diff options
| author | Ilan Peer <ilan.peer@intel.com> | 2016-07-05 08:23:09 -0400 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2016-07-06 08:46:30 -0400 |
| commit | f7736f501f87b3f6ffbf07d173a6893dd419ac50 (patch) | |
| tree | 26db1bc269c803c4aa9bb3ae6f8ce3b4fc29ff69 | |
| parent | c6e6a0c8be575c830a97b1942dabeab70f423fe0 (diff) | |
mac80211_hwsim: Add radar bandwidths to the P2P Device combination
Add radar_detect_widths to the interface combination that allows
concurrent P2P Device dedicated interface and AP interfaces, to enable
testing of radar detection when P2P Device interface is used.
Clear the radar_detect_widths in case of multi channel contexts
as this is not currently supported.
As radar_detect_widths are now supported in all combinations,
remove the hwsim_if_dfs_limits definition since it is no longer
needed.
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| -rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 382109bbc2c1..97196c4e2836 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
| @@ -457,10 +457,6 @@ static const struct ieee80211_iface_limit hwsim_if_limits[] = { | |||
| 457 | { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_DEVICE) } | 457 | { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_DEVICE) } |
| 458 | }; | 458 | }; |
| 459 | 459 | ||
| 460 | static const struct ieee80211_iface_limit hwsim_if_dfs_limits[] = { | ||
| 461 | { .max = 8, .types = BIT(NL80211_IFTYPE_AP) }, | ||
| 462 | }; | ||
| 463 | |||
| 464 | static const struct ieee80211_iface_combination hwsim_if_comb[] = { | 460 | static const struct ieee80211_iface_combination hwsim_if_comb[] = { |
| 465 | { | 461 | { |
| 466 | .limits = hwsim_if_limits, | 462 | .limits = hwsim_if_limits, |
| @@ -468,18 +464,12 @@ static const struct ieee80211_iface_combination hwsim_if_comb[] = { | |||
| 468 | .n_limits = ARRAY_SIZE(hwsim_if_limits) - 1, | 464 | .n_limits = ARRAY_SIZE(hwsim_if_limits) - 1, |
| 469 | .max_interfaces = 2048, | 465 | .max_interfaces = 2048, |
| 470 | .num_different_channels = 1, | 466 | .num_different_channels = 1, |
| 471 | }, | ||
| 472 | { | ||
| 473 | .limits = hwsim_if_dfs_limits, | ||
| 474 | .n_limits = ARRAY_SIZE(hwsim_if_dfs_limits), | ||
| 475 | .max_interfaces = 8, | ||
| 476 | .num_different_channels = 1, | ||
| 477 | .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | | 467 | .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | |
| 478 | BIT(NL80211_CHAN_WIDTH_20) | | 468 | BIT(NL80211_CHAN_WIDTH_20) | |
| 479 | BIT(NL80211_CHAN_WIDTH_40) | | 469 | BIT(NL80211_CHAN_WIDTH_40) | |
| 480 | BIT(NL80211_CHAN_WIDTH_80) | | 470 | BIT(NL80211_CHAN_WIDTH_80) | |
| 481 | BIT(NL80211_CHAN_WIDTH_160), | 471 | BIT(NL80211_CHAN_WIDTH_160), |
| 482 | } | 472 | }, |
| 483 | }; | 473 | }; |
| 484 | 474 | ||
| 485 | static const struct ieee80211_iface_combination hwsim_if_comb_p2p_dev[] = { | 475 | static const struct ieee80211_iface_combination hwsim_if_comb_p2p_dev[] = { |
| @@ -488,18 +478,12 @@ static const struct ieee80211_iface_combination hwsim_if_comb_p2p_dev[] = { | |||
| 488 | .n_limits = ARRAY_SIZE(hwsim_if_limits), | 478 | .n_limits = ARRAY_SIZE(hwsim_if_limits), |
| 489 | .max_interfaces = 2048, | 479 | .max_interfaces = 2048, |
| 490 | .num_different_channels = 1, | 480 | .num_different_channels = 1, |
| 491 | }, | ||
| 492 | { | ||
| 493 | .limits = hwsim_if_dfs_limits, | ||
| 494 | .n_limits = ARRAY_SIZE(hwsim_if_dfs_limits), | ||
| 495 | .max_interfaces = 8, | ||
| 496 | .num_different_channels = 1, | ||
| 497 | .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | | 481 | .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | |
| 498 | BIT(NL80211_CHAN_WIDTH_20) | | 482 | BIT(NL80211_CHAN_WIDTH_20) | |
| 499 | BIT(NL80211_CHAN_WIDTH_40) | | 483 | BIT(NL80211_CHAN_WIDTH_40) | |
| 500 | BIT(NL80211_CHAN_WIDTH_80) | | 484 | BIT(NL80211_CHAN_WIDTH_80) | |
| 501 | BIT(NL80211_CHAN_WIDTH_160), | 485 | BIT(NL80211_CHAN_WIDTH_160), |
| 502 | } | 486 | }, |
| 503 | }; | 487 | }; |
| 504 | 488 | ||
| 505 | static spinlock_t hwsim_radio_lock; | 489 | static spinlock_t hwsim_radio_lock; |
| @@ -2487,13 +2471,14 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, | |||
| 2487 | hw->wiphy->max_scan_ssids = 255; | 2471 | hw->wiphy->max_scan_ssids = 255; |
| 2488 | hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; | 2472 | hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; |
| 2489 | hw->wiphy->max_remain_on_channel_duration = 1000; | 2473 | hw->wiphy->max_remain_on_channel_duration = 1000; |
| 2490 | /* For channels > 1 DFS is not allowed */ | ||
| 2491 | hw->wiphy->n_iface_combinations = 1; | ||
| 2492 | hw->wiphy->iface_combinations = &data->if_combination; | 2474 | hw->wiphy->iface_combinations = &data->if_combination; |
| 2493 | if (param->p2p_device) | 2475 | if (param->p2p_device) |
| 2494 | data->if_combination = hwsim_if_comb_p2p_dev[0]; | 2476 | data->if_combination = hwsim_if_comb_p2p_dev[0]; |
| 2495 | else | 2477 | else |
| 2496 | data->if_combination = hwsim_if_comb[0]; | 2478 | data->if_combination = hwsim_if_comb[0]; |
| 2479 | hw->wiphy->n_iface_combinations = 1; | ||
| 2480 | /* For channels > 1 DFS is not allowed */ | ||
| 2481 | data->if_combination.radar_detect_widths = 0; | ||
| 2497 | data->if_combination.num_different_channels = data->channels; | 2482 | data->if_combination.num_different_channels = data->channels; |
| 2498 | } else if (param->p2p_device) { | 2483 | } else if (param->p2p_device) { |
| 2499 | hw->wiphy->iface_combinations = hwsim_if_comb_p2p_dev; | 2484 | hw->wiphy->iface_combinations = hwsim_if_comb_p2p_dev; |
