• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Fundamental types and constants relating to WFA MBO
3  * (Multiband Operation)
4  * Copyright (C) 1999-2019, Broadcom.
5  *
6  *      Unless you and Broadcom execute a separate written software license
7  * agreement governing use of this software, this software is licensed to you
8  * under the terms of the GNU General Public License version 2 (the "GPL"),
9  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10  * following added to such license:
11  *
12  *      As a special exception, the copyright holders of this software give you
13  * permission to link this software with independent modules, and to copy and
14  * distribute the resulting executable under terms of your choice, provided that
15  * you also meet, for each linked independent module, the terms and conditions
16  * of the license of that module.  An independent module is a module which is
17  * not derived from this software.  The special exception does not apply to any
18  * modifications of the software.
19  *
20  *      Notwithstanding the above, under no circumstances may you combine this
21  * software in any way with any other Broadcom software provided under a license
22  * other than the GPL, without Broadcom's express prior written consent.
23  *
24  *
25  * <<Broadcom-WL-IPTag/Open:>>
26  *
27  * $Id$
28  */
29 
30 #ifndef _MBO_H_
31 #define _MBO_H_
32 
33 /* This marks the start of a packed structure section. */
34 #include <packed_section_start.h>
35 
36 /* WiFi MBO OUI values */
37 #define MBO_OUI WFA_OUI /* WiFi OUI 50:6F:9A */
38 /* oui_type field identifying the type and version of the MBO IE. */
39 #define MBO_OUI_TYPE WFA_OUI_TYPE_MBO /* OUI Type/Version */
40 /* IEEE 802.11 vendor specific information element. */
41 #define MBO_IE_ID 0xdd
42 
43 /* MBO ATTR related macros */
44 #define MBO_ATTR_ID_OFF 0
45 #define MBO_ATTR_LEN_OFF 1
46 #define MBO_ATTR_DATA_OFF 2
47 
48 #define MBO_ATTR_ID_LEN 1  /* Attr ID field length */
49 #define MBO_ATTR_LEN_LEN 1 /* Attr Length field length */
50 #define MBO_ATTR_HDR_LEN 2 /* ID + 1-byte length field */
51 
52 /* MBO subelemts related */
53 #define MBO_SUBELEM_ID 0xdd
54 #define MBO_SUBELEM_OUI WFA_OUI
55 
56 #define MBO_SUBELEM_ID_LEN 1  /* SubElement ID field length */
57 #define MBO_SUBELEM_LEN_LEN 1 /* SubElement length field length */
58 #define MBO_SUBELEM_HDR_LEN 6 /* ID + length + OUI + OUY TYPE */
59 
60 #define MBO_NON_PREF_CHAN_SUBELEM_LEN_LEN(L)                                   \
61     (7 + (L)) /* value of length field */
62 #define MBO_NON_PREF_CHAN_SUBELEM_TOT_LEN(L)                                   \
63     (MBO_SUBELEM_ID_LEN + MBO_SUBELEM_LEN_LEN +                                \
64      MBO_NON_PREF_CHAN_SUBELEM_LEN_LEN(L))
65 /* MBO attributes as defined in the mbo spec */
66 enum {
67     MBO_ATTR_MBO_AP_CAPABILITY = 1,
68     MBO_ATTR_NON_PREF_CHAN_REPORT = 2,
69     MBO_ATTR_CELL_DATA_CAP = 3,
70     MBO_ATTR_ASSOC_DISALLOWED = 4,
71     MBO_ATTR_CELL_DATA_CONN_PREF = 5,
72     MBO_ATTR_TRANS_REASON_CODE = 6,
73     MBO_ATTR_TRANS_REJ_REASON_CODE = 7,
74     MBO_ATTR_ASSOC_RETRY_DELAY = 8
75 };
76 
77 typedef BWL_PRE_PACKED_STRUCT struct wifi_mbo_ie_s {
78     uint8 id;               /* IE ID: MBO_IE_ID 0xDD */
79     uint8 len;              /* IE length */
80     uint8 oui[WFA_OUI_LEN]; /* MBO_OUI 50:6F:9A */
81     uint8 oui_type;         /* MBO_OUI_TYPE 0x16 */
82     uint8 attr[1];          /* var len attributes */
83 } BWL_POST_PACKED_STRUCT wifi_mbo_ie_t;
84 
85 #define MBO_IE_HDR_SIZE (OFFSETOF(wifi_mbo_ie_t, attr))
86 /* oui:3 bytes + oui type:1 byte */
87 #define MBO_IE_NO_ATTR_LEN 4
88 
89 /* MBO AP Capability Attribute */
90 typedef BWL_PRE_PACKED_STRUCT struct wifi_mbo_ap_cap_ind_attr_s {
91     /* Attribute ID - 0x01. */
92     uint8 id;
93     /* Length of the following fields in the attribute */
94     uint8 len;
95     /* AP capability bitmap */
96     uint8 cap_ind;
97 } BWL_POST_PACKED_STRUCT wifi_mbo_ap_cap_ind_attr_t;
98 
99 /* MBO AP Capability Indication Field Values */
100 #define MBO_AP_CAP_IND_CELLULAR_AWARE 0x40
101 
102 /* Non-preferred Channel Report Attribute */
103 #define MBO_NON_PREF_CHAN_ATTR_OPCALSS_OFF 2
104 #define MBO_NON_PREF_CHAN_ATTR_CHANLIST_OFF 3
105 #define MBO_NON_PREF_CHAN_ATTR_PREF_OFF(L)                                     \
106     (MBO_NON_PREF_CHAN_ATTR_CHANLIST_OFF + (L))
107 
108 #define MBO_NON_PREF_CHAN_ATTR_OPCALSS_LEN 1
109 #define MBO_NON_PREF_CHAN_ATTR_PREF_LEN 1
110 #define MBO_NON_PREF_CHAN_ATTR_REASON_LEN 1
111 
112 #define MBO_NON_PREF_CHAN_ATTR_LEN(L) ((L) + 3)
113 #define MBO_NON_PREF_CHAN_ATTR_TOT_LEN(L) (MBO_ATTR_HDR_LEN + (L) + 3)
114 
115 /* attribute len - (opclass + Pref + Reason) */
116 #define MBO_NON_PREF_CHAN_ATTR_CHANLIST_LEN(L) ((L)-3)
117 
118 /* MBO Non-preferred Channel Report: "Preference" field value */
119 enum {
120     MBO_STA_NON_OPERABLE_BAND_CHAN = 0,
121     MBO_STA_NON_PREFERRED_BAND_CHAN = 1,
122     MBO_STA_PREFERRED_BAND_CHAN = 255
123 };
124 
125 /* MBO Non-preferred Channel Report: "Reason Code" field value */
126 enum {
127     MBO_NON_PREF_CHAN_RC_UNSPECIFIED = 0,
128     MBO_NON_PREF_CHAN_RC_BCN_STRENGTH = 1,
129     MBO_NON_PREF_CHAN_RC_CO_LOC_INTERFERENCE = 2,
130     MBO_NON_PREF_CHAN_RC_IN_DEV_INTERFERENCE = 3
131 };
132 
133 /* Cellular Data Capability Attribute */
134 typedef BWL_PRE_PACKED_STRUCT struct wifi_mbo_cell_data_cap_attr_s {
135     /* Attribute ID - 0x03. */
136     uint8 id;
137     /* Length of the following fields in the attribute */
138     uint8 len;
139     /* MBO STA's cellular capability */
140     uint8 cell_conn;
141 } BWL_POST_PACKED_STRUCT wifi_mbo_cell_data_cap_attr_t;
142 
143 /* MBO Cellular Data Capability:  "Cellular Connectivity" field value */
144 enum {
145     MBO_CELL_DATA_CONN_AVAILABLE = 1,
146     MBO_CELL_DATA_CONN_NOT_AVAILABLE = 2,
147     MBO_CELL_DATA_CONN_NOT_CAPABLE = 3
148 };
149 
150 /* Association Disallowed attribute */
151 typedef BWL_PRE_PACKED_STRUCT struct wifi_mbo_assoc_disallowed_attr_s {
152     /* Attribute ID - 0x04. */
153     uint8 id;
154     /* Length of the following fields in the attribute */
155     uint8 len;
156     /* Reason of not accepting new association */
157     uint8 reason_code;
158 } BWL_POST_PACKED_STRUCT wifi_mbo_assoc_disallowed_attr_t;
159 
160 /* Association Disallowed attr Reason code field values */
161 enum {
162     MBO_ASSOC_DISALLOWED_RC_UNSPECIFIED = 1,
163     MBO_ASSOC_DISALLOWED_RC_MAX_STA_REACHED = 2,
164     MBO_ASSOC_DISALLOWED_RC_AIR_IFACE_OVERLOADED = 3,
165     MBO_ASSOC_DISALLOWED_RC_AUTH_SRVR_OVERLOADED = 4,
166     MBO_ASSOC_DISALLOWED_RC_INSUFFIC_RSSI = 5
167 };
168 
169 /* Cellular Data Conn Pref attribute */
170 typedef BWL_PRE_PACKED_STRUCT struct wifi_mbo_cell_data_conn_pref_attr_s {
171     /* Attribute ID - 0x05. */
172     uint8 id;
173     /* Length of the following fields in the attribute */
174     uint8 len;
175     /* Preference value of cellular connection */
176     uint8 cell_pref;
177 } BWL_POST_PACKED_STRUCT wifi_mbo_cell_data_conn_pref_attr_t;
178 
179 /* Cellular Data Conn Pref attr: Cellular Pref field values */
180 enum {
181     MBO_CELLULAR_DATA_CONN_EXCLUDED = 1,
182     MBO_CELLULAR_DATA_CONN_NOT_PREFERRED = 2,
183     MBO_CELLULAR_DATA_CONN_PREFERRED = 255
184 };
185 
186 /* Transition Reason Code Attribute */
187 typedef BWL_PRE_PACKED_STRUCT struct wifi_mbo_trans_reason_code_attr_s {
188     /* Attribute ID - 0x06. */
189     uint8 id;
190     /* Length of the following fields in the attribute */
191     uint8 len;
192     /* Reason of transition recommendation */
193     uint8 trans_reason_code;
194 } BWL_POST_PACKED_STRUCT wifi_mbo_trans_reason_code_attr_t;
195 
196 /* Transition Reason Code Attr: trans reason code field values */
197 enum {
198     MBO_TRANS_REASON_UNSPECIFIED = 0,
199     MBO_TRANS_REASON_EXCESSV_FRM_LOSS_RATE = 1,
200     MBO_TRANS_REASON_EXCESSV_TRAFFIC_DELAY = 2,
201     MBO_TRANS_REASON_INSUFF_BW = 3,
202     MBO_TRANS_REASON_LOAD_BALANCING = 4,
203     MBO_TRANS_REASON_LOW_RSSI = 5,
204     MBO_TRANS_REASON_EXCESSV_RETRANS_RCVD = 6,
205     MBO_TRANS_REASON_HIGH_INTERFERENCE = 7,
206     MBO_TRANS_REASON_GRAY_ZONE = 8,
207     MBO_TRANS_REASON_PREMIUM_AP_TRANS = 9
208 };
209 
210 /* Transition Rejection Reason Code Attribute */
211 typedef BWL_PRE_PACKED_STRUCT struct wifi_mbo_trans_rej_reason_code_attr_s {
212     /* Attribute ID - 0x07. */
213     uint8 id;
214     /* Length of the following fields in the attribute */
215     uint8 len;
216     /* Reason of transition rejection */
217     uint8 trans_rej_reason_code;
218 } BWL_POST_PACKED_STRUCT wifi_mbo_trans_rej_reason_code_attr_t;
219 
220 /* Transition Rej Reason Code Attr: trans rej reason code field values */
221 enum {
222     MBO_TRANS_REJ_REASON_UNSPECIFIED = 0,
223     MBO_TRANS_REJ_REASON_EXSSIV_FRM_LOSS_RATE = 1,
224     MBO_TRANS_REJ_REASON_EXSSIV_TRAFFIC_DELAY = 2,
225     MBO_TRANS_REJ_REASON_INSUFF_QOS_CAPACITY = 3,
226     MBO_TRANS_REJ_REASON_LOW_RSSI = 4,
227     MBO_TRANS_REJ_REASON_HIGH_INTERFERENCE = 5,
228     MBO_TRANS_REJ_REASON_SERVICE_UNAVAIL = 6
229 };
230 
231 /* Assoc Retry Delay Attribute */
232 typedef BWL_PRE_PACKED_STRUCT struct wifi_mbo_assoc_retry_delay_attr_s {
233     /* Attribute ID - 0x08. */
234     uint8 id;
235     /* Length of the following fields in the attribute */
236     uint8 len;
237     /* No of Seconds before next assoc attempt */
238     uint16 reassoc_delay;
239 } BWL_POST_PACKED_STRUCT wifi_mbo_assoc_retry_delay_attr_t;
240 
241 #define MBO_ANQP_OUI_TYPE 0x12 /* OUTI Type/Version */
242 
243 /* MBO ANQP Element */
244 typedef BWL_PRE_PACKED_STRUCT struct wifi_mbo_anqp_elem_s {
245     /* ID - 56797 */
246     uint16 info_id;
247     /* Length of the OUI + Vendor Specific content */
248     uint16 len;
249     /* WFA_OUI 50:6F:9A */
250     uint8 oui[WFA_OUI_LEN];
251     /* MBO_ANQP_OUI_TYPE 0x12 */
252     uint8 oui_type;
253     /* MBO ANQP element type */
254     uint8 sub_type;
255     /* variable len payload */
256     uint8 payload[1];
257 } BWL_POST_PACKED_STRUCT wifi_mbo_anqp_elem_t;
258 
259 #define MBO_ANQP_ELEM_HDR_SIZE (OFFSETOF(wifi_mbo_anqp_elem_t, payload))
260 
261 /* oui:3 bytes + oui type:1 byte + sub type:1 byte */
262 #define MBO_ANQP_ELEM_NO_PAYLOAD_LEN 5
263 
264 /* MBO ANQP Subtype Values */
265 enum {
266     MBO_ANQP_ELEM_MBO_QUERY_LIST = 1,
267     MBO_ANQP_ELEM_CELL_DATA_CONN_PREF = 2
268 };
269 
270 /* MBO sub-elements */
271 typedef BWL_PRE_PACKED_STRUCT struct wifi_mbo_cell_cap_subelem_s {
272     /* 0xDD */
273     uint8 sub_elem_id;
274     /* Length of the following fields in sub-element */
275     uint8 len;
276     /* WFA_OUI 50:6F:9A */
277     uint8 oui[WFA_OUI_LEN];
278     /* OUI_TYPE 0x03 */
279     uint8 oui_type;
280     /* STA cellular capability */
281     uint8 cell_conn;
282 } BWL_POST_PACKED_STRUCT wifi_mbo_cell_cap_subelem_t;
283 
284 /* This marks the end of a packed structure section. */
285 #include <packed_section_end.h>
286 
287 #endif /* __MBO_H__ */
288