diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_cmd.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_cmd.c | 26 |
1 files changed, 19 insertions, 7 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 | ||
710 | int wl1271_cmd_build_null_data(struct wl1271 *wl) | 710 | int 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 | ||
722 | out: | 731 | out: |
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 | } |