aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c103
1 files changed, 56 insertions, 47 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index c985c7a537db..e9dcc6229c3c 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -403,6 +403,8 @@ ieee80211_rx_h_load_key(struct ieee80211_txrx_data *rx)
403static void ap_sta_ps_start(struct net_device *dev, struct sta_info *sta) 403static void ap_sta_ps_start(struct net_device *dev, struct sta_info *sta)
404{ 404{
405 struct ieee80211_sub_if_data *sdata; 405 struct ieee80211_sub_if_data *sdata;
406 DECLARE_MAC_BUF(mac);
407
406 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev); 408 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
407 409
408 if (sdata->bss) 410 if (sdata->bss)
@@ -410,8 +412,8 @@ static void ap_sta_ps_start(struct net_device *dev, struct sta_info *sta)
410 sta->flags |= WLAN_STA_PS; 412 sta->flags |= WLAN_STA_PS;
411 sta->pspoll = 0; 413 sta->pspoll = 0;
412#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 414#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
413 printk(KERN_DEBUG "%s: STA " MAC_FMT " aid %d enters power " 415 printk(KERN_DEBUG "%s: STA %s aid %d enters power save mode\n",
414 "save mode\n", dev->name, MAC_ARG(sta->addr), sta->aid); 416 dev->name, print_mac(mac, sta->addr), sta->aid);
415#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 417#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
416} 418}
417 419
@@ -422,6 +424,7 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta)
422 int sent = 0; 424 int sent = 0;
423 struct ieee80211_sub_if_data *sdata; 425 struct ieee80211_sub_if_data *sdata;
424 struct ieee80211_tx_packet_data *pkt_data; 426 struct ieee80211_tx_packet_data *pkt_data;
427 DECLARE_MAC_BUF(mac);
425 428
426 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev); 429 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
427 if (sdata->bss) 430 if (sdata->bss)
@@ -435,8 +438,8 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta)
435 bss_tim_clear(local, sdata->bss, sta->aid); 438 bss_tim_clear(local, sdata->bss, sta->aid);
436 } 439 }
437#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 440#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
438 printk(KERN_DEBUG "%s: STA " MAC_FMT " aid %d exits power " 441 printk(KERN_DEBUG "%s: STA %s aid %d exits power save mode\n",
439 "save mode\n", dev->name, MAC_ARG(sta->addr), sta->aid); 442 dev->name, print_mac(mac, sta->addr), sta->aid);
440#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 443#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
441 /* Send all buffered frames to the station */ 444 /* Send all buffered frames to the station */
442 while ((skb = skb_dequeue(&sta->tx_filtered)) != NULL) { 445 while ((skb = skb_dequeue(&sta->tx_filtered)) != NULL) {
@@ -450,9 +453,9 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta)
450 local->total_ps_buffered--; 453 local->total_ps_buffered--;
451 sent++; 454 sent++;
452#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 455#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
453 printk(KERN_DEBUG "%s: STA " MAC_FMT " aid %d send PS frame " 456 printk(KERN_DEBUG "%s: STA %s aid %d send PS frame "
454 "since STA not sleeping anymore\n", dev->name, 457 "since STA not sleeping anymore\n", dev->name,
455 MAC_ARG(sta->addr), sta->aid); 458 print_mac(mac, sta->addr), sta->aid);
456#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 459#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
457 pkt_data->flags |= IEEE80211_TXPD_REQUEUE; 460 pkt_data->flags |= IEEE80211_TXPD_REQUEUE;
458 dev_queue_xmit(skb); 461 dev_queue_xmit(skb);
@@ -590,13 +593,15 @@ ieee80211_reassemble_add(struct ieee80211_sub_if_data *sdata,
590#ifdef CONFIG_MAC80211_DEBUG 593#ifdef CONFIG_MAC80211_DEBUG
591 struct ieee80211_hdr *hdr = 594 struct ieee80211_hdr *hdr =
592 (struct ieee80211_hdr *) entry->skb_list.next->data; 595 (struct ieee80211_hdr *) entry->skb_list.next->data;
596 DECLARE_MAC_BUF(mac);
597 DECLARE_MAC_BUF(mac2);
593 printk(KERN_DEBUG "%s: RX reassembly removed oldest " 598 printk(KERN_DEBUG "%s: RX reassembly removed oldest "
594 "fragment entry (idx=%d age=%lu seq=%d last_frag=%d " 599 "fragment entry (idx=%d age=%lu seq=%d last_frag=%d "
595 "addr1=" MAC_FMT " addr2=" MAC_FMT "\n", 600 "addr1=%s addr2=%s\n",
596 sdata->dev->name, idx, 601 sdata->dev->name, idx,
597 jiffies - entry->first_frag_time, entry->seq, 602 jiffies - entry->first_frag_time, entry->seq,
598 entry->last_frag, MAC_ARG(hdr->addr1), 603 entry->last_frag, print_mac(mac, hdr->addr1),
599 MAC_ARG(hdr->addr2)); 604 print_mac(mac2, hdr->addr2));
600#endif /* CONFIG_MAC80211_DEBUG */ 605#endif /* CONFIG_MAC80211_DEBUG */
601 __skb_queue_purge(&entry->skb_list); 606 __skb_queue_purge(&entry->skb_list);
602 } 607 }
@@ -662,6 +667,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
662 unsigned int frag, seq; 667 unsigned int frag, seq;
663 struct ieee80211_fragment_entry *entry; 668 struct ieee80211_fragment_entry *entry;
664 struct sk_buff *skb; 669 struct sk_buff *skb;
670 DECLARE_MAC_BUF(mac);
665 671
666 hdr = (struct ieee80211_hdr *) rx->skb->data; 672 hdr = (struct ieee80211_hdr *) rx->skb->data;
667 sc = le16_to_cpu(hdr->seq_ctrl); 673 sc = le16_to_cpu(hdr->seq_ctrl);
@@ -720,10 +726,10 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
720 if (memcmp(pn, rpn, CCMP_PN_LEN) != 0) { 726 if (memcmp(pn, rpn, CCMP_PN_LEN) != 0) {
721 if (net_ratelimit()) 727 if (net_ratelimit())
722 printk(KERN_DEBUG "%s: defrag: CCMP PN not " 728 printk(KERN_DEBUG "%s: defrag: CCMP PN not "
723 "sequential A2=" MAC_FMT 729 "sequential A2=%s"
724 " PN=%02x%02x%02x%02x%02x%02x " 730 " PN=%02x%02x%02x%02x%02x%02x "
725 "(expected %02x%02x%02x%02x%02x%02x)\n", 731 "(expected %02x%02x%02x%02x%02x%02x)\n",
726 rx->dev->name, MAC_ARG(hdr->addr2), 732 rx->dev->name, print_mac(mac, hdr->addr2),
727 rpn[0], rpn[1], rpn[2], rpn[3], rpn[4], 733 rpn[0], rpn[1], rpn[2], rpn[3], rpn[4],
728 rpn[5], pn[0], pn[1], pn[2], pn[3], 734 rpn[5], pn[0], pn[1], pn[2], pn[3],
729 pn[4], pn[5]); 735 pn[4], pn[5]);
@@ -774,6 +780,7 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx)
774{ 780{
775 struct sk_buff *skb; 781 struct sk_buff *skb;
776 int no_pending_pkts; 782 int no_pending_pkts;
783 DECLARE_MAC_BUF(mac);
777 784
778 if (likely(!rx->sta || 785 if (likely(!rx->sta ||
779 (rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_CTL || 786 (rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_CTL ||
@@ -799,9 +806,8 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx)
799 rx->sta->pspoll = 1; 806 rx->sta->pspoll = 1;
800 807
801#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 808#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
802 printk(KERN_DEBUG "STA " MAC_FMT " aid %d: PS Poll (entries " 809 printk(KERN_DEBUG "STA %s aid %d: PS Poll (entries after %d)\n",
803 "after %d)\n", 810 print_mac(mac, rx->sta->addr), rx->sta->aid,
804 MAC_ARG(rx->sta->addr), rx->sta->aid,
805 skb_queue_len(&rx->sta->ps_tx_buf)); 811 skb_queue_len(&rx->sta->ps_tx_buf));
806#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 812#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
807 813
@@ -824,9 +830,9 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx)
824 } 830 }
825#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 831#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
826 } else if (!rx->u.rx.sent_ps_buffered) { 832 } else if (!rx->u.rx.sent_ps_buffered) {
827 printk(KERN_DEBUG "%s: STA " MAC_FMT " sent PS Poll even " 833 printk(KERN_DEBUG "%s: STA %s sent PS Poll even "
828 "though there is no buffered frames for it\n", 834 "though there is no buffered frames for it\n",
829 rx->dev->name, MAC_ARG(rx->sta->addr)); 835 rx->dev->name, print_mac(mac, rx->sta->addr));
830#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 836#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
831 837
832 } 838 }
@@ -881,9 +887,10 @@ ieee80211_rx_h_802_1x_pae(struct ieee80211_txrx_data *rx)
881#ifdef CONFIG_MAC80211_DEBUG 887#ifdef CONFIG_MAC80211_DEBUG
882 struct ieee80211_hdr *hdr = 888 struct ieee80211_hdr *hdr =
883 (struct ieee80211_hdr *) rx->skb->data; 889 (struct ieee80211_hdr *) rx->skb->data;
884 printk(KERN_DEBUG "%s: dropped frame from " MAC_FMT 890 DECLARE_MAC_BUF(mac);
891 printk(KERN_DEBUG "%s: dropped frame from %s"
885 " (unauthorized port)\n", rx->dev->name, 892 " (unauthorized port)\n", rx->dev->name,
886 MAC_ARG(hdr->addr2)); 893 print_mac(mac, hdr->addr2));
887#endif /* CONFIG_MAC80211_DEBUG */ 894#endif /* CONFIG_MAC80211_DEBUG */
888 return TXRX_DROP; 895 return TXRX_DROP;
889 } 896 }
@@ -928,6 +935,10 @@ ieee80211_rx_h_data(struct ieee80211_txrx_data *rx)
928 u8 src[ETH_ALEN]; 935 u8 src[ETH_ALEN];
929 struct sk_buff *skb = rx->skb, *skb2; 936 struct sk_buff *skb = rx->skb, *skb2;
930 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 937 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
938 DECLARE_MAC_BUF(mac);
939 DECLARE_MAC_BUF(mac2);
940 DECLARE_MAC_BUF(mac3);
941 DECLARE_MAC_BUF(mac4);
931 942
932 fc = rx->fc; 943 fc = rx->fc;
933 if (unlikely((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA)) 944 if (unlikely((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA))
@@ -958,13 +969,11 @@ ieee80211_rx_h_data(struct ieee80211_txrx_data *rx)
958 sdata->type != IEEE80211_IF_TYPE_VLAN)) { 969 sdata->type != IEEE80211_IF_TYPE_VLAN)) {
959 if (net_ratelimit()) 970 if (net_ratelimit())
960 printk(KERN_DEBUG "%s: dropped ToDS frame " 971 printk(KERN_DEBUG "%s: dropped ToDS frame "
961 "(BSSID=" MAC_FMT 972 "(BSSID=%s SA=%s DA=%s)\n",
962 " SA=" MAC_FMT
963 " DA=" MAC_FMT ")\n",
964 dev->name, 973 dev->name,
965 MAC_ARG(hdr->addr1), 974 print_mac(mac, hdr->addr1),
966 MAC_ARG(hdr->addr2), 975 print_mac(mac2, hdr->addr2),
967 MAC_ARG(hdr->addr3)); 976 print_mac(mac3, hdr->addr3));
968 return TXRX_DROP; 977 return TXRX_DROP;
969 } 978 }
970 break; 979 break;
@@ -976,14 +985,12 @@ ieee80211_rx_h_data(struct ieee80211_txrx_data *rx)
976 if (unlikely(sdata->type != IEEE80211_IF_TYPE_WDS)) { 985 if (unlikely(sdata->type != IEEE80211_IF_TYPE_WDS)) {
977 if (net_ratelimit()) 986 if (net_ratelimit())
978 printk(KERN_DEBUG "%s: dropped FromDS&ToDS " 987 printk(KERN_DEBUG "%s: dropped FromDS&ToDS "
979 "frame (RA=" MAC_FMT 988 "frame (RA=%s TA=%s DA=%s SA=%s)\n",
980 " TA=" MAC_FMT " DA=" MAC_FMT
981 " SA=" MAC_FMT ")\n",
982 rx->dev->name, 989 rx->dev->name,
983 MAC_ARG(hdr->addr1), 990 print_mac(mac, hdr->addr1),
984 MAC_ARG(hdr->addr2), 991 print_mac(mac2, hdr->addr2),
985 MAC_ARG(hdr->addr3), 992 print_mac(mac3, hdr->addr3),
986 MAC_ARG(hdr->addr4)); 993 print_mac(mac4, hdr->addr4));
987 return TXRX_DROP; 994 return TXRX_DROP;
988 } 995 }
989 break; 996 break;
@@ -1004,12 +1011,12 @@ ieee80211_rx_h_data(struct ieee80211_txrx_data *rx)
1004 1011
1005 if (sdata->type != IEEE80211_IF_TYPE_IBSS) { 1012 if (sdata->type != IEEE80211_IF_TYPE_IBSS) {
1006 if (net_ratelimit()) { 1013 if (net_ratelimit()) {
1007 printk(KERN_DEBUG "%s: dropped IBSS frame (DA=" 1014 printk(KERN_DEBUG "%s: dropped IBSS frame "
1008 MAC_FMT " SA=" MAC_FMT " BSSID=" MAC_FMT 1015 "(DA=%s SA=%s BSSID=%s)\n",
1009 ")\n", 1016 dev->name,
1010 dev->name, MAC_ARG(hdr->addr1), 1017 print_mac(mac, hdr->addr1),
1011 MAC_ARG(hdr->addr2), 1018 print_mac(mac2, hdr->addr2),
1012 MAC_ARG(hdr->addr3)); 1019 print_mac(mac3, hdr->addr3));
1013 } 1020 }
1014 return TXRX_DROP; 1021 return TXRX_DROP;
1015 } 1022 }
@@ -1172,6 +1179,8 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1172 struct ieee80211_txrx_data *rx) 1179 struct ieee80211_txrx_data *rx)
1173{ 1180{
1174 int keyidx, hdrlen; 1181 int keyidx, hdrlen;
1182 DECLARE_MAC_BUF(mac);
1183 DECLARE_MAC_BUF(mac2);
1175 1184
1176 hdrlen = ieee80211_get_hdrlen_from_skb(rx->skb); 1185 hdrlen = ieee80211_get_hdrlen_from_skb(rx->skb);
1177 if (rx->skb->len >= hdrlen + 4) 1186 if (rx->skb->len >= hdrlen + 4)
@@ -1181,9 +1190,9 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1181 1190
1182 if (net_ratelimit()) 1191 if (net_ratelimit())
1183 printk(KERN_DEBUG "%s: TKIP hwaccel reported Michael MIC " 1192 printk(KERN_DEBUG "%s: TKIP hwaccel reported Michael MIC "
1184 "failure from " MAC_FMT " to " MAC_FMT " keyidx=%d\n", 1193 "failure from %s to %s keyidx=%d\n",
1185 dev->name, MAC_ARG(hdr->addr2), MAC_ARG(hdr->addr1), 1194 dev->name, print_mac(mac, hdr->addr2),
1186 keyidx); 1195 print_mac(mac2, hdr->addr1), keyidx);
1187 1196
1188 if (!sta) { 1197 if (!sta) {
1189 /* 1198 /*
@@ -1192,8 +1201,8 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1192 */ 1201 */
1193 if (net_ratelimit()) 1202 if (net_ratelimit())
1194 printk(KERN_DEBUG "%s: ignored spurious Michael MIC " 1203 printk(KERN_DEBUG "%s: ignored spurious Michael MIC "
1195 "error for unknown address " MAC_FMT "\n", 1204 "error for unknown address %s\n",
1196 dev->name, MAC_ARG(hdr->addr2)); 1205 dev->name, print_mac(mac, hdr->addr2));
1197 goto ignore; 1206 goto ignore;
1198 } 1207 }
1199 1208
@@ -1201,7 +1210,7 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1201 if (net_ratelimit()) 1210 if (net_ratelimit())
1202 printk(KERN_DEBUG "%s: ignored spurious Michael MIC " 1211 printk(KERN_DEBUG "%s: ignored spurious Michael MIC "
1203 "error for a frame with no PROTECTED flag (src " 1212 "error for a frame with no PROTECTED flag (src "
1204 MAC_FMT ")\n", dev->name, MAC_ARG(hdr->addr2)); 1213 "%s)\n", dev->name, print_mac(mac, hdr->addr2));
1205 goto ignore; 1214 goto ignore;
1206 } 1215 }
1207 1216
@@ -1215,8 +1224,8 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1215 if (net_ratelimit()) 1224 if (net_ratelimit())
1216 printk(KERN_DEBUG "%s: ignored Michael MIC error for " 1225 printk(KERN_DEBUG "%s: ignored Michael MIC error for "
1217 "a frame with non-zero keyidx (%d)" 1226 "a frame with non-zero keyidx (%d)"
1218 " (src " MAC_FMT ")\n", dev->name, keyidx, 1227 " (src %s)\n", dev->name, keyidx,
1219 MAC_ARG(hdr->addr2)); 1228 print_mac(mac, hdr->addr2));
1220 goto ignore; 1229 goto ignore;
1221 } 1230 }
1222 1231
@@ -1226,8 +1235,8 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1226 if (net_ratelimit()) 1235 if (net_ratelimit())
1227 printk(KERN_DEBUG "%s: ignored spurious Michael MIC " 1236 printk(KERN_DEBUG "%s: ignored spurious Michael MIC "
1228 "error for a frame that cannot be encrypted " 1237 "error for a frame that cannot be encrypted "
1229 "(fc=0x%04x) (src " MAC_FMT ")\n", 1238 "(fc=0x%04x) (src %s)\n",
1230 dev->name, rx->fc, MAC_ARG(hdr->addr2)); 1239 dev->name, rx->fc, print_mac(mac, hdr->addr2));
1231 goto ignore; 1240 goto ignore;
1232 } 1241 }
1233 1242