2016-02-02 12:05:00

by Leo Kim

[permalink] [raw]
Subject: [PATCH 01/26] staging: wilc1000: removes function 'wilc_dealloc_network_info()'

This patch removes function 'wilc_dealloc_network_info()'.
Does not need this function which only free memory.
Therefore, this function is removed and changed directly with kfree.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 22 ----------------------
drivers/staging/wilc1000/coreconfigurator.h | 1 -
drivers/staging/wilc1000/host_interface.c | 4 ++--
3 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 11e3ce0..81dd22e 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -353,28 +353,6 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info)
return 0;
}

-s32 wilc_dealloc_network_info(tstrNetworkInfo *network_info)
-{
- s32 result = 0;
-
- if (network_info) {
- if (network_info->pu8IEs) {
- kfree(network_info->pu8IEs);
- network_info->pu8IEs = NULL;
- } else {
- result = -EFAULT;
- }
-
- kfree(network_info);
- network_info = NULL;
-
- } else {
- result = -EFAULT;
- }
-
- return result;
-}
-
s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,
tstrConnectRespInfo **ret_connect_resp_info)
{
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index d801e58..23775e4 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -121,7 +121,6 @@ typedef struct {
} tstrDisconnectNotifInfo;

s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info);
-s32 wilc_dealloc_network_info(tstrNetworkInfo *network_info);
s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,
tstrConnectRespInfo **ret_connect_resp_info);
s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *connect_resp_info);
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index e6a6a03..3ce3a7c 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1414,8 +1414,8 @@ done:
pstrRcvdNetworkInfo->buffer = NULL;

if (pstrNetworkInfo) {
- wilc_dealloc_network_info(pstrNetworkInfo);
- pstrNetworkInfo = NULL;
+ kfree(pstrNetworkInfo->pu8IEs);
+ kfree(pstrNetworkInfo);
}

return result;
--
1.9.1



2016-02-02 12:06:52

by Leo Kim

[permalink] [raw]
Subject: [PATCH 12/26] staging: wilc1000: renames u8DtimPeriod of connect_resp_info structure

This patch renames u8DtimPeriod variable to dtim_period.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 2 +-
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/host_interface.c | 2 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index b4f7ec3..ce3bc29 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -336,7 +336,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer,

tim_elm = get_tim_elm(msa, rx_len + FCS_LEN, index);
if (tim_elm)
- network_info->u8DtimPeriod = tim_elm[3];
+ network_info->dtim_period = tim_elm[3];
ies = &msa[MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN];
ies_len = rx_len - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN);

diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 2fbffe8..bbc4b0e 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -83,7 +83,7 @@ struct network_info {
u8 ssid_len;
u8 bssid[6];
u16 beacon_period;
- u8 u8DtimPeriod;
+ u8 dtim_period;
u8 u8channel;
unsigned long u32TimeRcvdInScanCached;
unsigned long u32TimeRcvdInScan;
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 99bc890..7b4f05b 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4276,7 +4276,7 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)

pNewJoinBssParam = kzalloc(sizeof(struct join_bss_param), GFP_KERNEL);
if (pNewJoinBssParam) {
- pNewJoinBssParam->dtim_period = ptstrNetworkInfo->u8DtimPeriod;
+ pNewJoinBssParam->dtim_period = ptstrNetworkInfo->dtim_period;
pNewJoinBssParam->beacon_period = ptstrNetworkInfo->beacon_period;
pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info;
memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->bssid, 6);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 086ec07..cfd6892 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -374,7 +374,7 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
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].u8DtimPeriod = pstrNetworkInfo->u8DtimPeriod;
+ last_scanned_shadow[ap_index].dtim_period = pstrNetworkInfo->dtim_period;
last_scanned_shadow[ap_index].u8channel = pstrNetworkInfo->u8channel;
last_scanned_shadow[ap_index].u16IEsLen = pstrNetworkInfo->u16IEsLen;
last_scanned_shadow[ap_index].u64Tsf = pstrNetworkInfo->u64Tsf;
--
1.9.1


2016-02-02 12:07:32

by Leo Kim

[permalink] [raw]
Subject: [PATCH 19/26] staging: wilc1000: renames pJoinParams of connect_resp_info structure

This patch renames pJoinParams variable to join_params.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 3dca840..f154e39 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -92,7 +92,7 @@ struct network_info {
u32 tsf_lo;
u8 *ies;
u16 ies_len;
- void *pJoinParams;
+ void *join_params;
tstrRSSI strRssi;
u64 u64Tsf;
};
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index fafe63c..ef4a994 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -199,8 +199,8 @@ static void clear_shadow_scan(void)
last_scanned_shadow[last_scanned_cnt].ies = NULL;
}

- wilc_free_join_params(last_scanned_shadow[i].pJoinParams);
- last_scanned_shadow[i].pJoinParams = NULL;
+ wilc_free_join_params(last_scanned_shadow[i].join_params);
+ last_scanned_shadow[i].join_params = NULL;
}
last_scanned_cnt = 0;
}
@@ -295,7 +295,7 @@ static void remove_network_from_shadow(unsigned long arg)
kfree(last_scanned_shadow[i].ies);
last_scanned_shadow[i].ies = NULL;

- wilc_free_join_params(last_scanned_shadow[i].pJoinParams);
+ wilc_free_join_params(last_scanned_shadow[i].join_params);

for (j = i; (j < last_scanned_cnt - 1); j++)
last_scanned_shadow[j] = last_scanned_shadow[j + 1];
@@ -389,8 +389,8 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
last_scanned_shadow[ap_index].time_scan_cached = jiffies;
last_scanned_shadow[ap_index].found = 1;
if (ap_found != -1)
- wilc_free_join_params(last_scanned_shadow[ap_index].pJoinParams);
- last_scanned_shadow[ap_index].pJoinParams = pJoinParams;
+ wilc_free_join_params(last_scanned_shadow[ap_index].join_params);
+ last_scanned_shadow[ap_index].join_params = pJoinParams;
}

static void CfgScanResult(enum scan_event scan_event,
@@ -913,7 +913,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
CfgConnectResult, (void *)priv,
u8security, tenuAuth_type,
pstrNetworkInfo->ch,
- pstrNetworkInfo->pJoinParams);
+ pstrNetworkInfo->join_params);
if (s32Error != 0) {
netdev_err(dev, "wilc_set_join_req(): Error\n");
s32Error = -ENOENT;
--
1.9.1


2016-02-02 12:05:24

by Leo Kim

[permalink] [raw]
Subject: [PATCH 05/26] staging: wilc1000: remove typedef from pstrNetworkInfo

This patch removes typedef from the struct pstrNetworkInfo and
renames it to network_info.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 7 ++++---
drivers/staging/wilc1000/coreconfigurator.h | 7 ++++---
drivers/staging/wilc1000/host_interface.c | 6 +++---
drivers/staging/wilc1000/host_interface.h | 4 ++--
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +++++++-------
5 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index e9f6262..0d0a4ec 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -270,9 +270,10 @@ static u8 get_current_channel_802_11n(u8 *pu8msa, u16 rx_len)
return 0;
}

-s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info)
+s32 wilc_parse_network_info(u8 *msg_buffer,
+ struct network_info **ret_network_info)
{
- tstrNetworkInfo *network_info = NULL;
+ struct network_info *network_info = NULL;
u8 msg_type = 0;
u8 msg_id = 0;
u16 msg_len = 0;
@@ -304,7 +305,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info)
u32 tsf_lo;
u32 tsf_hi;

- network_info = kzalloc(sizeof(tstrNetworkInfo), GFP_KERNEL);
+ network_info = kzalloc(sizeof(*network_info), GFP_KERNEL);
if (!network_info)
return -ENOMEM;

diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index aa9aee6..214b43b 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -76,7 +76,7 @@ typedef struct {
s8 as8RSSI[NUM_RSSI];
} tstrRSSI;

-typedef struct {
+struct network_info {
s8 s8rssi;
u16 u16CapInfo;
u8 au8ssid[MAX_SSID_LEN];
@@ -95,7 +95,7 @@ typedef struct {
void *pJoinParams;
tstrRSSI strRssi;
u64 u64Tsf;
-} tstrNetworkInfo;
+};

struct connect_resp_info {
u16 capability;
@@ -120,7 +120,8 @@ typedef struct {
size_t ie_len;
} tstrDisconnectNotifInfo;

-s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info);
+s32 wilc_parse_network_info(u8 *msg_buffer,
+ struct network_info **ret_network_info);
s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,
struct connect_resp_info **ret_connect_resp_info);
void wilc_scan_complete_received(struct wilc *wilc, u8 *pu8Buffer,
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index f8dc657..355bee7 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -272,7 +272,7 @@ static struct wilc_vif *join_req_vif;
#define FLUSHED_JOIN_REQ 1
#define FLUSHED_BYTE_POS 79

-static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo);
+static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo);

/* The u8IfIdx starts from 0 to NUM_CONCURRENT_IFC -1, but 0 index used as
* special purpose in wilc device, so we add 1 to the index to starts from 1.
@@ -1352,7 +1352,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
u32 i;
bool bNewNtwrkFound;
s32 result = 0;
- tstrNetworkInfo *pstrNetworkInfo = NULL;
+ struct network_info *pstrNetworkInfo = NULL;
void *pJoinParams = NULL;
struct host_if_drv *hif_drv = vif->hif_drv;

@@ -4256,7 +4256,7 @@ s32 wilc_setup_multicast_filter(struct wilc_vif *vif, bool bIsEnabled,
return result;
}

-static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
+static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
{
struct join_bss_param *pNewJoinBssParam = NULL;
u8 *pu8IEs;
diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index 7724ade..6fae371 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -168,8 +168,8 @@ enum KEY_TYPE {
PMKSA,
};

-typedef void (*wilc_scan_result)(enum scan_event, tstrNetworkInfo *,
- void *, void *);
+typedef void (*wilc_scan_result)(enum scan_event, struct network_info *,
+ void *, void *);

typedef void (*wilc_connect_result)(enum conn_event,
tstrConnectInfo *,
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 4310abe..8a007743 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -93,7 +93,7 @@ static const struct wiphy_wowlan_support wowlan_support = {
extern int wilc_mac_open(struct net_device *ndev);
extern int wilc_mac_close(struct net_device *ndev);

-static tstrNetworkInfo last_scanned_shadow[MAX_NUM_SCANNED_NETWORKS_SHADOW];
+static struct network_info last_scanned_shadow[MAX_NUM_SCANNED_NETWORKS_SHADOW];
static u32 last_scanned_cnt;
struct timer_list wilc_during_ip_timer;
static struct timer_list hAgingTimer;
@@ -206,7 +206,7 @@ static void clear_shadow_scan(void)
}
}

-static u32 get_rssi_avg(tstrNetworkInfo *network_info)
+static u32 get_rssi_avg(struct network_info *network_info)
{
u8 i;
int rssi_v = 0;
@@ -231,7 +231,7 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan)
wiphy = priv->dev->ieee80211_ptr->wiphy;

for (i = 0; i < last_scanned_cnt; i++) {
- tstrNetworkInfo *network_info;
+ struct network_info *network_info;

network_info = &last_scanned_shadow[i];

@@ -310,7 +310,7 @@ static void clear_duringIP(unsigned long arg)
wilc_optaining_ip = false;
}

-static int is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo,
+static int is_network_in_shadow(struct network_info *pstrNetworkInfo,
void *user_void)
{
int state = -1;
@@ -333,7 +333,7 @@ static int is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo,
return state;
}

-static void add_network_to_shadow(tstrNetworkInfo *pstrNetworkInfo,
+static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
void *user_void, void *pJoinParams)
{
int ap_found = is_network_in_shadow(pstrNetworkInfo, user_void);
@@ -384,7 +384,7 @@ static void add_network_to_shadow(tstrNetworkInfo *pstrNetworkInfo,
}

static void CfgScanResult(enum scan_event scan_event,
- tstrNetworkInfo *network_info,
+ struct network_info *network_info,
void *user_void,
void *join_params)
{
@@ -693,7 +693,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,

struct wilc_priv *priv;
struct host_if_drv *pstrWFIDrv;
- tstrNetworkInfo *pstrNetworkInfo = NULL;
+ struct network_info *pstrNetworkInfo = NULL;
struct wilc_vif *vif;

wilc_connecting = 1;
--
1.9.1


2016-02-02 12:08:34

by Leo Kim

[permalink] [raw]
Subject: [PATCH 26/26] staging: wilc1000: remove warnings line over 80 characters

This patch removes the warnings reported by checkpatch.pl
for line over 80 characters.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index d481719..3a76586 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -4,7 +4,7 @@
#include <linux/errno.h>
#include <linux/slab.h>
#define TAG_PARAM_OFFSET (MAC_HDR_LEN + TIME_STAMP_LEN + \
- BEACON_INTERVAL_LEN + CAP_INFO_LEN)
+ BEACON_INTERVAL_LEN + CAP_INFO_LEN)

enum basic_frame_type {
FRAME_TYPE_CONTROL = 0x04,
@@ -337,8 +337,10 @@ s32 wilc_parse_network_info(u8 *msg_buffer,
tim_elm = get_tim_elm(msa, rx_len + FCS_LEN, index);
if (tim_elm)
network_info->dtim_period = tim_elm[3];
- ies = &msa[MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN];
- ies_len = rx_len - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN);
+ ies = &msa[MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN +
+ CAP_INFO_LEN];
+ ies_len = rx_len - (MAC_HDR_LEN + TIME_STAMP_LEN +
+ BEACON_INTERVAL_LEN + CAP_INFO_LEN);

if (ies_len > 0) {
network_info->ies = kmemdup(ies, ies_len, GFP_KERNEL);
@@ -373,7 +375,8 @@ s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,
connect_resp_info->assoc_id = get_asoc_id(buffer);

ies = &buffer[CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN];
- ies_len = assoc_resp_len - (CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN);
+ ies_len = assoc_resp_len - (CAP_INFO_LEN + STATUS_CODE_LEN +
+ AID_LEN);

connect_resp_info->ies = kmemdup(ies, ies_len, GFP_KERNEL);
if (!connect_resp_info->ies)
--
1.9.1


2016-02-02 12:07:09

by Leo Kim

[permalink] [raw]
Subject: [PATCH 15/26] staging: wilc1000: renames bNewNetwork of connect_resp_info structure

This patch renames bNewNetwork variable to new_network.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/host_interface.c | 4 ++--
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 0e10c75..fd3b5d4 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -87,7 +87,7 @@ struct network_info {
u8 ch;
unsigned long time_scan_cached;
unsigned long time_scan;
- bool bNewNetwork;
+ bool new_network;
u8 u8Found;
u32 u32Tsf;
u8 *pu8IEs;
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 7b4f05b..ffa175d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1394,7 +1394,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,

hif_drv->usr_scan_req.rcvd_ch_cnt++;

- pstrNetworkInfo->bNewNetwork = true;
+ pstrNetworkInfo->new_network = true;
pJoinParams = host_int_ParseJoinBssParam(pstrNetworkInfo);

hif_drv->usr_scan_req.scan_result(SCAN_EVENT_NETWORK_FOUND, pstrNetworkInfo,
@@ -1403,7 +1403,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
}
}
} else {
- pstrNetworkInfo->bNewNetwork = false;
+ pstrNetworkInfo->new_network = false;
hif_drv->usr_scan_req.scan_result(SCAN_EVENT_NETWORK_FOUND, pstrNetworkInfo,
hif_drv->usr_scan_req.arg, NULL);
}
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 4767aa0..b5c19ed 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -434,7 +434,7 @@ static void CfgScanResult(enum scan_event scan_event,
network_info->cap_info,
network_info->beacon_period);

- if (network_info->bNewNetwork) {
+ if (network_info->new_network) {
if (priv->u32RcvdChCount < MAX_NUM_SCANNED_NETWORKS) {
PRINT_D(CFG80211_DBG,
"Network %s found\n",
--
1.9.1


2016-02-02 12:08:06

by Leo Kim

[permalink] [raw]
Subject: [PATCH 23/26] staging: wilc1000: remove unused log message using the RX_DBG tag

From: Chris Park <[email protected]>

This patch remove unused log message using the RX_DBG tag

Signed-off-by: Chris Park <[email protected]>
Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/linux_wlan_common.h | 2 --
drivers/staging/wilc1000/wilc_debugfs.c | 2 +-
drivers/staging/wilc1000/wilc_wlan.c | 5 -----
drivers/staging/wilc1000/wilc_wlan_cfg.c | 5 -----
4 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan_common.h b/drivers/staging/wilc1000/linux_wlan_common.h
index 617bc53..63d0ec5 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -6,7 +6,6 @@ enum debug_region {
Hostapd_debug,
CFG80211_debug,
Interrupt_debug,
- RX_debug,
Lock_debug,
Tcp_enhance,
Spin_debug,
@@ -22,7 +21,6 @@ enum debug_region {
#define HOSTAPD_DBG (1 << Hostapd_debug)
#define CFG80211_DBG (1 << CFG80211_debug)
#define INT_DBG (1 << Interrupt_debug)
-#define RX_DBG (1 << RX_debug)
#define LOCK_DBG (1 << Lock_debug)
#define TCP_ENH (1 << Tcp_enhance)
#define SPIN_DEBUG (1 << Spin_debug)
diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c
index fd0e58f..63b66b2 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -24,7 +24,7 @@ static struct dentry *wilc_dir;
* --------------------------------------------------------------------------------
*/

