• Home
  • Raw
  • Download

Lines Matching refs:sta

55 static struct sta_info* ap_get_sta(struct ap_data *ap, u8 *sta);
57 struct sta_info *sta);
98 static void ap_sta_hash_add(struct ap_data *ap, struct sta_info *sta) in ap_sta_hash_add() argument
100 sta->hnext = ap->sta_hash[STA_HASH(sta->addr)]; in ap_sta_hash_add()
101 ap->sta_hash[STA_HASH(sta->addr)] = sta; in ap_sta_hash_add()
104 static void ap_sta_hash_del(struct ap_data *ap, struct sta_info *sta) in ap_sta_hash_del() argument
108 s = ap->sta_hash[STA_HASH(sta->addr)]; in ap_sta_hash_del()
110 if (ether_addr_equal(s->addr, sta->addr)) { in ap_sta_hash_del()
111 ap->sta_hash[STA_HASH(sta->addr)] = s->hnext; in ap_sta_hash_del()
115 while (s->hnext != NULL && !ether_addr_equal(s->hnext->addr, sta->addr)) in ap_sta_hash_del()
121 sta->addr); in ap_sta_hash_del()
124 static void ap_free_sta(struct ap_data *ap, struct sta_info *sta) in ap_free_sta() argument
126 if (sta->ap && sta->local) in ap_free_sta()
127 hostap_event_expired_sta(sta->local->dev, sta); in ap_free_sta()
131 sprintf(name, "%pM", sta->addr); in ap_free_sta()
135 if (sta->crypt) { in ap_free_sta()
136 sta->crypt->ops->deinit(sta->crypt->priv); in ap_free_sta()
137 kfree(sta->crypt); in ap_free_sta()
138 sta->crypt = NULL; in ap_free_sta()
141 skb_queue_purge(&sta->tx_buf); in ap_free_sta()
145 if (sta->aid > 0) in ap_free_sta()
146 ap->sta_aid[sta->aid - 1] = NULL; in ap_free_sta()
148 if (!sta->ap) in ap_free_sta()
149 kfree(sta->u.sta.challenge); in ap_free_sta()
150 del_timer_sync(&sta->timer); in ap_free_sta()
153 kfree(sta); in ap_free_sta()
164 static void hostap_event_new_sta(struct net_device *dev, struct sta_info *sta) in hostap_event_new_sta() argument
168 memcpy(wrqu.addr.sa_data, sta->addr, ETH_ALEN); in hostap_event_new_sta()
175 struct sta_info *sta) in hostap_event_expired_sta() argument
179 memcpy(wrqu.addr.sa_data, sta->addr, ETH_ALEN); in hostap_event_expired_sta()
189 struct sta_info *sta = (struct sta_info *) data; in ap_handle_timer() local
195 if (sta == NULL || sta->local == NULL || sta->local->ap == NULL) { in ap_handle_timer()
200 local = sta->local; in ap_handle_timer()
202 was_assoc = sta->flags & WLAN_STA_ASSOC; in ap_handle_timer()
204 if (atomic_read(&sta->users) != 0) in ap_handle_timer()
206 else if ((sta->flags & WLAN_STA_PERM) && !(sta->flags & WLAN_STA_AUTH)) in ap_handle_timer()
209 if (time_before(jiffies, sta->last_rx + ap->max_inactivity)) { in ap_handle_timer()
211 sta->timeout_next = STA_NULLFUNC; in ap_handle_timer()
212 next_time = sta->last_rx + ap->max_inactivity; in ap_handle_timer()
213 } else if (sta->timeout_next == STA_DISASSOC && in ap_handle_timer()
214 !(sta->flags & WLAN_STA_PENDING_POLL)) { in ap_handle_timer()
216 sta->timeout_next = STA_NULLFUNC; in ap_handle_timer()
221 sta->timer.expires = next_time; in ap_handle_timer()
222 add_timer(&sta->timer); in ap_handle_timer()
226 if (sta->ap) in ap_handle_timer()
227 sta->timeout_next = STA_DEAUTH; in ap_handle_timer()
229 if (sta->timeout_next == STA_DEAUTH && !(sta->flags & WLAN_STA_PERM)) { in ap_handle_timer()
231 ap_sta_hash_del(ap, sta); in ap_handle_timer()
232 list_del(&sta->list); in ap_handle_timer()
234 sta->flags &= ~(WLAN_STA_AUTH | WLAN_STA_ASSOC); in ap_handle_timer()
235 } else if (sta->timeout_next == STA_DISASSOC) in ap_handle_timer()
236 sta->flags &= ~WLAN_STA_ASSOC; in ap_handle_timer()
238 if (was_assoc && !(sta->flags & WLAN_STA_ASSOC) && !sta->ap) in ap_handle_timer()
239 hostap_event_expired_sta(local->dev, sta); in ap_handle_timer()
241 if (sta->timeout_next == STA_DEAUTH && sta->aid > 0 && in ap_handle_timer()
242 !skb_queue_empty(&sta->tx_buf)) { in ap_handle_timer()
243 hostap_set_tim(local, sta->aid, 0); in ap_handle_timer()
244 sta->flags &= ~WLAN_STA_TIM; in ap_handle_timer()
247 if (sta->ap) { in ap_handle_timer()
251 local->dev->name, sta->addr); in ap_handle_timer()
252 hostap_wds_link_oper(local, sta->addr, WDS_DEL); in ap_handle_timer()
254 } else if (sta->timeout_next == STA_NULLFUNC) { in ap_handle_timer()
260 sta->flags |= WLAN_STA_PENDING_POLL; in ap_handle_timer()
263 sta->addr, ap->tx_callback_poll); in ap_handle_timer()
265 int deauth = sta->timeout_next == STA_DEAUTH; in ap_handle_timer()
271 sta->addr, sta->last_rx, jiffies); in ap_handle_timer()
278 (char *) &resp, 2, sta->addr, 0); in ap_handle_timer()
281 if (sta->timeout_next == STA_DEAUTH) { in ap_handle_timer()
282 if (sta->flags & WLAN_STA_PERM) { in ap_handle_timer()
286 local->dev->name, sta->addr); in ap_handle_timer()
288 ap_free_sta(ap, sta); in ap_handle_timer()
292 if (sta->timeout_next == STA_NULLFUNC) { in ap_handle_timer()
293 sta->timeout_next = STA_DISASSOC; in ap_handle_timer()
294 sta->timer.expires = jiffies + AP_DISASSOC_DELAY; in ap_handle_timer()
296 sta->timeout_next = STA_DEAUTH; in ap_handle_timer()
297 sta->timer.expires = jiffies + AP_DEAUTH_DELAY; in ap_handle_timer()
300 add_timer(&sta->timer); in ap_handle_timer()
499 struct sta_info *sta; in ap_control_kick_mac() local
503 sta = ap_get_sta(ap, mac); in ap_control_kick_mac()
504 if (sta) { in ap_control_kick_mac()
505 ap_sta_hash_del(ap, sta); in ap_control_kick_mac()
506 list_del(&sta->list); in ap_control_kick_mac()
510 if (!sta) in ap_control_kick_mac()
515 (char *) &resp, 2, sta->addr, 0); in ap_control_kick_mac()
517 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap) in ap_control_kick_mac()
518 hostap_event_expired_sta(dev, sta); in ap_control_kick_mac()
520 ap_free_sta(ap, sta); in ap_control_kick_mac()
531 struct sta_info *sta; in ap_control_kickall() local
536 sta = list_entry(ptr, struct sta_info, list); in ap_control_kickall()
537 ap_sta_hash_del(ap, sta); in ap_control_kickall()
538 list_del(&sta->list); in ap_control_kickall()
539 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap && sta->local) in ap_control_kickall()
540 hostap_event_expired_sta(sta->local->dev, sta); in ap_control_kickall()
541 ap_free_sta(ap, sta); in ap_control_kickall()
551 struct sta_info *sta = v; in prism2_ap_proc_show() local
559 if (!sta->ap) in prism2_ap_proc_show()
563 sta->addr, in prism2_ap_proc_show()
564 sta->u.ap.channel, sta->last_rx_signal, in prism2_ap_proc_show()
565 sta->last_rx_silence, sta->last_rx_rate); in prism2_ap_proc_show()
567 for (i = 0; i < sta->u.ap.ssid_len; i++) { in prism2_ap_proc_show()
568 if (sta->u.ap.ssid[i] >= 32 && sta->u.ap.ssid[i] < 127) in prism2_ap_proc_show()
569 seq_putc(m, sta->u.ap.ssid[i]); in prism2_ap_proc_show()
571 seq_printf(m, "<%02x>", sta->u.ap.ssid[i]); in prism2_ap_proc_show()
575 if (sta->capability & WLAN_CAPABILITY_ESS) in prism2_ap_proc_show()
577 if (sta->capability & WLAN_CAPABILITY_IBSS) in prism2_ap_proc_show()
579 if (sta->capability & WLAN_CAPABILITY_PRIVACY) in prism2_ap_proc_show()
686 struct sta_info *sta = NULL; in hostap_ap_tx_cb_auth() local
714 sta = ap_get_sta(ap, hdr->addr1); in hostap_ap_tx_cb_auth()
715 if (sta) in hostap_ap_tx_cb_auth()
716 atomic_inc(&sta->users); in hostap_ap_tx_cb_auth()
719 if (!sta) { in hostap_ap_tx_cb_auth()
728 sta->flags |= WLAN_STA_AUTH; in hostap_ap_tx_cb_auth()
729 sta->last_auth = jiffies; in hostap_ap_tx_cb_auth()
734 if (sta) in hostap_ap_tx_cb_auth()
735 atomic_dec(&sta->users); in hostap_ap_tx_cb_auth()
754 struct sta_info *sta = NULL; in hostap_ap_tx_cb_assoc() local
778 sta = ap_get_sta(ap, hdr->addr1); in hostap_ap_tx_cb_assoc()
779 if (sta) in hostap_ap_tx_cb_assoc()
780 atomic_inc(&sta->users); in hostap_ap_tx_cb_assoc()
783 if (!sta) { in hostap_ap_tx_cb_assoc()
792 if (!(sta->flags & WLAN_STA_ASSOC)) in hostap_ap_tx_cb_assoc()
793 hostap_event_new_sta(dev, sta); in hostap_ap_tx_cb_assoc()
795 sta->flags |= WLAN_STA_ASSOC; in hostap_ap_tx_cb_assoc()
796 sta->last_assoc = jiffies; in hostap_ap_tx_cb_assoc()
801 if (sta) in hostap_ap_tx_cb_assoc()
802 atomic_dec(&sta->users); in hostap_ap_tx_cb_assoc()
816 struct sta_info *sta; in hostap_ap_tx_cb_poll() local
823 sta = ap_get_sta(ap, hdr->addr1); in hostap_ap_tx_cb_poll()
824 if (sta) in hostap_ap_tx_cb_poll()
825 sta->flags &= ~WLAN_STA_PENDING_POLL; in hostap_ap_tx_cb_poll()
911 struct sta_info *n, *sta; in hostap_free_data() local
928 list_for_each_entry_safe(sta, n, &ap->sta_list, list) { in hostap_free_data()
929 ap_sta_hash_del(ap, sta); in hostap_free_data()
930 list_del(&sta->list); in hostap_free_data()
931 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap && sta->local) in hostap_free_data()
932 hostap_event_expired_sta(sta->local->dev, sta); in hostap_free_data()
933 ap_free_sta(ap, sta); in hostap_free_data()
955 static struct sta_info* ap_get_sta(struct ap_data *ap, u8 *sta) in ap_get_sta() argument
959 s = ap->sta_hash[STA_HASH(sta)]; in ap_get_sta()
960 while (s != NULL && !ether_addr_equal(s->addr, sta)) in ap_get_sta()
1043 struct sta_info *sta = m->private; in prism2_sta_proc_show() local
1054 sta->ap ? "AP" : "STA", in prism2_sta_proc_show()
1055 sta->addr, atomic_read(&sta->users), sta->aid, in prism2_sta_proc_show()
1056 sta->flags, in prism2_sta_proc_show()
1057 sta->flags & WLAN_STA_AUTH ? " AUTH" : "", in prism2_sta_proc_show()
1058 sta->flags & WLAN_STA_ASSOC ? " ASSOC" : "", in prism2_sta_proc_show()
1059 sta->flags & WLAN_STA_PS ? " PS" : "", in prism2_sta_proc_show()
1060 sta->flags & WLAN_STA_TIM ? " TIM" : "", in prism2_sta_proc_show()
1061 sta->flags & WLAN_STA_PERM ? " PERM" : "", in prism2_sta_proc_show()
1062 sta->flags & WLAN_STA_AUTHORIZED ? " AUTHORIZED" : "", in prism2_sta_proc_show()
1063 sta->flags & WLAN_STA_PENDING_POLL ? " POLL" : "", in prism2_sta_proc_show()
1064 sta->capability, sta->listen_interval); in prism2_sta_proc_show()
1066 for (i = 0; i < sizeof(sta->supported_rates); i++) in prism2_sta_proc_show()
1067 if (sta->supported_rates[i] != 0) in prism2_sta_proc_show()
1069 (sta->supported_rates[i] & 0x7f) / 2, in prism2_sta_proc_show()
1070 sta->supported_rates[i] & 1 ? ".5" : ""); in prism2_sta_proc_show()
1080 jiffies, sta->last_auth, sta->last_assoc, sta->last_rx, in prism2_sta_proc_show()
1081 sta->last_tx, in prism2_sta_proc_show()
1082 sta->rx_packets, sta->tx_packets, sta->rx_bytes, in prism2_sta_proc_show()
1083 sta->tx_bytes, skb_queue_len(&sta->tx_buf), in prism2_sta_proc_show()
1084 sta->last_rx_silence, in prism2_sta_proc_show()
1085 sta->last_rx_signal, sta->last_rx_rate / 10, in prism2_sta_proc_show()
1086 sta->last_rx_rate % 10 ? ".5" : "", in prism2_sta_proc_show()
1087 sta->tx_rate, sta->tx_count[0], sta->tx_count[1], in prism2_sta_proc_show()
1088 sta->tx_count[2], sta->tx_count[3], sta->rx_count[0], in prism2_sta_proc_show()
1089 sta->rx_count[1], sta->rx_count[2], sta->rx_count[3]); in prism2_sta_proc_show()
1090 if (sta->crypt && sta->crypt->ops && sta->crypt->ops->print_stats) in prism2_sta_proc_show()
1091 sta->crypt->ops->print_stats(m, sta->crypt->priv); in prism2_sta_proc_show()
1093 if (sta->ap) { in prism2_sta_proc_show()
1094 if (sta->u.ap.channel >= 0) in prism2_sta_proc_show()
1095 seq_printf(m, "channel=%d\n", sta->u.ap.channel); in prism2_sta_proc_show()
1097 for (i = 0; i < sta->u.ap.ssid_len; i++) { in prism2_sta_proc_show()
1098 if (sta->u.ap.ssid[i] >= 32 && sta->u.ap.ssid[i] < 127) in prism2_sta_proc_show()
1099 seq_putc(m, sta->u.ap.ssid[i]); in prism2_sta_proc_show()
1101 seq_printf(m, "<%02x>", sta->u.ap.ssid[i]); in prism2_sta_proc_show()
1126 struct sta_info *sta; in handle_add_proc_queue() local
1135 sta = ap_get_sta(ap, entry->addr); in handle_add_proc_queue()
1136 if (sta) in handle_add_proc_queue()
1137 atomic_inc(&sta->users); in handle_add_proc_queue()
1140 if (sta) { in handle_add_proc_queue()
1141 sprintf(name, "%pM", sta->addr); in handle_add_proc_queue()
1142 sta->proc = proc_create_data( in handle_add_proc_queue()
1144 &prism2_sta_proc_fops, sta); in handle_add_proc_queue()
1146 atomic_dec(&sta->users); in handle_add_proc_queue()
1158 struct sta_info *sta; in ap_add_sta() local
1160 sta = kzalloc(sizeof(struct sta_info), GFP_ATOMIC); in ap_add_sta()
1161 if (sta == NULL) { in ap_add_sta()
1167 sta->local = ap->local; in ap_add_sta()
1168 skb_queue_head_init(&sta->tx_buf); in ap_add_sta()
1169 memcpy(sta->addr, addr, ETH_ALEN); in ap_add_sta()
1171 atomic_inc(&sta->users); in ap_add_sta()
1173 list_add(&sta->list, &ap->sta_list); in ap_add_sta()
1175 ap_sta_hash_add(ap, sta); in ap_add_sta()
1184 memcpy(entry->addr, sta->addr, ETH_ALEN); in ap_add_sta()
1193 init_timer(&sta->timer); in ap_add_sta()
1194 sta->timer.expires = jiffies + ap->max_inactivity; in ap_add_sta()
1195 sta->timer.data = (unsigned long) sta; in ap_add_sta()
1196 sta->timer.function = ap_handle_timer; in ap_add_sta()
1198 add_timer(&sta->timer); in ap_add_sta()
1201 return sta; in ap_add_sta()
1205 static int ap_tx_rate_ok(int rateidx, struct sta_info *sta, in ap_tx_rate_ok() argument
1208 if (rateidx > sta->tx_max_rate || in ap_tx_rate_ok()
1209 !(sta->tx_supp_rates & (1 << rateidx))) in ap_tx_rate_ok()
1220 static void prism2_check_tx_rates(struct sta_info *sta) in prism2_check_tx_rates() argument
1224 sta->tx_supp_rates = 0; in prism2_check_tx_rates()
1225 for (i = 0; i < sizeof(sta->supported_rates); i++) { in prism2_check_tx_rates()
1226 if ((sta->supported_rates[i] & 0x7f) == 2) in prism2_check_tx_rates()
1227 sta->tx_supp_rates |= WLAN_RATE_1M; in prism2_check_tx_rates()
1228 if ((sta->supported_rates[i] & 0x7f) == 4) in prism2_check_tx_rates()
1229 sta->tx_supp_rates |= WLAN_RATE_2M; in prism2_check_tx_rates()
1230 if ((sta->supported_rates[i] & 0x7f) == 11) in prism2_check_tx_rates()
1231 sta->tx_supp_rates |= WLAN_RATE_5M5; in prism2_check_tx_rates()
1232 if ((sta->supported_rates[i] & 0x7f) == 22) in prism2_check_tx_rates()
1233 sta->tx_supp_rates |= WLAN_RATE_11M; in prism2_check_tx_rates()
1235 sta->tx_max_rate = sta->tx_rate = sta->tx_rate_idx = 0; in prism2_check_tx_rates()
1236 if (sta->tx_supp_rates & WLAN_RATE_1M) { in prism2_check_tx_rates()
1237 sta->tx_max_rate = 0; in prism2_check_tx_rates()
1238 if (ap_tx_rate_ok(0, sta, sta->local)) { in prism2_check_tx_rates()
1239 sta->tx_rate = 10; in prism2_check_tx_rates()
1240 sta->tx_rate_idx = 0; in prism2_check_tx_rates()
1243 if (sta->tx_supp_rates & WLAN_RATE_2M) { in prism2_check_tx_rates()
1244 sta->tx_max_rate = 1; in prism2_check_tx_rates()
1245 if (ap_tx_rate_ok(1, sta, sta->local)) { in prism2_check_tx_rates()
1246 sta->tx_rate = 20; in prism2_check_tx_rates()
1247 sta->tx_rate_idx = 1; in prism2_check_tx_rates()
1250 if (sta->tx_supp_rates & WLAN_RATE_5M5) { in prism2_check_tx_rates()
1251 sta->tx_max_rate = 2; in prism2_check_tx_rates()
1252 if (ap_tx_rate_ok(2, sta, sta->local)) { in prism2_check_tx_rates()
1253 sta->tx_rate = 55; in prism2_check_tx_rates()
1254 sta->tx_rate_idx = 2; in prism2_check_tx_rates()
1257 if (sta->tx_supp_rates & WLAN_RATE_11M) { in prism2_check_tx_rates()
1258 sta->tx_max_rate = 3; in prism2_check_tx_rates()
1259 if (ap_tx_rate_ok(3, sta, sta->local)) { in prism2_check_tx_rates()
1260 sta->tx_rate = 110; in prism2_check_tx_rates()
1261 sta->tx_rate_idx = 3; in prism2_check_tx_rates()
1357 struct sta_info *sta = NULL; in handle_authen() local
1372 sta = ap_get_sta(local->ap, hdr->addr2); in handle_authen()
1373 if (sta) in handle_authen()
1374 atomic_inc(&sta->users); in handle_authen()
1377 if (sta && sta->crypt) in handle_authen()
1378 crypt = sta->crypt; in handle_authen()
1428 if (sta && sta->ap) { in handle_authen()
1429 if (time_after(jiffies, sta->u.ap.last_beacon + in handle_authen()
1430 (10 * sta->listen_interval * HZ) / 1024)) { in handle_authen()
1433 dev->name, sta->addr); in handle_authen()
1434 sta->ap = 0; in handle_authen()
1435 sta->flags = 0; in handle_authen()
1436 sta->u.sta.challenge = NULL; in handle_authen()
1447 (auth_transaction == 3 && sta != NULL && in handle_authen()
1448 sta->u.sta.challenge != NULL)))) { in handle_authen()
1455 if (sta == NULL) { in handle_authen()
1465 sta = ap_add_sta(local->ap, hdr->addr2); in handle_authen()
1466 if (sta == NULL) { in handle_authen()
1481 sta->flags |= WLAN_STA_AUTH; in handle_authen()
1486 if (sta->u.sta.challenge == NULL) { in handle_authen()
1487 sta->u.sta.challenge = in handle_authen()
1489 if (sta->u.sta.challenge == NULL) { in handle_authen()
1495 if (sta->u.sta.challenge == NULL || in handle_authen()
1497 memcmp(sta->u.sta.challenge, challenge, in handle_authen()
1511 sta->flags |= WLAN_STA_AUTH; in handle_authen()
1512 kfree(sta->u.sta.challenge); in handle_authen()
1513 sta->u.sta.challenge = NULL; in handle_authen()
1528 if (resp == WLAN_STATUS_SUCCESS && sta != NULL && in handle_authen()
1529 sta->u.sta.challenge != NULL && in handle_authen()
1535 memcpy(pos, sta->u.sta.challenge, WLAN_AUTH_CHALLENGE_LEN); in handle_authen()
1542 if (sta) { in handle_authen()
1543 sta->last_rx = jiffies; in handle_authen()
1544 atomic_dec(&sta->users); in handle_authen()
1567 struct sta_info *sta = NULL; in handle_assoc() local
1582 sta = ap_get_sta(local->ap, hdr->addr2); in handle_assoc()
1583 if (sta == NULL || (sta->flags & WLAN_STA_AUTH) == 0) { in handle_assoc()
1588 sta = NULL; /* do not decrement sta->users */ in handle_assoc()
1591 atomic_inc(&sta->users); in handle_assoc()
1595 sta->capability = __le16_to_cpu(*pos); in handle_assoc()
1597 sta->listen_interval = __le16_to_cpu(*pos); in handle_assoc()
1644 memset(sta->supported_rates, 0, in handle_assoc()
1645 sizeof(sta->supported_rates)); in handle_assoc()
1646 memcpy(sta->supported_rates, u, ileft); in handle_assoc()
1647 prism2_check_tx_rates(sta); in handle_assoc()
1670 if (sta->aid > 0) in handle_assoc()
1674 for (sta->aid = 1; sta->aid <= MAX_AID_TABLE_SIZE; sta->aid++) in handle_assoc()
1675 if (local->ap->sta_aid[sta->aid - 1] == NULL) in handle_assoc()
1677 if (sta->aid > MAX_AID_TABLE_SIZE) { in handle_assoc()
1678 sta->aid = 0; in handle_assoc()
1683 local->ap->sta_aid[sta->aid - 1] = sta; in handle_assoc()
1707 *pos = cpu_to_le16((sta && sta->aid > 0 ? sta->aid : 0) | in handle_assoc()
1745 if (sta) { in handle_assoc()
1747 sta->last_rx = jiffies; in handle_assoc()
1751 atomic_dec(&sta->users); in handle_assoc()
1776 struct sta_info *sta = NULL; in handle_deauth() local
1793 sta = ap_get_sta(local->ap, hdr->addr2); in handle_deauth()
1794 if (sta != NULL) { in handle_deauth()
1795 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap) in handle_deauth()
1796 hostap_event_expired_sta(local->dev, sta); in handle_deauth()
1797 sta->flags &= ~(WLAN_STA_AUTH | WLAN_STA_ASSOC); in handle_deauth()
1800 if (sta == NULL) { in handle_deauth()
1818 struct sta_info *sta = NULL; in handle_disassoc() local
1835 sta = ap_get_sta(local->ap, hdr->addr2); in handle_disassoc()
1836 if (sta != NULL) { in handle_disassoc()
1837 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap) in handle_disassoc()
1838 hostap_event_expired_sta(local->dev, sta); in handle_disassoc()
1839 sta->flags &= ~WLAN_STA_ASSOC; in handle_disassoc()
1842 if (sta == NULL) { in handle_disassoc()
1872 struct sta_info *sta; in ap_handle_dropped_data() local
1876 sta = ap_get_sta(local->ap, hdr->addr2); in ap_handle_dropped_data()
1877 if (sta) in ap_handle_dropped_data()
1878 atomic_inc(&sta->users); in ap_handle_dropped_data()
1881 if (sta != NULL && (sta->flags & WLAN_STA_ASSOC)) { in ap_handle_dropped_data()
1883 atomic_dec(&sta->users); in ap_handle_dropped_data()
1889 ((sta == NULL || !(sta->flags & WLAN_STA_ASSOC)) ? in ap_handle_dropped_data()
1893 if (sta) in ap_handle_dropped_data()
1894 atomic_dec(&sta->users); in ap_handle_dropped_data()
1901 static void pspoll_send_buffered(local_info_t *local, struct sta_info *sta, in pspoll_send_buffered() argument
1906 if (!(sta->flags & WLAN_STA_PS)) { in pspoll_send_buffered()
1917 if (!skb_queue_empty(&sta->tx_buf)) { in pspoll_send_buffered()
1931 struct sta_info *sta; in handle_pspoll() local
1958 sta = ap_get_sta(local->ap, hdr->addr2); in handle_pspoll()
1959 if (sta) in handle_pspoll()
1960 atomic_inc(&sta->users); in handle_pspoll()
1963 if (sta == NULL) { in handle_pspoll()
1967 if (sta->aid != aid) { in handle_pspoll()
1969 "assoc.aid=%d\n", aid, sta->aid); in handle_pspoll()
1982 while ((skb = skb_dequeue(&sta->tx_buf)) != NULL) { in handle_pspoll()
1985 " (buffer_count=%d)\n", skb_queue_len(&sta->tx_buf)); in handle_pspoll()
1987 pspoll_send_buffered(local, sta, skb); in handle_pspoll()
1989 if (sta->flags & WLAN_STA_PS) { in handle_pspoll()
1998 if (skb_queue_empty(&sta->tx_buf)) { in handle_pspoll()
2000 if (!(sta->flags & WLAN_STA_TIM)) in handle_pspoll()
2004 sta->flags &= ~WLAN_STA_TIM; in handle_pspoll()
2007 atomic_dec(&sta->users); in handle_pspoll()
2055 struct sta_info *sta = NULL; in handle_beacon() local
2145 sta = ap_get_sta(local->ap, hdr->addr2); in handle_beacon()
2146 if (sta != NULL) in handle_beacon()
2147 atomic_inc(&sta->users); in handle_beacon()
2150 if (sta == NULL) { in handle_beacon()
2153 sta = ap_add_sta(local->ap, hdr->addr2); in handle_beacon()
2154 if (sta == NULL) { in handle_beacon()
2159 hostap_event_new_sta(local->dev, sta); in handle_beacon()
2163 sta->flags = WLAN_STA_AUTH | WLAN_STA_ASSOC; in handle_beacon()
2166 hostap_wds_link_oper(local, sta->addr, WDS_ADD); in handle_beacon()
2170 sta->ap = 1; in handle_beacon()
2172 sta->u.ap.ssid_len = ssid_len; in handle_beacon()
2173 memcpy(sta->u.ap.ssid, ssid, ssid_len); in handle_beacon()
2174 sta->u.ap.ssid[ssid_len] = '\0'; in handle_beacon()
2176 sta->u.ap.ssid_len = 0; in handle_beacon()
2177 sta->u.ap.ssid[0] = '\0'; in handle_beacon()
2179 sta->u.ap.channel = channel; in handle_beacon()
2180 sta->rx_packets++; in handle_beacon()
2181 sta->rx_bytes += len; in handle_beacon()
2182 sta->u.ap.last_beacon = sta->last_rx = jiffies; in handle_beacon()
2183 sta->capability = capability; in handle_beacon()
2184 sta->listen_interval = beacon_int; in handle_beacon()
2186 atomic_dec(&sta->users); in handle_beacon()
2189 memset(sta->supported_rates, 0, sizeof(sta->supported_rates)); in handle_beacon()
2190 memcpy(sta->supported_rates, supp_rates, supp_rates_len); in handle_beacon()
2191 prism2_check_tx_rates(sta); in handle_beacon()
2351 static void schedule_packet_send(local_info_t *local, struct sta_info *sta) in schedule_packet_send() argument
2357 if (skb_queue_empty(&sta->tx_buf)) in schedule_packet_send()
2373 memcpy(hdr->addr2, sta->addr, ETH_ALEN); in schedule_packet_send()
2374 hdr->duration_id = cpu_to_le16(sta->aid | BIT(15) | BIT(14)); in schedule_packet_send()
2378 local->dev->name, sta->addr); in schedule_packet_send()
2399 struct sta_info *sta = (struct sta_info *) ptr; in prism2_ap_get_sta_qual() local
2401 if (aplist && !sta->ap) in prism2_ap_get_sta_qual()
2404 memcpy(addr[count].sa_data, sta->addr, ETH_ALEN); in prism2_ap_get_sta_qual()
2405 if (sta->last_rx_silence == 0) in prism2_ap_get_sta_qual()
2406 qual[count].qual = sta->last_rx_signal < 27 ? in prism2_ap_get_sta_qual()
2407 0 : (sta->last_rx_signal - 27) * 92 / 127; in prism2_ap_get_sta_qual()
2409 qual[count].qual = sta->last_rx_signal - in prism2_ap_get_sta_qual()
2410 sta->last_rx_silence - 35; in prism2_ap_get_sta_qual()
2411 qual[count].level = HFA384X_LEVEL_TO_dBm(sta->last_rx_signal); in prism2_ap_get_sta_qual()
2412 qual[count].noise = HFA384X_LEVEL_TO_dBm(sta->last_rx_silence); in prism2_ap_get_sta_qual()
2413 qual[count].updated = sta->last_rx_updated; in prism2_ap_get_sta_qual()
2415 sta->last_rx_updated = IW_QUAL_DBM; in prism2_ap_get_sta_qual()
2451 struct sta_info *sta = (struct sta_info *) ptr; in prism2_ap_translate_scan() local
2457 memcpy(iwe.u.ap_addr.sa_data, sta->addr, ETH_ALEN); in prism2_ap_translate_scan()
2466 if (sta->ap) in prism2_ap_translate_scan()
2477 if (sta->last_rx_silence == 0) in prism2_ap_translate_scan()
2478 iwe.u.qual.qual = sta->last_rx_signal < 27 ? in prism2_ap_translate_scan()
2479 0 : (sta->last_rx_signal - 27) * 92 / 127; in prism2_ap_translate_scan()
2481 iwe.u.qual.qual = sta->last_rx_signal - in prism2_ap_translate_scan()
2482 sta->last_rx_silence - 35; in prism2_ap_translate_scan()
2483 iwe.u.qual.level = HFA384X_LEVEL_TO_dBm(sta->last_rx_signal); in prism2_ap_translate_scan()
2484 iwe.u.qual.noise = HFA384X_LEVEL_TO_dBm(sta->last_rx_silence); in prism2_ap_translate_scan()
2485 iwe.u.qual.updated = sta->last_rx_updated; in prism2_ap_translate_scan()
2491 if (sta->ap) { in prism2_ap_translate_scan()
2494 iwe.u.data.length = sta->u.ap.ssid_len; in prism2_ap_translate_scan()
2498 sta->u.ap.ssid); in prism2_ap_translate_scan()
2502 if (sta->capability & WLAN_CAPABILITY_PRIVACY) in prism2_ap_translate_scan()
2509 sta->u.ap.ssid); in prism2_ap_translate_scan()
2511 if (sta->u.ap.channel > 0 && in prism2_ap_translate_scan()
2512 sta->u.ap.channel <= FREQ_COUNT) { in prism2_ap_translate_scan()
2515 iwe.u.freq.m = freq_list[sta->u.ap.channel - 1] in prism2_ap_translate_scan()
2526 sta->listen_interval); in prism2_ap_translate_scan()
2533 sta->last_rx_updated = IW_QUAL_DBM; in prism2_ap_translate_scan()
2547 struct sta_info *sta; in prism2_hostapd_add_sta() local
2550 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_add_sta()
2551 if (sta) in prism2_hostapd_add_sta()
2552 atomic_inc(&sta->users); in prism2_hostapd_add_sta()
2555 if (sta == NULL) { in prism2_hostapd_add_sta()
2556 sta = ap_add_sta(ap, param->sta_addr); in prism2_hostapd_add_sta()
2557 if (sta == NULL) in prism2_hostapd_add_sta()
2561 if (!(sta->flags & WLAN_STA_ASSOC) && !sta->ap && sta->local) in prism2_hostapd_add_sta()
2562 hostap_event_new_sta(sta->local->dev, sta); in prism2_hostapd_add_sta()
2564 sta->flags |= WLAN_STA_AUTH | WLAN_STA_ASSOC; in prism2_hostapd_add_sta()
2565 sta->last_rx = jiffies; in prism2_hostapd_add_sta()
2566 sta->aid = param->u.add_sta.aid; in prism2_hostapd_add_sta()
2567 sta->capability = param->u.add_sta.capability; in prism2_hostapd_add_sta()
2568 sta->tx_supp_rates = param->u.add_sta.tx_supp_rates; in prism2_hostapd_add_sta()
2569 if (sta->tx_supp_rates & WLAN_RATE_1M) in prism2_hostapd_add_sta()
2570 sta->supported_rates[0] = 2; in prism2_hostapd_add_sta()
2571 if (sta->tx_supp_rates & WLAN_RATE_2M) in prism2_hostapd_add_sta()
2572 sta->supported_rates[1] = 4; in prism2_hostapd_add_sta()
2573 if (sta->tx_supp_rates & WLAN_RATE_5M5) in prism2_hostapd_add_sta()
2574 sta->supported_rates[2] = 11; in prism2_hostapd_add_sta()
2575 if (sta->tx_supp_rates & WLAN_RATE_11M) in prism2_hostapd_add_sta()
2576 sta->supported_rates[3] = 22; in prism2_hostapd_add_sta()
2577 prism2_check_tx_rates(sta); in prism2_hostapd_add_sta()
2578 atomic_dec(&sta->users); in prism2_hostapd_add_sta()
2586 struct sta_info *sta; in prism2_hostapd_remove_sta() local
2589 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_remove_sta()
2590 if (sta) { in prism2_hostapd_remove_sta()
2591 ap_sta_hash_del(ap, sta); in prism2_hostapd_remove_sta()
2592 list_del(&sta->list); in prism2_hostapd_remove_sta()
2596 if (!sta) in prism2_hostapd_remove_sta()
2599 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap && sta->local) in prism2_hostapd_remove_sta()
2600 hostap_event_expired_sta(sta->local->dev, sta); in prism2_hostapd_remove_sta()
2601 ap_free_sta(ap, sta); in prism2_hostapd_remove_sta()
2610 struct sta_info *sta; in prism2_hostapd_get_info_sta() local
2613 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_get_info_sta()
2614 if (sta) in prism2_hostapd_get_info_sta()
2615 atomic_inc(&sta->users); in prism2_hostapd_get_info_sta()
2618 if (!sta) in prism2_hostapd_get_info_sta()
2621 param->u.get_info_sta.inactive_sec = (jiffies - sta->last_rx) / HZ; in prism2_hostapd_get_info_sta()
2623 atomic_dec(&sta->users); in prism2_hostapd_get_info_sta()
2632 struct sta_info *sta; in prism2_hostapd_set_flags_sta() local
2635 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_set_flags_sta()
2636 if (sta) { in prism2_hostapd_set_flags_sta()
2637 sta->flags |= param->u.set_flags_sta.flags_or; in prism2_hostapd_set_flags_sta()
2638 sta->flags &= param->u.set_flags_sta.flags_and; in prism2_hostapd_set_flags_sta()
2642 if (!sta) in prism2_hostapd_set_flags_sta()
2652 struct sta_info *sta; in prism2_hostapd_sta_clear_stats() local
2656 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_sta_clear_stats()
2657 if (sta) { in prism2_hostapd_sta_clear_stats()
2658 sta->rx_packets = sta->tx_packets = 0; in prism2_hostapd_sta_clear_stats()
2659 sta->rx_bytes = sta->tx_bytes = 0; in prism2_hostapd_sta_clear_stats()
2661 sta->tx_count[rate] = 0; in prism2_hostapd_sta_clear_stats()
2662 sta->rx_count[rate] = 0; in prism2_hostapd_sta_clear_stats()
2667 if (!sta) in prism2_hostapd_sta_clear_stats()
2700 static int ap_update_sta_tx_rate(struct sta_info *sta, struct net_device *dev) in ap_update_sta_tx_rate() argument
2702 int ret = sta->tx_rate; in ap_update_sta_tx_rate()
2709 sta->tx_count[sta->tx_rate_idx]++; in ap_update_sta_tx_rate()
2710 sta->tx_since_last_failure++; in ap_update_sta_tx_rate()
2711 sta->tx_consecutive_exc = 0; in ap_update_sta_tx_rate()
2712 if (sta->tx_since_last_failure >= WLAN_RATE_UPDATE_COUNT && in ap_update_sta_tx_rate()
2713 sta->tx_rate_idx < sta->tx_max_rate) { in ap_update_sta_tx_rate()
2716 old_rate = new_rate = sta->tx_rate_idx; in ap_update_sta_tx_rate()
2717 while (new_rate < sta->tx_max_rate) { in ap_update_sta_tx_rate()
2719 if (ap_tx_rate_ok(new_rate, sta, local)) { in ap_update_sta_tx_rate()
2720 sta->tx_rate_idx = new_rate; in ap_update_sta_tx_rate()
2724 if (old_rate != sta->tx_rate_idx) { in ap_update_sta_tx_rate()
2725 switch (sta->tx_rate_idx) { in ap_update_sta_tx_rate()
2726 case 0: sta->tx_rate = 10; break; in ap_update_sta_tx_rate()
2727 case 1: sta->tx_rate = 20; break; in ap_update_sta_tx_rate()
2728 case 2: sta->tx_rate = 55; break; in ap_update_sta_tx_rate()
2729 case 3: sta->tx_rate = 110; break; in ap_update_sta_tx_rate()
2730 default: sta->tx_rate = 0; break; in ap_update_sta_tx_rate()
2733 dev->name, sta->addr, sta->tx_rate); in ap_update_sta_tx_rate()
2735 sta->tx_since_last_failure = 0; in ap_update_sta_tx_rate()
2746 struct sta_info *sta = NULL; in hostap_handle_sta_tx() local
2769 sta = ap_get_sta(local->ap, hdr->addr1); in hostap_handle_sta_tx()
2770 if (sta) in hostap_handle_sta_tx()
2771 atomic_inc(&sta->users); in hostap_handle_sta_tx()
2774 if (local->iw_mode == IW_MODE_MASTER && sta == NULL && in hostap_handle_sta_tx()
2794 if (sta == NULL) in hostap_handle_sta_tx()
2797 if (!(sta->flags & WLAN_STA_AUTHORIZED)) in hostap_handle_sta_tx()
2803 ap_update_sta_tx_rate(sta, local->dev); in hostap_handle_sta_tx()
2808 if (!(sta->flags & WLAN_STA_PS)) in hostap_handle_sta_tx()
2823 if (skb_queue_len(&sta->tx_buf) >= STA_MAX_TX_BUFFER) { in hostap_handle_sta_tx()
2826 local->dev->name, sta->addr); in hostap_handle_sta_tx()
2831 hostap_set_tim(local, sta->aid, 1); in hostap_handle_sta_tx()
2832 sta->flags |= WLAN_STA_TIM; in hostap_handle_sta_tx()
2838 set_tim = skb_queue_empty(&sta->tx_buf); in hostap_handle_sta_tx()
2839 skb_queue_tail(&sta->tx_buf, skb); in hostap_handle_sta_tx()
2844 if (sta->flags & WLAN_STA_TIM) in hostap_handle_sta_tx()
2846 sta->aid); in hostap_handle_sta_tx()
2847 hostap_set_tim(local, sta->aid, 1); in hostap_handle_sta_tx()
2848 sta->flags |= WLAN_STA_TIM; in hostap_handle_sta_tx()
2854 if (sta != NULL) { in hostap_handle_sta_tx()
2857 sta->tx_packets++; in hostap_handle_sta_tx()
2858 sta->tx_bytes += skb->len; in hostap_handle_sta_tx()
2859 sta->last_tx = jiffies; in hostap_handle_sta_tx()
2864 sta->crypt && tx->host_encrypt) { in hostap_handle_sta_tx()
2865 tx->crypt = sta->crypt; in hostap_handle_sta_tx()
2866 tx->sta_ptr = sta; /* hostap_handle_sta_release() will in hostap_handle_sta_tx()
2870 atomic_dec(&sta->users); in hostap_handle_sta_tx()
2879 struct sta_info *sta = ptr; in hostap_handle_sta_release() local
2880 atomic_dec(&sta->users); in hostap_handle_sta_release()
2887 struct sta_info *sta; in hostap_handle_sta_tx_exc() local
2895 sta = ap_get_sta(local->ap, hdr->addr1); in hostap_handle_sta_tx_exc()
2896 if (!sta) { in hostap_handle_sta_tx_exc()
2904 sta->tx_since_last_failure = 0; in hostap_handle_sta_tx_exc()
2905 sta->tx_consecutive_exc++; in hostap_handle_sta_tx_exc()
2907 if (sta->tx_consecutive_exc >= WLAN_RATE_DECREASE_THRESHOLD && in hostap_handle_sta_tx_exc()
2908 sta->tx_rate_idx > 0 && meta->rate <= sta->tx_rate) { in hostap_handle_sta_tx_exc()
2911 old = rate = sta->tx_rate_idx; in hostap_handle_sta_tx_exc()
2914 if (ap_tx_rate_ok(rate, sta, local)) { in hostap_handle_sta_tx_exc()
2915 sta->tx_rate_idx = rate; in hostap_handle_sta_tx_exc()
2919 if (old != sta->tx_rate_idx) { in hostap_handle_sta_tx_exc()
2920 switch (sta->tx_rate_idx) { in hostap_handle_sta_tx_exc()
2921 case 0: sta->tx_rate = 10; break; in hostap_handle_sta_tx_exc()
2922 case 1: sta->tx_rate = 20; break; in hostap_handle_sta_tx_exc()
2923 case 2: sta->tx_rate = 55; break; in hostap_handle_sta_tx_exc()
2924 case 3: sta->tx_rate = 110; break; in hostap_handle_sta_tx_exc()
2925 default: sta->tx_rate = 0; break; in hostap_handle_sta_tx_exc()
2929 local->dev->name, sta->addr, sta->tx_rate); in hostap_handle_sta_tx_exc()
2931 sta->tx_consecutive_exc = 0; in hostap_handle_sta_tx_exc()
2937 static void hostap_update_sta_ps2(local_info_t *local, struct sta_info *sta, in hostap_update_sta_ps2() argument
2940 if (pwrmgt && !(sta->flags & WLAN_STA_PS)) { in hostap_update_sta_ps2()
2941 sta->flags |= WLAN_STA_PS; in hostap_update_sta_ps2()
2944 sta->addr, type >> 2, stype >> 4); in hostap_update_sta_ps2()
2945 } else if (!pwrmgt && (sta->flags & WLAN_STA_PS)) { in hostap_update_sta_ps2()
2946 sta->flags &= ~WLAN_STA_PS; in hostap_update_sta_ps2()
2949 sta->addr, type >> 2, stype >> 4); in hostap_update_sta_ps2()
2952 schedule_packet_send(local, sta); in hostap_update_sta_ps2()
2961 struct sta_info *sta; in hostap_update_sta_ps() local
2965 sta = ap_get_sta(local->ap, hdr->addr2); in hostap_update_sta_ps()
2966 if (sta) in hostap_update_sta_ps()
2967 atomic_inc(&sta->users); in hostap_update_sta_ps()
2970 if (!sta) in hostap_update_sta_ps()
2974 hostap_update_sta_ps2(local, sta, fc & IEEE80211_FCTL_PM, in hostap_update_sta_ps()
2978 atomic_dec(&sta->users); in hostap_update_sta_ps()
2991 struct sta_info *sta; in hostap_handle_sta_rx() local
3005 sta = ap_get_sta(local->ap, hdr->addr2); in hostap_handle_sta_rx()
3006 if (sta) in hostap_handle_sta_rx()
3007 atomic_inc(&sta->users); in hostap_handle_sta_rx()
3010 if (sta && !(sta->flags & WLAN_STA_AUTHORIZED)) in hostap_handle_sta_rx()
3017 if (!wds && (sta == NULL || !(sta->flags & WLAN_STA_ASSOC))) { in hostap_handle_sta_rx()
3046 } else if (stype == IEEE80211_STYPE_NULLFUNC && sta == NULL && in hostap_handle_sta_rx()
3087 if (sta) { in hostap_handle_sta_rx()
3088 hostap_update_sta_ps2(local, sta, fc & IEEE80211_FCTL_PM, in hostap_handle_sta_rx()
3091 sta->rx_packets++; in hostap_handle_sta_rx()
3092 sta->rx_bytes += skb->len; in hostap_handle_sta_rx()
3093 sta->last_rx = jiffies; in hostap_handle_sta_rx()
3116 if (sta) in hostap_handle_sta_rx()
3117 atomic_dec(&sta->users); in hostap_handle_sta_rx()
3129 struct sta_info *sta; in hostap_handle_sta_crypto() local
3132 sta = ap_get_sta(local->ap, hdr->addr2); in hostap_handle_sta_crypto()
3133 if (sta) in hostap_handle_sta_crypto()
3134 atomic_inc(&sta->users); in hostap_handle_sta_crypto()
3137 if (!sta) in hostap_handle_sta_crypto()
3140 if (sta->crypt) { in hostap_handle_sta_crypto()
3141 *crypt = sta->crypt; in hostap_handle_sta_crypto()
3142 *sta_ptr = sta; in hostap_handle_sta_crypto()
3146 atomic_dec(&sta->users); in hostap_handle_sta_crypto()
3155 struct sta_info *sta; in hostap_is_sta_assoc() local
3159 sta = ap_get_sta(ap, sta_addr); in hostap_is_sta_assoc()
3160 if (sta != NULL && (sta->flags & WLAN_STA_ASSOC) && !sta->ap) in hostap_is_sta_assoc()
3171 struct sta_info *sta; in hostap_is_sta_authorized() local
3175 sta = ap_get_sta(ap, sta_addr); in hostap_is_sta_authorized()
3176 if (sta != NULL && (sta->flags & WLAN_STA_ASSOC) && !sta->ap && in hostap_is_sta_authorized()
3177 ((sta->flags & WLAN_STA_AUTHORIZED) || in hostap_is_sta_authorized()
3189 struct sta_info *sta; in hostap_add_sta() local
3196 sta = ap_get_sta(ap, sta_addr); in hostap_add_sta()
3197 if (sta) in hostap_add_sta()
3202 sta = ap_add_sta(ap, sta_addr); in hostap_add_sta()
3203 if (!sta) in hostap_add_sta()
3205 sta->flags = WLAN_STA_AUTH | WLAN_STA_ASSOC; in hostap_add_sta()
3206 sta->ap = 1; in hostap_add_sta()
3207 memset(sta->supported_rates, 0, sizeof(sta->supported_rates)); in hostap_add_sta()
3211 sta->supported_rates[0] = 0x82; in hostap_add_sta()
3212 sta->supported_rates[1] = 0x84; in hostap_add_sta()
3213 sta->supported_rates[2] = 0x0b; in hostap_add_sta()
3214 sta->supported_rates[3] = 0x16; in hostap_add_sta()
3215 sta->tx_supp_rates = WLAN_RATE_1M | WLAN_RATE_2M | in hostap_add_sta()
3217 sta->tx_rate = 110; in hostap_add_sta()
3218 sta->tx_max_rate = sta->tx_rate_idx = 3; in hostap_add_sta()
3230 struct sta_info *sta; in hostap_update_rx_stats() local
3236 sta = ap_get_sta(ap, hdr->addr2); in hostap_update_rx_stats()
3237 if (sta) { in hostap_update_rx_stats()
3238 sta->last_rx_silence = rx_stats->noise; in hostap_update_rx_stats()
3239 sta->last_rx_signal = rx_stats->signal; in hostap_update_rx_stats()
3240 sta->last_rx_rate = rx_stats->rate; in hostap_update_rx_stats()
3241 sta->last_rx_updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; in hostap_update_rx_stats()
3243 sta->rx_count[0]++; in hostap_update_rx_stats()
3245 sta->rx_count[1]++; in hostap_update_rx_stats()
3247 sta->rx_count[2]++; in hostap_update_rx_stats()
3249 sta->rx_count[3]++; in hostap_update_rx_stats()
3253 return sta ? 0 : -1; in hostap_update_rx_stats()
3259 struct sta_info *sta; in hostap_update_rates() local
3266 list_for_each_entry(sta, &ap->sta_list, list) { in hostap_update_rates()
3267 prism2_check_tx_rates(sta); in hostap_update_rates()
3276 struct sta_info *sta; in ap_crypt_get_ptrs() local
3279 sta = ap_get_sta(ap, addr); in ap_crypt_get_ptrs()
3280 if (sta) in ap_crypt_get_ptrs()
3281 atomic_inc(&sta->users); in ap_crypt_get_ptrs()
3284 if (!sta && permanent) in ap_crypt_get_ptrs()
3285 sta = ap_add_sta(ap, addr); in ap_crypt_get_ptrs()
3287 if (!sta) in ap_crypt_get_ptrs()
3291 sta->flags |= WLAN_STA_PERM; in ap_crypt_get_ptrs()
3293 *crypt = &sta->crypt; in ap_crypt_get_ptrs()
3295 return sta; in ap_crypt_get_ptrs()
3302 struct sta_info *sta; in hostap_add_wds_links() local
3305 list_for_each_entry(sta, &ap->sta_list, list) { in hostap_add_wds_links()
3306 if (sta->ap) in hostap_add_wds_links()
3307 hostap_wds_link_oper(local, sta->addr, WDS_ADD); in hostap_add_wds_links()