int wl1271_cmd_build_null_data(struct wl1271 *wl)
{
- struct sk_buff *skb;
- int ret = 0;
+ struct sk_buff *skb = NULL;
+ int size;
+ void *ptr;
+ int ret = -ENOMEM;
- skb = ieee80211_nullfunc_get(wl->hw, wl->vif);
- if (!skb)
- goto out;
- ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, skb->data,
- skb->len);
+ if (wl->bss_type == BSS_TYPE_IBSS) {
+ size = sizeof(struct wl12xx_null_data_template);
+ ptr = NULL;
+ } else {
+ skb = ieee80211_nullfunc_get(wl->hw, wl->vif);
+ if (!skb)
+ goto out;
+ size = skb->len;
+ ptr = skb->data;
+ }
+
+ ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, ptr, size);
out:
dev_kfree_skb(skb);
+ if (ret)
+ wl1271_warning("cmd buld null data failed %d", ret);
+
return ret;
}
*/
memcmp(wl->bssid, bss_conf->bssid, ETH_ALEN)) {
memcpy(wl->bssid, bss_conf->bssid, ETH_ALEN);
+
ret = wl1271_cmd_build_null_data(wl);
- if (ret < 0) {
- wl1271_warning("cmd buld null data failed %d",
- ret);
+ if (ret < 0)
goto out_sleep;
- }
/* filter out all packets not from this BSSID */
wl1271_configure_filters(wl, 0);