1e5b75505Sopenharmony_ci/*
2e5b75505Sopenharmony_ci * FST module - FST related definitions
3e5b75505Sopenharmony_ci * Copyright (c) 2014, Qualcomm Atheros, Inc.
4e5b75505Sopenharmony_ci *
5e5b75505Sopenharmony_ci * This software may be distributed under the terms of the BSD license.
6e5b75505Sopenharmony_ci * See README for more details.
7e5b75505Sopenharmony_ci */
8e5b75505Sopenharmony_ci
9e5b75505Sopenharmony_ci#ifndef IEEE_80211_FST_DEFS_H
10e5b75505Sopenharmony_ci#define IEEE_80211_FST_DEFS_H
11e5b75505Sopenharmony_ci
12e5b75505Sopenharmony_ci/* IEEE Std 802.11ad */
13e5b75505Sopenharmony_ci
14e5b75505Sopenharmony_ci#define MB_STA_CHANNEL_ALL 0
15e5b75505Sopenharmony_ci
16e5b75505Sopenharmony_cienum session_type {
17e5b75505Sopenharmony_ci	SESSION_TYPE_BSS = 0, /*  Infrastructure BSS */
18e5b75505Sopenharmony_ci	SESSION_TYPE_IBSS = 1,
19e5b75505Sopenharmony_ci	SESSION_TYPE_DLS = 2,
20e5b75505Sopenharmony_ci	SESSION_TYPE_TDLS = 3,
21e5b75505Sopenharmony_ci	SESSION_TYPE_PBSS = 4
22e5b75505Sopenharmony_ci};
23e5b75505Sopenharmony_ci
24e5b75505Sopenharmony_ci#define SESSION_CONTROL(session_type, switch_intent) \
25e5b75505Sopenharmony_ci	(((u8) ((session_type) & 0x7)) | ((switch_intent) ? 0x10 : 0x00))
26e5b75505Sopenharmony_ci
27e5b75505Sopenharmony_ci#define GET_SESSION_CONTROL_TYPE(session_control) \
28e5b75505Sopenharmony_ci	((u8) ((session_control) & 0x7))
29e5b75505Sopenharmony_ci
30e5b75505Sopenharmony_ci#define GET_SESSION_CONTROL_SWITCH_INTENT(session_control) \
31e5b75505Sopenharmony_ci	(((session_control) & 0x10) >> 4)
32e5b75505Sopenharmony_ci
33e5b75505Sopenharmony_ci/* 8.4.2.147  Session Transition element */
34e5b75505Sopenharmony_cistruct session_transition_ie {
35e5b75505Sopenharmony_ci	u8 element_id;
36e5b75505Sopenharmony_ci	u8 length;
37e5b75505Sopenharmony_ci	le32 fsts_id;
38e5b75505Sopenharmony_ci	u8 session_control;
39e5b75505Sopenharmony_ci	u8 new_band_id;
40e5b75505Sopenharmony_ci	u8 new_band_setup;
41e5b75505Sopenharmony_ci	u8 new_band_op;
42e5b75505Sopenharmony_ci	u8 old_band_id;
43e5b75505Sopenharmony_ci	u8 old_band_setup;
44e5b75505Sopenharmony_ci	u8 old_band_op;
45e5b75505Sopenharmony_ci} STRUCT_PACKED;
46e5b75505Sopenharmony_ci
47e5b75505Sopenharmony_cistruct fst_setup_req {
48e5b75505Sopenharmony_ci	u8 action;
49e5b75505Sopenharmony_ci	u8 dialog_token;
50e5b75505Sopenharmony_ci	le32 llt;
51e5b75505Sopenharmony_ci	struct session_transition_ie stie;
52e5b75505Sopenharmony_ci	/* Multi-band (optional) */
53e5b75505Sopenharmony_ci	/* Wakeup Schedule (optional) */
54e5b75505Sopenharmony_ci	/* Awake Window (optional) */
55e5b75505Sopenharmony_ci	/* Switching Stream (optional) */
56e5b75505Sopenharmony_ci} STRUCT_PACKED;
57e5b75505Sopenharmony_ci
58e5b75505Sopenharmony_cistruct fst_setup_res {
59e5b75505Sopenharmony_ci	u8 action;
60e5b75505Sopenharmony_ci	u8 dialog_token;
61e5b75505Sopenharmony_ci	u8 status_code;
62e5b75505Sopenharmony_ci	struct session_transition_ie stie;
63e5b75505Sopenharmony_ci	/* Multi-band (optional) */
64e5b75505Sopenharmony_ci	/* Wakeup Schedule (optional) */
65e5b75505Sopenharmony_ci	/* Awake Window (optional) */
66e5b75505Sopenharmony_ci	/* Switching Stream (optional) */
67e5b75505Sopenharmony_ci	/* Timeout Interval (optional) */
68e5b75505Sopenharmony_ci} STRUCT_PACKED;
69e5b75505Sopenharmony_ci
70e5b75505Sopenharmony_cistruct fst_ack_req {
71e5b75505Sopenharmony_ci	u8 action;
72e5b75505Sopenharmony_ci	u8 dialog_token;
73e5b75505Sopenharmony_ci	le32 fsts_id;
74e5b75505Sopenharmony_ci} STRUCT_PACKED;
75e5b75505Sopenharmony_ci
76e5b75505Sopenharmony_cistruct fst_ack_res {
77e5b75505Sopenharmony_ci	u8 action;
78e5b75505Sopenharmony_ci	u8 dialog_token;
79e5b75505Sopenharmony_ci	le32 fsts_id;
80e5b75505Sopenharmony_ci} STRUCT_PACKED;
81e5b75505Sopenharmony_ci
82e5b75505Sopenharmony_cistruct fst_tear_down {
83e5b75505Sopenharmony_ci	u8 action;
84e5b75505Sopenharmony_ci	le32 fsts_id;
85e5b75505Sopenharmony_ci} STRUCT_PACKED;
86e5b75505Sopenharmony_ci
87e5b75505Sopenharmony_ci#endif /* IEEE_80211_FST_DEFS_H */
88