Lines Matching refs:sta

56 static struct sta_info* ap_get_sta(struct ap_data *ap, u8 *sta);
58 struct sta_info *sta);
86 static void ap_sta_hash_add(struct ap_data *ap, struct sta_info *sta) in ap_sta_hash_add() argument
88 sta->hnext = ap->sta_hash[STA_HASH(sta->addr)]; in ap_sta_hash_add()
89 ap->sta_hash[STA_HASH(sta->addr)] = sta; in ap_sta_hash_add()
92 static void ap_sta_hash_del(struct ap_data *ap, struct sta_info *sta) in ap_sta_hash_del() argument
96 s = ap->sta_hash[STA_HASH(sta->addr)]; in ap_sta_hash_del()
98 if (ether_addr_equal(s->addr, sta->addr)) { in ap_sta_hash_del()
99 ap->sta_hash[STA_HASH(sta->addr)] = s->hnext; in ap_sta_hash_del()
103 while (s->hnext != NULL && !ether_addr_equal(s->hnext->addr, sta->addr)) in ap_sta_hash_del()
109 sta->addr); in ap_sta_hash_del()
112 static void ap_free_sta(struct ap_data *ap, struct sta_info *sta) in ap_free_sta() argument
114 if (sta->ap && sta->local) in ap_free_sta()
115 hostap_event_expired_sta(sta->local->dev, sta); in ap_free_sta()
119 sprintf(name, "%pM", sta->addr); in ap_free_sta()
123 if (sta->crypt) { in ap_free_sta()
124 sta->crypt->ops->deinit(sta->crypt->priv); in ap_free_sta()
125 kfree(sta->crypt); in ap_free_sta()
126 sta->crypt = NULL; in ap_free_sta()
129 skb_queue_purge(&sta->tx_buf); in ap_free_sta()
133 if (sta->aid > 0) in ap_free_sta()
134 ap->sta_aid[sta->aid - 1] = NULL; in ap_free_sta()
136 if (!sta->ap) in ap_free_sta()
137 kfree(sta->u.sta.challenge); in ap_free_sta()
138 timer_shutdown_sync(&sta->timer); in ap_free_sta()
141 kfree(sta); in ap_free_sta()
152 static void hostap_event_new_sta(struct net_device *dev, struct sta_info *sta) in hostap_event_new_sta() argument
156 memcpy(wrqu.addr.sa_data, sta->addr, ETH_ALEN); in hostap_event_new_sta()
163 struct sta_info *sta) in hostap_event_expired_sta() argument
167 memcpy(wrqu.addr.sa_data, sta->addr, ETH_ALEN); in hostap_event_expired_sta()
177 struct sta_info *sta = from_timer(sta, t, timer); in ap_handle_timer() local
183 if (sta == NULL || sta->local == NULL || sta->local->ap == NULL) { in ap_handle_timer()
188 local = sta->local; in ap_handle_timer()
190 was_assoc = sta->flags & WLAN_STA_ASSOC; in ap_handle_timer()
192 if (atomic_read(&sta->users) != 0) in ap_handle_timer()
194 else if ((sta->flags & WLAN_STA_PERM) && !(sta->flags & WLAN_STA_AUTH)) in ap_handle_timer()
197 if (time_before(jiffies, sta->last_rx + ap->max_inactivity)) { in ap_handle_timer()
199 sta->timeout_next = STA_NULLFUNC; in ap_handle_timer()
200 next_time = sta->last_rx + ap->max_inactivity; in ap_handle_timer()
201 } else if (sta->timeout_next == STA_DISASSOC && in ap_handle_timer()
202 !(sta->flags & WLAN_STA_PENDING_POLL)) { in ap_handle_timer()
204 sta->timeout_next = STA_NULLFUNC; in ap_handle_timer()
209 sta->timer.expires = next_time; in ap_handle_timer()
210 add_timer(&sta->timer); in ap_handle_timer()
214 if (sta->ap) in ap_handle_timer()
215 sta->timeout_next = STA_DEAUTH; in ap_handle_timer()
217 if (sta->timeout_next == STA_DEAUTH && !(sta->flags & WLAN_STA_PERM)) { in ap_handle_timer()
219 ap_sta_hash_del(ap, sta); in ap_handle_timer()
220 list_del(&sta->list); in ap_handle_timer()
222 sta->flags &= ~(WLAN_STA_AUTH | WLAN_STA_ASSOC); in ap_handle_timer()
223 } else if (sta->timeout_next == STA_DISASSOC) in ap_handle_timer()
224 sta->flags &= ~WLAN_STA_ASSOC; in ap_handle_timer()
226 if (was_assoc && !(sta->flags & WLAN_STA_ASSOC) && !sta->ap) in ap_handle_timer()
227 hostap_event_expired_sta(local->dev, sta); in ap_handle_timer()
229 if (sta->timeout_next == STA_DEAUTH && sta->aid > 0 && in ap_handle_timer()
230 !skb_queue_empty(&sta->tx_buf)) { in ap_handle_timer()
231 hostap_set_tim(local, sta->aid, 0); in ap_handle_timer()
232 sta->flags &= ~WLAN_STA_TIM; in ap_handle_timer()
235 if (sta->ap) { in ap_handle_timer()
239 local->dev->name, sta->addr); in ap_handle_timer()
240 hostap_wds_link_oper(local, sta->addr, WDS_DEL); in ap_handle_timer()
242 } else if (sta->timeout_next == STA_NULLFUNC) { in ap_handle_timer()
248 sta->flags |= WLAN_STA_PENDING_POLL; in ap_handle_timer()
251 sta->addr, ap->tx_callback_poll); in ap_handle_timer()
253 int deauth = sta->timeout_next == STA_DEAUTH; in ap_handle_timer()
259 sta->addr, sta->last_rx, jiffies); in ap_handle_timer()
266 (char *) &resp, 2, sta->addr, 0); in ap_handle_timer()
269 if (sta->timeout_next == STA_DEAUTH) { in ap_handle_timer()
270 if (sta->flags & WLAN_STA_PERM) { in ap_handle_timer()
274 local->dev->name, sta->addr); in ap_handle_timer()
276 ap_free_sta(ap, sta); in ap_handle_timer()
280 if (sta->timeout_next == STA_NULLFUNC) { in ap_handle_timer()
281 sta->timeout_next = STA_DISASSOC; in ap_handle_timer()
282 sta->timer.expires = jiffies + AP_DISASSOC_DELAY; in ap_handle_timer()
284 sta->timeout_next = STA_DEAUTH; in ap_handle_timer()
285 sta->timer.expires = jiffies + AP_DEAUTH_DELAY; in ap_handle_timer()
288 add_timer(&sta->timer); in ap_handle_timer()
469 struct sta_info *sta; in ap_control_kick_mac() local
473 sta = ap_get_sta(ap, mac); in ap_control_kick_mac()
474 if (sta) { in ap_control_kick_mac()
475 ap_sta_hash_del(ap, sta); in ap_control_kick_mac()
476 list_del(&sta->list); in ap_control_kick_mac()
480 if (!sta) in ap_control_kick_mac()
485 (char *) &resp, 2, sta->addr, 0); in ap_control_kick_mac()
487 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap) in ap_control_kick_mac()
488 hostap_event_expired_sta(dev, sta); in ap_control_kick_mac()
490 ap_free_sta(ap, sta); in ap_control_kick_mac()
501 struct sta_info *sta; in ap_control_kickall() local
506 sta = list_entry(ptr, struct sta_info, list); in ap_control_kickall()
507 ap_sta_hash_del(ap, sta); in ap_control_kickall()
508 list_del(&sta->list); in ap_control_kickall()
509 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap && sta->local) in ap_control_kickall()
510 hostap_event_expired_sta(sta->local->dev, sta); in ap_control_kickall()
511 ap_free_sta(ap, sta); in ap_control_kickall()
521 struct sta_info *sta = v; in prism2_ap_proc_show() local
529 if (!sta->ap) in prism2_ap_proc_show()
533 sta->addr, in prism2_ap_proc_show()
534 sta->u.ap.channel, sta->last_rx_signal, in prism2_ap_proc_show()
535 sta->last_rx_silence, sta->last_rx_rate); in prism2_ap_proc_show()
537 for (i = 0; i < sta->u.ap.ssid_len; i++) { in prism2_ap_proc_show()
538 if (sta->u.ap.ssid[i] >= 32 && sta->u.ap.ssid[i] < 127) in prism2_ap_proc_show()
539 seq_putc(m, sta->u.ap.ssid[i]); in prism2_ap_proc_show()
541 seq_printf(m, "<%02x>", sta->u.ap.ssid[i]); in prism2_ap_proc_show()
545 if (sta->capability & WLAN_CAPABILITY_ESS) in prism2_ap_proc_show()
547 if (sta->capability & WLAN_CAPABILITY_IBSS) in prism2_ap_proc_show()
549 if (sta->capability & WLAN_CAPABILITY_PRIVACY) in prism2_ap_proc_show()
639 struct sta_info *sta = NULL; in hostap_ap_tx_cb_auth() local
667 sta = ap_get_sta(ap, hdr->addr1); in hostap_ap_tx_cb_auth()
668 if (sta) in hostap_ap_tx_cb_auth()
669 atomic_inc(&sta->users); in hostap_ap_tx_cb_auth()
672 if (!sta) { in hostap_ap_tx_cb_auth()
681 sta->flags |= WLAN_STA_AUTH; in hostap_ap_tx_cb_auth()
682 sta->last_auth = jiffies; in hostap_ap_tx_cb_auth()
687 if (sta) in hostap_ap_tx_cb_auth()
688 atomic_dec(&sta->users); in hostap_ap_tx_cb_auth()
707 struct sta_info *sta = NULL; in hostap_ap_tx_cb_assoc() local
731 sta = ap_get_sta(ap, hdr->addr1); in hostap_ap_tx_cb_assoc()
732 if (sta) in hostap_ap_tx_cb_assoc()
733 atomic_inc(&sta->users); in hostap_ap_tx_cb_assoc()
736 if (!sta) { in hostap_ap_tx_cb_assoc()
745 if (!(sta->flags & WLAN_STA_ASSOC)) in hostap_ap_tx_cb_assoc()
746 hostap_event_new_sta(dev, sta); in hostap_ap_tx_cb_assoc()
748 sta->flags |= WLAN_STA_ASSOC; in hostap_ap_tx_cb_assoc()
749 sta->last_assoc = jiffies; in hostap_ap_tx_cb_assoc()
754 if (sta) in hostap_ap_tx_cb_assoc()
755 atomic_dec(&sta->users); in hostap_ap_tx_cb_assoc()
769 struct sta_info *sta; in hostap_ap_tx_cb_poll() local
776 sta = ap_get_sta(ap, hdr->addr1); in hostap_ap_tx_cb_poll()
777 if (sta) in hostap_ap_tx_cb_poll()
778 sta->flags &= ~WLAN_STA_PENDING_POLL; in hostap_ap_tx_cb_poll()
865 struct sta_info *n, *sta; in hostap_free_data() local
882 list_for_each_entry_safe(sta, n, &ap->sta_list, list) { in hostap_free_data()
883 ap_sta_hash_del(ap, sta); in hostap_free_data()
884 list_del(&sta->list); in hostap_free_data()
885 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap && sta->local) in hostap_free_data()
886 hostap_event_expired_sta(sta->local->dev, sta); in hostap_free_data()
887 ap_free_sta(ap, sta); in hostap_free_data()
909 static struct sta_info* ap_get_sta(struct ap_data *ap, u8 *sta) in ap_get_sta() argument
913 s = ap->sta_hash[STA_HASH(sta)]; in ap_get_sta()
914 while (s != NULL && !ether_addr_equal(s->addr, sta)) in ap_get_sta()
995 struct sta_info *sta = m->private; in prism2_sta_proc_show() local
1006 sta->ap ? "AP" : "STA", in prism2_sta_proc_show()
1007 sta->addr, atomic_read(&sta->users), sta->aid, in prism2_sta_proc_show()
1008 sta->flags, in prism2_sta_proc_show()
1009 sta->flags & WLAN_STA_AUTH ? " AUTH" : "", in prism2_sta_proc_show()
1010 sta->flags & WLAN_STA_ASSOC ? " ASSOC" : "", in prism2_sta_proc_show()
1011 sta->flags & WLAN_STA_PS ? " PS" : "", in prism2_sta_proc_show()
1012 sta->flags & WLAN_STA_TIM ? " TIM" : "", in prism2_sta_proc_show()
1013 sta->flags & WLAN_STA_PERM ? " PERM" : "", in prism2_sta_proc_show()
1014 sta->flags & WLAN_STA_AUTHORIZED ? " AUTHORIZED" : "", in prism2_sta_proc_show()
1015 sta->flags & WLAN_STA_PENDING_POLL ? " POLL" : "", in prism2_sta_proc_show()
1016 sta->capability, sta->listen_interval); in prism2_sta_proc_show()
1018 for (i = 0; i < sizeof(sta->supported_rates); i++) in prism2_sta_proc_show()
1019 if (sta->supported_rates[i] != 0) in prism2_sta_proc_show()
1021 (sta->supported_rates[i] & 0x7f) / 2, in prism2_sta_proc_show()
1022 sta->supported_rates[i] & 1 ? ".5" : ""); in prism2_sta_proc_show()
1032 jiffies, sta->last_auth, sta->last_assoc, sta->last_rx, in prism2_sta_proc_show()
1033 sta->last_tx, in prism2_sta_proc_show()
1034 sta->rx_packets, sta->tx_packets, sta->rx_bytes, in prism2_sta_proc_show()
1035 sta->tx_bytes, skb_queue_len(&sta->tx_buf), in prism2_sta_proc_show()
1036 sta->last_rx_silence, in prism2_sta_proc_show()
1037 sta->last_rx_signal, sta->last_rx_rate / 10, in prism2_sta_proc_show()
1038 sta->last_rx_rate % 10 ? ".5" : "", in prism2_sta_proc_show()
1039 sta->tx_rate, sta->tx_count[0], sta->tx_count[1], in prism2_sta_proc_show()
1040 sta->tx_count[2], sta->tx_count[3], sta->rx_count[0], in prism2_sta_proc_show()
1041 sta->rx_count[1], sta->rx_count[2], sta->rx_count[3]); in prism2_sta_proc_show()
1042 if (sta->crypt && sta->crypt->ops && sta->crypt->ops->print_stats) in prism2_sta_proc_show()
1043 sta->crypt->ops->print_stats(m, sta->crypt->priv); in prism2_sta_proc_show()
1045 if (sta->ap) { in prism2_sta_proc_show()
1046 if (sta->u.ap.channel >= 0) in prism2_sta_proc_show()
1047 seq_printf(m, "channel=%d\n", sta->u.ap.channel); in prism2_sta_proc_show()
1049 for (i = 0; i < sta->u.ap.ssid_len; i++) { in prism2_sta_proc_show()
1050 if (sta->u.ap.ssid[i] >= 32 && sta->u.ap.ssid[i] < 127) in prism2_sta_proc_show()
1051 seq_putc(m, sta->u.ap.ssid[i]); in prism2_sta_proc_show()
1053 seq_printf(m, "<%02x>", sta->u.ap.ssid[i]); in prism2_sta_proc_show()
1067 struct sta_info *sta; in handle_add_proc_queue() local
1076 sta = ap_get_sta(ap, entry->addr); in handle_add_proc_queue()
1077 if (sta) in handle_add_proc_queue()
1078 atomic_inc(&sta->users); in handle_add_proc_queue()
1081 if (sta) { in handle_add_proc_queue()
1082 sprintf(name, "%pM", sta->addr); in handle_add_proc_queue()
1083 sta->proc = proc_create_single_data( in handle_add_proc_queue()
1085 prism2_sta_proc_show, sta); in handle_add_proc_queue()
1087 atomic_dec(&sta->users); in handle_add_proc_queue()
1099 struct sta_info *sta; in ap_add_sta() local
1101 sta = kzalloc(sizeof(struct sta_info), GFP_ATOMIC); in ap_add_sta()
1102 if (sta == NULL) { in ap_add_sta()
1108 sta->local = ap->local; in ap_add_sta()
1109 skb_queue_head_init(&sta->tx_buf); in ap_add_sta()
1110 memcpy(sta->addr, addr, ETH_ALEN); in ap_add_sta()
1112 atomic_inc(&sta->users); in ap_add_sta()
1114 list_add(&sta->list, &ap->sta_list); in ap_add_sta()
1116 ap_sta_hash_add(ap, sta); in ap_add_sta()
1125 memcpy(entry->addr, sta->addr, ETH_ALEN); in ap_add_sta()
1134 timer_setup(&sta->timer, ap_handle_timer, 0); in ap_add_sta()
1135 sta->timer.expires = jiffies + ap->max_inactivity; in ap_add_sta()
1137 add_timer(&sta->timer); in ap_add_sta()
1140 return sta; in ap_add_sta()
1144 static int ap_tx_rate_ok(int rateidx, struct sta_info *sta, in ap_tx_rate_ok() argument
1147 if (rateidx > sta->tx_max_rate || in ap_tx_rate_ok()
1148 !(sta->tx_supp_rates & (1 << rateidx))) in ap_tx_rate_ok()
1159 static void prism2_check_tx_rates(struct sta_info *sta) in prism2_check_tx_rates() argument
1163 sta->tx_supp_rates = 0; in prism2_check_tx_rates()
1164 for (i = 0; i < sizeof(sta->supported_rates); i++) { in prism2_check_tx_rates()
1165 if ((sta->supported_rates[i] & 0x7f) == 2) in prism2_check_tx_rates()
1166 sta->tx_supp_rates |= WLAN_RATE_1M; in prism2_check_tx_rates()
1167 if ((sta->supported_rates[i] & 0x7f) == 4) in prism2_check_tx_rates()
1168 sta->tx_supp_rates |= WLAN_RATE_2M; in prism2_check_tx_rates()
1169 if ((sta->supported_rates[i] & 0x7f) == 11) in prism2_check_tx_rates()
1170 sta->tx_supp_rates |= WLAN_RATE_5M5; in prism2_check_tx_rates()
1171 if ((sta->supported_rates[i] & 0x7f) == 22) in prism2_check_tx_rates()
1172 sta->tx_supp_rates |= WLAN_RATE_11M; in prism2_check_tx_rates()
1174 sta->tx_max_rate = sta->tx_rate = sta->tx_rate_idx = 0; in prism2_check_tx_rates()
1175 if (sta->tx_supp_rates & WLAN_RATE_1M) { in prism2_check_tx_rates()
1176 sta->tx_max_rate = 0; in prism2_check_tx_rates()
1177 if (ap_tx_rate_ok(0, sta, sta->local)) { in prism2_check_tx_rates()
1178 sta->tx_rate = 10; in prism2_check_tx_rates()
1179 sta->tx_rate_idx = 0; in prism2_check_tx_rates()
1182 if (sta->tx_supp_rates & WLAN_RATE_2M) { in prism2_check_tx_rates()
1183 sta->tx_max_rate = 1; in prism2_check_tx_rates()
1184 if (ap_tx_rate_ok(1, sta, sta->local)) { in prism2_check_tx_rates()
1185 sta->tx_rate = 20; in prism2_check_tx_rates()
1186 sta->tx_rate_idx = 1; in prism2_check_tx_rates()
1189 if (sta->tx_supp_rates & WLAN_RATE_5M5) { in prism2_check_tx_rates()
1190 sta->tx_max_rate = 2; in prism2_check_tx_rates()
1191 if (ap_tx_rate_ok(2, sta, sta->local)) { in prism2_check_tx_rates()
1192 sta->tx_rate = 55; in prism2_check_tx_rates()
1193 sta->tx_rate_idx = 2; in prism2_check_tx_rates()
1196 if (sta->tx_supp_rates & WLAN_RATE_11M) { in prism2_check_tx_rates()
1197 sta->tx_max_rate = 3; in prism2_check_tx_rates()
1198 if (ap_tx_rate_ok(3, sta, sta->local)) { in prism2_check_tx_rates()
1199 sta->tx_rate = 110; in prism2_check_tx_rates()
1200 sta->tx_rate_idx = 3; in prism2_check_tx_rates()
1295 struct sta_info *sta = NULL; in handle_authen() local
1310 sta = ap_get_sta(local->ap, hdr->addr2); in handle_authen()
1311 if (sta) in handle_authen()
1312 atomic_inc(&sta->users); in handle_authen()
1315 if (sta && sta->crypt) in handle_authen()
1316 crypt = sta->crypt; in handle_authen()
1366 if (sta && sta->ap) { in handle_authen()
1367 if (time_after(jiffies, sta->u.ap.last_beacon + in handle_authen()
1368 (10 * sta->listen_interval * HZ) / 1024)) { in handle_authen()
1371 dev->name, sta->addr); in handle_authen()
1372 sta->ap = 0; in handle_authen()
1373 sta->flags = 0; in handle_authen()
1374 sta->u.sta.challenge = NULL; in handle_authen()
1385 (auth_transaction == 3 && sta != NULL && in handle_authen()
1386 sta->u.sta.challenge != NULL)))) { in handle_authen()
1393 if (sta == NULL) { in handle_authen()
1403 sta = ap_add_sta(local->ap, hdr->addr2); in handle_authen()
1404 if (sta == NULL) { in handle_authen()
1419 sta->flags |= WLAN_STA_AUTH; in handle_authen()
1424 if (sta->u.sta.challenge == NULL) { in handle_authen()
1425 sta->u.sta.challenge = in handle_authen()
1427 if (sta->u.sta.challenge == NULL) { in handle_authen()
1433 if (sta->u.sta.challenge == NULL || in handle_authen()
1435 memcmp(sta->u.sta.challenge, challenge, in handle_authen()
1449 sta->flags |= WLAN_STA_AUTH; in handle_authen()
1450 kfree(sta->u.sta.challenge); in handle_authen()
1451 sta->u.sta.challenge = NULL; in handle_authen()
1466 if (resp == WLAN_STATUS_SUCCESS && sta != NULL && in handle_authen()
1467 sta->u.sta.challenge != NULL && in handle_authen()
1473 memcpy(pos, sta->u.sta.challenge, WLAN_AUTH_CHALLENGE_LEN); in handle_authen()
1480 if (sta) { in handle_authen()
1481 sta->last_rx = jiffies; in handle_authen()
1482 atomic_dec(&sta->users); in handle_authen()
1505 struct sta_info *sta = NULL; in handle_assoc() local
1520 sta = ap_get_sta(local->ap, hdr->addr2); in handle_assoc()
1521 if (sta == NULL || (sta->flags & WLAN_STA_AUTH) == 0) { in handle_assoc()
1526 sta = NULL; /* do not decrement sta->users */ in handle_assoc()
1529 atomic_inc(&sta->users); in handle_assoc()
1533 sta->capability = __le16_to_cpu(*pos); in handle_assoc()
1535 sta->listen_interval = __le16_to_cpu(*pos); in handle_assoc()
1582 memset(sta->supported_rates, 0, in handle_assoc()
1583 sizeof(sta->supported_rates)); in handle_assoc()
1584 memcpy(sta->supported_rates, u, ileft); in handle_assoc()
1585 prism2_check_tx_rates(sta); in handle_assoc()
1608 if (sta->aid > 0) in handle_assoc()
1612 for (sta->aid = 1; sta->aid <= MAX_AID_TABLE_SIZE; sta->aid++) in handle_assoc()
1613 if (local->ap->sta_aid[sta->aid - 1] == NULL) in handle_assoc()
1615 if (sta->aid > MAX_AID_TABLE_SIZE) { in handle_assoc()
1616 sta->aid = 0; in handle_assoc()
1621 local->ap->sta_aid[sta->aid - 1] = sta; in handle_assoc()
1645 *pos = cpu_to_le16((sta && sta->aid > 0 ? sta->aid : 0) | in handle_assoc()
1683 if (sta) { in handle_assoc()
1685 sta->last_rx = jiffies; in handle_assoc()
1689 atomic_dec(&sta->users); in handle_assoc()
1714 struct sta_info *sta = NULL; in handle_deauth() local
1731 sta = ap_get_sta(local->ap, hdr->addr2); in handle_deauth()
1732 if (sta != NULL) { in handle_deauth()
1733 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap) in handle_deauth()
1734 hostap_event_expired_sta(local->dev, sta); in handle_deauth()
1735 sta->flags &= ~(WLAN_STA_AUTH | WLAN_STA_ASSOC); in handle_deauth()
1738 if (sta == NULL) { in handle_deauth()
1756 struct sta_info *sta = NULL; in handle_disassoc() local
1773 sta = ap_get_sta(local->ap, hdr->addr2); in handle_disassoc()
1774 if (sta != NULL) { in handle_disassoc()
1775 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap) in handle_disassoc()
1776 hostap_event_expired_sta(local->dev, sta); in handle_disassoc()
1777 sta->flags &= ~WLAN_STA_ASSOC; in handle_disassoc()
1780 if (sta == NULL) { in handle_disassoc()
1810 struct sta_info *sta; in ap_handle_dropped_data() local
1814 sta = ap_get_sta(local->ap, hdr->addr2); in ap_handle_dropped_data()
1815 if (sta) in ap_handle_dropped_data()
1816 atomic_inc(&sta->users); in ap_handle_dropped_data()
1819 if (sta != NULL && (sta->flags & WLAN_STA_ASSOC)) { in ap_handle_dropped_data()
1821 atomic_dec(&sta->users); in ap_handle_dropped_data()
1827 ((sta == NULL || !(sta->flags & WLAN_STA_ASSOC)) ? in ap_handle_dropped_data()
1831 if (sta) in ap_handle_dropped_data()
1832 atomic_dec(&sta->users); in ap_handle_dropped_data()
1839 static void pspoll_send_buffered(local_info_t *local, struct sta_info *sta, in pspoll_send_buffered() argument
1844 if (!(sta->flags & WLAN_STA_PS)) { in pspoll_send_buffered()
1855 if (!skb_queue_empty(&sta->tx_buf)) { in pspoll_send_buffered()
1869 struct sta_info *sta; in handle_pspoll() local
1896 sta = ap_get_sta(local->ap, hdr->addr2); in handle_pspoll()
1897 if (sta) in handle_pspoll()
1898 atomic_inc(&sta->users); in handle_pspoll()
1901 if (sta == NULL) { in handle_pspoll()
1905 if (sta->aid != aid) { in handle_pspoll()
1907 "assoc.aid=%d\n", aid, sta->aid); in handle_pspoll()
1920 while ((skb = skb_dequeue(&sta->tx_buf)) != NULL) { in handle_pspoll()
1923 " (buffer_count=%d)\n", skb_queue_len(&sta->tx_buf)); in handle_pspoll()
1925 pspoll_send_buffered(local, sta, skb); in handle_pspoll()
1927 if (sta->flags & WLAN_STA_PS) { in handle_pspoll()
1936 if (skb_queue_empty(&sta->tx_buf)) { in handle_pspoll()
1938 if (!(sta->flags & WLAN_STA_TIM)) in handle_pspoll()
1942 sta->flags &= ~WLAN_STA_TIM; in handle_pspoll()
1945 atomic_dec(&sta->users); in handle_pspoll()
1993 struct sta_info *sta = NULL; in handle_beacon() local
2083 sta = ap_get_sta(local->ap, hdr->addr2); in handle_beacon()
2084 if (sta != NULL) in handle_beacon()
2085 atomic_inc(&sta->users); in handle_beacon()
2088 if (sta == NULL) { in handle_beacon()
2091 sta = ap_add_sta(local->ap, hdr->addr2); in handle_beacon()
2092 if (sta == NULL) { in handle_beacon()
2097 hostap_event_new_sta(local->dev, sta); in handle_beacon()
2101 sta->flags = WLAN_STA_AUTH | WLAN_STA_ASSOC; in handle_beacon()
2104 hostap_wds_link_oper(local, sta->addr, WDS_ADD); in handle_beacon()
2108 sta->ap = 1; in handle_beacon()
2110 sta->u.ap.ssid_len = ssid_len; in handle_beacon()
2111 memcpy(sta->u.ap.ssid, ssid, ssid_len); in handle_beacon()
2112 sta->u.ap.ssid[ssid_len] = '\0'; in handle_beacon()
2114 sta->u.ap.ssid_len = 0; in handle_beacon()
2115 sta->u.ap.ssid[0] = '\0'; in handle_beacon()
2117 sta->u.ap.channel = channel; in handle_beacon()
2118 sta->rx_packets++; in handle_beacon()
2119 sta->rx_bytes += len; in handle_beacon()
2120 sta->u.ap.last_beacon = sta->last_rx = jiffies; in handle_beacon()
2121 sta->capability = capability; in handle_beacon()
2122 sta->listen_interval = beacon_int; in handle_beacon()
2124 atomic_dec(&sta->users); in handle_beacon()
2127 memset(sta->supported_rates, 0, sizeof(sta->supported_rates)); in handle_beacon()
2128 memcpy(sta->supported_rates, supp_rates, supp_rates_len); in handle_beacon()
2129 prism2_check_tx_rates(sta); in handle_beacon()
2289 static void schedule_packet_send(local_info_t *local, struct sta_info *sta) in schedule_packet_send() argument
2295 if (skb_queue_empty(&sta->tx_buf)) in schedule_packet_send()
2311 memcpy(hdr->addr2, sta->addr, ETH_ALEN); in schedule_packet_send()
2312 hdr->duration_id = cpu_to_le16(sta->aid | BIT(15) | BIT(14)); in schedule_packet_send()
2316 local->dev->name, sta->addr); in schedule_packet_send()
2337 struct sta_info *sta = (struct sta_info *) ptr; in prism2_ap_get_sta_qual() local
2339 if (aplist && !sta->ap) in prism2_ap_get_sta_qual()
2342 memcpy(addr[count].sa_data, sta->addr, ETH_ALEN); in prism2_ap_get_sta_qual()
2343 if (sta->last_rx_silence == 0) in prism2_ap_get_sta_qual()
2344 qual[count].qual = sta->last_rx_signal < 27 ? in prism2_ap_get_sta_qual()
2345 0 : (sta->last_rx_signal - 27) * 92 / 127; in prism2_ap_get_sta_qual()
2347 qual[count].qual = sta->last_rx_signal - in prism2_ap_get_sta_qual()
2348 sta->last_rx_silence - 35; in prism2_ap_get_sta_qual()
2349 qual[count].level = HFA384X_LEVEL_TO_dBm(sta->last_rx_signal); in prism2_ap_get_sta_qual()
2350 qual[count].noise = HFA384X_LEVEL_TO_dBm(sta->last_rx_silence); in prism2_ap_get_sta_qual()
2351 qual[count].updated = sta->last_rx_updated; in prism2_ap_get_sta_qual()
2353 sta->last_rx_updated = IW_QUAL_DBM; in prism2_ap_get_sta_qual()
2389 struct sta_info *sta = (struct sta_info *) ptr; in prism2_ap_translate_scan() local
2395 memcpy(iwe.u.ap_addr.sa_data, sta->addr, ETH_ALEN); in prism2_ap_translate_scan()
2404 if (sta->ap) in prism2_ap_translate_scan()
2415 if (sta->last_rx_silence == 0) in prism2_ap_translate_scan()
2416 iwe.u.qual.qual = sta->last_rx_signal < 27 ? in prism2_ap_translate_scan()
2417 0 : (sta->last_rx_signal - 27) * 92 / 127; in prism2_ap_translate_scan()
2419 iwe.u.qual.qual = sta->last_rx_signal - in prism2_ap_translate_scan()
2420 sta->last_rx_silence - 35; in prism2_ap_translate_scan()
2421 iwe.u.qual.level = HFA384X_LEVEL_TO_dBm(sta->last_rx_signal); in prism2_ap_translate_scan()
2422 iwe.u.qual.noise = HFA384X_LEVEL_TO_dBm(sta->last_rx_silence); in prism2_ap_translate_scan()
2423 iwe.u.qual.updated = sta->last_rx_updated; in prism2_ap_translate_scan()
2429 if (sta->ap) { in prism2_ap_translate_scan()
2432 iwe.u.data.length = sta->u.ap.ssid_len; in prism2_ap_translate_scan()
2436 sta->u.ap.ssid); in prism2_ap_translate_scan()
2440 if (sta->capability & WLAN_CAPABILITY_PRIVACY) in prism2_ap_translate_scan()
2447 sta->u.ap.ssid); in prism2_ap_translate_scan()
2449 if (sta->u.ap.channel > 0 && in prism2_ap_translate_scan()
2450 sta->u.ap.channel <= FREQ_COUNT) { in prism2_ap_translate_scan()
2453 iwe.u.freq.m = freq_list[sta->u.ap.channel - 1] in prism2_ap_translate_scan()
2464 sta->listen_interval); in prism2_ap_translate_scan()
2471 sta->last_rx_updated = IW_QUAL_DBM; in prism2_ap_translate_scan()
2485 struct sta_info *sta; in prism2_hostapd_add_sta() local
2488 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_add_sta()
2489 if (sta) in prism2_hostapd_add_sta()
2490 atomic_inc(&sta->users); in prism2_hostapd_add_sta()
2493 if (sta == NULL) { in prism2_hostapd_add_sta()
2494 sta = ap_add_sta(ap, param->sta_addr); in prism2_hostapd_add_sta()
2495 if (sta == NULL) in prism2_hostapd_add_sta()
2499 if (!(sta->flags & WLAN_STA_ASSOC) && !sta->ap && sta->local) in prism2_hostapd_add_sta()
2500 hostap_event_new_sta(sta->local->dev, sta); in prism2_hostapd_add_sta()
2502 sta->flags |= WLAN_STA_AUTH | WLAN_STA_ASSOC; in prism2_hostapd_add_sta()
2503 sta->last_rx = jiffies; in prism2_hostapd_add_sta()
2504 sta->aid = param->u.add_sta.aid; in prism2_hostapd_add_sta()
2505 sta->capability = param->u.add_sta.capability; in prism2_hostapd_add_sta()
2506 sta->tx_supp_rates = param->u.add_sta.tx_supp_rates; in prism2_hostapd_add_sta()
2507 if (sta->tx_supp_rates & WLAN_RATE_1M) in prism2_hostapd_add_sta()
2508 sta->supported_rates[0] = 2; in prism2_hostapd_add_sta()
2509 if (sta->tx_supp_rates & WLAN_RATE_2M) in prism2_hostapd_add_sta()
2510 sta->supported_rates[1] = 4; in prism2_hostapd_add_sta()
2511 if (sta->tx_supp_rates & WLAN_RATE_5M5) in prism2_hostapd_add_sta()
2512 sta->supported_rates[2] = 11; in prism2_hostapd_add_sta()
2513 if (sta->tx_supp_rates & WLAN_RATE_11M) in prism2_hostapd_add_sta()
2514 sta->supported_rates[3] = 22; in prism2_hostapd_add_sta()
2515 prism2_check_tx_rates(sta); in prism2_hostapd_add_sta()
2516 atomic_dec(&sta->users); in prism2_hostapd_add_sta()
2524 struct sta_info *sta; in prism2_hostapd_remove_sta() local
2527 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_remove_sta()
2528 if (sta) { in prism2_hostapd_remove_sta()
2529 ap_sta_hash_del(ap, sta); in prism2_hostapd_remove_sta()
2530 list_del(&sta->list); in prism2_hostapd_remove_sta()
2534 if (!sta) in prism2_hostapd_remove_sta()
2537 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap && sta->local) in prism2_hostapd_remove_sta()
2538 hostap_event_expired_sta(sta->local->dev, sta); in prism2_hostapd_remove_sta()
2539 ap_free_sta(ap, sta); in prism2_hostapd_remove_sta()
2548 struct sta_info *sta; in prism2_hostapd_get_info_sta() local
2551 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_get_info_sta()
2552 if (sta) in prism2_hostapd_get_info_sta()
2553 atomic_inc(&sta->users); in prism2_hostapd_get_info_sta()
2556 if (!sta) in prism2_hostapd_get_info_sta()
2559 param->u.get_info_sta.inactive_sec = (jiffies - sta->last_rx) / HZ; in prism2_hostapd_get_info_sta()
2561 atomic_dec(&sta->users); in prism2_hostapd_get_info_sta()
2570 struct sta_info *sta; in prism2_hostapd_set_flags_sta() local
2573 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_set_flags_sta()
2574 if (sta) { in prism2_hostapd_set_flags_sta()
2575 sta->flags |= param->u.set_flags_sta.flags_or; in prism2_hostapd_set_flags_sta()
2576 sta->flags &= param->u.set_flags_sta.flags_and; in prism2_hostapd_set_flags_sta()
2580 if (!sta) in prism2_hostapd_set_flags_sta()
2590 struct sta_info *sta; in prism2_hostapd_sta_clear_stats() local
2594 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_sta_clear_stats()
2595 if (sta) { in prism2_hostapd_sta_clear_stats()
2596 sta->rx_packets = sta->tx_packets = 0; in prism2_hostapd_sta_clear_stats()
2597 sta->rx_bytes = sta->tx_bytes = 0; in prism2_hostapd_sta_clear_stats()
2599 sta->tx_count[rate] = 0; in prism2_hostapd_sta_clear_stats()
2600 sta->rx_count[rate] = 0; in prism2_hostapd_sta_clear_stats()
2605 if (!sta) in prism2_hostapd_sta_clear_stats()
2638 static int ap_update_sta_tx_rate(struct sta_info *sta, struct net_device *dev) in ap_update_sta_tx_rate() argument
2640 int ret = sta->tx_rate; in ap_update_sta_tx_rate()
2647 sta->tx_count[sta->tx_rate_idx]++; in ap_update_sta_tx_rate()
2648 sta->tx_since_last_failure++; in ap_update_sta_tx_rate()
2649 sta->tx_consecutive_exc = 0; in ap_update_sta_tx_rate()
2650 if (sta->tx_since_last_failure >= WLAN_RATE_UPDATE_COUNT && in ap_update_sta_tx_rate()
2651 sta->tx_rate_idx < sta->tx_max_rate) { in ap_update_sta_tx_rate()
2654 old_rate = new_rate = sta->tx_rate_idx; in ap_update_sta_tx_rate()
2655 while (new_rate < sta->tx_max_rate) { in ap_update_sta_tx_rate()
2657 if (ap_tx_rate_ok(new_rate, sta, local)) { in ap_update_sta_tx_rate()
2658 sta->tx_rate_idx = new_rate; in ap_update_sta_tx_rate()
2662 if (old_rate != sta->tx_rate_idx) { in ap_update_sta_tx_rate()
2663 switch (sta->tx_rate_idx) { in ap_update_sta_tx_rate()
2664 case 0: sta->tx_rate = 10; break; in ap_update_sta_tx_rate()
2665 case 1: sta->tx_rate = 20; break; in ap_update_sta_tx_rate()
2666 case 2: sta->tx_rate = 55; break; in ap_update_sta_tx_rate()
2667 case 3: sta->tx_rate = 110; break; in ap_update_sta_tx_rate()
2668 default: sta->tx_rate = 0; break; in ap_update_sta_tx_rate()
2671 dev->name, sta->addr, sta->tx_rate); in ap_update_sta_tx_rate()
2673 sta->tx_since_last_failure = 0; in ap_update_sta_tx_rate()
2684 struct sta_info *sta = NULL; in hostap_handle_sta_tx() local
2707 sta = ap_get_sta(local->ap, hdr->addr1); in hostap_handle_sta_tx()
2708 if (sta) in hostap_handle_sta_tx()
2709 atomic_inc(&sta->users); in hostap_handle_sta_tx()
2712 if (local->iw_mode == IW_MODE_MASTER && sta == NULL && in hostap_handle_sta_tx()
2732 if (sta == NULL) in hostap_handle_sta_tx()
2735 if (!(sta->flags & WLAN_STA_AUTHORIZED)) in hostap_handle_sta_tx()
2741 ap_update_sta_tx_rate(sta, local->dev); in hostap_handle_sta_tx()
2746 if (!(sta->flags & WLAN_STA_PS)) in hostap_handle_sta_tx()
2761 if (skb_queue_len(&sta->tx_buf) >= STA_MAX_TX_BUFFER) { in hostap_handle_sta_tx()
2764 local->dev->name, sta->addr); in hostap_handle_sta_tx()
2769 hostap_set_tim(local, sta->aid, 1); in hostap_handle_sta_tx()
2770 sta->flags |= WLAN_STA_TIM; in hostap_handle_sta_tx()
2776 set_tim = skb_queue_empty(&sta->tx_buf); in hostap_handle_sta_tx()
2777 skb_queue_tail(&sta->tx_buf, skb); in hostap_handle_sta_tx()
2782 if (sta->flags & WLAN_STA_TIM) in hostap_handle_sta_tx()
2784 sta->aid); in hostap_handle_sta_tx()
2785 hostap_set_tim(local, sta->aid, 1); in hostap_handle_sta_tx()
2786 sta->flags |= WLAN_STA_TIM; in hostap_handle_sta_tx()
2792 if (sta != NULL) { in hostap_handle_sta_tx()
2795 sta->tx_packets++; in hostap_handle_sta_tx()
2796 sta->tx_bytes += skb->len; in hostap_handle_sta_tx()
2797 sta->last_tx = jiffies; in hostap_handle_sta_tx()
2802 sta->crypt && tx->host_encrypt) { in hostap_handle_sta_tx()
2803 tx->crypt = sta->crypt; in hostap_handle_sta_tx()
2804 tx->sta_ptr = sta; /* hostap_handle_sta_release() will in hostap_handle_sta_tx()
2808 atomic_dec(&sta->users); in hostap_handle_sta_tx()
2817 struct sta_info *sta = ptr; in hostap_handle_sta_release() local
2818 atomic_dec(&sta->users); in hostap_handle_sta_release()
2825 struct sta_info *sta; in hostap_handle_sta_tx_exc() local
2833 sta = ap_get_sta(local->ap, hdr->addr1); in hostap_handle_sta_tx_exc()
2834 if (!sta) { in hostap_handle_sta_tx_exc()
2842 sta->tx_since_last_failure = 0; in hostap_handle_sta_tx_exc()
2843 sta->tx_consecutive_exc++; in hostap_handle_sta_tx_exc()
2845 if (sta->tx_consecutive_exc >= WLAN_RATE_DECREASE_THRESHOLD && in hostap_handle_sta_tx_exc()
2846 sta->tx_rate_idx > 0 && meta->rate <= sta->tx_rate) { in hostap_handle_sta_tx_exc()
2849 old = rate = sta->tx_rate_idx; in hostap_handle_sta_tx_exc()
2852 if (ap_tx_rate_ok(rate, sta, local)) { in hostap_handle_sta_tx_exc()
2853 sta->tx_rate_idx = rate; in hostap_handle_sta_tx_exc()
2857 if (old != sta->tx_rate_idx) { in hostap_handle_sta_tx_exc()
2858 switch (sta->tx_rate_idx) { in hostap_handle_sta_tx_exc()
2859 case 0: sta->tx_rate = 10; break; in hostap_handle_sta_tx_exc()
2860 case 1: sta->tx_rate = 20; break; in hostap_handle_sta_tx_exc()
2861 case 2: sta->tx_rate = 55; break; in hostap_handle_sta_tx_exc()
2862 case 3: sta->tx_rate = 110; break; in hostap_handle_sta_tx_exc()
2863 default: sta->tx_rate = 0; break; in hostap_handle_sta_tx_exc()
2867 local->dev->name, sta->addr, sta->tx_rate); in hostap_handle_sta_tx_exc()
2869 sta->tx_consecutive_exc = 0; in hostap_handle_sta_tx_exc()
2875 static void hostap_update_sta_ps2(local_info_t *local, struct sta_info *sta, in hostap_update_sta_ps2() argument
2878 if (pwrmgt && !(sta->flags & WLAN_STA_PS)) { in hostap_update_sta_ps2()
2879 sta->flags |= WLAN_STA_PS; in hostap_update_sta_ps2()
2882 sta->addr, type >> 2, stype >> 4); in hostap_update_sta_ps2()
2883 } else if (!pwrmgt && (sta->flags & WLAN_STA_PS)) { in hostap_update_sta_ps2()
2884 sta->flags &= ~WLAN_STA_PS; in hostap_update_sta_ps2()
2887 sta->addr, type >> 2, stype >> 4); in hostap_update_sta_ps2()
2890 schedule_packet_send(local, sta); in hostap_update_sta_ps2()
2899 struct sta_info *sta; in hostap_update_sta_ps() local
2903 sta = ap_get_sta(local->ap, hdr->addr2); in hostap_update_sta_ps()
2904 if (sta) in hostap_update_sta_ps()
2905 atomic_inc(&sta->users); in hostap_update_sta_ps()
2908 if (!sta) in hostap_update_sta_ps()
2912 hostap_update_sta_ps2(local, sta, fc & IEEE80211_FCTL_PM, in hostap_update_sta_ps()
2916 atomic_dec(&sta->users); in hostap_update_sta_ps()
2929 struct sta_info *sta; in hostap_handle_sta_rx() local
2943 sta = ap_get_sta(local->ap, hdr->addr2); in hostap_handle_sta_rx()
2944 if (sta) in hostap_handle_sta_rx()
2945 atomic_inc(&sta->users); in hostap_handle_sta_rx()
2948 if (sta && !(sta->flags & WLAN_STA_AUTHORIZED)) in hostap_handle_sta_rx()
2955 if (!wds && (sta == NULL || !(sta->flags & WLAN_STA_ASSOC))) { in hostap_handle_sta_rx()
2984 } else if (stype == IEEE80211_STYPE_NULLFUNC && sta == NULL && in hostap_handle_sta_rx()
3025 if (sta) { in hostap_handle_sta_rx()
3026 hostap_update_sta_ps2(local, sta, fc & IEEE80211_FCTL_PM, in hostap_handle_sta_rx()
3029 sta->rx_packets++; in hostap_handle_sta_rx()
3030 sta->rx_bytes += skb->len; in hostap_handle_sta_rx()
3031 sta->last_rx = jiffies; in hostap_handle_sta_rx()
3054 if (sta) in hostap_handle_sta_rx()
3055 atomic_dec(&sta->users); in hostap_handle_sta_rx()
3067 struct sta_info *sta; in hostap_handle_sta_crypto() local
3070 sta = ap_get_sta(local->ap, hdr->addr2); in hostap_handle_sta_crypto()
3071 if (sta) in hostap_handle_sta_crypto()
3072 atomic_inc(&sta->users); in hostap_handle_sta_crypto()
3075 if (!sta) in hostap_handle_sta_crypto()
3078 if (sta->crypt) { in hostap_handle_sta_crypto()
3079 *crypt = sta->crypt; in hostap_handle_sta_crypto()
3080 *sta_ptr = sta; in hostap_handle_sta_crypto()
3084 atomic_dec(&sta->users); in hostap_handle_sta_crypto()
3093 struct sta_info *sta; in hostap_is_sta_assoc() local
3097 sta = ap_get_sta(ap, sta_addr); in hostap_is_sta_assoc()
3098 if (sta != NULL && (sta->flags & WLAN_STA_ASSOC) && !sta->ap) in hostap_is_sta_assoc()
3109 struct sta_info *sta; in hostap_is_sta_authorized() local
3113 sta = ap_get_sta(ap, sta_addr); in hostap_is_sta_authorized()
3114 if (sta != NULL && (sta->flags & WLAN_STA_ASSOC) && !sta->ap && in hostap_is_sta_authorized()
3115 ((sta->flags & WLAN_STA_AUTHORIZED) || in hostap_is_sta_authorized()
3127 struct sta_info *sta; in hostap_add_sta() local
3134 sta = ap_get_sta(ap, sta_addr); in hostap_add_sta()
3135 if (sta) in hostap_add_sta()
3140 sta = ap_add_sta(ap, sta_addr); in hostap_add_sta()
3141 if (!sta) in hostap_add_sta()
3143 sta->flags = WLAN_STA_AUTH | WLAN_STA_ASSOC; in hostap_add_sta()
3144 sta->ap = 1; in hostap_add_sta()
3145 memset(sta->supported_rates, 0, sizeof(sta->supported_rates)); in hostap_add_sta()
3149 sta->supported_rates[0] = 0x82; in hostap_add_sta()
3150 sta->supported_rates[1] = 0x84; in hostap_add_sta()
3151 sta->supported_rates[2] = 0x0b; in hostap_add_sta()
3152 sta->supported_rates[3] = 0x16; in hostap_add_sta()
3153 sta->tx_supp_rates = WLAN_RATE_1M | WLAN_RATE_2M | in hostap_add_sta()
3155 sta->tx_rate = 110; in hostap_add_sta()
3156 sta->tx_max_rate = sta->tx_rate_idx = 3; in hostap_add_sta()
3168 struct sta_info *sta; in hostap_update_rx_stats() local
3174 sta = ap_get_sta(ap, hdr->addr2); in hostap_update_rx_stats()
3175 if (sta) { in hostap_update_rx_stats()
3176 sta->last_rx_silence = rx_stats->noise; in hostap_update_rx_stats()
3177 sta->last_rx_signal = rx_stats->signal; in hostap_update_rx_stats()
3178 sta->last_rx_rate = rx_stats->rate; in hostap_update_rx_stats()
3179 sta->last_rx_updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; in hostap_update_rx_stats()
3181 sta->rx_count[0]++; in hostap_update_rx_stats()
3183 sta->rx_count[1]++; in hostap_update_rx_stats()
3185 sta->rx_count[2]++; in hostap_update_rx_stats()
3187 sta->rx_count[3]++; in hostap_update_rx_stats()
3191 return sta ? 0 : -1; in hostap_update_rx_stats()
3197 struct sta_info *sta; in hostap_update_rates() local
3204 list_for_each_entry(sta, &ap->sta_list, list) { in hostap_update_rates()
3205 prism2_check_tx_rates(sta); in hostap_update_rates()
3214 struct sta_info *sta; in ap_crypt_get_ptrs() local
3217 sta = ap_get_sta(ap, addr); in ap_crypt_get_ptrs()
3218 if (sta) in ap_crypt_get_ptrs()
3219 atomic_inc(&sta->users); in ap_crypt_get_ptrs()
3222 if (!sta && permanent) in ap_crypt_get_ptrs()
3223 sta = ap_add_sta(ap, addr); in ap_crypt_get_ptrs()
3225 if (!sta) in ap_crypt_get_ptrs()
3229 sta->flags |= WLAN_STA_PERM; in ap_crypt_get_ptrs()
3231 *crypt = &sta->crypt; in ap_crypt_get_ptrs()
3233 return sta; in ap_crypt_get_ptrs()
3240 struct sta_info *sta; in hostap_add_wds_links() local
3243 list_for_each_entry(sta, &ap->sta_list, list) { in hostap_add_wds_links()
3244 if (sta->ap) in hostap_add_wds_links()
3245 hostap_wds_link_oper(local, sta->addr, WDS_ADD); in hostap_add_wds_links()