[PATCH V2 03/12] staging: wilc1000: rename strInterfaceInfo in the sturct wilc

2015-10-19 Thread Tony Cho
This patch renames strInterfaceInfo in the struct wilc to the vif. In
addition, unnecessary print statements around it are removed in this patch.

Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/linux_wlan.c | 91 +++
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 72 +-
 drivers/staging/wilc1000/wilc_wfi_netdevice.h |  2 +-
 3 files changed, 80 insertions(+), 85 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 2bea103..971b99a 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -366,24 +366,21 @@ struct net_device *GetIfHandler(u8 *pMacHeader)
Bssid  = pMacHeader + 10;
Bssid1 = pMacHeader + 4;
 
-   for (i = 0; i < g_linux_wlan->vif_num; i++) {
-   if (!memcmp(Bssid1, g_linux_wlan->strInterfaceInfo[i].aBSSID, 
ETH_ALEN) ||
-   !memcmp(Bssid, g_linux_wlan->strInterfaceInfo[i].aBSSID, 
ETH_ALEN)) {
-   return g_linux_wlan->strInterfaceInfo[i].wilc_netdev;
-   }
-   }
+   for (i = 0; i < g_linux_wlan->vif_num; i++)
+   if (!memcmp(Bssid1, g_linux_wlan->vif[i].aBSSID, ETH_ALEN) ||
+   !memcmp(Bssid, g_linux_wlan->vif[i].aBSSID, ETH_ALEN))
+   return g_linux_wlan->vif[i].wilc_netdev;
+
PRINT_INFO(INIT_DBG, "Invalide handle\n");
for (i = 0; i < 25; i++)
PRINT_D(INIT_DBG, "%02x ", pMacHeader[i]);
Bssid  = pMacHeader + 18;
Bssid1 = pMacHeader + 12;
-   for (i = 0; i < g_linux_wlan->vif_num; i++) {
-   if (!memcmp(Bssid1, g_linux_wlan->strInterfaceInfo[i].aBSSID, 
ETH_ALEN) ||
-   !memcmp(Bssid, g_linux_wlan->strInterfaceInfo[i].aBSSID, 
ETH_ALEN)) {
-   PRINT_D(INIT_DBG, "Ctx [%p]\n", 
g_linux_wlan->strInterfaceInfo[i].wilc_netdev);
-   return g_linux_wlan->strInterfaceInfo[i].wilc_netdev;
-   }
-   }
+   for (i = 0; i < g_linux_wlan->vif_num; i++)
+   if (!memcmp(Bssid1, g_linux_wlan->vif[i].aBSSID, ETH_ALEN) ||
+   !memcmp(Bssid, g_linux_wlan->vif[i].aBSSID, ETH_ALEN))
+   return g_linux_wlan->vif[i].wilc_netdev;
+
PRINT_INFO(INIT_DBG, "\n");
return NULL;
 }
@@ -393,15 +390,13 @@ int linux_wlan_set_bssid(struct net_device *wilc_netdev, 
u8 *pBSSID)
int i = 0;
int ret = -1;
 
-   PRINT_D(INIT_DBG, "set bssid on[%p]\n", wilc_netdev);
-   for (i = 0; i < g_linux_wlan->vif_num; i++) {
-   if (g_linux_wlan->strInterfaceInfo[i].wilc_netdev == 
wilc_netdev) {
-   PRINT_D(INIT_DBG, "set bssid [%x][%x][%x]\n", 
pBSSID[0], pBSSID[1], pBSSID[2]);
-   memcpy(g_linux_wlan->strInterfaceInfo[i].aBSSID, 
pBSSID, 6);
+   for (i = 0; i < g_linux_wlan->vif_num; i++)
+   if (g_linux_wlan->vif[i].wilc_netdev == wilc_netdev) {
+   memcpy(g_linux_wlan->vif[i].aBSSID, pBSSID, 6);
ret = 0;
break;
}
-   }
+
return ret;
 }
 
@@ -412,10 +407,10 @@ int linux_wlan_get_num_conn_ifcs(void)
u8 null_bssid[6] = {0};
u8 ret_val = 0;
 
