Lines Matching refs:local
66 local_info_t *local; in prism2_rx_80211() local
73 local = iface->local; in prism2_rx_80211()
76 if (local->monitor_type == PRISM2_MONITOR_PRISM) { in prism2_rx_80211()
164 hdr->channel = htonl(local->channel); in prism2_rx_80211()
185 hdr->chan_freq = cpu_to_le16(freq_list[local->channel - 1]); in prism2_rx_80211()
222 prism2_frag_cache_find(local_info_t *local, unsigned int seq, in prism2_frag_cache_find() argument
229 entry = &local->frag_cache[i]; in prism2_frag_cache_find()
234 local->dev->name, entry->seq, entry->last_frag); in prism2_frag_cache_find()
252 prism2_frag_cache_get(local_info_t *local, struct ieee80211_hdr *hdr) in prism2_frag_cache_get() argument
265 skb = dev_alloc_skb(local->dev->mtu + in prism2_frag_cache_get()
273 entry = &local->frag_cache[local->frag_next_idx]; in prism2_frag_cache_get()
274 local->frag_next_idx++; in prism2_frag_cache_get()
275 if (local->frag_next_idx >= PRISM2_FRAG_CACHE_LEN) in prism2_frag_cache_get()
276 local->frag_next_idx = 0; in prism2_frag_cache_get()
290 entry = prism2_frag_cache_find(local, seq, frag, hdr->addr2, in prism2_frag_cache_get()
303 static int prism2_frag_cache_invalidate(local_info_t *local, in prism2_frag_cache_invalidate() argument
313 entry = prism2_frag_cache_find(local, seq, -1, hdr->addr2, hdr->addr1); in prism2_frag_cache_invalidate()
318 local->dev->name, seq); in prism2_frag_cache_invalidate()
327 static struct hostap_bss_info *__hostap_get_bss(local_info_t *local, u8 *bssid, in __hostap_get_bss() argument
333 list_for_each(ptr, &local->bss_list) { in __hostap_get_bss()
339 list_move(&bss->list, &local->bss_list); in __hostap_get_bss()
348 static struct hostap_bss_info *__hostap_add_bss(local_info_t *local, u8 *bssid, in __hostap_add_bss() argument
353 if (local->num_bss_info >= HOSTAP_MAX_BSS_COUNT) { in __hostap_add_bss()
354 bss = list_entry(local->bss_list.prev, in __hostap_add_bss()
357 local->num_bss_info--; in __hostap_add_bss()
368 local->num_bss_info++; in __hostap_add_bss()
369 list_add(&bss->list, &local->bss_list); in __hostap_add_bss()
374 static void __hostap_expire_bss(local_info_t *local) in __hostap_expire_bss() argument
378 while (local->num_bss_info > 0) { in __hostap_expire_bss()
379 bss = list_entry(local->bss_list.prev, in __hostap_expire_bss()
385 local->num_bss_info--; in __hostap_expire_bss()
393 static void hostap_rx_sta_beacon(local_info_t *local, struct sk_buff *skb, in hostap_rx_sta_beacon() argument
446 spin_lock(&local->lock); in hostap_rx_sta_beacon()
447 bss = __hostap_get_bss(local, mgmt->bssid, ssid, ssid_len); in hostap_rx_sta_beacon()
449 bss = __hostap_add_bss(local, mgmt->bssid, ssid, ssid_len); in hostap_rx_sta_beacon()
466 __hostap_expire_bss(local); in hostap_rx_sta_beacon()
467 spin_unlock(&local->lock); in hostap_rx_sta_beacon()
472 hostap_rx_frame_mgmt(local_info_t *local, struct sk_buff *skb, in hostap_rx_frame_mgmt() argument
476 if (local->iw_mode == IW_MODE_MASTER) in hostap_rx_frame_mgmt()
477 hostap_update_sta_ps(local, (struct ieee80211_hdr *) skb->data); in hostap_rx_frame_mgmt()
479 if (local->hostapd && type == IEEE80211_FTYPE_MGMT) { in hostap_rx_frame_mgmt()
481 local->iw_mode == IW_MODE_MASTER) { in hostap_rx_frame_mgmt()
492 local->apdevstats.rx_packets++; in hostap_rx_frame_mgmt()
493 local->apdevstats.rx_bytes += skb->len; in hostap_rx_frame_mgmt()
494 if (local->apdev == NULL) in hostap_rx_frame_mgmt()
496 prism2_rx_80211(local->apdev, skb, rx_stats, PRISM2_RX_MGMT); in hostap_rx_frame_mgmt()
500 if (local->iw_mode == IW_MODE_MASTER) { in hostap_rx_frame_mgmt()
514 hostap_rx_sta_beacon(local, skb, stype); in hostap_rx_frame_mgmt()
533 static struct net_device *prism2_rx_get_wds(local_info_t *local, in prism2_rx_get_wds() argument
539 read_lock_bh(&local->iface_lock); in prism2_rx_get_wds()
540 list_for_each(ptr, &local->hostap_interfaces) { in prism2_rx_get_wds()
547 read_unlock_bh(&local->iface_lock); in prism2_rx_get_wds()
554 hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr *hdr, u16 fc, in hostap_rx_frame_wds() argument
561 (local->iw_mode != IW_MODE_MASTER || !(fc & IEEE80211_FCTL_TODS))) in hostap_rx_frame_wds()
566 if (!ether_addr_equal(hdr->addr1, local->dev->dev_addr) && in hostap_rx_frame_wds()
573 local->dev->name, in hostap_rx_frame_wds()
580 *wds = prism2_rx_get_wds(local, hdr->addr2); in hostap_rx_frame_wds()
582 (local->iw_mode != IW_MODE_INFRA || in hostap_rx_frame_wds()
583 !(local->wds_type & HOSTAP_WDS_AP_CLIENT) || in hostap_rx_frame_wds()
584 memcmp(hdr->addr2, local->bssid, ETH_ALEN) != 0)) { in hostap_rx_frame_wds()
589 local->dev->name, hdr->addr2); in hostap_rx_frame_wds()
590 if (local->ap && local->ap->autom_ap_wds) in hostap_rx_frame_wds()
591 hostap_wds_link_oper(local, hdr->addr2, WDS_ADD); in hostap_rx_frame_wds()
595 if (*wds && !(fc & IEEE80211_FCTL_FROMDS) && local->ap && in hostap_rx_frame_wds()
596 hostap_is_sta_assoc(local->ap, hdr->addr2)) { in hostap_rx_frame_wds()
609 static int hostap_is_eapol_frame(local_info_t *local, struct sk_buff *skb) in hostap_is_eapol_frame() argument
611 struct net_device *dev = local->dev; in hostap_is_eapol_frame()
650 hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb, in hostap_rx_frame_decrypt() argument
662 if (local->tkip_countermeasures && in hostap_rx_frame_decrypt()
667 local->dev->name, hdr->addr2); in hostap_rx_frame_decrypt()
677 local->dev->name, hdr->addr2, res); in hostap_rx_frame_decrypt()
678 local->comm_tallies.rx_discards_wep_undecryptable++; in hostap_rx_frame_decrypt()
688 hostap_rx_frame_decrypt_msdu(local_info_t *local, struct sk_buff *skb, in hostap_rx_frame_decrypt_msdu() argument
706 local->dev->name, hdr->addr2, keyidx); in hostap_rx_frame_decrypt_msdu()
721 local_info_t *local; in hostap_80211_rx() local
739 local = iface->local; in hostap_80211_rx()
745 dev = local->ddev; in hostap_80211_rx()
774 hostap_update_rx_stats(local->ap, hdr, rx_stats); in hostap_80211_rx()
776 if (local->iw_mode == IW_MODE_MONITOR) { in hostap_80211_rx()
781 if (local->host_decrypt) { in hostap_80211_rx()
785 crypt = local->crypt_info.crypt[idx]; in hostap_80211_rx()
795 if (!(hdr->addr1[0] & 0x01) || local->bcrx_sta_key) in hostap_80211_rx()
796 (void) hostap_handle_sta_crypto(local, hdr, &crypt, in hostap_80211_rx()
813 local->dev->name, hdr->addr2); in hostap_80211_rx()
815 local->comm_tallies.rx_discards_wep_undecryptable++; in hostap_80211_rx()
823 fc & IEEE80211_FCTL_PROTECTED && local->host_decrypt && in hostap_80211_rx()
824 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) in hostap_80211_rx()
833 if (hostap_rx_frame_mgmt(local, skb, rx_stats, type, stype)) in hostap_80211_rx()
864 if (hostap_rx_frame_wds(local, hdr, fc, &wds)) in hostap_80211_rx()
869 if (local->iw_mode == IW_MODE_MASTER && !wds && in hostap_80211_rx()
872 local->stadev && in hostap_80211_rx()
873 memcmp(hdr->addr2, local->assoc_ap_addr, ETH_ALEN) == 0) { in hostap_80211_rx()
875 skb->dev = dev = local->stadev; in hostap_80211_rx()
879 if ((local->iw_mode == IW_MODE_MASTER || in hostap_80211_rx()
880 local->iw_mode == IW_MODE_REPEAT) && in hostap_80211_rx()
882 switch (hostap_handle_sta_rx(local, dev, skb, rx_stats, in hostap_80211_rx()
912 if (local->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) && in hostap_80211_rx()
913 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) in hostap_80211_rx()
919 if (local->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) && in hostap_80211_rx()
923 prism2_frag_cache_get(local, hdr); in hostap_80211_rx()
940 prism2_frag_cache_invalidate(local, hdr); in hostap_80211_rx()
970 prism2_frag_cache_invalidate(local, hdr); in hostap_80211_rx()
976 if (local->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) && in hostap_80211_rx()
977 hostap_rx_frame_decrypt_msdu(local, skb, keyidx, crypt)) in hostap_80211_rx()
981 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !local->open_wep) { in hostap_80211_rx()
982 if (local->ieee_802_1x && in hostap_80211_rx()
983 hostap_is_eapol_frame(local, skb)) { in hostap_80211_rx()
987 "unencrypted EAPOL frame\n", local->dev->name); in hostap_80211_rx()
991 local->dev->name, hdr->addr2); in hostap_80211_rx()
996 if (local->drop_unencrypted && !(fc & IEEE80211_FCTL_PROTECTED) && in hostap_80211_rx()
997 !hostap_is_eapol_frame(local, skb)) { in hostap_80211_rx()
1013 if (local->ieee_802_1x && local->iw_mode == IW_MODE_MASTER) { in hostap_80211_rx()
1017 if (local->hostapd && local->apdev) { in hostap_80211_rx()
1020 prism2_rx_80211(local->apdev, skb, rx_stats, in hostap_80211_rx()
1022 local->apdevstats.rx_packets++; in hostap_80211_rx()
1023 local->apdevstats.rx_bytes += skb->len; in hostap_80211_rx()
1069 if (local->iw_mode == IW_MODE_MASTER && !wds && in hostap_80211_rx()
1070 local->ap->bridge_packets) { in hostap_80211_rx()
1074 local->ap->bridged_multicast++; in hostap_80211_rx()
1079 } else if (hostap_is_sta_authorized(local->ap, dst)) { in hostap_80211_rx()
1082 local->ap->bridged_unicast++; in hostap_80211_rx()