rtlwifi: rtl8192ee: Convert driver to use common hardware info routine
The driver for RTL8192EE chips is converted to use the common routine for getting the hardware information. Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
9468792743
commit
5c392654ee
|
@ -2098,75 +2098,24 @@ static void _rtl92ee_read_adapter_info(struct ieee80211_hw *hw)
|
||||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||||
struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
|
struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
|
||||||
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
|
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
|
||||||
u16 i, usvalue;
|
int params[] = {RTL8192E_EEPROM_ID, EEPROM_VID, EEPROM_DID,
|
||||||
u8 hwinfo[HWSET_MAX_SIZE];
|
EEPROM_SVID, EEPROM_SMID, EEPROM_MAC_ADDR,
|
||||||
u16 eeprom_id;
|
EEPROM_CHANNELPLAN, EEPROM_VERSION, EEPROM_CUSTOMER_ID,
|
||||||
|
COUNTRY_CODE_WORLD_WIDE_13};
|
||||||
|
u8 *hwinfo;
|
||||||
|
|
||||||
switch (rtlefuse->epromtype) {
|
hwinfo = kzalloc(HWSET_MAX_SIZE, GFP_KERNEL);
|
||||||
case EEPROM_BOOT_EFUSE:
|
if (!hwinfo)
|
||||||
rtl_efuse_shadow_map_update(hw);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EEPROM_93C46:
|
|
||||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
|
|
||||||
"RTL819X Not boot from eeprom, check it !!\n");
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
if (rtl_get_hwinfo(hw, rtlpriv, HWSET_MAX_SIZE, hwinfo, params))
|
||||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
|
goto exit;
|
||||||
"boot from neither eeprom nor efuse, check it !!\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
memcpy(hwinfo, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0], HWSET_MAX_SIZE);
|
|
||||||
|
|
||||||
RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_DMESG, "MAP\n",
|
|
||||||
hwinfo, HWSET_MAX_SIZE);
|
|
||||||
|
|
||||||
eeprom_id = *((u16 *)&hwinfo[0]);
|
|
||||||
if (eeprom_id != RTL8192E_EEPROM_ID) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
|
|
||||||
"EEPROM ID(%#x) is invalid!!\n", eeprom_id);
|
|
||||||
rtlefuse->autoload_failflag = true;
|
|
||||||
} else {
|
|
||||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload OK\n");
|
|
||||||
rtlefuse->autoload_failflag = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rtlefuse->autoload_failflag)
|
|
||||||
return;
|
|
||||||
/*VID DID SVID SDID*/
|
|
||||||
rtlefuse->eeprom_vid = *(u16 *)&hwinfo[EEPROM_VID];
|
|
||||||
rtlefuse->eeprom_did = *(u16 *)&hwinfo[EEPROM_DID];
|
|
||||||
rtlefuse->eeprom_svid = *(u16 *)&hwinfo[EEPROM_SVID];
|
|
||||||
rtlefuse->eeprom_smid = *(u16 *)&hwinfo[EEPROM_SMID];
|
|
||||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "EEPROMId = 0x%4x\n", eeprom_id);
|
|
||||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
|
||||||
"EEPROM VID = 0x%4x\n", rtlefuse->eeprom_vid);
|
|
||||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
|
||||||
"EEPROM DID = 0x%4x\n", rtlefuse->eeprom_did);
|
|
||||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
|
||||||
"EEPROM SVID = 0x%4x\n", rtlefuse->eeprom_svid);
|
|
||||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
|
||||||
"EEPROM SMID = 0x%4x\n", rtlefuse->eeprom_smid);
|
|
||||||
/*customer ID*/
|
|
||||||
rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID];
|
|
||||||
if (rtlefuse->eeprom_oemid == 0xFF)
|
if (rtlefuse->eeprom_oemid == 0xFF)
|
||||||
rtlefuse->eeprom_oemid = 0;
|
rtlefuse->eeprom_oemid = 0;
|
||||||
|
|
||||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||||
"EEPROM Customer ID: 0x%2x\n", rtlefuse->eeprom_oemid);
|
"EEPROM Customer ID: 0x%2x\n", rtlefuse->eeprom_oemid);
|
||||||
/*EEPROM version*/
|
|
||||||
rtlefuse->eeprom_version = *(u8 *)&hwinfo[EEPROM_VERSION];
|
|
||||||
/*mac address*/
|
|
||||||
for (i = 0; i < 6; i += 2) {
|
|
||||||
usvalue = *(u16 *)&hwinfo[EEPROM_MAC_ADDR + i];
|
|
||||||
*((u16 *)(&rtlefuse->dev_addr[i])) = usvalue;
|
|
||||||
}
|
|
||||||
|
|
||||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
|
|
||||||
"dev_addr: %pM\n", rtlefuse->dev_addr);
|
|
||||||
/*channel plan */
|
|
||||||
rtlefuse->eeprom_channelplan = *(u8 *)&hwinfo[EEPROM_CHANNELPLAN];
|
|
||||||
/* set channel plan from efuse */
|
/* set channel plan from efuse */
|
||||||
rtlefuse->channel_plan = rtlefuse->eeprom_channelplan;
|
rtlefuse->channel_plan = rtlefuse->eeprom_channelplan;
|
||||||
/*tx power*/
|
/*tx power*/
|
||||||
|
@ -2208,6 +2157,8 @@ static void _rtl92ee_read_adapter_info(struct ieee80211_hw *hw)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
exit:
|
||||||
|
kfree(hwinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _rtl92ee_hal_customized_behavior(struct ieee80211_hw *hw)
|
static void _rtl92ee_hal_customized_behavior(struct ieee80211_hw *hw)
|
||||||
|
|
Loading…
Reference in New Issue