diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-05-27 11:40:30 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-06-01 15:36:35 -0400 |
commit | 0fd095024b7bc023c7afac107732dac961ee690d (patch) | |
tree | 2f2138773adc9fe5d49abaaf39cbd7dd36c5f60b /drivers/net/wireless/iwlwifi/iwl-agn.c | |
parent | 93cce6f0adff92238965eadb3c046db58552087b (diff) |
iwlagn: advertise interface combinations
With this, iwlwifi will advertise the limits on
concurrency of virtual interfaces.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 76b333624a2e..de0830dba1f0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2420,6 +2420,77 @@ unlock: | |||
2420 | * | 2420 | * |
2421 | *****************************************************************************/ | 2421 | *****************************************************************************/ |
2422 | 2422 | ||
2423 | static const struct ieee80211_iface_limit iwlagn_sta_ap_limits[] = { | ||
2424 | { | ||
2425 | .max = 1, | ||
2426 | .types = BIT(NL80211_IFTYPE_STATION), | ||
2427 | }, | ||
2428 | { | ||
2429 | .max = 1, | ||
2430 | .types = BIT(NL80211_IFTYPE_AP), | ||
2431 | }, | ||
2432 | }; | ||
2433 | |||
2434 | static const struct ieee80211_iface_limit iwlagn_2sta_limits[] = { | ||
2435 | { | ||
2436 | .max = 2, | ||
2437 | .types = BIT(NL80211_IFTYPE_STATION), | ||
2438 | }, | ||
2439 | }; | ||
2440 | |||
2441 | static const struct ieee80211_iface_limit iwlagn_p2p_sta_go_limits[] = { | ||
2442 | { | ||
2443 | .max = 1, | ||
2444 | .types = BIT(NL80211_IFTYPE_STATION), | ||
2445 | }, | ||
2446 | { | ||
2447 | .max = 1, | ||
2448 | .types = BIT(NL80211_IFTYPE_P2P_GO) | | ||
2449 | BIT(NL80211_IFTYPE_AP), | ||
2450 | }, | ||
2451 | }; | ||
2452 | |||
2453 | static const struct ieee80211_iface_limit iwlagn_p2p_2sta_limits[] = { | ||
2454 | { | ||
2455 | .max = 2, | ||
2456 | .types = BIT(NL80211_IFTYPE_STATION), | ||
2457 | }, | ||
2458 | { | ||
2459 | .max = 1, | ||
2460 | .types = BIT(NL80211_IFTYPE_P2P_CLIENT), | ||
2461 | }, | ||
2462 | }; | ||
2463 | |||
2464 | static const struct ieee80211_iface_combination | ||
2465 | iwlagn_iface_combinations_dualmode[] = { | ||
2466 | { .num_different_channels = 1, | ||
2467 | .max_interfaces = 2, | ||
2468 | .beacon_int_infra_match = true, | ||
2469 | .limits = iwlagn_sta_ap_limits, | ||
2470 | .n_limits = ARRAY_SIZE(iwlagn_sta_ap_limits), | ||
2471 | }, | ||
2472 | { .num_different_channels = 1, | ||
2473 | .max_interfaces = 2, | ||
2474 | .limits = iwlagn_2sta_limits, | ||
2475 | .n_limits = ARRAY_SIZE(iwlagn_2sta_limits), | ||
2476 | }, | ||
2477 | }; | ||
2478 | |||
2479 | static const struct ieee80211_iface_combination | ||
2480 | iwlagn_iface_combinations_p2p[] = { | ||
2481 | { .num_different_channels = 1, | ||
2482 | .max_interfaces = 2, | ||
2483 | .beacon_int_infra_match = true, | ||
2484 | .limits = iwlagn_p2p_sta_go_limits, | ||
2485 | .n_limits = ARRAY_SIZE(iwlagn_p2p_sta_go_limits), | ||
2486 | }, | ||
2487 | { .num_different_channels = 1, | ||
2488 | .max_interfaces = 2, | ||
2489 | .limits = iwlagn_p2p_2sta_limits, | ||
2490 | .n_limits = ARRAY_SIZE(iwlagn_p2p_2sta_limits), | ||
2491 | }, | ||
2492 | }; | ||
2493 | |||
2423 | /* | 2494 | /* |
2424 | * Not a mac80211 entry point function, but it fits in with all the | 2495 | * Not a mac80211 entry point function, but it fits in with all the |
2425 | * other mac80211 functions grouped here. | 2496 | * other mac80211 functions grouped here. |
@@ -2460,6 +2531,18 @@ static int iwl_mac_setup_register(struct iwl_priv *priv, | |||
2460 | hw->wiphy->interface_modes |= ctx->exclusive_interface_modes; | 2531 | hw->wiphy->interface_modes |= ctx->exclusive_interface_modes; |
2461 | } | 2532 | } |
2462 | 2533 | ||
2534 | BUILD_BUG_ON(NUM_IWL_RXON_CTX != 2); | ||
2535 | |||
2536 | if (hw->wiphy->interface_modes & NL80211_IFTYPE_P2P_CLIENT) { | ||
2537 | hw->wiphy->iface_combinations = iwlagn_iface_combinations_p2p; | ||
2538 | hw->wiphy->n_iface_combinations = | ||
2539 | ARRAY_SIZE(iwlagn_iface_combinations_p2p); | ||
2540 | } else if (hw->wiphy->interface_modes & NL80211_IFTYPE_AP) { | ||
2541 | hw->wiphy->iface_combinations = iwlagn_iface_combinations_dualmode; | ||
2542 | hw->wiphy->n_iface_combinations = | ||
2543 | ARRAY_SIZE(iwlagn_iface_combinations_dualmode); | ||
2544 | } | ||
2545 | |||
2463 | hw->wiphy->max_remain_on_channel_duration = 1000; | 2546 | hw->wiphy->max_remain_on_channel_duration = 1000; |
2464 | 2547 | ||
2465 | hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY | | 2548 | hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY | |