void wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni, const A_UINT8 *macaddr) { int hash; A_UINT32 timeoutValue = 0; A_MEMCPY(ni->ni_macaddr, macaddr, IEEE80211_ADDR_LEN); hash = IEEE80211_NODE_HASH (macaddr); ieee80211_node_initref (ni); /* mark referenced */ timeoutValue = nt->nt_nodeAge; //ni->ni_tstamp = A_GET_MS (0); //-builder:nodeage ni->ni_tstamp = A_GET_MS(timeoutValue); //+builder:nodeage ni->ni_actcnt = WLAN_NODE_INACT_CNT; IEEE80211_NODE_LOCK_BH(nt); /* Insert at the end of the node list */ ni->ni_list_next = NULL; ni->ni_list_prev = nt->nt_node_last; if(nt->nt_node_last != NULL) { nt->nt_node_last->ni_list_next = ni; } nt->nt_node_last = ni; if(nt->nt_node_first == NULL) { nt->nt_node_first = ni; } /* Insert into the hash list i.e. the bucket */ if((ni->ni_hash_next = nt->nt_hash[hash]) != NULL) { nt->nt_hash[hash]->ni_hash_prev = ni; } ni->ni_hash_prev = NULL; nt->nt_hash[hash] = ni; if (!nt->isTimerArmed) { A_TIMEOUT_MS(&nt->nt_inact_timer, timeoutValue, 0); nt->isTimerArmed = TRUE; } IEEE80211_NODE_UNLOCK_BH(nt); }
void wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni, const A_UINT8 *macaddr) { int hash; A_MEMCPY(ni->ni_macaddr, macaddr, IEEE80211_ADDR_LEN); hash = IEEE80211_NODE_HASH (macaddr); ieee80211_node_initref (ni); /* mark referenced */ wlan_node_update_timestamp(nt, ni); IEEE80211_NODE_LOCK_BH(nt); /* Insert at the end of the node list */ ni->ni_list_next = NULL; ni->ni_list_prev = nt->nt_node_last; if(nt->nt_node_last != NULL) { nt->nt_node_last->ni_list_next = ni; } nt->nt_node_last = ni; if(nt->nt_node_first == NULL) { nt->nt_node_first = ni; } /* Insert into the hash list i.e. the bucket */ if((ni->ni_hash_next = nt->nt_hash[hash]) != NULL) { nt->nt_hash[hash]->ni_hash_prev = ni; } ni->ni_hash_prev = NULL; nt->nt_hash[hash] = ni; IEEE80211_NODE_UNLOCK_BH(nt); }
void wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni, const A_UINT8 *macaddr) { A_INT32 hash; A_MEMCPY(ni->ni_macaddr, macaddr, IEEE80211_ADDR_LEN); hash = IEEE80211_NODE_HASH(macaddr); ieee80211_node_initref(ni); /* mark referenced */ ni->ni_tstamp = A_MS_TICKGET() + WLAN_NODE_INACT_TIMEOUT_MSEC; IEEE80211_NODE_LOCK(nt); /* Insert at the end of the node list */ ni->ni_list_next = NULL; ni->ni_list_prev = nt->nt_node_last; if(nt->nt_node_last != NULL) { nt->nt_node_last->ni_list_next = ni; } nt->nt_node_last = ni; if(nt->nt_node_first == NULL) { nt->nt_node_first = ni; } /* Insert into the hash list i.e. the bucket */ if((ni->ni_hash_next = nt->nt_hash[hash]) != NULL) { nt->nt_hash[hash]->ni_hash_prev = ni; } ni->ni_hash_prev = NULL; nt->nt_hash[hash] = ni; IEEE80211_NODE_UNLOCK(nt); }