Commit dab2ea6c authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Johannes Berg

ieee80211: add TWT element definitions

Introduce TWT definitions and TWT Information element structure
in ieee80211.h
Tested-by: default avatarPeter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/71d8b581fe4b5abc5b92f8d77ac2de3e2f7591b6.1629741512.git.lorenzo@kernel.orgSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent f6a4e0e8
...@@ -1088,6 +1088,48 @@ struct ieee80211_ext { ...@@ -1088,6 +1088,48 @@ struct ieee80211_ext {
} u; } u;
} __packed __aligned(2); } __packed __aligned(2);
#define IEEE80211_TWT_CONTROL_NDP BIT(0)
#define IEEE80211_TWT_CONTROL_RESP_MODE BIT(1)
#define IEEE80211_TWT_CONTROL_NEG_TYPE_BROADCAST BIT(3)
#define IEEE80211_TWT_CONTROL_RX_DISABLED BIT(4)
#define IEEE80211_TWT_CONTROL_WAKE_DUR_UNIT BIT(5)
#define IEEE80211_TWT_REQTYPE_REQUEST BIT(0)
#define IEEE80211_TWT_REQTYPE_SETUP_CMD GENMASK(3, 1)
#define IEEE80211_TWT_REQTYPE_TRIGGER BIT(4)
#define IEEE80211_TWT_REQTYPE_IMPLICIT BIT(5)
#define IEEE80211_TWT_REQTYPE_FLOWTYPE BIT(6)
#define IEEE80211_TWT_REQTYPE_FLOWID GENMASK(9, 7)
#define IEEE80211_TWT_REQTYPE_WAKE_INT_EXP GENMASK(14, 10)
#define IEEE80211_TWT_REQTYPE_PROTECTION BIT(15)
enum ieee80211_twt_setup_cmd {
TWT_SETUP_CMD_REQUEST,
TWT_SETUP_CMD_SUGGEST,
TWT_SETUP_CMD_DEMAND,
TWT_SETUP_CMD_GROUPING,
TWT_SETUP_CMD_ACCEPT,
TWT_SETUP_CMD_ALTERNATE,
TWT_SETUP_CMD_DICTATE,
TWT_SETUP_CMD_REJECT,
};
struct ieee80211_twt_params {
__le16 req_type;
__le64 twt;
u8 min_twt_dur;
__le16 mantissa;
u8 channel;
} __packed;
struct ieee80211_twt_setup {
u8 dialog_token;
u8 element_id;
u8 length;
u8 control;
u8 params[];
} __packed;
struct ieee80211_mgmt { struct ieee80211_mgmt {
__le16 frame_control; __le16 frame_control;
__le16 duration; __le16 duration;
...@@ -1252,6 +1294,10 @@ struct ieee80211_mgmt { ...@@ -1252,6 +1294,10 @@ struct ieee80211_mgmt {
__le16 toa_error; __le16 toa_error;
u8 variable[0]; u8 variable[0];
} __packed ftm; } __packed ftm;
struct {
u8 action_code;
u8 variable[];
} __packed s1g;
} u; } u;
} __packed action; } __packed action;
} u; } u;
...@@ -2881,6 +2927,7 @@ enum ieee80211_eid { ...@@ -2881,6 +2927,7 @@ enum ieee80211_eid {
WLAN_EID_AID_RESPONSE = 211, WLAN_EID_AID_RESPONSE = 211,
WLAN_EID_S1G_BCN_COMPAT = 213, WLAN_EID_S1G_BCN_COMPAT = 213,
WLAN_EID_S1G_SHORT_BCN_INTERVAL = 214, WLAN_EID_S1G_SHORT_BCN_INTERVAL = 214,
WLAN_EID_S1G_TWT = 216,
WLAN_EID_S1G_CAPABILITIES = 217, WLAN_EID_S1G_CAPABILITIES = 217,
WLAN_EID_VENDOR_SPECIFIC = 221, WLAN_EID_VENDOR_SPECIFIC = 221,
WLAN_EID_QOS_PARAMETER = 222, WLAN_EID_QOS_PARAMETER = 222,
...@@ -2950,6 +2997,7 @@ enum ieee80211_category { ...@@ -2950,6 +2997,7 @@ enum ieee80211_category {
WLAN_CATEGORY_FST = 18, WLAN_CATEGORY_FST = 18,
WLAN_CATEGORY_UNPROT_DMG = 20, WLAN_CATEGORY_UNPROT_DMG = 20,
WLAN_CATEGORY_VHT = 21, WLAN_CATEGORY_VHT = 21,
WLAN_CATEGORY_S1G = 22,
WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
WLAN_CATEGORY_VENDOR_SPECIFIC = 127, WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
}; };
...@@ -3023,6 +3071,20 @@ enum ieee80211_key_len { ...@@ -3023,6 +3071,20 @@ enum ieee80211_key_len {
WLAN_KEY_LEN_BIP_GMAC_256 = 32, WLAN_KEY_LEN_BIP_GMAC_256 = 32,
}; };
enum ieee80211_s1g_actioncode {
WLAN_S1G_AID_SWITCH_REQUEST,
WLAN_S1G_AID_SWITCH_RESPONSE,
WLAN_S1G_SYNC_CONTROL,
WLAN_S1G_STA_INFO_ANNOUNCE,
WLAN_S1G_EDCA_PARAM_SET,
WLAN_S1G_EL_OPERATION,
WLAN_S1G_TWT_SETUP,
WLAN_S1G_TWT_TEARDOWN,
WLAN_S1G_SECT_GROUP_ID_LIST,
WLAN_S1G_SECT_ID_FEEDBACK,
WLAN_S1G_TWT_INFORMATION = 11,
};
#define IEEE80211_WEP_IV_LEN 4 #define IEEE80211_WEP_IV_LEN 4
#define IEEE80211_WEP_ICV_LEN 4 #define IEEE80211_WEP_ICV_LEN 4
#define IEEE80211_CCMP_HDR_LEN 8 #define IEEE80211_CCMP_HDR_LEN 8
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment