aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/Makefile1
-rw-r--r--net/mac80211/ieee80211_i.h7
-rw-r--r--net/mac80211/mlme.c5
-rw-r--r--net/mac80211/util.c12
-rw-r--r--net/mac80211/vht.c35
5 files changed, 60 insertions, 0 deletions
diff --git a/net/mac80211/Makefile b/net/mac80211/Makefile
index a7dd110faafa..4911202334d9 100644
--- a/net/mac80211/Makefile
+++ b/net/mac80211/Makefile
@@ -8,6 +8,7 @@ mac80211-y := \
8 wpa.o \ 8 wpa.o \
9 scan.o offchannel.o \ 9 scan.o offchannel.o \
10 ht.o agg-tx.o agg-rx.o \ 10 ht.o agg-tx.o agg-rx.o \
11 vht.o \
11 ibss.o \ 12 ibss.o \
12 iface.o \ 13 iface.o \
13 rate.o \ 14 rate.o \
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index b7382454d0a6..6327816790e6 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1188,6 +1188,8 @@ struct ieee802_11_elems {
1188 u8 *wmm_param; 1188 u8 *wmm_param;
1189 struct ieee80211_ht_cap *ht_cap_elem; 1189 struct ieee80211_ht_cap *ht_cap_elem;
1190 struct ieee80211_ht_operation *ht_operation; 1190 struct ieee80211_ht_operation *ht_operation;
1191 struct ieee80211_vht_cap *vht_cap_elem;
1192 struct ieee80211_vht_operation *vht_operation;
1191 struct ieee80211_meshconf_ie *mesh_config; 1193 struct ieee80211_meshconf_ie *mesh_config;
1192 u8 *mesh_id; 1194 u8 *mesh_id;
1193 u8 *peering; 1195 u8 *peering;
@@ -1416,6 +1418,11 @@ void ieee80211_release_reorder_timeout(struct sta_info *sta, int tid);
1416 1418
1417u8 ieee80211_mcs_to_chains(const struct ieee80211_mcs_info *mcs); 1419u8 ieee80211_mcs_to_chains(const struct ieee80211_mcs_info *mcs);
1418 1420
1421/* VHT */
1422void ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
1423 struct ieee80211_supported_band *sband,
1424 struct ieee80211_vht_cap *vht_cap_ie,
1425 struct ieee80211_sta_vht_cap *vht_cap);
1419/* Spectrum management */ 1426/* Spectrum management */
1420void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, 1427void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
1421 struct ieee80211_mgmt *mgmt, 1428 struct ieee80211_mgmt *mgmt,
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 4af5a3eb892e..ab39c4f44e5c 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2156,6 +2156,11 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
2156 sta->supports_40mhz = 2156 sta->supports_40mhz =
2157 sta->sta.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40; 2157 sta->sta.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40;
2158 2158
2159 if (elems.vht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
2160 ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband,
2161 elems.vht_cap_elem,
2162 &sta->sta.vht_cap);
2163
2159 rate_control_rate_init(sta); 2164 rate_control_rate_init(sta);
2160 2165
2161 if (ifmgd->flags & IEEE80211_STA_MFP_ENABLED) 2166 if (ifmgd->flags & IEEE80211_STA_MFP_ENABLED)
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 3dca9827624a..51a4a2516233 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -741,6 +741,18 @@ u32 ieee802_11_parse_elems_crc(u8 *start, size_t len,
741 else 741 else
742 elem_parse_failed = true; 742 elem_parse_failed = true;
743 break; 743 break;
744 case WLAN_EID_VHT_CAPABILITY:
745 if (elen >= sizeof(struct ieee80211_vht_cap))
746 elems->vht_cap_elem = (void *)pos;
747 else
748 elem_parse_failed = true;
749 break;
750 case WLAN_EID_VHT_OPERATION:
751 if (elen >= sizeof(struct ieee80211_vht_operation))
752 elems->vht_operation = (void *)pos;
753 else
754 elem_parse_failed = true;
755 break;
744 case WLAN_EID_MESH_ID: 756 case WLAN_EID_MESH_ID:
745 elems->mesh_id = pos; 757 elems->mesh_id = pos;
746 elems->mesh_id_len = elen; 758 elems->mesh_id_len = elen;
diff --git a/net/mac80211/vht.c b/net/mac80211/vht.c
new file mode 100644
index 000000000000..f311388aeedf
--- /dev/null
+++ b/net/mac80211/vht.c
@@ -0,0 +1,35 @@
1/*
2 * VHT handling
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/ieee80211.h>
10#include <linux/export.h>
11#include <net/mac80211.h>
12#include "ieee80211_i.h"
13
14
15void ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
16 struct ieee80211_supported_band *sband,
17 struct ieee80211_vht_cap *vht_cap_ie,
18 struct ieee80211_sta_vht_cap *vht_cap)
19{
20 if (WARN_ON_ONCE(!vht_cap))
21 return;
22
23 memset(vht_cap, 0, sizeof(*vht_cap));
24
25 if (!vht_cap_ie || !sband->vht_cap.vht_supported)
26 return;
27
28 vht_cap->vht_supported = true;
29
30 vht_cap->cap = le32_to_cpu(vht_cap_ie->vht_cap_info);
31
32 /* Copy peer MCS info, the driver might need them. */
33 memcpy(&vht_cap->vht_mcs, &vht_cap_ie->supp_mcs,
34 sizeof(struct ieee80211_vht_mcs_info));
35}