From patchwork Mon Dec 16 17:03:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 11294797 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 795BE1580 for ; Mon, 16 Dec 2019 17:10:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C95B206D7 for ; Mon, 16 Dec 2019 17:10:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Dg/Pm5Sc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727006AbfLPRKD (ORCPT ); Mon, 16 Dec 2019 12:10:03 -0500 Received: from mail-eopbgr690046.outbound.protection.outlook.com ([40.107.69.46]:24384 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726733AbfLPRGo (ORCPT ); Mon, 16 Dec 2019 12:06:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mrC6wNWM3Y5wAYhE+0HRwM+ICfyt9RrQjidRycSKsZijy7vDq5j4pdVNbTa90bC7OQymhSrhv5K0BlMPPznZ0u0SaxHSorJECm+B1r0gpgJzGhaF12C8gPQo3aHYZ1vrAO3RaWnXpMRDxLDxU+o15vPcdwytBwiN9cz7LhzwsMd3HM4zihZvE3yuXNpXNDy3DmZ23RHR2d3ee7PD//OW7O/QVBk0Dcv9+Eg7xT4Xym1Ff7xfl49lKXhNpjraGHtHWDZSs00mEjOAOkzGaqR4wji59RZGlsycPoCexwYxF54lyEyLk7nvD3nJbfmwblEsQOg9fEAGtmBjdm9m7zwGeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kmAOJ0agPheGgx1VjfCjzc7s8gA525XeVy4Yz4IE/dE=; b=W8h4qW8+Lz0QzlHv7f9WnFJDxn7wZHs54I6oidNDObo5hhCFKx6m0ySpxB+hUVocBIzX+GkE2kgHp2LwCvGcI/86Ln5RCRizyXsb0jOCeFxOePbMk+8fZcbFELkJuFjxgDMdK55Yhl2m1ZteFLY/B3m2SVkG7nb7zJ32PSkibcVh44WMQUDsnl80p4Wa4j6P/+4Rs0IIPZyxOCeIwFdqmzVvQ7rls+Ws3WkmuqB3IjFkYOJkfvrkY1d3Kk51lesuPXefIaHzWVQIcxDjvnysSva9ogxttXuU5g2jMVXiIatgzKG73xl0HE8VLChm2POK7p1oMAvVDBSLGmsC5zuofw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kmAOJ0agPheGgx1VjfCjzc7s8gA525XeVy4Yz4IE/dE=; b=Dg/Pm5ScnO+EH8xSEK8kJLnTjdLe7yfIKi4pxKxOWIrq+kThT4kIkuAdVCf218XfjERSc0dSLj0mayjBrED9VmskOmbbUXDmEvq3lpB9Q74BCknTHNJN5maQzhw7HvVGrDi4A9d8F8LVNTpTU4UdOeGPt2HDAj7cFtBeNFZykEk= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4142.namprd11.prod.outlook.com (20.179.149.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.15; Mon, 16 Dec 2019 17:06:40 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2538.019; Mon, 16 Dec 2019 17:06:40 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 37/55] staging: wfx: simplify wfx_conf_tx() Thread-Topic: [PATCH 37/55] staging: wfx: simplify wfx_conf_tx() Thread-Index: AQHVtDLLEVDpQgdhxE+clC6qJBCJIw== Date: Mon, 16 Dec 2019 17:03:52 +0000 Message-ID: <20191216170302.29543-38-Jerome.Pouiller@silabs.com> References: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b85700c8-631d-4685-da60-08d7824a51d4 x-ms-traffictypediagnostic: MN2PR11MB4142: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1728; x-forefront-prvs: 02530BD3AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(396003)(346002)(136003)(376002)(39850400004)(199004)(189003)(6512007)(71200400001)(91956017)(6486002)(8676002)(2906002)(54906003)(81166006)(81156014)(186003)(76116006)(478600001)(36756003)(85182001)(85202003)(6666004)(66556008)(66476007)(66446008)(64756008)(1076003)(66574012)(316002)(2616005)(4326008)(6506007)(26005)(8936002)(110136005)(5660300002)(107886003)(66946007)(86362001);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4142;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yoOnKkYEuHbfD9vMdje85NvDq4os7KmgZjgSriRYjUTCzgxTr39w9YcrtS9U7TBCSAYoWTA/kBHpWWqK00Zm0nhsbm7VXB6D5ge/PNgDRuTfeCrZ3e/Cs+YR2F8Z5P11k3Tl2UF7X0ypDLr/djseEcfCNQrpeXajsED8yLJkKG4zlb5YMgcXAIhzGxsWsC7OEaQdhffHbUphg5IKOYi63LnkVB9l61FoVJWOw3ILdScHcx/T5ExXCfVyXJIYjWKODyk/1Rsy1Mz1q2hRB5a/vI8Bn01XFEGmteGdv9OCEVATSrpw/D5jCnCbIyxH8zn9OBq6h8QXMnDuDWrgU9u+ZDegrLk7hVwvNCim0f3N8PetQqjbeE+lfXcPulZWao/rlTDO+C/FLp75nE5xdgUvwFRGCtNxBJtueiz8V8eSggmZ52svstvwFbTyTQCJquJn Content-ID: <3D3EE71444088243A2F99A90DF3B60E6@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b85700c8-631d-4685-da60-08d7824a51d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:52.5272 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rSVaa6BJJNG3OTClZDveCNJKB7DfCaDndjz1tuBl3H7SDLdz37/vRCCFoiF4GhwE4A7Rga7gyHPpMbrcJ7zBVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4142 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Error management of wfx_conf_tx() can be simplified. In add, the hardware command "hif_set_edca_queue_params" never returns any error. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 42 ++++++++++++++------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 42b0d01d85cc..045d3916ada8 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -370,39 +370,27 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, { struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; - int ret = 0; struct hif_req_edca_queue_params *edca; + WARN_ON(queue >= hw->queues); + mutex_lock(&wdev->conf_mutex); + wvif->edca.uapsd_enable[queue] = params->uapsd; + edca = &wvif->edca.params[queue]; + edca->aifsn = params->aifs; + edca->cw_min = params->cw_min; + edca->cw_max = params->cw_max; + edca->tx_op_limit = params->txop * TXOP_UNIT; + edca->allowed_medium_time = 0; + hif_set_edca_queue_params(wvif, edca); - if (queue < hw->queues) { - edca = &wvif->edca.params[queue]; - - wvif->edca.uapsd_enable[queue] = params->uapsd; - edca->aifsn = params->aifs; - edca->cw_min = params->cw_min; - edca->cw_max = params->cw_max; - edca->tx_op_limit = params->txop * TXOP_UNIT; - edca->allowed_medium_time = 0; - ret = hif_set_edca_queue_params(wvif, edca); - if (ret) { - ret = -EINVAL; - goto out; - } - - if (wvif->vif->type == NL80211_IFTYPE_STATION) { - ret = wfx_set_uapsd_param(wvif, &wvif->edca); - if (!ret && wvif->setbssparams_done && - wvif->state == WFX_STATE_STA) - ret = wfx_update_pm(wvif); - } - } else { - ret = -EINVAL; + if (wvif->vif->type == NL80211_IFTYPE_STATION) { + wfx_set_uapsd_param(wvif, &wvif->edca); + if (wvif->setbssparams_done && wvif->state == WFX_STATE_STA) + wfx_update_pm(wvif); } - -out: mutex_unlock(&wdev->conf_mutex); - return ret; + return 0; } int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value)