void ieee80211_node_attach(struct ifnet *ifp) { struct ieee80211com *ic = (void *)ifp; int size; IEEE80211_NODE_LOCK_INIT(ic, ifp->if_xname); RB_INIT(&ic->ic_tree); ic->ic_node_alloc = ieee80211_node_alloc; ic->ic_node_free = ieee80211_node_free; ic->ic_node_copy = ieee80211_node_copy; ic->ic_node_getrssi = ieee80211_node_getrssi; ic->ic_scangen = 1; ic->ic_max_nnodes = ieee80211_cache_size; if (ic->ic_max_aid == 0) ic->ic_max_aid = IEEE80211_AID_DEF; else if (ic->ic_max_aid > IEEE80211_AID_MAX) ic->ic_max_aid = IEEE80211_AID_MAX; size = howmany(ic->ic_max_aid, 32) * sizeof(u_int32_t); MALLOC(ic->ic_aid_bitmap, u_int32_t *, size, M_DEVBUF, M_NOWAIT); if (ic->ic_aid_bitmap == NULL) { /* XXX no way to recover */ printf("%s: no memory for AID bitmap!\n", __func__); ic->ic_max_aid = 0; } else memset(ic->ic_aid_bitmap, 0, size); }
/* * Node table support. */ void wlan_node_table_init(void *wmip, struct ieee80211_node_table *nt) { int i; AR_DEBUG_PRINTF(ATH_DEBUG_WLAN, ("node table = 0x%x\n", (A_UINT32)nt)); IEEE80211_NODE_LOCK_INIT(nt); A_REGISTER_MODULE_DEBUG_INFO(wlan); nt->nt_node_first = nt->nt_node_last = NULL; for(i = 0; i < IEEE80211_NODE_HASHSIZE; i++) { nt->nt_hash[i] = NULL; } A_INIT_TIMER(&nt->nt_inact_timer, wlan_node_timeout, nt); nt->isTimerArmed = FALSE; nt->nt_wmip = wmip; nt->nt_nodeAge = WLAN_NODE_INACT_TIMEOUT_MSEC; // // nt_scangen never initialized before and during suspend/resume of winmobile, // that some junk has been stored in this, due to this scan list didn't properly updated // nt->nt_scangen = 0; #ifdef OS_ROAM_MANAGEMENT nt->nt_si_gen = 0; #endif }
/* * Node table support. */ void wlan_node_table_init(void *wmip, struct ieee80211_node_table *nt) { int i; WLAN_DEBUG_PRINTF(ATH_LOG_INF,"node table = 0x%x\n", (A_UINT32)nt); IEEE80211_NODE_LOCK_INIT(nt); nt->nt_node_first = nt->nt_node_last = NULL; for(i = 0; i < IEEE80211_NODE_HASHSIZE; i++) { nt->nt_hash[i] = NULL; } A_INIT_TIMER(&nt->nt_inact_timer, wlan_node_timeout, nt); A_TIMEOUT_MS(&nt->nt_inact_timer, WLAN_NODE_INACT_TIMEOUT_MSEC, 0); nt->nt_wmip = wmip; }