2018-03-08 15:10:46

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 00/10] staging: wilc1000: fixes related to camelCase & line over 80 chars

Patch series contains fixes to remove checkpatch reported warnings.

Ajay Singh (10):
staging: wilc1000: rename strHiddenNetwork to avoid camelCase
staging: wilc1000: rename pstrNetworkInfo to avoid camelCase
staging: wilc1000: rename CfgScanResult to avoid camelCase
staging: wilc1000: rename au8ScanChanList to avoid camelCase
staging: wilc1000: fix line over 80 char in change_virtual_intf()
staging: wilc1000: fix line over 80 char in get_key() &
set_default_key()
staging: wilc1000: fix line over 80 char for cfg parse RX and TX
function
staging: wilc1000: fix line over 80 char in mgmt_tx_cancel_wait()
staging: wilc1000: rename pJoinParams to avoid camelCase
staging: wilc1000: fix line over 80 char in cfg_scan_result()

drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 329 +++++++++++-----------
1 file changed, 168 insertions(+), 161 deletions(-)

--
2.7.4


2018-03-08 15:11:02

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 05/10] staging: wilc1000: fix line over 80 char in change_virtual_intf()

Fix 'line over 80 char' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 1f6c02a..3354bf2 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1804,7 +1804,8 @@ static int set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
}

