1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
3 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
6 * wlanfae <wlanfae@realtek.com>
7 ******************************************************************************/
13 struct chnl_txpow_triple
{
20 DOT11D_STATE_NONE
= 0,
26 * struct rt_dot11d_info * @country_len: value greater than 0 if
27 * @country_buffer contains valid country information element.
28 * @channel_map: holds channel values
30 * 1 - valid (active scan),
31 * 2 - valid (passive scan)
32 * @country_src_addr - Source AP of the country IE
35 struct rt_dot11d_info
{
39 u8 country_buffer
[MAX_IE_LEN
];
40 u8 country_src_addr
[6];
43 u8 channel_map
[MAX_CHANNEL_NUMBER
+ 1];
44 u8 max_tx_power_list
[MAX_CHANNEL_NUMBER
+ 1];
46 enum dot11d_state state
;
49 static inline void copy_mac_addr(unsigned char *des
, unsigned char *src
)
54 #define GET_DOT11D_INFO(__ieee_dev) \
55 ((struct rt_dot11d_info *)((__ieee_dev)->dot11d_info))
57 #define IS_DOT11D_ENABLE(__ieee_dev) \
58 (GET_DOT11D_INFO(__ieee_dev)->enabled)
59 #define IS_COUNTRY_IE_VALID(__ieee_dev) \
60 (GET_DOT11D_INFO(__ieee_dev)->country_len > 0)
62 #define IS_EQUAL_CIE_SRC(__ieee_dev, __address) \
63 ether_addr_equal_unaligned( \
64 GET_DOT11D_INFO(__ieee_dev)->country_src_addr, __address)
65 #define UPDATE_CIE_SRC(__ieee_dev, __address) \
66 copy_mac_addr(GET_DOT11D_INFO(__ieee_dev)->country_src_addr, __address)
68 #define GET_CIE_WATCHDOG(__ieee_dev) \
69 (GET_DOT11D_INFO(__ieee_dev)->country_watchdog)
70 static inline void RESET_CIE_WATCHDOG(struct rtllib_device
*__ieee_dev
)
72 GET_CIE_WATCHDOG(__ieee_dev
) = 0;
75 #define UPDATE_CIE_WATCHDOG(__ieee_dev) (++GET_CIE_WATCHDOG(__ieee_dev))
77 void dot11d_init(struct rtllib_device
*dev
);
78 void dot11d_channel_map(u8 channel_plan
, struct rtllib_device
*ieee
);
79 void dot11d_reset(struct rtllib_device
*dev
);
80 void dot11d_update_country(struct rtllib_device
*dev
, u8
*address
,
81 u16 country_len
, u8
*country
);
82 void dot11d_scan_complete(struct rtllib_device
*dev
);