-#define DBG_REGION_ALL (GENERIC_DBG | HOSTAPD_DBG | CFG80211_DBG | INT_DBG | RX_DBG | LOCK_DBG | INIT_DBG | BUS_DBG | MEM_DBG)
+#define DBG_REGION_ALL (GENERIC_DBG | HOSTAPD_DBG | CFG80211_DBG | INT_DBG | LOCK_DBG | INIT_DBG | BUS_DBG | MEM_DBG)
#define DBG_LEVEL_ALL (DEBUG | INFO | WRN | ERR)
atomic_t WILC_REGION = ATOMIC_INIT(INIT_DBG | GENERIC_DBG | CFG80211_DBG | FIRM_DBG | HOSTAPD_DBG);
EXPORT_SYMBOL_GPL(WILC_REGION);
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 10a0937..fc0f772 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -835,11 +835,8 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
u32 pkt_len, pkt_offset, tp_len;
int is_cfg_packet;

- PRINT_D(RX_DBG, "In the 2nd do-while\n");
memcpy(&header, &buffer[offset], 4);
header = cpu_to_le32(header);
- PRINT_D(RX_DBG, "Header = %04x - Offset = %d\n",
- header, offset);

is_cfg_packet = (header >> 31) & 0x1;
pkt_offset = (header >> 22) & 0x1ff;
@@ -890,7 +887,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
} while (1);

wilc->rxq_exit = 1;
- PRINT_D(RX_DBG, "THREAD: Exiting RX thread\n");
}

static void wilc_unknown_isr_ext(struct wilc *wilc)
@@ -958,7 +954,6 @@ _end_:
if (rqe) {
rqe->buffer = buffer;
rqe->buffer_size = size;
- PRINT_D(RX_DBG, "rxq entery Size= %d - Address = %p\n", rqe->buffer_size, rqe->buffer);
wilc_wlan_rxq_add(wilc, rqe);
}
}
diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index b72c77b..3b3065b 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -522,7 +522,6 @@ int wilc_wlan_cfg_indicate_rx(struct wilc *wilc, u8 *frame, int size,
rsp->type = wilc_wlan_parse_info_frame(frame, size);
rsp->seq_no = msg_id;
/*call host interface info parse as well*/
- PRINT_INFO(RX_DBG, "Info message received\n");
wilc_gnrl_async_info_received(wilc, frame - 4, size + 4);
break;

@@ -532,14 +531,10 @@ int wilc_wlan_cfg_indicate_rx(struct wilc *wilc, u8 *frame, int size,
break;

case 'S':
- PRINT_INFO(RX_DBG, "Scan Notification Received\n");
wilc_scan_complete_received(wilc, frame - 4, size + 4);
break;

default:
- PRINT_INFO(RX_DBG, "Receive unknown message type[%d-%d-%d-%d-%d-%d-%d-%d]\n",
- frame[0], frame[1], frame[2], frame[3], frame[4],
- frame[5], frame[6], frame[7]);
rsp->type = 0;
rsp->seq_no = msg_id;
ret = 0;
--
1.9.1


2016-02-02 12:05:30

by Leo Kim

[permalink] [raw]
Subject: [PATCH 06/26] staging: wilc1000: renames s8rssi of connect_resp_info structure

This patch renames s8rssi variable to rssi.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 2 +-
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/host_interface.c | 6 +++---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +++++++-------
4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 0d0a4ec..1e8c56b 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -309,7 +309,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer,
if (!network_info)
return -ENOMEM;

- network_info->s8rssi = wid_val[0];
+ network_info->rssi = wid_val[0];

msa = &wid_val[1];

diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 214b43b..e386e85 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -77,7 +77,7 @@ typedef struct {
} tstrRSSI;

struct network_info {
- s8 s8rssi;
+ s8 rssi;
u16 u16CapInfo;
u8 au8ssid[MAX_SSID_LEN];
u8 u8SsidLen;
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 355bee7..96f7f94 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1372,10 +1372,10 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
(pstrNetworkInfo->au8bssid)) {
if (memcmp(hif_drv->usr_scan_req.net_info[i].au8bssid,
pstrNetworkInfo->au8bssid, 6) == 0) {
- if (pstrNetworkInfo->s8rssi <= hif_drv->usr_scan_req.net_info[i].s8rssi) {
+ if (pstrNetworkInfo->rssi <= hif_drv->usr_scan_req.net_info[i].s8rssi) {
goto done;
} else {
- hif_drv->usr_scan_req.net_info[i].s8rssi = pstrNetworkInfo->s8rssi;
+ hif_drv->usr_scan_req.net_info[i].s8rssi = pstrNetworkInfo->rssi;
bNewNtwrkFound = false;
break;
}
@@ -1385,7 +1385,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,

if (bNewNtwrkFound) {
if (hif_drv->usr_scan_req.rcvd_ch_cnt < MAX_NUM_SCANNED_NETWORKS) {
- hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].s8rssi = pstrNetworkInfo->s8rssi;
+ hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].s8rssi = pstrNetworkInfo->rssi;

if (hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].au8bssid &&
pstrNetworkInfo->au8bssid) {
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 8a007743..048e6df 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -351,13 +351,13 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
ap_index = ap_found;
}
rssi_index = last_scanned_shadow[ap_index].strRssi.u8Index;
- last_scanned_shadow[ap_index].strRssi.as8RSSI[rssi_index++] = pstrNetworkInfo->s8rssi;
+ last_scanned_shadow[ap_index].strRssi.as8RSSI[rssi_index++] = pstrNetworkInfo->rssi;
if (rssi_index == NUM_RSSI) {
rssi_index = 0;
last_scanned_shadow[ap_index].strRssi.u8Full = 1;
}
last_scanned_shadow[ap_index].strRssi.u8Index = rssi_index;
- last_scanned_shadow[ap_index].s8rssi = pstrNetworkInfo->s8rssi;
+ last_scanned_shadow[ap_index].rssi = pstrNetworkInfo->rssi;
last_scanned_shadow[ap_index].u16CapInfo = pstrNetworkInfo->u16CapInfo;
last_scanned_shadow[ap_index].u8SsidLen = pstrNetworkInfo->u8SsidLen;
memcpy(last_scanned_shadow[ap_index].au8ssid,
@@ -403,8 +403,8 @@ static void CfgScanResult(enum scan_event scan_event,
return;

if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC &&
- (((s32)network_info->s8rssi * 100) < 0 ||
- ((s32)network_info->s8rssi * 100) > 100))
+ (((s32)network_info->rssi * 100) < 0 ||
+ ((s32)network_info->rssi * 100) > 100))
return;

if (network_info) {
@@ -415,7 +415,7 @@ static void CfgScanResult(enum scan_event scan_event,
return;

PRINT_INFO(CFG80211_DBG, "Network Info:: CHANNEL Frequency: %d, RSSI: %d, CapabilityInfo: %d,"
- "BeaconPeriod: %d\n", channel->center_freq, (((s32)network_info->s8rssi) * 100),
+ "BeaconPeriod: %d\n", channel->center_freq, (((s32)network_info->rssi) * 100),
network_info->u16CapInfo, network_info->u16BeaconPeriod);

if (network_info->bNewNetwork) {
@@ -428,7 +428,7 @@ static void CfgScanResult(enum scan_event scan_event,
if (!(memcmp("DIRECT-", network_info->au8ssid, 7))) {
bss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, network_info->au8bssid, network_info->u64Tsf, network_info->u16CapInfo,
network_info->u16BeaconPeriod, (const u8 *)network_info->pu8IEs,
- (size_t)network_info->u16IEsLen, (((s32)network_info->s8rssi) * 100), GFP_KERNEL);
+ (size_t)network_info->u16IEsLen, (((s32)network_info->rssi) * 100), GFP_KERNEL);
cfg80211_put_bss(wiphy, bss);
}
}
@@ -439,7 +439,7 @@ static void CfgScanResult(enum scan_event scan_event,
if (memcmp(last_scanned_shadow[i].au8bssid, network_info->au8bssid, 6) == 0) {
PRINT_D(CFG80211_DBG, "Update RSSI of %s\n", last_scanned_shadow[i].au8ssid);

- last_scanned_shadow[i].s8rssi = network_info->s8rssi;
+ last_scanned_shadow[i].rssi = network_info->rssi;
last_scanned_shadow[i].u32TimeRcvdInScan = jiffies;
break;
}
--
1.9.1


2016-02-03 04:00:15

by Julian Calaby

[permalink] [raw]
Subject: Re: [PATCH 01/26] staging: wilc1000: removes function 'wilc_dealloc_network_info()'

Hi Leo,

On Tue, Feb 2, 2016 at 11:02 PM, Leo Kim <[email protected]> wrote:
> This patch removes function 'wilc_dealloc_network_info()'.
> Does not need this function which only free memory.
> Therefore, this function is removed and changed directly with kfree.
>
> Signed-off-by: Leo Kim <[email protected]>

Nice work!

Reviewed-by: Julian Calaby <[email protected]>

> ---
> drivers/staging/wilc1000/coreconfigurator.c | 22 ----------------------
> drivers/staging/wilc1000/coreconfigurator.h | 1 -
> drivers/staging/wilc1000/host_interface.c | 4 ++--
> 3 files changed, 2 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
> index 11e3ce0..81dd22e 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.c
> +++ b/drivers/staging/wilc1000/coreconfigurator.c
> @@ -353,28 +353,6 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info)
> return 0;
> }
>
> -s32 wilc_dealloc_network_info(tstrNetworkInfo *network_info)
> -{
> - s32 result = 0;
> -
> - if (network_info) {
> - if (network_info->pu8IEs) {
> - kfree(network_info->pu8IEs);
> - network_info->pu8IEs = NULL;
> - } else {
> - result = -EFAULT;
> - }
> -
> - kfree(network_info);
> - network_info = NULL;
> -
> - } else {
> - result = -EFAULT;
> - }
> -
> - return result;
> -}
> -
> s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,
> tstrConnectRespInfo **ret_connect_resp_info)
> {
> diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
> index d801e58..23775e4 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.h
> +++ b/drivers/staging/wilc1000/coreconfigurator.h
> @@ -121,7 +121,6 @@ typedef struct {
> } tstrDisconnectNotifInfo;
>
> s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info);
> -s32 wilc_dealloc_network_info(tstrNetworkInfo *network_info);
> s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,
> tstrConnectRespInfo **ret_connect_resp_info);
> s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *connect_resp_info);
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index e6a6a03..3ce3a7c 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -1414,8 +1414,8 @@ done:
> pstrRcvdNetworkInfo->buffer = NULL;
>
> if (pstrNetworkInfo) {
> - wilc_dealloc_network_info(pstrNetworkInfo);
> - pstrNetworkInfo = NULL;
> + kfree(pstrNetworkInfo->pu8IEs);
> + kfree(pstrNetworkInfo);
> }
>
> return result;
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html



--
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/

2016-02-02 12:05:11

by Leo Kim

[permalink] [raw]
Subject: [PATCH 03/26] staging: wilc1000: remove typedef from tstrConnectRespInfo

This patch removes typedef from the struct tstrConnectRespInfo and
renames it to connect_resp_info.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 6 +++---
drivers/staging/wilc1000/coreconfigurator.h | 6 +++---
drivers/staging/wilc1000/host_interface.c | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index c86278d..c456a32 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -354,14 +354,14 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info)
}

s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,
- tstrConnectRespInfo **ret_connect_resp_info)
+ struct connect_resp_info **ret_connect_resp_info)
{
- tstrConnectRespInfo *connect_resp_info = NULL;
+ struct connect_resp_info *connect_resp_info = NULL;
u16 assoc_resp_len = 0;
u8 *ies = NULL;
u16 ies_len = 0;

- connect_resp_info = kzalloc(sizeof(tstrConnectRespInfo), GFP_KERNEL);
+ connect_resp_info = kzalloc(sizeof(*connect_resp_info), GFP_KERNEL);
if (!connect_resp_info)
return -ENOMEM;

diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index d42f47c..611486b 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -97,13 +97,13 @@ typedef struct {
u64 u64Tsf;
} tstrNetworkInfo;

-typedef struct {
+struct connect_resp_info {
u16 u16capability;
u16 u16ConnectStatus;
u16 u16AssocID;
u8 *pu8RespIEs;
u16 u16RespIEsLen;
-} tstrConnectRespInfo;
+};

typedef struct {
u8 au8bssid[6];
@@ -122,7 +122,7 @@ typedef struct {

s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info);
s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,
- tstrConnectRespInfo **ret_connect_resp_info);
+ struct connect_resp_info **ret_connect_resp_info);
void wilc_scan_complete_received(struct wilc *wilc, u8 *pu8Buffer,
u32 u32Length);
void wilc_network_info_received(struct wilc *wilc, u8 *pu8Buffer,
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 15c266b..a5042bb 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1475,7 +1475,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
u8MacStatusAdditionalInfo = pstrRcvdGnrlAsyncInfo->buffer[9];
if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) {
u32 u32RcvdAssocRespInfoLen = 0;
- tstrConnectRespInfo *pstrConnectRespInfo = NULL;
+ struct connect_resp_info *pstrConnectRespInfo = NULL;

memset(&strConnectInfo, 0, sizeof(tstrConnectInfo));

--
1.9.1


2016-02-02 12:05:42

by Leo Kim

[permalink] [raw]
Subject: [PATCH 08/26] staging: wilc1000: renames au8ssid of connect_resp_info structure

This patch renames au8ssid variable to ssid.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 2 +-
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/host_interface.c | 3 ++-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 19 +++++++++++--------
4 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 6c40d36..4dd7c8a 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -322,7 +322,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer,

network_info->u64Tsf = tsf_lo | ((u64)tsf_hi << 32);

- get_ssid(msa, network_info->au8ssid, &network_info->u8SsidLen);
+ get_ssid(msa, network_info->ssid, &network_info->u8SsidLen);
get_BSSID(msa, network_info->au8bssid);

network_info->u8channel = get_current_channel_802_11n(msa,
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index ace50d8..781a65f 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -79,7 +79,7 @@ typedef struct {
struct network_info {
s8 rssi;
u16 cap_info;
- u8 au8ssid[MAX_SSID_LEN];
+ u8 ssid[MAX_SSID_LEN];
u8 u8SsidLen;
u8 au8bssid[6];
u16 u16BeaconPeriod;
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index e4abc4b..7752af2 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4280,7 +4280,8 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
pNewJoinBssParam->beacon_period = ptstrNetworkInfo->u16BeaconPeriod;
pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info;
memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->au8bssid, 6);
- memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->au8ssid, ptstrNetworkInfo->u8SsidLen + 1);
+ memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->ssid,
+ ptstrNetworkInfo->u8SsidLen + 1);
pNewJoinBssParam->ssid_len = ptstrNetworkInfo->u8SsidLen;
memset(pNewJoinBssParam->rsn_pcip_policy, 0xFF, 3);
memset(pNewJoinBssParam->rsn_auth_policy, 0xFF, 3);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 4d50dd7..3b3411f 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -244,7 +244,7 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan)
channel = ieee80211_get_channel(wiphy, freq);

