On Sat, 2012-05-26 at 15:36 +0530, Soumik Das wrote: > /** > + * ieee80211_qosnullfunc_get - retrieve a qos nullfunc template > + * @hw: pointer obtained from ieee80211_alloc_hw(). > + * @vif: &struct ieee80211_vif pointer from the add_interface callback. > + * > + * Creates a QOS Nullfunc template which can, for example, be uploaded to > + * hardware. The template must be updated after association so that correct > + * BSSID and address is used. > + * > + * Note: Caller (or hardware) is responsible for setting the > + * &IEEE80211_FCTL_PM bit as well as Duration and Sequence Control fields. > + * The qos ctl field is set to zero by the function. Caller must > + * fill up proper value. > + */ > +struct sk_buff *ieee80211_qosnullfunc_get(struct ieee80211_hw *hw, > + struct ieee80211_vif *vif); You pass the hw & the vif, only one is really needed. I also don't understand the need to update the BSSID? If you have the vif, then it could trivially be correct upon returning from this function. > + sdata = vif_to_sdata(vif); > + ifmgd = &sdata->u.mgd; > + local = sdata->local; You don't even use the hw pointer that was passed :-) > + skb = dev_alloc_skb(local->hw.extra_tx_headroom + sizeof(*nullfunc)); > + if (!skb) { > + printk(KERN_DEBUG "%s: failed to allocate buffer for qos " > + "nullfunc template\n", sdata->name); Please don't print messages on allocation failures, they're already very verbose. > + return NULL; > + } > + skb_reserve(skb, local->hw.extra_tx_headroom); > + > + nullfunc = (struct ieee80211_hdr_3addr *) skb_put(skb, > + sizeof(*nullfunc)); (void *) cast is sufficient Shouldn't the TID be set somehow? This routine is largely the same as the non-QoS one, maybe it would be possible to combine them? johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html