• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  ******************************************************************************/
15 #ifndef __HAL_INTF_H__
16 #define __HAL_INTF_H__
17 
18 #include <osdep_service.h>
19 #include <drv_types.h>
20 #include <Hal8188EPhyCfg.h>
21 
22 enum RTL871X_HCI_TYPE {
23 	RTW_PCIE	= BIT(0),
24 	RTW_USB		= BIT(1),
25 	RTW_SDIO	= BIT(2),
26 	RTW_GSPI	= BIT(3),
27 };
28 
29 enum _CHIP_TYPE {
30 	NULL_CHIP_TYPE,
31 	RTL8712_8188S_8191S_8192S,
32 	RTL8188C_8192C,
33 	RTL8192D,
34 	RTL8723A,
35 	RTL8188E,
36 	MAX_CHIP_TYPE
37 };
38 
39 enum hw_variables {
40 	HW_VAR_MEDIA_STATUS,
41 	HW_VAR_MEDIA_STATUS1,
42 	HW_VAR_SET_OPMODE,
43 	HW_VAR_MAC_ADDR,
44 	HW_VAR_BSSID,
45 	HW_VAR_INIT_RTS_RATE,
46 	HW_VAR_BASIC_RATE,
47 	HW_VAR_TXPAUSE,
48 	HW_VAR_BCN_FUNC,
49 	HW_VAR_CORRECT_TSF,
50 	HW_VAR_CHECK_BSSID,
51 	HW_VAR_MLME_DISCONNECT,
52 	HW_VAR_MLME_SITESURVEY,
53 	HW_VAR_MLME_JOIN,
54 	HW_VAR_BEACON_INTERVAL,
55 	HW_VAR_SLOT_TIME,
56 	HW_VAR_RESP_SIFS,
57 	HW_VAR_ACK_PREAMBLE,
58 	HW_VAR_SEC_CFG,
59 	HW_VAR_BCN_VALID,
60 	HW_VAR_RF_TYPE,
61 	HW_VAR_DM_FUNC_OP,
62 	HW_VAR_DM_FUNC_SET,
63 	HW_VAR_DM_FUNC_CLR,
64 	HW_VAR_CAM_EMPTY_ENTRY,
65 	HW_VAR_CAM_INVALID_ALL,
66 	HW_VAR_CAM_WRITE,
67 	HW_VAR_CAM_READ,
68 	HW_VAR_AC_PARAM_VO,
69 	HW_VAR_AC_PARAM_VI,
70 	HW_VAR_AC_PARAM_BE,
71 	HW_VAR_AC_PARAM_BK,
72 	HW_VAR_ACM_CTRL,
73 	HW_VAR_AMPDU_MIN_SPACE,
74 	HW_VAR_AMPDU_FACTOR,
75 	HW_VAR_RXDMA_AGG_PG_TH,
76 	HW_VAR_SET_RPWM,
77 	HW_VAR_H2C_FW_PWRMODE,
78 	HW_VAR_H2C_FW_JOINBSSRPT,
79 	HW_VAR_FWLPS_RF_ON,
80 	HW_VAR_H2C_FW_P2P_PS_OFFLOAD,
81 	HW_VAR_TDLS_WRCR,
82 	HW_VAR_TDLS_INIT_CH_SEN,
83 	HW_VAR_TDLS_RS_RCR,
84 	HW_VAR_TDLS_DONE_CH_SEN,
85 	HW_VAR_INITIAL_GAIN,
86 	HW_VAR_TRIGGER_GPIO_0,
87 	HW_VAR_BT_SET_COEXIST,
88 	HW_VAR_BT_ISSUE_DELBA,
89 	HW_VAR_CURRENT_ANTENNA,
90 	HW_VAR_ANTENNA_DIVERSITY_LINK,
91 	HW_VAR_ANTENNA_DIVERSITY_SELECT,
92 	HW_VAR_SWITCH_EPHY_WoWLAN,
93 	HW_VAR_EFUSE_USAGE,
94 	HW_VAR_EFUSE_BYTES,
95 	HW_VAR_EFUSE_BT_USAGE,
96 	HW_VAR_EFUSE_BT_BYTES,
97 	HW_VAR_FIFO_CLEARN_UP,
98 	HW_VAR_CHECK_TXBUF,
99 	HW_VAR_APFM_ON_MAC, /* Auto FSM to Turn On, include clock, isolation,
100 			     * power control for MAC only */
101 	/*  The valid upper nav range for the HW updating, if the true value is
102 	 *  larger than the upper range, the HW won't update it. */
103 	/*  Unit in microsecond. 0 means disable this function. */
104 	HW_VAR_NAV_UPPER,
105 	HW_VAR_RPT_TIMER_SETTING,
106 	HW_VAR_TX_RPT_MAX_MACID,
107 	HW_VAR_H2C_MEDIA_STATUS_RPT,
108 	HW_VAR_CHK_HI_QUEUE_EMPTY,
109 };
110 
111 enum hal_def_variable {
112 	HAL_DEF_UNDERCORATEDSMOOTHEDPWDB,
113 	HAL_DEF_IS_SUPPORT_ANT_DIV,
114 	HAL_DEF_CURRENT_ANTENNA,
115 	HAL_DEF_DRVINFO_SZ,
116 	HAL_DEF_MAX_RECVBUF_SZ,
117 	HAL_DEF_RX_PACKET_OFFSET,
118 	HAL_DEF_DBG_DUMP_RXPKT,/* for dbg */
119 	HAL_DEF_DBG_DM_FUNC,/* for dbg */
120 	HAL_DEF_RA_DECISION_RATE,
121 	HAL_DEF_RA_SGI,
122 	HAL_DEF_PT_PWR_STATUS,
123 	HW_VAR_MAX_RX_AMPDU_FACTOR,
124 	HW_DEF_RA_INFO_DUMP,
125 	HAL_DEF_DBG_DUMP_TXPKT,
126 	HW_DEF_FA_CNT_DUMP,
127 	HW_DEF_ODM_DBG_FLAG,
128 };
129 
130 enum hal_odm_variable {
131 	HAL_ODM_STA_INFO,
132 	HAL_ODM_P2P_STATE,
133 	HAL_ODM_WIFI_DISPLAY_STATE,
134 };
135 
136 enum hal_intf_ps_func {
137 	HAL_USB_SELECT_SUSPEND,
138 	HAL_MAX_ID,
139 };
140 
141 enum rt_eeprom_type {
142 	EEPROM_93C46,
143 	EEPROM_93C56,
144 	EEPROM_BOOT_EFUSE,
145 };
146 
147 #define RF_CHANGE_BY_INIT	0
148 #define RF_CHANGE_BY_IPS	BIT(28)
149 #define RF_CHANGE_BY_PS		BIT(29)
150 #define RF_CHANGE_BY_HW		BIT(30)
151 #define RF_CHANGE_BY_SW		BIT(31)
152 
153 enum hardware_type {
154 	HARDWARE_TYPE_RTL8188EU,
155 	HARDWARE_TYPE_MAX,
156 };
157 
158 #define GET_EEPROM_EFUSE_PRIV(adapter) (&adapter->eeprompriv)
159 
160 #define is_boot_from_eeprom(adapter) (adapter->eeprompriv.EepromOrEfuse)
161 
162 void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_level);
163 u32 rtl8188eu_hal_deinit(struct adapter *Adapter);
164 u32 rtl8188eu_hal_init(struct adapter *Adapter);
165 void rtw_hal_def_value_init(struct adapter *padapter);
166 
167 void	rtw_hal_free_data(struct adapter *padapter);
168 
169 void rtw_hal_dm_init(struct adapter *padapter);
170 void rtw_hal_sw_led_init(struct adapter *padapter);
171 void rtw_hal_sw_led_deinit(struct adapter *padapter);
172 
173 u32 rtw_hal_power_on(struct adapter *padapter);
174 uint rtw_hal_init(struct adapter *padapter);
175 uint rtw_hal_deinit(struct adapter *padapter);
176 void rtw_hal_stop(struct adapter *padapter);
177 void rtw_hal_set_hwreg(struct adapter *padapter, u8 variable, u8 *val);
178 void rtw_hal_get_hwreg(struct adapter *padapter, u8 variable, u8 *val);
179 
180 void rtw_hal_chip_configure(struct adapter *padapter);
181 void rtw_hal_read_chip_info(struct adapter *padapter);
182 void rtw_hal_read_chip_version(struct adapter *padapter);
183 
184 u8 rtw_hal_get_def_var(struct adapter *padapter,
185 		       enum hal_def_variable eVariable, void *pValue);
186 
187 void rtw_hal_set_odm_var(struct adapter *padapter,
188 			 enum hal_odm_variable eVariable, void *pValue1,
189 			 bool bSet);
190 
191 u32	rtw_hal_inirp_init(struct adapter *padapter);
192 void	rtw_hal_inirp_deinit(struct adapter *padapter);
193 
194 s32	rtw_hal_xmit(struct adapter *padapter, struct xmit_frame *pxmitframe);
195 s32	rtw_hal_mgnt_xmit(struct adapter *padapter,
196 			  struct xmit_frame *pmgntframe);
197 
198 s32	rtw_hal_init_xmit_priv(struct adapter *padapter);
199 
200 int	rtw_hal_init_recv_priv(struct adapter *padapter);
201 void	rtw_hal_free_recv_priv(struct adapter *padapter);
202 
203 void rtw_hal_update_ra_mask(struct adapter *padapter, u32 mac_id, u8 level);
204 void	rtw_hal_add_ra_tid(struct adapter *adapt, u32 bitmap, u8 arg, u8 level);
205 void	rtw_hal_clone_data(struct adapter *dst_adapt,
206 			   struct adapter *src_adapt);
207 
208 void rtw_hal_bcn_related_reg_setting(struct adapter *padapter);
209 
210 u32	rtw_hal_read_rfreg(struct adapter *padapter, enum rf_radio_path eRFPath,
211 			   u32 RegAddr, u32 BitMask);
212 
213 void	rtw_hal_set_bwmode(struct adapter *padapter,
214 			   enum ht_channel_width Bandwidth, u8 Offset);
215 void	rtw_hal_set_chan(struct adapter *padapter, u8 channel);
216 void	rtw_hal_dm_watchdog(struct adapter *padapter);
217 
218 u8	rtw_hal_antdiv_before_linked(struct adapter *padapter);
219 void	rtw_hal_antdiv_rssi_compared(struct adapter *padapter,
220 				     struct wlan_bssid_ex *dst,
221 				     struct wlan_bssid_ex *src);
222 
223 void rtw_hal_sreset_init(struct adapter *padapter);
224 
225 void rtw_hal_notch_filter(struct adapter *adapter, bool enable);
226 
227 void indicate_wx_scan_complete_event(struct adapter *padapter);
228 u8 rtw_do_join(struct adapter *padapter);
229 
230 #endif /* __HAL_INTF_H__ */
231