diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac80211.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 31 | ||||
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/main.c | 6 |
5 files changed, 36 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index beaf8140abbf..7492fc0f2766 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -1746,14 +1746,16 @@ out: | |||
1746 | return ret; | 1746 | return ret; |
1747 | } | 1747 | } |
1748 | 1748 | ||
1749 | static void iwl_mvm_mac_sched_scan_stop(struct ieee80211_hw *hw, | 1749 | static int iwl_mvm_mac_sched_scan_stop(struct ieee80211_hw *hw, |
1750 | struct ieee80211_vif *vif) | 1750 | struct ieee80211_vif *vif) |
1751 | { | 1751 | { |
1752 | struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); | 1752 | struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); |
1753 | 1753 | ||
1754 | mutex_lock(&mvm->mutex); | 1754 | mutex_lock(&mvm->mutex); |
1755 | iwl_mvm_sched_scan_stop(mvm); | 1755 | iwl_mvm_sched_scan_stop(mvm); |
1756 | mutex_unlock(&mvm->mutex); | 1756 | mutex_unlock(&mvm->mutex); |
1757 | |||
1758 | return 0; | ||
1757 | } | 1759 | } |
1758 | 1760 | ||
1759 | static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw, | 1761 | static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw, |
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index f7e3562542fe..9d7a52f5a410 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -411,6 +411,7 @@ struct mac80211_hwsim_data { | |||
411 | 411 | ||
412 | struct mac_address addresses[2]; | 412 | struct mac_address addresses[2]; |
413 | int channels, idx; | 413 | int channels, idx; |
414 | bool use_chanctx; | ||
414 | 415 | ||
415 | struct ieee80211_channel *tmp_chan; | 416 | struct ieee80211_channel *tmp_chan; |
416 | struct delayed_work roc_done; | 417 | struct delayed_work roc_done; |
@@ -1088,7 +1089,7 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw, | |||
1088 | return; | 1089 | return; |
1089 | } | 1090 | } |
1090 | 1091 | ||
1091 | if (data->channels == 1) { | 1092 | if (!data->use_chanctx) { |
1092 | channel = data->channel; | 1093 | channel = data->channel; |
1093 | } else if (txi->hw_queue == 4) { | 1094 | } else if (txi->hw_queue == 4) { |
1094 | channel = data->tmp_chan; | 1095 | channel = data->tmp_chan; |
@@ -1354,7 +1355,7 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed) | |||
1354 | 1355 | ||
1355 | data->channel = conf->chandef.chan; | 1356 | data->channel = conf->chandef.chan; |
1356 | 1357 | ||
1357 | WARN_ON(data->channel && data->channels > 1); | 1358 | WARN_ON(data->channel && data->use_chanctx); |
1358 | 1359 | ||
1359 | data->power_level = conf->power_level; | 1360 | data->power_level = conf->power_level; |
1360 | if (!data->started || !data->beacon_int) | 1361 | if (!data->started || !data->beacon_int) |
@@ -1940,7 +1941,8 @@ static struct ieee80211_ops mac80211_hwsim_mchan_ops; | |||
1940 | 1941 | ||
1941 | static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2, | 1942 | static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2, |
1942 | const struct ieee80211_regdomain *regd, | 1943 | const struct ieee80211_regdomain *regd, |
1943 | bool reg_strict, bool p2p_device) | 1944 | bool reg_strict, bool p2p_device, |
1945 | bool use_chanctx) | ||
1944 | { | 1946 | { |
1945 | int err; | 1947 | int err; |
1946 | u8 addr[ETH_ALEN]; | 1948 | u8 addr[ETH_ALEN]; |
@@ -1950,11 +1952,14 @@ static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2, | |||
1950 | const struct ieee80211_ops *ops = &mac80211_hwsim_ops; | 1952 | const struct ieee80211_ops *ops = &mac80211_hwsim_ops; |
1951 | int idx; | 1953 | int idx; |
1952 | 1954 | ||
1955 | if (WARN_ON(channels > 1 && !use_chanctx)) | ||
1956 | return -EINVAL; | ||
1957 | |||
1953 | spin_lock_bh(&hwsim_radio_lock); | 1958 | spin_lock_bh(&hwsim_radio_lock); |
1954 | idx = hwsim_radio_idx++; | 1959 | idx = hwsim_radio_idx++; |
1955 | spin_unlock_bh(&hwsim_radio_lock); | 1960 | spin_unlock_bh(&hwsim_radio_lock); |
1956 | 1961 | ||
1957 | if (channels > 1) | 1962 | if (use_chanctx) |
1958 | ops = &mac80211_hwsim_mchan_ops; | 1963 | ops = &mac80211_hwsim_mchan_ops; |
1959 | hw = ieee80211_alloc_hw(sizeof(*data), ops); | 1964 | hw = ieee80211_alloc_hw(sizeof(*data), ops); |
1960 | if (!hw) { | 1965 | if (!hw) { |
@@ -1995,20 +2000,21 @@ static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2, | |||
1995 | hw->wiphy->addresses = data->addresses; | 2000 | hw->wiphy->addresses = data->addresses; |
1996 | 2001 | ||
1997 | data->channels = channels; | 2002 | data->channels = channels; |
2003 | data->use_chanctx = use_chanctx; | ||
1998 | data->idx = idx; | 2004 | data->idx = idx; |
1999 | 2005 | ||
2000 | if (data->channels > 1) { | 2006 | if (data->use_chanctx) { |
2001 | hw->wiphy->max_scan_ssids = 255; | 2007 | hw->wiphy->max_scan_ssids = 255; |
2002 | hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; | 2008 | hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; |
2003 | hw->wiphy->max_remain_on_channel_duration = 1000; | 2009 | hw->wiphy->max_remain_on_channel_duration = 1000; |
2004 | /* For channels > 1 DFS is not allowed */ | 2010 | /* For channels > 1 DFS is not allowed */ |
2005 | hw->wiphy->n_iface_combinations = 1; | 2011 | hw->wiphy->n_iface_combinations = 1; |
2006 | hw->wiphy->iface_combinations = &data->if_combination; | 2012 | hw->wiphy->iface_combinations = &data->if_combination; |
2007 | data->if_combination.num_different_channels = data->channels; | ||
2008 | if (p2p_device) | 2013 | if (p2p_device) |
2009 | data->if_combination = hwsim_if_comb_p2p_dev[0]; | 2014 | data->if_combination = hwsim_if_comb_p2p_dev[0]; |
2010 | else | 2015 | else |
2011 | data->if_combination = hwsim_if_comb[0]; | 2016 | data->if_combination = hwsim_if_comb[0]; |
2017 | data->if_combination.num_different_channels = data->channels; | ||
2012 | } else if (p2p_device) { | 2018 | } else if (p2p_device) { |
2013 | hw->wiphy->iface_combinations = hwsim_if_comb_p2p_dev; | 2019 | hw->wiphy->iface_combinations = hwsim_if_comb_p2p_dev; |
2014 | hw->wiphy->n_iface_combinations = | 2020 | hw->wiphy->n_iface_combinations = |
@@ -2156,7 +2162,7 @@ static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2, | |||
2156 | debugfs_create_file("ps", 0666, data->debugfs, data, &hwsim_fops_ps); | 2162 | debugfs_create_file("ps", 0666, data->debugfs, data, &hwsim_fops_ps); |
2157 | debugfs_create_file("group", 0666, data->debugfs, data, | 2163 | debugfs_create_file("group", 0666, data->debugfs, data, |
2158 | &hwsim_fops_group); | 2164 | &hwsim_fops_group); |
2159 | if (data->channels == 1) | 2165 | if (!data->use_chanctx) |
2160 | debugfs_create_file("dfs_simulate_radar", 0222, | 2166 | debugfs_create_file("dfs_simulate_radar", 0222, |
2161 | data->debugfs, | 2167 | data->debugfs, |
2162 | data, &hwsim_simulate_radar); | 2168 | data, &hwsim_simulate_radar); |
@@ -2423,10 +2429,16 @@ static int hwsim_create_radio_nl(struct sk_buff *msg, struct genl_info *info) | |||
2423 | const struct ieee80211_regdomain *regd = NULL; | 2429 | const struct ieee80211_regdomain *regd = NULL; |
2424 | bool reg_strict = info->attrs[HWSIM_ATTR_REG_STRICT_REG]; | 2430 | bool reg_strict = info->attrs[HWSIM_ATTR_REG_STRICT_REG]; |
2425 | bool p2p_device = info->attrs[HWSIM_ATTR_SUPPORT_P2P_DEVICE]; | 2431 | bool p2p_device = info->attrs[HWSIM_ATTR_SUPPORT_P2P_DEVICE]; |
2432 | bool use_chanctx; | ||
2426 | 2433 | ||
2427 | if (info->attrs[HWSIM_ATTR_CHANNELS]) | 2434 | if (info->attrs[HWSIM_ATTR_CHANNELS]) |
2428 | chans = nla_get_u32(info->attrs[HWSIM_ATTR_CHANNELS]); | 2435 | chans = nla_get_u32(info->attrs[HWSIM_ATTR_CHANNELS]); |
2429 | 2436 | ||
2437 | if (info->attrs[HWSIM_ATTR_USE_CHANCTX]) | ||
2438 | use_chanctx = true; | ||
2439 | else | ||
2440 | use_chanctx = (chans > 1); | ||
2441 | |||
2430 | if (info->attrs[HWSIM_ATTR_REG_HINT_ALPHA2]) | 2442 | if (info->attrs[HWSIM_ATTR_REG_HINT_ALPHA2]) |
2431 | alpha2 = nla_data(info->attrs[HWSIM_ATTR_REG_HINT_ALPHA2]); | 2443 | alpha2 = nla_data(info->attrs[HWSIM_ATTR_REG_HINT_ALPHA2]); |
2432 | 2444 | ||
@@ -2439,7 +2451,7 @@ static int hwsim_create_radio_nl(struct sk_buff *msg, struct genl_info *info) | |||
2439 | } | 2451 | } |
2440 | 2452 | ||
2441 | return mac80211_hwsim_create_radio(chans, alpha2, regd, reg_strict, | 2453 | return mac80211_hwsim_create_radio(chans, alpha2, regd, reg_strict, |
2442 | p2p_device); | 2454 | p2p_device, use_chanctx); |
2443 | } | 2455 | } |
2444 | 2456 | ||
2445 | static int hwsim_destroy_radio_nl(struct sk_buff *msg, struct genl_info *info) | 2457 | static int hwsim_destroy_radio_nl(struct sk_buff *msg, struct genl_info *info) |
@@ -2658,7 +2670,8 @@ static int __init init_mac80211_hwsim(void) | |||
2658 | 2670 | ||
2659 | err = mac80211_hwsim_create_radio(channels, reg_alpha2, | 2671 | err = mac80211_hwsim_create_radio(channels, reg_alpha2, |
2660 | regd, reg_strict, | 2672 | regd, reg_strict, |
2661 | support_p2p_device); | 2673 | support_p2p_device, |
2674 | channels > 1); | ||
2662 | if (err < 0) | 2675 | if (err < 0) |
2663 | goto out_free_radios; | 2676 | goto out_free_radios; |
2664 | } | 2677 | } |
diff --git a/drivers/net/wireless/mac80211_hwsim.h b/drivers/net/wireless/mac80211_hwsim.h index 6e72996ec8c1..c9d0315575ba 100644 --- a/drivers/net/wireless/mac80211_hwsim.h +++ b/drivers/net/wireless/mac80211_hwsim.h | |||
@@ -108,6 +108,9 @@ enum { | |||
108 | * @HWSIM_ATTR_REG_CUSTOM_REG: custom regulatory domain index (u32 attribute) | 108 | * @HWSIM_ATTR_REG_CUSTOM_REG: custom regulatory domain index (u32 attribute) |
109 | * @HWSIM_ATTR_REG_STRICT_REG: request REGULATORY_STRICT_REG (flag attribute) | 109 | * @HWSIM_ATTR_REG_STRICT_REG: request REGULATORY_STRICT_REG (flag attribute) |
110 | * @HWSIM_ATTR_SUPPORT_P2P_DEVICE: support P2P Device virtual interface (flag) | 110 | * @HWSIM_ATTR_SUPPORT_P2P_DEVICE: support P2P Device virtual interface (flag) |
111 | * @HWSIM_ATTR_USE_CHANCTX: used with the %HWSIM_CMD_CREATE_RADIO | ||
112 | * command to force use of channel contexts even when only a | ||
113 | * single channel is supported | ||
111 | * @__HWSIM_ATTR_MAX: enum limit | 114 | * @__HWSIM_ATTR_MAX: enum limit |
112 | */ | 115 | */ |
113 | 116 | ||
@@ -128,6 +131,7 @@ enum { | |||
128 | HWSIM_ATTR_REG_CUSTOM_REG, | 131 | HWSIM_ATTR_REG_CUSTOM_REG, |
129 | HWSIM_ATTR_REG_STRICT_REG, | 132 | HWSIM_ATTR_REG_STRICT_REG, |
130 | HWSIM_ATTR_SUPPORT_P2P_DEVICE, | 133 | HWSIM_ATTR_SUPPORT_P2P_DEVICE, |
134 | HWSIM_ATTR_USE_CHANCTX, | ||
131 | __HWSIM_ATTR_MAX, | 135 | __HWSIM_ATTR_MAX, |
132 | }; | 136 | }; |
133 | #define HWSIM_ATTR_MAX (__HWSIM_ATTR_MAX - 1) | 137 | #define HWSIM_ATTR_MAX (__HWSIM_ATTR_MAX - 1) |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 436ba437a4ba..6948a97af839 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -2600,8 +2600,8 @@ static int mwifiex_cfg80211_set_coalesce(struct wiphy *wiphy, | |||
2600 | static int | 2600 | static int |
2601 | mwifiex_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, | 2601 | mwifiex_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, |
2602 | u8 *peer, u8 action_code, u8 dialog_token, | 2602 | u8 *peer, u8 action_code, u8 dialog_token, |
2603 | u16 status_code, const u8 *extra_ies, | 2603 | u16 status_code, u32 peer_capability, |
2604 | size_t extra_ies_len) | 2604 | const u8 *extra_ies, size_t extra_ies_len) |
2605 | { | 2605 | { |
2606 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); | 2606 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
2607 | int ret; | 2607 | int ret; |
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index 7aae5b3a0c2c..4175a57ac9f5 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c | |||
@@ -3668,8 +3668,8 @@ out: | |||
3668 | return ret; | 3668 | return ret; |
3669 | } | 3669 | } |
3670 | 3670 | ||
3671 | static void wl1271_op_sched_scan_stop(struct ieee80211_hw *hw, | 3671 | static int wl1271_op_sched_scan_stop(struct ieee80211_hw *hw, |
3672 | struct ieee80211_vif *vif) | 3672 | struct ieee80211_vif *vif) |
3673 | { | 3673 | { |
3674 | struct wl1271 *wl = hw->priv; | 3674 | struct wl1271 *wl = hw->priv; |
3675 | struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif); | 3675 | struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif); |
@@ -3691,6 +3691,8 @@ static void wl1271_op_sched_scan_stop(struct ieee80211_hw *hw, | |||
3691 | wl1271_ps_elp_sleep(wl); | 3691 | wl1271_ps_elp_sleep(wl); |
3692 | out: | 3692 | out: |
3693 | mutex_unlock(&wl->mutex); | 3693 | mutex_unlock(&wl->mutex); |
3694 | |||
3695 | return 0; | ||
3694 | } | 3696 | } |
3695 | 3697 | ||
3696 | static int wl1271_op_set_frag_threshold(struct ieee80211_hw *hw, u32 value) | 3698 | static int wl1271_op_set_frag_threshold(struct ieee80211_hw *hw, u32 value) |