| .. | .. |
|---|
| 17 | 17 | }; |
|---|
| 18 | 18 | |
|---|
| 19 | 19 | struct rt_dot11d_info { |
|---|
| 20 | | - bool enabled; /* dot11MultiDomainCapabilityEnabled */ |
|---|
| 21 | | - |
|---|
| 22 | 20 | u16 country_ie_len; /* > 0 if country_ie_buf[] contains valid country information element. */ |
|---|
| 21 | + |
|---|
| 22 | + /* country_ie_src_addr u16 aligned for comparison and copy */ |
|---|
| 23 | + u8 country_ie_src_addr[ETH_ALEN]; /* Source AP of the country IE. */ |
|---|
| 23 | 24 | u8 country_ie_buf[MAX_IE_LEN]; |
|---|
| 24 | | - u8 country_ie_src_addr[6]; /* Source AP of the country IE. */ |
|---|
| 25 | 25 | u8 country_ie_watchdog; |
|---|
| 26 | 26 | |
|---|
| 27 | 27 | u8 channel_map[MAX_CHANNEL_NUMBER + 1]; /* !Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) */ |
|---|
| 28 | 28 | u8 max_tx_pwr_dbm_list[MAX_CHANNEL_NUMBER + 1]; |
|---|
| 29 | 29 | |
|---|
| 30 | 30 | enum dot11d_state state; |
|---|
| 31 | + u8 dot11d_enabled; /* dot11MultiDomainCapabilityEnabled */ |
|---|
| 31 | 32 | }; |
|---|
| 32 | 33 | |
|---|
| 33 | | -#define eqMacAddr(a, b) (((a)[0] == (b)[0] && \ |
|---|
| 34 | | - (a)[1] == (b)[1] && (a)[2] == (b)[2] && (a)[3] == (b)[3] && \ |
|---|
| 35 | | - (a)[4] == (b)[4] && (a)[5] == (b)[5]) ? 1 : 0) |
|---|
| 36 | | -#define cpMacAddr(des, src) ((des)[0] = (src)[0], \ |
|---|
| 37 | | - (des)[1] = (src)[1], (des)[2] = (src)[2], \ |
|---|
| 38 | | - (des)[3] = (src)[3], (des)[4] = (src)[4], \ |
|---|
| 39 | | - (des)[5] = (src)[5]) |
|---|
| 40 | | -#define GET_DOT11D_INFO(__pIeeeDev) ((struct rt_dot11d_info *)((__pIeeeDev)->pDot11dInfo)) |
|---|
| 34 | +#define GET_DOT11D_INFO(ieee_dev) ((struct rt_dot11d_info *)((ieee_dev)->dot11d_info)) |
|---|
| 41 | 35 | |
|---|
| 42 | | -#define IS_DOT11D_ENABLE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->enabled) |
|---|
| 43 | | -#define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_len > 0) |
|---|
| 36 | +#define IS_DOT11D_ENABLE(ieee_dev) (GET_DOT11D_INFO(ieee_dev)->dot11d_enabled) |
|---|
| 37 | +#define IS_COUNTRY_IE_VALID(ieee_dev) (GET_DOT11D_INFO(ieee_dev)->country_ie_len > 0) |
|---|
| 44 | 38 | |
|---|
| 45 | | -#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa) |
|---|
| 46 | | -#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa) |
|---|
| 39 | +#define IS_EQUAL_CIE_SRC(ieee_dev, addr) ether_addr_equal(GET_DOT11D_INFO(ieee_dev)->country_ie_src_addr, addr) |
|---|
| 40 | +#define UPDATE_CIE_SRC(ieee_dev, addr) ether_addr_copy(GET_DOT11D_INFO(ieee_dev)->country_ie_src_addr, addr) |
|---|
| 47 | 41 | |
|---|
| 48 | | -#define GET_CIE_WATCHDOG(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_watchdog) |
|---|
| 49 | | -#define RESET_CIE_WATCHDOG(__pIeeeDev) (GET_CIE_WATCHDOG(__pIeeeDev) = 0) |
|---|
| 50 | | -#define UPDATE_CIE_WATCHDOG(__pIeeeDev) (++GET_CIE_WATCHDOG(__pIeeeDev)) |
|---|
| 42 | +#define GET_CIE_WATCHDOG(ieee_dev) (GET_DOT11D_INFO(ieee_dev)->country_ie_watchdog) |
|---|
| 43 | +#define RESET_CIE_WATCHDOG(ieee_dev) (GET_CIE_WATCHDOG(ieee_dev) = 0) |
|---|
| 44 | +#define UPDATE_CIE_WATCHDOG(ieee_dev) (++GET_CIE_WATCHDOG(ieee_dev)) |
|---|
| 51 | 45 | |
|---|
| 52 | | -void |
|---|
| 53 | | -Dot11d_Init( |
|---|
| 54 | | - struct ieee80211_device *dev |
|---|
| 55 | | - ); |
|---|
| 46 | +void rtl8192u_dot11d_init(struct ieee80211_device *dev); |
|---|
| 47 | +void dot11d_reset(struct ieee80211_device *dev); |
|---|
| 48 | +void dot11d_update_country_ie(struct ieee80211_device *dev, |
|---|
| 49 | + u8 *addr, |
|---|
| 50 | + u16 coutry_ie_len, |
|---|
| 51 | + u8 *coutry_ie); |
|---|
| 52 | +u8 dot11d_get_max_tx_pwr_in_dbm(struct ieee80211_device *dev, u8 channel); |
|---|
| 53 | +void dot11d_scan_complete(struct ieee80211_device *dev); |
|---|
| 54 | +int is_legal_channel(struct ieee80211_device *dev, u8 channel); |
|---|
| 55 | +int to_legal_channel(struct ieee80211_device *dev, u8 channel); |
|---|
| 56 | 56 | |
|---|
| 57 | | -void |
|---|
| 58 | | -Dot11d_Reset( |
|---|
| 59 | | - struct ieee80211_device *dev |
|---|
| 60 | | - ); |
|---|
| 61 | | - |
|---|
| 62 | | -void |
|---|
| 63 | | -Dot11d_UpdateCountryIe( |
|---|
| 64 | | - struct ieee80211_device *dev, |
|---|
| 65 | | - u8 *pTaddr, |
|---|
| 66 | | - u16 CoutryIeLen, |
|---|
| 67 | | - u8 *pCoutryIe |
|---|
| 68 | | - ); |
|---|
| 69 | | - |
|---|
| 70 | | -u8 |
|---|
| 71 | | -DOT11D_GetMaxTxPwrInDbm( |
|---|
| 72 | | - struct ieee80211_device *dev, |
|---|
| 73 | | - u8 Channel |
|---|
| 74 | | - ); |
|---|
| 75 | | - |
|---|
| 76 | | -void |
|---|
| 77 | | -DOT11D_ScanComplete( |
|---|
| 78 | | - struct ieee80211_device *dev |
|---|
| 79 | | - ); |
|---|
| 80 | | - |
|---|
| 81 | | -int IsLegalChannel( |
|---|
| 82 | | - struct ieee80211_device *dev, |
|---|
| 83 | | - u8 channel |
|---|
| 84 | | -); |
|---|
| 85 | | - |
|---|
| 86 | | -int ToLegalChannel( |
|---|
| 87 | | - struct ieee80211_device *dev, |
|---|
| 88 | | - u8 channel |
|---|
| 89 | | -); |
|---|
| 90 | 57 | #endif /* #ifndef __INC_DOT11D_H */ |
|---|