Home | History | Annotate | Download | only in net80211

Lines Matching defs:nt

102 	struct ieee80211_node_table *nt, const char *name,
105 static void ieee80211_node_table_cleanup(struct ieee80211_node_table *nt);
405 struct ieee80211_node_table *nt;
417 nt = &ic->ic_sta;
418 IEEE80211_NODE_LOCK(nt);
420 nt->nt_name = "station";
421 nt->nt_inact_init = ic->ic_inact_init;
423 nt->nt_name = "neighbor";
424 nt->nt_inact_init = ic->ic_inact_run;
426 IEEE80211_NODE_UNLOCK(nt);
657 struct ieee80211_node_table *nt = &ic->ic_scan;
677 IEEE80211_NODE_LOCK(nt);
678 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
684 IEEE80211_NODE_UNLOCK(nt);
727 if (TAILQ_FIRST(&nt->nt_node) == NULL) {
745 IEEE80211_NODE_LOCK(nt);
746 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
750 IEEE80211_NODE_UNLOCK(nt);
765 IEEE80211_NODE_LOCK(nt);
766 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
776 IEEE80211_NODE_UNLOCK(nt);
837 struct ieee80211_node_table *nt;
850 nt = &ic->ic_sta;
851 IEEE80211_NODE_LOCK(nt);
852 nt->nt_name = "neighbor";
853 nt->nt_inact_init = ic->ic_inact_run;
854 IEEE80211_NODE_UNLOCK(nt);
938 node_alloc(struct ieee80211_node_table *nt)
1035 ieee80211_setup_node(struct ieee80211_node_table *nt,
1038 struct ieee80211com *ic = nt->nt_ic;
1043 ether_sprintf(macaddr), nt->nt_name);
1052 ni->ni_inact_reload = nt->nt_inact_init;
1056 IEEE80211_NODE_LOCK(nt);
1057 TAILQ_INSERT_TAIL(&nt->nt_node, ni, ni_list);
1058 LIST_INSERT_HEAD(&nt->nt_hash[hash], ni, ni_hash);
1059 ni->ni_table = nt;
1061 IEEE80211_NODE_UNLOCK(nt);
1065 ieee80211_alloc_node(struct ieee80211_node_table *nt, const u_int8_t *macaddr)
1067 struct ieee80211com *ic = nt->nt_ic;
1070 ni = ic->ic_node_alloc(nt);
1072 ieee80211_setup_node(nt, ni, macaddr);
1115 ieee80211_dup_bss(struct ieee80211_node_table *nt, const u_int8_t *macaddr)
1117 struct ieee80211com *ic = nt->nt_ic;
1120 ni = ic->ic_node_alloc(nt);
1122 ieee80211_setup_node(nt, ni, macaddr);
1140 _ieee80211_find_node_debug(struct ieee80211_node_table *nt,
1143 _ieee80211_find_node(struct ieee80211_node_table *nt,
1150 IEEE80211_NODE_LOCK_ASSERT(nt);
1153 LIST_FOREACH(ni, &nt->nt_hash[hash], ni_hash) {
1157 IEEE80211_DPRINTF(nt->nt_ic, IEEE80211_MSG_NODE,
1169 #define _ieee80211_find_node(nt, mac) \
1170 _ieee80211_find_node_debug(nt, mac, func, line)
1175 ieee80211_find_node_debug(struct ieee80211_node_table *nt,
1178 ieee80211_find_node(struct ieee80211_node_table *nt, const u_int8_t *macaddr)
1183 IEEE80211_NODE_LOCK(nt);
1184 ni = _ieee80211_find_node(nt, macaddr);
1185 IEEE80211_NODE_UNLOCK(nt);
1196 ieee80211_fakeup_adhoc_node(struct ieee80211_node_table *nt,
1199 struct ieee80211com *ic = nt->nt_ic;
1202 ni = ieee80211_dup_bss(nt, macaddr);
1267 struct ieee80211_node_table *nt = &ic->ic_scan;
1271 ni = ieee80211_find_node(nt, wh->i_addr2);
1276 ni = ic->ic_node_alloc(nt);
1281 ieee80211_setup_node(nt, ni, wh->i_addr2);
1422 struct ieee80211_node_table *nt;
1429 nt = &ic->ic_scan;
1431 nt = &ic->ic_sta;
1435 IEEE80211_NODE_LOCK(nt);
1437 ni = _ieee80211_find_node(nt, wh->i_addr1);
1439 ni = _ieee80211_find_node(nt, wh->i_addr2);
1442 IEEE80211_NODE_UNLOCK(nt);
1465 struct ieee80211_node_table *nt;
1471 nt = &ic->ic_scan;
1473 nt = &ic->ic_sta;
1476 IEEE80211_NODE_LOCK(nt);
1477 if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax) {
1478 ni = nt->nt_keyixmap[keyix];
1484 ni = _ieee80211_find_node(nt, wh->i_addr1);
1486 ni = _ieee80211_find_node(nt, wh->i_addr2);
1489 if (nt->nt_keyixmap != NULL) {
1496 if (keyix < nt->nt_keyixmax &&
1497 nt->nt_keyixmap[keyix] == NULL) {
1502 nt->nt_keyixmap[keyix] = ieee80211_ref_node(ni);
1508 IEEE80211_NODE_UNLOCK(nt);
1527 struct ieee80211_node_table *nt = &ic->ic_sta;
1537 IEEE80211_NODE_LOCK(nt);
1541 ni = _ieee80211_find_node(nt, macaddr);
1542 IEEE80211_NODE_UNLOCK(nt);
1552 ni = ieee80211_fakeup_adhoc_node(nt, macaddr);
1570 ieee80211_find_node_with_channel_debug(struct ieee80211_node_table *nt,
1574 ieee80211_find_node_with_channel(struct ieee80211_node_table *nt,
1583 IEEE80211_NODE_LOCK(nt);
1584 LIST_FOREACH(ni, &nt->nt_hash[hash], ni_hash) {
1589 IEEE80211_DPRINTF(nt->nt_ic, IEEE80211_MSG_NODE,
1595 IEEE80211_DPRINTF(nt->nt_ic, IEEE80211_MSG_NODE,
1603 IEEE80211_NODE_UNLOCK(nt);
1613 struct ieee80211_node_table *nt = ni0->ni_table;
1617 if (nt == NULL)
1629 IEEE80211_NODE_LOCK(nt);
1649 IEEE80211_NODE_UNLOCK(nt);
1659 ieee80211_find_node_with_ssid_debug(struct ieee80211_node_table *nt,
1663 ieee80211_find_node_with_ssid(struct ieee80211_node_table *nt,
1670 struct ieee80211com *ic = nt->nt_ic;
1674 IEEE80211_NODE_LOCK(nt);
1682 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
1688 LIST_FOREACH(ni, &nt->nt_hash[hash], ni_hash) {
1710 IEEE80211_NODE_UNLOCK(nt);
1720 struct ieee80211_node_table *nt = ni->ni_table;
1725 nt != NULL ? nt->nt_name : "<gone>");
1728 if (nt != NULL) {
1729 TAILQ_REMOVE(&nt->nt_node, ni, ni_list);
1742 struct ieee80211_node_table *nt = ni->ni_table;
1750 if (nt != NULL) {
1751 IEEE80211_NODE_LOCK(nt);
1758 nt->nt_keyixmap != NULL) {
1765 if (keyix < nt->nt_keyixmax &&
1766 nt->nt_keyixmap[keyix] == ni) {
1770 nt->nt_keyixmap[keyix] = NULL;
1775 IEEE80211_NODE_UNLOCK(nt);
1789 struct ieee80211_node_table *nt = &ic->ic_sta;
1806 isowned = IEEE80211_NODE_IS_LOCKED(nt);
1808 IEEE80211_NODE_LOCK(nt);
1811 if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax) {
1812 nikey = nt->nt_keyixmap[keyix];
1813 nt->nt_keyixmap[keyix] = NULL;
1837 node_reclaim(struct ieee80211_node_table *nt, struct ieee80211_node *ni)
1841 IEEE80211_NODE_LOCK_ASSERT(nt);
1846 nt->nt_name, ieee80211_node_refcnt(ni)-1);
1855 if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax &&
1856 nt->nt_keyixmap[keyix] == ni) {
1860 nt->nt_keyixmap[keyix] = NULL;
1870 TAILQ_REMOVE(&nt->nt_node, ni, ni_list);
1878 ieee80211_free_allnodes_locked(struct ieee80211_node_table *nt)
1880 struct ieee80211com *ic = nt->nt_ic;
1884 "%s: free all nodes in %s table\n", __func__, nt->nt_name);
1886 while ((ni = TAILQ_FIRST(&nt->nt_node)) != NULL) {
1892 node_reclaim(nt, ni);
1898 ieee80211_free_allnodes(struct ieee80211_node_table *nt)
1901 IEEE80211_NODE_LOCK(nt);
1902 ieee80211_free_allnodes_locked(nt);
1903 IEEE80211_NODE_UNLOCK(nt);
1910 ieee80211_timeout_scan_candidates(struct ieee80211_node_table *nt)
1912 struct ieee80211com *ic = nt->nt_ic;
1915 IEEE80211_NODE_LOCK(nt);
1922 TAILQ_FOREACH_SAFE(ni, &nt->nt_node, ni_list, tni) {
1928 node_reclaim(nt, ni);
1931 IEEE80211_NODE_UNLOCK(nt);
1933 nt->nt_inact_timer = IEEE80211_INACT_WAIT;
1947 ieee80211_timeout_stations(struct ieee80211_node_table *nt)
1949 struct ieee80211com *ic = nt->nt_ic;
1956 IEEE80211_SCAN_LOCK(nt);
1957 gen = ++nt->nt_scangen;
1958 IEEE80211_SCAN_UNLOCK(nt);
1960 "%s: %s scangen %u\n", __func__, nt->nt_name, gen);
1962 IEEE80211_SCAN_LOCK(nt);
1963 if (gen != nt->nt_scangen) {
1965 IEEE80211_SCAN_UNLOCK(nt);
1968 IEEE80211_SCAN_UNLOCK(nt);
1970 IEEE80211_NODE_LOCK(nt);
1971 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
2059 IEEE80211_NODE_UNLOCK(nt);
2085 IEEE80211_NODE_UNLOCK(nt);
2096 IEEE80211_NODE_UNLOCK(nt);
2098 nt->nt_inact_timer = IEEE80211_INACT_WAIT;
2102 ieee80211_iterate_nodes(struct ieee80211_node_table *nt, ieee80211_iter_func *f, void *arg)
2107 IEEE80211_SCAN_LOCK(nt);
2108 gen = ++nt->nt_scangen;
2109 IEEE80211_SCAN_UNLOCK(nt);
2111 IEEE80211_SCAN_LOCK(nt);
2112 if (gen != nt->nt_scangen) {
2114 IEEE80211_SCAN_UNLOCK(nt);
2117 IEEE80211_SCAN_UNLOCK(nt);
2119 IEEE80211_NODE_LOCK(nt);
2120 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
2124 IEEE80211_NODE_UNLOCK(nt);
2130 IEEE80211_NODE_UNLOCK(nt);
2134 ieee80211_dump_node(struct ieee80211_node_table *nt,
2159 ieee80211_dump_nodes(struct ieee80211_node_table *nt)
2161 ieee80211_iterate_nodes(nt,
2162 (ieee80211_iter_func *) ieee80211_dump_node, nt);
2346 struct ieee80211_node_table *nt = ni->ni_table;
2394 if (nt != NULL) {
2395 IEEE80211_NODE_LOCK(nt);
2396 node_reclaim(nt, ni);
2397 IEEE80211_NODE_UNLOCK(nt);
2406 struct ieee80211_node_table *nt = &ic->ic_sta;
2415 TAILQ_FOREACH(ni, &nt->nt_node, ni_list)
2423 TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
2431 TAILQ_FOREACH(ni, &nt->nt_node, ni_list)
2487 struct ieee80211_node_table *nt,
2495 nt->nt_ic = ic;
2497 IEEE80211_NODE_LOCK_INIT(nt, ic->ic_ifp->if_xname);
2498 IEEE80211_SCAN_LOCK_INIT(nt, ic->ic_ifp->if_xname);
2499 TAILQ_INIT(&nt->nt_node);
2500 nt->nt_name = name;
2501 nt->nt_scangen = 1;
2502 nt->nt_inact_init = inact;
2503 nt->nt_timeout = timeout;
2504 nt->nt_keyixmax = keyixmax;
2505 if (nt->nt_keyixmax > 0) {
2506 nt->nt_keyixmap = malloc(keyixmax *
2510 nt->nt_keyixmap = NULL;
2514 ieee80211_node_table_reset(struct ieee80211_node_table *nt)
2517 IEEE80211_DPRINTF(nt->nt_ic, IEEE80211_MSG_NODE,
2518 "%s %s table\n", __func__, nt->nt_name);
2520 IEEE80211_NODE_LOCK(nt);
2521 nt->nt_inact_timer = 0;
2522 ieee80211_free_allnodes_locked(nt);
2523 IEEE80211_NODE_UNLOCK(nt);
2527 ieee80211_node_table_cleanup(struct ieee80211_node_table *nt)
2530 IEEE80211_DPRINTF(nt->nt_ic, IEEE80211_MSG_NODE,
2531 "%s %s table\n", __func__, nt->nt_name);
2533 IEEE80211_NODE_LOCK(nt);
2534 ieee80211_free_allnodes_locked(nt);
2535 IEEE80211_NODE_UNLOCK(nt);
2536 if (nt->nt_keyixmap != NULL) {
2539 for (i = 0; i < nt->nt_keyixmax; i++)
2540 if (nt->nt_keyixmap[i] != NULL)
2542 nt->nt_name, i);
2543 free(nt->nt_keyixmap, M_80211_NODE);
2544 nt->nt_keyixmap = NULL;
2546 IEEE80211_SCAN_LOCK_DESTROY(nt);
2547 IEEE80211_NODE_LOCK_DESTROY(nt);