summaryrefslogtreecommitdiff
path: root/drivers/staging/wfx/data_tx.h
AgeCommit message (Collapse)Author
2022-04-06wfx: get out from the staging areaJérôme Pouiller
The wfx driver is now mature enough to leave the staging area. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Signed-off-by: Kalle Valo <kvalo@kernel.org>
2022-01-25staging: wfx: reformat code on 100 columnsJérôme Pouiller
Until now, this driver was written in 80 columns style. However, since all the functions are prefixed with "wfx_", this constraint is no more respected in the last patches. From the perspective of kernel Coding Style, it is not a problem since it is now allowed to write code on 100 columns. This patch just unify the code to use 100 columns. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20220113085524.1110708-21-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-25staging: wfx: prefix structs tx_policy and hwbus_ops with wfx_Jérôme Pouiller
All the types related to a driver should use the same prefix. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20220113085524.1110708-20-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-25staging: wfx: prefix structs hif_* with wfx_Jérôme Pouiller
All the types related to a driver should use the same prefix. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20220113085524.1110708-19-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-14staging: wfx: remove useless comments after #endifJérôme Pouiller
Comments after the last #endif of header files don't bring any information and are redundant with the name of the file. Drop them. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20210913130203.1903622-30-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-14staging: wfx: avoid c99 commentsJérôme Pouiller
The wfx driver is a network driver. C99 comments are prohibited in this part of the kernel. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20210913130203.1903622-28-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-14staging: wfx: update files descriptionsJérôme Pouiller
Each file of the driver contains a short description of its purpose. These description were a bit outdated. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20210913130203.1903622-26-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10Revert "staging: wfx: remove unused included header files"Greg Kroah-Hartman
This reverts commit 314fd52f01ead9528a5cda5a868425bb736d93a2. It turns .h files into non-stand-alone when building, which might cause problems in the long-run. Reported-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Cc: Muhammad Usama Anjum <musamaanjum@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-12staging: wfx: remove unused included header filesMuhammad Usama Anjum
Many header files have been included, but never used. Those header files have been removed. Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com> Link: https://lore.kernel.org/r/20210211143637.GA177425@LEGION Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-08staging: wfx: fix possible panic with re-queued framesJérôme Pouiller
When the firmware rejects a frame (because station become asleep or disconnected), the frame is re-queued in mac80211. However, the re-queued frame was 8 bytes longer than the original one (the size of the ICV for the encryption). So, when mac80211 try to send this frame again, it is a little bigger than expected. If the frame is re-queued secveral time it end with a skb_over_panic because the skb buffer is not large enough. Note it only happens when device acts as an AP and encryption is enabled. This patch more or less reverts the commit 049fde130419 ("staging: wfx: drop useless field from struct wfx_tx_priv"). Fixes: 049fde130419 ("staging: wfx: drop useless field from struct wfx_tx_priv") Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20210208135254.399964-1-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-07staging: wfx: update copyrights datesJérôme Pouiller
Most of the files have been modified in 2020, so update the copyright notices. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20201007101943.749898-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-28staging: wfx: drop useless field from struct wfx_tx_privJérôme Pouiller
The device need to receive a skb with necessary space for the ICV. So, the driver adds this space before to send the frame. Currently, once the frame is sent, the driver restore the original content of the skb. However, this step is useless. Mac80211 don't do it when software encryption is enabled. Once we have removed this step, it appears that it is no more necessary to keep hw_key in tx_priv. Then, it is possible to simplify a bunch of code in the Tx path. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200825085828.399505-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03staging: wfx: drop counter of buffered framesJérôme Pouiller
Since the driver does not call ieee80211_sta_set_buffered() anymore, it is no more necessary to maintain a counter of buffered frames for each stations. This change allows to simplify the processing in multiple places in the driver. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200701150707.222985-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03staging: wfx: correctly retrieve vif ID from Tx confirmationJérôme Pouiller
The device is able to send multiple Tx confirmations in the one reply. In this case, there is only one vif identifier for all the confirmations. Unfortunately, to generate this kind of messages the device squashes all the confirmations whatever their vif ID and use the vif ID of the first confirmation. So, the driver cannot rely on the vif ID mentioned in the header. Fortunately, using the packet_id, the driver can retrieve the Tx request and the associated vif. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200701150707.222985-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-28staging: wfx: fix the warning "inconsistent notification"Jérôme Pouiller
In some circumstances, Tx traffic is sent without associated station but the station exists when the Tx status is received. Beside that, the driver keep a counter associated to each station. So, in this case, the counter is not incremented, but is decremented. In this case a warning "inconsistent notification" appears: ------------[ cut here ]------------ WARNING: CPU: 3 PID: 82 at /home/jerome/wfx/data_tx.c:469 wfx_skb_dtor+0x1a4/0x1d4 [wfx] inconsistent notification Modules linked in: [...] CPU: 3 PID: 82 Comm: kworker/3:1H Tainted: G C O 4.19.57-v7l+ #1244 Hardware name: BCM2835 Workqueue: events_highpri bh_work [wfx] [<c0212c8c>] (unwind_backtrace) from [<c020d49c>] (show_stack+0x20/0x24) [<c020d49c>] (show_stack) from [<c0976220>] (dump_stack+0xd4/0x118) [<c0976220>] (dump_stack) from [<c0222270>] (__warn+0x104/0x11c) [<c0222270>] (__warn) from [<c02222e0>] (warn_slowpath_fmt+0x58/0x74) [<c02222e0>] (warn_slowpath_fmt) from [<bf497b48>] (wfx_skb_dtor+0x1a4/0x1d4 [wfx]) [<bf497b48>] (wfx_skb_dtor [wfx]) from [<bf4988b4>] (wfx_tx_confirm_cb+0x198/0x2f0 [wfx]) [<bf4988b4>] (wfx_tx_confirm_cb [wfx]) from [<bf49d054>] (hif_tx_confirm+0x50/0x70 [wfx]) [<bf49d054>] (hif_tx_confirm [wfx]) from [<bf49d42c>] (wfx_handle_rx+0x128/0x22c [wfx]) [<bf49d42c>] (wfx_handle_rx [wfx]) from [<bf4953cc>] (bh_work+0x3cc/0x964 [wfx]) [<bf4953cc>] (bh_work [wfx]) from [<c023dab8>] (process_one_work+0x170/0x458) [<c023dab8>] (process_one_work) from [<c023ddfc>] (worker_thread+0x5c/0x5a4) [<c023ddfc>] (worker_thread) from [<c02440e8>] (kthread+0x138/0x168) [<c02440e8>] (kthread) from [<c02010ac>] (ret_from_fork+0x14/0x28) Exception stack(0xee199fb0 to 0xee199ff8) 9fa0: 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace 64b9e754e12ef7de ]--- This patch fix this race between the station creation and the Tx data. Fixes: 7d2d2bfdeb82 ("staging: wfx: relocate "buffered" information to sta_priv") Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200427134031.323403-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: relocate TX_RETRY_POLICY_MAX and TX_RETRY_POLICY_INVALID to ↵Jérôme Pouiller
hif API The definitions TX_RETRY_POLICY_MAX and TX_RETRY_POLICY_INVALID are imposed by the hardware. Therefore, they should be located in the hardware interface API. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200406111756.154086-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: repair wfx_flush()Jérôme Pouiller
Until now, wfx_flush() flushed queue for while device instead of only the queue of the intended vif. It sometime failed with a timeout, but this error was not reported. Moreover, if the device was frozen, wfx_flush didn't do anything and it results a potential warning (and maybe a resource leak) when the frozen device was unregistered. We can also notice that wfx_tx_queues_wait_empty_vif() did only exist to work around the broken feature of wfx_flush(). This patch repair wfx_flush() and therefore drop wfx_tx_queues_wait_empty_vif(). Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200401110405.80282-29-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: drop unused raw_link_id fieldJérôme Pouiller
raw_link_id can be retrieved by wfx_tx_get_raw_link_id(). So, it is not necessary to keep it in struct wfx_tx_priv. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200401110405.80282-19-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: drop unused link_id fieldJérôme Pouiller
It is not used anymore. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200401110405.80282-18-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-11staging: wfx: data_tx.h: remove space after castKaaira Gupta
remove extra space after a cast in file data_tx.h Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in> Link: https://lore.kernel.org/r/20200310142509.25632-5-kgupta@es.iitr.ac.in Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16staging: wfx: replace wfx_tx_get_tid() with ieee80211_get_tid()Jérôme Pouiller
wfx_tx_get_tid() was used as a wrapper around ieee80211_get_tid(). It did sometime return WFX_MAX_TID to ask to upper layers to not include the frame in "buffered" counter. The objective of this behavior is not clear, but tests has shown that wfx_tx_get_tid() can be replaced by ieee80211_get_tid() without any regressions. BTW, it is not necessary to save the tid in tx_rpiv since it can be retrieved from the 802.11 header. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200115135338.14374-53-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16staging: wfx: simplify the link-id allocationJérôme Pouiller
The "link-id" is a slot number provided to the chip. A link-id is allocated to every station associated with the chip (mainly when the chip is in AP mode). It is more or less the same thing than the association ID, but it is limited to 14 values. Firmware uses the link-id to track the power save status of the stations. The current code try to associate a link-id as soon as data are exchanged with station. It is far easier to rely on sta_add() and sta_remove(). Until now the value WFX_LINK_ID_NO_ASSOC, was only used when no more link-id was available. Now, we also use this value for not-yet-associated stations (that was its primary behavior). Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200115135338.14374-51-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16staging: wfx: relocate "buffered" information to sta_privJérôme Pouiller
It simplify the code if field buffered is hosted in the struct sta_priv instead of in the struct wfx_link_entry. More globally, struct wfx_link_entry has no real reasons to exist and should be dropped soon. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200115135338.14374-47-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16staging: wfx: remove handling of "early_data"Jérôme Pouiller
It seems that purpose of "early_data" was to prevent sending data to mac80211 before station was completely associated. It is a useless precaution. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200115135338.14374-46-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-18staging: wfx: ensure that received hif messages are never modifiedJérôme Pouiller
There are no real reason to modify the data received from device. So, let's mark the arguments constant. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20191217161318.31402-23-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-18staging: wfx: use boolean appropriatelyJérôme Pouiller
The field 'uploaded' is used as a boolean, so call it a boolean. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20191217161318.31402-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-18staging: wfx: fix counter overflowJérôme Pouiller
Some weird behaviors were observed when connection is really good and packets are small. It appears that sometime, number of packets in queues can exceed 255 and generate an overflow in field usage_count. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20191217161318.31402-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-18staging: wfx: fix the cache of rate policies on interface resetJérôme Pouiller
Device and driver maintain a cache of rate policies (aka. tx_retry_policy in hardware API). When hif_reset() is sent to hardware, device resets its cache of rate policies. In order to keep driver in sync, it is necessary to do the same on driver. Note, when driver tries to use a rate policy that has not been defined on device, data is sent at 1Mbps. So, this patch should fix abnormal throughput observed sometime after a reset of the interface. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20191217161318.31402-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-11staging: wfx: replace uintXX_t to uXX and intXX_t to sXXJules Irenge
Replace uint8_t to u8, uint16_t to u16, uint32_t to u32 int8_t to s8,int16_t to s16 and int32_t to s32 As per recommendation of checkpatch tool. Signed-off-by: Jules Irenge <jbi.octave@gmail.com> Link: https://lore.kernel.org/r/20191111133055.214410-1-jbi.octave@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26staging: wfx: fix warnings of no space is necessaryJules Irenge
Fix warnings of no space is necessary after a cast. Issue detected by checkpatch tool. Signed-off-by: Jules Irenge <jbi.octave@gmail.com> Link: https://lore.kernel.org/r/20191019140719.2542-2-jbi.octave@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-08staging: wfx: avoid namespace contaminationJérôme Pouiller
tx_policy_init() was already defined in driver cw1200. So, compilation failed when wfx and cw1200 were both built-in. In order to keep a coherent naming scheme, this patch prefixes all "tx_policy_*" functions with "wfx_". Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20191008094232.10014-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-04staging: wfx: allow to send 802.11 framesJérôme Pouiller
Three things make this task more complex than it should: - Chip necessitate to associate a link-id to each station. It is same thing than association ID but, using 8 bits only. - Rate policy is sent separately from Tx frames - Driver try to handle itself power saving of stations and multicast data Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20190919142527.31797-17-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>