mac80211: parse Timeout Interval Element using a struct
authorJohannes Berg <johannes.berg@intel.com>
Wed, 27 Mar 2013 13:38:07 +0000 (14:38 +0100)
committerChristian Lamparter <chunkeey@googlemail.com>
Mon, 15 Apr 2013 22:03:33 +0000 (00:03 +0200)
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>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
include/linux/ieee80211.h

index ea446085e17abeb175eaa2479eedd55d885bebb0..805364f81634321202c7e55ce6dd84f96c359360 100644 (file)
@@ -1939,6 +1939,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,