Skip to content

Commit f0dd488

Browse files
nxptestKalle Valo
authored andcommitted
wifi: mwifiex: configure BSSID consistently when starting AP
AP BSSID configuration is missing at AP start. Without this fix, FW returns STA interface MAC address after first init. When hostapd restarts, it gets MAC address from netdev before driver sets STA MAC to netdev again. Now MAC address between hostapd and net interface are different causes STA cannot connect to AP. After that MAC address of uap0 mlan0 become the same. And issue disappears after following hostapd restart (another issue is AP/STA MAC address become the same). This patch fixes the issue cleanly. Signed-off-by: David Lin <[email protected]> Fixes: 12190c5 ("mwifiex: add cfg80211 start_ap and stop_ap handlers") Cc: [email protected] Reviewed-by: Francesco Dolcini <[email protected]> Tested-by: Rafael Beims <[email protected]> # Verdin iMX8MP/SD8997 SD Acked-by: Brian Norris <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://msgid.link/[email protected]
1 parent 1c5d463 commit f0dd488

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

drivers/net/wireless/marvell/mwifiex/cfg80211.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,6 +2047,8 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
20472047

20482048
mwifiex_set_sys_config_invalid_data(bss_cfg);
20492049

2050+
memcpy(bss_cfg->mac_addr, priv->curr_addr, ETH_ALEN);
2051+
20502052
if (params->beacon_interval)
20512053
bss_cfg->beacon_period = params->beacon_interval;
20522054
if (params->dtim_period)

drivers/net/wireless/marvell/mwifiex/fw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
165165
#define TLV_TYPE_STA_MAC_ADDR (PROPRIETARY_TLV_BASE_ID + 32)
166166
#define TLV_TYPE_BSSID (PROPRIETARY_TLV_BASE_ID + 35)
167167
#define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
168+
#define TLV_TYPE_UAP_MAC_ADDRESS (PROPRIETARY_TLV_BASE_ID + 43)
168169
#define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44)
169170
#define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45)
170171
#define TLV_TYPE_UAP_BCAST_SSID (PROPRIETARY_TLV_BASE_ID + 48)

drivers/net/wireless/marvell/mwifiex/ioctl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ struct mwifiex_uap_bss_param {
107107
u8 qos_info;
108108
u8 power_constraint;
109109
struct mwifiex_types_wmm_info wmm_info;
110+
u8 mac_addr[ETH_ALEN];
110111
};
111112

112113
enum {

drivers/net/wireless/marvell/mwifiex/uap_cmd.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ void mwifiex_config_uap_11d(struct mwifiex_private *priv,
468468
static int
469469
mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size)
470470
{
471+
struct host_cmd_tlv_mac_addr *mac_tlv;
471472
struct host_cmd_tlv_dtim_period *dtim_period;
472473
struct host_cmd_tlv_beacon_period *beacon_period;
473474
struct host_cmd_tlv_ssid *ssid;
@@ -487,6 +488,13 @@ mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size)
487488
int i;
488489
u16 cmd_size = *param_size;
489490

491+
mac_tlv = (struct host_cmd_tlv_mac_addr *)tlv;
492+
mac_tlv->header.type = cpu_to_le16(TLV_TYPE_UAP_MAC_ADDRESS);
493+
mac_tlv->header.len = cpu_to_le16(ETH_ALEN);
494+
memcpy(mac_tlv->mac_addr, bss_cfg->mac_addr, ETH_ALEN);
495+
cmd_size += sizeof(struct host_cmd_tlv_mac_addr);
496+
tlv += sizeof(struct host_cmd_tlv_mac_addr);
497+
490498
if (bss_cfg->ssid.ssid_len) {
491499
ssid = (struct host_cmd_tlv_ssid *)tlv;
492500
ssid->header.type = cpu_to_le16(TLV_TYPE_UAP_SSID);

0 commit comments

Comments
 (0)