Skip to content

Commit 3cec687

Browse files
Stone Piaolinvjw
authored andcommitted
mwifiex: implement cfg80211 mgmt_frame_register handler
Add a new command to implement mgmt_frame_register. Signed-off-by: Stone Piao <piaoyun@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 83719be commit 3cec687

File tree

5 files changed

+40
-0
lines changed

5 files changed

+40
-0
lines changed

drivers/net/wireless/mwifiex/cfg80211.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,27 @@ mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
226226
return 0;
227227
}
228228

229+
/*
230+
* CFG802.11 operation handler to register a mgmt frame.
231+
*/
232+
static void
233+
mwifiex_cfg80211_mgmt_frame_register(struct wiphy *wiphy,
234+
struct wireless_dev *wdev,
235+
u16 frame_type, bool reg)
236+
{
237+
struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev);
238+
239+
if (reg)
240+
priv->mgmt_frame_mask |= BIT(frame_type >> 4);
241+
else
242+
priv->mgmt_frame_mask &= ~BIT(frame_type >> 4);
243+
244+
mwifiex_send_cmd_async(priv, HostCmd_CMD_MGMT_FRAME_REG,
245+
HostCmd_ACT_GEN_SET, 0, &priv->mgmt_frame_mask);
246+
247+
wiphy_dbg(wiphy, "info: mgmt frame registered\n");
248+
}
249+
229250
/*
230251
* CFG802.11 operation handler to set Tx power.
231252
*/
@@ -1928,6 +1949,7 @@ static struct cfg80211_ops mwifiex_cfg80211_ops = {
19281949
.add_key = mwifiex_cfg80211_add_key,
19291950
.del_key = mwifiex_cfg80211_del_key,
19301951
.mgmt_tx = mwifiex_cfg80211_mgmt_tx,
1952+
.mgmt_frame_register = mwifiex_cfg80211_mgmt_frame_register,
19311953
.set_default_key = mwifiex_cfg80211_set_default_key,
19321954
.set_power_mgmt = mwifiex_cfg80211_set_power_mgmt,
19331955
.set_tx_power = mwifiex_cfg80211_set_tx_power,

drivers/net/wireless/mwifiex/fw.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
263263
#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
264264
#define HostCmd_CMD_SET_BSS_MODE 0x00f7
265265
#define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
266+
#define HostCmd_CMD_MGMT_FRAME_REG 0x010c
266267

267268
#define PROTOCOL_NO_SECURITY 0x01
268269
#define PROTOCOL_STATIC_WEP 0x02
@@ -1336,6 +1337,11 @@ struct host_cmd_ds_version_ext {
13361337
char version_str[128];
13371338
} __packed;
13381339

1340+
struct host_cmd_ds_mgmt_frame_reg {
1341+
__le16 action;
1342+
__le32 mask;
1343+
} __packed;
1344+
13391345
struct host_cmd_ds_802_11_ibss_status {
13401346
__le16 action;
13411347
__le16 enable;
@@ -1444,6 +1450,7 @@ struct host_cmd_ds_command {
14441450
struct host_cmd_ds_wmm_get_status get_wmm_status;
14451451
struct host_cmd_ds_802_11_key_material key_material;
14461452
struct host_cmd_ds_version_ext verext;
1453+
struct host_cmd_ds_mgmt_frame_reg reg_mask;
14471454
struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
14481455
struct host_cmd_ds_mac_reg_access mac_reg;
14491456
struct host_cmd_ds_bbp_reg_access bbp_reg;

drivers/net/wireless/mwifiex/main.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ struct mwifiex_private {
496496
u16 rsn_idx;
497497
struct timer_list scan_delay_timer;
498498
u8 ap_11n_enabled;
499+
u32 mgmt_frame_mask;
499500
};
500501

501502
enum mwifiex_ba_status {

drivers/net/wireless/mwifiex/sta_cmd.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,15 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
11671167
S_DS_GEN);
11681168
ret = 0;
11691169
break;
1170+
case HostCmd_CMD_MGMT_FRAME_REG:
1171+
cmd_ptr->command = cpu_to_le16(cmd_no);
1172+
cmd_ptr->params.reg_mask.action = cpu_to_le16(cmd_action);
1173+
cmd_ptr->params.reg_mask.mask = cpu_to_le32(*(u32 *)data_buf);
1174+
cmd_ptr->size =
1175+
cpu_to_le16(sizeof(struct host_cmd_ds_mgmt_frame_reg) +
1176+
S_DS_GEN);
1177+
ret = 0;
1178+
break;
11701179
case HostCmd_CMD_FUNC_INIT:
11711180
if (priv->adapter->hw_status == MWIFIEX_HW_STATUS_RESET)
11721181
priv->adapter->hw_status = MWIFIEX_HW_STATUS_READY;

drivers/net/wireless/mwifiex/sta_cmdresp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,7 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
875875
case HostCmd_CMD_VERSION_EXT:
876876
ret = mwifiex_ret_ver_ext(priv, resp, data_buf);
877877
break;
878+
case HostCmd_CMD_MGMT_FRAME_REG:
878879
case HostCmd_CMD_FUNC_INIT:
879880
case HostCmd_CMD_FUNC_SHUTDOWN:
880881
break;

0 commit comments

Comments
 (0)