2015-11-02 08:48:18

by Glen Lee

[permalink] [raw]
Subject: [PATCH 01/38] staging: wilc1000: rename pu8IPAddr of fuction Handle_set_IPAddress

From: Leo Kim <[email protected]>

This patch renames pu8IPAddr of fuction Handle_set_IPAddress to ip_addr
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 2a8330e..4cb491f 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -404,7 +404,7 @@ static s32 Handle_SetOperationMode(struct host_if_drv *hif_drv,
return result;
}

-s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
+s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *ip_addr, u8 idx)
{
s32 result = 0;
struct wid wid;
@@ -413,16 +413,17 @@ s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)

dev = hif_drv->priv->dev;

- if (pu8IPAddr[0] < 192)
- pu8IPAddr[0] = 0;
+ if (ip_addr[0] < 192)
+ ip_addr[0] = 0;

- PRINT_INFO(HOSTINF_DBG, "Indx = %d, Handling set IP = %pI4\n", idx, pu8IPAddr);
+ PRINT_INFO(HOSTINF_DBG, "Indx = %d, Handling set IP = %pI4\n",
+ idx, ip_addr);

- memcpy(set_ip[idx], pu8IPAddr, IP_ALEN);
+ memcpy(set_ip[idx], ip_addr, IP_ALEN);

wid.id = (u16)WID_IP_ADDRESS;
wid.type = WID_STR;
- wid.val = (u8 *)pu8IPAddr;
+ wid.val = (u8 *)ip_addr;
wid.size = IP_ALEN;

result = send_config_pkt(dev, SET_CFG, &wid, 1,
--
1.9.1



2015-11-02 08:50:05

by Glen Lee

[permalink] [raw]
Subject: [PATCH 18/38] staging: wilc1000: linux_wlan: remove unused defines

From: Leo Kim <[email protected]>

This patch removes unused defines from linux_wlan.c file.
- NM73131
- PLAT_CLM9722
Two defines are support custom feature that don't used anymore.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index e7e5229..82495ce 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1540,15 +1540,9 @@ int wilc_netdev_init(struct wilc **wilc)
nic = netdev_priv(ndev);
memset(nic, 0, sizeof(perInterface_wlan_t));

- if (i == 0) {
- #if defined(NM73131)
- strcpy(ndev->name, "wilc_eth%d");
- #elif defined(PLAT_CLM9722)
- strcpy(ndev->name, "eth%d");
- #else
+ if (i == 0)
strcpy(ndev->name, "wlan%d");
- #endif
- } else
+ else
strcpy(ndev->name, "p2p%d");

nic->u8IfIdx = wl->vif_num;
--
1.9.1


2015-11-02 08:48:53

by Glen Lee

[permalink] [raw]
Subject: [PATCH 06/38] staging: wilc1000: rename strHostIFCfgParamAttr of fuction Handle_CfgParam

From: Leo Kim <[email protected]>

This patch renames strHostIFCfgParamAttr of fuction Handle_CfgParam
to cfg_param_attr to avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 154 ++++++++++++++++--------------
1 file changed, 83 insertions(+), 71 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 69ec7eb..6abba23 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -538,7 +538,7 @@ static s32 Handle_GetMacAddress(struct host_if_drv *hif_drv,
}

static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
- struct cfg_param_attr *strHostIFCfgParamAttr)
+ struct cfg_param_attr *cfg_param_attr)
{
s32 result = 0;
struct wid strWIDList[32];
@@ -551,13 +551,13 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,

PRINT_D(HOSTINF_DBG, "Setting CFG params\n");

- if (strHostIFCfgParamAttr->cfg_attr_info.flag & BSS_TYPE) {
- if (strHostIFCfgParamAttr->cfg_attr_info.bss_type < 6) {
+ if (cfg_param_attr->cfg_attr_info.flag & BSS_TYPE) {
+ if (cfg_param_attr->cfg_attr_info.bss_type < 6) {
strWIDList[u8WidCnt].id = WID_BSS_TYPE;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.bss_type;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.bss_type;
strWIDList[u8WidCnt].type = WID_CHAR;
strWIDList[u8WidCnt].size = sizeof(char);
- hif_drv->cfg_values.bss_type = (u8)strHostIFCfgParamAttr->cfg_attr_info.bss_type;
+ hif_drv->cfg_values.bss_type = (u8)cfg_param_attr->cfg_attr_info.bss_type;
} else {
PRINT_ER("check value 6 over\n");
result = -EINVAL;
@@ -565,13 +565,15 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & AUTH_TYPE) {
- if ((strHostIFCfgParamAttr->cfg_attr_info.auth_type) == 1 || (strHostIFCfgParamAttr->cfg_attr_info.auth_type) == 2 || (strHostIFCfgParamAttr->cfg_attr_info.auth_type) == 5) {
+ if (cfg_param_attr->cfg_attr_info.flag & AUTH_TYPE) {
+ if (cfg_param_attr->cfg_attr_info.auth_type == 1 ||
+ cfg_param_attr->cfg_attr_info.auth_type == 2 ||
+ cfg_param_attr->cfg_attr_info.auth_type == 5) {
strWIDList[u8WidCnt].id = WID_AUTH_TYPE;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.auth_type;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.auth_type;
strWIDList[u8WidCnt].type = WID_CHAR;
strWIDList[u8WidCnt].size = sizeof(char);
- hif_drv->cfg_values.auth_type = (u8)strHostIFCfgParamAttr->cfg_attr_info.auth_type;
+ hif_drv->cfg_values.auth_type = (u8)cfg_param_attr->cfg_attr_info.auth_type;
} else {
PRINT_ER("Impossible value \n");
result = -EINVAL;
@@ -579,13 +581,14 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & AUTHEN_TIMEOUT) {
- if (strHostIFCfgParamAttr->cfg_attr_info.auth_timeout > 0 && strHostIFCfgParamAttr->cfg_attr_info.auth_timeout < 65536) {
+ if (cfg_param_attr->cfg_attr_info.flag & AUTHEN_TIMEOUT) {
+ if (cfg_param_attr->cfg_attr_info.auth_timeout > 0 &&
+ cfg_param_attr->cfg_attr_info.auth_timeout < 65536) {
strWIDList[u8WidCnt].id = WID_AUTH_TIMEOUT;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.auth_timeout;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.auth_timeout;
strWIDList[u8WidCnt].type = WID_SHORT;
strWIDList[u8WidCnt].size = sizeof(u16);
- hif_drv->cfg_values.auth_timeout = strHostIFCfgParamAttr->cfg_attr_info.auth_timeout;
+ hif_drv->cfg_values.auth_timeout = cfg_param_attr->cfg_attr_info.auth_timeout;
} else {
PRINT_ER("Range(1 ~ 65535) over\n");
result = -EINVAL;
@@ -593,13 +596,13 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & POWER_MANAGEMENT) {
- if (strHostIFCfgParamAttr->cfg_attr_info.power_mgmt_mode < 5) {
+ if (cfg_param_attr->cfg_attr_info.flag & POWER_MANAGEMENT) {
+ if (cfg_param_attr->cfg_attr_info.power_mgmt_mode < 5) {
strWIDList[u8WidCnt].id = WID_POWER_MANAGEMENT;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.power_mgmt_mode;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.power_mgmt_mode;
strWIDList[u8WidCnt].type = WID_CHAR;
strWIDList[u8WidCnt].size = sizeof(char);
- hif_drv->cfg_values.power_mgmt_mode = (u8)strHostIFCfgParamAttr->cfg_attr_info.power_mgmt_mode;
+ hif_drv->cfg_values.power_mgmt_mode = (u8)cfg_param_attr->cfg_attr_info.power_mgmt_mode;
} else {
PRINT_ER("Invalide power mode\n");
result = -EINVAL;
@@ -607,13 +610,14 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & RETRY_SHORT) {
- if ((strHostIFCfgParamAttr->cfg_attr_info.short_retry_limit > 0) && (strHostIFCfgParamAttr->cfg_attr_info.short_retry_limit < 256)) {
+ if (cfg_param_attr->cfg_attr_info.flag & RETRY_SHORT) {
+ if (cfg_param_attr->cfg_attr_info.short_retry_limit > 0 &&
+ cfg_param_attr->cfg_attr_info.short_retry_limit < 256) {
strWIDList[u8WidCnt].id = WID_SHORT_RETRY_LIMIT;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.short_retry_limit;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.short_retry_limit;
strWIDList[u8WidCnt].type = WID_SHORT;
strWIDList[u8WidCnt].size = sizeof(u16);
- hif_drv->cfg_values.short_retry_limit = strHostIFCfgParamAttr->cfg_attr_info.short_retry_limit;
+ hif_drv->cfg_values.short_retry_limit = cfg_param_attr->cfg_attr_info.short_retry_limit;
} else {
PRINT_ER("Range(1~256) over\n");
result = -EINVAL;
@@ -621,14 +625,15 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & RETRY_LONG) {
- if ((strHostIFCfgParamAttr->cfg_attr_info.long_retry_limit > 0) && (strHostIFCfgParamAttr->cfg_attr_info.long_retry_limit < 256)) {
+ if (cfg_param_attr->cfg_attr_info.flag & RETRY_LONG) {
+ if (cfg_param_attr->cfg_attr_info.long_retry_limit > 0 &&
+ cfg_param_attr->cfg_attr_info.long_retry_limit < 256) {
strWIDList[u8WidCnt].id = WID_LONG_RETRY_LIMIT;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.long_retry_limit;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.long_retry_limit;

strWIDList[u8WidCnt].type = WID_SHORT;
strWIDList[u8WidCnt].size = sizeof(u16);
- hif_drv->cfg_values.long_retry_limit = strHostIFCfgParamAttr->cfg_attr_info.long_retry_limit;
+ hif_drv->cfg_values.long_retry_limit = cfg_param_attr->cfg_attr_info.long_retry_limit;
} else {
PRINT_ER("Range(1~256) over\n");
result = -EINVAL;
@@ -636,13 +641,14 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & FRAG_THRESHOLD) {
- if (strHostIFCfgParamAttr->cfg_attr_info.frag_threshold > 255 && strHostIFCfgParamAttr->cfg_attr_info.frag_threshold < 7937) {
+ if (cfg_param_attr->cfg_attr_info.flag & FRAG_THRESHOLD) {
+ if (cfg_param_attr->cfg_attr_info.frag_threshold > 255 &&
+ cfg_param_attr->cfg_attr_info.frag_threshold < 7937) {
strWIDList[u8WidCnt].id = WID_FRAG_THRESHOLD;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.frag_threshold;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.frag_threshold;
strWIDList[u8WidCnt].type = WID_SHORT;
strWIDList[u8WidCnt].size = sizeof(u16);
- hif_drv->cfg_values.frag_threshold = strHostIFCfgParamAttr->cfg_attr_info.frag_threshold;
+ hif_drv->cfg_values.frag_threshold = cfg_param_attr->cfg_attr_info.frag_threshold;
} else {
PRINT_ER("Threshold Range fail\n");
result = -EINVAL;
@@ -650,13 +656,14 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & RTS_THRESHOLD) {
- if (strHostIFCfgParamAttr->cfg_attr_info.rts_threshold > 255 && strHostIFCfgParamAttr->cfg_attr_info.rts_threshold < 65536) {
+ if (cfg_param_attr->cfg_attr_info.flag & RTS_THRESHOLD) {
+ if (cfg_param_attr->cfg_attr_info.rts_threshold > 255 &&
+ cfg_param_attr->cfg_attr_info.rts_threshold < 65536) {
strWIDList[u8WidCnt].id = WID_RTS_THRESHOLD;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.rts_threshold;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.rts_threshold;
strWIDList[u8WidCnt].type = WID_SHORT;
strWIDList[u8WidCnt].size = sizeof(u16);
- hif_drv->cfg_values.rts_threshold = strHostIFCfgParamAttr->cfg_attr_info.rts_threshold;
+ hif_drv->cfg_values.rts_threshold = cfg_param_attr->cfg_attr_info.rts_threshold;
} else {
PRINT_ER("Threshold Range fail\n");
result = -EINVAL;
@@ -664,13 +671,13 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & PREAMBLE) {
- if (strHostIFCfgParamAttr->cfg_attr_info.preamble_type < 3) {
+ if (cfg_param_attr->cfg_attr_info.flag & PREAMBLE) {
+ if (cfg_param_attr->cfg_attr_info.preamble_type < 3) {
strWIDList[u8WidCnt].id = WID_PREAMBLE;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.preamble_type;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.preamble_type;
strWIDList[u8WidCnt].type = WID_CHAR;
strWIDList[u8WidCnt].size = sizeof(char);
- hif_drv->cfg_values.preamble_type = strHostIFCfgParamAttr->cfg_attr_info.preamble_type;
+ hif_drv->cfg_values.preamble_type = cfg_param_attr->cfg_attr_info.preamble_type;
} else {
PRINT_ER("Preamle Range(0~2) over\n");
result = -EINVAL;
@@ -678,13 +685,13 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & SHORT_SLOT_ALLOWED) {
- if (strHostIFCfgParamAttr->cfg_attr_info.short_slot_allowed < 2) {
+ if (cfg_param_attr->cfg_attr_info.flag & SHORT_SLOT_ALLOWED) {
+ if (cfg_param_attr->cfg_attr_info.short_slot_allowed < 2) {
strWIDList[u8WidCnt].id = WID_SHORT_SLOT_ALLOWED;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.short_slot_allowed;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.short_slot_allowed;
strWIDList[u8WidCnt].type = WID_CHAR;
strWIDList[u8WidCnt].size = sizeof(char);
- hif_drv->cfg_values.short_slot_allowed = (u8)strHostIFCfgParamAttr->cfg_attr_info.short_slot_allowed;
+ hif_drv->cfg_values.short_slot_allowed = (u8)cfg_param_attr->cfg_attr_info.short_slot_allowed;
} else {
PRINT_ER("Short slot(2) over\n");
result = -EINVAL;
@@ -692,13 +699,13 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & TXOP_PROT_DISABLE) {
- if (strHostIFCfgParamAttr->cfg_attr_info.txop_prot_disabled < 2) {
+ if (cfg_param_attr->cfg_attr_info.flag & TXOP_PROT_DISABLE) {
+ if (cfg_param_attr->cfg_attr_info.txop_prot_disabled < 2) {
strWIDList[u8WidCnt].id = WID_11N_TXOP_PROT_DISABLE;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.txop_prot_disabled;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.txop_prot_disabled;
strWIDList[u8WidCnt].type = WID_CHAR;
strWIDList[u8WidCnt].size = sizeof(char);
- hif_drv->cfg_values.txop_prot_disabled = (u8)strHostIFCfgParamAttr->cfg_attr_info.txop_prot_disabled;
+ hif_drv->cfg_values.txop_prot_disabled = (u8)cfg_param_attr->cfg_attr_info.txop_prot_disabled;
} else {
PRINT_ER("TXOP prot disable\n");
result = -EINVAL;
@@ -706,13 +713,14 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & BEACON_INTERVAL) {
- if (strHostIFCfgParamAttr->cfg_attr_info.beacon_interval > 0 && strHostIFCfgParamAttr->cfg_attr_info.beacon_interval < 65536) {
+ if (cfg_param_attr->cfg_attr_info.flag & BEACON_INTERVAL) {
+ if (cfg_param_attr->cfg_attr_info.beacon_interval > 0 &&
+ cfg_param_attr->cfg_attr_info.beacon_interval < 65536) {
strWIDList[u8WidCnt].id = WID_BEACON_INTERVAL;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.beacon_interval;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.beacon_interval;
strWIDList[u8WidCnt].type = WID_SHORT;
strWIDList[u8WidCnt].size = sizeof(u16);
- hif_drv->cfg_values.beacon_interval = strHostIFCfgParamAttr->cfg_attr_info.beacon_interval;
+ hif_drv->cfg_values.beacon_interval = cfg_param_attr->cfg_attr_info.beacon_interval;
} else {
PRINT_ER("Beacon interval(1~65535) fail\n");
result = -EINVAL;
@@ -720,13 +728,14 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & DTIM_PERIOD) {
- if (strHostIFCfgParamAttr->cfg_attr_info.dtim_period > 0 && strHostIFCfgParamAttr->cfg_attr_info.dtim_period < 256) {
+ if (cfg_param_attr->cfg_attr_info.flag & DTIM_PERIOD) {
+ if (cfg_param_attr->cfg_attr_info.dtim_period > 0 &&
+ cfg_param_attr->cfg_attr_info.dtim_period < 256) {
strWIDList[u8WidCnt].id = WID_DTIM_PERIOD;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.dtim_period;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.dtim_period;
strWIDList[u8WidCnt].type = WID_CHAR;
strWIDList[u8WidCnt].size = sizeof(char);
- hif_drv->cfg_values.dtim_period = strHostIFCfgParamAttr->cfg_attr_info.dtim_period;
+ hif_drv->cfg_values.dtim_period = cfg_param_attr->cfg_attr_info.dtim_period;
} else {
PRINT_ER("DTIM range(1~255) fail\n");
result = -EINVAL;
@@ -734,13 +743,13 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & SITE_SURVEY) {
- if (strHostIFCfgParamAttr->cfg_attr_info.site_survey_enabled < 3) {
+ if (cfg_param_attr->cfg_attr_info.flag & SITE_SURVEY) {
+ if (cfg_param_attr->cfg_attr_info.site_survey_enabled < 3) {
strWIDList[u8WidCnt].id = WID_SITE_SURVEY;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.site_survey_enabled;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.site_survey_enabled;
strWIDList[u8WidCnt].type = WID_CHAR;
strWIDList[u8WidCnt].size = sizeof(char);
- hif_drv->cfg_values.site_survey_enabled = (u8)strHostIFCfgParamAttr->cfg_attr_info.site_survey_enabled;
+ hif_drv->cfg_values.site_survey_enabled = (u8)cfg_param_attr->cfg_attr_info.site_survey_enabled;
} else {
PRINT_ER("Site survey disable\n");
result = -EINVAL;
@@ -748,13 +757,14 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & SITE_SURVEY_SCAN_TIME) {
- if (strHostIFCfgParamAttr->cfg_attr_info.site_survey_scan_time > 0 && strHostIFCfgParamAttr->cfg_attr_info.site_survey_scan_time < 65536) {
+ if (cfg_param_attr->cfg_attr_info.flag & SITE_SURVEY_SCAN_TIME) {
+ if (cfg_param_attr->cfg_attr_info.site_survey_scan_time > 0 &&
+ cfg_param_attr->cfg_attr_info.site_survey_scan_time < 65536) {
strWIDList[u8WidCnt].id = WID_SITE_SURVEY_SCAN_TIME;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.site_survey_scan_time;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.site_survey_scan_time;
strWIDList[u8WidCnt].type = WID_SHORT;
strWIDList[u8WidCnt].size = sizeof(u16);
- hif_drv->cfg_values.site_survey_scan_time = strHostIFCfgParamAttr->cfg_attr_info.site_survey_scan_time;
+ hif_drv->cfg_values.site_survey_scan_time = cfg_param_attr->cfg_attr_info.site_survey_scan_time;
} else {
PRINT_ER("Site survey scan time(1~65535) over\n");
result = -EINVAL;
@@ -762,13 +772,14 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & ACTIVE_SCANTIME) {
- if (strHostIFCfgParamAttr->cfg_attr_info.active_scan_time > 0 && strHostIFCfgParamAttr->cfg_attr_info.active_scan_time < 65536) {
+ if (cfg_param_attr->cfg_attr_info.flag & ACTIVE_SCANTIME) {
+ if (cfg_param_attr->cfg_attr_info.active_scan_time > 0 &&
+ cfg_param_attr->cfg_attr_info.active_scan_time < 65536) {
strWIDList[u8WidCnt].id = WID_ACTIVE_SCAN_TIME;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.active_scan_time;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.active_scan_time;
strWIDList[u8WidCnt].type = WID_SHORT;
strWIDList[u8WidCnt].size = sizeof(u16);
- hif_drv->cfg_values.active_scan_time = strHostIFCfgParamAttr->cfg_attr_info.active_scan_time;
+ hif_drv->cfg_values.active_scan_time = cfg_param_attr->cfg_attr_info.active_scan_time;
} else {
PRINT_ER("Active scan time(1~65535) over\n");
result = -EINVAL;
@@ -776,13 +787,14 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & PASSIVE_SCANTIME) {
- if (strHostIFCfgParamAttr->cfg_attr_info.passive_scan_time > 0 && strHostIFCfgParamAttr->cfg_attr_info.passive_scan_time < 65536) {
+ if (cfg_param_attr->cfg_attr_info.flag & PASSIVE_SCANTIME) {
+ if (cfg_param_attr->cfg_attr_info.passive_scan_time > 0 &&
+ cfg_param_attr->cfg_attr_info.passive_scan_time < 65536) {
strWIDList[u8WidCnt].id = WID_PASSIVE_SCAN_TIME;
- strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.passive_scan_time;
+ strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.passive_scan_time;
strWIDList[u8WidCnt].type = WID_SHORT;
strWIDList[u8WidCnt].size = sizeof(u16);
- hif_drv->cfg_values.passive_scan_time = strHostIFCfgParamAttr->cfg_attr_info.passive_scan_time;
+ hif_drv->cfg_values.passive_scan_time = cfg_param_attr->cfg_attr_info.passive_scan_time;
} else {
PRINT_ER("Passive scan time(1~65535) over\n");
result = -EINVAL;
@@ -790,8 +802,8 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
- if (strHostIFCfgParamAttr->cfg_attr_info.flag & CURRENT_TX_RATE) {
- enum CURRENT_TXRATE curr_tx_rate = strHostIFCfgParamAttr->cfg_attr_info.curr_tx_rate;
+ if (cfg_param_attr->cfg_attr_info.flag & CURRENT_TX_RATE) {
+ enum CURRENT_TXRATE curr_tx_rate = cfg_param_attr->cfg_attr_info.curr_tx_rate;

if (curr_tx_rate == AUTORATE || curr_tx_rate == MBPS_1
|| curr_tx_rate == MBPS_2 || curr_tx_rate == MBPS_5_5
--
1.9.1


2015-11-04 20:51:36

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 01/38] staging: wilc1000: rename pu8IPAddr of fuction Handle_set_IPAddress

On Mon, Nov 02, 2015 at 05:50:44PM +0900, Glen Lee wrote:
> From: Leo Kim <[email protected]>
>
> This patch renames pu8IPAddr of fuction Handle_set_IPAddress to ip_addr
> to avoid CamelCase naming convention.
>
> Signed-off-by: Leo Kim <[email protected]>
> Signed-off-by: Glen Lee <[email protected]>
> ---
> drivers/staging/wilc1000/host_interface.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)

This series doesn't apply probably because I didn't take your previous
series. Please resend after you refresh and resend that one.

thanks,

greg k-h

2015-11-02 08:50:34

by Glen Lee

[permalink] [raw]
Subject: [PATCH 23/38] staging: wilc1000: rename function GetIfHandler

From: Leo Kim <[email protected]>

This patch renames GetIfHandler function name to get_if_handler
to avoid CamelCase naming convention.

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

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 753405e..8321b76 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -332,7 +332,7 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)
}
}

-struct net_device *GetIfHandler(struct wilc *wilc, u8 *pMacHeader)
+struct net_device *get_if_handler(struct wilc *wilc, u8 *pMacHeader)
{
u8 *Bssid, *Bssid1;
int i = 0;
@@ -1427,7 +1427,7 @@ void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
struct net_device *wilc_netdev;
perInterface_wlan_t *nic;

- wilc_netdev = GetIfHandler(wilc, buff);
+ wilc_netdev = get_if_handler(wilc, buff);
if (!wilc_netdev)
return;

--
1.9.1


2015-11-02 08:50:17

by Glen Lee

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

From: Leo Kim <[email protected]>

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

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 40 +++++++++++++++++++++++------------
1 file changed, 27 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index ab4ab1f..f8cfdaf 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -123,7 +123,8 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event
return NOTIFY_DONE;
}

- if ((memcmp(dev_iface->ifa_label, "wlan0", 5)) && (memcmp(dev_iface->ifa_label, "p2p0", 4))) {
+ if (memcmp(dev_iface->ifa_label, "wlan0", 5) &&
+ memcmp(dev_iface->ifa_label, "p2p0", 4)) {
PRINT_D(GENERIC_DBG, "Interface is neither WLAN0 nor P2P0\n");
return NOTIFY_DONE;
}
@@ -306,7 +307,8 @@ int linux_wlan_lock_timeout(void *vp, u32 timeout)

PRINT_D(LOCK_DBG, "Locking %p\n", vp);
if (vp)
- error = down_timeout((struct semaphore *)vp, msecs_to_jiffies(timeout));
+ error = down_timeout((struct semaphore *)vp,
+ msecs_to_jiffies(timeout));
else
PRINT_ER("Failed, mutex is NULL\n");
return error;
@@ -317,7 +319,8 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)
int status;

if (flag == WILC_MAC_INDICATE_STATUS) {
- wilc_wlan_cfg_get_val(WID_STATUS, (unsigned char *)&status, 4);
+ wilc_wlan_cfg_get_val(WID_STATUS,
+ (unsigned char *)&status, 4);
if (wilc->mac_status == WILC_MAC_STATUS_INIT) {
wilc->mac_status = status;
up(&wilc->sync_event);
@@ -594,7 +597,9 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
hif_drv = (struct host_if_drv *)priv->hWILCWFIDrv;
PRINT_D(INIT_DBG, "Host = %p\n", hif_drv);

- PRINT_D(INIT_DBG, "MAC address is : %02x-%02x-%02x-%02x-%02x-%02x\n", mac_add[0], mac_add[1], mac_add[2], mac_add[3], mac_add[4], mac_add[5]);
+ PRINT_D(INIT_DBG, "MAC address is : %02x-%02x-%02x-%02x-%02x-%02x\n",
+ mac_add[0], mac_add[1], mac_add[2],
+ mac_add[3], mac_add[4], mac_add[5]);
wilc_get_chipid(0);

*(int *)c_val = 1;
@@ -1138,10 +1143,14 @@ int mac_open(struct net_device *ndev)
goto _err_;
}

- wilc_mgmt_frame_register(nic->wilc_netdev->ieee80211_ptr->wiphy, nic->wilc_netdev->ieee80211_ptr,
- nic->g_struct_frame_reg[0].frame_type, nic->g_struct_frame_reg[0].reg);
- wilc_mgmt_frame_register(nic->wilc_netdev->ieee80211_ptr->wiphy, nic->wilc_netdev->ieee80211_ptr,
- nic->g_struct_frame_reg[1].frame_type, nic->g_struct_frame_reg[1].reg);
+ wilc_mgmt_frame_register(nic->wilc_netdev->ieee80211_ptr->wiphy,
+ nic->wilc_netdev->ieee80211_ptr,
+ nic->g_struct_frame_reg[0].frame_type,
+ nic->g_struct_frame_reg[0].reg);
+ wilc_mgmt_frame_register(nic->wilc_netdev->ieee80211_ptr->wiphy,
+ nic->wilc_netdev->ieee80211_ptr,
+ nic->g_struct_frame_reg[1].frame_type,
+ nic->g_struct_frame_reg[1].reg);
netif_wake_queue(ndev);
wl->open_ifcs++;
nic->mac_opened = 1;
@@ -1173,14 +1182,16 @@ static void wilc_set_multicast_list(struct net_device *dev)
if (!dev)
return;

- PRINT_D(INIT_DBG, "Setting Multicast List with count = %d.\n", dev->mc.count);
+ PRINT_D(INIT_DBG, "Setting Multicast List with count = %d.\n",
+ dev->mc.count);

if (dev->flags & IFF_PROMISC) {
PRINT_D(INIT_DBG, "Set promiscuous mode ON, retrive all packets\n");
return;
}

- if ((dev->flags & IFF_ALLMULTI) || (dev->mc.count) > WILC_MULTICAST_TABLE_SIZE) {
+ if ((dev->flags & IFF_ALLMULTI) ||
+ (dev->mc.count) > WILC_MULTICAST_TABLE_SIZE) {
PRINT_D(INIT_DBG, "Disable multicast filter, retrive all multicast packets\n");
host_int_setup_multicast_filter(hif_drv, false, 0);
return;
@@ -1261,7 +1272,8 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
ih = (struct iphdr *)(skb->data + sizeof(struct ethhdr));

pu8UdpBuffer = (char *)ih + sizeof(struct iphdr);
- if ((pu8UdpBuffer[1] == 68 && pu8UdpBuffer[3] == 67) || (pu8UdpBuffer[1] == 67 && pu8UdpBuffer[3] == 68))
+ if ((pu8UdpBuffer[1] == 68 && pu8UdpBuffer[3] == 67) ||
+ (pu8UdpBuffer[1] == 67 && pu8UdpBuffer[3] == 68))
PRINT_D(GENERIC_DBG, "DHCP Message transmitted, type:%x %x %x\n", pu8UdpBuffer[248], pu8UdpBuffer[249], pu8UdpBuffer[250]);

PRINT_D(TX_DBG, "Sending packet - Size = %d - Address = %p - SKB = %p\n", tx_data->size, tx_data->buff, tx_data->skb);
@@ -1368,7 +1380,8 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
size = wrq->u.data.length;

if (size && wrq->u.data.pointer) {
- buff = memdup_user(wrq->u.data.pointer, wrq->u.data.length);
+ buff = memdup_user(wrq->u.data.pointer,
+ wrq->u.data.length);
if (IS_ERR(buff))
return PTR_ERR(buff);

@@ -1574,7 +1587,8 @@ int wilc_netdev_init(struct wilc **wilc)
}

if (register_netdev(ndev)) {
- PRINT_ER("Device couldn't be registered - %s\n", ndev->name);
+ PRINT_ER("Device couldn't be registered - %s\n",
+ ndev->name);
return -1;
}

--
1.9.1


2015-11-02 08:48:28

by Glen Lee

[permalink] [raw]
Subject: [PATCH 02/38] staging: wilc1000: rename firmwareIPAddress of fuction Handle_set_IPAddress

From: Leo Kim <[email protected]>

This patch renames firmwareIPAddress of fuction Handle_set_IPAddress to
firmware_ip_addr to avoid CamelCase naming convention.

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

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 4cb491f..d2628fd 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -408,7 +408,7 @@ s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *ip_addr, u8 idx)
{
s32 result = 0;
struct wid wid;
- char firmwareIPAddress[4] = {0};
+ char firmware_ip_addr[4] = {0};
struct net_device *dev;

dev = hif_drv->priv->dev;
@@ -429,7 +429,7 @@ s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *ip_addr, u8 idx)
result = send_config_pkt(dev, SET_CFG, &wid, 1,
get_id_from_handler(hif_drv));

- host_int_get_ipaddress(hif_drv, firmwareIPAddress, idx);
+ host_int_get_ipaddress(hif_drv, firmware_ip_addr, idx);

if (result) {
PRINT_ER("Failed to set IP address\n");
--
1.9.1


2015-11-02 08:52:01

by Glen Lee

[permalink] [raw]
Subject: [PATCH 38/38] staging: wilc1000: rename pu8UdpBuffer of mac_xmit function

From: Leo Kim <[email protected]>

This patch rename pu8UdpBuffer variable of mac_xmit function to udp_buf
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 5d1a547..f2be940 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1224,7 +1224,7 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
perInterface_wlan_t *nic;
struct tx_complete_data *tx_data = NULL;
int queue_count;
- char *pu8UdpBuffer;
+ char *udp_buf;
struct iphdr *ih;
struct ethhdr *eth_h;
struct wilc *wilc;
@@ -1257,10 +1257,11 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)

ih = (struct iphdr *)(skb->data + sizeof(struct ethhdr));

- pu8UdpBuffer = (char *)ih + sizeof(struct iphdr);
- if ((pu8UdpBuffer[1] == 68 && pu8UdpBuffer[3] == 67) ||
- (pu8UdpBuffer[1] == 67 && pu8UdpBuffer[3] == 68))
- PRINT_D(GENERIC_DBG, "DHCP Message transmitted, type:%x %x %x\n", pu8UdpBuffer[248], pu8UdpBuffer[249], pu8UdpBuffer[250]);
+ udp_buf = (char *)ih + sizeof(struct iphdr);
+ if ((udp_buf[1] == 68 && udp_buf[3] == 67) ||
+ (udp_buf[1] == 67 && udp_buf[3] == 68))
+ PRINT_D(GENERIC_DBG, "DHCP Message transmitted, type:%x %x %x\n",
+ udp_buf[248], udp_buf[249], udp_buf[250]);

PRINT_D(TX_DBG, "Sending packet - Size = %d - Address = %p - SKB = %p\n", tx_data->size, tx_data->buff, tx_data->skb);
PRINT_D(TX_DBG, "Adding tx packet to TX Queue\n");
--
1.9.1


2015-11-02 08:49:40

by Glen Lee

[permalink] [raw]
Subject: [PATCH 14/38] staging: wilc1000: rename pstrWFIDrv of function mac_close

From: Leo Kim <[email protected]>

This patch renames pstrWFIDrv of function mac_close to hif_drv
to avoid CamelCase naming convention.
And, some debug print modification that has been included name 'pstrWFIDrv'.

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

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 4dffae5..9811949 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1434,7 +1434,7 @@ int mac_close(struct net_device *ndev)
{
struct wilc_priv *priv;
perInterface_wlan_t *nic;
- struct host_if_drv *pstrWFIDrv;
+ struct host_if_drv *hif_drv;
struct wilc *wl;

nic = netdev_priv(ndev);
@@ -1453,7 +1453,7 @@ int mac_close(struct net_device *ndev)
return 0;
}

- pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv;
+ hif_drv = (struct host_if_drv *)priv->hWILCWFIDrv;

PRINT_D(GENERIC_DBG, "Mac close\n");

@@ -1462,8 +1462,8 @@ int mac_close(struct net_device *ndev)
return 0;
}

- if (!pstrWFIDrv) {
- PRINT_ER("pstrWFIDrv = NULL\n");
+ if (!hif_drv) {
+ PRINT_ER("hif_drv = NULL\n");
return 0;
}

--
1.9.1


2015-11-02 08:49:46

by Glen Lee

[permalink] [raw]
Subject: [PATCH 15/38] staging: wilc1000: rename pIP_Add_buff of function dev_state_ev_handler

From: Leo Kim <[email protected]>

This patch renames pIP_Add_buff of function dev_state_ev_handler to ip_addr_buf
to avoid CamelCase naming convention.

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

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 9811949..335aa2b 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -124,7 +124,7 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event
struct wilc_priv *priv;
struct host_if_drv *hif_drv;
struct net_device *dev;
- u8 *pIP_Add_buff;
+ u8 *ip_addr_buf;
perInterface_wlan_t *nic;
u8 null_ip[4] = {0};
char wlan_dev_name[5] = "wlan0";
@@ -177,9 +177,11 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event

PRINT_D(GENERIC_DBG, "[%s] Up IP\n", dev_iface->ifa_label);

- pIP_Add_buff = (char *) (&(dev_iface->ifa_address));
- PRINT_D(GENERIC_DBG, "IP add=%d:%d:%d:%d\n", pIP_Add_buff[0], pIP_Add_buff[1], pIP_Add_buff[2], pIP_Add_buff[3]);
- host_int_setup_ipaddress(hif_drv, pIP_Add_buff, nic->u8IfIdx);
+ ip_addr_buf = (char *)&dev_iface->ifa_address;
+ PRINT_D(GENERIC_DBG, "IP add=%d:%d:%d:%d\n",
+ ip_addr_buf[0], ip_addr_buf[1],
+ ip_addr_buf[2], ip_addr_buf[3]);
+ host_int_setup_ipaddress(hif_drv, ip_addr_buf, nic->u8IfIdx);

break;

@@ -199,10 +201,12 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event

PRINT_D(GENERIC_DBG, "[%s] Down IP\n", dev_iface->ifa_label);

- pIP_Add_buff = null_ip;
- PRINT_D(GENERIC_DBG, "IP add=%d:%d:%d:%d\n", pIP_Add_buff[0], pIP_Add_buff[1], pIP_Add_buff[2], pIP_Add_buff[3]);
+ ip_addr_buf = null_ip;
+ PRINT_D(GENERIC_DBG, "IP add=%d:%d:%d:%d\n",
+ ip_addr_buf[0], ip_addr_buf[1],
+ ip_addr_buf[2], ip_addr_buf[3]);

- host_int_setup_ipaddress(hif_drv, pIP_Add_buff, nic->u8IfIdx);
+ host_int_setup_ipaddress(hif_drv, ip_addr_buf, nic->u8IfIdx);

break;

--
1.9.1


2015-11-02 08:49:05

by Glen Lee

[permalink] [raw]
Subject: [PATCH 08/38] staging: wilc1000: rename gau8MulticastMacAddrList variable

From: Leo Kim <[email protected]>

This patch renames gau8MulticastMacAddrList variable to multicast_mac_addr_list
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 5 +++--
drivers/staging/wilc1000/linux_wlan.c | 11 ++++++++---
2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 584f718..de84c5d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -243,7 +243,7 @@ static struct semaphore hif_sema_wait_response;
static struct semaphore hif_sema_deinit;
static struct timer_list periodic_rssi;

-u8 gau8MulticastMacAddrList[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN];
+u8 multicast_mac_addr_list[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN];

static u8 rcv_assoc_resp[MAX_ASSOC_RESP_FRAME_SIZE];

@@ -2804,7 +2804,8 @@ static void Handle_SetMulticastFilter(struct host_if_drv *hif_drv,
*pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 24) & 0xFF);

if ((strHostIfSetMulti->cnt) > 0)
- memcpy(pu8CurrByte, gau8MulticastMacAddrList, ((strHostIfSetMulti->cnt) * ETH_ALEN));
+ memcpy(pu8CurrByte, multicast_mac_addr_list,
+ ((strHostIfSetMulti->cnt) * ETH_ALEN));

result = send_config_pkt(dev, SET_CFG, &wid, 1,
get_id_from_handler(hif_drv));
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 3422d99..315906b 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -47,7 +47,7 @@

extern bool g_obtainingIP;
extern void resolve_disconnect_aberration(void *drvHandler);
-extern u8 gau8MulticastMacAddrList[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN];
+extern u8 multicast_mac_addr_list[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN];
extern struct timer_list hDuringIpTimer;

static int linux_wlan_device_power(int on_off)
@@ -1347,9 +1347,14 @@ static void wilc_set_multicast_list(struct net_device *dev)
/* Store all of the multicast addresses in the hardware filter */
netdev_for_each_mc_addr(ha, dev)
{
- memcpy(gau8MulticastMacAddrList[i], ha->addr, ETH_ALEN);
+ memcpy(multicast_mac_addr_list[i], ha->addr, ETH_ALEN);
PRINT_D(INIT_DBG, "Entry[%d]: %x:%x:%x:%x:%x:%x\n", i,
- gau8MulticastMacAddrList[i][0], gau8MulticastMacAddrList[i][1], gau8MulticastMacAddrList[i][2], gau8MulticastMacAddrList[i][3], gau8MulticastMacAddrList[i][4], gau8MulticastMacAddrList[i][5]);
+ multicast_mac_addr_list[i][0],
+ multicast_mac_addr_list[i][1],
+ multicast_mac_addr_list[i][2],
+ multicast_mac_addr_list[i][3],
+ multicast_mac_addr_list[i][4],
+ multicast_mac_addr_list[i][5]);
i++;
}

--
1.9.1


2015-11-02 08:49:22

by Glen Lee

[permalink] [raw]
Subject: [PATCH 11/38] staging: wilc1000: rename pstrWFIDrv of function dev_state_ev_handler

From: Leo Kim <[email protected]>

This patch renames pstrWFIDrv of function dev_state_ev_handler to hif_drv
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 05f33ec..b4e84e3 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -122,7 +122,7 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event
{
struct in_ifaddr *dev_iface = (struct in_ifaddr *)ptr;
struct wilc_priv *priv;
- struct host_if_drv *pstrWFIDrv;
+ struct host_if_drv *hif_drv;
struct net_device *dev;
u8 *pIP_Add_buff;
perInterface_wlan_t *nic;
@@ -149,9 +149,9 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event
PRINT_D(GENERIC_DBG, "No Wireless Priv\n");
return NOTIFY_DONE;
}
- pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv;
+ hif_drv = (struct host_if_drv *)priv->hWILCWFIDrv;
nic = netdev_priv(dev);
- if (!nic || !pstrWFIDrv) {
+ if (!nic || !hif_drv) {
PRINT_D(GENERIC_DBG, "No Wireless Priv\n");
return NOTIFY_DONE;
}
@@ -166,20 +166,20 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event

/*If we are in station mode or client mode*/
if (nic->iftype == STATION_MODE || nic->iftype == CLIENT_MODE) {
- pstrWFIDrv->IFC_UP = 1;
+ hif_drv->IFC_UP = 1;
g_obtainingIP = false;
del_timer(&hDuringIpTimer);
PRINT_D(GENERIC_DBG, "IP obtained , enable scan\n");
}

if (bEnablePS)
- host_int_set_power_mgmt(pstrWFIDrv, 1, 0);
+ host_int_set_power_mgmt(hif_drv, 1, 0);

PRINT_D(GENERIC_DBG, "[%s] Up IP\n", dev_iface->ifa_label);

pIP_Add_buff = (char *) (&(dev_iface->ifa_address));
PRINT_D(GENERIC_DBG, "IP add=%d:%d:%d:%d\n", pIP_Add_buff[0], pIP_Add_buff[1], pIP_Add_buff[2], pIP_Add_buff[3]);
- host_int_setup_ipaddress(pstrWFIDrv, pIP_Add_buff, nic->u8IfIdx);
+ host_int_setup_ipaddress(hif_drv, pIP_Add_buff, nic->u8IfIdx);

break;

@@ -188,21 +188,21 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event

PRINT_INFO(GENERIC_DBG, "\n ============== IP Address Released ===============\n\n");
if (nic->iftype == STATION_MODE || nic->iftype == CLIENT_MODE) {
- pstrWFIDrv->IFC_UP = 0;
+ hif_drv->IFC_UP = 0;
g_obtainingIP = false;
}

if (memcmp(dev_iface->ifa_label, wlan_dev_name, 5) == 0)
- host_int_set_power_mgmt(pstrWFIDrv, 0, 0);
+ host_int_set_power_mgmt(hif_drv, 0, 0);

- resolve_disconnect_aberration(pstrWFIDrv);
+ resolve_disconnect_aberration(hif_drv);

PRINT_D(GENERIC_DBG, "[%s] Down IP\n", dev_iface->ifa_label);

pIP_Add_buff = null_ip;
PRINT_D(GENERIC_DBG, "IP add=%d:%d:%d:%d\n", pIP_Add_buff[0], pIP_Add_buff[1], pIP_Add_buff[2], pIP_Add_buff[3]);

- host_int_setup_ipaddress(pstrWFIDrv, pIP_Add_buff, nic->u8IfIdx);
+ host_int_setup_ipaddress(hif_drv, pIP_Add_buff, nic->u8IfIdx);

break;

--
1.9.1


2015-11-02 08:51:55

by Glen Lee

[permalink] [raw]
Subject: [PATCH 37/38] staging: wilc1000: rename QueueCount of mac_xmit function

From: Leo Kim <[email protected]>

This patch rename QueueCount variable of mac_xmit function to queue_count
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 0eba943..5d1a547 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1223,7 +1223,7 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
{
perInterface_wlan_t *nic;
struct tx_complete_data *tx_data = NULL;
- int QueueCount;
+ int queue_count;
char *pu8UdpBuffer;
struct iphdr *ih;
struct ethhdr *eth_h;
@@ -1267,11 +1267,11 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
nic->netstats.tx_packets++;
nic->netstats.tx_bytes += tx_data->size;
tx_data->pBssid = wilc->vif[nic->u8IfIdx].bssid;
- QueueCount = wilc_wlan_txq_add_net_pkt(ndev, (void *)tx_data,
- tx_data->buff, tx_data->size,
- linux_wlan_tx_complete);
+ queue_count = wilc_wlan_txq_add_net_pkt(ndev, (void *)tx_data,
+ tx_data->buff, tx_data->size,
+ linux_wlan_tx_complete);

- if (QueueCount > FLOW_CONTROL_UPPER_THRESHOLD) {
+ if (queue_count > FLOW_CONTROL_UPPER_THRESHOLD) {
netif_stop_queue(wilc->vif[0].ndev);
netif_stop_queue(wilc->vif[1].ndev);
}
--
1.9.1


2015-11-02 08:51:14

by Glen Lee

[permalink] [raw]
Subject: [PATCH 30/38] staging: wilc1000: remove goto from linux_wlan_firmware_download

From: Leo Kim <[email protected]>

This patch remove goto feature from linux_wlan_firmware_download function.
Goto feature is return result.
So, remove goto functions and it was replaced with the return value directly.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index f091a3c..aaa938f 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -558,14 +558,13 @@ static int linux_wlan_firmware_download(struct net_device *dev)

if (!wilc->firmware) {
PRINT_ER("Firmware buffer is NULL\n");
- ret = -ENOBUFS;
- goto _FAIL_;
+ return -ENOBUFS;
}
PRINT_D(INIT_DBG, "Downloading Firmware ...\n");
ret = wilc_wlan_firmware_download(dev, wilc->firmware->data,
wilc->firmware->size);
if (ret < 0)
- goto _FAIL_;
+ return ret;

PRINT_D(INIT_DBG, "Freeing FW buffer ...\n");
PRINT_D(INIT_DBG, "Releasing firmware\n");
@@ -573,7 +572,6 @@ static int linux_wlan_firmware_download(struct net_device *dev)

PRINT_D(INIT_DBG, "Download Succeeded\n");

-_FAIL_:
return ret;
}

--
1.9.1


2015-11-02 08:51:50

by Glen Lee

[permalink] [raw]
Subject: [PATCH 36/38] staging: wilc1000: rename s32Error of mac_ioctl function

From: Leo Kim <[email protected]>

This patch rename s32Error variable of mac_ioctl function to ret
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 8370a90..0eba943 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1349,7 +1349,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
u32 size = 0, length = 0;
perInterface_wlan_t *nic;
struct wilc_priv *priv;
- s32 s32Error = 0;
+ s32 ret = 0;
struct wilc *wilc;

nic = netdev_priv(ndev);
@@ -1373,8 +1373,9 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)

if (strncasecmp(buff, "RSSI", length) == 0) {
priv = wiphy_priv(nic->wilc_netdev->ieee80211_ptr->wiphy);
- s32Error = host_int_get_rssi(priv->hWILCWFIDrv, &(rssi));
- if (s32Error)
+ ret = host_int_get_rssi(priv->hWILCWFIDrv,
+ &rssi);
+ if (ret)
PRINT_ER("Failed to send get rssi param's message queue ");
PRINT_INFO(GENERIC_DBG, "RSSI :%d\n", rssi);

@@ -1384,7 +1385,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)

if (copy_to_user(wrq->u.data.pointer, buff, size)) {
PRINT_ER("%s: failed to copy data to user buffer\n", __func__);
- s32Error = -EFAULT;
+ ret = -EFAULT;
goto done;
}
}
@@ -1395,7 +1396,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
default:
{
PRINT_INFO(GENERIC_DBG, "Command - %d - has been received\n", cmd);
- s32Error = -EOPNOTSUPP;
+ ret = -EOPNOTSUPP;
goto done;
}
}
@@ -1404,7 +1405,7 @@ done:

kfree(buff);

- return s32Error;
+ return ret;
}

void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
--
1.9.1


2015-11-02 08:50:45

by Glen Lee

[permalink] [raw]
Subject: [PATCH 25/38] staging: wilc1000: rename Bssid of function get_if_handler

From: Leo Kim <[email protected]>

This patch renames Bssid of function get_if_handler to bssid
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 166f240..2cc7cd9 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -334,25 +334,25 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)

struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header)
{
- u8 *Bssid, *Bssid1;
+ u8 *bssid, *Bssid1;
int i = 0;

- Bssid = mac_header + 10;
+ bssid = mac_header + 10;
Bssid1 = mac_header + 4;

for (i = 0; i < wilc->vif_num; i++)
if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
- !memcmp(Bssid, wilc->vif[i].bssid, ETH_ALEN))
+ !memcmp(bssid, wilc->vif[i].bssid, ETH_ALEN))
return wilc->vif[i].ndev;

PRINT_INFO(INIT_DBG, "Invalide handle\n");
for (i = 0; i < 25; i++)
PRINT_D(INIT_DBG, "%02x ", mac_header[i]);
- Bssid = mac_header + 18;
+ bssid = mac_header + 18;
Bssid1 = mac_header + 12;
for (i = 0; i < wilc->vif_num; i++)
if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
- !memcmp(Bssid, wilc->vif[i].bssid, ETH_ALEN))
+ !memcmp(bssid, wilc->vif[i].bssid, ETH_ALEN))
return wilc->vif[i].ndev;

PRINT_INFO(INIT_DBG, "\n");
--
1.9.1


2015-11-02 08:51:02

by Glen Lee

[permalink] [raw]
Subject: [PATCH 28/38] staging: wilc1000: fixes braces {} should be used on all arms of this statement

From: Leo Kim <[email protected]>

This patch fixes the checks reported by checkpatch.pl
for braces {} should be used on all arms of this statement.

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

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index c397952..1e9d67f 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -482,12 +482,11 @@ int linux_wlan_get_firmware(struct net_device *dev)
nic = netdev_priv(dev);
wilc = nic->wilc;

- if (nic->iftype == AP_MODE)
+ if (nic->iftype == AP_MODE) {
firmware = AP_FIRMWARE;
- else if (nic->iftype == STATION_MODE)
+ } else if (nic->iftype == STATION_MODE) {
firmware = STA_FIRMWARE;
-
- else {
+ } else {
PRINT_D(INIT_DBG, "Get P2P_CONCURRENCY_FIRMWARE\n");
firmware = P2P_CONCURRENCY_FIRMWARE;
}
--
1.9.1


2015-11-02 08:49:34

by Glen Lee

[permalink] [raw]
Subject: [PATCH 13/38] staging: wilc1000: rename pstrWFIDrv of function wilc_set_multicast_list

From: Leo Kim <[email protected]>

This patch renames pstrWFIDrv of function wilc_set_multicast_list to hif_drv
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 312e91a..4dffae5 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1294,11 +1294,11 @@ static void wilc_set_multicast_list(struct net_device *dev)

struct netdev_hw_addr *ha;
struct wilc_priv *priv;
- struct host_if_drv *pstrWFIDrv;
+ struct host_if_drv *hif_drv;
int i = 0;

priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
- pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv;
+ hif_drv = (struct host_if_drv *)priv->hWILCWFIDrv;

if (!dev)
return;
@@ -1318,14 +1318,14 @@ static void wilc_set_multicast_list(struct net_device *dev)
if ((dev->flags & IFF_ALLMULTI) || (dev->mc.count) > WILC_MULTICAST_TABLE_SIZE) {
PRINT_D(INIT_DBG, "Disable multicast filter, retrive all multicast packets\n");
/* get all multicast packets */
- host_int_setup_multicast_filter(pstrWFIDrv, false, 0);
+ host_int_setup_multicast_filter(hif_drv, false, 0);
return;
}

/* No multicast? Just get our own stuff */
if ((dev->mc.count) == 0) {
PRINT_D(INIT_DBG, "Enable multicast filter, retrive directed packets only.\n");
- host_int_setup_multicast_filter(pstrWFIDrv, true, 0);
+ host_int_setup_multicast_filter(hif_drv, true, 0);
return;
}

@@ -1343,7 +1343,7 @@ static void wilc_set_multicast_list(struct net_device *dev)
i++;
}

- host_int_setup_multicast_filter(pstrWFIDrv, true, (dev->mc.count));
+ host_int_setup_multicast_filter(hif_drv, true, (dev->mc.count));

return;

--
1.9.1


2015-11-02 08:50:57

by Glen Lee

[permalink] [raw]
Subject: [PATCH 27/38] staging: wilc1000: rename pBSSID of function linux_wlan_set_bssid

From: Leo Kim <[email protected]>

This patch renames pBSSID of function linux_wlan_set_bssid to bssid
to avoid CamelCase naming convention.
Also, prototype linux_wlan_set_bssid in wilc_wfi_cfgoperations.c is moved to
wilc_wfi_netdevice.h.

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

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index a3bb7e0..c397952 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -359,7 +359,7 @@ struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header)
return NULL;
}

-int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID)
+int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid)
{
int i = 0;
int ret = -1;
@@ -371,7 +371,7 @@ int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID)

for (i = 0; i < wilc->vif_num; i++)
if (wilc->vif[i].ndev == wilc_netdev) {
- memcpy(wilc->vif[i].bssid, pBSSID, 6);
+ memcpy(wilc->vif[i].bssid, bssid, 6);
ret = 0;
break;
}
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 8554f6f..46d6052 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -505,8 +505,6 @@ int WILC_WFI_Set_PMKSA(u8 *bssid, struct wilc_priv *priv)


}
-int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID);
-

/**
* @brief CfgConnectResult
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 54d798c..19e8643 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -219,4 +219,5 @@ void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size);
u16 Set_machw_change_vir_if(struct net_device *dev, bool bValue);
int linux_wlan_get_firmware(struct net_device *dev);
int linux_wlan_get_num_conn_ifcs(struct net_device *dev);
+int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid);
#endif
--
1.9.1


2015-11-02 08:48:35

by Glen Lee

[permalink] [raw]
Subject: [PATCH 03/38] staging: wilc1000: remove unused parameter of fuction Handle_get_IPAddress

From: Leo Kim <[email protected]>

This patch removes parameter pu8IPAddr of fuction Handle_get_IPAddress because
it is not used in the function. Remove argument in the function call also.

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

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index d2628fd..23c15c3 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -441,7 +441,7 @@ s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *ip_addr, u8 idx)
return result;
}

-s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
+s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 idx)
{
s32 result = 0;
struct wid wid;
@@ -3072,7 +3072,7 @@ static int hostIFthread(void *pvArg)

case HOST_IF_MSG_GET_IPADDRESS:
PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_SET_IPADDRESS\n");
- Handle_get_IPAddress(msg.drv, msg.body.ip_info.ip_addr, msg.body.ip_info.idx);
+ Handle_get_IPAddress(msg.drv, msg.body.ip_info.idx);
break;

case HOST_IF_MSG_SET_MAC_ADDRESS:
--
1.9.1


2015-11-02 08:50:39

by Glen Lee

[permalink] [raw]
Subject: [PATCH 24/38] staging: wilc1000: rename pMacHeader of function get_if_handler

From: Leo Kim <[email protected]>

This patch renames pMacHeader of function get_if_handler to mac_header
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 8321b76..166f240 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -332,13 +332,13 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)
}
}

-struct net_device *get_if_handler(struct wilc *wilc, u8 *pMacHeader)
+struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header)
{
u8 *Bssid, *Bssid1;
int i = 0;

- Bssid = pMacHeader + 10;
- Bssid1 = pMacHeader + 4;
+ Bssid = mac_header + 10;
+ Bssid1 = mac_header + 4;

for (i = 0; i < wilc->vif_num; i++)
if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
@@ -347,9 +347,9 @@ struct net_device *get_if_handler(struct wilc *wilc, u8 *pMacHeader)

PRINT_INFO(INIT_DBG, "Invalide handle\n");
for (i = 0; i < 25; i++)
- PRINT_D(INIT_DBG, "%02x ", pMacHeader[i]);
- Bssid = pMacHeader + 18;
- Bssid1 = pMacHeader + 12;
+ PRINT_D(INIT_DBG, "%02x ", mac_header[i]);
+ Bssid = mac_header + 18;
+ Bssid1 = mac_header + 12;
for (i = 0; i < wilc->vif_num; i++)
if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
!memcmp(Bssid, wilc->vif[i].bssid, ETH_ALEN))
--
1.9.1


2015-11-02 08:48:40

by Glen Lee

[permalink] [raw]
Subject: [PATCH 04/38] staging: wilc1000: rename pstrHostIfSetMacAddress of fuction Handle_SetMacAddress

From: Leo Kim <[email protected]>

This patch renames pstrHostIfSetMacAddress of fuction Handle_SetMacAddress
to set_mac_addr to avoid CamelCase naming convention.

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

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 23c15c3..7a58ce7 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -479,7 +479,7 @@ s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 idx)
}

static s32 Handle_SetMacAddress(struct host_if_drv *hif_drv,
- struct set_mac_addr *pstrHostIfSetMacAddress)
+ struct set_mac_addr *set_mac_addr)
{
s32 result = 0;
struct wid wid;
@@ -492,7 +492,7 @@ static s32 Handle_SetMacAddress(struct host_if_drv *hif_drv,
PRINT_ER("No buffer to send mac address\n");
return -EFAULT;
}
- memcpy(mac_buf, pstrHostIfSetMacAddress->mac_addr, ETH_ALEN);
+ memcpy(mac_buf, set_mac_addr->mac_addr, ETH_ALEN);

wid.id = (u16)WID_MAC_ADDR;
wid.type = WID_STR;
--
1.9.1


2015-11-02 08:51:31

by Glen Lee

[permalink] [raw]
Subject: [PATCH 33/38] staging: wilc1000: remove goto from mac_open

From: Leo Kim <[email protected]>

This patch removes goto from mac_open function. If address is invalid, goto
handles deinit process and return result.
So, just call deinit process and return the error value directly instead of
goto statement.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 0750412e..1a4ef89 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1129,8 +1129,9 @@ int mac_open(struct net_device *ndev)

if (!is_valid_ether_addr(ndev->dev_addr)) {
PRINT_ER("Error: Wrong MAC address\n");
- ret = -EINVAL;
- goto _err_;
+ wilc_deinit_host_int(ndev);
+ wilc1000_wlan_deinit(ndev);
+ return -EINVAL;
}

wilc_mgmt_frame_register(nic->wilc_netdev->ieee80211_ptr->wiphy,
@@ -1145,11 +1146,6 @@ int mac_open(struct net_device *ndev)
wl->open_ifcs++;
nic->mac_opened = 1;
return 0;
-
-_err_:
- wilc_deinit_host_int(ndev);
- wilc1000_wlan_deinit(ndev);
- return ret;
}

struct net_device_stats *mac_stats(struct net_device *dev)
--
1.9.1


2015-11-02 08:50:51

by Glen Lee

[permalink] [raw]
Subject: [PATCH 26/38] staging: wilc1000: rename Bssid1 of function get_if_handler

From: Leo Kim <[email protected]>

This patch renames Bssid1 of function get_if_handler to bssid1
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 2cc7cd9..a3bb7e0 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -334,14 +334,14 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)

struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header)
{
- u8 *bssid, *Bssid1;
+ u8 *bssid, *bssid1;
int i = 0;

bssid = mac_header + 10;
- Bssid1 = mac_header + 4;
+ bssid1 = mac_header + 4;

for (i = 0; i < wilc->vif_num; i++)
- if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
+ if (!memcmp(bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
!memcmp(bssid, wilc->vif[i].bssid, ETH_ALEN))
return wilc->vif[i].ndev;

@@ -349,9 +349,9 @@ struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header)
for (i = 0; i < 25; i++)
PRINT_D(INIT_DBG, "%02x ", mac_header[i]);
bssid = mac_header + 18;
- Bssid1 = mac_header + 12;
+ bssid1 = mac_header + 12;
for (i = 0; i < wilc->vif_num; i++)
- if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
+ if (!memcmp(bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
!memcmp(bssid, wilc->vif[i].bssid, ETH_ALEN))
return wilc->vif[i].ndev;

--
1.9.1


2015-11-02 13:36:19

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 29/38] staging: wilc1000: remove goto from linux_wlan_start_firmware

On Mon, Nov 02, 2015 at 05:51:12PM +0900, Glen Lee wrote:
> PRINT_D(INIT_DBG, "Waiting for Firmware to get ready ...\n");
> ret = linux_wlan_lock_timeout(&wilc->sync_event, 5000);
> if (ret) {
> PRINT_D(INIT_DBG, "Firmware start timed out");
> - goto _fail_;
> + return ret;
> }
> PRINT_D(INIT_DBG, "Firmware successfully started\n");
>
> -_fail_:
> return ret;

In a later patch, could you change this from "return ret;" to
"return 0;"

regards,
dan carpenter


2015-11-02 08:50:22

by Glen Lee

[permalink] [raw]
Subject: [PATCH 21/38] staging: wilc1000: fixes add spaces required around that '&&'

From: Leo Kim <[email protected]>

This patch fixes add to spaces around that '&&' or '||'.
Reported by checkpatch.pl for spaces required around that '&&' or '||' (ctx:VxE).

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index f8cfdaf..72345b3 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1098,7 +1098,7 @@ int mac_open(struct net_device *ndev)
wl = nic->wilc;

#ifdef WILC_SPI
- if (!wl|| !wl->wilc_spidev) {
+ if (!wl || !wl->wilc_spidev) {
netdev_err(ndev, "wilc1000: SPI device not ready\n");
return -ENODEV;
}
@@ -1500,8 +1500,7 @@ void wl_wlan_cleanup(struct wilc *wilc)
if (wilc && wilc->firmware)
release_firmware(wilc->firmware);

- if (wilc&&
- (wilc->vif[0].ndev || wilc->vif[1].ndev)) {
+ if (wilc && (wilc->vif[0].ndev || wilc->vif[1].ndev)) {
linux_wlan_lock_timeout(&close_exit_sync, 12 * 1000);

for (i = 0; i < NUM_CONCURRENT_IFC; i++)
--
1.9.1


2015-11-02 08:51:26

by Glen Lee

[permalink] [raw]
Subject: [PATCH 32/38] staging: wilc1000: remove goto from wlan_initialize_threads

From: Leo Kim <[email protected]>

This patch remove goto feature from wlan_initialize_threads function.
Goto feature is 'wilc->close=0' & return result.
So, remove goto feature and it was replaced with the return value directly,
as well as removed unused ret variable.
Also, execute 'wilc->close=0' before return.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 98c3cd0..0750412e 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -916,7 +916,6 @@ int wlan_initialize_threads(struct net_device *dev)
{
perInterface_wlan_t *nic;
struct wilc *wilc;
- int ret = 0;

nic = netdev_priv(dev);
wilc = nic->wilc;
@@ -927,16 +926,12 @@ int wlan_initialize_threads(struct net_device *dev)
"K_TXQ_TASK");
if (!wilc->txq_thread) {
PRINT_ER("couldn't create TXQ thread\n");
- ret = -ENOBUFS;
- goto _fail_2;
+ wilc->close = 0;
+ return -ENOBUFS;
}
down(&wilc->txq_thread_started);

return 0;
-
-_fail_2:
- wilc->close = 0;
- return ret;
}

static void wlan_deinitialize_threads(struct net_device *dev)
--
1.9.1


2015-11-02 08:50:28

by Glen Lee

[permalink] [raw]
Subject: [PATCH 22/38] staging: wilc1000: remove do-nothing if condition case.

From: Leo Kim <[email protected]>

This patch removes do-nothing if condition case.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 72345b3..753405e 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -327,9 +327,6 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)
} else {
wilc->mac_status = status;
}
-
- if (wilc->mac_status == WILC_MAC_STATUS_CONNECT) {
- }
} else if (flag == WILC_MAC_INDICATE_SCAN) {
PRINT_D(GENERIC_DBG, "Scanning ...\n");
}
--
1.9.1


2015-11-02 08:49:10

by Glen Lee

[permalink] [raw]
Subject: [PATCH 09/38] staging: wilc1000: replace explicit NULL comparisons with !

From: Leo Kim <[email protected]>

This patch replace explicit NULL comparison with ! or unmark
operator to simplify code.
Reported by checkpatch.pl for comparison to NULL could be written "!XXX" or "XXX".

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 45 ++++++++++++++++++-----------------
1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 315906b..a483f79 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -136,7 +136,7 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event
u8 null_ip[4] = {0};
char wlan_dev_name[5] = "wlan0";

- if (dev_iface == NULL || dev_iface->ifa_dev == NULL || dev_iface->ifa_dev->dev == NULL) {
+ if (!dev_iface || !dev_iface->ifa_dev || !dev_iface->ifa_dev->dev) {
PRINT_D(GENERIC_DBG, "dev_iface = NULL\n");
return NOTIFY_DONE;
}
@@ -147,18 +147,18 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event
}

dev = (struct net_device *)dev_iface->ifa_dev->dev;
- if (dev->ieee80211_ptr == NULL || dev->ieee80211_ptr->wiphy == NULL) {
+ if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy) {
PRINT_D(GENERIC_DBG, "No Wireless registerd\n");
return NOTIFY_DONE;
}
priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
- if (priv == NULL) {
+ if (!priv) {
PRINT_D(GENERIC_DBG, "No Wireless Priv\n");
return NOTIFY_DONE;
}
pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv;
nic = netdev_priv(dev);
- if (nic == NULL || pstrWFIDrv == NULL) {
+ if (!nic || !pstrWFIDrv) {
PRINT_D(GENERIC_DBG, "No Wireless Priv\n");
return NOTIFY_DONE;
}
@@ -339,7 +339,7 @@ int linux_wlan_lock_timeout(void *vp, u32 timeout)
int error = -1;

PRINT_D(LOCK_DBG, "Locking %p\n", vp);
- if (vp != NULL)
+ if (vp)
error = down_timeout((struct semaphore *)vp, msecs_to_jiffies(timeout));
else
PRINT_ER("Failed, mutex is NULL\n");
@@ -542,12 +542,12 @@ int linux_wlan_get_firmware(struct net_device *dev)
firmware = P2P_CONCURRENCY_FIRMWARE;
}

- if (nic == NULL) {
+ if (!nic) {
PRINT_ER("NIC is NULL\n");
goto _fail_;
}

- if (&nic->wilc_netdev->dev == NULL) {
+ if (!(&nic->wilc_netdev->dev)) {
PRINT_ER("&nic->wilc_netdev->dev is NULL\n");
goto _fail_;
}
@@ -929,7 +929,7 @@ void wilc1000_wlan_deinit(struct net_device *dev)
disable_sdio_interrupt();
mutex_unlock(&wl->hif_cs);
#endif
- if (&wl->txq_event != NULL)
+ if (&wl->txq_event)
up(&wl->txq_event);

PRINT_D(INIT_DBG, "Deinitializing Threads\n");
@@ -1002,10 +1002,10 @@ static int wlan_deinit_locks(struct net_device *dev)

PRINT_D(INIT_DBG, "De-Initializing Locks\n");

- if (&wilc->hif_cs != NULL)
+ if (&wilc->hif_cs)
mutex_destroy(&wilc->hif_cs);

- if (&wilc->rxq_cs != NULL)
+ if (&wilc->rxq_cs)
mutex_destroy(&wilc->rxq_cs);

return 0;
@@ -1078,10 +1078,10 @@ static void wlan_deinitialize_threads(struct net_device *dev)
wl->close = 1;
PRINT_D(INIT_DBG, "Deinitializing Threads\n");

- if (&wl->txq_event != NULL)
+ if (&wl->txq_event)
up(&wl->txq_event);

- if (wl->txq_thread != NULL) {
+ if (wl->txq_thread) {
kthread_stop(wl->txq_thread);
wl->txq_thread = NULL;
}
@@ -1400,7 +1400,7 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
}

tx_data = kmalloc(sizeof(struct tx_complete_data), GFP_ATOMIC);
- if (tx_data == NULL) {
+ if (!tx_data) {
PRINT_ER("Failed to allocate memory for tx_data structure\n");
dev_kfree_skb(skb);
netif_wake_queue(ndev);
@@ -1454,7 +1454,8 @@ int mac_close(struct net_device *ndev)

nic = netdev_priv(ndev);

- if ((nic == NULL) || (nic->wilc_netdev == NULL) || (nic->wilc_netdev->ieee80211_ptr == NULL) || (nic->wilc_netdev->ieee80211_ptr->wiphy == NULL)) {
+ if (!nic || !nic->wilc_netdev || !nic->wilc_netdev->ieee80211_ptr ||
+ !nic->wilc_netdev->ieee80211_ptr->wiphy) {
PRINT_ER("nic = NULL\n");
return 0;
}
@@ -1462,7 +1463,7 @@ int mac_close(struct net_device *ndev)
priv = wiphy_priv(nic->wilc_netdev->ieee80211_ptr->wiphy);
wl = nic->wilc;

- if (priv == NULL) {
+ if (!priv) {
PRINT_ER("priv = NULL\n");
return 0;
}
@@ -1476,7 +1477,7 @@ int mac_close(struct net_device *ndev)
return 0;
}

- if (pstrWFIDrv == NULL) {
+ if (!pstrWFIDrv) {
PRINT_ER("pstrWFIDrv = NULL\n");
return 0;
}
@@ -1488,7 +1489,7 @@ int mac_close(struct net_device *ndev)
return 0;
}

- if (nic->wilc_netdev != NULL) {
+ if (nic->wilc_netdev) {
/* Stop the network interface queue */
netif_stop_queue(nic->wilc_netdev);

@@ -1589,7 +1590,7 @@ void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
perInterface_wlan_t *nic;

wilc_netdev = GetIfHandler(wilc, buff);
- if (wilc_netdev == NULL)
+ if (!wilc_netdev)
return;

buff += pkt_offset;
@@ -1602,16 +1603,16 @@ void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)

/* Need to send the packet up to the host, allocate a skb buffer */
skb = dev_alloc_skb(frame_len);
- if (skb == NULL) {
+ if (!skb) {
PRINT_ER("Low memory - packet droped\n");
return;
}

- if (wilc == NULL || wilc_netdev == NULL)
+ if (!wilc || !wilc_netdev)
PRINT_ER("wilc_netdev in wilc is NULL");
skb->dev = wilc_netdev;

- if (skb->dev == NULL)
+ if (!skb->dev)
PRINT_ER("skb->dev is NULL\n");

/*
@@ -1759,7 +1760,7 @@ int wilc_netdev_init(struct wilc **wilc)
SET_NETDEV_DEV(ndev, &local_sdio_func->dev);
#endif

- if (wdev == NULL) {
+ if (!wdev) {
PRINT_ER("Can't register WILC Wiphy\n");
return -1;
}
--
1.9.1


2015-11-02 08:49:16

by Glen Lee

[permalink] [raw]
Subject: [PATCH 10/38] staging: wilc1000: linux_wlan: remove unused define CUSTOMER_PLATFORM

From: Leo Kim <[email protected]>

This patch remove unused define CUSTOMER_PLATFORM from linux_wlan.c.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 15 ---------------
1 file changed, 15 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index a483f79..05f33ec 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -32,18 +32,11 @@
#include "linux_wlan_spi.h"
#endif

-#if defined(CUSTOMER_PLATFORM)
-/*
- TODO : Write power control functions as customer platform.
- */
-#else
-
#define _linux_wlan_device_power_on() {}
#define _linux_wlan_device_power_off() {}

#define _linux_wlan_device_detection() {}
#define _linux_wlan_device_removal() {}
-#endif

extern bool g_obtainingIP;
extern void resolve_disconnect_aberration(void *drvHandler);
@@ -278,15 +271,7 @@ static int init_irq(struct net_device *dev)
/*GPIO request*/
if ((gpio_request(GPIO_NUM, "WILC_INTR") == 0) &&
(gpio_direction_input(GPIO_NUM) == 0)) {
-#if defined(CUSTOMER_PLATFORM)
-/*
- TODO : save the registerd irq number to the private wilc context in kernel.
- *
- * ex) nic->dev_irq_num = gpio_to_irq(GPIO_NUM);
- */
-#else
wl->dev_irq_num = gpio_to_irq(GPIO_NUM);
-#endif
} else {
ret = -1;
PRINT_ER("could not obtain gpio for WILC_INTR\n");
--
1.9.1


2015-11-02 08:51:44

by Glen Lee

[permalink] [raw]
Subject: [PATCH 35/38] staging: wilc1000: rename host_int_get_MacAddress function

From: Leo Kim <[email protected]>

This patch rename host_int_get_MacAddress function to hif_get_mac_address
to avoid CamelCase naming convention.

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

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index de84c5d..5c38390 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3494,7 +3494,7 @@ s32 host_int_set_RSNAConfigPSKPassPhrase(struct host_if_drv *hif_drv,
return 0;
}

-s32 host_int_get_MacAddress(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
+s32 hif_get_mac_address(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
{
s32 result = 0;
struct host_if_msg msg;
diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index 510b4a5..dd33bc3 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -334,7 +334,7 @@ s32 host_int_set_RSNAConfigPSKPassPhrase(struct host_if_drv *hWFIDrv,
u8 u8Psklength);
s32 host_int_get_RSNAConfigPSKPassPhrase(struct host_if_drv *hWFIDrv,
u8 *pu8PassPhrase, u8 u8Psklength);
-s32 host_int_get_MacAddress(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress);
+s32 hif_get_mac_address(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress);
s32 host_int_set_MacAddress(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress);
int host_int_wait_msg_queue_idle(void);
s32 host_int_set_start_scan_req(struct host_if_drv *hWFIDrv, u8 scanSource);
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index a4038e1..8370a90 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1114,7 +1114,7 @@ int mac_open(struct net_device *ndev)

set_machw_change_vir_if(ndev, false);

- host_int_get_MacAddress(priv->hWILCWFIDrv, mac_add);
+ hif_get_mac_address(priv->hWILCWFIDrv, mac_add);
PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add);

for (i = 0; i < wl->vif_num; i++) {
--
1.9.1


2015-11-02 08:49:52

by Glen Lee

[permalink] [raw]
Subject: [PATCH 16/38] staging: wilc1000: fixes blank lines aren't necessary brace

From: Leo Kim <[email protected]>

This patch fixes the checks reported by checkpatch.pl
for Blank lines aren't necessary after an open brace '{' and
Blank lines aren't necessary before a close brace '}'.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 21 ---------------------
1 file changed, 21 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 335aa2b..b7c40ac 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -218,7 +218,6 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event
}

return NOTIFY_DONE;
-
}

#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
@@ -284,11 +283,9 @@ static int init_irq(struct net_device *dev)
if ((ret != -1) && (request_threaded_irq(wl->dev_irq_num, isr_uh_routine, isr_bh_routine,
IRQF_TRIGGER_LOW | IRQF_ONESHOT, /*Without IRQF_ONESHOT the uh will remain kicked in and dont gave a chance to bh*/
"WILC_IRQ", dev)) < 0) {
-
PRINT_ER("Failed to request IRQ for GPIO: %d\n", GPIO_NUM);
ret = -1;
} else {
-
PRINT_D(INIT_DBG, "IRQ request succeeded IRQ-NUM= %d on GPIO: %d\n",
wl->dev_irq_num, GPIO_NUM);
}
@@ -353,12 +350,9 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)

if (wilc->mac_status == WILC_MAC_STATUS_CONNECT) { /* Connect */
}
-
} else if (flag == WILC_MAC_INDICATE_SCAN) {
PRINT_D(GENERIC_DBG, "Scanning ...\n");
-
}
-
}

struct net_device *GetIfHandler(struct wilc *wilc, u8 *pMacHeader)
@@ -449,7 +443,6 @@ static int linux_wlan_txq_task(void *vp)
/* inform wilc1000_wlan_init that TXQ task is started. */
up(&wl->txq_thread_started);
while (1) {
-
PRINT_D(TX_DBG, "txq_task Taking a nap :)\n");
down(&wl->txq_event);
/* wait_for_completion(&pd->txq_event); */
@@ -562,7 +555,6 @@ int linux_wlan_get_firmware(struct net_device *dev)
_fail_:

return ret;
-
}

static int linux_wlan_start_firmware(struct net_device *dev)
@@ -635,7 +627,6 @@ _FAIL_:
/* startup configuration - could be changed later using iconfig*/
static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_nic)
{
-
unsigned char c_val[64];
unsigned char mac_add[] = {0x00, 0x80, 0xC2, 0x5E, 0xa2, 0xff};

@@ -1001,7 +992,6 @@ static int wlan_deinit_locks(struct net_device *dev)
}
void linux_to_wlan(wilc_wlan_inp_t *nwi, struct wilc *nic)
{
-
PRINT_D(INIT_DBG, "Linux to Wlan services ...\n");

nwi->wilc = (void *)nic;
@@ -1197,7 +1187,6 @@ _fail_locks_:

int mac_init_fn(struct net_device *ndev)
{
-
/*Why we do this !!!*/
netif_start_queue(ndev); /* ma */
netif_stop_queue(ndev); /* ma */
@@ -1295,7 +1284,6 @@ struct net_device_stats *mac_stats(struct net_device *dev)
/* Setup the multicast filter */
static void wilc_set_multicast_list(struct net_device *dev)
{
-
struct netdev_hw_addr *ha;
struct wilc_priv *priv;
struct host_if_drv *hif_drv;
@@ -1350,12 +1338,10 @@ static void wilc_set_multicast_list(struct net_device *dev)
host_int_setup_multicast_filter(hif_drv, true, (dev->mc.count));

return;
-
}

static void linux_wlan_tx_complete(void *priv, int status)
{
-
struct tx_complete_data *pv_data = (struct tx_complete_data *)priv;

if (status == 1)
@@ -1500,7 +1486,6 @@ int mac_close(struct net_device *ndev)

int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
{
-
u8 *buff = NULL;
s8 rssi;
u32 size = 0, length = 0;
@@ -1517,7 +1502,6 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
return 0;

switch (cmd) {
-
/* ]] 2013-06-24 */
case SIOCSIWPRIV:
{
@@ -1526,7 +1510,6 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
size = wrq->u.data.length;

if (size && wrq->u.data.pointer) {
-
buff = memdup_user(wrq->u.data.pointer, wrq->u.data.length);
if (IS_ERR(buff))
return PTR_ERR(buff);
@@ -1570,7 +1553,6 @@ done:

void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
{
-
unsigned int frame_len = 0;
int stats;
unsigned char *buff_to_send = NULL;
@@ -1586,7 +1568,6 @@ void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
nic = netdev_priv(wilc_netdev);

if (size > 0) {
-
frame_len = size;
buff_to_send = buff;

@@ -1762,7 +1743,6 @@ int wilc_netdev_init(struct wilc **wilc)
nic->netstats.tx_packets = 0;
nic->netstats.rx_bytes = 0;
nic->netstats.tx_bytes = 0;
-
}

if (register_netdev(ndev)) {
@@ -1772,7 +1752,6 @@ int wilc_netdev_init(struct wilc **wilc)

nic->iftype = STATION_MODE;
nic->mac_opened = 0;
-
}

#ifndef WILC_SDIO
--
1.9.1


2015-11-02 08:51:38

by Glen Lee

[permalink] [raw]
Subject: [PATCH 34/38] staging: wilc1000: rename Set_machw_change_vir_if function

From: Leo Kim <[email protected]>

This patch rename Set_machw_change_vir_if function to set_machw_change_vir_if
to avoid CamelCase naming convention.

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

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 1a4ef89..a4038e1 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1112,7 +1112,7 @@ int mac_open(struct net_device *ndev)
return ret;
}

- Set_machw_change_vir_if(ndev, false);
+ set_machw_change_vir_if(ndev, false);

host_int_get_MacAddress(priv->hWILCWFIDrv, mac_add);
PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 46d6052..49f061a 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1408,7 +1408,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
g_key_gtk_params.seq = NULL;

/*Reset WILC_CHANGING_VIR_IF register to allow adding futrue keys to CE H/W*/
- Set_machw_change_vir_if(netdev, false);
+ set_machw_change_vir_if(netdev, false);
}

if (key_index >= 0 && key_index <= 3) {
@@ -2548,7 +2548,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
PRINT_D(GENERIC_DBG, "Changing virtual interface, enable scan\n");
/*Set WILC_CHANGING_VIR_IF register to disallow adding futrue keys to CE H/W*/
if (g_ptk_keys_saved && g_gtk_keys_saved) {
- Set_machw_change_vir_if(dev, true);
+ set_machw_change_vir_if(dev, true);
}

switch (type) {
@@ -2710,7 +2710,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,

/*Refresh scan, to refresh the scan results to the wpa_supplicant. Set MachHw to false to enable further key installments*/
refresh_scan(priv, 1, true);
- Set_machw_change_vir_if(dev, false);
+ set_machw_change_vir_if(dev, false);

if (wl->initialized) {
for (i = 0; i < num_reg_frame; i++) {
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 19e8643..9406c96 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -216,7 +216,7 @@ void wl_wlan_cleanup(struct wilc *wilc);
int wilc_netdev_init(struct wilc **wilc);
void wilc1000_wlan_deinit(struct net_device *dev);
void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size);
-u16 Set_machw_change_vir_if(struct net_device *dev, bool bValue);
+u16 set_machw_change_vir_if(struct net_device *dev, bool bValue);
int linux_wlan_get_firmware(struct net_device *dev);
int linux_wlan_get_num_conn_ifcs(struct net_device *dev);
int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid);
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 898f60e..152dba5 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -2074,7 +2074,7 @@ _fail_:

}

-u16 Set_machw_change_vir_if(struct net_device *dev, bool bValue)
+u16 set_machw_change_vir_if(struct net_device *dev, bool bValue)
{
u16 ret;
u32 reg;
--
1.9.1


2015-11-02 08:49:59

by Glen Lee

[permalink] [raw]
Subject: [PATCH 17/38] staging: wilc1000: linux_wlan.c: clean up comments

From: Leo Kim <[email protected]>

There are over-commenting in the linux_wlan.c file and most of them
are not helpful to explain what the code does and generate 80 ending
line over warnings. So, all of comments and commented codes are removed in
this patch. Comment will be added if necessary with the preferred Linux style.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 218 ++++------------------------------
1 file changed, 26 insertions(+), 192 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index b7c40ac..e7e5229 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -79,12 +79,6 @@ static struct notifier_block g_dev_notifier = {

#define IRQ_WAIT 1
#define IRQ_NO_WAIT 0
-/*
- * to sync between mac_close and module exit.
- * don't initialize or de-initialize from init/deinitlocks
- * to be initialized from module wilc_netdev_init and
- * deinitialized from mdoule_exit
- */
static struct semaphore close_exit_sync;

static int wlan_deinit_locks(struct net_device *dev);
@@ -101,10 +95,6 @@ static struct net_device_stats *mac_stats(struct net_device *dev);
static int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd);
static void wilc_set_multicast_list(struct net_device *dev);

-/*
- * for now - in frmw_to_linux there should be private data to be passed to it
- * and this data should be pointer to net device
- */
bool bEnablePS = true;

static const struct net_device_ops wilc_netdev_ops = {
@@ -156,15 +146,14 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event
return NOTIFY_DONE;
}

- PRINT_INFO(GENERIC_DBG, "dev_state_ev_handler +++\n"); /* tony */
+ PRINT_INFO(GENERIC_DBG, "dev_state_ev_handler +++\n");

switch (event) {
case NETDEV_UP:
- PRINT_D(GENERIC_DBG, "dev_state_ev_handler event=NETDEV_UP %p\n", dev); /* tony */
+ PRINT_D(GENERIC_DBG, "dev_state_ev_handler event=NETDEV_UP %p\n", dev);

PRINT_INFO(GENERIC_DBG, "\n ============== IP Address Obtained ===============\n\n");

- /*If we are in station mode or client mode*/
if (nic->iftype == STATION_MODE || nic->iftype == CLIENT_MODE) {
hif_drv->IFC_UP = 1;
g_obtainingIP = false;
@@ -186,7 +175,7 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event
break;

case NETDEV_DOWN:
- PRINT_D(GENERIC_DBG, "dev_state_ev_handler event=NETDEV_DOWN %p\n", dev); /* tony */
+ PRINT_D(GENERIC_DBG, "dev_state_ev_handler event=NETDEV_DOWN %p\n", dev);

PRINT_INFO(GENERIC_DBG, "\n ============== IP Address Released ===============\n\n");
if (nic->iftype == STATION_MODE || nic->iftype == CLIENT_MODE) {
@@ -211,7 +200,7 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event
break;

default:
- PRINT_INFO(GENERIC_DBG, "dev_state_ev_handler event=default\n"); /* tony */
+ PRINT_INFO(GENERIC_DBG, "dev_state_ev_handler event=default\n");
PRINT_INFO(GENERIC_DBG, "[%s] unknown dev event: %lu\n", dev_iface->ifa_label, event);

break;
@@ -231,7 +220,6 @@ static irqreturn_t isr_uh_routine(int irq, void *user_data)
wilc = nic->wilc;
PRINT_D(INT_DBG, "Interrupt received UH\n");

- /*While mac is closing cacncel the handling of any interrupts received*/
if (wilc->close) {
PRINT_ER("Driver is CLOSING: Can't handle UH interrupt\n");
return IRQ_HANDLED;
@@ -248,7 +236,6 @@ irqreturn_t isr_bh_routine(int irq, void *userdata)
nic = netdev_priv(userdata);
wilc = nic->wilc;

- /*While mac is closing cacncel the handling of any interrupts received*/
if (wilc->close) {
PRINT_ER("Driver is CLOSING: Can't handle BH interrupt\n");
return IRQ_HANDLED;
@@ -270,8 +257,6 @@ static int init_irq(struct net_device *dev)
nic = netdev_priv(dev);
wl = nic->wilc;

- /*initialize GPIO and register IRQ num*/
- /*GPIO request*/
if ((gpio_request(GPIO_NUM, "WILC_INTR") == 0) &&
(gpio_direction_input(GPIO_NUM) == 0)) {
wl->dev_irq_num = gpio_to_irq(GPIO_NUM);
@@ -281,7 +266,7 @@ static int init_irq(struct net_device *dev)
}

if ((ret != -1) && (request_threaded_irq(wl->dev_irq_num, isr_uh_routine, isr_bh_routine,
- IRQF_TRIGGER_LOW | IRQF_ONESHOT, /*Without IRQF_ONESHOT the uh will remain kicked in and dont gave a chance to bh*/
+ IRQF_TRIGGER_LOW | IRQF_ONESHOT,
"WILC_IRQ", dev)) < 0) {
PRINT_ER("Failed to request IRQ for GPIO: %d\n", GPIO_NUM);
ret = -1;
@@ -303,7 +288,6 @@ static void deinit_irq(struct net_device *dev)
wilc = nic->wilc;

#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
- /* Deintialize IRQ */
if (&wilc->dev_irq_num != 0) {
free_irq(wilc->dev_irq_num, wilc);

@@ -312,9 +296,6 @@ static void deinit_irq(struct net_device *dev)
#endif
}

-/*
- * OS functions
- */
void linux_wlan_dbg(u8 *buff)
{
PRINT_D(INIT_DBG, "%d\n", *buff);
@@ -334,9 +315,6 @@ int linux_wlan_lock_timeout(void *vp, u32 timeout)

void linux_wlan_mac_indicate(struct wilc *wilc, int flag)
{
- /*I have to do it that way becuase there is no mean to encapsulate device pointer
- * as a parameter
- */
int status;

if (flag == WILC_MAC_INDICATE_STATUS) {
@@ -348,7 +326,7 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)
wilc->mac_status = status;
}

- if (wilc->mac_status == WILC_MAC_STATUS_CONNECT) { /* Connect */
+ if (wilc->mac_status == WILC_MAC_STATUS_CONNECT) {
}
} else if (flag == WILC_MAC_INDICATE_SCAN) {
PRINT_D(GENERIC_DBG, "Scanning ...\n");
@@ -402,7 +380,6 @@ int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID)
return ret;
}

-/*Function to get number of connected interfaces*/
int linux_wlan_get_num_conn_ifcs(struct net_device *dev)
{
u8 i = 0;
@@ -440,16 +417,13 @@ static int linux_wlan_txq_task(void *vp)
nic = netdev_priv(dev);
wl = nic->wilc;

- /* inform wilc1000_wlan_init that TXQ task is started. */
up(&wl->txq_thread_started);
while (1) {
PRINT_D(TX_DBG, "txq_task Taking a nap :)\n");
down(&wl->txq_event);
- /* wait_for_completion(&pd->txq_event); */
PRINT_D(TX_DBG, "txq_task Who waked me up :$\n");

if (wl->close) {
- /*Unlock the mutex in the mac_close function to indicate the exiting of the TX thread */
up(&wl->txq_thread_started);

while (!kthread_should_stop())
@@ -464,23 +438,19 @@ static int linux_wlan_txq_task(void *vp)
#else
do {
ret = wilc_wlan_handle_txq(dev, &txq_count);
- if (txq_count < FLOW_CONTROL_LOWER_THRESHOLD /* && netif_queue_stopped(pd->wilc_netdev)*/) {
+ if (txq_count < FLOW_CONTROL_LOWER_THRESHOLD) {
PRINT_D(TX_DBG, "Waking up queue\n");
- /* netif_wake_queue(pd->wilc_netdev); */
+
if (netif_queue_stopped(wl->vif[0].ndev))
netif_wake_queue(wl->vif[0].ndev);
if (netif_queue_stopped(wl->vif[1].ndev))
netif_wake_queue(wl->vif[1].ndev);
}

- if (ret == WILC_TX_ERR_NO_BUF) { /* failed to allocate buffers in chip. */
+ if (ret == WILC_TX_ERR_NO_BUF) {
do {
- /* Back off from sending packets for some time. */
- /* schedule_timeout will allow RX task to run and free buffers.*/
- /* set_current_state(TASK_UNINTERRUPTIBLE); */
- /* timeout = schedule_timeout(timeout); */
msleep(TX_BACKOFF_WEIGHT_UNIT_MS << backoff_weight);
- } while (/*timeout*/ 0);
+ } while (0);
backoff_weight += TX_BACKOFF_WEIGHT_INCR_STEP;
if (backoff_weight > TX_BACKOFF_WEIGHT_MAX)
backoff_weight = TX_BACKOFF_WEIGHT_MAX;
@@ -491,8 +461,7 @@ static int linux_wlan_txq_task(void *vp)
backoff_weight = TX_BACKOFF_WEIGHT_MIN;
}
}
- /*TODO: drop packets after a certain time/number of retry count. */
- } while (ret == WILC_TX_ERR_NO_BUF && !wl->close); /* retry sending packets if no more buffers in chip. */
+ } while (ret == WILC_TX_ERR_NO_BUF && !wl->close);
#endif
}
return 0;
@@ -534,9 +503,6 @@ int linux_wlan_get_firmware(struct net_device *dev)
goto _fail_;
}

- /* the firmare should be located in /lib/firmware in
- * root file system with the name specified above */
-
#ifdef WILC_SDIO
if (request_firmware(&wilc_firmware, firmware, &wilc->wilc_sdio_func->dev) != 0) {
PRINT_ER("%s - firmare not available\n", firmware);
@@ -566,7 +532,6 @@ static int linux_wlan_start_firmware(struct net_device *dev)
nic = netdev_priv(dev);
wilc = nic->wilc;

- /* start firmware */
PRINT_D(INIT_DBG, "Starting Firmware ...\n");
ret = wilc_wlan_start(dev);
if (ret < 0) {
@@ -574,17 +539,12 @@ static int linux_wlan_start_firmware(struct net_device *dev)
goto _fail_;
}

- /* wait for mac ready */
PRINT_D(INIT_DBG, "Waiting for Firmware to get ready ...\n");
ret = linux_wlan_lock_timeout(&wilc->sync_event, 5000);
if (ret) {
PRINT_D(INIT_DBG, "Firmware start timed out");
goto _fail_;
}
- /*
- * TODO: Driver shouoldn't wait forever for firmware to get started -
- * in case of timeout this should be handled properly
- */
PRINT_D(INIT_DBG, "Firmware successfully started\n");

_fail_:
@@ -604,16 +564,12 @@ static int linux_wlan_firmware_download(struct net_device *dev)
ret = -ENOBUFS;
goto _FAIL_;
}
- /**
- * do the firmware download
- **/
PRINT_D(INIT_DBG, "Downloading Firmware ...\n");
ret = wilc_wlan_firmware_download(dev, wilc->firmware->data,
wilc->firmware->size);
if (ret < 0)
goto _FAIL_;

- /* Freeing FW buffer */
PRINT_D(INIT_DBG, "Freeing FW buffer ...\n");
PRINT_D(INIT_DBG, "Releasing firmware\n");
release_firmware(wilc->firmware);
@@ -624,7 +580,6 @@ _FAIL_:
return ret;
}

-/* startup configuration - could be changed later using iconfig*/
static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_nic)
{
unsigned char c_val[64];
@@ -648,7 +603,6 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
if (!wilc_wlan_cfg_set(dev, 1, WID_SET_DRV_HANDLER, c_val, 4, 0, 0))
goto _fail_;

- /*to tell fw that we are going to use PC test - WILC specific*/
c_val[0] = 0;
if (!wilc_wlan_cfg_set(dev, 0, WID_PC_TEST_MODE, c_val, 1, 0, 0))
goto _fail_;
@@ -657,7 +611,6 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
if (!wilc_wlan_cfg_set(dev, 0, WID_BSS_TYPE, c_val, 1, 0, 0))
goto _fail_;

- /* c_val[0] = RATE_AUTO; */
c_val[0] = RATE_AUTO;
if (!wilc_wlan_cfg_set(dev, 0, WID_CURRENT_TX_RATE, c_val, 1, 0, 0))
goto _fail_;
@@ -686,7 +639,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
if (!wilc_wlan_cfg_set(dev, 0, WID_SITE_SURVEY, c_val, 1, 0, 0))
goto _fail_;

- *((int *)c_val) = 0xffff; /* Never use RTS-CTS */
+ *((int *)c_val) = 0xffff;
if (!wilc_wlan_cfg_set(dev, 0, WID_RTS_THRESHOLD, c_val, 2, 0, 0))
goto _fail_;

@@ -694,13 +647,6 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
if (!wilc_wlan_cfg_set(dev, 0, WID_FRAG_THRESHOLD, c_val, 2, 0, 0))
goto _fail_;

- /* SSID */
- /* -------------------------------------------------------------- */
- /* Configuration : String with length less than 32 bytes */
- /* Values to set : Any string with length less than 32 bytes */
- /* ( In BSS Station Set SSID to "" (null string) */
- /* to enable Broadcast SSID suppport ) */
- /* -------------------------------------------------------------- */
c_val[0] = 0;
if (!wilc_wlan_cfg_set(dev, 0, WID_BCAST_SSID, c_val, 1, 0, 0))
goto _fail_;
@@ -713,7 +659,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
if (!wilc_wlan_cfg_set(dev, 0, WID_POWER_MANAGEMENT, c_val, 1, 0, 0))
goto _fail_;

- c_val[0] = NO_ENCRYPT; /* NO_ENCRYPT, 0x79 */
+ c_val[0] = NO_ENCRYPT;
if (!wilc_wlan_cfg_set(dev, 0, WID_11I_MODE, c_val, 1, 0, 0))
goto _fail_;

@@ -721,43 +667,18 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
if (!wilc_wlan_cfg_set(dev, 0, WID_AUTH_TYPE, c_val, 1, 0, 0))
goto _fail_;

- /* WEP/802 11I Configuration */
- /* ------------------------------------------------------------------ */
- /* Configuration : WEP Key */
- /* Values (0x) : 5 byte for WEP40 and 13 bytes for WEP104 */
- /* In case more than 5 bytes are passed on for WEP 40 */
- /* only first 5 bytes will be used as the key */
- /* ------------------------------------------------------------------ */
-
strcpy(c_val, "123456790abcdef1234567890");
if (!wilc_wlan_cfg_set(dev, 0, WID_WEP_KEY_VALUE, c_val, (strlen(c_val) + 1), 0, 0))
goto _fail_;

- /* WEP/802 11I Configuration */
- /* ------------------------------------------------------------------ */
- /* Configuration : AES/TKIP WPA/RSNA Pre-Shared Key */
- /* Values to set : Any string with length greater than equal to 8 bytes */
- /* and less than 64 bytes */
- /* ------------------------------------------------------------------ */
strcpy(c_val, "12345678");
if (!wilc_wlan_cfg_set(dev, 0, WID_11I_PSK, c_val, (strlen(c_val)), 0, 0))
goto _fail_;

- /* IEEE802.1X Key Configuration */
- /* ------------------------------------------------------------------ */
- /* Configuration : Radius Server Access Secret Key */
- /* Values to set : Any string with length greater than equal to 8 bytes */
- /* and less than 65 bytes */
- /* ------------------------------------------------------------------ */
strcpy(c_val, "password");
if (!wilc_wlan_cfg_set(dev, 0, WID_1X_KEY, c_val, (strlen(c_val) + 1), 0, 0))
goto _fail_;

- /* IEEE802.1X Server Address Configuration */
- /* ------------------------------------------------------------------ */
- /* Configuration : Radius Server IP Address */
- /* Values to set : Any valid IP Address */
- /* ------------------------------------------------------------------ */
c_val[0] = 192;
c_val[1] = 168;
c_val[2] = 1;
@@ -789,12 +710,6 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
if (!wilc_wlan_cfg_set(dev, 0, WID_TX_POWER_LEVEL_11B, c_val, 1, 0, 0))
goto _fail_;

- /* Beacon Interval */
- /* -------------------------------------------------------------------- */
- /* Configuration : Sets the beacon interval value */
- /* Values to set : Any 16-bit value */
- /* -------------------------------------------------------------------- */
-
*((int *)c_val) = 100;
if (!wilc_wlan_cfg_set(dev, 0, WID_BEACON_INTERVAL, c_val, 2, 0, 0))
goto _fail_;
@@ -803,20 +718,10 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
if (!wilc_wlan_cfg_set(dev, 0, WID_REKEY_POLICY, c_val, 1, 0, 0))
goto _fail_;

- /* Rekey Time (s) (Used only when the Rekey policy is 2 or 4) */
- /* -------------------------------------------------------------------- */
- /* Configuration : Sets the Rekey Time (s) */
- /* Values to set : 32-bit value */
- /* -------------------------------------------------------------------- */
*((int *)c_val) = 84600;
if (!wilc_wlan_cfg_set(dev, 0, WID_REKEY_PERIOD, c_val, 4, 0, 0))
goto _fail_;

- /* Rekey Packet Count (in 1000s; used when Rekey Policy is 3) */
- /* -------------------------------------------------------------------- */
- /* Configuration : Sets Rekey Group Packet count */
- /* Values to set : 32-bit Value */
- /* -------------------------------------------------------------------- */
*((int *)c_val) = 500;
if (!wilc_wlan_cfg_set(dev, 0, WID_REKEY_PACKET_COUNT, c_val, 4, 0, 0))
goto _fail_;
@@ -829,7 +734,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
if (!wilc_wlan_cfg_set(dev, 0, WID_11N_ERP_PROT_TYPE, c_val, 1, 0, 0))
goto _fail_;

- c_val[0] = 1; /* Enable N */
+ c_val[0] = 1;
if (!wilc_wlan_cfg_set(dev, 0, WID_11N_ENABLE, c_val, 1, 0, 0))
goto _fail_;

@@ -837,7 +742,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
if (!wilc_wlan_cfg_set(dev, 0, WID_11N_OPERATING_MODE, c_val, 1, 0, 0))
goto _fail_;

- c_val[0] = 1; /* TXOP Prot disable in N mode: No RTS-CTS on TX A-MPDUs to save air-time. */
+ c_val[0] = 1;
if (!wilc_wlan_cfg_set(dev, 0, WID_11N_TXOP_PROT_DISABLE, c_val, 1, 0, 0))
goto _fail_;

@@ -846,9 +751,6 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
if (!wilc_wlan_cfg_set(dev, 0, WID_MAC_ADDR, c_val, 6, 0, 0))
goto _fail_;

- /**
- * AP only
- **/
c_val[0] = DETECT_PROTECT_REPORT;
if (!wilc_wlan_cfg_set(dev, 0, WID_11N_OBSS_NONHT_DETECTION, c_val, 1, 0, 0))
goto _fail_;
@@ -869,7 +771,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
if (!wilc_wlan_cfg_set(dev, 0, WID_11N_CURRENT_TX_MCS, c_val, 1, 0, 0))
goto _fail_;

- c_val[0] = 1; /* Enable N with immediate block ack. */
+ c_val[0] = 1;
if (!wilc_wlan_cfg_set(dev, 0, WID_11N_IMMEDIATE_BA_ENABLED, c_val, 1, 1, 1))
goto _fail_;

@@ -879,7 +781,6 @@ _fail_:
return -1;
}

-/**************************/
void wilc1000_wlan_deinit(struct net_device *dev)
{
perInterface_wlan_t *nic;
@@ -897,7 +798,6 @@ void wilc1000_wlan_deinit(struct net_device *dev)
netdev_info(dev, "Deinitializing wilc1000...\n");

#if defined(PLAT_ALLWINNER_A20) || defined(PLAT_ALLWINNER_A23) || defined(PLAT_ALLWINNER_A31)
- /* johnny : remove */
PRINT_D(INIT_DBG, "skip wilc_bus_set_default_speed\n");
#else
wilc_bus_set_default_speed();
@@ -932,11 +832,9 @@ void wilc1000_wlan_deinit(struct net_device *dev)
#endif
#endif

- /*De-Initialize locks*/
PRINT_D(INIT_DBG, "Deinitializing Locks\n");
wlan_deinit_locks(dev);

- /* announce that wilc1000 is not initialized */
wl->initialized = false;

PRINT_D(INIT_DBG, "wilc1000 deinitialization Done\n");
@@ -1025,8 +923,6 @@ int wlan_initialize_threads(struct net_device *dev)
wilc = nic->wilc;

PRINT_D(INIT_DBG, "Initializing Threads ...\n");
-
- /* create tx task */
PRINT_D(INIT_DBG, "Creating kthread for transmission\n");
wilc->txq_thread = kthread_run(linux_wlan_txq_task, (void *)dev,
"K_TXQ_TASK");
@@ -1035,13 +931,11 @@ int wlan_initialize_threads(struct net_device *dev)
ret = -ENOBUFS;
goto _fail_2;
}
- /* wait for TXQ task to start. */
down(&wilc->txq_thread_started);

return 0;

_fail_2:
- /*De-Initialize 2nd thread*/
wilc->close = 0;
return ret;
}
@@ -1117,7 +1011,6 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
goto _fail_irq_enable_;
}

- /*Download firmware*/
ret = linux_wlan_firmware_download(dev);
if (ret < 0) {
PRINT_ER("Failed to download firmware\n");
@@ -1125,7 +1018,6 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
goto _fail_irq_enable_;
}

- /* Start firmware*/
ret = linux_wlan_start_firmware(dev);
if (ret < 0) {
PRINT_ER("Failed to start firmware\n");
@@ -1145,7 +1037,6 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
Firmware_ver[size] = '\0';
PRINT_D(INIT_DBG, "***** Firmware Ver = %s *******\n", Firmware_ver);
}
- /* Initialize firmware with default configuration */
ret = linux_wlan_init_test_config(dev, wl);

if (ret < 0) {
@@ -1155,7 +1046,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
}

wl->initialized = true;
- return 0; /*success*/
+ return 0;

_fail_fw_start_:
wilc_wlan_stop(dev);
@@ -1181,26 +1072,18 @@ _fail_locks_:
return ret;
}

-/*
- * - this function will be called automatically by OS when module inserted.
- */
-
int mac_init_fn(struct net_device *ndev)
{
- /*Why we do this !!!*/
- netif_start_queue(ndev); /* ma */
- netif_stop_queue(ndev); /* ma */
+ netif_start_queue(ndev);
+ netif_stop_queue(ndev);

return 0;
}

-/* This fn is called, when this device is setup using ifconfig */
int mac_open(struct net_device *ndev)
{
perInterface_wlan_t *nic;

- /*No need for setting mac address here anymore,*/
- /*Just set it in init_test_config()*/
unsigned char mac_add[ETH_ALEN] = {0};
int ret = 0;
int i = 0;
@@ -1227,7 +1110,6 @@ int mac_open(struct net_device *ndev)
return ret;
}

- /*initialize platform*/
PRINT_D(INIT_DBG, "*** re-init ***\n");
ret = wilc1000_wlan_init(ndev, nic);
if (ret < 0) {
@@ -1241,7 +1123,6 @@ int mac_open(struct net_device *ndev)
host_int_get_MacAddress(priv->hWILCWFIDrv, mac_add);
PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add);

- /* loop through the NUM of supported devices and set the MAC address */
for (i = 0; i < wl->vif_num; i++) {
if (ndev == wl->vif[i].ndev) {
memcpy(wl->vif[i].src_addr, mac_add, ETH_ALEN);
@@ -1250,7 +1131,6 @@ int mac_open(struct net_device *ndev)
}
}

- /* TODO: get MAC address whenever the source is EPROM - hardcoded and copy it to ndev*/
memcpy(ndev->dev_addr, wl->vif[i].src_addr, ETH_ALEN);

if (!is_valid_ether_addr(ndev->dev_addr)) {
@@ -1281,7 +1161,6 @@ struct net_device_stats *mac_stats(struct net_device *dev)
return &nic->netstats;
}

-/* Setup the multicast filter */
static void wilc_set_multicast_list(struct net_device *dev)
{
struct netdev_hw_addr *ha;
@@ -1298,30 +1177,22 @@ static void wilc_set_multicast_list(struct net_device *dev)
PRINT_D(INIT_DBG, "Setting Multicast List with count = %d.\n", dev->mc.count);

if (dev->flags & IFF_PROMISC) {
- /* Normally, we should configure the chip to retrive all packets
- * but we don't wanna support this right now */
- /* TODO: add promiscuous mode support */
PRINT_D(INIT_DBG, "Set promiscuous mode ON, retrive all packets\n");
return;
}

- /* If there's more addresses than we handle, get all multicast
- * packets and sort them out in software. */
if ((dev->flags & IFF_ALLMULTI) || (dev->mc.count) > WILC_MULTICAST_TABLE_SIZE) {
PRINT_D(INIT_DBG, "Disable multicast filter, retrive all multicast packets\n");
- /* get all multicast packets */
host_int_setup_multicast_filter(hif_drv, false, 0);
return;
}

- /* No multicast? Just get our own stuff */
if ((dev->mc.count) == 0) {
PRINT_D(INIT_DBG, "Enable multicast filter, retrive directed packets only.\n");
host_int_setup_multicast_filter(hif_drv, true, 0);
return;
}

- /* Store all of the multicast addresses in the hardware filter */
netdev_for_each_mc_addr(ha, dev)
{
memcpy(multicast_mac_addr_list[i], ha->addr, ETH_ALEN);
@@ -1348,7 +1219,6 @@ static void linux_wlan_tx_complete(void *priv, int status)
PRINT_D(TX_DBG, "Packet sent successfully - Size = %d - Address = %p - SKB = %p\n", pv_data->size, pv_data->buff, pv_data->skb);
else
PRINT_D(TX_DBG, "Couldn't send packet - Size = %d - Address = %p - SKB = %p\n", pv_data->size, pv_data->buff, pv_data->skb);
- /* Free the SK Buffer, its work is done */
dev_kfree_skb(pv_data->skb);
kfree(pv_data);
}
@@ -1368,7 +1238,6 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)

PRINT_D(TX_DBG, "Sending packet just received from TCP/IP\n");

- /* Stop the network interface queue */
if (skb->dev != ndev) {
PRINT_ER("Packet not destined to this device\n");
return 0;
@@ -1390,7 +1259,6 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
if (eth_h->h_proto == 0x8e88)
PRINT_D(INIT_DBG, "EAPOL transmitted\n");

- /*get source and dest ip addresses*/
ih = (struct iphdr *)(skb->data + sizeof(struct ethhdr));

pu8UdpBuffer = (char *)ih + sizeof(struct iphdr);
@@ -1398,12 +1266,6 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
PRINT_D(GENERIC_DBG, "DHCP Message transmitted, type:%x %x %x\n", pu8UdpBuffer[248], pu8UdpBuffer[249], pu8UdpBuffer[250]);

PRINT_D(TX_DBG, "Sending packet - Size = %d - Address = %p - SKB = %p\n", tx_data->size, tx_data->buff, tx_data->skb);
-
- /* Send packet to MAC HW - for now the tx_complete function will be just status
- * indicator. still not sure if I need to suspend host transmission till the tx_complete
- * function called or not?
- * allocated buffer will be freed in tx_complete function.
- */
PRINT_D(TX_DBG, "Adding tx packet to TX Queue\n");
nic->netstats.tx_packets++;
nic->netstats.tx_bytes += tx_data->size;
@@ -1465,7 +1327,6 @@ int mac_close(struct net_device *ndev)
}

if (nic->wilc_netdev) {
- /* Stop the network interface queue */
netif_stop_queue(nic->wilc_netdev);

wilc_deinit_host_int(nic->wilc_netdev);
@@ -1494,7 +1355,6 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
s32 s32Error = 0;
struct wilc *wilc;

- /* struct iwreq *wrq = (struct iwreq *) req; // tony moved to case SIOCSIWPRIV */
nic = netdev_priv(ndev);
wilc = nic->wilc;

@@ -1502,10 +1362,9 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
return 0;

switch (cmd) {
- /* ]] 2013-06-24 */
case SIOCSIWPRIV:
{
- struct iwreq *wrq = (struct iwreq *) req; /* added by tony */
+ struct iwreq *wrq = (struct iwreq *) req;

size = wrq->u.data.length;

@@ -1521,7 +1380,6 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
PRINT_ER("Failed to send get rssi param's message queue ");
PRINT_INFO(GENERIC_DBG, "RSSI :%d\n", rssi);

- /*Rounding up the rssi negative value*/
rssi += 5;

snprintf(buff, size, "rssi %d", rssi);
@@ -1571,7 +1429,6 @@ void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
frame_len = size;
buff_to_send = buff;

- /* Need to send the packet up to the host, allocate a skb buffer */
skb = dev_alloc_skb(frame_len);
if (!skb) {
PRINT_ER("Low memory - packet droped\n");
@@ -1585,23 +1442,9 @@ void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
if (!skb->dev)
PRINT_ER("skb->dev is NULL\n");

- /*
- * for(i=0;i<40;i++)
- * {
- * if(i<frame_len)
- * WILC_PRINTF("buff_to_send[%d]=%2x\n",i,buff_to_send[i]);
- *
- * }*/
-
- /* skb_put(skb, frame_len); */
memcpy(skb_put(skb, frame_len), buff_to_send, frame_len);

- /* WILC_PRINTF("After MEM_CPY\n"); */
-
- /* nic = netdev_priv(wilc_netdev); */
-
skb->protocol = eth_type_trans(skb, wilc_netdev);
- /* Send the packet to the stack by giving it to the bridge */
nic->netstats.rx_packets++;
nic->netstats.rx_bytes += frame_len;
skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -1615,8 +1458,6 @@ void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size)
int i = 0;
perInterface_wlan_t *nic;

- /*Pass the frame on the monitor interface, if any.*/
- /*Otherwise, pass it on p2p0 netdev, if registered on it*/
for (i = 0; i < wilc->vif_num; i++) {
nic = netdev_priv(wilc->vif[i].ndev);
if (nic->monitor_flag) {
@@ -1625,7 +1466,7 @@ void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size)
}
}

- nic = netdev_priv(wilc->vif[1].ndev); /* p2p0 */
+ nic = netdev_priv(wilc->vif[1].ndev);
if ((buff[0] == nic->g_struct_frame_reg[0].frame_type && nic->g_struct_frame_reg[0].reg) ||
(buff[0] == nic->g_struct_frame_reg[1].frame_type && nic->g_struct_frame_reg[1].reg))
WILC_WFI_p2p_rx(wilc->vif[1].ndev, buff, size);
@@ -1681,7 +1522,6 @@ int wilc_netdev_init(struct wilc **wilc)

sema_init(&close_exit_sync, 0);

- /*create the common structure*/
wl = kzalloc(sizeof(*wl), GFP_KERNEL);
if (!wl)
return -ENOMEM;
@@ -1691,7 +1531,6 @@ int wilc_netdev_init(struct wilc **wilc)
register_inetaddr_notifier(&g_dev_notifier);

for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
- /*allocate first ethernet device with perinterface_wlan_t as its private data*/
ndev = alloc_etherdev(sizeof(perInterface_wlan_t));
if (!ndev) {
PRINT_ER("Failed to allocate ethernet dev\n");
@@ -1701,13 +1540,12 @@ int wilc_netdev_init(struct wilc **wilc)
nic = netdev_priv(ndev);
memset(nic, 0, sizeof(perInterface_wlan_t));

- /*Name the Devices*/
if (i == 0) {
- #if defined(NM73131) /* tony, 2012-09-20 */
+ #if defined(NM73131)
strcpy(ndev->name, "wilc_eth%d");
- #elif defined(PLAT_CLM9722) /* rachel */
+ #elif defined(PLAT_CLM9722)
strcpy(ndev->name, "eth%d");
- #else /* PANDA_BOARD, PLAT_ALLWINNER_A10, PLAT_ALLWINNER_A20, PLAT_ALLWINNER_A31, PLAT_AML8726_M3 or PLAT_WMS8304 */
+ #else
strcpy(ndev->name, "wlan%d");
#endif
} else
@@ -1722,11 +1560,9 @@ int wilc_netdev_init(struct wilc **wilc)

{
struct wireless_dev *wdev;
- /*Register WiFi*/
wdev = wilc_create_wiphy(ndev);

#ifdef WILC_SDIO
- /* set netdev, tony */
SET_NETDEV_DEV(ndev, &local_sdio_func->dev);
#endif

@@ -1735,7 +1571,6 @@ int wilc_netdev_init(struct wilc **wilc)
return -1;
}

- /*linking the wireless_dev structure with the netdevice*/
nic->wilc_netdev->ieee80211_ptr = wdev;
nic->wilc_netdev->ml_priv = nic;
wdev->netdev = nic->wilc_netdev;
@@ -1747,7 +1582,7 @@ int wilc_netdev_init(struct wilc **wilc)

if (register_netdev(ndev)) {
PRINT_ER("Device couldn't be registered - %s\n", ndev->name);
- return -1; /* ERROR */
+ return -1;
}

nic->iftype = STATION_MODE;
@@ -1757,7 +1592,7 @@ int wilc_netdev_init(struct wilc **wilc)
#ifndef WILC_SDIO
if (!linux_spi_init(&wl->wilc_spidev)) {
PRINT_ER("Can't initialize SPI\n");
- return -1; /* ERROR */
+ return -1;
}
wl->wilc_spidev = wilc_spi_dev;
#else
@@ -1767,7 +1602,6 @@ int wilc_netdev_init(struct wilc **wilc)
return 0;
}

-/*The 1st function called after module inserted*/
static int __init init_wilc_driver(void)
{
#ifdef WILC_SPI
--
1.9.1


2015-11-02 08:48:46

by Glen Lee

[permalink] [raw]
Subject: [PATCH 05/38] staging: wilc1000: rename pstrHostIfGetMacAddress of fuction Handle_GetMacAddress

From: Leo Kim <[email protected]>

This patch renames pstrHostIfGetMacAddress of fuction Handle_GetMacAddress
to get_mac_addr to avoid CamelCase naming convention.

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

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 7a58ce7..69ec7eb 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -512,7 +512,7 @@ static s32 Handle_SetMacAddress(struct host_if_drv *hif_drv,
}

static s32 Handle_GetMacAddress(struct host_if_drv *hif_drv,
- struct get_mac_addr *pstrHostIfGetMacAddress)
+ struct get_mac_addr *get_mac_addr)
{
s32 result = 0;
struct wid wid;
@@ -522,7 +522,7 @@ static s32 Handle_GetMacAddress(struct host_if_drv *hif_drv,

wid.id = (u16)WID_MAC_ADDR;
wid.type = WID_STR;
- wid.val = pstrHostIfGetMacAddress->mac_addr;
+ wid.val = get_mac_addr->mac_addr;
wid.size = ETH_ALEN;

result = send_config_pkt(dev, GET_CFG, &wid, 1,
--
1.9.1


2015-11-02 08:51:08

by Glen Lee

[permalink] [raw]
Subject: [PATCH 29/38] staging: wilc1000: remove goto from linux_wlan_start_firmware

From: Leo Kim <[email protected]>

This patch remove goto feature from linux_wlan_start_firmware function.
Goto feature is return result.
So, remove goto functions and it was replaced with the return value directly.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 1e9d67f..f091a3c 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -534,18 +534,17 @@ static int linux_wlan_start_firmware(struct net_device *dev)
ret = wilc_wlan_start(dev);
if (ret < 0) {
PRINT_ER("Failed to start Firmware\n");
- goto _fail_;
+ return ret;
}

PRINT_D(INIT_DBG, "Waiting for Firmware to get ready ...\n");
ret = linux_wlan_lock_timeout(&wilc->sync_event, 5000);
if (ret) {
PRINT_D(INIT_DBG, "Firmware start timed out");
- goto _fail_;
+ return ret;
}
PRINT_D(INIT_DBG, "Firmware successfully started\n");

-_fail_:
return ret;
}
static int linux_wlan_firmware_download(struct net_device *dev)
--
1.9.1


2015-11-02 08:51:20

by Glen Lee

[permalink] [raw]
Subject: [PATCH 31/38] staging: wilc1000: fixes missing a blank line after declarations

From: Leo Kim <[email protected]>

This patch fixes the warnings reported by checkpatch.pl
for Missing a blank line after declarations.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index aaa938f..98c3cd0 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -547,6 +547,7 @@ static int linux_wlan_start_firmware(struct net_device *dev)

return ret;
}
+
static int linux_wlan_firmware_download(struct net_device *dev)
{
perInterface_wlan_t *nic;
@@ -885,6 +886,7 @@ static int wlan_deinit_locks(struct net_device *dev)

return 0;
}
+
void linux_to_wlan(wilc_wlan_inp_t *nwi, struct wilc *nic)
{
PRINT_D(INIT_DBG, "Linux to Wlan services ...\n");
--
1.9.1


2015-11-02 08:50:11

by Glen Lee

[permalink] [raw]
Subject: [PATCH 19/38] staging: wilc1000: remove extern function in c file and move it to header file.

From: Leo Kim <[email protected]>

This patch removes extern resolve_disconnect_aberration in c file and move
it to proper header file. Rename argument also to match with declaration.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/host_interface.h | 2 +-
drivers/staging/wilc1000/linux_wlan.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index f9efb5a..510b4a5 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -421,5 +421,5 @@ void host_int_freeJoinParams(void *pJoinParams);

s32 host_int_get_statistics(struct host_if_drv *hWFIDrv,
struct rf_info *pstrStatistics);
-
+void resolve_disconnect_aberration(struct host_if_drv *hif_drv);
#endif
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 82495ce..ab4ab1f 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -39,7 +39,6 @@
#define _linux_wlan_device_removal() {}

extern bool g_obtainingIP;
-extern void resolve_disconnect_aberration(void *drvHandler);
extern u8 multicast_mac_addr_list[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN];
extern struct timer_list hDuringIpTimer;

--
1.9.1


2015-11-02 08:48:59

by Glen Lee

[permalink] [raw]
Subject: [PATCH 07/38] staging: wilc1000: remove return type of Handle_wait_msg_q_empty

From: Leo Kim <[email protected]>

This patch changes return type of Handle_wait_msg_q_empty from s32 with void
because return value is not used.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 6abba23..584f718 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -835,11 +835,10 @@ ERRORHANDLER:
return result;
}

-static s32 Handle_wait_msg_q_empty(void)
+static void Handle_wait_msg_q_empty(void)
{
g_wilc_initialized = 0;
up(&hif_sema_wait_response);
- return 0;
}

static s32 Handle_Scan(struct host_if_drv *hif_drv,
--
1.9.1


2015-11-02 08:49:28

by Glen Lee

[permalink] [raw]
Subject: [PATCH 12/38] staging: wilc1000: rename pstrWFIDrv of function linux_wlan_init_test_config

From: Leo Kim <[email protected]>

This patch renames pstrWFIDrv of function linux_wlan_init_test_config to hif_drv
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index b4e84e3..312e91a 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -636,14 +636,14 @@ static int linux_wlan_init_test_config(struct net_device *dev, struct wilc *p_ni
unsigned char mac_add[] = {0x00, 0x80, 0xC2, 0x5E, 0xa2, 0xff};

struct wilc_priv *priv;
- struct host_if_drv *pstrWFIDrv;
+ struct host_if_drv *hif_drv;

PRINT_D(TX_DBG, "Start configuring Firmware\n");
get_random_bytes(&mac_add[5], 1);
get_random_bytes(&mac_add[4], 1);
priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
- pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv;
- PRINT_D(INIT_DBG, "Host = %p\n", pstrWFIDrv);
+ hif_drv = (struct host_if_drv *)priv->hWILCWFIDrv;
+ PRINT_D(INIT_DBG, "Host = %p\n", hif_drv);

PRINT_D(INIT_DBG, "MAC address is : %02x-%02x-%02x-%02x-%02x-%02x\n", mac_add[0], mac_add[1], mac_add[2], mac_add[3], mac_add[4], mac_add[5]);
wilc_get_chipid(0);
--
1.9.1