static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
- enum nl80211_iftype type, struct vif_params *params)
+ enum nl80211_iftype type,
+ struct vif_params *params)
{
struct wilc_priv *priv;
struct wilc_vif *vif;
@@ -1828,7 +1829,8 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
vif->iftype = STATION_MODE;
wilc_set_operation_mode(vif, STATION_MODE);

- memset(priv->assoc_stainfo.sta_associated_bss, 0, MAX_NUM_STA * ETH_ALEN);
+ memset(priv->assoc_stainfo.sta_associated_bss, 0,
+ MAX_NUM_STA * ETH_ALEN);

wilc_enable_ps = true;
wilc_set_power_mgmt(vif, 1, 0);
--
2.7.4

2018-03-09 08:27:13

by Claudiu Beznea

[permalink] [raw]
Subject: Re: [PATCH 10/10] staging: wilc1000: fix line over 80 char in cfg_scan_result()



On 07.03.2018 03:32, Ajay Singh wrote:
> Refactor cfg_scan_result() API to avoid 'line over 80 chars' issue
> reported by checkpatch.pl script.
>
> Signed-off-by: Ajay Singh <[email protected]>
> ---
> drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 148 +++++++++++-----------
> 1 file changed, 77 insertions(+), 71 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> index 9da686b..5395648 100644
> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> @@ -374,91 +374,97 @@ static void cfg_scan_result(enum scan_event scan_event,
> struct cfg80211_bss *bss = NULL;
>
> priv = user_void;
> - if (priv->cfg_scanning) {
> - if (scan_event == SCAN_EVENT_NETWORK_FOUND) {
> - wiphy = priv->dev->ieee80211_ptr->wiphy;
> + if (!priv->cfg_scanning)
> + return;
> +
> + if (scan_event == SCAN_EVENT_NETWORK_FOUND) {
> + wiphy = priv->dev->ieee80211_ptr->wiphy;
> +
> + if (!wiphy || !network_info)
> + return;
>
> - if (!wiphy)
> + if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC &&
> + (((s32)network_info->rssi * 100) < 0 ||
> + ((s32)network_info->rssi * 100) > 100))
> + return;
> +
> + s32Freq = ieee80211_channel_to_frequency((s32)network_info->ch,
> + NL80211_BAND_2GHZ);
> + channel = ieee80211_get_channel(wiphy, s32Freq);
> +
> + if (!channel)
> + return;
> +
> + if (network_info->new_network) {
> + if (priv->rcvd_ch_cnt >= MAX_NUM_SCANNED_NETWORKS)
> return;
>
> - if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC &&
> - (((s32)network_info->rssi * 100) < 0 ||
> - ((s32)network_info->rssi * 100) > 100))
> + priv->rcvd_ch_cnt++;
> +
> + add_network_to_shadow(network_info, priv, join_params);
> +
> + if (memcmp("DIRECT-", network_info->ssid, 7))
> return;
>
> - if (network_info) {
> - s32Freq = ieee80211_channel_to_frequency((s32)network_info->ch, NL80211_BAND_2GHZ);
> - channel = ieee80211_get_channel(wiphy, s32Freq);
> -
> - if (!channel)
> - return;
> -
> - if (network_info->new_network) {
> - if (priv->rcvd_ch_cnt < MAX_NUM_SCANNED_NETWORKS) {
> - priv->rcvd_ch_cnt++;
> -
> - add_network_to_shadow(network_info, priv, join_params);
> -
> - if (!(memcmp("DIRECT-", network_info->ssid, 7))) {
> - bss = cfg80211_inform_bss(wiphy,
> - channel,
> - CFG80211_BSS_FTYPE_UNKNOWN,
> - network_info->bssid,
> - network_info->tsf_hi,
> - network_info->cap_info,
> - network_info->beacon_period,
> - (const u8 *)network_info->ies,
> - (size_t)network_info->ies_len,
> - (s32)network_info->rssi * 100,
> - GFP_KERNEL);
> - cfg80211_put_bss(wiphy, bss);
> - }
> - }
> - } else {
> - u32 i;
> + bss = cfg80211_inform_bss(wiphy,
> + channel,
> + CFG80211_BSS_FTYPE_UNKNOWN,
> + network_info->bssid,
> + network_info->tsf_hi,
> + network_info->cap_info,
> + network_info->beacon_period,
> + (const u8 *)network_info->ies,
> + (size_t)network_info->ies_len,
> + (s32)network_info->rssi * 100,
> + GFP_KERNEL);
> + cfg80211_put_bss(wiphy, bss);
> + } else {
> + u32 i;
>
> - for (i = 0; i < priv->rcvd_ch_cnt; i++) {
> - if (memcmp(last_scanned_shadow[i].bssid, network_info->bssid, 6) == 0) {
> - last_scanned_shadow[i].rssi = network_info->rssi;
> - last_scanned_shadow[i].time_scan = jiffies;
> - break;
> - }
> - }
> - }
> + for (i = 0; i < priv->rcvd_ch_cnt; i++) {
> + if (memcmp(last_scanned_shadow[i].bssid,
> + network_info->bssid, 6) == 0)
> + break;
> }
> - } else if (scan_event == SCAN_EVENT_DONE) {
> - refresh_scan(priv, false);
>
> - mutex_lock(&priv->scan_req_lock);
> + if (i >= priv->rcvd_ch_cnt)
> + return;
This complicates a little the logic... I don't now if it's worth...
>
> - if (priv->scan_req) {
> - struct cfg80211_scan_info info = {
> - .aborted = false,
> - };
> + last_scanned_shadow[i].rssi = network_info->rssi;
> + last_scanned_shadow[i].time_scan = jiffies;
> + }
> + } else if (scan_event == SCAN_EVENT_DONE) {
> + refresh_scan(priv, false);
>
> - cfg80211_scan_done(priv->scan_req, &info);
> - priv->rcvd_ch_cnt = 0;
> - priv->cfg_scanning = false;
> - priv->scan_req = NULL;
> - }
> - mutex_unlock(&priv->scan_req_lock);
> - } else if (scan_event == SCAN_EVENT_ABORTED) {
> - mutex_lock(&priv->scan_req_lock);
> + mutex_lock(&priv->scan_req_lock);
>
> - if (priv->scan_req) {
> - struct cfg80211_scan_info info = {
> - .aborted = false,
> - };
> + if (priv->scan_req) {
> + struct cfg80211_scan_info info = {
> + .aborted = false,
> + };
>
> - update_scan_time();
> - refresh_scan(priv, false);
> + cfg80211_scan_done(priv->scan_req, &info);
> + priv->rcvd_ch_cnt = 0;
> + priv->cfg_scanning = false;
> + priv->scan_req = NULL;
> + }
> + mutex_unlock(&priv->scan_req_lock);
> + } else if (scan_event == SCAN_EVENT_ABORTED) {
> + mutex_lock(&priv->scan_req_lock);
>
> - cfg80211_scan_done(priv->scan_req, &info);
> - priv->cfg_scanning = false;
> - priv->scan_req = NULL;
> - }
> - mutex_unlock(&priv->scan_req_lock);
> + if (priv->scan_req) {
> + struct cfg80211_scan_info info = {
> + .aborted = false,
> + };
> +
> + update_scan_time();
> + refresh_scan(priv, false);
> +
> + cfg80211_scan_done(priv->scan_req, &info);
> + priv->cfg_scanning = false;
> + priv->scan_req = NULL;
> }
> + mutex_unlock(&priv->scan_req_lock);
> }
> }
>
>

2018-03-08 15:10:56

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 03/10] staging: wilc1000: rename CfgScanResult to avoid camelCase

Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 2fda90d..051ba12 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -363,10 +363,9 @@ static void add_network_to_shadow(struct network_info *nw_info,
last_scanned_shadow[ap_index].join_params = pJoinParams;
}

-static void CfgScanResult(enum scan_event scan_event,
- struct network_info *network_info,
- void *user_void,
- void *join_params)
+static void cfg_scan_result(enum scan_event scan_event,
+ struct network_info *network_info,
+ void *user_void, void *join_params)
{
struct wilc_priv *priv;
struct wiphy *wiphy;
@@ -622,14 +621,14 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
au8ScanChanList,
request->n_channels,
(const u8 *)request->ie,
- request->ie_len, CfgScanResult,
+ request->ie_len, cfg_scan_result,
(void *)priv, &hidden_ntwk);
} else {
ret = wilc_scan(vif, USER_SCAN, ACTIVE_SCAN,
au8ScanChanList,
request->n_channels,
(const u8 *)request->ie,
- request->ie_len, CfgScanResult,
+ request->ie_len, cfg_scan_result,
(void *)priv, NULL);
}
} else {
--
2.7.4

2018-03-08 15:11:13

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 08/10] staging: wilc1000: fix line over 80 char in mgmt_tx_cancel_wait()

