From patchwork Sat Feb 2 19:16:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794465 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 32DFE746 for ; Sat, 2 Feb 2019 19:17:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 221DC2E1E0 for ; Sat, 2 Feb 2019 19:17:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 130542E202; Sat, 2 Feb 2019 19:17:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBBE82E1E0 for ; Sat, 2 Feb 2019 19:16:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726774AbfBBTQ6 (ORCPT ); Sat, 2 Feb 2019 14:16:58 -0500 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:13826 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726486AbfBBTQ6 (ORCPT ); Sat, 2 Feb 2019 14:16:58 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="26232209" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 02 Feb 2019 12:16:56 -0700 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:16:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QNs9VYXk7y9W0v+lcK6c/tNsdVQmMKZ1/PAvw+oPK/0=; b=pD3jhQED6JnrbfCca1GHiY8MH3iHzbj94sUkbMNNrErN0ndXzlCqVedWiFgp4yj67kftZzuVWTTCSivo5P6eH1gRw6nUz9m4K0LSLoTYZgUnEKA4ZiR5RicY7Nsze7scsHcY1WAUYqGVR8mRwA5PUIdW2K8fL2YSQOJDMXojuac= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2998.namprd11.prod.outlook.com (20.177.224.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.21; Sat, 2 Feb 2019 19:16:53 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:16:53 +0000 From: To: CC: , , , , Subject: [PATCH 01/15] staging: wilc1000: avoid the use of 'wilc_wfi_mon' static variable Thread-Topic: [PATCH 01/15] staging: wilc1000: avoid the use of 'wilc_wfi_mon' static variable Thread-Index: AQHUuyvbBxPjnJCw40CWpECh2AMjPQ== Date: Sat, 2 Feb 2019 19:16:53 +0000 Message-ID: <1549134974-5545-2-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2998;6:yIn3o+fvLeY1y9AhvYxcfzrV4r3DlrGpjbjxoyP2UhFZz1VXbM4LKCM0MDxWwGHMYsmpVlRYmbjKShHG2T6fYvmBP+hPjR5wlY7ywMgYAzWV7lY7W78UuGli7rdkSmiIv1yI3QrVsG3mDlD5jhsMUD44hukN51Kffltlx/x//ML4IjTO3/20kRSODFJXJ8kEdzXKvYFgOXVYYTewpDI3N8dst/n7VGfBVOdr3nmaEeoqArEs6gtPrkC5aoH6kdKxDMDDbmvzo4xbsYKSsYG3MFjqdUYeywyQZo2gpBTAzeN6Rzds2s0rStM9B8RjqekgGTrW4A6OnEVQmlDKBSMLmMplwSm8q0A6UIsIrygbmmXdOe6NspYhKDw7W+JrdMktUpSwaE7wsbtcEFIV3i3dLJsp3E77k9Ajx8Cdjkq6o9wPReo2V/iIyyGpDCegQHWwmTr71WjhXd2aw8Taj3JS4A==;5:jijejbzigfTS7WnPP2JK/cev7Uz0JdEn7N+JNlWwTJ2MKfCzftqlA1QQsUkqmyoSb5DoATrr8P5OZNUTEY8gttXmfPp2q4cux9xZhSMEJyMFsaZKCMHSCNYvIrAcS+Z/ZnBelr6+4jmKCUZHSkP/Z1fsQKyMr56yS3+LrOVlemA8pFVlzaB9Eu6UaXiw+L8z1c1TLcWaeHuT7Hao/iNj/Q==;7:sxHf7AAdFr68H3rxeCMZ62VT30Zbn7htiEv/AHvL6Nb/7ypmtJmVlhTN0Hx/Y15lvLNVE6qnBNPlmqDDLJjvBCxI54DrShSC2TUU/NTu1T+z+hBAFGJn1NFRP8nHE/DxuTOSnA5yDUDZE6OH1jsnFA== x-ms-office365-filtering-correlation-id: f6aa99fc-f7cb-45e0-5223-08d68942fd8f x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2998; x-ms-traffictypediagnostic: BYAPR11MB2998: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(376002)(366004)(346002)(39850400004)(189003)(199004)(25786009)(107886003)(105586002)(78486014)(36756003)(50226002)(2501003)(6916009)(66066001)(8936002)(3846002)(4326008)(305945005)(7736002)(71200400001)(71190400001)(8676002)(6116002)(54906003)(81166006)(316002)(446003)(81156014)(6436002)(6486002)(2906002)(2616005)(486006)(476003)(76176011)(256004)(99286004)(11346002)(14444005)(52116002)(53936002)(72206003)(478600001)(186003)(386003)(26005)(14454004)(106356001)(86362001)(5640700003)(97736004)(2351001)(68736007)(6506007)(102836004)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2998;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: C/zX9lysMzr8DrkTEoE6gILfWOlAVh6lRxDjF5cYbP9qqgcG5ihZ+vfUkUWmah5t0Ly7b/H6Fpfgtd5hsC1CSCaFJeI53zpOpxzKbIQVheEIHMFYMLl7z1po2Nuq/FWrNyavf5EQ/mwzyJHotHEGA+0QyrSCIrBZTytrK1YwnAPtMV3A1Rm9Eb9BWubILg5+LaSpuSd8qeLKdEpJMiY6irOBLW8ZkvDT41dpLt2WRsZC4iMX9d2E6kuFe5fP0rZmmu2yKbdYI39EaE5DVMoyo/ODPseC9XXzH3GR2TH6SE+aMzMC+2KYU/SN8y6mN7j6p6b2JJ1T9qp1C1VEcBC/lbQkm+px4Fpm75kvhN6+aQJcF6t/sXalQQ1FROofcWGqeA3YCQFMT/B34/KwUXIcB1c1mz5uMmKonuRxf2XPl0M= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f6aa99fc-f7cb-45e0-5223-08d68942fd8f X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:16:51.3104 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2998 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Avoid use of static variable for monitor net_device and move it inside wilc structure. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/linux_mon.c | 52 +++++++++++------------ drivers/staging/wilc1000/linux_wlan.c | 4 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 7 +-- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 + 5 files changed, 34 insertions(+), 33 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index a634468..ed06834 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -18,8 +18,6 @@ struct wilc_wfi_radiotap_cb_hdr { u16 tx_flags; } __packed; -static struct net_device *wilc_wfi_mon; /* global monitor netdev */ - static u8 srcadd[6]; static u8 bssid[6]; @@ -29,17 +27,17 @@ static u8 bssid[6]; #define TX_RADIOTAP_PRESENT ((1 << IEEE80211_RADIOTAP_RATE) | \ (1 << IEEE80211_RADIOTAP_TX_FLAGS)) -void wilc_wfi_monitor_rx(u8 *buff, u32 size) +void wilc_wfi_monitor_rx(struct net_device *mon_dev, u8 *buff, u32 size) { u32 header, pkt_offset; struct sk_buff *skb = NULL; struct wilc_wfi_radiotap_hdr *hdr; struct wilc_wfi_radiotap_cb_hdr *cb_hdr; - if (!wilc_wfi_mon) + if (!mon_dev) return; - if (!netif_running(wilc_wfi_mon)) + if (!netif_running(mon_dev)) return; /* Get WILC header */ @@ -94,7 +92,7 @@ void wilc_wfi_monitor_rx(u8 *buff, u32 size) hdr->rate = 5; } - skb->dev = wilc_wfi_mon; + skb->dev = mon_dev; skb_reset_mac_header(skb); skb->ip_summed = CHECKSUM_UNNECESSARY; skb->pkt_type = PACKET_OTHERHOST; @@ -156,12 +154,10 @@ static netdev_tx_t wilc_wfi_mon_xmit(struct sk_buff *skb, struct sk_buff *skb2; struct wilc_wfi_radiotap_cb_hdr *cb_hdr; - if (!wilc_wfi_mon) - return -EFAULT; - - mon_priv = netdev_priv(wilc_wfi_mon); + mon_priv = netdev_priv(dev); if (!mon_priv) return -EFAULT; + rtap_len = ieee80211_get_radiotap_len(skb->data); if (skb->len < rtap_len) return -1; @@ -187,7 +183,7 @@ static netdev_tx_t wilc_wfi_mon_xmit(struct sk_buff *skb, cb_hdr->rate = 5; cb_hdr->tx_flags = 0x0004; - skb2->dev = wilc_wfi_mon; + skb2->dev = dev; skb_reset_mac_header(skb2); skb2->ip_summed = CHECKSUM_UNNECESSARY; skb2->pkt_type = PACKET_OTHERHOST; @@ -223,51 +219,53 @@ static const struct net_device_ops wilc_wfi_netdev_ops = { }; -struct net_device *wilc_wfi_init_mon_interface(const char *name, +struct net_device *wilc_wfi_init_mon_interface(struct wilc *wl, + const char *name, struct net_device *real_dev) { struct wilc_wfi_mon_priv *priv; /*If monitor interface is already initialized, return it*/ - if (wilc_wfi_mon) - return wilc_wfi_mon; + if (wl->monitor_dev) + return wl->monitor_dev; - wilc_wfi_mon = alloc_etherdev(sizeof(struct wilc_wfi_mon_priv)); - if (!wilc_wfi_mon) + wl->monitor_dev = alloc_etherdev(sizeof(struct wilc_wfi_mon_priv)); + if (!wl->monitor_dev) return NULL; - wilc_wfi_mon->type = ARPHRD_IEEE80211_RADIOTAP; - strncpy(wilc_wfi_mon->name, name, IFNAMSIZ); - wilc_wfi_mon->name[IFNAMSIZ - 1] = 0; - wilc_wfi_mon->netdev_ops = &wilc_wfi_netdev_ops; - if (register_netdevice(wilc_wfi_mon)) { + wl->monitor_dev->type = ARPHRD_IEEE80211_RADIOTAP; + strncpy(wl->monitor_dev->name, name, IFNAMSIZ); + wl->monitor_dev->name[IFNAMSIZ - 1] = 0; + wl->monitor_dev->netdev_ops = &wilc_wfi_netdev_ops; + + if (register_netdevice(wl->monitor_dev)) { netdev_err(real_dev, "register_netdevice failed\n"); return NULL; } - priv = netdev_priv(wilc_wfi_mon); + priv = netdev_priv(wl->monitor_dev); if (!priv) return NULL; priv->real_ndev = real_dev; - return wilc_wfi_mon; + return wl->monitor_dev; } -void wilc_wfi_deinit_mon_interface(void) +void wilc_wfi_deinit_mon_interface(struct wilc *wl) { bool rollback_lock = false; - if (wilc_wfi_mon) { + if (wl->monitor_dev) { if (rtnl_is_locked()) { rtnl_unlock(); rollback_lock = true; } - unregister_netdev(wilc_wfi_mon); + unregister_netdev(wl->monitor_dev); if (rollback_lock) { rtnl_lock(); rollback_lock = false; } - wilc_wfi_mon = NULL; + wl->monitor_dev = NULL; } } diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 87ec048..1362d8f 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -920,7 +920,7 @@ static int wilc_mac_close(struct net_device *ndev) netdev_dbg(ndev, "Deinitializing wilc1000\n"); wl->close = 1; wilc_wlan_deinitialize(ndev); - wilc_wfi_deinit_mon_interface(); + wilc_wfi_deinit_mon_interface(wl); } vif->mac_opened = 0; @@ -976,7 +976,7 @@ void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size) for (i = 0; i < wilc->vif_num; i++) { vif = netdev_priv(wilc->vif[i]->ndev); if (vif->monitor_flag) { - wilc_wfi_monitor_rx(buff, size); + wilc_wfi_monitor_rx(wilc->monitor_dev, buff, size); return; } } diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 79753ad..cd3df42 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1617,7 +1617,8 @@ static struct wireless_dev *add_virtual_intf(struct wiphy *wiphy, struct net_device *new_ifc; if (type == NL80211_IFTYPE_MONITOR) { - new_ifc = wilc_wfi_init_mon_interface(name, vif->ndev); + new_ifc = wilc_wfi_init_mon_interface(vif->wilc, name, + vif->ndev); if (new_ifc) { vif = netdev_priv(priv->wdev->netdev); vif->monitor_flag = 1; diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h index 4812c8e..31dfa1f 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h @@ -13,9 +13,10 @@ struct wireless_dev *wilc_create_wiphy(struct net_device *net, void wilc_free_wiphy(struct net_device *net); void wilc_deinit_host_int(struct net_device *net); int wilc_init_host_int(struct net_device *net); -void wilc_wfi_monitor_rx(u8 *buff, u32 size); -void wilc_wfi_deinit_mon_interface(void); -struct net_device *wilc_wfi_init_mon_interface(const char *name, +void wilc_wfi_monitor_rx(struct net_device *mon_dev, u8 *buff, u32 size); +void wilc_wfi_deinit_mon_interface(struct wilc *wl); +struct net_device *wilc_wfi_init_mon_interface(struct wilc *wl, + const char *name, struct net_device *real_dev); void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev, u16 frame_type, bool reg); diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 59e8352..cc06ef9 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -270,6 +270,7 @@ struct wilc { enum chip_ps_states chip_ps_state; struct wilc_cfg cfg; void *bus_data; + struct net_device *monitor_dev; }; struct wilc_wfi_mon_priv { From patchwork Sat Feb 2 19:16:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794467 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 985DE13A4 for ; Sat, 2 Feb 2019 19:17:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AF122E1E0 for ; Sat, 2 Feb 2019 19:17:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7ED272E1FF; Sat, 2 Feb 2019 19:17:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6302D2E1FA for ; Sat, 2 Feb 2019 19:17:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726779AbfBBTQ7 (ORCPT ); Sat, 2 Feb 2019 14:16:59 -0500 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:55561 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726643AbfBBTQ7 (ORCPT ); Sat, 2 Feb 2019 14:16:59 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="26075155" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 02 Feb 2019 12:16:58 -0700 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:16:58 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FxgC7uJa6E9tYnTjPsmrM+kNhwimeheJk/XP+3cAOJg=; b=a9IFxnQB307CVfGBMFSzRTLP1rrfsjLJVI6Mp2M3RDoaq5cNAfQr6MN1zW4m6gydeUtpWu/ouPy07ysfbr6ULy7sFQ6wsGau2bVFk/5V+mWUrWdNJP3+J4IJQ3teMj/444VVOwiu4CYy5IoBqtrrs/XkZDdSBG5X81HyDCMDlgk= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2998.namprd11.prod.outlook.com (20.177.224.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.21; Sat, 2 Feb 2019 19:16:56 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:16:56 +0000 From: To: CC: , , , , Subject: [PATCH 02/15] staging: wilc1000: remove conditional lock in wilc_wfi_deinit_mon_interface() Thread-Topic: [PATCH 02/15] staging: wilc1000: remove conditional lock in wilc_wfi_deinit_mon_interface() Thread-Index: AQHUuyvcCrP3DvDHr0a0oJV3zTfU0A== Date: Sat, 2 Feb 2019 19:16:56 +0000 Message-ID: <1549134974-5545-3-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2998;6:55wkJUKyNhkNKEPKNGO+CzJCJwUKukpTIdOqm/braqxHriHLNjB4obW/XaUyQC8KyEMYgfD6+wUK1Ho2YFVPZiyfp+K3iRZWPLH69LBhk6HOcsUyRPQ9o/dLpToTvZyt6UBrUPAAl51w2uy4Zp9nTRr6rIWo9PdVK7su7NPK6/IFvGnPF0qjX7Y8UOmYkzYU0qoMlQUfCJaRbzZukE1BI3BG+1zDsfOGNKCZOPiQD1DMHbjWflzBPID8eo308QS1B8o1VVjSpBvKNms3Sai7LkamfC0fkwxuWh6KptkageZr3XZGYrp10c5Lu+Ogl/SfMDf7uPplKoqCn/BpwTyalo95X/rGIC3+iA9kUR0Et4IMGVkmhkieOoHosAAWRmRq/OYfle8FNceSCUw2Xcgocul9A8A8762ZlopVy93XYiF9aCjyH26oBz3JDHOw8BnKqm5oVq3B1WH+XxruBf63HA==;5:dyc5u8TS4mqbs9kTmHcekaTH+JfrsyhBwxpf8R18R/BWGFm0Bd7TrIixkRpIukgCjhNUkjwEXeZudv8o6P41fkYrGQPXTqNgusl1TLhsSi9JwjiS0ipPC+eoE3auuXxN1aGKAtzaA1X+jWzNDXbwtA5p7jD6qpB5sb6D95NUKGcsdqprGPgpbxVw5liOQctoIxg2iHFVOi338z+JJ38/9Q==;7:4APA4G6LKnnyXkK3llkM9fo2bwYjhjIhaTMSYYY5Z7XSVBqVhnzhbCUYaf1UMbfRVGona7cseh0GXvafYIS+83vhMP2YX868lWVL5p7MqmzvGS94xeYDBp79emaZZFFr5V3Swj0iaraXODWVfK7LoA== x-ms-office365-filtering-correlation-id: 56d47ac5-589e-46e9-44fd-08d68942ff24 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2998; x-ms-traffictypediagnostic: BYAPR11MB2998: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(376002)(366004)(346002)(39850400004)(189003)(199004)(25786009)(107886003)(105586002)(78486014)(36756003)(50226002)(2501003)(6916009)(66066001)(8936002)(3846002)(4326008)(305945005)(7736002)(71200400001)(71190400001)(8676002)(6116002)(54906003)(81166006)(316002)(446003)(81156014)(6436002)(6486002)(2906002)(2616005)(486006)(476003)(76176011)(256004)(99286004)(11346002)(14444005)(52116002)(53936002)(72206003)(478600001)(186003)(386003)(26005)(14454004)(106356001)(86362001)(5640700003)(97736004)(2351001)(68736007)(6506007)(102836004)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2998;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: NwtBiWT1Xc7e3NfxtnvPCD+GXpvzZ91WeUJ7ky9QbhBeRXS2eFSz+AQ+H2dgfdtPCW3Mza1aMCRwM6K9amviSmhhtEIsyk6Nt0/7+elNDAkANhVes9VdoCcrll1nzoYZk5hHquc0NTzu9Y20SUFwdrCi/ne4V5aaeTzwggQalKJ3ANQp0pJfNbDP2Pm7G63GHbud95rjsmhkT3KePo4mjcBYuE4zgJ+csGsaPJ5Nxh8Bs84nX5UdUY8O8yYzmMC8OpSceGtHomWusSmY+qsmt0OcEBE05aar4bd8tWjEyCy3Kn1w46S6uy5ls4N8Hr/bqyF42PMSfh1keHcVSw4ZAr7wSgzYylnFElA612qsUCVsb21bFNUZpw1dTTlI8ir6q0JQRCIyjBJCTzT0092kXVhmczcWp3Fli5A6pYAsr7g= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 56d47ac5-589e-46e9-44fd-08d68942ff24 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:16:54.1804 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2998 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh wilc_wfi_deinit_mon_interface() calls unregister_netdev() which requires the rtnl lock again. Now move wilc_wfi_deinit_mon_interface() out of wilc_mac_close(). Also remove explicit call to wilc_mac_close() because unregister_netdev() takes care of calling wilc_mac_close(). Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/linux_mon.c | 19 +++++-------------- drivers/staging/wilc1000/linux_wlan.c | 11 +++-------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index ed06834..32d0c81 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -253,19 +253,10 @@ struct net_device *wilc_wfi_init_mon_interface(struct wilc *wl, void wilc_wfi_deinit_mon_interface(struct wilc *wl) { - bool rollback_lock = false; - - if (wl->monitor_dev) { - if (rtnl_is_locked()) { - rtnl_unlock(); - rollback_lock = true; - } - unregister_netdev(wl->monitor_dev); + if (!wl->monitor_dev) + return; - if (rollback_lock) { - rtnl_lock(); - rollback_lock = false; - } - wl->monitor_dev = NULL; - } + unregister_netdev(wl->monitor_dev); + free_netdev(wl->monitor_dev); + wl->monitor_dev = NULL; } diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 1362d8f..b0249d2 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -920,7 +920,6 @@ static int wilc_mac_close(struct net_device *ndev) netdev_dbg(ndev, "Deinitializing wilc1000\n"); wl->close = 1; wilc_wlan_deinitialize(ndev); - wilc_wfi_deinit_mon_interface(wl); } vif->mac_opened = 0; @@ -1006,19 +1005,15 @@ void wilc_netdev_cleanup(struct wilc *wilc) wilc->firmware = NULL; } - if (wilc->vif[0]->ndev || wilc->vif[1]->ndev) { - for (i = 0; i < WILC_NUM_CONCURRENT_IFC; i++) - if (wilc->vif[i]->ndev) - if (wilc->vif[i]->mac_opened) - wilc_mac_close(wilc->vif[i]->ndev); - - for (i = 0; i < WILC_NUM_CONCURRENT_IFC; i++) { + for (i = 0; i < WILC_NUM_CONCURRENT_IFC; i++) { + if (wilc->vif[i] && wilc->vif[i]->ndev) { unregister_netdev(wilc->vif[i]->ndev); wilc_free_wiphy(wilc->vif[i]->ndev); free_netdev(wilc->vif[i]->ndev); } } + wilc_wfi_deinit_mon_interface(wilc); flush_workqueue(wilc->hif_workqueue); destroy_workqueue(wilc->hif_workqueue); wilc_wlan_cfg_deinit(wilc); From patchwork Sat Feb 2 19:16:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794469 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 427CB13A4 for ; Sat, 2 Feb 2019 19:17:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34FE42E1E0 for ; Sat, 2 Feb 2019 19:17:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 298DB2E1FF; Sat, 2 Feb 2019 19:17:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C39472E1E0 for ; Sat, 2 Feb 2019 19:17:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726787AbfBBTRD (ORCPT ); Sat, 2 Feb 2019 14:17:03 -0500 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:36455 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726643AbfBBTRD (ORCPT ); Sat, 2 Feb 2019 14:17:03 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="25789173" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Feb 2019 12:17:02 -0700 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.108) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:17:02 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SdrUwiVqV+p/0H+c6fPVfe46ka2sTfXzYSPleSF5BO0=; b=rJ9Ifz+MRdDNoR+cVhKcxMmw0yMkA/XRLzgg68d47zkQY+FUy6FMjNQavEGhDDhHYxJA4k9EhjXLvsQeKT/G23NAW5RUzfjygVVTwLzIQMAbuBlL7VHGZJTQ+vEg22HCVvMKb7n8Nv2iwqLmSXmvJQJ+mGFZI3oKxJEOE9Scmyo= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2998.namprd11.prod.outlook.com (20.177.224.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.21; Sat, 2 Feb 2019 19:16:59 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:16:59 +0000 From: To: CC: , , , , Subject: [PATCH 03/15] staging: wilc1000: remove redundant macros for radiotap Thread-Topic: [PATCH 03/15] staging: wilc1000: remove redundant macros for radiotap Thread-Index: AQHUuyvee8IyQa2e20K4gx2Ludvwqw== Date: Sat, 2 Feb 2019 19:16:59 +0000 Message-ID: <1549134974-5545-4-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2998;6:yV6boP0iwM3yNdxyfdIXmKCIXI9bWOfXU94+hdaXmpykYdhLlc7Ao/Y49nAoy+agczeV6lD9PCGHs1kmf56AT/eY+zPsTxCf7dWp6s8/CG58zXN/rnWmn7jaqDe70/rJ/BLqDl5ZA/YMnPbXTv1r1wf+dAfujYWB7I3lOQn235vxEoUNkAJv1y5s8emiVPO7trbH7ygECWeQkn+zBVGXqXvPeYO0fj3C6F3Qxddh1C822SKL6/YwlsEA6oVMduF/rU58dv2gS9PChEEbjASQkbynaa1qHtBmWj068r1Q3RxjA7qPx1GTUIugCZZBx1kceCdd1nUbEKq/zJy/n02LytszfSY7WgQXXQdQpHxhwYCefz6rRY8e1Xv5ksNSOtoGxcUHD17j1ceHk6AXYpxY7cVeujPah/PzgRwxuhNzLkUHY3EEiJufOQ6nKvXGvfP8kHDfU4x18WWZQBURKmdKiQ==;5:eFyde3Eh58mszJPZOeZOmNwSlmSKba4wG6X3EXUNqsPbF7bhSFjr0oX5t+A0PVMy9FoFpeyjeoCq3uoXE56LZTAJSW2h4o6oIY+DTKwL7Eh6Z7aE4maDj3M9s+eQIJKrdfqr+JY1Pvb9BEpYdOS7o9mBiKhwXbEIttRK7s1UKJsuMtajSkfUeoAwGVfX5ZcT0BWt/6POwg5m86O2G7EYZg==;7:cMYYps/GXKgqt27te0uhzg4e8n70FM26OzLTsdpwjWn/nb0eAdZm/BsUilH8QMKluUF+iR2LdrB/GaItXm5CTlUVZ5D3kA5odWb4XXL8ryW+iqYwJ2DSIxeT01ic/BcTjcqw/uiujD2JeMNN8kfIEw== x-ms-office365-filtering-correlation-id: b9a1edd6-e81b-441e-6b32-08d6894300c7 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2998; x-ms-traffictypediagnostic: BYAPR11MB2998: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(376002)(366004)(346002)(39850400004)(189003)(199004)(25786009)(107886003)(105586002)(78486014)(36756003)(50226002)(2501003)(6916009)(66066001)(8936002)(3846002)(4326008)(305945005)(7736002)(71200400001)(71190400001)(8676002)(6116002)(54906003)(81166006)(316002)(446003)(81156014)(6436002)(6486002)(2906002)(2616005)(486006)(476003)(76176011)(256004)(99286004)(11346002)(52116002)(53936002)(72206003)(478600001)(186003)(386003)(4744005)(26005)(14454004)(106356001)(86362001)(5640700003)(97736004)(2351001)(68736007)(6506007)(102836004)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2998;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ShCEwvXlaVKMfYHhTDux1YpByFGvUWV70b5KrAmwjBYpLJC/db7ydNk628CgIsfPiMczATntqse8P/GWIsGIw+2SLZMR4mlVKTjAYaEar66CB09y82rRqSRMZkzHjNKWW5vscXP9D3wdEeKF9sqFWYtQmKZvL93gVMgc+9g6sWbbWUWDbI/a+mMJ6ZMDX5B3C2iVu1nfatIi3OEpFc6ZHRfhyX2rlcfaKXEYNTV2mYUi/G+PyLf2VzodJS0r/uzgvQ2VU8CnTdwMe8e005e9qhoU+e1hltMfwfos4/COYArp6N2g34aXrAKLjh11ncGKD5+7lUabadFSUYhwVeLM2Qluncp78SGjWwaDSdSuy1GXykfnQi5zCLHsLCxmv929Hxxi3OMaUEyKASv8BNSHZ2ziFvusWfmynOudeE3xLFE= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b9a1edd6-e81b-441e-6b32-08d6894300c7 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:16:56.9453 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2998 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Remove macro define which are already present in the included header. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/linux_mon.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index 32d0c81..ce37b6f 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -21,9 +21,6 @@ struct wilc_wfi_radiotap_cb_hdr { static u8 srcadd[6]; static u8 bssid[6]; -#define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */ -#define IEEE80211_RADIOTAP_F_TX_FAIL 0x0001 /* failed due to excessive*/ - #define TX_RADIOTAP_PRESENT ((1 << IEEE80211_RADIOTAP_RATE) | \ (1 << IEEE80211_RADIOTAP_TX_FLAGS)) From patchwork Sat Feb 2 19:17:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794471 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 908D413A4 for ; Sat, 2 Feb 2019 19:17:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 822502E1E0 for ; Sat, 2 Feb 2019 19:17:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 768902E1FF; Sat, 2 Feb 2019 19:17:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 117AC2E1E0 for ; Sat, 2 Feb 2019 19:17:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726799AbfBBTRF (ORCPT ); Sat, 2 Feb 2019 14:17:05 -0500 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:36455 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726784AbfBBTRE (ORCPT ); Sat, 2 Feb 2019 14:17:04 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="25789174" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Feb 2019 12:17:03 -0700 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.108) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:17:03 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n5rUVZuh6Z2RSrsY2V7x7W2SlNuob5vuF3GFMRbQF2E=; b=Mz0w6fSaOaETSzFa03tKMwgjQnc1jzktteTbdTPyavlAYolunHj2UxXSf7MZ7I0zKZ1EnjY1VRDekPSJA3CKimoPQfYLuG2y64Hgat2/E3nu3bh8mXvVYCZ7bQVSMRfAEiafhs0wOqHcYD4lviPc+XDMxP4pQ/hgXGHHpxxb8+k= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2998.namprd11.prod.outlook.com (20.177.224.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.21; Sat, 2 Feb 2019 19:17:02 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:17:02 +0000 From: To: CC: , , , , Subject: [PATCH 04/15] staging: wilc1000: remove unnecessary debug log messages Thread-Topic: [PATCH 04/15] staging: wilc1000: remove unnecessary debug log messages Thread-Index: AQHUuyvgua6/kia3ykyboAjZFJF1Wg== Date: Sat, 2 Feb 2019 19:17:02 +0000 Message-ID: <1549134974-5545-5-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2998;6:ApDykclLIdcFU5Vk4X1SAPu+9PMkmeT+Vohiv/rP6bSZOwEynEZtUXhV0TK5SV30pE9zziu1iGtxJMRjsayL4qLActtM5URHUalJHfpypIZiGGZ4XnGCBD2eSBQTbQzmRWEPHpgoGCqM97SEuBqpd8z0cd2bq4aINoaj8vjbI2cWupyl0i/CeSU2CEvXEngtxx1YPsbDFUFz/zOb3+Yjhl/uo/9hOV2y8l1LoJGT+SQ6mtIRJYubtN3/khyTDZmX2M/5n79qQDzYI/FrCEh8DdsUR74nbyJ3NLY/XAKbmcz3X7gwtV6czTWCn88xbtL9nO1DJMQX+qlh+I72KlL0zgxrHxX3mDhLNt3jSAKjSyF/NOS10n/6JJ3iRZ4G646jPI8W3yDMZ4Bpx6XX4n7DF/jrxlLLqQMBP01pPZ5AKLLwbxQleFkp/hXiK8cdbf1vzA8Pua0q8QXjKVcRWufTkg==;5:0Kom+Gd2JRf7etsYH3gg4Qd6o84snTYqrqlUGbAl0SjtHrcJbaBPzqPhMQc0DN0KF+gqr397+ajC8/7FUpJvR8p1F+Kd9ph/BD5lpujCy6GTqDpdiofu40LEb7TRynWSMvMXLox05orqBEWxuZIKruAnj5Ril9nBJDvH9GM7fHIdbDdPPXtTp2QK3Amb7+RWjxgJXt3mgmETCuYC6VU8+A==;7:vCOOAV/lBsbHyW39ZQ3+YiDWq3td+xDQ+OPn4dQHsISkTWJuTXDohVJ18aPGO/nYqkVAxP5T1H7976cdITKeTtgyZqL+L5ENdH7cMHkQ69KDP/Y5ELAlW6A8TLNX7mQMLnnKJqlu8u3Q3w++gnw6DA== x-ms-office365-filtering-correlation-id: 0247c6e9-a584-4d69-dc90-08d689430280 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2998; x-ms-traffictypediagnostic: BYAPR11MB2998: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(376002)(366004)(346002)(39850400004)(189003)(199004)(25786009)(107886003)(105586002)(78486014)(36756003)(50226002)(2501003)(6916009)(66066001)(8936002)(3846002)(4326008)(305945005)(7736002)(71200400001)(71190400001)(8676002)(6116002)(54906003)(81166006)(316002)(446003)(81156014)(6436002)(6486002)(2906002)(2616005)(486006)(476003)(76176011)(256004)(99286004)(11346002)(52116002)(53936002)(72206003)(478600001)(186003)(386003)(26005)(14454004)(106356001)(86362001)(5640700003)(97736004)(2351001)(68736007)(6506007)(15650500001)(102836004)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2998;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: rS5Gzq0t1RswCW2DmoLuFyoxFdmmIbQhI9G7xqpvVdqlGYJ5Q0kz9XrHnx/adeD10FQqIvwEoI7o9LnKIkmD9mewagC9CunoIfAjz8poPZgV06YxoYvHIcaNaw3HsQ3IO9IN2XdE5tyIBAAogUbhW3IX1baDX6iHmtGuomrHxtjombtdtqsEi1uc2J5mpbr/h0Ca1dp0v5nFBf2n6QzkgZlQmC+QMrwPetfz8ClL4FD6LLiv9KJrX3HkpFZL3eM571m2gssQTjcRXQPXXngFZOW+AIoWHImGxh8DjKo0LlkATLTDSK08bOFihxaHoPhEfUhK+fIZfp1BfSAGsiZnwy5/+zmZ9xmojV52kXi84xzwSgdovN8TZq2Muw2NRX7AKVH8RjftStjNXPJb6Qm9okEal3gxcNNTPcn16TA8xw4= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 0247c6e9-a584-4d69-dc90-08d689430280 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:16:59.5862 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2998 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Remove unnecessary debug log messages. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/linux_wlan.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index b0249d2..81472d2 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -19,9 +19,7 @@ static int dev_state_ev_handler(struct notifier_block *this, struct wilc_priv *priv; struct host_if_drv *hif_drv; struct net_device *dev; - u8 *ip_addr_buf; struct wilc_vif *vif; - u8 null_ip[4] = {0}; char wlan_dev_name[5] = "wlan0"; if (!dev_iface || !dev_iface->ifa_dev || !dev_iface->ifa_dev->dev) @@ -56,13 +54,6 @@ static int dev_state_ev_handler(struct notifier_block *this, if (vif->wilc->enable_ps) wilc_set_power_mgmt(vif, 1, 0); - netdev_dbg(dev, "[%s] Up IP\n", dev_iface->ifa_label); - - ip_addr_buf = (char *)&dev_iface->ifa_address; - netdev_dbg(dev, "IP add=%d:%d:%d:%d\n", - ip_addr_buf[0], ip_addr_buf[1], - ip_addr_buf[2], ip_addr_buf[3]); - break; case NETDEV_DOWN: @@ -77,13 +68,6 @@ static int dev_state_ev_handler(struct notifier_block *this, wilc_resolve_disconnect_aberration(vif); - netdev_dbg(dev, "[%s] Down IP\n", dev_iface->ifa_label); - - ip_addr_buf = null_ip; - netdev_dbg(dev, "IP add=%d:%d:%d:%d\n", - ip_addr_buf[0], ip_addr_buf[1], - ip_addr_buf[2], ip_addr_buf[3]); - break; default: @@ -851,9 +835,6 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev) struct wilc *wilc = vif->wilc; struct tx_complete_data *tx_data = NULL; int queue_count; - char *udp_buf; - struct iphdr *ih; - struct ethhdr *eth_h; if (skb->dev != ndev) { netdev_err(ndev, "Packet not destined to this device\n"); @@ -871,18 +852,6 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev) tx_data->size = skb->len; tx_data->skb = skb; - eth_h = (struct ethhdr *)(skb->data); - if (eth_h->h_proto == cpu_to_be16(0x8e88)) - netdev_dbg(ndev, "EAPOL transmitted\n"); - - ih = (struct iphdr *)(skb->data + sizeof(struct ethhdr)); - - udp_buf = (char *)ih + sizeof(struct iphdr); - if ((udp_buf[1] == 68 && udp_buf[3] == 67) || - (udp_buf[1] == 67 && udp_buf[3] == 68)) - netdev_dbg(ndev, "DHCP Message transmitted, type:%x %x %x\n", - udp_buf[248], udp_buf[249], udp_buf[250]); - vif->netstats.tx_packets++; vif->netstats.tx_bytes += tx_data->size; tx_data->bssid = wilc->vif[vif->idx]->bssid; From patchwork Sat Feb 2 19:17:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794473 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1B84A746 for ; Sat, 2 Feb 2019 19:17:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DB062E1E0 for ; Sat, 2 Feb 2019 19:17:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 020B92E1FF; Sat, 2 Feb 2019 19:17:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76C462E1E0 for ; Sat, 2 Feb 2019 19:17:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726818AbfBBTRH (ORCPT ); Sat, 2 Feb 2019 14:17:07 -0500 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:24928 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726784AbfBBTRH (ORCPT ); Sat, 2 Feb 2019 14:17:07 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="27205811" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Feb 2019 12:17:06 -0700 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.49) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:17:06 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+2hqm+zttknyBndraW8EuqEof201oREous2KQ2UKNXw=; b=3uwJHmFxoY5xcvZ958qagRQIVp43V2kS2lDHRBq0B35GCfGPp6471ONEnkJXx6DIOCon1ZcnXJYircxYl2l3dnHbFfnkUBLmu1Rilr6vgSKCO8rYN4i9E2qovR+tVTTad+UbPDaWBVc2mWb7ilttSw3euboLScMqeMsmoC9g9A0= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2998.namprd11.prod.outlook.com (20.177.224.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.21; Sat, 2 Feb 2019 19:17:05 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:17:05 +0000 From: To: CC: , , , , Subject: [PATCH 05/15] staging: wilc1000: rename timeout related macros Thread-Topic: [PATCH 05/15] staging: wilc1000: rename timeout related macros Thread-Index: AQHUuyvh43ZAN6bCzUudObYJa32wsg== Date: Sat, 2 Feb 2019 19:17:05 +0000 Message-ID: <1549134974-5545-6-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2998;6:xhe9ZkM6uIa3/DYEUNdL8wVlBBO9Vj1fE0YumL2pV81Osvv5Oa5XJviOMK9I9NSXvxdtxtPIn7Tjb9bOcWh9a+tqkNCE0RY9W0LGkVMf9WID2Pm/4lavlqweYPWnIF5Wd0Zggt5qdpROFbk2fd3e7IkOSQTu/53NHdtPiOSTzwq//umDEHuQbQriSTVuxlZRDORPoaw78EL/Soi5NUJHwhgfuvpbWbP5wUz7nm3Xitx0GPoq8FgzkIT8SCeQLdf9GfM3mPzpPq7Su0lrxcucVVO4PSVM/+JoA5bx5COUAj6GAVP8wTWvcucUEYky+tmz13DHrZAxHDpJJLij3iLNIdrI0hq6dfkK1nZPQ+EbzYtgJZbVnDfAE0C2mbDY4VTqSGljLAjNX201efeegUhCK2CDtk3KV6SDR8xPzbFYsCGju0lC5DDAlmlU4Yhs9QjB/8v4Zj9uxtxUZY2UMssRSg==;5:0SobPl0hTsZJJRQ81vaM+s7s+FJk/F6H4ijdussgmuUXfEDiuzetqTqW6j6AStK5xGepqmlnyOG11T6SbxTGqy6RynkEaMGB0Q7ygpULdJQ/qww4DxDAvpj+MUQy7d/OUQc2vZPAFGDOM/IwzfOppX/JryUnaXwxrA7NaRtrhDsfzhScbluw5gURTIm/BY4VvmTGYf83mQPy7wPsV2AggA==;7:01WYJ5iXCw+rKpwAKEyQmgEZ5fxxj/BdEquusLFSIVnvYP4qtvrnYW1IV0JitS5FVO1PI4jvG/yIKWi85cHLKPHfNptRR8SCZ7hR7t7Rnwc3bliHT+U/oupWIjrnpQbqrFcCDcrfC9FYJvqE8yyqqQ== x-ms-office365-filtering-correlation-id: 1d85a612-3ff4-42fb-8207-08d689430429 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2998; x-ms-traffictypediagnostic: BYAPR11MB2998: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(376002)(366004)(346002)(39850400004)(189003)(199004)(25786009)(107886003)(105586002)(78486014)(36756003)(50226002)(2501003)(6916009)(66066001)(8936002)(3846002)(4326008)(305945005)(7736002)(71200400001)(71190400001)(8676002)(6116002)(54906003)(81166006)(316002)(446003)(81156014)(6436002)(6486002)(2906002)(2616005)(486006)(476003)(76176011)(256004)(99286004)(11346002)(52116002)(53936002)(72206003)(478600001)(186003)(386003)(26005)(14454004)(106356001)(86362001)(5640700003)(97736004)(2351001)(68736007)(6506007)(102836004)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2998;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ucj7kPWclol5llhr33NbQs0ydrP+l/Rpy93zEsgrcsdjLgvLpT0tyFKw4iQikivTY4Eo9ndVT/IaqRylbX3lxBVRteN3urFXai8yPeLSELSjdnkyyBxxWJ/0dqtcZPTqIR4DBrxNA8jhml2Dux1xs2bR8NyFw1vHSTKeWQMZRppcnzghAqutCxetLAek6NRzLpNyCRhqkdLiyux/WsSk1UaI+JG+wTvqMN6qbvg0EOy2nvbQl0mjLAkTXg/TK2Oxf3R1rrWevzwo8qbNVNk01ZbCVTJjYKobmoxRtVrErOLWdvE3yrnx2ConEgIj+j04blgeVJVaQtzcccm325+ZDLZFOtKEx2lh+6prBqOyGRPAOPjNfDiy4YhWBOF5kspdBWhj5xjpgUP6R8Oih4JRZo2ZDUGUxQI2f3V1uXO7AE8= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 1d85a612-3ff4-42fb-8207-08d689430429 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:17:02.4912 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2998 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Rename timeout related macros to have their unit clear from their name. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.c | 8 ++++---- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 ++-- drivers/staging/wilc1000/wilc_wlan.c | 4 ++-- drivers/staging/wilc1000/wilc_wlan.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index e958f9b..3576834 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -6,8 +6,8 @@ #include "wilc_wfi_netdevice.h" -#define HOST_IF_SCAN_TIMEOUT 4000 -#define HOST_IF_CONNECT_TIMEOUT 9500 +#define WILC_HIF_SCAN_TIMEOUT_MS 4000 +#define WILC_HIF_CONNECT_TIMEOUT_MS 9500 #define FALSE_FRMWR_CHANNEL 100 @@ -327,7 +327,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type, hif_drv->usr_scan_req.arg = user_arg; hif_drv->scan_timer_vif = vif; mod_timer(&hif_drv->scan_timer, - jiffies + msecs_to_jiffies(HOST_IF_SCAN_TIMEOUT)); + jiffies + msecs_to_jiffies(WILC_HIF_SCAN_TIMEOUT_MS)); error: if (search) { @@ -1442,7 +1442,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ies, hif_drv->connect_timer_vif = vif; mod_timer(&hif_drv->connect_timer, - jiffies + msecs_to_jiffies(HOST_IF_CONNECT_TIMEOUT)); + jiffies + msecs_to_jiffies(WILC_HIF_CONNECT_TIMEOUT_MS)); return 0; diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index cd3df42..95230d7 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -72,7 +72,7 @@ static u8 curr_channel; static u8 p2p_oui[] = {0x50, 0x6f, 0x9A, 0x09}; static u8 p2p_vendor_spec[] = {0xdd, 0x05, 0x00, 0x08, 0x40, 0x03}; -#define DURING_IP_TIME_OUT 15000 +#define WILC_IP_TIMEOUT_MS 15000 static void clear_during_ip(struct timer_list *t) { @@ -1489,7 +1489,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, case NL80211_IFTYPE_P2P_GO: vif->obtaining_ip = true; mod_timer(&vif->during_ip_timer, - jiffies + msecs_to_jiffies(DURING_IP_TIME_OUT)); + jiffies + msecs_to_jiffies(WILC_IP_TIMEOUT_MS)); wilc_set_operation_mode(vif, WILC_AP_MODE); dev->ieee80211_ptr->iftype = type; priv->wdev->iftype = type; diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 58bcdc1..7a757c9 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1141,7 +1141,7 @@ int wilc_wlan_cfg_set(struct wilc_vif *vif, int start, u16 wid, u8 *buffer, ret_size = 0; if (!wait_for_completion_timeout(&wilc->cfg_event, - msecs_to_jiffies(CFG_PKTS_TIMEOUT))) { + WILC_CFG_PKTS_TIMEOUT)) { netdev_dbg(vif->ndev, "%s: Timed Out\n", __func__); ret_size = 0; } @@ -1179,7 +1179,7 @@ int wilc_wlan_cfg_get(struct wilc_vif *vif, int start, u16 wid, int commit, ret_size = 0; if (!wait_for_completion_timeout(&wilc->cfg_event, - msecs_to_jiffies(CFG_PKTS_TIMEOUT))) { + WILC_CFG_PKTS_TIMEOUT)) { netdev_dbg(vif->ndev, "%s: Timed Out\n", __func__); ret_size = 0; } diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index 3880452..1d61e20 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -196,7 +196,7 @@ #define ENABLE_RX_VMM (SEL_VMM_TBL1 | EN_VMM) #define ENABLE_TX_VMM (SEL_VMM_TBL0 | EN_VMM) /*time for expiring the completion of cfg packets*/ -#define CFG_PKTS_TIMEOUT 2000 +#define WILC_CFG_PKTS_TIMEOUT msecs_to_jiffies(2000) #define IS_MANAGMEMENT 0x100 #define IS_MANAGMEMENT_CALLBACK 0x080 From patchwork Sat Feb 2 19:17:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794475 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2A76D13A4 for ; Sat, 2 Feb 2019 19:17:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C3D22E1E0 for ; Sat, 2 Feb 2019 19:17:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 104232E1FF; Sat, 2 Feb 2019 19:17:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A5492E1E0 for ; Sat, 2 Feb 2019 19:17:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726830AbfBBTRK (ORCPT ); Sat, 2 Feb 2019 14:17:10 -0500 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:12667 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726784AbfBBTRK (ORCPT ); Sat, 2 Feb 2019 14:17:10 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="26232214" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 02 Feb 2019 12:17:09 -0700 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:17:09 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HY8yqSaUMdNKviwoaHd/tppUcmbpgwyyEqKZWq474sE=; b=LF9NnUN/Dee/gEcOfdqJDQpfRYSbhsgc4AU0U16aj6B7VpFuHsbOBTP4C3DZz8ynpldN+15xZ2i/NgvtVVl5A1Y/ThjxMFVBB4D7pbWj8syUDtBx6bqulgwfZ9jSrtu4/4SAYy9+VV4zix4DE9Y/dp7OiOMNB37SMYzKChJAhaM= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2998.namprd11.prod.outlook.com (20.177.224.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.21; Sat, 2 Feb 2019 19:17:08 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:17:08 +0000 From: To: CC: , , , , Subject: [PATCH 06/15] staging: wilc1000: make use of iface type to identify p2p interface Thread-Topic: [PATCH 06/15] staging: wilc1000: make use of iface type to identify p2p interface Thread-Index: AQHUuyvjJZwJW3nTWkS6DFmJssE7qA== Date: Sat, 2 Feb 2019 19:17:07 +0000 Message-ID: <1549134974-5545-7-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2998;6:oBvqZrdCldX6w2jEkSeOBKjc+kkTQF92W/dzFHY8O64Lg3GC4R96cFNyrXBuXYlnatHwwMYLCCmiH9lZVUR0DWJL4N6Vc3AVAlcoN0OI8EaOjdz15zzh8N+B3X/CPuUfmHOPvfaLOQATbPhyEwCEGkIXsnhcwj1VLvAvidV6yxeEwt6ye9g7ttStKXsZ7u/jVtmElF8CASYL3DIYAqWMwjP4qYByPB/ppIcsCTio/AcrdL77NHDpHuKS4Zbj/swLqjdOdI/Z+h0e0QIhbZ/1QFC8aRXX+s1z/JiaVgDCEb3qKAWy0K1vBecPcLHnfCJB4ssJIXEh+UTMsHeeoQsxfvtRWQBkZRmc0UDmKHXWi1T2cH/G4bWrpAyLtRYSTDuek1geUGtYRXH9xa9YGeSLYBoCubY857seCx197g2iH53SWwYvJem/NDCBgOTMmt+DujOYpEuJiap42LbtmTEVJA==;5:m/Mtj2LXoWy/QCuPRJlUfXL439M3/DRj4QbNlOT3alVSpDDJu7VdSnZAgt+uuzf7JUbHNqcGWVlocRaJ3BWTvvF+phyHZkNIqE2X3wJOq/KhXp9ub+h832Fw01W2iierQfJ/NqhIkS8H4Cimd3AJ7ztwurYRIP+Qn20HuIgLl0tgXP0r+WralaGGxvxvWs6ltmKdYVNM//55YuZKMWWABw==;7:KTdVe0+/hkzJcP40xYNJZyO6JRHezNI4oo3funAwdA/s0z+57gCB3/yNkjOFmAg7r9Nlpmi7BgToa4dVXyG1MWcTcOz2dF5uDZS1QqKc3MZx2dqyq52m1RO1sDVTfr9WSmoI5Xc+jNMgHfHljuV/iQ== x-ms-office365-filtering-correlation-id: 770ebfe9-caf6-4a89-1c0a-08d68943060b x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2998; x-ms-traffictypediagnostic: BYAPR11MB2998: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(376002)(366004)(346002)(39850400004)(189003)(199004)(25786009)(107886003)(105586002)(78486014)(36756003)(50226002)(2501003)(6916009)(66066001)(8936002)(3846002)(4326008)(305945005)(7736002)(71200400001)(71190400001)(8676002)(6116002)(54906003)(81166006)(316002)(446003)(81156014)(6436002)(6486002)(2906002)(2616005)(486006)(476003)(76176011)(256004)(99286004)(11346002)(14444005)(52116002)(53936002)(72206003)(478600001)(186003)(386003)(26005)(14454004)(106356001)(86362001)(5640700003)(97736004)(2351001)(68736007)(6506007)(102836004)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2998;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: UiVBgjLlRA9bQuldjdLcbpR/tvIXHD58EBFR0WO/nnOuxCdzP4C6gNoOUDzI1oYnFD17RNlPEbNys1kX9i78xj/SprafwxL2EPTfIYi9kXPbT9F+Eu08GYVdUg3oI3yuQR3jz6Fiem9CdqYttQxcXWdL5hsgSE9GSgowAAIjnnJ9inDybb6E8s7jYSyN1wdQv1EW2bYfD1sI7v5XqnHPrRapTiXnlJZZ7ZJ6dDG6doi3bWzddl6nDnISxs+D+Pq8MAXIkBBuh1Zq8HUKb3ykCVq1MjwSOcaicYuVWqnsaLrSsxXXa8UQb5bP5Hex8k3ooT6sX8Z+1+9NmSlKgzCkv6V02rH3cg/kkXxYFpgBTWmMuHdK0zMiV0Qb+J2rx9u+w9BSXPU9H1DcEuNCTudJV+EYT5LDdsz04Uj6Ko88/+E= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 770ebfe9-caf6-4a89-1c0a-08d68943060b X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:17:05.3703 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2998 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Remove SSID string compare instead use interface type check for p2p client interface. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.h | 1 - drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 19 ++++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 7f3fc4c..8fa97a7 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -153,7 +153,6 @@ struct host_if_drv { struct remain_ch remain_on_ch; u8 remain_on_ch_pending; u64 p2p_timeout; - u8 p2p_connect; enum host_if_state hif_state; diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 95230d7..faffcc8 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -159,7 +159,7 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt, u8 mac_status, connect_status = WLAN_STATUS_UNSPECIFIED_FAILURE; wilc_wlan_set_bssid(priv->dev, NULL, WILC_STATION_MODE); - if (!wfi_drv->p2p_connect) + if (vif->iftype != WILC_CLIENT_MODE) wlan_channel = INVALID_CHANNEL; netdev_err(dev, "Unspecified failure\n"); @@ -185,7 +185,7 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt, u8 mac_status, eth_zero_addr(priv->associated_bss); wilc_wlan_set_bssid(priv->dev, NULL, WILC_STATION_MODE); - if (!wfi_drv->p2p_connect) + if (vif->iftype != WILC_CLIENT_MODE) wlan_channel = INVALID_CHANNEL; if (wfi_drv->ifc_up && dev == wl->vif[1]->ndev) @@ -329,11 +329,6 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, vif->connecting = true; - if (!(strncmp(sme->ssid, "DIRECT-", 7))) - wfi_drv->p2p_connect = 1; - else - wfi_drv->p2p_connect = 0; - memset(priv->wep_key, 0, sizeof(priv->wep_key)); memset(priv->wep_key_len, 0, sizeof(priv->wep_key_len)); @@ -436,7 +431,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, curr_channel = ieee80211_frequency_to_channel(bss->channel->center_freq); - if (!wfi_drv->p2p_connect) + if (vif->iftype != WILC_CLIENT_MODE) wlan_channel = curr_channel; wilc_wlan_set_bssid(dev, bss->bssid, WILC_STATION_MODE); @@ -452,7 +447,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, if (ret) { netdev_err(dev, "wilc_set_join_req(): Error\n"); ret = -ENOENT; - if (!wfi_drv->p2p_connect) + if (vif->iftype != WILC_CLIENT_MODE) wlan_channel = INVALID_CHANNEL; wilc_wlan_set_bssid(dev, NULL, WILC_STATION_MODE); wfi_drv->conn_info.conn_result = NULL; @@ -477,7 +472,6 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev, struct wilc_priv *priv = wiphy_priv(wiphy); struct wilc_vif *vif = netdev_priv(priv->dev); struct wilc *wilc = vif->wilc; - struct host_if_drv *wfi_drv; int ret; vif->connecting = false; @@ -491,15 +485,14 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev, return 0; } - wfi_drv = (struct host_if_drv *)priv->hif_drv; - if (!wfi_drv->p2p_connect) + if (vif->iftype != WILC_CLIENT_MODE) wlan_channel = INVALID_CHANNEL; wilc_wlan_set_bssid(priv->dev, NULL, WILC_STATION_MODE); priv->p2p.local_random = 0x01; priv->p2p.recv_random = 0x00; priv->p2p.is_wilc_ie = false; - wfi_drv->p2p_timeout = 0; + priv->hif_drv->p2p_timeout = 0; ret = wilc_disconnect(vif); if (ret != 0) { From patchwork Sat Feb 2 19:17:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794477 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 119D0746 for ; Sat, 2 Feb 2019 19:17:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03E8D2E1E0 for ; Sat, 2 Feb 2019 19:17:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC2FD2E1FF; Sat, 2 Feb 2019 19:17:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D2E82E1E0 for ; Sat, 2 Feb 2019 19:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726843AbfBBTRN (ORCPT ); Sat, 2 Feb 2019 14:17:13 -0500 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:13178 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726784AbfBBTRN (ORCPT ); Sat, 2 Feb 2019 14:17:13 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="24160773" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Feb 2019 12:17:13 -0700 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.107) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:17:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FuZm38XjAIJa1U3CtiEen0JGVox+w39IAh8UT7FahIg=; b=SNBSJdu1DtoUrk3nPqSOPQ3/Kaevm93/67dEwFrin8qL68VZtU2ChHUEgziyPytze56czCKAPTg8cZtmcyW9BHkWA0hH6Tks+z5hXNIp8Z3jONT+rZMCzWyOLspOmqAfFh04nF0qp44KbBEfkejGsPoC6KT+rnwssusSAz74EdQ= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2998.namprd11.prod.outlook.com (20.177.224.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.21; Sat, 2 Feb 2019 19:17:10 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:17:10 +0000 From: To: CC: , , , , Subject: [PATCH 07/15] staging: wilc1000: refactor scan() cfg80211 ops callback Thread-Topic: [PATCH 07/15] staging: wilc1000: refactor scan() cfg80211 ops callback Thread-Index: AQHUuyvlJ6DL9tLBCEKIKxEqObc91g== Date: Sat, 2 Feb 2019 19:17:10 +0000 Message-ID: <1549134974-5545-8-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2998;6:i1b+wz3bSWuSLci5ldnPRSkG7qs73zMutHQ5NBWRwHSzVLDrgvGUGaCrLsgA2qu3KEaIIUcARQVHX2JtgMd6iOMGxJaCbOMvcitf4Zw+muyNlM9KhUaSvsKx2feyGmqa7qN3PE1n2vpVTzLxyLpMHiPmo1ZrSovi9x9MpweBWInDpSZ1hYWbYrwBHs0pawUE3Y1Br6Jzu9bEyAA2p53c7489V4Cf6GrHiNVpLEQ9LzOk2XFYvOsslHHd96RiVhs+GZJpBPlCFr+BEu5wyNYEff2azTOGhC7ziX1+p2/1iFgl4d4EOCTX2bMDFAKIW9NsRf+8Qnszl2rem8QFerSbeN5ecI/2ydlRWt9suG7E0DECWXFKksSlpjuye+t/2X0UXIwrl4sVqjKlYULJ6BChUs8e0Swhq51vfvY2LseD1+tDZSNWYaYN5VpLkrUfw3h7FPXFdvxHyP7c7jNypX6X9w==;5:S34oAyB8BsRtOimyUG4LFNeaULc/Bc6lgYQliJnNrJEcxyZY4hOn1F2/EjXqGT6lyb4EG1FuMWyzSdjtsX+zH23+F6g9eYLdrZm3VNRa8/AQYU3z6qTMbsWEOBscKyFSr7XLcgDpCN2YjMIbg+EyIkz3+GQYIrUudGHKzGh90WuKyOcCq+Ly61AQYIuLakY0SsaZCpvSTdLTa8mA9FQEgQ==;7:/NzFiCkq+HM16B1XzkgswV10is6apiSo4An732LkCh5o7agutZc8xSzE0Sc18lJInSCHsbM9RyZMC4dsh2gbTk1+WjvnkEpBk4GCuz9QPHPGcxsMkKPPmJhwRyctM5hmUI6B5m90bB5sOSqS2TqMkw== x-ms-office365-filtering-correlation-id: a790b9e1-3bad-4ee1-ad8f-08d6894307a9 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2998; x-ms-traffictypediagnostic: BYAPR11MB2998: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(376002)(366004)(346002)(39850400004)(189003)(199004)(25786009)(107886003)(105586002)(78486014)(36756003)(50226002)(2501003)(6916009)(66066001)(8936002)(3846002)(4326008)(305945005)(7736002)(71200400001)(71190400001)(8676002)(6116002)(54906003)(81166006)(316002)(446003)(81156014)(6436002)(6486002)(2906002)(2616005)(486006)(476003)(76176011)(256004)(99286004)(11346002)(14444005)(52116002)(53936002)(72206003)(478600001)(186003)(386003)(26005)(14454004)(106356001)(86362001)(5640700003)(97736004)(2351001)(68736007)(6506007)(102836004)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2998;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: hSQJOObh2Z4xDM08ITlYXscETcxj9coePIvi4T7rV2thZ/NvmWFyU4r8nfbh7PP33fQ5kwmA94TEeKOMCzbV33CPCALUqLBIPsaWGjkGduNhbLqkCjxGnMXc4ciGokxruqIMecE9ZQxTfnflFXhg5FTT36ieNaY9C0lFfvl6oHeTIHhnMBclqQLpyUPqT7VApE/Fgn1XeThQ84ShcXBZ6Vl3/yYScnc7ioDqAtsuyfMB9HFQh2sqrR6BGdk8Rkn+ZidzfVpJSObLToID1BhnDFMqb9vfvnLoXu5aVEg0DzD2CRZ9mWQsuAJLt8ebeTp3oTnArig6z5onczqlmqyduNMrL4F5gFS5Cs9bRj83stG+yoy18d0fGUMLtGyCJo4KxH3wwCgZoBdJTcXoHRqR6l/eOYaSZC2LfV+BXX/YDbA= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a790b9e1-3bad-4ee1-ad8f-08d6894307a9 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:17:08.3133 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2998 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Refactor scan() cfg80211 callback function and use correct value for valid channel number limit. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.h | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 55 +++++++++++------------ 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 8fa97a7..0feb63f 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -18,7 +18,7 @@ enum { }; #define WILC_MAX_NUM_STA 9 -#define MAX_NUM_SCANNED_NETWORKS 100 +#define WILC_MAX_NUM_SCANNED_CH 14 #define WILC_MAX_NUM_PROBED_SSID 10 #define TX_MIC_KEY_LEN 8 diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index faffcc8..08b60ddd 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -266,42 +266,41 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) struct wilc_vif *vif = netdev_priv(priv->dev); u32 i; int ret = 0; - u8 scan_ch_list[MAX_NUM_SCANNED_NETWORKS]; + u8 scan_ch_list[WILC_MAX_NUM_SCANNED_CH]; struct wilc_probe_ssid probe_ssid; - priv->scan_req = request; + if (request->n_channels > WILC_MAX_NUM_SCANNED_CH) { + netdev_err(priv->dev, "Requested scanned channels over\n"); + return -EINVAL; + } + priv->scan_req = request; priv->cfg_scanning = true; - if (request->n_channels <= MAX_NUM_SCANNED_NETWORKS) { - for (i = 0; i < request->n_channels; i++) { - u16 freq = request->channels[i]->center_freq; - - scan_ch_list[i] = ieee80211_frequency_to_channel(freq); - } + for (i = 0; i < request->n_channels; i++) { + u16 freq = request->channels[i]->center_freq; - if (request->n_ssids >= 1) { - if (wilc_wfi_cfg_alloc_fill_ssid(request, - &probe_ssid)) { - ret = -ENOMEM; - goto out; - } + scan_ch_list[i] = ieee80211_frequency_to_channel(freq); + } - ret = wilc_scan(vif, WILC_FW_USER_SCAN, - WILC_FW_ACTIVE_SCAN, scan_ch_list, - request->n_channels, - (const u8 *)request->ie, - request->ie_len, cfg_scan_result, - (void *)priv, &probe_ssid); - } else { - ret = wilc_scan(vif, WILC_FW_USER_SCAN, - WILC_FW_ACTIVE_SCAN, scan_ch_list, - request->n_channels, - (const u8 *)request->ie, - request->ie_len, cfg_scan_result, - (void *)priv, NULL); + if (request->n_ssids >= 1) { + if (wilc_wfi_cfg_alloc_fill_ssid(request, &probe_ssid)) { + ret = -ENOMEM; + goto out; } + + ret = wilc_scan(vif, WILC_FW_USER_SCAN, + WILC_FW_ACTIVE_SCAN, scan_ch_list, + request->n_channels, + (const u8 *)request->ie, + request->ie_len, cfg_scan_result, + (void *)priv, &probe_ssid); } else { - netdev_err(priv->dev, "Requested scanned channels over\n"); + ret = wilc_scan(vif, WILC_FW_USER_SCAN, + WILC_FW_ACTIVE_SCAN, scan_ch_list, + request->n_channels, + (const u8 *)request->ie, + request->ie_len, cfg_scan_result, + (void *)priv, NULL); } out: From patchwork Sat Feb 2 19:17:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794479 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C6636746 for ; Sat, 2 Feb 2019 19:17:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B913B2E1E0 for ; Sat, 2 Feb 2019 19:17:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD2B92E1FF; Sat, 2 Feb 2019 19:17:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F2E62E1E0 for ; Sat, 2 Feb 2019 19:17:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726852AbfBBTRR (ORCPT ); Sat, 2 Feb 2019 14:17:17 -0500 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:36467 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726784AbfBBTRR (ORCPT ); Sat, 2 Feb 2019 14:17:17 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="25789181" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Feb 2019 12:17:15 -0700 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.108) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:17:14 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MWFsvsxw1NnZLOePfqvjArizv27M9uT1uDq5pl8heYI=; b=INBZmxmC9xpQTQUaNgXgg93RDljq6zYrbFS97xC1YqdmkTo0puBrX81nvEp4Pti7S+Lj/jDvCr2vWIs4IX4mSfyJJ9yxwlCIQO8ykV2/y1HSEHUbDgkxquuTgRPsjWGqOTySXsIeJeItnkdn0LJRIscFXVPd63J2GmclEpYQee0= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2998.namprd11.prod.outlook.com (20.177.224.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.21; Sat, 2 Feb 2019 19:17:13 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:17:13 +0000 From: To: CC: , , , , Subject: [PATCH 08/15] staging: wilc1000: use correct condition in loops for 'vif_num' count Thread-Topic: [PATCH 08/15] staging: wilc1000: use correct condition in loops for 'vif_num' count Thread-Index: AQHUuyvnTipBfoysokuAty4Jr8EL5Q== Date: Sat, 2 Feb 2019 19:17:13 +0000 Message-ID: <1549134974-5545-9-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2998;6:nnvFX8gFy8A5qKX4Y93maDO1MEZBqBW706cy8rDWPke+Wg6wjuS4naWA8npIrv5w4wh4lYUWTkjmIX3Eks9CCeE+4dFOXKeXR2hVySRfDR5eQAGCPYQkRGyv7C5vebiv06/P7vlStBY6eRmJ8NXeArHSNXit37XBXtD8RfSkW6iGv4RTilPa+HoUVqgR6hqdNNAvbUVb0fFexPM74yGckHuoCXn2JoOkYKR5ngdGeinoeX3S/fRG5cQmZGSFe16L3Q1ITIFpcQjQt/74e3a6OTaAZsubnm3GMlhH2xWk49Gp96pd3IB3hyLYDLY3Tx0kaX5nMWEyK9iga4pePoyqo3heXIWWxkze1BvB3eH9gBfFEwHB/zgtQ91S2w6BGw2ZsXZzFcEnr0dUir0RboCjHcw4k1MBK2/p8hW97CQ+q1Aduo5kSKAfoMQtX8g/2xXGeu8FlU7s/zHGAWsP/t2JuQ==;5:GFU0iymLEL2H+xNSv4fC+LYXsT2RECDH6rw1I0FagGjg44lp8ncYwbXQSoFSmD9hkmzCiLamI4CW65lmLpOtnb+rY2GTVp+MCb3faLjGnlOhxV7WR9aRIKincq9wKasO+0YvgNjPNguDTKePZd/rmLVyZ0Ahne5TRLDcPTjIg2dXYOX7aR4aUgbW+vZdjf0pSOGeSmb5BoJj9w4OQHlhSw==;7:7ANu8/aKfL6wRZv4t0ggWhoymcXhy62RxFkYAJx99b/1G95Gd70wZBM345l5TBnr8RSJATmuT0RnbDxpCSLl3zDr5xI5z0YwfmVGA4jfkcfVbiKU/1qJKNnYNTc1p6YDk2DBdDHi/NeViKySGsfRZA== x-ms-office365-filtering-correlation-id: 649ccaf1-5286-42db-0075-08d689430940 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2998; x-ms-traffictypediagnostic: BYAPR11MB2998: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(376002)(366004)(346002)(39850400004)(189003)(199004)(25786009)(107886003)(105586002)(78486014)(36756003)(50226002)(2501003)(6916009)(66066001)(8936002)(3846002)(4326008)(305945005)(7736002)(71200400001)(71190400001)(8676002)(6116002)(54906003)(81166006)(316002)(446003)(81156014)(6436002)(6486002)(2906002)(2616005)(486006)(476003)(76176011)(256004)(99286004)(11346002)(52116002)(53936002)(72206003)(478600001)(186003)(386003)(26005)(14454004)(106356001)(86362001)(5640700003)(97736004)(2351001)(68736007)(6506007)(102836004)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2998;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: lNMq+MrV4hJ+3Ii+bK5uZczPvN1va1aU2zmdhyiN1TcqeXgKR1vD+uXCbd1hEVqDoDaVZXDOK2t3UEpm5UIGekmVAFenVQ203oNBsZAI07yYOtPmPGb0szdoELYBJYZ7JjInycL3H4FsgL9vYSygDIDwtt0kP9gKpClkiaY+T9zUV9Ilx9C3t8Be+sw1o7ZSwBpIONScRu2ffL2uFAJbrpZdPHFeULh0mN3HsZIqfolFmiAdHNIEvGyjHJa19+zghOZgMSAVP2jj0AKwRFJXTbjaY2+rKh6dfODv8BmGKFh9xF1qcAk1S+0XGrJgXM0I2aTDsWwEdsfx9B0X6ZBq50IbVLUwipYH/kOVjE7cLpHnlxAROlmXrB1cgRtIeeramGg9spTcmxI5pTiFuvq/yW/e/dT61iNZkTrpDZhFCx0= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 649ccaf1-5286-42db-0075-08d689430940 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:17:11.1373 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2998 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh The value of 'vif_num'(interface count) starts with 0, so modified the loop conditions to execute for all interface. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.c | 2 +- drivers/staging/wilc1000/linux_wlan.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 3576834..fde236a 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1659,7 +1659,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) return -ENOMEM; *hif_drv_handler = hif_drv; - for (i = 0; i < wilc->vif_num; i++) + for (i = 0; i <= wilc->vif_num; i++) if (dev == wilc->vif[i]->ndev) { wilc->vif[i]->hif_drv = hif_drv; hif_drv->driver_handler_id = i + 1; diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 81472d2..466a1fa 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -164,7 +164,7 @@ static struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header) bssid = mac_header + 10; bssid1 = mac_header + 4; - for (i = 0; i < wilc->vif_num; i++) { + for (i = 0; i <= wilc->vif_num; i++) { if (wilc->vif[i]->mode == WILC_STATION_MODE) if (ether_addr_equal_unaligned(bssid, wilc->vif[i]->bssid)) @@ -195,7 +195,7 @@ int wilc_wlan_get_num_conn_ifcs(struct wilc *wilc) u8 i = 0; u8 ret_val = 0; - for (i = 0; i < wilc->vif_num; i++) + for (i = 0; i <= wilc->vif_num; i++) if (!is_zero_ether_addr(wilc->vif[i]->bssid)) ret_val++; @@ -739,7 +739,7 @@ static int wilc_mac_open(struct net_device *ndev) return ret; } - for (i = 0; i < wl->vif_num; i++) { + for (i = 0; i <= wl->vif_num; i++) { if (ndev == wl->vif[i]->ndev) { wilc_set_wfi_drv_handler(vif, wilc_get_vif_idx(vif), vif->iftype, vif->ifc_id); @@ -941,7 +941,7 @@ void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size) int i = 0; struct wilc_vif *vif; - for (i = 0; i < wilc->vif_num; i++) { + for (i = 0; i <= wilc->vif_num; i++) { vif = netdev_priv(wilc->vif[i]->ndev); if (vif->monitor_flag) { wilc_wfi_monitor_rx(wilc->monitor_dev, buff, size); From patchwork Sat Feb 2 19:17:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794481 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D896C746 for ; Sat, 2 Feb 2019 19:17:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAA802E1E0 for ; Sat, 2 Feb 2019 19:17:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BED022E1FF; Sat, 2 Feb 2019 19:17:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57C5C2E1E0 for ; Sat, 2 Feb 2019 19:17:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726818AbfBBTRS (ORCPT ); Sat, 2 Feb 2019 14:17:18 -0500 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:36467 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726784AbfBBTRS (ORCPT ); Sat, 2 Feb 2019 14:17:18 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="25789183" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Feb 2019 12:17:17 -0700 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.106) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:17:17 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PmYVSEFVHMQ8wj0BMWT4fIOD2T6R9K6/L+cy47oS9Ss=; b=r8sNke+9+bxYit2KEhe8sygjx0fxFmSsSPFdqoN6bkcY8C+Vwz8lE3chZDLFRrPWQtR94Okgyp21GZaG0zcCvh7dFUqc786/PJQqNeR+Pr4Jo0bZUWBRZtTS39roqDK5fLCzq0zzSkjgj5nRucCR4KMAo1WgZRjQQTMdFXheMvk= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2998.namprd11.prod.outlook.com (20.177.224.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.21; Sat, 2 Feb 2019 19:17:16 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:17:16 +0000 From: To: CC: , , , , Subject: [PATCH 09/15] staging: wilc1000: remove use of 'terminated_handle' static variable Thread-Topic: [PATCH 09/15] staging: wilc1000: remove use of 'terminated_handle' static variable Thread-Index: AQHUuyvooNbvePrjR0+z4StROIk53Q== Date: Sat, 2 Feb 2019 19:17:16 +0000 Message-ID: <1549134974-5545-10-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2998;6:3ZARpvO0NeKowoZ14+87b4CXdJ+FpVYVBpb/9pxxGFfPR9795T6sL7/qv4+MNGLzKXzXC/QzKaHSYAsbveoAh/GD826PBczcVaBhrma5UQygICQL0o7abD4ibO50U3d2K7x7y53PngZwU5W5tnBuetoj3yyXWXkbFAKiAkpxAER2NPN39aWt+nFwtwpfIJKcbCRUBTG3FitGwA33fZPiEqJ3PD6nw0FhhMNwi0juL/H/lSnRDI/Hnq9nL/86RT8kk8t02FDDvsgSFI3Tm+sEjA0ifyRM8eNoB9Q1ZYzuh9U524Bd5tBmm1kXp7yFtKtKZ3REW3wmh96HmAu+0awvwwjLltoqapUjjZVTelARIxyoOzARPk9Xv1xSa4MBuMU/NPChYRYWBxiSbHma4XROSuJe0ZBCOC20Y9OE4FW3dq6v1kX98l9ieHx+as0QQ3mzXVM6XHS/bsR/Ivln8qYM7g==;5:jfTEZJE8xQlzlEoeo5+yDNf0ma2g0Es3LkPR4g86lVJr4XpI+oHOjKKHVH3FXrLHkvjO1rluWIBHTgSQa6cAXlmvt+eW0oHGjet7CGH8ddj3fT5BkoLfm+690AD3fHNCToHDuHDa88G0+kzi4kRyS/uR8XCag6/MER7YNHOO0naCY3N3UjqaDD6CE2sFc6a03CLluFJFQWvh/WGZpPUKAw==;7:sc/hLLXplWZR1NSCJjMelmpKPGtQiX14vyXqi8e6cUYZLJipWcOE8n8DHP3JT/fMiX0d+YOkIvy45dZ0hzfx7hp9UNGgGvbnSPl2xZmHUvqT+sfKCmVAqfmcNlXwneFGQVQ7DkHIY0xoodqlnsukSA== x-ms-office365-filtering-correlation-id: d857303e-1c58-47d8-39dc-08d689430b0c x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2998; x-ms-traffictypediagnostic: BYAPR11MB2998: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(376002)(366004)(346002)(39850400004)(189003)(199004)(25786009)(107886003)(105586002)(78486014)(36756003)(50226002)(2501003)(6916009)(66066001)(8936002)(3846002)(4326008)(305945005)(7736002)(71200400001)(71190400001)(8676002)(6116002)(54906003)(81166006)(316002)(446003)(81156014)(6436002)(6486002)(2906002)(2616005)(486006)(476003)(76176011)(256004)(99286004)(11346002)(14444005)(52116002)(53936002)(72206003)(478600001)(186003)(386003)(26005)(14454004)(106356001)(86362001)(5640700003)(97736004)(2351001)(68736007)(6506007)(102836004)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2998;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: hE1bvh4Xx2AIDs3zraI0EUONoZMtF5mrranKoi24Z4rb/wg1aFRekD/118VyEJsB5svk7VBuCrCgomQJp+0gi19F8U+E7aKPlFSEqSM0msIHijcknFFPrEJHXS9Acl0FsQkZOebMBDgwPx2vJvT0q2pVTiaRhRI7u0yORL9Xw7UKE9jruwVvjZa0BINycD1g+XsnLKFMWQ6lptwxtG/vrV3iyZbbk8nvE8MZaPjGCJCh4ECaiiz2AA2vnQsBiP0VxqUOkbCiRAnV788XvaoMCstD2DpDW68elYSrL68Ry475XStjq+rsCt9Mv2fQ3zc72gkNu0rgmuZF7yzLMISMY40AuTrs9DnXzknrCqjNE4XszhP9ZnpnadvIa9L1quO7A1pZbdAGKbicMOv8oclQPxC0VXKobBNgzkc2gxzAj+E= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d857303e-1c58-47d8-39dc-08d689430b0c X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:17:13.8402 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2998 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Remove use of 'terminated_handle' variable and set the 'hif_drv' to NULL once it's free. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index fde236a..4598920 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -130,7 +130,6 @@ struct wilc_join_bss_param { }; } __packed; -static struct host_if_drv *terminated_handle; static struct mutex hif_deinit_lock; /* 'msg' should be free by the caller for syc */ @@ -1478,6 +1477,9 @@ int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mode, int result; struct wilc_drv_handler drv; + if (!hif_drv) + return -EFAULT; + wid.id = WID_SET_DRV_HANDLER; wid.type = WID_STR; wid.size = sizeof(drv); @@ -1699,8 +1701,6 @@ int wilc_deinit(struct wilc_vif *vif) mutex_lock(&hif_deinit_lock); - terminated_handle = hif_drv; - del_timer_sync(&hif_drv->scan_timer); del_timer_sync(&hif_drv->connect_timer); del_timer_sync(&vif->periodic_rssi); @@ -1717,9 +1717,8 @@ int wilc_deinit(struct wilc_vif *vif) hif_drv->hif_state = HOST_IF_IDLE; kfree(hif_drv); - + vif->hif_drv = NULL; vif->wilc->clients_count--; - terminated_handle = NULL; mutex_unlock(&hif_deinit_lock); return result; } @@ -1738,7 +1737,7 @@ void wilc_network_info_received(struct wilc *wilc, u8 *buffer, u32 length) return; hif_drv = vif->hif_drv; - if (!hif_drv || hif_drv == terminated_handle) { + if (!hif_drv) { netdev_err(vif->ndev, "driver not init[%p]\n", hif_drv); return; } @@ -1784,7 +1783,7 @@ void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *buffer, u32 length) hif_drv = vif->hif_drv; - if (!hif_drv || hif_drv == terminated_handle) { + if (!hif_drv) { mutex_unlock(&hif_deinit_lock); return; } @@ -1824,7 +1823,7 @@ void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length) return; hif_drv = vif->hif_drv; - if (!hif_drv || hif_drv == terminated_handle) + if (!hif_drv) return; if (hif_drv->usr_scan_req.scan_result) { From patchwork Sat Feb 2 19:17:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794483 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D50DE13A4 for ; Sat, 2 Feb 2019 19:17:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4D792E1E0 for ; Sat, 2 Feb 2019 19:17:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8ABA2E1FF; Sat, 2 Feb 2019 19:17:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1D872E1E0 for ; Sat, 2 Feb 2019 19:17:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726865AbfBBTRY (ORCPT ); Sat, 2 Feb 2019 14:17:24 -0500 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:55583 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726784AbfBBTRX (ORCPT ); Sat, 2 Feb 2019 14:17:23 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="26075172" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Feb 2019 12:17:22 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.38) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:17:22 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QPrR3vjNlB71lzBA+YqHLKH4zHHezOpIDvOTYSb84Rw=; b=DX3d8Kl4J7ZtnlHZx7ozzekE1fCQYu+9A0+93lKZx4jfMQlN2jtEzLOdK2vv3J1YeAlPiLMuJS2h5kcf+w08YwTq8w+KvRGZ1f5BDRMO+dzYHf06UJBF1MWR7oqVPp6UxzHrGesYXnIHkFJnQay9Ti2r8T7VWf8sLHD3uxPLhpE= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB3638.namprd11.prod.outlook.com (20.178.237.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.16; Sat, 2 Feb 2019 19:17:19 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:17:19 +0000 From: To: CC: , , , , Subject: [PATCH 10/15] staging: wilc1000: refactor linux_wlan_init_test_config() Thread-Topic: [PATCH 10/15] staging: wilc1000: refactor linux_wlan_init_test_config() Thread-Index: AQHUuyvq//+vh2NaCkOS22mlThxlWA== Date: Sat, 2 Feb 2019 19:17:19 +0000 Message-ID: <1549134974-5545-11-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB3638;6:ixxJF+BwZB4hVXGIdjo/BLY7JOHvV5bxpKcuyz3bAbkuC6RXhrTVUAjMuDpWMUrh8vTPA8Y738qi5RsjU3Rv2Clelc/bQUEDZp42qxskMSecEVA2YDhpNStXUDxCm/iukzKW7DRR3kXTVzmcMpWJkF0AjdZxMeQM8uq5+BlKWjC4YUWo4JA3BCGUd93ZAFcsQXhGHIqTtXFBDOYBmp+sHA3LX2ClXvXBmNaFrimWROIyXpXKcaouiIX8nV2mFdoAnh71E7S2ZyBK4W+elTjYXAvtR4talB9MN/cqNwx+RGR0WGBctINuGE7GCDmQN4m17wwe6fMmUwJ5/r4zjie+fBW5u0toP8OfDMLoX6IQ8tqopLw9GSjUL1YPz/Sok3nfHhDq9FLnaooyKgY5PPRLEhAggcMP4LwrY6mIfji7Wreez4BxaMuVqS0hCO2WXNRDteytzwcWgeR16is9Tphqcg==;5:Tcsn/+l8Dyx+3ZA8SqYu2a12J3svScDLNGUbvsUc9X3vJwKTUUlSb9yWmChcBfEN0gorga4y4wIXectFkYbHHvOui5cwFnuuWXiovE8Yb2oqoPWns4prttnOns5GplQVBLurFeaCKS4TLaQ62dACHQ/npnM3csEvJ0hHNjC4Giz25dtQxPjhB5JK0S8qSbjrrWgPtZPj+oK8yUxF2gwqyA==;7:pcurInIWTvfWwu5UAhpHFpF0nW4HEMPRaJatAYDyxl7GzTcgLQAAVj3YRoARu0iH3NVrdl6o0g3C8e8OBcFNn71f68NO1DKGAAIVg4cq652DzeOmi5XxcCVs/nrx0Zmbh24IRA1Ylt8C1k3HbpXnRA== x-ms-office365-filtering-correlation-id: 3cfd7be9-6bda-4fdd-2737-08d689430ce1 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB3638; x-ms-traffictypediagnostic: BYAPR11MB3638: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(396003)(376002)(136003)(346002)(366004)(189003)(199004)(26005)(478600001)(7736002)(186003)(105586002)(106356001)(2351001)(476003)(6486002)(446003)(2616005)(486006)(6512007)(66066001)(11346002)(2906002)(14454004)(6436002)(72206003)(71200400001)(71190400001)(386003)(6506007)(5640700003)(2501003)(68736007)(3846002)(97736004)(102836004)(6916009)(36756003)(76176011)(78486014)(25786009)(107886003)(81156014)(81166006)(4326008)(86362001)(52116002)(53936002)(316002)(305945005)(14444005)(99286004)(256004)(8676002)(6116002)(8936002)(50226002)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB3638;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: YX10qdsjb7IUY36tC9K60qEUxQ5ZunFy48e+tKHgSvR3YL4jFt5ljSmsfHRZQ4EZauPOHr/kdJKiDG0tQxtzFoLVi525/1m7RpYM/7gqUDYWj6Oie6z7W+C5cBma/Q6j0bhVVnF6FTNtAXxW1gMXC56X0tXQPe2BTfgduJveCnGTeoHJzcbko6n77UBF+GLT73A2sYdgOjdYDmlNsofpnn+2EbZFF6csYGqa8HVJPjtZ/dkEKYAka4KOAibnw296OcTvZLRot0768l4CjJ8yakem6PjjfY9DPzvnxWS+3FkVFvMD5OoFyro+Qqnqay3iHLEQnU/6gocbdFdnOeocADsXuakpxnx4nOYZ6V98Hh4z4OeH58ZCbJfOoxQZY6FEWY3+T1RWWM+V8rtQByAi/liuihX0k4Iix0p0aqs4n/0= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 3cfd7be9-6bda-4fdd-2737-08d689430ce1 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:17:16.8654 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3638 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Refactor linux_wlan_init_test_config() to use correct endianness for wid values and remove unnecessary code. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/linux_wlan.c | 200 +++++++++++++------------------- drivers/staging/wilc1000/wilc_wlan_if.h | 1 - 2 files changed, 83 insertions(+), 118 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 466a1fa..484fe3d 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -304,204 +304,170 @@ static int wilc1000_firmware_download(struct net_device *dev) return 0; } -static int linux_wlan_init_test_config(struct net_device *dev, - struct wilc_vif *vif) +static int linux_wlan_init_fw_config(struct net_device *dev, + struct wilc_vif *vif) { - unsigned char c_val[64]; - struct wilc *wilc = vif->wilc; struct wilc_priv *priv; struct host_if_drv *hif_drv; + u8 b; + u16 hw; + u32 w; netdev_dbg(dev, "Start configuring Firmware\n"); priv = wiphy_priv(dev->ieee80211_ptr->wiphy); hif_drv = (struct host_if_drv *)priv->hif_drv; netdev_dbg(dev, "Host = %p\n", hif_drv); - wilc_get_chipid(wilc, false); - - *(int *)c_val = 1; - - if (!wilc_wlan_cfg_set(vif, 1, WID_SET_DRV_HANDLER, c_val, 4, 0, 0)) - goto fail; - - c_val[0] = 0; - if (!wilc_wlan_cfg_set(vif, 0, WID_PC_TEST_MODE, c_val, 1, 0, 0)) - goto fail; - - c_val[0] = WILC_FW_BSS_TYPE_INFRA; - if (!wilc_wlan_cfg_set(vif, 0, WID_BSS_TYPE, c_val, 1, 0, 0)) - goto fail; - - c_val[0] = WILC_FW_TX_RATE_AUTO; - if (!wilc_wlan_cfg_set(vif, 0, WID_CURRENT_TX_RATE, c_val, 1, 0, 0)) - goto fail; - - c_val[0] = WILC_FW_OPER_MODE_G_MIXED_11B_2; - if (!wilc_wlan_cfg_set(vif, 0, WID_11G_OPERATING_MODE, c_val, 1, 0, - 0)) - goto fail; - c_val[0] = 1; - if (!wilc_wlan_cfg_set(vif, 0, WID_CURRENT_CHANNEL, c_val, 1, 0, 0)) - goto fail; - - c_val[0] = WILC_FW_PREAMBLE_SHORT; - if (!wilc_wlan_cfg_set(vif, 0, WID_PREAMBLE, c_val, 1, 0, 0)) + w = vif->iftype; + cpu_to_le32s(&w); + if (!wilc_wlan_cfg_set(vif, 1, WID_SET_OPERATION_MODE, (u8 *)&w, 4, + 0, 0)) goto fail; - c_val[0] = WILC_FW_11N_PROT_AUTO; - if (!wilc_wlan_cfg_set(vif, 0, WID_11N_PROT_MECH, c_val, 1, 0, 0)) + b = WILC_FW_BSS_TYPE_INFRA; + if (!wilc_wlan_cfg_set(vif, 0, WID_BSS_TYPE, &b, 1, 0, 0)) goto fail; - c_val[0] = WILC_FW_ACTIVE_SCAN; - if (!wilc_wlan_cfg_set(vif, 0, WID_SCAN_TYPE, c_val, 1, 0, 0)) + b = WILC_FW_TX_RATE_AUTO; + if (!wilc_wlan_cfg_set(vif, 0, WID_CURRENT_TX_RATE, &b, 1, 0, 0)) goto fail; - c_val[0] = WILC_FW_SITE_SURVEY_OFF; - if (!wilc_wlan_cfg_set(vif, 0, WID_SITE_SURVEY, c_val, 1, 0, 0)) + b = WILC_FW_OPER_MODE_G_MIXED_11B_2; + if (!wilc_wlan_cfg_set(vif, 0, WID_11G_OPERATING_MODE, &b, 1, 0, 0)) goto fail; - *((int *)c_val) = 0xffff; - if (!wilc_wlan_cfg_set(vif, 0, WID_RTS_THRESHOLD, c_val, 2, 0, 0)) + b = WILC_FW_PREAMBLE_SHORT; + if (!wilc_wlan_cfg_set(vif, 0, WID_PREAMBLE, &b, 1, 0, 0)) goto fail; - *((int *)c_val) = 2346; - if (!wilc_wlan_cfg_set(vif, 0, WID_FRAG_THRESHOLD, c_val, 2, 0, 0)) + b = WILC_FW_11N_PROT_AUTO; + if (!wilc_wlan_cfg_set(vif, 0, WID_11N_PROT_MECH, &b, 1, 0, 0)) goto fail; - c_val[0] = 0; - if (!wilc_wlan_cfg_set(vif, 0, WID_BCAST_SSID, c_val, 1, 0, 0)) + b = WILC_FW_ACTIVE_SCAN; + if (!wilc_wlan_cfg_set(vif, 0, WID_SCAN_TYPE, &b, 1, 0, 0)) goto fail; - c_val[0] = 1; - if (!wilc_wlan_cfg_set(vif, 0, WID_QOS_ENABLE, c_val, 1, 0, 0)) + b = WILC_FW_SITE_SURVEY_OFF; + if (!wilc_wlan_cfg_set(vif, 0, WID_SITE_SURVEY, &b, 1, 0, 0)) goto fail; - c_val[0] = WILC_FW_NO_POWERSAVE; - if (!wilc_wlan_cfg_set(vif, 0, WID_POWER_MANAGEMENT, c_val, 1, 0, 0)) + hw = 0xffff; + cpu_to_le16s(&hw); + if (!wilc_wlan_cfg_set(vif, 0, WID_RTS_THRESHOLD, (u8 *)&hw, 2, 0, 0)) goto fail; - c_val[0] = WILC_FW_SEC_NO; - if (!wilc_wlan_cfg_set(vif, 0, WID_11I_MODE, c_val, 1, 0, 0)) + hw = 2346; + cpu_to_le16s(&hw); + if (!wilc_wlan_cfg_set(vif, 0, WID_FRAG_THRESHOLD, (u8 *)&hw, 2, 0, 0)) goto fail; - c_val[0] = WILC_FW_AUTH_OPEN_SYSTEM; - if (!wilc_wlan_cfg_set(vif, 0, WID_AUTH_TYPE, c_val, 1, 0, 0)) + b = 0; + if (!wilc_wlan_cfg_set(vif, 0, WID_BCAST_SSID, &b, 1, 0, 0)) goto fail; - strcpy(c_val, "123456790abcdef1234567890"); - if (!wilc_wlan_cfg_set(vif, 0, WID_WEP_KEY_VALUE, c_val, - (strlen(c_val) + 1), 0, 0)) + b = 1; + if (!wilc_wlan_cfg_set(vif, 0, WID_QOS_ENABLE, &b, 1, 0, 0)) goto fail; - strcpy(c_val, "12345678"); - if (!wilc_wlan_cfg_set(vif, 0, WID_11I_PSK, c_val, (strlen(c_val)), 0, - 0)) + b = WILC_FW_NO_POWERSAVE; + if (!wilc_wlan_cfg_set(vif, 0, WID_POWER_MANAGEMENT, &b, 1, 0, 0)) goto fail; - strcpy(c_val, "password"); - if (!wilc_wlan_cfg_set(vif, 0, WID_1X_KEY, c_val, (strlen(c_val) + 1), - 0, 0)) + b = WILC_FW_SEC_NO; + if (!wilc_wlan_cfg_set(vif, 0, WID_11I_MODE, &b, 1, 0, 0)) goto fail; - c_val[0] = 192; - c_val[1] = 168; - c_val[2] = 1; - c_val[3] = 112; - if (!wilc_wlan_cfg_set(vif, 0, WID_1X_SERV_ADDR, c_val, 4, 0, 0)) + b = WILC_FW_AUTH_OPEN_SYSTEM; + if (!wilc_wlan_cfg_set(vif, 0, WID_AUTH_TYPE, &b, 1, 0, 0)) goto fail; - c_val[0] = 3; - if (!wilc_wlan_cfg_set(vif, 0, WID_LISTEN_INTERVAL, c_val, 1, 0, 0)) + b = 3; + if (!wilc_wlan_cfg_set(vif, 0, WID_LISTEN_INTERVAL, &b, 1, 0, 0)) goto fail; - c_val[0] = 3; - if (!wilc_wlan_cfg_set(vif, 0, WID_DTIM_PERIOD, c_val, 1, 0, 0)) + b = 3; + if (!wilc_wlan_cfg_set(vif, 0, WID_DTIM_PERIOD, &b, 1, 0, 0)) goto fail; - c_val[0] = WILC_FW_ACK_POLICY_NORMAL; - if (!wilc_wlan_cfg_set(vif, 0, WID_ACK_POLICY, c_val, 1, 0, 0)) + b = WILC_FW_ACK_POLICY_NORMAL; + if (!wilc_wlan_cfg_set(vif, 0, WID_ACK_POLICY, &b, 1, 0, 0)) goto fail; - c_val[0] = 0; - if (!wilc_wlan_cfg_set(vif, 0, WID_USER_CONTROL_ON_TX_POWER, c_val, 1, + b = 0; + if (!wilc_wlan_cfg_set(vif, 0, WID_USER_CONTROL_ON_TX_POWER, &b, 1, 0, 0)) goto fail; - c_val[0] = 48; - if (!wilc_wlan_cfg_set(vif, 0, WID_TX_POWER_LEVEL_11A, c_val, 1, 0, - 0)) + b = 48; + if (!wilc_wlan_cfg_set(vif, 0, WID_TX_POWER_LEVEL_11A, &b, 1, 0, 0)) goto fail; - c_val[0] = 28; - if (!wilc_wlan_cfg_set(vif, 0, WID_TX_POWER_LEVEL_11B, c_val, 1, 0, - 0)) + b = 28; + if (!wilc_wlan_cfg_set(vif, 0, WID_TX_POWER_LEVEL_11B, &b, 1, 0, 0)) goto fail; - *((int *)c_val) = 100; - if (!wilc_wlan_cfg_set(vif, 0, WID_BEACON_INTERVAL, c_val, 2, 0, 0)) + hw = 100; + cpu_to_le16s(&hw); + if (!wilc_wlan_cfg_set(vif, 0, WID_BEACON_INTERVAL, (u8 *)&hw, 2, 0, 0)) goto fail; - c_val[0] = WILC_FW_REKEY_POLICY_DISABLE; - if (!wilc_wlan_cfg_set(vif, 0, WID_REKEY_POLICY, c_val, 1, 0, 0)) + b = WILC_FW_REKEY_POLICY_DISABLE; + if (!wilc_wlan_cfg_set(vif, 0, WID_REKEY_POLICY, &b, 1, 0, 0)) goto fail; - *((int *)c_val) = 84600; - if (!wilc_wlan_cfg_set(vif, 0, WID_REKEY_PERIOD, c_val, 4, 0, 0)) + w = 84600; + cpu_to_le32s(&w); + if (!wilc_wlan_cfg_set(vif, 0, WID_REKEY_PERIOD, (u8 *)&w, 4, 0, 0)) goto fail; - *((int *)c_val) = 500; - if (!wilc_wlan_cfg_set(vif, 0, WID_REKEY_PACKET_COUNT, c_val, 4, 0, + w = 500; + cpu_to_le32s(&w); + if (!wilc_wlan_cfg_set(vif, 0, WID_REKEY_PACKET_COUNT, (u8 *)&w, 4, 0, 0)) goto fail; - c_val[0] = 1; - if (!wilc_wlan_cfg_set(vif, 0, WID_SHORT_SLOT_ALLOWED, c_val, 1, 0, + b = 1; + if (!wilc_wlan_cfg_set(vif, 0, WID_SHORT_SLOT_ALLOWED, &b, 1, 0, 0)) goto fail; - c_val[0] = WILC_FW_ERP_PROT_SELF_CTS; - if (!wilc_wlan_cfg_set(vif, 0, WID_11N_ERP_PROT_TYPE, c_val, 1, 0, 0)) + b = WILC_FW_ERP_PROT_SELF_CTS; + if (!wilc_wlan_cfg_set(vif, 0, WID_11N_ERP_PROT_TYPE, &b, 1, 0, 0)) goto fail; - c_val[0] = 1; - if (!wilc_wlan_cfg_set(vif, 0, WID_11N_ENABLE, c_val, 1, 0, 0)) + b = 1; + if (!wilc_wlan_cfg_set(vif, 0, WID_11N_ENABLE, &b, 1, 0, 0)) goto fail; - c_val[0] = WILC_FW_11N_OP_MODE_HT_MIXED; - if (!wilc_wlan_cfg_set(vif, 0, WID_11N_OPERATING_MODE, c_val, 1, 0, - 0)) + b = WILC_FW_11N_OP_MODE_HT_MIXED; + if (!wilc_wlan_cfg_set(vif, 0, WID_11N_OPERATING_MODE, &b, 1, 0, 0)) goto fail; - c_val[0] = 1; - if (!wilc_wlan_cfg_set(vif, 0, WID_11N_TXOP_PROT_DISABLE, c_val, 1, 0, - 0)) + b = 1; + if (!wilc_wlan_cfg_set(vif, 0, WID_11N_TXOP_PROT_DISABLE, &b, 1, 0, 0)) goto fail; - c_val[0] = WILC_FW_OBBS_NONHT_DETECT_PROTECT_REPORT; - if (!wilc_wlan_cfg_set(vif, 0, WID_11N_OBSS_NONHT_DETECTION, c_val, 1, + b = WILC_FW_OBBS_NONHT_DETECT_PROTECT_REPORT; + if (!wilc_wlan_cfg_set(vif, 0, WID_11N_OBSS_NONHT_DETECTION, &b, 1, 0, 0)) goto fail; - c_val[0] = WILC_FW_HT_PROT_RTS_CTS_NONHT; - if (!wilc_wlan_cfg_set(vif, 0, WID_11N_HT_PROT_TYPE, c_val, 1, 0, 0)) + b = WILC_FW_HT_PROT_RTS_CTS_NONHT; + if (!wilc_wlan_cfg_set(vif, 0, WID_11N_HT_PROT_TYPE, &b, 1, 0, 0)) goto fail; - c_val[0] = 0; - if (!wilc_wlan_cfg_set(vif, 0, WID_11N_RIFS_PROT_ENABLE, c_val, 1, 0, + b = 0; + if (!wilc_wlan_cfg_set(vif, 0, WID_11N_RIFS_PROT_ENABLE, &b, 1, 0, 0)) goto fail; - c_val[0] = WILC_FW_SMPS_MODE_MIMO; - if (!wilc_wlan_cfg_set(vif, 0, WID_11N_SMPS_MODE, c_val, 1, 0, 0)) - goto fail; - - c_val[0] = 7; - if (!wilc_wlan_cfg_set(vif, 0, WID_11N_CURRENT_TX_MCS, c_val, 1, 0, - 0)) + b = 7; + if (!wilc_wlan_cfg_set(vif, 0, WID_11N_CURRENT_TX_MCS, &b, 1, 0, 0)) goto fail; - c_val[0] = 1; - if (!wilc_wlan_cfg_set(vif, 0, WID_11N_IMMEDIATE_BA_ENABLED, c_val, 1, + b = 1; + if (!wilc_wlan_cfg_set(vif, 0, WID_11N_IMMEDIATE_BA_ENABLED, &b, 1, 1, 1)) goto fail; @@ -671,7 +637,7 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif) firmware_ver[size] = '\0'; netdev_dbg(dev, "Firmware Ver = %s\n", firmware_ver); } - ret = linux_wlan_init_test_config(dev, vif); + ret = linux_wlan_init_fw_config(dev, vif); if (ret < 0) { netdev_err(dev, "Failed to configure firmware\n"); diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 9370caa..26aad49 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -686,7 +686,6 @@ enum { WID_TX_POWER_LEVEL_11N = 0x00B1, /* Custom Character WID list */ - WID_PC_TEST_MODE = 0x00C8, /* SCAN Complete notification WID*/ WID_SCAN_COMPLETE = 0x00C9, From patchwork Sat Feb 2 19:17:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794485 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 257E813A4 for ; Sat, 2 Feb 2019 19:17:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 163922E1E0 for ; Sat, 2 Feb 2019 19:17:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AA4A2E1FF; Sat, 2 Feb 2019 19:17:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1D7B2E1E0 for ; Sat, 2 Feb 2019 19:17:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726871AbfBBTR0 (ORCPT ); Sat, 2 Feb 2019 14:17:26 -0500 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:12679 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726784AbfBBTRZ (ORCPT ); Sat, 2 Feb 2019 14:17:25 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="26232221" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Feb 2019 12:17:24 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.38) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:17:24 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uvEa6FU/4iuiTn/F4Etr82dL8ErNfLgNf57KoNCnaW0=; b=gmzfX5gqiIUOuf28xYu+p1twjJFk5ff0u9qauLicSaTWNkz0A69ak4X15XCrhEQcECHxOuEAIp8xfdyEx7/tO7DSZGfWkxXwIQm3WFsEi/ph4OHJh76dQ1GHZkk6ldsDUbsbjUXF10Gkl3wEEUEY4KbQOSjw5S7FaZktbI6An9g= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB3638.namprd11.prod.outlook.com (20.178.237.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.16; Sat, 2 Feb 2019 19:17:22 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:17:22 +0000 From: To: CC: , , , , Subject: [PATCH 11/15] staging: wilc1000: refactor code to use cookie information Thread-Topic: [PATCH 11/15] staging: wilc1000: refactor code to use cookie information Thread-Index: AQHUuyvsQFthn0ifj0+lXPH43qRwdA== Date: Sat, 2 Feb 2019 19:17:22 +0000 Message-ID: <1549134974-5545-12-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB3638;6:aQiHCRqbnRvg7BACul6DUbXje3GzvU/rG3azI0vylk1m4KNgWOy53FmR5zVaZKK+opp31u6YWGCv4SVsE3WwIa7YtBhlQv34ZaoRqyAquIlRxUZ56YBJTF68Whe3HkKfDW+4IHGSsxjjh3VEa4shB1cOn5jLCnbAqB75zLxQVcBnF5/uPbVzMBL1rMmJT2V8KjQ65gEey58IKi7N1Gi2ppoaS7ZaD5nph1O9Sljt8bNbkBt8dgx2sdp158RIqz2rriWymsupDl7FSizOXa66AZUxONTJP+2lNSJmf9E1jzoNz6P04LRNR1AesEjZZnfZnmNbf/CvufIoZXsCIpMWXKtI4pDi3joUJ1BJtoxTSjGQgHVNyRR0uURnN9erHX0njCV+gURAKRJ7hzwfqfvVyIuAzGIs7MBtJZ8J0WpkKa8qGX+5tX+V4+poI14N/0OwWZ3f9W73SH2XFa84yWJtzA==;5:6ExIt371AumVpO6H6MvNr9LM1xGUZwmI1SMLaUkIlIbpOzHlOev9rqPZE44ASdWbZZGzjYxCiksnivA6IICvU0Q/4/ZFSUxSEKO8AstpsonVW+vKrml+gTFUqyEw55dwf4EKkpSik6zq+jYQ7WcP9qIF1l5HnlPXNg0ZYntaoorypG9NQl7Zok4NuHCb37QngDNyEHdhLGh8FTXn9rSLqg==;7:1swSPao5P/K3Efy1T82MsYr6bBqTjAhWI4DB2QyX0lYOqzEGNKju6UytKS2G5Pt3WKzmsAIJTD6TjlmmeX+A5812rzdWn0edhyd4NVbmmOvdyBtLI4HWMHk+9TNNR+zbwsBxKfI2rCsK8nH1j7OJVA== x-ms-office365-filtering-correlation-id: 7c19b39d-a42c-4bb0-b8c9-08d689430e7f x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB3638; x-ms-traffictypediagnostic: BYAPR11MB3638: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(396003)(376002)(136003)(346002)(366004)(189003)(199004)(26005)(478600001)(7736002)(186003)(105586002)(106356001)(2351001)(476003)(6486002)(446003)(2616005)(486006)(6512007)(66066001)(11346002)(2906002)(14454004)(6436002)(72206003)(71200400001)(71190400001)(386003)(6506007)(5640700003)(2501003)(68736007)(3846002)(97736004)(102836004)(6916009)(36756003)(76176011)(78486014)(25786009)(107886003)(81156014)(81166006)(4326008)(86362001)(52116002)(53936002)(316002)(305945005)(14444005)(99286004)(256004)(8676002)(6116002)(8936002)(50226002)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB3638;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: K/XtvZJCbK7HpgjXthx6lbXRP7Ys3Zn7yeNh5/MisOuIlNaeXp0N9QlcFlrBd1GHt/tYgz9z5iUrAEwsAkomoqmekqPIrKfWwTbiB3rVJp81rplVle1chN9MjmmHqiXSWH3JIeoNWXy4Vu/RVY+ZPPRkNR/tNoMSB9beUS1RrZSymhSQFpBKmdWEnqRrVpaTOweMUqZjIq2vXSzV5eo/i5tl3KHfX0brNHlzMYKvmiLYJbJ7QIeyCoClDMdSVKxT2hxZ2d5DFE8Lfyl5NnaqrFW+gnffAehx0CHxvuV/ojNE4EOiIxOsh4MR5rp+cdbHWIYN2PDCpD1nIxW1otcBWGZp2IlTYyn++8EXlR+iaHzA7WSXfriTKcCxBP+UhIGH1CuyVAy9rvFvSl7lqNGP0D30Rv9WobPQ1fFHPwwOipM= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 7c19b39d-a42c-4bb0-b8c9-08d689430e7f X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:17:19.9135 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3638 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Make use of cookie information to pass to wpa_s and handle cookie value received in the cfg80211_ops callbacks. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.c | 72 +++++++---------------- drivers/staging/wilc1000/host_interface.h | 13 ++-- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 51 ++++++++-------- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +- 4 files changed, 53 insertions(+), 85 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 4598920..c6fcf27 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -920,40 +920,22 @@ static int handle_remain_on_chan(struct wilc_vif *vif, struct wid wid; struct host_if_drv *hif_drv = vif->hif_drv; - if (!hif_drv->remain_on_ch_pending) { - hif_drv->remain_on_ch.arg = hif_remain_ch->arg; - hif_drv->remain_on_ch.expired = hif_remain_ch->expired; - hif_drv->remain_on_ch.ready = hif_remain_ch->ready; - hif_drv->remain_on_ch.ch = hif_remain_ch->ch; - hif_drv->remain_on_ch.id = hif_remain_ch->id; - } else { - hif_remain_ch->ch = hif_drv->remain_on_ch.ch; - } + if (hif_drv->usr_scan_req.scan_result) + return -EBUSY; - if (hif_drv->usr_scan_req.scan_result) { - hif_drv->remain_on_ch_pending = 1; - result = -EBUSY; - goto error; - } - if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) { - result = -EBUSY; - goto error; - } + if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) + return -EBUSY; - if (vif->obtaining_ip || vif->connecting) { - result = -EBUSY; - goto error; - } + if (vif->obtaining_ip || vif->connecting) + return -EBUSY; remain_on_chan_flag = true; wid.id = WID_REMAIN_ON_CHAN; wid.type = WID_STR; wid.size = 2; wid.val = kmalloc(wid.size, GFP_KERNEL); - if (!wid.val) { - result = -ENOMEM; - goto error; - } + if (!wid.val) + return -ENOMEM; wid.val[0] = remain_on_chan_flag; wid.val[1] = (s8)hif_remain_ch->ch; @@ -961,21 +943,16 @@ static int handle_remain_on_chan(struct wilc_vif *vif, result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); kfree(wid.val); - if (result != 0) - netdev_err(vif->ndev, "Failed to set remain on channel\n"); + if (result) + return -EBUSY; -error: + hif_drv->remain_on_ch.arg = hif_remain_ch->arg; + hif_drv->remain_on_ch.expired = hif_remain_ch->expired; + hif_drv->remain_on_ch.ch = hif_remain_ch->ch; + hif_drv->remain_on_ch.cookie = hif_remain_ch->cookie; hif_drv->remain_on_ch_timer_vif = vif; - mod_timer(&hif_drv->remain_on_ch_timer, - jiffies + msecs_to_jiffies(hif_remain_ch->duration)); - - if (hif_drv->remain_on_ch.ready) - hif_drv->remain_on_ch.ready(hif_drv->remain_on_ch.arg); - if (hif_drv->remain_on_ch_pending) - hif_drv->remain_on_ch_pending = 0; - - return result; + return 0; } static void handle_listen_state_expired(struct work_struct *work) @@ -1012,7 +989,7 @@ static void handle_listen_state_expired(struct work_struct *work) if (hif_drv->remain_on_ch.expired) { hif_drv->remain_on_ch.expired(hif_drv->remain_on_ch.arg, - hif_remain_ch->id); + hif_remain_ch->cookie); } } else { netdev_dbg(vif->ndev, "Not in listen state\n"); @@ -1036,7 +1013,7 @@ static void listen_timer_cb(struct timer_list *t) if (IS_ERR(msg)) return; - msg->body.remain_on_ch.id = vif->hif_drv->remain_on_ch.id; + msg->body.remain_on_ch.cookie = vif->hif_drv->remain_on_ch.cookie; result = wilc_enqueue_work(msg); if (result) { @@ -1102,9 +1079,6 @@ static void handle_scan_complete(struct work_struct *work) handle_scan_done(msg->vif, SCAN_EVENT_DONE); - if (msg->vif->hif_drv->remain_on_ch_pending) - handle_remain_on_chan(msg->vif, - &msg->vif->hif_drv->remain_on_ch); kfree(msg); } @@ -1842,10 +1816,9 @@ void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length) } } -int wilc_remain_on_channel(struct wilc_vif *vif, u32 session_id, +int wilc_remain_on_channel(struct wilc_vif *vif, u64 cookie, u32 duration, u16 chan, - void (*expired)(void *, u32), - void (*ready)(void *), + void (*expired)(void *, u64), void *user_arg) { struct remain_ch roc; @@ -1853,10 +1826,9 @@ int wilc_remain_on_channel(struct wilc_vif *vif, u32 session_id, roc.ch = chan; roc.expired = expired; - roc.ready = ready; roc.arg = user_arg; roc.duration = duration; - roc.id = session_id; + roc.cookie = cookie; result = handle_remain_on_chan(vif, &roc); if (result) netdev_err(vif->ndev, "%s: failed to set remain on channel\n", @@ -1865,7 +1837,7 @@ int wilc_remain_on_channel(struct wilc_vif *vif, u32 session_id, return result; } -int wilc_listen_state_expired(struct wilc_vif *vif, u32 session_id) +int wilc_listen_state_expired(struct wilc_vif *vif, u64 cookie) { int result; struct host_if_msg *msg; @@ -1882,7 +1854,7 @@ int wilc_listen_state_expired(struct wilc_vif *vif, u32 session_id) if (IS_ERR(msg)) return PTR_ERR(msg); - msg->body.remain_on_ch.id = session_id; + msg->body.remain_on_ch.cookie = cookie; result = wilc_enqueue_work(msg); if (result) { diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 0feb63f..994e641 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -140,10 +140,9 @@ struct wilc_conn_info { struct remain_ch { u16 ch; u32 duration; - void (*expired)(void *priv, u32 session_id); - void (*ready)(void *priv); + void (*expired)(void *priv, u64 cookie); void *arg; - u32 id; + u32 cookie; }; struct wilc; @@ -151,7 +150,6 @@ struct host_if_drv { struct user_scan_req usr_scan_req; struct wilc_conn_info conn_info; struct remain_ch remain_on_ch; - u8 remain_on_ch_pending; u64 p2p_timeout; enum host_if_state hif_state; @@ -227,12 +225,11 @@ int wilc_edit_station(struct wilc_vif *vif, const u8 *mac, int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout); int wilc_setup_multicast_filter(struct wilc_vif *vif, u32 enabled, u32 count, u8 *mc_list); -int wilc_remain_on_channel(struct wilc_vif *vif, u32 session_id, +int wilc_remain_on_channel(struct wilc_vif *vif, u64 cookie, u32 duration, u16 chan, - void (*expired)(void *, u32), - void (*ready)(void *), + void (*expired)(void *, u64), void *user_arg); -int wilc_listen_state_expired(struct wilc_vif *vif, u32 session_id); +int wilc_listen_state_expired(struct wilc_vif *vif, u64 cookie); void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg); int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mode, u8 ifc_id); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 08b60ddd..f719b74 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1119,27 +1119,12 @@ static void wilc_wfi_mgmt_tx_complete(void *priv, int status) kfree(pv_data); } -static void wilc_wfi_remain_on_channel_ready(void *priv_data) -{ - struct wilc_priv *priv; - - priv = priv_data; - - priv->p2p_listen_state = true; - - cfg80211_ready_on_channel(priv->wdev, - priv->remain_on_ch_params.listen_cookie, - priv->remain_on_ch_params.listen_ch, - priv->remain_on_ch_params.listen_duration, - GFP_KERNEL); -} - -static void wilc_wfi_remain_on_channel_expired(void *data, u32 session_id) +static void wilc_wfi_remain_on_channel_expired(void *data, u64 cookie) { struct wilc_priv *priv = data; struct wilc_wfi_p2p_listen_params *params = &priv->remain_on_ch_params; - if (session_id != params->listen_session_id) + if (cookie != params->listen_cookie) return; priv->p2p_listen_state = false; @@ -1156,24 +1141,36 @@ static int remain_on_channel(struct wiphy *wiphy, int ret = 0; struct wilc_priv *priv = wiphy_priv(wiphy); struct wilc_vif *vif = netdev_priv(priv->dev); + u64 id; if (wdev->iftype == NL80211_IFTYPE_AP) { netdev_dbg(vif->ndev, "Required while in AP mode\n"); return ret; } + id = ++priv->inc_roc_cookie; + if (id == 0) + id = ++priv->inc_roc_cookie; + + ret = wilc_remain_on_channel(vif, id, duration, chan->hw_value, + wilc_wfi_remain_on_channel_expired, + (void *)priv); + if (ret) + return ret; + curr_channel = chan->hw_value; priv->remain_on_ch_params.listen_ch = chan; - priv->remain_on_ch_params.listen_cookie = *cookie; + priv->remain_on_ch_params.listen_cookie = id; + *cookie = id; + priv->p2p_listen_state = true; priv->remain_on_ch_params.listen_duration = duration; - priv->remain_on_ch_params.listen_session_id++; - return wilc_remain_on_channel(vif, - priv->remain_on_ch_params.listen_session_id, - duration, chan->hw_value, - wilc_wfi_remain_on_channel_expired, - wilc_wfi_remain_on_channel_ready, (void *)priv); + cfg80211_ready_on_channel(wdev, *cookie, chan, duration, GFP_KERNEL); + mod_timer(&vif->hif_drv->remain_on_ch_timer, + jiffies + msecs_to_jiffies(duration)); + + return ret; } static int cancel_remain_on_channel(struct wiphy *wiphy, @@ -1183,8 +1180,10 @@ static int cancel_remain_on_channel(struct wiphy *wiphy, struct wilc_priv *priv = wiphy_priv(wiphy); struct wilc_vif *vif = netdev_priv(priv->dev); - return wilc_listen_state_expired(vif, - priv->remain_on_ch_params.listen_session_id); + if (cookie != priv->remain_on_ch_params.listen_cookie) + return -ENOENT; + + return wilc_listen_state_expired(vif, cookie); } static void wilc_wfi_cfg_tx_vendor_spec(struct wilc_priv *priv, diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index cc06ef9..a06b0c0 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -65,7 +65,6 @@ struct wilc_wfi_p2p_listen_params { struct ieee80211_channel *listen_ch; u32 listen_duration; u64 listen_cookie; - u32 listen_session_id; }; struct wilc_p2p_var { @@ -161,6 +160,7 @@ struct wilc_priv { struct ieee80211_rate bitrates[ARRAY_SIZE(wilc_bitrates)]; struct ieee80211_supported_band band; u32 cipher_suites[ARRAY_SIZE(wilc_cipher_suites)]; + u64 inc_roc_cookie; }; struct frame_reg { From patchwork Sat Feb 2 19:17:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794487 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 48BF4746 for ; Sat, 2 Feb 2019 19:17:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A9692E1E0 for ; Sat, 2 Feb 2019 19:17:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F35B2E1FF; Sat, 2 Feb 2019 19:17:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB1DB2E1E0 for ; Sat, 2 Feb 2019 19:17:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726885AbfBBTR2 (ORCPT ); Sat, 2 Feb 2019 14:17:28 -0500 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:13192 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726710AbfBBTR1 (ORCPT ); Sat, 2 Feb 2019 14:17:27 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="24160779" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Feb 2019 12:17:28 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.105) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:17:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z96Q4nbyeiUbKc7ZDmGyrWqQr36PYnqfQ8P2r7fNAm0=; b=Y0l0Gyjx84eNOC96ncYC3lkCeVquQwIAYZp1KIWe+bIDyxyFd+ILaNEGKqBi5A7JuJrD8d57l22zlnKj2P+Cy0TQOiLSu8LOrlzgqnMiZ8J9D82FH3+g9t12zspLlSPOr+aHDYY3VwtcDxpgmb5XgwR+nesjZ+1DJD1JIQO7SUU= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB3638.namprd11.prod.outlook.com (20.178.237.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.16; Sat, 2 Feb 2019 19:17:25 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:17:25 +0000 From: To: CC: , , , , Subject: [PATCH 12/15] staging: wilc1000: use random number for cookie instead of pointer Thread-Topic: [PATCH 12/15] staging: wilc1000: use random number for cookie instead of pointer Thread-Index: AQHUuyvuUyuDXFekH0Km19Razzos3Q== Date: Sat, 2 Feb 2019 19:17:25 +0000 Message-ID: <1549134974-5545-13-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB3638;6:49QCvn8orcRLjOgpyvw5TNmP3mLcDsJb0xdKc1/Cg/n1k/zxb70fc51iXKMAVW9VgHNkcYky5VaAASMdBrdrdXJ69bTKlO/9h9W+6gOWXhvBMko/U114SqoR6tfOhX67/lqE/GJAz8vTU4YpiMZm0IuxpZqX0Tg29hkVrrGG04TEzoYjb1F3wdb/5L5oDPY2smDyFyRq7ISpLFjLWVORQA7Z+GOOiLZwTHwTElKP/e3Suhe69NW9SETAj8u6fL7jMioP4gg78ETUyQ15ngFOudWCAVWibxFFBN44Wj7CH6uGYkEaqiDrbr1K3jMVKFup2tGE/IXwQkVcGRQsMlKC6dY87YA43O5bVVyAdoumJdPWvyExABz6SOJpGcJP6D5ZsX6iMF4wCtyTCCWWFgnkFIXOfMICjumgh642Uj0QYuTrN5+p0hc1GuygWABgYcd+adg/1CPKRqLY7F9VZOn4kA==;5:gS4fpURWqQY0wkmEbFaJEJvqwxi9YE3QQuHBy/Aw+c7y2o3SpyPaXW/ZcQviPvJhofJDM575HtrMQzg4eL1cue6Jz5hwDF9xeGZFegg9+5qHsc8bGJna8upOJp+6wVjt+kx94R3nlZZ8f3lIImynMthDcB1xYfgyDsCnXfsvrdvR1Ur5N7DTP66oPlfiEAYYlObVEVl/wSTJIVDC6Q3YiA==;7:c5PuCiOrS+zx8vfewn0XlUUyD2AM4Hj9YUdBESWllHKNWf+oSmuZadW6ly3NfvnfUINmlunJcrVYElRcJGQtwAobFHSUtFY/bnx0DpsVM/2EPPC1P72l1r7F6X4/xac98CuRuFSfm/7PZ25NJN1rsA== x-ms-office365-filtering-correlation-id: c368110d-0681-4d10-d38a-08d68943105b x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB3638; x-ms-traffictypediagnostic: BYAPR11MB3638: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(396003)(376002)(136003)(346002)(366004)(189003)(199004)(26005)(478600001)(7736002)(186003)(105586002)(106356001)(2351001)(476003)(6486002)(446003)(2616005)(486006)(6512007)(66066001)(11346002)(2906002)(14454004)(6436002)(72206003)(71200400001)(71190400001)(386003)(6506007)(5640700003)(2501003)(68736007)(3846002)(97736004)(102836004)(6916009)(36756003)(76176011)(78486014)(25786009)(107886003)(81156014)(81166006)(4326008)(86362001)(52116002)(53936002)(316002)(305945005)(14444005)(99286004)(256004)(8676002)(6116002)(8936002)(50226002)(54906003)(4744005);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB3638;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: /lUmjShjolqbD6zpwBhN5pVR1douH43MgGAoQ0E+KtDKb20Ufbx6jPpQYSZiTTKY8bWvmzLDq/NtcmkBvcyt+y/RxS+MKRLAo9p5fHdeL5mk9H7+w3KftS/F6qDjobbJPIolvCMonNre7MHbhxbwPnd52uX9dvo/gME0VGTteeGjW7dlhHtbKB4gvHnNR2Ox+VFgpXJGNnTQed3rQMCLm0umOe3dOvhpuoogNPjqQ5sh+W1CE92lxq/jrgZ9/42vU/oTSRU94K3WX9osu9Y4rwP46wPggF5YMlh+OcWwrBdJA1dPENMjTrPvamTfYP4j9UQOWgjh8pgUxEXUKiA2mrWx9/VCvE6M8NGsWPBGFD+5hNdLtvpiaELCz06Ax1VkqzTUDOHpc/obj7Po/42atbP8vCxQLz52z4Hjx7Kngpg= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c368110d-0681-4d10-d38a-08d68943105b X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:17:22.6745 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3638 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Use random number to assign to cookie value. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index f719b74..98121ec 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1252,7 +1252,7 @@ static int mgmt_tx(struct wiphy *wiphy, u32 buf_len = len + sizeof(p2p_vendor_spec) + sizeof(priv->p2p.local_random); int ret = 0; - *cookie = (unsigned long)buf; + *cookie = prandom_u32(); priv->tx_cookie = *cookie; mgmt = (const struct ieee80211_mgmt *)buf; From patchwork Sat Feb 2 19:17:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794493 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E7FA746 for ; Sat, 2 Feb 2019 19:17:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 200762E1E0 for ; Sat, 2 Feb 2019 19:17:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 144F92E1FF; Sat, 2 Feb 2019 19:17:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 821102E1E0 for ; Sat, 2 Feb 2019 19:17:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726946AbfBBTRo (ORCPT ); Sat, 2 Feb 2019 14:17:44 -0500 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:55594 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726865AbfBBTRo (ORCPT ); Sat, 2 Feb 2019 14:17:44 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="26075178" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 02 Feb 2019 12:17:29 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:17:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PMQuUss+lDxND+rNXmxtq5+Te0Fk9NVfzwX969KnkUo=; b=vuUu3+U1MQ8dNvLmdZo2n1FXc1teaZDGc2gV/4EP/5zCe5iMgBfJStRnuBm2AqJxYVP/R/dRsh0VJunYGZ/U4OU4IJb94e7Brtl/un5zS/PBVQAAWRTJCC7f/6IaqCh3hlOm91pC0i1Hz26VRhTwzhOwatEbzDttTuSY9/JpKws= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB3638.namprd11.prod.outlook.com (20.178.237.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.16; Sat, 2 Feb 2019 19:17:28 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:17:28 +0000 From: To: CC: , , , , Subject: [PATCH 13/15] staging: wilc1000: avoid use of interface names for validation Thread-Topic: [PATCH 13/15] staging: wilc1000: avoid use of interface names for validation Thread-Index: AQHUuyvv+Bw2c9knpUK1FH69+IwEsg== Date: Sat, 2 Feb 2019 19:17:27 +0000 Message-ID: <1549134974-5545-14-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB3638;6:Q913C7/6sFwxLKMfLL3WMBoBRMEeEtxo70SHjd4oxARLTjQx4tvYxsFQ2vWY4fKWIqqIGBuDABGe40KWP0ZjWPt7vQGlOgYGoVPFlOJimmG9iPMrcM3M/xbCzLalSHMxPVop/7FaDQIDeVx8EyVOzOiAauCa6ZiNXhEIz6S9OzEwKdEJVVzo6mjrroB/Jumwfg03/9UPq1r+UG5fa16SiE5XkrBPGntfNrmcRP6mqIj8GDnRhv37gOAYtJxA5+HlRdqOrEaIAF/gAGTPvwnhQ0uFv1H5lN1XQ7Dm0C3IdBLjrYUDfunTkL2LTZj3k7O+vHjjbteKAV4XJQikwERbUfLbskR5yLlOnbmVUFhlR2WjhyyRO5XK0RunGrvtyv0l461riRvYtixAyToOC8UGBzJ7Pc63uFBAsLgsohtLTWyVsE30kzefgb5puWtE4RXJq1E4cT7oP46GH+mpKoshTQ==;5:aqcVMT0lb5f2XozCaql05e97ZiQ+30pN1PtDuREkDLfieUWXC5/Zv6WNr6E1UnVoy/01YkgGgujGv5rBN21Oj1DCrooOF0d/IkdSrHkupbW1Phi+EtJJiAkVMoxvTVYvKWNadCdqB8K5MSVjJxsls+qHySCOxwmZL41ujVbmb6MGneutj5FXFmp2nPDTXtSLayAs+LyhxOMAUmKfa79FwQ==;7:nnfw+sCkEwz920yWSaiaWdqdJNwcEm77XwhTKH1xW9DTEOobj9jYtzjwd7usM6Xbf3iPwI1Pzd0i5QZUy9vAC4XIse/AsZL5NTMEKAEdYbB9PuF4EXRc/00bMJoZIIq6Pdmi/1f4fnUS+ZQRcSUizQ== x-ms-office365-filtering-correlation-id: bca2f285-c010-43be-2ace-08d689431204 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB3638; x-ms-traffictypediagnostic: BYAPR11MB3638: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(396003)(376002)(136003)(346002)(366004)(189003)(199004)(26005)(478600001)(7736002)(186003)(105586002)(106356001)(2351001)(476003)(6486002)(446003)(2616005)(486006)(6512007)(66066001)(11346002)(2906002)(14454004)(6436002)(72206003)(71200400001)(71190400001)(386003)(6506007)(5640700003)(2501003)(68736007)(3846002)(97736004)(102836004)(6916009)(36756003)(76176011)(78486014)(25786009)(107886003)(81156014)(81166006)(4326008)(86362001)(52116002)(53936002)(316002)(305945005)(14444005)(99286004)(256004)(8676002)(6116002)(8936002)(50226002)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB3638;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 5udiX2vTAAvXbJBxyRoTgJ3xKjW2Phm8IwQd0PBu4adv0i/LNN4mg9X42KdiDlq4FA7P1L97WjZpRO5k4KBSC2yInyQ3fnogltBvZyEjZqbnWrNgv/yeUYPoqohuxzKrs8VL3RpjepbUfRMYFAyQVFAK3uIgQ95rtWPl0zWtALwzq3BnMoLQDU96jBUX4RzscNabeOLGs4MKCCFI1fWLru8lOJo/RiOgMDKyxjfHndWMnjbU0P+T8L1zy9Mfkq+kOM+FeU5jlQ9TqqcOFZO9sULxAEA9+ZZ2/eJ1x/D2mFUH6cN2rBN4RxtML+UZIzYY8Ghs5k1ZrrkIRBx7cuFKsMFnj50IuoEBIK/c0Zi4RIy78JCysJyvmCB4v+i+PDIEWvAMOJ27h8Ct/EhZnUsPDYejtI5p9SrwBTK2hj2IjJ0= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: bca2f285-c010-43be-2ace-08d689431204 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:17:25.8047 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3638 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Avoid use of interface name i.e 'wlan0' & 'p2p0' to check the interface type in dev_state_ev_handler(). Now making use of netdev_ops and iface type to know interface. Reorder the functions to avoid the forward declaration after the above changes Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/linux_wlan.c | 144 +++++++++++++++++----------------- 1 file changed, 70 insertions(+), 74 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 484fe3d..dcd5861 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -12,71 +12,6 @@ #include "wilc_wfi_cfgoperations.h" -static int dev_state_ev_handler(struct notifier_block *this, - unsigned long event, void *ptr) -{ - struct in_ifaddr *dev_iface = ptr; - struct wilc_priv *priv; - struct host_if_drv *hif_drv; - struct net_device *dev; - struct wilc_vif *vif; - char wlan_dev_name[5] = "wlan0"; - - if (!dev_iface || !dev_iface->ifa_dev || !dev_iface->ifa_dev->dev) - return NOTIFY_DONE; - - if (memcmp(dev_iface->ifa_label, "wlan0", 5) && - memcmp(dev_iface->ifa_label, "p2p0", 4)) - return NOTIFY_DONE; - - dev = (struct net_device *)dev_iface->ifa_dev->dev; - if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy) - return NOTIFY_DONE; - - priv = wiphy_priv(dev->ieee80211_ptr->wiphy); - if (!priv) - return NOTIFY_DONE; - - hif_drv = (struct host_if_drv *)priv->hif_drv; - vif = netdev_priv(dev); - if (!vif || !hif_drv) - return NOTIFY_DONE; - - switch (event) { - case NETDEV_UP: - if (vif->iftype == WILC_STATION_MODE || - vif->iftype == WILC_CLIENT_MODE) { - hif_drv->ifc_up = 1; - vif->obtaining_ip = false; - del_timer(&vif->during_ip_timer); - } - - if (vif->wilc->enable_ps) - wilc_set_power_mgmt(vif, 1, 0); - - break; - - case NETDEV_DOWN: - if (vif->iftype == WILC_STATION_MODE || - vif->iftype == WILC_CLIENT_MODE) { - hif_drv->ifc_up = 0; - vif->obtaining_ip = false; - } - - if (memcmp(dev_iface->ifa_label, wlan_dev_name, 5) == 0) - wilc_set_power_mgmt(vif, 0, 0); - - wilc_resolve_disconnect_aberration(vif); - - break; - - default: - break; - } - - return NOTIFY_DONE; -} - static irqreturn_t isr_uh_routine(int irq, void *user_data) { struct net_device *dev = user_data; @@ -921,6 +856,76 @@ void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size) wilc_wfi_p2p_rx(wilc->vif[1]->ndev, buff, size); } +static const struct net_device_ops wilc_netdev_ops = { + .ndo_init = mac_init_fn, + .ndo_open = wilc_mac_open, + .ndo_stop = wilc_mac_close, + .ndo_start_xmit = wilc_mac_xmit, + .ndo_get_stats = mac_stats, + .ndo_set_rx_mode = wilc_set_multicast_list, +}; + +static int dev_state_ev_handler(struct notifier_block *this, + unsigned long event, void *ptr) +{ + struct in_ifaddr *dev_iface = ptr; + struct wilc_priv *priv; + struct host_if_drv *hif_drv; + struct net_device *dev; + struct wilc_vif *vif; + + if (!dev_iface || !dev_iface->ifa_dev || !dev_iface->ifa_dev->dev) + return NOTIFY_DONE; + + dev = (struct net_device *)dev_iface->ifa_dev->dev; + if (dev->netdev_ops != &wilc_netdev_ops) + return NOTIFY_DONE; + + if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy) + return NOTIFY_DONE; + + priv = wiphy_priv(dev->ieee80211_ptr->wiphy); + if (!priv) + return NOTIFY_DONE; + + hif_drv = (struct host_if_drv *)priv->hif_drv; + vif = netdev_priv(dev); + if (!vif || !hif_drv) + return NOTIFY_DONE; + + switch (event) { + case NETDEV_UP: + if (vif->iftype == WILC_STATION_MODE || + vif->iftype == WILC_CLIENT_MODE) { + hif_drv->ifc_up = 1; + vif->obtaining_ip = false; + del_timer(&vif->during_ip_timer); + } + + if (vif->wilc->enable_ps) + wilc_set_power_mgmt(vif, 1, 0); + + break; + + case NETDEV_DOWN: + if (vif->iftype == WILC_STATION_MODE || + vif->iftype == WILC_CLIENT_MODE) { + hif_drv->ifc_up = 0; + vif->obtaining_ip = false; + wilc_set_power_mgmt(vif, 0, 0); + } + + wilc_resolve_disconnect_aberration(vif); + + break; + + default: + break; + } + + return NOTIFY_DONE; +} + static struct notifier_block g_dev_notifier = { .notifier_call = dev_state_ev_handler }; @@ -957,15 +962,6 @@ void wilc_netdev_cleanup(struct wilc *wilc) } EXPORT_SYMBOL_GPL(wilc_netdev_cleanup); -static const struct net_device_ops wilc_netdev_ops = { - .ndo_init = mac_init_fn, - .ndo_open = wilc_mac_open, - .ndo_stop = wilc_mac_close, - .ndo_start_xmit = wilc_mac_xmit, - .ndo_get_stats = mac_stats, - .ndo_set_rx_mode = wilc_set_multicast_list, -}; - int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, const struct wilc_hif_func *ops) { From patchwork Sat Feb 2 19:17:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794489 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51A6B13A4 for ; Sat, 2 Feb 2019 19:17:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42A792E1E0 for ; Sat, 2 Feb 2019 19:17:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36CAB2E1FF; Sat, 2 Feb 2019 19:17:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF1A42E1E0 for ; Sat, 2 Feb 2019 19:17:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726897AbfBBTRd (ORCPT ); Sat, 2 Feb 2019 14:17:33 -0500 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:12688 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726640AbfBBTRc (ORCPT ); Sat, 2 Feb 2019 14:17:32 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="26232224" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 02 Feb 2019 12:17:32 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:17:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0rD8q1TvEEJzeu3bKWT4Ee8PA2kJlveTAu2c5KRG+1U=; b=DJttGnmuyQD92+kuFiyB22unH1z7alUvGfG7wmy65R1UwqxqZRgzrDSWDFXGLu9IbrX2hXbUswEmoj88JsyCMgESuU0l/zLHUsw+HgOV93tbSAIwt1Cr9ijQ4s8cu5my0rMU92RnHV+5hwNzs2wQuZGeq2pPzNlyvopJ4ZvD4+4= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB3638.namprd11.prod.outlook.com (20.178.237.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.16; Sat, 2 Feb 2019 19:17:30 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:17:30 +0000 From: To: CC: , , , , Subject: [PATCH 14/15] staging: wilc1000: add check before performing operation on net_device Thread-Topic: [PATCH 14/15] staging: wilc1000: add check before performing operation on net_device Thread-Index: AQHUuyvxuHI7bB4sBkqwbIAVUUsm1w== Date: Sat, 2 Feb 2019 19:17:30 +0000 Message-ID: <1549134974-5545-15-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB3638;6:8nGV0KRSdHeu6RJ0DXE9GARoh79TvoWWhD000QaRU3dG+KaMpd0fQQnpW67RQs0OtEFpPVoe83Z0QriSTiLWl9NLJbG7FIt812K2LWhrNAP+OS2DbA2ijdzdjn38cfuB58PvokXCdm6PTMgGmEDdhrcLi/3wFKhzq/c1xOtv2dCuxH6UhrqVb5aHYqsCevMt5+/TkdusZlKHCLZO0iOxSfRLQHT7RlircxTIXS4/jepN/2+wTQ5yXYbfarcQPF8C63Cq82u4Y14umjLaFwxZBpgQ+8UKM7DY8dE2BBr9hsO8qnGijvv1QZCHOn4g6L4flXzhKf7Bk3o0SOb+0Qo+fbWo0gyXHVhYs7lCgEm58TZ3rh0ukPrQbGIpLGCNqAo2yNFq8i3nh9yukCdpqQ0U2nMgt21wXhvcRp6l1b4shukHpAsewf8expksApTu4oGfl+1XBH5h2ylXLMk7AYcHiw==;5:wAgSLcw5xnKJUvIM5tEtqtL8Es+p0bY0NFr3tkrhDbaLWgpXJfxmsXM6EtVTMKfo30BemNhJiD8kotsGdhpZKcpTXDWqbTBp+y7DVvr/2J+saXA5M23FWgYJstaEVrxtnZVeQ+xF6Qvw+t4NNtDwi8ahFDlrcCFds+e5U86oWX2pYlQZoFEvt8BI+ToPG8zolTmy1pX+vZfNfGneExrGpw==;7:yFC4CwBQDzeRZw8l57CPV8SpYEpI00AkIcjXugAde23J5CIhkeiTNUBm+tCPtDDj6znE0rayaL4L3y1+OR+VokmWy3DQ1EyELoIqFWP+raGPNRhQ6YXKToaEjMv8+LGRvRiC9e3eZcck95YK+ndNfQ== x-ms-office365-filtering-correlation-id: 33f7d85c-39c5-4ac5-f43d-08d68943138f x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB3638; x-ms-traffictypediagnostic: BYAPR11MB3638: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(396003)(376002)(136003)(346002)(366004)(189003)(199004)(26005)(478600001)(7736002)(186003)(105586002)(106356001)(2351001)(476003)(6486002)(446003)(2616005)(486006)(6512007)(66066001)(11346002)(2906002)(14454004)(6436002)(72206003)(71200400001)(71190400001)(386003)(6506007)(5640700003)(2501003)(68736007)(3846002)(97736004)(102836004)(6916009)(36756003)(76176011)(78486014)(25786009)(107886003)(81156014)(81166006)(4326008)(86362001)(52116002)(53936002)(316002)(305945005)(14444005)(99286004)(256004)(8676002)(6116002)(8936002)(50226002)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB3638;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: myrY/s/pi6CNe5xEGd8FWF3q79adT/yJ9rE7Sy5VR9498QuQ9un4dYkzVHcbk49gu+CDQ8J4sELsH2ETL8BOaHUkIFL853fdcbTT5j5FEDfY2gK6RIop1jvbNYnaUFaMBnzv5IdHS/HNGw7UQgzqCFnw2JVLQf3j5MKTpHDuA6jPh0q4tRi2HkKQikYHhKljUmV4dVoFMUCPmy8/9gINW4wFUPOpW0lwFw5evJc2sNBUvKQXZb5tkhVwvt/mDHfovbNWd3jb3owu+Cw/M/Pp3LO+FAwh3X4RVFP7IkJTKhmujxGQ/fsm+w5GCBXBYIV4UqnRyhWwNCPTnJycqXFYwXPILxDwB7aBX9Ey/dEchvbsFhpJjkXEOfprWRICe5uTN4OWDzUkb8vi/sESD+zZ9CjkTx/6M1aDDo1SqMX9bks= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 33f7d85c-39c5-4ac5-f43d-08d68943138f X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:17:28.2774 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3638 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Before calling an operation on net_device check if that interface is available. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/linux_wlan.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index dcd5861..bafb454 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -159,9 +159,11 @@ static int linux_wlan_txq_task(void *vp) do { ret = wilc_wlan_handle_txq(dev, &txq_count); if (txq_count < FLOW_CONTROL_LOWER_THRESHOLD) { - if (netif_queue_stopped(wl->vif[0]->ndev)) + if (wl->vif[0]->mac_opened && + netif_queue_stopped(wl->vif[0]->ndev)) netif_wake_queue(wl->vif[0]->ndev); - if (netif_queue_stopped(wl->vif[1]->ndev)) + if (wl->vif[1]->mac_opened && + netif_queue_stopped(wl->vif[1]->ndev)) netif_wake_queue(wl->vif[1]->ndev); } } while (ret == -ENOBUFS && !wl->close); @@ -761,8 +763,10 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev) linux_wlan_tx_complete); if (queue_count > FLOW_CONTROL_UPPER_THRESHOLD) { - netif_stop_queue(wilc->vif[0]->ndev); - netif_stop_queue(wilc->vif[1]->ndev); + if (wilc->vif[0]->mac_opened) + netif_stop_queue(wilc->vif[0]->ndev); + if (wilc->vif[1]->mac_opened) + netif_stop_queue(wilc->vif[1]->ndev); } return 0; From patchwork Sat Feb 2 19:17:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10794491 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A198513A4 for ; Sat, 2 Feb 2019 19:17:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94E982E1E0 for ; Sat, 2 Feb 2019 19:17:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 898D52E1FF; Sat, 2 Feb 2019 19:17:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CC792E1E0 for ; Sat, 2 Feb 2019 19:17:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726945AbfBBTRg (ORCPT ); Sat, 2 Feb 2019 14:17:36 -0500 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:24944 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726640AbfBBTRg (ORCPT ); Sat, 2 Feb 2019 14:17:36 -0500 X-IronPort-AV: E=Sophos;i="5.56,553,1539673200"; d="scan'208";a="27205824" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Feb 2019 12:17:35 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.105) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sat, 2 Feb 2019 12:17:34 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gdvtgetk+wRTZgdewoJhpaIeSsbqUcri9L7kv32NukA=; b=yGKnicNXMI/+AFef0ItFug+Rl4MDyNu1jIoeSn1o5znVqtkguLyL2lkLUfgnHQDyzRVqsyQOAXbBGA95yVu0s7IzPryYCTCdB5dNNqQz9SXFeA8bIP9MITIaAODmOKBztCmuu0xl6U7wxp9fx2J6NqNlQ3j5sw+bQklxhWMBIrM= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB3638.namprd11.prod.outlook.com (20.178.237.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.16; Sat, 2 Feb 2019 19:17:33 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::cc6d:bc31:d5b:a27d%5]) with mapi id 15.20.1580.019; Sat, 2 Feb 2019 19:17:33 +0000 From: To: CC: , , , , Subject: [PATCH 15/15] staging: wilc1000: remove unused struct 'add_sta_param' Thread-Topic: [PATCH 15/15] staging: wilc1000: remove unused struct 'add_sta_param' Thread-Index: AQHUuyvy+Uw+43cUVEqr7DQg5P0vvQ== Date: Sat, 2 Feb 2019 19:17:33 +0000 Message-ID: <1549134974-5545-16-git-send-email-ajay.kathat@microchip.com> References: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1549134974-5545-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0011.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::21) To BYAPR11MB2567.namprd11.prod.outlook.com (2603:10b6:a02:c5::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ajay.Kathat@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [49.205.218.11] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB3638;6:VYYcgcVdzy55f8uwcOHElhBDOmr4etLaReC0D72NBOKyxT4g1ZHtJkQ9rNtkYuCLsaJzqKQuSaiAN2p8ETgJfgom8qDTg81e5l9KPDxH2KA2rWRNhMO7jlJBIp1kOIsZEfq9RDbtxnM6lzjsoNLh9Q9aPky0Ebhzb8ihibRU9qaJNGhhImFoTYtkk7ZBQDcZqaVJoe5Q5x95o3X2SjpOiYzXx8V6g9obnCG2bqgH5anQP2W+lZLuiK3c4/7Nm+lk04devof0s8QpqInT3g0kmKclA/NPdAyk6i1EDyGsJGA/0lk8cajoyiHAljPrUgeHYBENiF+x5boC6XxtjCD/xebN/2tF5Moebjw6pAnqojcjJLH84xVzKuqi1B+07RDmCvuPeuRVqmXFtSKIUeic5Mxu0Yjymsk8h8vO4mGU5VsLw69UtcpNsFYAstVw5I4bgMYv8n+wa3DtGj4OJ0DsTA==;5:EAmeRSFvEphaeuRLsVm7xN5oRvOKTz7maYt6lwvGwyQs5fjhzOdFiGCtjkH6Jz2zMzgNRTialZCL3etBY0F+hojC8MDDO+m6MPGhmhDm2Ycis6BZUXgAnINfq7v9XxZM4I9ONipSpNjB96TTQ9gsoTpKamhfoyi17dYyglg2yHEsfvRsZsC1hXRwT8tJo5zp5YRiqBr0ZwyHrOKesiu4Zw==;7:D2yxIxTTSuqMw3qXsjHajy/M9vsJyVeMYqg48UsiItqKg/B/nFF7wAdhfFW2OPd6cESSa5cRxbm+Sq5VtqmWQxF6j/yHyZGL3ZpCKhzFW9FYDPFgCXxjCr9+Ol0U7eRZqG+EMkxGusTuh28+et8KLg== x-ms-office365-filtering-correlation-id: 41b73abc-cba3-4828-0a56-08d689431527 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB3638; x-ms-traffictypediagnostic: BYAPR11MB3638: x-microsoft-antispam-prvs: x-forefront-prvs: 09368DB063 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(396003)(376002)(136003)(346002)(366004)(189003)(199004)(26005)(478600001)(7736002)(186003)(105586002)(106356001)(2351001)(476003)(6486002)(446003)(2616005)(486006)(6512007)(66066001)(11346002)(2906002)(14454004)(6436002)(72206003)(71200400001)(71190400001)(386003)(6506007)(5640700003)(2501003)(68736007)(3846002)(97736004)(102836004)(6916009)(36756003)(76176011)(78486014)(25786009)(107886003)(81156014)(81166006)(4326008)(86362001)(52116002)(53936002)(316002)(305945005)(99286004)(256004)(8676002)(6116002)(8936002)(50226002)(54906003)(4744005);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB3638;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 4Gv9TzVn6HK+IH+Ezv4I91PTkTJo3cBccemYUDO/MxIAc68eKFsrOSVznA0Cbj7xe8hWLieFxZ/BDWtR4OqzzP2MtYfQM/buBpg/umw06krCi2x07yC54B3VPuHAW3wOFZhC8ao17/YNKWbD1Mt5CUmn3gF7wjrEwE7FH+cNpGqhO/cQaWW7M4OXWiEs2XphiZEPcQFASsv6XIw6Ux3Hm0J9r2i+672+xSjX+5bftxBqr7vUV4N7WcGRH8XEGiIDZQFKk2iXugf+PkAZye4Kwb+P0eSoyjdM7vAT4UuJbXk/OiiGcybDFAXsWltP+k8XrHEYjBx0NlzZSUsr2QSm5Mtjmv/q7+pIvKDPYeQ9DFyDzsW0IllSxTJ0Zrc+gErBnXCDo4YVYcdmmq5lccDuaCA1lPLYf/xQRLmhRqg0zT8= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 41b73abc-cba3-4828-0a56-08d689431527 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2019 19:17:30.8993 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3638 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Remove 'add_sta_param' structure as its not used now. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 994e641..790f83e 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -170,17 +170,6 @@ struct host_if_drv { u8 assoc_resp[WILC_MAX_ASSOC_RESP_FRAME_SIZE]; }; -struct add_sta_param { - u8 bssid[ETH_ALEN]; - u16 aid; - u8 rates_len; - const u8 *rates; - bool ht_supported; - struct ieee80211_ht_cap ht_capa; - u16 flags_mask; - u16 flags_set; -}; - struct wilc_vif; int wilc_remove_wep_key(struct wilc_vif *vif, u8 index); int wilc_set_wep_default_keyid(struct wilc_vif *vif, u8 index);