diff options
Diffstat (limited to 'net/wireless/util.c')
-rw-r--r-- | net/wireless/util.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c index e9d040d29846..68e5f2ecee1a 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -114,8 +114,7 @@ int ieee80211_frequency_to_channel(int freq) | |||
114 | } | 114 | } |
115 | EXPORT_SYMBOL(ieee80211_frequency_to_channel); | 115 | EXPORT_SYMBOL(ieee80211_frequency_to_channel); |
116 | 116 | ||
117 | struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, | 117 | struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy, int freq) |
118 | int freq) | ||
119 | { | 118 | { |
120 | enum nl80211_band band; | 119 | enum nl80211_band band; |
121 | struct ieee80211_supported_band *sband; | 120 | struct ieee80211_supported_band *sband; |
@@ -135,14 +134,13 @@ struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, | |||
135 | 134 | ||
136 | return NULL; | 135 | return NULL; |
137 | } | 136 | } |
138 | EXPORT_SYMBOL(__ieee80211_get_channel); | 137 | EXPORT_SYMBOL(ieee80211_get_channel); |
139 | 138 | ||
140 | static void set_mandatory_flags_band(struct ieee80211_supported_band *sband, | 139 | static void set_mandatory_flags_band(struct ieee80211_supported_band *sband) |
141 | enum nl80211_band band) | ||
142 | { | 140 | { |
143 | int i, want; | 141 | int i, want; |
144 | 142 | ||
145 | switch (band) { | 143 | switch (sband->band) { |
146 | case NL80211_BAND_5GHZ: | 144 | case NL80211_BAND_5GHZ: |
147 | want = 3; | 145 | want = 3; |
148 | for (i = 0; i < sband->n_bitrates; i++) { | 146 | for (i = 0; i < sband->n_bitrates; i++) { |
@@ -192,6 +190,7 @@ static void set_mandatory_flags_band(struct ieee80211_supported_band *sband, | |||
192 | WARN_ON((sband->ht_cap.mcs.rx_mask[0] & 0x1e) != 0x1e); | 190 | WARN_ON((sband->ht_cap.mcs.rx_mask[0] & 0x1e) != 0x1e); |
193 | break; | 191 | break; |
194 | case NUM_NL80211_BANDS: | 192 | case NUM_NL80211_BANDS: |
193 | default: | ||
195 | WARN_ON(1); | 194 | WARN_ON(1); |
196 | break; | 195 | break; |
197 | } | 196 | } |
@@ -203,7 +202,7 @@ void ieee80211_set_bitrate_flags(struct wiphy *wiphy) | |||
203 | 202 | ||
204 | for (band = 0; band < NUM_NL80211_BANDS; band++) | 203 | for (band = 0; band < NUM_NL80211_BANDS; band++) |
205 | if (wiphy->bands[band]) | 204 | if (wiphy->bands[band]) |
206 | set_mandatory_flags_band(wiphy->bands[band], band); | 205 | set_mandatory_flags_band(wiphy->bands[band]); |
207 | } | 206 | } |
208 | 207 | ||
209 | bool cfg80211_supported_cipher_suite(struct wiphy *wiphy, u32 cipher) | 208 | bool cfg80211_supported_cipher_suite(struct wiphy *wiphy, u32 cipher) |
@@ -619,8 +618,6 @@ int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, | |||
619 | 618 | ||
620 | if (pskb_expand_head(skb, head_need, 0, GFP_ATOMIC)) | 619 | if (pskb_expand_head(skb, head_need, 0, GFP_ATOMIC)) |
621 | return -ENOMEM; | 620 | return -ENOMEM; |
622 | |||
623 | skb->truesize += head_need; | ||
624 | } | 621 | } |
625 | 622 | ||
626 | if (encaps_data) { | 623 | if (encaps_data) { |
@@ -952,7 +949,7 @@ void cfg80211_process_wdev_events(struct wireless_dev *wdev) | |||
952 | ev->cr.resp_ie, ev->cr.resp_ie_len, | 949 | ev->cr.resp_ie, ev->cr.resp_ie_len, |
953 | ev->cr.status, | 950 | ev->cr.status, |
954 | ev->cr.status == WLAN_STATUS_SUCCESS, | 951 | ev->cr.status == WLAN_STATUS_SUCCESS, |
955 | ev->cr.bss); | 952 | ev->cr.bss, ev->cr.timeout_reason); |
956 | break; | 953 | break; |
957 | case EVENT_ROAMED: | 954 | case EVENT_ROAMED: |
958 | __cfg80211_roamed(wdev, ev->rm.bss, ev->rm.req_ie, | 955 | __cfg80211_roamed(wdev, ev->rm.bss, ev->rm.req_ie, |
@@ -1848,6 +1845,21 @@ void cfg80211_free_nan_func(struct cfg80211_nan_func *f) | |||
1848 | } | 1845 | } |
1849 | EXPORT_SYMBOL(cfg80211_free_nan_func); | 1846 | EXPORT_SYMBOL(cfg80211_free_nan_func); |
1850 | 1847 | ||
1848 | bool cfg80211_does_bw_fit_range(const struct ieee80211_freq_range *freq_range, | ||
1849 | u32 center_freq_khz, u32 bw_khz) | ||
1850 | { | ||
1851 | u32 start_freq_khz, end_freq_khz; | ||
1852 | |||
1853 | start_freq_khz = center_freq_khz - (bw_khz / 2); | ||
1854 | end_freq_khz = center_freq_khz + (bw_khz / 2); | ||
1855 | |||
1856 | if (start_freq_khz >= freq_range->start_freq_khz && | ||
1857 | end_freq_khz <= freq_range->end_freq_khz) | ||
1858 | return true; | ||
1859 | |||
1860 | return false; | ||
1861 | } | ||
1862 | |||
1851 | /* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */ | 1863 | /* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */ |
1852 | /* Ethernet-II snap header (RFC1042 for most EtherTypes) */ | 1864 | /* Ethernet-II snap header (RFC1042 for most EtherTypes) */ |
1853 | const unsigned char rfc1042_header[] __aligned(2) = | 1865 | const unsigned char rfc1042_header[] __aligned(2) = |