Fix 'line over 80 char' issue found in checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 911af68..a93c550 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1705,9 +1705,13 @@ static int mgmt_tx_cancel_wait(struct wiphy *wiphy,
wfi_drv->p2p_timeout = jiffies;

if (!priv->p2p_listen_state) {
+ struct wilc_wfi_p2p_listen_params *params;
+
+ params = &priv->remain_on_ch_params;
+
cfg80211_remain_on_channel_expired(priv->wdev,
- priv->remain_on_ch_params.listen_cookie,
- priv->remain_on_ch_params.listen_ch,
+ params->listen_cookie,
+ params->listen_ch,
GFP_KERNEL);
}

--
2.7.4

2018-03-08 15:10:49

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 01/10] staging: wilc1000: rename strHiddenNetwork to avoid camelCase

Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 205304c..dd7ab51 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -584,7 +584,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
u32 i;
s32 ret = 0;
u8 au8ScanChanList[MAX_NUM_SCANNED_NETWORKS];
- struct hidden_network strHiddenNetwork;
+ struct hidden_network hidden_ntwk;
struct wilc_vif *vif;

priv = wiphy_priv(wiphy);
@@ -602,21 +602,21 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
au8ScanChanList[i] = (u8)ieee80211_frequency_to_channel(request->channels[i]->center_freq);

