Commit 238ad2dd authored by Larry Finger's avatar Larry Finger Committed by Kalle Valo

rtlwifi: rtl8723ae: Clean up the hardware info routine

This driver contains some complicated if ... else if ... else constructions.
These are replaced by switch statements to improve readability.
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent a8c9fb2b
...@@ -1653,132 +1653,135 @@ static void _rtl8723e_read_adapter_info(struct ieee80211_hw *hw, ...@@ -1653,132 +1653,135 @@ static void _rtl8723e_read_adapter_info(struct ieee80211_hw *hw,
rtl8723e_read_bt_coexist_info_from_hwpg(hw, rtl8723e_read_bt_coexist_info_from_hwpg(hw,
rtlefuse->autoload_failflag, hwinfo); rtlefuse->autoload_failflag, hwinfo);
if (rtlhal->oem_id == RT_CID_DEFAULT) { if (rtlhal->oem_id != RT_CID_DEFAULT)
switch (rtlefuse->eeprom_oemid) { return;
case EEPROM_CID_DEFAULT:
if (rtlefuse->eeprom_did == 0x8176) { switch (rtlefuse->eeprom_oemid) {
if (CHK_SVID_SMID(0x10EC, 0x6151) || case EEPROM_CID_DEFAULT:
CHK_SVID_SMID(0x10EC, 0x6152) || switch (rtlefuse->eeprom_did) {
CHK_SVID_SMID(0x10EC, 0x6154) || case 0x8176:
CHK_SVID_SMID(0x10EC, 0x6155) || switch (rtlefuse->eeprom_svid) {
CHK_SVID_SMID(0x10EC, 0x6177) || case 0x10EC:
CHK_SVID_SMID(0x10EC, 0x6178) || switch (rtlefuse->eeprom_smid) {
CHK_SVID_SMID(0x10EC, 0x6179) || case 0x6151 ... 0x6152:
CHK_SVID_SMID(0x10EC, 0x6180) || case 0x6154 ... 0x6155:
CHK_SVID_SMID(0x10EC, 0x7151) || case 0x6177 ... 0x6180:
CHK_SVID_SMID(0x10EC, 0x7152) || case 0x7151 ... 0x7152:
CHK_SVID_SMID(0x10EC, 0x7154) || case 0x7154 ... 0x7155:
CHK_SVID_SMID(0x10EC, 0x7155) || case 0x7177 ... 0x7180:
CHK_SVID_SMID(0x10EC, 0x7177) || case 0x8151 ... 0x8152:
CHK_SVID_SMID(0x10EC, 0x7178) || case 0x8154 ... 0x8155:
CHK_SVID_SMID(0x10EC, 0x7179) || case 0x8181 ... 0x8182:
CHK_SVID_SMID(0x10EC, 0x7180) || case 0x8184 ... 0x8185:
CHK_SVID_SMID(0x10EC, 0x8151) || case 0x9151 ... 0x9152:
CHK_SVID_SMID(0x10EC, 0x8152) || case 0x9154 ... 0x9155:
CHK_SVID_SMID(0x10EC, 0x8154) || case 0x9181 ... 0x9182:
CHK_SVID_SMID(0x10EC, 0x8155) || case 0x9184 ... 0x9185:
CHK_SVID_SMID(0x10EC, 0x8181) ||
CHK_SVID_SMID(0x10EC, 0x8182) ||
CHK_SVID_SMID(0x10EC, 0x8184) ||
CHK_SVID_SMID(0x10EC, 0x8185) ||
CHK_SVID_SMID(0x10EC, 0x9151) ||
CHK_SVID_SMID(0x10EC, 0x9152) ||
CHK_SVID_SMID(0x10EC, 0x9154) ||
CHK_SVID_SMID(0x10EC, 0x9155) ||
CHK_SVID_SMID(0x10EC, 0x9181) ||
CHK_SVID_SMID(0x10EC, 0x9182) ||
CHK_SVID_SMID(0x10EC, 0x9184) ||
CHK_SVID_SMID(0x10EC, 0x9185))
rtlhal->oem_id = RT_CID_TOSHIBA; rtlhal->oem_id = RT_CID_TOSHIBA;
else if (rtlefuse->eeprom_svid == 0x1025) break;
rtlhal->oem_id = RT_CID_819X_ACER; case 0x6191 ... 0x6193:
else if (CHK_SVID_SMID(0x10EC, 0x6191) || case 0x7191 ... 0x7193:
CHK_SVID_SMID(0x10EC, 0x6192) || case 0x8191 ... 0x8193:
CHK_SVID_SMID(0x10EC, 0x6193) || case 0x9191 ... 0x9193:
CHK_SVID_SMID(0x10EC, 0x7191) ||
CHK_SVID_SMID(0x10EC, 0x7192) ||
CHK_SVID_SMID(0x10EC, 0x7193) ||
CHK_SVID_SMID(0x10EC, 0x8191) ||
CHK_SVID_SMID(0x10EC, 0x8192) ||
CHK_SVID_SMID(0x10EC, 0x8193) ||
CHK_SVID_SMID(0x10EC, 0x9191) ||
CHK_SVID_SMID(0x10EC, 0x9192) ||
CHK_SVID_SMID(0x10EC, 0x9193))
rtlhal->oem_id = RT_CID_819X_SAMSUNG; rtlhal->oem_id = RT_CID_819X_SAMSUNG;
else if (CHK_SVID_SMID(0x10EC, 0x8195) || break;
CHK_SVID_SMID(0x10EC, 0x9195) || case 0x8197:
CHK_SVID_SMID(0x10EC, 0x7194) || case 0x9196:
CHK_SVID_SMID(0x10EC, 0x8200) ||
CHK_SVID_SMID(0x10EC, 0x8201) ||
CHK_SVID_SMID(0x10EC, 0x8202) ||
CHK_SVID_SMID(0x10EC, 0x9200))
rtlhal->oem_id = RT_CID_819X_LENOVO;
else if (CHK_SVID_SMID(0x10EC, 0x8197) ||
CHK_SVID_SMID(0x10EC, 0x9196))
rtlhal->oem_id = RT_CID_819X_CLEVO; rtlhal->oem_id = RT_CID_819X_CLEVO;
else if (CHK_SVID_SMID(0x1028, 0x8194) || break;
CHK_SVID_SMID(0x1028, 0x8198) || case 0x8203:
CHK_SVID_SMID(0x1028, 0x9197) || rtlhal->oem_id = RT_CID_819X_PRONETS;
CHK_SVID_SMID(0x1028, 0x9198)) break;
case 0x8195:
case 0x9195:
case 0x7194:
case 0x8200 ... 0x8202:
case 0x9200:
rtlhal->oem_id = RT_CID_819X_LENOVO;
break;
}
case 0x1025:
rtlhal->oem_id = RT_CID_819X_ACER;
break;
case 0x1028:
switch (rtlefuse->eeprom_smid) {
case 0x8194:
case 0x8198:
case 0x9197 ... 0x9198:
rtlhal->oem_id = RT_CID_819X_DELL; rtlhal->oem_id = RT_CID_819X_DELL;
else if (CHK_SVID_SMID(0x103C, 0x1629)) break;
}
break;
case 0x103C:
switch (rtlefuse->eeprom_smid) {
case 0x1629:
rtlhal->oem_id = RT_CID_819X_HP; rtlhal->oem_id = RT_CID_819X_HP;
else if (CHK_SVID_SMID(0x1A32, 0x2315)) }
break;
case 0x1A32:
switch (rtlefuse->eeprom_smid) {
case 0x2315:
rtlhal->oem_id = RT_CID_819X_QMI; rtlhal->oem_id = RT_CID_819X_QMI;
else if (CHK_SVID_SMID(0x10EC, 0x8203)) break;
rtlhal->oem_id = RT_CID_819X_PRONETS; }
else if (CHK_SVID_SMID(0x1043, 0x84B5)) break;
rtlhal->oem_id = case 0x1043:
RT_CID_819X_EDIMAX_ASUS; switch (rtlefuse->eeprom_smid) {
else case 0x84B5:
rtlhal->oem_id = RT_CID_DEFAULT;
} else if (rtlefuse->eeprom_did == 0x8178) {
if (CHK_SVID_SMID(0x10EC, 0x6181) ||
CHK_SVID_SMID(0x10EC, 0x6182) ||
CHK_SVID_SMID(0x10EC, 0x6184) ||
CHK_SVID_SMID(0x10EC, 0x6185) ||
CHK_SVID_SMID(0x10EC, 0x7181) ||
CHK_SVID_SMID(0x10EC, 0x7182) ||
CHK_SVID_SMID(0x10EC, 0x7184) ||
CHK_SVID_SMID(0x10EC, 0x7185) ||
CHK_SVID_SMID(0x10EC, 0x8181) ||
CHK_SVID_SMID(0x10EC, 0x8182) ||
CHK_SVID_SMID(0x10EC, 0x8184) ||
CHK_SVID_SMID(0x10EC, 0x8185) ||
CHK_SVID_SMID(0x10EC, 0x9181) ||
CHK_SVID_SMID(0x10EC, 0x9182) ||
CHK_SVID_SMID(0x10EC, 0x9184) ||
CHK_SVID_SMID(0x10EC, 0x9185))
rtlhal->oem_id = RT_CID_TOSHIBA;
else if (rtlefuse->eeprom_svid == 0x1025)
rtlhal->oem_id = RT_CID_819X_ACER;
else if (CHK_SVID_SMID(0x10EC, 0x8186))
rtlhal->oem_id = RT_CID_819X_PRONETS;
else if (CHK_SVID_SMID(0x1043, 0x8486))
rtlhal->oem_id = rtlhal->oem_id =
RT_CID_819X_EDIMAX_ASUS; RT_CID_819X_EDIMAX_ASUS;
else }
rtlhal->oem_id = RT_CID_DEFAULT; break;
} else {
rtlhal->oem_id = RT_CID_DEFAULT;
} }
break; break;
case EEPROM_CID_TOSHIBA: case 0x8178:
rtlhal->oem_id = RT_CID_TOSHIBA; switch (rtlefuse->eeprom_svid) {
break; case 0x10ec:
case EEPROM_CID_CCX: switch (rtlefuse->eeprom_smid) {
rtlhal->oem_id = RT_CID_CCX; case 0x6181 ... 0x6182:
break; case 0x6184 ... 0x6185:
case EEPROM_CID_QMI: case 0x7181 ... 0x7182:
rtlhal->oem_id = RT_CID_819X_QMI; case 0x7184 ... 0x7185:
break; case 0x8181 ... 0x8182:
case EEPROM_CID_WHQL: case 0x8184 ... 0x8185:
case 0x9181 ... 0x9182:
case 0x9184 ... 0x9185:
rtlhal->oem_id = RT_CID_TOSHIBA;
break;
case 0x8186:
rtlhal->oem_id =
RT_CID_819X_PRONETS;
break;
}
break; break;
default: case 0x1025:
rtlhal->oem_id = RT_CID_DEFAULT; rtlhal->oem_id = RT_CID_819X_ACER;
break;
case 0x1043:
switch (rtlefuse->eeprom_smid) {
case 0x8486:
rtlhal->oem_id =
RT_CID_819X_EDIMAX_ASUS;
}
break;
}
break; break;
} }
break;
case EEPROM_CID_TOSHIBA:
rtlhal->oem_id = RT_CID_TOSHIBA;
break;
case EEPROM_CID_CCX:
rtlhal->oem_id = RT_CID_CCX;
break;
case EEPROM_CID_QMI:
rtlhal->oem_id = RT_CID_819X_QMI;
break;
case EEPROM_CID_WHQL:
break;
default:
rtlhal->oem_id = RT_CID_DEFAULT;
break;
} }
exit: exit:
kfree(hwinfo); kfree(hwinfo);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment