aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wfx
AgeCommit message (Collapse)Author
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>
2020-05-15staging: wfx: fix error reporting in wfx_start_ap()Jérôme Pouiller
If AP did not start, the error was not reported to mac80211. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-17-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: drop unnecessary filter configuration when disabling filterJérôme Pouiller
Currently, when mac80211 want to disable beacon filtering, the driver reset the filter table and disable the beacon filtering. Only the latter action is required. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-16-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: fix PS parameters when multiple vif are in useJérôme Pouiller
When multiple vif are in use (= one access point and one station), and when the channels are different, it is necessary to enable power save on station. The firmware check that steps are done in the correct order: - AP can't start if PS is not enable on the station - PS can't set on the station before the association has finished (= before the call set_bss_params) Obviously, in add, when one of the interface disappears, it is necessary to restore the power save status. wfx_update_pm() is able to set the correct PS configuration. But it has to be called at the right time: 1. before hif_start(), but after the channel configuration is known 2. after hif_set_bss_params() 3. after hif_reset() Therefore, the call to wfx_update_pm() from wfx_add_interface() is too early to address 1. The call after hif_set_bss_params() already exists. For the symmetry, the call from wfx_remove_interface() (that handle 3.) is also relocated. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-15-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: fix potential dead lock between join and scanJérôme Pouiller
The device disallows to start a scan request between hif_join() and hif_set_bss_params(). The driver is not protected against that. The worst case happens when association is aborted and hif_set_bss_params() never happens. mac80211 would never ask for scan during the association process. So, this patch just aborts the association in progress when scan is requested. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: merge wfx_stop_ap() with wfx_reset()Jérôme Pouiller
wfx_stop_ap() and wfx_reset() do the same thing. Merge them. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: rename wfx_do_unjoin() into wfx_reset()Jérôme Pouiller
In fact, wfx_do_unjoin() resets the interface. This mechanism can be used in more cases than just disassociating from a BSS. So, rename it to reflect that fact. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: fix potential use-after-freeJérôme Pouiller
wfx_tx_policy_put() use data from the skb. However, the call to skb_pull() has just discarded them (even if the memory is in fact not really discarded). Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: call wfx_tx_update_sta() before to destroy tx_privJérôme Pouiller
The function wfx_notify_buffered_tx() need to know if the frame was associated to a station. This information is available in the Control Buffer (CB) of the skb. However, when wfx_notify_buffered_tx() is called, the CB is no more available. Thus, the caller has to take care of this information. wfx_notify_buffered_tx() is a specific case. All the other function are called before the destruction of the CB. So, this patch align the API of wfx_notify_buffered_tx() with the other functions. Call it before the CB was destroyed and drop the extra argument 'has_sta'. It is also the right time to rename it into wfx_tx_update_sta() (which is closer to the behavior of the function). Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: split out wfx_tx_fill_rates() from wfx_tx_confirm_cb()Jérôme Pouiller
wfx_tx_confirm_cb() is a big function. A big part of its body aims to fill the rates list. So, create a new function wfx_tx_fill_rates() and make wfx_tx_confirm_cb() smaller. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: fix status of dropped framesJérôme Pouiller
When wfx_flush() is called, the status of pending frames are reported to mac80211 with random status. mac80211 probably won't interpret this status in this case, but it is cleaner to return a correctly initialized status. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: fix indentationJérôme Pouiller
Fix indention of wfx_skb_dtor(). Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: fix value of scan timeoutJérôme Pouiller
Before to start the scan request, the firmware signals (with a null frame) to the AP it won't be able to receive data. This frame can be long to send: up to 512TU. The current calculus of the scan timeout does not take into account this delay. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: check pointers returned by allocationsJérôme Pouiller
Until now, the driver did not always check if the allocations success. The issue was discussed here: https://lore.kernel.org/netdev/2026476.QLiXXEGFCf@pc-42/ Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: apply 80-columns rule to stringsJérôme Pouiller
Strings are allowed to exceed 80 columns but, in this case, the format arguments should be placed on a new line. Apply this rule to the whole code of the driver. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15staging: wfx: fix warning when unregister a frozen deviceJérôme Pouiller
The device does not answer to the command hif_shutdown. Therefore, hif_shutdown() is a bit special. It bypasses some of work normally made by wfx_cmd_send(). In particularly, it unlock hif_cmd.lock and hif_cmd.key_renew_lock. However, if the driver notice that the device is frozen, wfx_cmd_send() stops to send data and doesn't lock the mutexes. Then, it produced a warning when hif_shutdown() tried to unlock these mutexes. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: unlock on error pathDan Carpenter
We need to release the tx_lock on the error path before returning. Fixes: d1c015b4ef6f ("staging: wfx: rewrite wfx_hw_scan()") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable <stable@vger.kernel.org> Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512083656.GA251760@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: update TODOJérôme Pouiller
Update the TODO list associated to the wfx driver with the last progresses. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-18-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix endianness of the field 'channel_number'Jérôme Pouiller
The field 'channel_number' from the structs hif_ind_rx and hif_req_start is a __le32. Sparse complains this field is not always correctly accessed: drivers/staging/wfx/data_rx.c:95:55: warning: incorrect type in argument 1 (different base types) drivers/staging/wfx/data_rx.c:95:55: expected int chan drivers/staging/wfx/data_rx.c:95:55: got restricted __le16 const [usertype] channel_number However, the value of channel_number cannot be greater than 14 (this device only support 2.4Ghz band). So, we only have to access to the least significant byte. It is finally easier to declare it as an array of bytes and only access to the first one. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-17-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix endianness of the field 'num_tx_confs'Jérôme Pouiller
The field 'num_tx_confs' from the struct hif_cnf_multi_transmit is a __le32. Sparse complains this field is not always correctly accessed: drivers/staging/wfx/hif_rx.c:82:9: warning: restricted __le32 degrades to integer drivers/staging/wfx/hif_rx.c:87:29: warning: restricted __le32 degrades to integer However, the value of num_tx_confs cannot be greater than 15. So, we only have to access to the least significant byte. It is finally easier to declare it as an array of bytes and only access to the first one. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-16-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix endianness of the field 'status'Jérôme Pouiller
The field 'status' appears in most of structs returned by the hardware. This field is encoded as little endian. Sparse complains this field is not always correctly accessed: drivers/staging/wfx/data_rx.c:53:16: warning: restricted __le32 degrades to integer drivers/staging/wfx/data_rx.c:84:16: warning: restricted __le32 degrades to integer drivers/staging/wfx/data_tx.c:526:24: warning: restricted __le32 degrades to integer drivers/staging/wfx/data_tx.c:569:23: warning: restricted __le32 degrades to integer drivers/staging/wfx/hif_rx.c:128:33: warning: restricted __le32 degrades to integer drivers/staging/wfx/./traces.h:401:1: warning: restricted __le32 degrades to integer drivers/staging/wfx/./traces.h:401:1: warning: restricted __le32 degrades to integer In most of cases, this field is only compared with HIF_STATUS values. Finally, it is more convenient to solve the problem by defining the HIF_STATUS values directly in little endian. It is also the right time to make some clean up in the HIF_STATUS names. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-15-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix access to le32 attribute 'len'Jérôme Pouiller
Sparse complains about the accesses to the field 'len' from struct hif_msg: drivers/staging/wfx/bh.c:88:32: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:88:32: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:93:32: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:93:32: warning: cast to restricted __le16 drivers/staging/wfx/bh.c:93:32: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:121:25: warning: incorrect type in argument 2 (different base types) drivers/staging/wfx/bh.c:121:25: expected unsigned int len drivers/staging/wfx/bh.c:121:25: got restricted __le16 [usertype] len drivers/staging/wfx/hif_rx.c:27:22: warning: restricted __le16 degrades to integer drivers/staging/wfx/hif_rx.c:347:39: warning: incorrect type in argument 7 (different base types) drivers/staging/wfx/hif_rx.c:347:39: expected unsigned int [usertype] len drivers/staging/wfx/hif_rx.c:347:39: got restricted __le16 const [usertype] len drivers/staging/wfx/hif_rx.c:365:39: warning: incorrect type in argument 7 (different base types) drivers/staging/wfx/hif_rx.c:365:39: expected unsigned int [usertype] len drivers/staging/wfx/hif_rx.c:365:39: got restricted __le16 const [usertype] len drivers/staging/wfx/./traces.h:195:1: warning: incorrect type in assignment (different base types) drivers/staging/wfx/./traces.h:195:1: expected int msg_len drivers/staging/wfx/./traces.h:195:1: got restricted __le16 const [usertype] len drivers/staging/wfx/./traces.h:195:1: warning: incorrect type in assignment (different base types) drivers/staging/wfx/./traces.h:195:1: expected int msg_len drivers/staging/wfx/./traces.h:195:1: got restricted __le16 const [usertype] len drivers/staging/wfx/debug.c:319:20: warning: restricted __le16 degrades to integer drivers/staging/wfx/secure_link.c:85:27: warning: restricted __le16 degrades to integer drivers/staging/wfx/secure_link.c:85:27: warning: restricted __le16 degrades to integer Indeed, the attribute len is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix endianness of the struct hif_ind_startupJérôme Pouiller
The struct hif_ind_startup is received from the hardware. So it is declared as little endian. However, it is also stored in the main driver structure and used on different places in the driver. Sparse complains about that: drivers/staging/wfx/data_tx.c:388:43: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:199:9: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:221:62: warning: restricted __le16 degrades to integer In order to make Sparse happy and to keep access from the driver easy, this patch declare hif_ind_startup with native endianness. On reception of this struct, this patch takes care to do byte-swap and keep Sparse happy. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: declare the field 'packet_id' with native byte orderJérôme Pouiller
The field packet_id is not interpreted by the device. It is only used as identifier for the device answer. So it is not necessary to declare it little endian. It fixes some warnings raised by Sparse without complexifying the code. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix access to le32 attribute 'indication_type'Jérôme Pouiller
The attribute indication_type is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix access to le32 attribute 'event_id'Jérôme Pouiller
The attribute event_id is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix access to le32 attribute 'ps_mode_error'Jérôme Pouiller
The attribute ps_mode_error is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix endianness of hif_req_read_mib fieldsJérôme Pouiller
The structs hif_{req,cnf}_read_mib contain only little endian values. Thus, it is necessary to fix byte ordering before to use them. Especially, sparse detected wrong accesses to fields mib_id and length. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-8-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix endianness of fields media_delay and tx_queue_delayJérôme Pouiller
The struct hif_cnf_tx contains only little endian values. Thus, it is necessary to fix byte ordering before to use them. Especially, sparse detected wrong access to fields media_delay and tx_queue_delay. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix output of rx_stats on big endian hostsJérôme Pouiller
The struct hif_rx_stats contains only little endian values. Thus, it is necessary to fix byte ordering before to use them. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix wrong bytes orderJérôme Pouiller
The field wakeup_period_max from struct hif_mib_beacon_wake_up_period is a u8. So, assigning it a __le16 produces a nasty bug on big-endian architectures. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix cast operatorJérôme Pouiller
Sparse detects that le16_to_cpup() expects a __le16 * as argument. Change the cast operator to be compliant with sparse. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: take advantage of le32_to_cpup()Jérôme Pouiller
le32_to_cpu(*x) can be advantageously converted in le32_to_cpup(x). Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-3-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix use of cpu_to_le32 instead of le32_to_cpuJérôme Pouiller
Sparse detected that le32_to_cpu should be used instead of cpu_to_le32. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200512150414.267198-2-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: use kernel types instead of c99 onesJérôme Pouiller
The kernel coding style promotes the use of kernel types (u8, u16, u32, etc...) instead of the C99 ones. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200505123757.39506-16-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: remove spaces after cast operatorJérôme Pouiller
The kernel coding style expects no space after cast operator. This patch make the wfx driver compliant with this rule. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200505123757.39506-15-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13staging: wfx: fix alignements of function prototypesJérôme Pouiller
Some function prototypes were not correctly aligned and/or exceed 80 columns. In some other cases, the prototypes were written on more lines than necessary. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200505123757.39506-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>