From patchwork Fri Jan 17 10:31:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 11338715 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4EC11109A for ; Fri, 17 Jan 2020 10:31:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D1102082F for ; Fri, 17 Jan 2020 10:31:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="QukTkvi2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726897AbgAQKbb (ORCPT ); Fri, 17 Jan 2020 05:31:31 -0500 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:55340 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726371AbgAQKb3 (ORCPT ); Fri, 17 Jan 2020 05:31:29 -0500 Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Ajay.Kathat@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="Ajay.Kathat@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; spf=Pass smtp.mailfrom=Ajay.Kathat@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: 2/Vzii/G1umOr/a6aXkJDvAMqj5gyyeOqaSn3jGOBIF8OqWCqh7mqs4A4384lNaibYJf/2R9Do ngvyqjiU8jfOzPuRlqor/+sbEb+ygqWZh2tqHfT2+Zx82dBtSKbUv27iRt/YvDSmZYjFOLXrGR 0FUtsBiZnxfpcc4CltkrUCa15JywA+FlamRpwJIk1+OwF8CE6aP/rrb8kfAj4F5kIjVZUBjkOX 8bjlw6mKJvC2IrKrzufa2UUmZ3JsDUpPbjqX/qyhhPxr9U+PQzcg+iwwJYo59kiYUp8FK+aPMI FXg= X-IronPort-AV: E=Sophos;i="5.70,329,1574146800"; d="scan'208";a="61369408" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 17 Jan 2020 03:31:28 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 17 Jan 2020 03:31:27 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 17 Jan 2020 03:31:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fQwNoAO/BEdYTABFwjFyhwNEcYPbwBJBuP0KkXukio5HtwEGd4cgZdPPjePLojCT7Hb5PZ9m9EO1l7JwvnqpPOVaPnaLDdY7lIMWJOBFz9qwrNedfccSH4U8+TXOERAI3OwrPrTNnBaQvNaaCIfVJy0U5v058RZXVJCzaVMJwlbVhU1gSeZPQt44Xhb6Ez4MCXgheN0k7tBboak3/pAV8CqZVHcuUo5YFMyNptg3qUWNFz8savyDpBiMhlyhNVy9CFRuTBnIsuHQH3z2VwSE65k/0SC+maMH1LPWWmH5SI9U5c2RdB3Jd9Ib0q+WS0pAG+m2YFCkd7GQykwdrZp28A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o5agV0/Us/zJnCJJdOS17jZO9qXX663ySI3hI96UWUQ=; b=le4K+T/FKo3coQNNrWXM97wpvHAgWQGK35zQXbc6dZXErNOhjpCdggy83TBsmSFRr99/WCCwGtBf5r4Izq0XVhDSPPXlpluLOa46HHMafSHmdrZzrQs52zIY2+AAFXbi9zfzuADf0X2CMED48Zfes1SeEhtphqTPqBKwNE8i+0/8Z1r7XFtC3rAl8057ouKEaH4An29ZJFrgHmVQRkKPxMrokbaJKOQLoUoZ5+ynpgmAdJHUzMxFICxDhocT/LEddWst28oOEsnaH5+M3o5oAkfmrHBTE+Iq8UP9MloEZhOc/TsJwYYaweaTNQOF/05ZND4+qkdYmcNlU8C62XpydQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o5agV0/Us/zJnCJJdOS17jZO9qXX663ySI3hI96UWUQ=; b=QukTkvi2kwjbQVRxMpEjhZ3TLfTatoYa76FuJHiqWBEH7jkRSsk73VQ6M6NbZX1OlXMk5Sl/5lkrWXEB9m5kqN1pVWilwNB1CjisTTF6fXGPLdc0XSeVV7mc8tBCpZmj2XIp1X4Ck2aYxUqqPa/oUEz7g5xE3X5qvqMTDepWGCg= Received: from DM6PR11MB3996.namprd11.prod.outlook.com (20.176.125.206) by DM6PR11MB2907.namprd11.prod.outlook.com (20.177.217.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Fri, 17 Jan 2020 10:31:23 +0000 Received: from DM6PR11MB3996.namprd11.prod.outlook.com ([fe80::75b4:bb0c:c245:4392]) by DM6PR11MB3996.namprd11.prod.outlook.com ([fe80::75b4:bb0c:c245:4392%5]) with mapi id 15.20.2623.018; Fri, 17 Jan 2020 10:31:23 +0000 From: To: CC: , , , , Subject: [PATCH 1/4] staging: wilc1000: remove use of infinite loop conditions Thread-Topic: [PATCH 1/4] staging: wilc1000: remove use of infinite loop conditions Thread-Index: AQHVzSFEOFYj1tIKa0a59ayIYa8L2A== Date: Fri, 17 Jan 2020 10:31:23 +0000 Message-ID: <20200117160157.8706-2-ajay.kathat@microchip.com> References: <20200117160157.8706-1-ajay.kathat@microchip.com> In-Reply-To: <20200117160157.8706-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-originating-ip: [121.244.27.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: db6f6df3-04fa-4aff-8dc7-08d79b386698 x-ms-traffictypediagnostic: DM6PR11MB2907: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:59; x-forefront-prvs: 0285201563 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(39860400002)(396003)(376002)(346002)(189003)(199004)(8936002)(6916009)(5660300002)(6486002)(81166006)(966005)(478600001)(26005)(76116006)(91956017)(8676002)(81156014)(66946007)(66476007)(66446008)(64756008)(66556008)(36756003)(4326008)(2906002)(86362001)(316002)(6506007)(2616005)(107886003)(71200400001)(1076003)(6512007)(186003)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR11MB2907;H:DM6PR11MB3996.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: BCL:0; x-microsoft-antispam-message-info: cycVtdoVr+awDsddfqwFIrKlVyAGvyQtJZ0c8QEB9msmtgUEauJbI7Kk8wtzCxv+SlX1LLL1txUqYYXAbC1hexbzjnLmoKQpaxGwSrObdiDypzlFP+jXlAMD0bqlMHm4vwWF47arAg+tYQ5lCxjdxLf5HP9zn1OhTbh5sFvPm8BcJlQ4TfpFMDZJJT7G3lmS+EqFy64RyEDUEzKqilt/ErTcmugSRqClMetxldwfy2Ot08drXL5eX2H4xOBY4krSHoNw9+lhEUp+eA+z8YwqJw4VTEGqX1Kehxsi9uZfgZsGouy/a23Lru3opCS6qTT2hfg1fOVZ6/ERfnfJmOFVgMc7ovn1G0J6fTuQt1WTMf7QWj0TnlAjcXxbMixRasVicIyMjzPoa19hbBkmaK8Floeo2CBmmjvVzYchPyfTygCF0+ikJ4ke5WF0mHFe9gCX3/JpcMGfjgjlLJkGwIbJDQ5BFiWjRNnRzsAQN5R+FqidYLzX+DQgDyhewQt70LVo2jlzySdKROp1ZGiVB6RzMQ== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: db6f6df3-04fa-4aff-8dc7-08d79b386698 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2020 10:31:23.6543 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Tq/jvtpqeMvf0eAr4ieJGEm7tXZiKk4I+tO71KqGulurNxbeHQ/+DE4agpCl9aDBB456FcgOFZjzrhd0bPbU+ktvYabOlIPw7oDkzWzKbnU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2907 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Avoid the use of 'while (1)' infinite loop conditions. It's not recommended to have infinite loop in kernel code because a small bug can cause never ending loops so use terminator condition as suggested in full driver review [1]. [1]. https://lore.kernel.org/linux-wireless/20191023100313.52B3F606CF@smtp.codeaurora.org/ Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/netdev.c | 7 +- drivers/staging/wilc1000/wlan.c | 79 ++++++--------- drivers/staging/wilc1000/wlan_cfg.c | 144 ++++++++++------------------ 3 files changed, 84 insertions(+), 146 deletions(-) diff --git a/drivers/staging/wilc1000/netdev.c b/drivers/staging/wilc1000/netdev.c index 3fd8e008f733..960dbc8d5173 100644 --- a/drivers/staging/wilc1000/netdev.c +++ b/drivers/staging/wilc1000/netdev.c @@ -837,7 +837,7 @@ static const struct net_device_ops wilc_netdev_ops = { void wilc_netdev_cleanup(struct wilc *wilc) { struct wilc_vif *vif; - int srcu_idx; + int srcu_idx, ifc_cnt = 0; if (!wilc) return; @@ -858,7 +858,7 @@ void wilc_netdev_cleanup(struct wilc *wilc) flush_workqueue(wilc->hif_workqueue); destroy_workqueue(wilc->hif_workqueue); - do { + while (ifc_cnt < WILC_NUM_CONCURRENT_IFC) { mutex_lock(&wilc->vif_mutex); if (wilc->vif_num <= 0) { mutex_unlock(&wilc->vif_mutex); @@ -871,7 +871,8 @@ void wilc_netdev_cleanup(struct wilc *wilc) wilc->vif_num--; mutex_unlock(&wilc->vif_mutex); synchronize_srcu(&wilc->srcu); - } while (1); + ifc_cnt++; + } wilc_wlan_cfg_deinit(wilc); wlan_deinit_locks(wilc); diff --git a/drivers/staging/wilc1000/wlan.c b/drivers/staging/wilc1000/wlan.c index ba5446724c93..c32af7076012 100644 --- a/drivers/staging/wilc1000/wlan.c +++ b/drivers/staging/wilc1000/wlan.c @@ -499,37 +499,31 @@ int wilc_wlan_handle_txq(struct wilc *wilc, u32 *txq_count) wilc_wlan_txq_filter_dup_tcp_ack(dev); i = 0; sum = 0; - do { - if (tqe && (i < (WILC_VMM_TBL_SIZE - 1))) { - if (tqe->type == WILC_CFG_PKT) - vmm_sz = ETH_CONFIG_PKT_HDR_OFFSET; - - else if (tqe->type == WILC_NET_PKT) - vmm_sz = ETH_ETHERNET_HDR_OFFSET; - - else - vmm_sz = HOST_HDR_OFFSET; + while (tqe && (i < (WILC_VMM_TBL_SIZE - 1))) { + if (tqe->type == WILC_CFG_PKT) + vmm_sz = ETH_CONFIG_PKT_HDR_OFFSET; + else if (tqe->type == WILC_NET_PKT) + vmm_sz = ETH_ETHERNET_HDR_OFFSET; + else + vmm_sz = HOST_HDR_OFFSET; - vmm_sz += tqe->buffer_size; + vmm_sz += tqe->buffer_size; - if (vmm_sz & 0x3) - vmm_sz = (vmm_sz + 4) & ~0x3; + if (vmm_sz & 0x3) + vmm_sz = (vmm_sz + 4) & ~0x3; - if ((sum + vmm_sz) > WILC_TX_BUFF_SIZE) - break; + if ((sum + vmm_sz) > WILC_TX_BUFF_SIZE) + break; - vmm_table[i] = vmm_sz / 4; - if (tqe->type == WILC_CFG_PKT) - vmm_table[i] |= BIT(10); - cpu_to_le32s(&vmm_table[i]); + vmm_table[i] = vmm_sz / 4; + if (tqe->type == WILC_CFG_PKT) + vmm_table[i] |= BIT(10); + cpu_to_le32s(&vmm_table[i]); - i++; - sum += vmm_sz; - tqe = wilc_wlan_txq_get_next(wilc, tqe); - } else { - break; - } - } while (1); + i++; + sum += vmm_sz; + tqe = wilc_wlan_txq_get_next(wilc, tqe); + } if (i == 0) goto out; @@ -594,12 +588,8 @@ int wilc_wlan_handle_txq(struct wilc *wilc, u32 *txq_count) break; reg &= ~BIT(0); ret = func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, reg); - if (!ret) - break; - break; } - break; - } while (1); + } while (0); if (!ret) goto out_release_bus; @@ -725,9 +715,7 @@ static void wilc_wlan_handle_rx_buff(struct wilc *wilc, u8 *buffer, int size) } } offset += tp_len; - if (offset >= size) - break; - } while (1); + } while (offset < size); } static void wilc_wlan_handle_rxq(struct wilc *wilc) @@ -736,11 +724,7 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) u8 *buffer; struct rxq_entry_t *rqe; - do { - if (wilc->quit) { - complete(&wilc->cfg_event); - break; - } + while (!wilc->quit) { rqe = wilc_wlan_rxq_remove(wilc); if (!rqe) break; @@ -750,7 +734,9 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) wilc_wlan_handle_rx_buff(wilc, buffer, size); kfree(rqe); - } while (1); + } + if (wilc->quit) + complete(&wilc->cfg_event); } static void wilc_unknown_isr_ext(struct wilc *wilc) @@ -969,21 +955,14 @@ void wilc_wlan_cleanup(struct net_device *dev) struct wilc *wilc = vif->wilc; wilc->quit = 1; - do { - tqe = wilc_wlan_txq_remove_from_head(dev); - if (!tqe) - break; + while ((tqe = wilc_wlan_txq_remove_from_head(dev))) { if (tqe->tx_complete_func) tqe->tx_complete_func(tqe->priv, 0); kfree(tqe); - } while (1); + } - do { - rqe = wilc_wlan_rxq_remove(wilc); - if (!rqe) - break; + while ((rqe = wilc_wlan_rxq_remove(wilc))) kfree(rqe); - } while (1); kfree(wilc->rx_buffer); wilc->rx_buffer = NULL; diff --git a/drivers/staging/wilc1000/wlan_cfg.c b/drivers/staging/wilc1000/wlan_cfg.c index 2538435b82fd..fe2a7ed8e5cd 100644 --- a/drivers/staging/wilc1000/wlan_cfg.c +++ b/drivers/staging/wilc1000/wlan_cfg.c @@ -137,6 +137,7 @@ static void wilc_wlan_parse_response_frame(struct wilc *wl, u8 *info, int size) { u16 wid; u32 len = 0, i = 0; + struct wilc_cfg *cfg = &wl->cfg; while (size > 0) { i = 0; @@ -144,63 +145,42 @@ static void wilc_wlan_parse_response_frame(struct wilc *wl, u8 *info, int size) switch (FIELD_GET(WILC_WID_TYPE, wid)) { case WID_CHAR: - do { - if (wl->cfg.b[i].id == WID_NIL) - break; - - if (wl->cfg.b[i].id == wid) { - wl->cfg.b[i].val = info[4]; - break; - } + while (cfg->b[i].id != WID_NIL && cfg->b[i].id != wid) i++; - } while (1); + + if (cfg->b[i].id == wid) + cfg->b[i].val = info[4]; + len = 3; break; case WID_SHORT: - do { - struct wilc_cfg_hword *hw = &wl->cfg.hw[i]; + while (cfg->hw[i].id != WID_NIL && cfg->hw[i].id != wid) + i++; - if (hw->id == WID_NIL) - break; + if (cfg->hw[i].id == wid) + cfg->hw[i].val = get_unaligned_le16(&info[4]); - if (hw->id == wid) { - hw->val = get_unaligned_le16(&info[4]); - break; - } - i++; - } while (1); len = 4; break; case WID_INT: - do { - struct wilc_cfg_word *w = &wl->cfg.w[i]; + while (cfg->w[i].id != WID_NIL && cfg->w[i].id != wid) + i++; - if (w->id == WID_NIL) - break; + if (cfg->w[i].id == wid) + cfg->w[i].val = get_unaligned_le32(&info[4]); - if (w->id == wid) { - w->val = get_unaligned_le32(&info[4]); - break; - } - i++; - } while (1); len = 6; break; case WID_STR: - do { - if (wl->cfg.s[i].id == WID_NIL) - break; - - if (wl->cfg.s[i].id == wid) { - memcpy(wl->cfg.s[i].str, &info[2], - (info[2] + 2)); - break; - } + while (cfg->s[i].id != WID_NIL && cfg->s[i].id != wid) i++; - } while (1); + + if (cfg->s[i].id == wid) + memcpy(cfg->s[i].str, &info[2], info[2] + 2); + len = 2 + info[2]; break; @@ -223,16 +203,12 @@ static void wilc_wlan_parse_info_frame(struct wilc *wl, u8 *info) if (len == 1 && wid == WID_STATUS) { int i = 0; - do { - if (wl->cfg.b[i].id == WID_NIL) - break; - - if (wl->cfg.b[i].id == wid) { - wl->cfg.b[i].val = info[3]; - break; - } + while (wl->cfg.b[i].id != WID_NIL && + wl->cfg.b[i].id != wid) i++; - } while (1); + + if (wl->cfg.b[i].id == wid) + wl->cfg.b[i].val = info[3]; } } @@ -292,63 +268,45 @@ int wilc_wlan_cfg_get_val(struct wilc *wl, u16 wid, u8 *buffer, { u8 type = FIELD_GET(WILC_WID_TYPE, wid); int i, ret = 0; + struct wilc_cfg *cfg = &wl->cfg; i = 0; if (type == CFG_BYTE_CMD) { - do { - if (wl->cfg.b[i].id == WID_NIL) - break; - - if (wl->cfg.b[i].id == wid) { - memcpy(buffer, &wl->cfg.b[i].val, 1); - ret = 1; - break; - } + while (cfg->b[i].id != WID_NIL && cfg->b[i].id != wid) i++; - } while (1); + + if (cfg->b[i].id == wid) { + memcpy(buffer, &cfg->b[i].val, 1); + ret = 1; + } } else if (type == CFG_HWORD_CMD) { - do { - if (wl->cfg.hw[i].id == WID_NIL) - break; - - if (wl->cfg.hw[i].id == wid) { - memcpy(buffer, &wl->cfg.hw[i].val, 2); - ret = 2; - break; - } + while (cfg->hw[i].id != WID_NIL && cfg->hw[i].id != wid) i++; - } while (1); + + if (cfg->hw[i].id == wid) { + memcpy(buffer, &cfg->hw[i].val, 2); + ret = 2; + } } else if (type == CFG_WORD_CMD) { - do { - if (wl->cfg.w[i].id == WID_NIL) - break; - - if (wl->cfg.w[i].id == wid) { - memcpy(buffer, &wl->cfg.w[i].val, 4); - ret = 4; - break; - } + while (cfg->w[i].id != WID_NIL && cfg->w[i].id != wid) i++; - } while (1); - } else if (type == CFG_STR_CMD) { - do { - u32 id = wl->cfg.s[i].id; - if (id == WID_NIL) - break; + if (cfg->w[i].id == wid) { + memcpy(buffer, &cfg->w[i].val, 4); + ret = 4; + } + } else if (type == CFG_STR_CMD) { + while (cfg->s[i].id != WID_NIL && cfg->s[i].id != wid) + i++; - if (id == wid) { - u16 size = get_unaligned_le16(wl->cfg.s[i].str); + if (cfg->s[i].id == wid) { + u16 size = get_unaligned_le16(cfg->s[i].str); - if (buffer_size >= size) { - memcpy(buffer, &wl->cfg.s[i].str[2], - size); - ret = size; - } - break; + if (buffer_size >= size) { + memcpy(buffer, &cfg->s[i].str[2], size); + ret = size; } - i++; - } while (1); + } } return ret; } From patchwork Fri Jan 17 10:31:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 11338709 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B732D13BD for ; Fri, 17 Jan 2020 10:31:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 81E5D2082F for ; Fri, 17 Jan 2020 10:31:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="lmPDsA8V" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726689AbgAQKb3 (ORCPT ); Fri, 17 Jan 2020 05:31:29 -0500 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:2848 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbgAQKb3 (ORCPT ); Fri, 17 Jan 2020 05:31:29 -0500 Received-SPF: Pass (esa5.microchip.iphmx.com: domain of Ajay.Kathat@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa5.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="Ajay.Kathat@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa5.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa5.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa5.microchip.iphmx.com; spf=Pass smtp.mailfrom=Ajay.Kathat@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: Yow9O1h+N7raD/EczN45TYPh9TlmuQRRkhKU4Z7IX1pj7VgaWV6pwB+VSTJxWWh+3ldwG/XjGU QtlXy5nGMUTtLRsl1psv8vSuKQoa8gCLL1ncDS1oPUY262EXgfFruz4bkm7d8BFwMN9E4ryY1L LDrND3hm9HwFpPSd3Q5LowSZE9U/3zvQ27KEdsF8OJbvV5JV90+NRjnCVH8mlXxOJEAFQw1tz0 SERqBFu+ULn2vTQd6gPenK4Qh5uGmtBjM/ebfvPSgNOZmJz8RKnUVlwz01YBcClK2TJtAW1ukG Mic= X-IronPort-AV: E=Sophos;i="5.70,329,1574146800"; d="scan'208";a="62264555" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 17 Jan 2020 03:31:29 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 17 Jan 2020 03:31:26 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 17 Jan 2020 03:31:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BQUTt8TLOhfxniEQyNENuNOZNMeCwZ5skQxq6KY7Ij2QH7SdNmQ4f2wfnkyiaCT7F8fskqU+sogFWc4wEqm/8ySB4SNqo6uRRy2VOENof6sOkcI7tMkOoYgaFu5RYsUxKfmk7RwEstY3sHqOOKifoJjhE9iylfmADIdJFIH+Dai6AVyPpHXWXbweUEwD9nhD2bo/9G/BJjCDyBNmietW8kc4yDN8NyMbK1aCVARbsfq8/3GcQiPXcoJOhEP6kSiBo1ANCX3VCXo4lEkEZ8jC8ptVtZ+3QwWMX8Ck7kiingQWPNRVjCh2m2ucuCrRUJxDhR/oqnqkAMDjBPd1mRycRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EfgWzpRFGgji9ThLLnQuNckw2tiAw6dT5i9rtxJLgsw=; b=he6hc2F1OwSlzbOxvsZ5iVpQQG9muG3UcJGS26FjsQHF+KxA+mHmswQLhZbIRBy5rL7NnWRnVi3TrJexV8l8wuAwaJcZ01q/JdmAXpnBZ0O887vpWQ1dm9hDUwxFIAdrZ1U13ufgyGakpeHDI7zm2XlKW8xU58yhHrWDhhPnzE/2hKg3EOjnxO2AtqUKuRPa64y7o4tX5rTB6jybit1F0ulwnYyY/ebBjlj3+bseYb97IiYekmgd+CvhjAqifkBvNF0klZdQcaZhN/Dsb3z2ushNFmS29WTTKtsNxTjze2yZwX8WGDCVPYnfPXsGcpbsJaLUWmDouNMzOu+yPZAn7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EfgWzpRFGgji9ThLLnQuNckw2tiAw6dT5i9rtxJLgsw=; b=lmPDsA8VbVXpDEvU//KjuerxIZL402grG8GtStv8NyMwGnmr+D4D+i1Be3evxlnFxyWAqxmKuGBuIuQzmrrVZ2R5jiEpgL5UKQ0DjCWTLQjtm8YWPikH8jyHYRdLxrFDnS9i1Wo3b7D3nl1RkAPiQcVofftu2kXarFRfZojMYxw= Received: from DM6PR11MB3996.namprd11.prod.outlook.com (20.176.125.206) by DM6PR11MB2907.namprd11.prod.outlook.com (20.177.217.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Fri, 17 Jan 2020 10:31:25 +0000 Received: from DM6PR11MB3996.namprd11.prod.outlook.com ([fe80::75b4:bb0c:c245:4392]) by DM6PR11MB3996.namprd11.prod.outlook.com ([fe80::75b4:bb0c:c245:4392%5]) with mapi id 15.20.2623.018; Fri, 17 Jan 2020 10:31:25 +0000 From: To: CC: , , , , Subject: [PATCH 2/4] staging: wilc1000: move firmware API struct's to separate header file Thread-Topic: [PATCH 2/4] staging: wilc1000: move firmware API struct's to separate header file Thread-Index: AQHVzSFEHS1Yrl/GPkS/Rb+ODnC2zg== Date: Fri, 17 Jan 2020 10:31:25 +0000 Message-ID: <20200117160157.8706-3-ajay.kathat@microchip.com> References: <20200117160157.8706-1-ajay.kathat@microchip.com> In-Reply-To: <20200117160157.8706-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-originating-ip: [121.244.27.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ae769b65-8d6c-4666-8f24-08d79b386771 x-ms-traffictypediagnostic: DM6PR11MB2907: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-forefront-prvs: 0285201563 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(39860400002)(396003)(376002)(346002)(189003)(199004)(8936002)(6916009)(5660300002)(6486002)(81166006)(478600001)(26005)(76116006)(91956017)(8676002)(81156014)(66946007)(66476007)(66446008)(64756008)(66556008)(36756003)(4326008)(2906002)(86362001)(316002)(6506007)(2616005)(107886003)(71200400001)(1076003)(6512007)(186003)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR11MB2907;H:DM6PR11MB3996.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: BCL:0; x-microsoft-antispam-message-info: bcacPRPXI46za5+Txr3u+IECcmlYnOaSm0r3dgsp5ycpdeCz2OWYnZi3/NPVG/Fg5OzHBp7Xu6GXSWshfTEVaUT/FjkcXnjXrC+k+V6a1ISwHGmkyUpXjkDSYeEOjAFbH4avErU2+tlcqQcpaEvx01franYCc5S591zWRZh2wOKP469oWM3LF4ec38zs2fwtjffeTYUOOro3HICKFCvUgy3NrA91kJl7SqtZAtrChbmmGxnwocvWH84s+Fw6tZLU+94iM4iMGwwTsszbkDB6L3C3jbs9jXRmXfT9STMC4aA3NfpncORtbP/0ZapgN6l6K9Ef1QzGybUGL2oHhtLcy+xOKYvlBgWR5RQCiA6gqatQS7li8nVtxXWO+MX+tLz7vTiu132pqps9VwdG8XJr5vlawhIpcsuZ9LIKJu3KKje6BGJaiopnqvyw78KGRa6J MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ae769b65-8d6c-4666-8f24-08d79b386771 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2020 10:31:25.0734 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: YO5bhfWenUuWXSL3+UwkG/jzmKNIUKfuHGXlRuxYhdq0hr3FWPac2s8R1kwhy+3TU8DIIoAFxcHUco67boK2DMe6om6JQBEKoN3P2sbwvTU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2907 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh It's recommended to keep the 'struct' used for passing data to firmware in separate header file. So added 'fw.h' header file to keep struct's used to pass data to firmware. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/fw.h | 119 +++++++++++++++++++++++++++++ drivers/staging/wilc1000/hif.c | 88 --------------------- drivers/staging/wilc1000/hif.h | 19 ----- drivers/staging/wilc1000/netdev.h | 1 - drivers/staging/wilc1000/wlan_if.h | 1 + 5 files changed, 120 insertions(+), 108 deletions(-) create mode 100644 drivers/staging/wilc1000/fw.h diff --git a/drivers/staging/wilc1000/fw.h b/drivers/staging/wilc1000/fw.h new file mode 100644 index 000000000000..21d71a9e8b47 --- /dev/null +++ b/drivers/staging/wilc1000/fw.h @@ -0,0 +1,119 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries. + * All rights reserved. + */ + +#ifndef WILC_FW_H +#define WILC_FW_H + +#include + +#define WILC_MAX_NUM_STA 9 +#define WILC_MAX_RATES_SUPPORTED 12 +#define WILC_MAX_NUM_PMKIDS 16 +#define WILC_MAX_NUM_SCANNED_CH 14 + +struct assoc_resp { + __le16 capab_info; + __le16 status_code; + __le16 aid; +} __packed; + +struct wilc_pmkid { + u8 bssid[ETH_ALEN]; + u8 pmkid[WLAN_PMKID_LEN]; +} __packed; + +struct wilc_pmkid_attr { + u8 numpmkid; + struct wilc_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS]; +} __packed; + +struct wilc_reg_frame { + u8 reg; + u8 reg_id; + __le16 frame_type; +} __packed; + +struct wilc_drv_handler { + __le32 handler; + u8 mode; +} __packed; + +struct wilc_wep_key { + u8 index; + u8 key_len; + u8 key[0]; +} __packed; + +struct wilc_sta_wpa_ptk { + u8 mac_addr[ETH_ALEN]; + u8 key_len; + u8 key[0]; +} __packed; + +struct wilc_ap_wpa_ptk { + u8 mac_addr[ETH_ALEN]; + u8 index; + u8 key_len; + u8 key[0]; +} __packed; + +struct wilc_gtk_key { + u8 mac_addr[ETH_ALEN]; + u8 rsc[8]; + u8 index; + u8 key_len; + u8 key[0]; +} __packed; + +struct wilc_op_mode { + __le32 mode; +} __packed; + +struct wilc_noa_opp_enable { + u8 ct_window; + u8 cnt; + __le32 duration; + __le32 interval; + __le32 start_time; +} __packed; + +struct wilc_noa_opp_disable { + u8 cnt; + __le32 duration; + __le32 interval; + __le32 start_time; +} __packed; + +struct wilc_join_bss_param { + char ssid[IEEE80211_MAX_SSID_LEN]; + u8 ssid_terminator; + u8 bss_type; + u8 ch; + __le16 cap_info; + u8 sa[ETH_ALEN]; + u8 bssid[ETH_ALEN]; + __le16 beacon_period; + u8 dtim_period; + u8 supp_rates[WILC_MAX_RATES_SUPPORTED + 1]; + u8 wmm_cap; + u8 uapsd_cap; + u8 ht_capable; + u8 rsn_found; + u8 rsn_grp_policy; + u8 mode_802_11i; + u8 p_suites[3]; + u8 akm_suites[3]; + u8 rsn_cap[2]; + u8 noa_enabled; + __le32 tsf_lo; + u8 idx; + u8 opp_enabled; + union { + struct wilc_noa_opp_disable opp_dis; + struct wilc_noa_opp_enable opp_en; + }; +} __packed; +#endif diff --git a/drivers/staging/wilc1000/hif.c b/drivers/staging/wilc1000/hif.c index 349e45d58ec9..1ee3d7274bd6 100644 --- a/drivers/staging/wilc1000/hif.c +++ b/drivers/staging/wilc1000/hif.c @@ -10,7 +10,6 @@ #define WILC_HIF_CONNECT_TIMEOUT_MS 9500 #define WILC_FALSE_FRMWR_CHANNEL 100 -#define WILC_MAX_RATES_SUPPORTED 12 struct wilc_rcvd_mac_info { u8 status; @@ -27,48 +26,6 @@ struct wilc_del_all_sta { u8 mac[WILC_MAX_NUM_STA][ETH_ALEN]; }; -struct wilc_op_mode { - __le32 mode; -}; - -struct wilc_reg_frame { - u8 reg; - u8 reg_id; - __le16 frame_type; -} __packed; - -struct wilc_drv_handler { - __le32 handler; - u8 mode; -} __packed; - -struct wilc_wep_key { - u8 index; - u8 key_len; - u8 key[0]; -} __packed; - -struct wilc_sta_wpa_ptk { - u8 mac_addr[ETH_ALEN]; - u8 key_len; - u8 key[0]; -} __packed; - -struct wilc_ap_wpa_ptk { - u8 mac_addr[ETH_ALEN]; - u8 index; - u8 key_len; - u8 key[0]; -} __packed; - -struct wilc_gtk_key { - u8 mac_addr[ETH_ALEN]; - u8 rsc[8]; - u8 index; - u8 key_len; - u8 key[0]; -} __packed; - union wilc_message_body { struct wilc_rcvd_net_info net_info; struct wilc_rcvd_mac_info mac_info; @@ -86,51 +43,6 @@ struct host_if_msg { bool is_sync; }; -struct wilc_noa_opp_enable { - u8 ct_window; - u8 cnt; - __le32 duration; - __le32 interval; - __le32 start_time; -} __packed; - -struct wilc_noa_opp_disable { - u8 cnt; - __le32 duration; - __le32 interval; - __le32 start_time; -} __packed; - -struct wilc_join_bss_param { - char ssid[IEEE80211_MAX_SSID_LEN]; - u8 ssid_terminator; - u8 bss_type; - u8 ch; - __le16 cap_info; - u8 sa[ETH_ALEN]; - u8 bssid[ETH_ALEN]; - __le16 beacon_period; - u8 dtim_period; - u8 supp_rates[WILC_MAX_RATES_SUPPORTED + 1]; - u8 wmm_cap; - u8 uapsd_cap; - u8 ht_capable; - u8 rsn_found; - u8 rsn_grp_policy; - u8 mode_802_11i; - u8 p_suites[3]; - u8 akm_suites[3]; - u8 rsn_cap[2]; - u8 noa_enabled; - __le32 tsf_lo; - u8 idx; - u8 opp_enabled; - union { - struct wilc_noa_opp_disable opp_dis; - struct wilc_noa_opp_enable opp_en; - }; -} __packed; - /* 'msg' should be free by the caller for syc */ static struct host_if_msg* wilc_alloc_work(struct wilc_vif *vif, void (*work_fun)(struct work_struct *), diff --git a/drivers/staging/wilc1000/hif.h b/drivers/staging/wilc1000/hif.h index 22ee6fffd599..db9179171f05 100644 --- a/drivers/staging/wilc1000/hif.h +++ b/drivers/staging/wilc1000/hif.h @@ -17,14 +17,11 @@ enum { WILC_CLIENT_MODE = 0x4 }; -#define WILC_MAX_NUM_STA 9 -#define WILC_MAX_NUM_SCANNED_CH 14 #define WILC_MAX_NUM_PROBED_SSID 10 #define WILC_TX_MIC_KEY_LEN 8 #define WILC_RX_MIC_KEY_LEN 8 -#define WILC_MAX_NUM_PMKIDS 16 #define WILC_ADD_STA_LENGTH 40 #define WILC_NUM_CONCURRENT_IFC 2 @@ -35,12 +32,6 @@ enum { #define WILC_MAX_ASSOC_RESP_FRAME_SIZE 256 -struct assoc_resp { - __le16 capab_info; - __le16 status_code; - __le16 aid; -} __packed; - struct rf_info { u8 link_speed; s8 rssi; @@ -59,16 +50,6 @@ enum host_if_state { HOST_IF_FORCE_32BIT = 0xFFFFFFFF }; -struct wilc_pmkid { - u8 bssid[ETH_ALEN]; - u8 pmkid[WLAN_PMKID_LEN]; -} __packed; - -struct wilc_pmkid_attr { - u8 numpmkid; - struct wilc_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS]; -} __packed; - struct cfg_param_attr { u32 flag; u16 short_retry_limit; diff --git a/drivers/staging/wilc1000/netdev.h b/drivers/staging/wilc1000/netdev.h index cd8f0d72caaa..d5f7a6037fbc 100644 --- a/drivers/staging/wilc1000/netdev.h +++ b/drivers/staging/wilc1000/netdev.h @@ -21,7 +21,6 @@ #define FLOW_CONTROL_LOWER_THRESHOLD 128 #define FLOW_CONTROL_UPPER_THRESHOLD 256 -#define WILC_MAX_NUM_PMKIDS 16 #define PMKID_FOUND 1 #define NUM_STA_ASSOCIATED 8 diff --git a/drivers/staging/wilc1000/wlan_if.h b/drivers/staging/wilc1000/wlan_if.h index 7c7ee66c35f5..f85fd575136d 100644 --- a/drivers/staging/wilc1000/wlan_if.h +++ b/drivers/staging/wilc1000/wlan_if.h @@ -8,6 +8,7 @@ #define WILC_WLAN_IF_H #include +#include "fw.h" /******************************************** * From patchwork Fri Jan 17 10:31:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 11338717 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B036109A for ; Fri, 17 Jan 2020 10:31:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D2962082F for ; Fri, 17 Jan 2020 10:31:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="gJSvKjI+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726982AbgAQKbf (ORCPT ); Fri, 17 Jan 2020 05:31:35 -0500 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:23235 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbgAQKbf (ORCPT ); Fri, 17 Jan 2020 05:31:35 -0500 Received-SPF: Pass (esa1.microchip.iphmx.com: domain of Ajay.Kathat@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="Ajay.Kathat@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa1.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa1.microchip.iphmx.com; spf=Pass smtp.mailfrom=Ajay.Kathat@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: qdUSGLrBaAkCuWHaBojHLbJoAXcv8IfPmo5+ken92KMqWI1xEKhHDO/0t84GMrncQOScSr9Off O+AtSaYP6ht2Xg+zrZVErGPjw6hv7WRNtkA8ssCWwMpim9i6wQtHQTKniCdhXlwiXr40V1/0ww NriU+a9Db6obVnZiDd8rJ9WD6d8gIKS07HjzK9AZT9745EEUo0NFOXfegyOa2Dksx8LhS+YSOf JJOcfaZ1sKp0v8VJAHr+XKSmsqsnZ7xPsfasIIZMaUzlUTvebuRU1V9JezQKba3heZUhfXNpFf Fkg= X-IronPort-AV: E=Sophos;i="5.70,329,1574146800"; d="scan'208";a="65077360" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 17 Jan 2020 03:31:34 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 17 Jan 2020 03:31:27 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 17 Jan 2020 03:31:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gsTi5sV4B3NQtNnrsQcLq4n3Ggf9C6HFA3mH4hY/NOoeCe/kUBh03mQQXMpURj5r5a42coWW/XYQtkSS2NcpKBA7cYGTQNuVBtdVpX1q35D/wn00+vDN4WaMAZxQbZcBaUjbLset58IZw61UZOo7ZEwEoxH/Kd3bQOHLy8bW+tkAZxhv3Y1ieXTSZN51b5ZbMMoJUKweSowwMoCpNtsgGe/+WmBavAlaBuFnhLcenR3pqjfvWNdqaz/sKodfulci0X5S/3GinDE/gPkcyUDKupAD/GOhbtMYJKjy7eEwyG1n7Q4hPxOCavoE0T1Fmxzt3VgntVUCqBSUJOskQhUAGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9+zKjjAlC2k7d3vs1sFCBgtDTG8IvLrabnAyvvP9JRo=; b=ZEIkEqdjVo29qD84dSprSIRTCgfsd6DCulJ/l0RMjhkJY4ntzxUe71RRjNSftQc7J+AC+KjGvIqkWlDP1t3Ec9zUaSvxuH2EMmKjXkLlx71KcA25kUnIJNmVzzsVCyrFPRpFlIhg/BcznSkn8Ncwu3wfKfYfhB7rjxzGHG6lmlefYX2OKcRl1Ia1pDzkCYudGwO3QItajjHd/pATP0slAXmctF8gkJePhJ7zV6L1ng75bxUz5An8GS5XyOaLl3q2s0WT4ys8/YzdKTdFcuhuL6XST243gxCBcoPF0GzhBUNYN3u78zmeExPbGJP4rFZ7uLY2Y79Z3aYYej2c6VjWdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9+zKjjAlC2k7d3vs1sFCBgtDTG8IvLrabnAyvvP9JRo=; b=gJSvKjI+zkkt2mORH6qA56EqI18A7jDfTPJt+ra6LGGVV67wNklrEzpvOAYxW1HfB37zFyyKWvdB/bXRprfErskRzONP/jR7aak76l7R9LopYN+3yzVVSOPX03pwxfPEqgiE8fuVS+xrrghAJlKBX+gzrv08dxaV4zg46wfVR1Q= Received: from DM6PR11MB3996.namprd11.prod.outlook.com (20.176.125.206) by DM6PR11MB2907.namprd11.prod.outlook.com (20.177.217.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Fri, 17 Jan 2020 10:31:26 +0000 Received: from DM6PR11MB3996.namprd11.prod.outlook.com ([fe80::75b4:bb0c:c245:4392]) by DM6PR11MB3996.namprd11.prod.outlook.com ([fe80::75b4:bb0c:c245:4392%5]) with mapi id 15.20.2623.018; Fri, 17 Jan 2020 10:31:26 +0000 From: To: CC: , , , , Subject: [PATCH 3/4] staging: wilc1000: added 'wilc_' prefix for 'struct assoc_resp' name Thread-Topic: [PATCH 3/4] staging: wilc1000: added 'wilc_' prefix for 'struct assoc_resp' name Thread-Index: AQHVzSFFjPGjT3ZT2USKGRbjiG4W5g== Date: Fri, 17 Jan 2020 10:31:26 +0000 Message-ID: <20200117160157.8706-4-ajay.kathat@microchip.com> References: <20200117160157.8706-1-ajay.kathat@microchip.com> In-Reply-To: <20200117160157.8706-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-originating-ip: [121.244.27.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 040f77f7-723c-4aa2-f089-08d79b386842 x-ms-traffictypediagnostic: DM6PR11MB2907: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2331; x-forefront-prvs: 0285201563 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(39860400002)(396003)(376002)(346002)(189003)(199004)(8936002)(6916009)(5660300002)(6486002)(81166006)(478600001)(26005)(76116006)(91956017)(8676002)(81156014)(66946007)(66476007)(66446008)(64756008)(66556008)(36756003)(4326008)(2906002)(86362001)(316002)(6506007)(2616005)(107886003)(71200400001)(1076003)(6512007)(186003)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR11MB2907;H:DM6PR11MB3996.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: BCL:0; x-microsoft-antispam-message-info: B3s1Sn1kjLUwRs768yLMgYFlCYntSPEzErz3f3mmBgR7DXdku/naor6utsLI90JLxfNBxNwXXxB3dFjWp5tYaXV/TktLSt+QZB0AapPQyPVMTI3IYYKbOoq6eKiqVhoLLF7YlxIwTCcqwZ2M227IlzUgOIeKmk9d0g3ZV87MNnAi9dlCYEpey1/1KVZ4obo9LCBw7ZpoEOJ6+3oAhKuB7SbmqdqYqeqho/GCZuACMbKZn6Icoeqz+3uyxx12Ibdijbi2aCk7s80/fInEDQkVN7JCciE66G6ZRPROY+hses2FZUqqI/aGY62FTKrsSkRnxvv4xqL1y9OvjSMuTQTgjZjL+MMcdoHUkIzY7mly7rDi1P/jhpxNp+8pXzlg7ana2nHB6t8ZArv7k2myIlZhTIJjs678wU/bTwX3XyEV4KJgGQda1x3VS4nKxT50xH9u MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 040f77f7-723c-4aa2-f089-08d79b386842 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2020 10:31:26.4466 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: FuTQG/jL9n/HT1d8+W83IdTf8TYwZN2PAQAUKrkVPtoksCq1usqGbIvgbsNemDHokPUhxp1hBfdDf90GvM3kpMoNmnNadlJQytKz0LbCm48= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2907 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Use 'wilc_' prefix for 'assoc_resp' struct to have proper naming convention. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/fw.h | 2 +- drivers/staging/wilc1000/hif.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/fw.h b/drivers/staging/wilc1000/fw.h index 21d71a9e8b47..a76e1dea4345 100644 --- a/drivers/staging/wilc1000/fw.h +++ b/drivers/staging/wilc1000/fw.h @@ -14,7 +14,7 @@ #define WILC_MAX_NUM_PMKIDS 16 #define WILC_MAX_NUM_SCANNED_CH 14 -struct assoc_resp { +struct wilc_assoc_resp { __le16 capab_info; __le16 status_code; __le16 aid; diff --git a/drivers/staging/wilc1000/hif.c b/drivers/staging/wilc1000/hif.c index 1ee3d7274bd6..658790bd465b 100644 --- a/drivers/staging/wilc1000/hif.c +++ b/drivers/staging/wilc1000/hif.c @@ -552,7 +552,7 @@ static s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len, { u8 *ies; u16 ies_len; - struct assoc_resp *res = (struct assoc_resp *)buffer; + struct wilc_assoc_resp *res = (struct wilc_assoc_resp *)buffer; ret_conn_info->status = le16_to_cpu(res->status_code); if (ret_conn_info->status == WLAN_STATUS_SUCCESS) { From patchwork Fri Jan 17 10:31:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 11338713 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 23584186E for ; Fri, 17 Jan 2020 10:31:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 011B92082F for ; Fri, 17 Jan 2020 10:31:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="XwYB2HLn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726915AbgAQKbb (ORCPT ); Fri, 17 Jan 2020 05:31:31 -0500 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:55340 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbgAQKba (ORCPT ); Fri, 17 Jan 2020 05:31:30 -0500 Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Ajay.Kathat@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="Ajay.Kathat@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; spf=Pass smtp.mailfrom=Ajay.Kathat@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: k3ri91OHfHldoW61f821T7S20ZTDSywePNhHDV5L/bBp0HaVk442V+jxJKIACsVn7RdLXHVj4T 4sIeLXO5XEw5/GqaVOHkhebsViMYD16EwLzUZPscLcZcj/uD7+lSazdsXmJxhIfuuGYD/zKirQ pOW3xX+UhMWoOQZjUbIcCZQNHDbOdEPzTX1WRj8e5pOatV5ycGhxY9+bVgu1G7YKEsNaOczRO8 GKnXoKjDC90MiVCw3Xp+oFGDZpPM3KYn8vENXlidFvsUj9cRWYA7wV7AEEO/A9IIyHGJ30yVB6 9Fc= X-IronPort-AV: E=Sophos;i="5.70,329,1574146800"; d="scan'208";a="61369414" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 17 Jan 2020 03:31:29 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 17 Jan 2020 03:31:29 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 17 Jan 2020 03:31:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GileH9ucLOZ0WmMbsJx/WXWLVGCMePxq9DoX06SjO0aUdzz98JP/kKMFlwMoYNpdVVDNG++EtNPBOkBncJ+7R/enymwv8ZBWBLcGVQzCv9BScv5n7/5W2MFH4hgsuE1hWfzNyBrzgNUGfVH9e/1ptxSX43AWSFYQOg+ICO/apmjqLC1IyL5x5kXRRTDF4xzJY2B5KdyJrMBrH9SlHIV6+RxlPgeXF8cHjOrHrEnOvrNeULFQBBB2yw/9WRPo5puglF/aH6rKblajPkkWXRUQg08ImGjtCgRhpt2c3W16qOlX6+2r9M7XQX+XKhkNJiGq+Hb5f+udkydQXtSD5jpJXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z4sDtNbwx6vkaUI3w0nWsSCdnCCsvGh82TQsgrYmvxM=; b=Ww5xSgQeDhjNT6dV3ejpQChtci0xZOo/bT1u0Y72fJjegcy460lsigOg8U2kD6bF97f4xxpjhATwYhuGkMlTEzif7Dyi3f5FSrQpT92jwxFhYk1zDladmOFs6/daXWOJb6lKFFR5lX4eYZi/EADXSSpO9cJrW+9SKqLEM9rZvpkXG8enmlhDP50gveqd/MRmBnrh0wf2bx8yr1jGlcK9ySzSpkPRDvoVOst1D/0F4nVio8l85A9BX8i7zEKoSlfNLRjjnVVxDddf4SeoZolO6EDkGveNxl6t7vVpxUMMEDMz322Gpmke9hC+FCqir6M0iVkHARJFsyjvHaWNROUC5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z4sDtNbwx6vkaUI3w0nWsSCdnCCsvGh82TQsgrYmvxM=; b=XwYB2HLnSruiVRghr45G/VsQI70kPQqCpUoQcZn0uWeeMEUOQJ8nR+L0U2YohzqQpec8BIcvLrB9+9mzqQ1WFDcBhbSryvv30KTe6XSIlqZUWYj9Ym623sVizOXa5M+Qt4yNjdrZne6METYq1wyKDbyuJo7da1QIUbSfiBd/3mU= Received: from DM6PR11MB3996.namprd11.prod.outlook.com (20.176.125.206) by DM6PR11MB2907.namprd11.prod.outlook.com (20.177.217.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Fri, 17 Jan 2020 10:31:28 +0000 Received: from DM6PR11MB3996.namprd11.prod.outlook.com ([fe80::75b4:bb0c:c245:4392]) by DM6PR11MB3996.namprd11.prod.outlook.com ([fe80::75b4:bb0c:c245:4392%5]) with mapi id 15.20.2623.018; Fri, 17 Jan 2020 10:31:28 +0000 From: To: CC: , , , , Subject: [PATCH 4/4] staging: wilc1000: remove unused code prior to throughput enhancement in SPI Thread-Topic: [PATCH 4/4] staging: wilc1000: remove unused code prior to throughput enhancement in SPI Thread-Index: AQHVzSFG90oHFZftCU++AJhMAvfi1w== Date: Fri, 17 Jan 2020 10:31:27 +0000 Message-ID: <20200117160157.8706-5-ajay.kathat@microchip.com> References: <20200117160157.8706-1-ajay.kathat@microchip.com> In-Reply-To: <20200117160157.8706-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-originating-ip: [121.244.27.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ebf2e9b7-92e9-47f0-5470-08d79b38692d x-ms-traffictypediagnostic: DM6PR11MB2907: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0285201563 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(39860400002)(396003)(376002)(346002)(189003)(199004)(8936002)(6916009)(5660300002)(6486002)(81166006)(478600001)(26005)(76116006)(91956017)(8676002)(81156014)(66946007)(66476007)(66446008)(64756008)(66556008)(36756003)(4326008)(2906002)(86362001)(316002)(6506007)(2616005)(107886003)(71200400001)(1076003)(6512007)(186003)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR11MB2907;H:DM6PR11MB3996.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: BCL:0; x-microsoft-antispam-message-info: symNvoeiv2GXwonW1xpPwU0Yu4M/VwcAAjXu+WG7q2clSGjj7CcSfuAvWMGK0GbATABCV9iZJbL80DNYDDTSFMNQlPMaO8HZNyqi1KISf5lw3O93eYrPtASbSnaYuhE+YDYfWPv7pCyqJCv/Tw2M2ZOcZSlLPgiU2z3/qhh+PpF0MdWvxkRpcHXml311L4IWGtUzmAQmbUaFxGOB1xUooQUYX5CmG6DQUzR/DEoFiAN0SAfWpqGMhfpx8mXYkNLBCBF5DeJjAwaDGToUYYoVAZW7QFgAB0SU5hWh3Jy7U5kKee+yWXYhZhTI1Y7SV14u6505/x2ZenVUZnv7vnlvgsPSaexu3Ah5at/e785za+w+rKHaqxtIuU4ZX2U1PyRyQZHlHtAkbYQwd5AeB+nlosPkzC4AqQPmGt0YPSysm76Prs1NtjEP+ZlfBNj5+0hW MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ebf2e9b7-92e9-47f0-5470-08d79b38692d X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2020 10:31:27.9957 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: O83qTsPnmlWAWung21bc2Sbhp4wK6RP8ipv6mbmEOxu0uKWvHfgvmjZGCnL9QKIwcYpdJU796Ja87r31XVtjx7AGtpsMmEAT16AGN8TZhy8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2907 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh The firmware now uses throughput enhancement code by default for SPI so remove the previous implementation as its not used anymore. Removed the use of 'has_thrpt_enh' element as its always true. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/spi.c | 143 +-------------------------------- 1 file changed, 4 insertions(+), 139 deletions(-) diff --git a/drivers/staging/wilc1000/spi.c b/drivers/staging/wilc1000/spi.c index 8694ab5fcb22..4b883a933b44 100644 --- a/drivers/staging/wilc1000/spi.c +++ b/drivers/staging/wilc1000/spi.c @@ -13,7 +13,6 @@ struct wilc_spi { int crc_off; int nint; - int has_thrpt_enh; }; static const struct wilc_hif_func wilc_hif_spi; @@ -897,8 +896,6 @@ static int wilc_spi_init(struct wilc *wilc, bool resume) return 0; } - spi_priv->has_thrpt_enh = 1; - isinit = 1; return 1; @@ -906,154 +903,22 @@ static int wilc_spi_init(struct wilc *wilc, bool resume) static int wilc_spi_read_size(struct wilc *wilc, u32 *size) { - struct spi_device *spi = to_spi_device(wilc->dev); - struct wilc_spi *spi_priv = wilc->bus_data; int ret; - if (spi_priv->has_thrpt_enh) { - ret = spi_internal_read(wilc, 0xe840 - WILC_SPI_REG_BASE, - size); - *size = *size & IRQ_DMA_WD_CNT_MASK; - } else { - u32 tmp; - u32 byte_cnt; - - ret = wilc_spi_read_reg(wilc, WILC_VMM_TO_HOST_SIZE, - &byte_cnt); - if (!ret) { - dev_err(&spi->dev, - "Failed read WILC_VMM_TO_HOST_SIZE ...\n"); - return ret; - } - tmp = (byte_cnt >> 2) & IRQ_DMA_WD_CNT_MASK; - *size = tmp; - } + ret = spi_internal_read(wilc, 0xe840 - WILC_SPI_REG_BASE, size); + *size = *size & IRQ_DMA_WD_CNT_MASK; return ret; } static int wilc_spi_read_int(struct wilc *wilc, u32 *int_status) { - struct spi_device *spi = to_spi_device(wilc->dev); - struct wilc_spi *spi_priv = wilc->bus_data; - int ret; - u32 tmp; - u32 byte_cnt; - bool unexpected_irq; - int j; - u32 unknown_mask; - u32 irq_flags; - int k = IRG_FLAGS_OFFSET + 5; - - if (spi_priv->has_thrpt_enh) - return spi_internal_read(wilc, 0xe840 - WILC_SPI_REG_BASE, - int_status); - ret = wilc_spi_read_reg(wilc, WILC_VMM_TO_HOST_SIZE, &byte_cnt); - if (!ret) { - dev_err(&spi->dev, - "Failed read WILC_VMM_TO_HOST_SIZE ...\n"); - return ret; - } - tmp = (byte_cnt >> 2) & IRQ_DMA_WD_CNT_MASK; - - j = 0; - do { - wilc_spi_read_reg(wilc, 0x1a90, &irq_flags); - tmp |= ((irq_flags >> 27) << IRG_FLAGS_OFFSET); - - if (spi_priv->nint > 5) { - wilc_spi_read_reg(wilc, 0x1a94, &irq_flags); - tmp |= (((irq_flags >> 0) & 0x7) << k); - } - - unknown_mask = ~((1ul << spi_priv->nint) - 1); - - unexpected_irq = (tmp >> IRG_FLAGS_OFFSET) & unknown_mask; - if (unexpected_irq) { - dev_err(&spi->dev, - "Unexpected interrupt(2):j=%d,tmp=%x,mask=%x\n", - j, tmp, unknown_mask); - } - - j++; - } while (unexpected_irq); - - *int_status = tmp; - - return ret; + return spi_internal_read(wilc, 0xe840 - WILC_SPI_REG_BASE, int_status); } static int wilc_spi_clear_int_ext(struct wilc *wilc, u32 val) { - struct spi_device *spi = to_spi_device(wilc->dev); - struct wilc_spi *spi_priv = wilc->bus_data; - int ret; - u32 flags; - u32 tbl_ctl; - - if (spi_priv->has_thrpt_enh) { - return spi_internal_write(wilc, 0xe844 - WILC_SPI_REG_BASE, - val); - } - - flags = val & (BIT(MAX_NUM_INT) - 1); - if (flags) { - int i; - - ret = 1; - for (i = 0; i < spi_priv->nint; i++) { - /* - * No matter what you write 1 or 0, - * it will clear interrupt. - */ - if (flags & 1) - ret = wilc_spi_write_reg(wilc, - 0x10c8 + i * 4, 1); - if (!ret) - break; - flags >>= 1; - } - if (!ret) { - dev_err(&spi->dev, - "Failed wilc_spi_write_reg, set reg %x ...\n", - 0x10c8 + i * 4); - return ret; - } - for (i = spi_priv->nint; i < MAX_NUM_INT; i++) { - if (flags & 1) - dev_err(&spi->dev, - "Unexpected interrupt cleared %d...\n", - i); - flags >>= 1; - } - } - - tbl_ctl = 0; - /* select VMM table 0 */ - if (val & SEL_VMM_TBL0) - tbl_ctl |= BIT(0); - /* select VMM table 1 */ - if (val & SEL_VMM_TBL1) - tbl_ctl |= BIT(1); - - ret = wilc_spi_write_reg(wilc, WILC_VMM_TBL_CTL, tbl_ctl); - if (!ret) { - dev_err(&spi->dev, "fail write reg vmm_tbl_ctl...\n"); - return ret; - } - - if (val & EN_VMM) { - /* - * enable vmm transfer. - */ - ret = wilc_spi_write_reg(wilc, WILC_VMM_CORE_CTL, 1); - if (!ret) { - dev_err(&spi->dev, "fail write reg vmm_core_ctl...\n"); - return ret; - } - } - - return ret; + return spi_internal_write(wilc, 0xe844 - WILC_SPI_REG_BASE, val); } static int wilc_spi_sync_ext(struct wilc *wilc, int nint)