Message ID | 20200115135338.14374-13-Jerome.Pouiller@silabs.com |
---|---|
State | Not Applicable |
Delegated to: | David Miller |
Headers | show
Return-Path: <netdev-owner@vger.kernel.org> X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-silabs-onmicrosoft-com header.b=cOvbzPb2; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47yTXH1ZH1z9sTM for <patchwork-incoming-netdev@ozlabs.org>; Thu, 16 Jan 2020 01:01:51 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729182AbgAONyX (ORCPT <rfc822;patchwork-incoming-netdev@ozlabs.org>); Wed, 15 Jan 2020 08:54:23 -0500 Received: from mail-bn7nam10on2043.outbound.protection.outlook.com ([40.107.92.43]:8538 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729078AbgAONyW (ORCPT <rfc822;netdev@vger.kernel.org>); Wed, 15 Jan 2020 08:54:22 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ipeex1GFqyZBNyQ4NyWJ0YMXat4i22S5ECbRYpur8m2b7CvgIod/+IUo6Xtlf7Jba2gdM7fYwPTkQXLp12fsLwOiOfi/w4bYZvMAVDTrZCikocxAdym1qYMrbGr/ArUUaXDoeL6H0T+GfdPEMXTQd9N4DCce67ZGjG+I7oMyNzY3/TDl4essQxcSCn7DXCBhGHPbIUEjdo1tS0ISisWJXXgjIk50Az4nDETY40duHTKYvCaUBGp/Vtk10KTcUIC7uc20Fv/FaLmroFSSI26snV2cd1U2MiDwvUkUCgkFB63ZRtPWfE9+51a2Z5pnS37Xg05rMV6K/x/O1NZ5Oezrfw== 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=qXjwnQ3yvU8lyBSO2Sod3uaseaRMamnlynrVm+tTnXQ=; b=lVJpiOn/4hLiwYAH21EHgwDYGd/xrtDXqwjrdjpVsEYND2zRplNtxEvtcDlzq/B27x20Bj90COW2/VIIccw2Pem87vuYkGHP7mb9SN4omtzfd8QOkshUD3ok8NBD95zI6YoeNrT9aciEtyXAcm/D5pORw2hnafV2G9B8Y0JAx8NsYmgOld9v8VI8wW7FbBOgilbwtowhzjbdtWANONTZnwNFdiPZvUl6bgeZhreuTk0uMylUC7or0R47j0W6+JGQYIczC5CFtKf45gaMksHDAW5aAAT9oOu3dn0ESIejaiqtP/cZXAgh9doBJnHmFYUtGsrFQNN/ARBYENlXifjgpg== 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=qXjwnQ3yvU8lyBSO2Sod3uaseaRMamnlynrVm+tTnXQ=; b=cOvbzPb2qFGqABA9IoXAfJkESIIXl/tBemMwIYMEuuI1lHtL2AQOGIYEzTc6BDe61mv4fObc5iKwBLqz2fF7ygeR2IuLqLMDre1+wMrDa3NBSx7YJJetZWbo10uGBe4bfo5lxa/fZxqJz/nvSy56Qex7q2J88wr2PXJVBCbAcsU= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:54:19 +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.2623.018; Wed, 15 Jan 2020 13:54:19 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:18 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= <Jerome.Pouiller@silabs.com> To: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>, "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org> CC: "netdev@vger.kernel.org" <netdev@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Kalle Valo <kvalo@codeaurora.org>, "David S . Miller" <davem@davemloft.net>, =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= <Jerome.Pouiller@silabs.com> Subject: [PATCH v2 12/65] staging: wfx: retrieve greenfield mode from sta->ht_cap and bss_conf Thread-Topic: [PATCH v2 12/65] staging: wfx: retrieve greenfield mode from sta->ht_cap and bss_conf Thread-Index: AQHVy6tIGUmVoP+xv0yARbwZJ9m6wQ== Date: Wed, 15 Jan 2020 13:54:19 +0000 Message-ID: <20200115135338.14374-13-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d8d8706e-241c-4e92-945f-08d799c26abf x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: <MN2PR11MB3661ADCC694FB00DE526873A93370@MN2PR11MB3661.namprd11.prod.outlook.com> x-ms-oob-tlc-oobclassifiers: OLM:341; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; 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: jTr/NNEA0dJWg+KFlabysrU0QpKZKKxs4y3QsJDJKch9fXE9F3GYBr1pKBZOh/L2+AyVLefeKUMJtL7ktsoG6uCRyX/wPpakXYLht8iVRP6nTLyL8+KkNVfQO85PRjaDoqkMMbEUcQJwVjq55iPZcdzvnh/oRdWjdWwy8C12HcQqTxwFIIrO+0785Nrni4vCbaeWUF7XtLMyydmOQ4rv6TtmK/rdYbex2Gps4xiSsoYMpIZLecYv6MVw3XVlODicIlv8DPZ2tJ2sqDqTzh+I8rtgT9wqgEogD35nl/+9BqIT02mTIRuV5eQIFmObCQ9LBwlJq+58ad1XPRufRYM1EYvzUuviKLOvEQ/9JmEEdiH6gzP0D2BNkgPBMjaIQC7wmgnAeXt/qDC8bEMwSca2QKTdWkQeCUCnmmju0VzKYItEwdH8QMzew6XR5kPE1pSN Content-Type: text/plain; charset="utf-8" Content-ID: <27482D458E0F914484DE79DE23638CB8@namprd11.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8d8706e-241c-4e92-945f-08d799c26abf X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:19.1788 (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: QFR1sMxPhou9QReCLJ6QA4nVAvcmjaVyupBYJBakNnl2ZbsmGXd6AQr4vDr934eDA4NJInpRiOaW1wQumzMbLw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: <netdev.vger.kernel.org> X-Mailing-List: netdev@vger.kernel.org |
Series |
Simplify and improve the wfx driver
|
expand
|
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index f13a5b41735c..fcd9fe66e417 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -817,14 +817,6 @@ static int wfx_is_ht(const struct wfx_ht_info *ht_info) return ht_info->channel_type != NL80211_CHAN_NO_HT; } -static int wfx_ht_greenfield(const struct wfx_ht_info *ht_info) -{ - return wfx_is_ht(ht_info) && - (ht_info->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD) && - !(ht_info->operation_mode & - IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT); -} - static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_bss_conf *info) { @@ -849,9 +841,8 @@ static void wfx_join_finalize(struct wfx_vif *wvif, } rcu_read_unlock(); - /* Non Greenfield stations present */ - if (wvif->ht_info.operation_mode & - IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) + if (sta && + info->ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) hif_dual_cts_protection(wvif, true); else hif_dual_cts_protection(wvif, false); @@ -862,7 +853,10 @@ static void wfx_join_finalize(struct wfx_vif *wvif, association_mode.spacing = 1; association_mode.short_preamble = info->use_short_preamble; association_mode.basic_rate_set = cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, info->basic_rates)); - association_mode.greenfield = wfx_ht_greenfield(&wvif->ht_info); + if (sta && sta->ht_cap.ht_supported && + !(info->ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT)) + association_mode.greenfield = + !!(sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD); if (sta && sta->ht_cap.ht_supported) association_mode.mpdu_start_spacing = sta->ht_cap.ampdu_density;