rssi = get_rssi_avg(network_info);
- if (memcmp("DIRECT-", network_info->au8ssid, 7) ||
+ if (memcmp("DIRECT-", network_info->ssid, 7) ||
direct_scan) {
bss = cfg80211_inform_bss(wiphy,
channel,
@@ -288,7 +288,8 @@ static void remove_network_from_shadow(unsigned long arg)

for (i = 0; i < last_scanned_cnt; i++) {
if (time_after(now, last_scanned_shadow[i].u32TimeRcvdInScan + (unsigned long)(SCAN_RESULT_EXPIRE))) {
- PRINT_D(CFG80211_DBG, "Network expired in ScanShadow: %s\n", last_scanned_shadow[i].au8ssid);
+ PRINT_D(CFG80211_DBG, "Network expired ScanShadow:%s\n",
+ last_scanned_shadow[i].ssid);

kfree(last_scanned_shadow[i].pu8IEs);
last_scanned_shadow[i].pu8IEs = NULL;
@@ -368,8 +369,8 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
last_scanned_shadow[ap_index].rssi = pstrNetworkInfo->rssi;
last_scanned_shadow[ap_index].cap_info = pstrNetworkInfo->cap_info;
last_scanned_shadow[ap_index].u8SsidLen = pstrNetworkInfo->u8SsidLen;
- memcpy(last_scanned_shadow[ap_index].au8ssid,
- pstrNetworkInfo->au8ssid, pstrNetworkInfo->u8SsidLen);
+ memcpy(last_scanned_shadow[ap_index].ssid,
+ pstrNetworkInfo->ssid, pstrNetworkInfo->u8SsidLen);
memcpy(last_scanned_shadow[ap_index].au8bssid,
pstrNetworkInfo->au8bssid, ETH_ALEN);
last_scanned_shadow[ap_index].u16BeaconPeriod = pstrNetworkInfo->u16BeaconPeriod;
@@ -434,12 +435,14 @@ static void CfgScanResult(enum scan_event scan_event,

if (network_info->bNewNetwork) {
if (priv->u32RcvdChCount < MAX_NUM_SCANNED_NETWORKS) {
- PRINT_D(CFG80211_DBG, "Network %s found\n", network_info->au8ssid);
+ PRINT_D(CFG80211_DBG,
+ "Network %s found\n",
+ network_info->ssid);
priv->u32RcvdChCount++;

add_network_to_shadow(network_info, priv, join_params);

- if (!(memcmp("DIRECT-", network_info->au8ssid, 7))) {
+ if (!(memcmp("DIRECT-", network_info->ssid, 7))) {
bss = cfg80211_inform_bss(wiphy,
channel,
CFG80211_BSS_FTYPE_UNKNOWN,
@@ -459,7 +462,7 @@ static void CfgScanResult(enum scan_event scan_event,

for (i = 0; i < priv->u32RcvdChCount; i++) {
if (memcmp(last_scanned_shadow[i].au8bssid, network_info->au8bssid, 6) == 0) {
- PRINT_D(CFG80211_DBG, "Update RSSI of %s\n", last_scanned_shadow[i].au8ssid);
+ PRINT_D(CFG80211_DBG, "Update RSSI of %s\n", last_scanned_shadow[i].ssid);

last_scanned_shadow[i].rssi = network_info->rssi;
last_scanned_shadow[i].u32TimeRcvdInScan = jiffies;
@@ -736,7 +739,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,

for (i = 0; i < last_scanned_cnt; i++) {
if ((sme->ssid_len == last_scanned_shadow[i].u8SsidLen) &&
- memcmp(last_scanned_shadow[i].au8ssid,
+ memcmp(last_scanned_shadow[i].ssid,
sme->ssid,
sme->ssid_len) == 0) {
PRINT_INFO(CFG80211_DBG, "Network with required SSID is found %s\n", sme->ssid);
--
1.9.1


2016-02-02 12:07:37

by Leo Kim

[permalink] [raw]
Subject: [PATCH 20/26] staging: wilc1000: renames strRssi of connect_resp_info structure

This patch renames strRssi variable to str_rssi.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 13 +++++++------
2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index f154e39..18c785b 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -93,7 +93,7 @@ struct network_info {
u8 *ies;
u16 ies_len;
void *join_params;
- tstrRSSI strRssi;
+ tstrRSSI str_rssi;
u64 u64Tsf;
};

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index ef4a994..15565cf 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -210,10 +210,11 @@ static u32 get_rssi_avg(struct network_info *network_info)
{
u8 i;
int rssi_v = 0;
- u8 num_rssi = (network_info->strRssi.u8Full) ? NUM_RSSI : (network_info->strRssi.u8Index);
+ u8 num_rssi = (network_info->str_rssi.u8Full) ?
+ NUM_RSSI : (network_info->str_rssi.u8Index);

for (i = 0; i < num_rssi; i++)
- rssi_v += network_info->strRssi.as8RSSI[i];
+ rssi_v += network_info->str_rssi.as8RSSI[i];

rssi_v /= num_rssi;
return rssi_v;
@@ -360,13 +361,13 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
} else {
ap_index = ap_found;
}
- rssi_index = last_scanned_shadow[ap_index].strRssi.u8Index;
- last_scanned_shadow[ap_index].strRssi.as8RSSI[rssi_index++] = pstrNetworkInfo->rssi;
+ rssi_index = last_scanned_shadow[ap_index].str_rssi.u8Index;
+ last_scanned_shadow[ap_index].str_rssi.as8RSSI[rssi_index++] = pstrNetworkInfo->rssi;
if (rssi_index == NUM_RSSI) {
rssi_index = 0;
- last_scanned_shadow[ap_index].strRssi.u8Full = 1;
+ last_scanned_shadow[ap_index].str_rssi.u8Full = 1;
}
- last_scanned_shadow[ap_index].strRssi.u8Index = rssi_index;
+ last_scanned_shadow[ap_index].str_rssi.u8Index = 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;
--
1.9.1


2016-02-02 12:06:58

by Leo Kim

[permalink] [raw]
Subject: [PATCH 13/26] staging: wilc1000: renames u8channel of connect_resp_info structure

This patch renames u8channel variable to ch.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 2 +-
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +++++++-------
3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index ce3bc29..6c748aa 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -325,7 +325,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer,
get_ssid(msa, network_info->ssid, &network_info->ssid_len);
get_BSSID(msa, network_info->bssid);

- network_info->u8channel = get_current_channel_802_11n(msa,
+ network_info->ch = get_current_channel_802_11n(msa,
rx_len + FCS_LEN);

index = MAC_HDR_LEN + TIME_STAMP_LEN;
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index bbc4b0e..2f030a9 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -84,7 +84,7 @@ struct network_info {
u8 bssid[6];
u16 beacon_period;
u8 dtim_period;
- u8 u8channel;
+ u8 ch;
unsigned long u32TimeRcvdInScanCached;
unsigned long u32TimeRcvdInScan;
bool bNewNetwork;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index cfd6892..1773587 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -240,7 +240,7 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan)
struct ieee80211_channel *channel;

if (network_info) {
- freq = ieee80211_channel_to_frequency((s32)network_info->u8channel, IEEE80211_BAND_2GHZ);
+ freq = ieee80211_channel_to_frequency((s32)network_info->ch, IEEE80211_BAND_2GHZ);
channel = ieee80211_get_channel(wiphy, freq);

rssi = get_rssi_avg(network_info);
@@ -375,7 +375,7 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
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].u8channel = pstrNetworkInfo->u8channel;
+ last_scanned_shadow[ap_index].ch = pstrNetworkInfo->ch;
last_scanned_shadow[ap_index].u16IEsLen = pstrNetworkInfo->u16IEsLen;
last_scanned_shadow[ap_index].u64Tsf = pstrNetworkInfo->u64Tsf;
if (ap_found != -1)
@@ -417,7 +417,7 @@ static void CfgScanResult(enum scan_event scan_event,
return;

if (network_info) {
- s32Freq = ieee80211_channel_to_frequency((s32)network_info->u8channel, IEEE80211_BAND_2GHZ);
+ s32Freq = ieee80211_channel_to_frequency((s32)network_info->ch, IEEE80211_BAND_2GHZ);
channel = ieee80211_get_channel(wiphy, s32Freq);

if (!channel)
@@ -895,15 +895,15 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
}


- PRINT_INFO(CFG80211_DBG, "Required Channel = %d\n", pstrNetworkInfo->u8channel);
+ PRINT_INFO(CFG80211_DBG, "Required Ch = %d\n", pstrNetworkInfo->ch);

PRINT_INFO(CFG80211_DBG, "Group encryption value = %s\n Cipher Group = %s\n WPA version = %s\n",
pcgroup_encrypt_val, pccipher_group, pcwpa_version);

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

if (!pstrWFIDrv->p2p_connect)
- wlan_channel = pstrNetworkInfo->u8channel;
+ wlan_channel = pstrNetworkInfo->ch;

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

@@ -911,7 +911,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
sme->ssid_len, sme->ie, sme->ie_len,
CfgConnectResult, (void *)priv,
u8security, tenuAuth_type,
- pstrNetworkInfo->u8channel,
+ pstrNetworkInfo->ch,
pstrNetworkInfo->pJoinParams);
if (s32Error != 0) {
netdev_err(dev, "wilc_set_join_req(): Error\n");
--
1.9.1


2016-02-02 12:07:26

by Leo Kim

[permalink] [raw]
Subject: [PATCH 18/26] staging: wilc1000: renames struct connect_resp_info variables

This patch renames to avoid camelcase changes follow are:
- pu8IEs to ies
- u16IEsLen to ies_len

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 7 +++---
drivers/staging/wilc1000/coreconfigurator.h | 4 +--
drivers/staging/wilc1000/host_interface.c | 6 ++---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 30 +++++++++++------------
4 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 3e1e1f5..cbca6a0 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -341,12 +341,11 @@ s32 wilc_parse_network_info(u8 *msg_buffer,
ies_len = rx_len - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN);

if (ies_len > 0) {
- network_info->pu8IEs = kmemdup(ies, ies_len,
- GFP_KERNEL);
- if (!network_info->pu8IEs)
+ network_info->ies = kmemdup(ies, ies_len, GFP_KERNEL);
+ if (!network_info->ies)
return -ENOMEM;
}
- network_info->u16IEsLen = ies_len;
+ network_info->ies_len = ies_len;
}

*ret_network_info = network_info;
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 07a2ef0..3dca840 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -90,8 +90,8 @@ struct network_info {
bool new_network;
u8 found;
u32 tsf_lo;
- u8 *pu8IEs;
- u16 u16IEsLen;
+ u8 *ies;
+ u16 ies_len;
void *pJoinParams;
tstrRSSI strRssi;
u64 u64Tsf;
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index ac71453..017a357 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1414,7 +1414,7 @@ done:
pstrRcvdNetworkInfo->buffer = NULL;

if (pstrNetworkInfo) {
- kfree(pstrNetworkInfo->pu8IEs);
+ kfree(pstrNetworkInfo->ies);
kfree(pstrNetworkInfo);
}

@@ -4271,8 +4271,8 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
u8 authTotalCount = 0;
u8 i, j;

- pu8IEs = ptstrNetworkInfo->pu8IEs;
- u16IEsLen = ptstrNetworkInfo->u16IEsLen;
+ pu8IEs = ptstrNetworkInfo->ies;
+ u16IEsLen = ptstrNetworkInfo->ies_len;

pNewJoinBssParam = kzalloc(sizeof(struct join_bss_param), GFP_KERNEL);
if (pNewJoinBssParam) {
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index c09cc9d..fafe63c 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -194,9 +194,9 @@ static void clear_shadow_scan(void)
del_timer_sync(&hAgingTimer);

for (i = 0; i < last_scanned_cnt; i++) {
- if (last_scanned_shadow[last_scanned_cnt].pu8IEs) {
- kfree(last_scanned_shadow[i].pu8IEs);
- last_scanned_shadow[last_scanned_cnt].pu8IEs = NULL;
+ if (last_scanned_shadow[last_scanned_cnt].ies) {
+ kfree(last_scanned_shadow[i].ies);
+ last_scanned_shadow[last_scanned_cnt].ies = NULL;
}

wilc_free_join_params(last_scanned_shadow[i].pJoinParams);
@@ -253,8 +253,8 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan)
network_info->u64Tsf,
network_info->cap_info,
network_info->beacon_period,
- (const u8 *)network_info->pu8IEs,
- (size_t)network_info->u16IEsLen,
+ (const u8 *)network_info->ies,
+ (size_t)network_info->ies_len,
(s32)rssi * 100,
GFP_KERNEL);
cfg80211_put_bss(wiphy, bss);
@@ -292,8 +292,8 @@ static void remove_network_from_shadow(unsigned long arg)
PRINT_D(CFG80211_DBG, "Network expired ScanShadow:%s\n",
last_scanned_shadow[i].ssid);

- kfree(last_scanned_shadow[i].pu8IEs);
- last_scanned_shadow[i].pu8IEs = NULL;
+ kfree(last_scanned_shadow[i].ies);
+ last_scanned_shadow[i].ies = NULL;

wilc_free_join_params(last_scanned_shadow[i].pJoinParams);

@@ -377,14 +377,14 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
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].u16IEsLen = pstrNetworkInfo->u16IEsLen;
+ last_scanned_shadow[ap_index].ies_len = pstrNetworkInfo->ies_len;
last_scanned_shadow[ap_index].u64Tsf = pstrNetworkInfo->u64Tsf;
if (ap_found != -1)
- kfree(last_scanned_shadow[ap_index].pu8IEs);
- last_scanned_shadow[ap_index].pu8IEs =
- kmalloc(pstrNetworkInfo->u16IEsLen, GFP_KERNEL);
- memcpy(last_scanned_shadow[ap_index].pu8IEs,
- pstrNetworkInfo->pu8IEs, pstrNetworkInfo->u16IEsLen);
+ kfree(last_scanned_shadow[ap_index].ies);
+ last_scanned_shadow[ap_index].ies = kmalloc(pstrNetworkInfo->ies_len,
+ GFP_KERNEL);
+ memcpy(last_scanned_shadow[ap_index].ies,
+ pstrNetworkInfo->ies, pstrNetworkInfo->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;
@@ -451,8 +451,8 @@ static void CfgScanResult(enum scan_event scan_event,
network_info->u64Tsf,
network_info->cap_info,
network_info->beacon_period,
- (const u8 *)network_info->pu8IEs,
- (size_t)network_info->u16IEsLen,
+ (const u8 *)network_info->ies,
+ (size_t)network_info->ies_len,
(s32)network_info->rssi * 100,
GFP_KERNEL);
cfg80211_put_bss(wiphy, bss);
--
1.9.1


2016-02-02 12:07:43

by Leo Kim

[permalink] [raw]
Subject: [PATCH 21/26] staging: wilc1000: renames u64Tsf of connect_resp_info structure

This patch renames u64Tsf variable to tsf_hi.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 2 +-
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index cbca6a0..d481719 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -320,7 +320,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer,
tsf_lo = get_beacon_timestamp_lo(msa);
tsf_hi = get_beacon_timestamp_hi(msa);

- network_info->u64Tsf = tsf_lo | ((u64)tsf_hi << 32);
+ network_info->tsf_hi = tsf_lo | ((u64)tsf_hi << 32);

get_ssid(msa, network_info->ssid, &network_info->ssid_len);
get_BSSID(msa, network_info->bssid);
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 18c785b..748199d 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -94,7 +94,7 @@ struct network_info {
u16 ies_len;
void *join_params;
tstrRSSI str_rssi;
- u64 u64Tsf;
+ u64 tsf_hi;
};

struct connect_resp_info {
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 15565cf..1f0e4e2 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -251,7 +251,7 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan)
channel,
CFG80211_BSS_FTYPE_UNKNOWN,
network_info->bssid,
- network_info->u64Tsf,
+ network_info->tsf_hi,
network_info->cap_info,
network_info->beacon_period,
(const u8 *)network_info->ies,
@@ -379,7 +379,7 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
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].u64Tsf = pstrNetworkInfo->u64Tsf;
+ last_scanned_shadow[ap_index].tsf_hi = pstrNetworkInfo->tsf_hi;
if (ap_found != -1)
kfree(last_scanned_shadow[ap_index].ies);
last_scanned_shadow[ap_index].ies = kmalloc(pstrNetworkInfo->ies_len,
@@ -449,7 +449,7 @@ static void CfgScanResult(enum scan_event scan_event,
channel,
CFG80211_BSS_FTYPE_UNKNOWN,
network_info->bssid,
- network_info->u64Tsf,
+ network_info->tsf_hi,
network_info->cap_info,
network_info->beacon_period,
(const u8 *)network_info->ies,
--
1.9.1


2016-02-02 12:07:03

by Leo Kim

[permalink] [raw]
Subject: [PATCH 14/26] staging: wilc1000: renames struct connect_resp_info variables

This patch renames to avoid camelcase changes follow are:
- u32TimeRcvdInScanCached to time_scan_cached
- u32TimeRcvdInScan to time_scan

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.h | 4 ++--
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 15 ++++++++-------
2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 2f030a9..0e10c75 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -85,8 +85,8 @@ struct network_info {
u16 beacon_period;
u8 dtim_period;
u8 ch;
- unsigned long u32TimeRcvdInScanCached;
- unsigned long u32TimeRcvdInScan;
+ unsigned long time_scan_cached;
+ unsigned long time_scan;
bool bNewNetwork;
u8 u8Found;
u32 u32Tsf;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 1773587..4767aa0 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -277,7 +277,7 @@ static void update_scan_time(void)
int i;

for (i = 0; i < last_scanned_cnt; i++)
- last_scanned_shadow[i].u32TimeRcvdInScan = jiffies;
+ last_scanned_shadow[i].time_scan = jiffies;
}

static void remove_network_from_shadow(unsigned long arg)
@@ -287,7 +287,8 @@ static void remove_network_from_shadow(unsigned long arg)


for (i = 0; i < last_scanned_cnt; i++) {
- if (time_after(now, last_scanned_shadow[i].u32TimeRcvdInScan + (unsigned long)(SCAN_RESULT_EXPIRE))) {
+ if (time_after(now, last_scanned_shadow[i].time_scan +
+ (unsigned long)(SCAN_RESULT_EXPIRE))) {
PRINT_D(CFG80211_DBG, "Network expired ScanShadow:%s\n",
last_scanned_shadow[i].ssid);

@@ -384,8 +385,8 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
kmalloc(pstrNetworkInfo->u16IEsLen, GFP_KERNEL);
memcpy(last_scanned_shadow[ap_index].pu8IEs,
pstrNetworkInfo->pu8IEs, pstrNetworkInfo->u16IEsLen);
- last_scanned_shadow[ap_index].u32TimeRcvdInScan = jiffies;
- last_scanned_shadow[ap_index].u32TimeRcvdInScanCached = jiffies;
+ last_scanned_shadow[ap_index].time_scan = jiffies;
+ last_scanned_shadow[ap_index].time_scan_cached = jiffies;
last_scanned_shadow[ap_index].u8Found = 1;
if (ap_found != -1)
wilc_free_join_params(last_scanned_shadow[ap_index].pJoinParams);
@@ -465,7 +466,7 @@ static void CfgScanResult(enum scan_event scan_event,
PRINT_D(CFG80211_DBG, "Update RSSI of %s\n", last_scanned_shadow[i].ssid);

last_scanned_shadow[i].rssi = network_info->rssi;
- last_scanned_shadow[i].u32TimeRcvdInScan = jiffies;
+ last_scanned_shadow[i].time_scan = jiffies;
break;
}
}
@@ -566,9 +567,9 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent,
unsigned long now = jiffies;

if (time_after(now,
- last_scanned_shadow[i].u32TimeRcvdInScanCached + (unsigned long)(nl80211_SCAN_RESULT_EXPIRE - (1 * HZ)))) {
+ last_scanned_shadow[i].time_scan_cached +
+ (unsigned long)(nl80211_SCAN_RESULT_EXPIRE - (1 * HZ))))
bNeedScanRefresh = true;
- }

break;
}
--
1.9.1


2016-02-02 12:05:36

by Leo Kim

[permalink] [raw]
Subject: [PATCH 07/26] staging: wilc1000: renames u16CapInfo of connect_resp_info structure

This patch renames u16CapInfo variable to cap_info.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 2 +-
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/host_interface.c | 2 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 42 +++++++++++++++++------
4 files changed, 35 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 1e8c56b..6c40d36 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -314,7 +314,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer,
msa = &wid_val[1];

rx_len = wid_len - 1;
- network_info->u16CapInfo = get_cap_info(msa);
+ network_info->cap_info = get_cap_info(msa);
network_info->u32Tsf = get_beacon_timestamp_lo(msa);

tsf_lo = get_beacon_timestamp_lo(msa);
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index e386e85..ace50d8 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -78,7 +78,7 @@ typedef struct {

struct network_info {
s8 rssi;
- u16 u16CapInfo;
+ u16 cap_info;
u8 au8ssid[MAX_SSID_LEN];
u8 u8SsidLen;
u8 au8bssid[6];
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 96f7f94..e4abc4b 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4278,7 +4278,7 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
if (pNewJoinBssParam) {
pNewJoinBssParam->dtim_period = ptstrNetworkInfo->u8DtimPeriod;
pNewJoinBssParam->beacon_period = ptstrNetworkInfo->u16BeaconPeriod;
- pNewJoinBssParam->cap_info = ptstrNetworkInfo->u16CapInfo;
+ pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info;
memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->au8bssid, 6);
memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->au8ssid, ptstrNetworkInfo->u8SsidLen + 1);
pNewJoinBssParam->ssid_len = ptstrNetworkInfo->u8SsidLen;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 048e6df..4d50dd7 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -246,9 +246,17 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan)
rssi = get_rssi_avg(network_info);
if (memcmp("DIRECT-", network_info->au8ssid, 7) ||
direct_scan) {
- bss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, network_info->au8bssid, network_info->u64Tsf, network_info->u16CapInfo,
- network_info->u16BeaconPeriod, (const u8 *)network_info->pu8IEs,
- (size_t)network_info->u16IEsLen, (((s32)rssi) * 100), GFP_KERNEL);
+ bss = cfg80211_inform_bss(wiphy,
+ channel,
+ CFG80211_BSS_FTYPE_UNKNOWN,
+ network_info->au8bssid,
+ network_info->u64Tsf,
+ network_info->cap_info,
+ network_info->u16BeaconPeriod,
+ (const u8 *)network_info->pu8IEs,
+ (size_t)network_info->u16IEsLen,
+ (s32)rssi * 100,
+ GFP_KERNEL);
cfg80211_put_bss(wiphy, bss);
}
}
@@ -358,7 +366,7 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
}
last_scanned_shadow[ap_index].strRssi.u8Index = rssi_index;
last_scanned_shadow[ap_index].rssi = pstrNetworkInfo->rssi;
- last_scanned_shadow[ap_index].u16CapInfo = pstrNetworkInfo->u16CapInfo;
+ last_scanned_shadow[ap_index].cap_info = pstrNetworkInfo->cap_info;
last_scanned_shadow[ap_index].u8SsidLen = pstrNetworkInfo->u8SsidLen;
memcpy(last_scanned_shadow[ap_index].au8ssid,
pstrNetworkInfo->au8ssid, pstrNetworkInfo->u8SsidLen);
@@ -414,9 +422,15 @@ static void CfgScanResult(enum scan_event scan_event,
if (!channel)
return;

- PRINT_INFO(CFG80211_DBG, "Network Info:: CHANNEL Frequency: %d, RSSI: %d, CapabilityInfo: %d,"
- "BeaconPeriod: %d\n", channel->center_freq, (((s32)network_info->rssi) * 100),
- network_info->u16CapInfo, network_info->u16BeaconPeriod);
+ PRINT_INFO(CFG80211_DBG, "Network Info::"
+ "CHANNEL Frequency: %d,"
+ "RSSI: %d,"
+ "Capability Info: %d,"
+ "Beacon Period: %d\n",
+ channel->center_freq,
+ (s32)network_info->rssi * 100,
+ network_info->cap_info,
+ network_info->u16BeaconPeriod);

if (network_info->bNewNetwork) {
if (priv->u32RcvdChCount < MAX_NUM_SCANNED_NETWORKS) {
@@ -426,9 +440,17 @@ static void CfgScanResult(enum scan_event scan_event,
add_network_to_shadow(network_info, priv, join_params);

if (!(memcmp("DIRECT-", network_info->au8ssid, 7))) {
- bss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, network_info->au8bssid, network_info->u64Tsf, network_info->u16CapInfo,
- network_info->u16BeaconPeriod, (const u8 *)network_info->pu8IEs,
- (size_t)network_info->u16IEsLen, (((s32)network_info->rssi) * 100), GFP_KERNEL);
+ bss = cfg80211_inform_bss(wiphy,
+ channel,
+ CFG80211_BSS_FTYPE_UNKNOWN,
+ network_info->au8bssid,
+ network_info->u64Tsf,
+ network_info->cap_info,
+ network_info->u16BeaconPeriod,
+ (const u8 *)network_info->pu8IEs,
+ (size_t)network_info->u16IEsLen,
+ (s32)network_info->rssi * 100,
+ GFP_KERNEL);
cfg80211_put_bss(wiphy, bss);
}
}
--
1.9.1


2016-02-02 12:05:06

by Leo Kim

[permalink] [raw]
Subject: [PATCH 02/26] staging: wilc1000: removes function 'wilc_dealloc_assoc_resp_info()'

This patch removes function wilc_dealloc_assoc_resp_info()'.
Does not need this function which only free memory.
Therefore, this function is removed and changed directly with kfree.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 22 ----------------------
drivers/staging/wilc1000/coreconfigurator.h | 1 -
drivers/staging/wilc1000/host_interface.c | 4 ++--
3 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 81dd22e..c86278d 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -386,25 +386,3 @@ s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,

return 0;
}
-
-s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *connect_resp_info)
-{
- s32 result = 0;
-
- if (connect_resp_info) {
- if (connect_resp_info->pu8RespIEs) {
- kfree(connect_resp_info->pu8RespIEs);
- connect_resp_info->pu8RespIEs = NULL;
- } else {
- result = -EFAULT;
- }
-
- kfree(connect_resp_info);
- connect_resp_info = NULL;
-
- } else {
- result = -EFAULT;
- }
-
- return result;
-}
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 23775e4..d42f47c 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -123,7 +123,6 @@ typedef struct {
s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info);
s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,
tstrConnectRespInfo **ret_connect_resp_info);
-s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *connect_resp_info);
void wilc_scan_complete_received(struct wilc *wilc, u8 *pu8Buffer,
u32 u32Length);
void wilc_network_info_received(struct wilc *wilc, u8 *pu8Buffer,
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 3ce3a7c..15c266b 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1505,8 +1505,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
}

if (pstrConnectRespInfo) {
- wilc_dealloc_assoc_resp_info(pstrConnectRespInfo);
- pstrConnectRespInfo = NULL;
+ kfree(pstrConnectRespInfo->pu8RespIEs);
+ kfree(pstrConnectRespInfo);
}
}
}
--
1.9.1


2016-02-02 12:08:28

by Leo Kim

[permalink] [raw]
Subject: [PATCH 25/26] staging: wilc1000: remove unnecessary log message using GENERIC_DBG tag

From: Chris Park <[email protected]>

This patch remove unnecessary log message using GENERIC_DBG tag.
Needed log messages has changed netdev_dbg from PRINT_D.
And removes variables that were used to log message.

Signed-off-by: Chris Park <[email protected]>
Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 42 +------------
drivers/staging/wilc1000/linux_wlan.c | 2 -
drivers/staging/wilc1000/linux_wlan_common.h | 4 +-
drivers/staging/wilc1000/wilc_debugfs.c | 6 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 76 +++--------------------
drivers/staging/wilc1000/wilc_wlan.c | 2 -
drivers/staging/wilc1000/wilc_wlan_cfg.c | 11 +---
7 files changed, 18 insertions(+), 125 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 017a357..caffb9c 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -449,7 +449,6 @@ static s32 handle_set_mac_address(struct wilc_vif *vif,
wid.type = WID_STR;
wid.val = mac_buf;
wid.size = ETH_ALEN;
- PRINT_D(GENERIC_DBG, "mac addr = :%pM\n", wid.val);

result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
wilc_get_vif_idx(vif));
@@ -804,15 +803,12 @@ static s32 Handle_Scan(struct wilc_vif *vif,

if ((hif_drv->hif_state >= HOST_IF_SCANNING) &&
(hif_drv->hif_state < HOST_IF_CONNECTED)) {
- PRINT_D(GENERIC_DBG, "Don't scan already in [%d] state\n",
- hif_drv->hif_state);
PRINT_ER("Already scan\n");
result = -EBUSY;
goto ERRORHANDLER;
}

if (wilc_optaining_ip || wilc_connecting) {
- PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until IP adresss is obtained\n");
PRINT_ER("Don't do obss scan\n");
result = -EBUSY;
goto ERRORHANDLER;
@@ -919,7 +915,6 @@ static s32 Handle_ScanDone(struct wilc_vif *vif,
struct host_if_drv *hif_drv = vif->hif_drv;

if (enuEvent == SCAN_EVENT_ABORTED) {
- PRINT_D(GENERIC_DBG, "Abort running scan\n");
u8abort_running_scan = 1;
wid.id = (u16)WID_ABORT_RUNNING_SCAN;
wid.type = WID_CHAR;
@@ -960,8 +955,6 @@ static s32 Handle_Connect(struct wilc_vif *vif,
struct join_bss_param *ptstrJoinBssParam;
struct host_if_drv *hif_drv = vif->hif_drv;

- PRINT_D(GENERIC_DBG, "Handling connect request\n");
-
if (memcmp(pstrHostIFconnectAttr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
result = 0;
PRINT_ER("Trying to connect to an already connected AP, Discard connect request\n");
@@ -1153,13 +1146,9 @@ static s32 Handle_Connect(struct wilc_vif *vif,
join_req_vif = vif;
}

- if (pstrHostIFconnectAttr->bssid) {
+ if (pstrHostIFconnectAttr->bssid)
memcpy(wilc_connected_ssid,
pstrHostIFconnectAttr->bssid, ETH_ALEN);
- PRINT_D(GENERIC_DBG, "save Bssid = %pM\n",
- pstrHostIFconnectAttr->bssid);
- PRINT_D(GENERIC_DBG, "save bssid = %pM\n", wilc_connected_ssid);
- }

result = wilc_send_config_pkt(vif, SET_CFG, strWIDList,
u32WidsCount,
@@ -1169,7 +1158,6 @@ static s32 Handle_Connect(struct wilc_vif *vif,
result = -EFAULT;
goto ERRORHANDLER;
} else {
- PRINT_D(GENERIC_DBG, "set HOST_IF_WAITING_CONN_RESP\n");
hif_drv->hif_state = HOST_IF_WAITING_CONN_RESP;
}

@@ -1447,8 +1435,6 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
PRINT_ER("Driver handler is NULL\n");
return -ENODEV;
}
- PRINT_D(GENERIC_DBG, "Current State = %d,Received state = %d\n",
- hif_drv->hif_state, pstrRcvdGnrlAsyncInfo->buffer[7]);

if ((hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) ||
(hif_drv->hif_state == HOST_IF_CONNECTED) ||
@@ -1552,7 +1538,6 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,

hif_drv->hif_state = HOST_IF_CONNECTED;

- PRINT_D(GENERIC_DBG, "Obtaining an IP, Disable Scan\n");
wilc_optaining_ip = true;
mod_timer(&wilc_during_ip_timer,
jiffies + msecs_to_jiffies(10000));
@@ -2425,19 +2410,16 @@ static int Handle_RemainOnChan(struct wilc_vif *vif,
}

if (hif_drv->usr_scan_req.scan_result) {
- PRINT_INFO(GENERIC_DBG, "Required to remain on chan while scanning return\n");
hif_drv->remain_on_ch_pending = 1;
result = -EBUSY;
goto ERRORHANDLER;
}
if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) {
- PRINT_INFO(GENERIC_DBG, "Required to remain on chan while connecting return\n");
result = -EBUSY;
goto ERRORHANDLER;
}

if (wilc_optaining_ip || wilc_connecting) {
- PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until IP adresss is obtained\n");
result = -EBUSY;
goto ERRORHANDLER;
}
@@ -2545,7 +2527,7 @@ static u32 Handle_ListenStateExpired(struct wilc_vif *vif,
}
P2P_LISTEN_STATE = 0;
} else {
- PRINT_D(GENERIC_DBG, "Not in listen state\n");
+ netdev_dbg(vif->ndev, "Not in listen state\n");
result = -EFAULT;
}

@@ -2639,12 +2621,6 @@ static s32 Handle_DelAllRxBASessions(struct wilc_vif *vif,
struct wid wid;
char *ptr = NULL;

- PRINT_D(GENERIC_DBG, "Delete Block Ack session with\nBSSID = %.2x:%.2x:%.2x\nTID=%d\n",
- strHostIfBASessionInfo->bssid[0],
- strHostIfBASessionInfo->bssid[1],
- strHostIfBASessionInfo->bssid[2],
- strHostIfBASessionInfo->tid);
-
wid.id = (u16)WID_DEL_ALL_RX_BA;
wid.type = WID_STR;
wid.val = kmalloc(BLOCK_ACK_REQ_SIZE, GFP_KERNEL);
@@ -2715,13 +2691,10 @@ static int hostIFthread(void *pvArg)
while (1) {
wilc_mq_recv(&hif_msg_q, &msg, sizeof(struct host_if_msg), &u32Ret);
vif = msg.vif;
- if (msg.id == HOST_IF_MSG_EXIT) {
- PRINT_D(GENERIC_DBG, "THREAD: Exiting HostIfThread\n");
+ if (msg.id == HOST_IF_MSG_EXIT)
break;
- }

if ((!wilc_initialized)) {
- PRINT_D(GENERIC_DBG, "--WAIT--");
usleep_range(200 * 1000, 200 * 1000);
wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
continue;
@@ -3319,9 +3292,6 @@ s32 wilc_set_join_req(struct wilc_vif *vif, u8 *pu8bssid, const u8 *pu8ssid,
}
if (hif_drv->hif_state < HOST_IF_CONNECTING)
hif_drv->hif_state = HOST_IF_CONNECTING;
- else
- PRINT_D(GENERIC_DBG, "Don't set state to 'connecting' : %d\n",
- hif_drv->hif_state);

result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result) {
@@ -3867,8 +3837,6 @@ void wilc_scan_complete_received(struct wilc *wilc, u8 *pu8Buffer,
return;
hif_drv = vif->hif_drv;

- PRINT_D(GENERIC_DBG, "Scan notification received %p\n", hif_drv);
-
if (!hif_drv || hif_drv == terminated_handle)
return;

@@ -4342,10 +4310,6 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
pNewJoinBssParam->opp_enabled = 0;
}

- PRINT_D(GENERIC_DBG, "P2P Dump\n");
- for (i = 0; i < pu8IEs[index + 7]; i++)
- PRINT_D(GENERIC_DBG, " %x\n", pu8IEs[index + 9 + i]);
-
pNewJoinBssParam->cnt = pu8IEs[index + 11];
u16P2P_count = index + 12;

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index e702020..c11830f 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -253,8 +253,6 @@ void wilc_mac_indicate(struct wilc *wilc, int flag)
} else {
wilc->mac_status = status;
}
- } else if (flag == WILC_MAC_INDICATE_SCAN) {
- PRINT_D(GENERIC_DBG, "Scanning ...\n");
}
}

diff --git a/drivers/staging/wilc1000/linux_wlan_common.h b/drivers/staging/wilc1000/linux_wlan_common.h
index 758633e..44573e2 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -2,14 +2,12 @@
#define LINUX_WLAN_COMMON_H

enum debug_region {
- Generic_debug = 0,
- Hostapd_debug,
+ Hostapd_debug = 0,
CFG80211_debug,
Init_debug,
COMP = 0xFFFFFFFF,
};

-#define GENERIC_DBG (1 << Generic_debug)
#define HOSTAPD_DBG (1 << Hostapd_debug)
#define CFG80211_DBG (1 << CFG80211_debug)
#define INIT_DBG (1 << Init_debug)
diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c
index 13330c9..709e40f 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -24,9 +24,9 @@ static struct dentry *wilc_dir;
* --------------------------------------------------------------------------------
*/

-#define DBG_REGION_ALL (GENERIC_DBG | HOSTAPD_DBG | CFG80211_DBG | INIT_DBG)
+#define DBG_REGION_ALL (HOSTAPD_DBG | CFG80211_DBG | INIT_DBG)
#define DBG_LEVEL_ALL (DEBUG | INFO | WRN | ERR)
-atomic_t WILC_REGION = ATOMIC_INIT(INIT_DBG | GENERIC_DBG | CFG80211_DBG |
+atomic_t WILC_REGION = ATOMIC_INIT(INIT_DBG | CFG80211_DBG |
HOSTAPD_DBG);
EXPORT_SYMBOL_GPL(WILC_REGION);
atomic_t WILC_DEBUG_LEVEL = ATOMIC_INIT(ERR);
@@ -136,7 +136,7 @@ struct wilc_debugfs_info_t {

static struct wilc_debugfs_info_t debugfs_info[] = {
{ "wilc_debug_level", 0666, (DEBUG | ERR), FOPS(NULL, wilc_debug_level_read, wilc_debug_level_write, NULL), },
- { "wilc_debug_region", 0666, (INIT_DBG | GENERIC_DBG | CFG80211_DBG), FOPS(NULL, wilc_debug_region_read, wilc_debug_region_write, NULL), },
+ { "wilc_debug_region", 0666, (INIT_DBG | CFG80211_DBG), FOPS(NULL, wilc_debug_region_read, wilc_debug_region_write, NULL), },
};

static int __init wilc_debugfs_init(void)
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 1f0e4e2..79a4b7f 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -317,7 +317,6 @@ static void remove_network_from_shadow(unsigned long arg)

static void clear_duringIP(unsigned long arg)
{
- PRINT_D(GENERIC_DBG, "GO:IP Obtained , enable scan\n");
wilc_optaining_ip = false;
}

@@ -1567,7 +1566,6 @@ static void WILC_WFI_CfgParseRxAction(u8 *buf, u32 len)
}
if (wlan_channel != INVALID_CHANNEL) {
if (channel_list_attr_index) {
- PRINT_D(GENERIC_DBG, "Modify channel list attribute\n");
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++) {
@@ -1579,7 +1577,6 @@ static void WILC_WFI_CfgParseRxAction(u8 *buf, u32 len)
}

if (op_channel_attr_index) {
- PRINT_D(GENERIC_DBG, "Modify operating channel attribute\n");
buf[op_channel_attr_index + 6] = 0x51;
buf[op_channel_attr_index + 7] = wlan_channel;
}
@@ -1609,7 +1606,6 @@ static void WILC_WFI_CfgParseTxAction(u8 *buf, u32 len, bool bOperChan, u8 iftyp
}
if (wlan_channel != INVALID_CHANNEL && bOperChan) {
if (channel_list_attr_index) {
- PRINT_D(GENERIC_DBG, "Modify channel list attribute\n");
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++) {
@@ -1621,7 +1617,6 @@ static void WILC_WFI_CfgParseTxAction(u8 *buf, u32 len, bool bOperChan, u8 iftyp
}

if (op_channel_attr_index) {
- PRINT_D(GENERIC_DBG, "Modify operating channel attribute\n");
buf[op_channel_attr_index + 6] = 0x51;
buf[op_channel_attr_index + 7] = wlan_channel;
}
@@ -1645,41 +1640,29 @@ void WILC_WFI_p2p_rx (struct net_device *dev, u8 *buff, u32 size)

if (pkt_offset & IS_MANAGMEMENT_CALLBACK) {
if (buff[FRAME_TYPE_ID] == IEEE80211_STYPE_PROBE_RESP) {
- PRINT_D(GENERIC_DBG, "Probe response ACK\n");
cfg80211_mgmt_tx_status(priv->wdev, priv->u64tx_cookie, buff, size, true, GFP_KERNEL);
return;
} else {
- if (pkt_offset & IS_MGMT_STATUS_SUCCES) {
- PRINT_D(GENERIC_DBG, "Success Ack - Action frame category: %x Action Subtype: %d Dialog T: %x OR %x\n", buff[ACTION_CAT_ID], buff[ACTION_SUBTYPE_ID],
- buff[ACTION_SUBTYPE_ID + 1], buff[P2P_PUB_ACTION_SUBTYPE + 1]);
+ if (pkt_offset & IS_MGMT_STATUS_SUCCES)
cfg80211_mgmt_tx_status(priv->wdev, priv->u64tx_cookie, buff, size, true, GFP_KERNEL);
- } else {
- PRINT_D(GENERIC_DBG, "Fail Ack - Action frame category: %x Action Subtype: %d Dialog T: %x OR %x\n", buff[ACTION_CAT_ID], buff[ACTION_SUBTYPE_ID],
- buff[ACTION_SUBTYPE_ID + 1], buff[P2P_PUB_ACTION_SUBTYPE + 1]);
+ else
cfg80211_mgmt_tx_status(priv->wdev, priv->u64tx_cookie, buff, size, false, GFP_KERNEL);
- }
return;
}
} else {
- PRINT_D(GENERIC_DBG, "Rx Frame Type:%x\n", buff[FRAME_TYPE_ID]);
-
s32Freq = ieee80211_channel_to_frequency(curr_channel, IEEE80211_BAND_2GHZ);

if (ieee80211_is_action(buff[FRAME_TYPE_ID])) {
- PRINT_D(GENERIC_DBG, "Rx Action Frame Type: %x %x\n", buff[ACTION_SUBTYPE_ID], buff[P2P_PUB_ACTION_SUBTYPE]);
-
if (priv->bCfgScanning && time_after_eq(jiffies, (unsigned long)pstrWFIDrv->p2p_timeout)) {
- PRINT_D(GENERIC_DBG, "Receiving action frames from wrong channels\n");
+ netdev_dbg(dev, "Receiving action wrong ch\n");
return;
}
if (buff[ACTION_CAT_ID] == PUB_ACTION_ATTR_ID) {
switch (buff[ACTION_SUBTYPE_ID]) {
case GAS_INTIAL_REQ:
- PRINT_D(GENERIC_DBG, "GAS INITIAL REQ %x\n", buff[ACTION_SUBTYPE_ID]);
break;

case GAS_INTIAL_RSP:
- PRINT_D(GENERIC_DBG, "GAS INITIAL RSP %x\n", buff[ACTION_SUBTYPE_ID]);
break;

case PUBLIC_ACT_VENDORSPEC:
@@ -1690,7 +1673,6 @@ void WILC_WFI_p2p_rx (struct net_device *dev, u8 *buff, u32 size)
if (!memcmp(p2p_vendor_spec, &buff[i], 6)) {
p2p_recv_random = buff[i + 6];
wilc_ie = true;
- PRINT_D(GENERIC_DBG, "WILC Vendor specific IE:%02x\n", p2p_recv_random);
break;
}
}
@@ -1707,20 +1689,19 @@ void WILC_WFI_p2p_rx (struct net_device *dev, u8 *buff, u32 size)
}
}
} else {
- PRINT_D(GENERIC_DBG, "PEER WILL BE GO LocaRand=%02x RecvRand %02x\n", p2p_local_random, p2p_recv_random);
+ netdev_dbg(dev, "PEER WILL BE GO LocaRand=%02x RecvRand %02x\n", p2p_local_random, p2p_recv_random);
}
}


if ((buff[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_REQ || buff[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_RSP) && (wilc_ie)) {
- PRINT_D(GENERIC_DBG, "Sending P2P to host without extra elemnt\n");
cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size - 7, 0);
return;
}
break;

default:
- PRINT_D(GENERIC_DBG, "NOT HANDLED PUBLIC ACTION FRAME TYPE:%x\n", buff[ACTION_SUBTYPE_ID]);
+ netdev_dbg(dev, "NOT HANDLED PUBLIC ACTION FRAME TYPE:%x\n", buff[ACTION_SUBTYPE_ID]);
break;
}
}
@@ -1761,17 +1742,12 @@ static void WILC_WFI_RemainOnChannelExpired(void *pUserVoid, u32 u32SessionID)
priv = (struct wilc_priv *)pUserVoid;

if (u32SessionID == priv->strRemainOnChanParams.u32ListenSessionID) {
- PRINT_D(GENERIC_DBG, "Remain on channel expired\n");
-
priv->bInP2PlistenState = false;

cfg80211_remain_on_channel_expired(priv->wdev,
priv->strRemainOnChanParams.u64ListenCookie,
priv->strRemainOnChanParams.pstrListenChan,
GFP_KERNEL);
- } else {
- PRINT_D(GENERIC_DBG, "Received ID 0x%x Expected ID 0x%x (No match)\n", u32SessionID
- , priv->strRemainOnChanParams.u32ListenSessionID);
}
}

@@ -1787,11 +1763,8 @@ static int remain_on_channel(struct wiphy *wiphy,
priv = wiphy_priv(wiphy);
vif = netdev_priv(priv->dev);

- PRINT_D(GENERIC_DBG, "Remaining on channel %d\n", chan->hw_value);
-
-
if (wdev->iftype == NL80211_IFTYPE_AP) {
- PRINT_D(GENERIC_DBG, "Required remain-on-channel while in AP mode");
+ netdev_dbg(vif->ndev, "Required while in AP mode\n");
return s32Error;
}

@@ -1868,34 +1841,22 @@ static int mgmt_tx(struct wiphy *wiphy,


if (ieee80211_is_probe_resp(mgmt->frame_control)) {
- PRINT_D(GENERIC_DBG, "TX: Probe Response\n");
- PRINT_D(GENERIC_DBG, "Setting channel: %d\n", chan->hw_value);
wilc_set_mac_chnl_num(vif, chan->hw_value);
curr_channel = chan->hw_value;
} else if (ieee80211_is_action(mgmt->frame_control)) {
- PRINT_D(GENERIC_DBG, "ACTION FRAME:%x\n", (u16)mgmt->frame_control);
-
-
if (buf[ACTION_CAT_ID] == PUB_ACTION_ATTR_ID) {
if (buf[ACTION_SUBTYPE_ID] != PUBLIC_ACT_VENDORSPEC ||
buf[P2P_PUB_ACTION_SUBTYPE] != GO_NEG_CONF) {
- PRINT_D(GENERIC_DBG, "Setting channel: %d\n", chan->hw_value);
wilc_set_mac_chnl_num(vif,
chan->hw_value);
curr_channel = chan->hw_value;
}
switch (buf[ACTION_SUBTYPE_ID]) {
case GAS_INTIAL_REQ:
- {
- PRINT_D(GENERIC_DBG, "GAS INITIAL REQ %x\n", buf[ACTION_SUBTYPE_ID]);
break;
- }

case GAS_INTIAL_RSP:
- {
- PRINT_D(GENERIC_DBG, "GAS INITIAL RSP %x\n", buf[ACTION_SUBTYPE_ID]);
break;
- }

case PUBLIC_ACT_VENDORSPEC:
{
@@ -1910,8 +1871,6 @@ static int mgmt_tx(struct wiphy *wiphy,
if ((buf[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_REQ || buf[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_RSP
|| buf[P2P_PUB_ACTION_SUBTYPE] == P2P_INV_REQ || buf[P2P_PUB_ACTION_SUBTYPE] == P2P_INV_RSP)) {
if (p2p_local_random > p2p_recv_random) {
- PRINT_D(GENERIC_DBG, "LOCAL WILL BE GO LocaRand=%02x RecvRand %02x\n", p2p_local_random, p2p_recv_random);
-
for (i = P2P_PUB_ACTION_SUBTYPE + 2; i < len; i++) {
if (buf[i] == P2PELEM_ATTR_ID && !(memcmp(p2p_oui, &buf[i + 2], 4))) {
if (buf[P2P_PUB_ACTION_SUBTYPE] == P2P_INV_REQ || buf[P2P_PUB_ACTION_SUBTYPE] == P2P_INV_RSP)
@@ -1927,13 +1886,11 @@ static int mgmt_tx(struct wiphy *wiphy,
mgmt_tx->buff[len + sizeof(p2p_vendor_spec)] = p2p_local_random;
mgmt_tx->size = buf_len;
}
- } else {
- PRINT_D(GENERIC_DBG, "PEER WILL BE GO LocaRand=%02x RecvRand %02x\n", p2p_local_random, p2p_recv_random);
}
}

} else {
- PRINT_D(GENERIC_DBG, "Not a P2P public action frame\n");
+ netdev_dbg(vif->ndev, "Not a P2P public action frame\n");
}

break;
@@ -1941,24 +1898,18 @@ static int mgmt_tx(struct wiphy *wiphy,

default:
{
- PRINT_D(GENERIC_DBG, "NOT HANDLED PUBLIC ACTION FRAME TYPE:%x\n", buf[ACTION_SUBTYPE_ID]);
+ netdev_dbg(vif->ndev, "NOT HANDLED PUBLIC ACTION FRAME TYPE:%x\n", buf[ACTION_SUBTYPE_ID]);
break;
}
}
}

- PRINT_D(GENERIC_DBG, "TX: ACTION FRAME Type:%x : Chan:%d\n", buf[ACTION_SUBTYPE_ID], chan->hw_value);
pstrWFIDrv->p2p_timeout = (jiffies + msecs_to_jiffies(wait));
-
- PRINT_D(GENERIC_DBG, "Current Jiffies: %lu Timeout:%llu\n",
- jiffies, pstrWFIDrv->p2p_timeout);
}

wilc_wlan_txq_add_mgmt_pkt(wdev->netdev, mgmt_tx,
mgmt_tx->buff, mgmt_tx->size,
WILC_WFI_mgmt_tx_complete);
- } else {
- PRINT_D(GENERIC_DBG, "This function transmits only management frames\n");
}
return 0;
}
@@ -1972,9 +1923,6 @@ static int mgmt_tx_cancel_wait(struct wiphy *wiphy,

priv = wiphy_priv(wiphy);
pstrWFIDrv = (struct host_if_drv *)priv->hif_drv;
-
-
- PRINT_D(GENERIC_DBG, "Tx Cancel wait :%lu\n", jiffies);
pstrWFIDrv->p2p_timeout = jiffies;

if (!priv->bInP2PlistenState) {
@@ -2001,7 +1949,6 @@ void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev,
if (!frame_type)
return;

- PRINT_D(GENERIC_DBG, "Frame registering Frame Type: %x: Boolean: %d\n", frame_type, reg);
switch (frame_type) {
case PROBE_REQ:
{
@@ -2023,10 +1970,8 @@ void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev,
}
}

- if (!wl->initialized) {
- PRINT_D(GENERIC_DBG, "Return since mac is closed\n");
+ if (!wl->initialized)
return;
- }
wilc_frame_register(vif, frame_type, reg);
}

@@ -2099,7 +2044,6 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
wilc_ie = false;
wilc_optaining_ip = false;
del_timer(&wilc_during_ip_timer);
- PRINT_D(GENERIC_DBG, "Changing virtual interface, enable scan\n");

switch (type) {
case NL80211_IFTYPE_STATION:
@@ -2148,8 +2092,6 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
break;

case NL80211_IFTYPE_P2P_GO:
- PRINT_D(GENERIC_DBG, "start duringIP timer\n");
-
wilc_optaining_ip = true;
mod_timer(&wilc_during_ip_timer,
jiffies + msecs_to_jiffies(during_ip_time));
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index fc0f772..7d6492f 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -713,8 +713,6 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
break;

if (entries == 0) {
- PRINT_WRN(GENERIC_DBG, "[wilc txq]: no more buffer in the chip (reg: %08x), retry later [[ %d, %x ]]\n", reg, i, vmm_table[i - 1]);
-
ret = wilc->hif_func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, &reg);
if (!ret)
break;
diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index 3b3065b..2bb684a 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -270,13 +270,12 @@ static int wilc_wlan_cfg_set_bin(u8 *frame, u32 offset, u16 id, u8 *b, u32 size)
static void wilc_wlan_parse_response_frame(u8 *info, int size)
{
u32 wid, len = 0, i = 0;
- static int seq;

while (size > 0) {
i = 0;
wid = info[0] | (info[1] << 8);
wid = cpu_to_le32(wid);
- PRINT_INFO(GENERIC_DBG, "Processing response for %d seq %d\n", wid, seq++);
+
switch ((wid >> 12) & 0x7) {
case WID_CHAR:
do {
@@ -329,10 +328,6 @@ static void wilc_wlan_parse_response_frame(u8 *info, int size)
if (wid == WID_SITE_SURVEY_RESULTS) {
static int toggle;

- PRINT_INFO(GENERIC_DBG, "Site survey results received[%d]\n",
- size);
-
- PRINT_INFO(GENERIC_DBG, "Site survey results value[%d]toggle[%d]\n", size, toggle);
i += toggle;
toggle ^= 1;
}
@@ -361,7 +356,7 @@ static int wilc_wlan_parse_info_frame(u8 *info, int size)
wid = info[0] | (info[1] << 8);

len = info[2];
- PRINT_INFO(GENERIC_DBG, "Status Len = %d Id= %d\n", len, wid);
+
if ((len == 1) && (wid == WID_STATUS)) {
pd->mac_status = info[3];
type = WILC_CFG_RSP_STATUS;
@@ -475,8 +470,6 @@ int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 buffer_size)
if (g_cfg_str[i].id == WID_SITE_SURVEY_RESULTS) {
static int toggle;

- PRINT_INFO(GENERIC_DBG, "Site survey results value[%d]\n",
- size);
i += toggle;
toggle ^= 1;

--
1.9.1


2016-02-02 12:06:06

by Leo Kim

[permalink] [raw]
Subject: [PATCH 09/26] staging: wilc1000: renames u8SsidLen of connect_resp_info structure

This patch renames u8SsidLen variable to ssid_len.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 2 +-
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/host_interface.c | 4 ++--
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 4dd7c8a..273fad9 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -322,7 +322,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer,

network_info->u64Tsf = tsf_lo | ((u64)tsf_hi << 32);

- get_ssid(msa, network_info->ssid, &network_info->u8SsidLen);
+ get_ssid(msa, network_info->ssid, &network_info->ssid_len);
get_BSSID(msa, network_info->au8bssid);

network_info->u8channel = get_current_channel_802_11n(msa,
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 781a65f..39f3691 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -80,7 +80,7 @@ struct network_info {
s8 rssi;
u16 cap_info;
u8 ssid[MAX_SSID_LEN];
- u8 u8SsidLen;
+ u8 ssid_len;
u8 au8bssid[6];
u16 u16BeaconPeriod;
u8 u8DtimPeriod;
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 7752af2..e9a3057 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4281,8 +4281,8 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info;
memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->au8bssid, 6);
memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->ssid,
- ptstrNetworkInfo->u8SsidLen + 1);
- pNewJoinBssParam->ssid_len = ptstrNetworkInfo->u8SsidLen;
+ ptstrNetworkInfo->ssid_len + 1);
+ pNewJoinBssParam->ssid_len = ptstrNetworkInfo->ssid_len;
memset(pNewJoinBssParam->rsn_pcip_policy, 0xFF, 3);
memset(pNewJoinBssParam->rsn_auth_policy, 0xFF, 3);

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 3b3411f..577b8ca 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -368,9 +368,9 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
last_scanned_shadow[ap_index].strRssi.u8Index = 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].u8SsidLen = pstrNetworkInfo->u8SsidLen;
+ last_scanned_shadow[ap_index].ssid_len = pstrNetworkInfo->ssid_len;
memcpy(last_scanned_shadow[ap_index].ssid,
- pstrNetworkInfo->ssid, pstrNetworkInfo->u8SsidLen);
+ pstrNetworkInfo->ssid, pstrNetworkInfo->ssid_len);
memcpy(last_scanned_shadow[ap_index].au8bssid,
pstrNetworkInfo->au8bssid, ETH_ALEN);
last_scanned_shadow[ap_index].u16BeaconPeriod = pstrNetworkInfo->u16BeaconPeriod;
@@ -738,7 +738,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
PRINT_INFO(CFG80211_DBG, "Required SSID = %s\n , AuthType = %d\n", sme->ssid, sme->auth_type);

for (i = 0; i < last_scanned_cnt; i++) {
- if ((sme->ssid_len == last_scanned_shadow[i].u8SsidLen) &&
+ if ((sme->ssid_len == last_scanned_shadow[i].ssid_len) &&
memcmp(last_scanned_shadow[i].ssid,
sme->ssid,
sme->ssid_len) == 0) {
--
1.9.1


2016-02-02 12:06:31

by Leo Kim

[permalink] [raw]
Subject: [PATCH 10/26] staging: wilc1000: renames au8bssid of connect_resp_info structure

This patch renames au8bssid variable to bssid.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 2 +-
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/host_interface.c | 10 +++----
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 34 ++++++++++++-----------
4 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 273fad9..4a82576 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -323,7 +323,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer,
network_info->u64Tsf = tsf_lo | ((u64)tsf_hi << 32);

get_ssid(msa, network_info->ssid, &network_info->ssid_len);
- get_BSSID(msa, network_info->au8bssid);
+ get_BSSID(msa, network_info->bssid);

network_info->u8channel = get_current_channel_802_11n(msa,
rx_len + FCS_LEN);
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 39f3691..5404162 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -81,7 +81,7 @@ struct network_info {
u16 cap_info;
u8 ssid[MAX_SSID_LEN];
u8 ssid_len;
- u8 au8bssid[6];
+ u8 bssid[6];
u16 u16BeaconPeriod;
u8 u8DtimPeriod;
u8 u8channel;
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index e9a3057..b465e9e 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1369,9 +1369,9 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,

for (i = 0; i < hif_drv->usr_scan_req.rcvd_ch_cnt; i++) {
if ((hif_drv->usr_scan_req.net_info[i].au8bssid) &&
- (pstrNetworkInfo->au8bssid)) {
+ (pstrNetworkInfo->bssid)) {
if (memcmp(hif_drv->usr_scan_req.net_info[i].au8bssid,
- pstrNetworkInfo->au8bssid, 6) == 0) {
+ pstrNetworkInfo->bssid, 6) == 0) {
if (pstrNetworkInfo->rssi <= hif_drv->usr_scan_req.net_info[i].s8rssi) {
goto done;
} else {
@@ -1388,9 +1388,9 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].s8rssi = pstrNetworkInfo->rssi;

if (hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].au8bssid &&
- pstrNetworkInfo->au8bssid) {
+ pstrNetworkInfo->bssid) {
memcpy(hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].au8bssid,
- pstrNetworkInfo->au8bssid, 6);
+ pstrNetworkInfo->bssid, 6);

hif_drv->usr_scan_req.rcvd_ch_cnt++;

@@ -4279,7 +4279,7 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
pNewJoinBssParam->dtim_period = ptstrNetworkInfo->u8DtimPeriod;
pNewJoinBssParam->beacon_period = ptstrNetworkInfo->u16BeaconPeriod;
pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info;
- memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->au8bssid, 6);
+ memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->bssid, 6);
memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->ssid,
ptstrNetworkInfo->ssid_len + 1);
pNewJoinBssParam->ssid_len = ptstrNetworkInfo->ssid_len;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 577b8ca..c8b9a97 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -249,7 +249,7 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan)
bss = cfg80211_inform_bss(wiphy,
channel,
CFG80211_BSS_FTYPE_UNKNOWN,
- network_info->au8bssid,
+ network_info->bssid,
network_info->u64Tsf,
network_info->cap_info,
network_info->u16BeaconPeriod,
@@ -332,8 +332,8 @@ static int is_network_in_shadow(struct network_info *pstrNetworkInfo,
state = -1;
} else {
for (i = 0; i < last_scanned_cnt; i++) {
- if (memcmp(last_scanned_shadow[i].au8bssid,
- pstrNetworkInfo->au8bssid, 6) == 0) {
+ if (memcmp(last_scanned_shadow[i].bssid,
+ pstrNetworkInfo->bssid, 6) == 0) {
state = i;
break;
}
@@ -371,8 +371,8 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
last_scanned_shadow[ap_index].ssid_len = pstrNetworkInfo->ssid_len;
memcpy(last_scanned_shadow[ap_index].ssid,
pstrNetworkInfo->ssid, pstrNetworkInfo->ssid_len);
- memcpy(last_scanned_shadow[ap_index].au8bssid,
- pstrNetworkInfo->au8bssid, ETH_ALEN);
+ memcpy(last_scanned_shadow[ap_index].bssid,
+ pstrNetworkInfo->bssid, ETH_ALEN);
last_scanned_shadow[ap_index].u16BeaconPeriod = pstrNetworkInfo->u16BeaconPeriod;
last_scanned_shadow[ap_index].u8DtimPeriod = pstrNetworkInfo->u8DtimPeriod;
last_scanned_shadow[ap_index].u8channel = pstrNetworkInfo->u8channel;
@@ -446,7 +446,7 @@ static void CfgScanResult(enum scan_event scan_event,
bss = cfg80211_inform_bss(wiphy,
channel,
CFG80211_BSS_FTYPE_UNKNOWN,
- network_info->au8bssid,
+ network_info->bssid,
network_info->u64Tsf,
network_info->cap_info,
network_info->u16BeaconPeriod,
@@ -461,7 +461,7 @@ static void CfgScanResult(enum scan_event scan_event,
u32 i;

for (i = 0; i < priv->u32RcvdChCount; i++) {
- if (memcmp(last_scanned_shadow[i].au8bssid, network_info->au8bssid, 6) == 0) {
+ if (memcmp(last_scanned_shadow[i].bssid, network_info->bssid, 6) == 0) {
PRINT_D(CFG80211_DBG, "Update RSSI of %s\n", last_scanned_shadow[i].ssid);

last_scanned_shadow[i].rssi = network_info->rssi;
@@ -560,8 +560,9 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent,


for (i = 0; i < last_scanned_cnt; i++) {
- if (memcmp(last_scanned_shadow[i].au8bssid,
- pstrConnectInfo->au8bssid, ETH_ALEN) == 0) {
+ if (memcmp(last_scanned_shadow[i].bssid,
+ pstrConnectInfo->au8bssid,
+ ETH_ALEN) == 0) {
unsigned long now = jiffies;

if (time_after(now,
@@ -747,7 +748,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
PRINT_INFO(CFG80211_DBG, "BSSID is not passed from the user\n");
break;
} else {
- if (memcmp(last_scanned_shadow[i].au8bssid,
+ if (memcmp(last_scanned_shadow[i].bssid,
sme->bssid,
ETH_ALEN) == 0) {
PRINT_INFO(CFG80211_DBG, "BSSID is passed from the user and matched\n");
@@ -762,10 +763,11 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,

pstrNetworkInfo = &last_scanned_shadow[i];

- PRINT_INFO(CFG80211_DBG, "network BSSID to be associated: %x%x%x%x%x%x\n",
- pstrNetworkInfo->au8bssid[0], pstrNetworkInfo->au8bssid[1],
- pstrNetworkInfo->au8bssid[2], pstrNetworkInfo->au8bssid[3],
- pstrNetworkInfo->au8bssid[4], pstrNetworkInfo->au8bssid[5]);
+ PRINT_INFO(CFG80211_DBG, "network BSSID to be associated:"
+ "%x%x%x%x%x%x\n",
+ pstrNetworkInfo->bssid[0], pstrNetworkInfo->bssid[1],
+ pstrNetworkInfo->bssid[2], pstrNetworkInfo->bssid[3],
+ pstrNetworkInfo->bssid[4], pstrNetworkInfo->bssid[5]);
} else {
s32Error = -ENOENT;
if (last_scanned_cnt == 0)
@@ -903,9 +905,9 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
if (!pstrWFIDrv->p2p_connect)
wlan_channel = pstrNetworkInfo->u8channel;

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

- s32Error = wilc_set_join_req(vif, pstrNetworkInfo->au8bssid, sme->ssid,
+ s32Error = wilc_set_join_req(vif, pstrNetworkInfo->bssid, sme->ssid,
sme->ssid_len, sme->ie, sme->ie_len,
CfgConnectResult, (void *)priv,
u8security, tenuAuth_type,
--
1.9.1


2016-02-02 12:06:46

by Leo Kim

[permalink] [raw]
Subject: [PATCH 11/26] staging: wilc1000: renames u16BeaconPeriod of connect_resp_info structure

This patch renames u16BeaconPeriod variable to beacon_period.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 2 +-
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/host_interface.c | 2 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 ++++----
4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 4a82576..b4f7ec3 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -330,7 +330,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer,

index = MAC_HDR_LEN + TIME_STAMP_LEN;

- network_info->u16BeaconPeriod = get_beacon_period(msa + index);
+ network_info->beacon_period = get_beacon_period(msa + index);

index += BEACON_INTERVAL_LEN + CAP_INFO_LEN;

diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 5404162..2fbffe8 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -82,7 +82,7 @@ struct network_info {
u8 ssid[MAX_SSID_LEN];
u8 ssid_len;
u8 bssid[6];
- u16 u16BeaconPeriod;
+ u16 beacon_period;
u8 u8DtimPeriod;
u8 u8channel;
unsigned long u32TimeRcvdInScanCached;
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index b465e9e..99bc890 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4277,7 +4277,7 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
pNewJoinBssParam = kzalloc(sizeof(struct join_bss_param), GFP_KERNEL);
if (pNewJoinBssParam) {
pNewJoinBssParam->dtim_period = ptstrNetworkInfo->u8DtimPeriod;
- pNewJoinBssParam->beacon_period = ptstrNetworkInfo->u16BeaconPeriod;
+ pNewJoinBssParam->beacon_period = ptstrNetworkInfo->beacon_period;
pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info;
memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->bssid, 6);
memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->ssid,
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index c8b9a97..086ec07 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -252,7 +252,7 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan)
network_info->bssid,
network_info->u64Tsf,
network_info->cap_info,
- network_info->u16BeaconPeriod,
+ network_info->beacon_period,
(const u8 *)network_info->pu8IEs,
(size_t)network_info->u16IEsLen,
(s32)rssi * 100,
@@ -373,7 +373,7 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
pstrNetworkInfo->ssid, pstrNetworkInfo->ssid_len);
memcpy(last_scanned_shadow[ap_index].bssid,
pstrNetworkInfo->bssid, ETH_ALEN);
- last_scanned_shadow[ap_index].u16BeaconPeriod = pstrNetworkInfo->u16BeaconPeriod;
+ last_scanned_shadow[ap_index].beacon_period = pstrNetworkInfo->beacon_period;
last_scanned_shadow[ap_index].u8DtimPeriod = pstrNetworkInfo->u8DtimPeriod;
last_scanned_shadow[ap_index].u8channel = pstrNetworkInfo->u8channel;
last_scanned_shadow[ap_index].u16IEsLen = pstrNetworkInfo->u16IEsLen;
@@ -431,7 +431,7 @@ static void CfgScanResult(enum scan_event scan_event,
channel->center_freq,
(s32)network_info->rssi * 100,
network_info->cap_info,
- network_info->u16BeaconPeriod);
+ network_info->beacon_period);

if (network_info->bNewNetwork) {
if (priv->u32RcvdChCount < MAX_NUM_SCANNED_NETWORKS) {
@@ -449,7 +449,7 @@ static void CfgScanResult(enum scan_event scan_event,
network_info->bssid,
network_info->u64Tsf,
network_info->cap_info,
- network_info->u16BeaconPeriod,
+ network_info->beacon_period,
(const u8 *)network_info->pu8IEs,
(size_t)network_info->u16IEsLen,
(s32)network_info->rssi * 100,
--
1.9.1


2016-02-02 12:07:54

by Leo Kim

[permalink] [raw]
Subject: [PATCH 22/26] staging: wilc1000: remove unnecessary wilc_rx_complete function

From: Chris Park <[email protected]>

This patch remove unnecessary wilc_rx_complete function
because this function only print unused log message.
remove unused has_packet variable nomore.

Signed-off-by: Chris Park <[email protected]>
Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 5 -----
drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 -
drivers/staging/wilc1000/wilc_wlan.c | 7 +------
3 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 202be15..e702020 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -372,11 +372,6 @@ static int linux_wlan_txq_task(void *vp)
return 0;
}

-void wilc_rx_complete(struct wilc *nic)
-{
- PRINT_D(RX_DBG, "RX completed\n");
-}
-
int wilc_wlan_get_firmware(struct net_device *dev)
{
struct wilc_vif *vif;
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 07a4ff1..3077f5d4 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -228,7 +228,6 @@ int wilc1000_wlan_init(struct net_device *dev, struct wilc_vif *vif);

void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset);
void wilc_mac_indicate(struct wilc *wilc, int flag);
-void wilc_rx_complete(struct wilc *wilc);
void wilc_dbg(u8 *buff);

int wilc_lock_timeout(struct wilc *wilc, void *, u32 timeout);
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 01c5857..10a0937 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -811,7 +811,7 @@ _end_:

static void wilc_wlan_handle_rxq(struct wilc *wilc)
{
- int offset = 0, size, has_packet = 0;
+ int offset = 0, size;
u8 *buffer;
struct rxq_entry_t *rqe;

@@ -866,7 +866,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
&buffer[offset],
pkt_len,
pkt_offset);
- has_packet = 1;
}
} else {
struct wilc_cfg_rsp rsp;
@@ -888,10 +887,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
break;
} while (1);
kfree(rqe);
-
- if (has_packet)
- wilc_rx_complete(wilc);
-
} while (1);

wilc->rxq_exit = 1;
--
1.9.1


2016-02-03 23:35:13

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 01/26] staging: wilc1000: removes function 'wilc_dealloc_network_info()'

On Tue, Feb 02, 2016 at 09:02:11PM +0900, Leo Kim wrote:
> This patch removes function 'wilc_dealloc_network_info()'.
> Does not need this function which only free memory.
> Therefore, this function is removed and changed directly with kfree.
>
> Signed-off-by: Leo Kim <[email protected]>

This series didn't apply either :(

2016-02-02 12:08:17

by Leo Kim

[permalink] [raw]
Subject: [PATCH 24/26] staging: wilc1000: remove unused debug tag

From: Chris Park <[email protected]>

This patch remove unused debug tag INT_DBG, LOCK_DBG, BUS_DBG,
MEM_DBG and FIRM_DBG

Signed-off-by: Chris Park <[email protected]>
Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/linux_wlan_common.h | 15 ---------------
drivers/staging/wilc1000/wilc_debugfs.c | 5 +++--
2 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan_common.h b/drivers/staging/wilc1000/linux_wlan_common.h
index 63d0ec5..758633e 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -5,29 +5,14 @@ enum debug_region {
Generic_debug = 0,
Hostapd_debug,
CFG80211_debug,
- Interrupt_debug,
- Lock_debug,
- Tcp_enhance,
- Spin_debug,
-
Init_debug,
- Bus_debug,
- Mem_debug,
- Firmware_debug,
COMP = 0xFFFFFFFF,
};

#define GENERIC_DBG (1 << Generic_debug)
#define HOSTAPD_DBG (1 << Hostapd_debug)
#define CFG80211_DBG (1 << CFG80211_debug)
-#define INT_DBG (1 << Interrupt_debug)
-#define LOCK_DBG (1 << Lock_debug)
-#define TCP_ENH (1 << Tcp_enhance)
-#define SPIN_DEBUG (1 << Spin_debug)
#define INIT_DBG (1 << Init_debug)
-#define BUS_DBG (1 << Bus_debug)
-#define MEM_DBG (1 << Mem_debug)
-#define FIRM_DBG (1 << Firmware_debug)

#if defined (WILC_DEBUGFS)
extern atomic_t WILC_REGION;
diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c
index 63b66b2..13330c9 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -24,9 +24,10 @@ static struct dentry *wilc_dir;
* --------------------------------------------------------------------------------
*/

-#define DBG_REGION_ALL (GENERIC_DBG | HOSTAPD_DBG | CFG80211_DBG | INT_DBG | LOCK_DBG | INIT_DBG | BUS_DBG | MEM_DBG)
+#define DBG_REGION_ALL (GENERIC_DBG | HOSTAPD_DBG | CFG80211_DBG | INIT_DBG)
#define DBG_LEVEL_ALL (DEBUG | INFO | WRN | ERR)
-atomic_t WILC_REGION = ATOMIC_INIT(INIT_DBG | GENERIC_DBG | CFG80211_DBG | FIRM_DBG | HOSTAPD_DBG);
+atomic_t WILC_REGION = ATOMIC_INIT(INIT_DBG | GENERIC_DBG | CFG80211_DBG |
+ HOSTAPD_DBG);
EXPORT_SYMBOL_GPL(WILC_REGION);
atomic_t WILC_DEBUG_LEVEL = ATOMIC_INIT(ERR);
EXPORT_SYMBOL_GPL(WILC_DEBUG_LEVEL);
--
1.9.1


2016-02-02 23:13:09

by Julian Calaby

[permalink] [raw]
Subject: Re: [PATCH 02/26] staging: wilc1000: removes function 'wilc_dealloc_assoc_resp_info()'

Hi Leo,

On Tue, Feb 2, 2016 at 11:02 PM, Leo Kim <[email protected]> wrote:
> This patch removes function wilc_dealloc_assoc_resp_info()'.
> Does not need this function which only free memory.
> Therefore, this function is removed and changed directly with kfree.
>
> Signed-off-by: Leo Kim <[email protected]>

Nice work!

Reviewed-by: Julian Calaby <[email protected]>

> ---
> drivers/staging/wilc1000/coreconfigurator.c | 22 ----------------------
> drivers/staging/wilc1000/coreconfigurator.h | 1 -
> drivers/staging/wilc1000/host_interface.c | 4 ++--
> 3 files changed, 2 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
> index 81dd22e..c86278d 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.c
> +++ b/drivers/staging/wilc1000/coreconfigurator.c
> @@ -386,25 +386,3 @@ s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,
>
> return 0;
> }
> -
> -s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *connect_resp_info)
> -{
> - s32 result = 0;
> -
> - if (connect_resp_info) {
> - if (connect_resp_info->pu8RespIEs) {
> - kfree(connect_resp_info->pu8RespIEs);
> - connect_resp_info->pu8RespIEs = NULL;
> - } else {
> - result = -EFAULT;
> - }
> -
> - kfree(connect_resp_info);
> - connect_resp_info = NULL;
> -
> - } else {
> - result = -EFAULT;
> - }
> -
> - return result;
> -}
> diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
> index 23775e4..d42f47c 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.h
> +++ b/drivers/staging/wilc1000/coreconfigurator.h
> @@ -123,7 +123,6 @@ typedef struct {
> s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info);
> s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,
> tstrConnectRespInfo **ret_connect_resp_info);
> -s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *connect_resp_info);
> void wilc_scan_complete_received(struct wilc *wilc, u8 *pu8Buffer,
> u32 u32Length);
> void wilc_network_info_received(struct wilc *wilc, u8 *pu8Buffer,
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index 3ce3a7c..15c266b 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -1505,8 +1505,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
> }
>
> if (pstrConnectRespInfo) {
> - wilc_dealloc_assoc_resp_info(pstrConnectRespInfo);
> - pstrConnectRespInfo = NULL;
> + kfree(pstrConnectRespInfo->pu8RespIEs);
> + kfree(pstrConnectRespInfo);
> }
> }
> }
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html



--
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/

2016-02-02 12:05:18

by Leo Kim

[permalink] [raw]
Subject: [PATCH 04/26] staging: wilc1000: renames struct connect_resp_info variables

This patch renames to avoid camelcase and remove prefix names,
changes follow are:
- u16capability to capability
- u16ConnectStatus to status
- u16AssocID to assoc_id
- pu8RespIEs to ies
- u16RespIEsLen to ies_len

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 14 +++++++-------
drivers/staging/wilc1000/coreconfigurator.h | 10 +++++-----
drivers/staging/wilc1000/host_interface.c | 14 +++++++-------
3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index c456a32..e9f6262 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -367,19 +367,19 @@ s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,

assoc_resp_len = (u16)buffer_len;

- connect_resp_info->u16ConnectStatus = get_asoc_status(buffer);
- if (connect_resp_info->u16ConnectStatus == SUCCESSFUL_STATUSCODE) {
- connect_resp_info->u16capability = get_assoc_resp_cap_info(buffer);
- connect_resp_info->u16AssocID = get_asoc_id(buffer);
+ connect_resp_info->status = get_asoc_status(buffer);
+ if (connect_resp_info->status == SUCCESSFUL_STATUSCODE) {
+ connect_resp_info->capability = get_assoc_resp_cap_info(buffer);
+ connect_resp_info->assoc_id = get_asoc_id(buffer);

ies = &buffer[CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN];
ies_len = assoc_resp_len - (CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN);

- connect_resp_info->pu8RespIEs = kmemdup(ies, ies_len, GFP_KERNEL);
- if (!connect_resp_info->pu8RespIEs)
+ connect_resp_info->ies = kmemdup(ies, ies_len, GFP_KERNEL);
+ if (!connect_resp_info->ies)
return -ENOMEM;

- connect_resp_info->u16RespIEsLen = ies_len;
+ connect_resp_info->ies_len = ies_len;
}

*ret_connect_resp_info = connect_resp_info;
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 611486b..aa9aee6 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -98,11 +98,11 @@ typedef struct {
} tstrNetworkInfo;

struct connect_resp_info {
- u16 u16capability;
- u16 u16ConnectStatus;
- u16 u16AssocID;
- u8 *pu8RespIEs;
- u16 u16RespIEsLen;
+ u16 capability;
+ u16 status;
+ u16 assoc_id;
+ u8 *ies;
+ u16 ies_len;
};

typedef struct {
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index a5042bb..f8dc657 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1493,19 +1493,19 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
if (s32Err) {
PRINT_ER("wilc_parse_assoc_resp_info() returned error %d\n", s32Err);
} else {
- strConnectInfo.u16ConnectStatus = pstrConnectRespInfo->u16ConnectStatus;
+ strConnectInfo.u16ConnectStatus = pstrConnectRespInfo->status;

if (strConnectInfo.u16ConnectStatus == SUCCESSFUL_STATUSCODE) {
- if (pstrConnectRespInfo->pu8RespIEs) {
- strConnectInfo.u16RespIEsLen = pstrConnectRespInfo->u16RespIEsLen;
- strConnectInfo.pu8RespIEs = kmalloc(pstrConnectRespInfo->u16RespIEsLen, GFP_KERNEL);
- memcpy(strConnectInfo.pu8RespIEs, pstrConnectRespInfo->pu8RespIEs,
- pstrConnectRespInfo->u16RespIEsLen);
+ if (pstrConnectRespInfo->ies) {
+ strConnectInfo.u16RespIEsLen = pstrConnectRespInfo->ies_len;
+ strConnectInfo.pu8RespIEs = kmalloc(pstrConnectRespInfo->ies_len, GFP_KERNEL);
+ memcpy(strConnectInfo.pu8RespIEs, pstrConnectRespInfo->ies,
+ pstrConnectRespInfo->ies_len);
}
}

if (pstrConnectRespInfo) {
- kfree(pstrConnectRespInfo->pu8RespIEs);
+ kfree(pstrConnectRespInfo->ies);
kfree(pstrConnectRespInfo);
}
}
--
1.9.1


2016-02-02 12:07:21

by Leo Kim

[permalink] [raw]
Subject: [PATCH 17/26] staging: wilc1000: renames u32Tsf of connect_resp_info structure

This patch renames u32Tsf variable to tsf_lo.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 2 +-
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/host_interface.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 6c748aa..3e1e1f5 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -315,7 +315,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer,

rx_len = wid_len - 1;
network_info->cap_info = get_cap_info(msa);
- network_info->u32Tsf = get_beacon_timestamp_lo(msa);
+ network_info->tsf_lo = get_beacon_timestamp_lo(msa);

tsf_lo = get_beacon_timestamp_lo(msa);
tsf_hi = get_beacon_timestamp_hi(msa);
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 27c35d7..07a2ef0 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -89,7 +89,7 @@ struct network_info {
unsigned long time_scan;
bool new_network;
u8 found;
- u32 u32Tsf;
+ u32 tsf_lo;
u8 *pu8IEs;
u16 u16IEsLen;
void *pJoinParams;
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index ffa175d..ac71453 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4331,7 +4331,7 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
(pu8IEs[index + 5] == 0x09) && (pu8IEs[index + 6] == 0x0c)) {
u16 u16P2P_count;

- pNewJoinBssParam->tsf = ptstrNetworkInfo->u32Tsf;
+ pNewJoinBssParam->tsf = ptstrNetworkInfo->tsf_lo;
pNewJoinBssParam->noa_enabled = 1;
pNewJoinBssParam->idx = pu8IEs[index + 9];

--
1.9.1


2016-02-02 12:07:15

by Leo Kim

[permalink] [raw]
Subject: [PATCH 16/26] staging: wilc1000: renames u8Found of connect_resp_info structure

This patch renames u8Found variable to found.

Signed-off-by: Leo Kim <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.h | 2 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index fd3b5d4..27c35d7 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -88,7 +88,7 @@ struct network_info {
unsigned long time_scan_cached;
unsigned long time_scan;
bool new_network;
- u8 u8Found;
+ u8 found;
u32 u32Tsf;
u8 *pu8IEs;
u16 u16IEsLen;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index b5c19ed..c09cc9d 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -235,7 +235,7 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan)

network_info = &last_scanned_shadow[i];

- if (!network_info->u8Found || all) {
+ if (!network_info->found || all) {
s32 freq;
struct ieee80211_channel *channel;

@@ -269,7 +269,7 @@ static void reset_shadow_found(void)
int i;

for (i = 0; i < last_scanned_cnt; i++)
- last_scanned_shadow[i].u8Found = 0;
+ last_scanned_shadow[i].found = 0;
}

static void update_scan_time(void)
@@ -387,7 +387,7 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
pstrNetworkInfo->pu8IEs, pstrNetworkInfo->u16IEsLen);
last_scanned_shadow[ap_index].time_scan = jiffies;
last_scanned_shadow[ap_index].time_scan_cached = jiffies;
- last_scanned_shadow[ap_index].u8Found = 1;
+ last_scanned_shadow[ap_index].found = 1;
if (ap_found != -1)
wilc_free_join_params(last_scanned_shadow[ap_index].pJoinParams);
last_scanned_shadow[ap_index].pJoinParams = pJoinParams;
--
1.9.1