2013-05-08 21:45:39 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
|
2013-05-19 04:28:07 +00:00
|
|
|
*
|
2013-05-08 21:45:39 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of version 2 of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
|
|
|
*
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#define _HAL_INTF_C_
|
|
|
|
#include <drv_conf.h>
|
|
|
|
#include <osdep_service.h>
|
|
|
|
#include <drv_types.h>
|
|
|
|
#include <hal_intf.h>
|
2013-07-11 18:35:36 +00:00
|
|
|
#include <usb_hal.h>
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
void rtw_hal_chip_configure(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.intf_chip_configure)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.intf_chip_configure(padapter);
|
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_read_chip_info(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.read_adapter_info)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.read_adapter_info(padapter);
|
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_read_chip_version(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.read_chip_version)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.read_chip_version(padapter);
|
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_def_value_init(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.init_default_value)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.init_default_value(padapter);
|
|
|
|
}
|
|
|
|
void rtw_hal_free_data(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.free_hal_data)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.free_hal_data(padapter);
|
|
|
|
}
|
|
|
|
void rtw_hal_dm_init(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.dm_init)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.dm_init(padapter);
|
|
|
|
}
|
|
|
|
void rtw_hal_dm_deinit(_adapter *padapter)
|
|
|
|
{
|
2013-07-10 18:25:07 +00:00
|
|
|
/* cancel dm timer */
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.dm_deinit)
|
2013-05-19 04:28:07 +00:00
|
|
|
padapter->HalFunc.dm_deinit(padapter);
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
void rtw_hal_sw_led_init(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.InitSwLeds)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.InitSwLeds(padapter);
|
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_sw_led_deinit(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.DeInitSwLeds)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.DeInitSwLeds(padapter);
|
|
|
|
}
|
|
|
|
|
|
|
|
u32 rtw_hal_power_on(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.hal_power_on)
|
2013-05-08 21:45:39 +00:00
|
|
|
return padapter->HalFunc.hal_power_on(padapter);
|
|
|
|
return _FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-05-19 04:28:07 +00:00
|
|
|
uint rtw_hal_init(_adapter *padapter)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
uint status = _SUCCESS;
|
|
|
|
|
2013-05-26 03:02:10 +00:00
|
|
|
padapter->hw_init_completed=false;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
status = padapter->HalFunc.hal_init(padapter);
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (status == _SUCCESS){
|
2013-05-26 03:02:10 +00:00
|
|
|
padapter->hw_init_completed = true;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
if (padapter->registrypriv.notch_filter == 1)
|
|
|
|
rtw_hal_notch_filter(padapter, 1);
|
|
|
|
|
|
|
|
rtw_hal_reset_security_engine(padapter);
|
|
|
|
}
|
|
|
|
else{
|
2013-05-26 03:02:10 +00:00
|
|
|
padapter->hw_init_completed = false;
|
2013-05-25 23:35:42 +00:00
|
|
|
DBG_88E("rtw_hal_init: hal__init fail\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RT_TRACE(_module_hal_init_c_,_drv_err_,("-rtl871x_hal_init:status=0x%x\n",status));
|
|
|
|
|
|
|
|
return status;
|
|
|
|
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
uint rtw_hal_deinit(_adapter *padapter)
|
|
|
|
{
|
|
|
|
uint status = _SUCCESS;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
_func_enter_;
|
|
|
|
|
|
|
|
status = padapter->HalFunc.hal_deinit(padapter);
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (status == _SUCCESS){
|
2013-05-26 03:02:10 +00:00
|
|
|
padapter->hw_init_completed = false;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-25 23:35:42 +00:00
|
|
|
DBG_88E("\n rtw_hal_deinit: hal_init fail\n");
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
_func_exit_;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_set_hwreg(_adapter *padapter, u8 variable, u8 *val)
|
|
|
|
{
|
|
|
|
if (padapter->HalFunc.SetHwRegHandler)
|
|
|
|
padapter->HalFunc.SetHwRegHandler(padapter, variable, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_get_hwreg(_adapter *padapter, u8 variable, u8 *val)
|
|
|
|
{
|
|
|
|
if (padapter->HalFunc.GetHwRegHandler)
|
|
|
|
padapter->HalFunc.GetHwRegHandler(padapter, variable, val);
|
|
|
|
}
|
|
|
|
|
2013-05-19 04:37:45 +00:00
|
|
|
u8 rtw_hal_set_def_var(_adapter *padapter, HAL_DEF_VARIABLE eVariable, void * pValue)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.SetHalDefVarHandler)
|
2013-05-08 21:45:39 +00:00
|
|
|
return padapter->HalFunc.SetHalDefVarHandler(padapter,eVariable,pValue);
|
|
|
|
return _FAIL;
|
|
|
|
}
|
2013-05-19 04:37:45 +00:00
|
|
|
u8 rtw_hal_get_def_var(_adapter *padapter, HAL_DEF_VARIABLE eVariable, void * pValue)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.GetHalDefVarHandler)
|
2013-05-08 21:45:39 +00:00
|
|
|
return padapter->HalFunc.GetHalDefVarHandler(padapter,eVariable,pValue);
|
2013-05-19 04:28:07 +00:00
|
|
|
return _FAIL;
|
|
|
|
}
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-05-19 04:48:10 +00:00
|
|
|
void rtw_hal_set_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, void * pValue1,bool bSet)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.SetHalODMVarHandler)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.SetHalODMVarHandler(padapter,eVariable,pValue1,bSet);
|
|
|
|
}
|
2013-05-19 04:48:10 +00:00
|
|
|
void rtw_hal_get_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, void * pValue1,bool bSet)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.GetHalODMVarHandler)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.GetHalODMVarHandler(padapter,eVariable,pValue1,bSet);
|
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_enable_interrupt(_adapter *padapter)
|
|
|
|
{
|
|
|
|
if (padapter->HalFunc.enable_interrupt)
|
|
|
|
padapter->HalFunc.enable_interrupt(padapter);
|
2013-05-19 04:28:07 +00:00
|
|
|
else
|
2013-05-25 23:35:42 +00:00
|
|
|
DBG_88E("%s: HalFunc.enable_interrupt is NULL!\n", __func__);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
void rtw_hal_disable_interrupt(_adapter *padapter)
|
|
|
|
{
|
|
|
|
if (padapter->HalFunc.disable_interrupt)
|
|
|
|
padapter->HalFunc.disable_interrupt(padapter);
|
2013-05-19 04:28:07 +00:00
|
|
|
else
|
2013-05-25 23:35:42 +00:00
|
|
|
DBG_88E("%s: HalFunc.disable_interrupt is NULL!\n", __func__);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
u32 rtw_hal_inirp_init(_adapter *padapter)
|
|
|
|
{
|
|
|
|
u32 rst = _FAIL;
|
2013-05-19 04:28:07 +00:00
|
|
|
if (padapter->HalFunc.inirp_init)
|
|
|
|
rst = padapter->HalFunc.inirp_init(padapter);
|
|
|
|
else
|
2013-05-25 23:35:42 +00:00
|
|
|
DBG_88E(" %s HalFunc.inirp_init is NULL!!!\n",__func__);
|
2013-05-08 21:45:39 +00:00
|
|
|
return rst;
|
|
|
|
}
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
u32 rtw_hal_inirp_deinit(_adapter *padapter)
|
|
|
|
{
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.inirp_deinit)
|
2013-05-08 21:45:39 +00:00
|
|
|
return padapter->HalFunc.inirp_deinit(padapter);
|
|
|
|
|
|
|
|
return _FAIL;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
u8 rtw_hal_intf_ps_func(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id, u8* val)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
if (padapter->HalFunc.interface_ps_func)
|
2013-05-08 21:45:39 +00:00
|
|
|
return padapter->HalFunc.interface_ps_func(padapter,efunc_id,val);
|
|
|
|
return _FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
s32 rtw_hal_xmit(_adapter *padapter, struct xmit_frame *pxmitframe)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.hal_xmit)
|
2013-05-08 21:45:39 +00:00
|
|
|
return padapter->HalFunc.hal_xmit(padapter, pxmitframe);
|
|
|
|
|
2013-05-26 03:02:10 +00:00
|
|
|
return false;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
s32 rtw_hal_mgnt_xmit(_adapter *padapter, struct xmit_frame *pmgntframe)
|
|
|
|
{
|
|
|
|
s32 ret = _FAIL;
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.mgnt_xmit)
|
2013-05-08 21:45:39 +00:00
|
|
|
ret = padapter->HalFunc.mgnt_xmit(padapter, pmgntframe);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
s32 rtw_hal_init_xmit_priv(_adapter *padapter)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.init_xmit_priv != NULL)
|
2013-05-08 21:45:39 +00:00
|
|
|
return padapter->HalFunc.init_xmit_priv(padapter);
|
|
|
|
return _FAIL;
|
|
|
|
}
|
|
|
|
void rtw_hal_free_xmit_priv(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.free_xmit_priv != NULL)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.free_xmit_priv(padapter);
|
|
|
|
}
|
|
|
|
|
|
|
|
s32 rtw_hal_init_recv_priv(_adapter *padapter)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.init_recv_priv)
|
2013-05-08 21:45:39 +00:00
|
|
|
return padapter->HalFunc.init_recv_priv(padapter);
|
|
|
|
|
|
|
|
return _FAIL;
|
|
|
|
}
|
|
|
|
void rtw_hal_free_recv_priv(_adapter *padapter)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.free_recv_priv)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.free_recv_priv(padapter);
|
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_update_ra_mask(_adapter *padapter, u32 mac_id, u8 rssi_level)
|
|
|
|
{
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
|
|
|
|
2013-05-26 03:02:10 +00:00
|
|
|
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
struct sta_info *psta = NULL;
|
2013-05-19 04:28:07 +00:00
|
|
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
|
|
|
#ifdef CONFIG_NATIVEAP_MLME
|
2013-05-09 04:04:25 +00:00
|
|
|
if ((mac_id-1)>0)
|
2013-05-19 04:28:07 +00:00
|
|
|
psta = pstapriv->sta_aid[(mac_id-1) - 1];
|
2013-05-08 21:45:39 +00:00
|
|
|
#endif
|
2013-05-09 04:04:25 +00:00
|
|
|
if (psta)
|
2013-07-10 18:25:07 +00:00
|
|
|
add_RATid(padapter, psta, 0);/* todo: based on rssi_level */
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
else
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.UpdateRAMaskHandler)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.UpdateRAMaskHandler(padapter,mac_id,rssi_level);
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_add_ra_tid(_adapter *padapter, u32 bitmap, u8 arg, u8 rssi_level)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.Add_RateATid)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.Add_RateATid(padapter, bitmap, arg, rssi_level);
|
|
|
|
}
|
|
|
|
/* Start specifical interface thread */
|
|
|
|
void rtw_hal_start_thread(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.run_thread)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.run_thread(padapter);
|
|
|
|
}
|
|
|
|
/* Start specifical interface thread */
|
|
|
|
void rtw_hal_stop_thread(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.cancel_thread)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.cancel_thread(padapter);
|
|
|
|
}
|
|
|
|
|
|
|
|
u32 rtw_hal_read_bbreg(_adapter *padapter, u32 RegAddr, u32 BitMask)
|
|
|
|
{
|
|
|
|
u32 data = 0;
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.read_bbreg)
|
2013-05-08 21:45:39 +00:00
|
|
|
data = padapter->HalFunc.read_bbreg(padapter, RegAddr, BitMask);
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
void rtw_hal_write_bbreg(_adapter *padapter, u32 RegAddr, u32 BitMask, u32 Data)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.write_bbreg)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.write_bbreg(padapter, RegAddr, BitMask, Data);
|
|
|
|
}
|
|
|
|
|
2013-06-20 15:13:14 +00:00
|
|
|
u32 rtw_hal_read_rfreg(_adapter *padapter, RF_RADIO_PATH_E eRFPath, u32 RegAddr, u32 BitMask)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
u32 data = 0;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->HalFunc.read_rfreg)
|
2013-05-08 21:45:39 +00:00
|
|
|
data = padapter->HalFunc.read_rfreg(padapter, eRFPath, RegAddr, BitMask);
|
|
|
|
return data;
|
|
|
|
}
|
2013-06-20 15:13:14 +00:00
|
|
|
void rtw_hal_write_rfreg(_adapter *padapter, RF_RADIO_PATH_E eRFPath, u32 RegAddr, u32 BitMask, u32 Data)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.write_rfreg)
|
2013-05-19 04:28:07 +00:00
|
|
|
padapter->HalFunc.write_rfreg(padapter, eRFPath, RegAddr, BitMask, Data);
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
s32 rtw_hal_interrupt_handler(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.interrupt_handler)
|
2013-05-08 21:45:39 +00:00
|
|
|
return padapter->HalFunc.interrupt_handler(padapter);
|
|
|
|
return _FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_set_bwmode(_adapter *padapter, HT_CHANNEL_WIDTH Bandwidth, u8 Offset)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.set_bwmode_handler)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.set_bwmode_handler(padapter, Bandwidth, Offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_set_chan(_adapter *padapter, u8 channel)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.set_channel_handler)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.set_channel_handler(padapter, channel);
|
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_dm_watchdog(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.hal_dm_watchdog)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.hal_dm_watchdog(padapter);
|
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_bcn_related_reg_setting(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.SetBeaconRelatedRegistersHandler)
|
2013-05-19 04:28:07 +00:00
|
|
|
padapter->HalFunc.SetBeaconRelatedRegistersHandler(padapter);
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_ANTENNA_DIVERSITY
|
|
|
|
u8 rtw_hal_antdiv_before_linked(_adapter *padapter)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.AntDivBeforeLinkHandler)
|
2013-05-08 21:45:39 +00:00
|
|
|
return padapter->HalFunc.AntDivBeforeLinkHandler(padapter);
|
2013-05-26 03:02:10 +00:00
|
|
|
return false;
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
void rtw_hal_antdiv_rssi_compared(_adapter *padapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.AntDivCompareHandler)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.AntDivCompareHandler(padapter, dst, src);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef DBG_CONFIG_ERROR_DETECT
|
|
|
|
void rtw_hal_sreset_init(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.sreset_init_value)
|
2013-05-19 04:28:07 +00:00
|
|
|
padapter->HalFunc.sreset_init_value(padapter);
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
void rtw_hal_sreset_reset(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.silentreset)
|
2013-05-19 04:28:07 +00:00
|
|
|
padapter->HalFunc.silentreset(padapter);
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_sreset_reset_value(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.sreset_reset_value)
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->HalFunc.sreset_reset_value(padapter);
|
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_sreset_xmit_status_check(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.sreset_xmit_status_check)
|
2013-05-19 04:28:07 +00:00
|
|
|
padapter->HalFunc.sreset_xmit_status_check(padapter);
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
void rtw_hal_sreset_linked_status_check(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.sreset_linked_status_check)
|
2013-05-19 04:28:07 +00:00
|
|
|
padapter->HalFunc.sreset_linked_status_check(padapter);
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
u8 rtw_hal_sreset_get_wifi_status(_adapter *padapter)
|
|
|
|
{
|
|
|
|
u8 status = 0;
|
2013-05-19 04:28:07 +00:00
|
|
|
if (padapter->HalFunc.sreset_get_wifi_status)
|
|
|
|
status = padapter->HalFunc.sreset_get_wifi_status(padapter);
|
2013-05-08 21:45:39 +00:00
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
#endif /* DBG_CONFIG_ERROR_DETECT */
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_IOL
|
|
|
|
int rtw_hal_iol_cmd(ADAPTER *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (adapter->HalFunc.IOL_exec_cmds_sync)
|
2013-05-08 21:45:39 +00:00
|
|
|
return adapter->HalFunc.IOL_exec_cmds_sync(adapter, xmit_frame, max_wating_ms,bndy_cnt);
|
|
|
|
return _FAIL;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_XMIT_THREAD_MODE
|
|
|
|
s32 rtw_hal_xmit_thread_handler(_adapter *padapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->HalFunc.xmit_thread_handler)
|
2013-05-08 21:45:39 +00:00
|
|
|
return padapter->HalFunc.xmit_thread_handler(padapter);
|
|
|
|
return _FAIL;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void rtw_hal_notch_filter(_adapter *adapter, bool enable)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (adapter->HalFunc.hal_notch_filter)
|
2013-05-19 04:28:07 +00:00
|
|
|
adapter->HalFunc.hal_notch_filter(adapter,enable);
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void rtw_hal_reset_security_engine(_adapter * adapter)
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (adapter->HalFunc.hal_reset_security_engine)
|
2013-05-08 21:45:39 +00:00
|
|
|
adapter->HalFunc.hal_reset_security_engine(adapter);
|
|
|
|
}
|
|
|
|
|
|
|
|
s32 rtw_hal_c2h_handler(_adapter *adapter, struct c2h_evt_hdr *c2h_evt)
|
|
|
|
{
|
|
|
|
s32 ret = _FAIL;
|
|
|
|
if (adapter->HalFunc.c2h_handler)
|
|
|
|
ret = adapter->HalFunc.c2h_handler(adapter, c2h_evt);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
c2h_id_filter rtw_hal_c2h_id_filter_ccx(_adapter *adapter)
|
|
|
|
{
|
|
|
|
return adapter->HalFunc.c2h_id_filter_ccx;
|
|
|
|
}
|