Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtl8192cu: Remove dead code never selected

The original driver contained some conditional code that was not selected,
but was not deleted in case it would be used later. That code can now be
removed.

Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Larry Finger and committed by
John W. Linville
9ef11f7b 76a92be5

-170
-170
drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
··· 339 339 if (IS_HIGHT_PA(rtlefuse->board_type)) 340 340 rtlefuse->external_pa = 1; 341 341 pr_info("Board Type %x\n", rtlefuse->board_type); 342 - 343 - #ifdef CONFIG_ANTENNA_DIVERSITY 344 - /* Antenna Diversity setting. */ 345 - if (registry_par->antdiv_cfg == 2) /* 2: From Efuse */ 346 - rtl_efuse->antenna_cfg = (contents[EEPROM_RF_OPT1]&0x18)>>3; 347 - else 348 - rtl_efuse->antenna_cfg = registry_par->antdiv_cfg; /* 0:OFF, */ 349 - 350 - pr_info("Antenna Config %x\n", rtl_efuse->antenna_cfg); 351 - #endif 352 342 } 353 - 354 - #ifdef CONFIG_BT_COEXIST 355 - static void _update_bt_param(_adapter *padapter) 356 - { 357 - struct btcoexist_priv *pbtpriv = &(padapter->halpriv.bt_coexist); 358 - struct registry_priv *registry_par = &padapter->registrypriv; 359 - if (2 != registry_par->bt_iso) { 360 - /* 0:Low, 1:High, 2:From Efuse */ 361 - pbtpriv->BT_Ant_isolation = registry_par->bt_iso; 362 - } 363 - if (registry_par->bt_sco == 1) { 364 - /* 0:Idle, 1:None-SCO, 2:SCO, 3:From Counter, 4.Busy, 365 - * 5.OtherBusy */ 366 - pbtpriv->BT_Service = BT_OtherAction; 367 - } else if (registry_par->bt_sco == 2) { 368 - pbtpriv->BT_Service = BT_SCO; 369 - } else if (registry_par->bt_sco == 4) { 370 - pbtpriv->BT_Service = BT_Busy; 371 - } else if (registry_par->bt_sco == 5) { 372 - pbtpriv->BT_Service = BT_OtherBusy; 373 - } else { 374 - pbtpriv->BT_Service = BT_Idle; 375 - } 376 - pbtpriv->BT_Ampdu = registry_par->bt_ampdu; 377 - pbtpriv->bCOBT = _TRUE; 378 - pbtpriv->BtEdcaUL = 0; 379 - pbtpriv->BtEdcaDL = 0; 380 - pbtpriv->BtRssiState = 0xff; 381 - pbtpriv->bInitSet = _FALSE; 382 - pbtpriv->bBTBusyTraffic = _FALSE; 383 - pbtpriv->bBTTrafficModeSet = _FALSE; 384 - pbtpriv->bBTNonTrafficModeSet = _FALSE; 385 - pbtpriv->CurrentState = 0; 386 - pbtpriv->PreviousState = 0; 387 - pr_info("BT Coexistance = %s\n", 388 - (pbtpriv->BT_Coexist == _TRUE) ? "enable" : "disable"); 389 - if (pbtpriv->BT_Coexist) { 390 - if (pbtpriv->BT_Ant_Num == Ant_x2) 391 - pr_info("BlueTooth BT_Ant_Num = Antx2\n"); 392 - else if (pbtpriv->BT_Ant_Num == Ant_x1) 393 - pr_info("BlueTooth BT_Ant_Num = Antx1\n"); 394 - switch (pbtpriv->BT_CoexistType) { 395 - case BT_2Wire: 396 - pr_info("BlueTooth BT_CoexistType = BT_2Wire\n"); 397 - break; 398 - case BT_ISSC_3Wire: 399 - pr_info("BlueTooth BT_CoexistType = BT_ISSC_3Wire\n"); 400 - break; 401 - case BT_Accel: 402 - pr_info("BlueTooth BT_CoexistType = BT_Accel\n"); 403 - break; 404 - case BT_CSR_BC4: 405 - pr_info("BlueTooth BT_CoexistType = BT_CSR_BC4\n"); 406 - break; 407 - case BT_CSR_BC8: 408 - pr_info("BlueTooth BT_CoexistType = BT_CSR_BC8\n"); 409 - break; 410 - case BT_RTL8756: 411 - pr_info("BlueTooth BT_CoexistType = BT_RTL8756\n"); 412 - break; 413 - default: 414 - pr_info("BlueTooth BT_CoexistType = Unknown\n"); 415 - break; 416 - } 417 - pr_info("BlueTooth BT_Ant_isolation = %d\n", 418 - pbtpriv->BT_Ant_isolation); 419 - switch (pbtpriv->BT_Service) { 420 - case BT_OtherAction: 421 - pr_info("BlueTooth BT_Service = BT_OtherAction\n"); 422 - break; 423 - case BT_SCO: 424 - pr_info("BlueTooth BT_Service = BT_SCO\n"); 425 - break; 426 - case BT_Busy: 427 - pr_info("BlueTooth BT_Service = BT_Busy\n"); 428 - break; 429 - case BT_OtherBusy: 430 - pr_info("BlueTooth BT_Service = BT_OtherBusy\n"); 431 - break; 432 - default: 433 - pr_info("BlueTooth BT_Service = BT_Idle\n"); 434 - break; 435 - } 436 - pr_info("BT_RadioSharedType = 0x%x\n", 437 - pbtpriv->BT_RadioSharedType); 438 - } 439 - } 440 - 441 - #define GET_BT_COEXIST(priv) (&priv->bt_coexist) 442 - 443 - static void _rtl92cu_read_bluetooth_coexistInfo(struct ieee80211_hw *hw, 444 - u8 *contents, 445 - bool bautoloadfailed); 446 - { 447 - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); 448 - bool isNormal = IS_NORMAL_CHIP(pHalData->VersionID); 449 - struct btcoexist_priv *pbtpriv = &pHalData->bt_coexist; 450 - u8 rf_opt4; 451 - 452 - _rtw_memset(pbtpriv, 0, sizeof(struct btcoexist_priv)); 453 - if (AutoloadFail) { 454 - pbtpriv->BT_Coexist = _FALSE; 455 - pbtpriv->BT_CoexistType = BT_2Wire; 456 - pbtpriv->BT_Ant_Num = Ant_x2; 457 - pbtpriv->BT_Ant_isolation = 0; 458 - pbtpriv->BT_RadioSharedType = BT_Radio_Shared; 459 - return; 460 - } 461 - if (isNormal) { 462 - if (pHalData->BoardType == BOARD_USB_COMBO) 463 - pbtpriv->BT_Coexist = _TRUE; 464 - else 465 - pbtpriv->BT_Coexist = ((PROMContent[EEPROM_RF_OPT3] & 466 - 0x20) >> 5); /* bit[5] */ 467 - rf_opt4 = PROMContent[EEPROM_RF_OPT4]; 468 - pbtpriv->BT_CoexistType = ((rf_opt4&0xe)>>1); /* bit [3:1] */ 469 - pbtpriv->BT_Ant_Num = (rf_opt4&0x1); /* bit [0] */ 470 - pbtpriv->BT_Ant_isolation = ((rf_opt4&0x10)>>4); /* bit [4] */ 471 - pbtpriv->BT_RadioSharedType = ((rf_opt4&0x20)>>5); /* bit [5] */ 472 - } else { 473 - pbtpriv->BT_Coexist = (PROMContent[EEPROM_RF_OPT4] >> 4) ? 474 - _TRUE : _FALSE; 475 - } 476 - _update_bt_param(Adapter); 477 - } 478 - #endif 479 343 480 344 static void _rtl92cu_read_adapter_info(struct ieee80211_hw *hw) 481 345 { ··· 416 552 } 417 553 } 418 554 _rtl92cu_read_board_type(hw, hwinfo); 419 - #ifdef CONFIG_BT_COEXIST 420 - _rtl92cu_read_bluetooth_coexistInfo(hw, hwinfo, 421 - rtlefuse->autoload_failflag); 422 - #endif 423 555 } 424 556 425 557 static void _rtl92cu_hal_customized_behavior(struct ieee80211_hw *hw) ··· 967 1107 } 968 1108 } 969 1109 970 - static void _InitAntenna_Selection(struct ieee80211_hw *hw) 971 - { 972 - #ifdef CONFIG_ANTENNA_DIVERSITY 973 - struct rtl_priv *rtlpriv = rtl_priv(hw); 974 - struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 975 - struct rtl_phy *rtlphy = &(rtlpriv->phy); 976 - 977 - if (pHalData->AntDivCfg == 0) 978 - return; 979 - 980 - if (rtlphy->rf_type == RF_1T1R) { 981 - rtl_write_dword(rtlpriv, REG_LEDCFG0, 982 - rtl_read_dword(rtlpriv, 983 - REG_LEDCFG0)|BIT(23)); 984 - rtl_set_bbreg(hw, rFPGA0_XAB_RFPARAMETER, BIT(13), 0x01); 985 - if (rtl_get_bbreg(hw, RFPGA0_XA_RFINTERFACEOE, 0x300) == 986 - Antenna_A) 987 - pHalData->CurAntenna = Antenna_A; 988 - else 989 - pHalData->CurAntenna = Antenna_B; 990 - } 991 - #endif 992 - } 993 - 994 - static void _dump_registers(struct ieee80211_hw *hw) 995 - { 996 - } 997 - 998 1110 static void _update_mac_setting(struct ieee80211_hw *hw) 999 1111 { 1000 1112 struct rtl_priv *rtlpriv = rtl_priv(hw); ··· 1037 1205 } 1038 1206 _rtl92cu_hw_configure(hw); 1039 1207 _InitPABias(hw); 1040 - _InitAntenna_Selection(hw); 1041 1208 _update_mac_setting(hw); 1042 1209 rtl92c_dm_init(hw); 1043 - _dump_registers(hw); 1044 1210 return err; 1045 1211 } 1046 1212