aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 91f56a48e2b4..16423f94801b 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -26,6 +26,8 @@ static bool nl80211_type_check(enum nl80211_iftype type)
26#ifdef CONFIG_MAC80211_MESH 26#ifdef CONFIG_MAC80211_MESH
27 case NL80211_IFTYPE_MESH_POINT: 27 case NL80211_IFTYPE_MESH_POINT:
28#endif 28#endif
29 case NL80211_IFTYPE_AP:
30 case NL80211_IFTYPE_AP_VLAN:
29 case NL80211_IFTYPE_WDS: 31 case NL80211_IFTYPE_WDS:
30 return true; 32 return true;
31 default: 33 default:
@@ -1046,11 +1048,53 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
1046 changed |= BSS_CHANGED_ERP_SLOT; 1048 changed |= BSS_CHANGED_ERP_SLOT;
1047 } 1049 }
1048 1050
1051 if (params->basic_rates) {
1052 int i, j;
1053 u32 rates = 0;
1054 struct ieee80211_local *local = wiphy_priv(wiphy);
1055 struct ieee80211_supported_band *sband =
1056 wiphy->bands[local->oper_channel->band];
1057
1058 for (i = 0; i < params->basic_rates_len; i++) {
1059 int rate = (params->basic_rates[i] & 0x7f) * 5;
1060 for (j = 0; j < sband->n_bitrates; j++) {
1061 if (sband->bitrates[j].bitrate == rate)
1062 rates |= BIT(j);
1063 }
1064 }
1065 sdata->vif.bss_conf.basic_rates = rates;
1066 changed |= BSS_CHANGED_BASIC_RATES;
1067 }
1068
1049 ieee80211_bss_info_change_notify(sdata, changed); 1069 ieee80211_bss_info_change_notify(sdata, changed);
1050 1070
1051 return 0; 1071 return 0;
1052} 1072}
1053 1073
1074static int ieee80211_set_txq_params(struct wiphy *wiphy,
1075 struct ieee80211_txq_params *params)
1076{
1077 struct ieee80211_local *local = wiphy_priv(wiphy);
1078 struct ieee80211_tx_queue_params p;
1079
1080 if (!local->ops->conf_tx)
1081 return -EOPNOTSUPP;
1082
1083 memset(&p, 0, sizeof(p));
1084 p.aifs = params->aifs;
1085 p.cw_max = params->cwmax;
1086 p.cw_min = params->cwmin;
1087 p.txop = params->txop;
1088 if (local->ops->conf_tx(local_to_hw(local), params->queue, &p)) {
1089 printk(KERN_DEBUG "%s: failed to set TX queue "
1090 "parameters for queue %d\n", local->mdev->name,
1091 params->queue);
1092 return -EINVAL;
1093 }
1094
1095 return 0;
1096}
1097
1054struct cfg80211_ops mac80211_config_ops = { 1098struct cfg80211_ops mac80211_config_ops = {
1055 .add_virtual_intf = ieee80211_add_iface, 1099 .add_virtual_intf = ieee80211_add_iface,
1056 .del_virtual_intf = ieee80211_del_iface, 1100 .del_virtual_intf = ieee80211_del_iface,
@@ -1077,4 +1121,5 @@ struct cfg80211_ops mac80211_config_ops = {
1077 .get_mesh_params = ieee80211_get_mesh_params, 1121 .get_mesh_params = ieee80211_get_mesh_params,
1078#endif 1122#endif
1079 .change_bss = ieee80211_change_bss, 1123 .change_bss = ieee80211_change_bss,
1124 .set_txq_params = ieee80211_set_txq_params,
1080}; 1125};