Skip to content

Commit fc99dd0

Browse files
Avinash Patillinvjw
authored andcommitted
mwifiex: do not process broadcast mac address for del_sta
Generally broadcast mac address deauth is followed by stop_ap or start_ap. In both cases, FW already has provision to send deauth; so there is no need to handle broadcast mac deauthentication. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent c11fb98 commit fc99dd0

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

drivers/net/wireless/mwifiex/cfg80211.c

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,31 +1296,30 @@ mwifiex_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev,
12961296
{
12971297
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
12981298
struct mwifiex_sta_node *sta_node;
1299+
u8 deauth_mac[ETH_ALEN];
12991300
unsigned long flags;
13001301

13011302
if (list_empty(&priv->sta_list) || !priv->bss_started)
13021303
return 0;
13031304

1304-
if (!params->mac || is_broadcast_ether_addr(params->mac)) {
1305-
wiphy_dbg(wiphy, "%s: NULL/broadcast mac address\n", __func__);
1306-
list_for_each_entry(sta_node, &priv->sta_list, list) {
1307-
if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_STA_DEAUTH,
1308-
HostCmd_ACT_GEN_SET, 0,
1309-
sta_node->mac_addr, true))
1310-
return -1;
1311-
}
1312-
} else {
1313-
wiphy_dbg(wiphy, "%s: mac address %pM\n", __func__,
1314-
params->mac);
1315-
spin_lock_irqsave(&priv->sta_list_spinlock, flags);
1316-
sta_node = mwifiex_get_sta_entry(priv, params->mac);
1317-
spin_unlock_irqrestore(&priv->sta_list_spinlock, flags);
1318-
if (sta_node) {
1319-
if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_STA_DEAUTH,
1320-
HostCmd_ACT_GEN_SET, 0,
1321-
sta_node->mac_addr, true))
1322-
return -1;
1323-
}
1305+
if (!params->mac || is_broadcast_ether_addr(params->mac))
1306+
return 0;
1307+
1308+
wiphy_dbg(wiphy, "%s: mac address %pM\n", __func__, params->mac);
1309+
1310+
memset(deauth_mac, 0, ETH_ALEN);
1311+
1312+
spin_lock_irqsave(&priv->sta_list_spinlock, flags);
1313+
sta_node = mwifiex_get_sta_entry(priv, params->mac);
1314+
if (sta_node)
1315+
ether_addr_copy(deauth_mac, params->mac);
1316+
spin_unlock_irqrestore(&priv->sta_list_spinlock, flags);
1317+
1318+
if (is_valid_ether_addr(deauth_mac)) {
1319+
if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_STA_DEAUTH,
1320+
HostCmd_ACT_GEN_SET, 0,
1321+
deauth_mac, true))
1322+
return -1;
13241323
}
13251324

13261325
return 0;

0 commit comments

Comments
 (0)