mac80211: parse Timeout Interval Element using a struct

Instead of open-coding the accesses and length check do
the length check in the IE parser and assign a struct
pointer for use in the remaining code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg
2013-03-27 14:38:07 +01:00
parent 1946bed957
commit 79ba1d8910
4 changed files with 18 additions and 7 deletions

View File

@@ -1955,6 +1955,16 @@ enum ieee80211_timeout_interval_type {
WLAN_TIMEOUT_ASSOC_COMEBACK = 3 /* 802.11w */,
};
/**
* struct ieee80211_timeout_interval_ie - Timeout Interval element
* @type: type, see &enum ieee80211_timeout_interval_type
* @value: timeout interval value
*/
struct ieee80211_timeout_interval_ie {
u8 type;
__le32 value;
} __packed;
/* BACK action code */
enum ieee80211_back_actioncode {
WLAN_ACTION_ADDBA_REQ = 0,