if (request->n_ssids >= 1) {
- strHiddenNetwork.net_info =
+ hidden_ntwk.net_info =
kmalloc_array(request->n_ssids,
sizeof(struct hidden_network),
GFP_KERNEL);
- if (!strHiddenNetwork.net_info)
+ if (!hidden_ntwk.net_info)
return -ENOMEM;
- strHiddenNetwork.n_ssids = request->n_ssids;
+ hidden_ntwk.n_ssids = request->n_ssids;

for (i = 0; i < request->n_ssids; i++) {
if (request->ssids[i].ssid_len != 0) {
- strHiddenNetwork.net_info[i].ssid = kmalloc(request->ssids[i].ssid_len, GFP_KERNEL);
- memcpy(strHiddenNetwork.net_info[i].ssid, request->ssids[i].ssid, request->ssids[i].ssid_len);
- strHiddenNetwork.net_info[i].ssid_len = request->ssids[i].ssid_len;
+ hidden_ntwk.net_info[i].ssid = kmalloc(request->ssids[i].ssid_len, GFP_KERNEL);
+ memcpy(hidden_ntwk.net_info[i].ssid, request->ssids[i].ssid, request->ssids[i].ssid_len);
+ hidden_ntwk.net_info[i].ssid_len = request->ssids[i].ssid_len;
} else {
- strHiddenNetwork.n_ssids -= 1;
+ hidden_ntwk.n_ssids -= 1;
}
}
ret = wilc_scan(vif, USER_SCAN, ACTIVE_SCAN,
@@ -624,7 +624,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
request->n_channels,
(const u8 *)request->ie,
request->ie_len, CfgScanResult,
- (void *)priv, &strHiddenNetwork);
+ (void *)priv, &hidden_ntwk);
} else {
ret = wilc_scan(vif, USER_SCAN, ACTIVE_SCAN,
au8ScanChanList,
--
2.7.4

2018-03-09 08:27:45

by Claudiu Beznea

[permalink] [raw]
Subject: Re: [PATCH 00/10] staging: wilc1000: fixes related to camelCase & line over 80 chars

Reviewed-by: Claudiu Beznea <[email protected]>

On 07.03.2018 03:32, Ajay Singh wrote:
> Patch series contains fixes to remove checkpatch reported warnings.
>
> Ajay Singh (10):
> staging: wilc1000: rename strHiddenNetwork to avoid camelCase
> staging: wilc1000: rename pstrNetworkInfo to avoid camelCase
> staging: wilc1000: rename CfgScanResult to avoid camelCase
> staging: wilc1000: rename au8ScanChanList to avoid camelCase
> staging: wilc1000: fix line over 80 char in change_virtual_intf()
> staging: wilc1000: fix line over 80 char in get_key() &
> set_default_key()
> staging: wilc1000: fix line over 80 char for cfg parse RX and TX
> function
> staging: wilc1000: fix line over 80 char in mgmt_tx_cancel_wait()
> staging: wilc1000: rename pJoinParams to avoid camelCase
> staging: wilc1000: fix line over 80 char in cfg_scan_result()
>
> drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 329 +++++++++++-----------
> 1 file changed, 168 insertions(+), 161 deletions(-)
>

2018-03-08 15:11:09

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 07/10] staging: wilc1000: fix line over 80 char for cfg parse RX and TX function

Fix 'line over 80 characters' issue found by checkpatch.pl script. Moved
the common code from wilc_wfi_cfg_parse_tx_action() &
wilc_wfi_cfg_parse_rx_action() to new function to avoid checkpatch issue.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 67 +++++++++++------------
1 file changed, 32 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 92c3213..911af68 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1337,10 +1337,33 @@ static int flush_pmksa(struct wiphy *wiphy, struct net_device *netdev)
return 0;
}

+static inline void wilc_wfi_cfg_parse_ch_attr(u8 *buf, u8 ch_list_attr_idx,
+ u8 op_ch_attr_idx)
+{
+ int i = 0;
+ int j = 0;
+
+ if (ch_list_attr_idx) {
+ u8 limit = ch_list_attr_idx + 3 + buf[ch_list_attr_idx + 1];
+
+ for (i = ch_list_attr_idx + 3; i < limit; i++) {
+ if (buf[i] == 0x51) {
+ for (j = i + 2; j < ((i + 2) + buf[i + 1]); j++)
+ buf[j] = wlan_channel;
+ break;
+ }
+ }
+ }
+
+ if (op_ch_attr_idx) {
+ buf[op_ch_attr_idx + 6] = 0x51;
+ buf[op_ch_attr_idx + 7] = wlan_channel;
+ }
+}
+
static void wilc_wfi_cfg_parse_rx_action(u8 *buf, u32 len)
{
u32 index = 0;
- u32 i = 0, j = 0;

u8 op_channel_attr_index = 0;
u8 channel_list_attr_index = 0;
@@ -1355,28 +1378,15 @@ static void wilc_wfi_cfg_parse_rx_action(u8 *buf, u32 len)
op_channel_attr_index = index;
index += buf[index + 1] + 3;
}
- if (wlan_channel != INVALID_CHANNEL) {
- if (channel_list_attr_index) {
- for (i = channel_list_attr_index + 3; i < ((channel_list_attr_index + 3) + buf[channel_list_attr_index + 1]); i++) {
- if (buf[i] == 0x51) {
- for (j = i + 2; j < ((i + 2) + buf[i + 1]); j++)
- buf[j] = wlan_channel;
- break;
- }
- }
- }
-
- if (op_channel_attr_index) {
- buf[op_channel_attr_index + 6] = 0x51;
- buf[op_channel_attr_index + 7] = wlan_channel;
- }
- }
+ if (wlan_channel != INVALID_CHANNEL)
+ wilc_wfi_cfg_parse_ch_attr(buf, channel_list_attr_index,
+ op_channel_attr_index);
}

