1 /*
2  * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef _ESP_MBO_H
8 #define _ESP_MBO_H
9 
10 #include <stdbool.h>
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 /**
16   * enum non_pref_chan_reason: Reason for non preference of channel
17   */
18 enum non_pref_chan_reason {
19 	NON_PREF_CHAN_REASON_UNSPECIFIED = 0,
20 	NON_PREF_CHAN_REASON_RSSI = 1,
21 	NON_PREF_CHAN_REASON_EXT_INTERFERENCE = 2,
22 	NON_PREF_CHAN_REASON_INT_INTERFERENCE = 3,
23 };
24 
25 /**
26   * @brief  Channel structure for non preferred channel
27   *
28   * @param  reason: enum non_pref_chan_reason
29   * @param  oper_class: operating class for the channel
30   * @param  chan: channel number
31   * @param  preference: channel preference
32   */
33 struct non_pref_chan {
34 	enum non_pref_chan_reason reason;
35 	uint8_t oper_class;
36 	uint8_t chan;
37 	uint8_t preference;
38 };
39 
40 /**
41   * @brief  Array structure for non preferred channel struct
42   *
43   * @param  non_pref_chan_num: channel count
44   * @param  chan: array of non_pref_chan type
45   */
46 struct non_pref_chan_s {
47 	size_t non_pref_chan_num;
48 	struct non_pref_chan chan[];
49 };
50 
51 /**
52   * @brief  Update channel preference for MBO IE
53   *
54   * @param  non_pref_chan: Non preference channel list
55   *
56   * @return
57   *    - 0: success else failure
58   */
59 int esp_mbo_update_non_pref_chan(struct non_pref_chan_s *non_pref_chan);
60 
61 #ifdef __cplusplus
62 }
63 #endif
64 #endif
65