return NULL;
}
+/* NB: A node reference is acquired here; the caller MUST release it. */
static struct ieee80211_node *
#ifdef IEEE80211_DEBUG_REFCNT
_ieee80211_find_node_debug(struct ieee80211_node_table *nt,
}
/*
- * Locate the node for sender, track state, and then pass the
- * (referenced) node up to the 802.11 layer for its use. We
- * return NULL when the sender is unknown; the driver is required
- * locate the appropriate virtual ap in that case; possibly
- * sending it to all (using ieee80211_input_all).
+ * Return the node for the sender of a frame; if the sender is unknown return
+ * NULL. The caller is expected to deal with this. (The frame is sent to all
+ * VAPs in this case).
+ *
+ * NB: A node reference is acquired here; the caller MUST release it.
*/
struct ieee80211_node *
#ifdef IEEE80211_DEBUG_REFCNT
#endif
/*
- * Return a reference to the appropriate node for sending
- * a data frame. This handles node discovery in adhoc networks.
+ * Return the appropriate node for sending a data frame. This handles node
+ * discovery in adhoc networks.
+ *
+ * NB: A node reference is acquired here; the caller MUST release it.
*/
struct ieee80211_node *
#ifdef IEEE80211_DEBUG_REFCNT
if (vap->iv_opmode == IEEE80211_M_STA || IEEE80211_IS_MULTICAST(mac))
return ieee80211_ref_node(vap->iv_bss);
- /* XXX can't hold lock across dup_bss due to recursive locking */
+ /* XXX: Can't hold lock across dup_bss due to recursive locking. */
nt = &vap->iv_ic->ic_sta;
IEEE80211_NODE_TABLE_LOCK_IRQ(nt);
ni = _ieee80211_find_node(nt, mac);
goto bad;
}
- cb = (struct ieee80211_cb *) skb->cb;
+ cb = (struct ieee80211_cb *)skb->cb;
memset(cb, 0, sizeof(struct ieee80211_cb));
if (vap->iv_opmode == IEEE80211_M_MONITOR) {
* We'll get the frame back when the time is right.
*/
ieee80211_pwrsave(ni, skb);
- ieee80211_unref_node(&ni); /* matches ieee80211_find_txnode */
+ ieee80211_unref_node(&ni);
return 0;
}
#ifdef ATH_SUPERG_XR
- /*
- * broadcast/multicast packets need to be sent on XR vap in addition to
- * normal vap.
- */
+ /* Broadcast/multicast packets need to be sent on XR vap in addition to
+ * normal vap. */
- /* FIXME: ieee80211_parent_queue_xmit */
- if (vap->iv_xrvap && ni == vap->iv_bss &&
+ if (vap->iv_xrvap && (ni == vap->iv_bss) &&
vap->iv_xrvap->iv_sta_assoc) {
- struct sk_buff *skb1;
- skb1 = skb_clone(skb, GFP_ATOMIC);
+ struct sk_buff *skb1 = skb_clone(skb, GFP_ATOMIC);
if (skb1) {
- cb = (struct ieee80211_cb *) skb1->cb;
+ cb = (struct ieee80211_cb *)skb1->cb;
+ memset(cb, 0, sizeof(struct ieee80211_cb));
cb->ni = ieee80211_find_txnode(vap->iv_xrvap,
eh->ether_dhost);
- cb->flags = 0;
- cb->next = NULL;
- (void) dev_queue_xmit(skb1);
+ ieee80211_parent_queue_xmit(skb1);
}
}
#endif
ieee80211_parent_queue_xmit(skb);
- ieee80211_unref_node(&ni); /* matches ieee80211_find_txnode */
+ ieee80211_unref_node(&ni);
return 0;
bad:
if (skb != NULL)
dev_kfree_skb(skb);
if (ni != NULL)
- ieee80211_unref_node(&ni); /* matches ieee80211_find_txnode */
+ ieee80211_unref_node(&ni);
return 0;
}