2022-06-08 23:46:35 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
/* Copyright(c) 2007 - 2012 Realtek Corporation. */
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
#define _HAL_INTF_C_
|
2022-06-08 23:46:35 +00:00
|
|
|
#include "../include/osdep_service.h"
|
|
|
|
#include "../include/drv_types.h"
|
|
|
|
#include "../include/hal_intf.h"
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-04 23:08:37 +00:00
|
|
|
uint rtw_hal_init(struct adapter *adapt)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
uint status = _SUCCESS;
|
|
|
|
|
2013-08-04 23:08:37 +00:00
|
|
|
adapt->hw_init_completed = false;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2022-06-08 23:46:35 +00:00
|
|
|
status = rtl8188eu_hal_init(adapt);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-04 23:08:37 +00:00
|
|
|
if (status == _SUCCESS) {
|
|
|
|
adapt->hw_init_completed = true;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-04 23:08:37 +00:00
|
|
|
if (adapt->registrypriv.notch_filter == 1)
|
2022-06-08 23:46:35 +00:00
|
|
|
hal_notch_filter_8188e(adapt, 1);
|
2013-08-04 23:08:37 +00:00
|
|
|
} else {
|
|
|
|
adapt->hw_init_completed = false;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return status;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-04 23:08:37 +00:00
|
|
|
uint rtw_hal_deinit(struct adapter *adapt)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
uint status = _SUCCESS;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2022-06-08 23:46:35 +00:00
|
|
|
status = rtl8188eu_hal_deinit(adapt);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-04 23:08:37 +00:00
|
|
|
if (status == _SUCCESS)
|
|
|
|
adapt->hw_init_completed = false;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2013-08-04 23:08:37 +00:00
|
|
|
void rtw_hal_update_ra_mask(struct adapter *adapt, u32 mac_id, u8 rssi_level)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2022-06-08 23:46:35 +00:00
|
|
|
struct mlme_priv *pmlmepriv = &adapt->mlmepriv;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2022-06-08 23:46:35 +00:00
|
|
|
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
|
2013-05-08 21:45:39 +00:00
|
|
|
struct sta_info *psta = NULL;
|
2013-08-04 23:08:37 +00:00
|
|
|
struct sta_priv *pstapriv = &adapt->stapriv;
|
2022-06-08 23:46:35 +00:00
|
|
|
if (mac_id >= 2)
|
|
|
|
psta = pstapriv->sta_aid[(mac_id - 1) - 1];
|
2013-05-09 04:04:25 +00:00
|
|
|
if (psta)
|
2013-08-04 23:08:37 +00:00
|
|
|
add_RATid(adapt, psta, 0);/* todo: based on rssi_level*/
|
|
|
|
} else {
|
2022-06-08 23:46:35 +00:00
|
|
|
UpdateHalRAMask8188EUsb(adapt, mac_id, rssi_level);
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|