From patchwork Tue Oct 27 09:27:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glen Lee X-Patchwork-Id: 7495161 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 749DC9F36A for ; Tue, 27 Oct 2015 09:27:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 72CAB20849 for ; Tue, 27 Oct 2015 09:27:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B700206E4 for ; Tue, 27 Oct 2015 09:27:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753544AbbJ0J1Q (ORCPT ); Tue, 27 Oct 2015 05:27:16 -0400 Received: from eusmtp01.atmel.com ([212.144.249.243]:58493 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753476AbbJ0J1P (ORCPT ); Tue, 27 Oct 2015 05:27:15 -0400 Received: from glen-ubuntu.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server id 14.3.235.1; Tue, 27 Oct 2015 10:27:11 +0100 From: Glen Lee To: CC: , , , , , , , , Subject: [PATCH V2 22/27] staging: wilc1000: Set_machw_change_vir_if: add argument struct net_device Date: Tue, 27 Oct 2015 18:27:58 +0900 Message-ID: <1445938083-20445-22-git-send-email-glen.lee@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445938083-20445-1-git-send-email-glen.lee@atmel.com> References: <1445938083-20445-1-git-send-email-glen.lee@atmel.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add new argument net_device and use netdev private data member wilc instead of g_linux_wlan. Pass argument dev to the function as well. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan.c | 3 +-- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 7 +++---- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 + drivers/staging/wilc1000/wilc_wlan.c | 12 ++++++++---- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 1f5c8f3..d839f3b 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -46,7 +46,6 @@ #endif extern bool g_obtainingIP; -extern u16 Set_machw_change_vir_if(bool bValue); extern void resolve_disconnect_aberration(void *drvHandler); extern u8 gau8MulticastMacAddrList[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN]; extern struct timer_list hDuringIpTimer; @@ -1244,7 +1243,7 @@ int mac_open(struct net_device *ndev) return ret; } - Set_machw_change_vir_if(false); + Set_machw_change_vir_if(ndev, false); host_int_get_MacAddress(priv->hWILCWFIDrv, mac_add); PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 21d053d..bf7a2a2 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -22,7 +22,6 @@ #define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff) extern int linux_wlan_get_firmware(perInterface_wlan_t *p_nic); -extern u16 Set_machw_change_vir_if(bool bValue); extern int mac_open(struct net_device *ndev); extern int mac_close(struct net_device *ndev); @@ -1413,7 +1412,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, g_key_gtk_params.seq = NULL; /*Reset WILC_CHANGING_VIR_IF register to allow adding futrue keys to CE H/W*/ - Set_machw_change_vir_if(false); + Set_machw_change_vir_if(netdev, false); } if (key_index >= 0 && key_index <= 3) { @@ -2562,7 +2561,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, PRINT_D(GENERIC_DBG, "Changing virtual interface, enable scan\n"); /*Set WILC_CHANGING_VIR_IF register to disallow adding futrue keys to CE H/W*/ if (g_ptk_keys_saved && g_gtk_keys_saved) { - Set_machw_change_vir_if(true); + Set_machw_change_vir_if(dev, true); } switch (type) { @@ -2724,7 +2723,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, /*Refresh scan, to refresh the scan results to the wpa_supplicant. Set MachHw to false to enable further key installments*/ refresh_scan(priv, 1, true); - Set_machw_change_vir_if(false); + Set_machw_change_vir_if(dev, false); if (wl->initialized) { for (i = 0; i < num_reg_frame; i++) { diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index bca3e25..0bfe762 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -217,4 +217,5 @@ void wl_wlan_cleanup(void); int wilc_netdev_init(struct wilc **wilc); void wilc1000_wlan_deinit(struct net_device *dev); void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size); +u16 Set_machw_change_vir_if(struct net_device *dev, bool bValue); #endif diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 35c4c32d..aebc9a6 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -19,7 +19,6 @@ extern wilc_hif_func_t hif_sdio; extern wilc_hif_func_t hif_spi; u32 wilc_get_chipid(u8 update); -u16 Set_machw_change_vir_if(bool bValue); @@ -2033,13 +2032,18 @@ _fail_: } -u16 Set_machw_change_vir_if(bool bValue) +u16 Set_machw_change_vir_if(struct net_device *dev, bool bValue) { u16 ret; u32 reg; + perInterface_wlan_t *nic; + struct wilc *wilc; + + nic = netdev_priv(dev); + wilc = nic->wilc; /*Reset WILC_CHANGING_VIR_IF register to allow adding futrue keys to CE H/W*/ - mutex_lock(&g_linux_wlan->hif_cs); + mutex_lock(&wilc->hif_cs); ret = (&g_wlan)->hif_func.hif_read_reg(WILC_CHANGING_VIR_IF, ®); if (!ret) PRINT_ER("Error while Reading reg WILC_CHANGING_VIR_IF\n"); @@ -2054,7 +2058,7 @@ u16 Set_machw_change_vir_if(bool bValue) if (!ret) PRINT_ER("Error while writing reg WILC_CHANGING_VIR_IF\n"); - mutex_unlock(&g_linux_wlan->hif_cs); + mutex_unlock(&wilc->hif_cs); return ret; }