-   for (i = 0; i < g_linux_wlan->vif_num; i++) {
-   if (memcmp(g_linux_wlan->strInterfaceInfo[i].aBSSID, 
null_bssid, 6))
+   for (i = 0; i < g_linux_wlan->vif_num; i++)
+   if (memcmp(g_linux_wlan->vif[i].aBSSID, null_bssid, 6))
ret_val++;
-   }
+
return ret_val;
 }
 
@@ -462,10 +457,10 @@ static int linux_wlan_txq_task(void *vp)
if (txq_count < FLOW_CONTROL_LOWER_THRESHOLD /* && 
netif_queue_stopped(pd->wilc_netdev)*/) {
PRINT_D(TX_DBG, "Waking up queue\n");
/* netif_wake_queue(pd->wilc_netdev); */
-   if 
(netif_queue_stopped(g_linux_wlan->strInterfaceInfo[0].wilc_netdev))
-   
netif_wake_queue(g_linux_wlan->strInterfaceInfo[0].wilc_netdev);
-   if 
(netif_queue_stopped(g_linux_wlan->strInterfaceInfo[1].wilc_netdev))
-   
netif_wake_queue(g_linux_wlan->strInterfaceInfo[1].wilc_netdev);
+   if 
(netif_queue_stopped(g_linux_wlan->vif[0].wilc_netdev))
+   
netif_wake_queue(g_linux_wlan->vif[0].wilc_netdev);
+   if 
(netif_queue_stopped(g_linux_wlan->vif[1].wilc_netdev))
+   
netif_wake_queue(g_linux_wlan->vif[1].wilc_netdev);
}
 
if (ret == WILC_TX_ERR_NO_BUF) { /* failed to allocate 
buffers in chip. */
@@ -1317,15 +1312,15 @@ int mac_open(struct net_device *n

Re: [PATCH V2 03/12] staging: wilc1000: rename strInterfaceInfo in the sturct wilc

2015-10-22 Thread Dan Carpenter
On Tue, Oct 20, 2015 at 02:26:47PM +0900, Tony Cho wrote:
> This patch renames strInterfaceInfo in the struct wilc to the vif. In
> addition, unnecessary print statements around it are removed in this patch.
> 
> Signed-off-by: Tony Cho 
> ---
>  drivers/staging/wilc1000/linux_wlan.c | 91 
> +++
>  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 72 +-
>  drivers/staging/wilc1000/wilc_wfi_netdevice.h |  2 +-
>  3 files changed, 80 insertions(+), 85 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/linux_wlan.c 
> b/drivers/staging/wilc1000/linux_wlan.c
> index 2bea103..971b99a 100644
> --- a/drivers/staging/wilc1000/linux_wlan.c
> +++ b/drivers/staging/wilc1000/linux_wlan.c
> @@ -366,24 +366,21 @@ struct net_device *GetIfHandler(u8 *pMacHeader)
>   Bssid  = pMacHeader + 10;
>   Bssid1 = pMacHeader + 4;
>  
> - for (i = 0; i < g_linux_wlan->vif_num; i++) {
> - if (!memcmp(Bssid1, g_linux_wlan->strInterfaceInfo[i].aBSSID, 
> ETH_ALEN) ||
> - !memcmp(Bssid, g_linux_wlan->strInterfaceInfo[i].aBSSID, 
> ETH_ALEN)) {
> - return g_linux_wlan->strInterfaceInfo[i].wilc_netdev;
> - }
> - }
> + for (i = 0; i < g_linux_wlan->vif_num; i++)
> + if (!memcmp(Bssid1, g_linux_wlan->vif[i].aBSSID, ETH_ALEN) ||
> + !memcmp(Bssid, g_linux_wlan->vif[i].aBSSID, ETH_ALEN))
> + return g_linux_wlan->vif[i].wilc_netdev;
> +

Removing the curly braces was wrong.  Multi-line indents get curly
braces for readability even though the compiler does not insist on them.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 03/12] staging: wilc1000: rename strInterfaceInfo in the sturct wilc

2015-10-22 Thread Dan Carpenter
Don't resend the series though.  Please fix it in a later patch.

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 03/12] staging: wilc1000: rename strInterfaceInfo in the sturct wilc

2015-10-22 Thread Tony Cho

Thanks for your review.
I will do it later as you mentioned.
Tony.

On 2015년 10월 22일 20:19, Dan Carpenter wrote:

Don't resend the series though.  Please fix it in a later patch.

regards,
dan carpenter


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html