Commit 4481b2db authored by Stone Piao's avatar Stone Piao Committed by John W. Linville

mwifiex: skip registering mgmt frame that has already registered

Before sending command to firmware, we need to check the frame type.
We skip registering the mgmt frame that has already been registered.
Signed-off-by: default avatarStone Piao <piaoyun@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent eaf49dbc
...@@ -240,16 +240,20 @@ mwifiex_cfg80211_mgmt_frame_register(struct wiphy *wiphy, ...@@ -240,16 +240,20 @@ mwifiex_cfg80211_mgmt_frame_register(struct wiphy *wiphy,
u16 frame_type, bool reg) u16 frame_type, bool reg)
{ {
struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev); struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev);
u32 mask;
if (reg) if (reg)
priv->mgmt_frame_mask |= BIT(frame_type >> 4); mask = priv->mgmt_frame_mask | BIT(frame_type >> 4);
else else
priv->mgmt_frame_mask &= ~BIT(frame_type >> 4); mask = priv->mgmt_frame_mask & ~BIT(frame_type >> 4);
mwifiex_send_cmd_async(priv, HostCmd_CMD_MGMT_FRAME_REG, if (mask != priv->mgmt_frame_mask) {
HostCmd_ACT_GEN_SET, 0, &priv->mgmt_frame_mask); priv->mgmt_frame_mask = mask;
mwifiex_send_cmd_async(priv, HostCmd_CMD_MGMT_FRAME_REG,
wiphy_dbg(wiphy, "info: mgmt frame registered\n"); HostCmd_ACT_GEN_SET, 0,
&priv->mgmt_frame_mask);
wiphy_dbg(wiphy, "info: mgmt frame registered\n");
}
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment