rtl8188eu: Remove all conditional code for devices other than RTL8188EU

This commit handles os_dep and Makefile

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2014-12-16 18:13:14 -06:00
parent bfc1e57860
commit 7892bc7329
4 changed files with 2 additions and 592 deletions

116
Makefile
View file

@ -1,11 +1,5 @@
EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS) EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
EXTRA_CFLAGS += -O1 EXTRA_CFLAGS += -O1
#EXTRA_CFLAGS += -O3
#EXTRA_CFLAGS += -Wall
#EXTRA_CFLAGS += -Wextra
#EXTRA_CFLAGS += -Werror
#EXTRA_CFLAGS += -pedantic
#EXTRA_CFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
EXTRA_CFLAGS += -Wno-unused-variable EXTRA_CFLAGS += -Wno-unused-variable
EXTRA_CFLAGS += -Wno-unused-value EXTRA_CFLAGS += -Wno-unused-value
@ -20,11 +14,6 @@ EXTRA_CFLAGS += -I$(src)/include
ccflags-y += -D__CHECK_ENDIAN__ ccflags-y += -D__CHECK_ENDIAN__
CONFIG_AUTOCFG_CP = y
CONFIG_RTL8192C = n
CONFIG_RTL8192D = n
CONFIG_RTL8723A = n
CONFIG_RTL8188E = y CONFIG_RTL8188E = y
CONFIG_USB_HCI = y CONFIG_USB_HCI = y
@ -37,7 +26,6 @@ CONFIG_USB_AUTOSUSPEND = n
CONFIG_HW_PWRP_DETECTION = n CONFIG_HW_PWRP_DETECTION = n
CONFIG_WIFI_TEST = n CONFIG_WIFI_TEST = n
CONFIG_BT_COEXIST = n CONFIG_BT_COEXIST = n
CONFIG_RTL8192CU_REDEFINE_1X1 = n
CONFIG_INTEL_WIDI = n CONFIG_INTEL_WIDI = n
CONFIG_WAPI_SUPPORT = n CONFIG_WAPI_SUPPORT = n
CONFIG_EFUSE_CONFIG_FILE = n CONFIG_EFUSE_CONFIG_FILE = n
@ -95,107 +83,6 @@ OUTSRC_FILES := hal/OUTSRC/odm_debug.o \
hal/OUTSRC/odm.o\ hal/OUTSRC/odm.o\
hal/OUTSRC/HalPhyRf.o hal/OUTSRC/HalPhyRf.o
ifeq ($(CONFIG_RTL8192C), y)
RTL871X = rtl8192c
ifeq ($(CONFIG_USB_HCI), y)
MODULE_NAME = 8192cu
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8192CUFWImg_CE.o \
hal/OUTSRC/$(RTL871X)/Hal8192CUPHYImg_CE.o \
hal/OUTSRC/$(RTL871X)/Hal8192CUMACImg_CE.o
endif
ifeq ($(CONFIG_PCI_HCI), y)
MODULE_NAME = 8192ce
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8192CEFWImg_CE.o \
hal/OUTSRC/$(RTL871X)/Hal8192CEPHYImg_CE.o \
hal/OUTSRC/$(RTL871X)/Hal8192CEMACImg_CE.o
endif
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/odm_RTL8192C.o\
hal/OUTSRC/$(RTL871X)/HalDMOutSrc8192C_CE.o
CHIP_FILES := \
hal/$(RTL871X)/$(RTL871X)_sreset.o \
hal/$(RTL871X)/$(RTL871X)_xmit.o
CHIP_FILES += $(OUTSRC_FILES)
endif
ifeq ($(CONFIG_RTL8192D), y)
RTL871X = rtl8192d
ifeq ($(CONFIG_USB_HCI), y)
MODULE_NAME = 8192du
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8192DUFWImg_CE.o \
hal/OUTSRC/$(RTL871X)/Hal8192DUPHYImg_CE.o \
hal/OUTSRC/$(RTL871X)/Hal8192DUMACImg_CE.o
endif
ifeq ($(CONFIG_PCI_HCI), y)
MODULE_NAME = 8192de
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8192DEFWImg_CE.o \
hal/OUTSRC/$(RTL871X)/Hal8192DEPHYImg_CE.o \
hal/OUTSRC/$(RTL871X)/Hal8192DEMACImg_CE.o
endif
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/odm_RTL8192D.o\
hal/OUTSRC/$(RTL871X)/HalDMOutSrc8192D_CE.o
CHIP_FILES := \
hal/$(RTL871X)/$(RTL871X)_xmit.o
CHIP_FILES += $(OUTSRC_FILES)
endif
ifeq ($(CONFIG_RTL8723A), y)
RTL871X = rtl8723a
HAL_COMM_FILES := hal/$(RTL871X)/$(RTL871X)_xmit.o \
hal/$(RTL871X)/$(RTL871X)_sreset.o
ifeq ($(CONFIG_GSPI_HCI), y)
MODULE_NAME = 8723as
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8723SHWImg_CE.o
endif
ifeq ($(CONFIG_SDIO_HCI), y)
MODULE_NAME = 8723as
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8723SHWImg_CE.o
endif
ifeq ($(CONFIG_USB_HCI), y)
MODULE_NAME = 8723au
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8723UHWImg_CE.o
endif
ifeq ($(CONFIG_PCI_HCI), y)
MODULE_NAME = 8723ae
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8723EHWImg_CE.o
endif
#hal/OUTSRC/$(RTL871X)/HalHWImg8723A_FW.o
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8723A_BB.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8723A_MAC.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8723A_RF.o\
hal/OUTSRC/$(RTL871X)/odm_RegConfig8723A.o
OUTSRC_FILES += hal/OUTSRC/rtl8192c/HalDMOutSrc8192C_CE.o
clean_more ?=
clean_more += clean_odm-8192c
PWRSEQ_FILES := hal/HalPwrSeqCmd.o \
hal/$(RTL871X)/Hal8723PwrSeq.o
CHIP_FILES += $(HAL_COMM_FILES) $(OUTSRC_FILES) $(PWRSEQ_FILES)
ifeq ($(CONFIG_BT_COEXIST), y)
CHIP_FILES += hal/$(RTL871X)/rtl8723a_bt-coexist.o
endif
endif
ifeq ($(CONFIG_RTL8188E), y)
RTL871X = rtl8188e RTL871X = rtl8188e
HAL_COMM_FILES := hal/$(RTL871X)/$(RTL871X)_xmit.o\ HAL_COMM_FILES := hal/$(RTL871X)/$(RTL871X)_xmit.o\
hal/$(RTL871X)/$(RTL871X)_sreset.o hal/$(RTL871X)/$(RTL871X)_sreset.o
@ -233,9 +120,6 @@ PWRSEQ_FILES := hal/HalPwrSeqCmd.o \
CHIP_FILES += $(HAL_COMM_FILES) $(OUTSRC_FILES) $(PWRSEQ_FILES) CHIP_FILES += $(HAL_COMM_FILES) $(OUTSRC_FILES) $(PWRSEQ_FILES)
endif
ifeq ($(CONFIG_GSPI_HCI), y) ifeq ($(CONFIG_GSPI_HCI), y)
HCI_NAME = gspi HCI_NAME = gspi
endif endif

