staging: wilc1000: changes to rename files and few other review comments
cover staging: wilc1000: changes to rename files and few other review comments
From: Ajay Singh <[email protected]>
This patch series contains changes to address some of the review comments received during full driver review [1]. Mainly the changes are related to files rename and comments formatting.
1. https://www.spinics.net/lists/linux-wireless/msg191489.html
Ajay Singh (6):
staging: wilc1000: avoid 'bool' datatype in struct sent to firmware
staging: wilc1000: remove 'wilc_' prefix from filenames
staging: wilc1000: added 'WILC_' prefix in header guard macro
staging: wilc1000: avoid use of C++ style comments
staging: wilc1000: added proper spacing for comments
staging: wilc1000: use defines for msg types received from firmware
drivers/staging/wilc1000/Makefile | 8 ++---
.../{wilc_wfi_cfgoperations.c => cfg80211.c} | 2 +-
.../{wilc_wfi_cfgoperations.h => cfg80211.h} | 6 ++--
.../staging/wilc1000/{wilc_hif.c => hif.c} | 10 ++++---
.../staging/wilc1000/{wilc_hif.h => hif.h} | 6 ++--
.../staging/wilc1000/{wilc_mon.c => mon.c} | 4 +--
.../wilc1000/{wilc_netdev.c => netdev.c} | 4 +--
.../{wilc_wfi_netdevice.h => netdev.h} | 29 +++++++++++-------
.../staging/wilc1000/{wilc_sdio.c => sdio.c} | 4 +--
.../staging/wilc1000/{wilc_spi.c => spi.c} | 4 +--
.../staging/wilc1000/{wilc_wlan.c => wlan.c} | 4 +--
.../staging/wilc1000/{wilc_wlan.h => wlan.h} | 2 +-
.../wilc1000/{wilc_wlan_cfg.c => wlan_cfg.c} | 30 +++++++++----------
.../wilc1000/{wilc_wlan_cfg.h => wlan_cfg.h} | 0
.../wilc1000/{wilc_wlan_if.h => wlan_if.h} | 8 ++---
15 files changed, 65 insertions(+), 56 deletions(-)
rename drivers/staging/wilc1000/{wilc_wfi_cfgoperations.c => cfg80211.c} (99%)
rename drivers/staging/wilc1000/{wilc_wfi_cfgoperations.h => cfg80211.h} (92%)
rename drivers/staging/wilc1000/{wilc_hif.c => hif.c} (99%)
rename drivers/staging/wilc1000/{wilc_hif.h => hif.h} (99%)
rename drivers/staging/wilc1000/{wilc_mon.c => mon.c} (98%)
rename drivers/staging/wilc1000/{wilc_netdev.c => netdev.c} (99%)
rename drivers/staging/wilc1000/{wilc_wfi_netdevice.h => netdev.h} (95%)
rename drivers/staging/wilc1000/{wilc_sdio.c => sdio.c} (99%)
rename drivers/staging/wilc1000/{wilc_spi.c => spi.c} (99%)
rename drivers/staging/wilc1000/{wilc_wlan.c => wlan.c} (99%)
rename drivers/staging/wilc1000/{wilc_wlan.h => wlan.h} (99%)
rename drivers/staging/wilc1000/{wilc_wlan_cfg.c => wlan_cfg.c} (94%)
rename drivers/staging/wilc1000/{wilc_wlan_cfg.h => wlan_cfg.h} (100%)
rename drivers/staging/wilc1000/{wilc_wlan_if.h => wlan_if.h} (99%)Signature · 1 line
2.22.0
PATCH 1/6 staging: wilc1000: avoid 'bool' datatype in struct sent to firmware
From: Ajay Singh <[email protected]>
Use 'u8' instead of 'bool' datatype for struct element sent to firmware because storage of bool datatype is not guaranteed.
--- drivers/staging/wilc1000/wilc_hif.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/wilc1000/wilc_hif.c +4 -2
@@ -32,7 +32,7 @@ struct wilc_op_mode { };struct wilc_reg_frame { -bool reg; +u8 reg;u8 reg_id;__le16 frame_type; } __packed;
@@ -1784,7 +1784,9 @@ void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg) wid.val = (u8 *)®_frame;memset (®_frame,0x0 ,sizeof (reg_frame)); - reg_frame.reg = reg; + +if (reg) + reg_frame.reg =1 ;switch (frame_type) {case IEEE80211_STYPE_ACTION :
Signature · 1 line
2.22.0
PATCH 2/6 staging: wilc1000: remove 'wilc_' prefix from filenames
In reply to [email protected]From: Ajay Singh <[email protected]>
Remove 'wilc_' prefix from filenames, the driver is already present inside the 'wilc1000' directory so no need to add 'wilc_' in filenames.
---
drivers/staging/wilc1000/Makefile | 8 ++++----
.../wilc1000/{wilc_wfi_cfgoperations.c => cfg80211.c} | 2 +-
.../wilc1000/{wilc_wfi_cfgoperations.h => cfg80211.h} | 2 +-
drivers/staging/wilc1000/{wilc_hif.c => hif.c} | 2 +-
drivers/staging/wilc1000/{wilc_hif.h => hif.h} | 2 +-
drivers/staging/wilc1000/{wilc_mon.c => mon.c} | 2 +-
drivers/staging/wilc1000/{wilc_netdev.c => netdev.c} | 4 ++--
.../staging/wilc1000/{wilc_wfi_netdevice.h => netdev.h} | 6 +++---
drivers/staging/wilc1000/{wilc_sdio.c => sdio.c} | 4 ++--
drivers/staging/wilc1000/{wilc_spi.c => spi.c} | 4 ++--
drivers/staging/wilc1000/{wilc_wlan.c => wlan.c} | 4 ++--
drivers/staging/wilc1000/{wilc_wlan.h => wlan.h} | 0
drivers/staging/wilc1000/{wilc_wlan_cfg.c => wlan_cfg.c} | 8 ++++----
drivers/staging/wilc1000/{wilc_wlan_cfg.h => wlan_cfg.h} | 0
drivers/staging/wilc1000/{wilc_wlan_if.h => wlan_if.h} | 0
15 files changed, 24 insertions(+), 24 deletions(-)
rename drivers/staging/wilc1000/{wilc_wfi_cfgoperations.c => cfg80211.c} (99%)
rename drivers/staging/wilc1000/{wilc_wfi_cfgoperations.h => cfg80211.h} (97%)
rename drivers/staging/wilc1000/{wilc_hif.c => hif.c} (99%)
rename drivers/staging/wilc1000/{wilc_hif.h => hif.h} (99%)
rename drivers/staging/wilc1000/{wilc_mon.c => mon.c} (99%)
rename drivers/staging/wilc1000/{wilc_netdev.c => netdev.c} (99%)
rename drivers/staging/wilc1000/{wilc_wfi_netdevice.h => netdev.h} (98%)
rename drivers/staging/wilc1000/{wilc_sdio.c => sdio.c} (99%)
rename drivers/staging/wilc1000/{wilc_spi.c => spi.c} (99%)
rename drivers/staging/wilc1000/{wilc_wlan.c => wlan.c} (99%)
rename drivers/staging/wilc1000/{wilc_wlan.h => wlan.h} (100%)
rename drivers/staging/wilc1000/{wilc_wlan_cfg.c => wlan_cfg.c} (98%)
rename drivers/staging/wilc1000/{wilc_wlan_cfg.h => wlan_cfg.h} (100%)
rename drivers/staging/wilc1000/{wilc_wlan_if.h => wlan_if.h} (100%)drivers/staging/wilc1000/Makefile +4 -4
@@ -4,11 +4,11 @@ obj-$(CONFIG_WILC1000) += wilc1000.o ccflags-y += -DFIRMWARE_1002=\"atmel/wilc1002_firmware.bin\" \ -DFIRMWARE_1003=\"atmel/wilc1003_firmware.bin\" -wilc1000-objs := wilc_wfi_cfgoperations.o wilc_netdev.o wilc_mon.o \ - wilc_hif.o wilc_wlan_cfg.o wilc_wlan.o +wilc1000-objs := cfg80211.o netdev.o mon.o \ + hif.o wlan_cfg.o wlan.o obj-$(CONFIG_WILC1000_SDIO) += wilc1000-sdio.o -wilc1000-sdio-objs += wilc_sdio.o +wilc1000-sdio-objs += sdio.o obj-$(CONFIG_WILC1000_SPI) += wilc1000-spi.o -wilc1000-spi-objs += wilc_spi.o +wilc1000-spi-objs += spi.o
drivers/staging/wilc1000/cfg80211.c renamed from drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -1
@@ -4,7 +4,7 @@* All rights reserved. */ -#include "wilc_wfi_cfgoperations.h" +#include "cfg80211.h" #define FRAME_TYPE_ID 0#define ACTION_CAT_ID 24
drivers/staging/wilc1000/cfg80211.h renamed from drivers/staging/wilc1000/wilc_wfi_cfgoperations.h +1 -1
@@ -6,7 +6,7 @@#ifndef NM_WFI_CFGOPERATIONS #define NM_WFI_CFGOPERATIONS -#include "wilc_wfi_netdevice.h" +#include "netdev.h" struct wiphy *wilc_cfg_alloc (void ); int wilc_cfg80211_init(struct wilc **wilc, struct device *dev, int io_type,
drivers/staging/wilc1000/hif.c renamed from drivers/staging/wilc1000/wilc_hif.c +1 -1
@@ -4,7 +4,7 @@* All rights reserved. */ -#include "wilc_wfi_netdevice.h" +#include "netdev.h" #define WILC_HIF_SCAN_TIMEOUT_MS 5000#define WILC_HIF_CONNECT_TIMEOUT_MS 9500
drivers/staging/wilc1000/hif.h renamed from drivers/staging/wilc1000/wilc_hif.h +1 -1
@@ -7,7 +7,7 @@#ifndef HOST_INT_H #define HOST_INT_H #include <linux/ieee80211.h> -#include "wilc_wlan_if.h" +#include "wlan_if.h" enum { WILC_IDLE_MODE = 0x0,
drivers/staging/wilc1000/mon.c renamed from drivers/staging/wilc1000/wilc_mon.c +1 -1
@@ -4,7 +4,7 @@* All rights reserved. */ -#include "wilc_wfi_cfgoperations.h" +#include "cfg80211.h" struct wilc_wfi_radiotap_hdr {struct ieee80211_radiotap_header hdr;
drivers/staging/wilc1000/netdev.c renamed from drivers/staging/wilc1000/wilc_netdev.c +2 -2
@@ -10,8 +10,8 @@#include <linux/netdevice.h> #include <linux/inetdevice.h> -#include "wilc_wfi_cfgoperations.h" -#include "wilc_wlan_cfg.h" +#include "cfg80211.h" +#include "wlan_cfg.h" #define WILC_MULTICAST_TABLE_SIZE 8
drivers/staging/wilc1000/netdev.h renamed from drivers/staging/wilc1000/wilc_wfi_netdevice.h +3 -3
@@ -14,9 +14,9 @@#include <linux/if_arp.h> #include <linux/gpio/consumer.h> -#include "wilc_hif.h" -#include "wilc_wlan.h" -#include "wilc_wlan_cfg.h" +#include "hif.h" +#include "wlan.h" +#include "wlan_cfg.h" #define FLOW_CONTROL_LOWER_THRESHOLD 128#define FLOW_CONTROL_UPPER_THRESHOLD 256
drivers/staging/wilc1000/sdio.c renamed from drivers/staging/wilc1000/wilc_sdio.c +2 -2
@@ -8,8 +8,8 @@#include <linux/mmc/sdio_func.h> #include <linux/mmc/host.h> -#include "wilc_wfi_netdevice.h" -#include "wilc_wfi_cfgoperations.h" +#include "netdev.h" +#include "cfg80211.h" #define SDIO_MODALIAS "wilc1000_sdio"
drivers/staging/wilc1000/spi.c renamed from drivers/staging/wilc1000/wilc_spi.c +2 -2
@@ -7,8 +7,8 @@#include <linux/clk.h> #include <linux/spi/spi.h> -#include "wilc_wfi_netdevice.h" -#include "wilc_wfi_cfgoperations.h" +#include "netdev.h" +#include "cfg80211.h" struct wilc_spi {int crc_off;
drivers/staging/wilc1000/wlan.c renamed from drivers/staging/wilc1000/wilc_wlan.c +2 -2
@@ -6,8 +6,8 @@#include <linux/if_ether.h> #include <linux/ip.h> -#include "wilc_wfi_cfgoperations.h" -#include "wilc_wlan_cfg.h" +#include "cfg80211.h" +#include "wlan_cfg.h" static inline bool is_wilc1000 (u32 id) {
drivers/staging/wilc1000/wlan.h renamed from drivers/staging/wilc1000/wilc_wlan.h +0 -0
drivers/staging/wilc1000/wlan_cfg.c renamed from drivers/staging/wilc1000/wilc_wlan_cfg.c +4 -4
@@ -4,10 +4,10 @@* All rights reserved. */ -#include "wilc_wlan_if.h" -#include "wilc_wlan.h" -#include "wilc_wlan_cfg.h" -#include "wilc_wfi_netdevice.h" +#include "wlan_if.h" +#include "wlan.h" +#include "wlan_cfg.h" +#include "netdev.h" enum cfg_cmd_type {CFG_BYTE_CMD =0 ,
drivers/staging/wilc1000/wlan_cfg.h renamed from drivers/staging/wilc1000/wilc_wlan_cfg.h +0 -0
drivers/staging/wilc1000/wlan_if.h renamed from drivers/staging/wilc1000/wilc_wlan_if.h +0 -0
Signature · 1 line
2.22.0
PATCH 3/6 staging: wilc1000: added 'WILC_' prefix in header guard macro
In reply to [email protected]From: Ajay Singh <[email protected]>
Use 'WILC_' prefix in header guard to follow the proper naming convention for macro name.
--- drivers/staging/wilc1000/cfg80211.h | 4 ++-- drivers/staging/wilc1000/hif.h | 4 ++-- drivers/staging/wilc1000/netdev.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/wilc1000/cfg80211.h +2 -2
@@ -4,8 +4,8 @@* All rights reserved. */ -#ifndef NM_WFI_CFGOPERATIONS -#define NM_WFI_CFGOPERATIONS +#ifndef WILC_CFG80211_H +#define WILC_CFG80211_H #include "netdev.h" struct wiphy *wilc_cfg_alloc (void );
drivers/staging/wilc1000/hif.h +2 -2
@@ -4,8 +4,8 @@* All rights reserved. */ -#ifndef HOST_INT_H -#define HOST_INT_H +#ifndef WILC_HIF_H +#define WILC_HIF_H #include <linux/ieee80211.h> #include "wlan_if.h"
drivers/staging/wilc1000/netdev.h +2 -2
@@ -4,8 +4,8 @@* All rights reserved. */ -#ifndef WILC_WFI_NETDEVICE -#define WILC_WFI_NETDEVICE +#ifndef WILC_NETDEV_H +#define WILC_NETDEV_H #include <linux/tcp.h> #include <linux/ieee80211.h>
Signature · 1 line
2.22.0
PATCH 4/6 staging: wilc1000: avoid use of C++ style comments
In reply to [email protected]From: Ajay Singh <[email protected]>
Replace C++ style comment with C style.
--- drivers/staging/wilc1000/hif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/hif.c +1 -1
@@ -552,7 +552,7 @@ void *wilc_parse_join_bss_param(struct cfg80211_bss *bss, param->mode_802_11i =2 ; param->rsn_found = true; -//extract RSN capabilities +/* extract RSN capabilities */ offset += (rsn_ie[offset] *4 ) +2 ; offset += (rsn_ie[offset] *4 ) +2 ;memcpy (param->rsn_cap, &rsn_ie[offset],2 );
Signature · 1 line
2.22.0
PATCH 5/6 staging: wilc1000: added proper spacing for comments
In reply to [email protected]From: Ajay Singh <[email protected]>
Added proper space for the comments and added newline before the comments inside a struct.
--- drivers/staging/wilc1000/mon.c | 2 +- drivers/staging/wilc1000/netdev.h | 19 ++++++++++++++----- drivers/staging/wilc1000/wlan.h | 2 +- drivers/staging/wilc1000/wlan_cfg.c | 2 +- drivers/staging/wilc1000/wlan_if.h | 8 ++++---- 5 files changed, 21 insertions(+), 12 deletions(-)
drivers/staging/wilc1000/mon.c +1 -1
@@ -220,7 +220,7 @@ struct net_device *wilc_wfi_init_mon_interface(struct wilc *wl, {struct wilc_wfi_mon_priv *priv; -/*If monitor interface is already initialized, return it*/ +/* If monitor interface is already initialized, return it */ if (wl->monitor_dev)return wl->monitor_dev;
drivers/staging/wilc1000/netdev.h +14 -5
@@ -60,7 +60,7 @@ struct sta_info {u8 sta_associated_bss[WILC_MAX_NUM_STA ][ETH_ALEN ]; }; -/*Parameters needed for host interface for remaining on channel*/ +/* Parameters needed for host interface for remaining on channel */ struct wilc_wfi_p2p_listen_params {struct ieee80211_channel *listen_ch;u32 listen_duration;
@@ -145,11 +145,13 @@ struct wilc_priv {struct wilc_pmkid_attr pmkid_list;u8 wep_key[4 ][WLAN_KEY_LEN_WEP104 ];u8 wep_key_len[4 ]; +/* The real interface that the monitor is on */ struct net_device *real_ndev;struct wilc_wfi_key *wilc_gtk[WILC_MAX_NUM_STA ];struct wilc_wfi_key *wilc_ptk[WILC_MAX_NUM_STA ];u8 wilc_groupkey; +/* mutexes */ struct mutex scan_req_lock;bool p2p_listen_state;
@@ -224,16 +226,21 @@ struct wilc {int close;u8 vif_num;struct list_head vif_list; -/*protect vif list*/ + +/* protect vif list */ struct mutex vif_mutex;struct srcu_struct srcu;u8 open_ifcs; -/*protect head of transmit queue*/ + +/* protect head of transmit queue */ struct mutex txq_add_to_head_cs; -/*protect txq_entry_t transmit queue*/ + +/* protect txq_entry_t transmit queue */ spinlock_t txq_spinlock; -/*protect rxq_entry_t receiver queue*/ + +/* protect rxq_entry_t receiver queue */ struct mutex rxq_cs; +/* lock to protect hif access */ struct mutex hif_cs;
@@ -245,6 +252,7 @@ struct wilc {struct task_struct *txq_thread;int quit; +/* lock to protect issue of wid command to firmware */ struct mutex cfg_cmd_lock;struct wilc_cfg_frame cfg_frame;
@@ -271,6 +279,7 @@ struct wilc {struct wilc_cfg cfg;void *bus_data;struct net_device *monitor_dev; +/* deinit lock */ struct mutex deinit_lock;u8 sta_ch;
drivers/staging/wilc1000/wlan.h +1 -1
@@ -190,7 +190,7 @@#define ENABLE_RX_VMM (SEL_VMM_TBL1 | EN_VMM)#define ENABLE_TX_VMM (SEL_VMM_TBL0 | EN_VMM) -/*time for expiring the completion of cfg packets*/ +/* time for expiring the completion of cfg packets */ #define WILC_CFG_PKTS_TIMEOUT msecs_to_jiffies(2000)#define IS_MANAGMEMENT 0x100
drivers/staging/wilc1000/wlan_cfg.c +1 -1
@@ -378,7 +378,7 @@ void wilc_wlan_cfg_indicate_rx(struct wilc *wilc, u8 *frame, int size,wilc_wlan_parse_info_frame (wilc, frame); rsp->type =WILC_CFG_RSP_STATUS ; rsp->seq_no = msg_id; -/*call host interface info parse as well*/ +/* call host interface info parse as well */ wilc_gnrl_async_info_received (wilc, frame -4 , size +4 );break ;
drivers/staging/wilc1000/wlan_if.h +4 -4
@@ -750,10 +750,10 @@ enum {WID_REMOVE_KEY =0x301E ,WID_ASSOC_REQ_INFO =0x301F ,WID_ASSOC_RES_INFO =0x3020 , -WID_MANUFACTURER =0x3026 ,/*Added for CAPI tool */ -WID_MODEL_NAME =0x3027 ,/*Added for CAPI tool */ -WID_MODEL_NUM =0x3028 ,/*Added for CAPI tool */ -WID_DEVICE_NAME =0x3029 ,/*Added for CAPI tool */ +WID_MANUFACTURER =0x3026 ,/* Added for CAPI tool */ +WID_MODEL_NAME =0x3027 ,/* Added for CAPI tool */ +WID_MODEL_NUM =0x3028 ,/* Added for CAPI tool */ +WID_DEVICE_NAME =0x3029 ,/* Added for CAPI tool */ /* NMAC String WID list */ WID_SET_OPERATION_MODE = 0x3079,
Signature · 1 line
2.22.0
PATCH 6/6 staging: wilc1000: use defines for msg types received from firmware
In reply to [email protected]From: Ajay Singh <[email protected]>
Added defines for different types of messages received from firmware. Removed the unnecessary comments because after the addition of macros the message types are self-explanatory.
--- drivers/staging/wilc1000/wlan_cfg.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)
drivers/staging/wilc1000/wlan_cfg.c +9 -11
@@ -44,6 +44,11 @@ static const struct wilc_cfg_str g_cfg_str[] = { {WID_NIL, NULL} }; +#define WILC_RESP_MSG_TYPE_CONFIG_REPLY 'R' +#define WILC_RESP_MSG_TYPE_STATUS_INFO 'I' +#define WILC_RESP_MSG_TYPE_NETWORK_INFO 'N' +#define WILC_RESP_MSG_TYPE_SCAN_COMPLETE 'S' +/******************************************** * * Configuration Functions
@@ -360,21 +365,14 @@ void wilc_wlan_cfg_indicate_rx(struct wilc *wilc, u8 *frame, int size, size -=4 ; rsp->type =0 ; -/* -* The valid types of response messages are -* 'R' (Response), -* 'I' (Information), and -* 'N' (Network Information) -*/ -switch (msg_type) { -case 'R' : +case WILC_RESP_MSG_TYPE_CONFIG_REPLY :wilc_wlan_parse_response_frame (wilc, frame, size); rsp->type =WILC_CFG_RSP ; rsp->seq_no = msg_id;break ; -case 'I' : +case WILC_RESP_MSG_TYPE_STATUS_INFO :wilc_wlan_parse_info_frame (wilc, frame); rsp->type =WILC_CFG_RSP_STATUS ; rsp->seq_no = msg_id;
@@ -382,11 +380,11 @@ void wilc_wlan_cfg_indicate_rx(struct wilc *wilc, u8 *frame, int size,wilc_gnrl_async_info_received (wilc, frame -4 , size +4 );break ; -case 'N' : +case WILC_RESP_MSG_TYPE_NETWORK_INFO :wilc_network_info_received (wilc, frame -4 , size +4 );break ; -case 'S' : +case WILC_RESP_MSG_TYPE_SCAN_COMPLETE :wilc_scan_complete_received (wilc, frame -4 , size +4 );break ;
Signature · 1 line
2.22.0