diff options
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r-- | net/mac80211/main.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 0b040fb73673..c794101f8987 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -587,7 +587,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
587 | 587 | ||
588 | local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN); | 588 | local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN); |
589 | 589 | ||
590 | BUG_ON(!ops->tx && !ops->tx_frags); | 590 | BUG_ON(!ops->tx); |
591 | BUG_ON(!ops->start); | 591 | BUG_ON(!ops->start); |
592 | BUG_ON(!ops->stop); | 592 | BUG_ON(!ops->stop); |
593 | BUG_ON(!ops->config); | 593 | BUG_ON(!ops->config); |
@@ -688,7 +688,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
688 | int result, i; | 688 | int result, i; |
689 | enum ieee80211_band band; | 689 | enum ieee80211_band band; |
690 | int channels, max_bitrates; | 690 | int channels, max_bitrates; |
691 | bool supp_ht; | 691 | bool supp_ht, supp_vht; |
692 | netdev_features_t feature_whitelist; | 692 | netdev_features_t feature_whitelist; |
693 | static const u32 cipher_suites[] = { | 693 | static const u32 cipher_suites[] = { |
694 | /* keep WEP first, it may be removed below */ | 694 | /* keep WEP first, it may be removed below */ |
@@ -706,12 +706,11 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
706 | local->hw.offchannel_tx_hw_queue >= local->hw.queues)) | 706 | local->hw.offchannel_tx_hw_queue >= local->hw.queues)) |
707 | return -EINVAL; | 707 | return -EINVAL; |
708 | 708 | ||
709 | if ((hw->wiphy->wowlan.flags || hw->wiphy->wowlan.n_patterns) | ||
710 | #ifdef CONFIG_PM | 709 | #ifdef CONFIG_PM |
711 | && (!local->ops->suspend || !local->ops->resume) | 710 | if ((hw->wiphy->wowlan.flags || hw->wiphy->wowlan.n_patterns) && |
712 | #endif | 711 | (!local->ops->suspend || !local->ops->resume)) |
713 | ) | ||
714 | return -EINVAL; | 712 | return -EINVAL; |
713 | #endif | ||
715 | 714 | ||
716 | if ((hw->flags & IEEE80211_HW_SCAN_WHILE_IDLE) && !local->ops->hw_scan) | 715 | if ((hw->flags & IEEE80211_HW_SCAN_WHILE_IDLE) && !local->ops->hw_scan) |
717 | return -EINVAL; | 716 | return -EINVAL; |
@@ -733,6 +732,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
733 | channels = 0; | 732 | channels = 0; |
734 | max_bitrates = 0; | 733 | max_bitrates = 0; |
735 | supp_ht = false; | 734 | supp_ht = false; |
735 | supp_vht = false; | ||
736 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { | 736 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { |
737 | struct ieee80211_supported_band *sband; | 737 | struct ieee80211_supported_band *sband; |
738 | 738 | ||
@@ -750,6 +750,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
750 | if (max_bitrates < sband->n_bitrates) | 750 | if (max_bitrates < sband->n_bitrates) |
751 | max_bitrates = sband->n_bitrates; | 751 | max_bitrates = sband->n_bitrates; |
752 | supp_ht = supp_ht || sband->ht_cap.ht_supported; | 752 | supp_ht = supp_ht || sband->ht_cap.ht_supported; |
753 | supp_vht = supp_vht || sband->vht_cap.vht_supported; | ||
753 | } | 754 | } |
754 | 755 | ||
755 | local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) + | 756 | local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) + |
@@ -825,6 +826,10 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
825 | if (supp_ht) | 826 | if (supp_ht) |
826 | local->scan_ies_len += 2 + sizeof(struct ieee80211_ht_cap); | 827 | local->scan_ies_len += 2 + sizeof(struct ieee80211_ht_cap); |
827 | 828 | ||
829 | if (supp_vht) | ||
830 | local->scan_ies_len += | ||
831 | 2 + sizeof(struct ieee80211_vht_capabilities); | ||
832 | |||
828 | if (!local->ops->hw_scan) { | 833 | if (!local->ops->hw_scan) { |
829 | /* For hw_scan, driver needs to set these up. */ | 834 | /* For hw_scan, driver needs to set these up. */ |
830 | local->hw.wiphy->max_scan_ssids = 4; | 835 | local->hw.wiphy->max_scan_ssids = 4; |