From patchwork Tue Nov 6 00:01:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adham Abozaeid X-Patchwork-Id: 10669509 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 365EC13BF for ; Tue, 6 Nov 2018 00:01:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 284EC295C7 for ; Tue, 6 Nov 2018 00:01:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A8502976A; Tue, 6 Nov 2018 00:01:32 +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 379CC294B4 for ; Tue, 6 Nov 2018 00:01:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728643AbeKFJXr (ORCPT ); Tue, 6 Nov 2018 04:23:47 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:22115 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726589AbeKFJXr (ORCPT ); Tue, 6 Nov 2018 04:23:47 -0500 X-IronPort-AV: E=Sophos;i="5.54,469,1534834800"; d="scan'208";a="19973277" 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; 05 Nov 2018 17:01:22 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.106) with Microsoft SMTP Server (TLS) id 14.3.352.0; Mon, 5 Nov 2018 17:01:18 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ILHTXkSrJCa0cYDSARUc1QDmJOuP1sh/ThqEwzGiDAU=; b=RIxpiI3boRMxHbmuE59virbEUqGnhO5uebsjCsQZeMOWGNYQKIV4/oJuzie794C7j5SKmahvCbGIwfvyBmPt3NDFJDJjfy28MkiNTjaE0ZaSGQYXdFlHsRh8nTKjtP+R5roLL/OMAv8SBVHPm4sH7ZX8meu/OSfGq+SN9B8gUTY= Received: from SN6PR11MB3407.namprd11.prod.outlook.com (52.135.111.96) by SN6PR11MB2639.namprd11.prod.outlook.com (52.135.91.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Tue, 6 Nov 2018 00:01:17 +0000 Received: from SN6PR11MB3407.namprd11.prod.outlook.com ([fe80::a1c0:26cf:6e24:2feb]) by SN6PR11MB3407.namprd11.prod.outlook.com ([fe80::a1c0:26cf:6e24:2feb%2]) with mapi id 15.20.1250.028; Tue, 6 Nov 2018 00:01:17 +0000 From: To: CC: , , , , Subject: [PATCH v3 1/4] staging: wilc1000: remove unused flags in handle_cfg_param() Thread-Topic: [PATCH v3 1/4] staging: wilc1000: remove unused flags in handle_cfg_param() Thread-Index: AQHUdWPXq5QzWW0E1UquqaT/6odJ9A== Date: Tue, 6 Nov 2018 00:01:17 +0000 Message-ID: <20181106000109.6178-2-adham.abozaeid@microchip.com> References: <20181106000109.6178-1-adham.abozaeid@microchip.com> In-Reply-To: <20181106000109.6178-1-adham.abozaeid@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [198.175.253.81] x-clientproxiedby: BYAPR11CA0084.namprd11.prod.outlook.com (2603:10b6:a03:f4::25) To SN6PR11MB3407.namprd11.prod.outlook.com (2603:10b6:805:bd::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Adham.Abozaeid@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SN6PR11MB2639;6:TXJP3QzaZGGSblILNW7mBTaoTBN6+4L5goxLkSDsB21BWUZTP+OlasTzF+nmx2pq8o1DBCcaeE5ZVORfp8cUDKz+Gimm2HRTnjAE3DPQvhT+4zpXQN1fCNBwGEE2iB5P/nlYMcCqCd0of+S/KccbBU3wgbJhOT85sT56nE7dsyG/JmPQ3/shR8L0xSXbZtLqe1IPodMQ5nZ9d9luZThHW+tAVhqK8iZOUlBAvtmXyb3iYgfruDjAASvLDnmSCR4vQpitep6YGhWFAJMG1AFWkxhHVJRCp5zHQP8+Nj9XaPLhoX9K/61h49/E5FDl3eIxIm9ZQoSXWcG/n2bJdvAdM0CfhVX/cxIbPpMS2dTFnuO9QoDTucxGiXL4AVuFhGGRut7gbUN4OJIS8nbXrz/GniiVb/A+OWZ//6KUsI/LrFcPA2189OusVvqFnnBRGYmo6T0cyvt92Qn4DTBpvirTkA==;5:sNNrdTV+h2H03dysoNNUBZVYAP1rv8JCQHm+7JGCSqh9PNCSV0ENucWTuImQ1+DfVZ6mM21JhvoPa0ryo/bWCw5l9+mfW1/euOD1eMxwgHgtXDmR0Y5s/1HAdHZ0nzSJzFqTaqPcXeccnbjEdiSA7UlMx+iQVhqG+06i1N9OcTw=;7:5sY0julI7EwwUgfYH2oWiZrBmzj+0uFn27XhUOmn2rIDSI79uGk8Sens6nINkOrS7DXxTVYKLaxKTqIT3pnXKlZXQ9pO14FjxRc9JrNQXqBcuUPromfrgJNtfgKY9W6kw/7UQhlKW8oEzGFNsiiqAA== x-ms-office365-filtering-correlation-id: 85729a53-e87f-49e3-f870-08d6437af95a x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:SN6PR11MB2639; x-ms-traffictypediagnostic: SN6PR11MB2639: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3231382)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095);SRVR:SN6PR11MB2639;BCL:0;PCL:0;RULEID:;SRVR:SN6PR11MB2639; x-forefront-prvs: 0848C1A6AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(396003)(39860400002)(346002)(366004)(136003)(189003)(199004)(99286004)(1076002)(3846002)(6116002)(8676002)(6486002)(6436002)(36756003)(86362001)(5640700003)(316002)(54906003)(6506007)(5660300001)(76176011)(72206003)(71190400001)(6916009)(52116002)(386003)(71200400001)(53936002)(6512007)(81156014)(81166006)(8936002)(14454004)(2906002)(256004)(68736007)(66066001)(14444005)(486006)(4326008)(478600001)(102836004)(2501003)(551544002)(186003)(26005)(305945005)(2351001)(11346002)(7736002)(2616005)(446003)(106356001)(105586002)(2900100001)(25786009)(97736004)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR11MB2639;H:SN6PR11MB3407.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: hmH6DdXRNBsnk+SYGLX3AjXxELl61oJ+yktDZjLy4u2XQsX7ZOXtj6QaDSc8Dh34GGFlSA6KJoTLQw4th31lOniQ5X4XZ0ZDIcPiQIahPWX2ECGTxSFD7z6CLYJDjOHvfOtgku5/pBV6egLXTX00ySp37l0S3iL80Ic+3OFEZO9LmLz13+2pclx3Bo8g6isNpodkM8+FKDTp7yE7B9sWYFbqTOUO9fw1/Oy0YsFNXLJju3zslgbzA7utJs1LIfYU/OfGtgfIhjr0XuEWBQccYXw23ZKNo8fvKbH5NSqCSwleBFXvRrnvet8SKLdDNb8M5/5oaF9ASlvvE+m7C1I/3zAut6WGj5b7bXgqkwAwEkc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 85729a53-e87f-49e3-f870-08d6437af95a X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2018 00:01:17.2086 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2639 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: Adham Abozaeid handle_cfg_param() receives a bit map that describes what to be changed. Some of these bits flags aren't referred to from elsewhere and can be removed. Signed-off-by: Adham Abozaeid --- drivers/staging/wilc1000/host_interface.c | 216 ---------------------- drivers/staging/wilc1000/host_interface.h | 29 --- drivers/staging/wilc1000/wilc_wlan_if.h | 9 - 3 files changed, 254 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c4f858b22914..b89116c57064 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -374,64 +374,6 @@ static void handle_cfg_param(struct work_struct *work) mutex_lock(&hif_drv->cfg_values_lock); - if (param->flag & BSS_TYPE) { - u8 bss_type = param->bss_type; - - if (bss_type < 6) { - wid_list[i].id = WID_BSS_TYPE; - wid_list[i].val = (s8 *)¶m->bss_type; - wid_list[i].type = WID_CHAR; - wid_list[i].size = sizeof(char); - hif_drv->cfg_values.bss_type = bss_type; - } else { - netdev_err(vif->ndev, "check value 6 over\n"); - goto unlock; - } - i++; - } - if (param->flag & AUTH_TYPE) { - u8 auth_type = param->auth_type; - - if (auth_type == 1 || auth_type == 2 || auth_type == 5) { - wid_list[i].id = WID_AUTH_TYPE; - wid_list[i].val = (s8 *)¶m->auth_type; - wid_list[i].type = WID_CHAR; - wid_list[i].size = sizeof(char); - hif_drv->cfg_values.auth_type = auth_type; - } else { - netdev_err(vif->ndev, "Impossible value\n"); - goto unlock; - } - i++; - } - if (param->flag & AUTHEN_TIMEOUT) { - if (param->auth_timeout > 0) { - wid_list[i].id = WID_AUTH_TIMEOUT; - wid_list[i].val = (s8 *)¶m->auth_timeout; - wid_list[i].type = WID_SHORT; - wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.auth_timeout = param->auth_timeout; - } else { - netdev_err(vif->ndev, "Range(1 ~ 65535) over\n"); - goto unlock; - } - i++; - } - if (param->flag & POWER_MANAGEMENT) { - u8 pm_mode = param->power_mgmt_mode; - - if (pm_mode < 5) { - wid_list[i].id = WID_POWER_MANAGEMENT; - wid_list[i].val = (s8 *)¶m->power_mgmt_mode; - wid_list[i].type = WID_CHAR; - wid_list[i].size = sizeof(char); - hif_drv->cfg_values.power_mgmt_mode = pm_mode; - } else { - netdev_err(vif->ndev, "Invalid power mode\n"); - goto unlock; - } - i++; - } if (param->flag & RETRY_SHORT) { u16 retry_limit = param->short_retry_limit; @@ -492,160 +434,6 @@ static void handle_cfg_param(struct work_struct *work) } i++; } - if (param->flag & PREAMBLE) { - u16 preamble_type = param->preamble_type; - - if (param->preamble_type < 3) { - wid_list[i].id = WID_PREAMBLE; - wid_list[i].val = (s8 *)¶m->preamble_type; - wid_list[i].type = WID_CHAR; - wid_list[i].size = sizeof(char); - hif_drv->cfg_values.preamble_type = preamble_type; - } else { - netdev_err(vif->ndev, "Preamble Range(0~2) over\n"); - goto unlock; - } - i++; - } - if (param->flag & SHORT_SLOT_ALLOWED) { - u8 slot_allowed = param->short_slot_allowed; - - if (slot_allowed < 2) { - wid_list[i].id = WID_SHORT_SLOT_ALLOWED; - wid_list[i].val = (s8 *)¶m->short_slot_allowed; - wid_list[i].type = WID_CHAR; - wid_list[i].size = sizeof(char); - hif_drv->cfg_values.short_slot_allowed = slot_allowed; - } else { - netdev_err(vif->ndev, "Short slot(2) over\n"); - goto unlock; - } - i++; - } - if (param->flag & TXOP_PROT_DISABLE) { - u8 prot_disabled = param->txop_prot_disabled; - - if (param->txop_prot_disabled < 2) { - wid_list[i].id = WID_11N_TXOP_PROT_DISABLE; - wid_list[i].val = (s8 *)¶m->txop_prot_disabled; - wid_list[i].type = WID_CHAR; - wid_list[i].size = sizeof(char); - hif_drv->cfg_values.txop_prot_disabled = prot_disabled; - } else { - netdev_err(vif->ndev, "TXOP prot disable\n"); - goto unlock; - } - i++; - } - if (param->flag & BEACON_INTERVAL) { - u16 beacon_interval = param->beacon_interval; - - if (beacon_interval > 0) { - wid_list[i].id = WID_BEACON_INTERVAL; - wid_list[i].val = (s8 *)¶m->beacon_interval; - wid_list[i].type = WID_SHORT; - wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.beacon_interval = beacon_interval; - } else { - netdev_err(vif->ndev, "Beacon interval(1~65535)fail\n"); - goto unlock; - } - i++; - } - if (param->flag & DTIM_PERIOD) { - if (param->dtim_period > 0 && param->dtim_period < 256) { - wid_list[i].id = WID_DTIM_PERIOD; - wid_list[i].val = (s8 *)¶m->dtim_period; - wid_list[i].type = WID_CHAR; - wid_list[i].size = sizeof(char); - hif_drv->cfg_values.dtim_period = param->dtim_period; - } else { - netdev_err(vif->ndev, "DTIM range(1~255) fail\n"); - goto unlock; - } - i++; - } - if (param->flag & SITE_SURVEY) { - enum site_survey enabled = param->site_survey_enabled; - - if (enabled < 3) { - wid_list[i].id = WID_SITE_SURVEY; - wid_list[i].val = (s8 *)¶m->site_survey_enabled; - wid_list[i].type = WID_CHAR; - wid_list[i].size = sizeof(char); - hif_drv->cfg_values.site_survey_enabled = enabled; - } else { - netdev_err(vif->ndev, "Site survey disable\n"); - goto unlock; - } - i++; - } - if (param->flag & SITE_SURVEY_SCAN_TIME) { - u16 scan_time = param->site_survey_scan_time; - - if (scan_time > 0) { - wid_list[i].id = WID_SITE_SURVEY_SCAN_TIME; - wid_list[i].val = (s8 *)¶m->site_survey_scan_time; - wid_list[i].type = WID_SHORT; - wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.site_survey_scan_time = scan_time; - } else { - netdev_err(vif->ndev, "Site scan time(1~65535) over\n"); - goto unlock; - } - i++; - } - if (param->flag & ACTIVE_SCANTIME) { - u16 active_scan_time = param->active_scan_time; - - if (active_scan_time > 0) { - wid_list[i].id = WID_ACTIVE_SCAN_TIME; - wid_list[i].val = (s8 *)¶m->active_scan_time; - wid_list[i].type = WID_SHORT; - wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.active_scan_time = active_scan_time; - } else { - netdev_err(vif->ndev, "Active time(1~65535) over\n"); - goto unlock; - } - i++; - } - if (param->flag & PASSIVE_SCANTIME) { - u16 time = param->passive_scan_time; - - if (time > 0) { - wid_list[i].id = WID_PASSIVE_SCAN_TIME; - wid_list[i].val = (s8 *)¶m->passive_scan_time; - wid_list[i].type = WID_SHORT; - wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.passive_scan_time = time; - } else { - netdev_err(vif->ndev, "Passive time(1~65535) over\n"); - goto unlock; - } - i++; - } - if (param->flag & CURRENT_TX_RATE) { - enum current_tx_rate curr_tx_rate = param->curr_tx_rate; - - if (curr_tx_rate == AUTORATE || curr_tx_rate == MBPS_1 || - curr_tx_rate == MBPS_2 || curr_tx_rate == MBPS_5_5 || - curr_tx_rate == MBPS_11 || curr_tx_rate == MBPS_6 || - curr_tx_rate == MBPS_9 || curr_tx_rate == MBPS_12 || - curr_tx_rate == MBPS_18 || curr_tx_rate == MBPS_24 || - curr_tx_rate == MBPS_36 || curr_tx_rate == MBPS_48 || - curr_tx_rate == MBPS_54) { - wid_list[i].id = WID_CURRENT_TX_RATE; - wid_list[i].val = (s8 *)&curr_tx_rate; - wid_list[i].type = WID_SHORT; - wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.curr_tx_rate = (u8)curr_tx_rate; - } else { - netdev_err(vif->ndev, "out of TX rate\n"); - goto unlock; - } - i++; - } ret = wilc_send_config_pkt(vif, SET_CFG, wid_list, i, wilc_get_vif_idx(vif)); @@ -3489,11 +3277,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) mutex_lock(&hif_drv->cfg_values_lock); hif_drv->hif_state = HOST_IF_IDLE; - hif_drv->cfg_values.site_survey_enabled = SITE_SURVEY_OFF; hif_drv->cfg_values.scan_source = DEFAULT_SCAN; - hif_drv->cfg_values.active_scan_time = ACTIVE_SCAN_TIME; - hif_drv->cfg_values.passive_scan_time = PASSIVE_SCAN_TIME; - hif_drv->cfg_values.curr_tx_rate = AUTORATE; hif_drv->p2p_timeout = 0; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 5f8d30f47cd6..df9fc33be094 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -158,26 +158,11 @@ enum current_tx_rate { struct cfg_param_attr { u32 flag; u8 ht_enable; - u8 bss_type; - u8 auth_type; - u16 auth_timeout; - u8 power_mgmt_mode; u16 short_retry_limit; u16 long_retry_limit; u16 frag_threshold; u16 rts_threshold; - u16 preamble_type; - u8 short_slot_allowed; - u8 txop_prot_disabled; - u16 beacon_interval; - u16 dtim_period; - enum site_survey site_survey_enabled; - u16 site_survey_scan_time; u8 scan_source; - u16 active_scan_time; - u16 passive_scan_time; - enum current_tx_rate curr_tx_rate; - }; enum cfg_param { @@ -185,20 +170,6 @@ enum cfg_param { RETRY_LONG = BIT(1), FRAG_THRESHOLD = BIT(2), RTS_THRESHOLD = BIT(3), - BSS_TYPE = BIT(4), - AUTH_TYPE = BIT(5), - AUTHEN_TIMEOUT = BIT(6), - POWER_MANAGEMENT = BIT(7), - PREAMBLE = BIT(8), - SHORT_SLOT_ALLOWED = BIT(9), - TXOP_PROT_DISABLE = BIT(10), - BEACON_INTERVAL = BIT(11), - DTIM_PERIOD = BIT(12), - SITE_SURVEY = BIT(13), - SITE_SURVEY_SCAN_TIME = BIT(14), - ACTIVE_SCANTIME = BIT(15), - PASSIVE_SCANTIME = BIT(16), - CURRENT_TX_RATE = BIT(17), HT_ENABLE = BIT(18), }; diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index ce2066b74287..4f258bf6a48d 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -698,13 +698,8 @@ enum { WID_LONG_RETRY_LIMIT = 0x1003, WID_BEACON_INTERVAL = 0x1006, WID_MEMORY_ACCESS_16BIT = 0x1008, - WID_RX_SENSE = 0x100B, - WID_ACTIVE_SCAN_TIME = 0x100C, - WID_PASSIVE_SCAN_TIME = 0x100D, - WID_SITE_SURVEY_SCAN_TIME = 0x100E, WID_JOIN_START_TIMEOUT = 0x100F, - WID_AUTH_TIMEOUT = 0x1010, WID_ASOC_TIMEOUT = 0x1011, WID_11I_PROTOCOL_TIMEOUT = 0x1012, WID_EAPOL_RESPONSE_TIMEOUT = 0x1013, @@ -739,11 +734,8 @@ enum { WID_HW_RX_COUNT = 0x2015, WID_MEMORY_ADDRESS = 0x201E, WID_MEMORY_ACCESS_32BIT = 0x201F, - WID_RF_REG_VAL = 0x2021, /* NMAC Integer WID list */ - WID_11N_PHY_ACTIVE_REG_VAL = 0x2080, - /* Custom Integer WID list */ WID_GET_INACTIVE_TIME = 0x2084, WID_SET_OPERATION_MODE = 0X2086, @@ -764,7 +756,6 @@ enum { WID_SUPP_PASSWORD = 0x3011, WID_SITE_SURVEY_RESULTS = 0x3012, WID_RX_POWER_LEVEL = 0x3013, - WID_DEL_ALL_RX_BA = 0x3014, WID_SET_STA_MAC_INACTIVE_TIME = 0x3017, WID_ADD_WEP_KEY = 0x3019, WID_REMOVE_WEP_KEY = 0x301A, From patchwork Tue Nov 6 00:01:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adham Abozaeid X-Patchwork-Id: 10669505 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 D65A013BF for ; Tue, 6 Nov 2018 00:01:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA3C2294B4 for ; Tue, 6 Nov 2018 00:01:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD6BC2981F; Tue, 6 Nov 2018 00:01:24 +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 1E6C6294B4 for ; Tue, 6 Nov 2018 00:01:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727814AbeKFJXk (ORCPT ); Tue, 6 Nov 2018 04:23:40 -0500 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:41791 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726680AbeKFJXk (ORCPT ); Tue, 6 Nov 2018 04:23:40 -0500 X-IronPort-AV: E=Sophos;i="5.54,469,1534834800"; d="scan'208";a="22705233" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 05 Nov 2018 17:01:22 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.106) with Microsoft SMTP Server (TLS) id 14.3.352.0; Mon, 5 Nov 2018 17:01: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=89qkqBNoNN1aBsHPSP5V/3uuQKwj9TczfbC6RIkgfUo=; b=psXnVsYX9Xo6EU7mOZqZ2Gp4RqRBCqpPIMjT9S2SAvdRJg7ri2bsY+fivJMJBarHyOj4uVgbz/mhojVM6noK4RLjMdZoeYRPyKHi34lO3Q/m1Vf5dzW70023gs2fAMxp/o7NwQJ4Y5twVKAzIs4+lyIpkTM1q07rI7skHKrvSRs= Received: from SN6PR11MB3407.namprd11.prod.outlook.com (52.135.111.96) by SN6PR11MB2639.namprd11.prod.outlook.com (52.135.91.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Tue, 6 Nov 2018 00:01:18 +0000 Received: from SN6PR11MB3407.namprd11.prod.outlook.com ([fe80::a1c0:26cf:6e24:2feb]) by SN6PR11MB3407.namprd11.prod.outlook.com ([fe80::a1c0:26cf:6e24:2feb%2]) with mapi id 15.20.1250.028; Tue, 6 Nov 2018 00:01:18 +0000 From: To: CC: , , , , Subject: [PATCH v3 2/4] staging: wilc1000: validate cfg parameters before scheduling the work Thread-Topic: [PATCH v3 2/4] staging: wilc1000: validate cfg parameters before scheduling the work Thread-Index: AQHUdWPXxcun4ZLEiEWHqfumlI+XRQ== Date: Tue, 6 Nov 2018 00:01:18 +0000 Message-ID: <20181106000109.6178-3-adham.abozaeid@microchip.com> References: <20181106000109.6178-1-adham.abozaeid@microchip.com> In-Reply-To: <20181106000109.6178-1-adham.abozaeid@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [198.175.253.81] x-clientproxiedby: BYAPR11CA0084.namprd11.prod.outlook.com (2603:10b6:a03:f4::25) To SN6PR11MB3407.namprd11.prod.outlook.com (2603:10b6:805:bd::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Adham.Abozaeid@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SN6PR11MB2639;6:Gpm3RMUriaYL0qaqn0R660JTg0VFaugfYHpRLCopkZdxDmeBcI6WWFp0SHDkui+Zo24845SFxEh0FJ/ggjhExvqTBkdtnHejreQxQGj/cYCLy2SjM454kbnupeA4mF/LI+iC0MWuZdErs3bRMpHlly4B9G9RDY9BSPLo33rZFQ02Yb1UdmvCNBxENRqpV02k/sC7dA7Juv/jCQI2baJwUyG+wGKdihzmSykUOV1Fh/i3/DW+vuyhchxrwu79q/IuWpsws0Mo5O6W5ZkrZpexWxEwzB/Xe5bbgUfESRLBtLNcWHYbtUE0QjWUlshfphKskzOAtJuMfkWkDB2/Xgcp2Nm6iv5HKOf8wJgy7qqPgv4DlZqyI3R8KGs2uUdU7LrKn7kUjalxaDNAMEjPaYzlsLwlSPdCmgOeR16oSE6mRrQTYsSJUYQc7zJj88ITlu3dxk4LsVur0tbxnph9Ny74WQ==;5:/vPKJaP+diAy7cRzc+wX8FJJuDK1y2BMqF15AGk8dbe9yRg9AUb4BjKNFBJlyHkWfTOsQqdQliaQ5VFEa+gj7hkE36KuVUi92Y86GRvRS9Y5QSFMDZIdOSe7KFsQdvXwX91Oj6OETVd4+GBIYUylbmNB3yODmk1p5WDUv7CXDvI=;7:uhHrWlUjgvJ8Njr3ixzsJLEnzluoDMBPX60Q6F9zhI5iCL6Aum86OWBDFeFtaDadCq+184I4aaHPj71lIVCaY7M0U+1nXfEQziTxYzgaDzgAjAF8AfcSfroh4yh45pMDEV0qTkCUejj9AdNNsxPodw== x-ms-office365-filtering-correlation-id: 5880cf0e-7982-4857-65b0-08d6437af9ef x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:SN6PR11MB2639; x-ms-traffictypediagnostic: SN6PR11MB2639: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3231382)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095);SRVR:SN6PR11MB2639;BCL:0;PCL:0;RULEID:;SRVR:SN6PR11MB2639; x-forefront-prvs: 0848C1A6AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(396003)(39860400002)(346002)(366004)(136003)(189003)(199004)(99286004)(1076002)(3846002)(6116002)(8676002)(6486002)(6436002)(36756003)(86362001)(5640700003)(316002)(54906003)(6506007)(5660300001)(76176011)(72206003)(71190400001)(6916009)(52116002)(386003)(71200400001)(15650500001)(53936002)(6512007)(81156014)(81166006)(8936002)(14454004)(2906002)(256004)(68736007)(66066001)(14444005)(486006)(4326008)(478600001)(102836004)(2501003)(186003)(26005)(305945005)(2351001)(11346002)(7736002)(2616005)(446003)(106356001)(105586002)(2900100001)(25786009)(97736004)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR11MB2639;H:SN6PR11MB3407.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: hNqpMKHwIyN16a6AiioNe+yPZ+T0Q8S1dqE3sYtgSbJiTlGG8wSjtglQLMscxUB7FlRwle7mkmUZzl8ZhH0XlZm6LdIV4uqHzKYXKZuZnrYy4YnGk0nhOqQVVwuIyF0dHTsOzAJc3OF/xW8F0b384iSVoIzhgnx6kqxM4KwWXOA5cmBfoy8XI0NktZfJXS4Cs84Z4+ApU9GJTRMPPqjzpJPefqKSrvS6oQcIy9phZWKMGegkmvUR0eYY17MzSwJtOPE3489AeSbtkcXXxP653xbUkANPCIeEAxbUHPaxATUiTM/fdHLYs8hNbqGh+HW/C3XNar7vE2Tn+Tu2zW0z7X3AVv4JyU2Chpl4IKrzvj4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 5880cf0e-7982-4857-65b0-08d6437af9ef X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2018 00:01:18.1343 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2639 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: Adham Abozaeid Validate cfg parameters after being called by cfg80211 in set_wiphy_params before scheduling the work executed in handle_cfg_param Signed-off-by: Adham Abozaeid --- drivers/staging/wilc1000/host_interface.c | 61 ++++++------------- .../staging/wilc1000/wilc_wfi_cfgoperations.c | 50 ++++++++++++--- 2 files changed, 62 insertions(+), 49 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b89116c57064..c1215c194907 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -377,61 +377,41 @@ static void handle_cfg_param(struct work_struct *work) if (param->flag & RETRY_SHORT) { u16 retry_limit = param->short_retry_limit; - if (retry_limit > 0 && retry_limit < 256) { - 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); - hif_drv->cfg_values.short_retry_limit = retry_limit; - } else { - netdev_err(vif->ndev, "Range(1~256) over\n"); - goto unlock; - } + 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); + hif_drv->cfg_values.short_retry_limit = retry_limit; i++; } if (param->flag & RETRY_LONG) { u16 limit = param->long_retry_limit; - if (limit > 0 && limit < 256) { - 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); - hif_drv->cfg_values.long_retry_limit = limit; - } else { - netdev_err(vif->ndev, "Range(1~256) over\n"); - goto unlock; - } + 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); + hif_drv->cfg_values.long_retry_limit = limit; i++; } if (param->flag & FRAG_THRESHOLD) { u16 frag_th = param->frag_threshold; - if (frag_th > 255 && frag_th < 7937) { - 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); - hif_drv->cfg_values.frag_threshold = frag_th; - } else { - netdev_err(vif->ndev, "Threshold Range fail\n"); - goto unlock; - } + 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); + hif_drv->cfg_values.frag_threshold = frag_th; i++; } if (param->flag & RTS_THRESHOLD) { u16 rts_th = param->rts_threshold; - if (rts_th > 255) { - wid_list[i].id = WID_RTS_THRESHOLD; - wid_list[i].val = (s8 *)¶m->rts_threshold; - wid_list[i].type = WID_SHORT; - wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.rts_threshold = rts_th; - } else { - netdev_err(vif->ndev, "Threshold Range fail\n"); - goto unlock; - } + wid_list[i].id = WID_RTS_THRESHOLD; + wid_list[i].val = (s8 *)¶m->rts_threshold; + wid_list[i].type = WID_SHORT; + wid_list[i].size = sizeof(u16); + hif_drv->cfg_values.rts_threshold = rts_th; i++; } @@ -441,7 +421,6 @@ static void handle_cfg_param(struct work_struct *work) if (ret) netdev_err(vif->ndev, "Error in setting CFG params\n"); -unlock: mutex_unlock(&hif_drv->cfg_values_lock); kfree(msg); } diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 4fbbbbd5a64b..26bb78a49d81 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1149,21 +1149,55 @@ static int set_wiphy_params(struct wiphy *wiphy, u32 changed) cfg_param_val.flag = 0; if (changed & WIPHY_PARAM_RETRY_SHORT) { - cfg_param_val.flag |= RETRY_SHORT; - cfg_param_val.short_retry_limit = wiphy->retry_short; + if (wiphy->retry_short > 0 && wiphy->retry_short < 256) { + netdev_dbg(vif->ndev, + "Setting WIPHY_PARAM_RETRY_SHORT %d\n", + wiphy->retry_short); + cfg_param_val.flag |= RETRY_SHORT; + cfg_param_val.short_retry_limit = wiphy->retry_short; + } else { + netdev_err(vif->ndev, "Short retry limit out of range\n"); + return -EINVAL; + } } if (changed & WIPHY_PARAM_RETRY_LONG) { - cfg_param_val.flag |= RETRY_LONG; - cfg_param_val.long_retry_limit = wiphy->retry_long; + if (wiphy->retry_long > 0 && wiphy->retry_long < 256) { + netdev_dbg(vif->ndev, + "Setting WIPHY_PARAM_RETRY_LONG %d\n", + wiphy->retry_long); + cfg_param_val.flag |= RETRY_LONG; + cfg_param_val.long_retry_limit = wiphy->retry_long; + } else { + netdev_err(vif->ndev, "Long retry limit out of range\n"); + return -EINVAL; + } } if (changed & WIPHY_PARAM_FRAG_THRESHOLD) { - cfg_param_val.flag |= FRAG_THRESHOLD; - cfg_param_val.frag_threshold = wiphy->frag_threshold; + if (wiphy->frag_threshold > 255 && + wiphy->frag_threshold < 7937) { + netdev_dbg(vif->ndev, + "Setting WIPHY_PARAM_FRAG_THRESHOLD %d\n", + wiphy->frag_threshold); + cfg_param_val.flag |= FRAG_THRESHOLD; + cfg_param_val.frag_threshold = wiphy->frag_threshold; + } else { + netdev_err(vif->ndev, + "Fragmentation threshold out of range\n"); + return -EINVAL; + } } if (changed & WIPHY_PARAM_RTS_THRESHOLD) { - cfg_param_val.flag |= RTS_THRESHOLD; - cfg_param_val.rts_threshold = wiphy->rts_threshold; + if (wiphy->rts_threshold > 255) { + netdev_dbg(vif->ndev, + "Setting WIPHY_PARAM_RTS_THRESHOLD %d\n", + wiphy->rts_threshold); + cfg_param_val.flag |= RTS_THRESHOLD; + cfg_param_val.rts_threshold = wiphy->rts_threshold; + } else { + netdev_err(vif->ndev, "RTS threshold out of range\n"); + return -EINVAL; + } } ret = wilc_hif_set_cfg(vif, &cfg_param_val); From patchwork Tue Nov 6 00:01:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adham Abozaeid X-Patchwork-Id: 10669511 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 AC1EC1803 for ; Tue, 6 Nov 2018 00:01:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DCA1294B4 for ; Tue, 6 Nov 2018 00:01:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91A162976A; Tue, 6 Nov 2018 00:01:32 +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 216B5294B4 for ; Tue, 6 Nov 2018 00:01:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728809AbeKFJXs (ORCPT ); Tue, 6 Nov 2018 04:23:48 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:22115 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726680AbeKFJXs (ORCPT ); Tue, 6 Nov 2018 04:23:48 -0500 X-IronPort-AV: E=Sophos;i="5.54,469,1534834800"; d="scan'208";a="19973278" 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; 05 Nov 2018 17:01:23 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.106) with Microsoft SMTP Server (TLS) id 14.3.352.0; Mon, 5 Nov 2018 17:01:23 -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=IN5CIXOIFMpcCFiLwdu0rHAgdRDXaeinHDWcc5B/zF0=; b=YzX2/JpQlCK+7ezc2+p5r1rEy4XgotCOyGpmKdb59uRF7KNzXbAB9RxkJShg81hfCWjdJP/b7/e2Wdmfk8lD8JYeHyPsB653c9ATgtcY2rUuGzQ74Fx+QqU9wOSs6RARfF5egW3fMIrTGkHRGS8fnz2pwWPNiVUtkvQcwjEklOI= Received: from SN6PR11MB3407.namprd11.prod.outlook.com (52.135.111.96) by SN6PR11MB2639.namprd11.prod.outlook.com (52.135.91.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Tue, 6 Nov 2018 00:01:19 +0000 Received: from SN6PR11MB3407.namprd11.prod.outlook.com ([fe80::a1c0:26cf:6e24:2feb]) by SN6PR11MB3407.namprd11.prod.outlook.com ([fe80::a1c0:26cf:6e24:2feb%2]) with mapi id 15.20.1250.028; Tue, 6 Nov 2018 00:01:19 +0000 From: To: CC: , , , , Subject: [PATCH v3 3/4] staging: wilc1000: Don't keep a copy of wiphy parameters in the driver Thread-Topic: [PATCH v3 3/4] staging: wilc1000: Don't keep a copy of wiphy parameters in the driver Thread-Index: AQHUdWPYTYWY18NIQUON/TJQsYkLug== Date: Tue, 6 Nov 2018 00:01:19 +0000 Message-ID: <20181106000109.6178-4-adham.abozaeid@microchip.com> References: <20181106000109.6178-1-adham.abozaeid@microchip.com> In-Reply-To: <20181106000109.6178-1-adham.abozaeid@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [198.175.253.81] x-clientproxiedby: BYAPR11CA0084.namprd11.prod.outlook.com (2603:10b6:a03:f4::25) To SN6PR11MB3407.namprd11.prod.outlook.com (2603:10b6:805:bd::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Adham.Abozaeid@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SN6PR11MB2639;6:Cgm9tk+RrWLx0vHvRnKxeJvOLpAsuGYAiJ/ngjOqfVWCt88euOHfzbyNVLAu10Y83GbFV+t0w/bitjQn48fnuw82B7GAsFdruHrI/aNJ0HuqUlhgVbnnWVaAM8FC8nUDs93f+BInPjK+xBFqFcmBXn/qKvsZFL6l+HHy9tydsWD258yspSQxX7jMomDggzUXpV+ZIK3y/Lp+YsQnRbJxYBqW1446klW1iYUy87855jzIvctyq44z1MAFiQwydLD/fJnajR1eewX6OmalhoM1O8zWW6MhqDKBpwh9Cmb0mu4Y1R+5CLJx6Puccy8ZBUz0dEjTCr5iSOq0yLi1yloC33jY/60cwllPwxSB8dk5BqI1Uk9R/Th5+OUZTfaqnZMOTKqKwKFf7JbOqhgUzShOcUSqmyFuYeBynQgyCOLZf78Lw/VFQuUbBwOpkDkyYDdK+ZWwyvbj2i94PSbNtimAHg==;5:dVXCvC3eyvTQ2JxP7e+pBFNhDLxnZdOslVmcho8yJ+UBGT4KmLo+nPO1BjJxXpaG9/D7pfypghaUUrUOHslIq77Il7F+ymkWSDUJD5HikTiziPaRGYHUpPKZSHJZun7CRlTe+Ih2kS13WNlDcTd1glcqDyTPz7svGUq6sWPzW7Y=;7:UZGpDkqnIbsF1/1QwCyIROFQqlOxQqFT7m8Mbr5kNsljm8OX7b3hw49Rcis5kpJGv6rw/f0T6XIUb7Od3zGLjvm9j7ws9846+B3/S/ObAAk+7N99U9aszIgYq4ye38gk6IRsp1b5drgDEiTF7kKLRQ== x-ms-office365-filtering-correlation-id: e127fea5-400c-49e7-6910-08d6437afa7d x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:SN6PR11MB2639; x-ms-traffictypediagnostic: SN6PR11MB2639: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3231382)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095);SRVR:SN6PR11MB2639;BCL:0;PCL:0;RULEID:;SRVR:SN6PR11MB2639; x-forefront-prvs: 0848C1A6AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(396003)(39860400002)(346002)(366004)(136003)(189003)(199004)(99286004)(1076002)(3846002)(6116002)(8676002)(6486002)(6436002)(36756003)(86362001)(5640700003)(316002)(54906003)(6506007)(5660300001)(76176011)(72206003)(71190400001)(6916009)(52116002)(386003)(71200400001)(53936002)(6512007)(81156014)(81166006)(8936002)(14454004)(2906002)(256004)(68736007)(66066001)(14444005)(486006)(4326008)(478600001)(102836004)(2501003)(186003)(26005)(305945005)(2351001)(11346002)(7736002)(2616005)(446003)(106356001)(105586002)(2900100001)(25786009)(97736004)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR11MB2639;H:SN6PR11MB3407.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: 9Yb1IDVuIAi/etmS/qTnrX3rz+vTsOUba6SQII9sw+ioOmh00xKHHPAkwWWK1KmHspbc+xzRXbI9e/jzleU91503azzNA//bYBc2FFXvLUQE4hf8jZFg9N5FRdQGeBUlJvJEUBCztEmvqpz6/XDb15hPSPqF8Gb4bmty0ZjlfIKauRR8ah9HJuFQM2CecDpwNepp9AINIdjCEe2q1I9Hij69iRhRde7NetS/ins14KK+M8ObZoYwHX0Jof/gPbuFCnvaTrleD0jKe2ivOiJ5RqqOAu0ueobmjjNZD0501WJ3PSOExkB+SGDVtbZRSPhc7w0Y9qrgaWAyj51a2SLdqUghZmCH8QzxADmagsF/Noo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e127fea5-400c-49e7-6910-08d6437afa7d X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2018 00:01:19.0540 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2639 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: Adham Abozaeid host_if_drv.cfg_values is a write only member, and can be removed Signed-off-by: Adham Abozaeid --- drivers/staging/wilc1000/host_interface.c | 13 ------------- drivers/staging/wilc1000/host_interface.h | 1 - 2 files changed, 14 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c1215c194907..8d1142776310 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -375,43 +375,31 @@ static void handle_cfg_param(struct work_struct *work) mutex_lock(&hif_drv->cfg_values_lock); if (param->flag & RETRY_SHORT) { - u16 retry_limit = param->short_retry_limit; - 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); - hif_drv->cfg_values.short_retry_limit = retry_limit; i++; } if (param->flag & RETRY_LONG) { - u16 limit = param->long_retry_limit; - 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); - hif_drv->cfg_values.long_retry_limit = limit; i++; } if (param->flag & FRAG_THRESHOLD) { - u16 frag_th = 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); - hif_drv->cfg_values.frag_threshold = frag_th; i++; } if (param->flag & RTS_THRESHOLD) { - u16 rts_th = param->rts_threshold; - wid_list[i].id = WID_RTS_THRESHOLD; wid_list[i].val = (s8 *)¶m->rts_threshold; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.rts_threshold = rts_th; i++; } @@ -3256,7 +3244,6 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) mutex_lock(&hif_drv->cfg_values_lock); hif_drv->hif_state = HOST_IF_IDLE; - hif_drv->cfg_values.scan_source = DEFAULT_SCAN; hif_drv->p2p_timeout = 0; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index df9fc33be094..1e2e50e91f76 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -293,7 +293,6 @@ struct host_if_drv { enum host_if_state hif_state; u8 assoc_bssid[ETH_ALEN]; - struct cfg_param_attr cfg_values; /*lock to protect concurrent setting of cfg params*/ struct mutex cfg_values_lock; From patchwork Tue Nov 6 00:01:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adham Abozaeid X-Patchwork-Id: 10669507 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 38A2913BF for ; Tue, 6 Nov 2018 00:01:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CF50294B4 for ; Tue, 6 Nov 2018 00:01:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20E022976A; Tue, 6 Nov 2018 00:01:26 +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 AC82B294B4 for ; Tue, 6 Nov 2018 00:01:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728136AbeKFJXl (ORCPT ); Tue, 6 Nov 2018 04:23:41 -0500 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:41791 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726680AbeKFJXl (ORCPT ); Tue, 6 Nov 2018 04:23:41 -0500 X-IronPort-AV: E=Sophos;i="5.54,469,1534834800"; d="scan'208";a="22705238" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 05 Nov 2018 17:01:24 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.106) with Microsoft SMTP Server (TLS) id 14.3.352.0; Mon, 5 Nov 2018 17:01:23 -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=mZ2lB/4ASxi7OBfJU4mEw8ABxxDWI2cwY9oVY61Glb0=; b=R02bxlSQ2qCOA29rgcStBnFAVSr0fk+aE2+mlWi1+o6XIgoL5NOyxZmc41EozEEIdSo6Ga8mseMaj1CIJPaMeJw4RM0jSFWCQjfXmQtPiX4IcgqsecYiPgjpQMiY/w4GgtzcHIyAPTdX1uSq8HUhQ742TmMJhI7s4b87cDUQ23Q= Received: from SN6PR11MB3407.namprd11.prod.outlook.com (52.135.111.96) by SN6PR11MB2639.namprd11.prod.outlook.com (52.135.91.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Tue, 6 Nov 2018 00:01:20 +0000 Received: from SN6PR11MB3407.namprd11.prod.outlook.com ([fe80::a1c0:26cf:6e24:2feb]) by SN6PR11MB3407.namprd11.prod.outlook.com ([fe80::a1c0:26cf:6e24:2feb%2]) with mapi id 15.20.1250.028; Tue, 6 Nov 2018 00:01:20 +0000 From: To: CC: , , , , Subject: [PATCH v3 4/4] staging: wilc1000: Remove unused mutex cfg_values_lock Thread-Topic: [PATCH v3 4/4] staging: wilc1000: Remove unused mutex cfg_values_lock Thread-Index: AQHUdWPYkP7QvLxzV0+sJxJvn3G43A== Date: Tue, 6 Nov 2018 00:01:19 +0000 Message-ID: <20181106000109.6178-5-adham.abozaeid@microchip.com> References: <20181106000109.6178-1-adham.abozaeid@microchip.com> In-Reply-To: <20181106000109.6178-1-adham.abozaeid@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [198.175.253.81] x-clientproxiedby: BYAPR11CA0084.namprd11.prod.outlook.com (2603:10b6:a03:f4::25) To SN6PR11MB3407.namprd11.prod.outlook.com (2603:10b6:805:bd::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Adham.Abozaeid@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SN6PR11MB2639;6:1ZjSHfXheJA4iqgFore+Z6Z06W3IeERqmKzEc7OJ6esp+cZpQumdkaqEorSnJeJLyBMcVmJHc8ZuVghxLfbZn2e2nFOMDe/mJ3kRB8FrVfzV62eOqcsVuBU8wygcbA30hecexzT4Ak4h/F3ULa0UVZl9l+0bG3ZfYVQYVJfGgs08o13jbVIJc2OFKA/vDaZpVs9aWSkK4M5bhbci3cTcY2BwEwaHKM3zUuNeJ4Zmxt9VDFf2nnsdoNsAgVlAxJ1NYwVSTbTWtVkvRmAC6xxYdF+Xiek1RzdCBgFE/vmokE1F/5MO9CTRWL4NUftvn7VDRgY5XwwsiGEu6bIh+BTN5l+D5AGkzIAQh5AYKcT6UTGwVehcjMSTtVYgklXrmogwsXuGtLeA4rCadCWA2c06O112NQFSKqZYVIscPkDiTGvBd5OQ1dFsBtMVBxTJkNGv4RPzxItwBz2g1DHRcmxLVA==;5:Y59GnAE7TpZaBO+ubLPZtKLZDdpwFbM4SQMnOYsop6vlBjl/jGNwjyGeK/NJeV5a0X4T+pVrdz8o0SMJFgz53zAc5ZsuRUvmXU+ui5CZtqRyMPHFdlI2rn9PrLhKLx6ujt9httbOXFNEz2XZMFL2Q8Pbc1m6SkxancCXTCzHMew=;7:yfitimcOY6tpWCSaXPpCQdotvB032XIaddPhnOF0/4Tpn7EuCPprdRM+UJNfoCmwIPscS8Ud7vW8zYb+0cpGgxe0Z2TOcNi7nk/VwECYmWCqJ5T4RczpCMhRLJY9bgUSnpPuLQpQwZN6lOcVlgXKAw== x-ms-office365-filtering-correlation-id: f6623b89-a4fe-44f4-85b9-08d6437afb08 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:SN6PR11MB2639; x-ms-traffictypediagnostic: SN6PR11MB2639: 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)(8121501046)(5005006)(3231382)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095);SRVR:SN6PR11MB2639;BCL:0;PCL:0;RULEID:;SRVR:SN6PR11MB2639; x-forefront-prvs: 0848C1A6AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(396003)(39860400002)(346002)(366004)(136003)(189003)(199004)(99286004)(1076002)(3846002)(6116002)(8676002)(6486002)(6436002)(36756003)(86362001)(5640700003)(316002)(54906003)(6506007)(5660300001)(76176011)(72206003)(71190400001)(6916009)(52116002)(386003)(71200400001)(53936002)(6512007)(81156014)(81166006)(8936002)(14454004)(2906002)(256004)(68736007)(66066001)(14444005)(486006)(4326008)(478600001)(102836004)(2501003)(186003)(26005)(305945005)(2351001)(11346002)(7736002)(2616005)(446003)(106356001)(105586002)(2900100001)(25786009)(97736004)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR11MB2639;H:SN6PR11MB3407.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: +nO+MuLr5zRXZDT3OuhbXAx54SAbeLVFfCKXO5BiI7gRUShlSO2kbrqux0ojHpVFPVrE86DjXPpMB5t9lkXLnDYKY0r/337aK5Mx6JA0wW+YO2sRwz8xtxoEKcO2Syb5z2zbV8bADSMx6WNRXeoIiHIUai2GUliEb8rWOUyIEQwtmjG5v00TYK9EY0xYCJhPclV6547kGCISHM7Cx5ru2Ie4c131VTe6cxA0jkfb3Y28XnXMaDJPIzqFWPKvTHzz/bpcLF9H7NW8CDwVjeVyS1ANW1mDScV4p5o41Hxj04G9q8A82kgHMLyiEP4NFARTfr99WbEdq+6zpXm9koedu/eQtJgQeTHOPzZJlLsbN2U= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f6623b89-a4fe-44f4-85b9-08d6437afb08 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2018 00:01:20.0027 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2639 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: Adham Abozaeid After removing cfg_values member, cfg_values_lock that was used to protect it can also be removed. Signed-off-by: Adham Abozaeid --- drivers/staging/wilc1000/host_interface.c | 9 --------- drivers/staging/wilc1000/host_interface.h | 2 -- 2 files changed, 11 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 8d1142776310..2bf91df1ded1 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -369,11 +369,8 @@ static void handle_cfg_param(struct work_struct *work) struct cfg_param_attr *param = &msg->body.cfg_info; int ret; struct wid wid_list[32]; - struct host_if_drv *hif_drv = vif->hif_drv; int i = 0; - mutex_lock(&hif_drv->cfg_values_lock); - if (param->flag & RETRY_SHORT) { wid_list[i].id = WID_SHORT_RETRY_LIMIT; wid_list[i].val = (s8 *)¶m->short_retry_limit; @@ -409,7 +406,6 @@ static void handle_cfg_param(struct work_struct *work) if (ret) netdev_err(vif->ndev, "Error in setting CFG params\n"); - mutex_unlock(&hif_drv->cfg_values_lock); kfree(msg); } @@ -3240,15 +3236,10 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) timer_setup(&hif_drv->connect_timer, timer_connect_cb, 0); timer_setup(&hif_drv->remain_on_ch_timer, listen_timer_cb, 0); - mutex_init(&hif_drv->cfg_values_lock); - mutex_lock(&hif_drv->cfg_values_lock); - hif_drv->hif_state = HOST_IF_IDLE; hif_drv->p2p_timeout = 0; - mutex_unlock(&hif_drv->cfg_values_lock); - wilc->clients_count++; return 0; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 1e2e50e91f76..523b46bfb488 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -293,8 +293,6 @@ struct host_if_drv { enum host_if_state hif_state; u8 assoc_bssid[ETH_ALEN]; - /*lock to protect concurrent setting of cfg params*/ - struct mutex cfg_values_lock; struct timer_list scan_timer; struct wilc_vif *scan_timer_vif;