aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-02-05 09:36:01 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-02-06 03:33:46 -0500
commit0059b2b142b9938118e1ed1ea630c527119425fe (patch)
tree73a82bb801b6fb9d91ca4355c92c2601bc64efab /net/mac80211
parent3de3802c3d0909c4f222df93cfc0f4ed91191e4c (diff)
mac80211: remove unused radiotap vendor fields in ieee80211_rx_status
The purpose of this housekeeping is to make some room for VHT flags. The radiotap vendor fields weren't in use. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/rx.c53
1 files changed, 5 insertions, 48 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 79a89fe9d616..b86330138d67 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -40,8 +40,6 @@
40static struct sk_buff *remove_monitor_info(struct ieee80211_local *local, 40static struct sk_buff *remove_monitor_info(struct ieee80211_local *local,
41 struct sk_buff *skb) 41 struct sk_buff *skb)
42{ 42{
43 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
44
45 if (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS) { 43 if (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS) {
46 if (likely(skb->len > FCS_LEN)) 44 if (likely(skb->len > FCS_LEN))
47 __pskb_trim(skb, skb->len - FCS_LEN); 45 __pskb_trim(skb, skb->len - FCS_LEN);
@@ -53,9 +51,6 @@ static struct sk_buff *remove_monitor_info(struct ieee80211_local *local,
53 } 51 }
54 } 52 }
55 53
56 if (status->vendor_radiotap_len)
57 __pskb_pull(skb, status->vendor_radiotap_len);
58
59 return skb; 54 return skb;
60} 55}
61 56
@@ -64,14 +59,13 @@ static inline int should_drop_frame(struct sk_buff *skb, int present_fcs_len)
64 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); 59 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
65 struct ieee80211_hdr *hdr; 60 struct ieee80211_hdr *hdr;
66 61
67 hdr = (void *)(skb->data + status->vendor_radiotap_len); 62 hdr = (void *)(skb->data);
68 63
69 if (status->flag & (RX_FLAG_FAILED_FCS_CRC | 64 if (status->flag & (RX_FLAG_FAILED_FCS_CRC |
70 RX_FLAG_FAILED_PLCP_CRC | 65 RX_FLAG_FAILED_PLCP_CRC |
71 RX_FLAG_AMPDU_IS_ZEROLEN)) 66 RX_FLAG_AMPDU_IS_ZEROLEN))
72 return 1; 67 return 1;
73 if (unlikely(skb->len < 16 + present_fcs_len + 68 if (unlikely(skb->len < 16 + present_fcs_len))
74 status->vendor_radiotap_len))
75 return 1; 69 return 1;
76 if (ieee80211_is_ctl(hdr->frame_control) && 70 if (ieee80211_is_ctl(hdr->frame_control) &&
77 !ieee80211_is_pspoll(hdr->frame_control) && 71 !ieee80211_is_pspoll(hdr->frame_control) &&
@@ -90,8 +84,6 @@ ieee80211_rx_radiotap_space(struct ieee80211_local *local,
90 len = sizeof(struct ieee80211_radiotap_header) + 8; 84 len = sizeof(struct ieee80211_radiotap_header) + 8;
91 85
92 /* allocate extra bitmaps */ 86 /* allocate extra bitmaps */
93 if (status->vendor_radiotap_len)
94 len += 4;
95 if (status->chains) 87 if (status->chains)
96 len += 4 * hweight8(status->chains); 88 len += 4 * hweight8(status->chains);
97 89
@@ -127,18 +119,6 @@ ieee80211_rx_radiotap_space(struct ieee80211_local *local,
127 len += 2 * hweight8(status->chains); 119 len += 2 * hweight8(status->chains);
128 } 120 }
129 121
130 if (status->vendor_radiotap_len) {
131 if (WARN_ON_ONCE(status->vendor_radiotap_align == 0))
132 status->vendor_radiotap_align = 1;
133 /* align standard part of vendor namespace */
134 len = ALIGN(len, 2);
135 /* allocate standard part of vendor namespace */
136 len += 6;
137 /* align vendor-defined part */
138 len = ALIGN(len, status->vendor_radiotap_align);
139 /* vendor-defined part is already in skb */
140 }
141
142 return len; 122 return len;
143} 123}
144 124
@@ -172,7 +152,7 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
172 it_present = &rthdr->it_present; 152 it_present = &rthdr->it_present;
173 153
174 /* radiotap header, set always present flags */ 154 /* radiotap header, set always present flags */
175 rthdr->it_len = cpu_to_le16(rtap_len + status->vendor_radiotap_len); 155 rthdr->it_len = cpu_to_le16(rtap_len);
176 it_present_val = BIT(IEEE80211_RADIOTAP_FLAGS) | 156 it_present_val = BIT(IEEE80211_RADIOTAP_FLAGS) |
177 BIT(IEEE80211_RADIOTAP_CHANNEL) | 157 BIT(IEEE80211_RADIOTAP_CHANNEL) |
178 BIT(IEEE80211_RADIOTAP_RX_FLAGS); 158 BIT(IEEE80211_RADIOTAP_RX_FLAGS);
@@ -190,14 +170,6 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
190 BIT(IEEE80211_RADIOTAP_DBM_ANTSIGNAL); 170 BIT(IEEE80211_RADIOTAP_DBM_ANTSIGNAL);
191 } 171 }
192 172
193 if (status->vendor_radiotap_len) {
194 it_present_val |= BIT(IEEE80211_RADIOTAP_VENDOR_NAMESPACE) |
195 BIT(IEEE80211_RADIOTAP_EXT);
196 put_unaligned_le32(it_present_val, it_present);
197 it_present++;
198 it_present_val = status->vendor_radiotap_bitmap;
199 }
200
201 put_unaligned_le32(it_present_val, it_present); 173 put_unaligned_le32(it_present_val, it_present);
202 174
203 pos = (void *)(it_present + 1); 175 pos = (void *)(it_present + 1);
@@ -383,21 +355,6 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
383 *pos++ = status->chain_signal[chain]; 355 *pos++ = status->chain_signal[chain];
384 *pos++ = chain; 356 *pos++ = chain;
385 } 357 }
386
387 if (status->vendor_radiotap_len) {
388 /* ensure 2 byte alignment for the vendor field as required */
389 if ((pos - (u8 *)rthdr) & 1)
390 *pos++ = 0;
391 *pos++ = status->vendor_radiotap_oui[0];
392 *pos++ = status->vendor_radiotap_oui[1];
393 *pos++ = status->vendor_radiotap_oui[2];
394 *pos++ = status->vendor_radiotap_subns;
395 put_unaligned_le16(status->vendor_radiotap_len, pos);
396 pos += 2;
397 /* align the actual payload as requested */
398 while ((pos - (u8 *)rthdr) & (status->vendor_radiotap_align - 1))
399 *pos++ = 0;
400 }
401} 358}
402 359
403/* 360/*
@@ -428,8 +385,8 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
428 if (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS) 385 if (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS)
429 present_fcs_len = FCS_LEN; 386 present_fcs_len = FCS_LEN;
430 387
431 /* ensure hdr->frame_control and vendor radiotap data are in skb head */ 388 /* ensure hdr->frame_control is in skb head */
432 if (!pskb_may_pull(origskb, 2 + status->vendor_radiotap_len)) { 389 if (!pskb_may_pull(origskb, 2)) {
433 dev_kfree_skb(origskb); 390 dev_kfree_skb(origskb);
434 return NULL; 391 return NULL;
435 } 392 }