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