diff options
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r-- | net/mac80211/main.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 0de7c93bf62b..282a4f36eb92 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -478,13 +478,9 @@ static const struct ieee80211_vht_cap mac80211_vht_capa_mod_mask = { | |||
478 | }, | 478 | }, |
479 | }; | 479 | }; |
480 | 480 | ||
481 | static const u8 extended_capabilities[] = { | 481 | struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len, |
482 | 0, 0, 0, 0, 0, 0, 0, | 482 | const struct ieee80211_ops *ops, |
483 | WLAN_EXT_CAPA8_OPMODE_NOTIF, | 483 | const char *requested_name) |
484 | }; | ||
485 | |||
486 | struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | ||
487 | const struct ieee80211_ops *ops) | ||
488 | { | 484 | { |
489 | struct ieee80211_local *local; | 485 | struct ieee80211_local *local; |
490 | int priv_size, i; | 486 | int priv_size, i; |
@@ -524,7 +520,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
524 | */ | 520 | */ |
525 | priv_size = ALIGN(sizeof(*local), NETDEV_ALIGN) + priv_data_len; | 521 | priv_size = ALIGN(sizeof(*local), NETDEV_ALIGN) + priv_data_len; |
526 | 522 | ||
527 | wiphy = wiphy_new(&mac80211_config_ops, priv_size); | 523 | wiphy = wiphy_new_nm(&mac80211_config_ops, priv_size, requested_name); |
528 | 524 | ||
529 | if (!wiphy) | 525 | if (!wiphy) |
530 | return NULL; | 526 | return NULL; |
@@ -539,10 +535,6 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
539 | WIPHY_FLAG_REPORTS_OBSS | | 535 | WIPHY_FLAG_REPORTS_OBSS | |
540 | WIPHY_FLAG_OFFCHAN_TX; | 536 | WIPHY_FLAG_OFFCHAN_TX; |
541 | 537 | ||
542 | wiphy->extended_capabilities = extended_capabilities; | ||
543 | wiphy->extended_capabilities_mask = extended_capabilities; | ||
544 | wiphy->extended_capabilities_len = ARRAY_SIZE(extended_capabilities); | ||
545 | |||
546 | if (ops->remain_on_channel) | 538 | if (ops->remain_on_channel) |
547 | wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; | 539 | wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; |
548 | 540 | ||
@@ -550,6 +542,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
550 | NL80211_FEATURE_SAE | | 542 | NL80211_FEATURE_SAE | |
551 | NL80211_FEATURE_HT_IBSS | | 543 | NL80211_FEATURE_HT_IBSS | |
552 | NL80211_FEATURE_VIF_TXPOWER | | 544 | NL80211_FEATURE_VIF_TXPOWER | |
545 | NL80211_FEATURE_MAC_ON_CREATE | | ||
553 | NL80211_FEATURE_USERSPACE_MPM; | 546 | NL80211_FEATURE_USERSPACE_MPM; |
554 | 547 | ||
555 | if (!ops->hw_scan) | 548 | if (!ops->hw_scan) |
@@ -591,6 +584,13 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
591 | wiphy->ht_capa_mod_mask = &mac80211_ht_capa_mod_mask; | 584 | wiphy->ht_capa_mod_mask = &mac80211_ht_capa_mod_mask; |
592 | wiphy->vht_capa_mod_mask = &mac80211_vht_capa_mod_mask; | 585 | wiphy->vht_capa_mod_mask = &mac80211_vht_capa_mod_mask; |
593 | 586 | ||
587 | local->ext_capa[7] = WLAN_EXT_CAPA8_OPMODE_NOTIF; | ||
588 | |||
589 | wiphy->extended_capabilities = local->ext_capa; | ||
590 | wiphy->extended_capabilities_mask = local->ext_capa; | ||
591 | wiphy->extended_capabilities_len = | ||
592 | ARRAY_SIZE(local->ext_capa); | ||
593 | |||
594 | INIT_LIST_HEAD(&local->interfaces); | 594 | INIT_LIST_HEAD(&local->interfaces); |
595 | 595 | ||
596 | __hw_addr_init(&local->mc_list); | 596 | __hw_addr_init(&local->mc_list); |
@@ -651,7 +651,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
651 | 651 | ||
652 | return &local->hw; | 652 | return &local->hw; |
653 | } | 653 | } |
654 | EXPORT_SYMBOL(ieee80211_alloc_hw); | 654 | EXPORT_SYMBOL(ieee80211_alloc_hw_nm); |
655 | 655 | ||
656 | static int ieee80211_init_cipher_suites(struct ieee80211_local *local) | 656 | static int ieee80211_init_cipher_suites(struct ieee80211_local *local) |
657 | { | 657 | { |
@@ -787,13 +787,14 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
787 | if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS)) | 787 | if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS)) |
788 | return -EINVAL; | 788 | return -EINVAL; |
789 | 789 | ||
790 | /* DFS currently not supported with channel context drivers */ | 790 | /* DFS is not supported with multi-channel combinations yet */ |
791 | for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) { | 791 | for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) { |
792 | const struct ieee80211_iface_combination *comb; | 792 | const struct ieee80211_iface_combination *comb; |
793 | 793 | ||
794 | comb = &local->hw.wiphy->iface_combinations[i]; | 794 | comb = &local->hw.wiphy->iface_combinations[i]; |
795 | 795 | ||
796 | if (comb->radar_detect_widths) | 796 | if (comb->radar_detect_widths && |
797 | comb->num_different_channels > 1) | ||
797 | return -EINVAL; | 798 | return -EINVAL; |
798 | } | 799 | } |
799 | } | 800 | } |
@@ -958,6 +959,10 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
958 | if (local->hw.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) | 959 | if (local->hw.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) |
959 | local->hw.wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP; | 960 | local->hw.wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP; |
960 | 961 | ||
962 | /* mac80211 supports eCSA, if the driver supports STA CSA at all */ | ||
963 | if (local->hw.flags & IEEE80211_HW_CHANCTX_STA_CSA) | ||
964 | local->ext_capa[0] |= WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING; | ||
965 | |||
961 | local->hw.wiphy->max_num_csa_counters = IEEE80211_MAX_CSA_COUNTERS_NUM; | 966 | local->hw.wiphy->max_num_csa_counters = IEEE80211_MAX_CSA_COUNTERS_NUM; |
962 | 967 | ||
963 | result = wiphy_register(local->hw.wiphy); | 968 | result = wiphy_register(local->hw.wiphy); |
@@ -1019,7 +1024,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
1019 | } | 1024 | } |
1020 | 1025 | ||
1021 | /* add one default STA interface if supported */ | 1026 | /* add one default STA interface if supported */ |
1022 | if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION)) { | 1027 | if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION) && |
1028 | !(hw->flags & IEEE80211_HW_NO_AUTO_VIF)) { | ||
1023 | result = ieee80211_if_add(local, "wlan%d", NULL, | 1029 | result = ieee80211_if_add(local, "wlan%d", NULL, |
1024 | NL80211_IFTYPE_STATION, NULL); | 1030 | NL80211_IFTYPE_STATION, NULL); |
1025 | if (result) | 1031 | if (result) |