From be343965ed9ae29a370ca5f495d38a3561f1af27 Mon Sep 17 00:00:00 2001 From: mentor Date: Thu, 8 Nov 2007 16:50:00 +0000 Subject: [PATCH] * Update comments on find_*node functions to specifically note node reference acquirement * Update ieee80211 XR mode to use ieee80211_parent_queue_xmit git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2838 0192ed92-7a03-0410-a25b-9323aeb14dbd --- net80211/ieee80211_node.c | 19 +++++++++++-------- net80211/ieee80211_output.c | 27 +++++++++++---------------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/net80211/ieee80211_node.c b/net80211/ieee80211_node.c index 339fdc0..f7ba73b 100644 --- a/net80211/ieee80211_node.c +++ b/net80211/ieee80211_node.c @@ -1088,6 +1088,7 @@ _ieee80211_find_wds_node(struct ieee80211_node_table *nt, const u_int8_t *macadd 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, @@ -1257,11 +1258,11 @@ ieee80211_add_neighbor(struct ieee80211vap *vap, const struct ieee80211_frame *w } /* - * 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 @@ -1300,8 +1301,10 @@ EXPORT_SYMBOL(ieee80211_find_rxnode); #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 @@ -1322,7 +1325,7 @@ ieee80211_find_txnode(struct ieee80211vap *vap, const u_int8_t *mac) 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); diff --git a/net80211/ieee80211_output.c b/net80211/ieee80211_output.c index 91b9e8f..bc959ff 100644 --- a/net80211/ieee80211_output.c +++ b/net80211/ieee80211_output.c @@ -223,7 +223,7 @@ ieee80211_hardstart(struct sk_buff *skb, struct net_device *dev) 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) { @@ -270,40 +270,35 @@ ieee80211_hardstart(struct sk_buff *skb, struct net_device *dev) * 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; } -- 2.35.1