1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 2007 - 2012 Realtek Corporation. */
3 
4 #define _HAL_INTF_C_
5 #include "../include/osdep_service.h"
6 #include "../include/drv_types.h"
7 #include "../include/hal_intf.h"
8 
rtw_hal_init(struct adapter * adapt)9 uint	 rtw_hal_init(struct adapter *adapt)
10 {
11 	uint	status = _SUCCESS;
12 
13 	adapt->hw_init_completed = false;
14 
15 	status = rtl8188eu_hal_init(adapt);
16 
17 	if (status == _SUCCESS) {
18 		adapt->hw_init_completed = true;
19 
20 		if (adapt->registrypriv.notch_filter == 1)
21 			hal_notch_filter_8188e(adapt, 1);
22 	} else {
23 		adapt->hw_init_completed = false;
24 	}
25 
26 	return status;
27 }
28 
rtw_hal_deinit(struct adapter * adapt)29 uint rtw_hal_deinit(struct adapter *adapt)
30 {
31 	uint	status = _SUCCESS;
32 
33 	status = rtl8188eu_hal_deinit(adapt);
34 
35 	if (status == _SUCCESS)
36 		adapt->hw_init_completed = false;
37 
38 	return status;
39 }
40 
rtw_hal_update_ra_mask(struct adapter * adapt,u32 mac_id,u8 rssi_level)41 void rtw_hal_update_ra_mask(struct adapter *adapt, u32 mac_id, u8 rssi_level)
42 {
43 	struct mlme_priv *pmlmepriv = &adapt->mlmepriv;
44 
45 	if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
46 		struct sta_info *psta = NULL;
47 		struct sta_priv *pstapriv = &adapt->stapriv;
48 		if (mac_id >= 2)
49 			psta = pstapriv->sta_aid[(mac_id - 1) - 1];
50 		if (psta)
51 			add_RATid(adapt, psta, 0);/* todo: based on rssi_level*/
52 	} else {
53 		UpdateHalRAMask8188EUsb(adapt, mac_id, rssi_level);
54 	}
55 }
56