Lines Matching refs:skb
20 void hostap_dump_rx_80211(const char *name, struct sk_buff *skb, in hostap_dump_rx_80211() argument
26 hdr = (struct ieee80211_hdr *) skb->data; in hostap_dump_rx_80211()
31 skb->len, jiffies); in hostap_dump_rx_80211()
33 if (skb->len < 2) in hostap_dump_rx_80211()
43 if (skb->len < IEEE80211_DATA_HDR3_LEN) { in hostap_dump_rx_80211()
54 if (skb->len >= 30) in hostap_dump_rx_80211()
62 int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb, in prism2_rx_80211() argument
91 fhdr = (struct ieee80211_hdr *) skb->data; in prism2_rx_80211()
97 dev_kfree_skb_any(skb); in prism2_rx_80211()
111 head_need -= skb_headroom(skb); in prism2_rx_80211()
112 tail_need -= skb_tailroom(skb); in prism2_rx_80211()
115 if (pskb_expand_head(skb, head_need > 0 ? head_need : 0, in prism2_rx_80211()
120 dev_kfree_skb_any(skb); in prism2_rx_80211()
129 memset(skb_put(skb, 4), 0xff, 4); /* Prism2 strips CRC */ in prism2_rx_80211()
135 skb_push(skb, phdrlen); in prism2_rx_80211()
152 LWNG_SETVAL(frmlen, 10, 0, 4, skb->len - phdrlen); in prism2_rx_80211()
157 skb_push(skb, phdrlen); in prism2_rx_80211()
175 hdr = (struct hostap_radiotap_rx *)skb_push(skb, phdrlen); in prism2_rx_80211()
193 ret = skb->len - phdrlen; in prism2_rx_80211()
194 skb->dev = dev; in prism2_rx_80211()
195 skb_reset_mac_header(skb); in prism2_rx_80211()
196 skb_pull(skb, hdrlen); in prism2_rx_80211()
198 skb_pull(skb, phdrlen); in prism2_rx_80211()
199 skb->pkt_type = PACKET_OTHERHOST; in prism2_rx_80211()
200 skb->protocol = cpu_to_be16(ETH_P_802_2); in prism2_rx_80211()
201 memset(skb->cb, 0, sizeof(skb->cb)); in prism2_rx_80211()
202 netif_rx(skb); in prism2_rx_80211()
209 static void monitor_rx(struct net_device *dev, struct sk_buff *skb, in monitor_rx() argument
214 len = prism2_rx_80211(dev, skb, rx_stats, PRISM2_RX_MONITOR); in monitor_rx()
230 if (entry->skb != NULL && in prism2_frag_cache_find()
235 dev_kfree_skb(entry->skb); in prism2_frag_cache_find()
236 entry->skb = NULL; in prism2_frag_cache_find()
239 if (entry->skb != NULL && entry->seq == seq && in prism2_frag_cache_find()
254 struct sk_buff *skb = NULL; in prism2_frag_cache_get() local
265 skb = dev_alloc_skb(local->dev->mtu + in prism2_frag_cache_get()
270 if (skb == NULL) in prism2_frag_cache_get()
278 if (entry->skb != NULL) in prism2_frag_cache_get()
279 dev_kfree_skb(entry->skb); in prism2_frag_cache_get()
284 entry->skb = skb; in prism2_frag_cache_get()
294 skb = entry->skb; in prism2_frag_cache_get()
298 return skb; in prism2_frag_cache_get()
322 entry->skb = NULL; in prism2_frag_cache_invalidate()
393 static void hostap_rx_sta_beacon(local_info_t *local, struct sk_buff *skb, in hostap_rx_sta_beacon() argument
403 if (skb->len < IEEE80211_MGMT_HDR_LEN + sizeof(mgmt->u.beacon)) in hostap_rx_sta_beacon()
406 mgmt = (struct hostap_ieee80211_mgmt *) skb->data; in hostap_rx_sta_beacon()
408 left = skb->len - (pos - skb->data); in hostap_rx_sta_beacon()
472 hostap_rx_frame_mgmt(local_info_t *local, struct sk_buff *skb, in hostap_rx_frame_mgmt() argument
477 hostap_update_sta_ps(local, (struct ieee80211_hdr *) skb->data); in hostap_rx_frame_mgmt()
485 skb2 = skb_clone(skb, GFP_ATOMIC); in hostap_rx_frame_mgmt()
493 local->apdevstats.rx_bytes += skb->len; in hostap_rx_frame_mgmt()
496 prism2_rx_80211(local->apdev, skb, rx_stats, PRISM2_RX_MGMT); in hostap_rx_frame_mgmt()
505 skb->dev->name, type >> 2, stype >> 4); in hostap_rx_frame_mgmt()
509 hostap_rx(skb->dev, skb, rx_stats); in hostap_rx_frame_mgmt()
514 hostap_rx_sta_beacon(local, skb, stype); in hostap_rx_frame_mgmt()
526 skb->dev->name, type >> 2, stype >> 4); in hostap_rx_frame_mgmt()
609 static int hostap_is_eapol_frame(local_info_t *local, struct sk_buff *skb) in hostap_is_eapol_frame() argument
616 if (skb->len < 24) in hostap_is_eapol_frame()
619 hdr = (struct ieee80211_hdr *) skb->data; in hostap_is_eapol_frame()
635 if (skb->len < 24 + 8) in hostap_is_eapol_frame()
639 pos = skb->data + 24; in hostap_is_eapol_frame()
650 hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb, in hostap_rx_frame_decrypt() argument
659 hdr = (struct ieee80211_hdr *) skb->data; in hostap_rx_frame_decrypt()
673 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); 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
697 hdr = (struct ieee80211_hdr *) skb->data; in hostap_rx_frame_decrypt_msdu()
701 res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv); in hostap_rx_frame_decrypt_msdu()
717 void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, in hostap_80211_rx() argument
741 iface->stats.rx_bytes += skb->len; in hostap_80211_rx()
748 hdr = (struct ieee80211_hdr *) skb->data; in hostap_80211_rx()
750 if (skb->len < 10) in hostap_80211_rx()
777 monitor_rx(dev, skb, rx_stats); in hostap_80211_rx()
783 if (skb->len >= hdrlen + 3) in hostap_80211_rx()
784 idx = skb->data[hdrlen + 3] >> 6; 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()
840 if (skb->len < IEEE80211_DATA_HDR3_LEN) in hostap_80211_rx()
853 if (skb->len < IEEE80211_DATA_HDR4_LEN) in hostap_80211_rx()
867 skb->dev = dev = wds; in hostap_80211_rx()
875 skb->dev = dev = local->stadev; in hostap_80211_rx()
882 switch (hostap_handle_sta_rx(local, dev, skb, rx_stats, in hostap_80211_rx()
913 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) in hostap_80211_rx()
915 hdr = (struct ieee80211_hdr *) skb->data; in hostap_80211_rx()
932 flen = skb->len; in hostap_80211_rx()
947 skb_copy_from_linear_data(skb, skb_put(frag_skb, flen), in hostap_80211_rx()
952 skb_copy_from_linear_data_offset(skb, hdrlen, in hostap_80211_rx()
956 dev_kfree_skb(skb); in hostap_80211_rx()
957 skb = NULL; in hostap_80211_rx()
968 skb = frag_skb; in hostap_80211_rx()
969 hdr = (struct ieee80211_hdr *) skb->data; in hostap_80211_rx()
977 hostap_rx_frame_decrypt_msdu(local, skb, keyidx, crypt)) in hostap_80211_rx()
980 hdr = (struct ieee80211_hdr *) skb->data; in hostap_80211_rx()
983 hostap_is_eapol_frame(local, skb)) { in hostap_80211_rx()
997 !hostap_is_eapol_frame(local, skb)) { in hostap_80211_rx()
1008 payload = skb->data + hdrlen; in hostap_80211_rx()
1020 prism2_rx_80211(local->apdev, skb, rx_stats, in hostap_80211_rx()
1023 local->apdevstats.rx_bytes += skb->len; in hostap_80211_rx()
1036 if (skb->len - hdrlen >= 8 && in hostap_80211_rx()
1042 skb_pull(skb, hdrlen + 6); in hostap_80211_rx()
1043 memcpy(skb_push(skb, ETH_ALEN), src, ETH_ALEN); in hostap_80211_rx()
1044 memcpy(skb_push(skb, ETH_ALEN), dst, ETH_ALEN); in hostap_80211_rx()
1048 skb_pull(skb, hdrlen); in hostap_80211_rx()
1049 len = htons(skb->len); in hostap_80211_rx()
1050 memcpy(skb_push(skb, 2), &len, 2); in hostap_80211_rx()
1051 memcpy(skb_push(skb, ETH_ALEN), src, ETH_ALEN); in hostap_80211_rx()
1052 memcpy(skb_push(skb, ETH_ALEN), dst, ETH_ALEN); in hostap_80211_rx()
1057 skb->len >= ETH_HLEN + ETH_ALEN) { in hostap_80211_rx()
1060 skb_copy_from_linear_data_offset(skb, skb->len - ETH_ALEN, in hostap_80211_rx()
1061 skb->data + ETH_ALEN, in hostap_80211_rx()
1063 skb_trim(skb, skb->len - ETH_ALEN); in hostap_80211_rx()
1067 dev->stats.rx_bytes += skb->len; in hostap_80211_rx()
1075 skb2 = skb_clone(skb, GFP_ATOMIC); in hostap_80211_rx()
1083 skb2 = skb; in hostap_80211_rx()
1084 skb = NULL; in hostap_80211_rx()
1098 if (skb) { in hostap_80211_rx()
1099 skb->protocol = eth_type_trans(skb, dev); in hostap_80211_rx()
1100 memset(skb->cb, 0, sizeof(skb->cb)); in hostap_80211_rx()
1101 netif_rx(skb); in hostap_80211_rx()
1110 dev_kfree_skb(skb); in hostap_80211_rx()