-static void wilc_wfi_cfg_parse_tx_action(u8 *buf, u32 len, bool oper_ch, u8 iftype)
+static void wilc_wfi_cfg_parse_tx_action(u8 *buf, u32 len, bool oper_ch,
+ u8 iftype)
{
u32 index = 0;
- u32 i = 0, j = 0;

u8 op_channel_attr_index = 0;
u8 channel_list_attr_index = 0;
@@ -1394,22 +1404,9 @@ static void wilc_wfi_cfg_parse_tx_action(u8 *buf, u32 len, bool oper_ch, u8 ifty
op_channel_attr_index = index;
index += buf[index + 1] + 3;
}
- if (wlan_channel != INVALID_CHANNEL && oper_ch) {
- if (channel_list_attr_index) {
- for (i = channel_list_attr_index + 3; i < ((channel_list_attr_index + 3) + buf[channel_list_attr_index + 1]); i++) {
- if (buf[i] == 0x51) {
- for (j = i + 2; j < ((i + 2) + buf[i + 1]); j++)
- buf[j] = wlan_channel;
- break;
- }
- }
- }
-
- if (op_channel_attr_index) {
- buf[op_channel_attr_index + 6] = 0x51;
- buf[op_channel_attr_index + 7] = wlan_channel;
- }
- }
+ if (wlan_channel != INVALID_CHANNEL && oper_ch)
+ wilc_wfi_cfg_parse_ch_attr(buf, channel_list_attr_index,
+ op_channel_attr_index);
}

void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size)
--
2.7.4

2018-03-08 15:10:59

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 04/10] staging: wilc1000: rename au8ScanChanList to avoid camelCase

Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 051ba12..1f6c02a 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -581,7 +581,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
struct wilc_priv *priv;
u32 i;
s32 ret = 0;
- u8 au8ScanChanList[MAX_NUM_SCANNED_NETWORKS];
+ u8 scan_ch_list[MAX_NUM_SCANNED_NETWORKS];
struct hidden_network hidden_ntwk;
struct wilc_vif *vif;

@@ -597,7 +597,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
priv->cfg_scanning = true;
if (request->n_channels <= MAX_NUM_SCANNED_NETWORKS) {
for (i = 0; i < request->n_channels; i++)
- au8ScanChanList[i] = (u8)ieee80211_frequency_to_channel(request->channels[i]->center_freq);
+ scan_ch_list[i] = (u8)ieee80211_frequency_to_channel(request->channels[i]->center_freq);

if (request->n_ssids >= 1) {
hidden_ntwk.net_info =
@@ -618,14 +618,14 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
}
}
ret = wilc_scan(vif, USER_SCAN, ACTIVE_SCAN,
- au8ScanChanList,
+ scan_ch_list,
request->n_channels,
(const u8 *)request->ie,
request->ie_len, cfg_scan_result,
(void *)priv, &hidden_ntwk);
} else {
ret = wilc_scan(vif, USER_SCAN, ACTIVE_SCAN,
- au8ScanChanList,
+ scan_ch_list,
request->n_channels,
(const u8 *)request->ie,
request->ie_len, cfg_scan_result,
--
2.7.4

2018-03-08 15:10:52

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 02/10] staging: wilc1000: rename pstrNetworkInfo to avoid camelCase

Fix 'Avoid camleCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 51 +++++++++++------------
1 file changed, 25 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index dd7ab51..2fda90d 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -294,8 +294,7 @@ static void clear_duringIP(struct timer_list *unused)
wilc_optaining_ip = false;
}

