PageRenderTime 114ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 1ms

/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c

https://bitbucket.org/wisechild/galaxy-nexus
C | 493 lines | 445 code | 20 blank | 28 comment | 97 complexity | d503ac664a904cbd5537d8340cb09063 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2009-2010 Realtek Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. * The full GNU General Public License is included in this distribution in the
  19. * file called LICENSE.
  20. *
  21. * Contact Information:
  22. * wlanfae <wlanfae@realtek.com>
  23. * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
  24. * Hsinchu 300, Taiwan.
  25. *
  26. * Larry Finger <Larry.Finger@lwfinger.net>
  27. *
  28. *****************************************************************************/
  29. #include "../wifi.h"
  30. #include "reg.h"
  31. #include "def.h"
  32. #include "phy.h"
  33. #include "rf.h"
  34. #include "dm.h"
  35. static bool _rtl92c_phy_rf6052_config_parafile(struct ieee80211_hw *hw);
  36. void rtl92cu_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
  37. {
  38. struct rtl_priv *rtlpriv = rtl_priv(hw);
  39. struct rtl_phy *rtlphy = &(rtlpriv->phy);
  40. switch (bandwidth) {
  41. case HT_CHANNEL_WIDTH_20:
  42. rtlphy->rfreg_chnlval[0] = ((rtlphy->rfreg_chnlval[0] &
  43. 0xfffff3ff) | 0x0400);
  44. rtl_set_rfreg(hw, RF90_PATH_A, RF_CHNLBW, RFREG_OFFSET_MASK,
  45. rtlphy->rfreg_chnlval[0]);
  46. break;
  47. case HT_CHANNEL_WIDTH_20_40:
  48. rtlphy->rfreg_chnlval[0] = ((rtlphy->rfreg_chnlval[0] &
  49. 0xfffff3ff));
  50. rtl_set_rfreg(hw, RF90_PATH_A, RF_CHNLBW, RFREG_OFFSET_MASK,
  51. rtlphy->rfreg_chnlval[0]);
  52. break;
  53. default:
  54. RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
  55. ("unknown bandwidth: %#X\n", bandwidth));
  56. break;
  57. }
  58. }
  59. void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
  60. u8 *ppowerlevel)
  61. {
  62. struct rtl_priv *rtlpriv = rtl_priv(hw);
  63. struct rtl_phy *rtlphy = &(rtlpriv->phy);
  64. struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
  65. struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
  66. struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
  67. u32 tx_agc[2] = { 0, 0 }, tmpval = 0;
  68. bool turbo_scanoff = false;
  69. u8 idx1, idx2;
  70. u8 *ptr;
  71. if (rtlhal->interface == INTF_PCI) {
  72. if (rtlefuse->eeprom_regulatory != 0)
  73. turbo_scanoff = true;
  74. } else {
  75. if ((rtlefuse->eeprom_regulatory != 0) ||
  76. (rtlefuse->external_pa))
  77. turbo_scanoff = true;
  78. }
  79. if (mac->act_scanning == true) {
  80. tx_agc[RF90_PATH_A] = 0x3f3f3f3f;
  81. tx_agc[RF90_PATH_B] = 0x3f3f3f3f;
  82. if (turbo_scanoff) {
  83. for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
  84. tx_agc[idx1] = ppowerlevel[idx1] |
  85. (ppowerlevel[idx1] << 8) |
  86. (ppowerlevel[idx1] << 16) |
  87. (ppowerlevel[idx1] << 24);
  88. if (rtlhal->interface == INTF_USB) {
  89. if (tx_agc[idx1] > 0x20 &&
  90. rtlefuse->external_pa)
  91. tx_agc[idx1] = 0x20;
  92. }
  93. }
  94. }
  95. } else {
  96. if (rtlpriv->dm.dynamic_txhighpower_lvl ==
  97. TXHIGHPWRLEVEL_LEVEL1) {
  98. tx_agc[RF90_PATH_A] = 0x10101010;
  99. tx_agc[RF90_PATH_B] = 0x10101010;
  100. } else if (rtlpriv->dm.dynamic_txhighpower_lvl ==
  101. TXHIGHPWRLEVEL_LEVEL2) {
  102. tx_agc[RF90_PATH_A] = 0x00000000;
  103. tx_agc[RF90_PATH_B] = 0x00000000;
  104. } else{
  105. for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
  106. tx_agc[idx1] = ppowerlevel[idx1] |
  107. (ppowerlevel[idx1] << 8) |
  108. (ppowerlevel[idx1] << 16) |
  109. (ppowerlevel[idx1] << 24);
  110. }
  111. if (rtlefuse->eeprom_regulatory == 0) {
  112. tmpval = (rtlphy->mcs_txpwrlevel_origoffset
  113. [0][6]) +
  114. (rtlphy->mcs_txpwrlevel_origoffset
  115. [0][7] << 8);
  116. tx_agc[RF90_PATH_A] += tmpval;
  117. tmpval = (rtlphy->mcs_txpwrlevel_origoffset
  118. [0][14]) +
  119. (rtlphy->mcs_txpwrlevel_origoffset
  120. [0][15] << 24);
  121. tx_agc[RF90_PATH_B] += tmpval;
  122. }
  123. }
  124. }
  125. for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
  126. ptr = (u8 *) (&(tx_agc[idx1]));
  127. for (idx2 = 0; idx2 < 4; idx2++) {
  128. if (*ptr > RF6052_MAX_TX_PWR)
  129. *ptr = RF6052_MAX_TX_PWR;
  130. ptr++;
  131. }
  132. }
  133. tmpval = tx_agc[RF90_PATH_A] & 0xff;
  134. rtl_set_bbreg(hw, RTXAGC_A_CCK1_MCS32, MASKBYTE1, tmpval);
  135. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  136. ("CCK PWR 1M (rf-A) = 0x%x (reg 0x%x)\n", tmpval,
  137. RTXAGC_A_CCK1_MCS32));
  138. tmpval = tx_agc[RF90_PATH_A] >> 8;
  139. if (mac->mode == WIRELESS_MODE_B)
  140. tmpval = tmpval & 0xff00ffff;
  141. rtl_set_bbreg(hw, RTXAGC_B_CCK11_A_CCK2_11, 0xffffff00, tmpval);
  142. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  143. ("CCK PWR 2~11M (rf-A) = 0x%x (reg 0x%x)\n", tmpval,
  144. RTXAGC_B_CCK11_A_CCK2_11));
  145. tmpval = tx_agc[RF90_PATH_B] >> 24;
  146. rtl_set_bbreg(hw, RTXAGC_B_CCK11_A_CCK2_11, MASKBYTE0, tmpval);
  147. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  148. ("CCK PWR 11M (rf-B) = 0x%x (reg 0x%x)\n", tmpval,
  149. RTXAGC_B_CCK11_A_CCK2_11));
  150. tmpval = tx_agc[RF90_PATH_B] & 0x00ffffff;
  151. rtl_set_bbreg(hw, RTXAGC_B_CCK1_55_MCS32, 0xffffff00, tmpval);
  152. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  153. ("CCK PWR 1~5.5M (rf-B) = 0x%x (reg 0x%x)\n", tmpval,
  154. RTXAGC_B_CCK1_55_MCS32));
  155. }
  156. static void rtl92c_phy_get_power_base(struct ieee80211_hw *hw,
  157. u8 *ppowerlevel, u8 channel,
  158. u32 *ofdmbase, u32 *mcsbase)
  159. {
  160. struct rtl_priv *rtlpriv = rtl_priv(hw);
  161. struct rtl_phy *rtlphy = &(rtlpriv->phy);
  162. struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
  163. u32 powerBase0, powerBase1;
  164. u8 legacy_pwrdiff = 0, ht20_pwrdiff = 0;
  165. u8 i, powerlevel[2];
  166. for (i = 0; i < 2; i++) {
  167. powerlevel[i] = ppowerlevel[i];
  168. legacy_pwrdiff = rtlefuse->txpwr_legacyhtdiff[i][channel - 1];
  169. powerBase0 = powerlevel[i] + legacy_pwrdiff;
  170. powerBase0 = (powerBase0 << 24) | (powerBase0 << 16) |
  171. (powerBase0 << 8) | powerBase0;
  172. *(ofdmbase + i) = powerBase0;
  173. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  174. (" [OFDM power base index rf(%c) = 0x%x]\n",
  175. ((i == 0) ? 'A' : 'B'), *(ofdmbase + i)));
  176. }
  177. for (i = 0; i < 2; i++) {
  178. if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20) {
  179. ht20_pwrdiff = rtlefuse->txpwr_ht20diff[i][channel - 1];
  180. powerlevel[i] += ht20_pwrdiff;
  181. }
  182. powerBase1 = powerlevel[i];
  183. powerBase1 = (powerBase1 << 24) |
  184. (powerBase1 << 16) | (powerBase1 << 8) | powerBase1;
  185. *(mcsbase + i) = powerBase1;
  186. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  187. (" [MCS power base index rf(%c) = 0x%x]\n",
  188. ((i == 0) ? 'A' : 'B'), *(mcsbase + i)));
  189. }
  190. }
  191. static void _rtl92c_get_txpower_writeval_by_regulatory(struct ieee80211_hw *hw,
  192. u8 channel, u8 index,
  193. u32 *powerBase0,
  194. u32 *powerBase1,
  195. u32 *p_outwriteval)
  196. {
  197. struct rtl_priv *rtlpriv = rtl_priv(hw);
  198. struct rtl_phy *rtlphy = &(rtlpriv->phy);
  199. struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
  200. u8 i, chnlgroup = 0, pwr_diff_limit[4];
  201. u32 writeVal, customer_limit, rf;
  202. for (rf = 0; rf < 2; rf++) {
  203. switch (rtlefuse->eeprom_regulatory) {
  204. case 0:
  205. chnlgroup = 0;
  206. writeVal = rtlphy->mcs_txpwrlevel_origoffset
  207. [chnlgroup][index + (rf ? 8 : 0)]
  208. + ((index < 2) ? powerBase0[rf] : powerBase1[rf]);
  209. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  210. ("RTK better performance,writeVal(%c) = 0x%x\n",
  211. ((rf == 0) ? 'A' : 'B'), writeVal));
  212. break;
  213. case 1:
  214. if (rtlphy->pwrgroup_cnt == 1)
  215. chnlgroup = 0;
  216. if (rtlphy->pwrgroup_cnt >= 3) {
  217. if (channel <= 3)
  218. chnlgroup = 0;
  219. else if (channel >= 4 && channel <= 9)
  220. chnlgroup = 1;
  221. else if (channel > 9)
  222. chnlgroup = 2;
  223. if (rtlphy->current_chan_bw ==
  224. HT_CHANNEL_WIDTH_20)
  225. chnlgroup++;
  226. else
  227. chnlgroup += 4;
  228. }
  229. writeVal = rtlphy->mcs_txpwrlevel_origoffset
  230. [chnlgroup][index +
  231. (rf ? 8 : 0)] +
  232. ((index < 2) ? powerBase0[rf] :
  233. powerBase1[rf]);
  234. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  235. ("Realtek regulatory, 20MHz, "
  236. "writeVal(%c) = 0x%x\n",
  237. ((rf == 0) ? 'A' : 'B'), writeVal));
  238. break;
  239. case 2:
  240. writeVal = ((index < 2) ? powerBase0[rf] :
  241. powerBase1[rf]);
  242. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  243. ("Better regulatory,writeVal(%c) = 0x%x\n",
  244. ((rf == 0) ? 'A' : 'B'), writeVal));
  245. break;
  246. case 3:
  247. chnlgroup = 0;
  248. if (rtlphy->current_chan_bw ==
  249. HT_CHANNEL_WIDTH_20_40) {
  250. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  251. ("customer's limit, 40MHzrf(%c) = "
  252. "0x%x\n", ((rf == 0) ? 'A' : 'B'),
  253. rtlefuse->pwrgroup_ht40[rf]
  254. [channel - 1]));
  255. } else {
  256. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  257. ("customer's limit, 20MHz rf(%c) = "
  258. "0x%x\n", ((rf == 0) ? 'A' : 'B'),
  259. rtlefuse->pwrgroup_ht20[rf]
  260. [channel - 1]));
  261. }
  262. for (i = 0; i < 4; i++) {
  263. pwr_diff_limit[i] =
  264. (u8) ((rtlphy->mcs_txpwrlevel_origoffset
  265. [chnlgroup][index + (rf ? 8 : 0)]
  266. & (0x7f << (i * 8))) >> (i * 8));
  267. if (rtlphy->current_chan_bw ==
  268. HT_CHANNEL_WIDTH_20_40) {
  269. if (pwr_diff_limit[i] >
  270. rtlefuse->pwrgroup_ht40[rf]
  271. [channel - 1])
  272. pwr_diff_limit[i] = rtlefuse->
  273. pwrgroup_ht40[rf]
  274. [channel - 1];
  275. } else {
  276. if (pwr_diff_limit[i] >
  277. rtlefuse->pwrgroup_ht20[rf]
  278. [channel - 1])
  279. pwr_diff_limit[i] =
  280. rtlefuse->pwrgroup_ht20[rf]
  281. [channel - 1];
  282. }
  283. }
  284. customer_limit = (pwr_diff_limit[3] << 24) |
  285. (pwr_diff_limit[2] << 16) |
  286. (pwr_diff_limit[1] << 8) | (pwr_diff_limit[0]);
  287. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  288. ("Customer's limit rf(%c) = 0x%x\n",
  289. ((rf == 0) ? 'A' : 'B'), customer_limit));
  290. writeVal = customer_limit + ((index < 2) ?
  291. powerBase0[rf] : powerBase1[rf]);
  292. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  293. ("Customer, writeVal rf(%c)= 0x%x\n",
  294. ((rf == 0) ? 'A' : 'B'), writeVal));
  295. break;
  296. default:
  297. chnlgroup = 0;
  298. writeVal = rtlphy->mcs_txpwrlevel_origoffset[chnlgroup]
  299. [index + (rf ? 8 : 0)] + ((index < 2) ?
  300. powerBase0[rf] : powerBase1[rf]);
  301. RTPRINT(rtlpriv, FPHY, PHY_TXPWR, ("RTK better "
  302. "performance, writeValrf(%c) = 0x%x\n",
  303. ((rf == 0) ? 'A' : 'B'), writeVal));
  304. break;
  305. }
  306. if (rtlpriv->dm.dynamic_txhighpower_lvl ==
  307. TXHIGHPWRLEVEL_LEVEL1)
  308. writeVal = 0x14141414;
  309. else if (rtlpriv->dm.dynamic_txhighpower_lvl ==
  310. TXHIGHPWRLEVEL_LEVEL2)
  311. writeVal = 0x00000000;
  312. if (rtlpriv->dm.dynamic_txhighpower_lvl == TXHIGHPWRLEVEL_BT1)
  313. writeVal = writeVal - 0x06060606;
  314. else if (rtlpriv->dm.dynamic_txhighpower_lvl ==
  315. TXHIGHPWRLEVEL_BT2)
  316. writeVal = writeVal;
  317. *(p_outwriteval + rf) = writeVal;
  318. }
  319. }
  320. static void _rtl92c_write_ofdm_power_reg(struct ieee80211_hw *hw,
  321. u8 index, u32 *pValue)
  322. {
  323. struct rtl_priv *rtlpriv = rtl_priv(hw);
  324. struct rtl_phy *rtlphy = &(rtlpriv->phy);
  325. u16 regoffset_a[6] = {
  326. RTXAGC_A_RATE18_06, RTXAGC_A_RATE54_24,
  327. RTXAGC_A_MCS03_MCS00, RTXAGC_A_MCS07_MCS04,
  328. RTXAGC_A_MCS11_MCS08, RTXAGC_A_MCS15_MCS12
  329. };
  330. u16 regoffset_b[6] = {
  331. RTXAGC_B_RATE18_06, RTXAGC_B_RATE54_24,
  332. RTXAGC_B_MCS03_MCS00, RTXAGC_B_MCS07_MCS04,
  333. RTXAGC_B_MCS11_MCS08, RTXAGC_B_MCS15_MCS12
  334. };
  335. u8 i, rf, pwr_val[4];
  336. u32 writeVal;
  337. u16 regoffset;
  338. for (rf = 0; rf < 2; rf++) {
  339. writeVal = pValue[rf];
  340. for (i = 0; i < 4; i++) {
  341. pwr_val[i] = (u8)((writeVal & (0x7f << (i * 8))) >>
  342. (i * 8));
  343. if (pwr_val[i] > RF6052_MAX_TX_PWR)
  344. pwr_val[i] = RF6052_MAX_TX_PWR;
  345. }
  346. writeVal = (pwr_val[3] << 24) | (pwr_val[2] << 16) |
  347. (pwr_val[1] << 8) | pwr_val[0];
  348. if (rf == 0)
  349. regoffset = regoffset_a[index];
  350. else
  351. regoffset = regoffset_b[index];
  352. rtl_set_bbreg(hw, regoffset, MASKDWORD, writeVal);
  353. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  354. ("Set 0x%x = %08x\n", regoffset, writeVal));
  355. if (((get_rf_type(rtlphy) == RF_2T2R) &&
  356. (regoffset == RTXAGC_A_MCS15_MCS12 ||
  357. regoffset == RTXAGC_B_MCS15_MCS12)) ||
  358. ((get_rf_type(rtlphy) != RF_2T2R) &&
  359. (regoffset == RTXAGC_A_MCS07_MCS04 ||
  360. regoffset == RTXAGC_B_MCS07_MCS04))) {
  361. writeVal = pwr_val[3];
  362. if (regoffset == RTXAGC_A_MCS15_MCS12 ||
  363. regoffset == RTXAGC_A_MCS07_MCS04)
  364. regoffset = 0xc90;
  365. if (regoffset == RTXAGC_B_MCS15_MCS12 ||
  366. regoffset == RTXAGC_B_MCS07_MCS04)
  367. regoffset = 0xc98;
  368. for (i = 0; i < 3; i++) {
  369. writeVal = (writeVal > 6) ? (writeVal - 6) : 0;
  370. rtl_write_byte(rtlpriv, (u32)(regoffset + i),
  371. (u8)writeVal);
  372. }
  373. }
  374. }
  375. }
  376. void rtl92cu_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw,
  377. u8 *ppowerlevel, u8 channel)
  378. {
  379. u32 writeVal[2], powerBase0[2], powerBase1[2];
  380. u8 index = 0;
  381. rtl92c_phy_get_power_base(hw, ppowerlevel,
  382. channel, &powerBase0[0], &powerBase1[0]);
  383. for (index = 0; index < 6; index++) {
  384. _rtl92c_get_txpower_writeval_by_regulatory(hw,
  385. channel, index,
  386. &powerBase0[0],
  387. &powerBase1[0],
  388. &writeVal[0]);
  389. _rtl92c_write_ofdm_power_reg(hw, index, &writeVal[0]);
  390. }
  391. }
  392. bool rtl92cu_phy_rf6052_config(struct ieee80211_hw *hw)
  393. {
  394. struct rtl_priv *rtlpriv = rtl_priv(hw);
  395. struct rtl_phy *rtlphy = &(rtlpriv->phy);
  396. bool rtstatus = true;
  397. u8 b_reg_hwparafile = 1;
  398. if (rtlphy->rf_type == RF_1T1R)
  399. rtlphy->num_total_rfpath = 1;
  400. else
  401. rtlphy->num_total_rfpath = 2;
  402. if (b_reg_hwparafile == 1)
  403. rtstatus = _rtl92c_phy_rf6052_config_parafile(hw);
  404. return rtstatus;
  405. }
  406. static bool _rtl92c_phy_rf6052_config_parafile(struct ieee80211_hw *hw)
  407. {
  408. struct rtl_priv *rtlpriv = rtl_priv(hw);
  409. struct rtl_phy *rtlphy = &(rtlpriv->phy);
  410. u32 u4_regvalue = 0;
  411. u8 rfpath;
  412. bool rtstatus = true;
  413. struct bb_reg_def *pphyreg;
  414. for (rfpath = 0; rfpath < rtlphy->num_total_rfpath; rfpath++) {
  415. pphyreg = &rtlphy->phyreg_def[rfpath];
  416. switch (rfpath) {
  417. case RF90_PATH_A:
  418. case RF90_PATH_C:
  419. u4_regvalue = rtl_get_bbreg(hw, pphyreg->rfintfs,
  420. BRFSI_RFENV);
  421. break;
  422. case RF90_PATH_B:
  423. case RF90_PATH_D:
  424. u4_regvalue = rtl_get_bbreg(hw, pphyreg->rfintfs,
  425. BRFSI_RFENV << 16);
  426. break;
  427. }
  428. rtl_set_bbreg(hw, pphyreg->rfintfe, BRFSI_RFENV << 16, 0x1);
  429. udelay(1);
  430. rtl_set_bbreg(hw, pphyreg->rfintfo, BRFSI_RFENV, 0x1);
  431. udelay(1);
  432. rtl_set_bbreg(hw, pphyreg->rfhssi_para2,
  433. B3WIREADDREAALENGTH, 0x0);
  434. udelay(1);
  435. rtl_set_bbreg(hw, pphyreg->rfhssi_para2, B3WIREDATALENGTH, 0x0);
  436. udelay(1);
  437. switch (rfpath) {
  438. case RF90_PATH_A:
  439. rtstatus = rtl92cu_phy_config_rf_with_headerfile(hw,
  440. (enum radio_path) rfpath);
  441. break;
  442. case RF90_PATH_B:
  443. rtstatus = rtl92cu_phy_config_rf_with_headerfile(hw,
  444. (enum radio_path) rfpath);
  445. break;
  446. case RF90_PATH_C:
  447. break;
  448. case RF90_PATH_D:
  449. break;
  450. }
  451. switch (rfpath) {
  452. case RF90_PATH_A:
  453. case RF90_PATH_C:
  454. rtl_set_bbreg(hw, pphyreg->rfintfs,
  455. BRFSI_RFENV, u4_regvalue);
  456. break;
  457. case RF90_PATH_B:
  458. case RF90_PATH_D:
  459. rtl_set_bbreg(hw, pphyreg->rfintfs,
  460. BRFSI_RFENV << 16, u4_regvalue);
  461. break;
  462. }
  463. if (rtstatus != true) {
  464. RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
  465. ("Radio[%d] Fail!!", rfpath));
  466. goto phy_rf_cfg_fail;
  467. }
  468. }
  469. RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("<---\n"));
  470. return rtstatus;
  471. phy_rf_cfg_fail:
  472. return rtstatus;
  473. }