wfx: move out from the staging area
Subsystems (6)
Jerome Pouiller
maintainercover wfx: move out from the staging area
From: Jérôme Pouiller <[email protected]>
I think the wfx driver is now mature enough to be accepted in the drivers/net/wireless directory.
There is still one item on the TODO list. It is an idea to improve the rate control in some particular cases[1]. However, the current performances of the driver seem to satisfy everyone. In add, the suggested change is large enough. So, I would prefer to implement it only if it really solves an issue. I think it is not an obstacle to move the driver out of the staging area.
In order to comply with the last rules for the DT bindings, I have converted the documentation to yaml. I am moderately happy with the result. Especially, for the description of the binding. Any comments are welcome.
The series also update the copyrights dates of the files. I don't know exactly how this kind of changes should be sent. It's a bit weird to change all the copyrights in one commit, but I do not see any better way.
I also include a few fixes I have found these last weeks.
[1] https://lore.kernel.org/lkml/3099559.gv3Q75KnN1@pc-42
Jérôme Pouiller (7):
staging: wfx: fix handling of MMIC error
staging: wfx: remove remaining code of 'secure link' feature
staging: wfx: fix BA sessions for older firmwares
staging: wfx: fix QoS priority for slow buses
staging: wfx: update copyrights dates
dt-bindings: staging: wfx: silabs,wfx yaml conversion
wfx: move out from the staging area
.../bindings/net/wireless/silabs,wfx.yaml | 125 ++++++++++++++++++
MAINTAINERS | 2 +-
drivers/net/wireless/Kconfig | 1 +
drivers/net/wireless/Makefile | 1 +
drivers/net/wireless/silabs/Kconfig | 17 +++
drivers/net/wireless/silabs/Makefile | 3 +
.../wireless/silabs}/wfx/Kconfig | 0
.../wireless/silabs}/wfx/Makefile | 0
.../{staging => net/wireless/silabs}/wfx/bh.c | 2 +-
.../{staging => net/wireless/silabs}/wfx/bh.h | 2 +-
.../wireless/silabs}/wfx/bus.h | 2 +-
.../wireless/silabs}/wfx/bus_sdio.c | 2 +-
.../wireless/silabs}/wfx/bus_spi.c | 2 +-
.../wireless/silabs}/wfx/data_rx.c | 7 +-
.../wireless/silabs}/wfx/data_rx.h | 2 +-
.../wireless/silabs}/wfx/data_tx.c | 2 +-
.../wireless/silabs}/wfx/data_tx.h | 2 +-
.../wireless/silabs}/wfx/debug.c | 19 +--
.../wireless/silabs}/wfx/debug.h | 0
.../wireless/silabs}/wfx/fwio.c | 2 +-
.../wireless/silabs}/wfx/fwio.h | 0
.../wireless/silabs}/wfx/hif_api_cmd.h | 2 +-
.../wireless/silabs}/wfx/hif_api_general.h | 2 +-
.../wireless/silabs}/wfx/hif_api_mib.h | 2 +-
.../wireless/silabs}/wfx/hif_rx.c | 2 +-
.../wireless/silabs}/wfx/hif_rx.h | 0
.../wireless/silabs}/wfx/hif_tx.c | 2 +-
.../wireless/silabs}/wfx/hif_tx.h | 2 +-
.../wireless/silabs}/wfx/hif_tx_mib.c | 2 +-
.../wireless/silabs}/wfx/hif_tx_mib.h | 2 +-
.../wireless/silabs}/wfx/hwio.c | 2 +-
.../wireless/silabs}/wfx/hwio.h | 2 +-
.../wireless/silabs}/wfx/key.c | 2 +-
.../wireless/silabs}/wfx/key.h | 2 +-
.../wireless/silabs}/wfx/main.c | 2 +-
.../wireless/silabs}/wfx/main.h | 2 +-
.../wireless/silabs}/wfx/queue.c | 16 ++-
.../wireless/silabs}/wfx/queue.h | 3 +-
.../wireless/silabs}/wfx/scan.c | 2 +-
.../wireless/silabs}/wfx/scan.h | 2 +-
.../wireless/silabs}/wfx/sta.c | 2 +-
.../wireless/silabs}/wfx/sta.h | 2 +-
.../wireless/silabs}/wfx/traces.h | 2 +-
.../wireless/silabs}/wfx/wfx.h | 2 +-
drivers/staging/Kconfig | 2 -
drivers/staging/Makefile | 1 -
.../bindings/net/wireless/siliabs,wfx.txt | 98 --------------
drivers/staging/wfx/TODO | 6 -
48 files changed, 198 insertions(+), 161 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml
create mode 100644 drivers/net/wireless/silabs/Kconfig
create mode 100644 drivers/net/wireless/silabs/Makefile
rename drivers/{staging => net/wireless/silabs}/wfx/Kconfig (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/Makefile (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/bh.c (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/bh.h (92%)
rename drivers/{staging => net/wireless/silabs}/wfx/bus.h (94%)
rename drivers/{staging => net/wireless/silabs}/wfx/bus_sdio.c (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/bus_spi.c (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/data_rx.c (93%)
rename drivers/{staging => net/wireless/silabs}/wfx/data_rx.h (86%)
rename drivers/{staging => net/wireless/silabs}/wfx/data_tx.c (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/data_tx.h (96%)
rename drivers/{staging => net/wireless/silabs}/wfx/debug.c (94%)
rename drivers/{staging => net/wireless/silabs}/wfx/debug.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/fwio.c (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/fwio.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_api_cmd.h (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_api_general.h (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_api_mib.h (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_rx.c (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_rx.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_tx.c (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_tx.h (97%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_tx_mib.c (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_tx_mib.h (97%)
rename drivers/{staging => net/wireless/silabs}/wfx/hwio.c (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/hwio.h (98%)
rename drivers/{staging => net/wireless/silabs}/wfx/key.c (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/key.h (87%)
rename drivers/{staging => net/wireless/silabs}/wfx/main.c (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/main.h (95%)
rename drivers/{staging => net/wireless/silabs}/wfx/queue.c (93%)
rename drivers/{staging => net/wireless/silabs}/wfx/queue.h (94%)
rename drivers/{staging => net/wireless/silabs}/wfx/scan.c (98%)
rename drivers/{staging => net/wireless/silabs}/wfx/scan.h (90%)
rename drivers/{staging => net/wireless/silabs}/wfx/sta.c (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/sta.h (98%)
rename drivers/{staging => net/wireless/silabs}/wfx/traces.h (99%)
rename drivers/{staging => net/wireless/silabs}/wfx/wfx.h (98%)
delete mode 100644 drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt
delete mode 100644 drivers/staging/wfx/TODOSignature · 1 line
2.28.0
Jerome Pouiller
maintainerPATCH 1/7 staging: wfx: fix handling of MMIC error
From: Jérôme Pouiller <[email protected]>
As expected, when the device detect a MMIC error, it returns a specific status. However, it also strip IV from the frame (don't ask me why).
So, with the current code, mac80211 detects a corrupted frame and it drops it before it handle the MMIC error. The expected behavior would be to detect MMIC error then to renegotiate the EAP session.
So, this patch correctly informs mac80211 that IV is not available. So, mac80211 correctly takes into account the MMIC error.
--- drivers/staging/wfx/data_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wfx/data_rx.c +1 -1
@@ -41,7 +41,7 @@ void wfx_rx_cb(struct wfx_vif *wvif,memset (hdr,0 ,sizeof (*hdr));if (arg->status ==HIF_STATUS_RX_FAIL_MIC ) - hdr->flag |=RX_FLAG_MMIC_ERROR ; + hdr->flag |=RX_FLAG_MMIC_ERROR |RX_FLAG_IV_STRIPPED ;else if (arg->status) goto drop;
Signature · 1 line
2.28.0
Jerome Pouiller
maintainerPATCH 2/7 staging: wfx: remove remaining code of 'secure link' feature
In reply to Jerome PouillerFrom: Jérôme Pouiller <[email protected]>
Commit e8d607ce0c81 ("staging: wfx: drop 'secure link' feature") had removed the 'secure link' feature. However, a few lines of codes were yet here.
--- .../bindings/net/wireless/siliabs,wfx.txt | 2 -- drivers/staging/wfx/debug.c | 17 ----------------- 2 files changed, 19 deletions(-)
drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt +0 -2
@@ -90,8 +90,6 @@ Some properties are recognized either by SPI and SDIO versions: this property, driver will disable most of power saving features. - config-file: Use an alternative file as PDS. Default is `wf200.pds`. Only necessary for development/debug purpose. - - slk_key: String representing hexadecimal value of secure link key to use. - Must contains 64 hexadecimal digits. Not supported in current version. WFx driver also supports `mac-address` and `local-mac-address` as described in Documentation/devicetree/bindings/net/ethernet.txt
drivers/staging/wfx/debug.c +0 -17
@@ -230,21 +230,6 @@ static const struct file_operations wfx_send_pds_fops = { .write = wfx_send_pds_write, }; -static ssize_t wfx_burn_slk_key_write (struct file *file, -const char __user *user_buf, -size_t count,loff_t *ppos) -{ -struct wfx_dev *wdev = file->private_data; - -dev_info (wdev->dev,"this driver does not support secure link\n" ); -return -EINVAL ; -} - -static const struct file_operations wfx_burn_slk_key_fops = { - .open = simple_open, - .write = wfx_burn_slk_key_write, -}; -struct dbgfs_hif_msg {struct wfx_dev *wdev;struct completion complete;
@@ -366,8 +351,6 @@ int wfx_debug_init(struct wfx_dev *wdev)debugfs_create_file ("tx_power_loop" ,0444 , d, wdev, &wfx_tx_power_loop_fops);debugfs_create_file ("send_pds" ,0200 , d, wdev, &wfx_send_pds_fops); -debugfs_create_file ("burn_slk_key" ,0200 , d, wdev, - &wfx_burn_slk_key_fops);debugfs_create_file ("send_hif_msg" ,0600 , d, wdev, &wfx_send_hif_msg_fops);debugfs_create_file ("ps_timeout" ,0600 , d, wdev, &wfx_ps_timeout_fops);
Signature · 1 line
2.28.0
Jerome Pouiller
maintainerPATCH 3/7 staging: wfx: fix BA sessions for older firmwares
In reply to Jerome PouillerFrom: Jérôme Pouiller <[email protected]>
Firmwares with API < 3.6 do not forward DELBA requests. Thus, when a Block Ack session is restarted, the reordering buffer is not flushed and the received sequence number is not contiguous. Therefore, mac80211 starts to wait some missing frames that it will never receive.
This patch disables the reordering buffer for old firmware. It is harmless when the network is unencrypted. When the network is encrypted, the non-contiguous frames will be thrown away by the TKIP/CCMP replay protection. So, the user will observe some packet loss with UDP and performance drop with TCP.
--- drivers/staging/wfx/data_rx.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/staging/wfx/data_rx.c +3 -0
@@ -17,6 +17,9 @@ static void wfx_rx_handle_ba(struct wfx_vif *wvif, struct ieee80211_mgmt *mgmt) {int params, tid; +if (wfx_api_older_than (wvif->wdev,3 ,6 )) +return ; +switch (mgmt->u.action.u.addba_req.action_code) {case WLAN_ACTION_ADDBA_REQ : params =le16_to_cpu (mgmt->u.action.u.addba_req.capab);
Signature · 1 line
2.28.0
Jerome Pouiller
maintainerPATCH 4/7 staging: wfx: fix QoS priority for slow buses
In reply to Jerome PouillerFrom: Jérôme Pouiller <[email protected]>
The device is in charge of respecting the QoS constraints. The driver have to ensure that all the queues contain data and the device choose the right queue to send.
The things starts to be more difficult when the bandwidth of the bus is lower than the bandwidth of the WiFi. The device quickly sends the frames of the highest priority queue. Then, it starts to send frames from a lower priority queue. Though, there are still some high priority frames waiting in the driver.
To work around this problem, this patch add some priorities to each queue. The weigh of the queue was (roughly) calculated experimentally by checking the speed ratio of each queue when the bus does not limit the traffic:
- Be/Bk -> 20Mbps/10Mbps
- Vi/Be -> 36Mbps/180Kbps
- Vo/Be -> 35Mbps/600Kbps
- Vi/Vo -> 24Mbps/12Mbps
So, if we fix the weigh of the Background to 1, the weight of Best Effort should be 2. The weight of Video should be 116. However, since there is only 32 queues, it make no sense to use a value greater than 64[1]. And finally, the weight of the Voice is set to 128.
[1] Because of this approximation, with very slow bus, we can still observe frame starvation when we measure the speed ratio of Vi/Be. It is around 35Mbps/1Mbps (instead of 36Mbps/180Kbps). However, it is still in accepted error range.
--- drivers/staging/wfx/queue.c | 14 ++++++++++++-- drivers/staging/wfx/queue.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-)
drivers/staging/wfx/queue.c +12 -2
@@ -60,11 +60,16 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev)void wfx_tx_queues_init (struct wfx_vif *wvif) { +// The device is in charge to respect the details of the QoS parameters. +// The driver just ensure that it roughtly respect the priorities to +// avoid any shortage. +const int priorities[IEEE80211_NUM_ACS ] = {1 ,2 ,64 ,128 };int i;for (i =0 ; i <IEEE80211_NUM_ACS ; ++i) {skb_queue_head_init (&wvif->tx_queue[i].normal);skb_queue_head_init (&wvif->tx_queue[i].cab); + wvif->tx_queue[i].priority = priorities[i]; } }
@@ -219,6 +224,11 @@ bool wfx_tx_queues_has_cab(struct wfx_vif *wvif)return false; } +static int wfx_tx_queue_get_weight (struct wfx_queue *queue) +{ +return atomic_read (&queue->pending_frames) * queue->priority; +} +static struct sk_buff *wfx_tx_queues_get_skb (struct wfx_dev *wdev) {struct wfx_queue *queues[IEEE80211_NUM_ACS *ARRAY_SIZE (wdev->vif)];
@@ -234,8 +244,8 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev)WARN_ON (num_queues >=ARRAY_SIZE (queues)); queues[num_queues] = &wvif->tx_queue[i];for (j = num_queues; j >0 ; j--) -if (atomic_read (&queues[j]->pending_frames) < -atomic_read (&queues[j -1 ]->pending_frames)) +if (wfx_tx_queue_get_weight (queues[j]) < +wfx_tx_queue_get_weight (queues[j -1 ]))swap (queues[j -1 ], queues[j]); num_queues++; }
drivers/staging/wfx/queue.h +1 -0
@@ -18,6 +18,7 @@ struct wfx_queue {struct sk_buff_head normal;struct sk_buff_head cab;// Content After (DTIM) Beacon atomic_t pending_frames; +int priority; };void wfx_tx_lock (struct wfx_dev *wdev);
Signature · 1 line
2.28.0
Jerome Pouiller
maintainerPATCH 5/7 staging: wfx: update copyrights dates
In reply to Jerome PouillerFrom: Jérôme Pouiller <[email protected]>
Most of the files have been modified in 2020, so update the copyright notices.
--- drivers/staging/wfx/bh.c | 2 +- drivers/staging/wfx/bh.h | 2 +- drivers/staging/wfx/bus.h | 2 +- drivers/staging/wfx/bus_sdio.c | 2 +- drivers/staging/wfx/bus_spi.c | 2 +- drivers/staging/wfx/data_rx.c | 2 +- drivers/staging/wfx/data_rx.h | 2 +- drivers/staging/wfx/data_tx.c | 2 +- drivers/staging/wfx/data_tx.h | 2 +- drivers/staging/wfx/debug.c | 2 +- drivers/staging/wfx/fwio.c | 2 +- drivers/staging/wfx/hif_api_cmd.h | 2 +- drivers/staging/wfx/hif_api_general.h | 2 +- drivers/staging/wfx/hif_api_mib.h | 2 +- drivers/staging/wfx/hif_rx.c | 2 +- drivers/staging/wfx/hif_tx.c | 2 +- drivers/staging/wfx/hif_tx.h | 2 +- drivers/staging/wfx/hif_tx_mib.c | 2 +- drivers/staging/wfx/hif_tx_mib.h | 2 +- drivers/staging/wfx/hwio.c | 2 +- drivers/staging/wfx/hwio.h | 2 +- drivers/staging/wfx/key.c | 2 +- drivers/staging/wfx/key.h | 2 +- drivers/staging/wfx/main.c | 2 +- drivers/staging/wfx/main.h | 2 +- drivers/staging/wfx/queue.c | 2 +- drivers/staging/wfx/queue.h | 2 +- drivers/staging/wfx/scan.c | 2 +- drivers/staging/wfx/scan.h | 2 +- drivers/staging/wfx/sta.c | 2 +- drivers/staging/wfx/sta.h | 2 +- drivers/staging/wfx/traces.h | 2 +- drivers/staging/wfx/wfx.h | 2 +- 33 files changed, 33 insertions(+), 33 deletions(-)
drivers/staging/wfx/bh.c +1 -1
@@ -2,7 +2,7 @@/* * Interrupt bottom half (BH). * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #include <linux/gpio/consumer.h>
drivers/staging/wfx/bh.h +1 -1
@@ -2,7 +2,7 @@/* * Interrupt bottom half. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #ifndef WFX_BH_H
drivers/staging/wfx/bus.h +1 -1
@@ -2,7 +2,7 @@/* * Common bus abstraction layer. * -* Copyright (c) 2017-2018, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #ifndef WFX_BUS_H
drivers/staging/wfx/bus_sdio.c +1 -1
@@ -2,7 +2,7 @@/* * SDIO interface. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #include <linux/module.h>
drivers/staging/wfx/bus_spi.c +1 -1
@@ -2,7 +2,7 @@/* * SPI interface. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2011, Sagrad Inc. * Copyright (c) 2010, ST-Ericsson */
drivers/staging/wfx/data_rx.c +1 -1
@@ -2,7 +2,7 @@/* * Datapath implementation. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #include <linux/etherdevice.h>
drivers/staging/wfx/data_rx.h +1 -1
@@ -2,7 +2,7 @@/* * Datapath implementation. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #ifndef WFX_DATA_RX_H
drivers/staging/wfx/data_tx.c +1 -1
@@ -2,7 +2,7 @@/* * Datapath implementation. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #include <net/mac80211.h>
drivers/staging/wfx/data_tx.h +1 -1
@@ -2,7 +2,7 @@/* * Datapath implementation. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #ifndef WFX_DATA_TX_H
drivers/staging/wfx/debug.c +1 -1
@@ -2,7 +2,7 @@/* * Debugfs interface. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #include <linux/debugfs.h>
drivers/staging/wfx/fwio.c +1 -1
@@ -2,7 +2,7 @@/* * Firmware loading. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #include <linux/firmware.h>
drivers/staging/wfx/hif_api_cmd.h +1 -1
@@ -2,7 +2,7 @@/* * WFx hardware interface definitions * -* Copyright (c) 2018-2019, Silicon Laboratories Inc. +* Copyright (c) 2018-2020, Silicon Laboratories Inc. */ #ifndef WFX_HIF_API_CMD_H
drivers/staging/wfx/hif_api_general.h +1 -1
@@ -2,7 +2,7 @@/* * WFx hardware interface definitions * -* Copyright (c) 2018-2019, Silicon Laboratories Inc. +* Copyright (c) 2018-2020, Silicon Laboratories Inc. */ #ifndef WFX_HIF_API_GENERAL_H
drivers/staging/wfx/hif_api_mib.h +1 -1
@@ -2,7 +2,7 @@/* * WFx hardware interface definitions * -* Copyright (c) 2018-2019, Silicon Laboratories Inc. +* Copyright (c) 2018-2020, Silicon Laboratories Inc. */ #ifndef WFX_HIF_API_MIB_H
drivers/staging/wfx/hif_rx.c +1 -1
@@ -3,7 +3,7 @@* Implementation of chip-to-host event (aka indications) of WFxxx Split Mac * (WSM) API. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #include <linux/skbuff.h>
drivers/staging/wfx/hif_tx.c +1 -1
@@ -3,7 +3,7 @@* Implementation of host-to-chip commands (aka request/confirmation) of WFxxx * Split Mac (WSM) API. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #include <linux/etherdevice.h>
drivers/staging/wfx/hif_tx.h +1 -1
@@ -3,7 +3,7 @@* Implementation of host-to-chip commands (aka request/confirmation) of WFxxx * Split Mac (WSM) API. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson * Copyright (C) 2010, ST-Ericsson SA */
drivers/staging/wfx/hif_tx_mib.c +1 -1
@@ -2,7 +2,7 @@/* * Implementation of host-to-chip MIBs of WFxxx Split Mac (WSM) API. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson * Copyright (C) 2010, ST-Ericsson SA */
drivers/staging/wfx/hif_tx_mib.h +1 -1
@@ -2,7 +2,7 @@/* * Implementation of host-to-chip MIBs of WFxxx Split Mac (WSM) API. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson * Copyright (C) 2010, ST-Ericsson SA */
drivers/staging/wfx/hwio.c +1 -1
@@ -2,7 +2,7 @@/* * Low-level I/O functions. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #include <linux/kernel.h>
drivers/staging/wfx/hwio.h +1 -1
@@ -2,7 +2,7 @@/* * Low-level API. * -* Copyright (c) 2017-2018, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #ifndef WFX_HWIO_H
drivers/staging/wfx/key.c +1 -1
@@ -2,7 +2,7 @@/* * Key management related functions. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #include <linux/etherdevice.h>
drivers/staging/wfx/key.h +1 -1
@@ -2,7 +2,7 @@/* * Implementation of mac80211 API. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #ifndef WFX_KEY_H
drivers/staging/wfx/main.c +1 -1
@@ -2,7 +2,7 @@/* * Device probe and register. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson * Copyright (c) 2008, Johannes Berg <[email protected]> * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
drivers/staging/wfx/main.h +1 -1
@@ -2,7 +2,7 @@/* * Device probe and register. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson * Copyright (c) 2006, Michael Wu <[email protected]> * Copyright 2004-2006 Jean-Baptiste Note <[email protected]>, et al.
drivers/staging/wfx/queue.c +1 -1
@@ -2,7 +2,7 @@/* * O(1) TX queue with built-in allocator. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #include <linux/sched.h>
drivers/staging/wfx/queue.h +1 -1
@@ -2,7 +2,7 @@/* * O(1) TX queue with built-in allocator. * -* Copyright (c) 2017-2018, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #ifndef WFX_QUEUE_H
drivers/staging/wfx/scan.c +1 -1
@@ -2,7 +2,7 @@/* * Scan related functions. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #include <net/mac80211.h>
drivers/staging/wfx/scan.h +1 -1
@@ -2,7 +2,7 @@/* * Scan related functions. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #ifndef WFX_SCAN_H
drivers/staging/wfx/sta.c +1 -1
@@ -2,7 +2,7 @@/* * Implementation of mac80211 API. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #include <linux/etherdevice.h>
drivers/staging/wfx/sta.h +1 -1
@@ -2,7 +2,7 @@/* * Implementation of mac80211 API. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson */ #ifndef WFX_STA_H
drivers/staging/wfx/traces.h +1 -1
@@ -2,7 +2,7 @@/* * Tracepoints definitions. * -* Copyright (c) 2018-2019, Silicon Laboratories, Inc. +* Copyright (c) 2018-2020, Silicon Laboratories, Inc. */ #undef TRACE_SYSTEM
drivers/staging/wfx/wfx.h +1 -1
@@ -2,7 +2,7 @@/* * Common private data for Silicon Labs WFx chips. * -* Copyright (c) 2017-2019, Silicon Laboratories, Inc. +* Copyright (c) 2017-2020, Silicon Laboratories, Inc. * Copyright (c) 2010, ST-Ericsson * Copyright (c) 2006, Michael Wu <[email protected]> * Copyright 2004-2006 Jean-Baptiste Note <[email protected]>, et al.
Signature · 1 line
2.28.0
Jerome Pouiller
maintainerPATCH 6/7 dt-bindings: staging: wfx: silabs,wfx yaml conversion
In reply to Jerome PouillerFrom: Jérôme Pouiller <[email protected]>
The device can be connected on SPI or on SDIO. The original file described the two options separately. So, most of the file had to be rewritten in order to match with the Yaml requirements.
Some device requirements are still written in the comments since they cannot been expressed with the current scheme (e.g. reg must be set to 1 with SDIO, interrupt is mandatory with SPI, reset-gpio in SPI is replaced by mmc-pwrseq in SDIO, etc...).
The examples provided have also been reworked in order to make dt_binding_check happy.
Finally, also fix typo in the name of the file (siliabs instead of silabs)
--- .../bindings/net/wireless/silabs,wfx.yaml | 125 ++++++++++++++++++ .../bindings/net/wireless/siliabs,wfx.txt | 96 -------------- 2 files changed, 125 insertions(+), 96 deletions(-) create mode 100644 drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml delete mode 100644 drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt
drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml new file +125 -0
@@ -0,0 +1,125 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (c) 2020, Silicon Laboratories, Inc. +%YAML 1.2 +--- + +$id: http://devicetree.org/schemas/net/wireless/silabs,wfx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Silicon Labs WFxxx devicetree bindings + +maintainers: + - Jérôme Pouiller <[email protected]> + +description: + The WFxxx chip series can be connected via SPI or via SDIO. + + For SDIO':' + + The driver is able to detect a WFxxx chip on SDIO bus by matching its Vendor + ID and Product ID. However, driver will only provide limited features in + this case. Thus declaring WFxxx chip in device tree is recommended (and may + become mandatory in the future). + + In addition, it is recommended to declare a mmc-pwrseq on SDIO host above + WFx. Without it, you may encounter issues with warm boot. The mmc-pwrseq + should be compatible with mmc-pwrseq-simple. Please consult + Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt for more + information. + + For SPI':' + + In add of the properties below, please consult + Documentation/devicetree/bindings/spi/spi-controller.yaml for optional SPI + related properties. + + Note that in add of the properties below, the WFx driver also supports + `mac-address` and `local-mac-address` as described in + Documentation/devicetree/bindings/net/ethernet.txt + +properties: + compatible: + const: silabs,wf200 + reg: + description: + When used on SDIO bus, <reg> must be set to 1. When used on SPI bus, it is + the chip select address of the device as defined in the SPI devices + bindings. + maxItems: 1 + spi-max-frequency: + description: (SPI only) Maximum SPI clocking speed of device in Hz. + maxItems: 1 + interrupts: + description: The interrupt line. Triggers IRQ_TYPE_LEVEL_HIGH and + IRQ_TYPE_EDGE_RISING are both supported by the chip and the driver. When + SPI is used, this property is required. When SDIO is used, the "in-band" + interrupt provided by the SDIO bus is used unless an interrupt is defined + in the Device Tree. + maxItems: 1 + reset-gpios: + description: (SPI only) Phandle of gpio that will be used to reset chip + during probe. Without this property, you may encounter issues with warm + boot. (For legacy purpose, the gpio in inverted when compatible == + "silabs,wfx-spi") + + For SDIO, the reset gpio should declared using a mmc-pwrseq. + maxItems: 1 + wakeup-gpios: + description: Phandle of gpio that will be used to wake-up chip. Without this + property, driver will disable most of power saving features. + maxItems: 1 + config-file: + description: Use an alternative file as PDS. Default is `wf200.pds`. Only + necessary for development/debug purpose. + maxItems: 1 + +required: + - compatible + - reg + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/interrupt-controller/irq.h> + + spi0 { + #address-cells = <1>; + #size-cells = <0>; + + wfx@0 { + compatible = "silabs,wf200"; + pinctrl-names = "default"; + pinctrl-0 = <&wfx_irq &wfx_gpios>; + reg = <0>; + interrupts-extended = <&gpio 16 IRQ_TYPE_EDGE_RISING>; + wakeup-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + spi-max-frequency = <42000000>; + }; + }; + + - | + #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/interrupt-controller/irq.h> + + wfx_pwrseq: wfx_pwrseq { + compatible = "mmc-pwrseq-simple"; + pinctrl-names = "default"; + pinctrl-0 = <&wfx_reset>; + reset-gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + mmc0 { + mmc-pwrseq = <&wfx_pwrseq>; + #address-cells = <1>; + #size-cells = <0>; + + mmc@1 { + compatible = "silabs,wf200"; + pinctrl-names = "default"; + pinctrl-0 = <&wfx_wakeup>; + reg = <1>; + wakeup-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + }; + }; +...
drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt deleted +0 -96
96 lines not on this page · raw message
Signature · 1 line
2.28.0
Jerome Pouiller
maintainerPATCH 7/7 wfx: move out from the staging area
In reply to Jerome PouillerFrom: Jérôme Pouiller <[email protected]>
The wfx driver is now mature enough to leave the staging area.
---
.../bindings/net/wireless/silabs,wfx.yaml | 0
MAINTAINERS | 2 +-
drivers/net/wireless/Kconfig | 1 +
drivers/net/wireless/Makefile | 1 +
drivers/net/wireless/silabs/Kconfig | 17 +++++++++++++++++
drivers/net/wireless/silabs/Makefile | 3 +++
.../wireless/silabs}/wfx/Kconfig | 0
.../wireless/silabs}/wfx/Makefile | 0
.../{staging => net/wireless/silabs}/wfx/bh.c | 0
.../{staging => net/wireless/silabs}/wfx/bh.h | 0
.../{staging => net/wireless/silabs}/wfx/bus.h | 0
.../wireless/silabs}/wfx/bus_sdio.c | 0
.../wireless/silabs}/wfx/bus_spi.c | 0
.../wireless/silabs}/wfx/data_rx.c | 0
.../wireless/silabs}/wfx/data_rx.h | 0
.../wireless/silabs}/wfx/data_tx.c | 0
.../wireless/silabs}/wfx/data_tx.h | 0
.../wireless/silabs}/wfx/debug.c | 0
.../wireless/silabs}/wfx/debug.h | 0
.../{staging => net/wireless/silabs}/wfx/fwio.c | 0
.../{staging => net/wireless/silabs}/wfx/fwio.h | 0
.../wireless/silabs}/wfx/hif_api_cmd.h | 0
.../wireless/silabs}/wfx/hif_api_general.h | 0
.../wireless/silabs}/wfx/hif_api_mib.h | 0
.../wireless/silabs}/wfx/hif_rx.c | 0
.../wireless/silabs}/wfx/hif_rx.h | 0
.../wireless/silabs}/wfx/hif_tx.c | 0
.../wireless/silabs}/wfx/hif_tx.h | 0
.../wireless/silabs}/wfx/hif_tx_mib.c | 0
.../wireless/silabs}/wfx/hif_tx_mib.h | 0
.../{staging => net/wireless/silabs}/wfx/hwio.c | 0
.../{staging => net/wireless/silabs}/wfx/hwio.h | 0
.../{staging => net/wireless/silabs}/wfx/key.c | 0
.../{staging => net/wireless/silabs}/wfx/key.h | 0
.../{staging => net/wireless/silabs}/wfx/main.c | 0
.../{staging => net/wireless/silabs}/wfx/main.h | 0
.../wireless/silabs}/wfx/queue.c | 0
.../wireless/silabs}/wfx/queue.h | 0
.../{staging => net/wireless/silabs}/wfx/scan.c | 0
.../{staging => net/wireless/silabs}/wfx/scan.h | 0
.../{staging => net/wireless/silabs}/wfx/sta.c | 0
.../{staging => net/wireless/silabs}/wfx/sta.h | 0
.../wireless/silabs}/wfx/traces.h | 0
.../{staging => net/wireless/silabs}/wfx/wfx.h | 0
drivers/staging/Kconfig | 2 --
drivers/staging/Makefile | 1 -
drivers/staging/wfx/TODO | 6 ------
47 files changed, 23 insertions(+), 10 deletions(-)
rename {drivers/staging/wfx/Documentation => Documentation}/devicetree/bindings/net/wireless/silabs,wfx.yaml (100%)
create mode 100644 drivers/net/wireless/silabs/Kconfig
create mode 100644 drivers/net/wireless/silabs/Makefile
rename drivers/{staging => net/wireless/silabs}/wfx/Kconfig (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/Makefile (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/bh.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/bh.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/bus.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/bus_sdio.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/bus_spi.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/data_rx.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/data_rx.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/data_tx.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/data_tx.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/debug.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/debug.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/fwio.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/fwio.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_api_cmd.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_api_general.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_api_mib.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_rx.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_rx.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_tx.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_tx.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_tx_mib.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/hif_tx_mib.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/hwio.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/hwio.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/key.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/key.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/main.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/main.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/queue.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/queue.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/scan.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/scan.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/sta.c (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/sta.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/traces.h (100%)
rename drivers/{staging => net/wireless/silabs}/wfx/wfx.h (100%)
delete mode 100644 drivers/staging/wfx/TODODocumentation/devicetree/bindings/net/wireless/silabs,wfx.yaml renamed from drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml +0 -0
MAINTAINERS +1 -1
@@ -15799,7 +15799,7 @@ F: drivers/platform/x86/touchscreen_dmi.c SILICON LABS WIRELESS DRIVERS (for WFxxx series) M: Jérôme Pouiller <[email protected]> S: Supported -F: drivers/staging/wfx/ +F: drivers/net/wireless/silabs/wfx/ SILICON MOTION SM712 FRAME BUFFER DRIVER M: Sudip Mukherjee <[email protected]>
drivers/net/wireless/Kconfig +1 -0
@@ -44,6 +44,7 @@ source "drivers/net/wireless/microchip/Kconfig" source "drivers/net/wireless/ralink/Kconfig" source "drivers/net/wireless/realtek/Kconfig" source "drivers/net/wireless/rsi/Kconfig" +source "drivers/net/wireless/silabs/Kconfig" source "drivers/net/wireless/st/Kconfig" source "drivers/net/wireless/ti/Kconfig" source "drivers/net/wireless/zydas/Kconfig"
drivers/net/wireless/Makefile +1 -0
@@ -16,6 +16,7 @@ obj-$(CONFIG_WLAN_VENDOR_MICROCHIP) += microchip/ obj-$(CONFIG_WLAN_VENDOR_RALINK) += ralink/ obj-$(CONFIG_WLAN_VENDOR_REALTEK) += realtek/ obj-$(CONFIG_WLAN_VENDOR_RSI) += rsi/ +obj-$(CONFIG_WLAN_VENDOR_SILABS) += silabs/ obj-$(CONFIG_WLAN_VENDOR_ST) += st/ obj-$(CONFIG_WLAN_VENDOR_TI) += ti/ obj-$(CONFIG_WLAN_VENDOR_ZYDAS) += zydas/
drivers/net/wireless/silabs/Kconfig new file +17 -0
@@ -0,0 +1,17 @@ +# SPDX-License-Identifier: GPL-2.0 +config WLAN_VENDOR_SILABS + bool "Silicon Laboratories devices" + default y + help + If you have a wireless card belonging to this class, say Y. + + Note that the answer to this question doesn't directly affect the + kernel: saying N will just cause the configurator to skip all the + questions about these cards. If you say Y, you will be asked for + your specific card in the following questions. + +if WLAN_VENDOR_SILABS + +source "drivers/net/wireless/silabs/wfx/Kconfig" + +endif # WLAN_VENDOR_SILABS
drivers/net/wireless/silabs/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-$(CONFIG_WFX) += wfx/
drivers/net/wireless/silabs/wfx/Kconfig renamed from drivers/staging/wfx/Kconfig +0 -0
drivers/net/wireless/silabs/wfx/Makefile renamed from drivers/staging/wfx/Makefile +0 -0
drivers/net/wireless/silabs/wfx/bh.c renamed from drivers/staging/wfx/bh.c +0 -0
drivers/net/wireless/silabs/wfx/bh.h renamed from drivers/staging/wfx/bh.h +0 -0
drivers/net/wireless/silabs/wfx/bus.h renamed from drivers/staging/wfx/bus.h +0 -0
drivers/net/wireless/silabs/wfx/bus_sdio.c renamed from drivers/staging/wfx/bus_sdio.c +0 -0
drivers/net/wireless/silabs/wfx/bus_spi.c renamed from drivers/staging/wfx/bus_spi.c +0 -0
drivers/net/wireless/silabs/wfx/data_rx.c renamed from drivers/staging/wfx/data_rx.c +0 -0
drivers/net/wireless/silabs/wfx/data_rx.h renamed from drivers/staging/wfx/data_rx.h +0 -0
drivers/net/wireless/silabs/wfx/data_tx.c renamed from drivers/staging/wfx/data_tx.c +0 -0
drivers/net/wireless/silabs/wfx/data_tx.h renamed from drivers/staging/wfx/data_tx.h +0 -0
drivers/net/wireless/silabs/wfx/debug.c renamed from drivers/staging/wfx/debug.c +0 -0
drivers/net/wireless/silabs/wfx/debug.h renamed from drivers/staging/wfx/debug.h +0 -0
drivers/net/wireless/silabs/wfx/fwio.c renamed from drivers/staging/wfx/fwio.c +0 -0
drivers/net/wireless/silabs/wfx/fwio.h renamed from drivers/staging/wfx/fwio.h +0 -0
drivers/net/wireless/silabs/wfx/hif_api_cmd.h renamed from drivers/staging/wfx/hif_api_cmd.h +0 -0
drivers/net/wireless/silabs/wfx/hif_api_general.h renamed from drivers/staging/wfx/hif_api_general.h +0 -0
drivers/net/wireless/silabs/wfx/hif_api_mib.h renamed from drivers/staging/wfx/hif_api_mib.h +0 -0
drivers/net/wireless/silabs/wfx/hif_rx.c renamed from drivers/staging/wfx/hif_rx.c +0 -0
drivers/net/wireless/silabs/wfx/hif_rx.h renamed from drivers/staging/wfx/hif_rx.h +0 -0
drivers/net/wireless/silabs/wfx/hif_tx.c renamed from drivers/staging/wfx/hif_tx.c +0 -0
drivers/net/wireless/silabs/wfx/hif_tx.h renamed from drivers/staging/wfx/hif_tx.h +0 -0
drivers/net/wireless/silabs/wfx/hif_tx_mib.c renamed from drivers/staging/wfx/hif_tx_mib.c +0 -0
drivers/net/wireless/silabs/wfx/hif_tx_mib.h renamed from drivers/staging/wfx/hif_tx_mib.h +0 -0
drivers/net/wireless/silabs/wfx/hwio.c renamed from drivers/staging/wfx/hwio.c +0 -0
drivers/net/wireless/silabs/wfx/hwio.h renamed from drivers/staging/wfx/hwio.h +0 -0
drivers/net/wireless/silabs/wfx/key.c renamed from drivers/staging/wfx/key.c +0 -0
drivers/net/wireless/silabs/wfx/key.h renamed from drivers/staging/wfx/key.h +0 -0
drivers/net/wireless/silabs/wfx/main.c renamed from drivers/staging/wfx/main.c +0 -0
drivers/net/wireless/silabs/wfx/main.h renamed from drivers/staging/wfx/main.h +0 -0
drivers/net/wireless/silabs/wfx/queue.c renamed from drivers/staging/wfx/queue.c +0 -0
drivers/net/wireless/silabs/wfx/queue.h renamed from drivers/staging/wfx/queue.h +0 -0
drivers/net/wireless/silabs/wfx/scan.c renamed from drivers/staging/wfx/scan.c +0 -0
drivers/net/wireless/silabs/wfx/scan.h renamed from drivers/staging/wfx/scan.h +0 -0
drivers/net/wireless/silabs/wfx/sta.c renamed from drivers/staging/wfx/sta.c +0 -0
drivers/net/wireless/silabs/wfx/sta.h renamed from drivers/staging/wfx/sta.h +0 -0
drivers/net/wireless/silabs/wfx/traces.h renamed from drivers/staging/wfx/traces.h +0 -0
drivers/net/wireless/silabs/wfx/wfx.h renamed from drivers/staging/wfx/wfx.h +0 -0
drivers/staging/Kconfig +0 -2
@@ -114,8 +114,6 @@ source "drivers/staging/kpc2000/Kconfig" source "drivers/staging/qlge/Kconfig" -source "drivers/staging/wfx/Kconfig" - source "drivers/staging/hikey9xx/Kconfig" endif # STAGING
drivers/staging/Makefile +0 -1
@@ -47,5 +47,4 @@ obj-$(CONFIG_XIL_AXIS_FIFO) += axis-fifo/ obj-$(CONFIG_FIELDBUS_DEV) += fieldbus/ obj-$(CONFIG_KPC2000) += kpc2000/ obj-$(CONFIG_QLGE) += qlge/ -obj-$(CONFIG_WFX) += wfx/ obj-y += hikey9xx/
drivers/staging/wfx/TODO deleted +0 -6
@@ -1,6 +0,0 @@ -This is a list of things that need to be done to get this driver out of the -staging directory. - - - As suggested by Felix, rate control could be improved following this idea: - https://lore.kernel.org/lkml/3099559.gv3Q75KnN1@pc-42/ -
Signature · 1 line
2.28.0
Greg Kroah-Hartman
maintainerQuoted 15 lines · Jerome Pouiller
From: Jérôme Pouiller <[email protected]>
I think the wfx driver is now mature enough to be accepted in the
drivers/net/wirelessdirectory.There is still one item on the TODO list. It is an idea to improve the rate control in some particular cases[1]. However, the current performances of the driver seem to satisfy everyone. In add, the suggested change is large enough. So, I would prefer to implement it only if it really solves an issue. I think it is not an obstacle to move the driver out of the staging area.
In order to comply with the last rules for the DT bindings, I have converted the documentation to yaml. I am moderately happy with the result. Especially, for the description of the binding. Any comments are welcome.
Quoted 7 lines
The series also update the copyrights dates of the files. I don't know exactly how this kind of changes should be sent. It's a bit weird to change all the copyrights in one commit, but I do not see any better way.
I also include a few fixes I have found these last weeks.
I'll take the first 6 patches here, the last one you should work with the wireless maintainers to get reviewed.
Maybe that might want to wait until after 5.10-rc1 is out, with all of these changes in it, making it an easier move.
thanks,
greg k-h
Quoted 22 lines · Greg Kroah-Hartman
Quoted 21 lines · Jerome Pouiller
From: Jérôme Pouiller <[email protected]>
I think the wfx driver is now mature enough to be accepted in the
drivers/net/wirelessdirectory.There is still one item on the TODO list. It is an idea to improve the rate control in some particular cases[1]. However, the current performances of the driver seem to satisfy everyone. In add, the suggested change is large enough. So, I would prefer to implement it only if it really solves an issue. I think it is not an obstacle to move the driver out of the staging area.
In order to comply with the last rules for the DT bindings, I have converted the documentation to yaml. I am moderately happy with the result. Especially, for the description of the binding. Any comments are welcome.
The series also update the copyrights dates of the files. I don't know exactly how this kind of changes should be sent. It's a bit weird to change all the copyrights in one commit, but I do not see any better way.
I also include a few fixes I have found these last weeks.
Quoted 7 lines
Quoted 1 line
I'll take the first 6 patches here, the last one you should work with the wireless maintainers to get reviewed.
Maybe that might want to wait until after 5.10-rc1 is out, with all of these changes in it, making it an easier move.
Yes, the driver needs to be reviewed in linux-wireless list. I recommend submitting the whole driver in a patchset with one file per patch, which seems to be the easiest way to review a full driver. The final move will be in just one commit moving the driver, just like patch 7 does here. As an example see how wilc1000 review was done.
Device tree bindings needs to be reviewed by the DT maintainer so CC devicetree on that patch.
But do note that there's currently one new driver in review queue, so it will most likely take some time before wfx is reviewed.
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 32 lines · Kalle Valo
Quoted 22 lines · Greg Kroah-Hartman
Quoted 21 lines · Jerome Pouiller
From: Jérôme Pouiller <[email protected]>
I think the wfx driver is now mature enough to be accepted in the
drivers/net/wirelessdirectory.There is still one item on the TODO list. It is an idea to improve the rate control in some particular cases[1]. However, the current performances of the driver seem to satisfy everyone. In add, the suggested change is large enough. So, I would prefer to implement it only if it really solves an issue. I think it is not an obstacle to move the driver out of the staging area.
In order to comply with the last rules for the DT bindings, I have converted the documentation to yaml. I am moderately happy with the result. Especially, for the description of the binding. Any comments are welcome.
The series also update the copyrights dates of the files. I don't know exactly how this kind of changes should be sent. It's a bit weird to change all the copyrights in one commit, but I do not see any better way.
I also include a few fixes I have found these last weeks.
Quoted 7 lines
Quoted 1 line
I'll take the first 6 patches here, the last one you should work with the wireless maintainers to get reviewed.
Maybe that might want to wait until after 5.10-rc1 is out, with all of these changes in it, making it an easier move.
Quoted 8 lines
Yes, the driver needs to be reviewed in linux-wireless list. I recommend submitting the whole driver in a patchset with one file per patch, which seems to be the easiest way to review a full driver. The final move will be in just one commit moving the driver, just like patch 7 does here. As an example see how wilc1000 review was done.
Device tree bindings needs to be reviewed by the DT maintainer so CC devicetree on that patch.
BTW, I wrote some instructions for new wireless drivers:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#new_driver
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Jérôme Pouiller
maintainerOn Thursday 8 October 2020 09:30:06 CEST Kalle Valo wrote:
[...]
Quoted 5 lines
Yes, the driver needs to be reviewed in linux-wireless list. I recommend submitting the whole driver in a patchset with one file per patch, which seems to be the easiest way to review a full driver. The final move will be in just one commit moving the driver, just like patch 7 does here. As an example see how wilc1000 review was done.
I see. I suppose it is still a bit complicated to review? Maybe I could try to make things easier.
For my submission to staging/ I had taken time to split the driver in an understandable series of patches[1]. I think it was easier to review than just sending files one by one. I could do the same thing for the submission to linux-wireless. It would ask me a bit of work but, since I already have a template, it is conceivable.
Do you think it is worth it, or it would be an unnecessary effort?
[1] https://lore.kernel.org/driverdev-devel/[email protected]/
or commits a7a91ca5a23d^..40115bbc40e2
Signature · 1 line
Jérôme Pouiller
Quoted 17 lines · Jérôme Pouiller
On Thursday 8 October 2020 09:30:06 CEST Kalle Valo wrote:
[...]Quoted 5 lines
Yes, the driver needs to be reviewed in linux-wireless list. I recommend submitting the whole driver in a patchset with one file per patch, which seems to be the easiest way to review a full driver. The final move will be in just one commit moving the driver, just like patch 7 does here. As an example see how wilc1000 review was done.
I see. I suppose it is still a bit complicated to review? Maybe I could try to make things easier.
For my submission to staging/ I had taken time to split the driver in an understandable series of patches[1]. I think it was easier to review than just sending files one by one. I could do the same thing for the submission to linux-wireless. It would ask me a bit of work but, since I already have a template, it is conceivable.
Quoted 5 lines
Do you think it is worth it, or it would be an unnecessary effort?
[1]
https://lore.kernel.org/driverdev-devel/[email protected]/or commits a7a91ca5a23d^..40115bbc40e2
I don't know how others think, but I prefer to review new drivers "one file per patch" style as I get to see the big picture easily. And besides, splitting the driver like that would be a huge job for you. I don't think it's worth your time in this case. And making changes in the driver during review process becomes even more complex.
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
There are some static checker warnings to look at from linux-next from Tuesday.
drivers/staging/wfx/hif_tx.c:319 hif_join() error: we previously assumed 'channel' could be null (see line 315)drivers/staging/wfx/main.c:228 wfx_send_pdata_pds() warn: potential NULL parameter dereference 'tmp_buf'drivers/staging/wfx/hif_rx.c:177 hif_scan_complete_indication() warn: potential NULL parameter dereference 'wvif'drivers/staging/wfx/data_tx.c:576 wfx_flush() warn: potential NULL parameter dereference 'wvif'drivers/staging/wfx/bus_spi.c:228 wfx_spi_probe() warn: 'bus->core' could be an error pointerdrivers/staging/wfx/bus_sdio.c:221 wfx_sdio_probe() warn: 'bus->core' could be an error pointerdrivers/staging/wfx/hif_rx.c:26 hif_generic_confirm() warn: negative user subtract: 0-u16max - 4drivers/staging/wfx/hif_rx.c:98 hif_wakeup_indication() warn: 'gpiod_get_value(wdev->pdata.gpio_wakeup)' returns positive and negativedrivers/staging/wfx/bh.c:24 device_wakeup() warn: 'gpiod_get_value_cansleep(wdev->pdata.gpio_wakeup)' returns positive and negativedrivers/staging/wfx/hif_rx.c:235 hif_generic_indication() warn: format string contains non-ascii character '\xc2'drivers/staging/wfx/hif_rx.c:235 hif_generic_indication() warn: format string contains non-ascii character '\xb0'drivers/staging/wfx/data_tx.c:37 wfx_get_hw_rate() warn: constraint '(struct ieee80211_supported_band)->bitrates' overflow 'band->bitrates' 0 <= abs_rl '0-127' user_rl '' required = '(struct ieee80211_supported_band)->n_bitrates'
Some of these are unpublished checks that I haven't published because they are too crap. The rest of the email is just long explanations. Skip if not required.
regards,
dan carpenter
#1drivers/staging/wfx/hif_tx.c:319 hif_join() error: we previously assumed 'channel' could be null (see line 315)
311 if (!hif)
312 return -ENOMEM;
313 body->infrastructure_bss_mode = !conf->ibss_joined;
314 body->short_preamble = conf->use_short_preamble;
315 if (channel && channel->flags & IEEE80211_CHAN_NO_IR)
^^^^^^^Check for NULL.
316 body->probe_for_join = 0;
317 else
318 body->probe_for_join = 1;
319 body->channel_number = channel->hw_value;
^^^^^^^^^^^^^^^^^Unchecked dereference.
320 body->beacon_interval = cpu_to_le32(conf->beacon_int); 321 body->basic_rate_set =
#2drivers/staging/wfx/main.c:228 wfx_send_pdata_pds() warn: potential NULL parameter dereference 'tmp_buf'
227 tmp_buf = kmemdup(pds->data, pds->size, GFP_KERNEL);
No check for allocation failure.
228 ret = wfx_send_pds(wdev, tmp_buf, pds->size); 229 kfree(tmp_buf);
#3drivers/staging/wfx/hif_rx.c:177 hif_scan_complete_indication() warn: potential NULL parameter dereference 'wvif'
170 static int hif_scan_complete_indication(struct wfx_dev *wdev,
171 const struct hif_msg *hif,
172 const void *buf)
173 {
174 struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
^^^^^^^^^^^^^^^^^^^Smatch thinks wdev_to_wvif() can return NULL.
175 176 WARN_ON(!wvif); 177 wfx_scan_complete(wvif); 178 179 return 0; 180 }
#4drivers/staging/wfx/data_tx.c:576 wfx_flush() warn: potential NULL parameter dereference 'wvif'
572 while ((skb = skb_dequeue(&dropped)) != NULL) {
573 hif = (struct hif_msg *)skb->data;
574 wvif = wdev_to_wvif(wdev, hif->interface);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Same.
575 ieee80211_tx_info_clear_status(IEEE80211_SKB_CB(skb));
576 wfx_skb_dtor(wvif, skb);
577 }
578 }
#5 and #6drivers/staging/wfx/bus_spi.c:228 wfx_spi_probe() warn: 'bus->core' could be an error pointer drivers/staging/wfx/bus_sdio.c:221 wfx_sdio_probe() warn: 'bus->core' could be an error pointer
The wfx_init_common() function should return NULL instead of error pointer if devm_gpiod_get_optional() fails.
#7drivers/staging/wfx/hif_rx.c:26 hif_generic_confirm() warn: negative user subtract: 0-u16max - 4
20 static int hif_generic_confirm(struct wfx_dev *wdev,
21 const struct hif_msg *hif, const void *buf)
22 {
23 // All confirm messages start with status
24 int status = le32_to_cpup((__le32 *)buf);
25 int cmd = hif->id;
26 int len = le16_to_cpu(hif->len) - 4; // drop headerCan "len" get set to negative 4?
27
28 WARN(!mutex_is_locked(&wdev->hif_cmd.lock), "data locking error");#8 and #9drivers/staging/wfx/hif_rx.c:98 hif_wakeup_indication() warn: 'gpiod_get_value(wdev->pdata.gpio_wakeup)' returns positive and negative drivers/staging/wfx/bh.c:24 device_wakeup() warn: 'gpiod_get_value_cansleep(wdev->pdata.gpio_wakeup)' returns positive and negative
94 static int hif_wakeup_indication(struct wfx_dev *wdev,
95 const struct hif_msg *hif, const void *buf)
96 {
97 if (!wdev->pdata.gpio_wakeup
98 || !gpiod_get_value(wdev->pdata.gpio_wakeup)) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Negative error codes from gpiod_get_value() should be treated as error.
99 dev_warn(wdev->dev, "unexpected wake-up indication\n");
100 return -EIO;
101 }
102 return 0;
103 }
#10 and #11drivers/staging/wfx/hif_rx.c:235 hif_generic_indication() warn: format string contains non-ascii character '\xc2' drivers/staging/wfx/hif_rx.c:235 hif_generic_indication() warn: format string contains non-ascii character '\xb0'
234 if (!wfx_api_older_than(wdev, 1, 4))
235 dev_info(wdev->dev, "Rx test ongoing. Temperature: %d°C\n",
^
Can we output non-ascii to dmesg? (I didn't add this Smatch check so I don't really know the answer).
236 body->data.rx_stats.current_temp);
#12drivers/staging/wfx/data_tx.c:37 wfx_get_hw_rate() warn: constraint '(struct ieee80211_supported_band)->bitrates' overflow 'band->bitrates' 0 <= abs_rl '0-127' user_rl '' required = '(struct ieee80211_supported_band)->n_bitrates'
20 static int wfx_get_hw_rate(struct wfx_dev *wdev,
21 const struct ieee80211_tx_rate *rate)
22 {
23 struct ieee80211_supported_band *band;
24
25 if (rate->idx < 0)
26 return -1;
27 if (rate->flags & IEEE80211_TX_RC_MCS) {
28 if (rate->idx > 7) {
29 WARN(1, "wrong rate->idx value: %d", rate->idx);
30 return -1;
31 }
32 return rate->idx + 14;
33 }
34 // WFx only support 2GHz, else band information should be retrieved
35 // from ieee80211_tx_info
36 band = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ];
37 return band->bitrates[rate->idx].hw_value;This code assumes that "rate->idx" can be all sort of invalid values including negatives but it doesn't cap it against:
if (rate->idx >= band->n_bitrates)
return -1;
38 }If you you read all the way down to the second end of the email then you are a true hero. regards again,
dan carpenter