-static int is_network_in_shadow(struct network_info *pstrNetworkInfo,
- void *user_void)
+static int is_network_in_shadow(struct network_info *nw_info, void *user_void)
{
int state = -1;
int i;
@@ -306,7 +305,7 @@ static int is_network_in_shadow(struct network_info *pstrNetworkInfo,
} else {
for (i = 0; i < last_scanned_cnt; i++) {
if (memcmp(last_scanned_shadow[i].bssid,
- pstrNetworkInfo->bssid, 6) == 0) {
+ nw_info->bssid, 6) == 0) {
state = i;
break;
}
@@ -315,10 +314,10 @@ static int is_network_in_shadow(struct network_info *pstrNetworkInfo,
return state;
}

-static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
+static void add_network_to_shadow(struct network_info *nw_info,
void *user_void, void *pJoinParams)
{
- int ap_found = is_network_in_shadow(pstrNetworkInfo, user_void);
+ int ap_found = is_network_in_shadow(nw_info, user_void);
u32 ap_index = 0;
u8 rssi_index = 0;

@@ -332,30 +331,30 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
ap_index = ap_found;
}
rssi_index = last_scanned_shadow[ap_index].rssi_history.index;
- last_scanned_shadow[ap_index].rssi_history.samples[rssi_index++] = pstrNetworkInfo->rssi;
+ last_scanned_shadow[ap_index].rssi_history.samples[rssi_index++] = nw_info->rssi;
if (rssi_index == NUM_RSSI) {
rssi_index = 0;
last_scanned_shadow[ap_index].rssi_history.full = true;
}
last_scanned_shadow[ap_index].rssi_history.index = rssi_index;
- last_scanned_shadow[ap_index].rssi = pstrNetworkInfo->rssi;
- last_scanned_shadow[ap_index].cap_info = pstrNetworkInfo->cap_info;
- last_scanned_shadow[ap_index].ssid_len = pstrNetworkInfo->ssid_len;
+ last_scanned_shadow[ap_index].rssi = nw_info->rssi;
+ last_scanned_shadow[ap_index].cap_info = nw_info->cap_info;
+ last_scanned_shadow[ap_index].ssid_len = nw_info->ssid_len;
memcpy(last_scanned_shadow[ap_index].ssid,
- pstrNetworkInfo->ssid, pstrNetworkInfo->ssid_len);
+ nw_info->ssid, nw_info->ssid_len);
memcpy(last_scanned_shadow[ap_index].bssid,
- pstrNetworkInfo->bssid, ETH_ALEN);
- last_scanned_shadow[ap_index].beacon_period = pstrNetworkInfo->beacon_period;
- last_scanned_shadow[ap_index].dtim_period = pstrNetworkInfo->dtim_period;
- last_scanned_shadow[ap_index].ch = pstrNetworkInfo->ch;
- last_scanned_shadow[ap_index].ies_len = pstrNetworkInfo->ies_len;
- last_scanned_shadow[ap_index].tsf_hi = pstrNetworkInfo->tsf_hi;
+ nw_info->bssid, ETH_ALEN);
+ last_scanned_shadow[ap_index].beacon_period = nw_info->beacon_period;
+ last_scanned_shadow[ap_index].dtim_period = nw_info->dtim_period;
+ last_scanned_shadow[ap_index].ch = nw_info->ch;
+ last_scanned_shadow[ap_index].ies_len = nw_info->ies_len;
+ last_scanned_shadow[ap_index].tsf_hi = nw_info->tsf_hi;
if (ap_found != -1)
kfree(last_scanned_shadow[ap_index].ies);
- last_scanned_shadow[ap_index].ies = kmalloc(pstrNetworkInfo->ies_len,
+ last_scanned_shadow[ap_index].ies = kmalloc(nw_info->ies_len,
GFP_KERNEL);
memcpy(last_scanned_shadow[ap_index].ies,
- pstrNetworkInfo->ies, pstrNetworkInfo->ies_len);
+ nw_info->ies, nw_info->ies_len);
last_scanned_shadow[ap_index].time_scan = jiffies;
last_scanned_shadow[ap_index].time_scan_cached = jiffies;
last_scanned_shadow[ap_index].found = 1;
@@ -654,7 +653,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,

struct wilc_priv *priv;
struct host_if_drv *wfi_drv;
- struct network_info *pstrNetworkInfo = NULL;
+ struct network_info *nw_info = NULL;
struct wilc_vif *vif;

wilc_connecting = 1;
@@ -689,7 +688,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
}

if (sel_bssi_idx < last_scanned_cnt) {
- pstrNetworkInfo = &last_scanned_shadow[sel_bssi_idx];
+ nw_info = &last_scanned_shadow[sel_bssi_idx];
} else {
ret = -ENOENT;
wilc_connecting = 0;
@@ -782,19 +781,19 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
}
}

- curr_channel = pstrNetworkInfo->ch;
+ curr_channel = nw_info->ch;

if (!wfi_drv->p2p_connect)
- wlan_channel = pstrNetworkInfo->ch;
+ wlan_channel = nw_info->ch;

- wilc_wlan_set_bssid(dev, pstrNetworkInfo->bssid, STATION_MODE);
+ wilc_wlan_set_bssid(dev, nw_info->bssid, STATION_MODE);

