Lines Matching refs:ap
55 static struct sta_info* ap_get_sta(struct ap_data *ap, u8 *sta);
71 struct ap_data *ap = m->private; in ap_debug_proc_show() local
73 seq_printf(m, "BridgedUnicastFrames=%u\n", ap->bridged_unicast); in ap_debug_proc_show()
74 seq_printf(m, "BridgedMulticastFrames=%u\n", ap->bridged_multicast); in ap_debug_proc_show()
75 seq_printf(m, "max_inactivity=%u\n", ap->max_inactivity / HZ); in ap_debug_proc_show()
76 seq_printf(m, "bridge_packets=%u\n", ap->bridge_packets); in ap_debug_proc_show()
77 seq_printf(m, "nullfunc_ack=%u\n", ap->nullfunc_ack); in ap_debug_proc_show()
78 seq_printf(m, "autom_ap_wds=%u\n", ap->autom_ap_wds); in ap_debug_proc_show()
79 seq_printf(m, "auth_algs=%u\n", ap->local->auth_algs); in ap_debug_proc_show()
80 seq_printf(m, "tx_drop_nonassoc=%u\n", ap->tx_drop_nonassoc); in ap_debug_proc_show()
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()
111 ap->sta_hash[STA_HASH(sta->addr)] = s->hnext; 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()
129 if (ap->proc != NULL) { in ap_free_sta()
132 remove_proc_entry(name, ap->proc); in ap_free_sta()
143 ap->num_sta--; in ap_free_sta()
146 ap->sta_aid[sta->aid - 1] = NULL; in ap_free_sta()
148 if (!sta->ap && sta->u.sta.challenge) in ap_free_sta()
191 struct ap_data *ap; in ap_handle_timer() local
195 if (sta == NULL || sta->local == NULL || sta->local->ap == NULL) { in ap_handle_timer()
201 ap = local->ap; in ap_handle_timer()
207 next_time = jiffies + ap->max_inactivity; in ap_handle_timer()
209 if (time_before(jiffies, sta->last_rx + ap->max_inactivity)) { in ap_handle_timer()
212 next_time = sta->last_rx + ap->max_inactivity; in ap_handle_timer()
217 next_time = jiffies + ap->max_inactivity; in ap_handle_timer()
226 if (sta->ap) in ap_handle_timer()
230 spin_lock(&ap->sta_table_lock); in ap_handle_timer()
231 ap_sta_hash_del(ap, sta); in ap_handle_timer()
233 spin_unlock(&ap->sta_table_lock); in ap_handle_timer()
238 if (was_assoc && !(sta->flags & WLAN_STA_ASSOC) && !sta->ap) in ap_handle_timer()
247 if (sta->ap) { in ap_handle_timer()
248 if (ap->autom_ap_wds) { in ap_handle_timer()
263 sta->addr, ap->tx_callback_poll); in ap_handle_timer()
288 ap_free_sta(ap, sta); in ap_handle_timer()
304 void hostap_deauth_all_stas(struct net_device *dev, struct ap_data *ap, in hostap_deauth_all_stas() argument
325 if (!resend || ap->num_sta <= 0) in hostap_deauth_all_stas()
335 struct ap_data *ap = m->private; in ap_control_proc_show() local
340 switch (ap->mac_restrictions.policy) { in ap_control_proc_show()
355 seq_printf(m, "MAC entries: %u\n", ap->mac_restrictions.entries); in ap_control_proc_show()
367 struct ap_data *ap = m->private; in ap_control_proc_start() local
368 spin_lock_bh(&ap->mac_restrictions.lock); in ap_control_proc_start()
369 return seq_list_start_head(&ap->mac_restrictions.mac_list, *_pos); in ap_control_proc_start()
374 struct ap_data *ap = m->private; in ap_control_proc_next() local
375 return seq_list_next(v, &ap->mac_restrictions.mac_list, _pos); in ap_control_proc_next()
380 struct ap_data *ap = m->private; in ap_control_proc_stop() local
381 spin_unlock_bh(&ap->mac_restrictions.lock); in ap_control_proc_stop()
497 int ap_control_kick_mac(struct ap_data *ap, struct net_device *dev, u8 *mac) in ap_control_kick_mac() argument
502 spin_lock_bh(&ap->sta_table_lock); in ap_control_kick_mac()
503 sta = ap_get_sta(ap, mac); in ap_control_kick_mac()
505 ap_sta_hash_del(ap, sta); in ap_control_kick_mac()
508 spin_unlock_bh(&ap->sta_table_lock); in ap_control_kick_mac()
517 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap) in ap_control_kick_mac()
520 ap_free_sta(ap, sta); in ap_control_kick_mac()
528 void ap_control_kickall(struct ap_data *ap) in ap_control_kickall() argument
533 spin_lock_bh(&ap->sta_table_lock); in ap_control_kickall()
534 for (ptr = ap->sta_list.next, n = ptr->next; ptr != &ap->sta_list; in ap_control_kickall()
537 ap_sta_hash_del(ap, sta); in ap_control_kickall()
539 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap && sta->local) in ap_control_kickall()
541 ap_free_sta(ap, sta); in ap_control_kickall()
543 spin_unlock_bh(&ap->sta_table_lock); in ap_control_kickall()
559 if (!sta->ap) in prism2_ap_proc_show()
564 sta->u.ap.channel, sta->last_rx_signal, 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()
587 struct ap_data *ap = m->private; in prism2_ap_proc_start() local
588 spin_lock_bh(&ap->sta_table_lock); in prism2_ap_proc_start()
589 return seq_list_start_head(&ap->sta_list, *_pos); in prism2_ap_proc_start()
594 struct ap_data *ap = m->private; in prism2_ap_proc_next() local
595 return seq_list_next(v, &ap->sta_list, _pos); in prism2_ap_proc_next()
600 struct ap_data *ap = m->private; in prism2_ap_proc_stop() local
601 spin_unlock_bh(&ap->sta_table_lock); in prism2_ap_proc_stop()
630 void hostap_check_sta_fw_version(struct ap_data *ap, int sta_fw_ver) in hostap_check_sta_fw_version() argument
632 if (!ap) in hostap_check_sta_fw_version()
638 ap->nullfunc_ack = 1; in hostap_check_sta_fw_version()
640 ap->nullfunc_ack = 0; in hostap_check_sta_fw_version()
645 ap->local->dev->name); in hostap_check_sta_fw_version()
653 struct ap_data *ap = data; in hostap_ap_tx_cb() local
656 if (!ap->local->hostapd || !ap->local->apdev) { in hostap_ap_tx_cb()
668 skb->dev = ap->local->apdev; in hostap_ap_tx_cb()
681 struct ap_data *ap = data; in hostap_ap_tx_cb_auth() local
682 struct net_device *dev = ap->local->dev; in hostap_ap_tx_cb_auth()
689 if (ap->local->hostapd) { in hostap_ap_tx_cb_auth()
713 spin_lock(&ap->sta_table_lock); in hostap_ap_tx_cb_auth()
714 sta = ap_get_sta(ap, hdr->addr1); in hostap_ap_tx_cb_auth()
717 spin_unlock(&ap->sta_table_lock); in hostap_ap_tx_cb_auth()
749 struct ap_data *ap = data; in hostap_ap_tx_cb_assoc() local
750 struct net_device *dev = ap->local->dev; in hostap_ap_tx_cb_assoc()
757 if (ap->local->hostapd) { in hostap_ap_tx_cb_assoc()
777 spin_lock(&ap->sta_table_lock); in hostap_ap_tx_cb_assoc()
778 sta = ap_get_sta(ap, hdr->addr1); in hostap_ap_tx_cb_assoc()
781 spin_unlock(&ap->sta_table_lock); in hostap_ap_tx_cb_assoc()
814 struct ap_data *ap = data; in hostap_ap_tx_cb_poll() local
822 spin_lock(&ap->sta_table_lock); in hostap_ap_tx_cb_poll()
823 sta = ap_get_sta(ap, hdr->addr1); in hostap_ap_tx_cb_poll()
826 spin_unlock(&ap->sta_table_lock); in hostap_ap_tx_cb_poll()
830 ap->local->dev->name, hdr->addr1); in hostap_ap_tx_cb_poll()
841 struct ap_data *ap = local->ap; in hostap_init_data() local
843 if (ap == NULL) { in hostap_init_data()
847 memset(ap, 0, sizeof(struct ap_data)); in hostap_init_data()
848 ap->local = local; in hostap_init_data()
850 ap->ap_policy = GET_INT_PARM(other_ap_policy, local->card_idx); in hostap_init_data()
851 ap->bridge_packets = GET_INT_PARM(ap_bridge_packets, local->card_idx); in hostap_init_data()
852 ap->max_inactivity = in hostap_init_data()
854 ap->autom_ap_wds = GET_INT_PARM(autom_ap_wds, local->card_idx); in hostap_init_data()
856 spin_lock_init(&ap->sta_table_lock); in hostap_init_data()
857 INIT_LIST_HEAD(&ap->sta_list); in hostap_init_data()
860 INIT_WORK(&local->ap->add_sta_proc_queue, handle_add_proc_queue); in hostap_init_data()
862 ap->tx_callback_idx = in hostap_init_data()
863 hostap_tx_callback_register(local, hostap_ap_tx_cb, ap); in hostap_init_data()
864 if (ap->tx_callback_idx == 0) in hostap_init_data()
868 INIT_WORK(&local->ap->wds_oper_queue, handle_wds_oper_queue); in hostap_init_data()
870 ap->tx_callback_auth = in hostap_init_data()
871 hostap_tx_callback_register(local, hostap_ap_tx_cb_auth, ap); in hostap_init_data()
872 ap->tx_callback_assoc = in hostap_init_data()
873 hostap_tx_callback_register(local, hostap_ap_tx_cb_assoc, ap); in hostap_init_data()
874 ap->tx_callback_poll = in hostap_init_data()
875 hostap_tx_callback_register(local, hostap_ap_tx_cb_poll, ap); in hostap_init_data()
876 if (ap->tx_callback_auth == 0 || ap->tx_callback_assoc == 0 || in hostap_init_data()
877 ap->tx_callback_poll == 0) in hostap_init_data()
881 spin_lock_init(&ap->mac_restrictions.lock); in hostap_init_data()
882 INIT_LIST_HEAD(&ap->mac_restrictions.mac_list); in hostap_init_data()
885 ap->initialized = 1; in hostap_init_data()
891 struct ap_data *ap = local->ap; in hostap_init_ap_proc() local
893 ap->proc = local->proc; in hostap_init_ap_proc()
894 if (ap->proc == NULL) in hostap_init_ap_proc()
898 proc_create_data("ap_debug", 0, ap->proc, &ap_debug_proc_fops, ap); in hostap_init_ap_proc()
902 proc_create_data("ap_control", 0, ap->proc, &ap_control_proc_fops, ap); in hostap_init_ap_proc()
903 proc_create_data("ap", 0, ap->proc, &prism2_ap_proc_fops, ap); in hostap_init_ap_proc()
909 void hostap_free_data(struct ap_data *ap) in hostap_free_data() argument
913 if (ap == NULL || !ap->initialized) { in hostap_free_data()
919 flush_work(&ap->add_sta_proc_queue); in hostap_free_data()
922 flush_work(&ap->wds_oper_queue); in hostap_free_data()
923 if (ap->crypt) in hostap_free_data()
924 ap->crypt->deinit(ap->crypt_priv); in hostap_free_data()
925 ap->crypt = ap->crypt_priv = NULL; in hostap_free_data()
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()
931 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap && sta->local) in hostap_free_data()
933 ap_free_sta(ap, sta); in hostap_free_data()
937 if (ap->proc != NULL) { in hostap_free_data()
938 remove_proc_entry("ap_debug", ap->proc); in hostap_free_data()
943 if (ap->proc != NULL) { in hostap_free_data()
944 remove_proc_entry("ap", ap->proc); in hostap_free_data()
945 remove_proc_entry("ap_control", ap->proc); in hostap_free_data()
947 ap_control_flush_macs(&ap->mac_restrictions); in hostap_free_data()
950 ap->initialized = 0; 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()
1054 sta->ap ? "AP" : "STA", 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()
1124 struct ap_data *ap = container_of(work, struct ap_data, in handle_add_proc_queue() local
1130 entry = ap->add_sta_proc_entries; in handle_add_proc_queue()
1131 ap->add_sta_proc_entries = NULL; in handle_add_proc_queue()
1134 spin_lock_bh(&ap->sta_table_lock); in handle_add_proc_queue()
1135 sta = ap_get_sta(ap, entry->addr); in handle_add_proc_queue()
1138 spin_unlock_bh(&ap->sta_table_lock); in handle_add_proc_queue()
1143 name, 0, ap->proc, in handle_add_proc_queue()
1156 static struct sta_info * ap_add_sta(struct ap_data *ap, u8 *addr) in ap_add_sta() argument
1167 sta->local = ap->local; in ap_add_sta()
1172 spin_lock_bh(&ap->sta_table_lock); in ap_add_sta()
1173 list_add(&sta->list, &ap->sta_list); in ap_add_sta()
1174 ap->num_sta++; in ap_add_sta()
1175 ap_sta_hash_add(ap, sta); in ap_add_sta()
1176 spin_unlock_bh(&ap->sta_table_lock); in ap_add_sta()
1178 if (ap->proc) { in ap_add_sta()
1185 entry->next = ap->add_sta_proc_entries; in ap_add_sta()
1186 ap->add_sta_proc_entries = entry; in ap_add_sta()
1187 schedule_work(&ap->add_sta_proc_queue); in ap_add_sta()
1194 sta->timer.expires = jiffies + ap->max_inactivity; in ap_add_sta()
1197 if (!ap->local->hostapd) in ap_add_sta()
1269 static void ap_crypt_init(struct ap_data *ap) in ap_crypt_init() argument
1271 ap->crypt = lib80211_get_crypto_ops("WEP"); in ap_crypt_init()
1273 if (ap->crypt) { in ap_crypt_init()
1274 if (ap->crypt->init) { in ap_crypt_init()
1275 ap->crypt_priv = ap->crypt->init(0); in ap_crypt_init()
1276 if (ap->crypt_priv == NULL) in ap_crypt_init()
1277 ap->crypt = NULL; in ap_crypt_init()
1281 ap->crypt->set_key(key, WEP_KEY_LEN, NULL, in ap_crypt_init()
1282 ap->crypt_priv); in ap_crypt_init()
1287 if (ap->crypt == NULL) { in ap_crypt_init()
1302 static char * ap_auth_make_challenge(struct ap_data *ap) in ap_auth_make_challenge() argument
1307 if (ap->crypt == NULL) { in ap_auth_make_challenge()
1308 ap_crypt_init(ap); in ap_auth_make_challenge()
1309 if (ap->crypt == NULL) in ap_auth_make_challenge()
1320 ap->crypt->extra_mpdu_prefix_len + in ap_auth_make_challenge()
1321 ap->crypt->extra_mpdu_postfix_len); in ap_auth_make_challenge()
1327 skb_reserve(skb, ap->crypt->extra_mpdu_prefix_len); in ap_auth_make_challenge()
1330 if (ap->crypt->encrypt_mpdu(skb, 0, ap->crypt_priv)) { in ap_auth_make_challenge()
1336 skb_copy_from_linear_data_offset(skb, ap->crypt->extra_mpdu_prefix_len, in ap_auth_make_challenge()
1351 struct ap_data *ap = local->ap; in handle_authen() local
1371 spin_lock_bh(&local->ap->sta_table_lock); in handle_authen()
1372 sta = ap_get_sta(local->ap, hdr->addr2); in handle_authen()
1375 spin_unlock_bh(&local->ap->sta_table_lock); in handle_authen()
1395 ap_control_mac_deny(&ap->mac_restrictions, hdr->addr2)) { in handle_authen()
1428 if (sta && sta->ap) { in handle_authen()
1429 if (time_after(jiffies, sta->u.ap.last_beacon + in handle_authen()
1434 sta->ap = 0; in handle_authen()
1458 if (local->ap->num_sta >= MAX_STA_COUNT) { in handle_authen()
1465 sta = ap_add_sta(local->ap, hdr->addr2); in handle_authen()
1488 ap_auth_make_challenge(local->ap); in handle_authen()
1540 body, olen, hdr->addr2, ap->tx_callback_auth); in handle_authen()
1581 spin_lock_bh(&local->ap->sta_table_lock); in handle_assoc()
1582 sta = ap_get_sta(local->ap, hdr->addr2); in handle_assoc()
1584 spin_unlock_bh(&local->ap->sta_table_lock); in handle_assoc()
1592 spin_unlock_bh(&local->ap->sta_table_lock); in handle_assoc()
1673 spin_lock_bh(&local->ap->sta_table_lock); in handle_assoc()
1675 if (local->ap->sta_aid[sta->aid - 1] == NULL) in handle_assoc()
1679 spin_unlock_bh(&local->ap->sta_table_lock); in handle_assoc()
1683 local->ap->sta_aid[sta->aid - 1] = sta; in handle_assoc()
1684 spin_unlock_bh(&local->ap->sta_table_lock); in handle_assoc()
1743 send_deauth ? 0 : local->ap->tx_callback_assoc); in handle_assoc()
1792 spin_lock_bh(&local->ap->sta_table_lock); in handle_deauth()
1793 sta = ap_get_sta(local->ap, hdr->addr2); in handle_deauth()
1795 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap) in handle_deauth()
1799 spin_unlock_bh(&local->ap->sta_table_lock); in handle_deauth()
1834 spin_lock_bh(&local->ap->sta_table_lock); in handle_disassoc()
1835 sta = ap_get_sta(local->ap, hdr->addr2); in handle_disassoc()
1837 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap) in handle_disassoc()
1841 spin_unlock_bh(&local->ap->sta_table_lock); in handle_disassoc()
1875 spin_lock_bh(&local->ap->sta_table_lock); in ap_handle_dropped_data()
1876 sta = ap_get_sta(local->ap, hdr->addr2); in ap_handle_dropped_data()
1879 spin_unlock_bh(&local->ap->sta_table_lock); in ap_handle_dropped_data()
1957 spin_lock_bh(&local->ap->sta_table_lock); in handle_pspoll()
1958 sta = ap_get_sta(local->ap, hdr->addr2); in handle_pspoll()
1961 spin_unlock_bh(&local->ap->sta_table_lock); in handle_pspoll()
2015 struct ap_data *ap = container_of(work, struct ap_data, in handle_wds_oper_queue() local
2017 local_info_t *local = ap->local; in handle_wds_oper_queue()
2021 entry = local->ap->wds_oper_entries; in handle_wds_oper_queue()
2022 local->ap->wds_oper_entries = NULL; in handle_wds_oper_queue()
2078 if (local->ap->ap_policy != AP_OTHER_AP_EVEN_IBSS && in handle_beacon()
2096 if (local->ap->ap_policy == AP_OTHER_AP_SAME_SSID && in handle_beacon()
2144 spin_lock_bh(&local->ap->sta_table_lock); in handle_beacon()
2145 sta = ap_get_sta(local->ap, hdr->addr2); in handle_beacon()
2148 spin_unlock_bh(&local->ap->sta_table_lock); in handle_beacon()
2153 sta = ap_add_sta(local->ap, hdr->addr2); in handle_beacon()
2165 if (local->ap->autom_ap_wds) { 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()
2182 sta->u.ap.last_beacon = sta->last_rx = jiffies; in handle_beacon()
2239 if (local->ap->nullfunc_ack && in handle_ap_item()
2337 if (local->ap->ap_policy == AP_OTHER_AP_SKIP_ALL && in hostap_rx()
2391 struct ap_data *ap = local->ap; in prism2_ap_get_sta_qual() local
2395 spin_lock_bh(&ap->sta_table_lock); in prism2_ap_get_sta_qual()
2397 for (ptr = ap->sta_list.next; ptr != NULL && ptr != &ap->sta_list; in prism2_ap_get_sta_qual()
2401 if (aplist && !sta->ap) in prism2_ap_get_sta_qual()
2421 spin_unlock_bh(&ap->sta_table_lock); in prism2_ap_get_sta_qual()
2434 struct ap_data *ap; in prism2_ap_translate_scan() local
2445 ap = local->ap; in prism2_ap_translate_scan()
2447 spin_lock_bh(&ap->sta_table_lock); in prism2_ap_translate_scan()
2449 for (ptr = ap->sta_list.next; ptr != NULL && ptr != &ap->sta_list; in prism2_ap_translate_scan()
2466 if (sta->ap) 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()
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()
2538 spin_unlock_bh(&ap->sta_table_lock); in prism2_ap_translate_scan()
2544 static int prism2_hostapd_add_sta(struct ap_data *ap, in prism2_hostapd_add_sta() argument
2549 spin_lock_bh(&ap->sta_table_lock); in prism2_hostapd_add_sta()
2550 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_add_sta()
2553 spin_unlock_bh(&ap->sta_table_lock); in prism2_hostapd_add_sta()
2556 sta = ap_add_sta(ap, param->sta_addr); in prism2_hostapd_add_sta()
2561 if (!(sta->flags & WLAN_STA_ASSOC) && !sta->ap && sta->local) in prism2_hostapd_add_sta()
2583 static int prism2_hostapd_remove_sta(struct ap_data *ap, in prism2_hostapd_remove_sta() argument
2588 spin_lock_bh(&ap->sta_table_lock); in prism2_hostapd_remove_sta()
2589 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_remove_sta()
2591 ap_sta_hash_del(ap, sta); in prism2_hostapd_remove_sta()
2594 spin_unlock_bh(&ap->sta_table_lock); in prism2_hostapd_remove_sta()
2599 if ((sta->flags & WLAN_STA_ASSOC) && !sta->ap && sta->local) in prism2_hostapd_remove_sta()
2601 ap_free_sta(ap, sta); in prism2_hostapd_remove_sta()
2607 static int prism2_hostapd_get_info_sta(struct ap_data *ap, in prism2_hostapd_get_info_sta() argument
2612 spin_lock_bh(&ap->sta_table_lock); in prism2_hostapd_get_info_sta()
2613 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_get_info_sta()
2616 spin_unlock_bh(&ap->sta_table_lock); in prism2_hostapd_get_info_sta()
2629 static int prism2_hostapd_set_flags_sta(struct ap_data *ap, in prism2_hostapd_set_flags_sta() argument
2634 spin_lock_bh(&ap->sta_table_lock); in prism2_hostapd_set_flags_sta()
2635 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_set_flags_sta()
2640 spin_unlock_bh(&ap->sta_table_lock); in prism2_hostapd_set_flags_sta()
2649 static int prism2_hostapd_sta_clear_stats(struct ap_data *ap, in prism2_hostapd_sta_clear_stats() argument
2655 spin_lock_bh(&ap->sta_table_lock); in prism2_hostapd_sta_clear_stats()
2656 sta = ap_get_sta(ap, param->sta_addr); in prism2_hostapd_sta_clear_stats()
2665 spin_unlock_bh(&ap->sta_table_lock); in prism2_hostapd_sta_clear_stats()
2674 int prism2_hostapd(struct ap_data *ap, struct prism2_hostapd_param *param) in prism2_hostapd() argument
2678 ap_control_kickall(ap); in prism2_hostapd()
2681 return prism2_hostapd_add_sta(ap, param); in prism2_hostapd()
2683 return prism2_hostapd_remove_sta(ap, param); in prism2_hostapd()
2685 return prism2_hostapd_get_info_sta(ap, param); in prism2_hostapd()
2687 return prism2_hostapd_set_flags_sta(ap, param); in prism2_hostapd()
2689 return prism2_hostapd_sta_clear_stats(ap, param); in prism2_hostapd()
2754 if (local->ap == NULL || skb->len < 10 || in hostap_handle_sta_tx()
2762 if (local->ap->num_sta <= 0) in hostap_handle_sta_tx()
2768 spin_lock(&local->ap->sta_table_lock); in hostap_handle_sta_tx()
2769 sta = ap_get_sta(local->ap, hdr->addr1); in hostap_handle_sta_tx()
2772 spin_unlock(&local->ap->sta_table_lock); in hostap_handle_sta_tx()
2789 local->ap->tx_drop_nonassoc++; in hostap_handle_sta_tx()
2802 local->ap->last_tx_rate = meta->rate = in hostap_handle_sta_tx()
2894 spin_lock(&local->ap->sta_table_lock); in hostap_handle_sta_tx_exc()
2895 sta = ap_get_sta(local->ap, hdr->addr1); in hostap_handle_sta_tx_exc()
2897 spin_unlock(&local->ap->sta_table_lock); in hostap_handle_sta_tx_exc()
2933 spin_unlock(&local->ap->sta_table_lock); in hostap_handle_sta_tx_exc()
2964 spin_lock(&local->ap->sta_table_lock); in hostap_update_sta_ps()
2965 sta = ap_get_sta(local->ap, hdr->addr2); in hostap_update_sta_ps()
2968 spin_unlock(&local->ap->sta_table_lock); in hostap_update_sta_ps()
2995 if (local->ap == NULL) in hostap_handle_sta_rx()
3004 spin_lock(&local->ap->sta_table_lock); in hostap_handle_sta_rx()
3005 sta = ap_get_sta(local->ap, hdr->addr2); in hostap_handle_sta_rx()
3008 spin_unlock(&local->ap->sta_table_lock); in hostap_handle_sta_rx()
3096 if (local->ap->nullfunc_ack && stype == IEEE80211_STYPE_NULLFUNC && in hostap_handle_sta_rx()
3131 spin_lock(&local->ap->sta_table_lock); in hostap_handle_sta_crypto()
3132 sta = ap_get_sta(local->ap, hdr->addr2); in hostap_handle_sta_crypto()
3135 spin_unlock(&local->ap->sta_table_lock); in hostap_handle_sta_crypto()
3153 int hostap_is_sta_assoc(struct ap_data *ap, u8 *sta_addr) in hostap_is_sta_assoc() argument
3158 spin_lock(&ap->sta_table_lock); in hostap_is_sta_assoc()
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()
3162 spin_unlock(&ap->sta_table_lock); in hostap_is_sta_assoc()
3169 int hostap_is_sta_authorized(struct ap_data *ap, u8 *sta_addr) in hostap_is_sta_authorized() argument
3174 spin_lock(&ap->sta_table_lock); in hostap_is_sta_authorized()
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()
3178 ap->local->ieee_802_1x == 0)) in hostap_is_sta_authorized()
3180 spin_unlock(&ap->sta_table_lock); in hostap_is_sta_authorized()
3187 int hostap_add_sta(struct ap_data *ap, u8 *sta_addr) in hostap_add_sta() argument
3192 if (!ap) in hostap_add_sta()
3195 spin_lock(&ap->sta_table_lock); in hostap_add_sta()
3196 sta = ap_get_sta(ap, sta_addr); in hostap_add_sta()
3199 spin_unlock(&ap->sta_table_lock); in hostap_add_sta()
3202 sta = ap_add_sta(ap, sta_addr); in hostap_add_sta()
3206 sta->ap = 1; in hostap_add_sta()
3226 int hostap_update_rx_stats(struct ap_data *ap, in hostap_update_rx_stats() argument
3232 if (!ap) in hostap_update_rx_stats()
3235 spin_lock(&ap->sta_table_lock); in hostap_update_rx_stats()
3236 sta = ap_get_sta(ap, hdr->addr2); in hostap_update_rx_stats()
3251 spin_unlock(&ap->sta_table_lock); in hostap_update_rx_stats()
3260 struct ap_data *ap = local->ap; in hostap_update_rates() local
3262 if (!ap) in hostap_update_rates()
3265 spin_lock_bh(&ap->sta_table_lock); in hostap_update_rates()
3266 list_for_each_entry(sta, &ap->sta_list, list) { in hostap_update_rates()
3269 spin_unlock_bh(&ap->sta_table_lock); in hostap_update_rates()
3273 void * ap_crypt_get_ptrs(struct ap_data *ap, u8 *addr, int permanent, in ap_crypt_get_ptrs() argument
3278 spin_lock_bh(&ap->sta_table_lock); in ap_crypt_get_ptrs()
3279 sta = ap_get_sta(ap, addr); in ap_crypt_get_ptrs()
3282 spin_unlock_bh(&ap->sta_table_lock); in ap_crypt_get_ptrs()
3285 sta = ap_add_sta(ap, addr); in ap_crypt_get_ptrs()
3301 struct ap_data *ap = local->ap; in hostap_add_wds_links() local
3304 spin_lock_bh(&ap->sta_table_lock); in hostap_add_wds_links()
3305 list_for_each_entry(sta, &ap->sta_list, list) { in hostap_add_wds_links()
3306 if (sta->ap) in hostap_add_wds_links()
3309 spin_unlock_bh(&ap->sta_table_lock); in hostap_add_wds_links()
3311 schedule_work(&local->ap->wds_oper_queue); in hostap_add_wds_links()
3325 entry->next = local->ap->wds_oper_entries; in hostap_wds_link_oper()
3326 local->ap->wds_oper_entries = entry; in hostap_wds_link_oper()
3329 schedule_work(&local->ap->wds_oper_queue); in hostap_wds_link_oper()