diff mbox series

[v7,06/12] wifi: mwifiex: added mac address for AP config.

Message ID 20231128083115.613235-7-yu-hao.lin@nxp.com
State New
Headers show
Series wifi: mwifiex: added code to support host mlme. | expand

Commit Message

David Lin Nov. 28, 2023, 8:31 a.m. UTC
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(+)

Comments

Francesco Dolcini Dec. 1, 2023, 10:31 a.m. UTC | #1
On Tue, Nov 28, 2023 at 04:31:09PM +0800, David Lin wrote:
> 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.

Do I understand correctly this is a fix for an existing issue that has
nothing to do with the HOST MLE topic?

If so, that great to have this fixed (and it looks like something I am
affected by, I will try it in the coming days), but it should be:
 - separate patch from this series
 - fixes tag 
 - cc stable

Francesco
David Lin Dec. 1, 2023, 10:50 p.m. UTC | #2
> From: Francesco Dolcini <francesco@dolcini.it>
> Sent: Friday, December 1, 2023 6:31 PM
> To: David Lin <yu-hao.lin@nxp.com>
> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> briannorris@chromium.org; kvalo@kernel.org; francesco@dolcini.it; Pete
> Hsieh <tsung-hsien.hsieh@nxp.com>
> Subject: [EXT] Re: [PATCH v7 06/12] wifi: mwifiex: added mac address for AP
> config.
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
> 
> 
> On Tue, Nov 28, 2023 at 04:31:09PM +0800, David Lin wrote:
> > 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.
> 
> Do I understand correctly this is a fix for an existing issue that has nothing
> to do with the HOST MLE topic?
> 

Yes.

> If so, that great to have this fixed (and it looks like something I am affected
> by, I will try it in the coming days), but it should be:
>  - separate patch from this series
>  - fixes tag
>  - cc stable
> 

I will sperate this patch from Patch v8 and let it as a single patch.

- fixes tag
- cc stable

I don't understand what does this mean?

> Francesco
>
Jeff Johnson Dec. 3, 2023, 4:13 p.m. UTC | #3
On 12/1/2023 2:50 PM, David Lin wrote:
> - fixes tag
> - cc stable
> 
> I don't understand what does this mean?

<https://www.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes>

<https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1>
diff mbox series

Patch

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);