aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorAvinash Patil <patila@marvell.com>2012-05-08 21:30:30 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-05-16 12:46:37 -0400
commit40bbc21a2c2bc432735a085d572f3cb3732cf64c (patch)
treefe67ba6db810450bcdc141837aedd1cc00c7b3d0 /drivers/net/wireless
parentf31acabe3dd0699c61a8ec4ba4f70816d58b4dc9 (diff)
mwifiex: delete IEs when stop_ap
Delete custom IEs set by start_ap cfg80211 handler when stop_ap handler is called for AP interface. IE index required for deletion is stored in mwifiex_private structure. Signed-off-by: Avinash Patil <patila@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>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c3
-rw-r--r--drivers/net/wireless/mwifiex/ie.c71
-rw-r--r--drivers/net/wireless/mwifiex/main.h1
3 files changed, 75 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 2d0952dc593a..f315ffcedb06 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -929,6 +929,9 @@ static int mwifiex_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
929{ 929{
930 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); 930 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
931 931
932 if (mwifiex_del_mgmt_ies(priv))
933 wiphy_err(wiphy, "Failed to delete mgmt IEs!\n");
934
932 if (mwifiex_send_cmd_sync(priv, HostCmd_CMD_UAP_BSS_STOP, 935 if (mwifiex_send_cmd_sync(priv, HostCmd_CMD_UAP_BSS_STOP,
933 HostCmd_ACT_GEN_SET, 0, NULL)) { 936 HostCmd_ACT_GEN_SET, 0, NULL)) {
934 wiphy_err(wiphy, "Failed to stop the BSS\n"); 937 wiphy_err(wiphy, "Failed to stop the BSS\n");
diff --git a/drivers/net/wireless/mwifiex/ie.c b/drivers/net/wireless/mwifiex/ie.c
index ca9ebcf8ab22..ceb82cd749cc 100644
--- a/drivers/net/wireless/mwifiex/ie.c
+++ b/drivers/net/wireless/mwifiex/ie.c
@@ -323,3 +323,74 @@ done:
323 323
324 return ret; 324 return ret;
325} 325}
326
327/* This function removes management IE set */
328int mwifiex_del_mgmt_ies(struct mwifiex_private *priv)
329{
330 struct mwifiex_ie *beacon_ie = NULL, *pr_ie = NULL;
331 struct mwifiex_ie *ar_ie = NULL, *rsn_ie = NULL;
332 int ret = 0;
333
334 if (priv->rsn_idx != MWIFIEX_AUTO_IDX_MASK) {
335 rsn_ie = kmalloc(sizeof(struct mwifiex_ie), GFP_KERNEL);
336 if (!rsn_ie)
337 return -ENOMEM;
338
339 rsn_ie->ie_index = cpu_to_le16(priv->rsn_idx);
340 rsn_ie->mgmt_subtype_mask = cpu_to_le16(MWIFIEX_DELETE_MASK);
341 rsn_ie->ie_length = 0;
342 if (mwifiex_update_uap_custom_ie(priv, rsn_ie, &priv->rsn_idx,
343 NULL, &priv->proberesp_idx,
344 NULL, &priv->assocresp_idx)) {
345 ret = -1;
346 goto done;
347 }
348
349 priv->rsn_idx = MWIFIEX_AUTO_IDX_MASK;
350 }
351
352 if (priv->beacon_idx != MWIFIEX_AUTO_IDX_MASK) {
353 beacon_ie = kmalloc(sizeof(struct mwifiex_ie), GFP_KERNEL);
354 if (!beacon_ie) {
355 ret = -ENOMEM;
356 goto done;
357 }
358 beacon_ie->ie_index = cpu_to_le16(priv->beacon_idx);
359 beacon_ie->mgmt_subtype_mask = cpu_to_le16(MWIFIEX_DELETE_MASK);
360 beacon_ie->ie_length = 0;
361 }
362 if (priv->proberesp_idx != MWIFIEX_AUTO_IDX_MASK) {
363 pr_ie = kmalloc(sizeof(struct mwifiex_ie), GFP_KERNEL);
364 if (!pr_ie) {
365 ret = -ENOMEM;
366 goto done;
367 }
368 pr_ie->ie_index = cpu_to_le16(priv->proberesp_idx);
369 pr_ie->mgmt_subtype_mask = cpu_to_le16(MWIFIEX_DELETE_MASK);
370 pr_ie->ie_length = 0;
371 }
372 if (priv->assocresp_idx != MWIFIEX_AUTO_IDX_MASK) {
373 ar_ie = kmalloc(sizeof(struct mwifiex_ie), GFP_KERNEL);
374 if (!ar_ie) {
375 ret = -ENOMEM;
376 goto done;
377 }
378 ar_ie->ie_index = cpu_to_le16(priv->assocresp_idx);
379 ar_ie->mgmt_subtype_mask = cpu_to_le16(MWIFIEX_DELETE_MASK);
380 ar_ie->ie_length = 0;
381 }
382
383 if (beacon_ie || pr_ie || ar_ie)
384 ret = mwifiex_update_uap_custom_ie(priv,
385 beacon_ie, &priv->beacon_idx,
386 pr_ie, &priv->proberesp_idx,
387 ar_ie, &priv->assocresp_idx);
388
389done:
390 kfree(beacon_ie);
391 kfree(pr_ie);
392 kfree(ar_ie);
393 kfree(rsn_ie);
394
395 return ret;
396}
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 7d882eea2171..bd3b0bf94b9e 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -1007,6 +1007,7 @@ void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config);
1007 1007
1008int mwifiex_set_mgmt_ies(struct mwifiex_private *priv, 1008int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
1009 struct cfg80211_ap_settings *params); 1009 struct cfg80211_ap_settings *params);
1010int mwifiex_del_mgmt_ies(struct mwifiex_private *priv);
1010u8 *mwifiex_11d_code_2_region(u8 code); 1011u8 *mwifiex_11d_code_2_region(u8 code);
1011 1012
1012#ifdef CONFIG_DEBUG_FS 1013#ifdef CONFIG_DEBUG_FS