From: Leo Kim <[email protected]>
This patch renames ssidLen of struct join_bss_param to ssid_len
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[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 04f3bc2..e2588ef 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -207,7 +207,7 @@ struct join_bss_param {
u16 cap_info;
u8 au8bssid[6];
char ssid[MAX_SSID_LEN];
- u8 ssidLen;
+ u8 ssid_len;
u8 supp_rates[MAX_RATES_SUPPORTED + 1];
u8 ht_capable;
u8 wmm_cap;
@@ -4934,7 +4934,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
pNewJoinBssParam->cap_info = ptstrNetworkInfo->u16CapInfo;
memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->au8bssid, 6);
memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->au8ssid, ptstrNetworkInfo->u8SsidLen + 1);
- pNewJoinBssParam->ssidLen = ptstrNetworkInfo->u8SsidLen;
+ pNewJoinBssParam->ssid_len = ptstrNetworkInfo->u8SsidLen;
memset(pNewJoinBssParam->rsn_pcip_policy, 0xFF, 3);
memset(pNewJoinBssParam->rsn_auth_policy, 0xFF, 3);
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gs8Rssi to rssi
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index e309197..eda6382 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -253,7 +253,7 @@ static u8 rcv_assoc_resp[MAX_ASSOC_RESP_FRAME_SIZE];
static bool scan_while_connected;
-static s8 gs8Rssi;
+static s8 rssi;
static s8 gs8lnkspd;
static u8 gu8Chnl;
static u8 gs8SetIP[2][4];
@@ -2165,7 +2165,7 @@ static void Handle_GetRssi(struct host_if_drv *hif_drv)
strWID.id = (u16)WID_RSSI;
strWID.type = WID_CHAR;
- strWID.val = &gs8Rssi;
+ strWID.val = &rssi;
strWID.size = sizeof(char);
PRINT_D(HOSTINF_DBG, "Getting RSSI value\n");
@@ -3943,9 +3943,7 @@ s32 host_int_get_rssi(struct host_if_drv *hif_drv, s8 *ps8Rssi)
return -EFAULT;
}
-
- *ps8Rssi = gs8Rssi;
-
+ *ps8Rssi = rssi;
return s32Error;
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch removes unused the variable gu32WidConnRstHack.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 9f5db14..82d058f 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -260,7 +260,6 @@ static u8 set_ip[2][4];
static u8 get_ip[2][4];
static u32 inactive_time;
static u8 del_beacon;
-static u32 gu32WidConnRstHack;
u8 *gu8FlushedJoinReq;
u8 *gu8FlushedInfoElemAsoc;
@@ -1209,7 +1208,6 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
pu8CurrByte = strWIDList[u32WidsCount].val;
u32WidsCount++;
- gu32WidConnRstHack = 0;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
memcpy(gu8FlushedJoinReq, pu8CurrByte, gu32FlushedJoinReqSize);
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gu8FlushedAuthType to auth_type
to avoid CamelCase naming convention.
Add to static because follow warning reported by kbuild system.
- drivers/staging/wilc1000/host_interface.c:267:4: sparse: symbol
'auth_type' was not declared. Should it be static?
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index e15aeb1..f06280b 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -264,7 +264,7 @@ static u8 del_beacon;
static u8 *join_req;
static u8 *info_element;
static u8 mode_11i;
-u8 gu8FlushedAuthType;
+static u8 auth_type;
u32 gu32FlushedJoinReqSize;
u32 gu32FlushedInfoElemAsocSize;
struct host_if_drv *gu8FlushedJoinReqDrvHandler;
@@ -1100,7 +1100,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
u32WidsCount++;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
- gu8FlushedAuthType = (u8)hif_drv->strWILC_UsrConnReq.tenuAuth_type;
+ auth_type = (u8)hif_drv->strWILC_UsrConnReq.tenuAuth_type;
PRINT_INFO(HOSTINF_DBG, "Authentication Type = %x\n", hif_drv->strWILC_UsrConnReq.tenuAuth_type);
PRINT_D(HOSTINF_DBG, "Connecting to network of SSID %s on channel %d\n",
@@ -1317,7 +1317,7 @@ static s32 Handle_FlushConnect(struct host_if_drv *hif_drv)
strWIDList[u32WidsCount].id = (u16)WID_AUTH_TYPE;
strWIDList[u32WidsCount].type = WID_CHAR;
strWIDList[u32WidsCount].size = sizeof(char);
- strWIDList[u32WidsCount].val = (s8 *)(&gu8FlushedAuthType);
+ strWIDList[u32WidsCount].val = (s8 *)(&auth_type);
u32WidsCount++;
strWIDList[u32WidsCount].id = (u16)WID_JOIN_REQ_EXTENDED;
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gs8SetIP to set_ip
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index c9126d0..7e436fb 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -256,7 +256,7 @@ static bool scan_while_connected;
static s8 rssi;
static s8 link_speed;
static u8 ch_no;
-static u8 gs8SetIP[2][4];
+static u8 set_ip[2][4];
static u8 gs8GetIP[2][4];
static u32 gu32InactiveTime;
static u8 gu8DelBcn;
@@ -417,7 +417,7 @@ s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
PRINT_INFO(HOSTINF_DBG, "Indx = %d, Handling set IP = %pI4\n", idx, pu8IPAddr);
- memcpy(gs8SetIP[idx], pu8IPAddr, IP_ALEN);
+ memcpy(set_ip[idx], pu8IPAddr, IP_ALEN);
strWID.id = (u16)WID_IP_ADDRESS;
strWID.type = WID_STR;
@@ -460,8 +460,8 @@ s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
kfree(strWID.val);
- if (memcmp(gs8GetIP[idx], gs8SetIP[idx], IP_ALEN) != 0)
- host_int_setup_ipaddress(hif_drv, gs8SetIP[idx], idx);
+ if (memcmp(gs8GetIP[idx], set_ip[idx], IP_ALEN) != 0)
+ host_int_setup_ipaddress(hif_drv, set_ip[idx], idx);
if (s32Error != 0) {
PRINT_ER("Failed to get IP address\n");
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gu32FlushedJoinReqSize to join_req_size
to avoid CamelCase naming convention.
Add to static because follow warning reported by kbuild system.
- drivers/staging/wilc1000/host_interface.c:268:5: sparse: symbol
'join_req_size' was not declared. Should it be static?
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index f06280b..f41a365 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -265,7 +265,7 @@ static u8 *join_req;
static u8 *info_element;
static u8 mode_11i;
static u8 auth_type;
-u32 gu32FlushedJoinReqSize;
+static u32 join_req_size;
u32 gu32FlushedInfoElemAsocSize;
struct host_if_drv *gu8FlushedJoinReqDrvHandler;
#define REAL_JOIN_REQ 0
@@ -1112,8 +1112,8 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
strWIDList[u32WidsCount].val = kmalloc(strWIDList[u32WidsCount].size, GFP_KERNEL);
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
- gu32FlushedJoinReqSize = strWIDList[u32WidsCount].size;
- join_req = kmalloc(gu32FlushedJoinReqSize, GFP_KERNEL);
+ join_req_size = strWIDList[u32WidsCount].size;
+ join_req = kmalloc(join_req_size, GFP_KERNEL);
}
if (strWIDList[u32WidsCount].val == NULL) {
s32Error = -EFAULT;
@@ -1210,7 +1210,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
u32WidsCount++;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
- memcpy(join_req, pu8CurrByte, gu32FlushedJoinReqSize);
+ memcpy(join_req, pu8CurrByte, join_req_size);
gu8FlushedJoinReqDrvHandler = hif_drv;
}
@@ -1322,7 +1322,7 @@ static s32 Handle_FlushConnect(struct host_if_drv *hif_drv)
strWIDList[u32WidsCount].id = (u16)WID_JOIN_REQ_EXTENDED;
strWIDList[u32WidsCount].type = WID_STR;
- strWIDList[u32WidsCount].size = gu32FlushedJoinReqSize;
+ strWIDList[u32WidsCount].size = join_req_size;
strWIDList[u32WidsCount].val = (s8 *)join_req;
pu8CurrByte = strWIDList[u32WidsCount].val;
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gs8lnkspd to link_speed.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index eda6382..2648e43 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -254,7 +254,7 @@ static u8 rcv_assoc_resp[MAX_ASSOC_RESP_FRAME_SIZE];
static bool scan_while_connected;
static s8 rssi;
-static s8 gs8lnkspd;
+static s8 link_speed;
static u8 gu8Chnl;
static u8 gs8SetIP[2][4];
static u8 gs8GetIP[2][4];
@@ -2188,11 +2188,11 @@ static void Handle_GetLinkspeed(struct host_if_drv *hif_drv)
s32 s32Error = 0;
struct wid strWID;
- gs8lnkspd = 0;
+ link_speed = 0;
strWID.id = (u16)WID_LINKSPEED;
strWID.type = WID_CHAR;
- strWID.val = &gs8lnkspd;
+ strWID.val = &link_speed;
strWID.size = sizeof(char);
PRINT_D(HOSTINF_DBG, "Getting LINKSPEED value\n");
@@ -3971,9 +3971,7 @@ s32 host_int_get_link_speed(struct host_if_drv *hif_drv, s8 *ps8lnkspd)
return -EFAULT;
}
-
- *ps8lnkspd = gs8lnkspd;
-
+ *ps8lnkspd = link_speed;
return s32Error;
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gapu8RcvdAssocResp to rcv_assoc_resp
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 8c529d1..5112aee 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -249,7 +249,7 @@ static struct timer_list periodic_rssi;
u8 gau8MulticastMacAddrList[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN];
-static u8 gapu8RcvdAssocResp[MAX_ASSOC_RESP_FRAME_SIZE];
+static u8 rcv_assoc_resp[MAX_ASSOC_RESP_FRAME_SIZE];
bool gbScanWhileConnected;
@@ -1567,10 +1567,10 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
memset(&strConnectInfo, 0, sizeof(tstrConnectInfo));
if (u8MacStatus == MAC_CONNECTED) {
- memset(gapu8RcvdAssocResp, 0, MAX_ASSOC_RESP_FRAME_SIZE);
+ memset(rcv_assoc_resp, 0, MAX_ASSOC_RESP_FRAME_SIZE);
host_int_get_assoc_res_info(hif_drv,
- gapu8RcvdAssocResp,
+ rcv_assoc_resp,
MAX_ASSOC_RESP_FRAME_SIZE,
&u32RcvdAssocRespInfoLen);
@@ -1579,7 +1579,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
if (u32RcvdAssocRespInfoLen != 0) {
PRINT_D(HOSTINF_DBG, "Parsing association response\n");
- s32Err = ParseAssocRespInfo(gapu8RcvdAssocResp, u32RcvdAssocRespInfoLen,
+ s32Err = ParseAssocRespInfo(rcv_assoc_resp, u32RcvdAssocRespInfoLen,
&pstrConnectRespInfo);
if (s32Err) {
PRINT_ER("ParseAssocRespInfo() returned error %d\n", s32Err);
--
1.9.1
From: Leo Kim <[email protected]>
This patch move variable 'FALSE_FRMWR_CHANNEL' to local define position.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 5006f5d..02c9763 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -60,6 +60,7 @@ extern u8 g_wilc_initialized;
#define BA_SESSION_DEFAULT_BUFFER_SIZE 16
#define BA_SESSION_DEFAULT_TIMEOUT 1000
#define BLOCK_ACK_REQ_SIZE 0x14
+#define FALSE_FRMWR_CHANNEL 100
struct cfg_param_attr {
struct cfg_param_val cfg_attr_info;
@@ -2655,7 +2656,6 @@ static int Handle_RegisterFrame(struct host_if_drv *hif_drv,
return result;
}
-#define FALSE_FRMWR_CHANNEL 100
static u32 Handle_ListenStateExpired(struct host_if_drv *hif_drv,
struct remain_ch *pstrHostIfRemainOnChan)
{
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames u8Count of struct join_bss_param to cnt
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 07c5213..e8a35d3 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -222,7 +222,7 @@ struct join_bss_param {
u8 noa_enabled;
u8 opp_enabled;
u8 ct_window;
- u8 u8Count;
+ u8 cnt;
u8 u8Index;
u8 au8Duration[4];
u8 au8Interval[4];
@@ -1200,7 +1200,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
if (ptstrJoinBssParam->opp_enabled)
*(pu8CurrByte++) = ptstrJoinBssParam->ct_window;
- *(pu8CurrByte++) = ptstrJoinBssParam->u8Count;
+ *(pu8CurrByte++) = ptstrJoinBssParam->cnt;
memcpy(pu8CurrByte, ptstrJoinBssParam->au8Duration, sizeof(ptstrJoinBssParam->au8Duration));
@@ -4997,7 +4997,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
for (i = 0; i < pu8IEs[index + 7]; i++)
PRINT_D(GENERIC_DBG, " %x\n", pu8IEs[index + 9 + i]);
- pNewJoinBssParam->u8Count = pu8IEs[index + 11];
+ pNewJoinBssParam->cnt = pu8IEs[index + 11];
u16P2P_count = index + 12;
memcpy(pNewJoinBssParam->au8Duration, pu8IEs + u16P2P_count, 4);
--
1.9.1
From: Leo Kim <[email protected]>
This patch move static variable clients_count to local variable position.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[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 e6c4da3..5006f5d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -260,6 +260,7 @@ static u8 set_ip[2][4];
static u8 get_ip[2][4];
static u32 inactive_time;
static u8 del_beacon;
+static u32 clients_count;
static u8 *join_req;
static u8 *info_element;
@@ -4175,8 +4176,6 @@ void host_int_send_network_info_to_host
{
}
-static u32 clients_count;
-
s32 host_int_init(struct host_if_drv **hif_drv_handler)
{
s32 result = 0;
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gs8GetIP to get_ip
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 7e436fb..59cbf90 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -257,7 +257,7 @@ static s8 rssi;
static s8 link_speed;
static u8 ch_no;
static u8 set_ip[2][4];
-static u8 gs8GetIP[2][4];
+static u8 get_ip[2][4];
static u32 gu32InactiveTime;
static u8 gu8DelBcn;
static u32 gu32WidConnRstHack;
@@ -456,11 +456,11 @@ s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
PRINT_INFO(HOSTINF_DBG, "%pI4\n", strWID.val);
- memcpy(gs8GetIP[idx], strWID.val, IP_ALEN);
+ memcpy(get_ip[idx], strWID.val, IP_ALEN);
kfree(strWID.val);
- if (memcmp(gs8GetIP[idx], set_ip[idx], IP_ALEN) != 0)
+ if (memcmp(get_ip[idx], set_ip[idx], IP_ALEN) != 0)
host_int_setup_ipaddress(hif_drv, set_ip[idx], idx);
if (s32Error != 0) {
@@ -469,7 +469,7 @@ s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
}
PRINT_INFO(HOSTINF_DBG, "IP address retrieved:: u8IfIdx = %d\n", idx);
- PRINT_INFO(HOSTINF_DBG, "%pI4\n", gs8GetIP[idx]);
+ PRINT_INFO(HOSTINF_DBG, "%pI4\n", get_ip[idx]);
PRINT_INFO(HOSTINF_DBG, "\n");
return s32Error;
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames u8OppEnable of struct join_bss_param to opp_enabled
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 2b8e412..91e7072 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -220,7 +220,7 @@ struct join_bss_param {
u8 rsn_cap[2];
u32 tsf;
u8 noa_enabled;
- u8 u8OppEnable;
+ u8 opp_enabled;
u8 u8CtWindow;
u8 u8Count;
u8 u8Index;
@@ -1195,10 +1195,9 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
*(pu8CurrByte++) = ((ptstrJoinBssParam->tsf) >> 24) & 0xFF;
*(pu8CurrByte++) = ptstrJoinBssParam->u8Index;
+ *(pu8CurrByte++) = ptstrJoinBssParam->opp_enabled;
- *(pu8CurrByte++) = ptstrJoinBssParam->u8OppEnable;
-
- if (ptstrJoinBssParam->u8OppEnable)
+ if (ptstrJoinBssParam->opp_enabled)
*(pu8CurrByte++) = ptstrJoinBssParam->u8CtWindow;
*(pu8CurrByte++) = ptstrJoinBssParam->u8Count;
@@ -4988,10 +4987,11 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
pNewJoinBssParam->u8Index = pu8IEs[index + 9];
if (pu8IEs[index + 10] & BIT(7)) {
- pNewJoinBssParam->u8OppEnable = 1;
+ pNewJoinBssParam->opp_enabled = 1;
pNewJoinBssParam->u8CtWindow = pu8IEs[index + 10];
- } else
- pNewJoinBssParam->u8OppEnable = 0;
+ } else {
+ pNewJoinBssParam->opp_enabled = 0;
+ }
PRINT_D(GENERIC_DBG, "P2P Dump\n");
for (i = 0; i < pu8IEs[index + 7]; i++)
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable s32Error to result
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 784 ++++++++++++++----------------
1 file changed, 371 insertions(+), 413 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 0b3c991..e6c4da3 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -330,8 +330,7 @@ static struct host_if_drv *get_handler_from_id(int id)
static s32 Handle_SetChannel(struct host_if_drv *hif_drv,
struct channel_attr *pstrHostIFSetChan)
{
-
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
strWID.id = (u16)WID_CURRENT_CHANNEL;
@@ -341,21 +340,21 @@ static s32 Handle_SetChannel(struct host_if_drv *hif_drv,
PRINT_D(HOSTINF_DBG, "Setting channel\n");
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error) {
+
+ if (result) {
PRINT_ER("Failed to set channel\n");
return -EINVAL;
}
- return s32Error;
+ return result;
}
static s32 Handle_SetWfiDrvHandler(struct host_if_drv *hif_drv,
struct drv_handler *pstrHostIfSetDrvHandler)
{
-
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
strWID.id = (u16)WID_SET_DRV_HANDLER;
@@ -363,25 +362,24 @@ static s32 Handle_SetWfiDrvHandler(struct host_if_drv *hif_drv,
strWID.val = (s8 *)&(pstrHostIfSetDrvHandler->u32Address);
strWID.size = sizeof(u32);
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
pstrHostIfSetDrvHandler->u32Address);
if (!hif_drv)
up(&hif_sema_driver);
- if (s32Error) {
+ if (result) {
PRINT_ER("Failed to set driver handler\n");
return -EINVAL;
}
- return s32Error;
+ return result;
}
static s32 Handle_SetOperationMode(struct host_if_drv *hif_drv,
struct op_mode *pstrHostIfSetOperationMode)
{
-
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
strWID.id = (u16)WID_SET_OPERATION_MODE;
@@ -389,25 +387,23 @@ static s32 Handle_SetOperationMode(struct host_if_drv *hif_drv,
strWID.val = (s8 *)&(pstrHostIfSetOperationMode->u32Mode);
strWID.size = sizeof(u32);
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
-
if ((pstrHostIfSetOperationMode->u32Mode) == IDLE_MODE)
up(&hif_sema_driver);
- if (s32Error) {
+ if (result) {
PRINT_ER("Failed to set driver handler\n");
return -EINVAL;
}
- return s32Error;
+ return result;
}
s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
{
-
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
char firmwareIPAddress[4] = {0};
@@ -423,26 +419,24 @@ s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
strWID.val = (u8 *)pu8IPAddr;
strWID.size = IP_ALEN;
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
-
host_int_get_ipaddress(hif_drv, firmwareIPAddress, idx);
- if (s32Error) {
+ if (result) {
PRINT_ER("Failed to set IP address\n");
return -EINVAL;
}
PRINT_INFO(HOSTINF_DBG, "IP address set\n");
- return s32Error;
+ return result;
}
s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
{
-
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
strWID.id = (u16)WID_IP_ADDRESS;
@@ -450,7 +444,7 @@ s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
strWID.val = kmalloc(IP_ALEN, GFP_KERNEL);
strWID.size = IP_ALEN;
- s32Error = send_config_pkt(GET_CFG, &strWID, 1,
+ result = send_config_pkt(GET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
PRINT_INFO(HOSTINF_DBG, "%pI4\n", strWID.val);
@@ -462,7 +456,7 @@ s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
if (memcmp(get_ip[idx], set_ip[idx], IP_ALEN) != 0)
host_int_setup_ipaddress(hif_drv, set_ip[idx], idx);
- if (s32Error != 0) {
+ if (result != 0) {
PRINT_ER("Failed to get IP address\n");
return -EINVAL;
}
@@ -471,14 +465,13 @@ s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
PRINT_INFO(HOSTINF_DBG, "%pI4\n", get_ip[idx]);
PRINT_INFO(HOSTINF_DBG, "\n");
- return s32Error;
+ return result;
}
static s32 Handle_SetMacAddress(struct host_if_drv *hif_drv,
struct set_mac_addr *pstrHostIfSetMacAddress)
{
-
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
u8 *mac_buf = kmalloc(ETH_ALEN, GFP_KERNEL);
@@ -494,22 +487,21 @@ static s32 Handle_SetMacAddress(struct host_if_drv *hif_drv,
strWID.size = ETH_ALEN;
PRINT_D(GENERIC_DBG, "mac addr = :%pM\n", strWID.val);
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error) {
+ if (result) {
PRINT_ER("Failed to set mac address\n");
- s32Error = -EFAULT;
+ result = -EFAULT;
}
kfree(mac_buf);
- return s32Error;
+ return result;
}
static s32 Handle_GetMacAddress(struct host_if_drv *hif_drv,
struct get_mac_addr *pstrHostIfGetMacAddress)
{
-
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
strWID.id = (u16)WID_MAC_ADDR;
@@ -517,21 +509,22 @@ static s32 Handle_GetMacAddress(struct host_if_drv *hif_drv,
strWID.val = pstrHostIfGetMacAddress->u8MacAddress;
strWID.size = ETH_ALEN;
- s32Error = send_config_pkt(GET_CFG, &strWID, 1,
+ result = send_config_pkt(GET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error) {
+
+ if (result) {
PRINT_ER("Failed to get mac address\n");
- s32Error = -EFAULT;
+ result = -EFAULT;
}
up(&hif_sema_wait_response);
- return s32Error;
+ return result;
}
static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
struct cfg_param_attr *strHostIFCfgParamAttr)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWIDList[32];
u8 u8WidCnt = 0;
@@ -549,7 +542,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.bss_type = (u8)strHostIFCfgParamAttr->cfg_attr_info.bss_type;
} else {
PRINT_ER("check value 6 over\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -563,7 +556,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.auth_type = (u8)strHostIFCfgParamAttr->cfg_attr_info.auth_type;
} else {
PRINT_ER("Impossible value \n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -577,7 +570,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.auth_timeout = strHostIFCfgParamAttr->cfg_attr_info.auth_timeout;
} else {
PRINT_ER("Range(1 ~ 65535) over\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -591,7 +584,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.power_mgmt_mode = (u8)strHostIFCfgParamAttr->cfg_attr_info.power_mgmt_mode;
} else {
PRINT_ER("Invalide power mode\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -605,7 +598,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.short_retry_limit = strHostIFCfgParamAttr->cfg_attr_info.short_retry_limit;
} else {
PRINT_ER("Range(1~256) over\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -620,7 +613,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.long_retry_limit = strHostIFCfgParamAttr->cfg_attr_info.long_retry_limit;
} else {
PRINT_ER("Range(1~256) over\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -635,7 +628,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.frag_threshold = strHostIFCfgParamAttr->cfg_attr_info.frag_threshold;
} else {
PRINT_ER("Threshold Range fail\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -649,7 +642,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.rts_threshold = strHostIFCfgParamAttr->cfg_attr_info.rts_threshold;
} else {
PRINT_ER("Threshold Range fail\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -663,7 +656,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.preamble_type = strHostIFCfgParamAttr->cfg_attr_info.preamble_type;
} else {
PRINT_ER("Preamle Range(0~2) over\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -677,7 +670,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.short_slot_allowed = (u8)strHostIFCfgParamAttr->cfg_attr_info.short_slot_allowed;
} else {
PRINT_ER("Short slot(2) over\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -691,7 +684,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.txop_prot_disabled = (u8)strHostIFCfgParamAttr->cfg_attr_info.txop_prot_disabled;
} else {
PRINT_ER("TXOP prot disable\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -705,7 +698,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.beacon_interval = strHostIFCfgParamAttr->cfg_attr_info.beacon_interval;
} else {
PRINT_ER("Beacon interval(1~65535) fail\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -719,7 +712,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.dtim_period = strHostIFCfgParamAttr->cfg_attr_info.dtim_period;
} else {
PRINT_ER("DTIM range(1~255) fail\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -733,7 +726,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.site_survey_enabled = (u8)strHostIFCfgParamAttr->cfg_attr_info.site_survey_enabled;
} else {
PRINT_ER("Site survey disable\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -747,7 +740,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.site_survey_scan_time = strHostIFCfgParamAttr->cfg_attr_info.site_survey_scan_time;
} else {
PRINT_ER("Site survey scan time(1~65535) over\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -761,7 +754,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.active_scan_time = strHostIFCfgParamAttr->cfg_attr_info.active_scan_time;
} else {
PRINT_ER("Active scan time(1~65535) over\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -775,7 +768,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.passive_scan_time = strHostIFCfgParamAttr->cfg_attr_info.passive_scan_time;
} else {
PRINT_ER("Passive scan time(1~65535) over\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
@@ -795,20 +788,21 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
hif_drv->strCfgValues.curr_tx_rate = (u8)curr_tx_rate;
} else {
PRINT_ER("out of TX rate\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto ERRORHANDLER;
}
u8WidCnt++;
}
- s32Error = send_config_pkt(SET_CFG, strWIDList, u8WidCnt,
+
+ result = send_config_pkt(SET_CFG, strWIDList, u8WidCnt,
get_id_from_handler(hif_drv));
- if (s32Error)
+ if (result)
PRINT_ER("Error in setting CFG params\n");
ERRORHANDLER:
up(&hif_drv->gtOsCfgValuesSem);
- return s32Error;
+ return result;
}
static s32 Handle_wait_msg_q_empty(void)
@@ -821,7 +815,7 @@ static s32 Handle_wait_msg_q_empty(void)
static s32 Handle_Scan(struct host_if_drv *hif_drv,
struct scan_attr *pstrHostIFscanAttr)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWIDList[5];
u32 u32WidsCount = 0;
u32 i;
@@ -838,14 +832,14 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
if ((hif_drv->enuHostIFstate >= HOST_IF_SCANNING) && (hif_drv->enuHostIFstate < HOST_IF_CONNECTED)) {
PRINT_D(GENERIC_DBG, "Don't scan we are already in [%d] state\n", hif_drv->enuHostIFstate);
PRINT_ER("Already scan\n");
- s32Error = -EBUSY;
+ result = -EBUSY;
goto ERRORHANDLER;
}
if (g_obtainingIP || connecting) {
PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until IP adresss is obtained\n");
PRINT_ER("Don't do obss scan\n");
- s32Error = -EBUSY;
+ result = -EBUSY;
goto ERRORHANDLER;
}
@@ -921,16 +915,16 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
else if (hif_drv->enuHostIFstate == HOST_IF_IDLE)
scan_while_connected = false;
- s32Error = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
+ result = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
get_id_from_handler(hif_drv));
- if (s32Error)
+ if (result)
PRINT_ER("Failed to send scan paramters config packet\n");
else
PRINT_D(HOSTINF_DBG, "Successfully sent SCAN params config packet\n");
ERRORHANDLER:
- if (s32Error) {
+ if (result) {
del_timer(&hif_drv->hScanTimer);
Handle_ScanDone(hif_drv, SCAN_EVENT_ABORTED);
}
@@ -952,13 +946,13 @@ ERRORHANDLER:
if (pu8HdnNtwrksWidVal != NULL)
kfree(pu8HdnNtwrksWidVal);
- return s32Error;
+ return result;
}
static s32 Handle_ScanDone(struct host_if_drv *hif_drv,
enum scan_event enuEvent)
{
- s32 s32Error = 0;
+ s32 result = 0;
u8 u8abort_running_scan;
struct wid strWID;
@@ -973,17 +967,18 @@ static s32 Handle_ScanDone(struct host_if_drv *hif_drv,
strWID.val = (s8 *)&u8abort_running_scan;
strWID.size = sizeof(char);
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error) {
+
+ if (result) {
PRINT_ER("Failed to set abort running scan\n");
- s32Error = -EFAULT;
+ result = -EFAULT;
}
}
if (!hif_drv) {
PRINT_ER("Driver handler is NULL\n");
- return s32Error;
+ return result;
}
if (hif_drv->strWILC_UsrScanReq.pfUserScanResult) {
@@ -992,14 +987,14 @@ static s32 Handle_ScanDone(struct host_if_drv *hif_drv,
hif_drv->strWILC_UsrScanReq.pfUserScanResult = NULL;
}
- return s32Error;
+ return result;
}
u8 u8ConnectedSSID[6] = {0};
static s32 Handle_Connect(struct host_if_drv *hif_drv,
struct connect_attr *pstrHostIFconnectAttr)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWIDList[8];
u32 u32WidsCount = 0, dummyval = 0;
u8 *pu8CurrByte = NULL;
@@ -1008,10 +1003,9 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
PRINT_D(GENERIC_DBG, "Handling connect request\n");
if (memcmp(pstrHostIFconnectAttr->bssid, u8ConnectedSSID, ETH_ALEN) == 0) {
-
- s32Error = 0;
+ result = 0;
PRINT_ER("Trying to connect to an already connected AP, Discard connect request\n");
- return s32Error;
+ return result;
}
PRINT_INFO(HOSTINF_DBG, "Saving connection parameters in global structure\n");
@@ -1019,7 +1013,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
ptstrJoinBssParam = (struct join_bss_param *)pstrHostIFconnectAttr->params;
if (ptstrJoinBssParam == NULL) {
PRINT_ER("Required BSSID not found\n");
- s32Error = -ENOENT;
+ result = -ENOENT;
goto ERRORHANDLER;
}
@@ -1115,7 +1109,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
join_req = kmalloc(join_req_size, GFP_KERNEL);
}
if (strWIDList[u32WidsCount].val == NULL) {
- s32Error = -EFAULT;
+ result = -EFAULT;
goto ERRORHANDLER;
}
@@ -1222,11 +1216,11 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
PRINT_D(GENERIC_DBG, "save bssid = %pM\n", u8ConnectedSSID);
}
- s32Error = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
+ result = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
get_id_from_handler(hif_drv));
- if (s32Error) {
+ if (result) {
PRINT_ER("failed to send config packet\n");
- s32Error = -EFAULT;
+ result = -EFAULT;
goto ERRORHANDLER;
} else {
PRINT_D(GENERIC_DBG, "set HOST_IF_WAITING_CONN_RESP\n");
@@ -1234,7 +1228,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
}
ERRORHANDLER:
- if (s32Error) {
+ if (result) {
tstrConnectInfo strConnectInfo;
del_timer(&hif_drv->hConnectTimer);
@@ -1289,12 +1283,13 @@ ERRORHANDLER:
if (pu8CurrByte != NULL)
kfree(pu8CurrByte);
- return s32Error;
+
+ return result;
}
static s32 Handle_FlushConnect(struct host_if_drv *hif_drv)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWIDList[5];
u32 u32WidsCount = 0;
u8 *pu8CurrByte = NULL;
@@ -1330,26 +1325,26 @@ static s32 Handle_FlushConnect(struct host_if_drv *hif_drv)
u32WidsCount++;
- s32Error = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
+ result = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
get_id_from_handler(join_req_drv));
- if (s32Error) {
+ if (result) {
PRINT_ER("failed to send config packet\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
}
- return s32Error;
+ return result;
}
static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
{
- s32 s32Error = 0;
+ s32 result = 0;
tstrConnectInfo strConnectInfo;
struct wid strWID;
u16 u16DummyReasonCode = 0;
if (!hif_drv) {
PRINT_ER("Driver handler is NULL\n");
- return s32Error;
+ return result;
}
hif_drv->enuHostIFstate = HOST_IF_IDLE;
@@ -1393,9 +1388,9 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
PRINT_D(HOSTINF_DBG, "Sending disconnect request\n");
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error)
+ if (result)
PRINT_ER("Failed to send dissconect config packet\n");
hif_drv->strWILC_UsrConnReq.ssidLen = 0;
@@ -1416,7 +1411,7 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
info_element = NULL;
}
- return s32Error;
+ return result;
}
static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,
@@ -1424,10 +1419,7 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,
{
u32 i;
bool bNewNtwrkFound;
-
-
-
- s32 s32Error = 0;
+ s32 result = 0;
tstrNetworkInfo *pstrNetworkInfo = NULL;
void *pJoinParams = NULL;
@@ -1440,7 +1432,7 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,
if ((pstrNetworkInfo == NULL)
|| (hif_drv->strWILC_UsrScanReq.pfUserScanResult == NULL)) {
PRINT_ER("driver is null\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
goto done;
}
@@ -1505,13 +1497,13 @@ done:
pstrNetworkInfo = NULL;
}
- return s32Error;
+ return result;
}
static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
struct rcvd_async_info *pstrRcvdGnrlAsyncInfo)
{
- s32 s32Error = 0;
+ s32 result = 0;
u8 u8MsgType = 0;
u8 u8MsgID = 0;
u16 u16MsgLen = 0;
@@ -1741,13 +1733,13 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
pstrRcvdGnrlAsyncInfo->buffer = NULL;
}
- return s32Error;
+ return result;
}
static int Handle_Key(struct host_if_drv *hif_drv,
struct key_attr *pstrHostIFkeyAttr)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
struct wid strWIDList[5];
u8 i;
@@ -1797,8 +1789,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
strWIDList[3].size = pstrHostIFkeyAttr->attr.wep.key_len;
strWIDList[3].val = (s8 *)pu8keybuf;
-
- s32Error = send_config_pkt(SET_CFG, strWIDList, 4,
+ result = send_config_pkt(SET_CFG, strWIDList, 4,
get_id_from_handler(hif_drv));
kfree(pu8keybuf);
@@ -1823,7 +1814,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
strWID.val = (s8 *)pu8keybuf;
strWID.size = pstrHostIFkeyAttr->attr.wep.key_len + 2;
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
kfree(pu8keybuf);
} else if (pstrHostIFkeyAttr->action & REMOVEKEY) {
@@ -1836,7 +1827,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
strWID.val = s8idxarray;
strWID.size = 1;
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
} else {
strWID.id = (u16)WID_KEY_ID;
@@ -1846,7 +1837,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
PRINT_D(HOSTINF_DBG, "Setting default key index\n");
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
}
up(&hif_drv->hSemTestKeyBlock);
@@ -1879,7 +1870,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
strWIDList[1].val = (s8 *)pu8keybuf;
strWIDList[1].size = RX_MIC_KEY_MSG_LEN;
- s32Error = send_config_pkt(SET_CFG, strWIDList, 2,
+ result = send_config_pkt(SET_CFG, strWIDList, 2,
get_id_from_handler(hif_drv));
kfree(pu8keybuf);
@@ -1912,7 +1903,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
strWID.val = (s8 *)pu8keybuf;
strWID.size = RX_MIC_KEY_MSG_LEN;
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
kfree(pu8keybuf);
@@ -1957,7 +1948,7 @@ _WPARxGtk_end_case_:
strWIDList[1].val = (s8 *)pu8keybuf;
strWIDList[1].size = PTK_KEY_MSG_LEN + 1;
- s32Error = send_config_pkt(SET_CFG, strWIDList, 2,
+ result = send_config_pkt(SET_CFG, strWIDList, 2,
get_id_from_handler(hif_drv));
kfree(pu8keybuf);
up(&hif_drv->hSemTestKeyBlock);
@@ -1986,7 +1977,7 @@ _WPARxGtk_end_case_:
strWID.val = (s8 *)pu8keybuf;
strWID.size = PTK_KEY_MSG_LEN;
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
kfree(pu8keybuf);
up(&hif_drv->hSemTestKeyBlock);
@@ -2022,25 +2013,24 @@ _WPAPtk_end_case_:
strWID.val = (s8 *)pu8keybuf;
strWID.size = (pstrHostIFkeyAttr->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1;
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
kfree(pu8keybuf);
break;
}
- if (s32Error)
+ if (result)
PRINT_ER("Failed to send key config packet\n");
-
- return s32Error;
+ return result;
}
static void Handle_Disconnect(struct host_if_drv *hif_drv)
{
struct wid strWID;
- s32 s32Error = 0;
+ s32 result = 0;
u16 u16DummyReasonCode = 0;
strWID.id = (u16)WID_DISCONNECT;
@@ -2057,10 +2047,10 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
eth_zero_addr(u8ConnectedSSID);
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error) {
+ if (result) {
PRINT_ER("Failed to send dissconect config packet\n");
} else {
tstrDisconnectNotifInfo strDisconnectNotifInfo;
@@ -2131,8 +2121,7 @@ void resolve_disconnect_aberration(struct host_if_drv *hif_drv)
static s32 Handle_GetChnl(struct host_if_drv *hif_drv)
{
-
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
strWID.id = (u16)WID_CURRENT_CHANNEL;
@@ -2142,25 +2131,22 @@ static s32 Handle_GetChnl(struct host_if_drv *hif_drv)
PRINT_D(HOSTINF_DBG, "Getting channel value\n");
- s32Error = send_config_pkt(GET_CFG, &strWID, 1,
+ result = send_config_pkt(GET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error) {
+ if (result) {
PRINT_ER("Failed to get channel number\n");
- s32Error = -EFAULT;
+ result = -EFAULT;
}
up(&hif_drv->hSemGetCHNL);
- return s32Error;
-
-
-
+ return result;
}
static void Handle_GetRssi(struct host_if_drv *hif_drv)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
strWID.id = (u16)WID_RSSI;
@@ -2170,11 +2156,11 @@ static void Handle_GetRssi(struct host_if_drv *hif_drv)
PRINT_D(HOSTINF_DBG, "Getting RSSI value\n");
- s32Error = send_config_pkt(GET_CFG, &strWID, 1,
+ result = send_config_pkt(GET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error) {
+ if (result) {
PRINT_ER("Failed to get RSSI value\n");
- s32Error = -EFAULT;
+ result = -EFAULT;
}
up(&hif_drv->hSemGetRSSI);
@@ -2185,7 +2171,7 @@ static void Handle_GetRssi(struct host_if_drv *hif_drv)
static void Handle_GetLinkspeed(struct host_if_drv *hif_drv)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
link_speed = 0;
@@ -2197,11 +2183,11 @@ static void Handle_GetLinkspeed(struct host_if_drv *hif_drv)
PRINT_D(HOSTINF_DBG, "Getting LINKSPEED value\n");
- s32Error = send_config_pkt(GET_CFG, &strWID, 1,
+ result = send_config_pkt(GET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error) {
+ if (result) {
PRINT_ER("Failed to get LINKSPEED value\n");
- s32Error = -EFAULT;
+ result = -EFAULT;
}
up(&(hif_drv->hSemGetLINKSPEED));
@@ -2212,7 +2198,7 @@ static void Handle_GetLinkspeed(struct host_if_drv *hif_drv)
s32 Handle_GetStatistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatistics)
{
struct wid strWIDList[5];
- u32 u32WidsCount = 0, s32Error = 0;
+ u32 u32WidsCount = 0, result = 0;
strWIDList[u32WidsCount].id = WID_LINKSPEED;
strWIDList[u32WidsCount].type = WID_CHAR;
@@ -2244,10 +2230,10 @@ s32 Handle_GetStatistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatis
strWIDList[u32WidsCount].val = (s8 *)(&(pstrStatistics->u32TxFailureCount));
u32WidsCount++;
- s32Error = send_config_pkt(GET_CFG, strWIDList, u32WidsCount,
+ result = send_config_pkt(GET_CFG, strWIDList, u32WidsCount,
get_id_from_handler(hif_drv));
- if (s32Error)
+ if (result)
PRINT_ER("Failed to send scan paramters config packet\n");
up(&hif_sema_wait_response);
@@ -2258,8 +2244,7 @@ s32 Handle_GetStatistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatis
static s32 Handle_Get_InActiveTime(struct host_if_drv *hif_drv,
struct sta_inactive_t *strHostIfStaInactiveT)
{
-
- s32 s32Error = 0;
+ s32 result = 0;
u8 *stamac;
struct wid strWID;
@@ -2275,11 +2260,10 @@ static s32 Handle_Get_InActiveTime(struct host_if_drv *hif_drv,
PRINT_D(CFG80211_DBG, "SETING STA inactive time\n");
-
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error) {
+ if (result) {
PRINT_ER("Failed to SET incative time\n");
return -EFAULT;
}
@@ -2290,11 +2274,10 @@ static s32 Handle_Get_InActiveTime(struct host_if_drv *hif_drv,
strWID.val = (s8 *)&inactive_time;
strWID.size = sizeof(u32);
-
- s32Error = send_config_pkt(GET_CFG, &strWID, 1,
+ result = send_config_pkt(GET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error) {
+ if (result) {
PRINT_ER("Failed to get incative time\n");
return -EFAULT;
}
@@ -2303,16 +2286,13 @@ static s32 Handle_Get_InActiveTime(struct host_if_drv *hif_drv,
up(&hif_drv->hSemInactiveTime);
- return s32Error;
-
-
-
+ return result;
}
static void Handle_AddBeacon(struct host_if_drv *hif_drv,
struct beacon_attr *pstrSetBeaconParam)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
u8 *pu8CurrByte;
@@ -2353,9 +2333,9 @@ static void Handle_AddBeacon(struct host_if_drv *hif_drv,
memcpy(pu8CurrByte, pstrSetBeaconParam->tail, pstrSetBeaconParam->tail_len);
pu8CurrByte += pstrSetBeaconParam->tail_len;
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error)
+ if (result)
PRINT_ER("Failed to send add beacon config packet\n");
ERRORHANDLER:
@@ -2366,7 +2346,7 @@ ERRORHANDLER:
static void Handle_DelBeacon(struct host_if_drv *hif_drv)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
u8 *pu8CurrByte;
@@ -2382,9 +2362,9 @@ static void Handle_DelBeacon(struct host_if_drv *hif_drv)
PRINT_D(HOSTINF_DBG, "Deleting BEACON\n");
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error)
+ if (result)
PRINT_ER("Failed to send delete beacon config packet\n");
}
@@ -2437,7 +2417,7 @@ static u32 WILC_HostIf_PackStaParam(u8 *pu8Buffer,
static void Handle_AddStation(struct host_if_drv *hif_drv,
struct add_sta_param *pstrStationParam)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
u8 *pu8CurrByte;
@@ -2453,9 +2433,9 @@ static void Handle_AddStation(struct host_if_drv *hif_drv,
pu8CurrByte = strWID.val;
pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error != 0)
+ if (result != 0)
PRINT_ER("Failed to send add station config packet\n");
ERRORHANDLER:
@@ -2466,7 +2446,7 @@ ERRORHANDLER:
static void Handle_DelAllSta(struct host_if_drv *hif_drv,
struct del_all_sta *pstrDelAllStaParam)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
u8 *pu8CurrByte;
@@ -2496,9 +2476,9 @@ static void Handle_DelAllSta(struct host_if_drv *hif_drv,
pu8CurrByte += ETH_ALEN;
}
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error)
+ if (result)
PRINT_ER("Failed to send add station config packet\n");
ERRORHANDLER:
@@ -2510,7 +2490,7 @@ ERRORHANDLER:
static void Handle_DelStation(struct host_if_drv *hif_drv,
struct del_sta *pstrDelStaParam)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
u8 *pu8CurrByte;
@@ -2528,9 +2508,9 @@ static void Handle_DelStation(struct host_if_drv *hif_drv,
memcpy(pu8CurrByte, pstrDelStaParam->mac_addr, ETH_ALEN);
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error)
+ if (result)
PRINT_ER("Failed to send add station config packet\n");
ERRORHANDLER:
@@ -2540,7 +2520,7 @@ ERRORHANDLER:
static void Handle_EditStation(struct host_if_drv *hif_drv,
struct add_sta_param *pstrStationParam)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
u8 *pu8CurrByte;
@@ -2556,9 +2536,9 @@ static void Handle_EditStation(struct host_if_drv *hif_drv,
pu8CurrByte = strWID.val;
pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error)
+ if (result)
PRINT_ER("Failed to send edit station config packet\n");
ERRORHANDLER:
@@ -2569,7 +2549,7 @@ ERRORHANDLER:
static int Handle_RemainOnChan(struct host_if_drv *hif_drv,
struct remain_ch *pstrHostIfRemainOnChan)
{
- s32 s32Error = 0;
+ s32 result = 0;
u8 u8remain_on_chan_flag;
struct wid strWID;
@@ -2586,18 +2566,18 @@ static int Handle_RemainOnChan(struct host_if_drv *hif_drv,
if (hif_drv->strWILC_UsrScanReq.pfUserScanResult != NULL) {
PRINT_INFO(GENERIC_DBG, "Required to remain on chan while scanning return\n");
hif_drv->u8RemainOnChan_pendingreq = 1;
- s32Error = -EBUSY;
+ result = -EBUSY;
goto ERRORHANDLER;
}
if (hif_drv->enuHostIFstate == HOST_IF_WAITING_CONN_RESP) {
PRINT_INFO(GENERIC_DBG, "Required to remain on chan while connecting return\n");
- s32Error = -EBUSY;
+ result = -EBUSY;
goto ERRORHANDLER;
}
if (g_obtainingIP || connecting) {
PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until IP adresss is obtained\n");
- s32Error = -EBUSY;
+ result = -EBUSY;
goto ERRORHANDLER;
}
@@ -2610,16 +2590,16 @@ static int Handle_RemainOnChan(struct host_if_drv *hif_drv,
strWID.val = kmalloc(strWID.size, GFP_KERNEL);
if (strWID.val == NULL) {
- s32Error = -ENOMEM;
+ result = -ENOMEM;
goto ERRORHANDLER;
}
strWID.val[0] = u8remain_on_chan_flag;
strWID.val[1] = (s8)pstrHostIfRemainOnChan->u16Channel;
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error != 0)
+ if (result != 0)
PRINT_ER("Failed to set remain on channel\n");
ERRORHANDLER:
@@ -2636,13 +2616,14 @@ ERRORHANDLER:
if (hif_drv->u8RemainOnChan_pendingreq)
hif_drv->u8RemainOnChan_pendingreq = 0;
}
- return s32Error;
+
+ return result;
}
static int Handle_RegisterFrame(struct host_if_drv *hif_drv,
struct reg_frame *pstrHostIfRegisterFrame)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
u8 *pu8CurrByte;
@@ -2663,15 +2644,14 @@ static int Handle_RegisterFrame(struct host_if_drv *hif_drv,
strWID.size = sizeof(u16) + 2;
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error) {
+ if (result) {
PRINT_ER("Failed to frame register config packet\n");
- s32Error = -EINVAL;
+ result = -EINVAL;
}
- return s32Error;
-
+ return result;
}
#define FALSE_FRMWR_CHANNEL 100
@@ -2680,7 +2660,7 @@ static u32 Handle_ListenStateExpired(struct host_if_drv *hif_drv,
{
u8 u8remain_on_chan_flag;
struct wid strWID;
- s32 s32Error = 0;
+ s32 result = 0;
PRINT_D(HOSTINF_DBG, "CANCEL REMAIN ON CHAN\n");
@@ -2697,9 +2677,9 @@ static u32 Handle_ListenStateExpired(struct host_if_drv *hif_drv,
strWID.val[0] = u8remain_on_chan_flag;
strWID.val[1] = FALSE_FRMWR_CHANNEL;
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error != 0) {
+ if (result != 0) {
PRINT_ER("Failed to set remain on channel\n");
goto _done_;
}
@@ -2711,16 +2691,16 @@ static u32 Handle_ListenStateExpired(struct host_if_drv *hif_drv,
P2P_LISTEN_STATE = 0;
} else {
PRINT_D(GENERIC_DBG, "Not in listen state\n");
- s32Error = -EFAULT;
+ result = -EFAULT;
}
_done_:
- return s32Error;
+ return result;
}
static void ListenTimerCB(unsigned long arg)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
struct host_if_drv *hif_drv = (struct host_if_drv *)arg;
@@ -2731,15 +2711,15 @@ static void ListenTimerCB(unsigned long arg)
msg.drv = hif_drv;
msg.body.remain_on_ch.u32ListenSessionID = hif_drv->strHostIfRemainOnChan.u32ListenSessionID;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc_mq_send fail\n");
}
static void Handle_PowerManagement(struct host_if_drv *hif_drv,
struct power_mgmt_param *strPowerMgmtParam)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
s8 s8PowerMode;
@@ -2755,16 +2735,16 @@ static void Handle_PowerManagement(struct host_if_drv *hif_drv,
PRINT_D(HOSTINF_DBG, "Handling Power Management\n");
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error)
+ if (result)
PRINT_ER("Failed to send power management config packet\n");
}
static void Handle_SetMulticastFilter(struct host_if_drv *hif_drv,
struct set_multicast *strHostIfSetMulti)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
u8 *pu8CurrByte;
@@ -2791,9 +2771,9 @@ static void Handle_SetMulticastFilter(struct host_if_drv *hif_drv,
if ((strHostIfSetMulti->cnt) > 0)
memcpy(pu8CurrByte, gau8MulticastMacAddrList, ((strHostIfSetMulti->cnt) * ETH_ALEN));
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error)
+ if (result)
PRINT_ER("Failed to send setup multicast config packet\n");
ERRORHANDLER:
@@ -2804,7 +2784,7 @@ ERRORHANDLER:
static s32 Handle_AddBASession(struct host_if_drv *hif_drv,
struct ba_session_info *strHostIfBASessionInfo)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
int AddbaTimeout = 100;
char *ptr = NULL;
@@ -2838,9 +2818,9 @@ static s32 Handle_AddBASession(struct host_if_drv *hif_drv,
*ptr++ = 8;
*ptr++ = 0;
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error)
+ if (result)
PRINT_D(HOSTINF_DBG, "Couldn't open BA Session\n");
@@ -2858,20 +2838,19 @@ static s32 Handle_AddBASession(struct host_if_drv *hif_drv,
*ptr++ = (strHostIfBASessionInfo->u16BufferSize & 0xFF);
*ptr++ = ((strHostIfBASessionInfo->u16SessionTimeout >> 16) & 0xFF);
*ptr++ = 3;
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
if (strWID.val != NULL)
kfree(strWID.val);
- return s32Error;
-
+ return result;
}
static s32 Handle_DelAllRxBASessions(struct host_if_drv *hif_drv,
struct ba_session_info *strHostIfBASessionInfo)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
char *ptr = NULL;
@@ -2895,9 +2874,9 @@ static s32 Handle_DelAllRxBASessions(struct host_if_drv *hif_drv,
*ptr++ = 0;
*ptr++ = 32;
- s32Error = send_config_pkt(SET_CFG, &strWID, 1,
+ result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error)
+ if (result)
PRINT_D(HOSTINF_DBG, "Couldn't delete BA Session\n");
@@ -2906,8 +2885,7 @@ static s32 Handle_DelAllRxBASessions(struct host_if_drv *hif_drv,
up(&hif_sema_wait_response);
- return s32Error;
-
+ return result;
}
static int hostIFthread(void *pvArg)
@@ -3185,14 +3163,14 @@ int host_int_remove_wep_key(struct host_if_drv *hif_drv, u8 index)
s32 host_int_set_WEPDefaultKeyID(struct host_if_drv *hif_drv, u8 u8Index)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
if (!hif_drv) {
- s32Error = -EFAULT;
+ result = -EFAULT;
PRINT_ER("driver is null\n");
- return s32Error;
+ return result;
}
memset(&msg, 0, sizeof(struct host_if_msg));
@@ -3204,12 +3182,12 @@ s32 host_int_set_WEPDefaultKeyID(struct host_if_drv *hif_drv, u8 u8Index)
msg.drv = hif_drv;
msg.body.key_info.attr.wep.index = u8Index;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("Error in sending message queue : Default key index\n");
down(&hif_drv->hSemTestKeyBlock);
- return s32Error;
+ return result;
}
s32 host_int_add_wep_key_bss_sta(struct host_if_drv *hif_drv,
@@ -3217,14 +3195,13 @@ s32 host_int_add_wep_key_bss_sta(struct host_if_drv *hif_drv,
u8 u8WepKeylen,
u8 u8Keyidx)
{
-
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
if (!hif_drv) {
- s32Error = -EFAULT;
+ result = -EFAULT;
PRINT_ER("driver is null\n");
- return s32Error;
+ return result;
}
memset(&msg, 0, sizeof(struct host_if_msg));
@@ -3239,13 +3216,12 @@ s32 host_int_add_wep_key_bss_sta(struct host_if_drv *hif_drv,
msg.body.key_info.attr.wep.key_len = (u8WepKeylen);
msg.body.key_info.attr.wep.index = u8Keyidx;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("Error in sending message queue :WEP Key\n");
down(&hif_drv->hSemTestKeyBlock);
- return s32Error;
-
+ return result;
}
s32 host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv,
@@ -3255,15 +3231,14 @@ s32 host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv,
u8 u8mode,
enum AUTHTYPE tenuAuth_type)
{
-
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
u8 i;
if (!hif_drv) {
- s32Error = -EFAULT;
+ result = -EFAULT;
PRINT_ER("driver is null\n");
- return s32Error;
+ return result;
}
memset(&msg, 0, sizeof(struct host_if_msg));
@@ -3283,14 +3258,13 @@ s32 host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv,
msg.body.key_info.attr.wep.mode = u8mode;
msg.body.key_info.attr.wep.auth_type = tenuAuth_type;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ if (result)
PRINT_ER("Error in sending message queue :WEP Key\n");
down(&hif_drv->hSemTestKeyBlock);
- return s32Error;
-
+ return result;
}
s32 host_int_add_ptk(struct host_if_drv *hif_drv, const u8 *pu8Ptk,
@@ -3298,15 +3272,15 @@ s32 host_int_add_ptk(struct host_if_drv *hif_drv, const u8 *pu8Ptk,
const u8 *pu8RxMic, const u8 *pu8TxMic,
u8 mode, u8 u8Ciphermode, u8 u8Idx)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
u8 u8KeyLen = u8PtkKeylen;
u32 i;
if (!hif_drv) {
- s32Error = -EFAULT;
+ result = -EFAULT;
PRINT_ER("driver is null\n");
- return s32Error;
+ return result;
}
if (pu8RxMic != NULL)
u8KeyLen += RX_MIC_KEY_LEN;
@@ -3348,14 +3322,14 @@ s32 host_int_add_ptk(struct host_if_drv *hif_drv, const u8 *pu8Ptk,
msg.body.key_info.attr.wpa.mode = u8Ciphermode;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ if (result)
PRINT_ER("Error in sending message queue: PTK Key\n");
down(&hif_drv->hSemTestKeyBlock);
- return s32Error;
+ return result;
}
s32 host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *pu8RxGtk,
@@ -3364,14 +3338,14 @@ s32 host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *pu8RxGtk,
const u8 *pu8RxMic, const u8 *pu8TxMic,
u8 mode, u8 u8Ciphermode)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
u8 u8KeyLen = u8GtkKeylen;
if (!hif_drv) {
- s32Error = -EFAULT;
+ result = -EFAULT;
PRINT_ER("driver is null\n");
- return s32Error;
+ return result;
}
memset(&msg, 0, sizeof(struct host_if_msg));
@@ -3411,26 +3385,26 @@ s32 host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *pu8RxGtk,
msg.body.key_info.attr.wpa.key_len = u8KeyLen;
msg.body.key_info.attr.wpa.seq_len = u32KeyRSClen;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("Error in sending message queue: RX GTK\n");
down(&hif_drv->hSemTestKeyBlock);
- return s32Error;
+ return result;
}
s32 host_int_set_pmkid_info(struct host_if_drv *hif_drv, struct host_if_pmkid_attr *pu8PmkidInfoArray)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
u32 i;
if (!hif_drv) {
- s32Error = -EFAULT;
+ result = -EFAULT;
PRINT_ER("driver is null\n");
- return s32Error;
+ return result;
}
memset(&msg, 0, sizeof(struct host_if_msg));
@@ -3447,11 +3421,11 @@ s32 host_int_set_pmkid_info(struct host_if_drv *hif_drv, struct host_if_pmkid_at
PMKID_LEN);
}
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER(" Error in sending messagequeue: PMKID Info\n");
- return s32Error;
+ return result;
}
s32 host_int_get_pmkid_info(struct host_if_drv *hif_drv,
@@ -3486,7 +3460,7 @@ s32 host_int_set_RSNAConfigPSKPassPhrase(struct host_if_drv *hif_drv,
s32 host_int_get_MacAddress(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
memset(&msg, 0, sizeof(struct host_if_msg));
@@ -3495,19 +3469,19 @@ s32 host_int_get_MacAddress(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
msg.body.get_mac_info.u8MacAddress = pu8MacAddress;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error) {
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result) {
PRINT_ER("Failed to send get mac address\n");
return -EFAULT;
}
down(&hif_sema_wait_response);
- return s32Error;
+ return result;
}
s32 host_int_set_MacAddress(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
PRINT_D(GENERIC_DBG, "mac addr = %x:%x:%x\n", pu8MacAddress[0], pu8MacAddress[1], pu8MacAddress[2]);
@@ -3517,12 +3491,11 @@ s32 host_int_set_MacAddress(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
memcpy(msg.body.set_mac_info.u8MacAddress, pu8MacAddress, ETH_ALEN);
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("Failed to send message queue: Set mac address\n");
- return s32Error;
-
+ return result;
}
s32 host_int_get_RSNAConfigPSKPassPhrase(struct host_if_drv *hif_drv,
@@ -3569,14 +3542,14 @@ s32 host_int_set_join_req(struct host_if_drv *hif_drv, u8 *pu8bssid,
u8 u8security, enum AUTHTYPE tenuAuth_type,
u8 u8channel, void *pJoinParams)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
enum scan_conn_timer enuScanConnTimer;
if (!hif_drv || pfConnectResult == NULL) {
- s32Error = -EFAULT;
+ result = -EFAULT;
PRINT_ER("Driver is null\n");
- return s32Error;
+ return result;
}
if (pJoinParams == NULL) {
@@ -3617,8 +3590,8 @@ s32 host_int_set_join_req(struct host_if_drv *hif_drv, u8 *pu8bssid,
else
PRINT_D(GENERIC_DBG, "Don't set state to 'connecting' as state is %d\n", hif_drv->enuHostIFstate);
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error) {
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result) {
PRINT_ER("Failed to send message queue: Set join request\n");
return -EFAULT;
}
@@ -3628,41 +3601,41 @@ s32 host_int_set_join_req(struct host_if_drv *hif_drv, u8 *pu8bssid,
mod_timer(&hif_drv->hConnectTimer,
jiffies + msecs_to_jiffies(HOST_IF_CONNECT_TIMEOUT));
- return s32Error;
+ return result;
}
s32 host_int_flush_join_req(struct host_if_drv *hif_drv)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
if (!join_req) {
- s32Error = -EFAULT;
- return s32Error;
+ result = -EFAULT;
+ return result;
}
if (!hif_drv) {
- s32Error = -EFAULT;
+ result = -EFAULT;
PRINT_ER("Driver is null\n");
- return s32Error;
+ return result;
}
msg.id = HOST_IF_MSG_FLUSH_CONNECT;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error) {
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result) {
PRINT_ER("Failed to send message queue: Flush join request\n");
return -EFAULT;
}
- return s32Error;
+ return result;
}
s32 host_int_disconnect(struct host_if_drv *hif_drv, u16 u16ReasonCode)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
if (!hif_drv) {
@@ -3675,13 +3648,13 @@ s32 host_int_disconnect(struct host_if_drv *hif_drv, u16 u16ReasonCode)
msg.id = HOST_IF_MSG_DISCONNECT;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("Failed to send message queue: disconnect\n");
down(&hif_drv->hSemTestDisconnectBlock);
- return s32Error;
+ return result;
}
s32 host_int_disconnect_station(struct host_if_drv *hif_drv, u8 assoc_id)
@@ -3712,7 +3685,7 @@ s32 host_int_get_assoc_req_info(struct host_if_drv *hif_drv, u8 *pu8AssocReqInfo
s32 host_int_get_assoc_res_info(struct host_if_drv *hif_drv, u8 *pu8AssocRespInfo,
u32 u32MaxAssocRespInfoLen, u32 *pu32RcvdAssocRespInfoLen)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
if (!hif_drv) {
@@ -3725,9 +3698,9 @@ s32 host_int_get_assoc_res_info(struct host_if_drv *hif_drv, u8 *pu8AssocRespInf
strWID.val = pu8AssocRespInfo;
strWID.size = u32MaxAssocRespInfoLen;
- s32Error = send_config_pkt(GET_CFG, &strWID, 1,
+ result = send_config_pkt(GET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error) {
+ if (result) {
*pu32RcvdAssocRespInfoLen = 0;
PRINT_ER("Failed to send association response config packet\n");
return -EINVAL;
@@ -3735,7 +3708,7 @@ s32 host_int_get_assoc_res_info(struct host_if_drv *hif_drv, u8 *pu8AssocRespInf
*pu32RcvdAssocRespInfoLen = strWID.size;
}
- return s32Error;
+ return result;
}
s32 host_int_get_rx_power_level(struct host_if_drv *hif_drv, u8 *pu8RxPowerLevel,
@@ -3833,7 +3806,7 @@ int host_int_set_operation_mode(struct host_if_drv *hif_drv, u32 mode)
s32 host_int_get_host_chnl_num(struct host_if_drv *hif_drv, u8 *pu8ChNo)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
if (!hif_drv) {
@@ -3846,22 +3819,20 @@ s32 host_int_get_host_chnl_num(struct host_if_drv *hif_drv, u8 *pu8ChNo)
msg.id = HOST_IF_MSG_GET_CHNL;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc mq send fail\n");
down(&hif_drv->hSemGetCHNL);
*pu8ChNo = ch_no;
- return s32Error;
-
-
+ return result;
}
s32 host_int_get_inactive_time(struct host_if_drv *hif_drv,
const u8 *mac, u32 *pu32InactiveTime)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
if (!hif_drv) {
@@ -3878,21 +3849,20 @@ s32 host_int_get_inactive_time(struct host_if_drv *hif_drv,
msg.id = HOST_IF_MSG_GET_INACTIVETIME;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("Failed to send get host channel param's message queue ");
down(&hif_drv->hSemInactiveTime);
*pu32InactiveTime = inactive_time;
- return s32Error;
+ return result;
}
s32 host_int_test_get_int_wid(struct host_if_drv *hif_drv, u32 *pu32TestMemAddr)
{
-
- s32 s32Error = 0;
+ s32 result = 0;
struct wid strWID;
if (!hif_drv) {
@@ -3905,10 +3875,10 @@ s32 host_int_test_get_int_wid(struct host_if_drv *hif_drv, u32 *pu32TestMemAddr)
strWID.val = (s8 *)pu32TestMemAddr;
strWID.size = sizeof(u32);
- s32Error = send_config_pkt(GET_CFG, &strWID, 1,
+ result = send_config_pkt(GET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (s32Error) {
+ if (result) {
PRINT_ER("Failed to get wid value\n");
return -EINVAL;
} else {
@@ -3916,20 +3886,20 @@ s32 host_int_test_get_int_wid(struct host_if_drv *hif_drv, u32 *pu32TestMemAddr)
}
- return s32Error;
+ return result;
}
s32 host_int_get_rssi(struct host_if_drv *hif_drv, s8 *ps8Rssi)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
memset(&msg, 0, sizeof(struct host_if_msg));
msg.id = HOST_IF_MSG_GET_RSSI;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error) {
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result) {
PRINT_ER("Failed to send get host channel param's message queue ");
return -EFAULT;
}
@@ -3944,20 +3914,20 @@ s32 host_int_get_rssi(struct host_if_drv *hif_drv, s8 *ps8Rssi)
*ps8Rssi = rssi;
- return s32Error;
+ return result;
}
s32 host_int_get_link_speed(struct host_if_drv *hif_drv, s8 *ps8lnkspd)
{
struct host_if_msg msg;
- s32 s32Error = 0;
+ s32 result = 0;
memset(&msg, 0, sizeof(struct host_if_msg));
msg.id = HOST_IF_MSG_GET_LINKSPEED;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error) {
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result) {
PRINT_ER("Failed to send GET_LINKSPEED to message queue ");
return -EFAULT;
}
@@ -3972,12 +3942,12 @@ s32 host_int_get_link_speed(struct host_if_drv *hif_drv, s8 *ps8lnkspd)
*ps8lnkspd = link_speed;
- return s32Error;
+ return result;
}
s32 host_int_get_statistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatistics)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
memset(&msg, 0, sizeof(struct host_if_msg));
@@ -3985,14 +3955,14 @@ s32 host_int_get_statistics(struct host_if_drv *hif_drv, struct rf_info *pstrSta
msg.body.data = (char *)pstrStatistics;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error) {
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result) {
PRINT_ER("Failed to send get host channel param's message queue ");
return -EFAULT;
}
down(&hif_sema_wait_response);
- return s32Error;
+ return result;
}
s32 host_int_scan(struct host_if_drv *hif_drv, u8 u8ScanSource,
@@ -4001,7 +3971,7 @@ s32 host_int_scan(struct host_if_drv *hif_drv, u8 u8ScanSource,
size_t IEsLen, wilc_scan_result ScanResult,
void *pvUserArg, struct hidden_network *pstrHiddenNetwork)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
enum scan_conn_timer enuScanConnTimer;
@@ -4035,8 +4005,8 @@ s32 host_int_scan(struct host_if_drv *hif_drv, u8 u8ScanSource,
msg.body.scan_info.ies = kmalloc(IEsLen, GFP_KERNEL);
memcpy(msg.body.scan_info.ies, pu8IEs, IEsLen);
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error) {
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result) {
PRINT_ER("Error in sending message queue\n");
return -EINVAL;
}
@@ -4047,15 +4017,13 @@ s32 host_int_scan(struct host_if_drv *hif_drv, u8 u8ScanSource,
mod_timer(&hif_drv->hScanTimer,
jiffies + msecs_to_jiffies(HOST_IF_SCAN_TIMEOUT));
- return s32Error;
-
+ return result;
}
s32 hif_set_cfg(struct host_if_drv *hif_drv,
struct cfg_param_val *pstrCfgParamVal)
{
-
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
@@ -4069,15 +4037,14 @@ s32 hif_set_cfg(struct host_if_drv *hif_drv,
msg.body.cfg_info.cfg_attr_info = *pstrCfgParamVal;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
-
- return s32Error;
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ return result;
}
s32 hif_get_cfg(struct host_if_drv *hif_drv, u16 u16WID, u16 *pu16WID_Value)
{
- s32 s32Error = 0;
+ s32 result = 0;
down(&hif_drv->gtOsCfgValuesSem);
@@ -4166,8 +4133,7 @@ s32 hif_get_cfg(struct host_if_drv *hif_drv, u16 u16WID, u16 *pu16WID_Value)
up(&hif_drv->gtOsCfgValuesSem);
- return s32Error;
-
+ return result;
}
void host_int_send_join_leave_info_to_host
@@ -4185,7 +4151,7 @@ static void GetPeriodicRSSI(unsigned long arg)
}
if (hif_drv->enuHostIFstate == HOST_IF_CONNECTED) {
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
memset(&msg, 0, sizeof(struct host_if_msg));
@@ -4193,8 +4159,8 @@ static void GetPeriodicRSSI(unsigned long arg)
msg.id = HOST_IF_MSG_GET_RSSI;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error) {
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result) {
PRINT_ER("Failed to send get host channel param's message queue ");
return;
}
@@ -4316,7 +4282,7 @@ _fail_:
s32 host_int_deinit(struct host_if_drv *hif_drv)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
int ret;
@@ -4366,9 +4332,9 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
msg.id = HOST_IF_MSG_EXIT;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error != 0)
- PRINT_ER("Error in sending deinit's message queue message function: Error(%d)\n", s32Error);
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result != 0)
+ PRINT_ER("Error in sending deinit's message queue message function: Error(%d)\n", result);
down(&hif_sema_thread);
@@ -4379,19 +4345,19 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
ret = remove_handler_in_list(hif_drv);
if (ret)
- s32Error = -ENOENT;
+ result = -ENOENT;
kfree(hif_drv);
clients_count--;
terminated_handle = NULL;
up(&hif_sema_deinit);
- return s32Error;
+ return result;
}
void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
int id;
struct host_if_drv *hif_drv = NULL;
@@ -4416,14 +4382,14 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
msg.body.net_info.buffer = kmalloc(u32Length, GFP_KERNEL);
memcpy(msg.body.net_info.buffer, pu8Buffer, u32Length);
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
- PRINT_ER("Error in sending network info message queue message parameters: Error(%d)\n", s32Error);
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
+ PRINT_ER("Error in sending network info message queue message parameters: Error(%d)\n", result);
}
void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
int id;
struct host_if_drv *hif_drv = NULL;
@@ -4457,16 +4423,16 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
msg.body.async_info.buffer = kmalloc(u32Length, GFP_KERNEL);
memcpy(msg.body.async_info.buffer, pu8Buffer, u32Length);
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
- PRINT_ER("Error in sending message queue asynchronous message info: Error(%d)\n", s32Error);
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
+ PRINT_ER("Error in sending message queue asynchronous message info: Error(%d)\n", result);
up(&hif_sema_deinit);
}
void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
int id;
struct host_if_drv *hif_drv = NULL;
@@ -4486,9 +4452,9 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
msg.id = HOST_IF_MSG_RCVD_SCAN_COMPLETE;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
- PRINT_ER("Error in sending message queue scan complete parameters: Error(%d)\n", s32Error);
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
+ PRINT_ER("Error in sending message queue scan complete parameters: Error(%d)\n", result);
}
@@ -4502,7 +4468,7 @@ s32 host_int_remain_on_channel(struct host_if_drv *hif_drv, u32 u32SessionID,
wilc_remain_on_chan_ready RemainOnChanReady,
void *pvUserArg)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
if (!hif_drv) {
@@ -4521,16 +4487,16 @@ s32 host_int_remain_on_channel(struct host_if_drv *hif_drv, u32 u32SessionID,
msg.body.remain_on_ch.u32ListenSessionID = u32SessionID;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc mq send fail\n");
- return s32Error;
+ return result;
}
s32 host_int_ListenStateExpired(struct host_if_drv *hif_drv, u32 u32SessionID)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
if (!hif_drv) {
@@ -4545,16 +4511,16 @@ s32 host_int_ListenStateExpired(struct host_if_drv *hif_drv, u32 u32SessionID)
msg.drv = hif_drv;
msg.body.remain_on_ch.u32ListenSessionID = u32SessionID;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc mq send fail\n");
- return s32Error;
+ return result;
}
s32 host_int_frame_register(struct host_if_drv *hif_drv, u16 u16FrameType, bool bReg)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
if (!hif_drv) {
@@ -4584,20 +4550,18 @@ s32 host_int_frame_register(struct host_if_drv *hif_drv, u16 u16FrameType, bool
msg.body.reg_frame.bReg = bReg;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc mq send fail\n");
- return s32Error;
-
-
+ return result;
}
s32 host_int_add_beacon(struct host_if_drv *hif_drv, u32 u32Interval,
u32 u32DTIMPeriod, u32 u32HeadLen, u8 *pu8Head,
u32 u32TailLen, u8 *pu8Tail)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
struct beacon_attr *pstrSetBeaconParam = &msg.body.beacon_info;
@@ -4617,7 +4581,7 @@ s32 host_int_add_beacon(struct host_if_drv *hif_drv, u32 u32Interval,
pstrSetBeaconParam->head_len = u32HeadLen;
pstrSetBeaconParam->head = kmalloc(u32HeadLen, GFP_KERNEL);
if (pstrSetBeaconParam->head == NULL) {
- s32Error = -ENOMEM;
+ result = -ENOMEM;
goto ERRORHANDLER;
}
memcpy(pstrSetBeaconParam->head, pu8Head, u32HeadLen);
@@ -4626,7 +4590,7 @@ s32 host_int_add_beacon(struct host_if_drv *hif_drv, u32 u32Interval,
if (u32TailLen > 0) {
pstrSetBeaconParam->tail = kmalloc(u32TailLen, GFP_KERNEL);
if (pstrSetBeaconParam->tail == NULL) {
- s32Error = -ENOMEM;
+ result = -ENOMEM;
goto ERRORHANDLER;
}
memcpy(pstrSetBeaconParam->tail, pu8Tail, u32TailLen);
@@ -4634,12 +4598,12 @@ s32 host_int_add_beacon(struct host_if_drv *hif_drv, u32 u32Interval,
pstrSetBeaconParam->tail = NULL;
}
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc mq send fail\n");
ERRORHANDLER:
- if (s32Error) {
+ if (result) {
if (pstrSetBeaconParam->head != NULL)
kfree(pstrSetBeaconParam->head);
@@ -4647,13 +4611,12 @@ ERRORHANDLER:
kfree(pstrSetBeaconParam->tail);
}
- return s32Error;
-
+ return result;
}
s32 host_int_del_beacon(struct host_if_drv *hif_drv)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
if (!hif_drv) {
@@ -4665,17 +4628,17 @@ s32 host_int_del_beacon(struct host_if_drv *hif_drv)
msg.drv = hif_drv;
PRINT_D(HOSTINF_DBG, "Setting deleting beacon message queue params\n");
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc_mq_send fail\n");
- return s32Error;
+ return result;
}
s32 host_int_add_station(struct host_if_drv *hif_drv,
struct add_sta_param *pstrStaParams)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
struct add_sta_param *pstrAddStationMsg = &msg.body.add_sta_info;
@@ -4703,15 +4666,15 @@ s32 host_int_add_station(struct host_if_drv *hif_drv,
pstrAddStationMsg->pu8Rates = rates;
}
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc_mq_send fail\n");
- return s32Error;
+ return result;
}
s32 host_int_del_station(struct host_if_drv *hif_drv, const u8 *pu8MacAddr)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
struct del_sta *pstrDelStationMsg = &msg.body.del_sta_info;
@@ -4732,16 +4695,16 @@ s32 host_int_del_station(struct host_if_drv *hif_drv, const u8 *pu8MacAddr)
else
memcpy(pstrDelStationMsg->mac_addr, pu8MacAddr, ETH_ALEN);
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc_mq_send fail\n");
- return s32Error;
+ return result;
}
s32 host_int_del_allstation(struct host_if_drv *hif_drv,
u8 pu8MacAddr[][ETH_ALEN])
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
struct del_all_sta *pstrDelAllStationMsg = &msg.body.del_all_sta_info;
u8 au8Zero_Buff[ETH_ALEN] = {0};
@@ -4776,25 +4739,24 @@ s32 host_int_del_allstation(struct host_if_drv *hif_drv,
}
if (!u8AssocNumb) {
PRINT_D(CFG80211_DBG, "NO ASSOCIATED STAS\n");
- return s32Error;
+ return result;
}
pstrDelAllStationMsg->assoc_sta = u8AssocNumb;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ if (result)
PRINT_ER("wilc_mq_send fail\n");
down(&hif_sema_wait_response);
- return s32Error;
-
+ return result;
}
s32 host_int_edit_station(struct host_if_drv *hif_drv,
struct add_sta_param *pstrStaParams)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
struct add_sta_param *pstrAddStationMsg = &msg.body.add_sta_info;
@@ -4821,18 +4783,18 @@ s32 host_int_edit_station(struct host_if_drv *hif_drv,
pstrAddStationMsg->pu8Rates = rates;
}
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc_mq_send fail\n");
- return s32Error;
+ return result;
}
s32 host_int_set_power_mgmt(struct host_if_drv *hif_drv,
bool bIsEnabled,
u32 u32Timeout)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
struct power_mgmt_param *pstrPowerMgmtParam = &msg.body.pwr_mgmt_info;
@@ -4853,17 +4815,17 @@ s32 host_int_set_power_mgmt(struct host_if_drv *hif_drv,
pstrPowerMgmtParam->enabled = bIsEnabled;
pstrPowerMgmtParam->timeout = u32Timeout;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc_mq_send fail\n");
- return s32Error;
+ return result;
}
s32 host_int_setup_multicast_filter(struct host_if_drv *hif_drv,
bool bIsEnabled,
u32 u32count)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
struct set_multicast *pstrMulticastFilterParam = &msg.body.multicast_info;
@@ -4883,10 +4845,10 @@ s32 host_int_setup_multicast_filter(struct host_if_drv *hif_drv,
pstrMulticastFilterParam->enabled = bIsEnabled;
pstrMulticastFilterParam->cnt = u32count;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc_mq_send fail\n");
- return s32Error;
+ return result;
}
static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
@@ -5060,7 +5022,7 @@ void host_int_freeJoinParams(void *pJoinParams)
s32 host_int_delBASession(struct host_if_drv *hif_drv, char *pBSSID, char TID)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
struct ba_session_info *pBASessionInfo = &msg.body.session_info;
@@ -5077,20 +5039,20 @@ s32 host_int_delBASession(struct host_if_drv *hif_drv, char *pBSSID, char TID)
pBASessionInfo->u8Ted = TID;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc_mq_send fail\n");
down(&hif_sema_wait_response);
- return s32Error;
+ return result;
}
s32 host_int_del_All_Rx_BASession(struct host_if_drv *hif_drv,
char *pBSSID,
char TID)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
struct ba_session_info *pBASessionInfo = &msg.body.session_info;
@@ -5107,18 +5069,18 @@ s32 host_int_del_All_Rx_BASession(struct host_if_drv *hif_drv,
pBASessionInfo->u8Ted = TID;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc_mq_send fail\n");
down(&hif_sema_wait_response);
- return s32Error;
+ return result;
}
s32 host_int_setup_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
return 0;
@@ -5136,18 +5098,16 @@ s32 host_int_setup_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)
msg.drv = hif_drv;
msg.body.ip_info.idx = idx;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc_mq_send fail\n");
- return s32Error;
-
-
+ return result;
}
s32 host_int_get_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)
{
- s32 s32Error = 0;
+ s32 result = 0;
struct host_if_msg msg;
if (!hif_drv) {
@@ -5163,11 +5123,9 @@ s32 host_int_get_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)
msg.drv = hif_drv;
msg.body.ip_info.idx = idx;
- s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
- if (s32Error)
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
+ if (result)
PRINT_ER("wilc_mq_send fail\n");
- return s32Error;
-
-
+ return result;
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable hSemHostIntDeinit to hif_sema_deinit
to avoid CamelCase naming convention.
Add to static because follow warning reported by kbuild system.
- drivers/staging/wilc1000/host_interface.c:247:18: sparse: symbol
'hif_sema_deinit' was not declared. Should it be static?
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 9346d42..5900972 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -244,7 +244,7 @@ static WILC_MsgQueueHandle hif_msg_q;
static struct semaphore hif_sema_thread;
static struct semaphore hif_sema_driver;
static struct semaphore hif_sema_wait_response;
-struct semaphore hSemHostIntDeinit;
+static struct semaphore hif_sema_deinit;
struct timer_list g_hPeriodicRSSI;
@@ -4249,7 +4249,7 @@ s32 host_int_init(struct host_if_drv **hif_drv_handler)
if (clients_count == 0) {
sema_init(&hif_sema_thread, 0);
sema_init(&hif_sema_driver, 0);
- sema_init(&hSemHostIntDeinit, 1);
+ sema_init(&hif_sema_deinit, 1);
}
sema_init(&hif_drv->hSemTestKeyBlock, 0);
@@ -4333,7 +4333,7 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
return 0;
}
- down(&hSemHostIntDeinit);
+ down(&hif_sema_deinit);
terminated_handle = hif_drv;
PRINT_D(HOSTINF_DBG, "De-initializing host interface for client %d\n", clients_count);
@@ -4395,7 +4395,7 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
clients_count--;
terminated_handle = NULL;
- up(&hSemHostIntDeinit);
+ up(&hif_sema_deinit);
return s32Error;
}
@@ -4438,7 +4438,7 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
int id;
struct host_if_drv *hif_drv = NULL;
- down(&hSemHostIntDeinit);
+ down(&hif_sema_deinit);
id = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
hif_drv = get_handler_from_id(id);
@@ -4447,13 +4447,13 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
if (!hif_drv || hif_drv == terminated_handle) {
PRINT_D(HOSTINF_DBG, "Wifi driver handler is equal to NULL\n");
- up(&hSemHostIntDeinit);
+ up(&hif_sema_deinit);
return;
}
if (!hif_drv->strWILC_UsrConnReq.pfUserConnectResult) {
PRINT_ER("Received mac status is not needed when there is no current Connect Reques\n");
- up(&hSemHostIntDeinit);
+ up(&hif_sema_deinit);
return;
}
@@ -4471,7 +4471,7 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
if (s32Error)
PRINT_ER("Error in sending message queue asynchronous message info: Error(%d)\n", s32Error);
- up(&hSemHostIntDeinit);
+ up(&hif_sema_deinit);
}
void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable g_hPeriodicRSSI to periodic_rssi
to avoid CamelCase naming convention.
Add to static because follow warning reported by kbuild system.
- drivers/staging/wilc1000/host_interface.c:248:19: sparse: symbol
'periodic_rssi' was not declared. Should it be static?
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 5900972..8c529d1 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -245,9 +245,7 @@ static struct semaphore hif_sema_thread;
static struct semaphore hif_sema_driver;
static struct semaphore hif_sema_wait_response;
static struct semaphore hif_sema_deinit;
-struct timer_list g_hPeriodicRSSI;
-
-
+static struct timer_list periodic_rssi;
u8 gau8MulticastMacAddrList[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN];
@@ -4207,8 +4205,8 @@ static void GetPeriodicRSSI(unsigned long arg)
return;
}
}
- g_hPeriodicRSSI.data = (unsigned long)hif_drv;
- mod_timer(&g_hPeriodicRSSI, jiffies + msecs_to_jiffies(5000));
+ periodic_rssi.data = (unsigned long)hif_drv;
+ mod_timer(&periodic_rssi, jiffies + msecs_to_jiffies(5000));
}
@@ -4276,9 +4274,9 @@ s32 host_int_init(struct host_if_drv **hif_drv_handler)
result = -EFAULT;
goto _fail_mq_;
}
- setup_timer(&g_hPeriodicRSSI, GetPeriodicRSSI,
+ setup_timer(&periodic_rssi, GetPeriodicRSSI,
(unsigned long)hif_drv);
- mod_timer(&g_hPeriodicRSSI, jiffies + msecs_to_jiffies(5000));
+ mod_timer(&periodic_rssi, jiffies + msecs_to_jiffies(5000));
}
setup_timer(&hif_drv->hScanTimer, TimerCB_Scan, 0);
@@ -4346,10 +4344,8 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
PRINT_D(HOSTINF_DBG, ">> Connect timer is active\n");
}
-
- if (del_timer_sync(&g_hPeriodicRSSI)) {
+ if (del_timer_sync(&periodic_rssi))
PRINT_D(HOSTINF_DBG, ">> Connect timer is active\n");
- }
del_timer_sync(&hif_drv->hRemainOnChannel);
@@ -4370,9 +4366,9 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
memset(&msg, 0, sizeof(struct host_if_msg));
if (clients_count == 1) {
- if (del_timer_sync(&g_hPeriodicRSSI)) {
+ if (del_timer_sync(&periodic_rssi))
PRINT_D(HOSTINF_DBG, ">> Connect timer is active\n");
- }
+
msg.id = HOST_IF_MSG_EXIT;
msg.drv = hif_drv;
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable hSemDeinitDrvHandle to hif_sema_driver
to avoid CamelCase naming convention.
Add to static because follow warning reported by kbuild system.
- drivers/staging/wilc1000/host_interface.c:245:18: sparse: symbol
'hif_sema_driver' was not declared. Should it be static?
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index a587080..32c73b1 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -242,7 +242,7 @@ u8 P2P_LISTEN_STATE;
static struct task_struct *hif_thread_handler;
static WILC_MsgQueueHandle hif_msg_q;
static struct semaphore hif_sema_thread;
-struct semaphore hSemDeinitDrvHandle;
+static struct semaphore hif_sema_driver;
static struct semaphore hWaitResponse;
struct semaphore hSemHostIntDeinit;
struct timer_list g_hPeriodicRSSI;
@@ -370,8 +370,7 @@ static s32 Handle_SetWfiDrvHandler(struct host_if_drv *hif_drv,
pstrHostIfSetDrvHandler->u32Address);
if (!hif_drv)
- up(&hSemDeinitDrvHandle);
-
+ up(&hif_sema_driver);
if (s32Error) {
PRINT_ER("Failed to set driver handler\n");
@@ -398,8 +397,7 @@ static s32 Handle_SetOperationMode(struct host_if_drv *hif_drv,
if ((pstrHostIfSetOperationMode->u32Mode) == IDLE_MODE)
- up(&hSemDeinitDrvHandle);
-
+ up(&hif_sema_driver);
if (s32Error) {
PRINT_ER("Failed to set driver handler\n");
@@ -4250,7 +4248,7 @@ s32 host_int_init(struct host_if_drv **hif_drv_handler)
PRINT_D(HOSTINF_DBG, "Global handle pointer value=%p\n", hif_drv);
if (clients_count == 0) {
sema_init(&hif_sema_thread, 0);
- sema_init(&hSemDeinitDrvHandle, 0);
+ sema_init(&hif_sema_driver, 0);
sema_init(&hSemHostIntDeinit, 1);
}
@@ -4356,7 +4354,7 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
del_timer_sync(&hif_drv->hRemainOnChannel);
host_int_set_wfi_drv_handler(NULL);
- down(&hSemDeinitDrvHandle);
+ down(&hif_sema_driver);
if (hif_drv->strWILC_UsrScanReq.pfUserScanResult) {
hif_drv->strWILC_UsrScanReq.pfUserScanResult(SCAN_EVENT_ABORTED, NULL,
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gbScanWhileConnected to scan_while_connected
to avoid CamelCase naming convention.
Add to static because follow warning reported by kbuild system.
- drivers/staging/wilc1000/host_interface.c:254:6: sparse: symbol
'scan_while_connected' was not declared. Should it be static?
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 5112aee..e309197 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -251,7 +251,7 @@ u8 gau8MulticastMacAddrList[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN];
static u8 rcv_assoc_resp[MAX_ASSOC_RESP_FRAME_SIZE];
-bool gbScanWhileConnected;
+static bool scan_while_connected;
static s8 gs8Rssi;
static s8 gs8lnkspd;
@@ -918,9 +918,9 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
u32WidsCount++;
if (hif_drv->enuHostIFstate == HOST_IF_CONNECTED)
- gbScanWhileConnected = true;
+ scan_while_connected = true;
else if (hif_drv->enuHostIFstate == HOST_IF_IDLE)
- gbScanWhileConnected = false;
+ scan_while_connected = false;
s32Error = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
get_id_from_handler(hif_drv));
@@ -1357,8 +1357,7 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
hif_drv->enuHostIFstate = HOST_IF_IDLE;
- gbScanWhileConnected = false;
-
+ scan_while_connected = false;
memset(&strConnectInfo, 0, sizeof(tstrConnectInfo));
@@ -1658,7 +1657,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
} else {
PRINT_D(HOSTINF_DBG, "MAC status : %d and Connect Status : %d\n", u8MacStatus, strConnectInfo.u16ConnectStatus);
hif_drv->enuHostIFstate = HOST_IF_IDLE;
- gbScanWhileConnected = false;
+ scan_while_connected = false;
}
if (strConnectInfo.pu8RespIEs != NULL) {
@@ -1723,7 +1722,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
}
hif_drv->enuHostIFstate = HOST_IF_IDLE;
- gbScanWhileConnected = false;
+ scan_while_connected = false;
} else if ((u8MacStatus == MAC_DISCONNECTED) &&
(hif_drv->strWILC_UsrScanReq.pfUserScanResult != NULL)) {
@@ -2093,7 +2092,7 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
PRINT_ER("strWILC_UsrConnReq.pfUserConnectResult = NULL\n");
}
- gbScanWhileConnected = false;
+ scan_while_connected = false;
hif_drv->enuHostIFstate = HOST_IF_IDLE;
@@ -4225,7 +4224,7 @@ s32 host_int_init(struct host_if_drv **hif_drv_handler)
PRINT_D(HOSTINF_DBG, "Initializing host interface for client %d\n", clients_count + 1);
- gbScanWhileConnected = false;
+ scan_while_connected = false;
sema_init(&hif_sema_wait_response, 0);
@@ -4361,7 +4360,7 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
hif_drv->enuHostIFstate = HOST_IF_IDLE;
- gbScanWhileConnected = false;
+ scan_while_connected = false;
memset(&msg, 0, sizeof(struct host_if_msg));
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames au8StartTime of struct join_bss_param to start_time
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 5cbba1a..320073e 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -226,7 +226,7 @@ struct join_bss_param {
u8 idx;
u8 duration[4];
u8 interval[4];
- u8 au8StartTime[4];
+ u8 start_time[4];
};
enum scan_conn_timer {
@@ -1208,10 +1208,8 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
memcpy(pu8CurrByte, ptstrJoinBssParam->interval, sizeof(ptstrJoinBssParam->interval));
pu8CurrByte += sizeof(ptstrJoinBssParam->interval);
- memcpy(pu8CurrByte, ptstrJoinBssParam->au8StartTime, sizeof(ptstrJoinBssParam->au8StartTime));
-
- pu8CurrByte += sizeof(ptstrJoinBssParam->au8StartTime);
-
+ memcpy(pu8CurrByte, ptstrJoinBssParam->start_time, sizeof(ptstrJoinBssParam->start_time));
+ pu8CurrByte += sizeof(ptstrJoinBssParam->start_time);
} else
PRINT_D(HOSTINF_DBG, "NOA not present\n");
@@ -5004,7 +5002,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
memcpy(pNewJoinBssParam->interval, pu8IEs + u16P2P_count, 4);
u16P2P_count += 4;
- memcpy(pNewJoinBssParam->au8StartTime, pu8IEs + u16P2P_count, 4);
+ memcpy(pNewJoinBssParam->start_time, pu8IEs + u16P2P_count, 4);
index += pu8IEs[index + 1] + 2;
continue;
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames au8Interval of struct join_bss_param to interval
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 0c5cf08..5cbba1a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -225,7 +225,7 @@ struct join_bss_param {
u8 cnt;
u8 idx;
u8 duration[4];
- u8 au8Interval[4];
+ u8 interval[4];
u8 au8StartTime[4];
};
@@ -1205,9 +1205,8 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
memcpy(pu8CurrByte, ptstrJoinBssParam->duration, sizeof(ptstrJoinBssParam->duration));
pu8CurrByte += sizeof(ptstrJoinBssParam->duration);
- memcpy(pu8CurrByte, ptstrJoinBssParam->au8Interval, sizeof(ptstrJoinBssParam->au8Interval));
-
- pu8CurrByte += sizeof(ptstrJoinBssParam->au8Interval);
+ memcpy(pu8CurrByte, ptstrJoinBssParam->interval, sizeof(ptstrJoinBssParam->interval));
+ pu8CurrByte += sizeof(ptstrJoinBssParam->interval);
memcpy(pu8CurrByte, ptstrJoinBssParam->au8StartTime, sizeof(ptstrJoinBssParam->au8StartTime));
@@ -5002,7 +5001,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
memcpy(pNewJoinBssParam->duration, pu8IEs + u16P2P_count, 4);
u16P2P_count += 4;
- memcpy(pNewJoinBssParam->au8Interval, pu8IEs + u16P2P_count, 4);
+ memcpy(pNewJoinBssParam->interval, pu8IEs + u16P2P_count, 4);
u16P2P_count += 4;
memcpy(pNewJoinBssParam->au8StartTime, pu8IEs + u16P2P_count, 4);
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames u8Index of struct join_bss_param to idx
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index e8a35d3..75a4279 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -223,7 +223,7 @@ struct join_bss_param {
u8 opp_enabled;
u8 ct_window;
u8 cnt;
- u8 u8Index;
+ u8 idx;
u8 au8Duration[4];
u8 au8Interval[4];
u8 au8StartTime[4];
@@ -1194,8 +1194,8 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
*(pu8CurrByte++) = ((ptstrJoinBssParam->tsf) >> 16) & 0xFF;
*(pu8CurrByte++) = ((ptstrJoinBssParam->tsf) >> 24) & 0xFF;
- *(pu8CurrByte++) = ptstrJoinBssParam->u8Index;
*(pu8CurrByte++) = ptstrJoinBssParam->opp_enabled;
+ *(pu8CurrByte++) = ptstrJoinBssParam->idx;
if (ptstrJoinBssParam->opp_enabled)
*(pu8CurrByte++) = ptstrJoinBssParam->ct_window;
@@ -4984,7 +4984,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
pNewJoinBssParam->tsf = ptstrNetworkInfo->u32Tsf;
pNewJoinBssParam->noa_enabled = 1;
- pNewJoinBssParam->u8Index = pu8IEs[index + 9];
+ pNewJoinBssParam->idx = pu8IEs[index + 9];
if (pu8IEs[index + 10] & BIT(7)) {
pNewJoinBssParam->opp_enabled = 1;
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gu8DelBcn to del_beacon
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[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 ea3c011..9f5db14 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -259,7 +259,7 @@ static u8 ch_no;
static u8 set_ip[2][4];
static u8 get_ip[2][4];
static u32 inactive_time;
-static u8 gu8DelBcn;
+static u8 del_beacon;
static u32 gu32WidConnRstHack;
u8 *gu8FlushedJoinReq;
@@ -2373,7 +2373,7 @@ static void Handle_DelBeacon(struct host_if_drv *hif_drv)
strWID.id = (u16)WID_DEL_BEACON;
strWID.type = WID_CHAR;
strWID.size = sizeof(char);
- strWID.val = &gu8DelBcn;
+ strWID.val = &del_beacon;
if (strWID.val == NULL)
return;
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable HostIFthreadHandler to hif_thread_handler
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index ad7c102..4f24a05 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -239,7 +239,7 @@ static struct host_if_drv *wfidrv_list[NUM_CONCURRENT_IFC + 1];
struct host_if_drv *terminated_handle;
bool g_obtainingIP;
u8 P2P_LISTEN_STATE;
-static struct task_struct *HostIFthreadHandler;
+static struct task_struct *hif_thread_handler;
static WILC_MsgQueueHandle gMsgQHostIF;
static struct semaphore hSemHostIFthrdEnd;
@@ -4271,8 +4271,10 @@ s32 host_int_init(struct host_if_drv **hif_drv_handler)
PRINT_ER("Failed to creat MQ\n");
goto _fail_;
}
- HostIFthreadHandler = kthread_run(hostIFthread, NULL, "WILC_kthread");
- if (IS_ERR(HostIFthreadHandler)) {
+
+ hif_thread_handler = kthread_run(hostIFthread, NULL, "WILC_kthread");
+
+ if (IS_ERR(hif_thread_handler)) {
PRINT_ER("Failed to creat Thread\n");
result = -EFAULT;
goto _fail_mq_;
@@ -4316,7 +4318,7 @@ _fail_timer_2:
up(&hif_drv->gtOsCfgValuesSem);
del_timer_sync(&hif_drv->hConnectTimer);
del_timer_sync(&hif_drv->hScanTimer);
- kthread_stop(HostIFthreadHandler);
+ kthread_stop(hif_thread_handler);
_fail_mq_:
wilc_mq_destroy(&gMsgQHostIF);
_fail_:
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gu8Flushed11iMode to mode_11i
to avoid CamelCase naming convention.
Add to static because follow warning reported by kbuild system.
- drivers/staging/wilc1000/host_interface.c:266:4: sparse: symbol
'mode_11i' was not declared. Should it be static?
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index db63886..e15aeb1 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -263,7 +263,7 @@ static u8 del_beacon;
static u8 *join_req;
static u8 *info_element;
-u8 gu8Flushed11iMode;
+static u8 mode_11i;
u8 gu8FlushedAuthType;
u32 gu32FlushedJoinReqSize;
u32 gu32FlushedInfoElemAsocSize;
@@ -1088,7 +1088,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
u32WidsCount++;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
- gu8Flushed11iMode = hif_drv->strWILC_UsrConnReq.u8security;
+ mode_11i = hif_drv->strWILC_UsrConnReq.u8security;
PRINT_INFO(HOSTINF_DBG, "Encrypt Mode = %x\n", hif_drv->strWILC_UsrConnReq.u8security);
@@ -1309,7 +1309,7 @@ static s32 Handle_FlushConnect(struct host_if_drv *hif_drv)
strWIDList[u32WidsCount].id = (u16)WID_11I_MODE;
strWIDList[u32WidsCount].type = WID_CHAR;
strWIDList[u32WidsCount].size = sizeof(char);
- strWIDList[u32WidsCount].val = (s8 *)(&(gu8Flushed11iMode));
+ strWIDList[u32WidsCount].val = (s8 *)(&(mode_11i));
u32WidsCount++;
--
1.9.1
On Fri, Oct 16, 2015 at 01:37:31PM +0900, Tony Cho wrote:
> From: Leo Kim <[email protected]>
>
> This patch renames ssidLen of struct join_bss_param to ssid_len
> to avoid CamelCase naming convention.
>
> Signed-off-by: Leo Kim <[email protected]>
> Signed-off-by: Tony Cho <[email protected]>
> ---
> drivers/staging/wilc1000/host_interface.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Doesn't apply, I missed that you sent this as v2, why did you do that?
What was wrong with v1?
thanks,
greg k-h
From: Leo Kim <[email protected]>
This patch fixes the checks reported by checkpatch.pl
for alignment should match open parenthesis.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 155 +++++++++++++++---------------
1 file changed, 79 insertions(+), 76 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 08f70d8..3209444 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -343,7 +343,7 @@ static s32 Handle_SetChannel(struct host_if_drv *hif_drv,
PRINT_D(HOSTINF_DBG, "Setting channel\n");
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result) {
PRINT_ER("Failed to set channel\n");
@@ -365,7 +365,7 @@ static s32 Handle_SetWfiDrvHandler(struct host_if_drv *hif_drv,
strWID.size = sizeof(u32);
result = send_config_pkt(SET_CFG, &strWID, 1,
- pstrHostIfSetDrvHandler->u32Address);
+ pstrHostIfSetDrvHandler->u32Address);
if (!hif_drv)
up(&hif_sema_driver);
@@ -390,7 +390,7 @@ static s32 Handle_SetOperationMode(struct host_if_drv *hif_drv,
strWID.size = sizeof(u32);
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if ((pstrHostIfSetOperationMode->u32Mode) == IDLE_MODE)
up(&hif_sema_driver);
@@ -422,7 +422,7 @@ s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
strWID.size = IP_ALEN;
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
host_int_get_ipaddress(hif_drv, firmwareIPAddress, idx);
@@ -447,7 +447,7 @@ s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
strWID.size = IP_ALEN;
result = send_config_pkt(GET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
PRINT_INFO(HOSTINF_DBG, "%pI4\n", strWID.val);
@@ -490,7 +490,7 @@ static s32 Handle_SetMacAddress(struct host_if_drv *hif_drv,
PRINT_D(GENERIC_DBG, "mac addr = :%pM\n", strWID.val);
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result) {
PRINT_ER("Failed to set mac address\n");
result = -EFAULT;
@@ -512,7 +512,7 @@ static s32 Handle_GetMacAddress(struct host_if_drv *hif_drv,
strWID.size = ETH_ALEN;
result = send_config_pkt(GET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result) {
PRINT_ER("Failed to get mac address\n");
@@ -797,7 +797,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
result = send_config_pkt(SET_CFG, strWIDList, u8WidCnt,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result)
PRINT_ER("Error in setting CFG params\n");
@@ -918,7 +918,7 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
scan_while_connected = false;
result = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result)
PRINT_ER("Failed to send scan paramters config packet\n");
@@ -970,7 +970,7 @@ static s32 Handle_ScanDone(struct host_if_drv *hif_drv,
strWID.size = sizeof(char);
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result) {
PRINT_ER("Failed to set abort running scan\n");
@@ -1027,16 +1027,18 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
hif_drv->strWILC_UsrConnReq.ssidLen = pstrHostIFconnectAttr->ssid_len;
if (pstrHostIFconnectAttr->ssid != NULL) {
hif_drv->strWILC_UsrConnReq.pu8ssid = kmalloc(pstrHostIFconnectAttr->ssid_len + 1, GFP_KERNEL);
- memcpy(hif_drv->strWILC_UsrConnReq.pu8ssid, pstrHostIFconnectAttr->ssid,
- pstrHostIFconnectAttr->ssid_len);
+ memcpy(hif_drv->strWILC_UsrConnReq.pu8ssid,
+ pstrHostIFconnectAttr->ssid,
+ pstrHostIFconnectAttr->ssid_len);
hif_drv->strWILC_UsrConnReq.pu8ssid[pstrHostIFconnectAttr->ssid_len] = '\0';
}
hif_drv->strWILC_UsrConnReq.ConnReqIEsLen = pstrHostIFconnectAttr->ies_len;
if (pstrHostIFconnectAttr->ies != NULL) {
hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
- memcpy(hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs, pstrHostIFconnectAttr->ies,
- pstrHostIFconnectAttr->ies_len);
+ memcpy(hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs,
+ pstrHostIFconnectAttr->ies,
+ pstrHostIFconnectAttr->ies_len);
}
hif_drv->strWILC_UsrConnReq.u8security = pstrHostIFconnectAttr->security;
@@ -1219,7 +1221,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
}
result = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result) {
PRINT_ER("failed to send config packet\n");
result = -EFAULT;
@@ -1247,8 +1249,8 @@ ERRORHANDLER:
strConnectInfo.ReqIEsLen = pstrHostIFconnectAttr->ies_len;
strConnectInfo.pu8ReqIEs = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
memcpy(strConnectInfo.pu8ReqIEs,
- pstrHostIFconnectAttr->ies,
- pstrHostIFconnectAttr->ies_len);
+ pstrHostIFconnectAttr->ies,
+ pstrHostIFconnectAttr->ies_len);
}
pstrHostIFconnectAttr->result(CONN_DISCONN_EVENT_CONN_RESP,
@@ -1328,7 +1330,7 @@ static s32 Handle_FlushConnect(struct host_if_drv *hif_drv)
u32WidsCount++;
result = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
- get_id_from_handler(join_req_drv));
+ get_id_from_handler(join_req_drv));
if (result) {
PRINT_ER("failed to send config packet\n");
result = -EINVAL;
@@ -1358,15 +1360,15 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
if (hif_drv->strWILC_UsrConnReq.pfUserConnectResult != NULL) {
if (hif_drv->strWILC_UsrConnReq.pu8bssid != NULL) {
memcpy(strConnectInfo.au8bssid,
- hif_drv->strWILC_UsrConnReq.pu8bssid, 6);
+ hif_drv->strWILC_UsrConnReq.pu8bssid, 6);
}
if (hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs != NULL) {
strConnectInfo.ReqIEsLen = hif_drv->strWILC_UsrConnReq.ConnReqIEsLen;
strConnectInfo.pu8ReqIEs = kmalloc(hif_drv->strWILC_UsrConnReq.ConnReqIEsLen, GFP_KERNEL);
memcpy(strConnectInfo.pu8ReqIEs,
- hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs,
- hif_drv->strWILC_UsrConnReq.ConnReqIEsLen);
+ hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs,
+ hif_drv->strWILC_UsrConnReq.ConnReqIEsLen);
}
hif_drv->strWILC_UsrConnReq.pfUserConnectResult(CONN_DISCONN_EVENT_CONN_RESP,
@@ -1391,7 +1393,7 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
PRINT_D(HOSTINF_DBG, "Sending disconnect request\n");
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result)
PRINT_ER("Failed to send dissconect config packet\n");
@@ -1443,7 +1445,7 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,
if ((hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[i].au8bssid != NULL) &&
(pstrNetworkInfo->au8bssid != NULL)) {
if (memcmp(hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[i].au8bssid,
- pstrNetworkInfo->au8bssid, 6) == 0) {
+ pstrNetworkInfo->au8bssid, 6) == 0) {
if (pstrNetworkInfo->s8rssi <= hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[i].s8rssi) {
PRINT_D(HOSTINF_DBG, "Network previously discovered\n");
goto done;
@@ -1465,7 +1467,7 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,
if ((hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[hif_drv->strWILC_UsrScanReq.u32RcvdChCount].au8bssid != NULL)
&& (pstrNetworkInfo->au8bssid != NULL)) {
memcpy(hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[hif_drv->strWILC_UsrScanReq.u32RcvdChCount].au8bssid,
- pstrNetworkInfo->au8bssid, 6);
+ pstrNetworkInfo->au8bssid, 6);
hif_drv->strWILC_UsrScanReq.u32RcvdChCount++;
@@ -1782,7 +1784,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
}
memcpy(pu8keybuf, pstrHostIFkeyAttr->attr.wep.key,
- pstrHostIFkeyAttr->attr.wep.key_len);
+ pstrHostIFkeyAttr->attr.wep.key_len);
kfree(pstrHostIFkeyAttr->attr.wep.key);
@@ -1792,7 +1794,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
strWIDList[3].val = (s8 *)pu8keybuf;
result = send_config_pkt(SET_CFG, strWIDList, 4,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
kfree(pu8keybuf);
@@ -1808,7 +1810,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index;
memcpy(pu8keybuf + 1, &pstrHostIFkeyAttr->attr.wep.key_len, 1);
memcpy(pu8keybuf + 2, pstrHostIFkeyAttr->attr.wep.key,
- pstrHostIFkeyAttr->attr.wep.key_len);
+ pstrHostIFkeyAttr->attr.wep.key_len);
kfree(pstrHostIFkeyAttr->attr.wep.key);
strWID.id = (u16)WID_ADD_WEP_KEY;
@@ -1817,7 +1819,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
strWID.size = pstrHostIFkeyAttr->attr.wep.key_len + 2;
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
kfree(pu8keybuf);
} else if (pstrHostIFkeyAttr->action & REMOVEKEY) {
@@ -1830,7 +1832,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
strWID.size = 1;
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
} else {
strWID.id = (u16)WID_KEY_ID;
strWID.type = WID_CHAR;
@@ -1840,7 +1842,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
PRINT_D(HOSTINF_DBG, "Setting default key index\n");
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
}
up(&hif_drv->hSemTestKeyBlock);
break;
@@ -1860,7 +1862,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->attr.wpa.index, 1);
memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->attr.wpa.key_len, 1);
memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->attr.wpa.key,
- pstrHostIFkeyAttr->attr.wpa.key_len);
+ pstrHostIFkeyAttr->attr.wpa.key_len);
strWIDList[0].id = (u16)WID_11I_MODE;
strWIDList[0].type = WID_CHAR;
@@ -1873,7 +1875,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
strWIDList[1].size = RX_MIC_KEY_MSG_LEN;
result = send_config_pkt(SET_CFG, strWIDList, 2,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
kfree(pu8keybuf);
up(&hif_drv->hSemTestKeyBlock);
@@ -1898,7 +1900,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->attr.wpa.index, 1);
memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->attr.wpa.key_len, 1);
memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->attr.wpa.key,
- pstrHostIFkeyAttr->attr.wpa.key_len);
+ pstrHostIFkeyAttr->attr.wpa.key_len);
strWID.id = (u16)WID_ADD_RX_GTK;
strWID.type = WID_STR;
@@ -1906,7 +1908,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
strWID.size = RX_MIC_KEY_MSG_LEN;
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
kfree(pu8keybuf);
up(&hif_drv->hSemTestKeyBlock);
@@ -1938,7 +1940,7 @@ _WPARxGtk_end_case_:
memcpy(pu8keybuf + 6, &pstrHostIFkeyAttr->attr.wpa.index, 1);
memcpy(pu8keybuf + 7, &pstrHostIFkeyAttr->attr.wpa.key_len, 1);
memcpy(pu8keybuf + 8, pstrHostIFkeyAttr->attr.wpa.key,
- pstrHostIFkeyAttr->attr.wpa.key_len);
+ pstrHostIFkeyAttr->attr.wpa.key_len);
strWIDList[0].id = (u16)WID_11I_MODE;
strWIDList[0].type = WID_CHAR;
@@ -1951,7 +1953,7 @@ _WPARxGtk_end_case_:
strWIDList[1].size = PTK_KEY_MSG_LEN + 1;
result = send_config_pkt(SET_CFG, strWIDList, 2,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
kfree(pu8keybuf);
up(&hif_drv->hSemTestKeyBlock);
}
@@ -1972,7 +1974,7 @@ _WPARxGtk_end_case_:
memcpy(pu8keybuf, pstrHostIFkeyAttr->attr.wpa.mac_addr, 6);
memcpy(pu8keybuf + 6, &pstrHostIFkeyAttr->attr.wpa.key_len, 1);
memcpy(pu8keybuf + 7, pstrHostIFkeyAttr->attr.wpa.key,
- pstrHostIFkeyAttr->attr.wpa.key_len);
+ pstrHostIFkeyAttr->attr.wpa.key_len);
strWID.id = (u16)WID_ADD_PTK;
strWID.type = WID_STR;
@@ -1980,7 +1982,7 @@ _WPARxGtk_end_case_:
strWID.size = PTK_KEY_MSG_LEN;
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
kfree(pu8keybuf);
up(&hif_drv->hSemTestKeyBlock);
}
@@ -2016,7 +2018,7 @@ _WPAPtk_end_case_:
strWID.size = (pstrHostIFkeyAttr->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1;
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
kfree(pu8keybuf);
break;
@@ -2050,7 +2052,7 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
eth_zero_addr(u8ConnectedSSID);
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result) {
PRINT_ER("Failed to send dissconect config packet\n");
@@ -2134,7 +2136,7 @@ static s32 Handle_GetChnl(struct host_if_drv *hif_drv)
PRINT_D(HOSTINF_DBG, "Getting channel value\n");
result = send_config_pkt(GET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result) {
PRINT_ER("Failed to get channel number\n");
@@ -2159,7 +2161,7 @@ static void Handle_GetRssi(struct host_if_drv *hif_drv)
PRINT_D(HOSTINF_DBG, "Getting RSSI value\n");
result = send_config_pkt(GET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result) {
PRINT_ER("Failed to get RSSI value\n");
result = -EFAULT;
@@ -2186,7 +2188,7 @@ static void Handle_GetLinkspeed(struct host_if_drv *hif_drv)
PRINT_D(HOSTINF_DBG, "Getting LINKSPEED value\n");
result = send_config_pkt(GET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result) {
PRINT_ER("Failed to get LINKSPEED value\n");
result = -EFAULT;
@@ -2233,7 +2235,7 @@ s32 Handle_GetStatistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatis
u32WidsCount++;
result = send_config_pkt(GET_CFG, strWIDList, u32WidsCount,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result)
PRINT_ER("Failed to send scan paramters config packet\n");
@@ -2263,7 +2265,7 @@ static s32 Handle_Get_InActiveTime(struct host_if_drv *hif_drv,
PRINT_D(CFG80211_DBG, "SETING STA inactive time\n");
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result) {
PRINT_ER("Failed to SET incative time\n");
@@ -2277,7 +2279,7 @@ static s32 Handle_Get_InActiveTime(struct host_if_drv *hif_drv,
strWID.size = sizeof(u32);
result = send_config_pkt(GET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result) {
PRINT_ER("Failed to get incative time\n");
@@ -2336,7 +2338,7 @@ static void Handle_AddBeacon(struct host_if_drv *hif_drv,
pu8CurrByte += pstrSetBeaconParam->tail_len;
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result)
PRINT_ER("Failed to send add beacon config packet\n");
@@ -2365,7 +2367,7 @@ static void Handle_DelBeacon(struct host_if_drv *hif_drv)
PRINT_D(HOSTINF_DBG, "Deleting BEACON\n");
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result)
PRINT_ER("Failed to send delete beacon config packet\n");
}
@@ -2436,7 +2438,7 @@ static void Handle_AddStation(struct host_if_drv *hif_drv,
pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result != 0)
PRINT_ER("Failed to send add station config packet\n");
@@ -2479,7 +2481,7 @@ static void Handle_DelAllSta(struct host_if_drv *hif_drv,
}
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result)
PRINT_ER("Failed to send add station config packet\n");
@@ -2511,7 +2513,7 @@ static void Handle_DelStation(struct host_if_drv *hif_drv,
memcpy(pu8CurrByte, pstrDelStaParam->mac_addr, ETH_ALEN);
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result)
PRINT_ER("Failed to send add station config packet\n");
@@ -2539,7 +2541,7 @@ static void Handle_EditStation(struct host_if_drv *hif_drv,
pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result)
PRINT_ER("Failed to send edit station config packet\n");
@@ -2600,7 +2602,7 @@ static int Handle_RemainOnChan(struct host_if_drv *hif_drv,
strWID.val[1] = (s8)pstrHostIfRemainOnChan->u16Channel;
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result != 0)
PRINT_ER("Failed to set remain on channel\n");
@@ -2647,7 +2649,7 @@ static int Handle_RegisterFrame(struct host_if_drv *hif_drv,
strWID.size = sizeof(u16) + 2;
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result) {
PRINT_ER("Failed to frame register config packet\n");
result = -EINVAL;
@@ -2679,7 +2681,7 @@ static u32 Handle_ListenStateExpired(struct host_if_drv *hif_drv,
strWID.val[1] = FALSE_FRMWR_CHANNEL;
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result != 0) {
PRINT_ER("Failed to set remain on channel\n");
goto _done_;
@@ -2737,7 +2739,7 @@ static void Handle_PowerManagement(struct host_if_drv *hif_drv,
PRINT_D(HOSTINF_DBG, "Handling Power Management\n");
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result)
PRINT_ER("Failed to send power management config packet\n");
}
@@ -2773,7 +2775,7 @@ static void Handle_SetMulticastFilter(struct host_if_drv *hif_drv,
memcpy(pu8CurrByte, gau8MulticastMacAddrList, ((strHostIfSetMulti->cnt) * ETH_ALEN));
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result)
PRINT_ER("Failed to send setup multicast config packet\n");
@@ -2820,7 +2822,7 @@ static s32 Handle_AddBASession(struct host_if_drv *hif_drv,
*ptr++ = 0;
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result)
PRINT_D(HOSTINF_DBG, "Couldn't open BA Session\n");
@@ -2840,7 +2842,7 @@ static s32 Handle_AddBASession(struct host_if_drv *hif_drv,
*ptr++ = ((strHostIfBASessionInfo->u16SessionTimeout >> 16) & 0xFF);
*ptr++ = 3;
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (strWID.val != NULL)
kfree(strWID.val);
@@ -2876,7 +2878,7 @@ static s32 Handle_DelAllRxBASessions(struct host_if_drv *hif_drv,
*ptr++ = 32;
result = send_config_pkt(SET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result)
PRINT_D(HOSTINF_DBG, "Couldn't delete BA Session\n");
@@ -3411,10 +3413,10 @@ s32 host_int_set_pmkid_info(struct host_if_drv *hif_drv, struct host_if_pmkid_at
msg.drv = hif_drv;
for (i = 0; i < pu8PmkidInfoArray->numpmkid; i++) {
- memcpy(msg.body.key_info.attr.pmkid.pmkidlist[i].bssid, &pu8PmkidInfoArray->pmkidlist[i].bssid,
- ETH_ALEN);
- memcpy(msg.body.key_info.attr.pmkid.pmkidlist[i].pmkid, &pu8PmkidInfoArray->pmkidlist[i].pmkid,
- PMKID_LEN);
+ memcpy(msg.body.key_info.attr.pmkid.pmkidlist[i].bssid,
+ &pu8PmkidInfoArray->pmkidlist[i].bssid, ETH_ALEN);
+ memcpy(msg.body.key_info.attr.pmkid.pmkidlist[i].pmkid,
+ &pu8PmkidInfoArray->pmkidlist[i].pmkid, PMKID_LEN);
}
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
@@ -3660,8 +3662,9 @@ s32 host_int_disconnect_station(struct host_if_drv *hif_drv, u8 assoc_id)
return 0;
}
-s32 host_int_get_assoc_req_info(struct host_if_drv *hif_drv, u8 *pu8AssocReqInfo,
- u32 u32AssocReqInfoLen)
+s32 host_int_get_assoc_req_info(struct host_if_drv *hif_drv,
+ u8 *pu8AssocReqInfo,
+ u32 u32AssocReqInfoLen)
{
struct wid strWID;
@@ -3673,8 +3676,10 @@ s32 host_int_get_assoc_req_info(struct host_if_drv *hif_drv, u8 *pu8AssocReqInfo
return 0;
}
-s32 host_int_get_assoc_res_info(struct host_if_drv *hif_drv, u8 *pu8AssocRespInfo,
- u32 u32MaxAssocRespInfoLen, u32 *pu32RcvdAssocRespInfoLen)
+s32 host_int_get_assoc_res_info(struct host_if_drv *hif_drv,
+ u8 *pu8AssocRespInfo,
+ u32 u32MaxAssocRespInfoLen,
+ u32 *pu32RcvdAssocRespInfoLen)
{
s32 result = 0;
struct wid strWID;
@@ -3690,7 +3695,7 @@ s32 host_int_get_assoc_res_info(struct host_if_drv *hif_drv, u8 *pu8AssocRespInf
strWID.size = u32MaxAssocRespInfoLen;
result = send_config_pkt(GET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result) {
*pu32RcvdAssocRespInfoLen = 0;
PRINT_ER("Failed to send association response config packet\n");
@@ -3702,8 +3707,9 @@ s32 host_int_get_assoc_res_info(struct host_if_drv *hif_drv, u8 *pu8AssocRespInf
return result;
}
-s32 host_int_get_rx_power_level(struct host_if_drv *hif_drv, u8 *pu8RxPowerLevel,
- u32 u32RxPowerLevelLen)
+s32 host_int_get_rx_power_level(struct host_if_drv *hif_drv,
+ u8 *pu8RxPowerLevel,
+ u32 u32RxPowerLevelLen)
{
struct wid strWID;
@@ -3832,10 +3838,7 @@ s32 host_int_get_inactive_time(struct host_if_drv *hif_drv,
}
memset(&msg, 0, sizeof(struct host_if_msg));
-
-
- memcpy(msg.body.mac_info.mac,
- mac, ETH_ALEN);
+ memcpy(msg.body.mac_info.mac, mac, ETH_ALEN);
msg.id = HOST_IF_MSG_GET_INACTIVETIME;
msg.drv = hif_drv;
@@ -3867,7 +3870,7 @@ s32 host_int_test_get_int_wid(struct host_if_drv *hif_drv, u32 *pu32TestMemAddr)
strWID.size = sizeof(u32);
result = send_config_pkt(GET_CFG, &strWID, 1,
- get_id_from_handler(hif_drv));
+ get_id_from_handler(hif_drv));
if (result) {
PRINT_ER("Failed to get wid value\n");
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gu32InactiveTime to inactive_time
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 59cbf90..ea3c011 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -258,7 +258,7 @@ static s8 link_speed;
static u8 ch_no;
static u8 set_ip[2][4];
static u8 get_ip[2][4];
-static u32 gu32InactiveTime;
+static u32 inactive_time;
static u8 gu8DelBcn;
static u32 gu32WidConnRstHack;
@@ -2287,7 +2287,7 @@ static s32 Handle_Get_InActiveTime(struct host_if_drv *hif_drv,
strWID.id = (u16)WID_GET_INACTIVE_TIME;
strWID.type = WID_INT;
- strWID.val = (s8 *)&gu32InactiveTime;
+ strWID.val = (s8 *)&inactive_time;
strWID.size = sizeof(u32);
@@ -2299,8 +2299,7 @@ static s32 Handle_Get_InActiveTime(struct host_if_drv *hif_drv,
return -EFAULT;
}
-
- PRINT_D(CFG80211_DBG, "Getting inactive time : %d\n", gu32InactiveTime);
+ PRINT_D(CFG80211_DBG, "Getting inactive time : %d\n", inactive_time);
up(&hif_drv->hSemInactiveTime);
@@ -3885,7 +3884,7 @@ s32 host_int_get_inactive_time(struct host_if_drv *hif_drv,
down(&hif_drv->hSemInactiveTime);
- *pu32InactiveTime = gu32InactiveTime;
+ *pu32InactiveTime = inactive_time;
return s32Error;
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch fixes the checks reported by checkpatch.pl
for comparison to NULL could be written.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 220 ++++++++++++++----------------
1 file changed, 106 insertions(+), 114 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 3209444..eea3a1a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -476,8 +476,7 @@ static s32 Handle_SetMacAddress(struct host_if_drv *hif_drv,
s32 result = 0;
struct wid strWID;
u8 *mac_buf = kmalloc(ETH_ALEN, GFP_KERNEL);
-
- if (mac_buf == NULL) {
+ if (!mac_buf) {
PRINT_ER("No buffer to send mac address\n");
return -EFAULT;
}
@@ -857,7 +856,7 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
valuesize += ((pstrHostIFscanAttr->hidden_network.pstrHiddenNetworkInfo[i].u8ssidlen) + 1);
pu8HdnNtwrksWidVal = kmalloc(valuesize + 1, GFP_KERNEL);
strWIDList[u32WidsCount].val = pu8HdnNtwrksWidVal;
- if (strWIDList[u32WidsCount].val != NULL) {
+ if (strWIDList[u32WidsCount].val) {
pu8Buffer = strWIDList[u32WidsCount].val;
*pu8Buffer++ = pstrHostIFscanAttr->hidden_network.u8ssidnum;
@@ -893,7 +892,8 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
strWIDList[u32WidsCount].id = WID_SCAN_CHANNEL_LIST;
strWIDList[u32WidsCount].type = WID_BIN_DATA;
- if (pstrHostIFscanAttr->ch_freq_list != NULL && pstrHostIFscanAttr->ch_list_len > 0) {
+ if (pstrHostIFscanAttr->ch_freq_list &&
+ pstrHostIFscanAttr->ch_list_len > 0) {
int i;
for (i = 0; i < pstrHostIFscanAttr->ch_list_len; i++) {
@@ -931,21 +931,22 @@ ERRORHANDLER:
Handle_ScanDone(hif_drv, SCAN_EVENT_ABORTED);
}
- if (pstrHostIFscanAttr->ch_freq_list != NULL) {
+ if (pstrHostIFscanAttr->ch_freq_list) {
kfree(pstrHostIFscanAttr->ch_freq_list);
pstrHostIFscanAttr->ch_freq_list = NULL;
}
- if (pstrHostIFscanAttr->ies != NULL) {
+ if (pstrHostIFscanAttr->ies) {
kfree(pstrHostIFscanAttr->ies);
pstrHostIFscanAttr->ies = NULL;
}
- if (pstrHostIFscanAttr->hidden_network.pstrHiddenNetworkInfo != NULL) {
+
+ if (pstrHostIFscanAttr->hidden_network.pstrHiddenNetworkInfo) {
kfree(pstrHostIFscanAttr->hidden_network.pstrHiddenNetworkInfo);
pstrHostIFscanAttr->hidden_network.pstrHiddenNetworkInfo = NULL;
}
- if (pu8HdnNtwrksWidVal != NULL)
+ if (pu8HdnNtwrksWidVal)
kfree(pu8HdnNtwrksWidVal);
return result;
@@ -1013,19 +1014,19 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
PRINT_INFO(HOSTINF_DBG, "Saving connection parameters in global structure\n");
ptstrJoinBssParam = (struct join_bss_param *)pstrHostIFconnectAttr->params;
- if (ptstrJoinBssParam == NULL) {
+ if (!ptstrJoinBssParam) {
PRINT_ER("Required BSSID not found\n");
result = -ENOENT;
goto ERRORHANDLER;
}
- if (pstrHostIFconnectAttr->bssid != NULL) {
+ if (pstrHostIFconnectAttr->bssid) {
hif_drv->strWILC_UsrConnReq.pu8bssid = kmalloc(6, GFP_KERNEL);
memcpy(hif_drv->strWILC_UsrConnReq.pu8bssid, pstrHostIFconnectAttr->bssid, 6);
}
hif_drv->strWILC_UsrConnReq.ssidLen = pstrHostIFconnectAttr->ssid_len;
- if (pstrHostIFconnectAttr->ssid != NULL) {
+ if (pstrHostIFconnectAttr->ssid) {
hif_drv->strWILC_UsrConnReq.pu8ssid = kmalloc(pstrHostIFconnectAttr->ssid_len + 1, GFP_KERNEL);
memcpy(hif_drv->strWILC_UsrConnReq.pu8ssid,
pstrHostIFconnectAttr->ssid,
@@ -1034,7 +1035,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
}
hif_drv->strWILC_UsrConnReq.ConnReqIEsLen = pstrHostIFconnectAttr->ies_len;
- if (pstrHostIFconnectAttr->ies != NULL) {
+ if (pstrHostIFconnectAttr->ies) {
hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
memcpy(hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs,
pstrHostIFconnectAttr->ies,
@@ -1112,15 +1113,14 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
join_req_size = strWIDList[u32WidsCount].size;
join_req = kmalloc(join_req_size, GFP_KERNEL);
}
- if (strWIDList[u32WidsCount].val == NULL) {
+ if (!strWIDList[u32WidsCount].val) {
result = -EFAULT;
goto ERRORHANDLER;
}
pu8CurrByte = strWIDList[u32WidsCount].val;
-
- if (pstrHostIFconnectAttr->ssid != NULL) {
+ if (pstrHostIFconnectAttr->ssid) {
memcpy(pu8CurrByte, pstrHostIFconnectAttr->ssid, pstrHostIFconnectAttr->ssid_len);
pu8CurrByte[pstrHostIFconnectAttr->ssid_len] = '\0';
}
@@ -1213,7 +1213,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
PRINT_D(GENERIC_DBG, "send HOST_IF_WAITING_CONN_RESP\n");
- if (pstrHostIFconnectAttr->bssid != NULL) {
+ if (pstrHostIFconnectAttr->bssid) {
memcpy(u8ConnectedSSID, pstrHostIFconnectAttr->bssid, ETH_ALEN);
PRINT_D(GENERIC_DBG, "save Bssid = %pM\n", pstrHostIFconnectAttr->bssid);
@@ -1241,11 +1241,11 @@ ERRORHANDLER:
memset(&strConnectInfo, 0, sizeof(tstrConnectInfo));
- if (pstrHostIFconnectAttr->result != NULL) {
- if (pstrHostIFconnectAttr->bssid != NULL)
+ if (pstrHostIFconnectAttr->result) {
+ if (pstrHostIFconnectAttr->bssid)
memcpy(strConnectInfo.au8bssid, pstrHostIFconnectAttr->bssid, 6);
- if (pstrHostIFconnectAttr->ies != NULL) {
+ if (pstrHostIFconnectAttr->ies) {
strConnectInfo.ReqIEsLen = pstrHostIFconnectAttr->ies_len;
strConnectInfo.pu8ReqIEs = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
memcpy(strConnectInfo.pu8ReqIEs,
@@ -1259,7 +1259,7 @@ ERRORHANDLER:
NULL,
pstrHostIFconnectAttr->arg);
hif_drv->enuHostIFstate = HOST_IF_IDLE;
- if (strConnectInfo.pu8ReqIEs != NULL) {
+ if (strConnectInfo.pu8ReqIEs) {
kfree(strConnectInfo.pu8ReqIEs);
strConnectInfo.pu8ReqIEs = NULL;
}
@@ -1270,22 +1270,22 @@ ERRORHANDLER:
}
PRINT_D(HOSTINF_DBG, "Deallocating connection parameters\n");
- if (pstrHostIFconnectAttr->bssid != NULL) {
+ if (pstrHostIFconnectAttr->bssid) {
kfree(pstrHostIFconnectAttr->bssid);
pstrHostIFconnectAttr->bssid = NULL;
}
- if (pstrHostIFconnectAttr->ssid != NULL) {
+ if (pstrHostIFconnectAttr->ssid) {
kfree(pstrHostIFconnectAttr->ssid);
pstrHostIFconnectAttr->ssid = NULL;
}
- if (pstrHostIFconnectAttr->ies != NULL) {
+ if (pstrHostIFconnectAttr->ies) {
kfree(pstrHostIFconnectAttr->ies);
pstrHostIFconnectAttr->ies = NULL;
}
- if (pu8CurrByte != NULL)
+ if (pu8CurrByte)
kfree(pu8CurrByte);
return result;
@@ -1357,13 +1357,13 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
memset(&strConnectInfo, 0, sizeof(tstrConnectInfo));
- if (hif_drv->strWILC_UsrConnReq.pfUserConnectResult != NULL) {
- if (hif_drv->strWILC_UsrConnReq.pu8bssid != NULL) {
+ if (hif_drv->strWILC_UsrConnReq.pfUserConnectResult) {
+ if (hif_drv->strWILC_UsrConnReq.pu8bssid) {
memcpy(strConnectInfo.au8bssid,
hif_drv->strWILC_UsrConnReq.pu8bssid, 6);
}
- if (hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs != NULL) {
+ if (hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs) {
strConnectInfo.ReqIEsLen = hif_drv->strWILC_UsrConnReq.ConnReqIEsLen;
strConnectInfo.pu8ReqIEs = kmalloc(hif_drv->strWILC_UsrConnReq.ConnReqIEsLen, GFP_KERNEL);
memcpy(strConnectInfo.pu8ReqIEs,
@@ -1377,7 +1377,7 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
NULL,
hif_drv->strWILC_UsrConnReq.u32UserConnectPvoid);
- if (strConnectInfo.pu8ReqIEs != NULL) {
+ if (strConnectInfo.pu8ReqIEs) {
kfree(strConnectInfo.pu8ReqIEs);
strConnectInfo.pu8ReqIEs = NULL;
}
@@ -1405,12 +1405,12 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
eth_zero_addr(u8ConnectedSSID);
- if (join_req != NULL && join_req_drv == hif_drv) {
+ if (join_req && join_req_drv == hif_drv) {
kfree(join_req);
join_req = NULL;
}
- if (info_element != NULL && join_req_drv == hif_drv) {
+ if (info_element && join_req_drv == hif_drv) {
kfree(info_element);
info_element = NULL;
}
@@ -1433,8 +1433,8 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,
if (hif_drv->strWILC_UsrScanReq.pfUserScanResult) {
PRINT_D(HOSTINF_DBG, "State: Scanning, parsing network information received\n");
parse_network_info(pstrRcvdNetworkInfo->buffer, &pstrNetworkInfo);
- if ((pstrNetworkInfo == NULL)
- || (hif_drv->strWILC_UsrScanReq.pfUserScanResult == NULL)) {
+ if ((!pstrNetworkInfo) ||
+ (!hif_drv->strWILC_UsrScanReq.pfUserScanResult)) {
PRINT_ER("driver is null\n");
result = -EINVAL;
goto done;
@@ -1442,8 +1442,8 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,
for (i = 0; i < hif_drv->strWILC_UsrScanReq.u32RcvdChCount; i++) {
- if ((hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[i].au8bssid != NULL) &&
- (pstrNetworkInfo->au8bssid != NULL)) {
+ if ((hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[i].au8bssid) &&
+ (pstrNetworkInfo->au8bssid)) {
if (memcmp(hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[i].au8bssid,
pstrNetworkInfo->au8bssid, 6) == 0) {
if (pstrNetworkInfo->s8rssi <= hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[i].s8rssi) {
@@ -1464,8 +1464,8 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,
if (hif_drv->strWILC_UsrScanReq.u32RcvdChCount < MAX_NUM_SCANNED_NETWORKS) {
hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[hif_drv->strWILC_UsrScanReq.u32RcvdChCount].s8rssi = pstrNetworkInfo->s8rssi;
- if ((hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[hif_drv->strWILC_UsrScanReq.u32RcvdChCount].au8bssid != NULL)
- && (pstrNetworkInfo->au8bssid != NULL)) {
+ if (hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[hif_drv->strWILC_UsrScanReq.u32RcvdChCount].au8bssid &&
+ pstrNetworkInfo->au8bssid) {
memcpy(hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[hif_drv->strWILC_UsrScanReq.u32RcvdChCount].au8bssid,
pstrNetworkInfo->au8bssid, 6);
@@ -1491,12 +1491,12 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,
}
done:
- if (pstrRcvdNetworkInfo->buffer != NULL) {
+ if (pstrRcvdNetworkInfo->buffer) {
kfree(pstrRcvdNetworkInfo->buffer);
pstrRcvdNetworkInfo->buffer = NULL;
}
- if (pstrNetworkInfo != NULL) {
+ if (pstrNetworkInfo) {
DeallocateNetworkInfo(pstrNetworkInfo);
pstrNetworkInfo = NULL;
}
@@ -1530,8 +1530,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
if ((hif_drv->enuHostIFstate == HOST_IF_WAITING_CONN_RESP) ||
(hif_drv->enuHostIFstate == HOST_IF_CONNECTED) ||
hif_drv->strWILC_UsrScanReq.pfUserScanResult) {
- if ((pstrRcvdGnrlAsyncInfo->buffer == NULL) ||
- (hif_drv->strWILC_UsrConnReq.pfUserConnectResult == NULL)) {
+ if (!pstrRcvdGnrlAsyncInfo->buffer ||
+ !hif_drv->strWILC_UsrConnReq.pfUserConnectResult) {
PRINT_ER("driver is null\n");
return -EINVAL;
}
@@ -1581,7 +1581,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
if (strConnectInfo.u16ConnectStatus == SUCCESSFUL_STATUSCODE) {
PRINT_INFO(HOSTINF_DBG, "Association response received : Successful connection status\n");
- if (pstrConnectRespInfo->pu8RespIEs != NULL) {
+ if (pstrConnectRespInfo->pu8RespIEs) {
strConnectInfo.u16RespIEsLen = pstrConnectRespInfo->u16RespIEsLen;
@@ -1591,7 +1591,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
}
}
- if (pstrConnectRespInfo != NULL) {
+ if (pstrConnectRespInfo) {
DeallocateAssocRespInfo(pstrConnectRespInfo);
pstrConnectRespInfo = NULL;
}
@@ -1609,7 +1609,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
eth_zero_addr(u8ConnectedSSID);
}
- if (hif_drv->strWILC_UsrConnReq.pu8bssid != NULL) {
+ if (hif_drv->strWILC_UsrConnReq.pu8bssid) {
PRINT_D(HOSTINF_DBG, "Retrieving actual BSSID from AP\n");
memcpy(strConnectInfo.au8bssid, hif_drv->strWILC_UsrConnReq.pu8bssid, 6);
@@ -1621,7 +1621,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
}
- if (hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs != NULL) {
+ if (hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs) {
strConnectInfo.ReqIEsLen = hif_drv->strWILC_UsrConnReq.ConnReqIEsLen;
strConnectInfo.pu8ReqIEs = kmalloc(hif_drv->strWILC_UsrConnReq.ConnReqIEsLen, GFP_KERNEL);
memcpy(strConnectInfo.pu8ReqIEs,
@@ -1654,12 +1654,12 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
scan_while_connected = false;
}
- if (strConnectInfo.pu8RespIEs != NULL) {
+ if (strConnectInfo.pu8RespIEs) {
kfree(strConnectInfo.pu8RespIEs);
strConnectInfo.pu8RespIEs = NULL;
}
- if (strConnectInfo.pu8ReqIEs != NULL) {
+ if (strConnectInfo.pu8ReqIEs) {
kfree(strConnectInfo.pu8ReqIEs);
strConnectInfo.pu8ReqIEs = NULL;
}
@@ -1684,7 +1684,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
strDisconnectNotifInfo.ie = NULL;
strDisconnectNotifInfo.ie_len = 0;
- if (hif_drv->strWILC_UsrConnReq.pfUserConnectResult != NULL) {
+ if (hif_drv->strWILC_UsrConnReq.pfUserConnectResult) {
g_obtainingIP = false;
host_int_set_power_mgmt(hif_drv, 0, 0);
@@ -1706,12 +1706,12 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
hif_drv->strWILC_UsrConnReq.ConnReqIEsLen = 0;
kfree(hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs);
- if (join_req != NULL && join_req_drv == hif_drv) {
+ if (join_req && join_req_drv == hif_drv) {
kfree(join_req);
join_req = NULL;
}
- if (info_element != NULL && join_req_drv == hif_drv) {
+ if (info_element && join_req_drv == hif_drv) {
kfree(info_element);
info_element = NULL;
}
@@ -1720,7 +1720,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
scan_while_connected = false;
} else if ((u8MacStatus == MAC_DISCONNECTED) &&
- (hif_drv->strWILC_UsrScanReq.pfUserScanResult != NULL)) {
+ (hif_drv->strWILC_UsrScanReq.pfUserScanResult)) {
PRINT_D(HOSTINF_DBG, "Received MAC_DISCONNECTED from the FW while scanning\n");
PRINT_D(HOSTINF_DBG, "\n\n<< Abort the running Scan >>\n\n");
@@ -1732,7 +1732,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
}
- if (pstrRcvdGnrlAsyncInfo->buffer != NULL) {
+ if (pstrRcvdGnrlAsyncInfo->buffer) {
kfree(pstrRcvdGnrlAsyncInfo->buffer);
pstrRcvdGnrlAsyncInfo->buffer = NULL;
}
@@ -1777,8 +1777,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
strWIDList[2].size = sizeof(char);
pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len, GFP_KERNEL);
-
- if (pu8keybuf == NULL) {
+ if (!pu8keybuf) {
PRINT_ER("No buffer to send Key\n");
return -1;
}
@@ -1803,7 +1802,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
if (pstrHostIFkeyAttr->action & ADDKEY) {
PRINT_D(HOSTINF_DBG, "Handling WEP key\n");
pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len + 2, GFP_KERNEL);
- if (pu8keybuf == NULL) {
+ if (!pu8keybuf) {
PRINT_ER("No buffer to send Key\n");
return -1;
}
@@ -1850,13 +1849,13 @@ static int Handle_Key(struct host_if_drv *hif_drv,
case WPARxGtk:
if (pstrHostIFkeyAttr->action & ADDKEY_AP) {
pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
- if (pu8keybuf == NULL) {
+ if (!pu8keybuf) {
PRINT_ER("No buffer to send RxGTK Key\n");
ret = -1;
goto _WPARxGtk_end_case_;
}
- if (pstrHostIFkeyAttr->attr.wpa.seq != NULL)
+ if (pstrHostIFkeyAttr->attr.wpa.seq)
memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->attr.wpa.seq, 8);
memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->attr.wpa.index, 1);
@@ -1926,10 +1925,7 @@ _WPARxGtk_end_case_:
pu8keybuf = kmalloc(PTK_KEY_MSG_LEN + 1, GFP_KERNEL);
-
-
-
- if (pu8keybuf == NULL) {
+ if (!pu8keybuf) {
PRINT_ER("No buffer to send PTK Key\n");
ret = -1;
goto _WPAPtk_end_case_;
@@ -1961,10 +1957,7 @@ _WPARxGtk_end_case_:
pu8keybuf = kmalloc(PTK_KEY_MSG_LEN, GFP_KERNEL);
-
-
-
- if (pu8keybuf == NULL) {
+ if (!pu8keybuf) {
PRINT_ER("No buffer to send PTK Key\n");
ret = -1;
goto _WPAPtk_end_case_;
@@ -2000,7 +1993,7 @@ _WPAPtk_end_case_:
PRINT_D(HOSTINF_DBG, "Handling PMKSA key\n");
pu8keybuf = kmalloc((pstrHostIFkeyAttr->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1, GFP_KERNEL);
- if (pu8keybuf == NULL) {
+ if (!pu8keybuf) {
PRINT_ER("No buffer to send PMKSA Key\n");
return -1;
}
@@ -2073,7 +2066,7 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
hif_drv->strWILC_UsrScanReq.pfUserScanResult = NULL;
}
- if (hif_drv->strWILC_UsrConnReq.pfUserConnectResult != NULL) {
+ if (hif_drv->strWILC_UsrConnReq.pfUserConnectResult) {
if (hif_drv->enuHostIFstate == HOST_IF_WAITING_CONN_RESP) {
PRINT_D(HOSTINF_DBG, "Upper layer requested termination of connection\n");
del_timer(&hif_drv->hConnectTimer);
@@ -2097,12 +2090,12 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
hif_drv->strWILC_UsrConnReq.ConnReqIEsLen = 0;
kfree(hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs);
- if (join_req != NULL && join_req_drv == hif_drv) {
+ if (join_req && join_req_drv == hif_drv) {
kfree(join_req);
join_req = NULL;
}
- if (info_element != NULL && join_req_drv == hif_drv) {
+ if (info_element && join_req_drv == hif_drv) {
kfree(info_element);
info_element = NULL;
}
@@ -2306,7 +2299,7 @@ static void Handle_AddBeacon(struct host_if_drv *hif_drv,
strWID.type = WID_BIN;
strWID.size = pstrSetBeaconParam->head_len + pstrSetBeaconParam->tail_len + 16;
strWID.val = kmalloc(strWID.size, GFP_KERNEL);
- if (strWID.val == NULL)
+ if (!strWID.val)
goto ERRORHANDLER;
pu8CurrByte = strWID.val;
@@ -2359,7 +2352,7 @@ static void Handle_DelBeacon(struct host_if_drv *hif_drv)
strWID.size = sizeof(char);
strWID.val = &del_beacon;
- if (strWID.val == NULL)
+ if (!strWID.val)
return;
pu8CurrByte = strWID.val;
@@ -2431,7 +2424,7 @@ static void Handle_AddStation(struct host_if_drv *hif_drv,
strWID.size = WILC_ADD_STA_LENGTH + pstrStationParam->u8NumRates;
strWID.val = kmalloc(strWID.size, GFP_KERNEL);
- if (strWID.val == NULL)
+ if (!strWID.val)
goto ERRORHANDLER;
pu8CurrByte = strWID.val;
@@ -2464,7 +2457,7 @@ static void Handle_DelAllSta(struct host_if_drv *hif_drv,
PRINT_D(HOSTINF_DBG, "Handling delete station\n");
strWID.val = kmalloc((pstrDelAllStaParam->assoc_sta * ETH_ALEN) + 1, GFP_KERNEL);
- if (strWID.val == NULL)
+ if (!strWID.val)
goto ERRORHANDLER;
pu8CurrByte = strWID.val;
@@ -2505,7 +2498,7 @@ static void Handle_DelStation(struct host_if_drv *hif_drv,
PRINT_D(HOSTINF_DBG, "Handling delete station\n");
strWID.val = kmalloc(strWID.size, GFP_KERNEL);
- if (strWID.val == NULL)
+ if (!strWID.val)
goto ERRORHANDLER;
pu8CurrByte = strWID.val;
@@ -2534,7 +2527,7 @@ static void Handle_EditStation(struct host_if_drv *hif_drv,
PRINT_D(HOSTINF_DBG, "Handling edit station\n");
strWID.val = kmalloc(strWID.size, GFP_KERNEL);
- if (strWID.val == NULL)
+ if (!strWID.val)
goto ERRORHANDLER;
pu8CurrByte = strWID.val;
@@ -2567,7 +2560,7 @@ static int Handle_RemainOnChan(struct host_if_drv *hif_drv,
pstrHostIfRemainOnChan->u16Channel = hif_drv->strHostIfRemainOnChan.u16Channel;
}
- if (hif_drv->strWILC_UsrScanReq.pfUserScanResult != NULL) {
+ if (hif_drv->strWILC_UsrScanReq.pfUserScanResult) {
PRINT_INFO(GENERIC_DBG, "Required to remain on chan while scanning return\n");
hif_drv->u8RemainOnChan_pendingreq = 1;
result = -EBUSY;
@@ -2592,8 +2585,7 @@ static int Handle_RemainOnChan(struct host_if_drv *hif_drv,
strWID.type = WID_STR;
strWID.size = 2;
strWID.val = kmalloc(strWID.size, GFP_KERNEL);
-
- if (strWID.val == NULL) {
+ if (!strWID.val) {
result = -ENOMEM;
goto ERRORHANDLER;
}
@@ -2636,7 +2628,7 @@ static int Handle_RegisterFrame(struct host_if_drv *hif_drv,
strWID.id = (u16)WID_REGISTER_FRAME;
strWID.type = WID_STR;
strWID.val = kmalloc(sizeof(u16) + 2, GFP_KERNEL);
- if (strWID.val == NULL)
+ if (!strWID.val)
return -ENOMEM;
pu8CurrByte = strWID.val;
@@ -2674,7 +2666,7 @@ static u32 Handle_ListenStateExpired(struct host_if_drv *hif_drv,
strWID.size = 2;
strWID.val = kmalloc(strWID.size, GFP_KERNEL);
- if (strWID.val == NULL)
+ if (!strWID.val)
PRINT_ER("Failed to allocate memory\n");
strWID.val[0] = u8remain_on_chan_flag;
@@ -2757,7 +2749,7 @@ static void Handle_SetMulticastFilter(struct host_if_drv *hif_drv,
strWID.type = WID_BIN;
strWID.size = sizeof(struct set_multicast) + ((strHostIfSetMulti->cnt) * ETH_ALEN);
strWID.val = kmalloc(strWID.size, GFP_KERNEL);
- if (strWID.val == NULL)
+ if (!strWID.val)
goto ERRORHANDLER;
pu8CurrByte = strWID.val;
@@ -2844,7 +2836,7 @@ static s32 Handle_AddBASession(struct host_if_drv *hif_drv,
result = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
- if (strWID.val != NULL)
+ if (strWID.val)
kfree(strWID.val);
return result;
@@ -2882,8 +2874,7 @@ static s32 Handle_DelAllRxBASessions(struct host_if_drv *hif_drv,
if (result)
PRINT_D(HOSTINF_DBG, "Couldn't delete BA Session\n");
-
- if (strWID.val != NULL)
+ if (strWID.val)
kfree(strWID.val);
up(&hif_sema_wait_response);
@@ -2914,7 +2905,8 @@ static int hostIFthread(void *pvArg)
continue;
}
- if (msg.id == HOST_IF_MSG_CONNECT && hif_drv->strWILC_UsrScanReq.pfUserScanResult != NULL) {
+ if (msg.id == HOST_IF_MSG_CONNECT &&
+ hif_drv->strWILC_UsrScanReq.pfUserScanResult) {
PRINT_D(HOSTINF_DBG, "Requeue connect request till scan done received\n");
wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
usleep_range(2 * 1000, 2 * 1000);
@@ -3282,9 +3274,11 @@ s32 host_int_add_ptk(struct host_if_drv *hif_drv, const u8 *pu8Ptk,
PRINT_ER("driver is null\n");
return -EFAULT;
}
- if (pu8RxMic != NULL)
+
+ if (pu8RxMic)
u8KeyLen += RX_MIC_KEY_LEN;
- if (pu8TxMic != NULL)
+
+ if (pu8TxMic)
u8KeyLen += TX_MIC_KEY_LEN;
memset(&msg, 0, sizeof(struct host_if_msg));
@@ -3302,14 +3296,14 @@ s32 host_int_add_ptk(struct host_if_drv *hif_drv, const u8 *pu8Ptk,
msg.body.key_info.attr.wpa.key = kmalloc(u8PtkKeylen, GFP_KERNEL);
memcpy(msg.body.key_info.attr.wpa.key, pu8Ptk, u8PtkKeylen);
- if (pu8RxMic != NULL) {
+ if (pu8RxMic) {
memcpy(msg.body.key_info.attr.wpa.key + 16, pu8RxMic, RX_MIC_KEY_LEN);
if (INFO) {
for (i = 0; i < RX_MIC_KEY_LEN; i++)
PRINT_INFO(CFG80211_DBG, "PairwiseRx[%d] = %x\n", i, pu8RxMic[i]);
}
}
- if (pu8TxMic != NULL) {
+ if (pu8TxMic) {
memcpy(msg.body.key_info.attr.wpa.key + 24, pu8TxMic, TX_MIC_KEY_LEN);
if (INFO) {
for (i = 0; i < TX_MIC_KEY_LEN; i++)
@@ -3348,12 +3342,13 @@ s32 host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *pu8RxGtk,
}
memset(&msg, 0, sizeof(struct host_if_msg));
-
- if (pu8RxMic != NULL)
+ if (pu8RxMic)
u8KeyLen += RX_MIC_KEY_LEN;
- if (pu8TxMic != NULL)
+
+ if (pu8TxMic)
u8KeyLen += TX_MIC_KEY_LEN;
- if (KeyRSC != NULL) {
+
+ if (KeyRSC) {
msg.body.key_info.attr.wpa.seq = kmalloc(u32KeyRSClen, GFP_KERNEL);
memcpy(msg.body.key_info.attr.wpa.seq, KeyRSC, u32KeyRSClen);
}
@@ -3373,10 +3368,11 @@ s32 host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *pu8RxGtk,
msg.body.key_info.attr.wpa.key = kmalloc(u8KeyLen, GFP_KERNEL);
memcpy(msg.body.key_info.attr.wpa.key, pu8RxGtk, u8GtkKeylen);
- if (pu8RxMic != NULL) {
+ if (pu8RxMic) {
memcpy(msg.body.key_info.attr.wpa.key + 16, pu8RxMic, RX_MIC_KEY_LEN);
}
- if (pu8TxMic != NULL) {
+
+ if (pu8TxMic) {
memcpy(msg.body.key_info.attr.wpa.key + 24, pu8TxMic, TX_MIC_KEY_LEN);
}
@@ -3544,12 +3540,12 @@ s32 host_int_set_join_req(struct host_if_drv *hif_drv, u8 *pu8bssid,
struct host_if_msg msg;
enum scan_conn_timer enuScanConnTimer;
- if (!hif_drv || pfConnectResult == NULL) {
+ if (!hif_drv || !pfConnectResult) {
PRINT_ER("Driver is null\n");
return -EFAULT;
}
- if (pJoinParams == NULL) {
+ if (!pJoinParams) {
PRINT_ER("Unable to Join - JoinParams is NULL\n");
return -EFAULT;
}
@@ -3566,18 +3562,18 @@ s32 host_int_set_join_req(struct host_if_drv *hif_drv, u8 *pu8bssid,
msg.body.con_info.params = pJoinParams;
msg.drv = hif_drv ;
- if (pu8bssid != NULL) {
+ if (pu8bssid) {
msg.body.con_info.bssid = kmalloc(6, GFP_KERNEL);
memcpy(msg.body.con_info.bssid, pu8bssid, 6);
}
- if (pu8ssid != NULL) {
+ if (pu8ssid) {
msg.body.con_info.ssid_len = ssidLen;
msg.body.con_info.ssid = kmalloc(ssidLen, GFP_KERNEL);
memcpy(msg.body.con_info.ssid, pu8ssid, ssidLen);
}
- if (pu8IEs != NULL) {
+ if (pu8IEs) {
msg.body.con_info.ies_len = IEsLen;
msg.body.con_info.ies = kmalloc(IEsLen, GFP_KERNEL);
memcpy(msg.body.con_info.ies, pu8IEs, IEsLen);
@@ -3900,8 +3896,7 @@ s32 host_int_get_rssi(struct host_if_drv *hif_drv, s8 *ps8Rssi)
down(&hif_drv->hSemGetRSSI);
-
- if (ps8Rssi == NULL) {
+ if (!ps8Rssi) {
PRINT_ER("RSS pointer value is null");
return -EFAULT;
}
@@ -3928,8 +3923,7 @@ s32 host_int_get_link_speed(struct host_if_drv *hif_drv, s8 *ps8lnkspd)
down(&hif_drv->hSemGetLINKSPEED);
-
- if (ps8lnkspd == NULL) {
+ if (!ps8lnkspd) {
PRINT_ER("LINKSPEED pointer value is null");
return -EFAULT;
}
@@ -3969,7 +3963,7 @@ s32 host_int_scan(struct host_if_drv *hif_drv, u8 u8ScanSource,
struct host_if_msg msg;
enum scan_conn_timer enuScanConnTimer;
- if (!hif_drv || ScanResult == NULL) {
+ if (!hif_drv || !ScanResult) {
PRINT_ER("hif_drv or ScanResult = NULL\n");
return -EFAULT;
}
@@ -3978,7 +3972,7 @@ s32 host_int_scan(struct host_if_drv *hif_drv, u8 u8ScanSource,
msg.id = HOST_IF_MSG_SCAN;
- if (pstrHiddenNetwork != NULL) {
+ if (pstrHiddenNetwork) {
msg.body.scan_info.hidden_network.pstrHiddenNetworkInfo = pstrHiddenNetwork->pstrHiddenNetworkInfo;
msg.body.scan_info.hidden_network.u8ssidnum = pstrHiddenNetwork->u8ssidnum;
@@ -4572,7 +4566,7 @@ s32 host_int_add_beacon(struct host_if_drv *hif_drv, u32 u32Interval,
pstrSetBeaconParam->dtim_period = u32DTIMPeriod;
pstrSetBeaconParam->head_len = u32HeadLen;
pstrSetBeaconParam->head = kmalloc(u32HeadLen, GFP_KERNEL);
- if (pstrSetBeaconParam->head == NULL) {
+ if (!pstrSetBeaconParam->head) {
result = -ENOMEM;
goto ERRORHANDLER;
}
@@ -4581,7 +4575,7 @@ s32 host_int_add_beacon(struct host_if_drv *hif_drv, u32 u32Interval,
if (u32TailLen > 0) {
pstrSetBeaconParam->tail = kmalloc(u32TailLen, GFP_KERNEL);
- if (pstrSetBeaconParam->tail == NULL) {
+ if (!pstrSetBeaconParam->tail) {
result = -ENOMEM;
goto ERRORHANDLER;
}
@@ -4596,10 +4590,10 @@ s32 host_int_add_beacon(struct host_if_drv *hif_drv, u32 u32Interval,
ERRORHANDLER:
if (result) {
- if (pstrSetBeaconParam->head != NULL)
+ if (pstrSetBeaconParam->head)
kfree(pstrSetBeaconParam->head);
- if (pstrSetBeaconParam->tail != NULL)
+ if (pstrSetBeaconParam->tail)
kfree(pstrSetBeaconParam->tail);
}
@@ -4650,7 +4644,6 @@ s32 host_int_add_station(struct host_if_drv *hif_drv,
memcpy(pstrAddStationMsg, pstrStaParams, sizeof(struct add_sta_param));
if (pstrAddStationMsg->u8NumRates > 0) {
u8 *rates = kmalloc(pstrAddStationMsg->u8NumRates, GFP_KERNEL);
-
if (!rates)
return -ENOMEM;
@@ -4682,7 +4675,7 @@ s32 host_int_del_station(struct host_if_drv *hif_drv, const u8 *pu8MacAddr)
msg.id = HOST_IF_MSG_DEL_STATION;
msg.drv = hif_drv;
- if (pu8MacAddr == NULL)
+ if (!pu8MacAddr)
memset(pstrDelStationMsg->mac_addr, 255, ETH_ALEN);
else
memcpy(pstrDelStationMsg->mac_addr, pu8MacAddr, ETH_ALEN);
@@ -4767,7 +4760,6 @@ s32 host_int_edit_station(struct host_if_drv *hif_drv,
memcpy(pstrAddStationMsg, pstrStaParams, sizeof(struct add_sta_param));
if (pstrAddStationMsg->u8NumRates > 0) {
u8 *rates = kmalloc(pstrAddStationMsg->u8NumRates, GFP_KERNEL);
-
if (!rates)
return -ENOMEM;
@@ -4862,7 +4854,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
u16IEsLen = ptstrNetworkInfo->u16IEsLen;
pNewJoinBssParam = kzalloc(sizeof(struct join_bss_param), GFP_KERNEL);
- if (pNewJoinBssParam != NULL) {
+ if (pNewJoinBssParam) {
pNewJoinBssParam->dtim_period = ptstrNetworkInfo->u8DtimPeriod;
pNewJoinBssParam->beacon_period = ptstrNetworkInfo->u16BeaconPeriod;
pNewJoinBssParam->cap_info = ptstrNetworkInfo->u16CapInfo;
@@ -5006,7 +4998,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
void host_int_freeJoinParams(void *pJoinParams)
{
- if ((struct bss_param *)pJoinParams != NULL)
+ if ((struct bss_param *)pJoinParams)
kfree((struct bss_param *)pJoinParams);
else
PRINT_ER("Unable to FREE null pointer\n");
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames u8NoaEnbaled of struct join_bss_param to noa_enabled
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index e2588ef..2b8e412 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -219,7 +219,7 @@ struct join_bss_param {
u8 rsn_auth_policy[3];
u8 rsn_cap[2];
u32 tsf;
- u8 u8NoaEnbaled;
+ u8 noa_enabled;
u8 u8OppEnable;
u8 u8CtWindow;
u8 u8Count;
@@ -1184,9 +1184,9 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
pu8CurrByte += sizeof(ptstrJoinBssParam->rsn_cap);
*(pu8CurrByte++) = REAL_JOIN_REQ;
+ *(pu8CurrByte++) = ptstrJoinBssParam->noa_enabled;
- *(pu8CurrByte++) = ptstrJoinBssParam->u8NoaEnbaled;
- if (ptstrJoinBssParam->u8NoaEnbaled) {
+ if (ptstrJoinBssParam->noa_enabled) {
PRINT_D(HOSTINF_DBG, "NOA present\n");
*(pu8CurrByte++) = (ptstrJoinBssParam->tsf) & 0xFF;
@@ -4984,7 +4984,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
u16 u16P2P_count;
pNewJoinBssParam->tsf = ptstrNetworkInfo->u32Tsf;
- pNewJoinBssParam->u8NoaEnbaled = 1;
+ pNewJoinBssParam->noa_enabled = 1;
pNewJoinBssParam->u8Index = pu8IEs[index + 9];
if (pu8IEs[index + 10] & BIT(7)) {
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames u8CtWindow of struct join_bss_param to ct_window
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 91e7072..07c5213 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -221,7 +221,7 @@ struct join_bss_param {
u32 tsf;
u8 noa_enabled;
u8 opp_enabled;
- u8 u8CtWindow;
+ u8 ct_window;
u8 u8Count;
u8 u8Index;
u8 au8Duration[4];
@@ -1198,7 +1198,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
*(pu8CurrByte++) = ptstrJoinBssParam->opp_enabled;
if (ptstrJoinBssParam->opp_enabled)
- *(pu8CurrByte++) = ptstrJoinBssParam->u8CtWindow;
+ *(pu8CurrByte++) = ptstrJoinBssParam->ct_window;
*(pu8CurrByte++) = ptstrJoinBssParam->u8Count;
@@ -4988,7 +4988,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
if (pu8IEs[index + 10] & BIT(7)) {
pNewJoinBssParam->opp_enabled = 1;
- pNewJoinBssParam->u8CtWindow = pu8IEs[index + 10];
+ pNewJoinBssParam->ct_window = pu8IEs[index + 10];
} else {
pNewJoinBssParam->opp_enabled = 0;
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gu8FlushedJoinReqDrvHandler to join_req_drv
to avoid CamelCase naming convention.
Add to static because follow warning reported by kbuild system.
- drivers/staging/wilc1000/host_interface.c:270:20: sparse: symbol
'join_req_drv' was not declared. Should it be static?
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
mode change 100755 => 100644 drivers/staging/wilc1000/host_interface.c
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
old mode 100755
new mode 100644
index 9d747b5..0b3c991
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -267,7 +267,7 @@ static u8 mode_11i;
static u8 auth_type;
static u32 join_req_size;
static u32 info_element_size;
-struct host_if_drv *gu8FlushedJoinReqDrvHandler;
+static struct host_if_drv *join_req_drv;
#define REAL_JOIN_REQ 0
#define FLUSHED_JOIN_REQ 1
#define FLUSHED_BYTE_POS 79
@@ -1210,7 +1210,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
memcpy(join_req, pu8CurrByte, join_req_size);
- gu8FlushedJoinReqDrvHandler = hif_drv;
+ join_req_drv = hif_drv;
}
PRINT_D(GENERIC_DBG, "send HOST_IF_WAITING_CONN_RESP\n");
@@ -1331,7 +1331,7 @@ static s32 Handle_FlushConnect(struct host_if_drv *hif_drv)
u32WidsCount++;
s32Error = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
- get_id_from_handler(gu8FlushedJoinReqDrvHandler));
+ get_id_from_handler(join_req_drv));
if (s32Error) {
PRINT_ER("failed to send config packet\n");
s32Error = -EINVAL;
@@ -1406,12 +1406,12 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
eth_zero_addr(u8ConnectedSSID);
- if (join_req != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
+ if (join_req != NULL && join_req_drv == hif_drv) {
kfree(join_req);
join_req = NULL;
}
- if (info_element != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
+ if (info_element != NULL && join_req_drv == hif_drv) {
kfree(info_element);
info_element = NULL;
}
@@ -1710,12 +1710,12 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
hif_drv->strWILC_UsrConnReq.ConnReqIEsLen = 0;
kfree(hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs);
- if (join_req != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
+ if (join_req != NULL && join_req_drv == hif_drv) {
kfree(join_req);
join_req = NULL;
}
- if (info_element != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
+ if (info_element != NULL && join_req_drv == hif_drv) {
kfree(info_element);
info_element = NULL;
}
@@ -2103,12 +2103,12 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
hif_drv->strWILC_UsrConnReq.ConnReqIEsLen = 0;
kfree(hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs);
- if (join_req != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
+ if (join_req != NULL && join_req_drv == hif_drv) {
kfree(join_req);
join_req = NULL;
}
- if (info_element != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
+ if (info_element != NULL && join_req_drv == hif_drv) {
kfree(info_element);
info_element = NULL;
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gu32FlushedInfoElemAsocSize to info_element_size
to avoid CamelCase naming convention.
Add to static because follow warning reported by kbuild system.
- drivers/staging/wilc1000/host_interface.c:269:5: sparse: symbol
'info_element_size' was not declared. Should it be static?
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
mode change 100644 => 100755 drivers/staging/wilc1000/host_interface.c
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
old mode 100644
new mode 100755
index f41a365..9d747b5
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -266,7 +266,7 @@ static u8 *info_element;
static u8 mode_11i;
static u8 auth_type;
static u32 join_req_size;
-u32 gu32FlushedInfoElemAsocSize;
+static u32 info_element_size;
struct host_if_drv *gu8FlushedJoinReqDrvHandler;
#define REAL_JOIN_REQ 0
#define FLUSHED_JOIN_REQ 1
@@ -1074,11 +1074,10 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
u32WidsCount++;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
-
- gu32FlushedInfoElemAsocSize = hif_drv->strWILC_UsrConnReq.ConnReqIEsLen;
- info_element = kmalloc(gu32FlushedInfoElemAsocSize, GFP_KERNEL);
+ info_element_size = hif_drv->strWILC_UsrConnReq.ConnReqIEsLen;
+ info_element = kmalloc(info_element_size, GFP_KERNEL);
memcpy(info_element, hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs,
- gu32FlushedInfoElemAsocSize);
+ info_element_size);
}
}
strWIDList[u32WidsCount].id = (u16)WID_11I_MODE;
@@ -1303,7 +1302,7 @@ static s32 Handle_FlushConnect(struct host_if_drv *hif_drv)
strWIDList[u32WidsCount].id = WID_INFO_ELEMENT_ASSOCIATE;
strWIDList[u32WidsCount].type = WID_BIN_DATA;
strWIDList[u32WidsCount].val = info_element;
- strWIDList[u32WidsCount].size = gu32FlushedInfoElemAsocSize;
+ strWIDList[u32WidsCount].size = info_element_size;
u32WidsCount++;
strWIDList[u32WidsCount].id = (u16)WID_11I_MODE;
--
1.9.1
From: Leo Kim <[email protected]>
This patch removes an unnecessary variable use for the errors and
returns errors directly without a result variable.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 28 +++++++++-------------------
1 file changed, 9 insertions(+), 19 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 02c9763..08f70d8 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3200,9 +3200,8 @@ s32 host_int_add_wep_key_bss_sta(struct host_if_drv *hif_drv,
struct host_if_msg msg;
if (!hif_drv) {
- result = -EFAULT;
PRINT_ER("driver is null\n");
- return result;
+ return -EFAULT;
}
memset(&msg, 0, sizeof(struct host_if_msg));
@@ -3237,9 +3236,8 @@ s32 host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv,
u8 i;
if (!hif_drv) {
- result = -EFAULT;
PRINT_ER("driver is null\n");
- return result;
+ return -EFAULT;
}
memset(&msg, 0, sizeof(struct host_if_msg));
@@ -3279,9 +3277,8 @@ s32 host_int_add_ptk(struct host_if_drv *hif_drv, const u8 *pu8Ptk,
u32 i;
if (!hif_drv) {
- result = -EFAULT;
PRINT_ER("driver is null\n");
- return result;
+ return -EFAULT;
}
if (pu8RxMic != NULL)
u8KeyLen += RX_MIC_KEY_LEN;
@@ -3344,9 +3341,8 @@ s32 host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *pu8RxGtk,
u8 u8KeyLen = u8GtkKeylen;
if (!hif_drv) {
- result = -EFAULT;
PRINT_ER("driver is null\n");
- return result;
+ return -EFAULT;
}
memset(&msg, 0, sizeof(struct host_if_msg));
@@ -3403,9 +3399,8 @@ s32 host_int_set_pmkid_info(struct host_if_drv *hif_drv, struct host_if_pmkid_at
if (!hif_drv) {
- result = -EFAULT;
PRINT_ER("driver is null\n");
- return result;
+ return -EFAULT;
}
memset(&msg, 0, sizeof(struct host_if_msg));
@@ -3548,9 +3543,8 @@ s32 host_int_set_join_req(struct host_if_drv *hif_drv, u8 *pu8bssid,
enum scan_conn_timer enuScanConnTimer;
if (!hif_drv || pfConnectResult == NULL) {
- result = -EFAULT;
PRINT_ER("Driver is null\n");
- return result;
+ return -EFAULT;
}
if (pJoinParams == NULL) {
@@ -3610,16 +3604,12 @@ s32 host_int_flush_join_req(struct host_if_drv *hif_drv)
s32 result = 0;
struct host_if_msg msg;
- if (!join_req) {
- result = -EFAULT;
- return result;
- }
-
+ if (!join_req)
+ return -EFAULT;
if (!hif_drv) {
- result = -EFAULT;
PRINT_ER("Driver is null\n");
- return result;
+ return -EFAULT;
}
msg.id = HOST_IF_MSG_FLUSH_CONNECT;
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable hWaitResponse to hif_sema_wait_response
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 32c73b1..9346d42 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -243,7 +243,7 @@ static struct task_struct *hif_thread_handler;
static WILC_MsgQueueHandle hif_msg_q;
static struct semaphore hif_sema_thread;
static struct semaphore hif_sema_driver;
-static struct semaphore hWaitResponse;
+static struct semaphore hif_sema_wait_response;
struct semaphore hSemHostIntDeinit;
struct timer_list g_hPeriodicRSSI;
@@ -526,7 +526,7 @@ static s32 Handle_GetMacAddress(struct host_if_drv *hif_drv,
PRINT_ER("Failed to get mac address\n");
s32Error = -EFAULT;
}
- up(&hWaitResponse);
+ up(&hif_sema_wait_response);
return s32Error;
}
@@ -817,7 +817,7 @@ ERRORHANDLER:
static s32 Handle_wait_msg_q_empty(void)
{
g_wilc_initialized = 0;
- up(&hWaitResponse);
+ up(&hif_sema_wait_response);
return 0;
}
@@ -2253,7 +2253,7 @@ s32 Handle_GetStatistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatis
if (s32Error)
PRINT_ER("Failed to send scan paramters config packet\n");
- up(&hWaitResponse);
+ up(&hif_sema_wait_response);
return 0;
}
@@ -2508,7 +2508,7 @@ static void Handle_DelAllSta(struct host_if_drv *hif_drv,
ERRORHANDLER:
kfree(strWID.val);
- up(&hWaitResponse);
+ up(&hif_sema_wait_response);
}
static void Handle_DelStation(struct host_if_drv *hif_drv,
@@ -2908,7 +2908,7 @@ static s32 Handle_DelAllRxBASessions(struct host_if_drv *hif_drv,
if (strWID.val != NULL)
kfree(strWID.val);
- up(&hWaitResponse);
+ up(&hif_sema_wait_response);
return s32Error;
@@ -3505,7 +3505,7 @@ s32 host_int_get_MacAddress(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
return -EFAULT;
}
- down(&hWaitResponse);
+ down(&hif_sema_wait_response);
return s32Error;
}
@@ -3792,7 +3792,7 @@ int host_int_wait_msg_queue_idle(void)
result = -EINVAL;
}
- down(&hWaitResponse);
+ down(&hif_sema_wait_response);
return result;
}
@@ -3999,7 +3999,7 @@ s32 host_int_get_statistics(struct host_if_drv *hif_drv, struct rf_info *pstrSta
return -EFAULT;
}
- down(&hWaitResponse);
+ down(&hif_sema_wait_response);
return s32Error;
}
@@ -4229,7 +4229,7 @@ s32 host_int_init(struct host_if_drv **hif_drv_handler)
gbScanWhileConnected = false;
- sema_init(&hWaitResponse, 0);
+ sema_init(&hif_sema_wait_response, 0);
hif_drv = kzalloc(sizeof(struct host_if_drv), GFP_KERNEL);
if (!hif_drv) {
@@ -4795,7 +4795,7 @@ s32 host_int_del_allstation(struct host_if_drv *hif_drv,
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
- down(&hWaitResponse);
+ down(&hif_sema_wait_response);
return s32Error;
@@ -5091,7 +5091,7 @@ s32 host_int_delBASession(struct host_if_drv *hif_drv, char *pBSSID, char TID)
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
- down(&hWaitResponse);
+ down(&hif_sema_wait_response);
return s32Error;
}
@@ -5121,7 +5121,7 @@ s32 host_int_del_All_Rx_BASession(struct host_if_drv *hif_drv,
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
- down(&hWaitResponse);
+ down(&hif_sema_wait_response);
return s32Error;
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gu8FlushedJoinReq to join_req
to avoid CamelCase naming convention.
Add to static because follow warning reported by kbuild system.
- drivers/staging/wilc1000/host_interface.c:264:4: sparse: symbol
'join_req' was not declared. Should it be static?
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 82d058f..a97583a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -261,7 +261,7 @@ static u8 get_ip[2][4];
static u32 inactive_time;
static u8 del_beacon;
-u8 *gu8FlushedJoinReq;
+static u8 *join_req;
u8 *gu8FlushedInfoElemAsoc;
u8 gu8Flushed11iMode;
u8 gu8FlushedAuthType;
@@ -1113,7 +1113,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
gu32FlushedJoinReqSize = strWIDList[u32WidsCount].size;
- gu8FlushedJoinReq = kmalloc(gu32FlushedJoinReqSize, GFP_KERNEL);
+ join_req = kmalloc(gu32FlushedJoinReqSize, GFP_KERNEL);
}
if (strWIDList[u32WidsCount].val == NULL) {
s32Error = -EFAULT;
@@ -1210,7 +1210,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
u32WidsCount++;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
- memcpy(gu8FlushedJoinReq, pu8CurrByte, gu32FlushedJoinReqSize);
+ memcpy(join_req, pu8CurrByte, gu32FlushedJoinReqSize);
gu8FlushedJoinReqDrvHandler = hif_drv;
}
@@ -1323,7 +1323,7 @@ static s32 Handle_FlushConnect(struct host_if_drv *hif_drv)
strWIDList[u32WidsCount].id = (u16)WID_JOIN_REQ_EXTENDED;
strWIDList[u32WidsCount].type = WID_STR;
strWIDList[u32WidsCount].size = gu32FlushedJoinReqSize;
- strWIDList[u32WidsCount].val = (s8 *)gu8FlushedJoinReq;
+ strWIDList[u32WidsCount].val = (s8 *)join_req;
pu8CurrByte = strWIDList[u32WidsCount].val;
pu8CurrByte += FLUSHED_BYTE_POS;
@@ -1407,9 +1407,9 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
eth_zero_addr(u8ConnectedSSID);
- if (gu8FlushedJoinReq != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
- kfree(gu8FlushedJoinReq);
- gu8FlushedJoinReq = NULL;
+ if (join_req != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
+ kfree(join_req);
+ join_req = NULL;
}
if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
kfree(gu8FlushedInfoElemAsoc);
@@ -1710,9 +1710,9 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
hif_drv->strWILC_UsrConnReq.ConnReqIEsLen = 0;
kfree(hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs);
- if (gu8FlushedJoinReq != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
- kfree(gu8FlushedJoinReq);
- gu8FlushedJoinReq = NULL;
+ if (join_req != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
+ kfree(join_req);
+ join_req = NULL;
}
if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
kfree(gu8FlushedInfoElemAsoc);
@@ -2102,9 +2102,9 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
hif_drv->strWILC_UsrConnReq.ConnReqIEsLen = 0;
kfree(hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs);
- if (gu8FlushedJoinReq != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
- kfree(gu8FlushedJoinReq);
- gu8FlushedJoinReq = NULL;
+ if (join_req != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
+ kfree(join_req);
+ join_req = NULL;
}
if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
kfree(gu8FlushedInfoElemAsoc);
@@ -3634,7 +3634,7 @@ s32 host_int_flush_join_req(struct host_if_drv *hif_drv)
s32 s32Error = 0;
struct host_if_msg msg;
- if (!gu8FlushedJoinReq) {
+ if (!join_req) {
s32Error = -EFAULT;
return s32Error;
}
--
1.9.1
On 2015년 10월 17일 13:59, Greg KH wrote:
> On Fri, Oct 16, 2015 at 01:37:31PM +0900, Tony Cho wrote:
>> From: Leo Kim <[email protected]>
>>
>> This patch renames ssidLen of struct join_bss_param to ssid_len
>> to avoid CamelCase naming convention.
>>
>> Signed-off-by: Leo Kim <[email protected]>
>> Signed-off-by: Tony Cho <[email protected]>
>> ---
>> drivers/staging/wilc1000/host_interface.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
> Doesn't apply, I missed that you sent this as v2, why did you do that?
> What was wrong with v1?
This series of V2 includes Dan's suggestion, we don't have to add one blank line between malloc and null check if-statement.
In addition, some of global variables are declared as "static" because they are used in only one file so kbuild test robot indicated they had better be declared as "static".
So, I sent the series of them as V2. I can find the V1 of this series are already accepted so I will later make separate patch for them.
Thanks,
Tony.
> thanks,
>
> greg k-h
From: Leo Kim <[email protected]>
This patch renames variable hSemHostIFthrdEnd to hif_sema_thread
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index bb770ab1..a587080 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -241,8 +241,7 @@ bool g_obtainingIP;
u8 P2P_LISTEN_STATE;
static struct task_struct *hif_thread_handler;
static WILC_MsgQueueHandle hif_msg_q;
-static struct semaphore hSemHostIFthrdEnd;
-
+static struct semaphore hif_sema_thread;
struct semaphore hSemDeinitDrvHandle;
static struct semaphore hWaitResponse;
struct semaphore hSemHostIntDeinit;
@@ -3123,7 +3122,7 @@ static int hostIFthread(void *pvArg)
}
PRINT_D(HOSTINF_DBG, "Releasing thread exit semaphore\n");
- up(&hSemHostIFthrdEnd);
+ up(&hif_sema_thread);
return 0;
}
@@ -4250,7 +4249,7 @@ s32 host_int_init(struct host_if_drv **hif_drv_handler)
PRINT_D(HOSTINF_DBG, "Global handle pointer value=%p\n", hif_drv);
if (clients_count == 0) {
- sema_init(&hSemHostIFthrdEnd, 0);
+ sema_init(&hif_sema_thread, 0);
sema_init(&hSemDeinitDrvHandle, 0);
sema_init(&hSemHostIntDeinit, 1);
}
@@ -4383,7 +4382,7 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
if (s32Error != 0)
PRINT_ER("Error in sending deinit's message queue message function: Error(%d)\n", s32Error);
- down(&hSemHostIFthrdEnd);
+ down(&hif_sema_thread);
wilc_mq_destroy(&hif_msg_q);
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames au8Duration of struct join_bss_param to duration
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 75a4279..0c5cf08 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -224,7 +224,7 @@ struct join_bss_param {
u8 ct_window;
u8 cnt;
u8 idx;
- u8 au8Duration[4];
+ u8 duration[4];
u8 au8Interval[4];
u8 au8StartTime[4];
};
@@ -1202,9 +1202,8 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
*(pu8CurrByte++) = ptstrJoinBssParam->cnt;
- memcpy(pu8CurrByte, ptstrJoinBssParam->au8Duration, sizeof(ptstrJoinBssParam->au8Duration));
-
- pu8CurrByte += sizeof(ptstrJoinBssParam->au8Duration);
+ memcpy(pu8CurrByte, ptstrJoinBssParam->duration, sizeof(ptstrJoinBssParam->duration));
+ pu8CurrByte += sizeof(ptstrJoinBssParam->duration);
memcpy(pu8CurrByte, ptstrJoinBssParam->au8Interval, sizeof(ptstrJoinBssParam->au8Interval));
@@ -5000,7 +4999,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
pNewJoinBssParam->cnt = pu8IEs[index + 11];
u16P2P_count = index + 12;
- memcpy(pNewJoinBssParam->au8Duration, pu8IEs + u16P2P_count, 4);
+ memcpy(pNewJoinBssParam->duration, pu8IEs + u16P2P_count, 4);
u16P2P_count += 4;
memcpy(pNewJoinBssParam->au8Interval, pu8IEs + u16P2P_count, 4);
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gu8Chnl to ch_no
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 2648e43..c9126d0 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -255,7 +255,7 @@ static bool scan_while_connected;
static s8 rssi;
static s8 link_speed;
-static u8 gu8Chnl;
+static u8 ch_no;
static u8 gs8SetIP[2][4];
static u8 gs8GetIP[2][4];
static u32 gu32InactiveTime;
@@ -2137,7 +2137,7 @@ static s32 Handle_GetChnl(struct host_if_drv *hif_drv)
strWID.id = (u16)WID_CURRENT_CHANNEL;
strWID.type = WID_CHAR;
- strWID.val = (s8 *)&gu8Chnl;
+ strWID.val = (s8 *)&ch_no;
strWID.size = sizeof(char);
PRINT_D(HOSTINF_DBG, "Getting channel value\n");
@@ -3852,7 +3852,7 @@ s32 host_int_get_host_chnl_num(struct host_if_drv *hif_drv, u8 *pu8ChNo)
PRINT_ER("wilc mq send fail\n");
down(&hif_drv->hSemGetCHNL);
- *pu8ChNo = gu8Chnl;
+ *pu8ChNo = ch_no;
return s32Error;
--
1.9.1
From: Leo Kim <[email protected]>
This patch removes unused the variable gWFiDrvHandle.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 320073e..ad7c102 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -237,7 +237,6 @@ enum scan_conn_timer {
static struct host_if_drv *wfidrv_list[NUM_CONCURRENT_IFC + 1];
struct host_if_drv *terminated_handle;
-struct host_if_drv *gWFiDrvHandle;
bool g_obtainingIP;
u8 P2P_LISTEN_STATE;
static struct task_struct *HostIFthreadHandler;
--
1.9.1
On Mon, Oct 19, 2015 at 10:32:10AM +0900, Tony Cho wrote:
>
>
> On 2015년 10월 17일 13:59, Greg KH wrote:
> >On Fri, Oct 16, 2015 at 01:37:31PM +0900, Tony Cho wrote:
> >>From: Leo Kim <[email protected]>
> >>
> >>This patch renames ssidLen of struct join_bss_param to ssid_len
> >>to avoid CamelCase naming convention.
> >>
> >>Signed-off-by: Leo Kim <[email protected]>
> >>Signed-off-by: Tony Cho <[email protected]>
> >>---
> >> drivers/staging/wilc1000/host_interface.c | 4 ++--
> >> 1 file changed, 2 insertions(+), 2 deletions(-)
> >Doesn't apply, I missed that you sent this as v2, why did you do that?
> >What was wrong with v1?
>
> This series of V2 includes Dan's suggestion, we don't have to add one blank line between malloc and null check if-statement.
>
I said that that patch was fine. I was intending that you change all of
them in a later patch. I really try to not delay progress with small
review comments.
regards,
dan carpenter
From: Leo Kim <[email protected]>
This patch renames variable gu8FlushedInfoElemAsoc to info_element
to avoid CamelCase naming convention.
Add to static because follow warning reported by kbuild system.
- drivers/staging/wilc1000/host_interface.c:268:5: sparse: symbol
'info_element' was not declared. Should it be static?
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index a97583a..db63886 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -262,7 +262,7 @@ static u32 inactive_time;
static u8 del_beacon;
static u8 *join_req;
-u8 *gu8FlushedInfoElemAsoc;
+static u8 *info_element;
u8 gu8Flushed11iMode;
u8 gu8FlushedAuthType;
u32 gu32FlushedJoinReqSize;
@@ -1076,8 +1076,8 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
gu32FlushedInfoElemAsocSize = hif_drv->strWILC_UsrConnReq.ConnReqIEsLen;
- gu8FlushedInfoElemAsoc = kmalloc(gu32FlushedInfoElemAsocSize, GFP_KERNEL);
- memcpy(gu8FlushedInfoElemAsoc, hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs,
+ info_element = kmalloc(gu32FlushedInfoElemAsocSize, GFP_KERNEL);
+ memcpy(info_element, hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs,
gu32FlushedInfoElemAsocSize);
}
}
@@ -1302,7 +1302,7 @@ static s32 Handle_FlushConnect(struct host_if_drv *hif_drv)
strWIDList[u32WidsCount].id = WID_INFO_ELEMENT_ASSOCIATE;
strWIDList[u32WidsCount].type = WID_BIN_DATA;
- strWIDList[u32WidsCount].val = gu8FlushedInfoElemAsoc;
+ strWIDList[u32WidsCount].val = info_element;
strWIDList[u32WidsCount].size = gu32FlushedInfoElemAsocSize;
u32WidsCount++;
@@ -1411,9 +1411,10 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
kfree(join_req);
join_req = NULL;
}
- if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
- kfree(gu8FlushedInfoElemAsoc);
- gu8FlushedInfoElemAsoc = NULL;
+
+ if (info_element != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
+ kfree(info_element);
+ info_element = NULL;
}
return s32Error;
@@ -1714,9 +1715,10 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
kfree(join_req);
join_req = NULL;
}
- if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
- kfree(gu8FlushedInfoElemAsoc);
- gu8FlushedInfoElemAsoc = NULL;
+
+ if (info_element != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
+ kfree(info_element);
+ info_element = NULL;
}
hif_drv->enuHostIFstate = HOST_IF_IDLE;
@@ -2106,9 +2108,10 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
kfree(join_req);
join_req = NULL;
}
- if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
- kfree(gu8FlushedInfoElemAsoc);
- gu8FlushedInfoElemAsoc = NULL;
+
+ if (info_element != NULL && gu8FlushedJoinReqDrvHandler == hif_drv) {
+ kfree(info_element);
+ info_element = NULL;
}
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch renames variable gMsgQHostIF to hif_msg_q
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 109 +++++++++++++++---------------
1 file changed, 53 insertions(+), 56 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 4f24a05..bb770ab1 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -240,7 +240,7 @@ struct host_if_drv *terminated_handle;
bool g_obtainingIP;
u8 P2P_LISTEN_STATE;
static struct task_struct *hif_thread_handler;
-static WILC_MsgQueueHandle gMsgQHostIF;
+static WILC_MsgQueueHandle hif_msg_q;
static struct semaphore hSemHostIFthrdEnd;
struct semaphore hSemDeinitDrvHandle;
@@ -2738,7 +2738,7 @@ static void ListenTimerCB(unsigned long arg)
msg.drv = hif_drv;
msg.body.remain_on_ch.u32ListenSessionID = hif_drv->strHostIfRemainOnChan.u32ListenSessionID;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
}
@@ -2926,7 +2926,7 @@ static int hostIFthread(void *pvArg)
memset(&msg, 0, sizeof(struct host_if_msg));
while (1) {
- wilc_mq_recv(&gMsgQHostIF, &msg, sizeof(struct host_if_msg), &u32Ret);
+ wilc_mq_recv(&hif_msg_q, &msg, sizeof(struct host_if_msg), &u32Ret);
hif_drv = (struct host_if_drv *)msg.drv;
if (msg.id == HOST_IF_MSG_EXIT) {
PRINT_D(GENERIC_DBG, "THREAD: Exiting HostIfThread\n");
@@ -2936,13 +2936,13 @@ static int hostIFthread(void *pvArg)
if ((!g_wilc_initialized)) {
PRINT_D(GENERIC_DBG, "--WAIT--");
usleep_range(200 * 1000, 200 * 1000);
- wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
continue;
}
if (msg.id == HOST_IF_MSG_CONNECT && hif_drv->strWILC_UsrScanReq.pfUserScanResult != NULL) {
PRINT_D(HOSTINF_DBG, "Requeue connect request till scan done received\n");
- wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
usleep_range(2 * 1000, 2 * 1000);
continue;
}
@@ -3136,7 +3136,7 @@ static void TimerCB_Scan(unsigned long arg)
msg.drv = pvArg;
msg.id = HOST_IF_MSG_SCAN_TIMER_FIRED;
- wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
}
static void TimerCB_Connect(unsigned long arg)
@@ -3148,7 +3148,7 @@ static void TimerCB_Connect(unsigned long arg)
msg.drv = pvArg;
msg.id = HOST_IF_MSG_CONNECT_TIMER_FIRED;
- wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
}
s32 host_int_remove_key(struct host_if_drv *hif_drv, const u8 *pu8StaAddress)
@@ -3182,7 +3182,7 @@ int host_int_remove_wep_key(struct host_if_drv *hif_drv, u8 index)
msg.drv = hif_drv;
msg.body.key_info.attr.wep.index = index;
- result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result)
PRINT_ER("Error in sending message queue : Request to remove WEP key\n");
down(&hif_drv->hSemTestKeyBlock);
@@ -3211,7 +3211,7 @@ s32 host_int_set_WEPDefaultKeyID(struct host_if_drv *hif_drv, u8 u8Index)
msg.drv = hif_drv;
msg.body.key_info.attr.wep.index = u8Index;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("Error in sending message queue : Default key index\n");
down(&hif_drv->hSemTestKeyBlock);
@@ -3246,7 +3246,7 @@ s32 host_int_add_wep_key_bss_sta(struct host_if_drv *hif_drv,
msg.body.key_info.attr.wep.key_len = (u8WepKeylen);
msg.body.key_info.attr.wep.index = u8Keyidx;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("Error in sending message queue :WEP Key\n");
down(&hif_drv->hSemTestKeyBlock);
@@ -3290,7 +3290,7 @@ s32 host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv,
msg.body.key_info.attr.wep.mode = u8mode;
msg.body.key_info.attr.wep.auth_type = tenuAuth_type;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("Error in sending message queue :WEP Key\n");
@@ -3355,7 +3355,7 @@ s32 host_int_add_ptk(struct host_if_drv *hif_drv, const u8 *pu8Ptk,
msg.body.key_info.attr.wpa.mode = u8Ciphermode;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("Error in sending message queue: PTK Key\n");
@@ -3418,7 +3418,7 @@ s32 host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *pu8RxGtk,
msg.body.key_info.attr.wpa.key_len = u8KeyLen;
msg.body.key_info.attr.wpa.seq_len = u32KeyRSClen;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("Error in sending message queue: RX GTK\n");
@@ -3454,7 +3454,7 @@ s32 host_int_set_pmkid_info(struct host_if_drv *hif_drv, struct host_if_pmkid_at
PMKID_LEN);
}
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER(" Error in sending messagequeue: PMKID Info\n");
@@ -3502,7 +3502,7 @@ s32 host_int_get_MacAddress(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
msg.body.get_mac_info.u8MacAddress = pu8MacAddress;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error) {
PRINT_ER("Failed to send get mac address\n");
return -EFAULT;
@@ -3524,7 +3524,7 @@ s32 host_int_set_MacAddress(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
memcpy(msg.body.set_mac_info.u8MacAddress, pu8MacAddress, ETH_ALEN);
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("Failed to send message queue: Set mac address\n");
@@ -3624,7 +3624,7 @@ s32 host_int_set_join_req(struct host_if_drv *hif_drv, u8 *pu8bssid,
else
PRINT_D(GENERIC_DBG, "Don't set state to 'connecting' as state is %d\n", hif_drv->enuHostIFstate);
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error) {
PRINT_ER("Failed to send message queue: Set join request\n");
return -EFAULT;
@@ -3658,7 +3658,7 @@ s32 host_int_flush_join_req(struct host_if_drv *hif_drv)
msg.id = HOST_IF_MSG_FLUSH_CONNECT;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error) {
PRINT_ER("Failed to send message queue: Flush join request\n");
return -EFAULT;
@@ -3682,7 +3682,7 @@ s32 host_int_disconnect(struct host_if_drv *hif_drv, u16 u16ReasonCode)
msg.id = HOST_IF_MSG_DISCONNECT;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("Failed to send message queue: disconnect\n");
@@ -3773,7 +3773,7 @@ int host_int_set_mac_chnl_num(struct host_if_drv *hif_drv, u8 channel)
msg.body.channel_info.set_ch = channel;
msg.drv = hif_drv;
- result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result) {
PRINT_ER("wilc mq send fail\n");
return -EINVAL;
@@ -3789,7 +3789,7 @@ int host_int_wait_msg_queue_idle(void)
struct host_if_msg msg;
memset(&msg, 0, sizeof(struct host_if_msg));
msg.id = HOST_IF_MSG_Q_IDLE;
- result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result) {
PRINT_ER("wilc mq send fail\n");
result = -EINVAL;
@@ -3810,7 +3810,7 @@ int host_int_set_wfi_drv_handler(struct host_if_drv *hif_drv)
msg.body.drv.u32Address = get_id_from_handler(hif_drv);
msg.drv = hif_drv;
- result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result) {
PRINT_ER("wilc mq send fail\n");
result = -EINVAL;
@@ -3829,7 +3829,7 @@ int host_int_set_operation_mode(struct host_if_drv *hif_drv, u32 mode)
msg.body.mode.u32Mode = mode;
msg.drv = hif_drv;
- result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result) {
PRINT_ER("wilc mq send fail\n");
result = -EINVAL;
@@ -3853,7 +3853,7 @@ s32 host_int_get_host_chnl_num(struct host_if_drv *hif_drv, u8 *pu8ChNo)
msg.id = HOST_IF_MSG_GET_CHNL;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc mq send fail\n");
down(&hif_drv->hSemGetCHNL);
@@ -3885,7 +3885,7 @@ s32 host_int_get_inactive_time(struct host_if_drv *hif_drv,
msg.id = HOST_IF_MSG_GET_INACTIVETIME;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("Failed to send get host channel param's message queue ");
@@ -3935,7 +3935,7 @@ s32 host_int_get_rssi(struct host_if_drv *hif_drv, s8 *ps8Rssi)
msg.id = HOST_IF_MSG_GET_RSSI;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error) {
PRINT_ER("Failed to send get host channel param's message queue ");
return -EFAULT;
@@ -3965,7 +3965,7 @@ s32 host_int_get_link_speed(struct host_if_drv *hif_drv, s8 *ps8lnkspd)
msg.id = HOST_IF_MSG_GET_LINKSPEED;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error) {
PRINT_ER("Failed to send GET_LINKSPEED to message queue ");
return -EFAULT;
@@ -3996,7 +3996,7 @@ s32 host_int_get_statistics(struct host_if_drv *hif_drv, struct rf_info *pstrSta
msg.body.data = (char *)pstrStatistics;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error) {
PRINT_ER("Failed to send get host channel param's message queue ");
return -EFAULT;
@@ -4046,7 +4046,7 @@ s32 host_int_scan(struct host_if_drv *hif_drv, u8 u8ScanSource,
msg.body.scan_info.ies = kmalloc(IEsLen, GFP_KERNEL);
memcpy(msg.body.scan_info.ies, pu8IEs, IEsLen);
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error) {
PRINT_ER("Error in sending message queue\n");
return -EINVAL;
@@ -4080,7 +4080,7 @@ s32 hif_set_cfg(struct host_if_drv *hif_drv,
msg.body.cfg_info.cfg_attr_info = *pstrCfgParamVal;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
return s32Error;
@@ -4204,7 +4204,7 @@ static void GetPeriodicRSSI(unsigned long arg)
msg.id = HOST_IF_MSG_GET_RSSI;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error) {
PRINT_ER("Failed to send get host channel param's message queue ");
return;
@@ -4265,7 +4265,7 @@ s32 host_int_init(struct host_if_drv **hif_drv_handler)
PRINT_D(HOSTINF_DBG, "INIT: CLIENT COUNT %d\n", clients_count);
if (clients_count == 0) {
- result = wilc_mq_create(&gMsgQHostIF);
+ result = wilc_mq_create(&hif_msg_q);
if (result < 0) {
PRINT_ER("Failed to creat MQ\n");
@@ -4320,7 +4320,7 @@ _fail_timer_2:
del_timer_sync(&hif_drv->hScanTimer);
kthread_stop(hif_thread_handler);
_fail_mq_:
- wilc_mq_destroy(&gMsgQHostIF);
+ wilc_mq_destroy(&hif_msg_q);
_fail_:
return result;
}
@@ -4379,14 +4379,13 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
msg.id = HOST_IF_MSG_EXIT;
msg.drv = hif_drv;
-
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error != 0)
PRINT_ER("Error in sending deinit's message queue message function: Error(%d)\n", s32Error);
down(&hSemHostIFthrdEnd);
- wilc_mq_destroy(&gMsgQHostIF);
+ wilc_mq_destroy(&hif_msg_q);
}
down(&(hif_drv->gtOsCfgValuesSem));
@@ -4430,7 +4429,7 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
msg.body.net_info.buffer = kmalloc(u32Length, GFP_KERNEL);
memcpy(msg.body.net_info.buffer, pu8Buffer, u32Length);
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("Error in sending network info message queue message parameters: Error(%d)\n", s32Error);
}
@@ -4471,7 +4470,7 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
msg.body.async_info.buffer = kmalloc(u32Length, GFP_KERNEL);
memcpy(msg.body.async_info.buffer, pu8Buffer, u32Length);
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("Error in sending message queue asynchronous message info: Error(%d)\n", s32Error);
@@ -4500,7 +4499,7 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
msg.id = HOST_IF_MSG_RCVD_SCAN_COMPLETE;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("Error in sending message queue scan complete parameters: Error(%d)\n", s32Error);
}
@@ -4535,7 +4534,7 @@ s32 host_int_remain_on_channel(struct host_if_drv *hif_drv, u32 u32SessionID,
msg.body.remain_on_ch.u32ListenSessionID = u32SessionID;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc mq send fail\n");
@@ -4559,7 +4558,7 @@ s32 host_int_ListenStateExpired(struct host_if_drv *hif_drv, u32 u32SessionID)
msg.drv = hif_drv;
msg.body.remain_on_ch.u32ListenSessionID = u32SessionID;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc mq send fail\n");
@@ -4598,7 +4597,7 @@ s32 host_int_frame_register(struct host_if_drv *hif_drv, u16 u16FrameType, bool
msg.body.reg_frame.bReg = bReg;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc mq send fail\n");
@@ -4648,7 +4647,7 @@ s32 host_int_add_beacon(struct host_if_drv *hif_drv, u32 u32Interval,
pstrSetBeaconParam->tail = NULL;
}
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc mq send fail\n");
@@ -4679,7 +4678,7 @@ s32 host_int_del_beacon(struct host_if_drv *hif_drv)
msg.drv = hif_drv;
PRINT_D(HOSTINF_DBG, "Setting deleting beacon message queue params\n");
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
@@ -4717,8 +4716,7 @@ s32 host_int_add_station(struct host_if_drv *hif_drv,
pstrAddStationMsg->pu8Rates = rates;
}
-
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
return s32Error;
@@ -4747,7 +4745,7 @@ s32 host_int_del_station(struct host_if_drv *hif_drv, const u8 *pu8MacAddr)
else
memcpy(pstrDelStationMsg->mac_addr, pu8MacAddr, ETH_ALEN);
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
return s32Error;
@@ -4795,8 +4793,7 @@ s32 host_int_del_allstation(struct host_if_drv *hif_drv,
}
pstrDelAllStationMsg->assoc_sta = u8AssocNumb;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
-
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
@@ -4837,7 +4834,7 @@ s32 host_int_edit_station(struct host_if_drv *hif_drv,
pstrAddStationMsg->pu8Rates = rates;
}
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
@@ -4869,7 +4866,7 @@ s32 host_int_set_power_mgmt(struct host_if_drv *hif_drv,
pstrPowerMgmtParam->enabled = bIsEnabled;
pstrPowerMgmtParam->timeout = u32Timeout;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
return s32Error;
@@ -4899,7 +4896,7 @@ s32 host_int_setup_multicast_filter(struct host_if_drv *hif_drv,
pstrMulticastFilterParam->enabled = bIsEnabled;
pstrMulticastFilterParam->cnt = u32count;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
return s32Error;
@@ -5093,7 +5090,7 @@ s32 host_int_delBASession(struct host_if_drv *hif_drv, char *pBSSID, char TID)
pBASessionInfo->u8Ted = TID;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
@@ -5123,7 +5120,7 @@ s32 host_int_del_All_Rx_BASession(struct host_if_drv *hif_drv,
pBASessionInfo->u8Ted = TID;
msg.drv = hif_drv;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
@@ -5152,7 +5149,7 @@ s32 host_int_setup_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)
msg.drv = hif_drv;
msg.body.ip_info.idx = idx;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
@@ -5179,7 +5176,7 @@ s32 host_int_get_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)
msg.drv = hif_drv;
msg.body.ip_info.idx = idx;
- s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
+ s32Error = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
--
1.9.1