From patchwork Tue Nov 28 08:31:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lin X-Patchwork-Id: 748044 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="S6aSOrC2" Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2074.outbound.protection.outlook.com [40.107.22.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B239F100; Tue, 28 Nov 2023 00:31:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hK1Ohcq2kp8BiGA8c5Pv/9lwtmet/qMfjFLxtNigJH5nCuvU4iBup9rN34PRG1ZYKPf8ghJMczmls3caalsSP160sWAuZpHYjdUnK2iYB0Qu/e2kfCHAjkQU33mkuFp/ui5S9/7F42+ya9DTzI/zp6MgGetf1YLl/tKB4HWGfqqIrmEizXj/xDsdRTJZCjIvI1my3Cxh4/8QiGLQlGGtACRpYVjD2lWfITDcKFFjlcShzGvGZJe4WPoKucbNvFrsL6RnVw/1RfJifKvdcTEaSMAfPmWIRGXK7v++GawQkpZhDY/3v9IeeJwTxTJSl86f9kCw7yUEhCoLbCcrVJti4g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=quZ5oyAP+t8I2RJ9E8PB+luLtVBTB8mvEzr6Okc9zNg=; b=nemHLA1YF0q/j4XCOBLBfbS1Kk4PMkf18A2+gbzbdZl0UBQ9h3K+0LL97BaquUmxhh5hIFfUTLmelh4XHyo7g7SkrYIUzQIig0eqZJfvX532jiGa2NOxnpnvVImmJmPM6GHlpiEUVMYceITG3avEVtAAizAI0az7cq10LX8KiIMdYErfbcln+sIulE0Kh05vjcbGVmpuuT5aiY50N8eB94UT1nil3UmkJc5Vx8KJnYoou8+wl9r2rESpLOvo4Ch1YKKpBRre7Nxn1RYldnJg9xXbnVP1dHxIU8IoMqQFTCR5FKqbH2rjwRSiAfj+AOd7f9bAkODP4Sepk+4RnTrtRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=quZ5oyAP+t8I2RJ9E8PB+luLtVBTB8mvEzr6Okc9zNg=; b=S6aSOrC2L+KyPVDuEb7UA5wXImWEbSOt+dhMiYvKONZZ8XDDQ5bVyVNwom+E8VXfRe3IcUELlBizvtcu2LxR4UMLHB+tzTSLlFzfYlCx/9xqR/mPK8Wf7uJ3pCNLj3ayW59LW6xw9qtOTdl1lElGr59LEa7Wsftck8x/BrLrbM4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) by PAXPR04MB8653.eurprd04.prod.outlook.com (2603:10a6:102:21c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.22; Tue, 28 Nov 2023 08:31:46 +0000 Received: from PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b]) by PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b%7]) with mapi id 15.20.7046.015; Tue, 28 Nov 2023 08:31:46 +0000 From: David Lin To: linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, briannorris@chromium.org, kvalo@kernel.org, francesco@dolcini.it, tsung-hsien.hsieh@nxp.com, David Lin Subject: [PATCH v7 01/12] wifi: mwifiex: added code to support host mlme. Date: Tue, 28 Nov 2023 16:31:04 +0800 Message-Id: <20231128083115.613235-2-yu-hao.lin@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231128083115.613235-1-yu-hao.lin@nxp.com> References: <20231128083115.613235-1-yu-hao.lin@nxp.com> X-ClientProxiedBy: TYCP286CA0019.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::13) To PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9638:EE_|PAXPR04MB8653:EE_ X-MS-Office365-Filtering-Correlation-Id: 808f9a68-3133-480c-3b8f-08dbefec7537 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5KT99Hk+rKpGDfk5q87qetPCrK3PBs7Zp8hdFi1egOZmknWuKZc8CSWfUD9pK2YfJvUY7mWsgS0EWCx53JVwqilH4DB53mJQUkXfZrcnvLx0x6MbdFlPFGz8qoh5w3HE/1voJA2IrZi30uiAJ+W8pyEzEjeZf44AM8Lq0Yotp0ZuGbZ9w2t59dVixYus/+kScVV/PIYwD19eVWWOi8DRyaqjxJNGMFsSCYMXG559CQBl2N53eTAlFmPDtlX4jltKLmvbXVJOygwV5vZmPAB+buFMcttgMTs3CL5I5Mm6N9N4EnglejjEeWfdazreZAwnQYNO33oA1NTMUWzhDVtJmCPFicsj2DCrcWp/TuhCx18nwcaJcKkHdBN469WzSYLn+FHXwE0L46cJ0VYLCkjzhS9xZAmImNFg4AdJOBAxmIxlmyptlLBi3pEt0fkv0DI+8m57vFo2PfKNv42xddxBZTyAbkbpj3TCeTc7qaoR1KhiuvoLk6hOrHWy+Hrnr/2o3AjFaEY6CNKk23GDJzU5mnv+tfZJQTXnai5g3XVAVrBFucsBxieFI7o2cm0Ogk5n X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(136003)(396003)(366004)(376002)(39860400002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(83380400001)(66946007)(478600001)(6512007)(52116002)(6486002)(86362001)(66556008)(6666004)(66476007)(6916009)(316002)(8676002)(4326008)(8936002)(6506007)(1076003)(2616005)(5660300002)(30864003)(66899024)(38100700002)(41300700001)(2906002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UMJ+8tR7HqPozf3V6jYuidRAMQEu92jLB2zEc3uJuWznpWWpxDIGNahw4gjGDdQ2DEBfweLbRFsQMUgholXdW7GQGl/h/hKCva9XLQXTuXhUprK3SdE4ji0DnHCtOaLIiG+17McjmxNI+30SrzyFjBhETzeiqWDWXzXpJIrtESWHNmsUnZTX391ZojVmVZHc3w93D7/RTRYm6bg3/JIXfqscOHs7StxaxhPM2gh4ZVKqm6SJMT+5CM+ru6xycgfPj6oGNo08RC2CMPZQUCo36HdaqbqheosMci8ZF3ooTg7wglhxCkTdZhlsCYZWzDM9KnOmvSqbxeURu0bHd+bIvSfmQFNzQISXZU3hwdpNOkSVi3kKpQEolP8MWH5BlFJjmB2pepBDfiMJdS6ifgnchUWVuvp9GTHiIHIje3wMEyHKiQxI74WzUvQCHqORQMqEiQYygBXVl87saBsQSv2OPANyKXqVJvLGs4ww/i2QCTmCJ4NKu0rwLEOy7oXCsf/r2Ap8mAvTNB17A55j3dV5Nt5y6GjVtU7c0o7DDuanbzoFsN4WEUi9Jod2KByqv58W3wXP9pP31o+y+5ALGoVfbk7XEpcOKmVGRGgcsZFxiNywZHDQxwxNL7MwR9wVlXQwm9yNJNo37ndySxoVcUUc1eL6zerh1p1MC4pRL6CLSWA/by1MQNt+8bujaxaU2W/KvQ+xI+eYFQiNxTRyMhgOQONqBXIVEIZh0slzyJRvrHIaTnHLL7uN7t9sC1rVzCInvgoRk+Rsj47G+goNn7yWgEdbGuCZvr8MhzbooqDcHGdtsUAW8ZBcNP5disenckiPukP6Tg7tdfBNDizkrDk6+/lQk1hyeN67nCA9u6TjA6oSqQhmI5SLXlPiFyXKySb1K053p1eBe1/ivftt/SwjxG5xKMQMSsn3EvGRVG4jVd0MgKqbCoil9ecZiX132A9LgeZDN1+O72BP3YSoAQok3PO9SwGXENp0PSgiubyyXBiOTpckuQ5iPzYF2H/yXM1rjoqk4y8pf1L8YdSiAvx8TFHCrmG3+aYzdhDfK/mxsZwbn2BjIIiQ30F3E3Qs1WQZBGUcQmPQ3EFGZKzPRHSPokHF6SWMXAe/h10bCuWoV/ao0U+78Bq5XVHWn/unDyjWUfo3Spk7opWWTCZ5NI95gfBxIM4sYkaA5Tq+J9IL5NQ5fVXdLIzpwEvOsSQvSyputcBg/lgcXQ0MyskDXfHxPvxH+jAE/wbjxCEFCOBO2gRAe6K2FZZ8FAnqrv279WpG9rbAPGO3J1p+j/UGmt3IXUV9QxaoLqWVtxUpzDPSkJJJOI5cy6gcmgMv14GZgtyCFniTnG9kymmPD54jzp0xdrGqQHVKj5/6x+eIsktqOppPDnYgs/Bm6WsAF53q0uxorPuwvPsmXVqAp0BVk1Zo+1ND090PB7pycJMfvahaxAZWtfeY4xyMPFf6lO1rWay+JsvPnDCiaMjVqmMNz8tVnAVl7/lSV+PKtNdf8yw6ijfqvIjiLW/3ZeuZnxdYMV/WfGQFbwpnVy2GG5IsFKipYtkSO/qOqd1hg8tlCOlrBN+0lo/PLmoyCeqKthSEyRbHdQkhNQ0fPhUihFPM0v/+eJkGyJNn0po0VP9fHg6HD9BDPVbHekVYU4bIsCJXupCv X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 808f9a68-3133-480c-3b8f-08dbefec7537 X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 08:31:46.4563 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SCoXVAkkLsZ9wLE6pmaSCgI2EjenTWiKIokdzpsZfJp7GaNetGHmAz+wHh8GCZl+X1gakHGcb1vmgapEQ46LsA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8653 1. For station mode first. 2. This feature is a must for WPA3. 3. Firmware key api version 2 is needed for this feature. 4. The code is only enabled and tested with IW416. 5. This feature is disabled for other chips. Signed-off-by: David Lin --- .../net/wireless/marvell/mwifiex/cfg80211.c | 327 ++++++++++++++++++ drivers/net/wireless/marvell/mwifiex/cmdevt.c | 14 +- drivers/net/wireless/marvell/mwifiex/decl.h | 12 + drivers/net/wireless/marvell/mwifiex/fw.h | 15 + drivers/net/wireless/marvell/mwifiex/init.c | 3 + drivers/net/wireless/marvell/mwifiex/join.c | 64 +++- drivers/net/wireless/marvell/mwifiex/main.h | 10 + drivers/net/wireless/marvell/mwifiex/scan.c | 6 + drivers/net/wireless/marvell/mwifiex/sdio.c | 13 + drivers/net/wireless/marvell/mwifiex/sdio.h | 2 + .../net/wireless/marvell/mwifiex/sta_event.c | 18 +- .../net/wireless/marvell/mwifiex/sta_ioctl.c | 3 +- drivers/net/wireless/marvell/mwifiex/sta_tx.c | 9 +- .../net/wireless/marvell/mwifiex/uap_cmd.c | 26 ++ drivers/net/wireless/marvell/mwifiex/util.c | 73 ++++ 15 files changed, 582 insertions(+), 13 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index 7a15ea8072e6..40c39e4765f7 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -57,6 +57,31 @@ ieee80211_iface_combination mwifiex_iface_comb_ap_sta_drcs = { .beacon_int_infra_match = true, }; +struct mwifiex_ieee80211_mgmt { + __le16 frame_control; + __le16 duration; + u8 da[ETH_ALEN]; + u8 sa[ETH_ALEN]; + u8 bssid[ETH_ALEN]; + __le16 seq_ctrl; + u8 addr4[ETH_ALEN]; + union { + struct { + __le16 auth_alg; + __le16 auth_transaction; + __le16 status_code; + /* possibly followed by Challenge text */ + u8 variable[]; + } __packed auth; + struct { + __le16 capab_info; + __le16 listen_interval; + /* followed by SSID and Supported rates */ + u8 variable[]; + } __packed assoc_req; + } u; +} __pack; + /* * This function maps the nl802.11 channel type into driver channel type. * @@ -268,6 +293,8 @@ mwifiex_cfg80211_update_mgmt_frame_registrations(struct wiphy *wiphy, if (mask != priv->mgmt_frame_mask) { priv->mgmt_frame_mask = mask; + if (priv->host_mlme_reg) + priv->mgmt_frame_mask |= HOST_MLME_MGMT_MASK; mwifiex_send_cmd(priv, HostCmd_CMD_MGMT_FRAME_REG, HostCmd_ACT_GEN_SET, 0, &priv->mgmt_frame_mask, false); @@ -848,6 +875,7 @@ static int mwifiex_deinit_priv_params(struct mwifiex_private *priv) struct mwifiex_adapter *adapter = priv->adapter; unsigned long flags; + priv->host_mlme_reg = false; priv->mgmt_frame_mask = 0; if (mwifiex_send_cmd(priv, HostCmd_CMD_MGMT_FRAME_REG, HostCmd_ACT_GEN_SET, 0, @@ -4202,6 +4230,292 @@ mwifiex_cfg80211_change_station(struct wiphy *wiphy, struct net_device *dev, return ret; } +static int +mwifiex_cfg80211_authenticate(struct wiphy *wiphy, + struct net_device *dev, + struct cfg80211_auth_request *req) +{ + struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); + struct mwifiex_adapter *adapter = priv->adapter; + struct sk_buff *skb; + u16 pkt_len, auth_alg; + int ret; + struct mwifiex_ieee80211_mgmt *mgmt; + struct mwifiex_txinfo *tx_info; + u32 tx_control = 0, pkt_type = PKT_TYPE_MGMT; + u8 addr[ETH_ALEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; + u8 trans = 1, status_code = 0; + u8 *varptr; + + if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP) { + mwifiex_dbg(priv->adapter, ERROR, "Interface role is AP\n"); + return -EFAULT; + } + + if (priv->wdev.iftype != NL80211_IFTYPE_STATION) { + mwifiex_dbg(priv->adapter, ERROR, + "Interface type is not correct (type %d)\n", + priv->wdev.iftype); + return -EINVAL; + } + + if (priv->auth_alg != WLAN_AUTH_SAE && + (priv->auth_flag & HOST_MLME_AUTH_PENDING)) { + mwifiex_dbg(priv->adapter, ERROR, "Pending auth on going\n"); + return -EBUSY; + } + + if (!priv->host_mlme_reg) { + priv->host_mlme_reg = true; + priv->mgmt_frame_mask |= HOST_MLME_MGMT_MASK; + mwifiex_send_cmd(priv, HostCmd_CMD_MGMT_FRAME_REG, + HostCmd_ACT_GEN_SET, 0, + &priv->mgmt_frame_mask, false); + } + + switch (req->auth_type) { + case NL80211_AUTHTYPE_OPEN_SYSTEM: + auth_alg = WLAN_AUTH_OPEN; + break; + case NL80211_AUTHTYPE_SHARED_KEY: + auth_alg = WLAN_AUTH_SHARED_KEY; + break; + case NL80211_AUTHTYPE_FT: + auth_alg = WLAN_AUTH_FT; + break; + case NL80211_AUTHTYPE_NETWORK_EAP: + auth_alg = WLAN_AUTH_LEAP; + break; + case NL80211_AUTHTYPE_SAE: + auth_alg = WLAN_AUTH_SAE; + break; + default: + mwifiex_dbg(priv->adapter, ERROR, + "unsupported auth type=%d\n", req->auth_type); + return -EOPNOTSUPP; + } + + if (!priv->auth_flag) { + ret = mwifiex_remain_on_chan_cfg(priv, HostCmd_ACT_GEN_SET, + req->bss->channel, + AUTH_TX_DEFAULT_WAIT_TIME); + + if (!ret) { + priv->roc_cfg.cookie = get_random_u32() | 1; + priv->roc_cfg.chan = *req->bss->channel; + } + } + + priv->sec_info.authentication_mode = auth_alg; + + mwifiex_cancel_scan(adapter); + + pkt_len = (u16)req->ie_len + req->auth_data_len + + MWIFIEX_MGMT_HEADER_LEN + MWIFIEX_AUTH_BODY_LEN; + if (req->auth_data_len >= 4) + pkt_len -= 4; + + skb = dev_alloc_skb(MWIFIEX_MIN_DATA_HEADER_LEN + + MWIFIEX_MGMT_FRAME_HEADER_SIZE + + pkt_len + sizeof(pkt_len)); + if (!skb) { + mwifiex_dbg(priv->adapter, ERROR, + "allocate skb failed for management frame\n"); + return -ENOMEM; + } + + tx_info = MWIFIEX_SKB_TXCB(skb); + memset(tx_info, 0, sizeof(*tx_info)); + tx_info->bss_num = priv->bss_num; + tx_info->bss_type = priv->bss_type; + tx_info->pkt_len = pkt_len; + + skb_reserve(skb, MWIFIEX_MIN_DATA_HEADER_LEN + + MWIFIEX_MGMT_FRAME_HEADER_SIZE + sizeof(pkt_len)); + memcpy(skb_push(skb, sizeof(pkt_len)), &pkt_len, sizeof(pkt_len)); + memcpy(skb_push(skb, sizeof(tx_control)), + &tx_control, sizeof(tx_control)); + memcpy(skb_push(skb, sizeof(pkt_type)), &pkt_type, sizeof(pkt_type)); + + mgmt = (struct mwifiex_ieee80211_mgmt *)skb_put(skb, pkt_len); + memset(mgmt, 0, pkt_len); + mgmt->frame_control = + cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH); + memcpy(mgmt->da, req->bss->bssid, ETH_ALEN); + memcpy(mgmt->sa, priv->curr_addr, ETH_ALEN); + memcpy(mgmt->bssid, req->bss->bssid, ETH_ALEN); + memcpy(mgmt->addr4, addr, ETH_ALEN); + + if (req->auth_data_len >= 4) { + if (req->auth_type == NL80211_AUTHTYPE_SAE) { + __le16 *pos = (__le16 *)req->auth_data; + + trans = le16_to_cpu(pos[0]); + status_code = le16_to_cpu(pos[1]); + } + memcpy((u8 *)(&mgmt->u.auth.variable), req->auth_data + 4, + req->auth_data_len - 4); + varptr = (u8 *)&mgmt->u.auth.variable + + (req->auth_data_len - 4); + } + + mgmt->u.auth.auth_alg = cpu_to_le16(auth_alg); + mgmt->u.auth.auth_transaction = trans; + mgmt->u.auth.status_code = status_code; + + if (req->ie && req->ie_len) { + if (!varptr) + varptr = (u8 *)&mgmt->u.auth.variable; + memcpy((u8 *)varptr, req->ie, req->ie_len); + } + + priv->auth_flag = HOST_MLME_AUTH_PENDING; + priv->auth_alg = auth_alg; + + skb->priority = WMM_HIGHEST_PRIORITY; + __net_timestamp(skb); + + mwifiex_dbg(priv->adapter, MSG, + "auth: send authentication to %pM\n", req->bss->bssid); + + mwifiex_queue_tx_pkt(priv, skb); + + return 0; +} + +static int +mwifiex_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev, + struct cfg80211_assoc_request *req) +{ + struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); + struct mwifiex_adapter *adapter = priv->adapter; + int ret; + struct cfg80211_ssid req_ssid; + const u8 *ssid_ie; + struct cfg80211_rx_assoc_resp assoc_resp = { + .uapsd_queues = -1, + }; + + if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_STA) { + mwifiex_dbg(adapter, ERROR, + "%s: reject infra assoc request in non-STA role\n", + dev->name); + return -EINVAL; + } + + if (test_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags) || + test_bit(MWIFIEX_IS_CMD_TIMEDOUT, &adapter->work_flags)) { + mwifiex_dbg(adapter, ERROR, + "%s: Ignore association.\t" + "Card removed or FW in bad state\n", + dev->name); + return -EFAULT; + } + + if (priv->auth_alg == WLAN_AUTH_SAE) + priv->auth_flag = HOST_MLME_AUTH_DONE; + + if (priv->auth_flag && !(priv->auth_flag & HOST_MLME_AUTH_DONE)) + return -EBUSY; + + if (!mwifiex_stop_bg_scan(priv)) + cfg80211_sched_scan_stopped_locked(priv->wdev.wiphy, 0); + + memset(&req_ssid, 0, sizeof(struct cfg80211_ssid)); + rcu_read_lock(); + ssid_ie = ieee80211_bss_get_ie(req->bss, WLAN_EID_SSID); + + if (!ssid_ie) + goto ssid_err; + + req_ssid.ssid_len = ssid_ie[1]; + if (req_ssid.ssid_len > IEEE80211_MAX_SSID_LEN) { + mwifiex_dbg(priv->adapter, ERROR, "invalid SSID - aborting\n"); + goto ssid_err; + } + + memcpy(req_ssid.ssid, ssid_ie + 2, req_ssid.ssid_len); + if (!req_ssid.ssid_len || req_ssid.ssid[0] < 0x20) { + mwifiex_dbg(priv->adapter, ERROR, "invalid SSID - aborting\n"); + goto ssid_err; + } + rcu_read_unlock(); + + /* As this is new association, clear locally stored + * keys and security related flags + */ + priv->sec_info.wpa_enabled = false; + priv->sec_info.wpa2_enabled = false; + priv->wep_key_curr_index = 0; + priv->sec_info.encryption_mode = 0; + priv->sec_info.is_authtype_auto = 0; + ret = mwifiex_set_encode(priv, NULL, NULL, 0, 0, NULL, 1); + + if (req->crypto.n_ciphers_pairwise) + priv->sec_info.encryption_mode = + req->crypto.ciphers_pairwise[0]; + + if (req->crypto.cipher_group) + priv->sec_info.encryption_mode = req->crypto.cipher_group; + + if (req->ie) + ret = mwifiex_set_gen_ie(priv, req->ie, req->ie_len); + + memcpy(priv->cfg_bssid, req->bss->bssid, ETH_ALEN); + + mwifiex_dbg(priv->adapter, MSG, + "assoc: send association to %pM\n", req->bss->bssid); + + cfg80211_ref_bss(priv->adapter->wiphy, req->bss); + + ret = mwifiex_bss_start(priv, req->bss, &req_ssid); + + if (!ret) { + assoc_resp.links[0].bss = priv->attempted_bss_desc->bss; + assoc_resp.buf = priv->assoc_rsp_buf; + assoc_resp.len = priv->assoc_rsp_size; + cfg80211_rx_assoc_resp(priv->netdev, + &assoc_resp); + } else { + priv->auth_flag = 0; + priv->auth_alg = 0xFFFF; + eth_zero_addr(priv->cfg_bssid); + } + + cfg80211_put_bss(priv->adapter->wiphy, req->bss); + + return 0; + +ssid_err: + + rcu_read_unlock(); + return -EFAULT; +} + +static int +mwifiex_cfg80211_deauthenticate(struct wiphy *wiphy, + struct net_device *dev, + struct cfg80211_deauth_request *req) +{ + return mwifiex_cfg80211_disconnect(wiphy, dev, req->reason_code); +} + +static int +mwifiex_cfg80211_disassociate(struct wiphy *wiphy, + struct net_device *dev, + struct cfg80211_disassoc_request *req) +{ + return mwifiex_cfg80211_disconnect(wiphy, dev, req->reason_code); +} + +static int +mwifiex_cfg80211_probe_client(struct wiphy *wiphy, + struct net_device *dev, const u8 *peer, + u64 *cookie) +{ + return -1; +} + /* station cfg80211 operations */ static struct cfg80211_ops mwifiex_cfg80211_ops = { .add_virtual_intf = mwifiex_add_virtual_intf, @@ -4347,6 +4661,16 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) "%s: creating new wiphy\n", __func__); return -ENOMEM; } + if (adapter->host_mlme) { + mwifiex_cfg80211_ops.auth = mwifiex_cfg80211_authenticate; + mwifiex_cfg80211_ops.assoc = mwifiex_cfg80211_associate; + mwifiex_cfg80211_ops.deauth = mwifiex_cfg80211_deauthenticate; + mwifiex_cfg80211_ops.disassoc = mwifiex_cfg80211_disassociate; + mwifiex_cfg80211_ops.disconnect = NULL; + mwifiex_cfg80211_ops.connect = NULL; + mwifiex_cfg80211_ops.probe_client = + mwifiex_cfg80211_probe_client; + } wiphy->max_scan_ssids = MWIFIEX_MAX_SSID_LIST_LENGTH; wiphy->max_scan_ie_len = MWIFIEX_MAX_VSIE_LEN; wiphy->mgmt_stypes = mwifiex_mgmt_stypes; @@ -4428,6 +4752,9 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) NL80211_FEATURE_LOW_PRIORITY_SCAN | NL80211_FEATURE_NEED_OBSS_SCAN; + if (adapter->host_mlme) + wiphy->features |= NL80211_FEATURE_SAE; + if (ISSUPP_ADHOC_ENABLED(adapter->fw_cap_info)) wiphy->features |= NL80211_FEATURE_HT_IBSS; diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c index 3756aa247e77..311af5f40c3e 100644 --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c @@ -654,7 +654,7 @@ int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no, if (ret) { mwifiex_dbg(adapter, ERROR, "PREP_CMD: cmd %#x preparation failed\n", - cmd_no); + cmd_no); mwifiex_insert_cmd_to_free_q(adapter, cmd_node); return -1; } @@ -1477,6 +1477,17 @@ int mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv, return 0; } +static void mwifiex_check_key_api_ver(struct mwifiex_adapter *adapter) +{ + if (adapter->host_mlme) { + if (adapter->key_api_major_ver != KEY_API_VER_MAJOR_V2) + adapter->host_mlme = false; + mwifiex_dbg(adapter, MSG, "host_mlme: %s, key_api: %d\n", + adapter->host_mlme ? "enable" : "disable", + adapter->key_api_major_ver); + } +} + /* * This function handles the command response of get hardware * specifications. @@ -1586,6 +1597,7 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv, "key_api v%d.%d\n", adapter->key_api_major_ver, adapter->key_api_minor_ver); + mwifiex_check_key_api_ver(adapter); break; case FW_API_VER_ID: adapter->fw_api_ver = diff --git a/drivers/net/wireless/marvell/mwifiex/decl.h b/drivers/net/wireless/marvell/mwifiex/decl.h index 326ffb05d791..f9b21b13d6c3 100644 --- a/drivers/net/wireless/marvell/mwifiex/decl.h +++ b/drivers/net/wireless/marvell/mwifiex/decl.h @@ -24,6 +24,18 @@ #define MWIFIEX_RX_HEADROOM 64 #define MAX_TXPD_SZ 32 #define INTF_HDR_ALIGN 4 +/* frmctl + durationid + addr1 + addr2 + addr3 + seqctl + addr4 */ +#define MWIFIEX_MGMT_HEADER_LEN (2 + 2 + 6 + 6 + 6 + 2 + 6) +/* 6 = auth_alg + auth_transaction + auth_status */ +#define MWIFIEX_AUTH_BODY_LEN 6 + +#define HOST_MLME_AUTH_PENDING BIT(0) +#define HOST_MLME_AUTH_DONE BIT(1) + +#define HOST_MLME_MGMT_MASK (BIT(IEEE80211_STYPE_AUTH >> 4) | \ + BIT(IEEE80211_STYPE_DEAUTH >> 4) | \ + BIT(IEEE80211_STYPE_DISASSOC >> 4)) +#define AUTH_TX_DEFAULT_WAIT_TIME 2400 #define MWIFIEX_MIN_DATA_HEADER_LEN (MWIFIEX_DMA_ALIGN_SZ + INTF_HDR_ALIGN + \ MAX_TXPD_SZ) diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h index 8e6db904e5b2..8b22cd993a79 100644 --- a/drivers/net/wireless/marvell/mwifiex/fw.h +++ b/drivers/net/wireless/marvell/mwifiex/fw.h @@ -209,6 +209,9 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { #define TLV_TYPE_RANDOM_MAC (PROPRIETARY_TLV_BASE_ID + 236) #define TLV_TYPE_CHAN_ATTR_CFG (PROPRIETARY_TLV_BASE_ID + 237) #define TLV_TYPE_MAX_CONN (PROPRIETARY_TLV_BASE_ID + 279) +#define TLV_TYPE_HOST_MLME (PROPRIETARY_TLV_BASE_ID + 307) +#define TLV_TYPE_SAE_PWE_MODE (PROPRIETARY_TLV_BASE_ID + 339) + #define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048 @@ -802,6 +805,11 @@ struct mwifiex_ie_types_ssid_param_set { u8 ssid[]; } __packed; +struct mwifiex_ie_types_host_mlme { + struct mwifiex_ie_types_header header; + u8 host_mlme; +} __packed; + struct mwifiex_ie_types_num_probes { struct mwifiex_ie_types_header header; __le16 num_probes; @@ -905,6 +913,13 @@ struct mwifiex_ie_types_tdls_idle_timeout { __le16 value; } __packed; +#define MWIFIEX_AUTHTYPE_SAE 6 + +struct mwifiex_ie_types_sae_pwe_mode { + struct mwifiex_ie_types_header header; + u8 pwe[]; +} __packed; + struct mwifiex_ie_types_rsn_param_set { struct mwifiex_ie_types_header header; u8 rsn_ie[]; diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c index c9c58419c37b..f86a527fd7ca 100644 --- a/drivers/net/wireless/marvell/mwifiex/init.c +++ b/drivers/net/wireless/marvell/mwifiex/init.c @@ -81,6 +81,9 @@ int mwifiex_init_priv(struct mwifiex_private *priv) priv->bcn_avg_factor = DEFAULT_BCN_AVG_FACTOR; priv->data_avg_factor = DEFAULT_DATA_AVG_FACTOR; + priv->auth_flag = 0; + priv->auth_alg = 0xFFFF; + priv->sec_info.wep_enabled = 0; priv->sec_info.authentication_mode = NL80211_AUTHTYPE_OPEN_SYSTEM; priv->sec_info.encryption_mode = 0; diff --git a/drivers/net/wireless/marvell/mwifiex/join.c b/drivers/net/wireless/marvell/mwifiex/join.c index a6e254a1185c..ef7cc40c3ba4 100644 --- a/drivers/net/wireless/marvell/mwifiex/join.c +++ b/drivers/net/wireless/marvell/mwifiex/join.c @@ -382,7 +382,9 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv, struct mwifiex_ie_types_ss_param_set *ss_tlv; struct mwifiex_ie_types_rates_param_set *rates_tlv; struct mwifiex_ie_types_auth_type *auth_tlv; + struct mwifiex_ie_types_sae_pwe_mode *sae_pwe_tlv; struct mwifiex_ie_types_chan_list_param_set *chan_tlv; + struct mwifiex_ie_types_host_mlme *host_mlme_tlv; u8 rates[MWIFIEX_SUPPORTED_RATES]; u32 rates_size; u16 tmp_cap; @@ -448,7 +450,7 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv, mwifiex_dbg(priv->adapter, INFO, "info: ASSOC_CMD: rates size = %d\n", rates_size); - /* Add the Authentication type to be used for Auth frames */ + /* Add the Authentication type */ auth_tlv = (struct mwifiex_ie_types_auth_type *) pos; auth_tlv->header.type = cpu_to_le16(TLV_TYPE_AUTH_TYPE); auth_tlv->header.len = cpu_to_le16(sizeof(auth_tlv->auth_type)); @@ -460,6 +462,24 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv, pos += sizeof(auth_tlv->header) + le16_to_cpu(auth_tlv->header.len); + if (priv->sec_info.authentication_mode == WLAN_AUTH_SAE) { + auth_tlv->auth_type = cpu_to_le16(MWIFIEX_AUTHTYPE_SAE); + if (bss_desc->bcn_rsnx_ie && + bss_desc->bcn_rsnx_ie->ieee_hdr.len && + (bss_desc->bcn_rsnx_ie->data[0] & + WLAN_RSNX_CAPA_SAE_H2E)) { + sae_pwe_tlv = + (struct mwifiex_ie_types_sae_pwe_mode *)pos; + sae_pwe_tlv->header.type = + cpu_to_le16(TLV_TYPE_SAE_PWE_MODE); + sae_pwe_tlv->header.len = + cpu_to_le16(sizeof(sae_pwe_tlv->pwe[0])); + sae_pwe_tlv->pwe[0] = bss_desc->bcn_rsnx_ie->data[0]; + pos += sizeof(sae_pwe_tlv->header) + + sizeof(sae_pwe_tlv->pwe[0]); + } + } + if (IS_SUPPORT_MULTI_BANDS(priv->adapter) && !(ISSUPP_11NENABLED(priv->adapter->fw_cap_info) && (!bss_desc->disable_11n) && @@ -491,6 +511,16 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv, sizeof(struct mwifiex_chan_scan_param_set); } + if (priv->adapter->host_mlme) { + host_mlme_tlv = (struct mwifiex_ie_types_host_mlme *)pos; + host_mlme_tlv->header.type = cpu_to_le16(TLV_TYPE_HOST_MLME); + host_mlme_tlv->header.len = + cpu_to_le16(sizeof(host_mlme_tlv->host_mlme)); + host_mlme_tlv->host_mlme = 1; + pos += sizeof(host_mlme_tlv->header) + + sizeof(host_mlme_tlv->host_mlme); + } + if (!priv->wps.session_enable) { if (priv->sec_info.wpa_enabled || priv->sec_info.wpa2_enabled) rsn_ie_len = mwifiex_append_rsn_ie_wpa_wpa2(priv, &pos); @@ -634,6 +664,7 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv, u16 cap_info, status_code, aid; const u8 *ie_ptr; struct ieee80211_ht_operation *assoc_resp_ht_oper; + struct ieee80211_mgmt *hdr; if (!priv->attempted_bss_desc) { mwifiex_dbg(priv->adapter, ERROR, @@ -641,7 +672,19 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv, goto done; } - assoc_rsp = (struct ieee_types_assoc_rsp *) &resp->params; + if (adapter->host_mlme) { + hdr = (struct ieee80211_mgmt *)&resp->params; + if (!memcmp(hdr->bssid, + priv->attempted_bss_desc->mac_address, + ETH_ALEN)) + assoc_rsp = (struct ieee_types_assoc_rsp *) + &hdr->u.assoc_resp; + else + assoc_rsp = + (struct ieee_types_assoc_rsp *)&resp->params; + } else { + assoc_rsp = (struct ieee_types_assoc_rsp *)&resp->params; + } cap_info = le16_to_cpu(assoc_rsp->cap_info_bitmap); status_code = le16_to_cpu(assoc_rsp->status_code); @@ -778,7 +821,8 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv, priv->adapter->dbg.num_cmd_assoc_success++; - mwifiex_dbg(priv->adapter, INFO, "info: ASSOC_RESP: associated\n"); + mwifiex_dbg(priv->adapter, MSG, "assoc: associated with %pM\n", + priv->attempted_bss_desc->mac_address); /* Add the ra_list here for infra mode as there will be only 1 ra always */ @@ -1491,6 +1535,20 @@ int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) if (!priv->media_connected) return 0; + if (priv->adapter->host_mlme) { + priv->auth_flag = 0; + priv->auth_alg = 0xFFFF; + priv->host_mlme_reg = false; + priv->mgmt_frame_mask = 0; + if (mwifiex_send_cmd(priv, HostCmd_CMD_MGMT_FRAME_REG, + HostCmd_ACT_GEN_SET, 0, + &priv->mgmt_frame_mask, false)) { + mwifiex_dbg(priv->adapter, ERROR, + "could not unregister mgmt frame rx\n"); + return -1; + } + } + switch (priv->bss_mode) { case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_P2P_CLIENT: diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h index d263eae6078c..83449ad84d15 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.h +++ b/drivers/net/wireless/marvell/mwifiex/main.h @@ -384,6 +384,7 @@ struct ieee_types_aid { struct mwifiex_bssdescriptor { u8 mac_address[ETH_ALEN]; + struct cfg80211_bss *bss; struct cfg80211_ssid ssid; u32 privacy; s32 rssi; @@ -426,6 +427,8 @@ struct mwifiex_bssdescriptor { u16 wpa_offset; struct ieee_types_generic *bcn_rsn_ie; u16 rsn_offset; + struct ieee_types_generic *bcn_rsnx_ie; + u16 rsnx_offset; struct ieee_types_generic *bcn_wapi_ie; u16 wapi_offset; u8 *beacon_buf; @@ -527,6 +530,8 @@ struct mwifiex_private { u8 bss_priority; u8 bss_num; u8 bss_started; + u8 auth_flag; + u16 auth_alg; u8 frame_type; u8 curr_addr[ETH_ALEN]; u8 media_connected; @@ -649,6 +654,7 @@ struct mwifiex_private { u16 gen_idx; u8 ap_11n_enabled; u8 ap_11ac_enabled; + bool host_mlme_reg; u32 mgmt_frame_mask; struct mwifiex_roc_cfg roc_cfg; bool scan_aborting; @@ -998,6 +1004,7 @@ struct mwifiex_adapter { bool is_up; bool ext_scan; + bool host_mlme; u8 fw_api_ver; u8 key_api_major_ver, key_api_minor_ver; u8 max_p2p_conn, max_sta_conn; @@ -1063,6 +1070,9 @@ int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb); int mwifiex_uap_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb); +void mwifiex_host_mlme_disconnect(struct mwifiex_private *priv, + u16 reason_code, u8 *sa); + int mwifiex_process_mgmt_packet(struct mwifiex_private *priv, struct sk_buff *skb); diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c index 72904c275461..7ecff7ce06e4 100644 --- a/drivers/net/wireless/marvell/mwifiex/scan.c +++ b/drivers/net/wireless/marvell/mwifiex/scan.c @@ -1383,6 +1383,12 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter, bss_entry->rsn_offset = (u16) (current_ptr - bss_entry->beacon_buf); break; + case WLAN_EID_RSNX: + bss_entry->bcn_rsnx_ie = + (struct ieee_types_generic *)current_ptr; + bss_entry->rsnx_offset = + (u16)(current_ptr - bss_entry->beacon_buf); + break; case WLAN_EID_BSS_AC_ACCESS_DELAY: bss_entry->bcn_wapi_ie = (struct ieee_types_generic *) current_ptr; diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c index 6462a0ffe698..f5039d158f46 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.c +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c @@ -331,6 +331,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8786 = { .can_dump_fw = false, .can_auto_tdls = false, .can_ext_scan = false, + .host_mlme = false, }; static const struct mwifiex_sdio_device mwifiex_sdio_sd8787 = { @@ -346,6 +347,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8787 = { .can_dump_fw = false, .can_auto_tdls = false, .can_ext_scan = true, + .host_mlme = false, }; static const struct mwifiex_sdio_device mwifiex_sdio_sd8797 = { @@ -361,6 +363,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8797 = { .can_dump_fw = false, .can_auto_tdls = false, .can_ext_scan = true, + .host_mlme = false, }; static const struct mwifiex_sdio_device mwifiex_sdio_sd8897 = { @@ -376,6 +379,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8897 = { .can_dump_fw = true, .can_auto_tdls = false, .can_ext_scan = true, + .host_mlme = false, }; static const struct mwifiex_sdio_device mwifiex_sdio_sd8977 = { @@ -392,6 +396,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8977 = { .fw_dump_enh = true, .can_auto_tdls = false, .can_ext_scan = true, + .host_mlme = false, }; static const struct mwifiex_sdio_device mwifiex_sdio_sd8978 = { @@ -408,6 +413,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8978 = { .fw_dump_enh = true, .can_auto_tdls = false, .can_ext_scan = true, + .host_mlme = true, }; static const struct mwifiex_sdio_device mwifiex_sdio_sd8997 = { @@ -425,6 +431,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8997 = { .fw_dump_enh = true, .can_auto_tdls = false, .can_ext_scan = true, + .host_mlme = false, }; static const struct mwifiex_sdio_device mwifiex_sdio_sd8887 = { @@ -440,6 +447,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8887 = { .can_dump_fw = false, .can_auto_tdls = true, .can_ext_scan = true, + .host_mlme = false, }; static const struct mwifiex_sdio_device mwifiex_sdio_sd8987 = { @@ -456,6 +464,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8987 = { .fw_dump_enh = true, .can_auto_tdls = true, .can_ext_scan = true, + .host_mlme = false, }; static const struct mwifiex_sdio_device mwifiex_sdio_sd8801 = { @@ -471,6 +480,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8801 = { .can_dump_fw = false, .can_auto_tdls = false, .can_ext_scan = true, + .host_mlme = false, }; static struct memory_type_mapping generic_mem_type_map[] = { @@ -563,6 +573,7 @@ mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id) card->fw_dump_enh = data->fw_dump_enh; card->can_auto_tdls = data->can_auto_tdls; card->can_ext_scan = data->can_ext_scan; + card->host_mlme = data->host_mlme; INIT_WORK(&card->work, mwifiex_sdio_work); } @@ -2493,6 +2504,8 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter) adapter->num_mem_types = ARRAY_SIZE(mem_type_mapping_tbl); } + adapter->host_mlme = card->host_mlme; + return 0; } diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.h b/drivers/net/wireless/marvell/mwifiex/sdio.h index b86a9263a6a8..4f253d8cae42 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.h +++ b/drivers/net/wireless/marvell/mwifiex/sdio.h @@ -255,6 +255,7 @@ struct sdio_mmc_card { bool fw_dump_enh; bool can_auto_tdls; bool can_ext_scan; + bool host_mlme; struct mwifiex_sdio_mpa_tx mpa_tx; struct mwifiex_sdio_mpa_rx mpa_rx; @@ -278,6 +279,7 @@ struct mwifiex_sdio_device { bool fw_dump_enh; bool can_auto_tdls; bool can_ext_scan; + bool host_mlme; }; /* diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c b/drivers/net/wireless/marvell/mwifiex/sta_event.c index df9cdd10a494..69426ddd9c3a 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_event.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c @@ -135,6 +135,9 @@ void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code, priv->media_connected = false; + priv->auth_flag = 0; + priv->auth_alg = 0xFFFF; + priv->scan_block = false; priv->port_open = false; @@ -999,10 +1002,17 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) case EVENT_REMAIN_ON_CHAN_EXPIRED: mwifiex_dbg(adapter, EVENT, "event: Remain on channel expired\n"); - cfg80211_remain_on_channel_expired(&priv->wdev, - priv->roc_cfg.cookie, - &priv->roc_cfg.chan, - GFP_ATOMIC); + + if (adapter->host_mlme && + (priv->auth_flag & HOST_MLME_AUTH_PENDING)) { + priv->auth_flag = 0; + priv->auth_alg = 0xFFFF; + } else { + cfg80211_remain_on_channel_expired(&priv->wdev, + priv->roc_cfg.cookie, + &priv->roc_cfg.chan, + GFP_ATOMIC); + } memset(&priv->roc_cfg, 0x00, sizeof(struct mwifiex_roc_cfg)); diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c index a2ad2b53f016..046541713318 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c @@ -136,6 +136,7 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv, const struct cfg80211_bss_ies *ies; rcu_read_lock(); + bss_desc->bss = bss; ies = rcu_dereference(bss->ies); beacon_ie = kmemdup(ies->data, ies->len, GFP_ATOMIC); beacon_ie_len = ies->len; @@ -339,7 +340,7 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, ret = mwifiex_associate(priv, bss_desc); } - if (bss) + if (bss && !priv->adapter->host_mlme) cfg80211_put_bss(priv->adapter->wiphy, bss); } else { /* Adhoc mode */ diff --git a/drivers/net/wireless/marvell/mwifiex/sta_tx.c b/drivers/net/wireless/marvell/mwifiex/sta_tx.c index 70c2790b8e35..9d0ef04ebe02 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_tx.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_tx.c @@ -36,7 +36,7 @@ void mwifiex_process_sta_txpd(struct mwifiex_private *priv, struct txpd *local_tx_pd; struct mwifiex_txinfo *tx_info = MWIFIEX_SKB_TXCB(skb); unsigned int pad; - u16 pkt_type, pkt_offset; + u16 pkt_type, pkt_length, pkt_offset; int hroom = adapter->intf_hdr_len; pkt_type = mwifiex_is_skb_mgmt_frame(skb) ? PKT_TYPE_MGMT : 0; @@ -49,9 +49,10 @@ void mwifiex_process_sta_txpd(struct mwifiex_private *priv, memset(local_tx_pd, 0, sizeof(struct txpd)); local_tx_pd->bss_num = priv->bss_num; local_tx_pd->bss_type = priv->bss_type; - local_tx_pd->tx_pkt_length = cpu_to_le16((u16)(skb->len - - (sizeof(struct txpd) + - pad))); + pkt_length = (u16)(skb->len - (sizeof(struct txpd) + pad)); + if (pkt_type == PKT_TYPE_MGMT) + pkt_length -= MWIFIEX_MGMT_FRAME_HEADER_SIZE; + local_tx_pd->tx_pkt_length = cpu_to_le16(pkt_length); local_tx_pd->priority = (u8) skb->priority; local_tx_pd->pkt_delay_2ms = diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c index e78a201cd150..eb0b8016d43d 100644 --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c @@ -743,6 +743,29 @@ mwifiex_cmd_uap_sys_config(struct host_cmd_ds_command *cmd, u16 cmd_action, return 0; } +/* This function prepares AP start up command with or without host MLME + */ +static int mwifiex_cmd_uap_bss_start(struct mwifiex_private *priv, + struct host_cmd_ds_command *cmd) +{ + struct mwifiex_ie_types_host_mlme *tlv; + + cmd->command = cpu_to_le16(HostCmd_CMD_UAP_BSS_START); + cmd->size = S_DS_GEN; + + if (priv->adapter->host_mlme) { + tlv = (struct mwifiex_ie_types_host_mlme *)((u8 *)cmd + cmd->size); + tlv->header.type = cpu_to_le16(TLV_TYPE_HOST_MLME); + tlv->header.len = cpu_to_le16(sizeof(tlv->host_mlme)); + tlv->host_mlme = 1; + cmd->size += sizeof(struct mwifiex_ie_types_host_mlme); + } + + cmd->size = cpu_to_le16(cmd->size); + + return 0; +} + /* This function prepares AP specific deauth command with mac supplied in * function parameter. */ @@ -777,6 +800,9 @@ int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, u16 cmd_no, return -1; break; case HostCmd_CMD_UAP_BSS_START: + if (mwifiex_cmd_uap_bss_start(priv, cmd)) + return -1; + break; case HostCmd_CMD_UAP_BSS_STOP: case HOST_CMD_APCMD_SYS_RESET: case HOST_CMD_APCMD_STA_LIST: diff --git a/drivers/net/wireless/marvell/mwifiex/util.c b/drivers/net/wireless/marvell/mwifiex/util.c index 745b1d925b21..23675c1cecae 100644 --- a/drivers/net/wireless/marvell/mwifiex/util.c +++ b/drivers/net/wireless/marvell/mwifiex/util.c @@ -370,6 +370,46 @@ mwifiex_parse_mgmt_packet(struct mwifiex_private *priv, u8 *payload, u16 len, return 0; } + +/* This function sends deauth packet to the kernel. */ +void mwifiex_host_mlme_disconnect(struct mwifiex_private *priv, + u16 reason_code, u8 *sa) +{ + u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + u8 frame_buf[100]; + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)frame_buf; + + memset(frame_buf, 0, sizeof(frame_buf)); + mgmt->frame_control = (__force __le16)IEEE80211_STYPE_DEAUTH; + mgmt->duration = 0; + mgmt->seq_ctrl = 0; + mgmt->u.deauth.reason_code = (__force __le16)reason_code; + + if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) { + memcpy(mgmt->da, broadcast_addr, ETH_ALEN); + memcpy(mgmt->sa, + priv->curr_bss_params.bss_descriptor.mac_address, + ETH_ALEN); + memcpy(mgmt->bssid, priv->cfg_bssid, ETH_ALEN); + priv->auth_flag = 0; + priv->auth_alg = 0xFFFF; + } else { + memcpy(mgmt->da, priv->curr_addr, ETH_ALEN); + memcpy(mgmt->sa, sa, ETH_ALEN); + memcpy(mgmt->bssid, priv->curr_addr, ETH_ALEN); + } + + if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_UAP) { + wiphy_lock(priv->wdev.wiphy); + cfg80211_rx_mlme_mgmt(priv->netdev, frame_buf, 26); + wiphy_unlock(priv->wdev.wiphy); + } else { + cfg80211_rx_mgmt(&priv->wdev, + priv->bss_chandef.chan->center_freq, + 0, frame_buf, 26, 0); + } +} + /* * This function processes the received management packet and send it * to the kernel. @@ -417,6 +457,39 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv, pkt_len -= ETH_ALEN; rx_pd->rx_pkt_length = cpu_to_le16(pkt_len); + if (priv->host_mlme_reg && + (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_UAP) && + (ieee80211_is_auth(ieee_hdr->frame_control) || + ieee80211_is_deauth(ieee_hdr->frame_control) || + ieee80211_is_disassoc(ieee_hdr->frame_control))) { + if (ieee80211_is_auth(ieee_hdr->frame_control)) { + if (priv->auth_flag & HOST_MLME_AUTH_PENDING) { + if (priv->auth_alg != WLAN_AUTH_SAE) { + priv->auth_flag &= + ~HOST_MLME_AUTH_PENDING; + priv->auth_flag |= + HOST_MLME_AUTH_DONE; + } + } else { + return 0; + } + + mwifiex_dbg(priv->adapter, MSG, + "auth: receive authentication from %pM\n", + ieee_hdr->addr3); + } else { + if (!priv->wdev.connected) + return 0; + + if (ieee80211_is_deauth(ieee_hdr->frame_control)) { + priv->auth_flag = 0; + priv->auth_alg = 0xFFFF; + } + } + + cfg80211_rx_mlme_mgmt(priv->netdev, skb->data, pkt_len); + } + cfg80211_rx_mgmt(&priv->wdev, priv->roc_cfg.chan.center_freq, CAL_RSSI(rx_pd->snr, rx_pd->nf), skb->data, pkt_len, 0); From patchwork Tue Nov 28 08:31:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lin X-Patchwork-Id: 748490 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="EqHLnXwG" Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2085.outbound.protection.outlook.com [40.107.241.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3C7310A; Tue, 28 Nov 2023 00:31:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Td/9Q4oyZiirnjMjBdyipb9QVlwtNDEN6hJQalzTlMpAlup6lHaElLbJLQ8MecfANabdik0mDCsHusj2YVK6sJBi4z1OjPBU+/d39Fmmzq+m8bNh3MERGJ0SVYGQTwFfICTiP5NsJFPl2JfnKXBSi/gzmRfbFgbXsgnwBmH7tuPnjL4lmT9OZxhfyIW/guLF2sZMadu86O9aMVcBzDvsZxn7HKfUPgjDabJhMsaTT/xi14pCjroAlUahnji6m9i0ZQ8CSg1KYr9F8rUY/XFJ8qRixKY1F2MO/FaGcBNCUHkcNVq6aoseG8Ro6utZq47ACJGrHai7k2sGyc8Wmhe43g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OxItSBETnnmXjEaTJwHElt0Mk07zDwQCGCjI3sW3zLs=; b=nzRKpu0n8uh+gXAOWwkYqVZV2kIaiHPcHR4pmUNDVoKhgF4iTNKRLQuz82sbNC1kG74eHrDAnNsa2Q3/IUL2TZIBszmUp3KW0X9/LCZVwSEHSx97rRhRks0ltu1rt0is8/DB0DFz+PwnR+cnKGsStji1X5L9KjN/jPHAGkyVBQiNz/IdTtIYS8OL1FKsr2iN+eqLY3jNcbt04Mfm76F1XUl47v63KVgGWSwDXsUi2PEPfCgp0HmTko/0FXxbvePEhRbAd4ND/PNH0A60VnUKdZBCkHR1AHnx/hqc4j4rsLrPjgJnqTlAUEZ7Pvnjl7wIBTBjffU1g64O+BdPjwu5Cg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OxItSBETnnmXjEaTJwHElt0Mk07zDwQCGCjI3sW3zLs=; b=EqHLnXwGd8yQGIfDMW6yek7R4rqMQcEAT7rHMFBdec5EOgMhwahKkIGMg4ZvLnh2C8SFAwPMgztKIdAr6tUEgaYmVuyjPxEbJG6Q63oNS93PXLoPFqbcmWnYqNcolWbsC8E1uSvMKq7k28x1K7wgI1gUvwm4IEJ0OGVYLf8rJDY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) by AS5PR04MB10043.eurprd04.prod.outlook.com (2603:10a6:20b:67f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.18; Tue, 28 Nov 2023 08:31:49 +0000 Received: from PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b]) by PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b%7]) with mapi id 15.20.7046.015; Tue, 28 Nov 2023 08:31:49 +0000 From: David Lin To: linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, briannorris@chromium.org, kvalo@kernel.org, francesco@dolcini.it, tsung-hsien.hsieh@nxp.com, David Lin Subject: [PATCH v7 02/12] wifi: mwifiex: fixed group rekey issue for WPA3. Date: Tue, 28 Nov 2023 16:31:05 +0800 Message-Id: <20231128083115.613235-3-yu-hao.lin@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231128083115.613235-1-yu-hao.lin@nxp.com> References: <20231128083115.613235-1-yu-hao.lin@nxp.com> X-ClientProxiedBy: TYCP286CA0019.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::13) To PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9638:EE_|AS5PR04MB10043:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c3d87f1-b2d4-407a-9f55-08dbefec770d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3cDW1EbHZ9voPHvjUZWaGe5B5I7p0YFT8GNNxxxKIz6aPvj5oJPPyxXDCBP4wWC/1xbaCkXqMHOq9XNUDhOXlJ3G0rHBokcXRJMbL0szNY5TiNDeD/1NpmElf90umOYEDav41IhQuyXvTKwuvpLzhOa61YWz1Xc9Rl0RqSa/BcM8I/1U4gOdq5Q3qENasEpMv4YDQcpnwuiEZkteZTCrBJCIiVIviNg2vLqjGwa9UvHVGaU/NFVch+uneatU5BAES4qnv662OnQGjzkyk22Jzb2NhvHd+0AxrkH8H8oXggRUzjcZLymcEeBD+Qh3r0/dtJqG5Pq7Tp7eXs4ZHHerZmhoI9UeQZvsUoVddKZ07S9yTyEec4ydBemDtoqMDwWt4Urxq5CMuN1IemC/f+u2CzNmwznuJK6/4rh+z61l986Fz3qqKmBw9rEIPswjyIc5/qrlpP6n60IQcmbu9OZ5JniT8OB9oXGq6ln1pakUHcXqKNC/pf7VxCB4bSgLSN+WUAKCt1fZGfE+3lpR8SkO0QBsD7GMglboO1JJOD47b8FXD7XvS4L2MPTOpqafcuGi X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(346002)(376002)(396003)(136003)(39860400002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(86362001)(2906002)(5660300002)(6506007)(83380400001)(6512007)(52116002)(41300700001)(38100700002)(36756003)(6666004)(1076003)(2616005)(478600001)(66556008)(66946007)(6486002)(8936002)(6916009)(8676002)(316002)(4326008)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BkgnWb1fl5BZgtuuNU3KcLcIzZ+0X2Ly35a3lm961B9nq/SZ6KozAanSl8sv7pjRUvDz8+6BqPlOFH1Q6O5VlLSx2Y1PEpbUUEWRtkNF5r8Ajzu9q2dzN5rEs/MkkAmsZNFWQSQ3P4Z3tGRKP8DL/jyfOqFx2rSltD0rUqKtW2dRgh6bNGGRhCJ8t9jDgLcec7Ks+BygkZ8lcFjL8DHwLnlkxckyg3dEzLpcxLBNEytafE6tQFguSTurlN5C2sOaKfFhua3ylpW9lHA5HppHJHO00Nn1spKDZrweQkVSSwjwcu5/flX07alXaJ3ab2u5oWR3+r9FrcYXLhcwJfjMWDlf6Rz2RjaSOh0cZbVY2KC7feE/ee0Nkt9vYYcQSSXgaK10NgEb793v9jnDfVkavpUWbF8I3oDEQeh4W36nwZBwmpkSp4uYoDsHxH51kFJmW/gDATB6mlB2lHsRN7zSvAJ2vKQdaj1BtlFI9zE1Tof0n9EFRWmRoe+7M03fQUPmVnfngTlGaRJ4v6kATokAws+AXtZqV0LsTfyrqbMRCXEJoWIdEKdgcJARVErRQv/dspSZ0e0aq1lKJ3AHs9mT15kVBZqsesSY+GJiO3O/TJ4KIjzWzmkGyxZMbz74mUTI+za7BezMPdVnG/t5EEqdAyTGNMSNgkJ+vC/ND+de0KZd7hYKp8vWXVV8PXBxyP7M8/m6HuLeBAWtqsmSd8juPgliYd7lBUKZr1aD8HVE9UtZr3IWIFyRaDwd0JkFWa6IpwBlLSI9fF5iIHoceWu/8ECtHh1Tz28dAzzSKOAftNK/LgEvqWdSF1OwcFnR5n2jysZC9Y94uq+i2EIjPgzxZz04Oai/r0hBe+HLOCvjcn/55Rmv8C/kczZbkfb0JuPQxz+8rsrOi3plEZ7l1BvDKzH5X7jJIL0F/IRcEqg6KTbYvXBrySAYTWt2DNmVYhBDR+uQUYuXcOEffETKBYrSB6rPDR82fuMjSVelDX/j8dz86nPYBA8AsT69i+qliYYfV3sw43AuQmIfffPM4pDJW65/DgXrBqaVQuMIv9ciwZSdJth5nzYcIEtuPR9rPsCizjsFh0ZMNBkOv3zFusp2ppND472gD4tpFxUKMl/FyB6o1aiPthh22pwRX75SI3lNDTbPCbICSK+7/qXm9mhyfgFdyP7bOZ3x61RhTiYxCSD6ytutllk800gbUNNA99RcEMquprYH0Sp9IvmuIKUNFsIVM8/DKWQdzte7k1LXP1NiUE463c8XIF7pdmjoyantJ8/xbd97OkCPbxJ8SPuq/bdR4lbOpNLhOqeYfM+zYbgnOJxbfRnbqslZk2HopNWvYQs4AqvAtZk3OweGapblVk1ZJLwM1OivXDJJfGTfuBO5mqcD/qJmmwlTHpPL2J3pva+oT3wu/48ufvzxDN5YhesFgH0eRQsdyozKx03MtUk9xD6307aL+XSBMI1yHuw1se3nyNa7EdGsbkWHmrSxOPNeZTaufxfKNTSSX2w+vojGrpruGuydft4p9FLEXNDyAs1CAETV/2Cl1EpB+U1Hau65tZf6pHtiisz3yVkrxMxEGF9QdFoqpDtVlB55LIjl1X7VrPK/hMiuUPkTOaI5Z6pWKcJkwuiJBm2eXpQC0sN1sN9rzekQ7QJvSJ7USE3i X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c3d87f1-b2d4-407a-9f55-08dbefec770d X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 08:31:49.3102 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yitNFNEbo4K3yXvC20RCUHLcxa4B2vEvD14kYVMSGcutu6kg6MmsXg5XH7y75Cq77pYDT5tSRTwsBMToc+ld5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB10043 If host mlme is enabled, gropu rekey offload should be disabled. Signed-off-by: David Lin --- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 3 +++ drivers/net/wireless/marvell/mwifiex/main.c | 4 ++++ drivers/net/wireless/marvell/mwifiex/util.c | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index 40c39e4765f7..3d59e6a441b9 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -3657,6 +3657,9 @@ static int mwifiex_set_rekey_data(struct wiphy *wiphy, struct net_device *dev, if (!ISSUPP_FIRMWARE_SUPPLICANT(priv->adapter->fw_cap_info)) return -EOPNOTSUPP; + if (priv->adapter->host_mlme) + return 0; + return mwifiex_send_cmd(priv, HostCmd_CMD_GTK_REKEY_OFFLOAD_CFG, HostCmd_ACT_GEN_SET, 0, data, true); } diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index d99127dc466e..3bebb6c37604 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -802,6 +802,10 @@ mwifiex_bypass_tx_queue(struct mwifiex_private *priv, "bypass txqueue; eth type %#x, mgmt %d\n", ntohs(eth_hdr->h_proto), mwifiex_is_skb_mgmt_frame(skb)); + if (ntohs(eth_hdr->h_proto) == ETH_P_PAE) + mwifiex_dbg(priv->adapter, MSG, + "key: send EAPOL to %pM\n", + eth_hdr->h_dest); return true; } diff --git a/drivers/net/wireless/marvell/mwifiex/util.c b/drivers/net/wireless/marvell/mwifiex/util.c index 23675c1cecae..ff1b2f162c30 100644 --- a/drivers/net/wireless/marvell/mwifiex/util.c +++ b/drivers/net/wireless/marvell/mwifiex/util.c @@ -482,8 +482,15 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv, return 0; if (ieee80211_is_deauth(ieee_hdr->frame_control)) { + mwifiex_dbg(priv->adapter, MSG, + "auth: receive deauth from %pM\n", + ieee_hdr->addr3); priv->auth_flag = 0; priv->auth_alg = 0xFFFF; + } else { + mwifiex_dbg(priv->adapter, MSG, + "assoc: receive disasso from %pM\n", + ieee_hdr->addr3); } } From patchwork Tue Nov 28 08:31:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lin X-Patchwork-Id: 748489 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="ql1Xdd8p" Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2042.outbound.protection.outlook.com [40.107.241.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92FF81A1; Tue, 28 Nov 2023 00:31:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BRnH2jTvPIAFwoZ4Dcg0VXOnIBPfw0VV6s/xdcFpSMezR6+jZo9H2wlMDOO0R0C0UZwSWkZNYz581p0jsTy/C7UwVcnMk6br9gEppfDi7vM4HBDxDfYesKCAK1f67ApXpBpjs5UGxqSDg3vyT6ibx+DGvnh0Fb5WStEuZuWocvOG/PsJT/zanGioHcT1fcF5eOpt0R/X8WQEebQlL90yN6Or0lzhvq0a0M0gAIiyKAnpVKq4LOZuJyaI4X9X81dvTQbBmMdJH2SgOyunz8wBFQz8M/uzxOsGX89n3UsYsg9nAAoTOXIFo1ySzbHTuiosiT5fZa+PHoc1RYJbbZ7UIw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=s3Jm6rutR3ZzR9OuEz8K2efKZSKn5aVuiA9IuYUcO6k=; b=cmZw9TCvRGAxbber8rT07XAnuSqVre+pczvOoyJ8UVA3w5bhBcaOHoh3BawqAgNHCOKppVXv5fQr3V2FHDz08ymZEXMFzblxfD4UNjzwOG35uepigGISFggB0T7qels7ZkQK2pm2KJmXZJWeIB1zblCtzAG1Qlg87qcsTeglVbk+wesPceArztDygd4OxBaJMvU3gUifDjVnIDb2PI/2zYxdJzV/eOPIlfP7yLZqk0f2Vr17m4iX2rE52fp73ZUiL7Dz77iavdo7yjDCQKyigBpOaObyinp085tUmSLtZKH4ZRpnCU8mRWNV8u2FMRcbZ6Gb4hmjvBjTj8aXuB4ZCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s3Jm6rutR3ZzR9OuEz8K2efKZSKn5aVuiA9IuYUcO6k=; b=ql1Xdd8pEmDWz4JriU8zsWQn4qhXvsWw6qjZpvI4aaTxVM1aShZu2qdTr4nXT0Sb+GqBZjmjeftu9B+2DCxzUru3vgzGXkH24eTrGTRYwqBtHYzvPUNrhG5u9CElXxXuPMeQYLKDspM+rY1mNLJyXYyZLe88j8FP7Opix/vkMSg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) by AS5PR04MB10043.eurprd04.prod.outlook.com (2603:10a6:20b:67f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.18; Tue, 28 Nov 2023 08:31:52 +0000 Received: from PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b]) by PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b%7]) with mapi id 15.20.7046.015; Tue, 28 Nov 2023 08:31:52 +0000 From: David Lin To: linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, briannorris@chromium.org, kvalo@kernel.org, francesco@dolcini.it, tsung-hsien.hsieh@nxp.com, David Lin Subject: [PATCH v7 03/12] wifi: mwifiex: fixed reassocation issue for WPA3. Date: Tue, 28 Nov 2023 16:31:06 +0800 Message-Id: <20231128083115.613235-4-yu-hao.lin@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231128083115.613235-1-yu-hao.lin@nxp.com> References: <20231128083115.613235-1-yu-hao.lin@nxp.com> X-ClientProxiedBy: TYCP286CA0019.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::13) To PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9638:EE_|AS5PR04MB10043:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ba1180d-843c-4630-742c-08dbefec78ba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N0pS7Lib/nEIQ1KFfjwuS84nwvhJL4G6ST6PDx0j7ld2xemdQ6WnQuzssPdYkZqNqUjtR62lAoc2OObQMQ3Oit0e3/n7mMxuc1tc6rkeNn9KyLkVaR39dUq+OLQ/wCBncmNXn8rc6aytmJ9JPTX6DVJvEQUrSZrksEd3FwdvN0dmqvPsJDiJ8FbLfjCW2B2vMe3t5gAif+cPYt/FI7/PAsmckVUt1XWv1ueAZ4PAOFPfFDleV5kcTdaYaBuY6COGNOWEdp2ysIb9pwWwtGvSSEHUDHTCGAJF8Twbx1DuIo7JwtaQ9KOmk3JuJvCcHQsqQFwkHLjnxryQZqeNkB9J21AWIjbHLbYuOsYHdY5C8NUHcr4vCtJw34crER14X+jusy0p25P2oaKA6mB3e2iBSlkMT25dU4wEezqZqZfEFYM/+VgfdxJ9Xy4rbzFHZHXZZb1fElHdkzK/F/st5Kj1Sx6o/0Dqrp/TOhr2a5KanJ35MHxNU/AaDwIFJza4seuOWV10J42FemyVSPUxMj7y5OlrjGK525sdPwQwgr4G9YwzVM+O7zykPxzukhlkv6it X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(346002)(376002)(396003)(136003)(39860400002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(86362001)(2906002)(5660300002)(6506007)(83380400001)(6512007)(52116002)(41300700001)(38100700002)(36756003)(6666004)(1076003)(2616005)(478600001)(66556008)(66946007)(6486002)(8936002)(6916009)(8676002)(316002)(4326008)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xfcE0iR3Xp9UaFN9HZnB7SJ0at+pGgRWcLjCHpaxbDoLr03GeSiA7l0F0g5pi44+lIzwPvUME6UuivfSdf2u0FvtIIY12ssFdiBRLvVbNUpGOEFYVVPZcgiB/ax+BJh8gfnZQFn2iParN1xlZRjDeXm2R3leNb1ebhFIFh84C28fM2B2gaCGUWrKjlE2gSfZtDzCee2Sjq8+zB847J9aSqd5sNkZeAuqF1CaHrsOKNxDL3nLjxKzMJTQRCNjQ2aoUL5liYuCaYA9VfOeOQbyd2cZmNPTffrVQqlrHZ+eYIR2865o08BhXPEY8BSdaTQ+e3nY0l5dXG4ddcxBFoYSrL9UIOYdM6inm4zbMZBO9ACPezpOTCNK7O8U43T8gSMI2fy01HbRwN+Kb5F7FGLyTPneAyEBp0KNv6BwA6/VMj4e4q0Y8MEueYWdM7tCv4WFMIlo3/wMXXIGHk/aQaCByki4PzYt2i3fHJq67ZweQQxv6VQ8CHBmjXAQVJwOB9FQ/JoF7yqm/Lj917xEr23TnJAZtcEqgceh9+jBd06LNSc9IIaz99ezowwQUpoHnXpyfUmC55qPpfnuptmqVKJhLvvn+71DZDZPRjryWoDf9pFWq996qUYXlXx7jLQ3lgUvUvvEfFklklLJmtt4kB+vZrRW0YgHsBpVMBq0YeDW+uYLiZ1/w/+Wu6rGlwffVvbQ8DoCCshSJ1RgjXro3K5HvJQ/uYqjcTRv4hxrkp3JdoAWWPkm3ucB3d0wWWSWOffaTSdIeOtYuD4ZHmbMC1f70ihex4PqfoYfGmK41Yw3ioJyZ7LM15j72O1OKYw3qbCXGIaggJ7HYjC6U+5eKObOeV2AVrnHtEVWcEVknQRQMhjFqHx3060WDaC6HAKYTpahkX/m2o2VwlDPrz2VL2vQDYywkbOS2kpKXJatvGVW+LI+J9Wqf1/Bic7UdnjUk8sfOxoQjylACPcG9FCPnQvq3EIOOfmeqJWm4R+iG38O2JNYRU+FvnXGCVaO4Jl4k0zBxfmPItIiHWByce6XpTlCYfBklV2xk4Ta3Wc0cVRGBv/an4rK1u/rIjiuVcJgaceqp/x+Sd6wmTruSevLeqNKNLVkcGHPV+Ohgt1fMdQlPjcUzTFAkz7rH5ryaUge4QPkGV/sazUZngeLxhK/qu7yqus/4RgjC/uunFk7Jf7O95rdG7qlaaxh2sir+JeGQYbRW3Acdntqx+A1FMXPHOMPcqUfvH2B9y/S0HSpB99+kJGK+/AwyUhyYqNoUlhn7Y8lyKB6Nz56XaovgYjyEGIpSU2UUgbrkwBfS263oRQNCGBuhkO/zmq/6s7rRotlX7k1whUuFiu4uE1+YqtqwTVNxEcRxN6k2DkwG4Uchn4jBOQD7botBaGtZW7eETxQuf49ryWAwcSI2dkT3fjLUlE6j8R1oUrKYnOcIla3CLLDe3xZadF/q6COhuCbGeLV/emAoEmATaaOLSjwEPYRdva8tzXnNRTp/MlAWvc84JEi4lOLK62OfodV3zcIphxIj+pf0trs2TN66tnZkMel8OhCH/xxDrRJfgAfCPyU0Rvy8wCaezpqvSIU/4R39QWPDdTk1zEXIBq0zPGa4bWz4dBF4fv9DHx+eEIVMDamwMgKafeD4d4GvUZKQJE74vlyTUL8 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ba1180d-843c-4630-742c-08dbefec78ba X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 08:31:52.2818 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lIlZBWVggZWRFKgABsRZtX59qJGjDtn3P3LsAfU0qXGDV9KBRMLhVGbP5DkdjSm+CmKT0SfWaEbR/VFNGQBrog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB10043 This issue is related to resatart/reconfigure AP. When AP is restarted or reconfigured, wpa_supplilcant will use cached PMKSA to do association to AP. Because association failure does not report to cfg80211/wpa_supplicant, wpa_supplicant will always use cached PMKSA to do assocaiton. Connection can't be established under this way. Signed-off-by: David Lin --- .../net/wireless/marvell/mwifiex/cfg80211.c | 25 ++++++++----------- drivers/net/wireless/marvell/mwifiex/cmdevt.c | 18 +++++++++++++ drivers/net/wireless/marvell/mwifiex/init.c | 1 + drivers/net/wireless/marvell/mwifiex/main.c | 6 +++++ drivers/net/wireless/marvell/mwifiex/main.h | 3 +++ 5 files changed, 39 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index 3d59e6a441b9..a21310f3807c 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -4395,9 +4395,6 @@ mwifiex_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev, int ret; struct cfg80211_ssid req_ssid; const u8 *ssid_ie; - struct cfg80211_rx_assoc_resp assoc_resp = { - .uapsd_queues = -1, - }; if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_STA) { mwifiex_dbg(adapter, ERROR, @@ -4433,13 +4430,13 @@ mwifiex_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev, req_ssid.ssid_len = ssid_ie[1]; if (req_ssid.ssid_len > IEEE80211_MAX_SSID_LEN) { - mwifiex_dbg(priv->adapter, ERROR, "invalid SSID - aborting\n"); + mwifiex_dbg(adapter, ERROR, "invalid SSID - aborting\n"); goto ssid_err; } memcpy(req_ssid.ssid, ssid_ie + 2, req_ssid.ssid_len); if (!req_ssid.ssid_len || req_ssid.ssid[0] < 0x20) { - mwifiex_dbg(priv->adapter, ERROR, "invalid SSID - aborting\n"); + mwifiex_dbg(adapter, ERROR, "invalid SSID - aborting\n"); goto ssid_err; } rcu_read_unlock(); @@ -4466,25 +4463,25 @@ mwifiex_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev, memcpy(priv->cfg_bssid, req->bss->bssid, ETH_ALEN); - mwifiex_dbg(priv->adapter, MSG, + mwifiex_dbg(adapter, MSG, "assoc: send association to %pM\n", req->bss->bssid); - cfg80211_ref_bss(priv->adapter->wiphy, req->bss); + cfg80211_ref_bss(adapter->wiphy, req->bss); ret = mwifiex_bss_start(priv, req->bss, &req_ssid); - if (!ret) { - assoc_resp.links[0].bss = priv->attempted_bss_desc->bss; - assoc_resp.buf = priv->assoc_rsp_buf; - assoc_resp.len = priv->assoc_rsp_size; - cfg80211_rx_assoc_resp(priv->netdev, - &assoc_resp); - } else { + if (ret) { priv->auth_flag = 0; priv->auth_alg = 0xFFFF; eth_zero_addr(priv->cfg_bssid); } + if (priv->assoc_rsp_size) { + priv->req_bss = req->bss; + adapter->assoc_resp_received = true; + queue_work(adapter->workqueue, &adapter->main_work); + } + cfg80211_put_bss(priv->adapter->wiphy, req->bss); return 0; diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c index 311af5f40c3e..16777af50097 100644 --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c @@ -924,6 +924,24 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter) return ret; } +void mwifiex_process_assoc_resp(struct mwifiex_adapter *adapter) +{ + struct cfg80211_rx_assoc_resp assoc_resp = { + .uapsd_queues = -1, + }; + struct mwifiex_private *priv = + mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA); + + if (priv->assoc_rsp_size) { + assoc_resp.links[0].bss = priv->req_bss; + assoc_resp.buf = priv->assoc_rsp_buf; + assoc_resp.len = priv->assoc_rsp_size; + cfg80211_rx_assoc_resp(priv->netdev, + &assoc_resp); + priv->assoc_rsp_size = 0; + } +} + /* * This function handles the timeout of command sending. * diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c index f86a527fd7ca..4326e03a66d3 100644 --- a/drivers/net/wireless/marvell/mwifiex/init.c +++ b/drivers/net/wireless/marvell/mwifiex/init.c @@ -223,6 +223,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter) adapter->cmd_resp_received = false; adapter->event_received = false; adapter->data_received = false; + adapter->assoc_resp_received = false; clear_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags); diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index 3bebb6c37604..1dac77946813 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -365,6 +365,12 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter) } } + /* Chekc for Assoc Resp */ + if (adapter->assoc_resp_received) { + adapter->assoc_resp_received = false; + mwifiex_process_assoc_resp(adapter); + } + /* Check if we need to confirm Sleep Request received previously */ if (adapter->ps_state == PS_STATE_PRE_SLEEP) diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h index 83449ad84d15..ae4b44ad6c50 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.h +++ b/drivers/net/wireless/marvell/mwifiex/main.h @@ -615,6 +615,7 @@ struct mwifiex_private { #define MWIFIEX_ASSOC_RSP_BUF_SIZE 500 u8 assoc_rsp_buf[MWIFIEX_ASSOC_RSP_BUF_SIZE]; u32 assoc_rsp_size; + struct cfg80211_bss *req_bss; #define MWIFIEX_GENIE_BUF_SIZE 256 u8 gen_ie_buf[MWIFIEX_GENIE_BUF_SIZE]; @@ -915,6 +916,7 @@ struct mwifiex_adapter { u8 cmd_resp_received; u8 event_received; u8 data_received; + u8 assoc_resp_received; u16 seq_num; struct cmd_ctrl_node *cmd_pool; struct cmd_ctrl_node *curr_cmd; @@ -1104,6 +1106,7 @@ void mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter, int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter); int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter); +void mwifiex_process_assoc_resp(struct mwifiex_adapter *adapter); int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter, struct sk_buff *skb); int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb, From patchwork Tue Nov 28 08:31:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lin X-Patchwork-Id: 748043 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="MAWcpgoE" Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2042.outbound.protection.outlook.com [40.107.241.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC904D5B; Tue, 28 Nov 2023 00:31:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k1/TdqBa/cpyiUk/D0SMC5AJHAklr/Oa86Z0Cl84YNVuBFY3X+sjukSg651osjfUZMunGVqZ3NXgTBJgxXnojIj/zNeOPcP+CTj0/1E5pTaDJhhM8RxEP9ioXHPrq2raf49HZSAoJNJg0NGp2kHX5yxKYLCh7LgBJPa6uIaRfHAP+3HT/aY8suVwrCu+JxoUgbAQWivCi+CgbL/5VS0aeDYGBvkjx2l3xWo1Ez9TngG55V+b3TMsEmEZ2lK9AuV7Uo0VzoQIL0rBT7OboOtobwVwjwVpe9bA9H5bo7rknmrSc81Q9d0TaqaGBlAJdXX0bFxAAgFWFtLLrAd7Reafwg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RHQlhPnoPjoc1KM06W5fx9fuzzwAv4JpdmH3WpAtwaw=; b=iFKrtYdr4bodFf9QYVXHrkpLjlAr0veXh2k6Tga88HRY1nVZ7tJ39QcaN4cLbzrw32jDOqDMQyVrtzrRp19q292/ARfB3xhYq/Dcq8DUAK+iXwO53HPafJoO83FqscHHZ91aSMEfShBM1CZLlB6DN9gP/XxMIBhy+f/zWQ+96BM54wvEbnRbf8/CycKeEn1qbyiIOCJYKPj7sPOkFsKoo8t/q3G95+k0Kwqjk3HUPqfkSzPo6cY9m5nMk3NyB+4jXipMRMzWIvDGlo4QqXgtusItwUEB8VbPlc/oX01lzp6oDVQNToBskGCW7/OZ3KnatUB9N05OvfDeIMahyzNAtA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RHQlhPnoPjoc1KM06W5fx9fuzzwAv4JpdmH3WpAtwaw=; b=MAWcpgoELrvnB3o27O3wwZ+4sPEczzXLer3bvxpyXy744FKmATOoXBT2wznwC2NSr5gnpWA28sUfwvJPTTgc9Jrn131GIIwMdiMdt3u0XX9TPhVX18f5N+TbLlbwhwRYKZcNNhN1v1nzOdA3vxkd+yHqvQIFW+QidpMcIni2jh8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) by AS5PR04MB10043.eurprd04.prod.outlook.com (2603:10a6:20b:67f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.18; Tue, 28 Nov 2023 08:31:55 +0000 Received: from PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b]) by PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b%7]) with mapi id 15.20.7046.015; Tue, 28 Nov 2023 08:31:55 +0000 From: David Lin To: linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, briannorris@chromium.org, kvalo@kernel.org, francesco@dolcini.it, tsung-hsien.hsieh@nxp.com, David Lin Subject: [PATCH v7 04/12] wifi: mwifiex: fixed missing WMM IE for assoc req. Date: Tue, 28 Nov 2023 16:31:07 +0800 Message-Id: <20231128083115.613235-5-yu-hao.lin@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231128083115.613235-1-yu-hao.lin@nxp.com> References: <20231128083115.613235-1-yu-hao.lin@nxp.com> X-ClientProxiedBy: TYCP286CA0019.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::13) To PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9638:EE_|AS5PR04MB10043:EE_ X-MS-Office365-Filtering-Correlation-Id: 63cf6c96-b111-45b8-5ddf-08dbefec7a9f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1VSh2ByHfqB8eGkQ6tI4S4FHhV35MwLyy8qDfk71CiojXf+zQJ5khTheHq/+r8qdgyEjCzA8cwF+HsU/hdw5JaIGoQLucbICVtYk+XKdW4JmU9G8pcHy1sZrOr6LHwtpOL8iIlSZH5Yce4/xgAEjzbW8u+EpwuRd2t2ZLi2xvvIvZ8G23/hpN7HhYWihFHJoxhv6fMeow+2+J6VAZtMY5H2O7ejSGjPWMqgS3TnpytNtmuaLSuptpR7d0/kH4CHU9ALDy6MaaUC0JmmQrGZrS1BID1ExwzKcGRdKO3Vg98zUfg57V2J7m9o2bBUI8GaPSM4mkVYwcXsMPfoKaG6tCMyxhuBQ4Q8lBCnS2NNCWFUePXPJcVol7k9LILcq2dhF6ianFJXIHAFlzUbKBubWV5BuQtY6Et34QZ8ck4OOPR7bFxKDITobPTrCNCyT4X83cxfUzX5I+//zoUoZ4WXe/ncYzvyTk2ennyS5z5MWnp8rL4+PKy5KpzS/PQF23vFJEyagahfqlHpkX47sZQ/QXygwMWKAak6PZEXDZ60oL1fXYiwqTk4mRwCFGxBWoHx8 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(346002)(376002)(396003)(136003)(39860400002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(86362001)(2906002)(5660300002)(6506007)(83380400001)(6512007)(52116002)(41300700001)(38100700002)(36756003)(6666004)(1076003)(2616005)(478600001)(66556008)(66946007)(6486002)(8936002)(6916009)(8676002)(316002)(4326008)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: g7L6GvU9brkLXxCw+TNGuxhXY+SiHtCFJ0ak6nGFNbgCnxANohm4IwOEX7GXpa1ISFk40QDLZsWmyhiBvkx1G711ScaoWE4DZu8sw0U5hkjvL+IqhwRajJ/3Q5/Y0x0G13OtlwfRNUVmV+iaRrk9Rfe11FT7C2BkNUxXN8usE2dfpw/aAhVPKQ7yQOcmQY2+r8dxKW1WyDXq5im0j/8U/T2+f6yQKbPt/LCc7/pS+NuKlvNAbUnhlY94+NlyPIJBx9gNKWnfzM5xZ7vRJQu4fyH8d2cYpByzS5J7dv066HLmkmYUxOj2scV5yF2TNtecQX6m7HfUe0Dvg1CdoPTTONobPh0VVnbN71bbGe/J3nIorng86tFp/dtQln9U0IcHh1vfbb0WSEP7BujIp9BWjsmukLNiDvcGE1YG/ShbsHM8WKOjnlfNHwc3qoRsJBeLe6y01p/Pdr+8FqQfwQXxUd6URi/9e1ODJYPoBXlfB7reBHfBiwG6hf8IMxgeEpnY/msxLAlv2TnTRAwst/ioAAYdRd1pD/4qScE37/GyP0/BIlAJr/lvdifJ3aXBwfYwEpd3MSDiZ1EZa3R4vo6EQcDfvRJ4ka77KIEzkeatt15SGygG1ptxwtUuMO2rRieB6qrZvI4nqrxOrVcuRYnXhmU6ABoJmeaiMke8oP1MpNA/ajZ+Wr1sCCIas01Vof4tqCNXd0PbLtbE2OpWIwZFRWWrZXGL3RNQ88bDvDrHvn3ZQ1GHsJ2o1d48Tn2Jf433ddrsL6WaBtBOCQSFMVA47BuRMI6mmJkBFCYqFdA/96ZVVa88O4WREOF7yhekXMiLyWji6GXF2wg65alrPkm3KEUaX3wXU2EDBbC3/lk4SVw69O8nVUjuWMx+q7p8N1Q73c/+iUe+GRkwEMdGB8k51bJJEKlJJ3LCasgX8K7IdJLqSur3RDt7SBfvGaYAu2RarkEVrcgfRu/COIB/rgSBo4tozz+hxHRQxJUxirhUsMxdLRPveExECfXhOPHldc2ZMkhZL6A5dfiOqleyRR9svyptmSiXRIex/T7KuvCiyCEgQi3fbX4UKB4AwBz2ovBy+MoKQ5y4DRCsBwCncQ7gK4pEUgi/KCXbicLsVHEB8rVf/Sy6trC91Zglp32SFMbC9ubhIPZGrdYeX33OvKVSJjxNk8V40USN53bkAY3AuL72juw02dMogkwreZHB2yLL6Rz/iJTRr3z1BL0IZVEW6ACSeV6KD8iEBdzo6uxqWQNPG6Sza3Etd2sYRktNfst9DzyNSPBo0Cgz3DSa88QWXYGhWea8TCwslQc+SPdMFKXeScO3DtLrU13rm7IiCU7KOhK2BqhWtrLV9/WPtwrOb8SN6ysl7J6WdeibNtqk8gNMeEGXOzf6eJf+VgCcm+hneL7VHKALUD+upXkRgauB9kKYVgfg6N9OFyi0c5O3xUa2CVKNAfz6hPSluPcvuyn8EwjKnqCEd0Vs0eUlSMeDuMieDGtmkhNaLiQad7m1iUvUmga2K7mRGlGq1bZomqUGpS/exrqhS8zROq2fuevI29WwqMTuYQpEvQ7/kXmvcAMVDObKDp5PiYn/YKoonh4t2lpY2LbbGXlCKZ0Yu9cpfqEZlyORY+P+xBidvchePxCyjEvoeh5lDcEGtdKGON5X X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63cf6c96-b111-45b8-5ddf-08dbefec7a9f X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 08:31:55.5091 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pWQSDAc4PJ4XsgrLhT/y4rlhRAKNLjafQMnzFUJr+hb3HuwbOxwR7Ap191yQkk6/yMCyc1vv7M96awB/Taw8TA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB10043 Remain on channel must be removed after authentication is done. Otherwise WMM setting for assoiation request will be removed. Signed-off-by: David Lin --- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index a21310f3807c..b99de9f4ca14 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -4306,6 +4306,8 @@ mwifiex_cfg80211_authenticate(struct wiphy *wiphy, if (!ret) { priv->roc_cfg.cookie = get_random_u32() | 1; priv->roc_cfg.chan = *req->bss->channel; + } else { + return -EFAULT; } } @@ -4418,6 +4420,16 @@ mwifiex_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev, if (priv->auth_flag && !(priv->auth_flag & HOST_MLME_AUTH_DONE)) return -EBUSY; + if (priv->roc_cfg.cookie) { + ret = mwifiex_remain_on_chan_cfg(priv, HostCmd_ACT_GEN_REMOVE, + &priv->roc_cfg.chan, 0); + if (!ret) + memset(&priv->roc_cfg, 0, + sizeof(struct mwifiex_roc_cfg)); + else + return -EFAULT; + } + if (!mwifiex_stop_bg_scan(priv)) cfg80211_sched_scan_stopped_locked(priv->wdev.wiphy, 0); From patchwork Tue Nov 28 08:31:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lin X-Patchwork-Id: 748488 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Y4wCHZEJ" Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2069.outbound.protection.outlook.com [40.107.241.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4AD1D59; Tue, 28 Nov 2023 00:32:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YaQit2xAnnwRZrTy/qgoX6fbbSbbuKkVs7itKE/aAIoD2y07454fnXWpg/74ENRea8QnE063Om8CoZzmZAXbV8+phsoUK2OQPnk33+fyDSwzgzNXT4yvae8Gto8EiRifCOxh/TzOyVPNVXtRWMjdcpc2Ts/uckALEa/yx/dzqrt6NaajNwA1fLt/UzNulABot1INXuGi+ioDcoFulUtigazHsZ18D45PfjavGh1gcBROFso50RSmf9bcHOiIm/35ct+lOICOWLsmjZ8+t+7csvEdzIERxgC9gQd/FdRuEgnR4/ABvr8X+EhvqJ1XYsSHgBaTkQbhQSg516//JRxPQA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=C035kGY4S1lfiGSdH8eBw2TM7dNuBhd6S1Q6Otb7i7o=; b=DXYXUmepP/P05cK4h7QjnjLalXIReHw2Za2VpRGm9+YOPU6YIX2AJ/U5ZXBz1RBNJCICte6/ADVdgpIwTVrz72XGVgWBT9y8dZAT35B16WSxhTDGIEWW2E9iy9P4DwU1aiQMy3PKINeMnssy+wixgxbvdiwvh/lo9nT/nJX51TJzfxYqKk7k8VlTsewjUqDZSfUdMSRNAOM4nQ9cCws9F7Sb9K4EACd8OelvhHT1DRjYcXYuwFaOjMPIqiYq+i9dyThmDStxAcuX9+PetDfZrZDtT+4GAavLV2auT9sEN6EwwfzGCuBMGrclnuhxbv1gWDfyq69C8dkYPBcdeHC/ow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C035kGY4S1lfiGSdH8eBw2TM7dNuBhd6S1Q6Otb7i7o=; b=Y4wCHZEJUCfstxJKz4xWt9RqcXKl0YLqcfrMo3kGnOv+mcZJLN00uSoVIgEhsDa4ByBtPC2Z/O429kd90i7rGYHD7fh1I3UODEPICauNR31c1pwWm3F7WY070AyFiuKD7+ACEZrMOxxwuwR51c6Nu1JmnTH9DFRhLLKeWDk8WWk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) by AS5PR04MB10043.eurprd04.prod.outlook.com (2603:10a6:20b:67f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.18; Tue, 28 Nov 2023 08:31:58 +0000 Received: from PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b]) by PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b%7]) with mapi id 15.20.7046.015; Tue, 28 Nov 2023 08:31:58 +0000 From: David Lin To: linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, briannorris@chromium.org, kvalo@kernel.org, francesco@dolcini.it, tsung-hsien.hsieh@nxp.com, David Lin Subject: [PATCH v7 05/12] wifi: mwifiex: supported host mlme for AP mode. Date: Tue, 28 Nov 2023 16:31:08 +0800 Message-Id: <20231128083115.613235-6-yu-hao.lin@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231128083115.613235-1-yu-hao.lin@nxp.com> References: <20231128083115.613235-1-yu-hao.lin@nxp.com> X-ClientProxiedBy: TYCP286CA0019.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::13) To PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9638:EE_|AS5PR04MB10043:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a19d38d-326f-4dad-02d5-08dbefec7c6e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RebSAkcvh4ErOZyn6/93nAW2gy7VojKyWXndZplPg3TFrsss7NfULPFF+Aj1gZH7jrMFhLrn/2H7hR5SVkm7FOJSTz3GBikX/XR13Gd0/anDqblFKRG6Eu91Z7wDNayMM89uuELY4oAN1qH/1Q6+8e21MlociC1baO5qA0kUFXf5jDjU7K34JBVOUqv0PQGc6fICOodKNkHZfxUBWJDzvQQusbqqvtRRGdZRRENP/c/mcwIcT7NLUxbEa5pa0D9TMDrQYEBmzJ8UrxIcBNgMQAqvMm06Sj1L/qhNwgh6eJyXT2qjN6y7ypg6qzyhscFww6d5jY3uocoP7leFkhLdcFcrBDy4hiwztUQtJdwzPAu7fpENA4RQH9chgHa+2sG6xZjzxASAecrRTYCiAWYMa8/ezj13RyXn6FAGfxW4ZeNCdbAgyDXXpowj1IfO9KjAeVqr68IkfoVsdaeFmJETYXSXgxwK8YYkwFBdHuoT1b5Zt7pDB/YX04B720cYaVqVi/M0QJZ2v943cWE7SCFp3jE72qCTLJLK3vXrpcPIRw5JHkQzTdOpbRjNdYO5t4TpMjGj0D+nlty+GPPtdEGUTppi9z2cojsSDBDOG3lC/5h4iMrn0cpT9kJRtIo6VNwy X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(346002)(376002)(396003)(136003)(39860400002)(230922051799003)(230273577357003)(230173577357003)(1800799012)(186009)(64100799003)(451199024)(86362001)(30864003)(2906002)(5660300002)(6506007)(83380400001)(6512007)(52116002)(41300700001)(38100700002)(36756003)(6666004)(1076003)(2616005)(66899024)(478600001)(66556008)(66946007)(6486002)(8936002)(6916009)(8676002)(316002)(4326008)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cf+fpMlBKbebqdpLJFm3m610eOQ4QuWYu0onNXFYSNUSl7nNcYdeAFBUzwJ6YSYsZ/sLFXv8VPkB0sGsgDMz81zUyqkUxV6W7jOQC4UM56KpAer87A3Ynhdu9//BbWhs4x0U+6CshJGO+1+h2jfNb5rZZ/oqr5uqSW4FqZbZE64z1iHvjxEyUGjJ8jmqEYh32mFTO3GSHEoeJ+ql7HAN8E+uLhu1b52yhO1CeYTQgBmQdolFmTFS1t2CNl7SchdWGuETlN7HxOmuX6SN8ODedFIB0H7zeGT4ih1poEmBvPuR3aKUB1YkqXwdLv4TO/41wIXyUwbuHIwE6I/0i6w+kLM+opU/vReGLzvoAXT1pndFew2UZ7UixNjF2v01amQuowJDdbKOZeoxkBxm3BVR4ZSpkHo17PCbKhLutskoKGvKSXd8sscZuE9mhaOpHc8uIjb1zCiehYwSv6GX9x1dwR9SJGnfC2uMVfKk8AgJkMUDKcETKzNTEop6vJ59zJ6qz1qhEej1kVxYjhClCioA0LXA2qU48XfxZB0E7CaX7Ykjwee9oY+A1tpkAifLdgbtZzAbj4FwC2/Jm3/Hj9fVVUr+7owCqUFzTSmCZicDMG0h3ZleZ5mS16Ay7LU94zlGEtN9yf5UULr8EdDpVlGfbHThBUJkLG7e/BC+rp98SzZVpMSxPfT06TCG6/8sdt72TiggYWUpuVwYflbEZLyGiY3b+V/qST7pSj2MBtbT9qew29kJQ+aNaN4HQu0a3Mq0/2q4livGKhOm/7vvVEqEMfJmjKMPDY8Gi4Nt1OUtxl6Y4m/DsEYj+s7lFt3MvSWvMIELOiPn0wuht5LJ+44KmMs4hjg8Uus3dXe9cU2YZlPYGdnOJxHbjGWw9dkGXbCnR7YwtSyYzBHQo9cvzf6cHNg5MbzQn8hLHJwfxoxxnk0A9kpLCI+z/XI4Z4Z8xDY5aNCCvymMHOPBvENTtXMIuzK5P+QdevBUKj/5BWs+6LuQVbXZW40ceukUcUn9BMt3lV2WoB+WsopPUe5++Nl7x34PoRZJqS6aFiHHbVbhwR8qZSxzheBHbpjeLJw5cIuUdVJbrTkjRJpxbQ7jFRtMHVZzytqFYbO/FPs0uGiPFENiLMAawsMLPp72VZP3/gW6dG2UKHYjAt8wN/yGAx5+KwmsSvoq7/AlRWW3e7O4YKwefbBlt7zd/Cb1nFZmQyz54xPvPYPj7eXiKXRap6I6QVaY8hq+URq2qZGLmlQ2YHndt8cnuTuAQjt3AUzf6IDZt176pTc+WB/vTcxtZDc1lcT+mdp/6tD8x8FEvPz09EDC9YaScjt3eXhwr16Hu26BdIEs+NBEQ+y+55DvhS8i7olALoMvv5Q67kr0+uhZoUPgVu5so1i72VDIY2P9USMgiqsLD1RKdK4dKFvEJBYCyzt0asyXRVzgIMu1/NstJxb7WDp4QVHre8wok3g/HWdCwJtKv/ESMRh76eoOmeu6bsRcbvbw9096xTKGv/bMuKVGZJ274fsEtTX5sBv9TkRRdPZreuC68WwUiGBCq+SpRZFsIOVOONplAH5JKoKOFchIf7gGdzAEbyLSKJxaFRg39tYGc7ISyiq5d7bxUvw8sVWiqm2HWmd+/7kEkeal1Ooh/tpaTtzLeq7T9/VxoaBT X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a19d38d-326f-4dad-02d5-08dbefec7c6e X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 08:31:58.5594 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IZFDCcl8TG5bbHNFk2PXDtntHbvQLhDwIG3CMw3hQd2c0GGJHfFodoCvG3P+lY3SG5vorkuQnW0Bq48lfsjPUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB10043 Added code to support host mlme for AP mode and let WPA3 work. Signed-off-by: David Lin --- .../net/wireless/marvell/mwifiex/cfg80211.c | 81 +++++++++- drivers/net/wireless/marvell/mwifiex/cmdevt.c | 2 + drivers/net/wireless/marvell/mwifiex/fw.h | 22 ++- drivers/net/wireless/marvell/mwifiex/ioctl.h | 5 + .../wireless/marvell/mwifiex/sta_cmdresp.c | 2 + .../net/wireless/marvell/mwifiex/uap_cmd.c | 148 ++++++++++++++++++ drivers/net/wireless/marvell/mwifiex/util.c | 24 +++ 7 files changed, 276 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index b99de9f4ca14..2968db643ab4 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -246,6 +246,26 @@ mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, return 0; } + if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP) { + if (ieee80211_is_auth(mgmt->frame_control)) + mwifiex_dbg(priv->adapter, MSG, + "auth: send auth to %pM\n", mgmt->da); + if (ieee80211_is_deauth(mgmt->frame_control)) + mwifiex_dbg(priv->adapter, MSG, + "auth: send deauth to %pM\n", mgmt->da); + if (ieee80211_is_disassoc(mgmt->frame_control)) + mwifiex_dbg(priv->adapter, MSG, + "assoc: send disassoc to %pM\n", mgmt->da); + if (ieee80211_is_assoc_resp(mgmt->frame_control)) + mwifiex_dbg(priv->adapter, MSG, + "assoc: send assoc resp to %pM\n", + mgmt->da); + if (ieee80211_is_reassoc_resp(mgmt->frame_control)) + mwifiex_dbg(priv->adapter, MSG, + "assoc: send reassoc resp to %pM\n", + mgmt->da); + } + pkt_len = len + ETH_ALEN; skb = dev_alloc_skb(MWIFIEX_MIN_DATA_HEADER_LEN + MWIFIEX_MGMT_FRAME_HEADER_SIZE + @@ -293,7 +313,8 @@ mwifiex_cfg80211_update_mgmt_frame_registrations(struct wiphy *wiphy, if (mask != priv->mgmt_frame_mask) { priv->mgmt_frame_mask = mask; - if (priv->host_mlme_reg) + if (priv->host_mlme_reg && + GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_UAP) priv->mgmt_frame_mask |= HOST_MLME_MGMT_MASK; mwifiex_send_cmd(priv, HostCmd_CMD_MGMT_FRAME_REG, HostCmd_ACT_GEN_SET, 0, @@ -530,6 +551,9 @@ mwifiex_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, wiphy_dbg(wiphy, "set default mgmt key, key index=%d\n", key_index); + if (priv->adapter->host_mlme) + return 0; + memset(&encrypt_key, 0, sizeof(struct mwifiex_ds_encrypt_key)); encrypt_key.key_len = WLAN_KEY_LEN_CCMP; encrypt_key.key_index = key_index; @@ -1746,10 +1770,14 @@ mwifiex_mgmt_stypes[NUM_NL80211_IFTYPES] = { BIT(IEEE80211_STYPE_PROBE_REQ >> 4), }, [NL80211_IFTYPE_AP] = { - .tx = BIT(IEEE80211_STYPE_ACTION >> 4) | - BIT(IEEE80211_STYPE_PROBE_RESP >> 4), - .rx = BIT(IEEE80211_STYPE_ACTION >> 4) | - BIT(IEEE80211_STYPE_PROBE_REQ >> 4), + .tx = 0xffff, + .rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) | + BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) | + BIT(IEEE80211_STYPE_PROBE_REQ >> 4) | + BIT(IEEE80211_STYPE_DISASSOC >> 4) | + BIT(IEEE80211_STYPE_AUTH >> 4) | + BIT(IEEE80211_STYPE_DEAUTH >> 4) | + BIT(IEEE80211_STYPE_ACTION >> 4), }, [NL80211_IFTYPE_P2P_CLIENT] = { .tx = BIT(IEEE80211_STYPE_ACTION >> 4) | @@ -3974,12 +4002,43 @@ mwifiex_cfg80211_tdls_cancel_chan_switch(struct wiphy *wiphy, } } +static int +mwifiex_cfg80211_uap_add_station(struct mwifiex_private *priv, const u8 *mac, + struct station_parameters *params) +{ + struct mwifiex_sta_info add_sta; + int ret; + + memcpy(add_sta.peer_mac, mac, ETH_ALEN); + add_sta.params = params; + + ret = mwifiex_send_cmd(priv, HostCmd_CMD_ADD_NEW_STATION, + HostCmd_ACT_ADD_STA, 0, (void *)&add_sta, true); + + if (!ret) { + struct station_info *sinfo = NULL; + + sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); + + if (sinfo) { + cfg80211_new_sta(priv->netdev, mac, sinfo, GFP_KERNEL); + kfree(sinfo); + } + } + + return ret; +} + static int mwifiex_cfg80211_add_station(struct wiphy *wiphy, struct net_device *dev, const u8 *mac, struct station_parameters *params) { struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); + if (priv->adapter->host_mlme && + (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP)) + return mwifiex_cfg80211_uap_add_station(priv, mac, params); + if (!(params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))) return -EOPNOTSUPP; @@ -4217,6 +4276,10 @@ mwifiex_cfg80211_change_station(struct wiphy *wiphy, struct net_device *dev, int ret; struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); + if (priv->adapter->host_mlme && + (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP)) + return 0; + /* we support change_station handler only for TDLS peers*/ if (!(params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))) return -EOPNOTSUPP; @@ -4727,14 +4790,18 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) ether_addr_copy(wiphy->perm_addr, adapter->perm_addr); wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; - wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME | - WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD | + wiphy->flags |= WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD | WIPHY_FLAG_AP_UAPSD | WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL | WIPHY_FLAG_HAS_CHANNEL_SWITCH | WIPHY_FLAG_NETNS_OK | WIPHY_FLAG_PS_ON_BY_DEFAULT; + if (adapter->host_mlme) + wiphy->flags |= WIPHY_FLAG_REPORTS_OBSS; + else + wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME; + if (ISSUPP_TDLS_ENABLED(adapter->fw_cap_info)) wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS | WIPHY_FLAG_TDLS_EXTERNAL_SETUP; diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c index 16777af50097..c8d94cc6706f 100644 --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c @@ -635,6 +635,8 @@ int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no, case HostCmd_CMD_UAP_STA_DEAUTH: case HOST_CMD_APCMD_SYS_RESET: case HOST_CMD_APCMD_STA_LIST: + case HostCmd_CMD_CHAN_REPORT_REQUEST: + case HostCmd_CMD_ADD_NEW_STATION: ret = mwifiex_uap_prepare_cmd(priv, cmd_no, cmd_action, cmd_oid, data_buf, cmd_ptr); diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h index 8b22cd993a79..7080f8701952 100644 --- a/drivers/net/wireless/marvell/mwifiex/fw.h +++ b/drivers/net/wireless/marvell/mwifiex/fw.h @@ -210,9 +210,9 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { #define TLV_TYPE_CHAN_ATTR_CFG (PROPRIETARY_TLV_BASE_ID + 237) #define TLV_TYPE_MAX_CONN (PROPRIETARY_TLV_BASE_ID + 279) #define TLV_TYPE_HOST_MLME (PROPRIETARY_TLV_BASE_ID + 307) +#define TLV_TYPE_UAP_STA_FLAGS (PROPRIETARY_TLV_BASE_ID + 313) #define TLV_TYPE_SAE_PWE_MODE (PROPRIETARY_TLV_BASE_ID + 339) - #define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048 #define SSN_MASK 0xfff0 @@ -407,6 +407,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { #define HostCmd_CMD_STA_CONFIGURE 0x023f #define HostCmd_CMD_CHAN_REGION_CFG 0x0242 #define HostCmd_CMD_PACKET_AGGR_CTRL 0x0251 +#define HostCmd_CMD_ADD_NEW_STATION 0x025f #define PROTOCOL_NO_SECURITY 0x01 #define PROTOCOL_STATIC_WEP 0x02 @@ -417,6 +418,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { #define KEY_MGMT_NONE 0x04 #define KEY_MGMT_PSK 0x02 #define KEY_MGMT_EAP 0x01 +#define KEY_MGMT_SAE 0x400 #define CIPHER_TKIP 0x04 #define CIPHER_AES_CCMP 0x08 #define VALID_CIPHER_BITMAP 0x0c @@ -502,6 +504,9 @@ enum mwifiex_channel_flags { #define HostCmd_ACT_GET_TX 0x0008 #define HostCmd_ACT_GET_BOTH 0x000c +#define HostCmd_ACT_REMOVE_STA 0x0 +#define HostCmd_ACT_ADD_STA 0x1 + #define RF_ANTENNA_AUTO 0xFFFF #define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) \ @@ -2312,6 +2317,20 @@ struct host_cmd_ds_sta_configure { u8 tlv_buffer[]; } __packed; +struct mwifiex_ie_types_sta_flag { + struct mwifiex_ie_types_header header; + __le32 sta_flags; +} __packed; + +struct host_cmd_ds_add_station { + __le16 action; + __le16 aid; + u8 peer_mac[ETH_ALEN]; + __le32 listen_interval; + __le16 cap_info; + u8 tlv[]; +} __packed; + struct host_cmd_ds_command { __le16 command; __le16 size; @@ -2390,6 +2409,7 @@ struct host_cmd_ds_command { struct host_cmd_ds_chan_region_cfg reg_cfg; struct host_cmd_ds_pkt_aggr_ctrl pkt_aggr_ctrl; struct host_cmd_ds_sta_configure sta_cfg; + struct host_cmd_ds_add_station sta_info; } params; } __packed; diff --git a/drivers/net/wireless/marvell/mwifiex/ioctl.h b/drivers/net/wireless/marvell/mwifiex/ioctl.h index 091e7ca79376..80ba79ca74c5 100644 --- a/drivers/net/wireless/marvell/mwifiex/ioctl.h +++ b/drivers/net/wireless/marvell/mwifiex/ioctl.h @@ -157,6 +157,11 @@ struct mwifiex_bss_info { u8 bssid[ETH_ALEN]; }; +struct mwifiex_sta_info { + u8 peer_mac[ETH_ALEN]; + struct station_parameters *params; +}; + #define MAX_NUM_TID 8 #define MAX_RX_WINSIZE 64 diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c index 7b69d27e0c0e..9c53825f222d 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c @@ -1398,6 +1398,8 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no, break; case HostCmd_CMD_UAP_STA_DEAUTH: break; + case HostCmd_CMD_ADD_NEW_STATION: + break; case HOST_CMD_APCMD_SYS_RESET: break; case HostCmd_CMD_MEF_CFG: diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c index eb0b8016d43d..91a8a581e3f5 100644 --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c @@ -72,6 +72,10 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv, bss_config->key_mgmt = KEY_MGMT_PSK; } break; + case WLAN_AKM_SUITE_SAE: + bss_config->protocol = PROTOCOL_WPA2; + bss_config->key_mgmt = KEY_MGMT_SAE; + break; default: break; } @@ -783,6 +787,145 @@ static int mwifiex_cmd_uap_sta_deauth(struct mwifiex_private *priv, return 0; } +/* This function prepares AP specific add station command. + */ +static int mwifiex_cmd_uap_add_station(struct mwifiex_private *priv, + struct host_cmd_ds_command *cmd, + u16 cmd_action, void *data_buf) +{ + struct host_cmd_ds_add_station *new_sta = &cmd->params.sta_info; + struct mwifiex_sta_info *add_sta = (struct mwifiex_sta_info *)data_buf; + struct station_parameters *params = add_sta->params; + struct mwifiex_sta_node *sta_ptr; + u8 *pos; + u8 qos_capa; + u16 header_len = sizeof(struct mwifiex_ie_types_header); + u16 tlv_len; + struct mwifiex_ie_types_header *tlv; + struct mwifiex_ie_types_sta_flag *sta_flag; + int i; + + cmd->command = cpu_to_le16(HostCmd_CMD_ADD_NEW_STATION); + new_sta->action = cpu_to_le16(cmd_action); + cmd->size = sizeof(struct host_cmd_ds_add_station) + S_DS_GEN; + + if (cmd_action == HostCmd_ACT_ADD_STA) + sta_ptr = mwifiex_add_sta_entry(priv, add_sta->peer_mac); + else + sta_ptr = mwifiex_get_sta_entry(priv, add_sta->peer_mac); + + if (!sta_ptr) + return -1; + + memcpy(new_sta->peer_mac, add_sta->peer_mac, ETH_ALEN); + + if (cmd_action == HostCmd_ACT_REMOVE_STA) + goto done; + + new_sta->aid = cpu_to_le16(params->aid); + new_sta->listen_interval = cpu_to_le32(params->listen_interval); + new_sta->cap_info = cpu_to_le16(params->capability); + + pos = new_sta->tlv; + + if (params->sta_flags_set & NL80211_STA_FLAG_WME) + sta_ptr->is_wmm_enabled = 1; + sta_flag = (struct mwifiex_ie_types_sta_flag *)pos; + sta_flag->header.type = cpu_to_le16(TLV_TYPE_UAP_STA_FLAGS); + sta_flag->header.len = cpu_to_le16(sizeof(__le32)); + sta_flag->sta_flags = cpu_to_le32(params->sta_flags_set); + pos += sizeof(struct mwifiex_ie_types_sta_flag); + cmd->size += sizeof(struct mwifiex_ie_types_sta_flag); + + if (params->ext_capab_len) { + tlv = (struct mwifiex_ie_types_header *)pos; + tlv->type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY); + tlv_len = params->ext_capab_len; + tlv->len = cpu_to_le16(tlv_len); + memcpy(tlv + header_len, params->ext_capab, tlv_len); + pos += (header_len + tlv_len); + cmd->size += (header_len + tlv_len); + } + + if (params->link_sta_params.supported_rates_len) { + tlv = (struct mwifiex_ie_types_header *)pos; + tlv->type = cpu_to_le16(WLAN_EID_SUPP_RATES); + tlv_len = params->link_sta_params.supported_rates_len; + tlv->len = cpu_to_le16(tlv_len); + memcpy(tlv + header_len, + params->link_sta_params.supported_rates, tlv_len); + pos += (header_len + tlv_len); + cmd->size += (header_len + tlv_len); + } + + if (params->uapsd_queues || params->max_sp) { + tlv = (struct mwifiex_ie_types_header *)pos; + tlv->type = cpu_to_le16(WLAN_EID_QOS_CAPA); + tlv_len = sizeof(qos_capa); + tlv->len = cpu_to_le16(tlv_len); + qos_capa = params->uapsd_queues | (params->max_sp << 5); + memcpy(tlv + header_len, &qos_capa, tlv_len); + pos += (header_len + tlv_len); + cmd->size += (header_len + tlv_len); + sta_ptr->is_wmm_enabled = 1; + } + + if (params->link_sta_params.ht_capa) { + tlv = (struct mwifiex_ie_types_header *)pos; + tlv->type = cpu_to_le16(WLAN_EID_HT_CAPABILITY); + tlv_len = sizeof(struct ieee80211_ht_cap); + tlv->len = cpu_to_le16(tlv_len); + memcpy(tlv + header_len, params->link_sta_params.ht_capa, + tlv_len); + pos += (header_len + tlv_len); + cmd->size += (header_len + tlv_len); + sta_ptr->is_11n_enabled = 1; + sta_ptr->max_amsdu = + le16_to_cpu(params->link_sta_params.ht_capa->cap_info) & + IEEE80211_HT_CAP_MAX_AMSDU ? + MWIFIEX_TX_DATA_BUF_SIZE_8K : + MWIFIEX_TX_DATA_BUF_SIZE_4K; + } + + if (params->link_sta_params.vht_capa) { + tlv = (struct mwifiex_ie_types_header *)pos; + tlv->type = cpu_to_le16(WLAN_EID_VHT_CAPABILITY); + tlv_len = sizeof(struct ieee80211_vht_cap); + tlv->len = cpu_to_le16(tlv_len); + memcpy(tlv + header_len, params->link_sta_params.vht_capa, + tlv_len); + pos += (header_len + tlv_len); + cmd->size += (header_len + tlv_len); + sta_ptr->is_11ac_enabled = 1; + } + + if (params->link_sta_params.opmode_notif_used) { + tlv = (struct mwifiex_ie_types_header *)pos; + tlv->type = cpu_to_le16(WLAN_EID_OPMODE_NOTIF); + tlv_len = sizeof(u8); + tlv->len = cpu_to_le16(tlv_len); + memcpy(tlv + header_len, params->link_sta_params.opmode_notif, + tlv_len); + pos += (header_len + tlv_len); + cmd->size += (header_len + tlv_len); + } + + for (i = 0; i < MAX_NUM_TID; i++) { + if (sta_ptr->is_11n_enabled) + sta_ptr->ampdu_sta[i] = + priv->aggr_prio_tbl[i].ampdu_user; + else + sta_ptr->ampdu_sta[i] = BA_STREAM_NOT_ALLOWED; + } + + memset(sta_ptr->rx_seq, 0xff, sizeof(sta_ptr->rx_seq)); + +done: + cmd->size = cpu_to_le16(cmd->size); + + return 0; +} + /* This function prepares the AP specific commands before sending them * to the firmware. * This is a generic function which calls specific command preparation @@ -818,6 +961,11 @@ int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, u16 cmd_no, data_buf)) return -1; break; + case HostCmd_CMD_ADD_NEW_STATION: + if (mwifiex_cmd_uap_add_station(priv, cmd, cmd_action, + data_buf)) + return -1; + break; default: mwifiex_dbg(priv->adapter, ERROR, "PREP_CMD: unknown cmd %#x\n", cmd_no); diff --git a/drivers/net/wireless/marvell/mwifiex/util.c b/drivers/net/wireless/marvell/mwifiex/util.c index ff1b2f162c30..9e36bb4a8d67 100644 --- a/drivers/net/wireless/marvell/mwifiex/util.c +++ b/drivers/net/wireless/marvell/mwifiex/util.c @@ -497,6 +497,30 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv, cfg80211_rx_mlme_mgmt(priv->netdev, skb->data, pkt_len); } + if (priv->adapter->host_mlme && + (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP)) { + if (ieee80211_is_auth(ieee_hdr->frame_control)) + mwifiex_dbg(priv->adapter, MSG, + "auth: receive auth from %pM\n", + ieee_hdr->addr2); + if (ieee80211_is_deauth(ieee_hdr->frame_control)) + mwifiex_dbg(priv->adapter, MSG, + "auth: receive deauth from %pM\n", + ieee_hdr->addr2); + if (ieee80211_is_disassoc(ieee_hdr->frame_control)) + mwifiex_dbg(priv->adapter, MSG, + "assoc: receive disassoc from %pM\n", + ieee_hdr->addr2); + if (ieee80211_is_assoc_req(ieee_hdr->frame_control)) + mwifiex_dbg(priv->adapter, MSG, + "assoc: receive assoc req from %pM\n", + ieee_hdr->addr2); + if (ieee80211_is_reassoc_req(ieee_hdr->frame_control)) + mwifiex_dbg(priv->adapter, MSG, + "assoc: receive reassoc req from %pM\n", + ieee_hdr->addr2); + } + cfg80211_rx_mgmt(&priv->wdev, priv->roc_cfg.chan.center_freq, CAL_RSSI(rx_pd->snr, rx_pd->nf), skb->data, pkt_len, 0); From patchwork Tue Nov 28 08:31:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lin X-Patchwork-Id: 748042 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Qns2NWgJ" Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2086.outbound.protection.outlook.com [40.107.22.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DA7A10E7; Tue, 28 Nov 2023 00:32:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DqMRizaG0rZl9Gwu4wCjJyqzXM+0RJzHdNXCCtXkcbDF9/O1wyADx9pU2GvCNtSZyFSgCY1umR7HbcjI+H0af0awOy8u6CGbjEzDfwumDErEHMlJ41UDbXwimqv6PzM8CQ+2BMr4rSJPQ0Y6lZuXgYxNEH6q/+AVSz2oe0OHwzj+jPV0kxpNwqdGAYoNtPeoSVNhuPGvihbncMYv5NdA1UzgXUPs3GpYJtgoMPx3t6mAplLUY/xRv6GnikbLrdISuZM5efR32WlC6iqiYwoOJ4o4Zk6n/jlp+TfW+ueb+pqPjWgMPWiPIDPxlmpgN5FZT0LB1GHjyhDb9KGCPTzsdQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mp2O7UM8gLmHwHcUiqTis1VHoTzZ7+MrO7hBp8xrSW4=; b=QF8gEu5WMVy7UMaMqbpa9Z0k0GVpLryE1ZFjQqp4czCghzacqqEkEvg7oMJ4COwRTn2kAurTf0H62HR3RgVEXJC/GNPYmG/HnU/9dm8ltG5cYmiH/Q7DdoaWdbqy8oeLjYuxT2bdOcLu8wueY5wOUdQ4W3okb1S05FiG1d8Yo2TYpgIyFSvAXVC1zwEE9PeR+RCGwW7v2652Q3+JzeDJ/1Epqd6DfVVdXdVTjHZ+p+htZ1MnHDIYzEEwhgSFuA8Ngi4dGX/QOTqhdhs0j0mquVKTSE369H2ItzOD+lViULBb5t/VPNWYIexzhg0ZN5iXSt9nN9809CRgYCizPyKCFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mp2O7UM8gLmHwHcUiqTis1VHoTzZ7+MrO7hBp8xrSW4=; b=Qns2NWgJQb3uamxVHeI6qxRE4zQh413csB1FiL+wEqrw96EMJEnXhmwnz0Yd0V4AeyE7tSeWy8hEoqmCZQHuxoB0osxC62DxJkJUtbYkVahUwM3GMhAnRWwzv8JeKKPAI8MotVSBG5CtnCY2Mn/EriEdwlX6H1q0m2bjor/qniI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) by PAXPR04MB8653.eurprd04.prod.outlook.com (2603:10a6:102:21c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.22; Tue, 28 Nov 2023 08:32:01 +0000 Received: from PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b]) by PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b%7]) with mapi id 15.20.7046.015; Tue, 28 Nov 2023 08:32:01 +0000 From: David Lin To: linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, briannorris@chromium.org, kvalo@kernel.org, francesco@dolcini.it, tsung-hsien.hsieh@nxp.com, David Lin Subject: [PATCH v7 06/12] wifi: mwifiex: added mac address for AP config. Date: Tue, 28 Nov 2023 16:31:09 +0800 Message-Id: <20231128083115.613235-7-yu-hao.lin@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231128083115.613235-1-yu-hao.lin@nxp.com> References: <20231128083115.613235-1-yu-hao.lin@nxp.com> X-ClientProxiedBy: TYCP286CA0019.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::13) To PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9638:EE_|PAXPR04MB8653:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ae09f17-9dcf-4731-a054-08dbefec7e3c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t/PeriRdxqtw3fxnIpwSDBYeEP/eoi6mKddA09+NxRrE7bhs8lpJmTd70RR1C3gp8xKR+ebtGljIPNrfms7NB+wbyzU2pOwtr4OlA7bqsH5h+2SlaWP80Pu4CE4cRaL3Q7INJKhloBrrsyRAMHCUTsMsXjOS9JGJRVFKgJ6caoLCbTImSDGACqtvFJJ9sEzX7jbBzP8rE3H1qDNU4WBLpW3wpJPTx4ACIgkzaRVoEji94Zb32Drkw0tuW1zeNSj4PKfWwnjEhZ+Bg4NKyzuh7LkJIILjS+Cjr45h1PHZoTxq5mcwDCHuUhay3Lfk1FaWDSmI5Bb8pf9IbTBF6dpdae5sZHH116FlWq549gSI5KqzNciPrLnO3ttrt6rsNtYWevwafzQQeuLIOXsAjaZQA1gndSuMVKRpvNt/PJwmYtU2yZP4ocIZr/CqMHOBZMfHD51lstq2xcNHJrybqvitBZ7flEq9GzbcEnss4SCRKOxtxXsa9ZGuM1SQejGBF2RcRF3/gyp7o2MXD5tAnj9e4Qht1bJNBxfaLU2LxXtxgClnbTu638GXagzRQ1tUuZFG X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(136003)(396003)(366004)(376002)(39860400002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(66946007)(478600001)(6512007)(52116002)(6486002)(86362001)(66556008)(66476007)(6916009)(316002)(8676002)(4326008)(8936002)(6506007)(1076003)(2616005)(5660300002)(66899024)(38100700002)(41300700001)(2906002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dUp6orpOzC8xeP+zJOetdlRBjw5wyt4GIL1sCPf+DDvcHLYRfcVEmJfvO+fdhFKHnaVIaTFyKFm9r1z8RkYlQtYArwDoscdqxkrxBAcuMjqr0amZ3VeMzM2ykKsHmmVMAPTD3lDrRiJB5EIP59kMJ9dSC4PP24SH7mgi0f9SbkcyMfa7wWgqyCX7DbRg0yXtwLEavMtrgo6lI80besckt7eP77g+iYXwEpP9vlraV+B9LIMEwYUF/l7G+Fp6y3jkd/SCtfDiSG2nKhf047poX4cmCz0fNyNt05jXJ3yUR+jAVlMIC3OMqYc76RurjRFExqLw+Sei1TpqU3asUsMTrFzu+dB+wxBXU60pMmp/6etfbep7rb8OoGvi89GYm0LWQ8m02PFsUlNSBCTHamGfM5f1A9Rjaw7FORokvsHoebpF7FV617ZO1zENljCQZD6aQLOfwxdyUVwlJ7pQWngIy5YPK4ZNJIdYWQsLLay0dHaqHpo7BKz0z6UGb3wolPYmY7685vTdySeFufDzKX+j4qVzqcDiuxaQyM8k+LF/xhKE4BYWMGx47+fRknFcE00QNaXtFd0pqFKM3G3zddZdTzp1cCU2RCovwV0BlXxDcA6yhCZCs66UnQ1qySW3IMl92hdmMKn7ERiTcuk3oRSZIRVglMCp1D8m/I2PqLvgnBH3JXzbk98yiZg9xOZ+VczqVJLFD7Q1ZptF4U9fkUtUlBysfhLG93yzQRSIwEwiasm5JolG8Sfvlr3t7ykhUgbtNizYhrEQ9nPFwYknKsDk7zgdHoV6QyVhkYDOjsR52CfUbgHlRZzlqpXX7Zy9B7UBvem8/hJipQTLXclDAdtJhwCtk7XdSCFAdX0YZbLLMSas4cAE9m/gVdtNLGNMgh1wa35VGeYoDXHBXP2jIKfXkHiE4i4P9NbVsq+NXLjYik/VMiN7BD2rwMOBc1kgGPiIqcZpDRK3pjznmZWCuHsYmOZbJMdKiimyPRQJLYuaSOEIBTjymIpbMKEX3Nopxx/HSVpc+zaSiC7quR3mH845eV3Do31zfzPcpoy97fa2lL7haCSz7eC3PwLldb8LgKIs98z1Xp/FuikA9S/9k89eQgDncmHdDSHUB7wFx6SrMuP++uUZJu5m6t56PiwoWrQnqFxWU6kRadWcXnrWmZpOnyhIQ8GdHiwD7Xcg7gWB4m/ok/xhbtil/Vob8NJ4hGBlFJSTXByXvqZXE/ZusQVt9GF4yG1lCB67YPD6Vk+WozPP6PIJR+rBsPc9r6EhKAsM63ZTg0TOzV2GdK6oGD3anHrQMK0cT+HbeGAmmWy5QkV5Egbpd4mGJ4DaD8O/SsC+uvmtn61+SeYMyNTOEqqjNgEo1aKcmQOyZYfyobvBQxYTh1FT6tuId2Deg3MdujfAdi6mX5TS8uv4jUE71JU2ct03cFb/+VHGEihKysJ5cdLRUsaE4YVa8EtD3eTGsot+UTa6A5+EFtr5H4NIDu73QL0Pooak5pKOsrB8hldmHZH6Qp/l2IotnBOgQamEnsd6P3SUDAHnzSty70vzib9ScW8Ff8hO6ze/k+4AiMjGPtZ040ARHKjZsTRT0EXyZjjfsjhXK6tjEw2FrRpE3CGIS+8Ss2OY6TwwO56J67ZW8h5K8XG/hD1nUGZJa/jcdz0Q X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ae09f17-9dcf-4731-a054-08dbefec7e3c X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 08:32:01.3628 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5bskH+Ni/CWZNt6rXmmxQI4UeTv0eoR44FHSkBv5SHEwi02ngHoT+YIqF9jKImJr96AT68SQhY7juz8fHPU9Xw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8653 Added TLV command TLV_TYPE_UAP_MAC_ADDRESS for AP configuration. Without this TLV command, client can't connect to AP after restart of hostapd. Signed-off-by: David Lin --- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 2 ++ drivers/net/wireless/marvell/mwifiex/fw.h | 1 + drivers/net/wireless/marvell/mwifiex/ioctl.h | 1 + drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 8 ++++++++ 4 files changed, 12 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index 2968db643ab4..40ab3e8d0c1c 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -2103,6 +2103,8 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy, mwifiex_set_sys_config_invalid_data(bss_cfg); + memcpy(bss_cfg->mac_addr, priv->curr_addr, ETH_ALEN); + if (params->beacon_interval) bss_cfg->beacon_period = params->beacon_interval; if (params->dtim_period) diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h index 7080f8701952..699c7ffcd0e5 100644 --- a/drivers/net/wireless/marvell/mwifiex/fw.h +++ b/drivers/net/wireless/marvell/mwifiex/fw.h @@ -165,6 +165,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { #define TLV_TYPE_STA_MAC_ADDR (PROPRIETARY_TLV_BASE_ID + 32) #define TLV_TYPE_BSSID (PROPRIETARY_TLV_BASE_ID + 35) #define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42) +#define TLV_TYPE_UAP_MAC_ADDRESS (PROPRIETARY_TLV_BASE_ID + 43) #define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44) #define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45) #define TLV_TYPE_UAP_BCAST_SSID (PROPRIETARY_TLV_BASE_ID + 48) diff --git a/drivers/net/wireless/marvell/mwifiex/ioctl.h b/drivers/net/wireless/marvell/mwifiex/ioctl.h index 80ba79ca74c5..fbbb5aafb803 100644 --- a/drivers/net/wireless/marvell/mwifiex/ioctl.h +++ b/drivers/net/wireless/marvell/mwifiex/ioctl.h @@ -83,6 +83,7 @@ struct wep_key { #define MWIFIEX_OPERATING_CLASSES 16 struct mwifiex_uap_bss_param { + u8 mac_addr[ETH_ALEN]; u8 channel; u8 band_cfg; u16 rts_threshold; diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c index 91a8a581e3f5..c1133da28bc6 100644 --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c @@ -472,6 +472,7 @@ void mwifiex_config_uap_11d(struct mwifiex_private *priv, static int mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size) { + struct host_cmd_tlv_mac_addr *mac_tlv; struct host_cmd_tlv_dtim_period *dtim_period; struct host_cmd_tlv_beacon_period *beacon_period; struct host_cmd_tlv_ssid *ssid; @@ -491,6 +492,13 @@ mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size) int i; u16 cmd_size = *param_size; + mac_tlv = (struct host_cmd_tlv_mac_addr *)tlv; + mac_tlv->header.type = cpu_to_le16(TLV_TYPE_UAP_MAC_ADDRESS); + mac_tlv->header.len = cpu_to_le16(ETH_ALEN); + memcpy(mac_tlv->mac_addr, bss_cfg->mac_addr, ETH_ALEN); + cmd_size += sizeof(struct host_cmd_tlv_mac_addr); + tlv += sizeof(struct host_cmd_tlv_mac_addr); + if (bss_cfg->ssid.ssid_len) { ssid = (struct host_cmd_tlv_ssid *)tlv; ssid->header.type = cpu_to_le16(TLV_TYPE_UAP_SSID); From patchwork Tue Nov 28 08:31:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lin X-Patchwork-Id: 748487 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="f+XiBxAa" Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2086.outbound.protection.outlook.com [40.107.22.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95F34D4C; Tue, 28 Nov 2023 00:32:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DRVpTr+Hj1DoQm7g8N+Rhp51nl53h8qfEODYnR9K33sPgedI5Ax1MJgI+xCYWg8RrGZ1qqk50OrRHhJ7DWT4s5JCyPFPSWDaUmV7AglLg/a/K/4IGHaF+uUWxNl8gZXW2pFYAt6lQfR8+jgUmd+m71zvzl6HMt8TtQG3G9AUfW+DzpJpsTF4CSRFlFJ6mUIY0riIIIQx08nOGDnlKZBWL8UtsyyAbn7IAVicY6KdzAccrl6+rYlOZsGUOavZH9D+YnwXpoMYodMl8zmmO8861Ws2r1rIHYKWmEJ3iMH/tVpvMks3phpadfhpQOl2FrksI5kvaWgw/Vt35VSslKUOnQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lZ7GKKLZNzBJwSK0KCfnrPqMHfh7ixsv8ewCJo3g0HE=; b=eu4JE/QIBHoF64FTGqrJz5auf5yZjKM1CnXFP6NI6Unp2XmnEGNgz1MVVOr8zGtpzdbOoySwYT/LvqpvGJzS4eLPyb4nJy0Tva9prmlBl8qmDebny3Fm4HSDYvwnCEnaBZmUlMH/0lH4ynOKpdyIuRY1VLr4bDgOxsdr0KxH7Pq54zfyuBKHd7cCG0ksN7WFqI0TKiHtaLM0ZIMvqH7vldY+2oyVOAQqk06fItjuPQm9aXVdpkQbDERH09etoNJA63XqbeCEcRMtmH3vnk1kHpqRhWnxF01jDsqo/C5iP/ocm0MZ6o3a6DKizRQOrAdOpsXY+zwtSS8+toqUPSSpWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lZ7GKKLZNzBJwSK0KCfnrPqMHfh7ixsv8ewCJo3g0HE=; b=f+XiBxAabVkSgBm81ZNPAxLRCarQw5o62YyFc/R8yUFAltGywUTADxBeIrswKYwRVNb1ZW7LAPb5MiG211VorD1YbNuvcb+U9E6yIwz6ZIXBfcdE/ss0HrbDkAFK9DF6w0wFeGEnObaOHtsRxXYVJDqYr1K2y+1vN3d5UVx4mfU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) by PAXPR04MB8653.eurprd04.prod.outlook.com (2603:10a6:102:21c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.22; Tue, 28 Nov 2023 08:32:04 +0000 Received: from PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b]) by PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b%7]) with mapi id 15.20.7046.015; Tue, 28 Nov 2023 08:32:04 +0000 From: David Lin To: linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, briannorris@chromium.org, kvalo@kernel.org, francesco@dolcini.it, tsung-hsien.hsieh@nxp.com, David Lin Subject: [PATCH v7 07/12] wifi: mwifiex: fixed TLV error for station add cmd. Date: Tue, 28 Nov 2023 16:31:10 +0800 Message-Id: <20231128083115.613235-8-yu-hao.lin@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231128083115.613235-1-yu-hao.lin@nxp.com> References: <20231128083115.613235-1-yu-hao.lin@nxp.com> X-ClientProxiedBy: TYCP286CA0019.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::13) To PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9638:EE_|PAXPR04MB8653:EE_ X-MS-Office365-Filtering-Correlation-Id: d4d8d950-3136-4b2c-d6fb-08dbefec802d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MG+8QqDU+SSFUxlDsGdRKYP663s7wB4584KnjoHXy22Vb+0QcosYYA8IwQFIhlHuu+FK0fD5smUgmrvL0DoppKnfl6dyfPGKXsJm0Lpw2WUc1ip0KT2PlKog09G0zDzzmvmAQtVwJe8MxdxvZbRjPlg0LSa7rIPgXzdw5r0H/5gYKsbg9p9UoIyf41ZkTPvp95jwqydM91sP+vYs/hAo4kdke2AaA2zvOYC/BqVrxhtcny2y01wwMeD1fRfKhxBM1/gZWDXemWwqi/xlYBfFdTM8CQ0qT/ZWa87dZ//lZ+y+c88f6fKF66WdSsgm3+ZaPPC4z+IzgJ8uKwtrLLMoMWA2WN5nXetj8x8Z6ZMxzuK/5f6YpME+BtZjXUIDZKLGG7ffjgVoMR2nO8bec47mpTMcIT1185oDCl+qey+a1xgU2kxwX0sTGDRwYyE5dj8PGV5cJAxLWNKVVYAMjbjy/zET0UPbny6CwXkl8EYmor90zI022XQLyS/+1WRkfJ/LbJrVD0BLy7ToEWB2ApbNy7OAPN04v+FpeJxmT1HMjfjYW8kVOjhCde2zfu3YFtUU X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(136003)(396003)(366004)(376002)(39860400002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(83380400001)(66946007)(478600001)(6512007)(52116002)(6486002)(86362001)(66556008)(6666004)(66476007)(6916009)(316002)(8676002)(4326008)(8936002)(6506007)(1076003)(2616005)(5660300002)(38100700002)(41300700001)(2906002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ItNs+oxaMif1vmZDwUZAQy1CVcBjyWJITQ6FaAC1UX8KUNaRCqyOOPmq51haboe9b4IlG6+pHyAegGRomiKWzAzHJUVpopZXNyh+0zp1jO1oauYIx3gKMBsJ7+CxFs8Ln4oSQzt0L7dbBB+dHsxADQa1kYxB0ZuSBf5FutqUn1Zxbe0JdtNr1pQfzOc3rJFkjq8FJB+PIicwc5mLBTpajXa5rFi0otamGf+SiOG4Fa56TE7NrKfZVj0xWnFj7MTjvooXmmMI65BXevh7Ir9ByEdfYjmKHezXEFCRtk3Zpjr2A1kXDMRt5v+4WreJ2D2tA83HWsaFb0Lyj6uIiM8UVtJInrd7eDhwTcVy7q+Wk//QQU5pg5b3kTB8pDoHD5fAY7D/Us0K/+qrc+3V5sV/WkON6FDGuYXOiDe4TTQ6AGgde9/DX1ZRtREluVmLRePPnpsNWDImrxTktycGrjWa/DPNkBOX6l4PUUEZjfSd8spd7yR0deRYHI1s8WcIBreQdDHXY2J6qEXQbUvnvh12w7+C9BbvU/1MDa00QRGYXEEyR+f7YfSlnVWYZZOc0omcC5Yo1rnguWJqn5caANDQ7/FWBUehs+2zi4PVX4B2XjLKFjzNoxL7nrRoOcocZaKXPUIFEhirTXKNob2C7bbCqjDORJyHemCPU86sB/tyyOPoMxPL2E3x4txnh3P3lYBcHU8V8g3DqkKt2SkW+v8HhRSbFbxrKADdkPVf1u/0rW6pr5Aui58PXGOYF83hePL62qneNU5Post3gaS20BYE+7Quv3t9XxNBBhhWs1Bx3wAPh/WISjcis4KnraoVzQhJWaTd1NIpopAqpX7XH8TyL+LOZA/rrpoNwP1GZNgDi35qmYZQ6MaTYfO4amYDjfF0G0ewGdB20waiqcvgqXHRMz633aQ7pJlsYNz+iZnZRWHe8frGafWYLMb6rz50DUxurYkFS6bRNJOkr2LGF8sbhR8kAKYR8vLf/2JULZI87fyhuFltOFaFt9Zc26lrH7hnvjsFrei5IWE6elYx3YwvXo8Ems7CWrgPML/sC0hWgC3MLJhrMAfpNn2Gnn1OzjLe3F2DJQrwMoYt6ybqJPtWE8DAoHlXT20ENOc7CmX/VK1NCac2qSIBs3JVJh9TTs6/aERpD4XwLZtXYECpC+rOZZX+AUo0AKuNagMk24C09MmHV5Ca2AvU50ZUYm9BHcU/hXYfvAsveqN65ZXCIccuYJVdhGMOz2y4FFwdu4m/dYIJCIOHWWW2aH5moxUsfGxYEoAQthNQZxf+TdCQ+759DTMPCnDYMe0KivClwpLY8e9hUWTj6GOD1yn4fCudMqNckA9iLTbkZk4gPJb13grgrr7fg7e5XS6heeq3xzihOw2hRcCtB5wpgpdWLTtfqqtN59CVUZf/KeYU0SNTW/gjyCdSeq9C90ziAF3/rgceXxujXVALXQKxjRCRAxWl5o16sigYHJo+zuClqq+KQOcUYHv2qP5RI1tQuqBJiI9E0iDfrnk1b0dWA+BkB7sltWRARI2xEwFuypy7+5pK+kAwbDKn/fCm9+s8D5LADbph71AMoy4JvOXCK/6IkKgY9waMnVbajYpoIdc12XobQunv5j682bxHq/3Z8hw1klRm8GlvheE0dJQTuuEJWA/deSBy X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4d8d950-3136-4b2c-d6fb-08dbefec802d X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 08:32:04.5996 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rGCukaewpao4bUK9u59AHCnoPez6D5NErvDNwH+LXwnkiA/HjXNyHJO+00cdfWj2JM1xpDFxRJlsgxK2HLyw4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8653 TLV commands setting for host command HostCmd_CMD_ADD_NEW_STATION is not correct. This issue will set wrong station information to firmware. Without this patch, transmission will get 50-70% low throughput for host mlme AP mode. Signed-off-by: David Lin --- .../net/wireless/marvell/mwifiex/uap_cmd.c | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c index c1133da28bc6..eb7e39146b8a 100644 --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c @@ -809,7 +809,7 @@ static int mwifiex_cmd_uap_add_station(struct mwifiex_private *priv, u8 qos_capa; u16 header_len = sizeof(struct mwifiex_ie_types_header); u16 tlv_len; - struct mwifiex_ie_types_header *tlv; + struct mwifiex_ie_types_data *tlv; struct mwifiex_ie_types_sta_flag *sta_flag; int i; @@ -846,45 +846,44 @@ static int mwifiex_cmd_uap_add_station(struct mwifiex_private *priv, cmd->size += sizeof(struct mwifiex_ie_types_sta_flag); if (params->ext_capab_len) { - tlv = (struct mwifiex_ie_types_header *)pos; - tlv->type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY); + tlv = (struct mwifiex_ie_types_data *)pos; + tlv->header.type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY); tlv_len = params->ext_capab_len; - tlv->len = cpu_to_le16(tlv_len); - memcpy(tlv + header_len, params->ext_capab, tlv_len); + tlv->header.len = cpu_to_le16(tlv_len); + memcpy(tlv->data, params->ext_capab, tlv_len); pos += (header_len + tlv_len); cmd->size += (header_len + tlv_len); } if (params->link_sta_params.supported_rates_len) { - tlv = (struct mwifiex_ie_types_header *)pos; - tlv->type = cpu_to_le16(WLAN_EID_SUPP_RATES); + tlv = (struct mwifiex_ie_types_data *)pos; + tlv->header.type = cpu_to_le16(WLAN_EID_SUPP_RATES); tlv_len = params->link_sta_params.supported_rates_len; - tlv->len = cpu_to_le16(tlv_len); - memcpy(tlv + header_len, + tlv->header.len = cpu_to_le16(tlv_len); + memcpy(tlv->data, params->link_sta_params.supported_rates, tlv_len); pos += (header_len + tlv_len); cmd->size += (header_len + tlv_len); } if (params->uapsd_queues || params->max_sp) { - tlv = (struct mwifiex_ie_types_header *)pos; - tlv->type = cpu_to_le16(WLAN_EID_QOS_CAPA); + tlv = (struct mwifiex_ie_types_data *)pos; + tlv->header.type = cpu_to_le16(WLAN_EID_QOS_CAPA); tlv_len = sizeof(qos_capa); - tlv->len = cpu_to_le16(tlv_len); + tlv->header.len = cpu_to_le16(tlv_len); qos_capa = params->uapsd_queues | (params->max_sp << 5); - memcpy(tlv + header_len, &qos_capa, tlv_len); + memcpy(tlv->data, &qos_capa, tlv_len); pos += (header_len + tlv_len); cmd->size += (header_len + tlv_len); sta_ptr->is_wmm_enabled = 1; } if (params->link_sta_params.ht_capa) { - tlv = (struct mwifiex_ie_types_header *)pos; - tlv->type = cpu_to_le16(WLAN_EID_HT_CAPABILITY); + tlv = (struct mwifiex_ie_types_data *)pos; + tlv->header.type = cpu_to_le16(WLAN_EID_HT_CAPABILITY); tlv_len = sizeof(struct ieee80211_ht_cap); - tlv->len = cpu_to_le16(tlv_len); - memcpy(tlv + header_len, params->link_sta_params.ht_capa, - tlv_len); + tlv->header.len = cpu_to_le16(tlv_len); + memcpy(tlv->data, params->link_sta_params.ht_capa, tlv_len); pos += (header_len + tlv_len); cmd->size += (header_len + tlv_len); sta_ptr->is_11n_enabled = 1; @@ -896,23 +895,22 @@ static int mwifiex_cmd_uap_add_station(struct mwifiex_private *priv, } if (params->link_sta_params.vht_capa) { - tlv = (struct mwifiex_ie_types_header *)pos; - tlv->type = cpu_to_le16(WLAN_EID_VHT_CAPABILITY); + tlv = (struct mwifiex_ie_types_data *)pos; + tlv->header.type = cpu_to_le16(WLAN_EID_VHT_CAPABILITY); tlv_len = sizeof(struct ieee80211_vht_cap); - tlv->len = cpu_to_le16(tlv_len); - memcpy(tlv + header_len, params->link_sta_params.vht_capa, - tlv_len); + tlv->header.len = cpu_to_le16(tlv_len); + memcpy(tlv->data, params->link_sta_params.vht_capa, tlv_len); pos += (header_len + tlv_len); cmd->size += (header_len + tlv_len); sta_ptr->is_11ac_enabled = 1; } if (params->link_sta_params.opmode_notif_used) { - tlv = (struct mwifiex_ie_types_header *)pos; - tlv->type = cpu_to_le16(WLAN_EID_OPMODE_NOTIF); + tlv = (struct mwifiex_ie_types_data *)pos; + tlv->header.type = cpu_to_le16(WLAN_EID_OPMODE_NOTIF); tlv_len = sizeof(u8); - tlv->len = cpu_to_le16(tlv_len); - memcpy(tlv + header_len, params->link_sta_params.opmode_notif, + tlv->header.len = cpu_to_le16(tlv_len); + memcpy(tlv->data, params->link_sta_params.opmode_notif, tlv_len); pos += (header_len + tlv_len); cmd->size += (header_len + tlv_len); From patchwork Tue Nov 28 08:31:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lin X-Patchwork-Id: 748041 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="PgIC6NDq" Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2053.outbound.protection.outlook.com [40.107.241.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D29A21BCC; Tue, 28 Nov 2023 00:32:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OoFIi5MS/IKhrCGoYSP+Yy9HmlNGaBSktFWm0pHyT4l/3iNHJdW8zasCb1GHu86gDXcs7UDRAwIGcOigJB4o7GwADogCH/XmHkk9DhbdKaOXoAXomB2V3HDippk9sNyAXZcB+muY45urY83A3sjqa+xwYKyVUszMEWrCrIYeYk7kdDR0P3dIP4+yo9NWeJrm3KoKn1BUReOXMYuhkLgY7ZsyZPDvaprmfg6bcvngEnMHjZe5d6reSEKf6aVmz2Pw7vz/gnbmUz1ed0/fZcUZ6Yd6EJN7C/Z/8abviz8LuhpjjfehHlHYaDDgv+IUYWGOeoc3V7CU+3nOyZBfEr2RuA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b/gpZf9bYIIaRoUG14w2vAxo8usjf+vtn2EtICcECN0=; b=k4VdhjxNMifcTHEIvTOzcwZI5z6z9lwoJUJDE7oVNiNpfSm5r2gnjSktaVkokAWqERmGehgMVEoavDsxnuLhEYeSvzELvnQLhz7pjkQFbmpwV+miaBU6lQBlh5ODppPbP284VlqTMc8MDsHLwY+qNzybrN/HeTeb5rUJafP7aBWy90r2l9nnhfm8+iftv/3S3nu0K16AohWAtfqRp9mZyomoZ83WDZS2wlCQBSofbPS9ZeHR3ookYbuoqu9ffBIzI12qKbMW7ejgM0soitNm8mKpiR22mzqdsZxmnl96RydDp3JoCgxtPaI8uIm0L7qI29kjJY1r67ZKL6zpAmbN5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b/gpZf9bYIIaRoUG14w2vAxo8usjf+vtn2EtICcECN0=; b=PgIC6NDqvwZ7wWYIb7qmOF1BBYzAhXo2eWg36YrdTeD3MjPjdog+cXH9tKVePS51yTsbWJGJx9yiVYFY6pbLrEYB4vxzxMZbLHoGuqI4F5nKI2ClXinGbocanOxhOymxJtobrkmzhS49p1CwPnmE3ROZOirEc/RRmdGIiNXMAXo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) by AS5PR04MB10043.eurprd04.prod.outlook.com (2603:10a6:20b:67f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.18; Tue, 28 Nov 2023 08:32:07 +0000 Received: from PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b]) by PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b%7]) with mapi id 15.20.7046.015; Tue, 28 Nov 2023 08:32:07 +0000 From: David Lin To: linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, briannorris@chromium.org, kvalo@kernel.org, francesco@dolcini.it, tsung-hsien.hsieh@nxp.com, David Lin Subject: [PATCH v7 08/12] wifi: mwifiex: fixed the way to handle assoc timeout. Date: Tue, 28 Nov 2023 16:31:11 +0800 Message-Id: <20231128083115.613235-9-yu-hao.lin@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231128083115.613235-1-yu-hao.lin@nxp.com> References: <20231128083115.613235-1-yu-hao.lin@nxp.com> X-ClientProxiedBy: TYCP286CA0019.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::13) To PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9638:EE_|AS5PR04MB10043:EE_ X-MS-Office365-Filtering-Correlation-Id: b167b2d5-b147-41cf-4dff-08dbefec81d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pjR5DaqgxnvKtUGcTnD96PXZMs39mvBTrBM/+ZPX6v7YjKgBW3GQj9xfJcCE6rj4jcTz5RkZ4lz3b37KK0TrlOWED9d6xMzAlA8+3FwXdNHxpnKdJVYobwBFQ1+ZBSLJi7saeQnQ166emWB+PYa98h4FJrp1t4DQtY3JQ7mDx2ufJlPYQGahxj754hy6XYRndcJNRdSkzn6fmc4LtKxYxfgi6qtEYKOZyd3Ie9+I1TTPUbA8/3rof8H9z5Bc91dSvd/nc6DUGeDZ4bBx1oSm4jkE7ghOXXQ8hvCCsFR+IbJHBpmK4qoAdESblCd4o8Cno9S15Mv+8RjcXrslpUn8/cdiLcVgPEtL1HCmXyo/LDsgvGGLfIVd0nYgae8VRBHYRztzRAekVerhakVwNGwWCFqjSD8l4Q8YZB3KeYgAKBOV1BVS4QvdHZjXUK9tsk3REJJb0I+gTmRqZn8Vvc4s6TsXl8iPf2WlCtW5Lu0KXbD6cQHBi3fRPuwIkzTpVk0KFOKAyKeCFeXeMpJLag7SP94oqOGrCzxUix30S/pFuOKWfOXKqQ2MYmPJ+cuAITwHa7rX9soCVfnGESS2CQbfziLV4UOzxzTvIkWZ5MFVspE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(346002)(376002)(396003)(136003)(39860400002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(86362001)(4744005)(2906002)(5660300002)(6506007)(83380400001)(6512007)(52116002)(41300700001)(38100700002)(36756003)(6666004)(1076003)(2616005)(478600001)(66556008)(66946007)(6486002)(8936002)(6916009)(8676002)(316002)(4326008)(66476007)(43043002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Xy2P44jmVRWooW4rBElSCkDCiusOEuqqv1pPBQI9Pm2/GevuCsjnSMafwQL1VRKVMMYDpiF1CRuWkwQE0mkuaw/yJ4yVTps4gaQZHSdC+CYoPmxBIlf2vk/blhbYX9OaLfI9w1eTTurBVADMIwBD/S4IkJrhTQ6XsXzpXyTE136+Io3BFQblP0OzOTxfM8PbIz9XS1brgikE8WEDbRQrDchRjPqsH8F3J3hV6B2cv/CNvBzvmuOsQAECqcwxHO7gx/oKZTNZEGgFPY92csqUQq+ZuGELCcBre4AOigjl44lkB3GkfbvtANKROTAwGQS7rnjX0kYlJJCkKM09f4mZAGVmior93XrqGvHLOeqEPhXB15XY+KcFQ/5YlcZYRuuSB92kLOCG/2ylrzoO3MBzL49B8MKnwwYKP+DvUckKYh8L+l7X111dfm3cgaeLW3pVnNugDsqURoJv66ML34Gf6Df97AgJcP82ro589eOGVyoMXHiGCGh8QdQYNgVq70mcRXS91dpsf1HNLEkdAnl8j0Oc+ilL7yLWx5icECSTj9bejSdR/IkME8mSoYNx35kmLZzXTpQMuuzKLqX9RdofQnzypVVD0kcQ6Cy9484uPrPLvhBVwj27dGogfyB52VnGoAA82NyMk6AC2zhSFfa0c9Op+3LtZxoWdG6l6JrwAxrL1HUAN4QbT/KJxht0YGhf2H/FX4aQH79W/x8lpojUuXpyOF+vKOO1F5MsGqzGkRpH1Sb81L1ZsWr+lQkej9de617EYVdd/Q5kyM+6/9Ld+gLokHPEvTTlV2APouebDpQ6tk68YNEQ/5L9OBhMbHBhpehdz/Ca9j/5/GK4VS1sJOJ8aBS9Hsh0f/8rHX3ejIjg/dxuc5qJmk/PB474bytq1jMe37SHrDOutzKnNIxZlOVEDoJ1uNj4Px5vmOvtPFP0zjdb/B8fHMqCAbSDSI4S/38c9RHhJORou6raNIUyn8pCJ94v9XB+f1/VKElUAdgN4tXwB6m21VzDP+qMH8/FItF0w5mwxp/Prciy2Ux6R51d419h5W6OIj3Qxkf7b4s13BTN1y9ZN52dHgxcj32a6slVzSI3n5iyP3nlDaGmwb2DWDMXr5dsGclKma8fexq5CeYjatFGqrUTjUhDD+VZkSf+e7Hk75uePUVEPyG5sKrFALiMVkjlxKwyTa0l73tOw1VEP1YH9NHEJDpXKb6yo+J2h1AZIZvHleJ4EwAtuJWMmpEleoeutPpUl/Xyommss+5RvEQNEiqRkUBJHQkBuHFU1Z9LSi/OcKRc59YrjiVNCUQdeCnOsqO21vzpfQqX8SPtMG/KvzPzcDeLl6+NX7wrEaOCj/MaDGuBGdRahnZwJD33z0hVvnFGAwJDtVmYsNc0rDixWIKkmA13c6gOkiDY59TBlLtd2K7dNMjbs52GkVs5WbGLddwnKltWnrJ8bzMk7Vwau9fD82F83TFBVL/SWZOQoqxjC4Pn12HBoUGuZVMDaOmYgcHwGvCFa32yUaFj6ZcdJJQpOW4+ZYFMBCE+ZocrS7X066pQmFQWIyv6UxYy58Y/iVi/48acHArBpyTBVcRFq0fDCo4aeIU/xioiVjSAUxYQvdH22hmgOGo4/MgHowGtaKfV7MGuK5KsNH0CKNAJaO78VJR6MsPZ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b167b2d5-b147-41cf-4dff-08dbefec81d2 X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 08:32:07.5863 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: InWwETKHzoVQ16OAVBGPfUSPi+5tJcqA8T84tLY6UymvFjiv8re00VI6HF4hgthmWXIsInLWP8+V4l7w9MGlCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB10043 Without this patch, if there is no association response from AP with host mlme enabled, kernel oops will occur. Signed-off-by: David Lin --- drivers/net/wireless/marvell/mwifiex/join.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/join.c b/drivers/net/wireless/marvell/mwifiex/join.c index ef7cc40c3ba4..00720c6840ef 100644 --- a/drivers/net/wireless/marvell/mwifiex/join.c +++ b/drivers/net/wireless/marvell/mwifiex/join.c @@ -723,6 +723,9 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv, mwifiex_dbg(priv->adapter, ERROR, "ASSOC_RESP: UNSPECIFIED failure\n"); } + + if (priv->adapter->host_mlme) + priv->assoc_rsp_size = 0; } else { ret = status_code; } From patchwork Tue Nov 28 08:31:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lin X-Patchwork-Id: 748039 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="IHy6OfV5" Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2086.outbound.protection.outlook.com [40.107.22.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FDB519A3; Tue, 28 Nov 2023 00:32:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bKS474wcTWHiS066RhS7xLu5TunOXfGq+Zr3b5eYDk868z7Phqb/vRVkRWJeP2fq1+WomQdoC9x79V5/0ak0FeyfsQzRKuwJUrScwQIztIDNFEao6Dw8zmEnWxrBThMeA0GPdqoDIXpmKAVIsOtTO4XsSWcZUbAoOvPlF7QH1Bd+44HYxsbydIFaKKhQG8tDROWqvYwAmGZaPU62I+Qwp1qKsAEv7fBlPaSZZrZeVID9KIiDXl8npsBXWDDc1hMU0ccYuG2FYP15ROg9AL6s2E5q/5yiQ9sbJv7x+nlqThoh+5cl3boN4AZDpu1t/5AwMXHoqgVCvutY8haxCj/SJA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0nG190phW/zEeDWMzaxJTOQNoc728q9tAnr7iDWpFTA=; b=djVZxSbIkzxUYyxCPwk+MZFZu8C0c/XLkKq6qrIgiC+XsQ7DJPwxvXRmk/OwS2bldeLHlT4b1eIW3oi3SRQnmwAT0YnMEDmLPdHhTij8VbyClG6T89ecDLs4AiFcmwXqnebQ2QatKGsnH/JAG7ms21RjpiUnIgrg6odAHdeGCpIy8k/HeE+SKmDi8QN+/fxqZz0XnpPtqhQgEwQsJ2W4YpYFHl6E+wVjtaEknDtMhc47r1RNrWG7pe4V9bcaDdHE2aMxwjgYGKo6Mt0cfKgClIGtN/21TsGJIXKmGMRU3VM/GdwDeh7mt4ono9DxdVJ9BjPfIk7t1XYH6TwxxYdCTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0nG190phW/zEeDWMzaxJTOQNoc728q9tAnr7iDWpFTA=; b=IHy6OfV53L/7JUfb9qjWQX/LqgtnlH9+0w9Mx8TY8Xbt1rhAq/70wSr+8gJJ+k3WnmT1Om1w1bKqgZRdgw7juqo3lVCzQ01q/A5oikT8IaVi1Y/gLU7xha6+a/ph/KWT1tncqgqawrZIDJ2zXUhvX6qdM09C32PJcHBrHTE1iO8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) by PAXPR04MB8653.eurprd04.prod.outlook.com (2603:10a6:102:21c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.22; Tue, 28 Nov 2023 08:32:10 +0000 Received: from PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b]) by PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b%7]) with mapi id 15.20.7046.015; Tue, 28 Nov 2023 08:32:10 +0000 From: David Lin To: linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, briannorris@chromium.org, kvalo@kernel.org, francesco@dolcini.it, tsung-hsien.hsieh@nxp.com, David Lin Subject: [PATCH v7 09/12] wifi: mwifiex: fixed the way to handle link lost. Date: Tue, 28 Nov 2023 16:31:12 +0800 Message-Id: <20231128083115.613235-10-yu-hao.lin@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231128083115.613235-1-yu-hao.lin@nxp.com> References: <20231128083115.613235-1-yu-hao.lin@nxp.com> X-ClientProxiedBy: TYCP286CA0019.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::13) To PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9638:EE_|PAXPR04MB8653:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ae21bca-303b-4fd6-cab5-08dbefec839f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7W9PXM8iyaw5O5rglbWFIDp7W3jsoMIBo/F0vk2r08r+k5T8p6ruG4ML1TNDWFkhJDFVFeNU8NWo9JCfM5o8wAAW/emjMvAU0tETa5Uf9e3Dzn7bs+JdfF6pSdCt3sau8UeJuDSMYJbvak/PQZTrBoqBxRoIiKNr86YcoCVyHREmA41+7rvJ5QpgQhBY7+BmD2oInbhbzxTr4g+6nuf1TS+4ZCdTkjyN8MODGyqxx1LLvIU2RcK7iSL2hl9YwpydReR5EaGX6eBIQIHgjp1h73C9sNq9Q5Uk4ODKebJbMj+HsAS7R2lW16ns7O2v5wOTDg+AjBTwFMZYkOTQbC6jGksf+J26gtgvmlPj55lc84c1ENLU4jtw+AJ58AFoUlq95h2Yo2yF80dNswwodg9YKkZQGIykxgmgUN/xwCMnTlRfP2H/uTb3iE0GBnreVsU4bal3n/5Pu/0dRxoqN3/MWIaUeeME2qPIkDU4I5DCi3gagC2s8vCaQBUCD6cftu4KhfHaMwogitRuj2527dB2N6JrUWiFjYH/BLVMlBCqIfWopDtuQoNetyNBH7F8xW8waCAYwQws9tc07dRdXIkGh32L38eTU2UxcDWsuYWxR7I= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(136003)(396003)(366004)(376002)(39860400002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(83380400001)(66946007)(478600001)(6512007)(52116002)(6486002)(86362001)(66556008)(66476007)(6916009)(316002)(8676002)(4326008)(8936002)(6506007)(1076003)(2616005)(5660300002)(38100700002)(41300700001)(2906002)(36756003)(43043002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UaLe/ZRZBYX/SjqQyWqSwdV92+fJNmmAmbLznsl0l6c/V/uRl9mYuwRr19CUEaeY3Nr/lz8FOD4imHLN9yxjxlGB0zy4Mtlv1v+WBwfGMrI03NT45nW4myaFTL+mtytlZhoJmJ+rahumH56kHg0Cm5CPOHLKbxJpkCRxUWZU9N52JNwg7ZO7H9m6nDDRGXNjYuHohNwnk19OP/MGtwE0qdsZK6/+u9J2JmgJSPHKdmeHGnW+0ELrDtID6dAsD5rvWLvY9EF228BgI1/gQXXXJSksw4uk2J0Ud1M/Vse2cqpMBZBzOHaAGqeITGwx5iHImwOrLWizleUGZCuFE/kGn4FAMAOpw0XawQuC8XzA6BQeu9hPJkeHgwAb6OpdSsFE4SZN2sVPbjYAdKaVCcnMapVBqIqvKecHQLuFJoM3z6wWpyL+MmC5n8chNg+gp9aV/f/HfP1USN8VWfk2VQKwEuFYzgrHUN13dmJli5Qmva4dBr9fc0HMHxcw0ci9BY1LzMXeMZDlHxVMb4JNVnC4XQs0+UeFx3++ikEmAH/BRbVEo+FfkgGr/eEvIYjx0mvfsASgZkHg1JyTvGd92tVE8J8lkPHi5cdR1O/snkJBhDtgmV7CXSqv3kOGseMWY33VZEkQL/tkLX6Ur3u5TsjlUrlOY8o/ztpEBtzrB68JOBSkB+wvTwlVRY9XEaISqaz9hPPb7+wuDYRhugzFSjzg/Y+cwwadQyKioPG0W7QHY9I6MSOQC51s432nM0j/kPFX0ww4zL1EXphT40xwWjD4qjdcX4zSH3InB7tx9oGLfZWFW3z4HrvcpEU2WkJjr+3rys/uub9WCJHGZV6OK5qGVwr30TZsqkZ12EtXIhm4WFvfFnZpWTefcXrnJR54kga+XuJ33mkrYNlbZ74xqJawVCwMfHPhJFKbgdiqvol4olYw/5XA4HH3kGwV5RnoNpygkQI84TS3NNQL314VApLIFxkkd2AwUL/vM28vL5jgHOWhE+1rFO66UL5Cedxc7DiGrJ2qujvIZ9j/SnZDI1M/BRP5lgVzcrMKrYzMmWcYbSJFEtAyuYkRMmWvaTWJNreUIqxwm/90AzQtwvOnPcQgNqmR0LEPLLqBZoBZxyLKlb0Zys2Tt/YTR3dXQ9a+/fmGwnlh3ItZzsgQQldWdxVqlL3u1w/rPboRtYsZaTTCK2uMA1AoAmD4VXBUTxd/D+mWI1CbtgE4lfCjGLsZGafe1mu8VxghdHMHpTjKCsYV1wHSUWLmJ8hE9DhaKbkIDJ/OEzv2d6CWTPNE48eeNddMniu/OHZp5C4Msm2v+fU/nINJwCgqdtrFDY//C+wY4/YpRWSDtdwfiw/6ZXdVKxXZWmW9acMdDcFnLf2fDGzlTGpPXVv06KcBxfdA8de+wevTUJgihp0C+AZKGx7LD4MdPnoB7FGiwwWz8vwOAjuOpblxGdxxYLuLakXNyCSjCMElaLVnnwXM/tOdBy7USw2HM6vvckNIqErBrbJ6Ns2/Oc39+vzeNYlx2Zx962B0rzzyswse8K5ofByVZiRpIdDU+1ZikRpc4DXngLExYeWRlWGEj7h2TC/n+m1y6K6eFr1i6eI3FZbL/CfG7rPvlO+3Tqyf3aU5gRnH/pXKKnX/ZZijxJV8Hmv482hd0TjoXkI1 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ae21bca-303b-4fd6-cab5-08dbefec839f X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 08:32:10.3930 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: I9/GbXSUhmRKx/7wiSCcG4MyDVptcj6oEQrj0a0PjqsUsjHv/EoIXJ7igd4JZcgTmQo9RbMd87FsgcNyVDiAeQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8653 If host mlme is enabled, event EVENT_LINK_LOST must be handled with sending deauthentication to upper layers. Without this patch, if AP is leaving and station won't receive deauthentication from AP, station won't reconnect to AP again. Signed-off-by: David Lin --- .../net/wireless/marvell/mwifiex/cfg80211.c | 3 +- drivers/net/wireless/marvell/mwifiex/init.c | 2 + drivers/net/wireless/marvell/mwifiex/main.c | 56 +++++++++++++++++-- drivers/net/wireless/marvell/mwifiex/main.h | 4 ++ .../net/wireless/marvell/mwifiex/sta_event.c | 18 +++++- 5 files changed, 73 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index 40ab3e8d0c1c..588a500fe1b9 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -4556,7 +4556,8 @@ mwifiex_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev, if (priv->assoc_rsp_size) { priv->req_bss = req->bss; adapter->assoc_resp_received = true; - queue_work(adapter->workqueue, &adapter->main_work); + queue_work(adapter->host_mlme_workqueue, + &adapter->host_mlme_work); } cfg80211_put_bss(priv->adapter->wiphy, req->bss); diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c index 4326e03a66d3..87121018abc6 100644 --- a/drivers/net/wireless/marvell/mwifiex/init.c +++ b/drivers/net/wireless/marvell/mwifiex/init.c @@ -224,6 +224,8 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter) adapter->event_received = false; adapter->data_received = false; adapter->assoc_resp_received = false; + adapter->priv_link_lost = NULL; + adapter->host_mlme_link_lost = false; clear_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags); diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index 1dac77946813..f8cef2673502 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -365,12 +365,6 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter) } } - /* Chekc for Assoc Resp */ - if (adapter->assoc_resp_received) { - adapter->assoc_resp_received = false; - mwifiex_process_assoc_resp(adapter); - } - /* Check if we need to confirm Sleep Request received previously */ if (adapter->ps_state == PS_STATE_PRE_SLEEP) @@ -536,6 +530,11 @@ static void mwifiex_terminate_workqueue(struct mwifiex_adapter *adapter) destroy_workqueue(adapter->rx_workqueue); adapter->rx_workqueue = NULL; } + + if (adapter->host_mlme_workqueue) { + destroy_workqueue(adapter->host_mlme_workqueue); + adapter->host_mlme_workqueue = NULL; + } } /* @@ -1394,6 +1393,35 @@ int is_command_pending(struct mwifiex_adapter *adapter) return !is_cmd_pend_q_empty; } +/* This is the host mlme work queue function. + * It handles the host mlme operations. + */ +static void mwifiex_host_mlme_work_queue(struct work_struct *work) +{ + struct mwifiex_adapter *adapter = + container_of(work, struct mwifiex_adapter, host_mlme_work); + + if (test_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags)) + return; + + /* Check for host mlme disconnection */ + if (adapter->host_mlme_link_lost) { + if (adapter->priv_link_lost) { + mwifiex_reset_connect_state(adapter->priv_link_lost, + WLAN_REASON_DEAUTH_LEAVING, + true); + adapter->priv_link_lost = NULL; + } + adapter->host_mlme_link_lost = false; + } + + /* Check for host mlme Assoc Resp */ + if (adapter->assoc_resp_received) { + mwifiex_process_assoc_resp(adapter); + adapter->assoc_resp_received = false; + } +} + /* * This is the RX work queue function. * @@ -1568,6 +1596,14 @@ mwifiex_reinit_sw(struct mwifiex_adapter *adapter) INIT_WORK(&adapter->rx_work, mwifiex_rx_work_queue); } + adapter->host_mlme_workqueue = + alloc_workqueue("MWIFIEX_HOST_MLME_WORK_QUEUE", + WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_UNBOUND, 1); + if (!adapter->host_mlme_workqueue) + goto err_kmalloc; + + INIT_WORK(&adapter->host_mlme_work, mwifiex_host_mlme_work_queue); + /* Register the device. Fill up the private data structure with * relevant information from the card. Some code extracted from * mwifiex_register_dev() @@ -1724,6 +1760,14 @@ mwifiex_add_card(void *card, struct completion *fw_done, INIT_WORK(&adapter->rx_work, mwifiex_rx_work_queue); } + adapter->host_mlme_workqueue = + alloc_workqueue("MWIFIEX_HOST_MLME_WORK_QUEUE", + WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_UNBOUND, 1); + if (!adapter->host_mlme_workqueue) + goto err_kmalloc; + + INIT_WORK(&adapter->host_mlme_work, mwifiex_host_mlme_work_queue); + /* Register the device. Fill up the private data structure with relevant information from the card. */ if (adapter->if_ops.register_dev(adapter)) { diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h index ae4b44ad6c50..f0158d217bb8 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.h +++ b/drivers/net/wireless/marvell/mwifiex/main.h @@ -885,6 +885,8 @@ struct mwifiex_adapter { struct work_struct main_work; struct workqueue_struct *rx_workqueue; struct work_struct rx_work; + struct workqueue_struct *host_mlme_workqueue; + struct work_struct host_mlme_work; bool rx_work_enabled; bool rx_processing; bool delay_main_work; @@ -917,6 +919,8 @@ struct mwifiex_adapter { u8 event_received; u8 data_received; u8 assoc_resp_received; + struct mwifiex_private *priv_link_lost; + u8 host_mlme_link_lost; u16 seq_num; struct cmd_ctrl_node *cmd_pool; struct cmd_ctrl_node *curr_cmd; diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c b/drivers/net/wireless/marvell/mwifiex/sta_event.c index 69426ddd9c3a..9c6fac91204c 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_event.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c @@ -225,8 +225,12 @@ void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code, priv->cfg_bssid, reason_code); if (priv->bss_mode == NL80211_IFTYPE_STATION || priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) { - cfg80211_disconnected(priv->netdev, reason_code, NULL, 0, - !from_ap, GFP_KERNEL); + if (adapter->host_mlme && adapter->host_mlme_link_lost) + mwifiex_host_mlme_disconnect(adapter->priv_link_lost, + reason_code, NULL); + else + cfg80211_disconnected(priv->netdev, reason_code, NULL, + 0, !from_ap, GFP_KERNEL); } eth_zero_addr(priv->cfg_bssid); @@ -749,7 +753,15 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) if (priv->media_connected) { reason_code = get_unaligned_le16(adapter->event_body); - mwifiex_reset_connect_state(priv, reason_code, true); + if (adapter->host_mlme) { + adapter->priv_link_lost = priv; + adapter->host_mlme_link_lost = true; + queue_work(adapter->host_mlme_workqueue, + &adapter->host_mlme_work); + } else { + mwifiex_reset_connect_state(priv, reason_code, + true); + } } break; From patchwork Tue Nov 28 08:31:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lin X-Patchwork-Id: 748486 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="pirNeDjp" Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2050.outbound.protection.outlook.com [40.107.22.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 310552710; Tue, 28 Nov 2023 00:33:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C89kq+PxzKMi+f8lQDZ6Q6Q+JnIo41DSZ/J9SqCD7uSclwoPU8DFM+iAxp8xVjjAEwdITW+LPxykMBfOyVAARdZtDSJakGZziPDzG6BvxH89oROeloZM8hm2NI5H6C4B666IyjUVZiXKF4ylJmFoerWen39OMpxxbP5mn7OtwAoT1DH+Db7zuxspOhUnPof1QZHkHzyi18LwxowHMdbvni8yvmGsZ090aFRsJtfLXsHWvOJMnzUPeQ++ZrAOpLHfwUctjW47LYFcWxh/jyOlBFKIzOawmhLqEXriF7QWsd4cyeCK7Nil6bvUrjEz2ve7h+jou388L7b0Kqfc2s9k2A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sZrG4C4q1H5THFoH+tI44/yFuOw6ffv1Nnud6P0dn5o=; b=AWzkYmbnIpho7G4Q26jcV5aOvckeKDkM6G0FLBWAq/R27kh+Vis3Wjd2prV0opDcI1SVxHSeWhwq93aYvapaMjJeKqGJzLer7zuHj6q6gC5GBILUmVldq48VGbfZ5OuGGc7kpkdwkGWaDk4r9K+dmCtc/80+5UzbJ4ohJZ7Bg4mY+KHd+cOP6soJeVQI+gJfSJFWsIqt5vjfsRrFh66jn+1Q/RPil897/j7i44OYdVKk/WA0M6tFzmQsFWNevVieRvIvdy3oG13x/DzYl7cvwxSDoYNa/nVTH7jzJbpR0Q1N35B+5gg8dITceAmKdXoeEPq4rQvl+XSarWqO/x8TUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sZrG4C4q1H5THFoH+tI44/yFuOw6ffv1Nnud6P0dn5o=; b=pirNeDjpTHfXhp1NQTWlm2E9HyDoeGAw1u8w2XRjKSj9JGTLqkgSU1DwaUBX92j5y6OGMFSALCoTZzw/qNbteH2LlmSOOVKF6/evGGPHx3tHunXbx7y3by5jikD58Jh1qaYDLyKeWUv+zsZ7v8uqCEPcw7VNxN+UH3lHD7GilMI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) by PAXPR04MB8653.eurprd04.prod.outlook.com (2603:10a6:102:21c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.22; Tue, 28 Nov 2023 08:32:13 +0000 Received: from PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b]) by PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b%7]) with mapi id 15.20.7046.015; Tue, 28 Nov 2023 08:32:13 +0000 From: David Lin To: linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, briannorris@chromium.org, kvalo@kernel.org, francesco@dolcini.it, tsung-hsien.hsieh@nxp.com, David Lin Subject: [PATCH v7 10/12] wifi: mwifiex: fixed AP issue without host mlme. Date: Tue, 28 Nov 2023 16:31:13 +0800 Message-Id: <20231128083115.613235-11-yu-hao.lin@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231128083115.613235-1-yu-hao.lin@nxp.com> References: <20231128083115.613235-1-yu-hao.lin@nxp.com> X-ClientProxiedBy: TYCP286CA0019.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::13) To PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9638:EE_|PAXPR04MB8653:EE_ X-MS-Office365-Filtering-Correlation-Id: d074516f-7629-4b76-c7af-08dbefec8549 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vm18zIdthFvU0Md0H7Fdr0YdJtuT0j6GW3AcKUAM6/Q11W4JBhD1LnFaJT81aziWtX29ihfFS6ZPW/YE/f7SXafiQkMmRlTAJ+5m9q/VZ5IRKA6ugN8BHp7x33kgqVcsL9oChQ/Unu3D6V6AYgr/iVVGFV59T1YUpivAEGrkeFntVfuRqXlnb3uJ6mYJx2njcskVe2ehAJ90uzqKuuFtnIQt4asm93WaGO8jS0KivUNzSJnxVuTHG9xCECXh6k8uNguCJvRlShXLVtY7GgBQIfsEyc0ZosycY9L+/V9k+ApGYCpV1N2Npj2U7l95mQG1Mwme43BIjEZ50ofWhmw9RpDxqyTiztYbHLgPCkUNvXcwo4JdSHTuNrsG4gdgArF1e7xIwhQhTwiG92udX3WfzqXwosIxEbLwUZwf0i1x/k3Jo8sAbA9cY8HE945TjjnX1WaX4EZk1zlDO7kSaE8sFl27uYKFDMk3tq8dIUltRlYIngQR5T3b+wdVE4X2QQ1u5kdC7naA26/Hzv5cAQI5l3QT2zrE7K06TVf4a9kx06TWV+xMl4JaHjKkrNTspESv X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(136003)(396003)(366004)(376002)(39860400002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(83380400001)(66946007)(478600001)(6512007)(52116002)(6486002)(86362001)(66556008)(66476007)(6916009)(316002)(8676002)(4326008)(8936002)(6506007)(1076003)(2616005)(5660300002)(38100700002)(41300700001)(2906002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2Y+He+H/4a4QEY1/341MOIolyQV/j6FlZ44Dp7D6aeIfBNxYpH/9gT4RrKF+uG4OBr/p5j1sdmTrvlSMavXlZLK6vy+pLjAb+3at0dqri3j5Ov/LGh2gX1mSByFQ9hMvgrRBp/KGDCKzHaKCW0pMajV00CaASCtQNnr2PAQgnJlqJhZtNvPn5tsdsHvkUUe7QABzG9WEgiA14vU7qv+LCYrlvutjK1yGi7Nlq24/MU8f7B1OTapH48JblW91Op72uJoUTdkJ5M/rfr+1Qi8yLuQcZRS0cHFMtPVYS0ega950puawZdKc06k3+x3+LP12/FSCqhfE2OU+wBUUODDXzL/9m1RGKxdz4KOMFyWpkmHUbgm9+Xw9XfLGRIonTSeQvDiiMwvhKcCRHluFQEi/pyf367hC7kFAgB7CB47ZTsUYfu8SBeUTvq4kbANU/E5lIcXgfe6fEqWyUca0d9uHPhg6O+Q26oGzW6A7g9fMLOXc9OHyYe/Bh4lRLE345D4HppLk675YwuXbutOm1Y/RefcGqqEK10cZG+bg2K7iz/kCZfdyaEubceeIbX1oyyevSZULUsTIBkZ3yhu2iEnNDijjnqWzw95g6HNa12DIILWJbgIOnG9+F1yU5yY2T/68EU1F16tR5rTQf/g0kqOjPm1nsnxEvU+Y6tDP53TXNf87lP8UjhCj0Y7e51DFO0//Yd9yb9xfUmAKWxy60f3K81R9+BKVycLAoA64tX5XreUsEooKjYt3b61IdSQePCo60ZH4MaeA/VTX7GdcwEyq9tYm079Mq6lKkvezDq6Mw4Cjks9k8L6+qKd1/7aPHiKPvwVcAN8mqRguPXBB872iQAuVJUFu6si93MWGWodi5OMpQEgWkbbHCX1AMJLQzVdncsYXTwWEOnvzLz8R4leFRXWAcnwiqn6M8t2WX23NdYDOG8jAl1tZOgFbhRqzdXRI13ccqjXL//O7kKD8qIpVoVNb0rya3ENzHzxQyCn6RULA2a2G6LyY5yaZDvOQ8/TeIExzgohx/8fm2IwrsP3QElgJEzHa+9sr0a+IcptYN/bOLfsxpovIVH7d3z1iQB71aLoVK2MpWfnwybJmP2XPiO5yE/LYijVuWUbFwnX1lxEA0c3qPKPfRmQkaZyQ9zZ9DxvIN3jSv/lOQtik5hf5QqXFy3LSrXwIK3qynQwwmwfnn+hwuCZwfQRjwf/gM1XOcPDCZyJrks4KaaHAlglkutFqSjZ3NodsB8ChSm16kZ6ATSKnyblcKpJvfClmSlmw27BSzqBv+5SPg+n/Ci0x4rTpManDAGHRKXEJeg/89pDJubthWYnoiz9ulmDHDQpmExaBQroRlZioEkpB/AgLZt3qY0CEleQ0BjpVVOiko42CufS8mk7Tq2qROnmFKnfsEZ411dB393Lhn45NAKOblCUP8MPNUQMm++hQ0mZMA7y5Gqq6YS7CrJmxPxt0HGj3o8aDfyZwTkT8+fqfWqWzfYfekPx0NGZBvLe4XVHcgUoLLgpI0bbZMWyZn6lYoFK4raHHSNoJiyglL6DvCIcpRj7cJGlshCsAiklJUy3xq49OZ6IXf8hNvrZtpZ9srFJEuB66UVAIVLcjQgAD9tcETxS90/62BSyhUaKDlB2Y/CFniW/sXGXyVX253W0spA/L X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d074516f-7629-4b76-c7af-08dbefec8549 X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 08:32:13.1838 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uaTcqgVVLDFEcdYyDJux7VHZkEvWo8d+CJ98GVmZl08PLlK5oM1Tp1a/kep9sqYnZPB3g6qfjLuj5Ku6xeGo4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8653 Without this patch, station can't connect to AP if host mlme is disabled. Signed-off-by: David Lin --- .../net/wireless/marvell/mwifiex/cfg80211.c | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index 588a500fe1b9..2792996e027f 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -1761,7 +1761,7 @@ static const u32 mwifiex_cipher_suites[] = { }; /* Supported mgmt frame types to be advertised to cfg80211 */ -static const struct ieee80211_txrx_stypes +static struct ieee80211_txrx_stypes mwifiex_mgmt_stypes[NUM_NL80211_IFTYPES] = { [NL80211_IFTYPE_STATION] = { .tx = BIT(IEEE80211_STYPE_ACTION >> 4) | @@ -1770,14 +1770,10 @@ mwifiex_mgmt_stypes[NUM_NL80211_IFTYPES] = { BIT(IEEE80211_STYPE_PROBE_REQ >> 4), }, [NL80211_IFTYPE_AP] = { - .tx = 0xffff, - .rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) | - BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) | - BIT(IEEE80211_STYPE_PROBE_REQ >> 4) | - BIT(IEEE80211_STYPE_DISASSOC >> 4) | - BIT(IEEE80211_STYPE_AUTH >> 4) | - BIT(IEEE80211_STYPE_DEAUTH >> 4) | - BIT(IEEE80211_STYPE_ACTION >> 4), + .tx = BIT(IEEE80211_STYPE_ACTION >> 4) | + BIT(IEEE80211_STYPE_PROBE_RESP >> 4), + .rx = BIT(IEEE80211_STYPE_ACTION >> 4) | + BIT(IEEE80211_STYPE_PROBE_REQ >> 4), }, [NL80211_IFTYPE_P2P_CLIENT] = { .tx = BIT(IEEE80211_STYPE_ACTION >> 4) | @@ -4751,6 +4747,17 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) } wiphy->max_scan_ssids = MWIFIEX_MAX_SSID_LIST_LENGTH; wiphy->max_scan_ie_len = MWIFIEX_MAX_VSIE_LEN; + if (adapter->host_mlme) { + mwifiex_mgmt_stypes[NL80211_IFTYPE_AP].tx = 0xffff; + mwifiex_mgmt_stypes[NL80211_IFTYPE_AP].rx = + BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) | + BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) | + BIT(IEEE80211_STYPE_PROBE_REQ >> 4) | + BIT(IEEE80211_STYPE_DISASSOC >> 4) | + BIT(IEEE80211_STYPE_AUTH >> 4) | + BIT(IEEE80211_STYPE_DEAUTH >> 4) | + BIT(IEEE80211_STYPE_ACTION >> 4); + } wiphy->mgmt_stypes = mwifiex_mgmt_stypes; wiphy->max_remain_on_channel_duration = 5000; wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | From patchwork Tue Nov 28 08:31:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lin X-Patchwork-Id: 748040 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="o9S5/jiX" Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2047.outbound.protection.outlook.com [40.107.22.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56A5110C3; Tue, 28 Nov 2023 00:33:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PoG12SKW+4TGcaiPtQz6c8oKoR7XM1mLdlNbP6m9BQ2PeCtJRhSY3i//s9kzw+w0qnJIhfaX/xHhir0BKaNquPCtlu1vB4Oqen0vBo8ro2YlMUey9sECO4q9I6Cer5HFIA/gHKoe+eTRaz6pub2iTPfiKVsljiU/qB8cLh/gMN7/a2837XnqRmErgFOKqhj5OeXhT2fSj+JaywLX1wtlwVLD4+jznbsDYilX6vDnoH5i2flfVkZj5koxmCoJ2bWfJtc1jbYwknJX7lhO0kEnVWNs5el0NUVqE1y0MyyJh5dpbaIOKtJpVZiNwZvm++3W4c68io60piGEENKQUBp1rA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YCL1iomnw4k7Rk1/ycXqY7MZHK26xof6L3vDXJg/Kmk=; b=R4YK+oF7O2KWJ3hZ/Zd0MnS433dHIr8EujglgL1KmF3CPkfYo9YTBv9Kbo3wQLLKB0pC/Bdi3kfvFFai+TFFR7KFO2EvHBLXmBqk4a2X44VLv5HKxs9S9u/Uy913RXY4gYltUrdDDgYMNm5SX9KKv7QnJCLGBmohaAqi99MEJjXsTwX+spOrWxyKSnUHN3IM/OZCo5Dkva5UHdlvXq87fTl4vjXI92shoaGXC90aIYuu9Mx1R5JPeWrW3EdYFECAJmsQRkTeD4gGZt7kK83jRpYtTZ3k3rpwffx9ViLLlvtv/susma/zRQuZpj9W1zvt8Yp4d8vJYlTVHGhVC36o7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YCL1iomnw4k7Rk1/ycXqY7MZHK26xof6L3vDXJg/Kmk=; b=o9S5/jiXSKwgb0m3twNtpolMr5StS2ZHfEgh+4/c2/gZ3K5Ry0Tggg69FKUXXvpUMopf1cl57Su27Xm3OcdV/92VpGI8DXxFrHDfu2TfO3kHKbfncvymIAHC8Q90ZW0WntfgFGN2zdSM6XhLWmoDVSQTVmZF4NOIm/DdQSKgt7c= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) by PAXPR04MB8653.eurprd04.prod.outlook.com (2603:10a6:102:21c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.22; Tue, 28 Nov 2023 08:32:16 +0000 Received: from PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b]) by PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b%7]) with mapi id 15.20.7046.015; Tue, 28 Nov 2023 08:32:16 +0000 From: David Lin To: linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, briannorris@chromium.org, kvalo@kernel.org, francesco@dolcini.it, tsung-hsien.hsieh@nxp.com, David Lin Subject: [PATCH v7 11/12] wifi: mwifiex: misc modifications for review comments. Date: Tue, 28 Nov 2023 16:31:14 +0800 Message-Id: <20231128083115.613235-12-yu-hao.lin@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231128083115.613235-1-yu-hao.lin@nxp.com> References: <20231128083115.613235-1-yu-hao.lin@nxp.com> X-ClientProxiedBy: TYCP286CA0019.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::13) To PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9638:EE_|PAXPR04MB8653:EE_ X-MS-Office365-Filtering-Correlation-Id: b37ad126-0716-464a-39d9-08dbefec86f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o3CEf8S8ccryPBHKa9O08fKYaztG8U4JGD6waGa0VqMJpTCCB91hW/ZdwQGMNE0FaExCwSNQBgzKGsJ6KbcJJgB1ElNsBUDxSftT86RBfQeVCpEBW/kPMeXyU4ZpLVL13lR7YG+r+Jl2xSN9i6updUe1WBiT8izqeAaSPO43A8mStsxH+gPF1PHxIwQdKiZdQX1ylCObskOvPmaISDcQNAuqsUfq6wzqCG0xNcJBSkybF9nK9cbY0ChI3A1giEcmgMTkSbyVFynLYXf3Hpz4iVUyqz6WQX4fLX1tyIpLiqShq0ZtIdK1Fu/yNClwp0gDQ9eYD7s/1Hsm+xuL+676zEqT8wPSowq9TqA8CR3mpeBJn0srGzALukoyOGafm1xzWvV9xPpvyvhgLTQjDj8jP91y7ysmiGsflYqDNx9IxJocDJHMYZFEFJh/K15uHKtIL6COHv7cqG3qIRkj7LVzL9l8HKKIJmQC7+TiS+d2Sc0jbcwNEhDjfNaBgGmc44UeqHaBeVkCqosnUbh9S2taZ0WYIbVwahMYYhnq1CHzvPzibPxXM6i5yrSAW6J1Hi0q X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(136003)(396003)(366004)(376002)(39860400002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(83380400001)(66946007)(478600001)(6512007)(52116002)(6486002)(86362001)(66556008)(66476007)(6916009)(316002)(8676002)(4326008)(8936002)(6506007)(1076003)(2616005)(5660300002)(30864003)(38100700002)(41300700001)(2906002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5Ykc9VMaUxsiNKRaYKIXmMeoWcz2sm4NT36ZsKI5ozp/JrvdDgWj5rrh5uMyQcUMuBozSJ4HbKj758A2w0MHTBFZ5jTS6XQFH9EWqthaZhY5mr74fhxR3q7QdGob1M5AwIi10RM0iKKS33T3Pa2IuOE6OTMHrhUcf1eWzRZsVIHazMCUzXNR6XDHXclGP5BHvvl5VCNU6gL7/zVAj17+u/0hSYkbr7N1Njw+S6/cMkN/8JRzZUy2Dbx5DBMcchAxUWEcScMG0awSf0Lg3dBiJ7t06v8J+ivZ+bAlQjzf62poMZp617fswB+grJzEoelN/RUIqAk+qihYxUqLgFGeSaQ01GDPFScrPRd3Y8r3BAT5tFvXnK7gYKgkY9jyaH0QeNCdozgHGjGieOQ402XlGDMW5YvwscEQ2m4zWs7jIBtMD5ddQusmSVi1ocKsMQ59eBrLu7oeXJg1oUlDuYqzkDnW0mZQ/WFQJnPPRT2BJdH368ZPMvA/jHlpWpoYWYmZYGPcOtqPLYu+1Yj2yPnF6/ql/aVNwwuUOjWf/SyYZrIVUS+iR2GwLgrTkFdOOkcqb/ZCtsaLTtqwB3YivKkl1MPyqYN+thz9VSZiX84p0SSxukcjXUcshjlmQNgFVH+coqdKlRM9wjk/LZ91y0NPxlCWb1IBTqdumfLH66GibiAIDz7Owri245c/hhcNVSeQzaj1FSTrYfH2OJto65YHTqwMUvl0/hBA3+QPsZi+KIRUchgeBgwQ28H2Slu9WgEY4Enm3B2+tTSwE2lKg3vTCcgrs/4WBCAS9ULtqLdhrK4dqsZG1ns1fwKxUvqSHKQiMDcnNAMbhbtCZqBIkYHsHhwbnPVgLj4Z/hJvupb8Xt1XK38a2GX6yXMMxTPT+grXP/EB6OtH2cSAcjWKqbrsm5iYjkICvhYlRz2BWIwyeDDfSOwoW0gQ7xb9CN5nHXRi/9aH8ETm9mKefihEvWtsRz9mJm/yYustMr8l17jJeupx9rV3NaK9xC3zuYiPFHH7zFK6s2Y8YAZzClfp1gXjutvN2+womSWtIgNVCGd9T9n6yFtVkALzuk5lK77UKc1qnC4irx4lvo22ZJ0x3AFg72MgMDERKV2WN/R1VHqfMjioVC7RMrTxtmwCsAYI2Sli/Z1R4s6jYhLIe2+i+nPXwvj7ddwPcaj4Sck/SvjjLg0rnyYLAwnFuqL0NaYAk5BY3KdsUtQJDxpICfnUDKH3vMdErzLjZG3G+Sm/D4vKiUBs2LBpVMHCYgpXkK/3Yyxjg7AXf8OFodwp2weyX5t7E3g6hQ2tiUBtF7plTzAYW5blOKFmvvtZ8JgfbhcXBoTbctYyfj+Lhs9uoLWpMKi1jjXXJ2FmFh/eiArt6qCAgQT3nfJyInde8CurX8WeTId394zoyevkCsd5HnP4Y5oCrkJVnvNL1rDVcrio0I0Ie12L9UvPjs0X5E6iFzaxUEIx0QRKPlNZtMdeQq9J2hPbH+NwvJDulreLK/zBL85M9DjaEgm13FwhSVeDgFFAjVl20oBBpuXr/xs7yoVyjJRmPubqg+z/7APTSqOQF8dgVHjFt+rTHuDqVnmCw7iZRbxmTR8qWFJTtxuQcfj6NbVyU4Yxj14YKUEnrGcQjQKGVwipjSWc3pHBMbbWvLjExQDo X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b37ad126-0716-464a-39d9-08dbefec86f7 X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 08:32:16.2247 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Dx8YI4A59RPSXufGsaOWLj2EsqKkaQJgqbc1HDRVRJqXD5MUDX4QHPRWyaxD1yzL88jIHHPIUfabhLl+JkiTEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8653 1. Moved struct mwifiex_ieee80211_mgmt from cfg80211.c to fw.h. 2. Defined WLAN_AUTH_NONE instead of using 0xFFFF directly. 3. Changed host_mlme of struct mwifiex_adapter to host_mlme_enabled. 4. Moved mwifiex_check_key_api_ver() to end of mwifiex_ret_get_hw_spec(). 5. Redefined MWIFIEX_MGMT_HEADER_LEN and MWIFIEX_AUTH_BODY_LEN. Signed-off-by: David Lin --- .../net/wireless/marvell/mwifiex/cfg80211.c | 47 +++++-------------- drivers/net/wireless/marvell/mwifiex/cmdevt.c | 9 ++-- drivers/net/wireless/marvell/mwifiex/decl.h | 29 ++++++++---- drivers/net/wireless/marvell/mwifiex/fw.h | 25 ++++++++++ drivers/net/wireless/marvell/mwifiex/init.c | 2 +- drivers/net/wireless/marvell/mwifiex/join.c | 10 ++-- drivers/net/wireless/marvell/mwifiex/main.h | 2 +- drivers/net/wireless/marvell/mwifiex/sdio.c | 2 +- .../net/wireless/marvell/mwifiex/sta_event.c | 10 ++-- .../net/wireless/marvell/mwifiex/sta_ioctl.c | 2 +- .../net/wireless/marvell/mwifiex/uap_cmd.c | 2 +- drivers/net/wireless/marvell/mwifiex/util.c | 6 +-- 12 files changed, 79 insertions(+), 67 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index 2792996e027f..f840b0559bd3 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -57,31 +57,6 @@ ieee80211_iface_combination mwifiex_iface_comb_ap_sta_drcs = { .beacon_int_infra_match = true, }; -struct mwifiex_ieee80211_mgmt { - __le16 frame_control; - __le16 duration; - u8 da[ETH_ALEN]; - u8 sa[ETH_ALEN]; - u8 bssid[ETH_ALEN]; - __le16 seq_ctrl; - u8 addr4[ETH_ALEN]; - union { - struct { - __le16 auth_alg; - __le16 auth_transaction; - __le16 status_code; - /* possibly followed by Challenge text */ - u8 variable[]; - } __packed auth; - struct { - __le16 capab_info; - __le16 listen_interval; - /* followed by SSID and Supported rates */ - u8 variable[]; - } __packed assoc_req; - } u; -} __pack; - /* * This function maps the nl802.11 channel type into driver channel type. * @@ -551,7 +526,7 @@ mwifiex_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, wiphy_dbg(wiphy, "set default mgmt key, key index=%d\n", key_index); - if (priv->adapter->host_mlme) + if (priv->adapter->host_mlme_enabled) return 0; memset(&encrypt_key, 0, sizeof(struct mwifiex_ds_encrypt_key)); @@ -3683,7 +3658,7 @@ static int mwifiex_set_rekey_data(struct wiphy *wiphy, struct net_device *dev, if (!ISSUPP_FIRMWARE_SUPPLICANT(priv->adapter->fw_cap_info)) return -EOPNOTSUPP; - if (priv->adapter->host_mlme) + if (priv->adapter->host_mlme_enabled) return 0; return mwifiex_send_cmd(priv, HostCmd_CMD_GTK_REKEY_OFFLOAD_CFG, @@ -4033,7 +4008,7 @@ mwifiex_cfg80211_add_station(struct wiphy *wiphy, struct net_device *dev, { struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); - if (priv->adapter->host_mlme && + if (priv->adapter->host_mlme_enabled && (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP)) return mwifiex_cfg80211_uap_add_station(priv, mac, params); @@ -4274,7 +4249,7 @@ mwifiex_cfg80211_change_station(struct wiphy *wiphy, struct net_device *dev, int ret; struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); - if (priv->adapter->host_mlme && + if (priv->adapter->host_mlme_enabled && (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP)) return 0; @@ -4426,8 +4401,8 @@ mwifiex_cfg80211_authenticate(struct wiphy *wiphy, } mgmt->u.auth.auth_alg = cpu_to_le16(auth_alg); - mgmt->u.auth.auth_transaction = trans; - mgmt->u.auth.status_code = status_code; + mgmt->u.auth.auth_transaction = cpu_to_le16(trans); + mgmt->u.auth.status_code = cpu_to_le16(status_code); if (req->ie && req->ie_len) { if (!varptr) @@ -4545,7 +4520,7 @@ mwifiex_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev, if (ret) { priv->auth_flag = 0; - priv->auth_alg = 0xFFFF; + priv->auth_alg = WLAN_AUTH_NONE; eth_zero_addr(priv->cfg_bssid); } @@ -4735,7 +4710,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) "%s: creating new wiphy\n", __func__); return -ENOMEM; } - if (adapter->host_mlme) { + if (adapter->host_mlme_enabled) { mwifiex_cfg80211_ops.auth = mwifiex_cfg80211_authenticate; mwifiex_cfg80211_ops.assoc = mwifiex_cfg80211_associate; mwifiex_cfg80211_ops.deauth = mwifiex_cfg80211_deauthenticate; @@ -4747,7 +4722,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) } wiphy->max_scan_ssids = MWIFIEX_MAX_SSID_LIST_LENGTH; wiphy->max_scan_ie_len = MWIFIEX_MAX_VSIE_LEN; - if (adapter->host_mlme) { + if (adapter->host_mlme_enabled) { mwifiex_mgmt_stypes[NL80211_IFTYPE_AP].tx = 0xffff; mwifiex_mgmt_stypes[NL80211_IFTYPE_AP].rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) | @@ -4807,7 +4782,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) WIPHY_FLAG_NETNS_OK | WIPHY_FLAG_PS_ON_BY_DEFAULT; - if (adapter->host_mlme) + if (adapter->host_mlme_enabled) wiphy->flags |= WIPHY_FLAG_REPORTS_OBSS; else wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME; @@ -4841,7 +4816,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) NL80211_FEATURE_LOW_PRIORITY_SCAN | NL80211_FEATURE_NEED_OBSS_SCAN; - if (adapter->host_mlme) + if (adapter->host_mlme_enabled) wiphy->features |= NL80211_FEATURE_SAE; if (ISSUPP_ADHOC_ENABLED(adapter->fw_cap_info)) diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c index c8d94cc6706f..85429c51c407 100644 --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c @@ -1499,11 +1499,11 @@ int mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv, static void mwifiex_check_key_api_ver(struct mwifiex_adapter *adapter) { - if (adapter->host_mlme) { + if (adapter->host_mlme_enabled) { if (adapter->key_api_major_ver != KEY_API_VER_MAJOR_V2) - adapter->host_mlme = false; + adapter->host_mlme_enabled = false; mwifiex_dbg(adapter, MSG, "host_mlme: %s, key_api: %d\n", - adapter->host_mlme ? "enable" : "disable", + adapter->host_mlme_enabled ? "enable" : "disable", adapter->key_api_major_ver); } } @@ -1617,7 +1617,6 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv, "key_api v%d.%d\n", adapter->key_api_major_ver, adapter->key_api_minor_ver); - mwifiex_check_key_api_ver(adapter); break; case FW_API_VER_ID: adapter->fw_api_ver = @@ -1712,6 +1711,8 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv, if (adapter->fw_api_ver == MWIFIEX_FW_V15) adapter->scan_chan_gap_enabled = true; + mwifiex_check_key_api_ver(adapter); + return 0; } diff --git a/drivers/net/wireless/marvell/mwifiex/decl.h b/drivers/net/wireless/marvell/mwifiex/decl.h index f9b21b13d6c3..be42040822b2 100644 --- a/drivers/net/wireless/marvell/mwifiex/decl.h +++ b/drivers/net/wireless/marvell/mwifiex/decl.h @@ -24,10 +24,24 @@ #define MWIFIEX_RX_HEADROOM 64 #define MAX_TXPD_SZ 32 #define INTF_HDR_ALIGN 4 -/* frmctl + durationid + addr1 + addr2 + addr3 + seqctl + addr4 */ -#define MWIFIEX_MGMT_HEADER_LEN (2 + 2 + 6 + 6 + 6 + 2 + 6) -/* 6 = auth_alg + auth_transaction + auth_status */ -#define MWIFIEX_AUTH_BODY_LEN 6 +#define MWIFIEX_MIN_DATA_HEADER_LEN (MWIFIEX_DMA_ALIGN_SZ + INTF_HDR_ALIGN + \ + MAX_TXPD_SZ) + +#define MWIFIEX_MGMT_FRAME_HEADER_SIZE 8 /* sizeof(pkt_type) + * + sizeof(tx_control) + */ + +#define FRMCTL_LEN 2 +#define DURATION_LEN 2 +#define SEQCTL_LEN 2 +#define MWIFIEX_MGMT_HEADER_LEN (FRMCTL_LEN + FRMCTL_LEN + ETH_ALEN + \ + ETH_ALEN + ETH_ALEN + SEQCTL_LEN + ETH_ALEN) + +#define AUTH_ALG_LEN 2 +#define AUTH_TRANSACTION_LEN 2 +#define AUTH_STATUS_LEN 2 +#define MWIFIEX_AUTH_BODY_LEN (AUTH_ALG_LEN + AUTH_TRANSACTION_LEN + \ + AUTH_STATUS_LEN) #define HOST_MLME_AUTH_PENDING BIT(0) #define HOST_MLME_AUTH_DONE BIT(1) @@ -35,13 +49,10 @@ #define HOST_MLME_MGMT_MASK (BIT(IEEE80211_STYPE_AUTH >> 4) | \ BIT(IEEE80211_STYPE_DEAUTH >> 4) | \ BIT(IEEE80211_STYPE_DISASSOC >> 4)) + #define AUTH_TX_DEFAULT_WAIT_TIME 2400 -#define MWIFIEX_MIN_DATA_HEADER_LEN (MWIFIEX_DMA_ALIGN_SZ + INTF_HDR_ALIGN + \ - MAX_TXPD_SZ) -#define MWIFIEX_MGMT_FRAME_HEADER_SIZE 8 /* sizeof(pkt_type) - * + sizeof(tx_control) - */ +#define WLAN_AUTH_NONE 0xFFFF #define MWIFIEX_MAX_TX_BASTREAM_SUPPORTED 2 #define MWIFIEX_MAX_RX_BASTREAM_SUPPORTED 16 diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h index 699c7ffcd0e5..0f9d860b5d59 100644 --- a/drivers/net/wireless/marvell/mwifiex/fw.h +++ b/drivers/net/wireless/marvell/mwifiex/fw.h @@ -752,6 +752,31 @@ struct uap_rxpd { u8 flags; } __packed; +struct mwifiex_ieee80211_mgmt { + __le16 frame_control; + __le16 duration; + u8 da[ETH_ALEN]; + u8 sa[ETH_ALEN]; + u8 bssid[ETH_ALEN]; + __le16 seq_ctrl; + u8 addr4[ETH_ALEN]; + union { + struct { + __le16 auth_alg; + __le16 auth_transaction; + __le16 status_code; + /* possibly followed by Challenge text */ + u8 variable[]; + } __packed auth; + struct { + __le16 capab_info; + __le16 listen_interval; + /* followed by SSID and Supported rates */ + u8 variable[]; + } __packed assoc_req; + } u; +} __packed; + struct mwifiex_fw_chan_stats { u8 chan_num; u8 bandcfg; diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c index 87121018abc6..a336d45b9677 100644 --- a/drivers/net/wireless/marvell/mwifiex/init.c +++ b/drivers/net/wireless/marvell/mwifiex/init.c @@ -82,7 +82,7 @@ int mwifiex_init_priv(struct mwifiex_private *priv) priv->data_avg_factor = DEFAULT_DATA_AVG_FACTOR; priv->auth_flag = 0; - priv->auth_alg = 0xFFFF; + priv->auth_alg = WLAN_AUTH_NONE; priv->sec_info.wep_enabled = 0; priv->sec_info.authentication_mode = NL80211_AUTHTYPE_OPEN_SYSTEM; diff --git a/drivers/net/wireless/marvell/mwifiex/join.c b/drivers/net/wireless/marvell/mwifiex/join.c index 00720c6840ef..06db8e358c01 100644 --- a/drivers/net/wireless/marvell/mwifiex/join.c +++ b/drivers/net/wireless/marvell/mwifiex/join.c @@ -511,7 +511,7 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv, sizeof(struct mwifiex_chan_scan_param_set); } - if (priv->adapter->host_mlme) { + if (priv->adapter->host_mlme_enabled) { host_mlme_tlv = (struct mwifiex_ie_types_host_mlme *)pos; host_mlme_tlv->header.type = cpu_to_le16(TLV_TYPE_HOST_MLME); host_mlme_tlv->header.len = @@ -672,7 +672,7 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv, goto done; } - if (adapter->host_mlme) { + if (adapter->host_mlme_enabled) { hdr = (struct ieee80211_mgmt *)&resp->params; if (!memcmp(hdr->bssid, priv->attempted_bss_desc->mac_address, @@ -724,7 +724,7 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv, "ASSOC_RESP: UNSPECIFIED failure\n"); } - if (priv->adapter->host_mlme) + if (priv->adapter->host_mlme_enabled) priv->assoc_rsp_size = 0; } else { ret = status_code; @@ -1538,9 +1538,9 @@ int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) if (!priv->media_connected) return 0; - if (priv->adapter->host_mlme) { + if (priv->adapter->host_mlme_enabled) { priv->auth_flag = 0; - priv->auth_alg = 0xFFFF; + priv->auth_alg = WLAN_AUTH_NONE; priv->host_mlme_reg = false; priv->mgmt_frame_mask = 0; if (mwifiex_send_cmd(priv, HostCmd_CMD_MGMT_FRAME_REG, diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h index f0158d217bb8..b5aef4c92b98 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.h +++ b/drivers/net/wireless/marvell/mwifiex/main.h @@ -1010,7 +1010,7 @@ struct mwifiex_adapter { bool is_up; bool ext_scan; - bool host_mlme; + bool host_mlme_enabled; u8 fw_api_ver; u8 key_api_major_ver, key_api_minor_ver; u8 max_p2p_conn, max_sta_conn; diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c index f5039d158f46..e7b488fca52f 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.c +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c @@ -2504,7 +2504,7 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter) adapter->num_mem_types = ARRAY_SIZE(mem_type_mapping_tbl); } - adapter->host_mlme = card->host_mlme; + adapter->host_mlme_enabled = card->host_mlme; return 0; } diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c b/drivers/net/wireless/marvell/mwifiex/sta_event.c index 9c6fac91204c..b5f3821a6a8f 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_event.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c @@ -136,7 +136,7 @@ void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code, priv->media_connected = false; priv->auth_flag = 0; - priv->auth_alg = 0xFFFF; + priv->auth_alg = WLAN_AUTH_NONE; priv->scan_block = false; priv->port_open = false; @@ -225,7 +225,7 @@ void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code, priv->cfg_bssid, reason_code); if (priv->bss_mode == NL80211_IFTYPE_STATION || priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) { - if (adapter->host_mlme && adapter->host_mlme_link_lost) + if (adapter->host_mlme_enabled && adapter->host_mlme_link_lost) mwifiex_host_mlme_disconnect(adapter->priv_link_lost, reason_code, NULL); else @@ -753,7 +753,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) if (priv->media_connected) { reason_code = get_unaligned_le16(adapter->event_body); - if (adapter->host_mlme) { + if (adapter->host_mlme_enabled) { adapter->priv_link_lost = priv; adapter->host_mlme_link_lost = true; queue_work(adapter->host_mlme_workqueue, @@ -1015,10 +1015,10 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) mwifiex_dbg(adapter, EVENT, "event: Remain on channel expired\n"); - if (adapter->host_mlme && + if (adapter->host_mlme_enabled && (priv->auth_flag & HOST_MLME_AUTH_PENDING)) { priv->auth_flag = 0; - priv->auth_alg = 0xFFFF; + priv->auth_alg = WLAN_AUTH_NONE; } else { cfg80211_remain_on_channel_expired(&priv->wdev, priv->roc_cfg.cookie, diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c index 046541713318..23639aacf092 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c @@ -340,7 +340,7 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, ret = mwifiex_associate(priv, bss_desc); } - if (bss && !priv->adapter->host_mlme) + if (bss && !priv->adapter->host_mlme_enabled) cfg80211_put_bss(priv->adapter->wiphy, bss); } else { /* Adhoc mode */ diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c index eb7e39146b8a..e393cc78bb98 100644 --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c @@ -765,7 +765,7 @@ static int mwifiex_cmd_uap_bss_start(struct mwifiex_private *priv, cmd->command = cpu_to_le16(HostCmd_CMD_UAP_BSS_START); cmd->size = S_DS_GEN; - if (priv->adapter->host_mlme) { + if (priv->adapter->host_mlme_enabled) { tlv = (struct mwifiex_ie_types_host_mlme *)((u8 *)cmd + cmd->size); tlv->header.type = cpu_to_le16(TLV_TYPE_HOST_MLME); tlv->header.len = cpu_to_le16(sizeof(tlv->host_mlme)); diff --git a/drivers/net/wireless/marvell/mwifiex/util.c b/drivers/net/wireless/marvell/mwifiex/util.c index 9e36bb4a8d67..c0614c246b5f 100644 --- a/drivers/net/wireless/marvell/mwifiex/util.c +++ b/drivers/net/wireless/marvell/mwifiex/util.c @@ -392,7 +392,7 @@ void mwifiex_host_mlme_disconnect(struct mwifiex_private *priv, ETH_ALEN); memcpy(mgmt->bssid, priv->cfg_bssid, ETH_ALEN); priv->auth_flag = 0; - priv->auth_alg = 0xFFFF; + priv->auth_alg = WLAN_AUTH_NONE; } else { memcpy(mgmt->da, priv->curr_addr, ETH_ALEN); memcpy(mgmt->sa, sa, ETH_ALEN); @@ -486,7 +486,7 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv, "auth: receive deauth from %pM\n", ieee_hdr->addr3); priv->auth_flag = 0; - priv->auth_alg = 0xFFFF; + priv->auth_alg = WLAN_AUTH_NONE; } else { mwifiex_dbg(priv->adapter, MSG, "assoc: receive disasso from %pM\n", @@ -497,7 +497,7 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv, cfg80211_rx_mlme_mgmt(priv->netdev, skb->data, pkt_len); } - if (priv->adapter->host_mlme && + if (priv->adapter->host_mlme_enabled && (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP)) { if (ieee80211_is_auth(ieee_hdr->frame_control)) mwifiex_dbg(priv->adapter, MSG, From patchwork Tue Nov 28 08:31:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lin X-Patchwork-Id: 748485 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="FK9vWYGN" Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2050.outbound.protection.outlook.com [40.107.22.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70C47D56; Tue, 28 Nov 2023 00:33:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IY6Jk1ZmfyMEfLCLEOg/fS2ky/j1LvAFSsd9NFFk1lDRxXbxhARAG8Qo4rqVXQlcutv7doBqinpLim/RWj6tJnaEVeVoatKsNCrNMJmKS1IE9w1RQvuBIa8gtXrQUtS2XRkyLWB4CAp8dRGvihAC4YE13mD86hfYhQd4U86LEEIj7gtz6q3Ve3NA+AuQrvm6ZRfitJq+9dnjlRk5RgW4p2B+hpw5oIH4tEbAvXku9THUWSGIif/Jwy95FW/RkVdbeChn5/ApHhLQ9RB0EjqQW3f3QdPV4APKLLGkr3FpQdTiiJiLshjX/AWolEc6G2+ePZOXmGn5mtl710OzhGJTqA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ObAhNAFRkqzLbzmid5PnkGoNqrKaVeHOcSzklM/w//0=; b=Hl6Utxmq09n0klo9VlW8+MFXrquVs3HV5qKjv3y40coPqNQzdo41M3atzj32hRdWeAkHlwNc6BYPvEz4HjuMWfXEvY68z0AwnG+i/6KfsmlfC3Azb5OmmwsXU5zTAAYLErux96v/3LnbDET9nxouGklg3vpkg6lmlORp8V5KX3IAPEwFwckT6175QYseibRX/SR9KEpKafSb+MKn1VN/ELdIvpV8WljyM82vMY/HKxFtw3d/tjdB9x0F7/rLzOVEsqvDu+mGYksN1B1Z96avNSJ7TDkR1xgXjZd29aRxya3/FL7ikObz3FpGj6tjSJRpijiJnMveanNP91ZCHHQKoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ObAhNAFRkqzLbzmid5PnkGoNqrKaVeHOcSzklM/w//0=; b=FK9vWYGNAVJ8ppOUwHVlmKqDr5lYCb00Pg4vdlXs6Dmh9xKYdUkQcgKMm9J0HqhvJ81C9xq6/OLTqTRuKOaFyYnuF3BuBnh64n7GjndhHjXXoTl4PeiVTfyoddqqXccUaeQhXHTd5BxX8l198peWsKA8P+SGFkrzivy7ElDlJZU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) by PAXPR04MB8653.eurprd04.prod.outlook.com (2603:10a6:102:21c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.22; Tue, 28 Nov 2023 08:32:19 +0000 Received: from PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b]) by PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::34dd:289e:9e8b:9c9b%7]) with mapi id 15.20.7046.015; Tue, 28 Nov 2023 08:32:19 +0000 From: David Lin To: linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, briannorris@chromium.org, kvalo@kernel.org, francesco@dolcini.it, tsung-hsien.hsieh@nxp.com, David Lin Subject: [PATCH v7 12/12] wifi: mwifiex: fixed compile and coding errors. Date: Tue, 28 Nov 2023 16:31:15 +0800 Message-Id: <20231128083115.613235-13-yu-hao.lin@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231128083115.613235-1-yu-hao.lin@nxp.com> References: <20231128083115.613235-1-yu-hao.lin@nxp.com> X-ClientProxiedBy: TYCP286CA0019.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::13) To PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9638:EE_|PAXPR04MB8653:EE_ X-MS-Office365-Filtering-Correlation-Id: 2af1c722-dedb-4648-3ab6-08dbefec88c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hASxrlyd+LzoqYZz84iCzm5fqsDmHiLpgCAN7px9J+IWS6btGK+1gBF3twyxWn3DHST57Q2ZtNOUeeSLov+ISg8O6cEzcdrDzrk6HJboJc0AnbdVqDRcCiJzLk3CVLm7MwNr+MNbPkH/HL8cEs98agbls5t3LfACt4qwaU2+KumbnCShCvKoTbjqZ3k/r6rU68PEBZUjnUwkynaqUiRF5k66xHQfjcgznyIjii6LhZczd5+FQfFHkEZAAC3mNwRUzFkyLquCrsGCdHx5X/dC2UNya6OWut8/4ZDTrh4ohcQ90HMncd1yzi2j4S34s+HGTSuPbYcqYDIAY6uTnFXNHzExfNvyKOiO2uukelh78WPsbu8EbMrCcje/94lxUN3H3G8HKpXCHHhUvOsSfUluUswvi6T6qXYeUvBvTRJzAmLx4GqeM4Hx/yDOJeDmU0od/t2Xcmb+rOZ+HMUhZeqg6vhItUhjL28HOTk7i/UX3LXj/op2CTPzZtEmW6o4PqBwaAXudsQAUbpR9MrGXNxzY8sB4w4/xVV8NoT0PC4gBkJlqtovfgPE+HLsm348XRs/ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(136003)(396003)(366004)(376002)(39860400002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(83380400001)(66946007)(478600001)(6512007)(52116002)(6486002)(86362001)(66556008)(6666004)(66476007)(6916009)(316002)(8676002)(4326008)(8936002)(6506007)(1076003)(2616005)(5660300002)(38100700002)(41300700001)(2906002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Cf7K+EW/tfsGMPSr8dZfjELNhX3zMo8tluMWpl2bw8+2/MUy7FIBsuenhVt5FPnUleE11CsXiWi/+MADnhk4vQSzHTx9q9CL8EJFM429Vbheh4kc4ha/8KD6dymu9Q8YUOFP5Z2cukNwupE/MchAjBRAQHG3WLpG3413YLYr3nh9/tk6GXVI3p1lqTDKFS1fJX8lTALZTFVFHodYfLHgfuEKU3TUmZ5q2I7QC4u4F29D2+8LcTkD8H2HelCyJxyzu7EV8cQDzOkksojMQlEMyOGerTRryCyagaWvQC43O4J8/uexlgnODWQjGbowVnj14yiAx1yUQcWU06tDhvQLTt8bzGN6liKIbSUb5hNbVeMpn2hVUiG5lulh8fqyA0T9Pah9lB91VmYnHzY4BKuz1cW/y4Z8CSoGTZZaNgqFD46kh+7aKdZCWlKWcucNM2avT8qpHr6Q7ftHSawInTJejuF0XgRWojtYOEeUPZFGXLv0qCpC2eyohE+t4V4YgP7i5SkQVKUYnlJYbOzwcL9PiW1HDVL+vcrdbb0ACby8D9kTz7WQbhwj7KmhPFC04dgYjujsJHbIrMWDPjiDrPdGk4D3TA8CcXdgZybuxJ0It90Gb4q5G4vTR1QmrcHep6+fx2RytWpBxRDGtzHelV+Tz8CmepCRFNEX4gPqaI90ke0NprxGnl3nDR/Fjdy0RVfEkARnXzTlsCpYm9pmfVjvsxOPCqvFheG8QMb25yqrzMFBh8QpuPYWehHa1/w3ilj6RPsNCFH3C94n1e7N9hNpLH+nGnYKN+5SyT8j6uYUkgMums3tavYVMKipZrlEspLTOfTCBkBJAZJssDY8BmLG2hl/h+H/GhUKjng1T3rDGyHZ+rm4urhqmK0ofozi7ZNVg67PPBcxf1x1F3Uc0pp2hBYRimuX0HcoLGb0nJcsftl2l9hQ0zCMcZ7WMsI5/4iCilQtEpXsRbNfW6coOhHDuAUszzDaroYKjVp6LIeouAZfpftkJn1D3lbygbLEtNIEkcvfy1bn026e2Ck0Lst3yMRPo0e7gvrFOtIVrE7hnSMS92ICrTg/QXXef461Tv5j2iBtvuZlCCMB48xHXJo+XxvH1sdJlas5tK+fMQFAV3nptkQIwD4ZWV2xyiTyesNML5mUXQkD1bFB4EWQl0TEmpgKXasslViaFpTk5tcYN1o4zb5rOqKNHbeqvYqtoDGJ5X4RcVJK/XzRw08dtyUuWF5rHxwioz+t14gA5kmvS9N5Vg9n1AEUZeJUG+ytRhY0irPruCSjqwtEoKToKdAfDb6NBGOqhK1+vSYuPcw/xCXAMRfHUHl9zKnsj53fXspmRLun1oKQgR3sRFtWqJKlIMgT80DwmOelbAQJis7yQt5bUqaQmAfW1dfEMXukXEli5Xy6VRNvELd7gmXRPjve+Ji7hUdPzWAqNsbEvehcM3+yOraqLXx2ZjCTystMWA7B8oaZBM6Mvopl3we+HGMfWID6CRWRfyCBUY5pddxf/2GsUZF5OL9iUlKjdoRd0qbOWjF9If387tk5YKEFMAPsMRBgVCIUv+laoIGnb7Ynz0sNoX7uqOXv4qYDCuLgE4oBCFEUqDhmx5HTSD0bD1JR01zU50ixl112P6hBqMUg6r07gjpdnt9Uztgp+4VvjhPG X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2af1c722-dedb-4648-3ab6-08dbefec88c5 X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 08:32:19.0469 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WWRZ8g3Q1+//D88s8ADndv0yU+ooglnaQUvRBVcqkrK+gZzessVAmZ9253tMMNazNxhmEKld5rte6jFWZUxl/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8653 1. struct cfg80211_rx_assoc_resp -> struct cfg80211_rx_assoc_resp_data. 2. Pointer should be used for memcpy. Signed-off-by: David Lin --- drivers/net/wireless/marvell/mwifiex/cmdevt.c | 2 +- drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c index 85429c51c407..63246cdfed65 100644 --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c @@ -928,7 +928,7 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter) void mwifiex_process_assoc_resp(struct mwifiex_adapter *adapter) { - struct cfg80211_rx_assoc_resp assoc_resp = { + struct cfg80211_rx_assoc_resp_data assoc_resp = { .uapsd_queues = -1, }; struct mwifiex_private *priv = diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c index e393cc78bb98..1ed3ba6aaefe 100644 --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c @@ -910,7 +910,7 @@ static int mwifiex_cmd_uap_add_station(struct mwifiex_private *priv, tlv->header.type = cpu_to_le16(WLAN_EID_OPMODE_NOTIF); tlv_len = sizeof(u8); tlv->header.len = cpu_to_le16(tlv_len); - memcpy(tlv->data, params->link_sta_params.opmode_notif, + memcpy(tlv->data, ¶ms->link_sta_params.opmode_notif, tlv_len); pos += (header_len + tlv_len); cmd->size += (header_len + tlv_len);