From patchwork Tue Oct 27 09:27:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glen Lee X-Patchwork-Id: 7495151 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 86D6F9F36A for ; Tue, 27 Oct 2015 09:27:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A8DD820841 for ; Tue, 27 Oct 2015 09:27:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A30BB206E4 for ; Tue, 27 Oct 2015 09:27:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753538AbbJ0J1J (ORCPT ); Tue, 27 Oct 2015 05:27:09 -0400 Received: from eusmtp01.atmel.com ([212.144.249.243]:58440 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753476AbbJ0J1I (ORCPT ); Tue, 27 Oct 2015 05:27:08 -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:05 +0100 From: Glen Lee To: CC: , , , , , , , , Subject: [PATCH V2 21/27] staging: wilc1000: GetIfHandler: add argument struct wilc and use it Date: Tue, 27 Oct 2015 18:27:57 +0900 Message-ID: <1445938083-20445-21-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 This patch adds new argument struct wilc and use it instead of g_linux_wlan. And also pass wilc to the function. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 6293410..1f5c8f3 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -374,7 +374,7 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag) } -struct net_device *GetIfHandler(u8 *pMacHeader) +struct net_device *GetIfHandler(struct wilc *wilc, u8 *pMacHeader) { u8 *Bssid, *Bssid1; int i = 0; @@ -382,20 +382,20 @@ 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->vif[i].bssid, ETH_ALEN) || - !memcmp(Bssid, g_linux_wlan->vif[i].bssid, ETH_ALEN)) - return g_linux_wlan->vif[i].ndev; + for (i = 0; i < wilc->vif_num; i++) + if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) || + !memcmp(Bssid, wilc->vif[i].bssid, ETH_ALEN)) + return wilc->vif[i].ndev; 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->vif[i].bssid, ETH_ALEN) || - !memcmp(Bssid, g_linux_wlan->vif[i].bssid, ETH_ALEN)) - return g_linux_wlan->vif[i].ndev; + for (i = 0; i < wilc->vif_num; i++) + if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) || + !memcmp(Bssid, wilc->vif[i].bssid, ETH_ALEN)) + return wilc->vif[i].ndev; PRINT_INFO(INIT_DBG, "\n"); return NULL; @@ -1567,7 +1567,7 @@ void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset) struct net_device *wilc_netdev; perInterface_wlan_t *nic; - wilc_netdev = GetIfHandler(buff); + wilc_netdev = GetIfHandler(wilc, buff); if (wilc_netdev == NULL) return;