Home | History | Annotate | Download | only in net80211

Lines Matching refs:nt

102 	struct ieee80211_node_table *nt, const char *name,
105 static void ieee80211_node_table_cleanup(struct ieee80211_node_table *nt);
423 struct ieee80211_node_table *nt;
435 nt = &ic->ic_sta;
436 IEEE80211_NODE_LOCK(nt);
438 nt->nt_name = "station";
439 nt->nt_inact_init = ic->ic_inact_init;
441 nt->nt_name = "neighbor";
442 nt->nt_inact_init = ic->ic_inact_run;
444 IEEE80211_NODE_UNLOCK(nt);
675 struct ieee80211_node_table *nt = &ic->ic_scan;
695 IEEE80211_NODE_LOCK(nt);
696 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
702 IEEE80211_NODE_UNLOCK(nt);
745 if (TAILQ_FIRST(&nt->nt_node) == NULL) {
763 IEEE80211_NODE_LOCK(nt);
764 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
768 IEEE80211_NODE_UNLOCK(nt);
786 IEEE80211_NODE_LOCK(nt);
787 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
797 IEEE80211_NODE_UNLOCK(nt);
858 struct ieee80211_node_table *nt;
871 nt = &ic->ic_sta;
872 IEEE80211_NODE_LOCK(nt);
873 nt->nt_name = "neighbor";
874 nt->nt_inact_init = ic->ic_inact_run;
875 IEEE80211_NODE_UNLOCK(nt);
959 node_alloc(struct ieee80211_node_table *nt)
1056 ieee80211_setup_node(struct ieee80211_node_table *nt,
1059 struct ieee80211com *ic = nt->nt_ic;
1064 ether_sprintf(macaddr), nt->nt_name);
1073 ni->ni_inact_reload = nt->nt_inact_init;
1077 IEEE80211_NODE_LOCK(nt);
1078 TAILQ_INSERT_TAIL(&nt->nt_node, ni, ni_list);
1079 LIST_INSERT_HEAD(&nt->nt_hash[hash], ni, ni_hash);
1080 ni->ni_table = nt;
1082 IEEE80211_NODE_UNLOCK(nt);
1086 ieee80211_alloc_node(struct ieee80211_node_table *nt, const u_int8_t *macaddr)
1088 struct ieee80211com *ic = nt->nt_ic;
1091 ni = ic->ic_node_alloc(nt);
1093 ieee80211_setup_node(nt, ni, macaddr);
1136 ieee80211_dup_bss(struct ieee80211_node_table *nt, const u_int8_t *macaddr)
1138 struct ieee80211com *ic = nt->nt_ic;
1141 ni = ic->ic_node_alloc(nt);
1143 ieee80211_setup_node(nt, ni, macaddr);
1161 nt,
1164 _ieee80211_find_node(struct ieee80211_node_table *nt,
1171 IEEE80211_NODE_LOCK_ASSERT(nt);
1174 LIST_FOREACH(ni, &nt->nt_hash[hash], ni_hash) {
1178 IEEE80211_DPRINTF(nt->nt_ic, IEEE80211_MSG_NODE,
1190 #define _ieee80211_find_node(nt, mac) \
1191 _ieee80211_find_node_debug(nt, mac, func, line)
1196 ieee80211_find_node_debug(struct ieee80211_node_table *nt,
1199 ieee80211_find_node(struct ieee80211_node_table *nt, const u_int8_t *macaddr)
1204 IEEE80211_NODE_LOCK(nt);
1205 ni = _ieee80211_find_node(nt, macaddr);
1206 IEEE80211_NODE_UNLOCK(nt);
1217 ieee80211_fakeup_adhoc_node(struct ieee80211_node_table *nt,
1220 struct ieee80211com *ic = nt->nt_ic;
1223 ni = ieee80211_dup_bss(nt, macaddr);
1288 struct ieee80211_node_table *nt = &ic->ic_scan;
1292 ni = ieee80211_find_node(nt, wh->i_addr2);
1297 ni = ic->ic_node_alloc(nt);
1302 ieee80211_setup_node(nt, ni, wh->i_addr2);
1443 struct ieee80211_node_table *nt;
1450 nt = &ic->ic_scan;
1452 nt = &ic->ic_sta;
1456 IEEE80211_NODE_LOCK(nt);
1458 ni = _ieee80211_find_node(nt, wh->i_addr1);
1460 ni = _ieee80211_find_node(nt, wh->i_addr2);
1463 IEEE80211_NODE_UNLOCK(nt);
1486 struct ieee80211_node_table *nt;
1492 nt = &ic->ic_scan;
1494 nt = &ic->ic_sta;
1497 IEEE80211_NODE_LOCK(nt);
1498 if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax) {
1499 ni = nt->nt_keyixmap[keyix];
1505 ni = _ieee80211_find_node(nt, wh->i_addr1);
1507 ni = _ieee80211_find_node(nt, wh->i_addr2);
1510 if (nt->nt_keyixmap != NULL) {
1517 if (keyix < nt->nt_keyixmax &&
1518 nt->nt_keyixmap[keyix] == NULL) {
1523 nt->nt_keyixmap[keyix] = ieee80211_ref_node(ni);
1529 IEEE80211_NODE_UNLOCK(nt);
1548 struct ieee80211_node_table *nt = &ic->ic_sta;
1558 IEEE80211_NODE_LOCK(nt);
1562 ni = _ieee80211_find_node(nt, macaddr);
1563 IEEE80211_NODE_UNLOCK(nt);
1573 ni = ieee80211_fakeup_adhoc_node(nt, macaddr);
1591 ieee80211_find_node_with_channel_debug(struct ieee80211_node_table *nt,
1595 ieee80211_find_node_with_channel(struct ieee80211_node_table *nt,
1604 IEEE80211_NODE_LOCK(nt);
1605 LIST_FOREACH(ni, &nt->nt_hash[hash], ni_hash) {
1610 IEEE80211_DPRINTF(nt->nt_ic, IEEE80211_MSG_NODE,
1616 IEEE80211_DPRINTF(nt->nt_ic, IEEE80211_MSG_NODE,
1624 IEEE80211_NODE_UNLOCK(nt);
1634 struct ieee80211_node_table *nt = ni0->ni_table;
1638 if (nt == NULL)
1650 IEEE80211_NODE_LOCK(nt);
1670 IEEE80211_NODE_UNLOCK(nt);
1680 ieee80211_find_node_with_ssid_debug(struct ieee80211_node_table *nt,
1684 ieee80211_find_node_with_ssid(struct ieee80211_node_table *nt,
1691 struct ieee80211com *ic = nt->nt_ic;
1695 IEEE80211_NODE_LOCK(nt);
1703 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
1709 LIST_FOREACH(ni, &nt->nt_hash[hash], ni_hash) {
1731 IEEE80211_NODE_UNLOCK(nt);
1741 struct ieee80211_node_table *nt = ni->ni_table;
1746 nt != NULL ? nt->nt_name : "<gone>");
1749 if (nt != NULL) {
1750 TAILQ_REMOVE(&nt->nt_node, ni, ni_list);
1763 struct ieee80211_node_table *nt = ni->ni_table;
1771 if (nt != NULL) {
1772 IEEE80211_NODE_LOCK(nt);
1779 nt->nt_keyixmap != NULL) {
1786 if (keyix < nt->nt_keyixmax &&
1787 nt->nt_keyixmap[keyix] == ni) {
1791 nt->nt_keyixmap[keyix] = NULL;
1796 IEEE80211_NODE_UNLOCK(nt);
1810 struct ieee80211_node_table *nt = &ic->ic_sta;
1827 isowned = IEEE80211_NODE_IS_LOCKED(nt);
1829 IEEE80211_NODE_LOCK(nt);
1832 if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax) {
1833 nikey = nt->nt_keyixmap[keyix];
1834 nt->nt_keyixmap[keyix] = NULL;
1858 node_reclaim(struct ieee80211_node_table *nt, struct ieee80211_node *ni)
1862 IEEE80211_NODE_LOCK_ASSERT(nt);
1867 nt->nt_name, ieee80211_node_refcnt(ni)-1);
1876 if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax &&
1877 nt->nt_keyixmap[keyix] == ni) {
1881 nt->nt_keyixmap[keyix] = NULL;
1891 TAILQ_REMOVE(&nt->nt_node, ni, ni_list);
1899 ieee80211_free_allnodes_locked(struct ieee80211_node_table *nt)
1901 struct ieee80211com *ic = nt->nt_ic;
1905 "%s: free all nodes in %s table\n", __func__, nt->nt_name);
1907 while ((ni = TAILQ_FIRST(&nt->nt_node)) != NULL) {
1913 node_reclaim(nt, ni);
1919 ieee80211_free_allnodes(struct ieee80211_node_table *nt)
1922 IEEE80211_NODE_LOCK(nt);
1923 ieee80211_free_allnodes_locked(nt);
1924 IEEE80211_NODE_UNLOCK(nt);
1931 ieee80211_timeout_scan_candidates(struct ieee80211_node_table *nt)
1933 struct ieee80211com *ic = nt->nt_ic;
1936 IEEE80211_NODE_LOCK(nt);
1943 TAILQ_FOREACH_SAFE(ni, &nt->nt_node, ni_list, tni) {
1949 node_reclaim(nt, ni);
1952 IEEE80211_NODE_UNLOCK(nt);
1954 nt->nt_inact_timer = IEEE80211_INACT_WAIT;
1968 ieee80211_timeout_stations(struct ieee80211_node_table *nt)
1970 struct ieee80211com *ic = nt->nt_ic;
1977 IEEE80211_SCAN_LOCK(nt);
1978 gen = ++nt->nt_scangen;
1979 IEEE80211_SCAN_UNLOCK(nt);
1981 "%s: %s scangen %u\n", __func__, nt->nt_name, gen);
1983 IEEE80211_SCAN_LOCK(nt);
1984 if (gen != nt->nt_scangen) {
1986 IEEE80211_SCAN_UNLOCK(nt);
1989 IEEE80211_SCAN_UNLOCK(nt);
1991 IEEE80211_NODE_LOCK(nt);
1992 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
2080 IEEE80211_NODE_UNLOCK(nt);
2106 IEEE80211_NODE_UNLOCK(nt);
2117 IEEE80211_NODE_UNLOCK(nt);
2119 nt->nt_inact_timer = IEEE80211_INACT_WAIT;
2123 ieee80211_iterate_nodes(struct ieee80211_node_table *nt, ieee80211_iter_func *f, void *arg)
2128 IEEE80211_SCAN_LOCK(nt);
2129 gen = ++nt->nt_scangen;
2130 IEEE80211_SCAN_UNLOCK(nt);
2132 IEEE80211_SCAN_LOCK(nt);
2133 if (gen != nt->nt_scangen) {
2135 IEEE80211_SCAN_UNLOCK(nt);
2138 IEEE80211_SCAN_UNLOCK(nt);
2140 IEEE80211_NODE_LOCK(nt);
2141 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
2145 IEEE80211_NODE_UNLOCK(nt);
2151 IEEE80211_NODE_UNLOCK(nt);
2155 ieee80211_dump_node(struct ieee80211_node_table *nt,
2180 ieee80211_dump_nodes(struct ieee80211_node_table *nt)
2182 ieee80211_iterate_nodes(nt,
2183 (ieee80211_iter_func *) ieee80211_dump_node, nt);
2367 struct ieee80211_node_table *nt = ni->ni_table;
2415 if (nt != NULL) {
2416 IEEE80211_NODE_LOCK(nt);
2417 node_reclaim(nt, ni);
2418 IEEE80211_NODE_UNLOCK(nt);
2427 struct ieee80211_node_table *nt = &ic->ic_sta;
2436 TAILQ_FOREACH(ni, &nt->nt_node, ni_list)
2444 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
2452 TAILQ_FOREACH(ni, &nt->nt_node, ni_list)
2508 struct ieee80211_node_table *nt,
2516 nt->nt_ic = ic;
2518 IEEE80211_NODE_LOCK_INIT(nt, ic->ic_ifp->if_xname);
2519 IEEE80211_SCAN_LOCK_INIT(nt, ic->ic_ifp->if_xname);
2520 TAILQ_INIT(&nt->nt_node);
2521 nt->nt_name = name;
2522 nt->nt_scangen = 1;
2523 nt->nt_inact_init = inact;
2524 nt->nt_timeout = timeout;
2525 nt->nt_keyixmax = keyixmax;
2526 if (nt->nt_keyixmax > 0) {
2527 nt->nt_keyixmap = malloc(keyixmax *
2531 nt->nt_keyixmap = NULL;
2535 ieee80211_node_table_reset(struct ieee80211_node_table *nt)
2538 IEEE80211_DPRINTF(nt->nt_ic, IEEE80211_MSG_NODE,
2539 "%s %s table\n", __func__, nt->nt_name);
2541 IEEE80211_NODE_LOCK(nt);
2542 nt->nt_inact_timer = 0;
2543 ieee80211_free_allnodes_locked(nt);
2544 IEEE80211_NODE_UNLOCK(nt);
2548 ieee80211_node_table_cleanup(struct ieee80211_node_table *nt)
2551 IEEE80211_DPRINTF(nt->nt_ic, IEEE80211_MSG_NODE,
2552 "%s %s table\n", __func__, nt->nt_name);
2554 IEEE80211_NODE_LOCK(nt);
2555 ieee80211_free_allnodes_locked(nt);
2556 IEEE80211_NODE_UNLOCK(nt);
2557 if (nt->nt_keyixmap != NULL) {
2560 for (i = 0; i < nt->nt_keyixmax; i++)
2561 if (nt->nt_keyixmap[i] != NULL)
2563 nt->nt_name, i);
2564 free(nt->nt_keyixmap, M_80211_NODE);
2565 nt->nt_keyixmap = NULL;
2567 IEEE80211_SCAN_LOCK_DESTROY(nt);
2568 IEEE80211_NODE_LOCK_DESTROY(nt);