From 2a75f42bff24585e82604b4e2b482f1d4193be4f Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Mon, 2 Mar 2015 11:34:17 -0600 Subject: [PATCH] rtl8188eu: Remove CONFIG_EFUSE_CONFIG_FILE and CONFIG_RF_GAIN_OFFSET These two interdependent parameters are not defined. Signed-off-by: Larry Finger --- Makefile | 9 --- hal/rtl8188e_hal_init.c | 26 -------- hal/usb_halinit.c | 128 ---------------------------------------- include/osdep_intf.h | 4 -- include/rtl8188e_hal.h | 7 --- include/rtl8188e_spec.h | 9 --- include/rtw_eeprom.h | 5 -- os_dep/os_intfs.c | 50 +--------------- 8 files changed, 1 insertion(+), 237 deletions(-) diff --git a/Makefile b/Makefile index d9dc640..2f8dfad 100755 --- a/Makefile +++ b/Makefile @@ -21,7 +21,6 @@ CONFIG_USB_HCI = y CONFIG_POWER_SAVING = y CONFIG_USB_AUTOSUSPEND = n CONFIG_BT_COEXIST = n -CONFIG_EFUSE_CONFIG_FILE = n CONFIG_EXT_CLK = n CONFIG_WOWLAN = n CONFIG_GPIO_WAKEUP = n @@ -102,10 +101,6 @@ ifeq ($(CONFIG_BT_COEXIST), y) EXTRA_CFLAGS += -DCONFIG_BT_COEXIST endif -ifeq ($(CONFIG_EFUSE_CONFIG_FILE), y) -EXTRA_CFLAGS += -DCONFIG_EFUSE_CONFIG_FILE -endif - ifeq ($(CONFIG_EXT_CLK), y) EXTRA_CFLAGS += -DCONFIG_EXT_CLK endif @@ -126,10 +121,6 @@ ifeq ($(CONFIG_GPIO_WAKEUP), y) EXTRA_CFLAGS += -DCONFIG_GPIO_WAKEUP endif -ifeq ($(CONFIG_EFUSE_CONFIG_FILE), y) -EXTRA_CFLAGS += -DCONFIG_RF_GAIN_OFFSET -endif - SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ | sed -e s/ppc/powerpc/ | sed -e s/armv.l/arm/) ARCH ?= $(SUBARCH) CROSS_COMPILE ?= diff --git a/hal/rtl8188e_hal_init.c b/hal/rtl8188e_hal_init.c index 47d79d6..a765de3 100755 --- a/hal/rtl8188e_hal_init.c +++ b/hal/rtl8188e_hal_init.c @@ -3570,32 +3570,6 @@ void Hal_DetectWoWMode(struct adapter *pAdapter) } #endif -#ifdef CONFIG_RF_GAIN_OFFSET -void Hal_ReadRFGainOffset( - IN struct adapter * Adapter, - IN u8* PROMContent, - IN BOOLEAN AutoloadFail) -{ - u8 buff[EFUSE_MAX_SIZE]; - u32 res; - /* */ - /* BB_RF Gain Offset from EEPROM */ - /* */ - /* res = rtw_efuse_access(Adapter, false, 0, EFUSE_MAX_SIZE, buff); */ - if(!AutoloadFail ){ - Adapter->eeprompriv.EEPROMRFGainOffset = PROMContent[EEPROM_RF_GAIN_OFFSET_88E]; - Adapter->eeprompriv.EEPROMRFGainVal=EFUSE_Read1Byte(Adapter, EEPROM_RF_GAIN_VAL_88E); - } - else{ - Adapter->eeprompriv.EEPROMRFGainOffset = EEPROM_Default_RFGainOffset; - Adapter->eeprompriv.EEPROMRFGainVal=0xff; - } - DBG_871X("EEPRORFGainOffset = 0x%02x\n", Adapter->eeprompriv.EEPROMRFGainOffset); -} -#endif /* CONFIG_RF_GAIN_OFFSET */ - -/* */ -/* */ /* 20100209 Joseph: */ /* This function is used only for 92C to set REG_BCN_CTRL(0x550) register. */ /* We just reserve the value of the register in variable pHalData->RegBcnCtrlVal and then operate */ diff --git a/hal/usb_halinit.c b/hal/usb_halinit.c index 8fcb1ee..af4d17b 100755 --- a/hal/usb_halinit.c +++ b/hal/usb_halinit.c @@ -31,11 +31,6 @@ #include #include -#ifdef CONFIG_EFUSE_CONFIG_FILE -#include -#include -#endif /* CONFIG_EFUSE_CONFIG_FILE */ - #if DISABLE_BB_RF #define HAL_MAC_ENABLE 0 #define HAL_BB_ENABLE 0 @@ -2008,119 +2003,6 @@ static void _ReadPSSetting(IN struct adapter *Adapter,IN u8*PROMContent,IN u8 Au { } -#ifdef CONFIG_EFUSE_CONFIG_FILE -static u32 Hal_readPGDataFromConfigFile( - struct adapter *padapter) -{ - u32 i; - struct file *fp; - mm_segment_t fs; - u8 temp[3]; - loff_t pos = 0; - EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter); - u8 *PROMContent = pEEPROM->efuse_eeprom_data; - - - temp[2] = 0; /* add end of string '\0' */ - - fp = filp_open("/system/etc/wifi/wifi_efuse.map", O_RDWR, 0644); - if (IS_ERR(fp)) { - pEEPROM->bloadfile_fail_flag = true; - DBG_871X("Error, Efuse configure file doesn't exist.\n"); - return _FAIL; - } - - fs = get_fs(); - set_fs(KERNEL_DS); - - DBG_871X("Efuse configure file:\n"); - for (i=0; ibloadfile_fail_flag = false; - - return _SUCCESS; -} - -static void -Hal_ReadMACAddrFromFile_8188EU( - struct adapter * padapter - ) -{ - u32 i; - struct file *fp; - mm_segment_t fs; - u8 source_addr[18]; - loff_t pos = 0; - u32 curtime = rtw_get_current_time(); - EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter); - u8 *head, *end; - - u8 null_mac_addr[ETH_ALEN] = {0, 0, 0,0, 0, 0}; - u8 multi_mac_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - - memset(source_addr, 0, 18); - memset(pEEPROM->mac_addr, 0, ETH_ALEN); - - fp = filp_open("/data/wifimac.txt", O_RDWR, 0644); - if (IS_ERR(fp)) { - pEEPROM->bloadmac_fail_flag = true; - DBG_871X("Error, wifi mac address file doesn't exist.\n"); - } else { - fs = get_fs(); - set_fs(KERNEL_DS); - - DBG_871X("wifi mac address:\n"); - vfs_read(fp, source_addr, 18, &pos); - source_addr[17] = ':'; - - head = end = source_addr; - for (i=0; imac_addr[i] = simple_strtoul(head, NULL, 16 ); - - if (end) { - end++; - head = end; - } - DBG_871X("%02x \n", pEEPROM->mac_addr[i]); - } - DBG_871X("\n"); - set_fs(fs); - pEEPROM->bloadmac_fail_flag = false; - filp_close(fp, NULL); - } - - if ( (_rtw_memcmp(pEEPROM->mac_addr, null_mac_addr, ETH_ALEN)) || - (_rtw_memcmp(pEEPROM->mac_addr, multi_mac_addr, ETH_ALEN)) ) { - pEEPROM->mac_addr[0] = 0x00; - pEEPROM->mac_addr[1] = 0xe0; - pEEPROM->mac_addr[2] = 0x4c; - pEEPROM->mac_addr[3] = (u8)(curtime & 0xff) ; - pEEPROM->mac_addr[4] = (u8)((curtime>>8) & 0xff) ; - pEEPROM->mac_addr[5] = (u8)((curtime>>16) & 0xff) ; - } - - DBG_871X("Hal_ReadMACAddrFromFile_8188ES: Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n", - pEEPROM->mac_addr[0], pEEPROM->mac_addr[1], - pEEPROM->mac_addr[2], pEEPROM->mac_addr[3], - pEEPROM->mac_addr[4], pEEPROM->mac_addr[5]); -} -#endif /* CONFIG_EFUSE_CONFIG_FILE */ - static void readAdapterInfo_8188EU( IN struct adapter *padapter @@ -2131,11 +2013,7 @@ readAdapterInfo_8188EU( /* parse the eeprom/efuse content */ Hal_EfuseParseIDCode88E(padapter, pEEPROM->efuse_eeprom_data); Hal_EfuseParsePIDVID_8188EU(padapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); -#ifdef CONFIG_EFUSE_CONFIG_FILE - Hal_ReadMACAddrFromFile_8188EU(padapter); -#else /* CONFIG_EFUSE_CONFIG_FILE */ Hal_EfuseParseMACAddr_8188EU(padapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); -#endif /* CONFIG_EFUSE_CONFIG_FILE */ Hal_ReadPowerSavingMode88E(padapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); Hal_ReadTxPowerInfo88E(padapter, pEEPROM->efuse_eeprom_data, pEEPROM->bautoload_fail_flag); @@ -2173,16 +2051,10 @@ static void _ReadPROMContent( (pEEPROM->bautoload_fail_flag ? "Fail" : "OK") ); /* pHalData->EEType = IS_BOOT_FROM_EEPROM(Adapter) ? EEPROM_93C46 : EEPROM_BOOT_EFUSE; */ -#ifdef CONFIG_EFUSE_CONFIG_FILE - Hal_readPGDataFromConfigFile(Adapter); -#else /* CONFIG_EFUSE_CONFIG_FILE */ Hal_InitPGData88E(Adapter); -#endif /* CONFIG_EFUSE_CONFIG_FILE */ readAdapterInfo_8188EU(Adapter); } - - static void _ReadRFType( IN struct adapter *Adapter diff --git a/include/osdep_intf.h b/include/osdep_intf.h index a0540e6..4fe6ca9 100755 --- a/include/osdep_intf.h +++ b/include/osdep_intf.h @@ -101,10 +101,6 @@ static void rtw_proc_remove_one(struct net_device *dev){} void rtw_ips_dev_unload(struct adapter *padapter); -#ifdef CONFIG_RF_GAIN_OFFSET -void rtw_bb_rf_gain_offset(struct adapter *padapter); -#endif //CONFIG_RF_GAIN_OFFSET - int rtw_ips_pwr_up(struct adapter *padapter); void rtw_ips_pwr_down(struct adapter *padapter); diff --git a/include/rtl8188e_hal.h b/include/rtl8188e_hal.h index f6b9af6..3217112 100755 --- a/include/rtl8188e_hal.h +++ b/include/rtl8188e_hal.h @@ -530,13 +530,6 @@ BOOLEAN HalDetectPwrDownMode88E(struct adapter *Adapter); void Hal_DetectWoWMode(struct adapter *pAdapter); #endif //CONFIG_WOWLAN -#ifdef CONFIG_RF_GAIN_OFFSET -void Hal_ReadRFGainOffset(struct adapter *pAdapter,u8* hwinfo,BOOLEAN AutoLoadFail); -#endif //CONFIG_RF_GAIN_OFFSET - -//RT_CHANNEL_DOMAIN rtl8723a_HalMapChannelPlan(struct adapter *padapter, u8 HalChannelPlan); -//VERSION_8192C rtl8723a_ReadChipVersion(struct adapter *padapter); -//void rtl8723a_ReadBluetoothCoexistInfo(struct adapter *padapter, u8 *PROMContent, BOOLEAN AutoloadFail); void Hal_InitChannelPlan(struct adapter *padapter); void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc); diff --git a/include/rtl8188e_spec.h b/include/rtl8188e_spec.h index e5053a9..2013e2e 100755 --- a/include/rtl8188e_spec.h +++ b/include/rtl8188e_spec.h @@ -1558,11 +1558,6 @@ Current IOREG MAP #define EEPROM_CUSTOMERID_88E 0xC5 #define EEPROM_RF_ANTENNA_OPT_88E 0xC9 -#ifdef CONFIG_RF_GAIN_OFFSET -#define EEPROM_RF_GAIN_OFFSET_88E 0xC1 -#define EEPROM_RF_GAIN_VAL_88E 0xF6 //Physical address which is the BB gain offset value -#endif //CONFIG_RF_GAIN_OFFSET - // RTL88EE #define EEPROM_MAC_ADDR_88EE 0xD0 #define EEPROM_VID_88EE 0xD6 @@ -1613,10 +1608,6 @@ Current IOREG MAP #define EEPROM_Default_CrystalCap_88E 0x20 #define EEPROM_Default_ThermalMeter_88E 0x18 -#ifdef CONFIG_RF_GAIN_OFFSET -#define EEPROM_Default_RFGainOffset 0xff -#endif //CONFIG_RF_GAIN_OFFSET - //New EFUSE deafult value #define EEPROM_DEFAULT_24G_INDEX 0x2D #define EEPROM_DEFAULT_24G_HT20_DIFF 0X02 diff --git a/include/rtw_eeprom.h b/include/rtw_eeprom.h index b223cef..a7b23ee 100755 --- a/include/rtw_eeprom.h +++ b/include/rtw_eeprom.h @@ -130,11 +130,6 @@ struct eeprom_priv u8 EepromOrEfuse; u8 efuse_eeprom_data[HWSET_MAX_SIZE_512]; //92C:256bytes, 88E:512bytes, we use union set (512bytes) - -#ifdef CONFIG_RF_GAIN_OFFSET - u8 EEPROMRFGainOffset; - u8 EEPROMRFGainVal; -#endif //CONFIG_RF_GAIN_OFFSET }; extern void eeprom_write16(struct adapter *padapter, u16 reg, u16 data); diff --git a/os_dep/os_intfs.c b/os_dep/os_intfs.c index 5f68d5f..b6d4878 100755 --- a/os_dep/os_intfs.c +++ b/os_dep/os_intfs.c @@ -37,12 +37,6 @@ #include #endif /* CONFIG_BR_EXT */ -#ifdef CONFIG_RF_GAIN_OFFSET -#define RF_GAIN_OFFSET_ON BIT4 -#define REG_RF_BB_GAIN_OFFSET 0x55 -#define RF_GAIN_OFFSET_MASK 0xfffff -#endif /* CONFIG_RF_GAIN_OFFSET */ - MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Realtek Wireless Lan Driver"); MODULE_AUTHOR("Realtek Semiconductor Corp."); @@ -1233,10 +1227,6 @@ int _netdev_open(struct net_device *pnetdev) DBG_871X("MAC Address = "MAC_FMT"\n", MAC_ARG(pnetdev->dev_addr)); -#ifdef CONFIG_RF_GAIN_OFFSET - rtw_bb_rf_gain_offset(padapter); -#endif /* CONFIG_RF_GAIN_OFFSET */ - status=rtw_start_drv_threads(padapter); if(status ==_FAIL) { @@ -1330,20 +1320,13 @@ static int ips_netdrv_open(struct adapter *padapter) /* padapter->bup = true; */ status = rtw_hal_init(padapter); - if (status ==_FAIL) - { + if (status ==_FAIL) { RT_TRACE(_module_os_intfs_c_,_drv_err_,("ips_netdrv_open(): Can't init h/w!\n")); goto netdev_open_error; } -#ifdef CONFIG_RF_GAIN_OFFSET - rtw_bb_rf_gain_offset(padapter); -#endif /* CONFIG_RF_GAIN_OFFSET */ - if(padapter->intf_start) - { padapter->intf_start(padapter); - } rtw_set_pwr_state_check_timer(adapter_to_pwrctl(padapter)); _set_timer(&padapter->mlmepriv.dynamic_chk_timer,5000); @@ -1410,37 +1393,6 @@ void rtw_ips_dev_unload(struct adapter *padapter) } -#ifdef CONFIG_RF_GAIN_OFFSET -void rtw_bb_rf_gain_offset(struct adapter *padapter) -{ - u8 value = padapter->eeprompriv.EEPROMRFGainOffset; - u8 tmp = 0x3e; - u32 res; - - DBG_871X("+%s value: 0x%02x+\n", __func__, value); - - if (value & RF_GAIN_OFFSET_ON) { - /* DBG_871X("Offset RF Gain.\n"); */ - /* DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x\n",padapter->eeprompriv.EEPROMRFGainVal); */ - if(padapter->eeprompriv.EEPROMRFGainVal != 0xff){ - 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); - res &= 0xfff87fff; - res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f)<< 15; - 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); - } - else - { - /* DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x != 0xff, didn't run Kfree\n",padapter->eeprompriv.EEPROMRFGainVal); */ - } - } else { - /* DBG_871X("Using the default RF gain.\n"); */ - } - -} -#endif /* CONFIG_RF_GAIN_OFFSET */ - int pm_netdev_open(struct net_device *pnetdev,u8 bnormal) { int status;