summaryrefslogtreecommitdiffstats
path: root/drivers/staging
AgeCommit message (Collapse)AuthorFilesLines
2020-04-13staging: wfx: drop useless update of macaddrJérôme Pouiller1-1/+0
Mac address is set in wfx_add_interface() and removed in wfx_remove_interface(). Currently, there is also an additional update of mac address in wfx_do_unjoin(). It has no rationale. Mac address is already present and nothing has changed it. Therefore, we can drop it. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-20-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: drop unused attribute 'beacon_int'Jérôme Pouiller2-6/+0
The field beacon_int is never read. Drop it. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-19-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: check value of beacon_intJérôme Pouiller1-0/+2
Firmware dislike when beacon_int value is 0. This patch add some warnings in case it would happen. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-18-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: re-enable BA after resetJérôme Pouiller1-8/+4
Firmware does not support Block Acks when multiple vif are running. Thus, wfx_add_interface() and wfx_remove_interface() enable and disable Block Acks as necessary. Block Ack policy is also reset after hif_reset(). Driver have to re-enable it after each call to hif_reset(). This patch reflects this behavior. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-17-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: introduce wfx_join_ibss() and wfx_leave_ibss()Jérôme Pouiller3-2/+21
Currently, IBSS networks are started by the mean of wfx_bss_info_changed(). It easier to use use callbacks provided by mac80211. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-16-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: allow to join IBSS networksJérôme Pouiller1-1/+1
Current code does not permit to join an already existing IBSS network. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-15-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: avoid duplicate updating of beacon templateJérôme Pouiller1-11/+1
When ERP changes, mac80211 call wfx_bss_info_changed() with BSS_CHANGED_ERP_* and with BSS_CHANGED_BEACON. The driver already update beacon template because of BSS_CHANGED_BEACON. It is not necessary to also update beacon template because of BSS_CHANGED_ERP_*. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: remove unnecessary conditions in wfx_bss_info_changed()Jérôme Pouiller1-4/+3
wfx_bss_info_changed() update ERP and CQM related stuff. Thus, it check the flags BSS_CHANGED_ERP_* and BSS_CHANGED_CQM. It also update ERP and CQM on join and leave by checking the flag BSS_CHANGED_ASSOC. This check is useless. Mac80211 already do that job and set necessary flags as expected. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: request to send beacons in IBSS modeJérôme Pouiller1-2/+1
Currently, firmware take in charge of start/stop sending beacons while in IBSS mode. However, this behavior may change in the further releases. Currently, asking to firmware to send beacon while in IBSS mode return an error but is harmless. Therefore, send this request unconditionally. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: drop unnecessary condition checks in wfx_upload_ap_templates()Jérôme Pouiller1-5/+0
In former code, wfx_upload_ap_templates() was called in more cases than necessary. Therefore, it tried to not update the frame templates if it was not necessary. Now, wfx_upload_ap_templates() is called only if mac80211 asked to update the templates. In add, it does not hurt to upload template if they are not used. So, remove unnecessary conditions at beginning of wfx_upload_ap_templates() Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: disabling keep alive during unjoin is uselessJérôme Pouiller1-1/+0
After a call to hif_reset(), the parameters associated with BSS are reset. So, it useless to explicitly reset the keep alive period. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: fix support for BSS_CHANGED_KEEP_ALIVEJérôme Pouiller1-1/+5
Chip firmware is able to send periodic null frames to keep the association with the AP. The driver arbitrary set this period to 30sec. We prefer to rely on BSS_CHANGED_KEEP_ALIVE that provide a true value. Note that if BSS_CHANGED_KEEP_ALIVE is not received, we just disable keep_alive feature. It is not very disturbing since AP will probably ping the station before to disconnect it. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: remove useless call to wfx_tx_flush()Jérôme Pouiller1-2/+0
wfx_do_join() calls wfx_tx_lock_flush() ate beginning of the function. Therefore, the subsequent call to wfx_tx_flush() is useless. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: change the way the station associate to an APJérôme Pouiller1-45/+17
Chipset need two steps to associate with an AP: 1. it start receiving beacon from the AP (done with wfx_do_join()) 2. it sent the association request (done with wfx_join_finalize()) The join request (see hif_join()) contains basic rates, beacon interval and bssid to connect, so we trig on these events for the first step. The second step is obviously associated to the event BSS_CHANGED_ASSOC. Note that conf_mutex is now easier to manage. It is held by wfx_bss_info_changed() and inner functions does not need to lock it. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: set all parameters before starting APJérôme Pouiller1-1/+1
Current code start AP and then configure the different parameters. Since all the configuration is sent quickly after AP started, it works. However, it is not very nice. In add, last firmware releases start to disallow incorrect settings. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: implement start_ap/stop_apJérôme Pouiller3-45/+30
Currently, wfx_bss_info_changed() check interface status changes and guess when the pattern match with an AP start and AP stop (through wfx_update_beaconing()). It is far easier to rely on start_ap and stop_ap callbacks provided by mac80211. wfx_bss_info_changed() keeps only the responsibility of updating the frame templates. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: call wfx_do_unjoin() synchronouslyJérôme Pouiller2-37/+12
Currently, wfx_do_unjoin() are called by the mean of work queues. However, the contexts from where they are called are not atomic. So there is no reason to not call it synchronously. This change will simplify the code. Notice two main changes: - There no more reason to lock tx queue before to run wfx_do_unjoin(). We can lock the tx queue directly from wfx_do_unjoin(). - Most of the time, wfx_do_unjoin_work() was called with conf_mutex held. This patch remove lock of conf_mutex in wfx_do_unjoin_work() and ensure that conf_mutex is always held whatever the context. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: reduce hold duration of cfg80211_bssJérôme Pouiller1-2/+1
Pointer to cfg80211_bss is held during all duration of wfx_do_join. But, it is not necessary, We can release it far earlier. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: fix race between configure_filter and remove_interfaceJérôme Pouiller2-2/+4
wfx_remove_interface() and wfx_configure_filter() can be run concurrently. Therefore, this patch protect access to the list of interfaces from wfx_configure_filter(). Notice that wfx_configure_filter() now lock "conf_lock" and "scan_lock". Beside that, wfx_hw_scan_work() also access to the same locks. So we have to lock them in same order to avoid any deadlock. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200410133239.438347-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: send just necessary bytesJérôme Pouiller2-2/+5
Size of hif_mib_template_frame must be sufficient to contains bytes declared by frame_length and cannot exceed 700bytes. Change the API to reflect that. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200406111756.154086-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: make hif_ie_table_entry constJérôme Pouiller3-5/+5
In wfx_update_filtering(), filter_ies is never modified. So, make it constant. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200406111756.154086-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: allow to connect an IBSS with an existing SSIDJérôme Pouiller1-1/+1
With current code, chip is not able to join an existing IBSS network. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200406111756.154086-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: place hif_tx_mib functions into a .c fileJérôme Pouiller6-391/+444
Until now, all functions from hif_tx_mib.h are declared "static inline". However, they are not time critical. So, it does not make so much sense. We prefer to place them in a .c file as for other hif functions. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200406111756.154086-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: align members declarations in hif APIJérôme Pouiller3-572/+572
Hardware API headers were not uniformly aligned. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200406111756.154086-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: fix endianness of hif APIJérôme Pouiller3-150/+150
The chip expects little endian in all structs it sends/receives. This patch fixes the hif API to reflect this fact. Sparse should now report meaningful errors. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200406111756.154086-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: remove useless definesJérôme Pouiller2-26/+12
Several values defined in hif API are only here to define length of some arrays. In most cases, they do not provide any extra information about the size of the array (ie. "API_FIRMWARE_LABEL_SIZE" is only used to define the size of member "firmware_label"). Remove these useless definitions. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200406111756.154086-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: remove unused definitions from the hif APIJérôme Pouiller3-263/+0
Until now, hif API was directly imported from firmware sources. However, it does not make sense to keep ton of unused structures in the driver. Moreover, the hif API is now stable enough to be keep in sync by importing delta from firmware. So, drop unused definitions from the hif API. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200406111756.154086-5-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 Pouiller3-11/+10
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: relocate LINK_ID_NO_ASSOC and MAX_STA_IN_AP_MODE to hif APIJérôme Pouiller5-6/+6
The definitions LINK_ID_NO_ASSOC and MAX_STA_IN_AP_MODE 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-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: drop unused WFX_LINK_ID_GC_TIMEOUTJérôme Pouiller1-1/+0
The definition WFX_LINK_ID_GC_TIMEOUT is not used anymore since commit d6aeba575f27 ("staging: wfx: simplify the link-id allocation") Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200406111756.154086-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: rtl8723bs: hal: Correct misspelled symbolic nameR Veera Kumar1-2/+2
Correct misspelled symbolic name. Misspelling found using checkpatch.pl. Signed-off-by: R Veera Kumar <vkor@vkten.in> Link: https://lore.kernel.org/r/b893adc31b71722df63d0756f0d360e27f896e51.1586187304.git.vkor@vkten.in Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: rtl8723bs: hal: Correct misspelt enum nameR Veera Kumar1-1/+1
Correct misspelt enum name. Misspelling found using checkpatch.pl. Signed-off-by: R Veera Kumar <vkor@vkten.in> Link: https://lore.kernel.org/r/d091fa95d537f613c24e55a2dee638d4493534b5.1586187304.git.vkor@vkten.in Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: rtl8723bs: Correct misspelt symbolic namesR Veera Kumar2-8/+8
Correct misspelt symbolic names. Misspelling found using checkpatch.pl. Signed-off-by: R Veera Kumar <vkor@vkten.in> Link: https://lore.kernel.org/r/abe807c11a5fda479ed6079a11d528989fe7b63e.1586187304.git.vkor@vkten.in Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: remove hack about tx_rate policiesJérôme Pouiller1-53/+0
Current code contains a weird hack to avoid switch from 54Mbps CTS to 1Mbps. However, we have not been able to reproduce the problem and hardware team don't know any defect of this kind. So, it seems this hack is no more necessary. 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-33-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: fix case where AP stop with CAB traffic pendingJérôme Pouiller1-1/+14
When driver has Content After DTIM Beacon (CAB) in queue, it wait for an indication from the firmware. However, when we stop to send beacons, this indication may never happen. Solve this issue by simply simulate this indication. Firmware will send data that probably nobody will heard. 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-32-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: fix potential deadlock in wfx_tx_flush()Jérôme Pouiller1-0/+2
wfx_tx_flush() wait there are no more frame in device buffer. However, this event may never happens since wfx_tx_flush() don't forbid to enqueue new frames. Note that wfx_tx_flush() should only ensure that all frames currently in hardware queues are sent. So the current code is more restrictive that it should. Note that wfx_tx_flush() release the lock before to return while wfx_tx_lock_flush() keep the lock. 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-31-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: wfx_flush() did not ensure that frames are processedJérôme Pouiller1-2/+2
wfx_flush() exited once all frames are retrieved from the device. However, it did not ensure they were processed by driver before to return. Therefore, some frame may be processed after the interface has disappear. Change the place we signal that the queue is empty to fix that. 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-30-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: repair wfx_flush()Jérôme Pouiller7-122/+113
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: relocate wfx_skb_dtor() prior its callersJérôme Pouiller1-35/+37
In a next commit, we would like to mark wfx_skb_dtor as static and stop to declare it in data_tx.h. Relocate wfx_skb_dtor() prior its callers to avoid compile error. 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-28-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: improve interface between data_tx.c and queue.cJérôme Pouiller3-17/+8
Currently, wfx_pending_remove() (from queue.c) call wfx_skb_dtor() (from data_tx.c) that forward the tx status to mac80211. Moreover, there no purpose to retrieve a frame from the pending queue without dequeuing it. So, the main purpose of wfx_pending_remove() is to forward the tx status to mac80211. Let's make the architecture cleaner: - merge wfx_pending_remove() into wfx_pending_get() - call wfx_skb_dtor() from data_tx.c 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-27-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: simplify usage of wfx_tx_queues_put()Jérôme Pouiller3-6/+5
The queue used for wfx_tx_queue_put() can be deducted from the content of the skb. So drop this parameter from call to wfx_tx_queues_put(). In add, this change uniformizes usage of functions wfx_tx_queues_*. 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-26-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: drop struct wfx_queue_statsJérôme Pouiller4-28/+18
There is no reason to keep the intermediate struct wfx_queue_stats. Relocate its members to struct wfx_dev. 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-25-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: drop now useless field edca_paramsJérôme Pouiller2-2/+0
Since we do not rely in QoS parameters to choose which frame to send, it is no more necessary to keep a copy of EDCA parameters. 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-24-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: change the way to choose frame to sendJérôme Pouiller2-143/+89
The current code computes itself the QoS policy to choose which frame should be sent. However, firmware already do that job. Firmware would prefer to have packets in every queues and be able to choose itself which queue to use. So, this patch sort the queues from the emptiest to the fulliest (thanks to the pending frames counter introduced a few commits earlier). It send frame to the least full queue. However, we continue to be careful with frames that have to be sent after a dtim ("cab": Content After (DTIM) Beacon). So, this patch splits AC queues in two skb_queues: one for normal frames and another for cab frames. It cares to send frames from CAB skb_queue if appropriate. 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-23-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: introduce a counter of pending framesJérôme Pouiller2-0/+17
This counter will be useful to know which queue is least full in a further patch. 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-22-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: replace wfx_tx_queues_get_after_dtim() by wfx_tx_queues_has_cab()Jérôme Pouiller3-23/+23
It is not necessary to return a skb. Just getting the information if there is traffic to be sent after DTIM is sufficient. In add, the acronym "cab" (Content After (DTIM) Beacon) is used in mac80211 to designate this kind of traffic. So, make wfx_tx_queues_get_after_dtim() return a boolean and rename accordingly. 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-21-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13staging: wfx: rename wfx_tx_get_raw_link_id()Jérôme Pouiller1-4/+3
Since concept of "raw_link_id" does not exist anymore, rename wfx_tx_get_raw_link_id() in wfx_tx_get_link_id(). 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-20-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 Pouiller2-3/+1
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 Pouiller3-8/+0
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-04-13staging: wfx: do not rely anymore on link_id to choose packet in queueJérôme Pouiller1-5/+6
link_id was expected to contain identifier of a station. It was also used to mark frames that has to sent after dtim. We do not use the further purpose. For the last purpose, we can directly check the flag value in tx_info. 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-17-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>