mirror of
https://github.com/armbian/linux-cix.git
synced 2026-01-06 12:30:45 -08:00
staging: Add rtl8723bs sdio wifi driver
The rtl8723bs is found on quite a few systems used by Linux users, such as on Atom systems (Intel Computestick and various other Atom based devices) and on many (budget) ARM boards such as the CHIP. The plan moving forward with this is for the new clean, written from scratch, rtl8xxxu driver to eventually gain support for sdio devices. But there is no clear timeline for that, so lets add this driver included in staging for now. Cc: Bastien Nocera <hadess@hadess.net> Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Jes Sorensen <jes.sorensen@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
38ca74e58f
commit
554c0a3abf
@@ -34,6 +34,8 @@ source "drivers/staging/rtl8192u/Kconfig"
|
||||
|
||||
source "drivers/staging/rtl8192e/Kconfig"
|
||||
|
||||
source "drivers/staging/rtl8723bs/Kconfig"
|
||||
|
||||
source "drivers/staging/rtl8712/Kconfig"
|
||||
|
||||
source "drivers/staging/rtl8188eu/Kconfig"
|
||||
|
||||
@@ -6,6 +6,7 @@ obj-$(CONFIG_COMEDI) += comedi/
|
||||
obj-$(CONFIG_FB_OLPC_DCON) += olpc_dcon/
|
||||
obj-$(CONFIG_RTL8192U) += rtl8192u/
|
||||
obj-$(CONFIG_RTL8192E) += rtl8192e/
|
||||
obj-$(CONFIG_RTL8723BS) += rtl8723bs/
|
||||
obj-$(CONFIG_R8712U) += rtl8712/
|
||||
obj-$(CONFIG_R8188EU) += rtl8188eu/
|
||||
obj-$(CONFIG_RTS5208) += rts5208/
|
||||
|
||||
10
drivers/staging/rtl8723bs/Kconfig
Normal file
10
drivers/staging/rtl8723bs/Kconfig
Normal file
@@ -0,0 +1,10 @@
|
||||
config RTL8723BS
|
||||
tristate "Realtek RTL8723BS SDIO Wireless LAN NIC driver"
|
||||
depends on WLAN && MMC && CFG80211
|
||||
select WIRELESS_EXT
|
||||
select WEXT_PRIV
|
||||
---help---
|
||||
This option enables support for RTL8723BS SDIO drivers, such as
|
||||
the wifi found on the 1st gen Intel Compute Stick, the CHIP
|
||||
and many other Intel Atom and ARM based devices.
|
||||
If built as a module, it will be called r8723bs.
|
||||
70
drivers/staging/rtl8723bs/Makefile
Normal file
70
drivers/staging/rtl8723bs/Makefile
Normal file
@@ -0,0 +1,70 @@
|
||||
r8723bs-y = \
|
||||
core/rtw_ap.o \
|
||||
core/rtw_btcoex.o \
|
||||
core/rtw_cmd.o \
|
||||
core/rtw_debug.o \
|
||||
core/rtw_efuse.o \
|
||||
core/rtw_io.o \
|
||||
core/rtw_ioctl_set.o \
|
||||
core/rtw_ieee80211.o \
|
||||
core/rtw_mlme.o \
|
||||
core/rtw_mlme_ext.o \
|
||||
core/rtw_odm.o \
|
||||
core/rtw_pwrctrl.o \
|
||||
core/rtw_recv.o \
|
||||
core/rtw_rf.o \
|
||||
core/rtw_security.o \
|
||||
core/rtw_sta_mgt.o \
|
||||
core/rtw_wlan_util.o \
|
||||
core/rtw_xmit.o \
|
||||
hal/hal_intf.o \
|
||||
hal/hal_com.o \
|
||||
hal/hal_com_phycfg.o \
|
||||
hal/hal_btcoex.o \
|
||||
hal/hal_sdio.o \
|
||||
hal/Hal8723BPwrSeq.o \
|
||||
hal/HalPhyRf.o \
|
||||
hal/HalPwrSeqCmd.o \
|
||||
hal/odm.o \
|
||||
hal/odm_CfoTracking.o \
|
||||
hal/odm_debug.o \
|
||||
hal/odm_DIG.o \
|
||||
hal/odm_DynamicBBPowerSaving.o \
|
||||
hal/odm_DynamicTxPower.o \
|
||||
hal/odm_EdcaTurboCheck.o \
|
||||
hal/odm_HWConfig.o \
|
||||
hal/odm_NoiseMonitor.o \
|
||||
hal/odm_PathDiv.o \
|
||||
hal/odm_RegConfig8723B.o \
|
||||
hal/odm_RTL8723B.o \
|
||||
hal/rtl8723b_cmd.o \
|
||||
hal/rtl8723b_dm.o \
|
||||
hal/rtl8723b_hal_init.o \
|
||||
hal/rtl8723b_phycfg.o \
|
||||
hal/rtl8723b_rf6052.o \
|
||||
hal/rtl8723b_rxdesc.o \
|
||||
hal/rtl8723bs_recv.o \
|
||||
hal/rtl8723bs_xmit.o \
|
||||
hal/sdio_halinit.o \
|
||||
hal/sdio_ops.o \
|
||||
hal/HalBtc8723b1Ant.o \
|
||||
hal/HalBtc8723b2Ant.o \
|
||||
hal/HalHWImg8723B_BB.o \
|
||||
hal/HalHWImg8723B_MAC.o \
|
||||
hal/HalHWImg8723B_RF.o \
|
||||
hal/HalPhyRf_8723B.o \
|
||||
os_dep/ioctl_cfg80211.o \
|
||||
os_dep/ioctl_linux.o \
|
||||
os_dep/mlme_linux.o \
|
||||
os_dep/osdep_service.o \
|
||||
os_dep/os_intfs.o \
|
||||
os_dep/recv_linux.o \
|
||||
os_dep/rtw_proc.o \
|
||||
os_dep/sdio_intf.o \
|
||||
os_dep/sdio_ops_linux.o \
|
||||
os_dep/wifi_regd.o \
|
||||
os_dep/xmit_linux.o
|
||||
|
||||
obj-$(CONFIG_RTL8723BS) := r8723bs.o
|
||||
|
||||
ccflags-y += -I$(srctree)/$(src)/include -I$(srctree)/$(src)/hal
|
||||
16
drivers/staging/rtl8723bs/TODO
Normal file
16
drivers/staging/rtl8723bs/TODO
Normal file
@@ -0,0 +1,16 @@
|
||||
TODO:
|
||||
- find and remove code blocks guarded by never set CONFIG_FOO defines
|
||||
- find and remove remaining code valid only for 5 HGz. Most of the obvious
|
||||
ones have been removed, but things like channel > 14 still exist.
|
||||
- find and remove any code for other chips that is left over
|
||||
- convert any remaining unusual variable types
|
||||
- find codes that can use %pM and %Nph formatting
|
||||
- checkpatch.pl fixes - most of the remaining ones are lines too long. Many
|
||||
of them will require refactoring
|
||||
- merge Realtek's bugfixes and new features into the driver
|
||||
- switch to use LIB80211
|
||||
- switch to use MAC80211
|
||||
|
||||
Please send any patches to Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
|
||||
Bastien Nocera <hadess@hadess.net>, Hans de Goede <hdegoede@redhat.com>
|
||||
and Larry Finger <Larry.Finger@lwfinger.net>.
|
||||
2684
drivers/staging/rtl8723bs/core/rtw_ap.c
Normal file
2684
drivers/staging/rtl8723bs/core/rtw_ap.c
Normal file
File diff suppressed because it is too large
Load Diff
243
drivers/staging/rtl8723bs/core/rtw_btcoex.c
Normal file
243
drivers/staging/rtl8723bs/core/rtw_btcoex.c
Normal file
@@ -0,0 +1,243 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2013 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
******************************************************************************/
|
||||
#include <drv_types.h>
|
||||
#include <rtw_debug.h>
|
||||
#include <rtw_btcoex.h>
|
||||
#include <hal_btcoex.h>
|
||||
|
||||
|
||||
void rtw_btcoex_Initialize(struct adapter *padapter)
|
||||
{
|
||||
hal_btcoex_Initialize(padapter);
|
||||
}
|
||||
|
||||
void rtw_btcoex_PowerOnSetting(struct adapter *padapter)
|
||||
{
|
||||
hal_btcoex_PowerOnSetting(padapter);
|
||||
}
|
||||
|
||||
void rtw_btcoex_HAL_Initialize(struct adapter *padapter, u8 bWifiOnly)
|
||||
{
|
||||
hal_btcoex_InitHwConfig(padapter, bWifiOnly);
|
||||
}
|
||||
|
||||
void rtw_btcoex_IpsNotify(struct adapter *padapter, u8 type)
|
||||
{
|
||||
hal_btcoex_IpsNotify(padapter, type);
|
||||
}
|
||||
|
||||
void rtw_btcoex_LpsNotify(struct adapter *padapter, u8 type)
|
||||
{
|
||||
hal_btcoex_LpsNotify(padapter, type);
|
||||
}
|
||||
|
||||
void rtw_btcoex_ScanNotify(struct adapter *padapter, u8 type)
|
||||
{
|
||||
hal_btcoex_ScanNotify(padapter, type);
|
||||
}
|
||||
|
||||
void rtw_btcoex_ConnectNotify(struct adapter *padapter, u8 action)
|
||||
{
|
||||
hal_btcoex_ConnectNotify(padapter, action);
|
||||
}
|
||||
|
||||
void rtw_btcoex_MediaStatusNotify(struct adapter *padapter, u8 mediaStatus)
|
||||
{
|
||||
if ((RT_MEDIA_CONNECT == mediaStatus)
|
||||
&& (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true)) {
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_DL_RSVD_PAGE, NULL);
|
||||
}
|
||||
|
||||
hal_btcoex_MediaStatusNotify(padapter, mediaStatus);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SpecialPacketNotify(struct adapter *padapter, u8 pktType)
|
||||
{
|
||||
hal_btcoex_SpecialPacketNotify(padapter, pktType);
|
||||
}
|
||||
|
||||
void rtw_btcoex_IQKNotify(struct adapter *padapter, u8 state)
|
||||
{
|
||||
hal_btcoex_IQKNotify(padapter, state);
|
||||
}
|
||||
|
||||
void rtw_btcoex_BtInfoNotify(struct adapter *padapter, u8 length, u8 *tmpBuf)
|
||||
{
|
||||
hal_btcoex_BtInfoNotify(padapter, length, tmpBuf);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SuspendNotify(struct adapter *padapter, u8 state)
|
||||
{
|
||||
hal_btcoex_SuspendNotify(padapter, state);
|
||||
}
|
||||
|
||||
void rtw_btcoex_HaltNotify(struct adapter *padapter)
|
||||
{
|
||||
if (false == padapter->bup) {
|
||||
DBG_871X(FUNC_ADPT_FMT ": bup =%d Skip!\n",
|
||||
FUNC_ADPT_ARG(padapter), padapter->bup);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (true == padapter->bSurpriseRemoved) {
|
||||
DBG_871X(FUNC_ADPT_FMT ": bSurpriseRemoved =%d Skip!\n",
|
||||
FUNC_ADPT_ARG(padapter), padapter->bSurpriseRemoved);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
hal_btcoex_HaltNotify(padapter);
|
||||
}
|
||||
|
||||
u8 rtw_btcoex_IsBtDisabled(struct adapter *padapter)
|
||||
{
|
||||
return hal_btcoex_IsBtDisabled(padapter);
|
||||
}
|
||||
|
||||
void rtw_btcoex_Handler(struct adapter *padapter)
|
||||
{
|
||||
hal_btcoex_Hanlder(padapter);
|
||||
}
|
||||
|
||||
s32 rtw_btcoex_IsBTCoexCtrlAMPDUSize(struct adapter *padapter)
|
||||
{
|
||||
s32 coexctrl;
|
||||
|
||||
coexctrl = hal_btcoex_IsBTCoexCtrlAMPDUSize(padapter);
|
||||
|
||||
return coexctrl;
|
||||
}
|
||||
|
||||
void rtw_btcoex_SetManualControl(struct adapter *padapter, u8 manual)
|
||||
{
|
||||
if (true == manual) {
|
||||
hal_btcoex_SetManualControl(padapter, true);
|
||||
} else{
|
||||
hal_btcoex_SetManualControl(padapter, false);
|
||||
}
|
||||
}
|
||||
|
||||
u8 rtw_btcoex_IsBtControlLps(struct adapter *padapter)
|
||||
{
|
||||
return hal_btcoex_IsBtControlLps(padapter);
|
||||
}
|
||||
|
||||
u8 rtw_btcoex_IsLpsOn(struct adapter *padapter)
|
||||
{
|
||||
return hal_btcoex_IsLpsOn(padapter);
|
||||
}
|
||||
|
||||
u8 rtw_btcoex_RpwmVal(struct adapter *padapter)
|
||||
{
|
||||
return hal_btcoex_RpwmVal(padapter);
|
||||
}
|
||||
|
||||
u8 rtw_btcoex_LpsVal(struct adapter *padapter)
|
||||
{
|
||||
return hal_btcoex_LpsVal(padapter);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SetBTCoexist(struct adapter *padapter, u8 bBtExist)
|
||||
{
|
||||
hal_btcoex_SetBTCoexist(padapter, bBtExist);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SetChipType(struct adapter *padapter, u8 chipType)
|
||||
{
|
||||
hal_btcoex_SetChipType(padapter, chipType);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SetPGAntNum(struct adapter *padapter, u8 antNum)
|
||||
{
|
||||
hal_btcoex_SetPgAntNum(padapter, antNum);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SetSingleAntPath(struct adapter *padapter, u8 singleAntPath)
|
||||
{
|
||||
hal_btcoex_SetSingleAntPath(padapter, singleAntPath);
|
||||
}
|
||||
|
||||
u32 rtw_btcoex_GetRaMask(struct adapter *padapter)
|
||||
{
|
||||
return hal_btcoex_GetRaMask(padapter);
|
||||
}
|
||||
|
||||
void rtw_btcoex_RecordPwrMode(struct adapter *padapter, u8 *pCmdBuf, u8 cmdLen)
|
||||
{
|
||||
hal_btcoex_RecordPwrMode(padapter, pCmdBuf, cmdLen);
|
||||
}
|
||||
|
||||
void rtw_btcoex_DisplayBtCoexInfo(struct adapter *padapter, u8 *pbuf, u32 bufsize)
|
||||
{
|
||||
hal_btcoex_DisplayBtCoexInfo(padapter, pbuf, bufsize);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SetDBG(struct adapter *padapter, u32 *pDbgModule)
|
||||
{
|
||||
hal_btcoex_SetDBG(padapter, pDbgModule);
|
||||
}
|
||||
|
||||
u32 rtw_btcoex_GetDBG(struct adapter *padapter, u8 *pStrBuf, u32 bufSize)
|
||||
{
|
||||
return hal_btcoex_GetDBG(padapter, pStrBuf, bufSize);
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
/* Below Functions are called by BT-Coex */
|
||||
/* ================================================== */
|
||||
void rtw_btcoex_RejectApAggregatedPacket(struct adapter *padapter, u8 enable)
|
||||
{
|
||||
struct mlme_ext_info *pmlmeinfo;
|
||||
struct sta_info *psta;
|
||||
|
||||
pmlmeinfo = &padapter->mlmeextpriv.mlmext_info;
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, get_bssid(&padapter->mlmepriv));
|
||||
|
||||
if (true == enable) {
|
||||
pmlmeinfo->bAcceptAddbaReq = false;
|
||||
if (psta)
|
||||
send_delba(padapter, 0, psta->hwaddr);
|
||||
} else{
|
||||
pmlmeinfo->bAcceptAddbaReq = true;
|
||||
}
|
||||
}
|
||||
|
||||
void rtw_btcoex_LPS_Enter(struct adapter *padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv;
|
||||
u8 lpsVal;
|
||||
|
||||
|
||||
pwrpriv = adapter_to_pwrctl(padapter);
|
||||
|
||||
pwrpriv->bpower_saving = true;
|
||||
lpsVal = rtw_btcoex_LpsVal(padapter);
|
||||
rtw_set_ps_mode(padapter, PS_MODE_MIN, 0, lpsVal, "BTCOEX");
|
||||
}
|
||||
|
||||
void rtw_btcoex_LPS_Leave(struct adapter *padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv;
|
||||
|
||||
|
||||
pwrpriv = adapter_to_pwrctl(padapter);
|
||||
|
||||
if (pwrpriv->pwr_mode != PS_MODE_ACTIVE) {
|
||||
rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "BTCOEX");
|
||||
LPS_RF_ON_check(padapter, 100);
|
||||
pwrpriv->bpower_saving = false;
|
||||
}
|
||||
}
|
||||
2226
drivers/staging/rtl8723bs/core/rtw_cmd.c
Normal file
2226
drivers/staging/rtl8723bs/core/rtw_cmd.c
Normal file
File diff suppressed because it is too large
Load Diff
1453
drivers/staging/rtl8723bs/core/rtw_debug.c
Normal file
1453
drivers/staging/rtl8723bs/core/rtw_debug.c
Normal file
File diff suppressed because it is too large
Load Diff
369
drivers/staging/rtl8723bs/core/rtw_eeprom.c
Normal file
369
drivers/staging/rtl8723bs/core/rtw_eeprom.c
Normal file
@@ -0,0 +1,369 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTW_EEPROM_C_
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
|
||||
void up_clk(_adapter *padapter, u16 *x)
|
||||
{
|
||||
_func_enter_;
|
||||
*x = *x | _EESK;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)*x);
|
||||
udelay(CLOCK_RATE);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void down_clk(_adapter *padapter, u16 *x)
|
||||
{
|
||||
_func_enter_;
|
||||
*x = *x & ~_EESK;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)*x);
|
||||
udelay(CLOCK_RATE);
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
void shift_out_bits(_adapter *padapter, u16 data, u16 count)
|
||||
{
|
||||
u16 x, mask;
|
||||
_func_enter_;
|
||||
|
||||
if (padapter->bSurpriseRemoved == true) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
|
||||
goto out;
|
||||
}
|
||||
mask = 0x01 << (count - 1);
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EEDO | _EEDI);
|
||||
|
||||
do {
|
||||
x &= ~_EEDI;
|
||||
if (data & mask)
|
||||
x |= _EEDI;
|
||||
if (padapter->bSurpriseRemoved == true) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
|
||||
goto out;
|
||||
}
|
||||
rtw_write8(padapter, EE_9346CR, (u8)x);
|
||||
udelay(CLOCK_RATE);
|
||||
up_clk(padapter, &x);
|
||||
down_clk(padapter, &x);
|
||||
mask = mask >> 1;
|
||||
} while (mask);
|
||||
if (padapter->bSurpriseRemoved == true) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
|
||||
goto out;
|
||||
}
|
||||
x &= ~_EEDI;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)x);
|
||||
out:
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
u16 shift_in_bits(_adapter *padapter)
|
||||
{
|
||||
u16 x, d = 0, i;
|
||||
_func_enter_;
|
||||
if (padapter->bSurpriseRemoved == true) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
|
||||
goto out;
|
||||
}
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EEDO | _EEDI);
|
||||
d = 0;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
d = d << 1;
|
||||
up_clk(padapter, &x);
|
||||
if (padapter->bSurpriseRemoved == true) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
|
||||
goto out;
|
||||
}
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EEDI);
|
||||
if (x & _EEDO)
|
||||
d |= 1;
|
||||
|
||||
down_clk(padapter, &x);
|
||||
}
|
||||
out:
|
||||
_func_exit_;
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
void standby(_adapter *padapter)
|
||||
{
|
||||
u8 x;
|
||||
_func_enter_;
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EECS | _EESK);
|
||||
rtw_write8(padapter, EE_9346CR, x);
|
||||
|
||||
udelay(CLOCK_RATE);
|
||||
x |= _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, x);
|
||||
udelay(CLOCK_RATE);
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
u16 wait_eeprom_cmd_done(_adapter *padapter)
|
||||
{
|
||||
u8 x;
|
||||
u16 i, res = false;
|
||||
_func_enter_;
|
||||
standby(padapter);
|
||||
for (i = 0; i < 200; i++) {
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
if (x & _EEDO) {
|
||||
res = true;
|
||||
goto exit;
|
||||
}
|
||||
udelay(CLOCK_RATE);
|
||||
}
|
||||
exit:
|
||||
_func_exit_;
|
||||
return res;
|
||||
}
|
||||
|
||||
void eeprom_clean(_adapter *padapter)
|
||||
{
|
||||
u16 x;
|
||||
_func_enter_;
|
||||
if (padapter->bSurpriseRemoved == true) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
|
||||
goto out;
|
||||
}
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
if (padapter->bSurpriseRemoved == true) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
|
||||
goto out;
|
||||
}
|
||||
x &= ~(_EECS | _EEDI);
|
||||
rtw_write8(padapter, EE_9346CR, (u8)x);
|
||||
if (padapter->bSurpriseRemoved == true) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
|
||||
goto out;
|
||||
}
|
||||
up_clk(padapter, &x);
|
||||
if (padapter->bSurpriseRemoved == true) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
|
||||
goto out;
|
||||
}
|
||||
down_clk(padapter, &x);
|
||||
out:
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
void eeprom_write16(_adapter *padapter, u16 reg, u16 data)
|
||||
{
|
||||
u8 x;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
|
||||
x |= _EEM1 | _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, x);
|
||||
|
||||
shift_out_bits(padapter, EEPROM_EWEN_OPCODE, 5);
|
||||
|
||||
if (padapter->EepromAddressSize == 8) /*CF+ and SDIO*/
|
||||
shift_out_bits(padapter, 0, 6);
|
||||
else /*USB*/
|
||||
shift_out_bits(padapter, 0, 4);
|
||||
|
||||
standby(padapter);
|
||||
|
||||
/* Commented out by rcnjko, 2004.0
|
||||
* Erase this particular word. Write the erase opcode and register
|
||||
* number in that order. The opcode is 3bits in length; reg is 6 bits long.
|
||||
* shift_out_bits(Adapter, EEPROM_ERASE_OPCODE, 3);
|
||||
* shift_out_bits(Adapter, reg, Adapter->EepromAddressSize);
|
||||
*
|
||||
* if (wait_eeprom_cmd_done(Adapter ) == false)
|
||||
* {
|
||||
* return;
|
||||
* }
|
||||
*/
|
||||
|
||||
standby(padapter);
|
||||
|
||||
/* write the new word to the EEPROM*/
|
||||
|
||||
/* send the write opcode the EEPORM*/
|
||||
shift_out_bits(padapter, EEPROM_WRITE_OPCODE, 3);
|
||||
|
||||
/* select which word in the EEPROM that we are writing to.*/
|
||||
shift_out_bits(padapter, reg, padapter->EepromAddressSize);
|
||||
|
||||
/* write the data to the selected EEPROM word.*/
|
||||
shift_out_bits(padapter, data, 16);
|
||||
|
||||
if (wait_eeprom_cmd_done(padapter) == false) {
|
||||
|
||||
goto exit;
|
||||
}
|
||||
|
||||
standby(padapter);
|
||||
|
||||
shift_out_bits(padapter, EEPROM_EWDS_OPCODE, 5);
|
||||
shift_out_bits(padapter, reg, 4);
|
||||
|
||||
eeprom_clean(padapter);
|
||||
exit:
|
||||
_func_exit_;
|
||||
return;
|
||||
}
|
||||
|
||||
u16 eeprom_read16(_adapter *padapter, u16 reg) /*ReadEEprom*/
|
||||
{
|
||||
|
||||
u16 x;
|
||||
u16 data = 0;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if (padapter->bSurpriseRemoved == true) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
|
||||
goto out;
|
||||
}
|
||||
/* select EEPROM, reset bits, set _EECS*/
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
if (padapter->bSurpriseRemoved == true) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
|
||||
x |= _EEM1 | _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, (unsigned char)x);
|
||||
|
||||
/* write the read opcode and register number in that order*/
|
||||
/* The opcode is 3bits in length, reg is 6 bits long*/
|
||||
shift_out_bits(padapter, EEPROM_READ_OPCODE, 3);
|
||||
shift_out_bits(padapter, reg, padapter->EepromAddressSize);
|
||||
|
||||
/* Now read the data (16 bits) in from the selected EEPROM word*/
|
||||
data = shift_in_bits(padapter);
|
||||
|
||||
eeprom_clean(padapter);
|
||||
out:
|
||||
_func_exit_;
|
||||
return data;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*From even offset*/
|
||||
void eeprom_read_sz(_adapter *padapter, u16 reg, u8 *data, u32 sz)
|
||||
{
|
||||
|
||||
u16 x, data16;
|
||||
u32 i;
|
||||
_func_enter_;
|
||||
if (padapter->bSurpriseRemoved == true) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
|
||||
goto out;
|
||||
}
|
||||
/* select EEPROM, reset bits, set _EECS*/
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
if (padapter->bSurpriseRemoved == true) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
|
||||
x |= _EEM1 | _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, (unsigned char)x);
|
||||
|
||||
/* write the read opcode and register number in that order*/
|
||||
/* The opcode is 3bits in length, reg is 6 bits long*/
|
||||
shift_out_bits(padapter, EEPROM_READ_OPCODE, 3);
|
||||
shift_out_bits(padapter, reg, padapter->EepromAddressSize);
|
||||
|
||||
|
||||
for (i = 0; i < sz; i += 2) {
|
||||
data16 = shift_in_bits(padapter);
|
||||
data[i] = data16 & 0xff;
|
||||
data[i+1] = data16 >> 8;
|
||||
}
|
||||
|
||||
eeprom_clean(padapter);
|
||||
out:
|
||||
_func_exit_;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*addr_off : address offset of the entry in eeprom (not the tuple number of eeprom (reg); that is addr_off !=reg)*/
|
||||
u8 eeprom_read(_adapter *padapter, u32 addr_off, u8 sz, u8 *rbuf)
|
||||
{
|
||||
u8 quotient, remainder, addr_2align_odd;
|
||||
u16 reg, stmp, i = 0, idx = 0;
|
||||
_func_enter_;
|
||||
reg = (u16)(addr_off >> 1);
|
||||
addr_2align_odd = (u8)(addr_off & 0x1);
|
||||
|
||||
/*read that start at high part: e.g 1,3,5,7,9,...*/
|
||||
if (addr_2align_odd) {
|
||||
stmp = eeprom_read16(padapter, reg);
|
||||
rbuf[idx++] = (u8) ((stmp>>8)&0xff); /*return hogh-part of the short*/
|
||||
reg++; sz--;
|
||||
}
|
||||
|
||||
quotient = sz >> 1;
|
||||
remainder = sz & 0x1;
|
||||
|
||||
for (i = 0; i < quotient; i++) {
|
||||
stmp = eeprom_read16(padapter, reg+i);
|
||||
rbuf[idx++] = (u8) (stmp&0xff);
|
||||
rbuf[idx++] = (u8) ((stmp>>8)&0xff);
|
||||
}
|
||||
|
||||
reg = reg+i;
|
||||
if (remainder) { /*end of read at lower part of short : 0,2,4,6,...*/
|
||||
stmp = eeprom_read16(padapter, reg);
|
||||
rbuf[idx] = (u8)(stmp & 0xff);
|
||||
}
|
||||
_func_exit_;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void read_eeprom_content(_adapter *padapter)
|
||||
{
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
635
drivers/staging/rtl8723bs/core/rtw_efuse.c
Normal file
635
drivers/staging/rtl8723bs/core/rtw_efuse.c
Normal file
File diff suppressed because it is too large
Load Diff
1433
drivers/staging/rtl8723bs/core/rtw_ieee80211.c
Normal file
1433
drivers/staging/rtl8723bs/core/rtw_ieee80211.c
Normal file
File diff suppressed because it is too large
Load Diff
203
drivers/staging/rtl8723bs/core/rtw_io.c
Normal file
203
drivers/staging/rtl8723bs/core/rtw_io.c
Normal file
@@ -0,0 +1,203 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
|
||||
The purpose of rtw_io.c
|
||||
|
||||
a. provides the API
|
||||
|
||||
b. provides the protocol engine
|
||||
|
||||
c. provides the software interface between caller and the hardware interface
|
||||
|
||||
|
||||
Compiler Flag Option:
|
||||
|
||||
1. CONFIG_SDIO_HCI:
|
||||
a. USE_SYNC_IRP: Only sync operations are provided.
|
||||
b. USE_ASYNC_IRP:Both sync/async operations are provided.
|
||||
|
||||
jackson@realtek.com.tw
|
||||
|
||||
*/
|
||||
|
||||
#define _RTW_IO_C_
|
||||
|
||||
#include <drv_types.h>
|
||||
#include <rtw_debug.h>
|
||||
|
||||
#define rtw_le16_to_cpu(val) val
|
||||
#define rtw_le32_to_cpu(val) val
|
||||
#define rtw_cpu_to_le16(val) val
|
||||
#define rtw_cpu_to_le32(val) val
|
||||
|
||||
u8 _rtw_read8(struct adapter *adapter, u32 addr)
|
||||
{
|
||||
u8 r_val;
|
||||
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
|
||||
_read8 = pintfhdl->io_ops._read8;
|
||||
|
||||
r_val = _read8(pintfhdl, addr);
|
||||
return r_val;
|
||||
}
|
||||
|
||||
u16 _rtw_read16(struct adapter *adapter, u32 addr)
|
||||
{
|
||||
u16 r_val;
|
||||
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
|
||||
_read16 = pintfhdl->io_ops._read16;
|
||||
|
||||
r_val = _read16(pintfhdl, addr);
|
||||
return rtw_le16_to_cpu(r_val);
|
||||
}
|
||||
|
||||
u32 _rtw_read32(struct adapter *adapter, u32 addr)
|
||||
{
|
||||
u32 r_val;
|
||||
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
|
||||
_read32 = pintfhdl->io_ops._read32;
|
||||
|
||||
r_val = _read32(pintfhdl, addr);
|
||||
return rtw_le32_to_cpu(r_val);
|
||||
|
||||
}
|
||||
|
||||
int _rtw_write8(struct adapter *adapter, u32 addr, u8 val)
|
||||
{
|
||||
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
|
||||
int ret;
|
||||
|
||||
_write8 = pintfhdl->io_ops._write8;
|
||||
|
||||
ret = _write8(pintfhdl, addr, val);
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_write16(struct adapter *adapter, u32 addr, u16 val)
|
||||
{
|
||||
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
|
||||
int ret;
|
||||
|
||||
_write16 = pintfhdl->io_ops._write16;
|
||||
|
||||
ret = _write16(pintfhdl, addr, val);
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_write32(struct adapter *adapter, u32 addr, u32 val)
|
||||
{
|
||||
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
|
||||
int ret;
|
||||
|
||||
_write32 = pintfhdl->io_ops._write32;
|
||||
|
||||
ret = _write32(pintfhdl, addr, val);
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
|
||||
u8 _rtw_sd_f0_read8(struct adapter *adapter, u32 addr)
|
||||
{
|
||||
u8 r_val = 0x00;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u8 (*_sd_f0_read8)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
|
||||
_sd_f0_read8 = pintfhdl->io_ops._sd_f0_read8;
|
||||
|
||||
if (_sd_f0_read8)
|
||||
r_val = _sd_f0_read8(pintfhdl, addr);
|
||||
else
|
||||
DBG_871X_LEVEL(_drv_warning_, FUNC_ADPT_FMT" _sd_f0_read8 callback is NULL\n", FUNC_ADPT_ARG(adapter));
|
||||
|
||||
return r_val;
|
||||
}
|
||||
|
||||
u32 _rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u32 ret = _SUCCESS;
|
||||
|
||||
_write_port = pintfhdl->io_ops._write_port;
|
||||
|
||||
ret = _write_port(pintfhdl, addr, cnt, pmem);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct adapter *padapter, struct _io_ops *pops))
|
||||
{
|
||||
struct io_priv *piopriv = &padapter->iopriv;
|
||||
struct intf_hdl *pintf = &piopriv->intf;
|
||||
|
||||
if (set_intf_ops == NULL)
|
||||
return _FAIL;
|
||||
|
||||
piopriv->padapter = padapter;
|
||||
pintf->padapter = padapter;
|
||||
pintf->pintf_dev = adapter_to_dvobj(padapter);
|
||||
|
||||
set_intf_ops(padapter, &pintf->io_ops);
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Increase and check if the continual_io_error of this @param dvobjprive is larger than MAX_CONTINUAL_IO_ERR
|
||||
* @return true:
|
||||
* @return false:
|
||||
*/
|
||||
int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
|
||||
{
|
||||
int ret = false;
|
||||
int value = atomic_inc_return(&dvobj->continual_io_error);
|
||||
if (value > MAX_CONTINUAL_IO_ERR) {
|
||||
DBG_871X("[dvobj:%p][ERROR] continual_io_error:%d > %d\n", dvobj, value, MAX_CONTINUAL_IO_ERR);
|
||||
ret = true;
|
||||
} else {
|
||||
/* DBG_871X("[dvobj:%p] continual_io_error:%d\n", dvobj, value); */
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the continual_io_error of this @param dvobjprive to 0
|
||||
*/
|
||||
void rtw_reset_continual_io_error(struct dvobj_priv *dvobj)
|
||||
{
|
||||
atomic_set(&dvobj->continual_io_error, 0);
|
||||
}
|
||||
696
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
Normal file
696
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
Normal file
File diff suppressed because it is too large
Load Diff
3155
drivers/staging/rtl8723bs/core/rtw_mlme.c
Normal file
3155
drivers/staging/rtl8723bs/core/rtw_mlme.c
Normal file
File diff suppressed because it is too large
Load Diff
6940
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
Normal file
6940
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
Normal file
File diff suppressed because it is too large
Load Diff
195
drivers/staging/rtl8723bs/core/rtw_odm.c
Normal file
195
drivers/staging/rtl8723bs/core/rtw_odm.c
Normal file
@@ -0,0 +1,195 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2013 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include <drv_types.h>
|
||||
#include <rtw_debug.h>
|
||||
#include <rtw_odm.h>
|
||||
#include <hal_data.h>
|
||||
|
||||
static const char *odm_comp_str[] = {
|
||||
/* BIT0 */"ODM_COMP_DIG",
|
||||
/* BIT1 */"ODM_COMP_RA_MASK",
|
||||
/* BIT2 */"ODM_COMP_DYNAMIC_TXPWR",
|
||||
/* BIT3 */"ODM_COMP_FA_CNT",
|
||||
/* BIT4 */"ODM_COMP_RSSI_MONITOR",
|
||||
/* BIT5 */"ODM_COMP_CCK_PD",
|
||||
/* BIT6 */"ODM_COMP_ANT_DIV",
|
||||
/* BIT7 */"ODM_COMP_PWR_SAVE",
|
||||
/* BIT8 */"ODM_COMP_PWR_TRAIN",
|
||||
/* BIT9 */"ODM_COMP_RATE_ADAPTIVE",
|
||||
/* BIT10 */"ODM_COMP_PATH_DIV",
|
||||
/* BIT11 */"ODM_COMP_PSD",
|
||||
/* BIT12 */"ODM_COMP_DYNAMIC_PRICCA",
|
||||
/* BIT13 */"ODM_COMP_RXHP",
|
||||
/* BIT14 */"ODM_COMP_MP",
|
||||
/* BIT15 */"ODM_COMP_DYNAMIC_ATC",
|
||||
/* BIT16 */"ODM_COMP_EDCA_TURBO",
|
||||
/* BIT17 */"ODM_COMP_EARLY_MODE",
|
||||
/* BIT18 */NULL,
|
||||
/* BIT19 */NULL,
|
||||
/* BIT20 */NULL,
|
||||
/* BIT21 */NULL,
|
||||
/* BIT22 */NULL,
|
||||
/* BIT23 */NULL,
|
||||
/* BIT24 */"ODM_COMP_TX_PWR_TRACK",
|
||||
/* BIT25 */"ODM_COMP_RX_GAIN_TRACK",
|
||||
/* BIT26 */"ODM_COMP_CALIBRATION",
|
||||
/* BIT27 */NULL,
|
||||
/* BIT28 */NULL,
|
||||
/* BIT29 */NULL,
|
||||
/* BIT30 */"ODM_COMP_COMMON",
|
||||
/* BIT31 */"ODM_COMP_INIT",
|
||||
};
|
||||
|
||||
#define RTW_ODM_COMP_MAX 32
|
||||
|
||||
static const char *odm_ability_str[] = {
|
||||
/* BIT0 */"ODM_BB_DIG",
|
||||
/* BIT1 */"ODM_BB_RA_MASK",
|
||||
/* BIT2 */"ODM_BB_DYNAMIC_TXPWR",
|
||||
/* BIT3 */"ODM_BB_FA_CNT",
|
||||
/* BIT4 */"ODM_BB_RSSI_MONITOR",
|
||||
/* BIT5 */"ODM_BB_CCK_PD",
|
||||
/* BIT6 */"ODM_BB_ANT_DIV",
|
||||
/* BIT7 */"ODM_BB_PWR_SAVE",
|
||||
/* BIT8 */"ODM_BB_PWR_TRAIN",
|
||||
/* BIT9 */"ODM_BB_RATE_ADAPTIVE",
|
||||
/* BIT10 */"ODM_BB_PATH_DIV",
|
||||
/* BIT11 */"ODM_BB_PSD",
|
||||
/* BIT12 */"ODM_BB_RXHP",
|
||||
/* BIT13 */"ODM_BB_ADAPTIVITY",
|
||||
/* BIT14 */"ODM_BB_DYNAMIC_ATC",
|
||||
/* BIT15 */NULL,
|
||||
/* BIT16 */"ODM_MAC_EDCA_TURBO",
|
||||
/* BIT17 */"ODM_MAC_EARLY_MODE",
|
||||
/* BIT18 */NULL,
|
||||
/* BIT19 */NULL,
|
||||
/* BIT20 */NULL,
|
||||
/* BIT21 */NULL,
|
||||
/* BIT22 */NULL,
|
||||
/* BIT23 */NULL,
|
||||
/* BIT24 */"ODM_RF_TX_PWR_TRACK",
|
||||
/* BIT25 */"ODM_RF_RX_GAIN_TRACK",
|
||||
/* BIT26 */"ODM_RF_CALIBRATION",
|
||||
};
|
||||
|
||||
#define RTW_ODM_ABILITY_MAX 27
|
||||
|
||||
static const char *odm_dbg_level_str[] = {
|
||||
NULL,
|
||||
"ODM_DBG_OFF",
|
||||
"ODM_DBG_SERIOUS",
|
||||
"ODM_DBG_WARNING",
|
||||
"ODM_DBG_LOUD",
|
||||
"ODM_DBG_TRACE",
|
||||
};
|
||||
|
||||
#define RTW_ODM_DBG_LEVEL_NUM 6
|
||||
|
||||
void rtw_odm_dbg_comp_msg(void *sel, struct adapter *adapter)
|
||||
{
|
||||
u64 dbg_comp;
|
||||
int i;
|
||||
|
||||
rtw_hal_get_def_var(adapter, HW_DEF_ODM_DBG_FLAG, &dbg_comp);
|
||||
DBG_871X_SEL_NL(sel, "odm.DebugComponents = 0x%016llx\n", dbg_comp);
|
||||
for (i = 0; i < RTW_ODM_COMP_MAX; i++) {
|
||||
if (odm_comp_str[i])
|
||||
DBG_871X_SEL_NL(sel, "%cBIT%-2d %s\n",
|
||||
(BIT0 << i) & dbg_comp ? '+' : ' ', i, odm_comp_str[i]);
|
||||
}
|
||||
}
|
||||
|
||||
inline void rtw_odm_dbg_comp_set(struct adapter *adapter, u64 comps)
|
||||
{
|
||||
rtw_hal_set_def_var(adapter, HW_DEF_ODM_DBG_FLAG, &comps);
|
||||
}
|
||||
|
||||
void rtw_odm_dbg_level_msg(void *sel, struct adapter *adapter)
|
||||
{
|
||||
u32 dbg_level;
|
||||
int i;
|
||||
|
||||
rtw_hal_get_def_var(adapter, HW_DEF_ODM_DBG_LEVEL, &dbg_level);
|
||||
DBG_871X_SEL_NL(sel, "odm.DebugLevel = %u\n", dbg_level);
|
||||
for (i = 0; i < RTW_ODM_DBG_LEVEL_NUM; i++) {
|
||||
if (odm_dbg_level_str[i])
|
||||
DBG_871X_SEL_NL(sel, "%u %s\n", i, odm_dbg_level_str[i]);
|
||||
}
|
||||
}
|
||||
|
||||
inline void rtw_odm_dbg_level_set(struct adapter *adapter, u32 level)
|
||||
{
|
||||
rtw_hal_set_def_var(adapter, HW_DEF_ODM_DBG_LEVEL, &level);
|
||||
}
|
||||
|
||||
void rtw_odm_ability_msg(void *sel, struct adapter *adapter)
|
||||
{
|
||||
u32 ability = 0;
|
||||
int i;
|
||||
|
||||
rtw_hal_get_hwreg(adapter, HW_VAR_DM_FLAG, (u8 *)&ability);
|
||||
DBG_871X_SEL_NL(sel, "odm.SupportAbility = 0x%08x\n", ability);
|
||||
for (i = 0; i < RTW_ODM_ABILITY_MAX; i++) {
|
||||
if (odm_ability_str[i])
|
||||
DBG_871X_SEL_NL(sel, "%cBIT%-2d %s\n",
|
||||
(BIT0 << i) & ability ? '+' : ' ', i, odm_ability_str[i]);
|
||||
}
|
||||
}
|
||||
|
||||
inline void rtw_odm_ability_set(struct adapter *adapter, u32 ability)
|
||||
{
|
||||
rtw_hal_set_hwreg(adapter, HW_VAR_DM_FLAG, (u8 *)&ability);
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_parm_msg(void *sel, struct adapter *adapter)
|
||||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &pHalData->odmpriv;
|
||||
|
||||
DBG_871X_SEL_NL(sel, "%10s %16s %8s %10s %11s %14s\n"
|
||||
, "TH_L2H_ini", "TH_EDCCA_HL_diff", "IGI_Base", "ForceEDCCA", "AdapEn_RSSI", "IGI_LowerBound");
|
||||
DBG_871X_SEL_NL(sel, "0x%-8x %-16d 0x%-6x %-10d %-11u %-14u\n"
|
||||
, (u8)odm->TH_L2H_ini
|
||||
, odm->TH_EDCCA_HL_diff
|
||||
, odm->IGI_Base
|
||||
, odm->ForceEDCCA
|
||||
, odm->AdapEn_RSSI
|
||||
, odm->IGI_LowerBound
|
||||
);
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_parm_set(struct adapter *adapter, s8 TH_L2H_ini, s8 TH_EDCCA_HL_diff,
|
||||
s8 IGI_Base, bool ForceEDCCA, u8 AdapEn_RSSI, u8 IGI_LowerBound)
|
||||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &pHalData->odmpriv;
|
||||
|
||||
odm->TH_L2H_ini = TH_L2H_ini;
|
||||
odm->TH_EDCCA_HL_diff = TH_EDCCA_HL_diff;
|
||||
odm->IGI_Base = IGI_Base;
|
||||
odm->ForceEDCCA = ForceEDCCA;
|
||||
odm->AdapEn_RSSI = AdapEn_RSSI;
|
||||
odm->IGI_LowerBound = IGI_LowerBound;
|
||||
}
|
||||
|
||||
void rtw_odm_get_perpkt_rssi(void *sel, struct adapter *adapter)
|
||||
{
|
||||
struct hal_com_data *hal_data = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &(hal_data->odmpriv);
|
||||
|
||||
DBG_871X_SEL_NL(sel, "RxRate = %s, RSSI_A = %d(%%), RSSI_B = %d(%%)\n",
|
||||
HDATA_RATE(odm->RxRate), odm->RSSI_A, odm->RSSI_B);
|
||||
}
|
||||
1421
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
Normal file
1421
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
Normal file
File diff suppressed because it is too large
Load Diff
2693
drivers/staging/rtl8723bs/core/rtw_recv.c
Normal file
2693
drivers/staging/rtl8723bs/core/rtw_recv.c
Normal file
File diff suppressed because it is too large
Load Diff
64
drivers/staging/rtl8723bs/core/rtw_rf.c
Normal file
64
drivers/staging/rtl8723bs/core/rtw_rf.c
Normal file
@@ -0,0 +1,64 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTW_RF_C_
|
||||
|
||||
#include <drv_types.h>
|
||||
|
||||
|
||||
struct ch_freq {
|
||||
u32 channel;
|
||||
u32 frequency;
|
||||
};
|
||||
|
||||
static struct ch_freq ch_freq_map[] = {
|
||||
{1, 2412}, {2, 2417}, {3, 2422}, {4, 2427}, {5, 2432},
|
||||
{6, 2437}, {7, 2442}, {8, 2447}, {9, 2452}, {10, 2457},
|
||||
{11, 2462}, {12, 2467}, {13, 2472}, {14, 2484},
|
||||
/* UNII */
|
||||
{36, 5180}, {40, 5200}, {44, 5220}, {48, 5240}, {52, 5260},
|
||||
{56, 5280}, {60, 5300}, {64, 5320}, {149, 5745}, {153, 5765},
|
||||
{157, 5785}, {161, 5805}, {165, 5825}, {167, 5835}, {169, 5845},
|
||||
{171, 5855}, {173, 5865},
|
||||
/* HiperLAN2 */
|
||||
{100, 5500}, {104, 5520}, {108, 5540}, {112, 5560}, {116, 5580},
|
||||
{120, 5600}, {124, 5620}, {128, 5640}, {132, 5660}, {136, 5680},
|
||||
{140, 5700},
|
||||
/* Japan MMAC */
|
||||
{34, 5170}, {38, 5190}, {42, 5210}, {46, 5230},
|
||||
/* Japan */
|
||||
{184, 4920}, {188, 4940}, {192, 4960}, {196, 4980},
|
||||
{208, 5040},/* Japan, means J08 */
|
||||
{212, 5060},/* Japan, means J12 */
|
||||
{216, 5080},/* Japan, means J16 */
|
||||
};
|
||||
|
||||
static int ch_freq_map_num = (sizeof(ch_freq_map) / sizeof(struct ch_freq));
|
||||
|
||||
u32 rtw_ch2freq(u32 channel)
|
||||
{
|
||||
u8 i;
|
||||
u32 freq = 0;
|
||||
|
||||
for (i = 0; i < ch_freq_map_num; i++) {
|
||||
if (channel == ch_freq_map[i].channel) {
|
||||
freq = ch_freq_map[i].frequency;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == ch_freq_map_num)
|
||||
freq = 2412;
|
||||
|
||||
return freq;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user