From patchwork Thu Nov 1 16:45:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10664249 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 22E7614E2 for ; Thu, 1 Nov 2018 16:45:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FEAB2C1D7 for ; Thu, 1 Nov 2018 16:45:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0385E2C1DD; Thu, 1 Nov 2018 16:45:10 +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 684AE2C1D7 for ; Thu, 1 Nov 2018 16:45:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726200AbeKBBsw (ORCPT ); Thu, 1 Nov 2018 21:48:52 -0400 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:22166 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbeKBBsw (ORCPT ); Thu, 1 Nov 2018 21:48:52 -0400 X-IronPort-AV: E=Sophos;i="5.54,452,1534834800"; d="scan'208";a="19784996" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 01 Nov 2018 09:45:07 -0700 Received: from NAM04-SN1-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; Thu, 1 Nov 2018 09:45:07 -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=WAf/hwDnxTI6/5yTp255TBRUKtQD+1arIqXfWawfjTw=; b=TFAz2CCxWWYj/pMTLogUUNbmTXIp8x237s20ChNvU01SKyvLJIpE97gC7obGBhtW6STiCiz4R+fyYgfdwJlZD6C2A1hZxiQY9dv0xaz8TklfyzM6VH8b/M/baM9tk1r6oaU3BEteq3dQMQVnIr2ZKO0brU88p8b8956886cG2Yo= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB3077.namprd11.prod.outlook.com (20.177.226.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.27; Thu, 1 Nov 2018 16:45:05 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7%6]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 16:45:05 +0000 From: To: CC: , , , , , , Subject: [PATCH 1/8] staging: wilc1000: refactor wilc_parse_network_info() using kernel framework api's Thread-Topic: [PATCH 1/8] staging: wilc1000: refactor wilc_parse_network_info() using kernel framework api's Thread-Index: AQHUcgI9+KAAgLN1y0ueG6DieJ/uhw== Date: Thu, 1 Nov 2018 16:45:05 +0000 Message-ID: <1541090691-31928-2-git-send-email-ajay.kathat@microchip.com> References: <1541090691-31928-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1541090691-31928-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: SG2PR06CA0138.apcprd06.prod.outlook.com (2603:1096:1:1f::16) 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-originating-ip: [49.205.219.12] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB3077;6:3yjNK+F2v5KxyIC04T5tjthVd4oiftaPH1JMVnchMgq4dfc4iWkfG+cAauSdVZXcPGgiagcxlGi5+qVQSDan9hphmcClRCrdoQ9vNEbVjG+hrE9mVwsTBFX/ALD27GrSISd1u47iyiEm91UUKK4tYMLxPv2FkcDvXbCwc80JdKfWsaqAc+R7wplNWBSCsI+D8ZL0AAQ1XUPpaM2ubmXRQgnoOrd0A4txb/thBOdQuH/whLQhT+T/Kn0VPsaSUnYXpnMBK3ATpKclZK9h1VwhNFmEjbOuQUbQp0GSkx52+DjvEQT335lqBG7Zz1oXva3HlicZqlo1ewWmuyTVsO3Bvsg+6pXn80MtvTBWN0MqioSa2jFbK+Uwc8ZJmQqBtzpwHP7V0TE6ArmAMg1WdytcOZta6+mgczURtLrZB1ANBMTXvse+aS0SKfaaryuH8oYR1xmxcNbcHJWasNh1JWW7WA==;5:hW3gKDEGkv/n8ETEtjUbRKsqAgs7I1xTbDWbyZjclM5a5nye1TwT2M//RqFaFRfRlyDQSGQ+Q8JzBuMg6XjpQGXw/kfxmfQRrFhx/TPtibMzlmnTh7C6aKoqGe+icTfrotADSs/IGDS16JbJh7FsNQyW3lYpZDtzZajsRbmlo8s=;7:EU1B2lwbltmEKIC+hrsWVtGbXbEKEzdIYudtE7p8X/LkAatxL5XWKDu+Am3I8fJX3hNv/e2NxkvlrNjH7oklNy5yUKrZzr8lNhfbbZ3S+nWZin0nLKhRpDZuWDd0bDODc0QQc5fVZiv4R5/J5cUfqQ== x-ms-office365-filtering-correlation-id: 0bc926f6-a97c-4479-120e-08d640195fbc x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB3077; x-ms-traffictypediagnostic: BYAPR11MB3077: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3231382)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB3077;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB3077; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(376002)(366004)(39860400002)(346002)(396003)(189003)(199004)(26005)(486006)(6486002)(86362001)(2906002)(71190400001)(2351001)(53936002)(71200400001)(256004)(6512007)(14454004)(66066001)(106356001)(6116002)(105586002)(3846002)(6436002)(107886003)(2900100001)(68736007)(81166006)(8676002)(5640700003)(11346002)(6506007)(36756003)(72206003)(7736002)(54906003)(316002)(8936002)(4326008)(5660300001)(52116002)(81156014)(25786009)(102836004)(2616005)(186003)(476003)(6916009)(76176011)(386003)(305945005)(5250100002)(478600001)(97736004)(446003)(99286004)(2501003)(78486014);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB3077;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-microsoft-antispam-message-info: aCsHY9EqDnbL3UYt5jzBtF0cmRzWn+rM0kSIAbgN4WVaA0webCKjyE1HzIqeMDn3+kBHoZa0FypwtOJIJSYwGRBe+3quJXgLBg29q7HaoUOI2H6ybjRAFZWcCNv+j29rTAkV8It20Un2FCGHLfLd+TRfPR/GEeQBjmWlCVwyqPKdCiQk0b6YKu/gyHQSW3RkrBIjg3UROD5L6Ewa5eiN31ctCMnHiwErpmxgouamdS2HOeWEZvT0HhJGQ/XPFadM2z47qiXRxvLDkkIqThM2Zi/KTNo3jiCmgqtbBa2ajBoCPgLuajkQV81m+7jQLDyJWz8G//V5h8kdmNVafwf/4MxSHUWevrZxLjtnAxBJSIg= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 0bc926f6-a97c-4479-120e-08d640195fbc X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 16:45:05.1289 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3077 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 wilc_parse_network_info() by making use of cfg80211.h provided API. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/coreconfigurator.c | 90 ++++++++++++++++++----------- 1 file changed, 55 insertions(+), 35 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index d6d3a97..4dfa658 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -4,7 +4,7 @@ * All rights reserved. */ -#include +#include #include "coreconfigurator.h" @@ -116,11 +116,11 @@ static inline void get_address3(u8 *msa, u8 *addr) memcpy(addr, msa + 16, 6); } -static inline void get_bssid(u8 *data, u8 *bssid) +static inline void get_bssid(__le16 fc, u8 *data, u8 *bssid) { - if (get_from_ds(data) == 1) + if (ieee80211_has_fromds(fc)) get_address2(data, bssid); - else if (get_to_ds(data) == 1) + else if (ieee80211_has_tods(fc)) get_address1(data, bssid); else get_address3(data, bssid); @@ -202,17 +202,18 @@ s32 wilc_parse_network_info(u8 *msg_buffer, struct network_info **ret_network_info) { struct network_info *network_info; - u8 *wid_val, *msa, *tim_elm, *ies; - u32 tsf_lo, tsf_hi; + struct ieee80211_mgmt *mgt; + u8 *wid_val, *msa, *ies; u16 wid_len, rx_len, ies_len; - u8 msg_type, index; + u8 msg_type; + size_t offset; + const u8 *ch_elm, *tim_elm, *ssid_elm; msg_type = msg_buffer[0]; - if ('N' != msg_type) return -EFAULT; - wid_len = MAKE_WORD16(msg_buffer[6], msg_buffer[7]); + wid_len = get_unaligned_le16(&msg_buffer[6]); wid_val = &msg_buffer[8]; network_info = kzalloc(sizeof(*network_info), GFP_KERNEL); @@ -222,42 +223,61 @@ s32 wilc_parse_network_info(u8 *msg_buffer, network_info->rssi = wid_val[0]; msa = &wid_val[1]; - + mgt = (struct ieee80211_mgmt *)&wid_val[1]; rx_len = wid_len - 1; - network_info->cap_info = get_cap_info(msa); - network_info->tsf_lo = get_beacon_timestamp_lo(msa); - tsf_lo = get_beacon_timestamp_lo(msa); - tsf_hi = get_beacon_timestamp_hi(msa); + if (ieee80211_is_probe_resp(mgt->frame_control)) { + network_info->cap_info = le16_to_cpu(mgt->u.probe_resp.capab_info); + network_info->beacon_period = le16_to_cpu(mgt->u.probe_resp.beacon_int); + network_info->tsf_hi = le64_to_cpu(mgt->u.probe_resp.timestamp); + network_info->tsf_lo = (u32)network_info->tsf_hi; + offset = offsetof(struct ieee80211_mgmt, u.probe_resp.variable); + } else if (ieee80211_is_beacon(mgt->frame_control)) { + network_info->cap_info = le16_to_cpu(mgt->u.beacon.capab_info); + network_info->beacon_period = le16_to_cpu(mgt->u.beacon.beacon_int); + network_info->tsf_hi = le64_to_cpu(mgt->u.beacon.timestamp); + network_info->tsf_lo = (u32)network_info->tsf_hi; + offset = offsetof(struct ieee80211_mgmt, u.beacon.variable); + } else { + /* only process probe response and beacon frame */ + kfree(network_info); + return -EIO; + } - network_info->tsf_hi = tsf_lo | ((u64)tsf_hi << 32); + get_bssid(mgt->frame_control, msa, network_info->bssid); - get_ssid(msa, network_info->ssid, &network_info->ssid_len); - get_bssid(msa, network_info->bssid); + ies = mgt->u.beacon.variable; + ies_len = rx_len - offset; + if (ies_len <= 0) { + kfree(network_info); + return -EIO; + } - network_info->ch = get_current_channel_802_11n(msa, rx_len - + FCS_LEN); + network_info->ies = kmemdup(ies, ies_len, GFP_KERNEL); + if (!network_info->ies) { + kfree(network_info); + return -ENOMEM; + } - index = MAC_HDR_LEN + TIME_STAMP_LEN; + network_info->ies_len = ies_len; - network_info->beacon_period = get_beacon_period(msa + index); + ssid_elm = cfg80211_find_ie(WLAN_EID_SSID, ies, ies_len); + if (ssid_elm) { + network_info->ssid_len = ssid_elm[1]; + if (network_info->ssid_len <= IEEE80211_MAX_SSID_LEN) + memcpy(network_info->ssid, ssid_elm + 2, + network_info->ssid_len); + else + network_info->ssid_len = 0; + } - index += BEACON_INTERVAL_LEN + CAP_INFO_LEN; + ch_elm = cfg80211_find_ie(WLAN_EID_DS_PARAMS, ies, ies_len); + if (ch_elm && ch_elm[1] > 0) + network_info->ch = ch_elm[2]; - tim_elm = get_tim_elm(msa, rx_len + FCS_LEN, index); - if (tim_elm) + tim_elm = cfg80211_find_ie(WLAN_EID_TIM, ies, ies_len); + if (tim_elm && tim_elm[1] >= 2) network_info->dtim_period = tim_elm[3]; - ies = &msa[TAG_PARAM_OFFSET]; - ies_len = rx_len - TAG_PARAM_OFFSET; - - if (ies_len > 0) { - network_info->ies = kmemdup(ies, ies_len, GFP_KERNEL); - if (!network_info->ies) { - kfree(network_info); - return -ENOMEM; - } - } - network_info->ies_len = ies_len; *ret_network_info = network_info; From patchwork Thu Nov 1 16:45:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10664251 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 75C3A1751 for ; Thu, 1 Nov 2018 16:45:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61A2F2C1DA for ; Thu, 1 Nov 2018 16:45:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 505682C1E4; Thu, 1 Nov 2018 16:45:17 +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 BA60A2C1DA for ; Thu, 1 Nov 2018 16:45:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726124AbeKBBs7 (ORCPT ); Thu, 1 Nov 2018 21:48:59 -0400 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:22172 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725992AbeKBBs6 (ORCPT ); Thu, 1 Nov 2018 21:48:58 -0400 X-IronPort-AV: E=Sophos;i="5.54,452,1534834800"; d="scan'208";a="19785001" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 01 Nov 2018 09:45:14 -0700 Received: from NAM02-CY1-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; Thu, 1 Nov 2018 09:45:13 -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=OvCRvykrNwBX/ZIdEejwFaOE3YrKTn+xHf72ftvNij4=; b=3YmZpiOVh+VV8iNay5UliQa6D/3LnL8tilcVif7chvAawxyY0gQj3AZgU5Kxhpn9yP+9ga1h2FQuxJPyoF5T8dUrCs3l2Ed9cGAJNE2E+bZEIVxV0Es4/EJqwevBVTN/nx79gn9ngpiTh48ZOP7uYqpZ1dJ8+6If2Ka+/gzi3tU= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB3463.namprd11.prod.outlook.com (20.177.187.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.26; Thu, 1 Nov 2018 16:45:08 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7%6]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 16:45:08 +0000 From: To: CC: , , , , , , Subject: [PATCH 2/8] staging: wilc1000: remove unused code in coreconfigurator Thread-Topic: [PATCH 2/8] staging: wilc1000: remove unused code in coreconfigurator Thread-Index: AQHUcgI/Twuk2wmbMEWdKuIkyuBZyw== Date: Thu, 1 Nov 2018 16:45:08 +0000 Message-ID: <1541090691-31928-3-git-send-email-ajay.kathat@microchip.com> References: <1541090691-31928-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1541090691-31928-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: SG2PR06CA0138.apcprd06.prod.outlook.com (2603:1096:1:1f::16) 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-originating-ip: [49.205.219.12] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB3463;6:S+B0nRPu42HlEf4qj5mZTYCKQZ/ySLlsDWTa3bjVKR86AyZz8ws+d+VInEPHSGZc/nRgeHZ4yFxVwI0jz+nDJs5byNLaeBD+Qhym+U5+vuiEa1JNVUqoC1UVlvtCGm1PAh9Le9BFb/PmzPmZfzCgNwQdQGPaUTOKZA7BwJyrViBXo3fces3bIbmdqOHOsuNK/+ydfxwRwggSGvlRs/X7CrediOoD/1Gwr7a89KiyyVRSkXPIYxYwLN/ImsPIJJ4wK69HTYG5s92GMvgZ83Igbr1kjFFerJyxO+THJ/eRU6TcD2OL/3LpnmhUdDAYaZ2UtwjoU/FbHKhN9mtkzI5k+T6craqlh31jePq8WJcFVzPR/jLltdLk3vLoh11NrLkQtzryU+zP9O6UYniStsVGVs8fbzWZ7PbOGBEk7ePXJP7xmHe4T0tNE9Yzn9gFk9dPkz4IoMKaBiyVojAmBMccKQ==;5:03S6Gb5K/ox29zQg+96wKyP1chHjfF5s5kDJRc9Pp20OiMfOHjsmpvIJle/3AN29Yr9ls6fuHF1T/IXamShAGl5VuzBVlubCSW709JzdhXhgNYt2il26PdtwRI21Uce5zTde22sLnA5NXaTr5Frbejjt1PpL5ouW9Xv6MQxT07k=;7:Oes2Rx72Xyb3zgEVPwoIhTxKjCusTYD6ifXnRvk4rHeWOn1dJ6g8A5EKHiB9f9ek2Rtorvr5+5bwRklI/TMs9H2OrTsvU6nDsz5NADViQo2ncinOVzt8eTB6vMtgIpQBsIg5ergVy0KTrBJOiGHi1g== x-ms-office365-filtering-correlation-id: aba20ca7-2b46-4b1e-24ab-08d6401961ae x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB3463; x-ms-traffictypediagnostic: BYAPR11MB3463: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3231382)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB3463;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB3463; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(376002)(39860400002)(346002)(136003)(396003)(199004)(189003)(71190400001)(4326008)(5660300001)(305945005)(2351001)(6512007)(25786009)(97736004)(68736007)(53936002)(2906002)(71200400001)(6116002)(6436002)(3846002)(6486002)(78486014)(106356001)(478600001)(256004)(76176011)(107886003)(5250100002)(105586002)(7736002)(2501003)(8676002)(72206003)(54906003)(81166006)(14454004)(81156014)(486006)(8936002)(86362001)(2900100001)(52116002)(476003)(316002)(386003)(6506007)(5640700003)(66066001)(2616005)(26005)(446003)(36756003)(102836004)(11346002)(99286004)(186003)(6916009);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB3463;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: eNtZUuM43W4FwMVQKgDsZLh9bZj6mLJgEovV+OCXgJz7rHXD7WLhH8MytaS0BsO+tgVzXzMCJDUobblURiDiH5RnNECo+HT8oazI2dsu+j03fHeGgCl+7vPDSzvJnOId1eq1Idf9wrmQDRc2XA5ZmltEQpm7CJAdzcUNVIN6HaXOTjRU6ZUnqigoI4fTWjJ8g/sWSReKX8EX3oC6mpDQkCWyWJ2o7wSZWaZYBozbYFmczzdzLeks3Vb2LFp9y/M0isRNGi/K1xD2q/D1sfV7LAsdrJ2J113i6CLjU2HeWs1ls1bx9xz3RI/YIMn99TjjmqZrJZj8HqRErA8vtf65qdB7P1SjC6IwT7f3czAcQJA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: aba20ca7-2b46-4b1e-24ab-08d6401961ae X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 16:45:08.1099 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3463 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 After refactoring of wilc_parse_network_info(), some of the functions and macro are not required, so removed the unused code. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/coreconfigurator.c | 157 ---------------------------- drivers/staging/wilc1000/coreconfigurator.h | 8 -- 2 files changed, 165 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 4dfa658..166443d 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -8,99 +8,6 @@ #include "coreconfigurator.h" -#define TAG_PARAM_OFFSET (MAC_HDR_LEN + TIME_STAMP_LEN + \ - BEACON_INTERVAL_LEN + CAP_INFO_LEN) - -enum sub_frame_type { - ASSOC_REQ = 0x00, - ASSOC_RSP = 0x10, - REASSOC_REQ = 0x20, - REASSOC_RSP = 0x30, - PROBE_REQ = 0x40, - PROBE_RSP = 0x50, - BEACON = 0x80, - ATIM = 0x90, - DISASOC = 0xA0, - AUTH = 0xB0, - DEAUTH = 0xC0, - ACTION = 0xD0, - PS_POLL = 0xA4, - RTS = 0xB4, - CTS = 0xC4, - ACK = 0xD4, - CFEND = 0xE4, - CFEND_ACK = 0xF4, - DATA = 0x08, - DATA_ACK = 0x18, - DATA_POLL = 0x28, - DATA_POLL_ACK = 0x38, - NULL_FRAME = 0x48, - CFACK = 0x58, - CFPOLL = 0x68, - CFPOLL_ACK = 0x78, - QOS_DATA = 0x88, - QOS_DATA_ACK = 0x98, - QOS_DATA_POLL = 0xA8, - QOS_DATA_POLL_ACK = 0xB8, - QOS_NULL_FRAME = 0xC8, - QOS_CFPOLL = 0xE8, - QOS_CFPOLL_ACK = 0xF8, - BLOCKACK_REQ = 0x84, - BLOCKACK = 0x94, - FRAME_SUBTYPE_FORCE_32BIT = 0xFFFFFFFF -}; - -static inline u16 get_beacon_period(u8 *data) -{ - u16 bcn_per; - - bcn_per = data[0]; - bcn_per |= (data[1] << 8); - - return bcn_per; -} - -static inline u32 get_beacon_timestamp_lo(u8 *data) -{ - u32 time_stamp = 0; - u32 index = MAC_HDR_LEN; - - time_stamp |= data[index++]; - time_stamp |= (data[index++] << 8); - time_stamp |= (data[index++] << 16); - time_stamp |= (data[index] << 24); - - return time_stamp; -} - -static inline u32 get_beacon_timestamp_hi(u8 *data) -{ - u32 time_stamp = 0; - u32 index = (MAC_HDR_LEN + 4); - - time_stamp |= data[index++]; - time_stamp |= (data[index++] << 8); - time_stamp |= (data[index++] << 16); - time_stamp |= (data[index] << 24); - - return time_stamp; -} - -static inline enum sub_frame_type get_sub_type(u8 *header) -{ - return ((enum sub_frame_type)(header[0] & 0xFC)); -} - -static inline u8 get_to_ds(u8 *header) -{ - return (header[1] & 0x01); -} - -static inline u8 get_from_ds(u8 *header) -{ - return ((header[1] & 0x02) >> 1); -} - static inline void get_address1(u8 *msa, u8 *addr) { memcpy(addr, msa + 4, 6); @@ -126,41 +33,6 @@ static inline void get_bssid(__le16 fc, u8 *data, u8 *bssid) get_address3(data, bssid); } -static inline void get_ssid(u8 *data, u8 *ssid, u8 *p_ssid_len) -{ - u8 i, j, len; - - len = data[TAG_PARAM_OFFSET + 1]; - j = TAG_PARAM_OFFSET + 2; - - if (len >= MAX_SSID_LEN) - len = 0; - - for (i = 0; i < len; i++, j++) - ssid[i] = data[j]; - - ssid[len] = '\0'; - - *p_ssid_len = len; -} - -static inline u16 get_cap_info(u8 *data) -{ - u16 cap_info = 0; - u16 index = MAC_HDR_LEN; - enum sub_frame_type st; - - st = get_sub_type(data); - - if (st == BEACON || st == PROBE_RSP) - index += TIME_STAMP_LEN + BEACON_INTERVAL_LEN; - - cap_info = data[index]; - cap_info |= (data[index + 1] << 8); - - return cap_info; -} - static inline u16 get_asoc_status(u8 *data) { u16 asoc_status; @@ -169,35 +41,6 @@ static inline u16 get_asoc_status(u8 *data) return (asoc_status << 8) | data[2]; } -static u8 *get_tim_elm(u8 *msa, u16 rx_len, u16 tag_param_offset) -{ - u16 index; - - index = tag_param_offset; - - while (index < (rx_len - FCS_LEN)) { - if (msa[index] == WLAN_EID_TIM) - return &msa[index]; - index += (IE_HDR_LEN + msa[index + 1]); - } - - return NULL; -} - -static u8 get_current_channel_802_11n(u8 *msa, u16 rx_len) -{ - u16 index; - - index = TAG_PARAM_OFFSET; - while (index < (rx_len - FCS_LEN)) { - if (msa[index] == WLAN_EID_DS_PARAMS) - return msa[index + 2]; - index += msa[index + 1] + IE_HDR_LEN; - } - - return 0; -} - s32 wilc_parse_network_info(u8 *msg_buffer, struct network_info **ret_network_info) { diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index b62acb4..0d40c77 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -11,14 +11,9 @@ #define NUM_RSSI 5 -#define MAC_HDR_LEN 24 -#define FCS_LEN 4 -#define TIME_STAMP_LEN 8 -#define BEACON_INTERVAL_LEN 2 #define CAP_INFO_LEN 2 #define STATUS_CODE_LEN 2 #define AID_LEN 2 -#define IE_HDR_LEN 2 #define SET_CFG 0 #define GET_CFG 1 @@ -26,9 +21,6 @@ #define MAX_STRING_LEN 256 #define MAX_ASSOC_RESP_FRAME_SIZE MAX_STRING_LEN -#define MAKE_WORD16(lsb, msb) ((((u16)(msb) << 8) & 0xFF00) | (lsb)) -#define MAKE_WORD32(lsw, msw) ((((u32)(msw) << 16) & 0xFFFF0000) | (lsw)) - struct rssi_history_buffer { bool full; u8 index; From patchwork Thu Nov 1 16:45:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10664253 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 D143C1751 for ; Thu, 1 Nov 2018 16:45:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C02D72C1DD for ; Thu, 1 Nov 2018 16:45:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4A912C1E4; Thu, 1 Nov 2018 16:45: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 E7CC02C1D7 for ; Thu, 1 Nov 2018 16:45:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726219AbeKBBs7 (ORCPT ); Thu, 1 Nov 2018 21:48:59 -0400 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:23507 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbeKBBs6 (ORCPT ); Thu, 1 Nov 2018 21:48:58 -0400 X-IronPort-AV: E=Sophos;i="5.54,452,1534834800"; d="scan'208";a="22518393" 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; 01 Nov 2018 09:45:14 -0700 Received: from NAM05-CO1-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; Thu, 1 Nov 2018 09:45:13 -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=M4ahWR0oTWmFX3Q1w8REDz7RGjjMiMQrDZGb+UACxg8=; b=PvnI5wJVYIgaaLlkL9qxaB2AC0iOmLDtIvQNfxIZ3IE/SsOkksAB0miiGJxgdoEOPrlJIyMmqq5KtrMUU0GQ1L4WZElr6zHpnf0nW9NEUJAMk8vBTDMy3RTtd/9b4FkWcRe1vXDXqmRUMLCMJDrTZ6ImX7E6l6DxnQENXMTijx8= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB3157.namprd11.prod.outlook.com (20.177.126.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.26; Thu, 1 Nov 2018 16:45:12 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7%6]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 16:45:12 +0000 From: To: CC: , , , , , , Subject: [PATCH 3/8] staging: wilc1000: refactor get_bssid() function Thread-Topic: [PATCH 3/8] staging: wilc1000: refactor get_bssid() function Thread-Index: AQHUcgJBTVV1S6Dic0ela26+KMVh9A== Date: Thu, 1 Nov 2018 16:45:11 +0000 Message-ID: <1541090691-31928-4-git-send-email-ajay.kathat@microchip.com> References: <1541090691-31928-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1541090691-31928-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: SG2PR06CA0138.apcprd06.prod.outlook.com (2603:1096:1:1f::16) 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-originating-ip: [49.205.219.12] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB3157;6:OPygXMqEsGvV0WKieyzIHqI2uSjKM/9GVScC7WJvdfefFhy6cM1eMSGBlE9pTQF4y8raU0gKbVFU50zCLDoQcLjMTAcvXKGn8qOEFy/3JAqy9VyNh4A7urorgey1dK1wKckBDNM35v3ZaWyR9Ww5vF0+cuWoToTjiam5ZUCFxB6io7H9brRC1XjMvpTzpzoW5T+c0k9CTIL1Rk3x2vOZv7zsJ1/cIDjlOV7slfZW6AfDilgX2kJzEFeIwFNQmnIjlR4oqiTRg245Hz0XDTIsnITo2WDz3SjJu+Pb2s5tEhOV4lEqaY/UdfqZb+/l5p4YPKcDHaWmIm4E1hk5PeON+uQzdu9BhcDUU5bC8MRdn/MQ/amH9V4Ky2HYfBxH8UQ7aaWZzrkdjGXCqvsDarZv6CHLCBcssSFbbKq4yENiOJai0zm5+uJ3DFID/hl5r4QwVbcFSBJtDTlLhKQDcQXCeg==;5:K0R8spka6I8YVrJUUjTdEPI6FzSn3mcWpbJaYkUzFMxFn0I6XDUbTh/byrftuBXIWm/JJ8mcz3BKQW7gG1/7QMhDt7NaZisowfnW0MSp2pwbholOxYMT1IeVQHkjJdU/Nn1swN1ZnXPocx66/ipM4rQgQ2lASesJfNeWi+6Pbd8=;7:LWvm1jsPNvgWx9YS0CB6J4K/oOiB0SWu1NuRkzH8dxj3PsX6gOlVoNi8pSfJnvO6YwtbMov106dmQTWVWbGsqaRA3MKFlKl8f8Zo0qBZtV/F3mQ1UdfIWsdJpjZTKScSgxf5J+z3qfzLaEp8ggua/A== x-ms-office365-filtering-correlation-id: 72fc9195-874c-4589-16cf-08d640196374 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB3157; x-ms-traffictypediagnostic: BYAPR11MB3157: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB3157;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB3157; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(346002)(366004)(39860400002)(136003)(376002)(199004)(189003)(6436002)(14454004)(26005)(71190400001)(68736007)(5660300001)(71200400001)(107886003)(2501003)(5250100002)(5640700003)(36756003)(102836004)(97736004)(53936002)(486006)(6512007)(6916009)(478600001)(2900100001)(2351001)(305945005)(476003)(76176011)(2906002)(86362001)(66066001)(11346002)(99286004)(2616005)(72206003)(256004)(52116002)(446003)(106356001)(105586002)(316002)(54906003)(6486002)(81156014)(8676002)(3846002)(81166006)(8936002)(186003)(25786009)(4326008)(6506007)(6116002)(386003)(7736002)(78486014);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB3157;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: OGN5S9e2tWj0B5d1LDxKl1T6Ku9U2V6kKcIk2PqG1zpixhtg2IMUpZRzrCUR+cKh/OBd73seM7QHXNV+d4lYCKw+2IPH6uzi+fVYrlsfYbmuuO2hVuLi3ZiIX4tQ1vxPNA98ZqMOb8hhwxTcF2ZOqrUv8tDuVCjzHpYIW3Y6HmyHN5Jg2ihurdPVnkfFzZnNV17bo+nPeT/kaO9vmrritbeTCwWKLpB1jNJl9ck2gVC0Hx+gmIAYyJ6bItP11KAP3uNh00fl7jkVLRaJTaSkhpiGgIkrSYHQLbfw1F5ySu9m50O8ke+PrdR9hBTe9j4qAhdNGwhEq02V1jUMsYc9XtkcsDpD0jGJsOn2eeaUtvQ= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 72fc9195-874c-4589-16cf-08d640196374 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 16:45:11.2300 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3157 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 get_bssid() by making use of 'ieee80211_mgmt' struct. Instead of passing the memory offset now using structure element to fetch the bssid information. Returning the pointer to bssid from get_bssid() instead of filing the input argument. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/coreconfigurator.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 166443d..ac44846 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -8,29 +8,14 @@ #include "coreconfigurator.h" -static inline void get_address1(u8 *msa, u8 *addr) +static inline u8 *get_bssid(struct ieee80211_mgmt *mgmt) { - memcpy(addr, msa + 4, 6); -} - -static inline void get_address2(u8 *msa, u8 *addr) -{ - memcpy(addr, msa + 10, 6); -} - -static inline void get_address3(u8 *msa, u8 *addr) -{ - memcpy(addr, msa + 16, 6); -} - -static inline void get_bssid(__le16 fc, u8 *data, u8 *bssid) -{ - if (ieee80211_has_fromds(fc)) - get_address2(data, bssid); - else if (ieee80211_has_tods(fc)) - get_address1(data, bssid); + if (ieee80211_has_fromds(mgmt->frame_control)) + return mgmt->sa; + else if (ieee80211_has_tods(mgmt->frame_control)) + return mgmt->da; else - get_address3(data, bssid); + return mgmt->bssid; } static inline u16 get_asoc_status(u8 *data) @@ -87,7 +72,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer, return -EIO; } - get_bssid(mgt->frame_control, msa, network_info->bssid); + ether_addr_copy(network_info->bssid, get_bssid(mgt)); ies = mgt->u.beacon.variable; ies_len = rx_len - offset; From patchwork Thu Nov 1 16:45:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10664255 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 F39D714E2 for ; Thu, 1 Nov 2018 16:45:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E19922C1D7 for ; Thu, 1 Nov 2018 16:45:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D57832C1DD; Thu, 1 Nov 2018 16:45: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 54A622C1DA for ; Thu, 1 Nov 2018 16:45:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726231AbeKBBtB (ORCPT ); Thu, 1 Nov 2018 21:49:01 -0400 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:19769 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbeKBBtB (ORCPT ); Thu, 1 Nov 2018 21:49:01 -0400 X-IronPort-AV: E=Sophos;i="5.54,452,1534834800"; d="scan'208";a="22208924" 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; 01 Nov 2018 09:45:16 -0700 Received: from NAM02-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; Thu, 1 Nov 2018 09:45:15 -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=gkfHw2s3HDgMDUaRGb619JU5KSTW83g/h5PUcfWsp8s=; b=w90z8I36Jl+ZTNNUQpMZvm3kkZgdwIU2KknSUqkw/R9W9SrxUiuBAuXtjQmGU6HJYqV0POea/j+wE+yYTpjd3WBsh/fLhEgGP2J/Iu2z5JYSpwiKgRREYjDJrOWiJbijSg2JfrWcztlddVpUB+hN+No9x8Gjf5Bk9aHLdMaEUsc= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB3286.namprd11.prod.outlook.com (20.177.185.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.21; Thu, 1 Nov 2018 16:45:14 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7%6]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 16:45:14 +0000 From: To: CC: , , , , , , Subject: [PATCH 4/8] staging: wilc1000: avoid line over 80 chars in wilc_parse_network_info() Thread-Topic: [PATCH 4/8] staging: wilc1000: avoid line over 80 chars in wilc_parse_network_info() Thread-Index: AQHUcgJD9vPPwH1+N0OaOZ3PcNN1Ig== Date: Thu, 1 Nov 2018 16:45:14 +0000 Message-ID: <1541090691-31928-5-git-send-email-ajay.kathat@microchip.com> References: <1541090691-31928-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1541090691-31928-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: SG2PR06CA0138.apcprd06.prod.outlook.com (2603:1096:1:1f::16) 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-originating-ip: [49.205.219.12] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB3286;6:619ids8eDRT36dCY19A/FdpxelqAp5kYcapmDFB7FFl9UKG1S+Au8IsRZxLoQvC4QKXtS+HHejVVM1HZNZt/o9U0YZAYSR2kNt68bvm7Z4aSOwNA+YLTPj17oBD/23qP9ft7nWrOeY2dK+x76r5Pj9Q1hqG0KLQ/Jxsq2ry9wJsuYDCGqP0LrwZnwbnWzYFiZW+VHcV3u1nfGyJXtDUSURbLqN5TWf11qy4GblnnedbGK6itcaR/dbRLKZQOFZXgec4c1uT36UmyPoPy7KjVgged39UrKJOipzC0Zw4mc7yDZAbE3olxzIq0LFdp6xQMdEOGutEUGa+EIB9P9H/wxXrKri2rjZYvc25fLVf1gJi8fyZ4GN7Zjwt0m/2QiXc/Og8thOWHBjRq4W1KdfZwtnaXcuPg11EMQhiw1SNrClfhDgrI6xPN/zw12EC/52W8GdszcUrUcG2Y2awwC/I6oQ==;5:Mo6aS7swbeLVLVL3c+XDIiMGMWqagYzmEnxGVGOwiQsmK+q8EYAGJ1dQorIcSGiZfqAba+NaPLntVVrVe3rDpTyhvB094zOMpeW8QD864ThPr8Qm7CfV+jWZ/sU8c/e6DTwcL21b2BGxFJsQAWt5u4580nCd9eskSvuG8aMObI8=;7:hNKVahsXIYi9o2n7IW5gdBnFdNPxoRpwjqKVrVuEzmr9cnkW0CNeutHuhW0sDLZRQ4XfopVQmtX5jQ5OrjIiDqGI3yko8RrIUKGQmM4fyTSbq9E3fl3gA2PEDCsT15tPxOEd/xmY1VlDlsCbl8bDpw== x-ms-office365-filtering-correlation-id: 993b4b3f-6671-4212-6b56-08d640196558 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB3286; x-ms-traffictypediagnostic: BYAPR11MB3286: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3231382)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB3286;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB3286; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(376002)(346002)(136003)(39860400002)(396003)(199004)(189003)(105586002)(102836004)(2900100001)(5660300001)(106356001)(6916009)(4326008)(186003)(26005)(78486014)(2906002)(476003)(446003)(305945005)(6506007)(14454004)(386003)(486006)(2616005)(7736002)(11346002)(86362001)(3846002)(6116002)(256004)(52116002)(8936002)(76176011)(478600001)(81156014)(8676002)(71200400001)(68736007)(71190400001)(72206003)(54906003)(316002)(25786009)(99286004)(81166006)(107886003)(66066001)(5250100002)(2501003)(5640700003)(53936002)(6512007)(6436002)(36756003)(6486002)(97736004)(2351001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB3286;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: w+gpXEAhIiZlLgWfMM63mFany5cRSF0qdYVAsraiCA5eW5UHVkYK7FyxpthMZ2TVuxjS8k5W5mEwOCenLDcagD6Z7W6ixoLK1ljkhrOdPqKzsSrbGAOtinkvUhgF8NsYlXa9EWqkhi9t0uIPlErHBe4iLr1zE/oo7Kql2FX7PLj6DeIk1lM1VoTOFrNmSyytXLUQkdjCTEvhxfHxjrbkZByP492m+tX6ssRQCSvEcjIoBLIN9AWIWMSxCaOD1gSvbC+H06IvpA9kK2b630bYICGMzJpafV/QQ7vdaRvpp9Uwg4GOS1eNrFLpE11OENZbsCdF53RFbPrzjD+wDedHhmGRPLQzO4v1vxIXkTeMWTo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 993b4b3f-6671-4212-6b56-08d640196558 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 16:45:14.2039 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3286 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 shorter name for 'network_info' variable to avoid line over 80 chars issue. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/coreconfigurator.c | 53 ++++++++++++++--------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index ac44846..2c77e5a 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -29,7 +29,7 @@ static inline u16 get_asoc_status(u8 *data) s32 wilc_parse_network_info(u8 *msg_buffer, struct network_info **ret_network_info) { - struct network_info *network_info; + struct network_info *info; struct ieee80211_mgmt *mgt; u8 *wid_val, *msa, *ies; u16 wid_len, rx_len, ies_len; @@ -44,70 +44,69 @@ s32 wilc_parse_network_info(u8 *msg_buffer, wid_len = get_unaligned_le16(&msg_buffer[6]); wid_val = &msg_buffer[8]; - network_info = kzalloc(sizeof(*network_info), GFP_KERNEL); - if (!network_info) + info = kzalloc(sizeof(*info), GFP_KERNEL); + if (!info) return -ENOMEM; - network_info->rssi = wid_val[0]; + info->rssi = wid_val[0]; msa = &wid_val[1]; mgt = (struct ieee80211_mgmt *)&wid_val[1]; rx_len = wid_len - 1; if (ieee80211_is_probe_resp(mgt->frame_control)) { - network_info->cap_info = le16_to_cpu(mgt->u.probe_resp.capab_info); - network_info->beacon_period = le16_to_cpu(mgt->u.probe_resp.beacon_int); - network_info->tsf_hi = le64_to_cpu(mgt->u.probe_resp.timestamp); - network_info->tsf_lo = (u32)network_info->tsf_hi; + info->cap_info = le16_to_cpu(mgt->u.probe_resp.capab_info); + info->beacon_period = le16_to_cpu(mgt->u.probe_resp.beacon_int); + info->tsf_hi = le64_to_cpu(mgt->u.probe_resp.timestamp); + info->tsf_lo = (u32)info->tsf_hi; offset = offsetof(struct ieee80211_mgmt, u.probe_resp.variable); } else if (ieee80211_is_beacon(mgt->frame_control)) { - network_info->cap_info = le16_to_cpu(mgt->u.beacon.capab_info); - network_info->beacon_period = le16_to_cpu(mgt->u.beacon.beacon_int); - network_info->tsf_hi = le64_to_cpu(mgt->u.beacon.timestamp); - network_info->tsf_lo = (u32)network_info->tsf_hi; + info->cap_info = le16_to_cpu(mgt->u.beacon.capab_info); + info->beacon_period = le16_to_cpu(mgt->u.beacon.beacon_int); + info->tsf_hi = le64_to_cpu(mgt->u.beacon.timestamp); + info->tsf_lo = (u32)info->tsf_hi; offset = offsetof(struct ieee80211_mgmt, u.beacon.variable); } else { /* only process probe response and beacon frame */ - kfree(network_info); + kfree(info); return -EIO; } - ether_addr_copy(network_info->bssid, get_bssid(mgt)); + ether_addr_copy(info->bssid, get_bssid(mgt)); ies = mgt->u.beacon.variable; ies_len = rx_len - offset; if (ies_len <= 0) { - kfree(network_info); + kfree(info); return -EIO; } - network_info->ies = kmemdup(ies, ies_len, GFP_KERNEL); - if (!network_info->ies) { - kfree(network_info); + info->ies = kmemdup(ies, ies_len, GFP_KERNEL); + if (!info->ies) { + kfree(info); return -ENOMEM; } - network_info->ies_len = ies_len; + info->ies_len = ies_len; ssid_elm = cfg80211_find_ie(WLAN_EID_SSID, ies, ies_len); if (ssid_elm) { - network_info->ssid_len = ssid_elm[1]; - if (network_info->ssid_len <= IEEE80211_MAX_SSID_LEN) - memcpy(network_info->ssid, ssid_elm + 2, - network_info->ssid_len); + info->ssid_len = ssid_elm[1]; + if (info->ssid_len <= IEEE80211_MAX_SSID_LEN) + memcpy(info->ssid, ssid_elm + 2, info->ssid_len); else - network_info->ssid_len = 0; + info->ssid_len = 0; } ch_elm = cfg80211_find_ie(WLAN_EID_DS_PARAMS, ies, ies_len); if (ch_elm && ch_elm[1] > 0) - network_info->ch = ch_elm[2]; + info->ch = ch_elm[2]; tim_elm = cfg80211_find_ie(WLAN_EID_TIM, ies, ies_len); if (tim_elm && tim_elm[1] >= 2) - network_info->dtim_period = tim_elm[3]; + info->dtim_period = tim_elm[3]; - *ret_network_info = network_info; + *ret_network_info = info; return 0; } From patchwork Thu Nov 1 16:45:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10664257 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 758EB1751 for ; Thu, 1 Nov 2018 16:45:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 630532C1D7 for ; Thu, 1 Nov 2018 16:45:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 579B02C1DD; Thu, 1 Nov 2018 16:45:21 +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 E194D2C1D7 for ; Thu, 1 Nov 2018 16:45:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726257AbeKBBtE (ORCPT ); Thu, 1 Nov 2018 21:49:04 -0400 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:19769 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbeKBBtD (ORCPT ); Thu, 1 Nov 2018 21:49:03 -0400 X-IronPort-AV: E=Sophos;i="5.54,452,1534834800"; d="scan'208";a="22208926" 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; 01 Nov 2018 09:45:18 -0700 Received: from NAM05-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; Thu, 1 Nov 2018 09:45:18 -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=eefh+zwZpaJLvk//k7a5ZFH5GL8tPXx1xsCoJgURr7o=; b=rlgB+5FAlFUGXy8w0d2b5BBhBmjYwSDmGdtiIR9YJcmq6MJbN5+0Bl5p01CNCEm0WqnllCd+RJafq6patfw69xULoYX/9a+8x4Q19tt6iOuuZAN3mWBg5jGwE6FAYhkEW4Di/HC/g+6ub0aArH27qNY2qhGpsbYVxp7QkspHhS0= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2582.namprd11.prod.outlook.com (52.135.227.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.24; Thu, 1 Nov 2018 16:45:17 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7%6]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 16:45:17 +0000 From: To: CC: , , , , , , Subject: [PATCH 5/8] staging: wilc1000: refactor wilc_parse_assoc_resp_info() Thread-Topic: [PATCH 5/8] staging: wilc1000: refactor wilc_parse_assoc_resp_info() Thread-Index: AQHUcgJE/ENI2Pb1Z0W0rDNFVbNqvA== Date: Thu, 1 Nov 2018 16:45:17 +0000 Message-ID: <1541090691-31928-6-git-send-email-ajay.kathat@microchip.com> References: <1541090691-31928-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1541090691-31928-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: SG2PR06CA0138.apcprd06.prod.outlook.com (2603:1096:1:1f::16) 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-originating-ip: [49.205.219.12] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2582;6:WlXfGMErROiRYpcXXhv0P+4DLIE2IPLoTyz6sAV9HWLXX21P3ZPdq15xh+LrjvUnlXXTVXprpIJ9cPqoUJlAXJWlDL93TEYW1cLclCH5t5fwhAFQuGGF2GnJ/Men+WSK4iMUn9RpfIm+Lagka5gvW9Zdv/tnPJ3h3qoJ9jQLvBPJly09CtL9yKMgMed0uJZpqY4k4ZNw2qj2lRbtK558nZXrnb1dsEoVmj+/S9MkK5Zk6QseleiyNgIiGhEUV73ikG3FjD5sEXIf1HGm1kosQWDYk+4Nml2simsRAOhD/7Ze6qEcZkObanUoz8VkOy7bseYkK4Gk+qbAfNOBM6n8LwLosH1Xu+XPvrzgW+Fnm1pUQIKBT18PcNFbn/meS0HeKb97OgQZzfVs8nME6XGBy/sZIL3kr+pjgtSER2U3DCgVvSkqVYfq+dbBTUGuoHVDXWTM/Fx474212lgNBzV6Hw==;5:ukqoWBsGHF4UHQ7FusZEgd+JsnJP8q2TFpdsJowi4xOCv2GfiATLCyUdXLDDfdbK6AZoEzGkPtUb8LCgWtMblqIxZhBhHuklNGieCDhtB0g8pOAxVpKQCHkJF68dHX78VGToiIDaMdMSVm6dKzB8x+aktlOtt2HTuKFI4cQACgE=;7:qONH0xHca7GUe0ycpW0fmUm1WsTlmgYtfM2hed9qN9+y6h7ZTLhs+7lDD1ebyNsCHss8JO7mCcS+nbwy3yrZxDItf4RxsgeFx49P+1aHf2xQljzze7I8gqJphtH7/8UAM+4Mx99SdaH+oxdO5WLffw== x-ms-office365-filtering-correlation-id: 299a9401-74e5-49a2-e5da-08d640196714 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2582; x-ms-traffictypediagnostic: BYAPR11MB2582: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB2582;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB2582; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(376002)(346002)(366004)(39860400002)(199004)(189003)(68736007)(6916009)(8936002)(7736002)(2906002)(81166006)(81156014)(186003)(3846002)(6116002)(4326008)(5660300001)(54906003)(26005)(316002)(86362001)(2900100001)(476003)(36756003)(107886003)(25786009)(446003)(11346002)(66066001)(486006)(8676002)(305945005)(78486014)(5250100002)(2616005)(386003)(6506007)(102836004)(2351001)(53936002)(97736004)(72206003)(14454004)(478600001)(6486002)(71200400001)(71190400001)(6436002)(52116002)(106356001)(105586002)(5640700003)(256004)(76176011)(6512007)(99286004)(2501003);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2582;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: nNkgOW5Cal022HPDbkZrlJzlcjJWjMBtcJOU/DFOfz9T3RK0cE46FA2XTCy1v+VoQp+oTS0owdDPqPYYKi+lpLjIK7Xx1603nRVHJ32c60l9E2epnbvRGjZbBx44jA5Hf797WDCy7/aX6zHuxQ4bHPWJGINc0nTG0A/UBEeMRIJr9lWN5ZdaRWgIOpkwraRK0cC4u1zYcOJPDpxzFiuPhv+RvalhBfXlZxFSBBhj2kbqzlDC66EWCzDAnWk1Xuvj4VVAceIil5/FAhjxiST5rVK+UnAVYH7+nmNVTTdVPZFxyNoZTazyV9exttbBwBN9uyjH4VNUaxm/uGrJUt8O5+alyF6NLoc7hXhZYVqETK0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 299a9401-74e5-49a2-e5da-08d640196714 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 16:45:17.0779 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2582 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 wilc_parse_assoc_resp_info() function by removing the use of get_asoc_status() API. For parsing assoc response use the struct and avoided the use of offset macros to extract the ies information. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/coreconfigurator.c | 16 ++++------------ drivers/staging/wilc1000/coreconfigurator.h | 10 ++++++---- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 2c77e5a..2bd62fd 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -18,14 +18,6 @@ static inline u8 *get_bssid(struct ieee80211_mgmt *mgmt) return mgmt->bssid; } -static inline u16 get_asoc_status(u8 *data) -{ - u16 asoc_status; - - asoc_status = data[3]; - return (asoc_status << 8) | data[2]; -} - s32 wilc_parse_network_info(u8 *msg_buffer, struct network_info **ret_network_info) { @@ -116,12 +108,12 @@ s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len, { u8 *ies; u16 ies_len; + struct assoc_resp *res = (struct assoc_resp *)buffer; - ret_conn_info->status = get_asoc_status(buffer); + ret_conn_info->status = le16_to_cpu(res->status_code); if (ret_conn_info->status == WLAN_STATUS_SUCCESS) { - ies = &buffer[CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN]; - ies_len = buffer_len - (CAP_INFO_LEN + STATUS_CODE_LEN + - AID_LEN); + ies = &buffer[sizeof(*res)]; + ies_len = buffer_len - sizeof(*res); ret_conn_info->resp_ies = kmemdup(ies, ies_len, GFP_KERNEL); if (!ret_conn_info->resp_ies) diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 0d40c77..71a9f27 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -11,10 +11,6 @@ #define NUM_RSSI 5 -#define CAP_INFO_LEN 2 -#define STATUS_CODE_LEN 2 -#define AID_LEN 2 - #define SET_CFG 0 #define GET_CFG 1 @@ -63,6 +59,12 @@ struct disconnect_info { size_t ie_len; }; +struct assoc_resp { + __le16 capab_info; + __le16 status_code; + __le16 aid; +} __packed; + s32 wilc_parse_network_info(u8 *msg_buffer, struct network_info **ret_network_info); s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len, From patchwork Thu Nov 1 16:45:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10664259 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 13E9A1751 for ; Thu, 1 Nov 2018 16:45:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 032BC2C1D7 for ; Thu, 1 Nov 2018 16:45:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB2BB2C1DD; Thu, 1 Nov 2018 16:45:23 +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 899642C1D7 for ; Thu, 1 Nov 2018 16:45:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726292AbeKBBtG (ORCPT ); Thu, 1 Nov 2018 21:49:06 -0400 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:22178 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726115AbeKBBtG (ORCPT ); Thu, 1 Nov 2018 21:49:06 -0400 X-IronPort-AV: E=Sophos;i="5.54,452,1534834800"; d="scan'208";a="19785005" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 01 Nov 2018 09:45:22 -0700 Received: from NAM05-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; Thu, 1 Nov 2018 09:45:21 -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=tvwY2TF2xBuIx/3ncGO5v2vJYnDp27xwIM1PwFfXb0M=; b=vEbOvElL19Qb9xqL/K40Y2cYJO6UiDnH5a/Xf/4BI6vHRzk1cEQFkW4N/GDmCfE1xeiwMY2iTMNfxmlkUzohYoTzJet60vbUAk5aqyqOCOePTb0OGszmFtym9aw9AeZOp2usCDt71I1yMwdErG4Z+pnSQJPH7KOcOEiF9N+zqKU= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2582.namprd11.prod.outlook.com (52.135.227.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.24; Thu, 1 Nov 2018 16:45:20 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7%6]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 16:45:20 +0000 From: To: CC: , , , , , , Subject: [PATCH 6/8] staging: wilc1000: remove unnecessary MAX_STRING_LEN macro Thread-Topic: [PATCH 6/8] staging: wilc1000: remove unnecessary MAX_STRING_LEN macro Thread-Index: AQHUcgJGupyF8amde0qk/GtebEujZQ== Date: Thu, 1 Nov 2018 16:45:20 +0000 Message-ID: <1541090691-31928-7-git-send-email-ajay.kathat@microchip.com> References: <1541090691-31928-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1541090691-31928-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: SG2PR06CA0138.apcprd06.prod.outlook.com (2603:1096:1:1f::16) 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-originating-ip: [49.205.219.12] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2582;6:2SXgEVLx9XmfgfLHcHh7GJtrHQE7S3GeaBDqi/jjqyLqXeidjwrKBrAyKZvsu6YQgJ5lEf/eCZt0k7rpiZHfzP47Q7UNl+U4hbSAI/RaHSW8vG+NIV8xsGHCjSbcGfCdUo+cqCHH+TuNz56GRpl0QEy28YvNL0U4RCeMDUwI6M65ZYhUetYGIs9O67E3PlUsqbgdkoBtMmzH/7DGXlzPnnj6+qGelL/eef2r+YgqpOo7cghW2PYiq4v5eI0Bh1biSSvx1LmrwguUGrO3OfowpXWO6jWPffZ/n6FDePvEwsD8zZ0fiqaY50wgsfV4LE8VgMJwkqu7F5Y09ZuzzJYgPGkXOMfOppaH4vcK/wYXACVDB9dKO1tAOZ3wVO1KZlXitU+nfDLzp48wg0mpNKS/r8ip2Q1N3XaU3VbxnlMM0d6zVZiyE/NPQr1uv7Fsw1GO5F3rzAVLY3kwrMOeGeMcpw==;5:AhREf/e/WEKU1js93Q2gfsdzpYWzpqz8iqzLT2+LtUJ9st/k/TbfblImZEKrxDZBqK8zfGxhnBMYbRCaBJU9Gd/Cq3R12r+M2VoxEbGR6WcQVD7Cmwfr7TqA9SHrpJf54UXHDwO9pWXVdu6Aih8n0Vsa/O8R7XFGXIlCAO11roA=;7:806BLfudMS9mq8ug1fGgBbe2Iq5Kor6fIMwglXXymlI+z3FVdX93m6egOvb8F6FWxFTthEApMxo7ayNlQMMDi5MM/tX0/yRYcc1KhkRnWY7I4Kj8BYU/EKuYpDjVt4eFxLVg4jjiW0m7huydsU3Kuw== x-ms-office365-filtering-correlation-id: 36d198d1-27ca-4140-c411-08d6401968d0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2582; x-ms-traffictypediagnostic: BYAPR11MB2582: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB2582;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB2582; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(376002)(346002)(366004)(39860400002)(199004)(189003)(68736007)(6916009)(8936002)(7736002)(2906002)(81166006)(81156014)(186003)(3846002)(6116002)(4326008)(5660300001)(54906003)(26005)(316002)(86362001)(2900100001)(476003)(36756003)(107886003)(25786009)(446003)(11346002)(66066001)(486006)(8676002)(305945005)(78486014)(5250100002)(2616005)(386003)(6506007)(102836004)(2351001)(53936002)(97736004)(72206003)(14454004)(478600001)(6486002)(71200400001)(71190400001)(6436002)(52116002)(106356001)(105586002)(5640700003)(256004)(76176011)(6512007)(99286004)(2501003);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2582;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: MmWO72h3xJrOHmYFUVfJGmBAMlr1zTfQVY1Tnphq3VmwnXLojc0+UodOtyR9bpovMn04gSAjQW6K2VD6dRMWkZh5VI5035OunS3/jeHKbZ2qOgSOhQvIzrq/g/E94xmhmWTAma726+UkSDXrNpZNgYz4Kn1oGFPsg4r+MJ5lF/M371/2qKAyIWRSQbeLsshGooMbMHg6T336pZs1rd07U4eAqFRhiK3feDQA9eT2l2lCgaCjofZjKqMQNfWTTwFcduPybYb4OAgnY7pBoqs10DEWooNNh6AbdwDchvEMsGebwKU2G1AfpkJagfKqZXGNdEulsO/IA/skZAqP0DefZgEW8OLJtSKdEFwORw+8s8w= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 36d198d1-27ca-4140-c411-08d6401968d0 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 16:45:20.1739 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2582 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 Cleanup patch to remove the use of unnecessary 'MAX_STRING_LEN' macro. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/coreconfigurator.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 71a9f27..a1347f7 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -14,8 +14,7 @@ #define SET_CFG 0 #define GET_CFG 1 -#define MAX_STRING_LEN 256 -#define MAX_ASSOC_RESP_FRAME_SIZE MAX_STRING_LEN +#define MAX_ASSOC_RESP_FRAME_SIZE 256 struct rssi_history_buffer { bool full; From patchwork Thu Nov 1 16:45:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10664261 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 EE43F14E2 for ; Thu, 1 Nov 2018 16:45:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBBF72C1DD for ; Thu, 1 Nov 2018 16:45:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC34E2C1DA; Thu, 1 Nov 2018 16:45: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 02CD82C1DA for ; Thu, 1 Nov 2018 16:45:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726283AbeKBBtL (ORCPT ); Thu, 1 Nov 2018 21:49:11 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:5864 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbeKBBtL (ORCPT ); Thu, 1 Nov 2018 21:49:11 -0400 X-IronPort-AV: E=Sophos;i="5.54,452,1534834800"; d="scan'208";a="23460615" 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; 01 Nov 2018 09:45:24 -0700 Received: from NAM03-BY2-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; Thu, 1 Nov 2018 09:45: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=PHJLJ5q3ON5iKUPEIynbvGz8/fjxzUEjSDVekuUlQkY=; b=0zW7jlPk4y+GlAzvJB9VHA691fhHDzpQoV2AtKnSZnIzs66XoUkiwr7+LtW9bzHWR7caUe/wMyvXoC4ikFJEwgPnLc7LXFByjKeqkjNmSdnVNBDB/MHV6i4+K899Cc/FezwqzM91boXglaxQk7OSlk2dcBeMtvjeyMZl/FT0ceU= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB3286.namprd11.prod.outlook.com (20.177.185.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.21; Thu, 1 Nov 2018 16:45:23 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7%6]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 16:45:23 +0000 From: To: CC: , , , , , , Subject: [PATCH 7/8] staging: wilc1000: remove coreconfigurator.c file Thread-Topic: [PATCH 7/8] staging: wilc1000: remove coreconfigurator.c file Thread-Index: AQHUcgJI+n1jXNCkK0+aLkIKHXw5oA== Date: Thu, 1 Nov 2018 16:45:23 +0000 Message-ID: <1541090691-31928-8-git-send-email-ajay.kathat@microchip.com> References: <1541090691-31928-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1541090691-31928-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: SG2PR06CA0138.apcprd06.prod.outlook.com (2603:1096:1:1f::16) 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-originating-ip: [49.205.219.12] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB3286;6:Wp+TXIRLybuoimMW1IzdXAHsW2XlI+DeVzqULLSL5DMHu6whn1mbgvTD1O/OCE7/KWG/Hl2P+i3JP6YSCKtvLEJePhLM/vSRB1GhP68oBrgsH+oqHSYgJ+4rRjKolq9vwBCWn+Qko6jO8rBaCUpVEQfhQa7BOf7ElBUEmqGD9fwVgAhS/IVi5cDvbLYijdNgeReRtx4P9An1hSlWmdEEIWa4gPf2hBR5Qa3pV9a/QJLq4L1vIj10gFGdLSpoS4HD/NFAYIb/gcbgbIg9BuGa267yrzQAu9DNDqtLb8Z9HlweZsTE05l4UNrE1ZpLXtKiC+gle3IKcIZm3mqBmUdWNXovNkiDbAFuGT4ZJnAGs339QZTjuJPDcRwIMT1toKq+V9L/vez8uhTC9WSq86OpiIn3XnSgYe9nd2PJnXLPstrzvbj0sdBbtVCCE9wroNfAiX1ydTgeHovpLRrMJWVraQ==;5:vrkW4S2HOx4B+5VotTuYd/uAtOMnqBZ5YhM2ALremNdsGjyffBofXO6Pwj0TZ9cacOqC/QPrd5MUXhp4WmGq7soUOXizQTDSAGtwLJHCJY/5ZNK8IiJq4xPF5BFuJmIpyXk0oBoXke+zVJFbrhEuYIR5VpxexVJY9h5WAFabMyA=;7:gP/dzqEdEJ0E6VG0HSf7Gh9OfWAc81VzD6ENglUtRNg/K7VOyWVuBLpJeLa9dVHD7Gjj/OqgudC7+av3wlcgOPJIMI+60SOHGyL7rTUeGRA7e67dB2p9YApAZv4HMPrVg8AqZs2OSMGnt4zNNJI66A== x-ms-office365-filtering-correlation-id: d3ce6bcc-9487-4952-740c-08d640196aa4 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB3286; x-ms-traffictypediagnostic: BYAPR11MB3286: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(21532816269658); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3231382)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB3286;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB3286; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(376002)(346002)(136003)(39860400002)(396003)(199004)(189003)(105586002)(102836004)(2900100001)(5660300001)(106356001)(6916009)(4326008)(186003)(26005)(14444005)(78486014)(2906002)(476003)(446003)(305945005)(6506007)(14454004)(386003)(486006)(2616005)(7736002)(11346002)(86362001)(3846002)(6116002)(256004)(52116002)(8936002)(76176011)(478600001)(81156014)(8676002)(71200400001)(68736007)(71190400001)(72206003)(54906003)(316002)(25786009)(99286004)(81166006)(107886003)(66066001)(5250100002)(2501003)(5640700003)(53936002)(6512007)(6436002)(36756003)(6486002)(97736004)(2351001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB3286;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: diRGW/7ZLJxqSudFNDlk2sKRwqIoZ8twPL0DyIs1zXWftT4YSqVm9qiCKyU+1noWszzUjP0SLTGa6SaTrkfXM33HyJO0r1PBQ/Nwyvgw/OjjEN7ZV9h9IInErOLshUiHl79wIeKMY/ww+UK6STTofptRg0T+CdHG4QzTSrvn+Ddl1XWzcc28OXWK5YcFVAXHRwraSw4ZTpIPkCFjIJk4RAu3Qk4NSKiyE5orzAnTWFgCaMzD70qBHjwz37bN17oKk/IZi3ByWg3b2u9EuZVu8FTR8OWMTIr2l/1+52jLFtfCmJllugOCPN6r8PWpViGvzmKnGfUk8vYa4KGpQEakV82LN6EZd4R9OfOJLCIlcF4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d3ce6bcc-9487-4952-740c-08d640196aa4 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 16:45:23.1029 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3286 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 After use of framework API's most of the redundant functions are removed in coreconfigurator.c file. Now moved left over function to host_interface file and deleted the coreconfigurator.c file. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/Makefile | 3 +- drivers/staging/wilc1000/coreconfigurator.c | 126 ---------------------------- drivers/staging/wilc1000/coreconfigurator.h | 4 - drivers/staging/wilc1000/host_interface.c | 117 ++++++++++++++++++++++++++ 4 files changed, 118 insertions(+), 132 deletions(-) delete mode 100644 drivers/staging/wilc1000/coreconfigurator.c diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile index 37e8560..72a4daa 100644 --- a/drivers/staging/wilc1000/Makefile +++ b/drivers/staging/wilc1000/Makefile @@ -5,8 +5,7 @@ ccflags-y += -DFIRMWARE_1002=\"atmel/wilc1002_firmware.bin\" \ -DFIRMWARE_1003=\"atmel/wilc1003_firmware.bin\" wilc1000-objs := wilc_wfi_cfgoperations.o linux_wlan.o linux_mon.o \ - coreconfigurator.o host_interface.o \ - wilc_wlan_cfg.o wilc_wlan.o + host_interface.o wilc_wlan_cfg.o wilc_wlan.o obj-$(CONFIG_WILC1000_SDIO) += wilc1000-sdio.o wilc1000-sdio-objs += wilc_sdio.o diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c deleted file mode 100644 index 2bd62fd..0000000 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ /dev/null @@ -1,126 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries. - * All rights reserved. - */ - -#include - -#include "coreconfigurator.h" - -static inline u8 *get_bssid(struct ieee80211_mgmt *mgmt) -{ - if (ieee80211_has_fromds(mgmt->frame_control)) - return mgmt->sa; - else if (ieee80211_has_tods(mgmt->frame_control)) - return mgmt->da; - else - return mgmt->bssid; -} - -s32 wilc_parse_network_info(u8 *msg_buffer, - struct network_info **ret_network_info) -{ - struct network_info *info; - struct ieee80211_mgmt *mgt; - u8 *wid_val, *msa, *ies; - u16 wid_len, rx_len, ies_len; - u8 msg_type; - size_t offset; - const u8 *ch_elm, *tim_elm, *ssid_elm; - - msg_type = msg_buffer[0]; - if ('N' != msg_type) - return -EFAULT; - - wid_len = get_unaligned_le16(&msg_buffer[6]); - wid_val = &msg_buffer[8]; - - info = kzalloc(sizeof(*info), GFP_KERNEL); - if (!info) - return -ENOMEM; - - info->rssi = wid_val[0]; - - msa = &wid_val[1]; - mgt = (struct ieee80211_mgmt *)&wid_val[1]; - rx_len = wid_len - 1; - - if (ieee80211_is_probe_resp(mgt->frame_control)) { - info->cap_info = le16_to_cpu(mgt->u.probe_resp.capab_info); - info->beacon_period = le16_to_cpu(mgt->u.probe_resp.beacon_int); - info->tsf_hi = le64_to_cpu(mgt->u.probe_resp.timestamp); - info->tsf_lo = (u32)info->tsf_hi; - offset = offsetof(struct ieee80211_mgmt, u.probe_resp.variable); - } else if (ieee80211_is_beacon(mgt->frame_control)) { - info->cap_info = le16_to_cpu(mgt->u.beacon.capab_info); - info->beacon_period = le16_to_cpu(mgt->u.beacon.beacon_int); - info->tsf_hi = le64_to_cpu(mgt->u.beacon.timestamp); - info->tsf_lo = (u32)info->tsf_hi; - offset = offsetof(struct ieee80211_mgmt, u.beacon.variable); - } else { - /* only process probe response and beacon frame */ - kfree(info); - return -EIO; - } - - ether_addr_copy(info->bssid, get_bssid(mgt)); - - ies = mgt->u.beacon.variable; - ies_len = rx_len - offset; - if (ies_len <= 0) { - kfree(info); - return -EIO; - } - - info->ies = kmemdup(ies, ies_len, GFP_KERNEL); - if (!info->ies) { - kfree(info); - return -ENOMEM; - } - - info->ies_len = ies_len; - - ssid_elm = cfg80211_find_ie(WLAN_EID_SSID, ies, ies_len); - if (ssid_elm) { - info->ssid_len = ssid_elm[1]; - if (info->ssid_len <= IEEE80211_MAX_SSID_LEN) - memcpy(info->ssid, ssid_elm + 2, info->ssid_len); - else - info->ssid_len = 0; - } - - ch_elm = cfg80211_find_ie(WLAN_EID_DS_PARAMS, ies, ies_len); - if (ch_elm && ch_elm[1] > 0) - info->ch = ch_elm[2]; - - tim_elm = cfg80211_find_ie(WLAN_EID_TIM, ies, ies_len); - if (tim_elm && tim_elm[1] >= 2) - info->dtim_period = tim_elm[3]; - - *ret_network_info = info; - - return 0; -} - -s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len, - struct connect_info *ret_conn_info) -{ - u8 *ies; - u16 ies_len; - struct assoc_resp *res = (struct assoc_resp *)buffer; - - ret_conn_info->status = le16_to_cpu(res->status_code); - if (ret_conn_info->status == WLAN_STATUS_SUCCESS) { - ies = &buffer[sizeof(*res)]; - ies_len = buffer_len - sizeof(*res); - - ret_conn_info->resp_ies = kmemdup(ies, ies_len, GFP_KERNEL); - if (!ret_conn_info->resp_ies) - return -ENOMEM; - - ret_conn_info->resp_ies_len = ies_len; - } - - return 0; -} diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index a1347f7..67f6855 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -64,10 +64,6 @@ struct assoc_resp { __le16 aid; } __packed; -s32 wilc_parse_network_info(u8 *msg_buffer, - struct network_info **ret_network_info); -s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len, - struct connect_info *ret_conn_info); void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length); void wilc_network_info_received(struct wilc *wilc, u8 *buffer, u32 length); void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *buffer, u32 length); diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 01db899..c4f858b 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1305,6 +1305,101 @@ static void *host_int_parse_join_bss_param(struct network_info *info) return (void *)param; } +static inline u8 *get_bssid(struct ieee80211_mgmt *mgmt) +{ + if (ieee80211_has_fromds(mgmt->frame_control)) + return mgmt->sa; + else if (ieee80211_has_tods(mgmt->frame_control)) + return mgmt->da; + else + return mgmt->bssid; +} + +static s32 wilc_parse_network_info(u8 *msg_buffer, + struct network_info **ret_network_info) +{ + struct network_info *info; + struct ieee80211_mgmt *mgt; + u8 *wid_val, *msa, *ies; + u16 wid_len, rx_len, ies_len; + u8 msg_type; + size_t offset; + const u8 *ch_elm, *tim_elm, *ssid_elm; + + msg_type = msg_buffer[0]; + if ('N' != msg_type) + return -EFAULT; + + wid_len = get_unaligned_le16(&msg_buffer[6]); + wid_val = &msg_buffer[8]; + + info = kzalloc(sizeof(*info), GFP_KERNEL); + if (!info) + return -ENOMEM; + + info->rssi = wid_val[0]; + + msa = &wid_val[1]; + mgt = (struct ieee80211_mgmt *)&wid_val[1]; + rx_len = wid_len - 1; + + if (ieee80211_is_probe_resp(mgt->frame_control)) { + info->cap_info = le16_to_cpu(mgt->u.probe_resp.capab_info); + info->beacon_period = le16_to_cpu(mgt->u.probe_resp.beacon_int); + info->tsf_hi = le64_to_cpu(mgt->u.probe_resp.timestamp); + info->tsf_lo = (u32)info->tsf_hi; + offset = offsetof(struct ieee80211_mgmt, u.probe_resp.variable); + } else if (ieee80211_is_beacon(mgt->frame_control)) { + info->cap_info = le16_to_cpu(mgt->u.beacon.capab_info); + info->beacon_period = le16_to_cpu(mgt->u.beacon.beacon_int); + info->tsf_hi = le64_to_cpu(mgt->u.beacon.timestamp); + info->tsf_lo = (u32)info->tsf_hi; + offset = offsetof(struct ieee80211_mgmt, u.beacon.variable); + } else { + /* only process probe response and beacon frame */ + kfree(info); + return -EIO; + } + + ether_addr_copy(info->bssid, get_bssid(mgt)); + + ies = mgt->u.beacon.variable; + ies_len = rx_len - offset; + if (ies_len <= 0) { + kfree(info); + return -EIO; + } + + info->ies = kmemdup(ies, ies_len, GFP_KERNEL); + if (!info->ies) { + kfree(info); + return -ENOMEM; + } + + info->ies_len = ies_len; + + ssid_elm = cfg80211_find_ie(WLAN_EID_SSID, ies, ies_len); + if (ssid_elm) { + info->ssid_len = ssid_elm[1]; + if (info->ssid_len <= IEEE80211_MAX_SSID_LEN) + memcpy(info->ssid, ssid_elm + 2, info->ssid_len); + else + info->ssid_len = 0; + } + + ch_elm = cfg80211_find_ie(WLAN_EID_DS_PARAMS, ies, ies_len); + if (ch_elm && ch_elm[1] > 0) + info->ch = ch_elm[2]; + + tim_elm = cfg80211_find_ie(WLAN_EID_TIM, ies, ies_len); + if (tim_elm && tim_elm[1] >= 2) + info->dtim_period = tim_elm[3]; + + *ret_network_info = info; + + return 0; +} + static void handle_rcvd_ntwrk_info(struct work_struct *work) { struct host_if_msg *msg = container_of(work, struct host_if_msg, work); @@ -1410,6 +1505,28 @@ static inline void host_int_free_user_conn_req(struct host_if_drv *hif_drv) hif_drv->usr_conn_req.ies = NULL; } +static s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len, + struct connect_info *ret_conn_info) +{ + u8 *ies; + u16 ies_len; + struct assoc_resp *res = (struct assoc_resp *)buffer; + + ret_conn_info->status = le16_to_cpu(res->status_code); + if (ret_conn_info->status == WLAN_STATUS_SUCCESS) { + ies = &buffer[sizeof(*res)]; + ies_len = buffer_len - sizeof(*res); + + ret_conn_info->resp_ies = kmemdup(ies, ies_len, GFP_KERNEL); + if (!ret_conn_info->resp_ies) + return -ENOMEM; + + ret_conn_info->resp_ies_len = ies_len; + } + + return 0; +} + static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif, u8 mac_status) { From patchwork Thu Nov 1 16:45:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10664303 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 B105817DF for ; Thu, 1 Nov 2018 16:45:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FFFB2C1DD for ; Thu, 1 Nov 2018 16:45:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92D052C1F6; Thu, 1 Nov 2018 16:45:39 +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 037512C1DD for ; Thu, 1 Nov 2018 16:45:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726665AbeKBBtW (ORCPT ); Thu, 1 Nov 2018 21:49:22 -0400 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:23527 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726375AbeKBBtV (ORCPT ); Thu, 1 Nov 2018 21:49:21 -0400 X-IronPort-AV: E=Sophos;i="5.54,452,1534834800"; d="scan'208";a="22518412" 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; 01 Nov 2018 09:45:36 -0700 Received: from NAM03-BY2-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; Thu, 1 Nov 2018 09:45:36 -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=Uy9sptyMJYFTT0S9XX9moaq1Qs6LT/UqQ2MpJAOEerI=; b=1zmSXPne6pKTvbQD/dIaF2wkgSppzMi4tnG0pg9GH3YvNDjS2heqK7JvBIwm2lQE4xGpmIMsHMbLAgloVI9WuTBmOhDUZefPJVMk7EsciuRRkJALsg/srXoGLf6t2OKG9YcIyj+2VNvk3pTo3NrycRAnzodrjJiKnx2riASI5S8= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB3286.namprd11.prod.outlook.com (20.177.185.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.21; Thu, 1 Nov 2018 16:45:26 +0000 Received: from BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7]) by BYAPR11MB2567.namprd11.prod.outlook.com ([fe80::b548:a8e4:b647:5b7%6]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 16:45:26 +0000 From: To: CC: , , , , , , Subject: [PATCH 8/8] staging: wilc1000: remove coreconfigurator.h file Thread-Topic: [PATCH 8/8] staging: wilc1000: remove coreconfigurator.h file Thread-Index: AQHUcgJKrJ6AhFhOzkqqkkcb4c2a7A== Date: Thu, 1 Nov 2018 16:45:26 +0000 Message-ID: <1541090691-31928-9-git-send-email-ajay.kathat@microchip.com> References: <1541090691-31928-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1541090691-31928-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: SG2PR06CA0138.apcprd06.prod.outlook.com (2603:1096:1:1f::16) 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-originating-ip: [49.205.219.12] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB3286;6:vlptNQxt2xlxZnJjbrBf8Xyq6QrT+jOOGsm0SRH10ENus02lsAbmxEmhG28k8TjVBHS4+yuDhPJGi2s8a1l9uNt479oTgD1JpeKLq3WUS1Vgg7yFkufKKEng9OO0UnG5cYwBGCs/JSWxxs0cgvC7HrJs3OZITRSDFLq6Bt5gUFDl36ccLni1pfp+ZjkwLu9ThEaiv1Lp60itPXu5r/9OFd+TBAXGjTiqu4/oR1rdmtUOUzow4bKoqG9g1DsUK00yUP/SdruG2vKyg6JSpABu9kvZyDMra8DCrt7/slBeNcKrATEMkvpKqGwxS52baKmiYWfZohgZMLGu8K+xSCtM2PL9dotwafOz2vKZokZaRRvIdpl7UIhcGFKvZRR9UdXBpjipGRywGWoLKuo8W9RywEm90LXuvRHE0TuC4tmtOtJyobDKDk431WHAnMx2ysr7M8V5KxSvXjcju9LR/ZYb8w==;5:3wVmbYZxwsYXvyhgzphSfP9NpRKcmNrurfKyi2CaVpzrT739/snyt4x3ioBzXpxvmy/9Ua7LW78kDSnDK4RjLPKm7nDoIAe1XZXOtycaHGxXzM8YgcQAsFlpnSDHUOePjVfLbfrrx8bbcHn31kmhRLcRRUq/ZE6lm8YxcPOeSL4=;7:0E+cFM528b8bkmgptI1Ek7c66K/ENwnE1QGIrL+J5aK3slaxbjk/S+ZvJcU8Qdu2g88zG5gRp0k/F4sZYQHg3HM9h/QzkBn1NTSgBpaVZe0snz2BcG0WbQ3WkNZ7TT8FBUrcFRltDyweEzlPcCpeJQ== x-ms-office365-filtering-correlation-id: f2992e42-9846-4cf0-bbf1-08d640196c66 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB3286; x-ms-traffictypediagnostic: BYAPR11MB3286: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(21532816269658); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3231382)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB3286;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB3286; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(376002)(346002)(136003)(39860400002)(396003)(199004)(189003)(105586002)(102836004)(2900100001)(5660300001)(106356001)(6916009)(4326008)(186003)(26005)(14444005)(78486014)(2906002)(476003)(446003)(305945005)(6506007)(14454004)(386003)(486006)(2616005)(7736002)(11346002)(575784001)(86362001)(3846002)(6116002)(256004)(52116002)(8936002)(76176011)(478600001)(81156014)(8676002)(71200400001)(68736007)(71190400001)(72206003)(54906003)(316002)(25786009)(99286004)(81166006)(107886003)(66066001)(5250100002)(2501003)(5640700003)(53936002)(6512007)(6436002)(36756003)(6486002)(97736004)(2351001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB3286;H:BYAPR11MB2567.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: CNjqtccZmfcyNuXTPa8GWhqVkYBtuD4uQZpiaQ8MTfl0Pe2/zuu2kBMV/guebS0fQ/T7wDR6yaEv94/3/jS0HFp3MQ11/choC3PhtxoM4VBl+a5kYDYa/in1+68jIGHKV9UmplHYLLbcHx+/Sjv0BH3w1z/1c3yR6JSkFF28ONfYM8e/EY5Uc6GYvjWTAzSodIenlqfW3tQYA9HUrD/v5gpAmqBTShw1qHkFoj5AiRuLBVCDEM03OczxvfZ8OGkf4a+CedezqRUTmGsw9PKJp4CU9R1cMIcWfQSbv+oHq74kEEw7U7gn+FdRSXdQVtw1xgY+Oq894R9MbboAprtUch8mToAG1TgukUBDRVmzpWA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f2992e42-9846-4cf0-bbf1-08d640196c66 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 16:45:26.0318 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3286 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 the coreconfigurator header file, as its source file is deleted after code refactor. Moved the required structure and prototypes to hostinterface header. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/coreconfigurator.h | 70 ----------------------------- drivers/staging/wilc1000/host_interface.h | 61 ++++++++++++++++++++++++- drivers/staging/wilc1000/wilc_wlan_cfg.c | 1 - 3 files changed, 59 insertions(+), 73 deletions(-) delete mode 100644 drivers/staging/wilc1000/coreconfigurator.h diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h deleted file mode 100644 index 67f6855..0000000 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ /dev/null @@ -1,70 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries. - * All rights reserved. - */ - -#ifndef CORECONFIGURATOR_H -#define CORECONFIGURATOR_H - -#include "wilc_wlan_if.h" - -#define NUM_RSSI 5 - -#define SET_CFG 0 -#define GET_CFG 1 - -#define MAX_ASSOC_RESP_FRAME_SIZE 256 - -struct rssi_history_buffer { - bool full; - u8 index; - s8 samples[NUM_RSSI]; -}; - -struct network_info { - s8 rssi; - u16 cap_info; - u8 ssid[MAX_SSID_LEN]; - u8 ssid_len; - u8 bssid[6]; - u16 beacon_period; - u8 dtim_period; - u8 ch; - unsigned long time_scan_cached; - unsigned long time_scan; - bool new_network; - u8 found; - u32 tsf_lo; - u8 *ies; - u16 ies_len; - void *join_params; - struct rssi_history_buffer rssi_history; - u64 tsf_hi; -}; - -struct connect_info { - u8 bssid[6]; - u8 *req_ies; - size_t req_ies_len; - u8 *resp_ies; - u16 resp_ies_len; - u16 status; -}; - -struct disconnect_info { - u16 reason; - u8 *ie; - size_t ie_len; -}; - -struct assoc_resp { - __le16 capab_info; - __le16 status_code; - __le16 aid; -} __packed; - -void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length); -void wilc_network_info_received(struct wilc *wilc, u8 *buffer, u32 length); -void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *buffer, u32 length); -#endif diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 33fb731..5f8d30f 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -7,7 +7,7 @@ #ifndef HOST_INT_H #define HOST_INT_H #include -#include "coreconfigurator.h" +#include "wilc_wlan_if.h" #define IDLE_MODE 0x00 #define AP_MODE 0x01 @@ -56,6 +56,61 @@ #define DRV_HANDLER_SIZE 5 #define DRV_HANDLER_MASK 0x000000FF +#define NUM_RSSI 5 + +#define SET_CFG 0 +#define GET_CFG 1 + +#define MAX_ASSOC_RESP_FRAME_SIZE 256 + +struct rssi_history_buffer { + bool full; + u8 index; + s8 samples[NUM_RSSI]; +}; + +struct network_info { + s8 rssi; + u16 cap_info; + u8 ssid[MAX_SSID_LEN]; + u8 ssid_len; + u8 bssid[6]; + u16 beacon_period; + u8 dtim_period; + u8 ch; + unsigned long time_scan_cached; + unsigned long time_scan; + bool new_network; + u8 found; + u32 tsf_lo; + u8 *ies; + u16 ies_len; + void *join_params; + struct rssi_history_buffer rssi_history; + u64 tsf_hi; +}; + +struct connect_info { + u8 bssid[6]; + u8 *req_ies; + size_t req_ies_len; + u8 *resp_ies; + u16 resp_ies_len; + u16 status; +}; + +struct disconnect_info { + u16 reason; + u8 *ie; + size_t ie_len; +}; + +struct assoc_resp { + __le16 capab_info; + __le16 status_code; + __le16 aid; +} __packed; + struct rf_info { u8 link_speed; s8 rssi; @@ -358,5 +413,7 @@ void wilc_resolve_disconnect_aberration(struct wilc_vif *vif); int wilc_get_vif_idx(struct wilc_vif *vif); int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power); int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power); - +void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length); +void wilc_network_info_received(struct wilc *wilc, u8 *buffer, u32 length); +void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *buffer, u32 length); #endif diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c b/drivers/staging/wilc1000/wilc_wlan_cfg.c index faa001c..8390766 100644 --- a/drivers/staging/wilc1000/wilc_wlan_cfg.c +++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c @@ -7,7 +7,6 @@ #include "wilc_wlan_if.h" #include "wilc_wlan.h" #include "wilc_wlan_cfg.h" -#include "coreconfigurator.h" #include "wilc_wfi_netdevice.h" enum cfg_cmd_type {