View file

@ -38,31 +38,11 @@
#endif //CONFIG_USB_HCI #endif //CONFIG_USB_HCI
#include <rtw_version.h> #include <rtw_version.h>
#ifdef CONFIG_RTL8192C
#include <rtl8192c_hal.h>
#endif
#ifdef CONFIG_RTL8192D
#include <rtl8192d_hal.h>
#endif
#ifdef CONFIG_RTL8723A
#include <rtl8723a_pg.h>
#include <rtl8723a_hal.h>
#include <rtw_bt_mp.h>
#endif
#ifdef CONFIG_RTL8188E
#include <rtl8188e_hal.h> #include <rtl8188e_hal.h>
#endif
#ifdef CONFIG_GSPI_HCI #ifdef CONFIG_GSPI_HCI
#include <gspi_ops.h> #include <gspi_ops.h>
#endif #endif
#ifdef CONFIG_RTL8723A
//extern u8 _InitPowerOn(PADAPTER padapter);
//extern s32 rtl8723a_FirmwareDownload(PADAPTER padapter);
extern s32 FillH2CCmd(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer);
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27))
#define iwe_stream_add_event(a, b, c, d, e) iwe_stream_add_event(b, c, d, e) #define iwe_stream_add_event(a, b, c, d, e) iwe_stream_add_event(b, c, d, e)
#define iwe_stream_add_point(a, b, c, d, e) iwe_stream_add_point(b, c, d, e) #define iwe_stream_add_point(a, b, c, d, e) iwe_stream_add_point(b, c, d, e)
@ -9325,31 +9305,11 @@ static int rtw_mp_efuse_get(struct net_device *dev,
} }
else if (strcmp(tmp[0], "mac") == 0) else if (strcmp(tmp[0], "mac") == 0)
{ {
#ifdef CONFIG_RTL8192C
addr = 0x16; // EEPROM_MAC_ADDR
#endif
#ifdef CONFIG_RTL8192D
addr = 0x19;
#endif
#ifdef CONFIG_RTL8723A
#ifdef CONFIG_SDIO_HCI
addr = EEPROM_MAC_ADDR_8723AS;
#endif
#ifdef CONFIG_GSPI_HCI
addr = EEPROM_MAC_ADDR_8723AS;
#endif
#ifdef CONFIG_USB_HCI
addr = EEPROM_MAC_ADDR_8723AU;
#endif
#endif // CONFIG_RTL8723A
#ifdef CONFIG_RTL8188E
#ifdef CONFIG_SDIO_HCI #ifdef CONFIG_SDIO_HCI
addr = EEPROM_MAC_ADDR_88ES; addr = EEPROM_MAC_ADDR_88ES;
#else #else
addr = EEPROM_MAC_ADDR_88EU; addr = EEPROM_MAC_ADDR_88EU;
#endif #endif
#endif
cnts = 6; cnts = 6;
@ -9383,15 +9343,6 @@ static int rtw_mp_efuse_get(struct net_device *dev,
} }
else if (strcmp(tmp[0], "vidpid") == 0) else if (strcmp(tmp[0], "vidpid") == 0)
{ {
#ifdef CONFIG_RTL8192C
addr = 0x0a; // EEPROM_VID
#endif
#ifdef CONFIG_RTL8192D
addr = 0x0c;
#endif
#ifdef CONFIG_RTL8723A
addr = EEPROM_VID_8723AU;
#endif
cnts = 4; cnts = 4;
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_available_size, _FALSE); EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_available_size, _FALSE);
@ -9801,12 +9752,8 @@ static int rtw_mp_efuse_set(struct net_device *dev,
{ {
setdata[jj] = key_2char2num(tmp[2][kk], tmp[2][kk+1]); setdata[jj] = key_2char2num(tmp[2][kk], tmp[2][kk+1]);
} }
#ifndef CONFIG_RTL8188E
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_available_size, _FALSE);
#else
//Change to check TYPE_EFUSE_MAP_LEN ,beacuse 8188E raw 256,logic map over 256. //Change to check TYPE_EFUSE_MAP_LEN ,beacuse 8188E raw 256,logic map over 256.
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (PVOID)&max_available_size, _FALSE); EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (PVOID)&max_available_size, _FALSE);
#endif
if ((addr+cnts) > max_available_size) if ((addr+cnts) > max_available_size)
{ {
DBG_871X("%s: addr(0x%X)+cnts(%d) parameter error!\n", __FUNCTION__, addr, cnts); DBG_871X("%s: addr(0x%X)+cnts(%d) parameter error!\n", __FUNCTION__, addr, cnts);
@ -9870,24 +9817,6 @@ static int rtw_mp_efuse_set(struct net_device *dev,
} }
//mac,00e04c871200 //mac,00e04c871200
#ifdef CONFIG_RTL8192C
addr = 0x16;
#endif
#ifdef CONFIG_RTL8192D
addr = 0x19;
#endif
#ifdef CONFIG_RTL8723A
#ifdef CONFIG_SDIO_HCI
addr = EEPROM_MAC_ADDR_8723AS;
#endif
#ifdef CONFIG_GSPI_HCI
addr = EEPROM_MAC_ADDR_8723AS;
#endif
#ifdef CONFIG_USB_HCI
addr = EEPROM_MAC_ADDR_8723AU;
#endif
#endif // CONFIG_RTL8723A
#ifdef CONFIG_RTL8188E
#ifdef CONFIG_USB_HCI #ifdef CONFIG_USB_HCI
addr = EEPROM_MAC_ADDR_88EU; addr = EEPROM_MAC_ADDR_88EU;
#endif #endif
@ -9897,7 +9826,6 @@ static int rtw_mp_efuse_set(struct net_device *dev,
#ifdef CONFIG_PCI_HCI #ifdef CONFIG_PCI_HCI
addr = EEPROM_MAC_ADDR_88EE; addr = EEPROM_MAC_ADDR_88EE;
#endif #endif
#endif //#ifdef CONFIG_RTL8188E
cnts = strlen(tmp[1]); cnts = strlen(tmp[1]);
if (cnts%2) if (cnts%2)
@ -9926,12 +9854,8 @@ static int rtw_mp_efuse_set(struct net_device *dev,
{ {
setdata[jj] = key_2char2num(tmp[1][kk], tmp[1][kk+1]); setdata[jj] = key_2char2num(tmp[1][kk], tmp[1][kk+1]);
} }
#ifndef CONFIG_RTL8188E
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_available_size, _FALSE);
#else
//Change to check TYPE_EFUSE_MAP_LEN ,beacuse 8188E raw 256,logic map over 256. //Change to check TYPE_EFUSE_MAP_LEN ,beacuse 8188E raw 256,logic map over 256.
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (PVOID)&max_available_size, _FALSE); EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (PVOID)&max_available_size, _FALSE);
#endif
if ((addr+cnts) > max_available_size) if ((addr+cnts) > max_available_size)
{ {
DBG_871X("%s: addr(0x%X)+cnts(%d) parameter error!\n", __FUNCTION__, addr, cnts); DBG_871X("%s: addr(0x%X)+cnts(%d) parameter error!\n", __FUNCTION__, addr, cnts);
@ -9954,24 +9878,12 @@ static int rtw_mp_efuse_set(struct net_device *dev,
goto exit; goto exit;
} }
// pidvid,da0b7881
#ifdef CONFIG_RTL8192C
addr = 0x0a;
#endif
#ifdef CONFIG_RTL8192D
addr = 0x0c;
#endif
#ifdef CONFIG_RTL8723A
addr = EEPROM_VID_8723AU;
#endif
#ifdef CONFIG_RTL8188E
#ifdef CONFIG_USB_HCI #ifdef CONFIG_USB_HCI
addr = EEPROM_VID_88EE; addr = EEPROM_VID_88EE;
#endif #endif
#ifdef CONFIG_PCI_HCI #ifdef CONFIG_PCI_HCI
addr = EEPROM_VID_88EE; addr = EEPROM_VID_88EE;
#endif #endif
#endif //#ifdef CONFIG_RTL8188E
cnts = strlen(tmp[1]); cnts = strlen(tmp[1]);
if (cnts%2) if (cnts%2)
{ {
@ -10882,12 +10794,6 @@ static int rtw_widi_set_probe_request(struct net_device *dev,
#ifdef CONFIG_MAC_LOOPBACK_DRIVER #ifdef CONFIG_MAC_LOOPBACK_DRIVER
#ifdef CONFIG_RTL8723A
extern void rtl8723a_cal_txdesc_chksum(struct tx_desc *ptxdesc);
#define cal_txdesc_chksum rtl8723a_cal_txdesc_chksum
extern void rtl8723a_fill_default_txdesc(struct xmit_frame *pxmitframe, u8 *pbuf);
#define fill_default_txdesc rtl8723a_fill_default_txdesc
#elif defined(CONFIG_RTL8188E)
#include <rtl8188e_hal.h> #include <rtl8188e_hal.h>
extern void rtl8188e_cal_txdesc_chksum(struct tx_desc *ptxdesc); extern void rtl8188e_cal_txdesc_chksum(struct tx_desc *ptxdesc);
#define cal_txdesc_chksum rtl8188e_cal_txdesc_chksum #define cal_txdesc_chksum rtl8188e_cal_txdesc_chksum
@ -10895,7 +10801,6 @@ extern void rtl8188e_cal_txdesc_chksum(struct tx_desc *ptxdesc);
extern void rtl8188es_fill_default_txdesc(struct xmit_frame *pxmitframe, u8 *pbuf); extern void rtl8188es_fill_default_txdesc(struct xmit_frame *pxmitframe, u8 *pbuf);
#define fill_default_txdesc rtl8188es_fill_default_txdesc #define fill_default_txdesc rtl8188es_fill_default_txdesc
#endif // CONFIG_SDIO_HCI #endif // CONFIG_SDIO_HCI
#endif // CONFIG_RTL8188E
static s32 initLoopback(PADAPTER padapter) static s32 initLoopback(PADAPTER padapter)
{ {
@ -11488,115 +11393,6 @@ static int rtw_test(
} }
#endif #endif
#ifdef CONFIG_RTL8723A
#if 0
if (strcmp(pch, "poweron") == 0)
{
s32 ret;
ret = _InitPowerOn(padapter);
DBG_871X("%s: power on %s\n", __func__, (_FAIL==ret) ? "FAIL!":"OK.");
sprintf(extra, "Power ON %s", (_FAIL==ret) ? "FAIL!":"OK.");
wrqu->data.length = strlen(extra) + 1;
rtw_mfree(pbuf, len);
return 0;
}
if (strcmp(pch, "dlfw") == 0)
{
s32 ret;
ret = rtl8723a_FirmwareDownload(padapter);
DBG_871X("%s: download FW %s\n", __func__, (_FAIL==ret) ? "FAIL!":"OK.");
sprintf(extra, "download FW %s", (_FAIL==ret) ? "FAIL!":"OK.");
wrqu->data.length = strlen(extra) + 1;
rtw_mfree(pbuf, len);
return 0;
}
#endif
#ifdef CONFIG_BT_COEXIST
#define GET_BT_INFO(padapter) (&GET_HAL_DATA(padapter)->BtInfo)
if (strcmp(pch, "btdbg") == 0)
{
DBG_8192C("===== BT debug information Start =====\n");
DBG_8192C("WIFI status=\n");
DBG_8192C("BT status=\n");
DBG_8192C("BT profile=\n");
DBG_8192C("WIFI RSSI=%d\n", GET_HAL_DATA(padapter)->dmpriv.UndecoratedSmoothedPWDB);
DBG_8192C("BT RSSI=\n");
DBG_8192C("coex mechanism=\n");
DBG_8192C("BT counter TX/RX=/\n");
DBG_8192C("0x880=0x%08x\n", rtw_read32(padapter, 0x880));
DBG_8192C("0x6c0=0x%08x\n", rtw_read32(padapter, 0x6c0));
DBG_8192C("0x6c4=0x%08x\n", rtw_read32(padapter, 0x6c4));
DBG_8192C("0x6c8=0x%08x\n", rtw_read32(padapter, 0x6c8));
DBG_8192C("0x6cc=0x%08x\n", rtw_read32(padapter, 0x6cc));
DBG_8192C("0x778=0x%08x\n", rtw_read32(padapter, 0x778));
DBG_8192C("0xc50=0x%08x\n", rtw_read32(padapter, 0xc50));
BT_DisplayBtCoexInfo(padapter);
DBG_8192C("===== BT debug information End =====\n");
}
if (strcmp(pch, "bton") == 0)
{
PBT30Info pBTInfo = GET_BT_INFO(padapter);
PBT_MGNT pBtMgnt = &pBTInfo->BtMgnt;
pBtMgnt->ExtConfig.bManualControl = _FALSE;
}
if (strcmp(pch, "btoff") == 0)
{
PBT30Info pBTInfo = GET_BT_INFO(padapter);
PBT_MGNT pBtMgnt = &pBTInfo->BtMgnt;
pBtMgnt->ExtConfig.bManualControl = _TRUE;
}
#endif // CONFIG_BT_COEXIST
if (strcmp(pch, "h2c") == 0)
{
u8 param[6];
u8 count = 0;
u32 tmp;
u8 i;
u32 pos;
s32 ret;
do {
pch = strsep(&ptmp, delim);
if ((pch == NULL) || (strlen(pch) == 0))
break;
sscanf(pch, "%x", &tmp);
param[count++] = (u8)tmp;
} while (count < 6);
if (count == 0) {
rtw_mfree(pbuf, len);
DBG_8192C("%s: parameter error(level 2)!\n", __func__);
return -EFAULT;
}
ret = FillH2CCmd(padapter, param[0], count-1, &param[1]);
pos = sprintf(extra, "H2C ID=%x content=", param[0]);
for (i=0; i<count; i++) {
pos += sprintf(extra+pos, "%x,", param[i]);
}
extra[pos] = 0;
pos--;
pos += sprintf(extra+pos, " %s", ret==_FAIL?"FAIL":"OK");
wrqu->data.length = strlen(extra) + 1;
}
#endif // CONFIG_RTL8723A
rtw_mfree(pbuf, len); rtw_mfree(pbuf, len);
return 0; return 0;
} }

View file

@ -42,15 +42,9 @@
#endif //CONFIG_BR_EXT #endif //CONFIG_BR_EXT
#ifdef CONFIG_RF_GAIN_OFFSET #ifdef CONFIG_RF_GAIN_OFFSET
#ifdef CONFIG_RTL8723A
#define RF_GAIN_OFFSET_ON BIT0
#define REG_RF_BB_GAIN_OFFSET 0x7f
#define RF_GAIN_OFFSET_MASK 0xfffff
#else
#define RF_GAIN_OFFSET_ON BIT4 #define RF_GAIN_OFFSET_ON BIT4
#define REG_RF_BB_GAIN_OFFSET 0x55 #define REG_RF_BB_GAIN_OFFSET 0x55
#define RF_GAIN_OFFSET_MASK 0xfffff #define RF_GAIN_OFFSET_MASK 0xfffff
#endif //CONFIG_RTL8723A
#endif //CONFIG_RF_GAIN_OFFSET #endif //CONFIG_RF_GAIN_OFFSET
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
@ -2390,32 +2384,12 @@ void rtw_bb_rf_gain_offset(_adapter *padapter)
//DBG_871X("Offset RF Gain.\n"); //DBG_871X("Offset RF Gain.\n");
//DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x\n",padapter->eeprompriv.EEPROMRFGainVal); //DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x\n",padapter->eeprompriv.EEPROMRFGainVal);
if(padapter->eeprompriv.EEPROMRFGainVal != 0xff){ if(padapter->eeprompriv.EEPROMRFGainVal != 0xff){
#ifdef CONFIG_RTL8723A
res = rtw_hal_read_rfreg(padapter, RF_PATH_A, 0xd, 0xffffffff);
//DBG_871X("Offset RF Gain. reg 0xd=0x%x\n",res);
res &= 0xfff87fff;
res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f)<< 15;
//DBG_871X("Offset RF Gain. reg 0xd=0x%x\n",res);
rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, RF_GAIN_OFFSET_MASK, res);
res = rtw_hal_read_rfreg(padapter, RF_PATH_A, 0xe, 0xffffffff);
DBG_871X("Offset RF Gain. reg 0xe=0x%x\n",res);
res &= 0xfffffff0;
res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f);
//DBG_871X("Offset RF Gain. reg 0xe=0x%x\n",res);
rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, RF_GAIN_OFFSET_MASK, res);
#else
res = rtw_hal_read_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, 0xffffffff); res = rtw_hal_read_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, 0xffffffff);
DBG_871X("REG_RF_BB_GAIN_OFFSET=%x \n",res); DBG_871X("REG_RF_BB_GAIN_OFFSET=%x \n",res);
res &= 0xfff87fff; res &= 0xfff87fff;
res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f)<< 15; res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f)<< 15;
DBG_871X("write REG_RF_BB_GAIN_OFFSET=%x \n",res); DBG_871X("write REG_RF_BB_GAIN_OFFSET=%x \n",res);
rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, RF_GAIN_OFFSET_MASK, res); rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, RF_GAIN_OFFSET_MASK, res);
#endif
} }
else else
{ {

View file

@ -133,131 +133,6 @@ static void rtw_dev_shutdown(struct device *dev)
#define USB_VENDER_ID_REALTEK 0x0BDA #define USB_VENDER_ID_REALTEK 0x0BDA
/* DID_USB_v916_20130116 */
#define RTL8192C_USB_IDS \
/*=== Realtek demoboard ===*/ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8191)},/* Default ID */ \
/****** 8188CUS ********/ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8176)},/* 8188cu 1*1 dongole */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8170)},/* 8188CE-VAU USB minCard */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817E)},/* 8188CE-VAU USB minCard */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817A)},/* 8188cu Slim Solo */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817B)},/* 8188cu Slim Combo */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817D)},/* 8188RU High-power USB Dongle */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8754)},/* 8188 Combo for BC4 */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817F)},/* 8188RU */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x818A)},/* RTL8188CUS-VL */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x018A)},/* RTL8188CTV */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x17C0)}, /* RTK demoboard - USB-N10E */ \
/****** 8192CUS ********/ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8177)},/* 8191cu 1*2 */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8178)},/* 8192cu 2*2 */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817C)},/* 8192CE-VAU USB minCard */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8191)},/* 8192CU 2*2 */ \
{USB_DEVICE(0x1058, 0x0631)},/* Alpha, 8192CU */ \
/*=== Customer ID ===*/ \
/****** 8188CUS Dongle ********/ \
{USB_DEVICE(0x2019, 0xED17)},/* PCI - Edimax */ \
{USB_DEVICE(0x0DF6, 0x0052)},/* Sitecom - Edimax */ \
{USB_DEVICE(0x7392, 0x7811)},/* Edimax - Edimax */ \
{USB_DEVICE(0x07B8, 0x8189)},/* Abocom - Abocom */ \
{USB_DEVICE(0x0EB0, 0x9071)},/* NO Brand - Etop */ \
{USB_DEVICE(0x06F8, 0xE033)},/* Hercules - Edimax */ \
{USB_DEVICE(0x103C, 0x1629)},/* HP - Lite-On ,8188CUS Slim Combo */ \
{USB_DEVICE(0x2001, 0x3308)},/* D-Link - Alpha */ \
{USB_DEVICE(0x050D, 0x1102)},/* Belkin - Edimax */ \
{USB_DEVICE(0x2019, 0xAB2A)},/* Planex - Abocom */ \
{USB_DEVICE(0x20F4, 0x648B)},/* TRENDnet - Cameo */ \
{USB_DEVICE(0x4855, 0x0090)},/* - Feixun */ \
{USB_DEVICE(0x13D3, 0x3357)},/* - AzureWave */ \
{USB_DEVICE(0x0DF6, 0x005C)},/* Sitecom - Edimax */ \
{USB_DEVICE(0x0BDA, 0x5088)},/* Thinkware - CC&C */ \
{USB_DEVICE(0x4856, 0x0091)},/* NetweeN - Feixun */ \
{USB_DEVICE(0x0846, 0x9041)}, /* Netgear - Cameo */ \
{USB_DEVICE(0x2019, 0x4902)},/* Planex - Etop */ \
{USB_DEVICE(0x2019, 0xAB2E)},/* SW-WF02-AD15 -Abocom */ \
{USB_DEVICE(0x2001, 0x330B)}, /* D-LINK - T&W */ \
{USB_DEVICE(0xCDAB, 0x8010)}, /* - - compare */ \
{USB_DEVICE(0x0B05, 0x17BA)}, /* ASUS - Edimax */ \
{USB_DEVICE(0x0BDA, 0x1E1E)}, /* Intel - - */ \
{USB_DEVICE(0x04BB, 0x094c)}, /* I-O DATA - Edimax */ \
/****** 8188CTV ********/ \
{USB_DEVICE(0xCDAB, 0x8011)}, /* - - compare */ \
{USB_DEVICE(0x0BDA, 0x0A8A)}, /* Sony - Foxconn */ \
/****** 8188 RU ********/ \
{USB_DEVICE(0x0BDA, 0x317F)},/* Netcore,Netcore */ \
/****** 8188CE-VAU ********/ \
{USB_DEVICE(0x13D3, 0x3359)},/* - Azwave */ \
{USB_DEVICE(0x13D3, 0x3358)},/* - Azwave */ \
/****** 8188CUS Slim Solo********/ \
{USB_DEVICE(0x04F2, 0xAFF7)},/* XAVI - XAVI */ \
{USB_DEVICE(0x04F2, 0xAFF9)},/* XAVI - XAVI */ \
{USB_DEVICE(0x04F2, 0xAFFA)},/* XAVI - XAVI */ \
/****** 8188CUS Slim Combo ********/ \
{USB_DEVICE(0x04F2, 0xAFF8)},/* XAVI - XAVI */ \
{USB_DEVICE(0x04F2, 0xAFFB)},/* XAVI - XAVI */ \
{USB_DEVICE(0x04F2, 0xAFFC)},/* XAVI - XAVI */ \
{USB_DEVICE(0x2019, 0x1201)},/* Planex - Vencer */ \
/****** 8192CUS Dongle ********/ \
{USB_DEVICE(0x2001, 0x3307)},/* D-Link - Cameo */ \
{USB_DEVICE(0x2001, 0x330A)},/* D-Link - Alpha */ \
{USB_DEVICE(0x2001, 0x3309)},/* D-Link - Alpha */ \
{USB_DEVICE(0x0586, 0x341F)},/* Zyxel - Abocom */ \
{USB_DEVICE(0x7392, 0x7822)},/* Edimax - Edimax */ \
{USB_DEVICE(0x2019, 0xAB2B)},/* Planex - Abocom */ \
{USB_DEVICE(0x07B8, 0x8178)},/* Abocom - Abocom */ \
{USB_DEVICE(0x07AA, 0x0056)},/* ATKK - Gemtek */ \
{USB_DEVICE(0x4855, 0x0091)},/* - Feixun */ \
{USB_DEVICE(0x050D, 0x2102)},/* Belkin - Sercomm */ \
{USB_DEVICE(0x050D, 0x2103)},/* Belkin - Edimax */ \
{USB_DEVICE(0x20F4, 0x624D)},/* TRENDnet */ \
{USB_DEVICE(0x0DF6, 0x0061)},/* Sitecom - Edimax */ \
{USB_DEVICE(0x0B05, 0x17AB)},/* ASUS - Edimax */ \
{USB_DEVICE(0x0846, 0x9021)},/* Netgear - Sercomm */ \
{USB_DEVICE(0x0846, 0xF001)}, /* Netgear - Sercomm */ \
{USB_DEVICE(0x0E66, 0x0019)},/* Hawking,Edimax */ \
{USB_DEVICE(0x0E66, 0x0020)}, /* Hawking - Edimax */ \
{USB_DEVICE(0x050D, 0x1004)}, /* Belkin - Edimax */ \
{USB_DEVICE(0x0BDA, 0x2E2E)}, /* Intel - - */ \
{USB_DEVICE(0x2357, 0x0100)}, /* TP-Link - TP-Link */ \
{USB_DEVICE(0x06F8, 0xE035)}, /* Hercules - Edimax */ \
{USB_DEVICE(0x04BB, 0x0950)}, /* IO-DATA - Edimax */ \
{USB_DEVICE(0x0DF6, 0x0070)}, /* Sitecom - Edimax */ \
{USB_DEVICE(0x0789, 0x016D)}, /* LOGITEC - Edimax */ \
/****** 8192CE-VAU ********/ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8186)},/* Intel-Xavi( Azwave) */
#define RTL8192D_USB_IDS \
/*=== Realtek demoboard ===*/ \
/****** 8192DU ********/ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8193)},/* 8192DU-VC */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8194)},/* 8192DU-VS */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8111)},/* Realtek 5G dongle for WiFi Display */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x0193)},/* 8192DE-VAU */ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8171)},/* 8192DU-VC */ \
/*=== Customer ID ===*/ \
/****** 8192DU-VC ********/ \
{USB_DEVICE(0x2019, 0xAB2C)},/* PCI - Abocm */ \
{USB_DEVICE(0x2019, 0x4903)},/* PCI - ETOP */ \
{USB_DEVICE(0x2019, 0x4904)},/* PCI - ETOP */ \
{USB_DEVICE(0x07B8, 0x8193)},/* Abocom - Abocom */ \
/****** 8192DU-VS ********/ \
{USB_DEVICE(0x20F4, 0x664B)}, /* TRENDnet - Cameo */ \
{USB_DEVICE(0x04DD, 0x954F)}, /* Sharp */ \
{USB_DEVICE(0x04DD, 0x96A6)}, /* Sharp */ \
{USB_DEVICE(0x050D, 0x110A)}, /* Belkin - Edimax */ \
{USB_DEVICE(0x050D, 0x1105)}, /* Belkin - Edimax */ \
{USB_DEVICE(0x050D, 0x120A)}, /* Belkin - Edimax */ \
{USB_DEVICE(0x1668, 0x8102)}, /* - */ \
{USB_DEVICE(0x0BDA, 0xE194)}, /* - Edimax */ \
/****** 8192DU-WiFi Display Dongle ********/ \
{USB_DEVICE(0x2019, 0xAB2D)},/* Planex - Abocom ,5G dongle for WiFi Display */
#define RTL8723A_USB_IDS \
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0x8724,0xff,0xff,0xff)}, /* 8723AU 1*1 */ \
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0x1724,0xff,0xff,0xff)}, /* 8723AU 1*1 */ \
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0x0724,0xff,0xff,0xff)}, /* 8723AU 1*1 */
#define RTL8188E_USB_IDS \ #define RTL8188E_USB_IDS \
/*=== Realtek demoboard ===*/ \ /*=== Realtek demoboard ===*/ \
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8179)}, /* 8188EUS */ \ {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8179)}, /* 8188EUS */ \
@ -266,27 +141,7 @@ static void rtw_dev_shutdown(struct device *dev)
/****** 8188EUS ********/ \ /****** 8188EUS ********/ \
{USB_DEVICE(0x07B8, 0x8179)}, /* Abocom - Abocom */ {USB_DEVICE(0x07B8, 0x8179)}, /* Abocom - Abocom */
#ifndef CONFIG_RTL8192C
#undef RTL8192C_USB_IDS
#define RTL8192C_USB_IDS
#endif
#ifndef CONFIG_RTL8192D
#undef RTL8192D_USB_IDS
#define RTL8192D_USB_IDS
#endif
#ifndef CONFIG_RTL8723A
#undef RTL8723A_USB_IDS
#define RTL8723A_USB_IDS
#endif
#ifndef CONFIG_RTL8188E
#undef RTL8188E_USB_IDS
#define RTL8188E_USB_IDS
#endif
static struct usb_device_id rtw_usb_id_tbl[] ={ static struct usb_device_id rtw_usb_id_tbl[] ={
RTL8192C_USB_IDS
RTL8192D_USB_IDS
RTL8723A_USB_IDS
RTL8188E_USB_IDS RTL8188E_USB_IDS
{} /* Terminating entry */ {} /* Terminating entry */
}; };
@ -312,96 +167,6 @@ struct rtw_usb_drv {
int drv_registered; int drv_registered;
}; };
#ifdef CONFIG_RTL8192C
static struct usb_device_id rtl8192c_usb_id_tbl[] ={
RTL8192C_USB_IDS
{} /* Terminating entry */
};
struct rtw_usb_drv rtl8192c_usb_drv = {
.usbdrv.name = (char*)"rtl8192cu",
.usbdrv.probe = rtw_drv_init,
.usbdrv.disconnect = rtw_dev_remove,
.usbdrv.id_table = rtl8192c_usb_id_tbl,
.usbdrv.suspend = rtw_suspend,
.usbdrv.resume = rtw_resume,
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
.usbdrv.reset_resume = rtw_resume,
#endif
#ifdef CONFIG_AUTOSUSPEND
.usbdrv.supports_autosuspend = 1,
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19))
.usbdrv.drvwrap.driver.shutdown = rtw_dev_shutdown,
#else
.usbdrv.driver.shutdown = rtw_dev_shutdown,
#endif
};
static struct rtw_usb_drv *usb_drv = &rtl8192c_usb_drv;
#endif /* CONFIG_RTL8192C */
#ifdef CONFIG_RTL8192D
static struct usb_device_id rtl8192d_usb_id_tbl[] ={
RTL8192D_USB_IDS
{} /* Terminating entry */
};
struct rtw_usb_drv rtl8192d_usb_drv = {
.usbdrv.name = (char*)"rtl8192du",
.usbdrv.probe = rtw_drv_init,
.usbdrv.disconnect = rtw_dev_remove,
.usbdrv.id_table = rtl8192d_usb_id_tbl,
.usbdrv.suspend = rtw_suspend,
.usbdrv.resume = rtw_resume,
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
.usbdrv.reset_resume = rtw_resume,
#endif
#ifdef CONFIG_AUTOSUSPEND
.usbdrv.supports_autosuspend = 1,
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19))
.usbdrv.drvwrap.driver.shutdown = rtw_dev_shutdown,
#else
.usbdrv.driver.shutdown = rtw_dev_shutdown,
#endif
};
static struct rtw_usb_drv *usb_drv = &rtl8192d_usb_drv;
#endif /* CONFIG_RTL8192D */
#ifdef CONFIG_RTL8723A
static struct usb_device_id rtl8723a_usb_id_tbl[] ={
RTL8723A_USB_IDS
{} /* Terminating entry */
};
struct rtw_usb_drv rtl8723a_usb_drv = {
.usbdrv.name = (char*)"rtl8723au",
.usbdrv.probe = rtw_drv_init,
.usbdrv.disconnect = rtw_dev_remove,
.usbdrv.id_table = rtl8723a_usb_id_tbl,
.usbdrv.suspend = rtw_suspend,
.usbdrv.resume = rtw_resume,
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
.usbdrv.reset_resume = rtw_resume,
#endif
#ifdef CONFIG_AUTOSUSPEND
.usbdrv.supports_autosuspend = 1,
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19))
.usbdrv.drvwrap.driver.shutdown = rtw_dev_shutdown,
#else
.usbdrv.driver.shutdown = rtw_dev_shutdown,
#endif
};
static struct rtw_usb_drv *usb_drv = &rtl8723a_usb_drv;
#endif /* CONFIG_RTL8723A */
#ifdef CONFIG_RTL8188E
static struct usb_device_id rtl8188e_usb_id_tbl[] ={ static struct usb_device_id rtl8188e_usb_id_tbl[] ={
RTL8188E_USB_IDS RTL8188E_USB_IDS
{} /* Terminating entry */ {} /* Terminating entry */
@ -429,7 +194,6 @@ struct rtw_usb_drv rtl8188e_usb_drv = {
}; };
static struct rtw_usb_drv *usb_drv = &rtl8188e_usb_drv; static struct rtw_usb_drv *usb_drv = &rtl8188e_usb_drv;
#endif /* CONFIG_RTL8188E */
static inline int RT_usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd) static inline int RT_usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd)
{ {
@ -2043,7 +1807,6 @@ static int __init rtw_drv_entry(void)
writel(tmp,(volatile unsigned int*)0xb801a608);//write dummy register for 1055 writel(tmp,(volatile unsigned int*)0xb801a608);//write dummy register for 1055
#endif #endif
#ifdef CONFIG_PLATFORM_ARM_SUNxI #ifdef CONFIG_PLATFORM_ARM_SUNxI
#ifndef CONFIG_RTL8723A
int ret = 0; int ret = 0;
/* ----------get usb_wifi_usbc_num------------- */ /* ----------get usb_wifi_usbc_num------------- */
ret = script_parser_fetch("usb_wifi_para", "usb_wifi_usbc_num", (int *)&usb_wifi_host, 64); ret = script_parser_fetch("usb_wifi_para", "usb_wifi_usbc_num", (int *)&usb_wifi_host, 64);
@ -2054,7 +1817,6 @@ static int __init rtw_drv_entry(void)
} }
DBG_8192C("sw_usb_enable_hcd: usbc_num = %d\n", usb_wifi_host); DBG_8192C("sw_usb_enable_hcd: usbc_num = %d\n", usb_wifi_host);
sw_usb_enable_hcd(usb_wifi_host); sw_usb_enable_hcd(usb_wifi_host);
#endif //CONFIG_RTL8723A
#endif //CONFIG_PLATFORM_ARM_SUNxI #endif //CONFIG_PLATFORM_ARM_SUNxI
#if defined CONFIG_PLATFORM_ARM_SUN6I #if defined CONFIG_PLATFORM_ARM_SUN6I
@ -2070,10 +1832,8 @@ static int __init rtw_drv_entry(void)
wifi_pm_power(1); wifi_pm_power(1);
mdelay(10); mdelay(10);
#ifndef CONFIG_RTL8723A
sw_usb_enable_hcd(item.val); sw_usb_enable_hcd(item.val);
#endif #endif // defined CONFIG_PLATFORM_ARM_SUN6I
#endif // defined CONFIG_PLATFORM_ARM_SUN6I && !(defined CONFIG_RTL8723A)
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+rtw_drv_entry\n")); RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+rtw_drv_entry\n"));
@ -2099,18 +1859,14 @@ static void __exit rtw_drv_halt(void)
usb_deregister(&usb_drv->usbdrv); usb_deregister(&usb_drv->usbdrv);
#ifdef CONFIG_PLATFORM_ARM_SUNxI #ifdef CONFIG_PLATFORM_ARM_SUNxI
#ifndef CONFIG_RTL8723A
DBG_8192C("sw_usb_disable_hcd: usbc_num = %d\n", usb_wifi_host); DBG_8192C("sw_usb_disable_hcd: usbc_num = %d\n", usb_wifi_host);
sw_usb_disable_hcd(usb_wifi_host); sw_usb_disable_hcd(usb_wifi_host);
#endif //ifndef CONFIG_RTL8723A
#endif //CONFIG_PLATFORM_ARM_SUNxI #endif //CONFIG_PLATFORM_ARM_SUNxI
#if defined CONFIG_PLATFORM_ARM_SUN6I #if defined CONFIG_PLATFORM_ARM_SUN6I
#ifndef CONFIG_RTL8723A
sw_usb_disable_hcd(item.val); sw_usb_disable_hcd(item.val);
#endif
wifi_pm_power(0); wifi_pm_power(0);
#endif // defined CONFIG_PLATFORM_ARM_SUN6I && !(defined CONFIG_RTL8723A) #endif // defined CONFIG_PLATFORM_ARM_SUN6I
rtw_suspend_lock_uninit(); rtw_suspend_lock_uninit();
DBG_871X("-rtw_drv_halt\n"); DBG_871X("-rtw_drv_halt\n");