From patchwork Mon Nov 12 05:45:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10678137 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 12A1A14DB for ; Mon, 12 Nov 2018 05:45:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8F60287B1 for ; Mon, 12 Nov 2018 05:45:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB51F2A050; Mon, 12 Nov 2018 05:45:07 +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 BD580287B1 for ; Mon, 12 Nov 2018 05:45:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731120AbeKLPgo (ORCPT ); Mon, 12 Nov 2018 10:36:44 -0500 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:32648 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbeKLPgn (ORCPT ); Mon, 12 Nov 2018 10:36:43 -0500 X-IronPort-AV: E=Sophos;i="5.54,494,1534834800"; d="scan'208";a="23150803" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 11 Nov 2018 22:45:04 -0700 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sun, 11 Nov 2018 22:45:04 -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=oYNFxSp1FcHbnkfC8bV2Z0Cm0vIcxQA/VssSkuTWuVY=; b=ZxwtBLNyRyvhZHg10owKBAZDCafQEKnYOyMb+klJMf3z6WcLoCNgiNQw0dTxfN3rHhW4PsGFRsGmFOxuI9YIEcZMt1wfeS8lJ8RtfnAGD6bQ6ctCBdD9jVuMi4vGnNK9hYVVV6j6cnFFHy9q0aUp9IYLIhLR9knWqYbxW03ZMlY= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2599.namprd11.prod.outlook.com (52.135.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Mon, 12 Nov 2018 05:45:03 +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.1294.044; Mon, 12 Nov 2018 05:45:03 +0000 From: To: CC: , , , , Subject: [PATCH 01/12] staging: wilc1000: use macro from ieee80211.h in register frame api's Thread-Topic: [PATCH 01/12] staging: wilc1000: use macro from ieee80211.h in register frame api's Thread-Index: AQHUekrbiCfNsEguAUmYJfp1aXypGg== Date: Mon, 12 Nov 2018 05:45:03 +0000 Message-ID: <1542001458-20217-2-git-send-email-ajay.kathat@microchip.com> References: <1542001458-20217-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1542001458-20217-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: MA1PR01CA0135.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::29) 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: [27.59.94.109] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2599;6:ZyLO6NJjhhX0SLCU4qdVxwz+7X3iuxqYENZv5DUczkQWRYEltdxEFSgjGosH4XwK2cBdtCqFSH1lNJ9jQB9T0dm6H4BM8NZEfTkrVBMjSN/y/xuGvv16HnhBWhYK4LHkBa77Xt1o5WaCtOWQXIGwHwc/Ae+dQIBaFSuFbqknjOkaxFGTyeBAgWgYq6auDfUx7HGowXfKv5hMVoJ5UXoQWCZoB1HhgyqNNlob3QLlQx9nkZeUilC0o49Vlhwx65IU9Kg1LQYdUHut7NeHQmdwGHVeeiJuFo+djnk1elxI52waXBlcs1bTAgnEyRH0bIQeIcOStmXAM/5xhIrAbEOFkjkGsstFB3xIHeeBXKDMN7bTD06N5xupYWTCHQzNBbKlASkjMnVXR9Q3Q5HBnVPhxne+H3Ad4eNSUkL3WKcWxcV3xK+2mMXx1G3UFFXwGuQgoe/KxFKZMh31eZzIBVG+xQ==;5:YfJ1OS8MRhlAqhcsS1VSPrxQUDAPe+MLVkA3kMpABNTMFM7NeQNyxM79KZY+d7pbFAgNVQ3oRgPCvfR7H3V5Orn3iMvCA8PoKAoE+yxw0IRpsSDhLKjcO8fFFQA7dP+zPiM+mc1M1iGPBn8m6wcw2xBlxkTMbuiHTZoeAeCj/Ps=;7:6+fjOXUM+cr5Ch3oAqWEGctCLNe2bPk6Zg+/2wPgT0jxjlieersEjI8FPiOzqHwyhIfl6W8kqdD07N47VL9jtMb+lWa1y4jEM4BNp1Wry7IZpgyJHIwsNRiuVMgLa4w8pEibEFaRsemsuErvwJJr2A== x-ms-office365-filtering-correlation-id: 47a846c0-2d0a-49fc-e5f3-08d64861fe04 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2599; x-ms-traffictypediagnostic: BYAPR11MB2599: 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)(3002001)(3231402)(944501410)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB2599;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB2599; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(4326008)(25786009)(2906002)(6116002)(3846002)(72206003)(26005)(2351001)(14454004)(86362001)(575784001)(186003)(6436002)(478600001)(6486002)(105586002)(76176011)(106356001)(2501003)(107886003)(5640700003)(54906003)(52116002)(99286004)(102836004)(53936002)(256004)(6506007)(386003)(316002)(36756003)(486006)(8936002)(6916009)(11346002)(7736002)(305945005)(476003)(2616005)(68736007)(8676002)(71200400001)(97736004)(5660300001)(66066001)(446003)(81156014)(81166006)(6512007)(71190400001)(2900100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2599;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: 3CSYBG0hTAzaxCTGe8Sbu6gOdxh4AwgMJYf5jrBtLl/5WMkTv0GcgZTclfieTQpaa7IRTfv8wy7y7qxzWghjAJf2tp0Pau76DLRY+s2xItt2KzZ7eJOGUOgVQ7YHkxgOeMKNq7b3X2rsoGdLs9+PEoTilZzZNarh9OINnkXbEmcmcQvkyhufejmzL6xL3kVh80qoR2XJHZ7wN2itEu1TGdVdxyzOZS+rG46yh/UvC3uVyq0BOq8afEbnGGsyIbEBvaD+2amkPRsLGuvyCFVoqKzfMXuF2+9JuBInMV6NB1qt+FXIKDkLXyP78aH3dj8H1Cgv7/Y7oFzbDZscS5dEt4Qu19hEOFpe3LjnidZd8g4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 47a846c0-2d0a-49fc-e5f3-08d64861fe04 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 05:45:03.2376 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2599 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Make use of ieee80211.h provided macros and removed the extra macro defined for the same purpose. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 3 --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 2bf91df..eb13b41 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3483,11 +3483,11 @@ void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg) return; switch (frame_type) { - case ACTION: + case IEEE80211_STYPE_ACTION: msg->body.reg_frame.reg_id = ACTION_FRM_IDX; break; - case PROBE_REQ: + case IEEE80211_STYPE_PROBE_REQ: msg->body.reg_frame.reg_id = PROBE_REQ_IDX; break; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 523b46b..0185fc6 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -14,9 +14,6 @@ #define STATION_MODE 0x02 #define GO_MODE 0x03 #define CLIENT_MODE 0x04 -#define ACTION 0xD0 -#define PROBE_REQ 0x40 -#define PROBE_RESP 0x50 #define ACTION_FRM_IDX 0 #define PROBE_REQ_IDX 1 diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index a6f4fad..f92ecf6c 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1700,12 +1700,12 @@ void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev, return; switch (frame_type) { - case PROBE_REQ: + case IEEE80211_STYPE_PROBE_REQ: vif->frame_reg[0].type = frame_type; vif->frame_reg[0].reg = reg; break; - case ACTION: + case IEEE80211_STYPE_ACTION: vif->frame_reg[1].type = frame_type; vif->frame_reg[1].reg = reg; break; From patchwork Mon Nov 12 05:45:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10678141 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 40FE614DB for ; Mon, 12 Nov 2018 05:45:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D2CD286B1 for ; Mon, 12 Nov 2018 05:45:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21B682A046; Mon, 12 Nov 2018 05: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 A34C6286B1 for ; Mon, 12 Nov 2018 05:45:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731138AbeKLPgr (ORCPT ); Mon, 12 Nov 2018 10:36:47 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:41844 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbeKLPgq (ORCPT ); Mon, 12 Nov 2018 10:36:46 -0500 X-IronPort-AV: E=Sophos;i="5.54,494,1534834800"; d="scan'208";a="20255100" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 11 Nov 2018 22:45:07 -0700 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sun, 11 Nov 2018 22: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=0l1Rt1VSn9zYgn0u1YkKA9tJmKtjDBL6WvQVlK9jt6U=; b=GLqnvNu7XgcKZD0OzZ5nwKXOb2OQdS+DcI3KrIJ5yul5rtzSSgnpUY/orxJTMfciPA31WT5CTl9/3gf+A7OhUotGxXRJ4mlESsuhWOKEQHEclAl1WOCrkBncYM8b45iAlY+JdMa8NyXeEAQCg1WCd8y4t9w/yPY1qNJfIF0C/6k= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2599.namprd11.prod.outlook.com (52.135.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Mon, 12 Nov 2018 05:45:06 +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.1294.044; Mon, 12 Nov 2018 05:45:06 +0000 From: To: CC: , , , , Subject: [PATCH 02/12] staging: wilc1000: use WLAN_PMKID_LEN macro from ieee80211.h header Thread-Topic: [PATCH 02/12] staging: wilc1000: use WLAN_PMKID_LEN macro from ieee80211.h header Thread-Index: AQHUekrdhaIVWOO/IUy8mzrRzrCr+g== Date: Mon, 12 Nov 2018 05:45:06 +0000 Message-ID: <1542001458-20217-3-git-send-email-ajay.kathat@microchip.com> References: <1542001458-20217-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1542001458-20217-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: MA1PR01CA0135.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::29) 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: [27.59.94.109] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2599;6:S95zeBCHZ6cQf/cZW+XAwdUqtI7ihvigg4jxhjXsfr1okxoca4vpYgJiarY0J0+ItqP1DdOsNv5cue17IAPE5gydhXJJHZv4g092KEY2vWeNXuz462DKMDpt3VVWDE+i31t7XGqexWQjdpt32Yqx6nCY/5SUgW2la+7EUAlL/mmLnLjVNn9tyUp+ghNM6IbhOrEU4si6di+cQoIzJo2Sp1LhQBFlOj82mEMVJrPevhkzH4iK5B4he0WN0RblKjL5lX4wHWpXxfA73X0MMA/NjMMK7pRmEnLYApYZ0FBHFmpmMGV3SLEyaWmSgQWaxYfIWf5iaV+LfUawoR1kV96jGYvxHLAVrYMJMq4b1mAFVUo9ZFuFhysxCVm5s0ILIq9GXMbY5Og/zGjALGj8gd2sXYJzPy0u31wdM0R4xLwY1NrZOITvwWIho1ymGq58s9y3ABN5DV0Q0nuPhdHtyKfqvg==;5:q8+NgudlV+ol8mLgxLCJTW0iDjEp3Ghkx+Df9e+rHeH9X8HMJK6jwQxZSadHJwl4kPnH9WnaNJ1Q4t1Rt3XXmnYxAOY8YMjYFZqwvmDhhe/jd+ib6BvstWxRLBnkcvp/lRxoWaNWh/YpGflfKdnMaty5rtTljceXKK7kShYSfYI=;7:6u0o4p+MpC9J1Avl2VUfx+XZBM3zh3OO37nqwHpzmgQGDUiRHk/rsJ4QSgX1RHPawgb1uTwUun9gIwvjiawgB66feDDJLti7D3pnQgTm7ppkYCfiqOPnENphx8/v6enAUJRdwZNh2IWUKFurfNDylQ== x-ms-office365-filtering-correlation-id: 26ef5b76-bfdd-403e-ed6d-08d64861ffa3 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2599; x-ms-traffictypediagnostic: BYAPR11MB2599: 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)(3002001)(3231402)(944501410)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB2599;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB2599; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(4326008)(25786009)(2906002)(6116002)(3846002)(72206003)(26005)(2351001)(14454004)(86362001)(186003)(6436002)(478600001)(6486002)(105586002)(76176011)(106356001)(2501003)(107886003)(5640700003)(54906003)(52116002)(99286004)(102836004)(53936002)(256004)(6506007)(386003)(316002)(36756003)(486006)(8936002)(6916009)(11346002)(7736002)(305945005)(476003)(2616005)(68736007)(8676002)(71200400001)(97736004)(5660300001)(66066001)(446003)(81156014)(81166006)(6512007)(71190400001)(2900100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2599;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: 38XBtiO99e6jD6yTgI2z4kE7v847RFlDVgWqgMaYH/lRAsCyhREGuEEXDqdH9DHRFMjYsiRINVCqNeJEWmm1pXIPR76pqxLb3MzuDT/heMX0PFM+2iypv3vL+l8G+c27ZdbIvN518sdL4utwSm/Wh6CJzhf12OpE6FIysaApnD3D/J4ZaXYlIoRtPzAhWNKnMuQMHDi9NjanWdBQ5IPOhpX+EDVerPQSqfZ4EejMrf81RsdtKXrJYbbLbixLP7WM54ERxbDAGr6ipGHMnER+gqwyW9KUkw9BPPVcLKwl3Lx6bE9thFleMmbnZT4fP3gHBUm7C7XWdkk54M3l291XoPeIU+DRujfWZxzeJMxuYbY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 26ef5b76-bfdd-403e-ed6d-08d64861ffa3 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 05:45:06.0106 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2599 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Make use of WLAN_PMKID_LEN macro provided by ieee80211.h header instead of PMKID_LEN. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 3 +-- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 ++-- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 - 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index eb13b41..c200d90 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1460,7 +1460,7 @@ static int wilc_pmksa_key_copy(struct wilc_vif *vif, struct key_attr *hif_key) memcpy(key_buf + ((PMKSA_KEY_LEN * i) + 1), hif_key->attr.pmkid.pmkidlist[i].bssid, ETH_ALEN); memcpy(key_buf + ((PMKSA_KEY_LEN * i) + ETH_ALEN + 1), - hif_key->attr.pmkid.pmkidlist[i].pmkid, PMKID_LEN); + hif_key->attr.pmkid.pmkidlist[i].pmkid, WLAN_PMKID_LEN); } wid.id = WID_PMKID_INFO; @@ -2793,7 +2793,7 @@ int wilc_set_pmkid_info(struct wilc_vif *vif, memcpy(msg->body.key_info.attr.pmkid.pmkidlist[i].bssid, &pmkid->pmkidlist[i].bssid, ETH_ALEN); memcpy(msg->body.key_info.attr.pmkid.pmkidlist[i].pmkid, - &pmkid->pmkidlist[i].pmkid, PMKID_LEN); + &pmkid->pmkidlist[i].pmkid, WLAN_PMKID_LEN); } result = wilc_enqueue_work(msg); diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 0185fc6..3d31153 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -46,7 +46,6 @@ #define PMKSA_KEY_LEN 22 #define ETH_ALEN 6 -#define PMKID_LEN 16 #define WILC_MAX_NUM_PMKIDS 16 #define WILC_ADD_STA_LENGTH 40 #define NUM_CONCURRENT_IFC 2 @@ -128,7 +127,7 @@ enum host_if_state { struct host_if_pmkid { u8 bssid[ETH_ALEN]; - u8 pmkid[PMKID_LEN]; + u8 pmkid[WLAN_PMKID_LEN]; }; struct host_if_pmkid_attr { diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index f92ecf6c..7b753c1 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1217,7 +1217,7 @@ static int set_pmksa(struct wiphy *wiphy, struct net_device *netdev, memcpy(priv->pmkid_list.pmkidlist[i].bssid, pmksa->bssid, ETH_ALEN); memcpy(priv->pmkid_list.pmkidlist[i].pmkid, pmksa->pmkid, - PMKID_LEN); + WLAN_PMKID_LEN); if (!(flag == PMKID_FOUND)) priv->pmkid_list.numpmkid++; } else { @@ -1254,7 +1254,7 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev, ETH_ALEN); memcpy(priv->pmkid_list.pmkidlist[i].pmkid, priv->pmkid_list.pmkidlist[i + 1].pmkid, - PMKID_LEN); + WLAN_PMKID_LEN); } priv->pmkid_list.numpmkid--; } else { diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 4f05a16..6283d9e 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -22,7 +22,6 @@ #define FLOW_CONTROL_UPPER_THRESHOLD 256 #define WILC_MAX_NUM_PMKIDS 16 -#define PMKID_LEN 16 #define PMKID_FOUND 1 #define NUM_STA_ASSOCIATED 8 From patchwork Mon Nov 12 05: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: 10678143 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 DEC4614DB for ; Mon, 12 Nov 2018 05:45:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDE67286B1 for ; Mon, 12 Nov 2018 05:45:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1B102A046; Mon, 12 Nov 2018 05:45:13 +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 5BE85286B1 for ; Mon, 12 Nov 2018 05:45:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731157AbeKLPgv (ORCPT ); Mon, 12 Nov 2018 10:36:51 -0500 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:32655 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbeKLPgu (ORCPT ); Mon, 12 Nov 2018 10:36:50 -0500 X-IronPort-AV: E=Sophos;i="5.54,494,1534834800"; d="scan'208";a="23150805" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 11 Nov 2018 22:45:11 -0700 Received: from NAM05-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sun, 11 Nov 2018 22:45:10 -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=PHLqIoPDWBLYmP2O4cCE4rqGBwtC6Atzd4HtL/q6tmQ=; b=tvrPq8p3Hjsbtju0ZW3c/M0lQOWVUi4yyZTPGxsyW63hn+feiQJNcE8Y+Z9kWlkNZwaxHcuyMbMbE+TDsF5cqNfDfstse1Gu4R2bXvhmz2FedyzpLuGFcytk8KzNielsdbfYOgjXpZpcIkLHopGxgIUV+tpy4Bbn2sSp6IQqQcM= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2599.namprd11.prod.outlook.com (52.135.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Mon, 12 Nov 2018 05: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.1294.044; Mon, 12 Nov 2018 05:45:08 +0000 From: To: CC: , , , , Subject: [PATCH 03/12] staging: wilc1000: remove unused macros and struct members in host_interface.h Thread-Topic: [PATCH 03/12] staging: wilc1000: remove unused macros and struct members in host_interface.h Thread-Index: AQHUekrevzFGmTKp4UCaOE3ezU/3MQ== Date: Mon, 12 Nov 2018 05:45:08 +0000 Message-ID: <1542001458-20217-4-git-send-email-ajay.kathat@microchip.com> References: <1542001458-20217-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1542001458-20217-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: MA1PR01CA0135.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::29) 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: [27.59.94.109] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2599;6:tB8FLW1E9s9N2agIZ2PFew4rVSa8IvvlF409BiRX0OGsdHNaW3TyyB3HWBcdUXb0pIBJWTt+vD+wkBEQJgeXdNeSw4dL8eLgm1AK5sd9sl22BUmOy+OPoEIHTOxssELJu/4gAjkwwtnRmfuzGnmdxO8DtydZiiz3U/NX69gVOiT+Hic8tNRMjNkMfQyDLjRkPegFJOWxKu/BTcOychtYgX23rJnHA45naNZjqB9gcyCOslm5sQEtamHhHdkedNYS23cu/9BCnazcM56C7z45+i1SdbzTYias7PFNqddTFqX0a4FXHqlEOnoCJMTmt/WS8zegW1JQBUGkgFGo9YqCC99o8HDvC1akYL3bENsWiuRP/F2wHmqAMEqyynHXf6+jNZkjpy7BL26my702YwXHevM/9DMM5vk8Pa3+79Cnj99UgVfA1IRtX7iRKp0ZlPgBcasAPG+wLZseh2unWiwJBQ==;5:Tm+n0Y3oC7MaXq5zZWSrhrWZ8YypRCOpXpYABRI4pa9DQfWvWAGQ/CKI2S9AzaI0f9/12ATa6l8o6L47lCqKDntRSM+mseE0QqN6ccEh7k1qC5Wg3lT7ZQi74I0QZJ8/gAXkQy4NKWylYruBFXeCpo7/4n/vfxcbW9fH+4icgaE=;7:U+AE3u+WOSCv8uD+SkB+ubNryW5J9BJ9Luz5xs5E1+idUtmA1TsvG3BRVgyMsn0TmPbOcR1KQt1Y54bfWzhcDRY3iOS0BagaPTTp+e6Sn/Odr1tjbozRaCtPmO+/kksK+lFGRj859/83SsR6bRVQoA== x-ms-office365-filtering-correlation-id: ee6a4f6c-65d7-466c-1e41-08d64862014c x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2599; x-ms-traffictypediagnostic: BYAPR11MB2599: 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)(3002001)(3231402)(944501410)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB2599;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB2599; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(4326008)(25786009)(2906002)(6116002)(3846002)(72206003)(26005)(2351001)(14454004)(86362001)(575784001)(186003)(6436002)(478600001)(6486002)(105586002)(76176011)(106356001)(2501003)(107886003)(5640700003)(54906003)(52116002)(99286004)(102836004)(53936002)(14444005)(256004)(6506007)(386003)(316002)(36756003)(486006)(8936002)(6916009)(11346002)(7736002)(305945005)(476003)(2616005)(68736007)(8676002)(71200400001)(97736004)(5660300001)(66066001)(446003)(81156014)(81166006)(6512007)(71190400001)(2900100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2599;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: 4c6TkopcNT/yshsY971GiT948xXmn59n6F18dT6OV7wMjbJ/UXukNtkLjVReco3Qgg5zbDNkbQO+86tN6TNvO3KsFXs1ITuGY5vitdMjaIzEzXZJZgG618NWZ3w2ocsMkWsqMIOlScl3UoDW5h+gX5dvvTTGcCxmpHN4ch/Qjtv1DRN74ms3MFr4KITAIcVSAmAmiLeGootqL/aqMC9EwRCTBg7fi0l47FHJzZtiDiQA4GVXcUIzSgWf9x8hGzwF8fPLdK7y/TiJQyIsZg2GlFgRlTaTcQw+RaQoe6XBFSPu1baj+nm0r5m/Dclo4plU4A3BXVuHniVXjQuQP35XUDS6XkzLld7qIK4gswvY3iM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ee6a4f6c-65d7-466c-1e41-08d64862014c X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 05:45:08.7435 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2599 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 unused macros and struct members in host_interface.h header file. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 3d31153..fefbce6 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -18,15 +18,10 @@ #define ACTION_FRM_IDX 0 #define PROBE_REQ_IDX 1 #define MAX_NUM_STA 9 -#define ACTIVE_SCAN_TIME 10 -#define PASSIVE_SCAN_TIME 1200 -#define MIN_SCAN_TIME 10 -#define MAX_SCAN_TIME 1200 #define DEFAULT_SCAN 0 #define USER_SCAN BIT(0) #define OBSS_PERIODIC_SCAN BIT(1) #define OBSS_ONETIME_SCAN BIT(2) -#define GTK_RX_KEY_BUFF_LEN 24 #define ADDKEY 0x1 #define REMOVEKEY 0x2 #define DEFAULTKEY 0x4 @@ -34,18 +29,15 @@ #define MAX_NUM_SCANNED_NETWORKS 100 #define MAX_NUM_SCANNED_NETWORKS_SHADOW 130 #define MAX_NUM_PROBED_SSID 10 -#define CHANNEL_SCAN_TIME 250 #define TX_MIC_KEY_LEN 8 #define RX_MIC_KEY_LEN 8 #define PTK_KEY_LEN 16 -#define TX_MIC_KEY_MSG_LEN 26 #define RX_MIC_KEY_MSG_LEN 48 #define PTK_KEY_MSG_LEN 39 #define PMKSA_KEY_LEN 22 -#define ETH_ALEN 6 #define WILC_MAX_NUM_PMKIDS 16 #define WILC_ADD_STA_LENGTH 40 #define NUM_CONCURRENT_IFC 2 @@ -153,12 +145,10 @@ enum current_tx_rate { struct cfg_param_attr { u32 flag; - u8 ht_enable; u16 short_retry_limit; u16 long_retry_limit; u16 frag_threshold; u16 rts_threshold; - u8 scan_source; }; enum cfg_param { @@ -166,7 +156,6 @@ enum cfg_param { RETRY_LONG = BIT(1), FRAG_THRESHOLD = BIT(2), RTS_THRESHOLD = BIT(3), - HT_ENABLE = BIT(18), }; struct found_net_info { From patchwork Mon Nov 12 05: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: 10678145 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 5846215A6 for ; Mon, 12 Nov 2018 05:45:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47133286B1 for ; Mon, 12 Nov 2018 05:45:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B65B2A046; Mon, 12 Nov 2018 05: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 C7CAA286B1 for ; Mon, 12 Nov 2018 05:45:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731172AbeKLPgy (ORCPT ); Mon, 12 Nov 2018 10:36:54 -0500 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:3001 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbeKLPgy (ORCPT ); Mon, 12 Nov 2018 10:36:54 -0500 X-IronPort-AV: E=Sophos;i="5.54,494,1534834800"; d="scan'208";a="22686985" 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; 11 Nov 2018 22:45:13 -0700 Received: from NAM05-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.108) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sun, 11 Nov 2018 22: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=3b5lsiR9N571Q4zTAmU4DdUZ3DivNL4v7eMM1hH1TKQ=; b=UcKNTumbxYQeR7skOy228C2pktBDk8G3733JcImoVivvG7PLFrDgz4AQZklOrqkmyGS8xNMxqoHFpzMJoINM7RsPbMwYDuOUFBZcZORZS4T/7t5mZCESgrZceOnSL2TZltfWPdcK3XAJLqRCDHOHbvZRo3jUpifmau5BdMtDpYU= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2599.namprd11.prod.outlook.com (52.135.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Mon, 12 Nov 2018 05:45:11 +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.1294.044; Mon, 12 Nov 2018 05:45:11 +0000 From: To: CC: , , , , Subject: [PATCH 04/12] staging: wilc1000: move sdio_cmd52 & sdio_cmd53 struct to source file Thread-Topic: [PATCH 04/12] staging: wilc1000: move sdio_cmd52 & sdio_cmd53 struct to source file Thread-Index: AQHUekrg7zuwIXbBSkqdc6QAGUB6NQ== Date: Mon, 12 Nov 2018 05:45:11 +0000 Message-ID: <1542001458-20217-5-git-send-email-ajay.kathat@microchip.com> References: <1542001458-20217-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1542001458-20217-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: MA1PR01CA0135.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::29) 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: [27.59.94.109] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2599;6:5bm4MMyayqavPMXn31jKvJDCUWrqiLI6Jg6c7ml/WWZk+2NAKYBs4Ww/LYv5QUgCJ6TEKMruR+L85vVsJhS+mt8NzydO0bffquK93/SXF5R2HUpGZRQLPzUAg6FlZQJZKAXEx4X7OuWRYjrsXpJHhwBZMEPgWlh9aLewPtU6R2IGHSxNgety5PhOY4l+2AjBNYhr4N+dQO5InDZEMlOruxJWCedH7LttwElnskzuMmuzyQqf2SAqJgYR81NHBL6y++feeY9wcGpey7SF34S12JxLZCCfmLE7qPIK27qEln+QzMQBJCadK+7PxA92IWrZ1BjTUqYKzW6w7mGwiKJIh7AP8ARh1XQzXRKXN+LOvC5d9OMvgwdBWeuQjrq+FTkHzunXpqgIN2hlrR5QBB/hfN1JoIFtwFFZs1mtlDcyE23jsRzb9FtAD3p9zlY/IfdQ8mizj/2/B4H7hrcEBnpeQw==;5:9XvdBzRDItvdI9SfpDRGq9LSnHr6VOe15RLZEBZiuCy80yDCmYQpgB0vqgZOkgAk/cooobqRRNomB0e8bRK+fpED8dQtMsDuSh2y847Ri9DfMbwYqvgOhSwsYXdd4EnqIOHXOC6oJH8q8JNQB6V0HgKrTyqktAvkWJC/EiogauI=;7:7ud1kQR1vCuopJTjXuBVNbDWjDdu9ExPy805GkHTVC4wXygAImttEMET2NC2ZD5vtzMUBGOX2F57zjqCewkt34FgPedXQORzYJKUUKlk74CA8WALQTuaISFR36BgnfxDTadC7DjRrLJ8pVjDb/NZlw== x-ms-office365-filtering-correlation-id: 070305e9-cd24-4d87-afcb-08d648620309 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2599; x-ms-traffictypediagnostic: BYAPR11MB2599: 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)(3002001)(3231402)(944501410)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB2599;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB2599; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(4326008)(25786009)(2906002)(6116002)(3846002)(72206003)(26005)(2351001)(14454004)(86362001)(186003)(6436002)(478600001)(6486002)(105586002)(76176011)(106356001)(2501003)(107886003)(5640700003)(54906003)(52116002)(99286004)(102836004)(53936002)(256004)(6506007)(386003)(316002)(36756003)(486006)(8936002)(6916009)(11346002)(7736002)(305945005)(476003)(2616005)(68736007)(8676002)(71200400001)(97736004)(5660300001)(66066001)(446003)(81156014)(81166006)(6512007)(71190400001)(2900100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2599;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: jkXV024cFy57M+1Orx/5usYx8etvChmyhQWMSrEmycAtU/zW/o3ZL0VpjhpwefiSgoc0mqpiWD66ZOH2MWvfrU7D2D2qW/ABuHxYEbefI4gM+EDhFcyiZfnrR06MmV7ikMtzADvZwjWMcXNI8OcVxCdHppHvHmzLV2gW47NquNrQVSwIa09Dn6uQC61npjYjEr2LSTbDYKh1AQKBN5rEn2weXl5TETMZAGy/6g1uivj7Sf0mg/E82Il8AB/FQYkT3hS3ctDnUPuaQN38oPFKr4AVcAxlbvZcs+cHURnpQT+KIvaU8XgfandsvoNYn/sqEVBXLtV80FC+xwKT9eTRwyvUWJBRuaWnGDoIC5dV61A= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 070305e9-cd24-4d87-afcb-08d648620309 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 05:45:11.6736 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2599 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 Moved sdio_cmd52 & sdio_cmd53 struct from wilc_wlan_if.h, as its used in wilc_sdio.cfile. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/wilc_sdio.c | 19 +++++++++++++++++++ drivers/staging/wilc1000/wilc_wlan_if.h | 19 ------------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index ca351c9..779614e 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -30,6 +30,25 @@ struct wilc_sdio { int has_thrpt_enh3; }; +struct sdio_cmd52 { + u32 read_write: 1; + u32 function: 3; + u32 raw: 1; + u32 address: 17; + u32 data: 8; +}; + +struct sdio_cmd53 { + u32 read_write: 1; + u32 function: 3; + u32 block_mode: 1; + u32 increment: 1; + u32 address: 17; + u32 count: 9; + u8 *buffer; + u32 block_size; +}; + static const struct wilc_hif_func wilc_hif_sdio; static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data); diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 4f258bf..dc40743 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -24,25 +24,6 @@ * ********************************************/ -struct sdio_cmd52 { - u32 read_write: 1; - u32 function: 3; - u32 raw: 1; - u32 address: 17; - u32 data: 8; -}; - -struct sdio_cmd53 { - u32 read_write: 1; - u32 function: 3; - u32 block_mode: 1; - u32 increment: 1; - u32 address: 17; - u32 count: 9; - u8 *buffer; - u32 block_size; -}; - #define MAC_STATUS_INIT -1 #define MAC_STATUS_CONNECTED 1 #define MAC_STATUS_DISCONNECTED 0 From patchwork Mon Nov 12 05: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: 10678147 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 B361315A6 for ; Mon, 12 Nov 2018 05:45:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2637286B1 for ; Mon, 12 Nov 2018 05:45:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96BFF2A046; Mon, 12 Nov 2018 05:45:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A165286B1 for ; Mon, 12 Nov 2018 05:45:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731210AbeKLPg5 (ORCPT ); Mon, 12 Nov 2018 10:36:57 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:20234 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbeKLPg4 (ORCPT ); Mon, 12 Nov 2018 10:36:56 -0500 X-IronPort-AV: E=Sophos;i="5.54,494,1534834800"; d="scan'208";a="20255111" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 11 Nov 2018 22:45:17 -0700 Received: from NAM05-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sun, 11 Nov 2018 22:45:16 -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=+5vSsWAqoGgYwYuyiTFUZsPviJaXVqiOHUohCrJHtRY=; b=0VpBND9lHrQss8zHEsEY+2yfx30lwzxiX0IcKor3AF7IKLW0AAUMczUcesxi5U605JRKqAHUNl4YTbigGrUV8u7p1TDF3pBXfZ1aYvIWvADq2/vyphPSfhgDXDsGn55LnLBA1muHiXFPUDHuBjp0fFPpxMEXRdzo+qEUXtkkqFg= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2599.namprd11.prod.outlook.com (52.135.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Mon, 12 Nov 2018 05: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.1294.044; Mon, 12 Nov 2018 05:45:14 +0000 From: To: CC: , , , , Subject: [PATCH 05/12] staging: wilc1000: use enum contants for mac status & added 'WILC_' prefix Thread-Topic: [PATCH 05/12] staging: wilc1000: use enum contants for mac status & added 'WILC_' prefix Thread-Index: AQHUekrilosVAR7mhkyLeKdcYAQjqg== Date: Mon, 12 Nov 2018 05:45:14 +0000 Message-ID: <1542001458-20217-6-git-send-email-ajay.kathat@microchip.com> References: <1542001458-20217-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1542001458-20217-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: MA1PR01CA0135.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::29) 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: [27.59.94.109] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2599;6:CM1/6KR4Dpczwu65w0YT7r7C+3FLnauSHxU5SAxMMlJtMhvbdxCtWqukwT2ta9nd/r7dyXzpiRRWRYGzW/V3eP92KQn/0u1Kjkg2e1CNpelg3sFyQ0hTAQ2pvCOu9Vs1Cb4yMFqYbEYN3wQeoJdUtdp3zTEhCeEkmfMknCfBw1+BEhxZdC89luncwRzjchmlAChkyaN5XHT3bbzalpITad62dike+aS/RpqIcjl81itv34cDzM6FnH1G/4Jt3zEznX45+3MwEANv/Q7FIFGUgAdrDdMcLsX9XhGtbhyDsgd3HMI5aEFq/VZGytzOifmP4emHR9riPq5qvXWv62DxxwMdNnRrSaYCV5GRw92Ch9QpmHh0xYxsYFS4s3NGBnpbZHHXlcS/qTofsLty2Yst7UgeVhRj6pmGgFZNRDMaaxjBj0hCzObsm+QO3oQFT+0eWazeboJubNxp0NQpzACSmQ==;5:tSsVHHTCFEvcJGv48X5HzsGctBPTqQ6IgfZLDpwpx4De3ynOqf33gCd3PbirQYTwWmFUAGOBUDbePdGPKhf836kVUn/KMRCHmkTMl4RQy6smcpu9Ni6r6f1fU1ByMuqT/sXcuV8h/AzFEF0AgHoiC6tZED925vh3E6z2wAha8w4=;7:xHZvqWI/P6oi2AVr3axESI/2gweJDnaIgk/Wp9gToD8q2OIsvS6qDJe7+enM5snFJ58QmsJZdxQKgrtXqllwwEcCz5fIdqzesrre4HF06RPd1EzlPywu4ZJWi9l95L30NMhO9C7ZsCsPNbcPdkclkQ== x-ms-office365-filtering-correlation-id: 2a4b14c3-f591-4f40-a742-08d6486204cf x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2599; x-ms-traffictypediagnostic: BYAPR11MB2599: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(17755550239193)(21532816269658); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(3231402)(944501410)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB2599;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB2599; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(4326008)(25786009)(2906002)(6116002)(3846002)(72206003)(26005)(2351001)(14454004)(86362001)(186003)(6436002)(478600001)(6486002)(105586002)(76176011)(106356001)(2501003)(107886003)(5640700003)(54906003)(52116002)(99286004)(102836004)(53936002)(14444005)(256004)(6506007)(386003)(316002)(36756003)(486006)(8936002)(6916009)(11346002)(7736002)(305945005)(476003)(2616005)(68736007)(8676002)(71200400001)(97736004)(5660300001)(66066001)(446003)(81156014)(81166006)(6512007)(71190400001)(2900100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2599;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: Y53uBMX/DQT6qqoN+GZbLuWXtJOc0knJ2kBBFyVMuwJm9DtptACmBboXKoDDVNq9NJmKh+l/k7d/o7KaK1wrK8RrLHBkv7R5KXPSHpcMhkQuzMe2132uulY0ZnEAgXfGINUjBqr+QAyk7KFaXbqV+NfYfcZO/xPWUWe1KMuX2qPi+TBd8Fup14fo0HTBj+BryespcLHCGWLrPPNuOcXtfvucp6lj+BlUQO13SDh8qf0h48HWznrlFLOKJkxjH6Lo9wAJz4miJ8YX72WSoHQzDt/CKBZv7KjcgfeEOFZzYkQrJ4NqZVnZTyQ3dzTJqRQ7aq4xI0xC9CFnQ3kdZm1HY5Y8c8ilNCtJTlmTStEnFo0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 2a4b14c3-f591-4f40-a742-08d6486204cf X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 05:45:14.6367 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2599 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 Clubbed mac status constants inside the enum constant and also added 'WILC_' prefix to have better namespace. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.c | 15 ++++++++------- drivers/staging/wilc1000/linux_wlan.c | 4 ++-- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- drivers/staging/wilc1000/wilc_wlan_if.h | 8 +++++--- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c200d90..46b1a00 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -797,7 +797,8 @@ static void handle_connect(struct work_struct *work) } conn_attr->result(CONN_DISCONN_EVENT_CONN_RESP, - &conn_info, MAC_STATUS_DISCONNECTED, + &conn_info, + WILC_MAC_STATUS_DISCONNECTED, NULL, conn_attr->arg); hif_drv->hif_state = HOST_IF_IDLE; kfree(conn_info.req_ies); @@ -857,7 +858,7 @@ static void handle_connect_timeout(struct work_struct *work) hif_drv->usr_conn_req.conn_result(CONN_DISCONN_EVENT_CONN_RESP, &info, - MAC_STATUS_DISCONNECTED, + WILC_MAC_STATUS_DISCONNECTED, NULL, hif_drv->usr_conn_req.arg); @@ -1286,7 +1287,7 @@ static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif, memset(&conn_info, 0, sizeof(struct connect_info)); - if (mac_status == MAC_STATUS_CONNECTED) { + if (mac_status == WILC_MAC_STATUS_CONNECTED) { u32 assoc_resp_info_len; memset(hif_drv->assoc_resp, 0, MAX_ASSOC_RESP_FRAME_SIZE); @@ -1311,7 +1312,7 @@ static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif, if (hif_drv->usr_conn_req.bssid) { memcpy(conn_info.bssid, hif_drv->usr_conn_req.bssid, 6); - if (mac_status == MAC_STATUS_CONNECTED && + if (mac_status == WILC_MAC_STATUS_CONNECTED && conn_info.status == WLAN_STATUS_SUCCESS) { memcpy(hif_drv->assoc_bssid, hif_drv->usr_conn_req.bssid, ETH_ALEN); @@ -1331,7 +1332,7 @@ static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif, &conn_info, mac_status, NULL, hif_drv->usr_conn_req.arg); - if (mac_status == MAC_STATUS_CONNECTED && + if (mac_status == WILC_MAC_STATUS_CONNECTED && conn_info.status == WLAN_STATUS_SUCCESS) { wilc_set_power_mgmt(vif, 0, 0); @@ -1423,10 +1424,10 @@ static void handle_rcvd_gnrl_async_info(struct work_struct *work) mac_status = rcvd_info->buffer[7]; if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) { host_int_parse_assoc_resp_info(vif, mac_status); - } else if ((mac_status == MAC_STATUS_DISCONNECTED) && + } else if ((mac_status == WILC_MAC_STATUS_DISCONNECTED) && (hif_drv->hif_state == HOST_IF_CONNECTED)) { host_int_handle_disconnect(vif); - } else if ((mac_status == MAC_STATUS_DISCONNECTED) && + } else if ((mac_status == WILC_MAC_STATUS_DISCONNECTED) && (hif_drv->usr_scan_req.scan_result)) { del_timer(&hif_drv->scan_timer); if (hif_drv->usr_scan_req.scan_result) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 76c9012..274c4f6 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -162,7 +162,7 @@ void wilc_mac_indicate(struct wilc *wilc) s8 status; wilc_wlan_cfg_get_val(wilc, WID_STATUS, &status, 1); - if (wilc->mac_status == MAC_STATUS_INIT) { + if (wilc->mac_status == WILC_MAC_STATUS_INIT) { wilc->mac_status = status; complete(&wilc->sync_event); } else { @@ -624,7 +624,7 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif) struct wilc *wl = vif->wilc; if (!wl->initialized) { - wl->mac_status = MAC_STATUS_INIT; + wl->mac_status = WILC_MAC_STATUS_INIT; wl->close = 0; wlan_init_locks(dev); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 7b753c1..9038f8c 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -470,7 +470,7 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt, connect_status = conn_info->status; - if (mac_status == MAC_STATUS_DISCONNECTED && + if (mac_status == WILC_MAC_STATUS_DISCONNECTED && conn_info->status == WLAN_STATUS_SUCCESS) { connect_status = WLAN_STATUS_UNSPECIFIED_FAILURE; wilc_wlan_set_bssid(priv->dev, null_bssid, diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index dc40743..923b07c 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -24,9 +24,11 @@ * ********************************************/ -#define MAC_STATUS_INIT -1 -#define MAC_STATUS_CONNECTED 1 -#define MAC_STATUS_DISCONNECTED 0 +enum { + WILC_MAC_STATUS_INIT = -1, + WILC_MAC_STATUS_DISCONNECTED = 0, + WILC_MAC_STATUS_CONNECTED = 1 +}; struct tx_complete_data { int size; From patchwork Mon Nov 12 05: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: 10678149 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 D110514DB for ; Mon, 12 Nov 2018 05:45:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0684286B1 for ; Mon, 12 Nov 2018 05:45:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1CCC2A046; Mon, 12 Nov 2018 05:45:22 +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 12D16286B1 for ; Mon, 12 Nov 2018 05:45:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731223AbeKLPg7 (ORCPT ); Mon, 12 Nov 2018 10:36:59 -0500 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:32662 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbeKLPg7 (ORCPT ); Mon, 12 Nov 2018 10:36:59 -0500 X-IronPort-AV: E=Sophos;i="5.54,494,1534834800"; d="scan'208";a="23150815" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 11 Nov 2018 22:45:19 -0700 Received: from NAM05-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sun, 11 Nov 2018 22:45:19 -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=IqAtSX30llDiSvM5GaetI8jQjxUMqulUo5qLUCAN8uU=; b=iJb0ey7x1phmksd3LCKz0+/hDG3o7s0kVhrUdqvqFMSgyVhgJNm91Q4mdh8pm/h9LhORRGo0lohaFm5ZoLVZV91b4LkwXJpK+cnXNPERHruAOuvyaVGGeXFhdBiN201GFmcUEIqVTt5X7SMx0zzhLENJLgpanGfONdRLsdoeh2k= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2599.namprd11.prod.outlook.com (52.135.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Mon, 12 Nov 2018 05: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.1294.044; Mon, 12 Nov 2018 05:45:17 +0000 From: To: CC: , , , , Subject: [PATCH 06/12] staging: wilc1000: restructure macros used to handle security type Thread-Topic: [PATCH 06/12] staging: wilc1000: restructure macros used to handle security type Thread-Index: AQHUekrkDj0FgRItGUedl5uhmTXIjA== Date: Mon, 12 Nov 2018 05:45:17 +0000 Message-ID: <1542001458-20217-7-git-send-email-ajay.kathat@microchip.com> References: <1542001458-20217-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1542001458-20217-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: MA1PR01CA0135.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::29) 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: [27.59.94.109] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2599;6:9hZHnMlIOpZNLGomP5ztA84tsVWwrZ6QfYJPpBZul6Ftd3m9OhhfFIj+0vSO0o/INdy/szRxAnolTsiBjL0Pdglwq4JXwNlFcXj1uTQ3Icl+YSeEubpcLoaSspBDTGeiGfM25cCACW9whbi99/eFscwKvjAyBhd9FKCbfphBhhgg4BxCIF7nMPj14fLVoP711MouYpcqZCC/emLD9r4l4Ig6NBhWgczAVAw6YuDw3MUet+6LUwrI23S2VXjvovTLnAvn5KS1z2IPA4SOld8ThBfcIGTF+uIjMy32Jte6vJGyT/9djVtXI2HlWj4osV+KbLqSC/rjPGjvfMEZQg/qa3Jh4mUzusPicOV5a2f39VEk3r2nTmVCEtOGPTEgCNGqYrJG6ZotGM0qQPUOls53ol8X06Ty46GDZ68FT1+4SN/iUKa5SSNwmPVsitaNfqeEmHLuHf5auWV3D5dNX2uAoQ==;5:8PAoVPmj5zBxjG99BVcFSEpWP0lJjkRtJWbNOt+iBExGSaYnkRp+EGCb+4fM9owa3VJ7eMTRZZOKN4b8CKqHPoR5Efa/PF309UIpj3bXjQh/bv8dhU9Y6PrK0gcmlh8qaOGs5DwiMj2WvPIo03YzBsF/4XqpmxYGS+cgXr8y+mk=;7:8hiF7zOgoPjP9akNULgZ7haAGxr5vsarud51pe4qh9nhyPTLmzCTyE2ljdei2j5CvzMeg9ujsHZeNqZWJu9HPYB4Dtvme3eEQiUr/fsmkbbDR26ub4EPLIqNfpOas7/7gTxKVX6/zQgm2yNBhzWuYg== x-ms-office365-filtering-correlation-id: 2edc0128-1a23-46b8-f60d-08d648620686 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2599; x-ms-traffictypediagnostic: BYAPR11MB2599: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(192374486261705)(21532816269658); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(3231402)(944501410)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB2599;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB2599; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(4326008)(25786009)(2906002)(6116002)(3846002)(72206003)(26005)(2351001)(14454004)(86362001)(575784001)(186003)(6436002)(478600001)(6486002)(105586002)(15650500001)(76176011)(106356001)(2501003)(107886003)(5640700003)(54906003)(52116002)(99286004)(102836004)(53936002)(14444005)(256004)(6506007)(386003)(316002)(36756003)(486006)(8936002)(6916009)(11346002)(7736002)(305945005)(476003)(2616005)(68736007)(8676002)(71200400001)(97736004)(5660300001)(66066001)(446003)(81156014)(81166006)(6512007)(71190400001)(2900100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2599;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: DFly7RAbIyY2MwRZrAxQV5QmNRUmdvn43/qYpjhygi+1Wf7eyBPd//FwoACJM0E/KyPHA3K+LACaOXGuzLYwC/ceMFXD5TY86pvEsFnbjMteRsIk6A4sOwmf6aWyFaQIPXfRlPVmercLCpRP3/xgvH3CW7PseiRrDZglk062nzLlYnliEfZFFb/C1NV8kGaohKQhdU4ZKxIutzNliOSU3UaPrvUNMnoOYbpSycLL6ZqMppLd59uoV+jZSCFSiXfqOg8xXZnJDGbPenXgPG0MIjL/fV08UmQGkJcOEq3Qdd2MCmTUSCE1vv2VHI0KQlaDeoM+vMNFM78FTSry5+MYFFn1nX1jjpbhAHXPSDlj0Vg= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 2edc0128-1a23-46b8-f60d-08d648620686 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 05:45:17.5788 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2599 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 Restructure the code to have a proper namespace for macro defined to handle the security types. Move them as part of wilc_wlan_if.h header as along with other macro defined for firmware. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/linux_wlan.c | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 43 +++++++++-------------- drivers/staging/wilc1000/wilc_wlan_if.h | 29 ++++++++++----- 3 files changed, 38 insertions(+), 36 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 274c4f6..6f0a2cd 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -391,7 +391,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, if (!wilc_wlan_cfg_set(vif, 0, WID_POWER_MANAGEMENT, c_val, 1, 0, 0)) goto fail; - c_val[0] = NO_SECURITY; /* NO_ENCRYPT, 0x79 */ + c_val[0] = WILC_FW_SEC_NO; if (!wilc_wlan_cfg_set(vif, 0, WID_11I_MODE, c_val, 1, 0, 0)) goto fail; diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 9038f8c..4b04775 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -6,15 +6,6 @@ #include "wilc_wfi_cfgoperations.h" -#define NO_ENCRYPT 0 -#define ENCRYPT_ENABLED BIT(0) -#define WEP BIT(1) -#define WEP_EXTENDED BIT(2) -#define WPA BIT(3) -#define WPA2 BIT(4) -#define AES BIT(5) -#define TKIP BIT(6) - #define FRAME_TYPE_ID 0 #define ACTION_CAT_ID 24 #define ACTION_SUBTYPE_ID 25 @@ -655,7 +646,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, int ret; u32 i; u32 sel_bssi_idx = UINT_MAX; - u8 security = NO_ENCRYPT; + u8 security = WILC_FW_SEC_NO; enum authtype auth_type = ANY; u32 cipher_group; @@ -703,9 +694,9 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, memset(priv->wep_key_len, 0, sizeof(priv->wep_key_len)); cipher_group = sme->crypto.cipher_group; - if (cipher_group != NO_ENCRYPT) { + if (cipher_group != 0) { if (cipher_group == WLAN_CIPHER_SUITE_WEP40) { - security = ENCRYPT_ENABLED | WEP; + security = WILC_FW_SEC_WEP; priv->wep_key_len[sme->key_idx] = sme->key_len; memcpy(priv->wep_key[sme->key_idx], sme->key, @@ -715,7 +706,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, wilc_add_wep_key_bss_sta(vif, sme->key, sme->key_len, sme->key_idx); } else if (cipher_group == WLAN_CIPHER_SUITE_WEP104) { - security = ENCRYPT_ENABLED | WEP | WEP_EXTENDED; + security = WILC_FW_SEC_WEP_EXTENDED; priv->wep_key_len[sme->key_idx] = sme->key_len; memcpy(priv->wep_key[sme->key_idx], sme->key, @@ -726,14 +717,14 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, sme->key_idx); } else if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_2) { if (cipher_group == WLAN_CIPHER_SUITE_TKIP) - security = ENCRYPT_ENABLED | WPA2 | TKIP; + security = WILC_FW_SEC_WPA2_TKIP; else - security = ENCRYPT_ENABLED | WPA2 | AES; + security = WILC_FW_SEC_WPA2_AES; } else if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_1) { if (cipher_group == WLAN_CIPHER_SUITE_TKIP) - security = ENCRYPT_ENABLED | WPA | TKIP; + security = WILC_FW_SEC_WPA_TKIP; else - security = ENCRYPT_ENABLED | WPA | AES; + security = WILC_FW_SEC_WPA_AES; } else { ret = -ENOTSUPP; netdev_err(dev, "%s: Unsupported cipher\n", @@ -748,9 +739,9 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, u32 ciphers_pairwise = sme->crypto.ciphers_pairwise[i]; if (ciphers_pairwise == WLAN_CIPHER_SUITE_TKIP) - security = security | TKIP; + security |= WILC_FW_TKIP; else - security = security | AES; + security |= WILC_FW_AES; } } @@ -900,7 +891,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, struct wilc_priv *priv = wiphy_priv(wiphy); const u8 *rx_mic = NULL; const u8 *tx_mic = NULL; - u8 mode = NO_ENCRYPT; + u8 mode = WILC_FW_SEC_NO; u8 op_mode; struct wilc_vif *vif = netdev_priv(netdev); @@ -911,9 +902,9 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, wilc_wfi_cfg_copy_wep_info(priv, key_index, params); if (params->cipher == WLAN_CIPHER_SUITE_WEP40) - mode = ENCRYPT_ENABLED | WEP; + mode = WILC_FW_SEC_WEP; else - mode = ENCRYPT_ENABLED | WEP | WEP_EXTENDED; + mode = WILC_FW_SEC_WEP_EXTENDED; ret = wilc_add_wep_key_bss_ap(vif, params->key, params->key_len, @@ -951,18 +942,18 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, if (!pairwise) { if (params->cipher == WLAN_CIPHER_SUITE_TKIP) - mode = ENCRYPT_ENABLED | WPA | TKIP; + mode = WILC_FW_SEC_WPA_TKIP; else - mode = ENCRYPT_ENABLED | WPA2 | AES; + mode = WILC_FW_SEC_WPA2_AES; priv->wilc_groupkey = mode; key = priv->wilc_gtk[key_index]; } else { if (params->cipher == WLAN_CIPHER_SUITE_TKIP) - mode = ENCRYPT_ENABLED | WPA | TKIP; + mode = WILC_FW_SEC_WPA_TKIP; else - mode = priv->wilc_groupkey | AES; + mode = priv->wilc_groupkey | WILC_FW_AES; key = priv->wilc_ptk[key_index]; } diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 923b07c..a3da6e7 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -99,15 +99,26 @@ enum bus_release { }; enum { - NO_SECURITY = 0, - WEP_40 = 0x3, - WEP_104 = 0x7, - WPA_AES = 0x29, - WPA_TKIP = 0x49, - WPA_AES_TKIP = 0x69, /* Aes or Tkip */ - WPA2_AES = 0x31, - WPA2_TKIP = 0x51, - WPA2_AES_TKIP = 0x71, /* Aes or Tkip */ + WILC_FW_NO_ENCRYPT = 0, + WILC_FW_ENCRYPT_ENABLED = BIT(0), + WILC_FW_WEP = BIT(1), + WILC_FW_WEP_EXTENDED = BIT(2), + WILC_FW_WPA = BIT(3), + WILC_FW_WPA2 = BIT(4), + WILC_FW_AES = BIT(5), + WILC_FW_TKIP = BIT(6) +}; + +enum { + WILC_FW_SEC_NO = WILC_FW_NO_ENCRYPT, + WILC_FW_SEC_WEP = WILC_FW_WEP | WILC_FW_ENCRYPT_ENABLED, + WILC_FW_SEC_WEP_EXTENDED = WILC_FW_WEP_EXTENDED | WILC_FW_SEC_WEP, + WILC_FW_SEC_WPA = WILC_FW_WPA | WILC_FW_ENCRYPT_ENABLED, + WILC_FW_SEC_WPA_AES = WILC_FW_AES | WILC_FW_SEC_WPA, + WILC_FW_SEC_WPA_TKIP = WILC_FW_TKIP | WILC_FW_SEC_WPA, + WILC_FW_SEC_WPA2 = WILC_FW_WPA2 | WILC_FW_ENCRYPT_ENABLED, + WILC_FW_SEC_WPA2_AES = WILC_FW_AES | WILC_FW_SEC_WPA2, + WILC_FW_SEC_WPA2_TKIP = WILC_FW_TKIP | WILC_FW_SEC_WPA2 }; enum authtype { From patchwork Mon Nov 12 05: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: 10678151 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 B619115A6 for ; Mon, 12 Nov 2018 05:45:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A25B72A046 for ; Mon, 12 Nov 2018 05:45:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 973522A06D; Mon, 12 Nov 2018 05:45:27 +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 1FEA4286B1 for ; Mon, 12 Nov 2018 05:45:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731242AbeKLPhE (ORCPT ); Mon, 12 Nov 2018 10:37:04 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:20241 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbeKLPhD (ORCPT ); Mon, 12 Nov 2018 10:37:03 -0500 X-IronPort-AV: E=Sophos;i="5.54,494,1534834800"; d="scan'208";a="20255115" 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; 11 Nov 2018 22:45:23 -0700 Received: from NAM05-DM3-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; Sun, 11 Nov 2018 22:45:22 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B0MB0Jnzeia7owSzdl3ELiMOPiFj3/jUBr/+R/j0fhk=; b=WPYdsVvUQ0bMIEc/2oGi6w7ekoFq8V/k2qvQatWc0V+tCVSLUEYihyJGVgjCPer6H6EDMbRx5qFsjwszIEJCSGb1cwxC7FWaCAH9IibAtaAVC2RRPUhLPz3tQYsKBBcZpAqgeGoc/huglZVEme8YPvii4WWXFEMxTO4dYMbF5EM= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2599.namprd11.prod.outlook.com (52.135.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Mon, 12 Nov 2018 05: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.1294.044; Mon, 12 Nov 2018 05:45:20 +0000 From: To: CC: , , , , Subject: [PATCH 07/12] staging: wilc1000: use proper namespace for macros in wilc_wlan_if.h header Thread-Topic: [PATCH 07/12] staging: wilc1000: use proper namespace for macros in wilc_wlan_if.h header Thread-Index: AQHUekrmhVK7AUVCcUKmwdcpjqQovA== Date: Mon, 12 Nov 2018 05:45:20 +0000 Message-ID: <1542001458-20217-8-git-send-email-ajay.kathat@microchip.com> References: <1542001458-20217-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1542001458-20217-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: MA1PR01CA0135.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::29) 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: [27.59.94.109] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2599;6:xJqBs18xXECubrZJyyMVGLIiaO8bdluwGKze79ZgT9EoCJ1cENqsLh/l6iFn7dgCes2wp40Ils27yAlnuLrPWoaVS+TJYdzBfMRaTiuGOXrb6T5p3d4XQav6Dv7cxh74BlN7EIR8nxClXG5Jwm4/XoYeiJtsOkkJVyh6+a8y3jyutwszQHyH7i/S/HFwrpjDeuI1dft08o7Nkp+mNNXoqQXVrs5X+G40zTYedT1eDd1PCVGbF+j5gWdGNyG9W23wvGgeOSlu0NOVA+RpaV37UCwBVEvcVVk7K1rOvopLOpwZHdFyLPKMbqegqeIOa40TZs7RD5IMVZn0WhizTOF8DK0oyJARlIjutTVzBpxoOrQupJu+Hzrb+T2rg/tc9Kb+DDFnWY8MPPEwPn663NlYk+muoB4VWCzsMT/PErwyf9BMSz2TX1lcgT92uMIbDUOEa8g8p1DyJtLrTemL/lWiQg==;5:sWnPMQ13pQ/kw1FGU4ZLkXwLKEMITNAjmdVFeqtGhzQcwtQjRHCj1lrUY5KsPTExoemoJ35N9jDKYSMQ+O3pHLINq//+h4e4L6jjiJmxRT6uo5t+/80fbFBAfvSvwXkIEQo7N65naOp0MpErBJ3Sb8eyfw8FVAcaza4tIjVJ/tw=;7:sOrtxO1MdlRiw69eYYMteSeALgAEPoHuC+KLp+afE4xs8fsvAY3JmPqEKA2CsO1PfMpfRvhOfn1wy0JFAnToaum0PZGIu9y+oVQdSWzLk7XAD2cuvz1KvBpdpWM4pT12QZJt0SE5XdZzGcxkpNLqdQ== x-ms-office365-filtering-correlation-id: 92e18999-a094-4bb1-6447-08d648620842 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2599; x-ms-traffictypediagnostic: BYAPR11MB2599: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(21532816269658)(192374486261705); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(3231402)(944501410)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB2599;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB2599; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(4326008)(25786009)(2906002)(6116002)(3846002)(72206003)(26005)(2351001)(14454004)(86362001)(575784001)(186003)(6436002)(478600001)(6486002)(105586002)(76176011)(106356001)(2501003)(107886003)(5640700003)(54906003)(52116002)(99286004)(102836004)(53936002)(14444005)(53946003)(256004)(6506007)(386003)(316002)(36756003)(486006)(8936002)(6916009)(11346002)(7736002)(305945005)(476003)(2616005)(68736007)(8676002)(71200400001)(97736004)(5660300001)(66066001)(446003)(81156014)(81166006)(6512007)(71190400001)(2900100001)(4744004)(579004);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2599;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: 0brY1ziTJuIuu69AKdqhqeo7CDWTios39vGOff04+PUG62ai9pGK8Gtf4YHGcBE7UP6p4fn3XHr8losB9oKq1EM0gWts+d0j7pgg4WBTD8dT2SSAAYlGDi48zFB2VdZRKZA30b7sKC1WqLwZMnsjFdwJoQtWNLNG100hqwS2cAkLazWn/iv+4k+xiEQ/3ZWMlQT18MVLwy97c12vsuTXhzpTmMIxXcir0R1BK2Mpfo6N2X32vtkEYXDGRmnvuhdGakqt2pw3zuNWP68VvOoWx3GCi5SAWiCiHj0qqSgchNLD3vxCqOcXafB+id/ByOKynWXMoSuhPGqnu1IMegRgemFmA+TvM9mDYs9oopYS5Dc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 92e18999-a094-4bb1-6447-08d648620842 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 05:45:20.6330 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2599 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Rename the macros defined in wilc_wlan_if.h header to have clear namespace. As convention used 'WILC_FW_' prefix for constants defined for firmware and 'WILC_' prefix for driver constants. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.c | 6 +- drivers/staging/wilc1000/linux_wlan.c | 32 +++--- drivers/staging/wilc1000/wilc_sdio.c | 3 +- drivers/staging/wilc1000/wilc_spi.c | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +-- drivers/staging/wilc1000/wilc_wlan.c | 88 +++++++-------- drivers/staging/wilc1000/wilc_wlan_if.h | 128 +++++++++++----------- 7 files changed, 138 insertions(+), 135 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 46b1a00..4dfdc7c 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -684,7 +684,7 @@ static void handle_connect(struct work_struct *work) cur_byte[conn_attr->ssid_len] = '\0'; } cur_byte += MAX_SSID_LEN; - *(cur_byte++) = INFRASTRUCTURE; + *(cur_byte++) = WILC_FW_BSS_TYPE_INFRA; if (conn_attr->ch >= 1 && conn_attr->ch <= 14) { *(cur_byte++) = conn_attr->ch; @@ -2321,9 +2321,9 @@ static void handle_power_management(struct work_struct *work) wid.id = WID_POWER_MANAGEMENT; if (pm_param->enabled) - power_mode = MIN_FAST_PS; + power_mode = WILC_FW_MIN_FAST_PS; else - power_mode = NO_POWERSAVE; + power_mode = WILC_FW_NO_POWERSAVE; wid.val = &power_mode; wid.size = sizeof(char); diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 6f0a2cd..c4787bb 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -338,7 +338,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, if (!wilc_wlan_cfg_set(vif, 0, WID_PC_TEST_MODE, c_val, 1, 0, 0)) goto fail; - c_val[0] = INFRASTRUCTURE; + c_val[0] = WILC_FW_BSS_TYPE_INFRA; if (!wilc_wlan_cfg_set(vif, 0, WID_BSS_TYPE, c_val, 1, 0, 0)) goto fail; @@ -346,7 +346,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, if (!wilc_wlan_cfg_set(vif, 0, WID_CURRENT_TX_RATE, c_val, 1, 0, 0)) goto fail; - c_val[0] = G_MIXED_11B_2_MODE; + c_val[0] = WILC_FW_OPER_MODE_G_MIXED_11B_2; if (!wilc_wlan_cfg_set(vif, 0, WID_11G_OPERATING_MODE, c_val, 1, 0, 0)) goto fail; @@ -355,19 +355,19 @@ static int linux_wlan_init_test_config(struct net_device *dev, if (!wilc_wlan_cfg_set(vif, 0, WID_CURRENT_CHANNEL, c_val, 1, 0, 0)) goto fail; - c_val[0] = G_SHORT_PREAMBLE; + c_val[0] = WILC_FW_PREAMBLE_SHORT; if (!wilc_wlan_cfg_set(vif, 0, WID_PREAMBLE, c_val, 1, 0, 0)) goto fail; - c_val[0] = AUTO_PROT; + c_val[0] = WILC_FW_11N_PROT_AUTO; if (!wilc_wlan_cfg_set(vif, 0, WID_11N_PROT_MECH, c_val, 1, 0, 0)) goto fail; - c_val[0] = ACTIVE_SCAN; + c_val[0] = WILC_FW_ACTIVE_SCAN; if (!wilc_wlan_cfg_set(vif, 0, WID_SCAN_TYPE, c_val, 1, 0, 0)) goto fail; - c_val[0] = SITE_SURVEY_OFF; + c_val[0] = WILC_FW_SITE_SURVEY_OFF; if (!wilc_wlan_cfg_set(vif, 0, WID_SITE_SURVEY, c_val, 1, 0, 0)) goto fail; @@ -387,7 +387,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, if (!wilc_wlan_cfg_set(vif, 0, WID_QOS_ENABLE, c_val, 1, 0, 0)) goto fail; - c_val[0] = NO_POWERSAVE; + c_val[0] = WILC_FW_NO_POWERSAVE; if (!wilc_wlan_cfg_set(vif, 0, WID_POWER_MANAGEMENT, c_val, 1, 0, 0)) goto fail; @@ -395,7 +395,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, if (!wilc_wlan_cfg_set(vif, 0, WID_11I_MODE, c_val, 1, 0, 0)) goto fail; - c_val[0] = OPEN_SYSTEM; + c_val[0] = WILC_FW_AUTH_OPEN_SYSTEM; if (!wilc_wlan_cfg_set(vif, 0, WID_AUTH_TYPE, c_val, 1, 0, 0)) goto fail; @@ -429,7 +429,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, if (!wilc_wlan_cfg_set(vif, 0, WID_DTIM_PERIOD, c_val, 1, 0, 0)) goto fail; - c_val[0] = NORMAL_ACK; + c_val[0] = WILC_FW_ACK_POLICY_NORMAL; if (!wilc_wlan_cfg_set(vif, 0, WID_ACK_POLICY, c_val, 1, 0, 0)) goto fail; @@ -452,7 +452,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, if (!wilc_wlan_cfg_set(vif, 0, WID_BEACON_INTERVAL, c_val, 2, 0, 0)) goto fail; - c_val[0] = REKEY_DISABLE; + c_val[0] = WILC_FW_REKEY_POLICY_DISABLE; if (!wilc_wlan_cfg_set(vif, 0, WID_REKEY_POLICY, c_val, 1, 0, 0)) goto fail; @@ -470,7 +470,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, 0)) goto fail; - c_val[0] = G_SELF_CTS_PROT; + c_val[0] = WILC_FW_ERP_PROT_SELF_CTS; if (!wilc_wlan_cfg_set(vif, 0, WID_11N_ERP_PROT_TYPE, c_val, 1, 0, 0)) goto fail; @@ -478,7 +478,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, if (!wilc_wlan_cfg_set(vif, 0, WID_11N_ENABLE, c_val, 1, 0, 0)) goto fail; - c_val[0] = HT_MIXED_MODE; + c_val[0] = WILC_FW_11N_OP_MODE_HT_MIXED; if (!wilc_wlan_cfg_set(vif, 0, WID_11N_OPERATING_MODE, c_val, 1, 0, 0)) goto fail; @@ -488,12 +488,12 @@ static int linux_wlan_init_test_config(struct net_device *dev, 0)) goto fail; - c_val[0] = DETECT_PROTECT_REPORT; + c_val[0] = WILC_FW_OBBS_NONHT_DETECT_PROTECT_REPORT; if (!wilc_wlan_cfg_set(vif, 0, WID_11N_OBSS_NONHT_DETECTION, c_val, 1, 0, 0)) goto fail; - c_val[0] = RTS_CTS_NONHT_PROT; + c_val[0] = WILC_FW_HT_PROT_RTS_CTS_NONHT; if (!wilc_wlan_cfg_set(vif, 0, WID_11N_HT_PROT_TYPE, c_val, 1, 0, 0)) goto fail; @@ -502,7 +502,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, 0)) goto fail; - c_val[0] = MIMO_MODE; + c_val[0] = WILC_FW_SMPS_MODE_MIMO; if (!wilc_wlan_cfg_set(vif, 0, WID_11N_SMPS_MODE, c_val, 1, 0, 0)) goto fail; @@ -1070,7 +1070,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, wl->io_type = io_type; wl->hif_func = ops; wl->enable_ps = true; - wl->chip_ps_state = CHIP_WAKEDUP; + wl->chip_ps_state = WILC_CHIP_WAKEDUP; INIT_LIST_HEAD(&wl->txq_head.list); INIT_LIST_HEAD(&wl->rxq_head.list); diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index 779614e..27fdfbd 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -144,7 +144,8 @@ static int linux_sdio_probe(struct sdio_func *func, } dev_dbg(&func->dev, "Initializing netdev\n"); - ret = wilc_netdev_init(&wilc, &func->dev, HIF_SDIO, &wilc_hif_sdio); + ret = wilc_netdev_init(&wilc, &func->dev, WILC_HIF_SDIO, + &wilc_hif_sdio); if (ret) { dev_err(&func->dev, "Couldn't initialize netdev\n"); kfree(sdio_priv); diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c index cef127b..35ff432 100644 --- a/drivers/staging/wilc1000/wilc_spi.c +++ b/drivers/staging/wilc1000/wilc_spi.c @@ -120,7 +120,7 @@ static int wilc_bus_probe(struct spi_device *spi) dev_err(&spi->dev, "failed to get the irq gpio\n"); } - ret = wilc_netdev_init(&wilc, NULL, HIF_SPI, &wilc_hif_spi); + ret = wilc_netdev_init(&wilc, NULL, WILC_HIF_SPI, &wilc_hif_spi); if (ret) { kfree(spi_priv); return ret; diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 4b04775..b882fe9 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -612,14 +612,14 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) &hidden_ntwk)) return -ENOMEM; - ret = wilc_scan(vif, USER_SCAN, ACTIVE_SCAN, + ret = wilc_scan(vif, USER_SCAN, WILC_FW_ACTIVE_SCAN, scan_ch_list, request->n_channels, (const u8 *)request->ie, request->ie_len, cfg_scan_result, (void *)priv, &hidden_ntwk); } else { - ret = wilc_scan(vif, USER_SCAN, ACTIVE_SCAN, + ret = wilc_scan(vif, USER_SCAN, WILC_FW_ACTIVE_SCAN, scan_ch_list, request->n_channels, (const u8 *)request->ie, @@ -647,7 +647,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, u32 i; u32 sel_bssi_idx = UINT_MAX; u8 security = WILC_FW_SEC_NO; - enum authtype auth_type = ANY; + enum authtype auth_type = WILC_FW_AUTH_ANY; u32 cipher_group; vif->connecting = true; @@ -747,11 +747,11 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, switch (sme->auth_type) { case NL80211_AUTHTYPE_OPEN_SYSTEM: - auth_type = OPEN_SYSTEM; + auth_type = WILC_FW_AUTH_OPEN_SYSTEM; break; case NL80211_AUTHTYPE_SHARED_KEY: - auth_type = SHARED_KEY; + auth_type = WILC_FW_AUTH_SHARED_KEY; break; default: @@ -760,7 +760,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, if (sme->crypto.n_akm_suites) { if (sme->crypto.akm_suites[0] == WLAN_AKM_SUITE_8021X) - auth_type = IEEE8021; + auth_type = WILC_FW_AUTH_IEEE8021; } curr_channel = nw_info->ch; @@ -909,7 +909,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, ret = wilc_add_wep_key_bss_ap(vif, params->key, params->key_len, key_index, mode, - OPEN_SYSTEM); + WILC_FW_AUTH_OPEN_SYSTEM); break; } if (memcmp(params->key, priv->wep_key[key_index], diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index a48c906..d474b87 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -17,13 +17,13 @@ static inline bool is_wilc1000(u32 id) static inline void acquire_bus(struct wilc *wilc, enum bus_acquire acquire) { mutex_lock(&wilc->hif_cs); - if (acquire == ACQUIRE_AND_WAKEUP) + if (acquire == WILC_BUS_ACQUIRE_AND_WAKEUP) chip_wakeup(wilc); } static inline void release_bus(struct wilc *wilc, enum bus_release release) { - if (release == RELEASE_ALLOW_SLEEP) + if (release == WILC_BUS_RELEASE_ALLOW_SLEEP) chip_allow_sleep(wilc); mutex_unlock(&wilc->hif_cs); } @@ -399,7 +399,7 @@ void chip_wakeup(struct wilc *wilc) { u32 reg, clk_status_reg; - if ((wilc->io_type & 0x1) == HIF_SPI) { + if ((wilc->io_type & 0x1) == WILC_HIF_SPI) { do { wilc->hif_func->hif_read_reg(wilc, 1, ®); wilc->hif_func->hif_write_reg(wilc, 1, reg | BIT(1)); @@ -410,7 +410,7 @@ void chip_wakeup(struct wilc *wilc) wilc_get_chipid(wilc, true); } while (wilc_get_chipid(wilc, true) == 0); } while (wilc_get_chipid(wilc, true) == 0); - } else if ((wilc->io_type & 0x1) == HIF_SDIO) { + } else if ((wilc->io_type & 0x1) == WILC_HIF_SDIO) { wilc->hif_func->hif_write_reg(wilc, 0xfa, 1); usleep_range(200, 400); wilc->hif_func->hif_read_reg(wilc, 0xf0, ®); @@ -433,7 +433,7 @@ void chip_wakeup(struct wilc *wilc) } while ((clk_status_reg & 0x1) == 0); } - if (wilc->chip_ps_state == CHIP_SLEEPING_MANUAL) { + if (wilc->chip_ps_state == WILC_CHIP_SLEEPING_MANUAL) { if (wilc_get_chipid(wilc, false) < 0x1002b0) { u32 val32; @@ -446,37 +446,37 @@ void chip_wakeup(struct wilc *wilc) wilc->hif_func->hif_write_reg(wilc, 0x1e9c, val32); } } - wilc->chip_ps_state = CHIP_WAKEDUP; + wilc->chip_ps_state = WILC_CHIP_WAKEDUP; } EXPORT_SYMBOL_GPL(chip_wakeup); void wilc_chip_sleep_manually(struct wilc *wilc) { - if (wilc->chip_ps_state != CHIP_WAKEDUP) + if (wilc->chip_ps_state != WILC_CHIP_WAKEDUP) return; - acquire_bus(wilc, ACQUIRE_ONLY); + acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); chip_allow_sleep(wilc); wilc->hif_func->hif_write_reg(wilc, 0x10a8, 1); - wilc->chip_ps_state = CHIP_SLEEPING_MANUAL; - release_bus(wilc, RELEASE_ONLY); + wilc->chip_ps_state = WILC_CHIP_SLEEPING_MANUAL; + release_bus(wilc, WILC_BUS_RELEASE_ONLY); } EXPORT_SYMBOL_GPL(wilc_chip_sleep_manually); void host_wakeup_notify(struct wilc *wilc) { - acquire_bus(wilc, ACQUIRE_ONLY); + acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); wilc->hif_func->hif_write_reg(wilc, 0x10b0, 1); - release_bus(wilc, RELEASE_ONLY); + release_bus(wilc, WILC_BUS_RELEASE_ONLY); } EXPORT_SYMBOL_GPL(host_wakeup_notify); void host_sleep_notify(struct wilc *wilc) { - acquire_bus(wilc, ACQUIRE_ONLY); + acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); wilc->hif_func->hif_write_reg(wilc, 0x10ac, 1); - release_bus(wilc, RELEASE_ONLY); + release_bus(wilc, WILC_BUS_RELEASE_ONLY); } EXPORT_SYMBOL_GPL(host_sleep_notify); @@ -541,7 +541,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) goto out; vmm_table[i] = 0x0; - acquire_bus(wilc, ACQUIRE_AND_WAKEUP); + acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); counter = 0; func = wilc->hif_func; do { @@ -584,7 +584,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) entries = ((reg >> 3) & 0x3f); break; } - release_bus(wilc, RELEASE_ALLOW_SLEEP); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); } while (--timeout); if (timeout <= 0) { ret = func->hif_write_reg(wilc, WILC_HOST_VMM_CTL, 0x0); @@ -615,7 +615,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) goto out_release_bus; } - release_bus(wilc, RELEASE_ALLOW_SLEEP); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); offset = 0; i = 0; @@ -667,7 +667,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) kfree(tqe); } while (--entries); - acquire_bus(wilc, ACQUIRE_AND_WAKEUP); + acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); ret = func->hif_clear_int_ext(wilc, ENABLE_TX_VMM); if (!ret) @@ -676,7 +676,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) ret = func->hif_block_tx_ext(wilc, 0, txb, offset); out_release_bus: - release_bus(wilc, RELEASE_ALLOW_SLEEP); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); out: mutex_unlock(&wilc->txq_add_to_head_cs); @@ -775,7 +775,7 @@ static void wilc_pllupdate_isr_ext(struct wilc *wilc, u32 int_stats) wilc->hif_func->hif_clear_int_ext(wilc, PLL_INT_CLR); - if (wilc->io_type == HIF_SDIO) + if (wilc->io_type == WILC_HIF_SDIO) mdelay(WILC_PLL_TO_SDIO); else mdelay(WILC_PLL_TO_SPI); @@ -835,7 +835,7 @@ void wilc_handle_isr(struct wilc *wilc) { u32 int_status; - acquire_bus(wilc, ACQUIRE_AND_WAKEUP); + acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); wilc->hif_func->hif_read_int(wilc, &int_status); if (int_status & PLL_INT_EXT) @@ -850,7 +850,7 @@ void wilc_handle_isr(struct wilc *wilc) if (!(int_status & (ALL_INT_EXT))) wilc_unknown_isr_ext(wilc); - release_bus(wilc, RELEASE_ALLOW_SLEEP); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); } EXPORT_SYMBOL_GPL(wilc_handle_isr); @@ -874,7 +874,7 @@ int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer, memcpy(&size, &buffer[offset + 4], 4); le32_to_cpus(&addr); le32_to_cpus(&size); - acquire_bus(wilc, ACQUIRE_ONLY); + acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); offset += 8; while (((int)size) && (offset < buffer_size)) { if (size <= blksz) @@ -892,7 +892,7 @@ int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer, offset += size2; size -= size2; } - release_bus(wilc, RELEASE_ONLY); + release_bus(wilc, WILC_BUS_RELEASE_ONLY); if (!ret) { ret = -EIO; @@ -913,20 +913,20 @@ int wilc_wlan_start(struct wilc *wilc) int ret; u32 chipid; - if (wilc->io_type == HIF_SDIO) { + if (wilc->io_type == WILC_HIF_SDIO) { reg = 0; reg |= BIT(3); - } else if (wilc->io_type == HIF_SPI) { + } else if (wilc->io_type == WILC_HIF_SPI) { reg = 1; } - acquire_bus(wilc, ACQUIRE_ONLY); + acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); ret = wilc->hif_func->hif_write_reg(wilc, WILC_VMM_CORE_CFG, reg); if (!ret) { - release_bus(wilc, RELEASE_ONLY); + release_bus(wilc, WILC_BUS_RELEASE_ONLY); return -EIO; } reg = 0; - if (wilc->io_type == HIF_SDIO && wilc->dev_irq_num) + if (wilc->io_type == WILC_HIF_SDIO && wilc->dev_irq_num) reg |= WILC_HAVE_SDIO_IRQ_GPIO; #ifdef WILC_DISABLE_PMU @@ -954,7 +954,7 @@ int wilc_wlan_start(struct wilc *wilc) ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_1, reg); if (!ret) { - release_bus(wilc, RELEASE_ONLY); + release_bus(wilc, WILC_BUS_RELEASE_ONLY); return -EIO; } @@ -962,7 +962,7 @@ int wilc_wlan_start(struct wilc *wilc) ret = wilc->hif_func->hif_read_reg(wilc, 0x1000, &chipid); if (!ret) { - release_bus(wilc, RELEASE_ONLY); + release_bus(wilc, WILC_BUS_RELEASE_ONLY); return -EIO; } @@ -976,7 +976,7 @@ int wilc_wlan_start(struct wilc *wilc) reg |= BIT(10); ret = wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); - release_bus(wilc, RELEASE_ONLY); + release_bus(wilc, WILC_BUS_RELEASE_ONLY); return (ret < 0) ? ret : 0; } @@ -987,18 +987,18 @@ int wilc_wlan_stop(struct wilc *wilc) int ret; u8 timeout = 10; - acquire_bus(wilc, ACQUIRE_AND_WAKEUP); + acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); ret = wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); if (!ret) { - release_bus(wilc, RELEASE_ALLOW_SLEEP); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); return ret; } reg &= ~BIT(10); ret = wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); if (!ret) { - release_bus(wilc, RELEASE_ALLOW_SLEEP); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); return ret; } @@ -1006,7 +1006,7 @@ int wilc_wlan_stop(struct wilc *wilc) ret = wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); if (!ret) { - release_bus(wilc, RELEASE_ALLOW_SLEEP); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); return ret; } @@ -1021,7 +1021,7 @@ int wilc_wlan_stop(struct wilc *wilc) WILC_GLB_RESET_0, ®); if (!ret) { - release_bus(wilc, RELEASE_ALLOW_SLEEP); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); return ret; } break; @@ -1036,7 +1036,7 @@ int wilc_wlan_stop(struct wilc *wilc) ret = wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); - release_bus(wilc, RELEASE_ALLOW_SLEEP); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); return ret; } @@ -1072,18 +1072,18 @@ void wilc_wlan_cleanup(struct net_device *dev) kfree(wilc->tx_buffer); wilc->tx_buffer = NULL; - acquire_bus(wilc, ACQUIRE_AND_WAKEUP); + acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, ®); if (!ret) - release_bus(wilc, RELEASE_ALLOW_SLEEP); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0, (reg | ABORT_INT)); if (!ret) - release_bus(wilc, RELEASE_ALLOW_SLEEP); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); - release_bus(wilc, RELEASE_ALLOW_SLEEP); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); wilc->hif_func->hif_deinit(NULL); } @@ -1245,7 +1245,7 @@ static u32 init_chip(struct net_device *dev) struct wilc_vif *vif = netdev_priv(dev); struct wilc *wilc = vif->wilc; - acquire_bus(wilc, ACQUIRE_ONLY); + acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); chipid = wilc_get_chipid(wilc, true); @@ -1268,7 +1268,7 @@ static u32 init_chip(struct net_device *dev) } } - release_bus(wilc, RELEASE_ONLY); + release_bus(wilc, WILC_BUS_RELEASE_ONLY); return ret; } diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index a3da6e7..c7e745d 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -15,8 +15,10 @@ * ********************************************/ -#define HIF_SDIO (0) -#define HIF_SPI BIT(0) +enum { + WILC_HIF_SDIO = 0, + WILC_HIF_SPI = BIT(0) +}; /******************************************** * @@ -51,51 +53,51 @@ typedef void (*wilc_tx_complete_func_t)(void *, int); #define MAX_RATES_SUPPORTED 12 enum bss_types { - INFRASTRUCTURE = 0, - INDEPENDENT, - AP, + WILC_FW_BSS_TYPE_INFRA = 0, + WILC_FW_BSS_TYPE_INDEPENDENT, + WILC_FW_BSS_TYPE_AP, }; enum { - B_ONLY_MODE = 0, /* 1, 2 M, otherwise 5, 11 M */ - G_ONLY_MODE, /* 6,12,24 otherwise 9,18,36,48,54 */ - G_MIXED_11B_1_MODE, /* 1,2,5.5,11 otherwise all on */ - G_MIXED_11B_2_MODE, /* 1,2,5,11,6,12,24 otherwise all on */ + WILC_FW_OPER_MODE_B_ONLY = 0, /* 1, 2 M, otherwise 5, 11 M */ + WILC_FW_OPER_MODE_G_ONLY, /* 6,12,24 otherwise 9,18,36,48,54 */ + WILC_FW_OPER_MODE_G_MIXED_11B_1, /* 1,2,5.5,11 otherwise all on */ + WILC_FW_OPER_MODE_G_MIXED_11B_2, /* 1,2,5,11,6,12,24 otherwise all on */ }; enum { - G_SHORT_PREAMBLE = 0, /* Short Preamble */ - G_LONG_PREAMBLE = 1, /* Long Preamble */ - G_AUTO_PREAMBLE = 2, /* Auto Preamble Selection */ + WILC_FW_PREAMBLE_SHORT = 0, /* Short Preamble */ + WILC_FW_PREAMBLE_LONG = 1, /* Long Preamble */ + WILC_FW_PREAMBLE_AUTO = 2, /* Auto Preamble Selection */ }; enum { - PASSIVE_SCAN = 0, - ACTIVE_SCAN = 1, + WILC_FW_PASSIVE_SCAN = 0, + WILC_FW_ACTIVE_SCAN = 1, }; enum { - NO_POWERSAVE = 0, - MIN_FAST_PS = 1, - MAX_FAST_PS = 2, - MIN_PSPOLL_PS = 3, - MAX_PSPOLL_PS = 4 + WILC_FW_NO_POWERSAVE = 0, + WILC_FW_MIN_FAST_PS = 1, + WILC_FW_MAX_FAST_PS = 2, + WILC_FW_MIN_PSPOLL_PS = 3, + WILC_FW_MAX_PSPOLL_PS = 4 }; enum chip_ps_states { - CHIP_WAKEDUP = 0, - CHIP_SLEEPING_AUTO = 1, - CHIP_SLEEPING_MANUAL = 2 + WILC_CHIP_WAKEDUP = 0, + WILC_CHIP_SLEEPING_AUTO = 1, + WILC_CHIP_SLEEPING_MANUAL = 2 }; enum bus_acquire { - ACQUIRE_ONLY = 0, - ACQUIRE_AND_WAKEUP = 1, + WILC_BUS_ACQUIRE_ONLY = 0, + WILC_BUS_ACQUIRE_AND_WAKEUP = 1, }; enum bus_release { - RELEASE_ONLY = 0, - RELEASE_ALLOW_SLEEP = 1, + WILC_BUS_RELEASE_ONLY = 0, + WILC_BUS_RELEASE_ALLOW_SLEEP = 1, }; enum { @@ -122,73 +124,73 @@ enum { }; enum authtype { - OPEN_SYSTEM = 1, - SHARED_KEY = 2, - ANY = 3, - IEEE8021 = 5 + WILC_FW_AUTH_OPEN_SYSTEM = 1, + WILC_FW_AUTH_SHARED_KEY = 2, + WILC_FW_AUTH_ANY = 3, + WILC_FW_AUTH_IEEE8021 = 5 }; enum site_survey { - SITE_SURVEY_1CH = 0, - SITE_SURVEY_ALL_CH = 1, - SITE_SURVEY_OFF = 2 + WILC_FW_SITE_SURVEY_1CH = 0, + WILC_FW_SITE_SURVEY_ALL_CH = 1, + WILC_FW_SITE_SURVEY_OFF = 2 }; enum { - NORMAL_ACK = 0, - NO_ACK, + WILC_FW_ACK_POLICY_NORMAL = 0, + WILC_FW_ACK_NO_POLICY, }; enum { - REKEY_DISABLE = 1, - REKEY_TIME_BASE, - REKEY_PKT_BASE, - REKEY_TIME_PKT_BASE + WILC_FW_REKEY_POLICY_DISABLE = 1, + WILC_FW_REKEY_POLICY_TIME_BASE, + WILC_FW_REKEY_POLICY_PKT_BASE, + WILC_FW_REKEY_POLICY_TIME_PKT_BASE }; enum { - FILTER_NO = 0x00, - FILTER_AP_ONLY = 0x01, - FILTER_STA_ONLY = 0x02 + WILC_FW_FILTER_NO = 0x00, + WILC_FW_FILTER_AP_ONLY = 0x01, + WILC_FW_FILTER_STA_ONLY = 0x02 }; enum { - AUTO_PROT = 0, /* Auto */ - NO_PROT, /* Do not use any protection */ - ERP_PROT, /* Protect all ERP frame exchanges */ - HT_PROT, /* Protect all HT frame exchanges */ - GF_PROT, /* Protect all GF frame exchanges */ + WILC_FW_11N_PROT_AUTO = 0, /* Auto */ + WILC_FW_11N_NO_PROT, /* Do not use any protection */ + WILC_FW_11N_PROT_ERP, /* Protect all ERP frame exchanges */ + WILC_FW_11N_PROT_HT, /* Protect all HT frame exchanges */ + WILC_FW_11N_PROT_GF /* Protect all GF frame exchanges */ }; enum { - G_SELF_CTS_PROT, - G_RTS_CTS_PROT, + WILC_FW_ERP_PROT_SELF_CTS, + WILC_FW_ERP_PROT_RTS_CTS, }; enum { - HT_MIXED_MODE = 1, - HT_ONLY_20MHZ_MODE, - HT_ONLY_20_40MHZ_MODE, + WILC_FW_11N_OP_MODE_HT_MIXED = 1, + WILC_FW_11N_OP_MODE_HT_ONLY_20MHZ, + WILC_FW_11N_OP_MODE_HT_ONLY_20_40MHZ, }; enum { - NO_DETECT = 0, - DETECT_ONLY = 1, - DETECT_PROTECT = 2, - DETECT_PROTECT_REPORT = 3, + WILC_FW_OBBS_NONHT_NO_DETECT = 0, + WILC_FW_OBBS_NONHT_DETECT_ONLY = 1, + WILC_FW_OBBS_NONHT_DETECT_PROTECT = 2, + WILC_FW_OBBS_NONHT_DETECT_PROTECT_REPORT = 3, }; enum { - RTS_CTS_NONHT_PROT = 0, /* RTS-CTS at non-HT rate */ - FIRST_FRAME_NONHT_PROT, /* First frame at non-HT rate */ - LSIG_TXOP_PROT, /* LSIG TXOP Protection */ - FIRST_FRAME_MIXED_PROT, /* First frame at Mixed format */ + WILC_FW_HT_PROT_RTS_CTS_NONHT = 0, /* RTS-CTS at non-HT rate */ + WILC_FW_HT_PROT_FIRST_FRAME_NONHT, /* First frame at non-HT rate */ + WILC_FW_HT_PROT_LSIG_TXOP, /* LSIG TXOP Protection */ + WILC_FW_HT_PROT_FIRST_FRAME_MIXED, /* First frame at Mixed format */ }; enum { - STATIC_MODE = 1, - DYNAMIC_MODE = 2, - MIMO_MODE = 3, /* power save disable */ + WILC_FW_SMPS_MODE_STATIC = 1, + WILC_FW_SMPS_MODE_DYNAMIC = 2, + WILC_FW_SMPS_MODE_MIMO = 3, /* power save disable */ }; enum wid_type { From patchwork Mon Nov 12 05: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: 10678153 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 1E0931759 for ; Mon, 12 Nov 2018 05:45:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E72E286B1 for ; Mon, 12 Nov 2018 05:45:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 030FA2A046; Mon, 12 Nov 2018 05:45:27 +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 784FC2A048 for ; Mon, 12 Nov 2018 05:45:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731272AbeKLPhF (ORCPT ); Mon, 12 Nov 2018 10:37:05 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:20241 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbeKLPhF (ORCPT ); Mon, 12 Nov 2018 10:37:05 -0500 X-IronPort-AV: E=Sophos;i="5.54,494,1534834800"; d="scan'208";a="20255117" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 11 Nov 2018 22:45:25 -0700 Received: from NAM05-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sun, 11 Nov 2018 22:45:25 -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=Rtk/jJxbqZeEVvgYuNk/7RkZRjGzoGb1PngjnBTR8Dg=; b=Ndx3c4uzXsLcrh3gaXDQHDLq2N5u0h4XGzwPa8g35xTF5RtHl2WzDBLNxZE5Z30N6JQXTMYGQk/tpdgt6YYRRWwjkPj2k9/zPEyDbBYczWSSL01zDK6Ah+qEzJ21AXLlZ8XUuhTseZIxJ4c0qJMCQ5E1yLtv0KVcQclGwKsVeXs= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2599.namprd11.prod.outlook.com (52.135.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Mon, 12 Nov 2018 05: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.1294.044; Mon, 12 Nov 2018 05:45:23 +0000 From: To: CC: , , , , Subject: [PATCH 08/12] staging: wilc1000: move current_tx_rate enum to wilc_wlan_if.h file Thread-Topic: [PATCH 08/12] staging: wilc1000: move current_tx_rate enum to wilc_wlan_if.h file Thread-Index: AQHUekrnIwzI7H2ssEWuH+WDdGOmLw== Date: Mon, 12 Nov 2018 05:45:23 +0000 Message-ID: <1542001458-20217-9-git-send-email-ajay.kathat@microchip.com> References: <1542001458-20217-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1542001458-20217-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: MA1PR01CA0135.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::29) 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: [27.59.94.109] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2599;6:MDYrfXve7+9y3UT72gNoVYLXRmyqiEwPzw/z7Xw8ni/XrfdgeVsRK5XgoHS5qqpvHK90FphKzuXxE83snusWucZy66EN7ru7i9Ylmv9SV99H7Fhv6XRYQTh0BbyBPzlC58pI/JUojmjz4NT11BxQl/MBb2voOVDR+6fCkdI0QaCnJ+IotRxtZ3xspCZPIE2KYURT+OKdAbOjJi7UknKoBFp8Pjbk/iyQ8/plWUjKfHzZ8PpWrGh2nh7N9uxvNmk6OP4M7QC2VZXcqB3UG1VRBJGAXluGtw5aP8yjDEpZ6m7Lz3x36H88yV+hSp3SVyipKEBus4yZ2y008cp4YZ83SeowHHj77PTzHOWalXepQMtMhyZX0qYE3wH8JFJX90t45bEzPLay1xguGCctgrXMKU4GtVGXz3OPVvZ815c4Yj8dsncq7L6US/fFvHz+9Wa/SwFV0Imt2K2lU3MdMhM2WA==;5:nnLDN8axx7SeRLTk7fWy1RM4gXOiHF/Mnepe/VIfK6NOGhkBdG0trTJc+4iusYafDxKYYlZJODLGHqjGQuIaUxiD2d9OPNhtfHAtg9QnBYjad/1C7oBODjycgWqVv7ADP2lc0x95fswiXKnRDP1WvGYaivImVrfq2DCl4ILV1ko=;7:d69S7eSeoPfGg83iYWLCuHAHNQ2fhYBlN1OnjNQMxUSTMmUjdAo1b06PLeWYMJ/Ffeznv06PjXYyla3Foix/rVYOMuZxDE1YksK8dofjPGEwjAHy3i5V0lEfFEIvLjLnhNivlezasBiG+y80zTqyDA== x-ms-office365-filtering-correlation-id: ae660515-3e52-4e0a-b63f-08d648620a16 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2599; x-ms-traffictypediagnostic: BYAPR11MB2599: 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)(3002001)(3231402)(944501410)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB2599;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB2599; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(4326008)(25786009)(2906002)(6116002)(3846002)(72206003)(26005)(2351001)(14454004)(86362001)(186003)(6436002)(478600001)(6486002)(105586002)(76176011)(106356001)(2501003)(107886003)(5640700003)(54906003)(52116002)(99286004)(102836004)(53936002)(14444005)(256004)(6506007)(386003)(316002)(36756003)(486006)(8936002)(6916009)(11346002)(7736002)(305945005)(476003)(2616005)(68736007)(8676002)(71200400001)(97736004)(5660300001)(66066001)(446003)(81156014)(81166006)(6512007)(71190400001)(2900100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2599;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: WeL3SQR9Ll+bsRbMiSlxGoM0ae9XJWKwNxRT6VzrFOENIuKZDFKyDT0gMCduRuloZSeJzn91lQEsVSYUIamVuZTOm8wLcHXMrSmF+AvtDxThxcJnbJGoBYHTjYLioXClWam6rv01UEh4PDbh1EdR6FJnougu+6M+4LFJpAWAWjsZF3tigx702mzr1lmFSAF4d8duVdw4pNQQmePQG1oDFtir8LRbcw7XKVKtwLOmy3nfhYKhjA4HGWRvMpq/NCvvK9708Sy96tiO4XnUPrVbtci47KhWXgu9Wy73PvAxU/90ZzBPvqlA2nDgPauA4hpHqzAO39+DgjDHEfKa5JiaT7QrdKwsC1CbAx7y+G5Q2o0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ae660515-3e52-4e0a-b63f-08d648620a16 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 05:45:23.5050 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2599 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 Move 'current_tx_rate' enum to wilc_wlan_if.h, to have it along with the other FW related to constants. Also added prefix to have a better namespace. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.h | 16 ---------------- drivers/staging/wilc1000/linux_wlan.c | 2 +- drivers/staging/wilc1000/wilc_wlan_if.h | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index fefbce6..91e60e3 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -127,22 +127,6 @@ struct host_if_pmkid_attr { struct host_if_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS]; }; -enum current_tx_rate { - AUTORATE = 0, - MBPS_1 = 1, - MBPS_2 = 2, - MBPS_5_5 = 5, - MBPS_11 = 11, - MBPS_6 = 6, - MBPS_9 = 9, - MBPS_12 = 12, - MBPS_18 = 18, - MBPS_24 = 24, - MBPS_36 = 36, - MBPS_48 = 48, - MBPS_54 = 54 -}; - struct cfg_param_attr { u32 flag; u16 short_retry_limit; diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index c4787bb..faf97df 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -342,7 +342,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, if (!wilc_wlan_cfg_set(vif, 0, WID_BSS_TYPE, c_val, 1, 0, 0)) goto fail; - c_val[0] = AUTORATE; + c_val[0] = WILC_FW_TX_RATE_AUTO; if (!wilc_wlan_cfg_set(vif, 0, WID_CURRENT_TX_RATE, c_val, 1, 0, 0)) goto fail; diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index c7e745d..36d6905 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -193,6 +193,22 @@ enum { WILC_FW_SMPS_MODE_MIMO = 3, /* power save disable */ }; +enum { + WILC_FW_TX_RATE_AUTO = 0, + WILC_FW_TX_RATE_MBPS_1 = 1, + WILC_FW_TX_RATE_MBPS_2 = 2, + WILC_FW_TX_RATE_MBPS_5_5 = 5, + WILC_FW_TX_RATE_MBPS_11 = 11, + WILC_FW_TX_RATE_MBPS_6 = 6, + WILC_FW_TX_RATE_MBPS_9 = 9, + WILC_FW_TX_RATE_MBPS_12 = 12, + WILC_FW_TX_RATE_MBPS_18 = 18, + WILC_FW_TX_RATE_MBPS_24 = 24, + WILC_FW_TX_RATE_MBPS_36 = 36, + WILC_FW_TX_RATE_MBPS_48 = 48, + WILC_FW_TX_RATE_MBPS_54 = 54 +}; + enum wid_type { WID_CHAR = 0, WID_SHORT = 1, From patchwork Mon Nov 12 05: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: 10678155 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 1253A14DB for ; Mon, 12 Nov 2018 05:45:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 022DC286B1 for ; Mon, 12 Nov 2018 05:45:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAB9C2A046; Mon, 12 Nov 2018 05:45:30 +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 7491F286B1 for ; Mon, 12 Nov 2018 05:45:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731284AbeKLPhI (ORCPT ); Mon, 12 Nov 2018 10:37:08 -0500 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:32674 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbeKLPhI (ORCPT ); Mon, 12 Nov 2018 10:37:08 -0500 X-IronPort-AV: E=Sophos;i="5.54,494,1534834800"; d="scan'208";a="23150822" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 11 Nov 2018 22:45:28 -0700 Received: from NAM05-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sun, 11 Nov 2018 22:45:28 -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=QN98gsJKH/Vql1KRpVW+wgph9+mID7akIV1jb18qeqU=; b=W1CaxG4LLwlVpb6L6mXOvcnyv53pmeuEANUSxRFqC7A3glavvjQUOqz/TuSpSTfHCRCv2l0b875PpWefw5X7RE9rbsuIC97bOu/K6axHJmkaJnblsuQ9Ht6GnVYO/sD+x05HPBIdeP3UbvZncxXHToLyHxz4UfkiSl8G8s2fdYc= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2599.namprd11.prod.outlook.com (52.135.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Mon, 12 Nov 2018 05: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.1294.044; Mon, 12 Nov 2018 05:45:26 +0000 From: To: CC: , , , , Subject: [PATCH 09/12] staging: wilc1000: rename firmware related constants to follow better namespace Thread-Topic: [PATCH 09/12] staging: wilc1000: rename firmware related constants to follow better namespace Thread-Index: AQHUekrpaJ5VS0fHJUCysAisgY4MhQ== Date: Mon, 12 Nov 2018 05:45:26 +0000 Message-ID: <1542001458-20217-10-git-send-email-ajay.kathat@microchip.com> References: <1542001458-20217-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1542001458-20217-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: MA1PR01CA0135.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::29) 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: [27.59.94.109] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2599;6:+QhxtZIZqw3UritGDOaqJRDnLrkQJN9OfJtDx5gF/hBocWV85KjHI7w8sRjmIN2iRFORl2G5O7pnndyox8NpWxyBed/9q3w/0efTllLQDjBo+X2j/KIHap0onlBY+vkXWVJGiQB/EDpfE6oMrX3/oXRDOLJzBiqD7ZN6TPSn7AgAut1j50G5+48OgPtPE7KeH720ZYAeqHTrUvy9+jEUBblC77bqWPqqg4fSW0xNAva9Lpuo/44KXdKYm4+2S1soiZ7Du/ZdgRAgiNuORydbufgPpvqcxR/Up+bfntA0Fcp5Pu/y1SdH33DVGHyEPm+aWF3hGUv6CDiBWOl9YGaJF2D1LJH8dlAOubO9+7ceY7lga9y/00O0p0EjtiQeUhFB1adzb6LZqJqqWjourmsljxuJ7lzr/DZtX8QfE3mC7+DGqeiwpftFX6iOKuOSfLN9Pnn18+4HH1mG0rstwrHyWg==;5:JSR1DyLUwocLNBF1HtsBb0nBY+zCqGa33R3jOLhbRnpbF4xnqcgkU0jUmXt6Ov1lyIU8EyVN2/zzXdZccB05PtWKl3m46flyBcHnPVFEtx7DWMRSq/80HqgUaXvpRR+bIBxFKX/PtE9KMTM+v0EMw50iWThhSe2Dsp5Gp6i6mQI=;7:cBNQxbQTM9DQUdBKKp09qZMDjeAYEQewgXLZydBZPcifK+Psnl+Whmj7Pxn8KtFaRIaKKKy7TF7wJv7qv7NXXSU4mAAxaCOpwY3h4xr8aCez8405E22t54uWa7QeI3s7wfemZuvEjJQaASZpe/H3OQ== x-ms-office365-filtering-correlation-id: 85e8187d-9ad2-4bdc-d6fa-08d648620bc9 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2599; x-ms-traffictypediagnostic: BYAPR11MB2599: 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)(3002001)(3231402)(944501410)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB2599;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB2599; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(4326008)(25786009)(2906002)(6116002)(3846002)(72206003)(26005)(2351001)(14454004)(86362001)(575784001)(186003)(6436002)(478600001)(6486002)(105586002)(76176011)(106356001)(2501003)(107886003)(5640700003)(54906003)(52116002)(99286004)(102836004)(53936002)(14444005)(256004)(6506007)(386003)(316002)(36756003)(486006)(8936002)(6916009)(11346002)(7736002)(305945005)(476003)(2616005)(68736007)(8676002)(71200400001)(97736004)(5660300001)(66066001)(446003)(81156014)(81166006)(6512007)(71190400001)(2900100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2599;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: ywrF60ml4+SN9tP6YwaLJItKRuE6HLKhZXn/nXimag+nSt/W6BfpAANUySirOH4hoCxbngqCW3/xfWB8JqbzfHBgWIIMijZdB1U7jl27dLTyGDHjLZW5EBI3raQpYa3sduyexrynmLj6sdHyhnQus8LYzZY4SH7FjnPmm7ZFitr02zIIQ3bYyn9SqJHxoCjb1Qbd7/6xpqARl8mpRLIMv6egqu5GzM4NcxDEITonkxCuk1/ZhYSNYhiUZDvSHNI+LopG4ex7Np4B74+B9ZdzXa4fSBwnnJz39s89dJLDwY577qroiNoMVat0hdQ1zDzctK6X37aFMce0Y9shbRpoEC9zvsrqbMT1ZoOFOIcgp4o= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 85e8187d-9ad2-4bdc-d6fa-08d648620bc9 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 05:45:26.4668 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2599 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Rename the firmware related macro by prefix with 'WILC_FW_' prefix for a better namespace. Also, move them to wilc_wlan_if.h file along with other FW related macros. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 6 ------ drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 ++++---- drivers/staging/wilc1000/wilc_wlan_if.h | 12 ++++++++++++ 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 4dfdc7c..c238d39 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3485,11 +3485,11 @@ void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg) switch (frame_type) { case IEEE80211_STYPE_ACTION: - msg->body.reg_frame.reg_id = ACTION_FRM_IDX; + msg->body.reg_frame.reg_id = WILC_FW_ACTION_FRM_IDX; break; case IEEE80211_STYPE_PROBE_REQ: - msg->body.reg_frame.reg_id = PROBE_REQ_IDX; + msg->body.reg_frame.reg_id = WILC_FW_PROBE_REQ_IDX; break; default: diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 91e60e3..610ca2b 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -15,13 +15,7 @@ #define GO_MODE 0x03 #define CLIENT_MODE 0x04 -#define ACTION_FRM_IDX 0 -#define PROBE_REQ_IDX 1 #define MAX_NUM_STA 9 -#define DEFAULT_SCAN 0 -#define USER_SCAN BIT(0) -#define OBSS_PERIODIC_SCAN BIT(1) -#define OBSS_ONETIME_SCAN BIT(2) #define ADDKEY 0x1 #define REMOVEKEY 0x2 #define DEFAULTKEY 0x4 diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index b882fe9..4cfa3ff4 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -612,15 +612,15 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) &hidden_ntwk)) return -ENOMEM; - ret = wilc_scan(vif, USER_SCAN, WILC_FW_ACTIVE_SCAN, - scan_ch_list, + ret = wilc_scan(vif, WILC_FW_USER_SCAN, + WILC_FW_ACTIVE_SCAN, scan_ch_list, request->n_channels, (const u8 *)request->ie, request->ie_len, cfg_scan_result, (void *)priv, &hidden_ntwk); } else { - ret = wilc_scan(vif, USER_SCAN, WILC_FW_ACTIVE_SCAN, - scan_ch_list, + ret = wilc_scan(vif, WILC_FW_USER_SCAN, + WILC_FW_ACTIVE_SCAN, scan_ch_list, request->n_channels, (const u8 *)request->ie, request->ie_len, cfg_scan_result, diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 36d6905..f4f6ac6 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -209,6 +209,18 @@ enum { WILC_FW_TX_RATE_MBPS_54 = 54 }; +enum { + WILC_FW_DEFAULT_SCAN = 0, + WILC_FW_USER_SCAN = BIT(0), + WILC_FW_OBSS_PERIODIC_SCAN = BIT(1), + WILC_FW_OBSS_ONETIME_SCAN = BIT(2) +}; + +enum { + WILC_FW_ACTION_FRM_IDX = 0, + WILC_FW_PROBE_REQ_IDX = 1 +}; + enum wid_type { WID_CHAR = 0, WID_SHORT = 1, From patchwork Mon Nov 12 05:45:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10678159 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 DEEB615A6 for ; Mon, 12 Nov 2018 05:45:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9737286B1 for ; Mon, 12 Nov 2018 05:45:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD2D52A046; Mon, 12 Nov 2018 05:45:36 +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 9C88E286B1 for ; Mon, 12 Nov 2018 05:45:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731323AbeKLPhM (ORCPT ); Mon, 12 Nov 2018 10:37:12 -0500 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:32674 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbeKLPhM (ORCPT ); Mon, 12 Nov 2018 10:37:12 -0500 X-IronPort-AV: E=Sophos;i="5.54,494,1534834800"; d="scan'208";a="23150823" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Nov 2018 22:45:32 -0700 Received: from NAM05-DM3-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; Sun, 11 Nov 2018 22:45:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dQZKC8ZUyL/vDc/ay/TL8yJrY7ne1t3X9adhdGGFjbo=; b=FTQlrWRvU/Mi17w10wlu+ICXssK+5gpMflnxkYDxCHfZJUhlSbDle1Tz4fu1y2URaZl2aBJz85r9Q1sXgVhOmWgbTBWn9pFOC5xwxdjBI3Ij85hhUqfn0UHR9a74/bTBm4PyXqLvEd+TZT5hCHZUECXGD2+qAa2hn4/fhF4cpXA= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2599.namprd11.prod.outlook.com (52.135.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Mon, 12 Nov 2018 05:45:29 +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.1294.044; Mon, 12 Nov 2018 05:45:29 +0000 From: To: CC: , , , , Subject: [PATCH 10/12] staging: wilc1000: added 'WILC_' prefix for constants to have clear namespace Thread-Topic: [PATCH 10/12] staging: wilc1000: added 'WILC_' prefix for constants to have clear namespace Thread-Index: AQHUekrrgYivYpl2AEePhC1CU9LWRw== Date: Mon, 12 Nov 2018 05:45:29 +0000 Message-ID: <1542001458-20217-11-git-send-email-ajay.kathat@microchip.com> References: <1542001458-20217-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1542001458-20217-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: MA1PR01CA0135.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::29) 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: [27.59.94.109] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2599;6:r9vEywJ9b/HIFgaUxI/QzuCK2B35RTJEEy4t5GaLD0K4y4+3a/soXU5hNkZGWaHuQMHS9ZDFecFRlxpQmx1tSptvxelj5M0wMeXs/43coAH5zoYpreiLl56Pm4oO2hJP6NbKuaWk5V+Jso50RZSaMy7YVHeTmaZN8CBj4/yO2sI5CWBNErpr3k/8XvLAcXmr37Ere4TpHMi3DG2SbjOslpF7qqLuTBL2hhVNkP9WuweZgCKJ42zkndBEOF0d3aUb0Has/iLDVTAkJhd4cqW5tdbyZL+Nb/194fN+5y3Cj8RwTMYqVeJufr8fnGaQCFuWBxcNqiz3N72U9Wbox0q6QCixHnna+jf/1Vu2GWZxBPe4/aUDTQeACfxWW2vuFf+7xVrY0LUKn5rTK22zn1uT+NvNxea63YYIL/SmoIRRSJDO5FHjxfW+Po/wo36bB/0wvKVEJhWLiHuuQ+U9QIajAg==;5:PQ9kjo64EI6Uu26kwQzzmO5dNm+Rwc3r2fCjC+AUIVQMuO6xFw8xZgtRlIoRdIkRWP47YoTy5rQkGu1Wtc+jmLLoeaJOWfd2V0IgO8HLqIdrOpJm1Xjrx2Pft8m9nmmJzbpomqRBOox+OiNQUWFHUMDusJ7/vfXvc6a32NXE4uw=;7:qki9b6j9A2SLQXlPrgw7f0FG+uUNbtG7jVygwJFggLAYZiQN/xEv6durL7V5i4umGSmvscokZ2P/2uFTkSstbB8TtWVn7O8qkMCP7mELfvDcBHFsoXIe2PEmxe/3bP2LeZHSpqhOnSwD1khTLGH8bQ== x-ms-office365-filtering-correlation-id: bc38a3e3-cd1a-4760-2b78-08d648620d88 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2599; x-ms-traffictypediagnostic: BYAPR11MB2599: 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)(3002001)(3231402)(944501410)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB2599;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB2599; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(4326008)(25786009)(2906002)(6116002)(3846002)(72206003)(26005)(2351001)(14454004)(86362001)(575784001)(186003)(6436002)(478600001)(6486002)(105586002)(76176011)(106356001)(2501003)(107886003)(5640700003)(54906003)(52116002)(99286004)(102836004)(53936002)(14444005)(53946003)(256004)(6506007)(386003)(316002)(36756003)(486006)(8936002)(6916009)(11346002)(7736002)(305945005)(476003)(2616005)(68736007)(8676002)(71200400001)(97736004)(5660300001)(66066001)(446003)(81156014)(81166006)(6512007)(71190400001)(2900100001)(4744004)(579004)(569006);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2599;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: q6DVVvJXWHHEToKIzrXOkgyi7HGMEjGi/6S3llg/H+wd5Q1j9eOl1465x1Gs1FAhxqdFMe69sILjshBJpqNdvje++or6TezPKWBWaECmXorU/gw2rcuB0Gbiy62j500ICYIYs3AlF4bRhkdvJJad+wXO04aeuNSV/FTat9posqcQ1HarDSEse/Mwn010tCmtncuhX/VnawCn1P5gMuK4nz9FJr9zL0rLIwitZ8nsK+MtNPfI1VuOMxdiKB2UYyDMYPO6QWcxmQJamNUIJLNIx2hX/P5Edg8sJMVM0isWwHDSjOwwjI4P2yQt7xCMdNbN+ynA7vByUJNS50nkruRwCR8cFPgsP4/fHZ+d7sr0+HI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: bc38a3e3-cd1a-4760-2b78-08d648620d88 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 05:45:29.5400 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2599 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 For better namespace added 'WILC_' prefix for driver specific constants. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.c | 162 +++++++++++----------- drivers/staging/wilc1000/host_interface.h | 59 ++++---- drivers/staging/wilc1000/linux_wlan.c | 20 +-- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 56 ++++---- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 8 +- drivers/staging/wilc1000/wilc_wlan.c | 4 +- 6 files changed, 159 insertions(+), 150 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c238d39..5ab426c 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -94,7 +94,7 @@ struct set_multicast { }; struct del_all_sta { - u8 del_all_sta[MAX_NUM_STA][ETH_ALEN]; + u8 del_all_sta[WILC_MAX_NUM_STA][ETH_ALEN]; u8 assoc_sta; }; @@ -242,7 +242,7 @@ static struct wilc_vif *wilc_get_vif_from_idx(struct wilc *wilc, int idx) { int index = idx - 1; - if (index < 0 || index >= NUM_CONCURRENT_IFC) + if (index < 0 || index >= WILC_NUM_CONCURRENT_IFC) return NULL; return wilc->vif[index]; @@ -261,7 +261,7 @@ static void handle_set_channel(struct work_struct *work) wid.val = (char *)&hif_set_ch->set_ch; wid.size = sizeof(char); - ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + ret = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (ret) @@ -284,7 +284,7 @@ static void handle_set_wfi_drv_handler(struct work_struct *work) hif_drv = vif->hif_drv; - buffer = kzalloc(DRV_HANDLER_SIZE, GFP_KERNEL); + buffer = kzalloc(WILC_DRV_HANDLER_SIZE, GFP_KERNEL); if (!buffer) goto free_msg; @@ -302,9 +302,9 @@ static void handle_set_wfi_drv_handler(struct work_struct *work) wid.id = WID_SET_DRV_HANDLER; wid.type = WID_STR; wid.val = (s8 *)buffer; - wid.size = DRV_HANDLER_SIZE; + wid.size = WILC_DRV_HANDLER_SIZE; - ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + ret = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, hif_drv->driver_handler_id); if (ret) netdev_err(vif->ndev, "Failed to set driver handler\n"); @@ -331,7 +331,7 @@ static void handle_set_operation_mode(struct work_struct *work) wid.val = (s8 *)&hif_op_mode->mode; wid.size = sizeof(u32); - ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + ret = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (ret) @@ -353,7 +353,7 @@ static void handle_get_mac_address(struct work_struct *work) wid.val = get_mac_addr->mac_addr; wid.size = ETH_ALEN; - ret = wilc_send_config_pkt(vif, GET_CFG, &wid, 1, + ret = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (ret) @@ -371,28 +371,28 @@ static void handle_cfg_param(struct work_struct *work) struct wid wid_list[32]; int i = 0; - if (param->flag & RETRY_SHORT) { + if (param->flag & WILC_CFG_PARAM_RETRY_SHORT) { wid_list[i].id = WID_SHORT_RETRY_LIMIT; wid_list[i].val = (s8 *)¶m->short_retry_limit; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); i++; } - if (param->flag & RETRY_LONG) { + if (param->flag & WILC_CFG_PARAM_RETRY_LONG) { wid_list[i].id = WID_LONG_RETRY_LIMIT; wid_list[i].val = (s8 *)¶m->long_retry_limit; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); i++; } - if (param->flag & FRAG_THRESHOLD) { + if (param->flag & WILC_CFG_PARAM_FRAG_THRESHOLD) { wid_list[i].id = WID_FRAG_THRESHOLD; wid_list[i].val = (s8 *)¶m->frag_threshold; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); i++; } - if (param->flag & RTS_THRESHOLD) { + if (param->flag & WILC_CFG_PARAM_RTS_THRESHOLD) { wid_list[i].id = WID_RTS_THRESHOLD; wid_list[i].val = (s8 *)¶m->rts_threshold; wid_list[i].type = WID_SHORT; @@ -400,7 +400,7 @@ static void handle_cfg_param(struct work_struct *work) i++; } - ret = wilc_send_config_pkt(vif, SET_CFG, wid_list, + ret = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, i, wilc_get_vif_idx(vif)); if (ret) @@ -424,7 +424,7 @@ static int handle_scan_done(struct wilc_vif *vif, enum scan_event evt) wid.val = (s8 *)&abort_running_scan; wid.size = sizeof(char); - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (result) { @@ -538,7 +538,7 @@ static void handle_scan(struct work_struct *work) wid_list[index].val = (s8 *)&scan_info->src; index++; - result = wilc_send_config_pkt(vif, SET_CFG, wid_list, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, index, wilc_get_vif_idx(vif)); @@ -764,7 +764,7 @@ static void handle_connect(struct work_struct *work) cur_byte = wid_list[wid_cnt].val; wid_cnt++; - result = wilc_send_config_pkt(vif, SET_CFG, wid_list, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, wid_cnt, wilc_get_vif_idx(vif)); if (result) { @@ -873,7 +873,7 @@ static void handle_connect_timeout(struct work_struct *work) wid.val = (s8 *)&dummy_reason_code; wid.size = sizeof(char); - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (result) netdev_err(vif->ndev, "Failed to send disconnect\n"); @@ -1234,7 +1234,7 @@ static void host_int_get_assoc_res_info(struct wilc_vif *vif, wid.val = assoc_resp_info; wid.size = max_assoc_resp_info_len; - result = wilc_send_config_pkt(vif, GET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (result) { *rcvd_assoc_resp_info_len = 0; @@ -1290,10 +1290,10 @@ static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif, if (mac_status == WILC_MAC_STATUS_CONNECTED) { u32 assoc_resp_info_len; - memset(hif_drv->assoc_resp, 0, MAX_ASSOC_RESP_FRAME_SIZE); + memset(hif_drv->assoc_resp, 0, WILC_MAX_ASSOC_RESP_FRAME_SIZE); host_int_get_assoc_res_info(vif, hif_drv->assoc_resp, - MAX_ASSOC_RESP_FRAME_SIZE, + WILC_MAX_ASSOC_RESP_FRAME_SIZE, &assoc_resp_info_len); if (assoc_resp_info_len != 0) { @@ -1469,7 +1469,7 @@ static int wilc_pmksa_key_copy(struct wilc_vif *vif, struct key_attr *hif_key) wid.val = (s8 *)key_buf; wid.size = (hif_key->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1; - ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + ret = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); kfree(key_buf); @@ -1489,9 +1489,9 @@ static void handle_key(struct work_struct *work) struct host_if_drv *hif_drv = vif->hif_drv; switch (hif_key->type) { - case WEP: + case WILC_KEY_TYPE_WEP: - if (hif_key->action & ADDKEY_AP) { + if (hif_key->action & WILC_ADD_KEY_AP) { wid_list[0].id = WID_11I_MODE; wid_list[0].type = WID_CHAR; wid_list[0].size = sizeof(char); @@ -1520,11 +1520,11 @@ static void handle_key(struct work_struct *work) wid_list[2].size = hif_key->attr.wep.key_len + 2; wid_list[2].val = (s8 *)key_buf; - result = wilc_send_config_pkt(vif, SET_CFG, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, 3, wilc_get_vif_idx(vif)); kfree(key_buf); - } else if (hif_key->action & ADDKEY) { + } else if (hif_key->action & WILC_ADD_KEY) { key_buf = kmalloc(hif_key->attr.wep.key_len + 2, GFP_KERNEL); if (!key_buf) { @@ -1541,27 +1541,27 @@ static void handle_key(struct work_struct *work) wid.val = (s8 *)key_buf; wid.size = hif_key->attr.wep.key_len + 2; - result = wilc_send_config_pkt(vif, SET_CFG, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); kfree(key_buf); - } else if (hif_key->action & REMOVEKEY) { + } else if (hif_key->action & WILC_REMOVE_KEY) { wid.id = WID_REMOVE_WEP_KEY; wid.type = WID_STR; wid.val = (s8 *)&hif_key->attr.wep.index; wid.size = 1; - result = wilc_send_config_pkt(vif, SET_CFG, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); - } else if (hif_key->action & DEFAULTKEY) { + } else if (hif_key->action & WILC_DEFAULT_KEY) { wid.id = WID_KEY_ID; wid.type = WID_CHAR; wid.val = (s8 *)&hif_key->attr.wep.index; wid.size = sizeof(char); - result = wilc_send_config_pkt(vif, SET_CFG, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); } @@ -1569,8 +1569,8 @@ static void handle_key(struct work_struct *work) complete(&msg->work_comp); break; - case WPA_RX_GTK: - if (hif_key->action & ADDKEY_AP) { + case WILC_KEY_TYPE_WPA_RX_GTK: + if (hif_key->action & WILC_ADD_KEY_AP) { key_buf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL); if (!key_buf) { result = -ENOMEM; @@ -1595,12 +1595,12 @@ static void handle_key(struct work_struct *work) wid_list[1].val = (s8 *)key_buf; wid_list[1].size = RX_MIC_KEY_MSG_LEN; - result = wilc_send_config_pkt(vif, SET_CFG, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, 2, wilc_get_vif_idx(vif)); kfree(key_buf); - } else if (hif_key->action & ADDKEY) { + } else if (hif_key->action & WILC_ADD_KEY) { key_buf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL); if (!key_buf) { result = -ENOMEM; @@ -1623,7 +1623,7 @@ static void handle_key(struct work_struct *work) wid.val = (s8 *)key_buf; wid.size = RX_MIC_KEY_MSG_LEN; - result = wilc_send_config_pkt(vif, SET_CFG, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); @@ -1633,8 +1633,8 @@ static void handle_key(struct work_struct *work) complete(&msg->work_comp); break; - case WPA_PTK: - if (hif_key->action & ADDKEY_AP) { + case WILC_KEY_TYPE_WPA_PTK: + if (hif_key->action & WILC_ADD_KEY_AP) { key_buf = kmalloc(PTK_KEY_MSG_LEN + 1, GFP_KERNEL); if (!key_buf) { result = -ENOMEM; @@ -1657,11 +1657,11 @@ static void handle_key(struct work_struct *work) wid_list[1].val = (s8 *)key_buf; wid_list[1].size = PTK_KEY_MSG_LEN + 1; - result = wilc_send_config_pkt(vif, SET_CFG, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, 2, wilc_get_vif_idx(vif)); kfree(key_buf); - } else if (hif_key->action & ADDKEY) { + } else if (hif_key->action & WILC_ADD_KEY) { key_buf = kmalloc(PTK_KEY_MSG_LEN, GFP_KERNEL); if (!key_buf) { result = -ENOMEM; @@ -1678,7 +1678,7 @@ static void handle_key(struct work_struct *work) wid.val = (s8 *)key_buf; wid.size = PTK_KEY_MSG_LEN; - result = wilc_send_config_pkt(vif, SET_CFG, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); kfree(key_buf); @@ -1688,7 +1688,7 @@ static void handle_key(struct work_struct *work) complete(&msg->work_comp); break; - case PMKSA: + case WILC_KEY_TYPE_PMKSA: result = wilc_pmksa_key_copy(vif, hif_key); /*free 'msg', this case it not a sync call*/ kfree(msg); @@ -1721,7 +1721,7 @@ static void handle_disconnect(struct work_struct *work) vif->obtaining_ip = false; wilc_set_power_mgmt(vif, 0, 0); - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (result) { @@ -1794,7 +1794,7 @@ static void handle_get_rssi(struct work_struct *work) wid.val = msg->body.data; wid.size = sizeof(char); - result = wilc_send_config_pkt(vif, GET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (result) netdev_err(vif->ndev, "Failed to get RSSI value\n"); @@ -1841,7 +1841,7 @@ static void handle_get_statistics(struct work_struct *work) wid_list[wid_cnt].val = (s8 *)&stats->tx_fail_cnt; wid_cnt++; - result = wilc_send_config_pkt(vif, GET_CFG, wid_list, + result = wilc_send_config_pkt(vif, WILC_GET_CFG, wid_list, wid_cnt, wilc_get_vif_idx(vif)); @@ -1878,7 +1878,7 @@ static void handle_get_inactive_time(struct work_struct *work) ether_addr_copy(wid.val, hif_sta_inactive->mac); - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); kfree(wid.val); @@ -1892,7 +1892,7 @@ static void handle_get_inactive_time(struct work_struct *work) wid.val = (s8 *)&hif_sta_inactive->inactive_time; wid.size = sizeof(u32); - result = wilc_send_config_pkt(vif, GET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (result) @@ -1947,7 +1947,7 @@ static void handle_add_beacon(struct work_struct *work) memcpy(cur_byte, param->tail, param->tail_len); cur_byte += param->tail_len; - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (result) netdev_err(vif->ndev, "Failed to send add beacon\n"); @@ -1972,7 +1972,7 @@ static void handle_del_beacon(struct work_struct *work) wid.size = sizeof(char); wid.val = &del_beacon; - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (result) netdev_err(vif->ndev, "Failed to send delete beacon\n"); @@ -2029,7 +2029,7 @@ static void handle_add_station(struct work_struct *work) cur_byte = wid.val; cur_byte += wilc_hif_pack_sta_param(cur_byte, param); - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (result != 0) netdev_err(vif->ndev, "Failed to send add station\n"); @@ -2063,7 +2063,7 @@ static void handle_del_all_sta(struct work_struct *work) *(curr_byte++) = param->assoc_sta; - for (i = 0; i < MAX_NUM_STA; i++) { + for (i = 0; i < WILC_MAX_NUM_STA; i++) { if (memcmp(param->del_all_sta[i], zero_buff, ETH_ALEN)) memcpy(curr_byte, param->del_all_sta[i], ETH_ALEN); else @@ -2072,7 +2072,7 @@ static void handle_del_all_sta(struct work_struct *work) curr_byte += ETH_ALEN; } - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (result) netdev_err(vif->ndev, "Failed to send delete all station\n"); @@ -2102,7 +2102,7 @@ static void handle_del_station(struct work_struct *work) ether_addr_copy(wid.val, param->mac_addr); - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (result) netdev_err(vif->ndev, "Failed to del station\n"); @@ -2132,7 +2132,7 @@ static void handle_edit_station(struct work_struct *work) cur_byte = wid.val; cur_byte += wilc_hif_pack_sta_param(cur_byte, param); - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (result) netdev_err(vif->ndev, "Failed to send edit station\n"); @@ -2189,7 +2189,7 @@ static int handle_remain_on_chan(struct wilc_vif *vif, wid.val[0] = remain_on_chan_flag; wid.val[1] = (s8)hif_remain_ch->ch; - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); kfree(wid.val); if (result != 0) @@ -2232,7 +2232,7 @@ static void handle_register_frame(struct work_struct *work) wid.size = sizeof(u16) + 2; - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); kfree(wid.val); if (result) @@ -2266,7 +2266,7 @@ static void handle_listen_state_expired(struct work_struct *work) wid.val[0] = remain_on_chan_flag; wid.val[1] = FALSE_FRMWR_CHANNEL; - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); kfree(wid.val); if (result != 0) { @@ -2328,7 +2328,7 @@ static void handle_power_management(struct work_struct *work) wid.val = &power_mode; wid.size = sizeof(char); - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (result) netdev_err(vif->ndev, "Failed to send power management\n"); @@ -2366,7 +2366,7 @@ static void handle_set_mcast_filter(struct work_struct *work) memcpy(cur_byte, hif_set_mc->mc_list, ((hif_set_mc->cnt) * ETH_ALEN)); - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (result) netdev_err(vif->ndev, "Failed to send setup multicast\n"); @@ -2390,7 +2390,7 @@ static void handle_set_tx_pwr(struct work_struct *work) wid.val = &tx_pwr; wid.size = sizeof(char); - ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, + ret = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (ret) netdev_err(vif->ndev, "Failed to set TX PWR\n"); @@ -2411,7 +2411,7 @@ static void handle_get_tx_pwr(struct work_struct *work) wid.val = (s8 *)tx_pwr; wid.size = sizeof(char); - ret = wilc_send_config_pkt(vif, GET_CFG, &wid, 1, + ret = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1, wilc_get_vif_idx(vif)); if (ret) netdev_err(vif->ndev, "Failed to get TX PWR\n"); @@ -2501,8 +2501,8 @@ int wilc_remove_wep_key(struct wilc_vif *vif, u8 index) if (IS_ERR(msg)) return PTR_ERR(msg); - msg->body.key_info.type = WEP; - msg->body.key_info.action = REMOVEKEY; + msg->body.key_info.type = WILC_KEY_TYPE_WEP; + msg->body.key_info.action = WILC_REMOVE_KEY; msg->body.key_info.attr.wep.index = index; result = wilc_enqueue_work(msg); @@ -2531,8 +2531,8 @@ int wilc_set_wep_default_keyid(struct wilc_vif *vif, u8 index) if (IS_ERR(msg)) return PTR_ERR(msg); - msg->body.key_info.type = WEP; - msg->body.key_info.action = DEFAULTKEY; + msg->body.key_info.type = WILC_KEY_TYPE_WEP; + msg->body.key_info.action = WILC_DEFAULT_KEY; msg->body.key_info.attr.wep.index = index; result = wilc_enqueue_work(msg); @@ -2561,8 +2561,8 @@ int wilc_add_wep_key_bss_sta(struct wilc_vif *vif, const u8 *key, u8 len, if (IS_ERR(msg)) return PTR_ERR(msg); - msg->body.key_info.type = WEP; - msg->body.key_info.action = ADDKEY; + msg->body.key_info.type = WILC_KEY_TYPE_WEP; + msg->body.key_info.action = WILC_ADD_KEY; msg->body.key_info.attr.wep.key = kmemdup(key, len, GFP_KERNEL); if (!msg->body.key_info.attr.wep.key) { result = -ENOMEM; @@ -2602,8 +2602,8 @@ int wilc_add_wep_key_bss_ap(struct wilc_vif *vif, const u8 *key, u8 len, if (IS_ERR(msg)) return PTR_ERR(msg); - msg->body.key_info.type = WEP; - msg->body.key_info.action = ADDKEY_AP; + msg->body.key_info.type = WILC_KEY_TYPE_WEP; + msg->body.key_info.action = WILC_ADD_KEY_AP; msg->body.key_info.attr.wep.key = kmemdup(key, len, GFP_KERNEL); if (!msg->body.key_info.attr.wep.key) { result = -ENOMEM; @@ -2653,13 +2653,13 @@ int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len, if (IS_ERR(msg)) return PTR_ERR(msg); - msg->body.key_info.type = WPA_PTK; - if (mode == AP_MODE) { - msg->body.key_info.action = ADDKEY_AP; + msg->body.key_info.type = WILC_KEY_TYPE_WPA_PTK; + if (mode == WILC_AP_MODE) { + msg->body.key_info.action = WILC_ADD_KEY_AP; msg->body.key_info.attr.wpa.index = index; } - if (mode == STATION_MODE) - msg->body.key_info.action = ADDKEY; + if (mode == WILC_STATION_MODE) + msg->body.key_info.action = WILC_ADD_KEY; msg->body.key_info.attr.wpa.key = kmemdup(ptk, ptk_key_len, GFP_KERNEL); if (!msg->body.key_info.attr.wpa.key) { @@ -2730,14 +2730,14 @@ int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len, } } - msg->body.key_info.type = WPA_RX_GTK; + msg->body.key_info.type = WILC_KEY_TYPE_WPA_RX_GTK; - if (mode == AP_MODE) { - msg->body.key_info.action = ADDKEY_AP; + if (mode == WILC_AP_MODE) { + msg->body.key_info.action = WILC_ADD_KEY_AP; msg->body.key_info.attr.wpa.mode = cipher_mode; } - if (mode == STATION_MODE) - msg->body.key_info.action = ADDKEY; + if (mode == WILC_STATION_MODE) + msg->body.key_info.action = WILC_ADD_KEY; msg->body.key_info.attr.wpa.key = kmemdup(rx_gtk, key_len, GFP_KERNEL); if (!msg->body.key_info.attr.wpa.key) { @@ -2787,8 +2787,8 @@ int wilc_set_pmkid_info(struct wilc_vif *vif, if (IS_ERR(msg)) return PTR_ERR(msg); - msg->body.key_info.type = PMKSA; - msg->body.key_info.action = ADDKEY; + msg->body.key_info.type = WILC_KEY_TYPE_PMKSA; + msg->body.key_info.action = WILC_ADD_KEY; for (i = 0; i < pmkid->numpmkid; i++) { memcpy(msg->body.key_info.attr.pmkid.pmkidlist[i].bssid, @@ -3640,7 +3640,7 @@ int wilc_del_allstation(struct wilc_vif *vif, u8 mac_addr[][ETH_ALEN]) del_all_sta_info = &msg->body.del_all_sta_info; - for (i = 0; i < MAX_NUM_STA; i++) { + for (i = 0; i < WILC_MAX_NUM_STA; i++) { if (memcmp(mac_addr[i], zero_addr, ETH_ALEN)) { memcpy(del_all_sta_info->del_all_sta[i], mac_addr[i], ETH_ALEN); diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 610ca2b..606e80a 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -9,20 +9,25 @@ #include #include "wilc_wlan_if.h" -#define IDLE_MODE 0x00 -#define AP_MODE 0x01 -#define STATION_MODE 0x02 -#define GO_MODE 0x03 -#define CLIENT_MODE 0x04 - -#define MAX_NUM_STA 9 -#define ADDKEY 0x1 -#define REMOVEKEY 0x2 -#define DEFAULTKEY 0x4 -#define ADDKEY_AP 0x8 +enum { + WILC_IDLE_MODE = 0x0, + WILC_AP_MODE = 0x1, + WILC_STATION_MODE = 0x2, + WILC_GO_MODE = 0x3, + WILC_CLIENT_MODE = 0x4 +}; + +enum { + WILC_ADD_KEY = 0x1, + WILC_REMOVE_KEY = 0x2, + WILC_DEFAULT_KEY = 0x4, + WILC_ADD_KEY_AP = 0x8 +}; + +#define WILC_MAX_NUM_STA 9 #define MAX_NUM_SCANNED_NETWORKS 100 #define MAX_NUM_SCANNED_NETWORKS_SHADOW 130 -#define MAX_NUM_PROBED_SSID 10 +#define WILC_MAX_NUM_PROBED_SSID 10 #define TX_MIC_KEY_LEN 8 #define RX_MIC_KEY_LEN 8 @@ -34,16 +39,18 @@ #define PMKSA_KEY_LEN 22 #define WILC_MAX_NUM_PMKIDS 16 #define WILC_ADD_STA_LENGTH 40 -#define NUM_CONCURRENT_IFC 2 -#define DRV_HANDLER_SIZE 5 +#define WILC_NUM_CONCURRENT_IFC 2 +#define WILC_DRV_HANDLER_SIZE 5 #define DRV_HANDLER_MASK 0x000000FF #define NUM_RSSI 5 -#define SET_CFG 0 -#define GET_CFG 1 +enum { + WILC_SET_CFG = 0, + WILC_GET_CFG +}; -#define MAX_ASSOC_RESP_FRAME_SIZE 256 +#define WILC_MAX_ASSOC_RESP_FRAME_SIZE 256 struct rssi_history_buffer { bool full; @@ -130,10 +137,10 @@ struct cfg_param_attr { }; enum cfg_param { - RETRY_SHORT = BIT(0), - RETRY_LONG = BIT(1), - FRAG_THRESHOLD = BIT(2), - RTS_THRESHOLD = BIT(3), + WILC_CFG_PARAM_RETRY_SHORT = BIT(0), + WILC_CFG_PARAM_RETRY_LONG = BIT(1), + WILC_CFG_PARAM_FRAG_THRESHOLD = BIT(2), + WILC_CFG_PARAM_RTS_THRESHOLD = BIT(3) }; struct found_net_info { @@ -155,10 +162,10 @@ enum conn_event { }; enum KEY_TYPE { - WEP, - WPA_RX_GTK, - WPA_PTK, - PMKSA, + WILC_KEY_TYPE_WEP, + WILC_KEY_TYPE_WPA_RX_GTK, + WILC_KEY_TYPE_WPA_PTK, + WILC_KEY_TYPE_PMKSA, }; typedef void (*wilc_scan_result)(enum scan_event, struct network_info *, @@ -268,7 +275,7 @@ struct host_if_drv { bool ifc_up; int driver_handler_id; - u8 assoc_resp[MAX_ASSOC_RESP_FRAME_SIZE]; + u8 assoc_resp[WILC_MAX_ASSOC_RESP_FRAME_SIZE]; }; struct add_sta_param { diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index faf97df..96d8834 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -46,7 +46,8 @@ static int dev_state_ev_handler(struct notifier_block *this, switch (event) { case NETDEV_UP: - if (vif->iftype == STATION_MODE || vif->iftype == CLIENT_MODE) { + if (vif->iftype == WILC_STATION_MODE || + vif->iftype == WILC_CLIENT_MODE) { hif_drv->ifc_up = 1; vif->obtaining_ip = false; del_timer(&vif->during_ip_timer); @@ -65,7 +66,8 @@ static int dev_state_ev_handler(struct notifier_block *this, break; case NETDEV_DOWN: - if (vif->iftype == STATION_MODE || vif->iftype == CLIENT_MODE) { + if (vif->iftype == WILC_STATION_MODE || + vif->iftype == WILC_CLIENT_MODE) { hif_drv->ifc_up = 0; vif->obtaining_ip = false; } @@ -179,11 +181,11 @@ static struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header) bssid1 = mac_header + 4; for (i = 0; i < wilc->vif_num; i++) { - if (wilc->vif[i]->mode == STATION_MODE) + if (wilc->vif[i]->mode == WILC_STATION_MODE) if (ether_addr_equal_unaligned(bssid, wilc->vif[i]->bssid)) return wilc->vif[i]->ndev; - if (wilc->vif[i]->mode == AP_MODE) + if (wilc->vif[i]->mode == WILC_AP_MODE) if (ether_addr_equal_unaligned(bssid1, wilc->vif[i]->bssid)) return wilc->vif[i]->ndev; @@ -1021,12 +1023,12 @@ void wilc_netdev_cleanup(struct wilc *wilc) } if (wilc->vif[0]->ndev || wilc->vif[1]->ndev) { - for (i = 0; i < NUM_CONCURRENT_IFC; i++) + for (i = 0; i < WILC_NUM_CONCURRENT_IFC; i++) if (wilc->vif[i]->ndev) if (wilc->vif[i]->mac_opened) wilc_mac_close(wilc->vif[i]->ndev); - for (i = 0; i < NUM_CONCURRENT_IFC; i++) { + for (i = 0; i < WILC_NUM_CONCURRENT_IFC; i++) { unregister_netdev(wilc->vif[i]->ndev); wilc_free_wiphy(wilc->vif[i]->ndev); free_netdev(wilc->vif[i]->ndev); @@ -1082,7 +1084,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, register_inetaddr_notifier(&g_dev_notifier); - for (i = 0; i < NUM_CONCURRENT_IFC; i++) { + for (i = 0; i < WILC_NUM_CONCURRENT_IFC; i++) { struct wireless_dev *wdev; ndev = alloc_etherdev(sizeof(struct wilc_vif)); @@ -1130,7 +1132,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, if (ret) goto free_ndev; - vif->iftype = STATION_MODE; + vif->iftype = WILC_STATION_MODE; vif->mac_opened = 0; } @@ -1139,7 +1141,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, free_ndev: for (; i >= 0; i--) { if (wl->vif[i]) { - if (wl->vif[i]->iftype == STATION_MODE) + if (wl->vif[i]->iftype == WILC_STATION_MODE) unregister_netdev(wl->vif[i]->ndev); if (wl->vif[i]->ndev) { diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 4cfa3ff4..9906a9f7 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -465,7 +465,7 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt, conn_info->status == WLAN_STATUS_SUCCESS) { connect_status = WLAN_STATUS_UNSPECIFIED_FAILURE; wilc_wlan_set_bssid(priv->dev, null_bssid, - STATION_MODE); + WILC_STATION_MODE); if (!wfi_drv->p2p_connect) wlan_channel = INVALID_CHANNEL; @@ -507,7 +507,7 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt, priv->p2p.recv_random = 0x00; priv->p2p.is_wilc_ie = false; eth_zero_addr(priv->associated_bss); - wilc_wlan_set_bssid(priv->dev, null_bssid, STATION_MODE); + wilc_wlan_set_bssid(priv->dev, null_bssid, WILC_STATION_MODE); if (!wfi_drv->p2p_connect) wlan_channel = INVALID_CHANNEL; @@ -768,7 +768,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, if (!wfi_drv->p2p_connect) wlan_channel = nw_info->ch; - wilc_wlan_set_bssid(dev, nw_info->bssid, STATION_MODE); + wilc_wlan_set_bssid(dev, nw_info->bssid, WILC_STATION_MODE); ret = wilc_set_join_req(vif, nw_info->bssid, sme->ssid, sme->ssid_len, sme->ie, sme->ie_len, @@ -781,7 +781,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, netdev_err(dev, "wilc_set_join_req(): Error\n"); ret = -ENOENT; - wilc_wlan_set_bssid(dev, null_bssid, STATION_MODE); + wilc_wlan_set_bssid(dev, null_bssid, WILC_STATION_MODE); goto out_error; } return 0; @@ -815,7 +815,7 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev, wfi_drv = (struct host_if_drv *)priv->hif_drv; if (!wfi_drv->p2p_connect) wlan_channel = INVALID_CHANNEL; - wilc_wlan_set_bssid(priv->dev, null_bssid, STATION_MODE); + wilc_wlan_set_bssid(priv->dev, null_bssid, WILC_STATION_MODE); priv->p2p.local_random = 0x01; priv->p2p.recv_random = 0x00; @@ -961,7 +961,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, if (ret) return -ENOMEM; - op_mode = AP_MODE; + op_mode = WILC_AP_MODE; } else { if (params->key_len > 16 && params->cipher == WLAN_CIPHER_SUITE_TKIP) { @@ -970,7 +970,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, keylen = params->key_len - 16; } - op_mode = STATION_MODE; + op_mode = WILC_STATION_MODE; } if (!pairwise) @@ -1079,7 +1079,7 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, u32 associatedsta = ~0; u32 inactive_time = 0; - if (vif->iftype == AP_MODE || vif->iftype == GO_MODE) { + if (vif->iftype == WILC_AP_MODE || vif->iftype == WILC_GO_MODE) { for (i = 0; i < NUM_STA_ASSOCIATED; i++) { if (!(memcmp(mac, priv->assoc_stainfo.sta_associated_bss[i], @@ -1098,7 +1098,7 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, wilc_get_inactive_time(vif, mac, &inactive_time); sinfo->inactive_time = 1000 * inactive_time; - } else if (vif->iftype == STATION_MODE) { + } else if (vif->iftype == WILC_STATION_MODE) { struct rf_info stats; wilc_get_statistics(vif, &stats, true); @@ -1143,14 +1143,14 @@ static int set_wiphy_params(struct wiphy *wiphy, u32 changed) netdev_dbg(vif->ndev, "Setting WIPHY_PARAM_RETRY_SHORT %d\n", wiphy->retry_short); - cfg_param_val.flag |= RETRY_SHORT; + cfg_param_val.flag |= WILC_CFG_PARAM_RETRY_SHORT; cfg_param_val.short_retry_limit = wiphy->retry_short; } if (changed & WIPHY_PARAM_RETRY_LONG) { netdev_dbg(vif->ndev, "Setting WIPHY_PARAM_RETRY_LONG %d\n", wiphy->retry_long); - cfg_param_val.flag |= RETRY_LONG; + cfg_param_val.flag |= WILC_CFG_PARAM_RETRY_LONG; cfg_param_val.long_retry_limit = wiphy->retry_long; } if (changed & WIPHY_PARAM_FRAG_THRESHOLD) { @@ -1159,7 +1159,7 @@ static int set_wiphy_params(struct wiphy *wiphy, u32 changed) netdev_dbg(vif->ndev, "Setting WIPHY_PARAM_FRAG_THRESHOLD %d\n", wiphy->frag_threshold); - cfg_param_val.flag |= FRAG_THRESHOLD; + cfg_param_val.flag |= WILC_CFG_PARAM_FRAG_THRESHOLD; cfg_param_val.frag_threshold = wiphy->frag_threshold; } else { netdev_err(vif->ndev, @@ -1173,7 +1173,7 @@ static int set_wiphy_params(struct wiphy *wiphy, u32 changed) netdev_dbg(vif->ndev, "Setting WIPHY_PARAM_RTS_THRESHOLD %d\n", wiphy->rts_threshold); - cfg_param_val.flag |= RTS_THRESHOLD; + cfg_param_val.flag |= WILC_CFG_PARAM_RTS_THRESHOLD; cfg_param_val.rts_threshold = wiphy->rts_threshold; } else { netdev_err(vif->ndev, "RTS threshold out of range\n"); @@ -1768,11 +1768,11 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, dev->ieee80211_ptr->iftype = type; priv->wdev->iftype = type; vif->monitor_flag = 0; - vif->iftype = STATION_MODE; - wilc_set_operation_mode(vif, STATION_MODE); + vif->iftype = WILC_STATION_MODE; + wilc_set_operation_mode(vif, WILC_STATION_MODE); memset(priv->assoc_stainfo.sta_associated_bss, 0, - MAX_NUM_STA * ETH_ALEN); + WILC_MAX_NUM_STA * ETH_ALEN); wl->enable_ps = true; wilc_set_power_mgmt(vif, 1, 0); @@ -1783,8 +1783,8 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, dev->ieee80211_ptr->iftype = type; priv->wdev->iftype = type; vif->monitor_flag = 0; - vif->iftype = CLIENT_MODE; - wilc_set_operation_mode(vif, STATION_MODE); + vif->iftype = WILC_CLIENT_MODE; + wilc_set_operation_mode(vif, WILC_STATION_MODE); wl->enable_ps = false; wilc_set_power_mgmt(vif, 0, 0); @@ -1794,12 +1794,12 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, wl->enable_ps = false; dev->ieee80211_ptr->iftype = type; priv->wdev->iftype = type; - vif->iftype = AP_MODE; + vif->iftype = WILC_AP_MODE; if (wl->initialized) { wilc_set_wfi_drv_handler(vif, wilc_get_vif_idx(vif), 0, vif->ifc_id, false); - wilc_set_operation_mode(vif, AP_MODE); + wilc_set_operation_mode(vif, WILC_AP_MODE); wilc_set_power_mgmt(vif, 0, 0); } break; @@ -1808,10 +1808,10 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, vif->obtaining_ip = true; mod_timer(&vif->during_ip_timer, jiffies + msecs_to_jiffies(DURING_IP_TIME_OUT)); - wilc_set_operation_mode(vif, AP_MODE); + wilc_set_operation_mode(vif, WILC_AP_MODE); dev->ieee80211_ptr->iftype = type; priv->wdev->iftype = type; - vif->iftype = GO_MODE; + vif->iftype = WILC_GO_MODE; wl->enable_ps = false; wilc_set_power_mgmt(vif, 0, 0); @@ -1838,7 +1838,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev, if (ret != 0) netdev_err(dev, "Error in setting channel\n"); - wilc_wlan_set_bssid(dev, wl->vif[vif->idx]->src_addr, AP_MODE); + wilc_wlan_set_bssid(dev, wl->vif[vif->idx]->src_addr, WILC_AP_MODE); wilc_set_power_mgmt(vif, 0, 0); return wilc_add_beacon(vif, settings->beacon_interval, @@ -1865,7 +1865,7 @@ static int stop_ap(struct wiphy *wiphy, struct net_device *dev) struct wilc_vif *vif = netdev_priv(priv->dev); u8 null_bssid[ETH_ALEN] = {0}; - wilc_wlan_set_bssid(dev, null_bssid, AP_MODE); + wilc_wlan_set_bssid(dev, null_bssid, WILC_AP_MODE); ret = wilc_del_beacon(vif); @@ -1883,7 +1883,7 @@ static int add_station(struct wiphy *wiphy, struct net_device *dev, struct add_sta_param sta_params = { {0} }; struct wilc_vif *vif = netdev_priv(dev); - if (vif->iftype == AP_MODE || vif->iftype == GO_MODE) { + if (vif->iftype == WILC_AP_MODE || vif->iftype == WILC_GO_MODE) { memcpy(sta_params.bssid, mac, ETH_ALEN); memcpy(priv->assoc_stainfo.sta_associated_bss[params->aid], mac, ETH_ALEN); @@ -1918,7 +1918,7 @@ static int del_station(struct wiphy *wiphy, struct net_device *dev, struct wilc_vif *vif = netdev_priv(dev); struct sta_info *info; - if (!(vif->iftype == AP_MODE || vif->iftype == GO_MODE)) + if (!(vif->iftype == WILC_AP_MODE || vif->iftype == WILC_GO_MODE)) return ret; info = &priv->assoc_stainfo; @@ -1939,7 +1939,7 @@ static int change_station(struct wiphy *wiphy, struct net_device *dev, struct add_sta_param sta_params = { {0} }; struct wilc_vif *vif = netdev_priv(dev); - if (vif->iftype == AP_MODE || vif->iftype == GO_MODE) { + if (vif->iftype == WILC_AP_MODE || vif->iftype == WILC_GO_MODE) { memcpy(sta_params.bssid, mac, ETH_ALEN); sta_params.aid = params->aid; sta_params.rates_len = params->supported_rates_len; @@ -2141,7 +2141,7 @@ struct wireless_dev *wilc_create_wiphy(struct net_device *net, priv = wdev_priv(wdev); priv->wdev = wdev; - wdev->wiphy->max_scan_ssids = MAX_NUM_PROBED_SSID; + wdev->wiphy->max_scan_ssids = WILC_MAX_NUM_PROBED_SSID; #ifdef CONFIG_PM wdev->wiphy->wowlan = &wowlan_support; #endif diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 6283d9e..c6dad12 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -57,7 +57,7 @@ struct wilc_wfi_wep_key { }; struct sta_info { - u8 sta_associated_bss[MAX_NUM_STA][ETH_ALEN]; + u8 sta_associated_bss[WILC_MAX_NUM_STA][ETH_ALEN]; }; /*Parameters needed for host interface for remaining on channel*/ @@ -94,8 +94,8 @@ struct wilc_priv { u8 wep_key_len[4]; /* The real interface that the monitor is on */ struct net_device *real_ndev; - struct wilc_wfi_key *wilc_gtk[MAX_NUM_STA]; - struct wilc_wfi_key *wilc_ptk[MAX_NUM_STA]; + struct wilc_wfi_key *wilc_gtk[WILC_MAX_NUM_STA]; + struct wilc_wfi_key *wilc_ptk[WILC_MAX_NUM_STA]; u8 wilc_groupkey; /* mutexes */ struct mutex scan_req_lock; @@ -168,7 +168,7 @@ struct wilc { int dev_irq_num; int close; u8 vif_num; - struct wilc_vif *vif[NUM_CONCURRENT_IFC]; + struct wilc_vif *vif[WILC_NUM_CONCURRENT_IFC]; u8 open_ifcs; /*protect head of transmit queue*/ struct mutex txq_add_to_head_cs; diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index d474b87..563ce62 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1205,7 +1205,7 @@ int wilc_send_config_pkt(struct wilc_vif *vif, u8 mode, struct wid *wids, int i; int ret = 0; - if (mode == GET_CFG) { + if (mode == WILC_GET_CFG) { for (i = 0; i < count; i++) { if (!wilc_wlan_cfg_get(vif, !i, wids[i].id, @@ -1221,7 +1221,7 @@ int wilc_send_config_pkt(struct wilc_vif *vif, u8 mode, struct wid *wids, wids[i].val, wids[i].size); } - } else if (mode == SET_CFG) { + } else if (mode == WILC_SET_CFG) { for (i = 0; i < count; i++) { if (!wilc_wlan_cfg_set(vif, !i, wids[i].id, From patchwork Mon Nov 12 05:45:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10678157 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 0EF5C15A6 for ; Mon, 12 Nov 2018 05:45:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F251B287B1 for ; Mon, 12 Nov 2018 05:45:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E68AE2A048; Mon, 12 Nov 2018 05:45:35 +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 8F8CE287B1 for ; Mon, 12 Nov 2018 05:45:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731338AbeKLPhO (ORCPT ); Mon, 12 Nov 2018 10:37:14 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:20249 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbeKLPhO (ORCPT ); Mon, 12 Nov 2018 10:37:14 -0500 X-IronPort-AV: E=Sophos;i="5.54,494,1534834800"; d="scan'208";a="20255123" 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; 11 Nov 2018 22:45:34 -0700 Received: from NAM05-DM3-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.108) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sun, 11 Nov 2018 22:45:34 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7wzuC8+kEr4xYfvgZkUZGsqSxnyi5pGfwXBSOE8Dnj8=; b=Mg19aqTOlGQbUcZ3uUQdHiTJ+EZVbyObPzCotapXQnfZgPJq4AG/2Zn2/ZcaQmQAQj9KPe12KP67lN5M3pmpB5C2Kbyz9SsV83+wl38PZHNtX/VhOXQD5e2WYeUe1VUHWfUqkEBgPJfJGC+d4fHIypmmbSUNEcCNr//TXv2ErTY= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2599.namprd11.prod.outlook.com (52.135.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Mon, 12 Nov 2018 05:45:32 +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.1294.044; Mon, 12 Nov 2018 05:45:32 +0000 From: To: CC: , , , , Subject: [PATCH 11/12] staging: wilc1000: use ENOBUFS error code instead of WILC_TX_ERR_NO_BUF macro Thread-Topic: [PATCH 11/12] staging: wilc1000: use ENOBUFS error code instead of WILC_TX_ERR_NO_BUF macro Thread-Index: AQHUekrtislktLPEfUqSa2LzX+QlZw== Date: Mon, 12 Nov 2018 05:45:32 +0000 Message-ID: <1542001458-20217-12-git-send-email-ajay.kathat@microchip.com> References: <1542001458-20217-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1542001458-20217-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: MA1PR01CA0135.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::29) 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: [27.59.94.109] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2599;6:BtKOIJXiEUgcsMbh6QpFyk+8yW2ESX5F2EeZeo7S8iNAbbYEs9BuFwvDpZGYGPeVlsCbrhjyyfceDswVIpcmYbaPMO3Hmax/LW4M7bBr1C1SC/WZ0TUPfEHTRJ3RefSdgt+uJgi9o80tcVUMGTqneVvQz5t12l5OfNuwLpFa4zEZIYf80XFn9K/qO60QrbiG4ge1g59mk5izxNUjHQ5BhySMuuZ8FNxliS9Qt4Q4fQXDxU1HBf52rxgnkNBiBS77kgpnLlVl60ygk3qgOdc5gFg5AMWAyKaP1E0BH0ZTZ4eS8PBUUA55R9UGWgXmhMo0Wc/9hOMo9bzLR7pYMW7Cr34O8yegrIVrgZ1+QnLlujB+FFJgLiB4wGuZdv0ToWFpaKxwiQ4Q1vqZMtD2Jl91zNWpxhYV0IxXX+a/rUThGcNaz5H0nd+V7sxckly4WQu2n/I2d2SH6N4VwcbAc+E2+g==;5:J1jKZdK2/R5hd+YlehEN6lzRsUNbe/t0Xed7/W80ws9ubOc2/g5qiZ5UUqZNQQ1woulflnHbGLtNOC6g2SDJJEBdD6IJP31LOCnS4dV8gX33hUQ9N0ovDzdLGweCwDdK6UEXbw+Vr9iRnaHb2l2FFy6kbOx8OKqUUuqaHU4czrk=;7:sNFWozdXXvOh61QJ4SQb8Kae2V7p6xi2F8c28CpUSLH2LRP72ZTombBdlGffUMjURcr3V/9snaQG40rFgMkWbHV3m41UsfCAnVLfQ6860RUO7LKAKt5XCx8xxgV7Q4AwwK6n+zc9qWKVFXjAeWy6WA== x-ms-office365-filtering-correlation-id: 0aff0706-7b53-4fc5-1cf2-08d648620f5b x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2599; x-ms-traffictypediagnostic: BYAPR11MB2599: 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)(3002001)(3231402)(944501410)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB2599;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB2599; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(4326008)(25786009)(2906002)(6116002)(3846002)(72206003)(26005)(2351001)(14454004)(86362001)(575784001)(186003)(6436002)(478600001)(6486002)(105586002)(76176011)(106356001)(2501003)(107886003)(5640700003)(54906003)(52116002)(99286004)(102836004)(53936002)(14444005)(256004)(6506007)(386003)(316002)(36756003)(486006)(8936002)(6916009)(11346002)(7736002)(305945005)(476003)(2616005)(68736007)(8676002)(71200400001)(97736004)(5660300001)(66066001)(446003)(81156014)(81166006)(6512007)(71190400001)(2900100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2599;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: eKpgD0Gb3gBm6Cbf8gw5IqpoewV9KqEIRywhykFzjxXQ9hfY+lgvcUrr7vFHQB+UXXvTW4/Sb4HvWadHqKdV1TfTmcWbUZQHwlkTM/FmUtW9hRXUknWATPUD+Y+7F5lXkQC5ioHEM/ILPgxWe0E7cCleeXvdCwoqwYTk+2HTnQGDYC/I318fwKxxfcMUrANmHA75HeqKJtWV1QOze6UmS42dT2iZTEQg1gTCaybh/twYG1LmVMkfwbACERJx2mSu+fV47+lKpTM28/lRJKLBEXOaLOfDgBUyyPO8g/w5p5c/+mKoRaXDZkLzHuV/QTKEkmBoi7cxc2dDJcYqLSqosID61tBmat0LWPBN4T56SDo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 0aff0706-7b53-4fc5-1cf2-08d648620f5b X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 05:45:32.3740 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2599 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Make use of 'ENOBUFS' instead of WILC_TX_ERR_NO_BUF macro. The value of WILC_TX_ERR_NO_BUF is -2, which is confusing with ENOENT error code. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/linux_wlan.c | 2 +- drivers/staging/wilc1000/wilc_wlan.c | 2 +- drivers/staging/wilc1000/wilc_wlan_if.h | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 96d8834..66fb988 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -242,7 +242,7 @@ static int linux_wlan_txq_task(void *vp) if (netif_queue_stopped(wl->vif[1]->ndev)) netif_wake_queue(wl->vif[1]->ndev); } - } while (ret == WILC_TX_ERR_NO_BUF && !wl->close); + } while (ret == -ENOBUFS && !wl->close); } return 0; } diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 563ce62..f0b10e2 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -611,7 +611,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) goto out_release_bus; if (entries == 0) { - ret = WILC_TX_ERR_NO_BUF; + ret = -ENOBUFS; goto out_release_bus; } diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index f4f6ac6..e2310d8 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -41,8 +41,6 @@ struct tx_complete_data { typedef void (*wilc_tx_complete_func_t)(void *, int); -#define WILC_TX_ERR_NO_BUF (-2) - /******************************************** * * Wlan Configuration ID From patchwork Mon Nov 12 05:45:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10678161 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 D768B14DB for ; Mon, 12 Nov 2018 05:45:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6C11286B1 for ; Mon, 12 Nov 2018 05:45:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BAE2C2A046; Mon, 12 Nov 2018 05: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 43FD5286B1 for ; Mon, 12 Nov 2018 05:45:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731355AbeKLPhR (ORCPT ); Mon, 12 Nov 2018 10:37:17 -0500 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:32674 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731346AbeKLPhR (ORCPT ); Mon, 12 Nov 2018 10:37:17 -0500 X-IronPort-AV: E=Sophos;i="5.54,494,1534834800"; d="scan'208";a="23150826" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Nov 2018 22:45:37 -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; Sun, 11 Nov 2018 22:45:37 -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=S2GCIzDd1uS1OW5hZ2UOHNKzLjQRsn0vIn+K9GW10mQ=; b=dOKZGRGsivQp0HzMtZ+8xKj1WWaFyGYjNVU+BF5XJxH4aPd8/1cK8gd01D7T42DSPt4R2SF5/XNLrWgZKn37eynVIV74h0OZciaI7ynq2VyJpApprZM8uu6iJXFG2wQK9MZK2AjyUlym2RC+Dwa2+T3zZmyuaaA61bqiqwof6gI= Received: from BYAPR11MB2567.namprd11.prod.outlook.com (52.135.226.160) by BYAPR11MB2599.namprd11.prod.outlook.com (52.135.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Mon, 12 Nov 2018 05:45:35 +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.1294.044; Mon, 12 Nov 2018 05:45:35 +0000 From: To: CC: , , , , Subject: [PATCH 12/12] staging: wilc1000: rename tsf_hi element of network_info struct Thread-Topic: [PATCH 12/12] staging: wilc1000: rename tsf_hi element of network_info struct Thread-Index: AQHUekruXCjAPZ0O50yLjLnc3p2keQ== Date: Mon, 12 Nov 2018 05:45:35 +0000 Message-ID: <1542001458-20217-13-git-send-email-ajay.kathat@microchip.com> References: <1542001458-20217-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1542001458-20217-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: MA1PR01CA0135.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::29) 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: [27.59.94.109] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR11MB2599;6:x3sWrTtN7Ifv9N+kyPlQNM5qUFrVdSq1p+Cf31wMAjT8/t5ewTBm0f1bJVCFlO8S2SP+fAzwlLG19XAtM9XWz800nzZrBM/4Lv2QpXh7Wq1YoDEByUX/aLR76lQ9V/NwpW7sKtiHoXUtAl71JT55lDRt0FQAcxCI5fzVVmAtCC79Pl5lvRIpZ7pqBjKCaObggZI1bh54J1sdNQGGqvWBgd8G0fAjKLaWLz2tRrNDsX8/1Bs1GQxYXY5xFZO7bW+0VYd3+avYrQjFXw0bCAxOVCGq2NncSe0n+j1OAjts6z/d/uAhr69DxRFRdgd7g9MsLkf2Rm1mi3C5kpjS7HOdiGrkMS8Ta7scij+/SFSYH7ok0ERvF8PPGJ+I965wdzZFb/cgx8Zx9Ozc16B8ygHzNWN/0khqKezM+IKA6q8AP7ihHP9PgP8X+63r9BbrWmZCSla1ukroYaQicW4/syL9aw==;5:+GgAXuOG4EnwIgutEwTVgjPMN6DVmTUeDT7tyS4N/Iw6fxSlkx9sW9CzTJZfg438x2FsOCUeXuH33dzdJigghMeOyfFtgEeG1FNvFGuyenJBDb0BU0UVVosKarc/DkRb9F4Wc3M/1CNH7BfO/3UirT9ECZPG/Y06YzBmYSBR040=;7:H0vu6wLjQgyo5Y1KbCZkr+dvERUerWlQa4UEGVpIDDUsgdUch4GoODrDiViRNuhkF8xIwP9SEvAK0CxH4TmV/9ge9vcD/6cYIoFZivwdWdXTvyQMl5DyuPvvYKleUxy2dNgCBQBWX4ZkXiatjcbptA== x-ms-office365-filtering-correlation-id: bc94f3cc-69eb-40c3-53bc-08d648621113 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BYAPR11MB2599; x-ms-traffictypediagnostic: BYAPR11MB2599: 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)(3002001)(3231402)(944501410)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BYAPR11MB2599;BCL:0;PCL:0;RULEID:;SRVR:BYAPR11MB2599; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(4326008)(25786009)(2906002)(6116002)(3846002)(72206003)(26005)(2351001)(14454004)(86362001)(186003)(6436002)(478600001)(6486002)(105586002)(76176011)(106356001)(2501003)(107886003)(5640700003)(54906003)(52116002)(99286004)(102836004)(53936002)(256004)(6506007)(386003)(316002)(36756003)(486006)(8936002)(6916009)(11346002)(7736002)(305945005)(476003)(2616005)(68736007)(8676002)(71200400001)(97736004)(5660300001)(66066001)(446003)(81156014)(81166006)(6512007)(71190400001)(2900100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR11MB2599;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: iHr1DOW5U69wcKKN783gmetoi6QU/e+OhlEG4f/KlYUzMDq4FBbulSjj+p0ohogyDLucmOjYQ72YcPcNEKbgCyML8i+Gz83G7RSLUfsT95tCV5CkZ4fm0ZaDy8K0xUjnWfF4tivrJ+LZ3hIuB6OrkXiFRAK9s6Fp4mqh/MyEPC1cwY0+YCXa4+dIShwoSf66TGql85vwIbM4KJpTlSDNTxFB77crcYVhW+luqk9cmhHQoFnCZWyNCycvNXAZwGRO4F2vFDqsXGV08OPWqWXRq556Z0y9XKaqe3/QiF20zBF9bb/i04snOU5lWAYFI6TRR2FrHbzgVBuRHOo811ObX250Z8B+voXqUeU77ctPvEY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: bc94f3cc-69eb-40c3-53bc-08d648621113 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 05:45:35.2599 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2599 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajay Singh Rename 'tsf_hi' element in network_info struct as it's not used to store only the higher 32-bit value but the complete 64-bit tsf value. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.c | 8 ++++---- drivers/staging/wilc1000/host_interface.h | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 5ab426c..3f3b013 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1098,14 +1098,14 @@ static s32 wilc_parse_network_info(u8 *msg_buffer, 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; + info->tsf = le64_to_cpu(mgt->u.probe_resp.timestamp); + info->tsf_lo = (u32)info->tsf; 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; + info->tsf = le64_to_cpu(mgt->u.beacon.timestamp); + info->tsf_lo = (u32)info->tsf; offset = offsetof(struct ieee80211_mgmt, u.beacon.variable); } else { /* only process probe response and beacon frame */ diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 606e80a..8279345 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -76,7 +76,7 @@ struct network_info { u16 ies_len; void *join_params; struct rssi_history_buffer rssi_history; - u64 tsf_hi; + u64 tsf; }; struct connect_info { diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 9906a9f7..1dec6bb 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -193,7 +193,7 @@ static void refresh_scan(struct wilc_priv *priv, bool direct_scan) channel, CFG80211_BSS_FTYPE_UNKNOWN, network_info->bssid, - network_info->tsf_hi, + network_info->tsf, network_info->cap_info, network_info->beacon_period, (const u8 *)network_info->ies, @@ -308,7 +308,7 @@ static void add_network_to_shadow(struct network_info *nw_info, shadow_nw_info->beacon_period = nw_info->beacon_period; shadow_nw_info->dtim_period = nw_info->dtim_period; shadow_nw_info->ch = nw_info->ch; - shadow_nw_info->tsf_hi = nw_info->tsf_hi; + shadow_nw_info->tsf = nw_info->tsf; if (ap_found != -1) kfree(shadow_nw_info->ies); shadow_nw_info->ies = kmemdup(nw_info->ies, nw_info->ies_len, @@ -372,7 +372,7 @@ static void cfg_scan_result(enum scan_event scan_event, channel, CFG80211_BSS_FTYPE_UNKNOWN, network_info->bssid, - network_info->tsf_hi, + network_info->tsf, network_info->cap_info, network_info->beacon_period, (const u8 *)network_info->ies,