- ret = wilc_set_join_req(vif, pstrNetworkInfo->bssid, sme->ssid,
+ ret = wilc_set_join_req(vif, nw_info->bssid, sme->ssid,
sme->ssid_len, sme->ie, sme->ie_len,
cfg_connect_result, (void *)priv,
u8security, auth_type,
- pstrNetworkInfo->ch,
- pstrNetworkInfo->join_params);
+ nw_info->ch,
+ nw_info->join_params);
if (ret != 0) {
netdev_err(dev, "wilc_set_join_req(): Error\n");
ret = -ENOENT;
--
2.7.4

2018-03-08 15:11:20

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 10/10] staging: wilc1000: fix line over 80 char in cfg_scan_result()

Refactor cfg_scan_result() API to avoid 'line over 80 chars' issue
reported by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 148 +++++++++++-----------
1 file changed, 77 insertions(+), 71 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 9da686b..5395648 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -374,91 +374,97 @@ static void cfg_scan_result(enum scan_event scan_event,
struct cfg80211_bss *bss = NULL;

priv = user_void;
- if (priv->cfg_scanning) {
- if (scan_event == SCAN_EVENT_NETWORK_FOUND) {
- wiphy = priv->dev->ieee80211_ptr->wiphy;
+ if (!priv->cfg_scanning)
+ return;
+
+ if (scan_event == SCAN_EVENT_NETWORK_FOUND) {
+ wiphy = priv->dev->ieee80211_ptr->wiphy;
+
+ if (!wiphy || !network_info)
+ return;

- if (!wiphy)
+ if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC &&
+ (((s32)network_info->rssi * 100) < 0 ||
+ ((s32)network_info->rssi * 100) > 100))
+ return;
+
+ s32Freq = ieee80211_channel_to_frequency((s32)network_info->ch,
+ NL80211_BAND_2GHZ);
+ channel = ieee80211_get_channel(wiphy, s32Freq);
+
+ if (!channel)
+ return;
+
+ if (network_info->new_network) {
+ if (priv->rcvd_ch_cnt >= MAX_NUM_SCANNED_NETWORKS)
return;

- if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC &&
- (((s32)network_info->rssi * 100) < 0 ||
- ((s32)network_info->rssi * 100) > 100))
+ priv->rcvd_ch_cnt++;
+
+ add_network_to_shadow(network_info, priv, join_params);
+
+ if (memcmp("DIRECT-", network_info->ssid, 7))
return;

- if (network_info) {
- s32Freq = ieee80211_channel_to_frequency((s32)network_info->ch, NL80211_BAND_2GHZ);
- channel = ieee80211_get_channel(wiphy, s32Freq);
-
- if (!channel)
- return;
-
- if (network_info->new_network) {
- if (priv->rcvd_ch_cnt < MAX_NUM_SCANNED_NETWORKS) {
- priv->rcvd_ch_cnt++;
-
- add_network_to_shadow(network_info, priv, join_params);
-
- if (!(memcmp("DIRECT-", network_info->ssid, 7))) {
- bss = cfg80211_inform_bss(wiphy,
- channel,
- CFG80211_BSS_FTYPE_UNKNOWN,
- network_info->bssid,
- network_info->tsf_hi,
- network_info->cap_info,
- network_info->beacon_period,
- (const u8 *)network_info->ies,
- (size_t)network_info->ies_len,
- (s32)network_info->rssi * 100,
- GFP_KERNEL);
- cfg80211_put_bss(wiphy, bss);
- }
- }
- } else {
- u32 i;
+ bss = cfg80211_inform_bss(wiphy,
+ channel,
+ CFG80211_BSS_FTYPE_UNKNOWN,
+ network_info->bssid,
+ network_info->tsf_hi,
+ network_info->cap_info,
+ network_info->beacon_period,
+ (const u8 *)network_info->ies,
+ (size_t)network_info->ies_len,
+ (s32)network_info->rssi * 100,
+ GFP_KERNEL);
+ cfg80211_put_bss(wiphy, bss);
+ } else {
+ u32 i;

- for (i = 0; i < priv->rcvd_ch_cnt; i++) {
- if (memcmp(last_scanned_shadow[i].bssid, network_info->bssid, 6) == 0) {
- last_scanned_shadow[i].rssi = network_info->rssi;
- last_scanned_shadow[i].time_scan = jiffies;
- break;
- }
- }
- }
+ for (i = 0; i < priv->rcvd_ch_cnt; i++) {
+ if (memcmp(last_scanned_shadow[i].bssid,
+ network_info->bssid, 6) == 0)
+ break;
}
- } else if (scan_event == SCAN_EVENT_DONE) {
- refresh_scan(priv, false);

- mutex_lock(&priv->scan_req_lock);
+ if (i >= priv->rcvd_ch_cnt)
+ return;

- if (priv->scan_req) {
- struct cfg80211_scan_info info = {
- .aborted = false,
- };
+ last_scanned_shadow[i].rssi = network_info->rssi;
+ last_scanned_shadow[i].time_scan = jiffies;
+ }
+ } else if (scan_event == SCAN_EVENT_DONE) {
+ refresh_scan(priv, false);

- cfg80211_scan_done(priv->scan_req, &info);
- priv->rcvd_ch_cnt = 0;
- priv->cfg_scanning = false;
- priv->scan_req = NULL;
- }
- mutex_unlock(&priv->scan_req_lock);
- } else if (scan_event == SCAN_EVENT_ABORTED) {
- mutex_lock(&priv->scan_req_lock);
+ mutex_lock(&priv->scan_req_lock);

- if (priv->scan_req) {
- struct cfg80211_scan_info info = {
- .aborted = false,
- };
+ if (priv->scan_req) {
+ struct cfg80211_scan_info info = {
+ .aborted = false,
+ };

- update_scan_time();
- refresh_scan(priv, false);
+ cfg80211_scan_done(priv->scan_req, &info);
+ priv->rcvd_ch_cnt = 0;
+ priv->cfg_scanning = false;
+ priv->scan_req = NULL;
+ }
+ mutex_unlock(&priv->scan_req_lock);
+ } else if (scan_event == SCAN_EVENT_ABORTED) {
+ mutex_lock(&priv->scan_req_lock);

- cfg80211_scan_done(priv->scan_req, &info);
- priv->cfg_scanning = false;
- priv->scan_req = NULL;
- }
- mutex_unlock(&priv->scan_req_lock);
+ if (priv->scan_req) {
+ struct cfg80211_scan_info info = {
+ .aborted = false,
+ };
+
+ update_scan_time();
+ refresh_scan(priv, false);
+
+ cfg80211_scan_done(priv->scan_req, &info);
+ priv->cfg_scanning = false;
+ priv->scan_req = NULL;
}
+ mutex_unlock(&priv->scan_req_lock);
}
}

--
2.7.4

2018-03-08 15:11:11

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 06/10] staging: wilc1000: fix line over 80 char in get_key() & set_default_key()

