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.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 6ad330341b71..e3daee8fdf7a 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -81,7 +81,7 @@ ieee80211_rx_radiotap_len(struct ieee80211_local *local,
81 /* always present fields */ 81 /* always present fields */
82 len = sizeof(struct ieee80211_radiotap_header) + 9; 82 len = sizeof(struct ieee80211_radiotap_header) + 9;
83 83
84 if (status->flag & RX_FLAG_MACTIME_MPDU) 84 if (ieee80211_have_rx_timestamp(status))
85 len += 8; 85 len += 8;
86 if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM) 86 if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM)
87 len += 1; 87 len += 1;
@@ -117,6 +117,11 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
117 struct ieee80211_radiotap_header *rthdr; 117 struct ieee80211_radiotap_header *rthdr;
118 unsigned char *pos; 118 unsigned char *pos;
119 u16 rx_flags = 0; 119 u16 rx_flags = 0;
120 int mpdulen;
121
122 mpdulen = skb->len;
123 if (!(has_fcs && (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS)))
124 mpdulen += FCS_LEN;
120 125
121 rthdr = (struct ieee80211_radiotap_header *)skb_push(skb, rtap_len); 126 rthdr = (struct ieee80211_radiotap_header *)skb_push(skb, rtap_len);
122 memset(rthdr, 0, rtap_len); 127 memset(rthdr, 0, rtap_len);
@@ -134,8 +139,11 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
134 /* the order of the following fields is important */ 139 /* the order of the following fields is important */
135 140
136 /* IEEE80211_RADIOTAP_TSFT */ 141 /* IEEE80211_RADIOTAP_TSFT */
137 if (status->flag & RX_FLAG_MACTIME_MPDU) { 142 if (ieee80211_have_rx_timestamp(status)) {
138 put_unaligned_le64(status->mactime, pos); 143 put_unaligned_le64(
144 ieee80211_calculate_rx_timestamp(local, status,
145 mpdulen, 0),
146 pos);
139 rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_TSFT); 147 rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_TSFT);
140 pos += 8; 148 pos += 8;
141 } 149 }