diff options
Diffstat (limited to 'net/wireless/util.c')
-rw-r--r-- | net/wireless/util.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c index 37a56ee1e1ed..f5ad4d94ba88 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -511,7 +511,7 @@ int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, | |||
511 | encaps_data = bridge_tunnel_header; | 511 | encaps_data = bridge_tunnel_header; |
512 | encaps_len = sizeof(bridge_tunnel_header); | 512 | encaps_len = sizeof(bridge_tunnel_header); |
513 | skip_header_bytes -= 2; | 513 | skip_header_bytes -= 2; |
514 | } else if (ethertype > 0x600) { | 514 | } else if (ethertype >= ETH_P_802_3_MIN) { |
515 | encaps_data = rfc1042_header; | 515 | encaps_data = rfc1042_header; |
516 | encaps_len = sizeof(rfc1042_header); | 516 | encaps_len = sizeof(rfc1042_header); |
517 | skip_header_bytes -= 2; | 517 | skip_header_bytes -= 2; |
@@ -1155,6 +1155,26 @@ int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len, | |||
1155 | } | 1155 | } |
1156 | EXPORT_SYMBOL(cfg80211_get_p2p_attr); | 1156 | EXPORT_SYMBOL(cfg80211_get_p2p_attr); |
1157 | 1157 | ||
1158 | bool ieee80211_operating_class_to_band(u8 operating_class, | ||
1159 | enum ieee80211_band *band) | ||
1160 | { | ||
1161 | switch (operating_class) { | ||
1162 | case 112: | ||
1163 | case 115 ... 127: | ||
1164 | *band = IEEE80211_BAND_5GHZ; | ||
1165 | return true; | ||
1166 | case 81: | ||
1167 | case 82: | ||
1168 | case 83: | ||
1169 | case 84: | ||
1170 | *band = IEEE80211_BAND_2GHZ; | ||
1171 | return true; | ||
1172 | } | ||
1173 | |||
1174 | return false; | ||
1175 | } | ||
1176 | EXPORT_SYMBOL(ieee80211_operating_class_to_band); | ||
1177 | |||
1158 | int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev, | 1178 | int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev, |
1159 | u32 beacon_int) | 1179 | u32 beacon_int) |
1160 | { | 1180 | { |
@@ -1258,12 +1278,12 @@ int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev, | |||
1258 | list_for_each_entry(wdev_iter, &rdev->wdev_list, list) { | 1278 | list_for_each_entry(wdev_iter, &rdev->wdev_list, list) { |
1259 | if (wdev_iter == wdev) | 1279 | if (wdev_iter == wdev) |
1260 | continue; | 1280 | continue; |
1261 | if (wdev_iter->netdev) { | 1281 | if (wdev_iter->iftype == NL80211_IFTYPE_P2P_DEVICE) { |
1262 | if (!netif_running(wdev_iter->netdev)) | ||
1263 | continue; | ||
1264 | } else if (wdev_iter->iftype == NL80211_IFTYPE_P2P_DEVICE) { | ||
1265 | if (!wdev_iter->p2p_started) | 1282 | if (!wdev_iter->p2p_started) |
1266 | continue; | 1283 | continue; |
1284 | } else if (wdev_iter->netdev) { | ||
1285 | if (!netif_running(wdev_iter->netdev)) | ||
1286 | continue; | ||
1267 | } else { | 1287 | } else { |
1268 | WARN_ON(1); | 1288 | WARN_ON(1); |
1269 | } | 1289 | } |