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