From patchwork Mon Apr 6 11:17:47 2020 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: 216092 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AA24C2BA2B for ; Mon, 6 Apr 2020 11:19:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16EC42072A for ; Mon, 6 Apr 2020 11:19:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="bopQMs9/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727528AbgDFLSa (ORCPT ); Mon, 6 Apr 2020 07:18:30 -0400 Received: from mail-dm6nam11on2071.outbound.protection.outlook.com ([40.107.223.71]:6126 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727181AbgDFLS3 (ORCPT ); Mon, 6 Apr 2020 07:18:29 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UszR6/0gk9VuQBwHKFB8DrB25i6FRuuY/CizCaSZPUYgQUNY6PZKHs+PQdwN+rhGxv+Mv8qJLoIWy9GVebRTQFArMZWuwt2Y4l6MCIz1b83TmGlMNErus5MHy0UwNqdiRVDYrt8kpTTEtGUoTBV6E7IUFmrTQlwsNwWg3ZPOZR78OUUdfWDGt9tMKFLeKBm8/EiEE7nOS+yGL93kcJn8rDErx+dseiT/0EE16wIvlJ8JTylbesac+i/5Q4rkmt/DrderG+G7sKIn+qnw3J+Bttw9Aq/zrwb3vtsiAqvAOTusxFDOwTfQqg0u3yBH9OK2aKu9htBkoLT7Qa4Mcu7M3w== 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=71xh9u/RIMkG499DwssDiiGYNVHPEa5/cKqpph8ivW0=; b=KC8NVAg0V8i+ZnmEibnY/mNFDki/jDyD8LZ9wpW/PSG8dWs+QZM+kysoYZOH08JhAFU2HQ4fNYdGEIQFYZ8lCCVN39m2pESzB66TiAALfo1PH2Zi0TdMu4SrTHayGgTh1NxK+1tXZPjgKfoOnvsixydzfkTAscM0dnD1/DAtVoyL50ndbxFW/gK5RoO69+cII2bumCtvWp9E62BCSOgTdO8i/GCicnkUR5+HFObT4D0sRUFffaWtCwHJu9Nzt6v3TtGG9q+pNoNXn0TEI9XsC1YiZknxfSNgdbIt6S9wqQ7x8dS7pYtV3/21SDDKQ9qylMr/jsmdKptNft2YgoXNLA== 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=71xh9u/RIMkG499DwssDiiGYNVHPEa5/cKqpph8ivW0=; b=bopQMs9/GIZbQIw/p9kkbheBG5p/rtt5U5Ow7dnNNrObrYClrETlszZDYkhNbyuKeVlDrAy9+AJZbu1xwuoJH+xRb3iBTBHDeuqdL6q5KMW/OGBu1lxmAbMLmRY6r7QGkYgNNZ903uUwephMFY4pzgICt5v4+OQFH88L9umANFk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from BN6PR11MB4052.namprd11.prod.outlook.com (2603:10b6:405:7a::37) by BN6PR11MB3860.namprd11.prod.outlook.com (2603:10b6:405:77::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15; Mon, 6 Apr 2020 11:18:18 +0000 Received: from BN6PR11MB4052.namprd11.prod.outlook.com ([fe80::e0af:e9de:ffce:7376]) by BN6PR11MB4052.namprd11.prod.outlook.com ([fe80::e0af:e9de:ffce:7376%3]) with mapi id 15.20.2878.018; Mon, 6 Apr 2020 11:18:17 +0000 From: Jerome Pouiller 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 02/11] staging: wfx: relocate LINK_ID_NO_ASSOC and MAX_STA_IN_AP_MODE to hif API Date: Mon, 6 Apr 2020 13:17:47 +0200 Message-Id: <20200406111756.154086-3-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200406111756.154086-1-Jerome.Pouiller@silabs.com> References: <20200406111756.154086-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: DM5PR05CA0010.namprd05.prod.outlook.com (2603:10b6:3:d4::20) To BN6PR11MB4052.namprd11.prod.outlook.com (2603:10b6:405:7a::37) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:544b:f17b:7ae8:fb7) by DM5PR05CA0010.namprd05.prod.outlook.com (2603:10b6:3:d4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.13 via Frontend Transport; Mon, 6 Apr 2020 11:18:16 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:544b:f17b:7ae8:fb7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e7e5e3a6-3ccc-4a30-aa6c-08d7da1c34bc X-MS-TrafficTypeDiagnostic: BN6PR11MB3860: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0365C0E14B X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB4052.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(396003)(39850400004)(346002)(366004)(136003)(376002)(186003)(16526019)(7696005)(52116002)(36756003)(5660300002)(107886003)(316002)(54906003)(66946007)(66476007)(4326008)(2616005)(66556008)(1076003)(81166006)(6666004)(6486002)(8936002)(2906002)(86362001)(81156014)(8676002)(478600001); DIR:OUT; SFP:1101; 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: ARabYavYWCGuNVhIPfFJTw4dYllGb+FCgUD5tt+/bM2vBRaz3izBD0F9hSpM4yduFOHXkRsnJ0IdCsdWOc9Fv39BCDdsKWAR7S+XU57hc3Vky9d+cXfgNEOKJlBl0qCdrM6gDV0DZaqQznZ6vfLVE49Bh+RfTVO6pS5BNnD+yo19sC0RxoRrDh+d5E3LJ1pudkvAbCrydgTRPMskSp4eVRVYz28uVZDm4l6s2Ja038eYuyKBJtrIMXvkfDA8ws2gS2+F/edaKXd9X9EY4EqJSztcmp77T+XgnlSJqqDPHFL3fwq6lektRgMotcwSU9TeoAmjFgwgs2z3Xx/YXU4HjyLyEu4aqNujQZj1f0kMaIC65Y+7Iutn6XpUNaMvYHaFyeCkx21vqZ5lhH2p2f0mM4abEWjAiQPUxAxomAm05Zj++bKBt3Z6psj26Li7ieie X-MS-Exchange-AntiSpam-MessageData: pUj5x91NcaoWydM2gOqqsZ8olywHjMLS7dPc/Zh+oEc/XuLvLguUHWvosQoD+lpPuHzCo3MO3bWihm5BA7900KlXJmG7SndKAql0Bs8VeagvyOEVZU6meYzm2GuVJVhQABIuPHo7iANauoII1CivSyMuEKWKoQr8DFCvbyZmN1coF4CEAbPutEB49L2VIv9TzGBCHrcRUN5sGKgTXSAYsQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7e5e3a6-3ccc-4a30-aa6c-08d7da1c34bc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2020 11:18:17.8261 (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: NsOC8tziAf9AxdkpUM3rzT4chvooRv/1dHH1acc6rGZvevGYVAsISLZH469jpj/oBwiEiHjwRNHdJYeoTWlykQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB3860 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The definitions LINK_ID_NO_ASSOC and MAX_STA_IN_AP_MODE are imposed by the hardware. Therefore, they should be located in the hardware interface API. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 2 +- drivers/staging/wfx/hif_api_cmd.h | 3 +++ drivers/staging/wfx/main.c | 2 +- drivers/staging/wfx/queue.h | 3 --- drivers/staging/wfx/sta.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index c88d14fe614b..757e37454391 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -246,7 +246,7 @@ static u8 wfx_tx_get_link_id(struct wfx_vif *wvif, struct ieee80211_sta *sta, return 0; if (is_multicast_ether_addr(da)) return 0; - return WFX_LINK_ID_NO_ASSOC; + return HIF_LINK_ID_NOT_ASSOCIATED; } static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates) diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h index 071b71e2a107..f6934598f319 100644 --- a/drivers/staging/wfx/hif_api_cmd.h +++ b/drivers/staging/wfx/hif_api_cmd.h @@ -480,6 +480,9 @@ struct hif_cnf_beacon_transmit { u32 status; } __packed; +#define HIF_LINK_ID_MAX 14 +#define HIF_LINK_ID_NOT_ASSOCIATED (HIF_LINK_ID_MAX + 1) + enum hif_sta_map_direction { HIF_STA_MAP = 0x0, HIF_STA_UNMAP = 0x1 diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 738016d45d63..1e9f6da75024 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -313,7 +313,7 @@ struct wfx_dev *wfx_init_common(struct device *dev, hw->wiphy->flags |= WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD; hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; - hw->wiphy->max_ap_assoc_sta = WFX_MAX_STA_IN_AP_MODE; + hw->wiphy->max_ap_assoc_sta = HIF_LINK_ID_MAX; hw->wiphy->max_scan_ssids = 2; hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; hw->wiphy->n_iface_combinations = ARRAY_SIZE(wfx_iface_combinations); diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index ab45e32cbfbc..1020dfde399b 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -13,9 +13,6 @@ #include "hif_api_cmd.h" -#define WFX_MAX_STA_IN_AP_MODE 14 -#define WFX_LINK_ID_NO_ASSOC 15 - struct wfx_dev; struct wfx_vif; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 2e8d3f571c3e..64cf58122661 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -563,7 +563,7 @@ int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, sta_priv->link_id = ffz(wvif->link_id_map); wvif->link_id_map |= BIT(sta_priv->link_id); WARN_ON(!sta_priv->link_id); - WARN_ON(sta_priv->link_id >= WFX_MAX_STA_IN_AP_MODE); + WARN_ON(sta_priv->link_id >= HIF_LINK_ID_MAX); hif_map_link(wvif, sta->addr, 0, sta_priv->link_id); return 0;