• 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 
8 #define _HAL_INTF_C_
9 #include <hal_intf.h>
10 
rtw_hal_init(struct adapter * adapt)11 uint rtw_hal_init(struct adapter *adapt)
12 {
13 	uint status = _SUCCESS;
14 
15 	adapt->hw_init_completed = false;
16 
17 	status = rtl8188eu_hal_init(adapt);
18 
19 	if (status == _SUCCESS) {
20 		adapt->hw_init_completed = true;
21 
22 		if (adapt->registrypriv.notch_filter == 1)
23 			rtw_hal_notch_filter(adapt, 1);
24 	} else {
25 		adapt->hw_init_completed = false;
26 		DBG_88E("%s: hal__init fail\n", __func__);
27 	}
28 
29 	RT_TRACE(_module_hal_init_c_, _drv_err_,
30 		 ("-rtl871x_hal_init:status=0x%x\n", status));
31 
32 	return status;
33 }
34 
rtw_hal_deinit(struct adapter * adapt)35 uint rtw_hal_deinit(struct adapter *adapt)
36 {
37 	uint status = _SUCCESS;
38 
39 	status = rtl8188eu_hal_deinit(adapt);
40 
41 	if (status == _SUCCESS)
42 		adapt->hw_init_completed = false;
43 	else
44 		DBG_88E("\n %s: hal_init fail\n", __func__);
45 
46 	return status;
47 }
48 
rtw_hal_update_ra_mask(struct adapter * adapt,u32 mac_id,u8 rssi_level)49 void rtw_hal_update_ra_mask(struct adapter *adapt, u32 mac_id, u8 rssi_level)
50 {
51 	struct mlme_priv *pmlmepriv = &adapt->mlmepriv;
52 
53 	if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
54 #ifdef CONFIG_88EU_AP_MODE
55 		struct sta_info *psta = NULL;
56 		struct sta_priv *pstapriv = &adapt->stapriv;
57 
58 		if (mac_id - 1 > 0)
59 			psta = pstapriv->sta_aid[mac_id - 2];
60 		if (psta)
61 			add_RATid(adapt, psta, 0);/* todo: based on rssi_level*/
62 #endif
63 	} else {
64 		UpdateHalRAMask8188EUsb(adapt, mac_id, rssi_level);
65 	}
66 }
67