Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc99dd08 authored by Avinash Patil's avatar Avinash Patil Committed by John W. Linville
Browse files

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: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarCathy Luo <cluo@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c11fb985
Loading
Loading
Loading
Loading
+19 −20
Original line number Diff line number Diff line
@@ -1296,32 +1296,31 @@ mwifiex_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev,
{
	struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
	struct mwifiex_sta_node *sta_node;
	u8 deauth_mac[ETH_ALEN];
	unsigned long flags;

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

	if (!params->mac || is_broadcast_ether_addr(params->mac)) {
		wiphy_dbg(wiphy, "%s: NULL/broadcast mac address\n", __func__);
		list_for_each_entry(sta_node, &priv->sta_list, list) {
			if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_STA_DEAUTH,
					     HostCmd_ACT_GEN_SET, 0,
					     sta_node->mac_addr, true))
				return -1;
		}
	} else {
		wiphy_dbg(wiphy, "%s: mac address %pM\n", __func__,
			  params->mac);
	if (!params->mac || is_broadcast_ether_addr(params->mac))
		return 0;

	wiphy_dbg(wiphy, "%s: mac address %pM\n", __func__, params->mac);

	memset(deauth_mac, 0, ETH_ALEN);

	spin_lock_irqsave(&priv->sta_list_spinlock, flags);
	sta_node = mwifiex_get_sta_entry(priv, params->mac);
	if (sta_node)
		ether_addr_copy(deauth_mac, params->mac);
	spin_unlock_irqrestore(&priv->sta_list_spinlock, flags);
		if (sta_node) {

	if (is_valid_ether_addr(deauth_mac)) {
		if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_STA_DEAUTH,
				     HostCmd_ACT_GEN_SET, 0,
					     sta_node->mac_addr, true))
				     deauth_mac, true))
			return -1;
	}
	}

	return 0;
}