mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Lin <yu-hao.lin@nxp.com>
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 <yu-hao.lin@nxp.com>
Subject: [PATCH v7 06/12] wifi: mwifiex: added mac address for AP config.
Date: Tue, 28 Nov 2023 16:31:09 +0800	[thread overview]
Message-ID: <20231128083115.613235-7-yu-hao.lin@nxp.com> (raw)
In-Reply-To: <20231128083115.613235-1-yu-hao.lin@nxp.com>

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 <yu-hao.lin@nxp.com>
---
 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);
-- 
2.25.1


  parent reply	other threads:[~2023-11-28  8:32 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
2023-11-28  8:31 ` [PATCH v7 01/12] " David Lin
2023-11-28 22:51   ` kernel test robot
2023-11-28  8:31 ` [PATCH v7 02/12] wifi: mwifiex: fixed group rekey issue for WPA3 David Lin
2023-12-01 10:15   ` Francesco Dolcini
2023-12-01 15:05     ` Jeff Johnson
2023-12-01 23:18       ` [EXT] " David Lin
2023-12-01 22:41     ` David Lin
2023-11-28  8:31 ` [PATCH v7 03/12] wifi: mwifiex: fixed reassocation " David Lin
2023-12-01 10:17   ` Francesco Dolcini
2023-12-01 22:44     ` [EXT] " David Lin
2023-11-28  8:31 ` [PATCH v7 04/12] wifi: mwifiex: fixed missing WMM IE for assoc req David Lin
2023-12-01 10:18   ` Francesco Dolcini
2023-12-01 22:47     ` [EXT] " David Lin
2023-12-14  2:16       ` Brian Norris
2023-12-14  2:20         ` David Lin
2023-11-28  8:31 ` [PATCH v7 05/12] wifi: mwifiex: supported host mlme for AP mode David Lin
2023-11-28  8:31 ` David Lin [this message]
2023-12-01 10:31   ` [PATCH v7 06/12] wifi: mwifiex: added mac address for AP config Francesco Dolcini
2023-12-01 22:50     ` [EXT] " David Lin
2023-12-03 16:13       ` Jeff Johnson
2023-12-04  1:56         ` David Lin
2023-11-28  8:31 ` [PATCH v7 07/12] wifi: mwifiex: fixed TLV error for station add cmd David Lin
2023-12-01 10:36   ` Francesco Dolcini
2023-12-01 22:52     ` [EXT] " David Lin
2023-11-28  8:31 ` [PATCH v7 08/12] wifi: mwifiex: fixed the way to handle assoc timeout David Lin
2023-12-01 10:37   ` Francesco Dolcini
2023-11-28  8:31 ` [PATCH v7 09/12] wifi: mwifiex: fixed the way to handle link lost David Lin
2023-12-01 10:38   ` Francesco Dolcini
2023-11-28  8:31 ` [PATCH v7 10/12] wifi: mwifiex: fixed AP issue without host mlme David Lin
2023-12-01 10:39   ` Francesco Dolcini
2023-11-28  8:31 ` [PATCH v7 11/12] wifi: mwifiex: misc modifications for review comments David Lin
2023-12-01 10:40   ` Francesco Dolcini
2023-11-28  8:31 ` [PATCH v7 12/12] wifi: mwifiex: fixed compile and coding errors David Lin
2023-12-01 10:43   ` Francesco Dolcini
2023-12-01 11:49 ` [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme Francesco Dolcini
2023-12-01 12:25   ` Kalle Valo
2023-12-01 23:12     ` [EXT] " David Lin
2023-12-01 23:05   ` David Lin
2023-12-05 19:46     ` Francesco Dolcini
2023-12-06  1:49       ` David Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231128083115.613235-7-yu-hao.lin@nxp.com \
    --to=yu-hao.lin@nxp.com \
    --cc=briannorris@chromium.org \
    --cc=francesco@dolcini.it \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=tsung-hsien.hsieh@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®