Skip to content

Commit dab2ea6

Browse files
LorenzoBianconijmberg-intel
authored andcommitted
ieee80211: add TWT element definitions
Introduce TWT definitions and TWT Information element structure in ieee80211.h Tested-by: Peter Chiu <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Link: https://lore.kernel.org/r/71d8b581fe4b5abc5b92f8d77ac2de3e2f7591b6.1629741512.git.lorenzo@kernel.org Signed-off-by: Johannes Berg <[email protected]>
1 parent f6a4e0e commit dab2ea6

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

include/linux/ieee80211.h

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,48 @@ struct ieee80211_ext {
10881088
} u;
10891089
} __packed __aligned(2);
10901090

1091+
#define IEEE80211_TWT_CONTROL_NDP BIT(0)
1092+
#define IEEE80211_TWT_CONTROL_RESP_MODE BIT(1)
1093+
#define IEEE80211_TWT_CONTROL_NEG_TYPE_BROADCAST BIT(3)
1094+
#define IEEE80211_TWT_CONTROL_RX_DISABLED BIT(4)
1095+
#define IEEE80211_TWT_CONTROL_WAKE_DUR_UNIT BIT(5)
1096+
1097+
#define IEEE80211_TWT_REQTYPE_REQUEST BIT(0)
1098+
#define IEEE80211_TWT_REQTYPE_SETUP_CMD GENMASK(3, 1)
1099+
#define IEEE80211_TWT_REQTYPE_TRIGGER BIT(4)
1100+
#define IEEE80211_TWT_REQTYPE_IMPLICIT BIT(5)
1101+
#define IEEE80211_TWT_REQTYPE_FLOWTYPE BIT(6)
1102+
#define IEEE80211_TWT_REQTYPE_FLOWID GENMASK(9, 7)
1103+
#define IEEE80211_TWT_REQTYPE_WAKE_INT_EXP GENMASK(14, 10)
1104+
#define IEEE80211_TWT_REQTYPE_PROTECTION BIT(15)
1105+
1106+
enum ieee80211_twt_setup_cmd {
1107+
TWT_SETUP_CMD_REQUEST,
1108+
TWT_SETUP_CMD_SUGGEST,
1109+
TWT_SETUP_CMD_DEMAND,
1110+
TWT_SETUP_CMD_GROUPING,
1111+
TWT_SETUP_CMD_ACCEPT,
1112+
TWT_SETUP_CMD_ALTERNATE,
1113+
TWT_SETUP_CMD_DICTATE,
1114+
TWT_SETUP_CMD_REJECT,
1115+
};
1116+
1117+
struct ieee80211_twt_params {
1118+
__le16 req_type;
1119+
__le64 twt;
1120+
u8 min_twt_dur;
1121+
__le16 mantissa;
1122+
u8 channel;
1123+
} __packed;
1124+
1125+
struct ieee80211_twt_setup {
1126+
u8 dialog_token;
1127+
u8 element_id;
1128+
u8 length;
1129+
u8 control;
1130+
u8 params[];
1131+
} __packed;
1132+
10911133
struct ieee80211_mgmt {
10921134
__le16 frame_control;
10931135
__le16 duration;
@@ -1252,6 +1294,10 @@ struct ieee80211_mgmt {
12521294
__le16 toa_error;
12531295
u8 variable[0];
12541296
} __packed ftm;
1297+
struct {
1298+
u8 action_code;
1299+
u8 variable[];
1300+
} __packed s1g;
12551301
} u;
12561302
} __packed action;
12571303
} u;
@@ -2881,6 +2927,7 @@ enum ieee80211_eid {
28812927
WLAN_EID_AID_RESPONSE = 211,
28822928
WLAN_EID_S1G_BCN_COMPAT = 213,
28832929
WLAN_EID_S1G_SHORT_BCN_INTERVAL = 214,
2930+
WLAN_EID_S1G_TWT = 216,
28842931
WLAN_EID_S1G_CAPABILITIES = 217,
28852932
WLAN_EID_VENDOR_SPECIFIC = 221,
28862933
WLAN_EID_QOS_PARAMETER = 222,
@@ -2950,6 +2997,7 @@ enum ieee80211_category {
29502997
WLAN_CATEGORY_FST = 18,
29512998
WLAN_CATEGORY_UNPROT_DMG = 20,
29522999
WLAN_CATEGORY_VHT = 21,
3000+
WLAN_CATEGORY_S1G = 22,
29533001
WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
29543002
WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
29553003
};
@@ -3023,6 +3071,20 @@ enum ieee80211_key_len {
30233071
WLAN_KEY_LEN_BIP_GMAC_256 = 32,
30243072
};
30253073

3074+
enum ieee80211_s1g_actioncode {
3075+
WLAN_S1G_AID_SWITCH_REQUEST,
3076+
WLAN_S1G_AID_SWITCH_RESPONSE,
3077+
WLAN_S1G_SYNC_CONTROL,
3078+
WLAN_S1G_STA_INFO_ANNOUNCE,
3079+
WLAN_S1G_EDCA_PARAM_SET,
3080+
WLAN_S1G_EL_OPERATION,
3081+
WLAN_S1G_TWT_SETUP,
3082+
WLAN_S1G_TWT_TEARDOWN,
3083+
WLAN_S1G_SECT_GROUP_ID_LIST,
3084+
WLAN_S1G_SECT_ID_FEEDBACK,
3085+
WLAN_S1G_TWT_INFORMATION = 11,
3086+
};
3087+
30263088
#define IEEE80211_WEP_IV_LEN 4
30273089
#define IEEE80211_WEP_ICV_LEN 4
30283090
#define IEEE80211_CCMP_HDR_LEN 8

0 commit comments

Comments
 (0)