Lines Matching refs:st
159 struct sta_table *st;
161 st = (struct sta_table *) malloc(sizeof(struct sta_table),
163 if (st == NULL)
165 IEEE80211_SCAN_TABLE_LOCK_INIT(st, "scantable");
166 mtx_init(&st->st_scanlock, "scangen", "802.11 scangen", MTX_DEF);
167 TAILQ_INIT(&st->st_entry);
168 ss->ss_priv = st;
179 struct sta_table *st = ss->ss_priv;
181 if (st != NULL) {
182 sta_flush_table(st);
183 IEEE80211_SCAN_TABLE_LOCK_DESTROY(st);
184 mtx_destroy(&st->st_scanlock);
185 free(st, M_80211_SCAN);
198 struct sta_table *st = ss->ss_priv;
200 IEEE80211_SCAN_TABLE_LOCK(st);
201 sta_flush_table(st);
202 IEEE80211_SCAN_TABLE_UNLOCK(st);
211 sta_flush_table(struct sta_table *st)
215 TAILQ_FOREACH_SAFE(se, &st->st_entry, se_list, next) {
216 TAILQ_REMOVE(&st->st_entry, se, se_list);
221 memset(st->st_maxrssi, 0, sizeof(st->st_maxrssi));
238 struct sta_table *st = ss->ss_priv;
249 IEEE80211_SCAN_TABLE_LOCK(st);
250 LIST_FOREACH(se, &st->st_hash[hash], se_hash)
256 IEEE80211_SCAN_TABLE_UNLOCK(st);
259 se->se_scangen = st->st_scaniter-1;
262 TAILQ_INSERT_TAIL(&st->st_entry, se, se_list);
263 LIST_INSERT_HEAD(&st->st_hash[hash], se, se_hash);
355 if (se->se_countrygen != st->st_scangen) {
358 se->se_countrygen = st->st_scangen;
379 if (rssi > st->st_maxrssi[sp->bchan])
380 st->st_maxrssi[sp->bchan] = rssi;
382 IEEE80211_SCAN_TABLE_UNLOCK(st);
698 struct sta_table *st = ss->ss_priv;
707 st->st_scangen++;
708 st->st_newscan = 1;
720 struct sta_table *st = ss->ss_priv;
722 st->st_newscan = 1;
1150 sta_update_notseen(struct sta_table *st)
1154 IEEE80211_SCAN_TABLE_LOCK(st);
1155 TAILQ_FOREACH(se, &st->st_entry, se_list) {
1168 IEEE80211_SCAN_TABLE_UNLOCK(st);
1172 sta_dec_fails(struct sta_table *st)
1176 IEEE80211_SCAN_TABLE_LOCK(st);
1177 TAILQ_FOREACH(se, &st->st_entry, se_list)
1180 IEEE80211_SCAN_TABLE_UNLOCK(st);
1186 struct sta_table *st = ss->ss_priv;
1191 IEEE80211_SCAN_TABLE_LOCK(st);
1192 TAILQ_FOREACH(se, &st->st_entry, se_list) {
1201 IEEE80211_SCAN_TABLE_UNLOCK(st);
1213 struct sta_table *st = ss->ss_priv;
1220 if (st->st_newscan) {
1221 sta_update_notseen(st);
1222 st->st_newscan = 0;
1238 if (TAILQ_FIRST(&st->st_entry) == NULL) {
1251 sta_dec_fails(st);
1252 st->st_newscan = 1;
1275 sta_lookup(struct sta_table *st, const uint8_t macaddr[IEEE80211_ADDR_LEN])
1280 IEEE80211_SCAN_TABLE_LOCK(st);
1281 LIST_FOREACH(se, &st->st_hash[hash], se_hash)
1284 IEEE80211_SCAN_TABLE_UNLOCK(st);
1294 struct sta_table *st = ss->ss_priv;
1300 se = sta_lookup(st, ni->ni_macaddr);
1397 struct sta_table *st = ss->ss_priv;
1401 mtx_lock(&st->st_scanlock);
1402 gen = st->st_scaniter++;
1404 IEEE80211_SCAN_TABLE_LOCK(st);
1405 TAILQ_FOREACH(se, &st->st_entry, se_list) {
1410 IEEE80211_SCAN_TABLE_UNLOCK(st);
1415 IEEE80211_SCAN_TABLE_UNLOCK(st);
1417 mtx_unlock(&st->st_scanlock);
1424 struct sta_table *st = ss->ss_priv;
1427 se = sta_lookup(st, macaddr);
1441 struct sta_table *st = ss->ss_priv;
1444 se = sta_lookup(st, macaddr);
1501 struct sta_table *st = ss->ss_priv;
1510 st->st_scangen++;
1511 st->st_newscan = 1;
1524 struct sta_table *st = ss->ss_priv;
1532 IEEE80211_SCAN_TABLE_LOCK(st);
1545 TAILQ_FOREACH(se, &st->st_entry, se_list) {
1554 IEEE80211_SCAN_TABLE_UNLOCK(st);
1566 struct sta_table *st = ss->ss_priv;
1576 if (st->st_newscan) {
1577 sta_update_notseen(st);
1578 st->st_newscan = 0;
1594 if (TAILQ_FIRST(&st->st_entry) == NULL) {
1639 sta_dec_fails(st);
1640 st->st_newscan = 1;
1670 struct sta_table *st = ss->ss_priv;
1673 IEEE80211_SCAN_TABLE_LOCK(st);
1674 TAILQ_FOREACH_SAFE(se, &st->st_entry, se_list, next) {
1676 TAILQ_REMOVE(&st->st_entry, se, se_list);
1682 IEEE80211_SCAN_TABLE_UNLOCK(st);
1727 struct sta_table *st = ss->ss_priv;
1736 st->st_scangen++;
1737 st->st_newscan = 1;
1759 struct sta_table *st = ss->ss_priv;
1782 if (st->st_maxrssi[chan->ic_ieee] == 0) {
1787 st->st_maxrssi[chan->ic_ieee] < st->st_maxrssi[bestchan->ic_ieee])
1864 struct sta_table *st = ss->ss_priv;
1872 if (st->st_newscan) {
1873 sta_update_notseen(st);
1874 st->st_newscan = 0;
1890 if (TAILQ_FIRST(&st->st_entry) == NULL) {
1924 sta_dec_fails(st);
1925 st->st_newscan = 1;