aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMahesh Palivela <maheshp@posedge.com>2012-10-11 04:04:52 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-10-17 05:02:15 -0400
commitf461be3eff662f01a177ecea8c1d7b040bb6bfbe (patch)
tree7c83ffadf4f1cfe25e69bfdf129643dc1c4e326f
parent818255ea47709065c53c86ca47fce96d8580bee1 (diff)
{nl,cfg}80211: Peer STA VHT caps
To save STAs VHT caps in AP mode Signed-off-by: Mahesh Palivela <maheshp@posedge.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--include/net/cfg80211.h2
-rw-r--r--include/uapi/linux/nl80211.h6
-rw-r--r--net/mac80211/cfg.c5
-rw-r--r--net/wireless/nl80211.c5
4 files changed, 18 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 60cebfac3e3c..607b5c02f740 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -498,6 +498,7 @@ enum station_parameters_apply_mask {
498 * @plink_action: plink action to take 498 * @plink_action: plink action to take
499 * @plink_state: set the peer link state for a station 499 * @plink_state: set the peer link state for a station
500 * @ht_capa: HT capabilities of station 500 * @ht_capa: HT capabilities of station
501 * @vht_capa: VHT capabilities of station
501 * @uapsd_queues: bitmap of queues configured for uapsd. same format 502 * @uapsd_queues: bitmap of queues configured for uapsd. same format
502 * as the AC bitmap in the QoS info field 503 * as the AC bitmap in the QoS info field
503 * @max_sp: max Service Period. same format as the MAX_SP in the 504 * @max_sp: max Service Period. same format as the MAX_SP in the
@@ -517,6 +518,7 @@ struct station_parameters {
517 u8 plink_action; 518 u8 plink_action;
518 u8 plink_state; 519 u8 plink_state;
519 struct ieee80211_ht_cap *ht_capa; 520 struct ieee80211_ht_cap *ht_capa;
521 struct ieee80211_vht_cap *vht_capa;
520 u8 uapsd_queues; 522 u8 uapsd_queues;
521 u8 max_sp; 523 u8 max_sp;
522}; 524};
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 179a0c2e2f61..71ab23b0356d 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1276,6 +1276,9 @@ enum nl80211_commands {
1276 * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts 1276 * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts
1277 * with the Authentication transaction sequence number field. 1277 * with the Authentication transaction sequence number field.
1278 * 1278 *
1279 * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from
1280 * association request when used with NL80211_CMD_NEW_STATION)
1281 *
1279 * @NL80211_ATTR_MAX: highest attribute number currently defined 1282 * @NL80211_ATTR_MAX: highest attribute number currently defined
1280 * @__NL80211_ATTR_AFTER_LAST: internal use 1283 * @__NL80211_ATTR_AFTER_LAST: internal use
1281 */ 1284 */
@@ -1535,6 +1538,8 @@ enum nl80211_attrs {
1535 1538
1536 NL80211_ATTR_SAE_DATA, 1539 NL80211_ATTR_SAE_DATA,
1537 1540
1541 NL80211_ATTR_VHT_CAPABILITY,
1542
1538 /* add attributes here, update the policy in nl80211.c */ 1543 /* add attributes here, update the policy in nl80211.c */
1539 1544
1540 __NL80211_ATTR_AFTER_LAST, 1545 __NL80211_ATTR_AFTER_LAST,
@@ -1578,6 +1583,7 @@ enum nl80211_attrs {
1578#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 1583#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
1579#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 1584#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
1580#define NL80211_HT_CAPABILITY_LEN 26 1585#define NL80211_HT_CAPABILITY_LEN 26
1586#define NL80211_VHT_CAPABILITY_LEN 12
1581 1587
1582#define NL80211_MAX_NR_CIPHER_SUITES 5 1588#define NL80211_MAX_NR_CIPHER_SUITES 5
1583#define NL80211_MAX_NR_AKM_SUITES 2 1589#define NL80211_MAX_NR_AKM_SUITES 2
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 03216b0408c7..ed27988f9d35 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1157,6 +1157,11 @@ static int sta_apply_parameters(struct ieee80211_local *local,
1157 params->ht_capa, 1157 params->ht_capa,
1158 &sta->sta.ht_cap); 1158 &sta->sta.ht_cap);
1159 1159
1160 if (params->vht_capa)
1161 ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband,
1162 params->vht_capa,
1163 &sta->sta.vht_cap);
1164
1160 if (ieee80211_vif_is_mesh(&sdata->vif)) { 1165 if (ieee80211_vif_is_mesh(&sdata->vif)) {
1161#ifdef CONFIG_MAC80211_MESH 1166#ifdef CONFIG_MAC80211_MESH
1162 if (sdata->u.mesh.security & IEEE80211_MESH_SEC_SECURED) 1167 if (sdata->u.mesh.security & IEEE80211_MESH_SEC_SECURED)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 74d8123ada77..ef170e982f91 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -355,6 +355,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
355 [NL80211_ATTR_WDEV] = { .type = NLA_U64 }, 355 [NL80211_ATTR_WDEV] = { .type = NLA_U64 },
356 [NL80211_ATTR_USER_REG_HINT_TYPE] = { .type = NLA_U32 }, 356 [NL80211_ATTR_USER_REG_HINT_TYPE] = { .type = NLA_U32 },
357 [NL80211_ATTR_SAE_DATA] = { .type = NLA_BINARY, }, 357 [NL80211_ATTR_SAE_DATA] = { .type = NLA_BINARY, },
358 [NL80211_ATTR_VHT_CAPABILITY] = { .len = NL80211_VHT_CAPABILITY_LEN },
358}; 359};
359 360
360/* policy for the key attributes */ 361/* policy for the key attributes */
@@ -3223,6 +3224,10 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
3223 params.ht_capa = 3224 params.ht_capa =
3224 nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]); 3225 nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]);
3225 3226
3227 if (info->attrs[NL80211_ATTR_VHT_CAPABILITY])
3228 params.vht_capa =
3229 nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY]);
3230
3226 if (info->attrs[NL80211_ATTR_STA_PLINK_ACTION]) 3231 if (info->attrs[NL80211_ATTR_STA_PLINK_ACTION])
3227 params.plink_action = 3232 params.plink_action =
3228 nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_ACTION]); 3233 nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_ACTION]);