void wlan_node_return (struct ieee80211_node_table *nt, bss_t *ni) { IEEE80211_NODE_LOCK (nt); wlan_node_dec_free (ni); IEEE80211_NODE_UNLOCK (nt); }
void wlan_iterate_nodes(struct ieee80211_node_table *nt, wlan_node_iter_func *f, void *arg) { bss_t *ni; A_UINT32 gen; A_UINT32 numNodes = 0; gen = ++nt->nt_scangen; IEEE80211_NODE_LOCK (nt); for (ni = nt->nt_node_first; ni; ni = ni->ni_list_next) { /*if (ni->ni_scangen != gen) { */ { numNodes++; ni->ni_scangen = gen; (void) ieee80211_node_incref(ni); (*f)(arg, ni); wlan_node_dec_free(ni); } } IEEE80211_NODE_UNLOCK (nt); /*RETAILMSG (1, (L"numNodes available ==> %d\n", numNodes)); */ }
void wlan_iterate_nodes(struct ath6kl_node_table *nt, void *arg) { struct bss *ni; spin_lock_bh(&nt->nt_nodelock); for (ni = nt->nt_node_first; ni; ni = ni->ni_list_next) { ni->ni_refcnt++; ath6kl_cfg80211_scan_node(arg, ni); wlan_node_dec_free(ni); } spin_unlock_bh(&nt->nt_nodelock); }
/* * Reclaim a node. If this is the last reference count then * do the normal free work. Otherwise remove it from the node * table and mark it gone by clearing the back-reference. */ void wlan_node_reclaim(struct ieee80211_node_table *nt, bss_t *ni) { if(ni->ni_list_prev == NULL) { /* First in list so fix the list head */ nt->nt_node_first = ni->ni_list_next; } else { ni->ni_list_prev->ni_list_next = ni->ni_list_next; } if(ni->ni_list_next == NULL) { /* Last in list so fix list tail */ nt->nt_node_last = ni->ni_list_prev; } else { ni->ni_list_next->ni_list_prev = ni->ni_list_prev; } if(ni->ni_hash_prev == NULL) { /* First in list so fix the list head */ int hash; hash = IEEE80211_NODE_HASH(ni->ni_macaddr); nt->nt_hash[hash] = ni->ni_hash_next; } else { ni->ni_hash_prev->ni_hash_next = ni->ni_hash_next; } if(ni->ni_hash_next != NULL) { ni->ni_hash_next->ni_hash_prev = ni->ni_hash_prev; } wlan_node_dec_free(ni); }
void wlan_iterate_nodes(struct ieee80211_node_table *nt, wlan_node_iter_func *f, void *arg) { bss_t *ni; A_UINT32 gen; gen = ++nt->nt_scangen; IEEE80211_NODE_LOCK(nt); for (ni = nt->nt_node_first; ni; ni = ni->ni_list_next) { if (ni->ni_scangen != gen) { ni->ni_scangen = gen; (void) ieee80211_node_incref(ni); (*f)(arg, ni); wlan_node_dec_free(ni); } } IEEE80211_NODE_UNLOCK(nt); }
void wlan_node_return(struct ath6kl_node_table *nt, struct bss *ni) { spin_lock_bh(&nt->nt_nodelock); wlan_node_dec_free(ni); spin_unlock_bh(&nt->nt_nodelock); }