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.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index a3643fd86af9..c32a0bcd53b7 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -67,12 +67,9 @@ static inline int should_drop_frame(struct ieee80211_rx_status *status,
67 return 1; 67 return 1;
68 if (unlikely(skb->len < 16 + present_fcs_len + radiotap_len)) 68 if (unlikely(skb->len < 16 + present_fcs_len + radiotap_len))
69 return 1; 69 return 1;
70 if (((hdr->frame_control & cpu_to_le16(IEEE80211_FCTL_FTYPE)) == 70 if (ieee80211_is_ctl(hdr->frame_control) &&
71 cpu_to_le16(IEEE80211_FTYPE_CTL)) && 71 !ieee80211_is_pspoll(hdr->frame_control) &&
72 ((hdr->frame_control & cpu_to_le16(IEEE80211_FCTL_STYPE)) != 72 !ieee80211_is_back_req(hdr->frame_control))
73 cpu_to_le16(IEEE80211_STYPE_PSPOLL)) &&
74 ((hdr->frame_control & cpu_to_le16(IEEE80211_FCTL_STYPE)) !=
75 cpu_to_le16(IEEE80211_STYPE_BACK_REQ)))
76 return 1; 73 return 1;
77 return 0; 74 return 0;
78} 75}
@@ -1826,8 +1823,13 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata,
1826 if (!bssid) 1823 if (!bssid)
1827 return 0; 1824 return 0;
1828 if ((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT && 1825 if ((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT &&
1829 (rx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON) 1826 (rx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON) {
1827 if (!rx->sta)
1828 rx->sta = ieee80211_ibss_add_sta(sdata->dev,
1829 rx->skb, bssid, hdr->addr2,
1830 BIT(rx->status->rate_idx));
1830 return 1; 1831 return 1;
1832 }
1831 else if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) { 1833 else if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) {
1832 if (!(rx->flags & IEEE80211_RX_IN_SCAN)) 1834 if (!(rx->flags & IEEE80211_RX_IN_SCAN))
1833 return 0; 1835 return 0;
@@ -1840,7 +1842,8 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata,
1840 rx->flags &= ~IEEE80211_RX_RA_MATCH; 1842 rx->flags &= ~IEEE80211_RX_RA_MATCH;
1841 } else if (!rx->sta) 1843 } else if (!rx->sta)
1842 rx->sta = ieee80211_ibss_add_sta(sdata->dev, rx->skb, 1844 rx->sta = ieee80211_ibss_add_sta(sdata->dev, rx->skb,
1843 bssid, hdr->addr2); 1845 bssid, hdr->addr2,
1846 BIT(rx->status->rate_idx));
1844 break; 1847 break;
1845 case IEEE80211_IF_TYPE_MESH_POINT: 1848 case IEEE80211_IF_TYPE_MESH_POINT:
1846 if (!multicast && 1849 if (!multicast &&
@@ -2118,7 +2121,7 @@ static u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local,
2118 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 2121 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
2119 struct sta_info *sta; 2122 struct sta_info *sta;
2120 struct tid_ampdu_rx *tid_agg_rx; 2123 struct tid_ampdu_rx *tid_agg_rx;
2121 u16 fc, sc; 2124 u16 sc;
2122 u16 mpdu_seq_num; 2125 u16 mpdu_seq_num;
2123 u8 ret = 0, *qc; 2126 u8 ret = 0, *qc;
2124 int tid; 2127 int tid;
@@ -2127,14 +2130,12 @@ static u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local,
2127 if (!sta) 2130 if (!sta)
2128 return ret; 2131 return ret;
2129 2132
2130 fc = le16_to_cpu(hdr->frame_control);
2131
2132 /* filter the QoS data rx stream according to 2133 /* filter the QoS data rx stream according to
2133 * STA/TID and check if this STA/TID is on aggregation */ 2134 * STA/TID and check if this STA/TID is on aggregation */
2134 if (!WLAN_FC_IS_QOS_DATA(fc)) 2135 if (!ieee80211_is_data_qos(hdr->frame_control))
2135 goto end_reorder; 2136 goto end_reorder;
2136 2137
2137 qc = skb->data + ieee80211_get_hdrlen(fc) - QOS_CONTROL_LEN; 2138 qc = ieee80211_get_qos_ctl(hdr);
2138 tid = qc[0] & QOS_CONTROL_TID_MASK; 2139 tid = qc[0] & QOS_CONTROL_TID_MASK;
2139 2140
2140 if (sta->ampdu_mlme.tid_state_rx[tid] != HT_AGG_STATE_OPERATIONAL) 2141 if (sta->ampdu_mlme.tid_state_rx[tid] != HT_AGG_STATE_OPERATIONAL)
@@ -2143,7 +2144,7 @@ static u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local,
2143 tid_agg_rx = sta->ampdu_mlme.tid_rx[tid]; 2144 tid_agg_rx = sta->ampdu_mlme.tid_rx[tid];
2144 2145
2145 /* null data frames are excluded */ 2146 /* null data frames are excluded */
2146 if (unlikely(fc & IEEE80211_STYPE_NULLFUNC)) 2147 if (unlikely(ieee80211_is_nullfunc(hdr->frame_control)))
2147 goto end_reorder; 2148 goto end_reorder;
2148 2149
2149 /* new un-ordered ampdu frame - process it */ 2150 /* new un-ordered ampdu frame - process it */