From patchwork Fri Oct 20 03:49: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: 13430040 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47AD3C001DF for ; Fri, 20 Oct 2023 03:49:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347005AbjJTDt3 (ORCPT ); Thu, 19 Oct 2023 23:49:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376308AbjJTDtV (ORCPT ); Thu, 19 Oct 2023 23:49:21 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2075.outbound.protection.outlook.com [40.107.15.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AC6910CF; Thu, 19 Oct 2023 20:49:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WTAdg+XgK5DLroIa2oAvmZ7aPy0nvRC6FthqyZ+a3a1G3SCzzcOvMBnsgUMKoGNu/tvOiKc+WDuVgS9GtfGgbtE/HORFqWNzP78DqHd2hFP9qh58jE9zrhP6EOrfnfzNtr7e1QYFVsrmSQRdwkmEF/LkdrXXoUCtpk3sfLB//yC833yKTRue3Av+HRAaYa4J4CPgmij4LMDEVAW7F71QqTUCKIsxG5XuTtgAOuDgpy9lutXQkpcC1ovyTBMTc2i9iVXIllXZO493yelbUHJ8YRDtT181C3TVm0dyA9mYJ6Rb3kj/38whMU3HZmGybI5uPGg1KD9pYIUkr1b2ZaIniA== 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=tfNYCrQm/wK2XnczQIVZkD5iyQbQTHVwNb/d7iSrOvE=; b=oOr3dmFWHW53k8XIbzOVDzq4vT9OQ+NJMRsT7lEzGFV/WmYE0/rtTfC5QS+OAAPqlnkVQ1mVVNu7FweJHzp8tCmFgl/Aj9OGTBitm1/AxUUi9Kx9byxDDLp8jx/eViFXeQmJzVoCytYhcWs87kJgUULtRuJr0n/dSFm9sTkQWjE8jrDekJ4jJYLA1EPFTGD8pP08VpRttbkbarabfAnlMe76pAE9fIzp8GMqhhTZPcwhDLz+FpDVhOFapQseh0reJijHf2GCGvpxEfAosCfaC7w/DZWBhDkrG4NTYcaiYXmzrPzb0Yo+cDMdIALWgSoy91TlXYFg+mZ89KSSOAcFAA== 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=tfNYCrQm/wK2XnczQIVZkD5iyQbQTHVwNb/d7iSrOvE=; b=LlcjMbyadq5QsqozzjGSzamIiorA4gF+Rdy8lPaMkTDrqVlfWvLOAzhiYHZi0uxhuZupNOCf7lFUTFuIqo11sUcWHDI2/MThyUMfkGpLy+j8mzV0xsj274vlYn4ktfy2XqidaMcXl2eQs2yIo/ZMLySwD60y83Nz/yyeNEGNFXk= Received: from PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) by VI1PR04MB7069.eurprd04.prod.outlook.com (2603:10a6:800:127::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.11; Fri, 20 Oct 2023 03:49: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.6933.011; Fri, 20 Oct 2023 03:49: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" , Sharvari Harisangam , David Lin , Pete Hsieh Subject: [PATCH v6 6/6] wifi: mwifiex: added mac address for AP config. Thread-Topic: [PATCH v6 6/6] wifi: mwifiex: added mac address for AP config. Thread-Index: AdoDCGMYrPaKM3X4QW2qaT7OzNDnMw== Date: Fri, 20 Oct 2023 03:49:13 +0000 Message-ID: Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PA4PR04MB9638:EE_|VI1PR04MB7069:EE_ x-ms-office365-filtering-correlation-id: 9ce86412-14c7-4a9b-b57c-08dbd11f86a8 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: j++zEnhkMaZltlSVpYc0QQdpp8uj/Ko6l3b57ZRAEglEZQ+86hoWPcjwQSxtt5fFnfkDhyA5mgZTzVa+JFL5MlS+SGQpYLzfvZXo77R2hQh9ZoihxEw77k9MV0E7yxGBg2sUCEXq0o10bTjhFI+Q8O4s+LVmW3gURzxV/h9VDRAW56ErXikyhgCmyYQTNCgs+cGnfCEKCFD8WZ/qe7ekp3jHyBy5MG9GSeIeeWExIhaB1QvQt8SPp9DZCqXHie7HZQ/7JRhre78c8bZrr8V8EETqq4yNOVxE8lJeSPWDb8IIn12arTcWUjrVYIS624PntPqDszQQzRXZXOrhaDSJGy713egnJE3Ive57NWDZYwFJaPzNo+bs5Z72D3JOhtixae+Zm5AgQ44ZLwPO60wflCVeUtDMkex0MxdKqXbsuqzmXpauiITX+484ACS08J3aKsM54gUFGXw7Tjf99GZ0WwTzZYFezQBx/XpeKjx4McdvJh/hryW3/AT1l6inPj0iEJEhtEQS9rl6bVHP85qFGYyeppl6HI4q1qG67DYLa2IOxJ+gtcquz1RCE7TOHA5EcQ2BisjIRuOy+QgEfj0q3LFUBMKkciHtIrDgUwFpHeyrzLp7N0X62NHIBjwFi4UM 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)(396003)(136003)(376002)(39860400002)(346002)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(55016003)(38100700002)(66899024)(41300700001)(4326008)(5660300002)(8676002)(8936002)(52536014)(86362001)(33656002)(2906002)(122000001)(478600001)(9686003)(7696005)(26005)(71200400001)(6506007)(316002)(38070700009)(66946007)(76116006)(54906003)(66476007)(6916009)(66446008)(64756008)(66556008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: rX9R94XQO3pukemvqQe/lUSdldg8344a5P+GPa7pkLpBXbTsyUlIlytb20rD8+2I7RZ7ldHois1v25eFku7yUA2xNmXhyX6G9OrP7xcE3VeL1r4F7CaT80hFg7rO9H4WXG2L8QlsZfLtn2O1CfW7+0ShruQK/LCP9p9K3Egkq9Y/WzuUZf+lvZKIOTFT9fPyHDpS8sjIwggZG/+QphaIIyQPnDGNgzbZG+nnISUeXjDKH0AgX0dFOlG4iwnyI5TEGVXszSKfTLW9fByPssX23QdcPOUPqFLgOQ1/tuao/jBsmShtZM4IF34WUOxlqA0PrT6h32ZyumNLppy0TIfCwF2STmvkb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45t12E3roE5djeos1tmfQZlpntMUFqc8E7EIaPCVuns7tQmtkBHrQiDM4U/z7Nv4fWJkON/QgPzbaIcKRtKQxTEq73Rux1x9Wk84UVL4wD9AIyGiCg9gBELiy35Doau5w/9czKWncFZ7/d2nhAZ0ki2Er0viieqVmvJZRJmbv/kZ46+Pd MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ce86412-14c7-4a9b-b57c-08dbd11f86a8 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Oct 2023 03:49:13.6182 (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: s1v0RSa9PoCLBtfwNxP1ouPtv2StqwdZH9XF/rnLA5YO2V+D66SuwVBmHb5uV+tJl9mYaQfUpsqQ02urOyG1Tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7069 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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);