aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-03-18 06:26:44 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-03-23 16:50:24 -0400
commita0cb7be4f4fa765dcfa82675811cd7e7713b5610 (patch)
treeb3ab262437222b9bb54f28bd5fb0a1aec02dbc36 /drivers/net/wireless
parent14b228a0d4234e4a2d4e683052da78760e8abf0f (diff)
wl1271: Don't generate null func template for ad-hoc
The null func template is not needed for ad-hoc, and it's generation is not supported for ad-hoc (mac80211 will WARN about it.) Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.c26
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c6
2 files changed, 21 insertions, 11 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index 035ddc06034c..d005729e0312 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -709,18 +709,30 @@ out:
709 709
710int wl1271_cmd_build_null_data(struct wl1271 *wl) 710int wl1271_cmd_build_null_data(struct wl1271 *wl)
711{ 711{
712 struct sk_buff *skb; 712 struct sk_buff *skb = NULL;
713 int ret = 0; 713 int size;
714 void *ptr;
715 int ret = -ENOMEM;
714 716
715 skb = ieee80211_nullfunc_get(wl->hw, wl->vif);
716 if (!skb)
717 goto out;
718 717
719 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, skb->data, 718 if (wl->bss_type == BSS_TYPE_IBSS) {
720 skb->len); 719 size = sizeof(struct wl12xx_null_data_template);
720 ptr = NULL;
721 } else {
722 skb = ieee80211_nullfunc_get(wl->hw, wl->vif);
723 if (!skb)
724 goto out;
725 size = skb->len;
726 ptr = skb->data;
727 }
728
729 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, ptr, size);
721 730
722out: 731out:
723 dev_kfree_skb(skb); 732 dev_kfree_skb(skb);
733 if (ret)
734 wl1271_warning("cmd buld null data failed %d", ret);
735
724 return ret; 736 return ret;
725 737
726} 738}
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index befc2e9b1842..6f6d366491a3 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -1619,12 +1619,10 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1619 */ 1619 */
1620 memcmp(wl->bssid, bss_conf->bssid, ETH_ALEN)) { 1620 memcmp(wl->bssid, bss_conf->bssid, ETH_ALEN)) {
1621 memcpy(wl->bssid, bss_conf->bssid, ETH_ALEN); 1621 memcpy(wl->bssid, bss_conf->bssid, ETH_ALEN);
1622
1622 ret = wl1271_cmd_build_null_data(wl); 1623 ret = wl1271_cmd_build_null_data(wl);
1623 if (ret < 0) { 1624 if (ret < 0)
1624 wl1271_warning("cmd buld null data failed %d",
1625 ret);
1626 goto out_sleep; 1625 goto out_sleep;
1627 }
1628 1626
1629 /* filter out all packets not from this BSSID */ 1627 /* filter out all packets not from this BSSID */
1630 wl1271_configure_filters(wl, 0); 1628 wl1271_configure_filters(wl, 0);