summaryrefslogtreecommitdiff
path: root/drivers/staging/wfx
AgeCommit message (Collapse)Author
2020-09-13staging: wfx: simplify hif_set_association_mode()Jérôme Pouiller
The file hif_tx_mib.c expects to contain functions that format messages for the hardware. It is unexpected to find function that manipulate RCU and structures from mac80211. Keep hif_set_association_mode() with the code necessary for message formatting and relocate the smart part in wfx_join_finalize(). Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200907101521.66082-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-13staging: wfx: relocate wfx_join() beside wfx_join_finalize()Jérôme Pouiller
wfx_join() and wfx_join_finalize() are the two halves of the association process. Group them. In addition, for better uniformity of the code, rename wfx_do_join() in wfx_join(). Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200907101521.66082-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-13staging: wfx: improve readability of association processingJérôme Pouiller
The statements in wfx_bss_info_changed() has no particular order. For better readability, group and sort the statements relative to the association processing. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200907101521.66082-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-28staging: wfx: add workaround for 'timeout while wake up chip'Jérôme Pouiller
The host and the device can be connected with a called Wake-Up GPIO. When the host fall down this GPIO, it allows the device to enter in deep sleep and no communication with the device is no more possible (the device wakes up automatically on DTIM and fetch data if necessary). So, before to communicate with the device, the driver have to raise the Wake-up GPIO and then wait for an IRQ from the device. Unfortunately, old firmwares have a race in sleep/wake-up process and the device may never wake up. In this case, the IRQ is not sent and driver complains with "timeout while wake up chip". Then, the driver tries anyway to access the bus and an other error is raised by the bus. Fortunately, when the bug occurs, it is possible to fall down the IRQ and the device will eventually finish the sleep process. Then the driver can wake it up normally. The patch implements that workaround and add a retry limit in case something goes very wrong. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200825085828.399505-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-28staging: wfx: remove useless extra jiffyJérôme Pouiller
The initial developer has feared msecs_to_jiffies() could round down the result. However, the documentation of msecs_to_jiffies() says that the result is rounded upward. So the increment of the result of msecs_to_jiffies() is not necessary. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200825085828.399505-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-28staging: wfx: enable powersave on probeJérôme Pouiller
In the old days, ieee80211 powersave has some impact on the Rx speed. These problems are solved for a long time now. There is no more reason to not enabling it. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200825085828.399505-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-28staging: wfx: scan while AP is supportedJérôme Pouiller
The device is able to scan while running an Access Point. Just declare it. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200825085828.399505-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-28staging: wfx: fix potential use before initJérôme Pouiller
The trace below can appear: [83613.832200] INFO: trying to register non-static key. [83613.837248] the code is fine but needs lockdep annotation. [83613.842808] turning off the locking correctness validator. [83613.848375] CPU: 3 PID: 141 Comm: kworker/3:2H Tainted: G O 5.6.13-silabs15 #2 [83613.857019] Hardware name: BCM2835 [83613.860605] Workqueue: events_highpri bh_work [wfx] [83613.865552] Backtrace: [83613.868041] [<c010f2cc>] (dump_backtrace) from [<c010f7b8>] (show_stack+0x20/0x24) [83613.881463] [<c010f798>] (show_stack) from [<c0d82138>] (dump_stack+0xe8/0x114) [83613.888882] [<c0d82050>] (dump_stack) from [<c01a02ec>] (register_lock_class+0x748/0x768) [83613.905035] [<c019fba4>] (register_lock_class) from [<c019da04>] (__lock_acquire+0x88/0x13dc) [83613.924192] [<c019d97c>] (__lock_acquire) from [<c019f6a4>] (lock_acquire+0xe8/0x274) [83613.942644] [<c019f5bc>] (lock_acquire) from [<c0daa5dc>] (_raw_spin_lock_irqsave+0x58/0x6c) [83613.961714] [<c0daa584>] (_raw_spin_lock_irqsave) from [<c0ab3248>] (skb_dequeue+0x24/0x78) [83613.974967] [<c0ab3224>] (skb_dequeue) from [<bf330db0>] (wfx_tx_queues_get+0x96c/0x1294 [wfx]) [83613.989728] [<bf330444>] (wfx_tx_queues_get [wfx]) from [<bf320454>] (bh_work+0x454/0x26d8 [wfx]) [83614.009337] [<bf320000>] (bh_work [wfx]) from [<c014c920>] (process_one_work+0x23c/0x7ec) [83614.028141] [<c014c6e4>] (process_one_work) from [<c014cf1c>] (worker_thread+0x4c/0x55c) [83614.046861] [<c014ced0>] (worker_thread) from [<c0154c04>] (kthread+0x138/0x168) [83614.064876] [<c0154acc>] (kthread) from [<c01010b4>] (ret_from_fork+0x14/0x20) [83614.072200] Exception stack(0xecad3fb0 to 0xecad3ff8) [83614.077323] 3fa0: 00000000 00000000 00000000 00000000 [83614.085620] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [83614.093914] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 Indeed, the code of wfx_add_interface() shows that the interface is enabled to early. So, the spinlock associated with some skb_queue may not yet initialized when wfx_tx_queues_get() is called. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200825085828.399505-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-28staging: wfx: fix frame reorderingJérôme Pouiller
When mac80211 debug is enabled, the trace below appears: [60744.340037] wlan0: Rx A-MPDU request on aa:bb:cc:97:60:24 tid 0 result -524 This imply that ___ieee80211_start_rx_ba_session will prematurely exit and frame reordering won't be enabled. Fixes: e5da5fbd77411 ("staging: wfx: fix CCMP/TKIP replay protection") Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200825085828.399505-7-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-08-28staging: wfx: fix support for cipher AES_CMAC (multicast PMF)Jérôme Pouiller
When MFP is enabled, the multicast management frames are not protected, in fact. Instead, but they should include an IE containing the MMIC of the frames (i.e. a cryptographic signature). Until now, the driver didn't correctly detect this kind of frames (they are not marked protected but they are associated to a key) and didn't ask to the device to encrypt them. In add, the device is not able to generate the IE itself. Mac80211 has to generate the IE and let the device compute the MMIC. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200825085828.399505-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-28staging: wfx: fix spaces around binary operatorsJérôme Pouiller
A binary operator should be followed by exactly one space. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200825085828.399505-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-28staging: wfx: fix BA when MFP is disabled but BSS is MFP capableJérôme Pouiller
The protection of the management frames is mainly done by mac80211. However, frames for the management of the BlockAck sessions are directly sent by the device. These frames have to be protected if MFP is in use. So the driver has to pass the MFP configuration to the device. Until now, the driver directly read the RSN IE of the BSS. However, it didn't work when the BSS was MFP capable (ieee80211w=1) and the local device has disabled MFP (ieee80211w=0). This patch read the MFP information directly from the struct ieee80211_sta. This information take into account the MFP negotiated during the association. In addition, the code is far simpler. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200825085828.399505-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-28staging: wfx: improve usage of hif_map_link()Jérôme Pouiller
Until now, hif_map_link() get as argument the raw value for map_link_flags when map_link_flags is defined as a bitfield. It was error prone. Now hif_map_link() takes explicit value for every flags of the struct map_link_flags. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200825085828.399505-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-28staging: wfx: fix BA when device is AP and MFP is enabledJérôme Pouiller
The protection of the management frames is mainly done by mac80211. However, frames for the management of the BlockAck sessions are directly sent by the device. These frames have to be protected if MFP is in use. So the driver has to pass the MFP configuration to the device. Until now, the BlockAck management frames were completely unprotected whatever the status of the MFP negotiation. So, some devices dropped these frames. The device has two knobs to control the MFP. One global and one per station. Normally, the driver should always enable global MFP. Then it should enable MFP on every station with which MFP was successfully negotiated. Unfortunately, the older firmwares only provide the global control. So, this patch enable global MFP as it is exposed in the beacon. Then it marks every station with which the MFP is effective. Thus, the support for the old firmwares is not so bad. It may only encounter some difficulties to negotiate BA sessions when the local device (the AP) is MFP capable (ieee80211w=1) but the station is not. The only solution for this case is to upgrade the firmware. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200825085828.399505-1-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-18staging: wfx: fix a handful of spelling mistakesColin Ian King
There are various spelling mistakes in comments and error messages. Fix these. Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200806104701.46123-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-18staging: wfx: clear alignment style issuesTomer Samara
Clear checkpatch alignment style issues in debug.c. CHECK: Alignment should match open parenthesis Signed-off-by: Tomer Samara <tomersamara98@gmail.com> Link: https://lore.kernel.org/r/20200802150157.GA3052@tsnow Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-30staging: wfx: Use flex_array_size() helper in memcpy()Gustavo A. R. Silva
Make use of the flex_array_size() helper to calculate the size of a flexible array member within an enclosing structure. This helper offers defense-in-depth against potential integer overflows, while at the same time makes it explicitly clear that we are dealing with a flexible array member. Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/20200729233557.GA17693@embeddedor Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-28staging: wfx: Remove unnecessary return variableSumera Priyadarsini
Remove redundant variable in file fwio.c used for returning value. Issue was found using Coccinelle: @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com> Link: https://lore.kernel.org/r/20200726130720.12993-1-sylphrenadin@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-10staging: wfx: Get descriptors for GPIOsLinus Walleij
The code has the functionality to insert the GPIO lines using the global GPIO numbers through module parameters. As we are clearly deprecating the use of global GPIO numbers look up the GPIO descriptors from the device instead. This usually falls back to device hardware descriptions using e.g. device tree or ACPI. This device clearly supports device tree when used over SPI for example. For example, this can be supplied in the device tree like so: wfx@0x01 { compatible = "silabs,wf200"; reset-gpios = <&gpio0 1>; wakeup-gpios = <&gpio0 2>; }; Cc: Jérôme Pouiller <jerome.pouiller@silabs.com> Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20200703130756.514868-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-10staging: wfx: fix uninitialized variable bytes_doneColin Ian King
The variable bytes_done is not initialized and hence the first FIFO size check on bytes_done may be breaking prematurely from the loop if bytes_done contains a large bogus uninitialized value. Fix this by initializing bytes_done to zero. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: a9408ad79ff3 ("staging: wfx: load the firmware faster") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200706132017.487627-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03staging: wfx: always enable FastPs in combo with new firmwaresJérôme Pouiller
When multiple interface on different channels are in use. It is necessary to advertise the AP that the device is no more awake before to switch to the other channel. Until now, PS-Poll was the preferred mechanism for that. However. The new firmwares (>= 3.7) now nicely support FastPS. FastPS improves bandwidth and compatibility with AP. This patch drop the complex and rarely used mechanism introduced in the commit dd5eba1bb5b4f ("staging: wfx: fix support for AP that do not support PS-Poll") and use FastPS as soon as it is possible. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200701150707.222985-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03staging: wfx: add a debugfs entry to force ps_timeoutJérôme Pouiller
In some advanced usage or debug scenarios, it could interesting to change the value of ps_timeout or eventually to force use of PS-Poll frames. The wext API (used by iwconfig) provide a way to change ps_timeout. However, this API is obsolete and it seems a little weird to use (it seems it does apply the change, so the user have to disable then re-enable de power save) On side of nl80211, there is no way to change the ps_timeout. This patch provides a file in debugfs to change the value of ps_timeout. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200701150707.222985-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03staging: wfx: fix CCMP/TKIP replay protectionJérôme Pouiller
To enable the TKIP/CCMP replay protection, the frames has to be processed in the right order. However, the device is not able to re-order the frames during BlockAck sessions. Mac80211 is able to reorder the frames, but it need the information about the BlockAck sessions start and stop. Unfortunately, since the BlockAck is fully handled by the hardware, these frames were not forwarded to the host. So, if the driver ask to mac80211 to apply the replay protection, it drop all misordered frames. So, until now, the driver explicitly asked to mac80211 to not apply the CCMP/TKIP replay protection. The situation has changed with the API 3.4 of the device firmware. The firmware forward the BlockAck information. Mac80211 is now able to correctly reorder the frames. There is no more reasons to drop cryptographic data. This patch also impact the older firmwares. There will be a performance impact on these firmware (since the misordered frames will dropped). However, we can't keep the replay protection disabled. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200701150707.222985-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03staging: wfx: simplify handling of encrypted framesJérôme Pouiller
We don't want mac80211 try to check MMIC and other security mechanisms. So, the driver remove all the data related to the encryption (IV, ICV, MMIC). However, enabling RX_FLAG_PN_VALIDATED is sufficient for that. So, drop the useless function wfx_drop_encrypt_data() and enable RX_FLAG_PN_VALIDATED. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200701150707.222985-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03staging: wfx: fix handling of frames without RSSI dataJérôme Pouiller
It seems that in the old days, the RSSI information could be missing. In this case, in order to not pollute the RSSI stats, the frame was dropped (!). It is far better to mark the frame with the flag RX_FLAG_NO_SIGNAL_VAL. In add, the problem seems now fixed in the firmware (at least, it has not been encountered with recent firmwares). Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200701150707.222985-10-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: fix unexpected calls to ieee80211_sta_set_buffered()Jérôme Pouiller
When a station go to sleep, the driver receive the status REQUEUE and forward this answer to mac80211. So, neither the driver, neither the hardware buffer the frames. So the call to ieee80211_sta_set_buffered is useless. In add, it seems that mac80211 does not expect to receive ieee80211_sta_set_buffered(false) after the station is asleep(). When the device send data to a station, the following sequence can be observed: - Mac80211 call wfx_sta_notify(awake). - The driver calls ieee80211_sta_set_buffered(true). Since the station is awake, its TIM is not set. - Mac80211 receive a power save notification from the station, so it calls wfx_sta_notify(asleep). - Then, since the driver has declared it has buffered some frames, the TIM of the station should be set. This action is delayed by mac80211. - The device also notice the station go to sleep. It replies the REQUEUE status for the buffered frames. The driver forward this status to mac80211. - There is no more frames in queues, so the driver call ieee80211_sta_set_buffered(false). - Mac80211 updates the TIM but since there is no frames buffered by the driver, it set the TIM for the station to 0. Anyway, correctly use the ieee80211_sta_set_buffered() API solves the problem. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200701150707.222985-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03staging: wfx: improve protection against malformed HIF messagesJérôme Pouiller
As discussed here[1], if a message was smaller than the size of the message header, it could be incorrectly processed. [1] https://lore.kernel.org/driverdev-devel/2302785.6C7ODC2LYm@pc-42/ Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200701150707.222985-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03staging: wfx: load the firmware fasterJérôme Pouiller
During the loading of the firmware, the WFX_DCA_GET register provide the number available bytes in the receiving buffer. It is not necessary to access to the WFX_DCA_GET after sent of each firmware fragment. This patch allows to send the firmware: - in 64ms instead of 130ms using SDIO bus - in 78ms instead of 115ms using SPI bus Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200701150707.222985-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03staging: wfx: add tracepoint "queues_stats"Jérôme Pouiller
It is useful to check which queue the driver choose to send to the hardware. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200701150707.222985-5-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-07-03staging: wfx: check the vif ID of the Tx confirmationsJérôme Pouiller
When the driver has sent a frame on a virtual interface (vif), it expects to receive the confirmation on the same vif. This patch add a check for that. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200701150707.222985-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-03staging: wfx: associate tx_queues to vifsJérôme Pouiller
The device handles 4 queues (one per AC) for each virtual interface (and maximum 4 virtual interfaces). Until now the driver unified the queue of all interfaces and handled only 4 queues for whole device. This architecture did not allow to balance the traffic between the vif. So, this patch relocate the queues into the vif and change the API accordingly. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200701150707.222985-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-29Merge 5.8-rc3 into staging-nextGreg Kroah-Hartman
We want the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-16staging: wfx: make methods 'wfx_get_ps_timeout' and 'wfx_update_pm' staticJulius Hemanth Pitti
Add "static" for local methods wfx_get_ps_timeout() and wfx_update_pm() to address following sparse warnings. wfx/sta.c:203:5: warning: symbol 'wfx_get_ps_timeout' was not declared. Should it be static? wfx/sta.c:233:5: warning: symbol 'wfx_update_pm' was not declared. Should it be static? Signed-off-by: Julius Hemanth Pitti <juliushemanth@gmail.com> Link: https://lore.kernel.org/r/1591737854-11855-1-git-send-email-juliushemanth@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-16staging: wfx: fix coherency of hif_scan() prototypeJérôme Pouiller
The function hif_scan() return the timeout for the completion of the scan request. It is the only function from hif_tx.c that return another thing than just an error code. This behavior is not coherent with the rest of file. Worse, if value returned is positive, the caller can't make say if it is a timeout or the value returned by the hardware. Uniformize API with other HIF functions, only return the error code and pass timeout with parameters. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200529121256.1045521-1-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-16staging: wfx: drop useless loopJérôme Pouiller
It is guarantee that the loop will stop at first iteration. So drop the loop. Fixes: 6bf418c50f98a ("staging: wfx: change the way to choose frame to send") Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200529121603.1050891-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-16staging: wfx: fix AC priorityJérôme Pouiller
In order to work properly all the queues of the device must be filled (the device chooses itself the queue to use depending of AC parameters and other things). It is the job of wfx_tx_queues_get_skb() to choose which queue must be filled. However, the sorting algorithm was inverted, so it prioritized the already filled queue! Consequently, the AC priorities was badly broken. Fixes: 6bf418c50f98a ("staging: wfx: change the way to choose frame to send") Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200529121603.1050891-1-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-27staging: wfx: split wfx_get_ps_timeout() from wfx_update_pm()Jérôme Pouiller
In the next commit, we will have to compute the PS timeout without changing the power save status of the device. This patch introduces wfx_get_ps_timeout() for that job and make wfx_update_pm() relies on it. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200526171821.934581-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-27staging: wfx: retrieve the PS status from the vifJérôme Pouiller
The Power Save status is stored for each virtual interface and for the whole device. The WF200 is able to handle power saving per interface, so use the value stored in vif. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200526171821.934581-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-27staging: wfx: add support for tx_power_loopJérôme Pouiller
During the calibration of the RF amplifier, the device is able to provide some data about the status of the amplifier. Record these data and expose them in debugfs. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200526171821.934581-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-27staging: wfx: drop unused function wfx_pending_requeue()Jérôme Pouiller
The function wfx_pending_requeue() is not used anymore since the commit 7a44644c9379e ("staging: wfx: introduce wfx_set_default_unicast_key()") Fixes: 7a44644c9379e ("staging: wfx: introduce wfx_set_default_unicast_key()") Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200526171821.934581-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-27staging: wfx: do not declare variables inside loopsJérôme Pouiller
The local variables should be declared at beginning of the functions. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200526171821.934581-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-27staging: wfx: drop unused variableJérôme Pouiller
Since the commit 3f84adfe1d7ae ("staging: wfx: remove hack about tx_rate policies"), the variable "count" is no more used in wfx_tx_policy_build(). Notice that there were two instances of the variable "count" in wfx_tx_policy_build(). This patch also solves this cosmetic issue. Reported-by: kbuild test robot <lkp@intel.com> Fixes: 3f84adfe1d7ae ("staging: wfx: remove hack about tx_rate policies") Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200526171821.934581-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-25Merge 5.7-rc7 into staging-nextGreg Kroah-Hartman
We need the staging/iio fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-19staging: wfx: Typo fixMohamed Dawod
Fixing some typo errors in traces.h file Signed-off-by: Mohamed Dawod <mhm.dawod@gmail.com> Link: https://lore.kernel.org/r/20200518062445.GA13044@dinux Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: remove false positive warningJérôme Pouiller
When a station is removed, the driver check that all the Tx frames were correctly sent. However, the station can be removed before all the Tx frames were acknowledged and a false positive warning can be emitted. The previous commit has added a trace when driver received an acknowledge for a non-existent station. It appear that these events are perfectly correlated and there is no leak. Now, the subject is perfectly understood. Remove the warning. Just keep a debug trace in case we have any doubt in the future. In the past, the subject has already been discussed here: https://lore.kernel.org/driverdev-devel/6287924.ghGFUMk3OD@pc-42/ Fixes: 4bbc6a3e7ad0 ("staging: wfx: make warning about pending frame less scary") Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-20-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: trace acknowledges not linked to any stationsJérôme Pouiller
Some resources are associated to the outgoing of the stations. To avoid any resource leaks. It is important to understand why an acknowledge is not associated to any station. Add a trace for that purpose. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-19-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: remove false-positive WARN()Jérôme Pouiller
The function wfx_tx_flush() wait for there is no more queued frames in hardware queue. Then, for the sanity, it checks that there is no more pending frame on any AC queue. However, there is a race here. It may happens that hardware queues are empty, but the counters of the AC queues are not yet updated. So, it may produce false-positive warning. The easiest way to solve the problem is just to remove the sanity check. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-18-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>