diff options
author | Arik Nemtsov <arik@wizery.com> | 2014-11-09 11:50:18 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-11-19 12:45:16 -0500 |
commit | 53837584438f8899e061ada4663ae1d09b49b96a (patch) | |
tree | c8792fcd2efa35f8e9e7bc7db0913990f5a50f02 /net/mac80211 | |
parent | 1057d35ede5dbf7ed7842357564fb42c9b54ba50 (diff) |
mac80211: add parsing of TDLS specific IEs
These are used in TDLS channel switching code.
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 2 | ||||
-rw-r--r-- | net/mac80211/util.c | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 4b3a7e7ec2a0..e786ab6bc72c 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -1400,6 +1400,8 @@ struct ieee802_11_elems { | |||
1400 | size_t total_len; | 1400 | size_t total_len; |
1401 | 1401 | ||
1402 | /* pointers to IEs */ | 1402 | /* pointers to IEs */ |
1403 | const struct ieee80211_tdls_lnkie *lnk_id; | ||
1404 | const struct ieee80211_ch_switch_timing *ch_sw_timing; | ||
1403 | const u8 *ext_capab; | 1405 | const u8 *ext_capab; |
1404 | const u8 *ssid; | 1406 | const u8 *ssid; |
1405 | const u8 *supp_rates; | 1407 | const u8 *supp_rates; |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 3ca0c2e725ff..9e5bfd614856 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -832,6 +832,8 @@ u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action, | |||
832 | case WLAN_EID_WIDE_BW_CHANNEL_SWITCH: | 832 | case WLAN_EID_WIDE_BW_CHANNEL_SWITCH: |
833 | case WLAN_EID_CHAN_SWITCH_PARAM: | 833 | case WLAN_EID_CHAN_SWITCH_PARAM: |
834 | case WLAN_EID_EXT_CAPABILITY: | 834 | case WLAN_EID_EXT_CAPABILITY: |
835 | case WLAN_EID_CHAN_SWITCH_TIMING: | ||
836 | case WLAN_EID_LINK_ID: | ||
835 | /* | 837 | /* |
836 | * not listing WLAN_EID_CHANNEL_SWITCH_WRAPPER -- it seems possible | 838 | * not listing WLAN_EID_CHANNEL_SWITCH_WRAPPER -- it seems possible |
837 | * that if the content gets bigger it might be needed more than once | 839 | * that if the content gets bigger it might be needed more than once |
@@ -851,6 +853,20 @@ u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action, | |||
851 | elem_parse_failed = false; | 853 | elem_parse_failed = false; |
852 | 854 | ||
853 | switch (id) { | 855 | switch (id) { |
856 | case WLAN_EID_LINK_ID: | ||
857 | if (elen + 2 != sizeof(struct ieee80211_tdls_lnkie)) { | ||
858 | elem_parse_failed = true; | ||
859 | break; | ||
860 | } | ||
861 | elems->lnk_id = (void *)(pos - 2); | ||
862 | break; | ||
863 | case WLAN_EID_CHAN_SWITCH_TIMING: | ||
864 | if (elen != sizeof(struct ieee80211_ch_switch_timing)) { | ||
865 | elem_parse_failed = true; | ||
866 | break; | ||
867 | } | ||
868 | elems->ch_sw_timing = (void *)pos; | ||
869 | break; | ||
854 | case WLAN_EID_EXT_CAPABILITY: | 870 | case WLAN_EID_EXT_CAPABILITY: |
855 | elems->ext_capab = pos; | 871 | elems->ext_capab = pos; |
856 | elems->ext_capab_len = elen; | 872 | elems->ext_capab_len = elen; |