Fix 'line over 80 characters' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 3354bf2..92c3213 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1118,8 +1118,8 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
}

static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
- bool pairwise,
- const u8 *mac_addr, void *cookie, void (*callback)(void *cookie, struct key_params *))
+ bool pairwise, const u8 *mac_addr, void *cookie,
+ void (*callback)(void *cookie, struct key_params *))
{
struct wilc_priv *priv;
struct key_params key_params;
@@ -1145,8 +1145,8 @@ static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
return 0;
}

-static int set_default_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
- bool unicast, bool multicast)
+static int set_default_key(struct wiphy *wiphy, struct net_device *netdev,
+ u8 key_index, bool unicast, bool multicast)
{
struct wilc_priv *priv;
struct wilc_vif *vif;
--
2.7.4

2018-03-08 15:11:16

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 09/10] staging: wilc1000: rename pJoinParams to avoid camelCase

Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index a93c550..9da686b 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -315,7 +315,7 @@ static int is_network_in_shadow(struct network_info *nw_info, void *user_void)
}

static void add_network_to_shadow(struct network_info *nw_info,
- void *user_void, void *pJoinParams)
+ void *user_void, void *join_params)
{
int ap_found = is_network_in_shadow(nw_info, user_void);
u32 ap_index = 0;
@@ -360,7 +360,7 @@ static void add_network_to_shadow(struct network_info *nw_info,
last_scanned_shadow[ap_index].found = 1;
if (ap_found != -1)
kfree(last_scanned_shadow[ap_index].join_params);
- last_scanned_shadow[ap_index].join_params = pJoinParams;
+ last_scanned_shadow[ap_index].join_params = join_params;
}

static void cfg_scan_result(enum scan_event scan_event,
--
2.7.4