rf.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2009-2012 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_mac *mac = rtl_mac(rtl_priv(hw));
  65. struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
  66. u32 tx_agc[2] = { 0, 0 }, tmpval = 0;
  67. bool turbo_scanoff = false;
  68. u8 idx1, idx2;
  69. u8 *ptr;
  70. if ((rtlefuse->eeprom_regulatory != 0) || (rtlefuse->external_pa))
  71. turbo_scanoff = true;
  72. if (mac->act_scanning) {
  73. tx_agc[RF90_PATH_A] = 0x3f3f3f3f;
  74. tx_agc[RF90_PATH_B] = 0x3f3f3f3f;
  75. for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
  76. tx_agc[idx1] = ppowerlevel[idx1] |
  77. (ppowerlevel[idx1] << 8) |
  78. (ppowerlevel[idx1] << 16) |
  79. (ppowerlevel[idx1] << 24);
  80. if (tx_agc[idx1] > 0x20 && rtlefuse->external_pa)
  81. tx_agc[idx1] = 0x20;
  82. }
  83. } else {
  84. if (rtlpriv->dm.dynamic_txhighpower_lvl ==
  85. TXHIGHPWRLEVEL_LEVEL1) {
  86. tx_agc[RF90_PATH_A] = 0x10101010;
  87. tx_agc[RF90_PATH_B] = 0x10101010;
  88. } else if (rtlpriv->dm.dynamic_txhighpower_lvl ==
  89. TXHIGHPWRLEVEL_LEVEL2) {
  90. tx_agc[RF90_PATH_A] = 0x00000000;
  91. tx_agc[RF90_PATH_B] = 0x00000000;
  92. } else {
  93. for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
  94. tx_agc[idx1] = ppowerlevel[idx1] |
  95. (ppowerlevel[idx1] << 8) |
  96. (ppowerlevel[idx1] << 16) |
  97. (ppowerlevel[idx1] << 24);
  98. }
  99. if (rtlefuse->eeprom_regulatory == 0) {
  100. tmpval = (rtlphy->mcs_offset[0][6]) +
  101. (rtlphy->mcs_offset[0][7] << 8);
  102. tx_agc[RF90_PATH_A] += tmpval;
  103. tmpval = (rtlphy->mcs_offset[0][14]) +
  104. (rtlphy->mcs_offset[0][15] << 24);
  105. tx_agc[RF90_PATH_B] += tmpval;
  106. }
  107. }
  108. }
  109. for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
  110. ptr = (u8 *) (&(tx_agc[idx1]));
  111. for (idx2 = 0; idx2 < 4; idx2++) {
  112. if (*ptr > RF6052_MAX_TX_PWR)
  113. *ptr = RF6052_MAX_TX_PWR;
  114. ptr++;
  115. }
  116. }
  117. tmpval = tx_agc[RF90_PATH_A] & 0xff;
  118. rtl_set_bbreg(hw, RTXAGC_A_CCK1_MCS32, MASKBYTE1, tmpval);
  119. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  120. "CCK PWR 1M (rf-A) = 0x%x (reg 0x%x)\n",
  121. tmpval, RTXAGC_A_CCK1_MCS32);
  122. tmpval = tx_agc[RF90_PATH_A] >> 8;
  123. if (mac->mode == WIRELESS_MODE_B)
  124. tmpval = tmpval & 0xff00ffff;
  125. rtl_set_bbreg(hw, RTXAGC_B_CCK11_A_CCK2_11, 0xffffff00, tmpval);
  126. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  127. "CCK PWR 2~11M (rf-A) = 0x%x (reg 0x%x)\n",
  128. tmpval, RTXAGC_B_CCK11_A_CCK2_11);
  129. tmpval = tx_agc[RF90_PATH_B] >> 24;
  130. rtl_set_bbreg(hw, RTXAGC_B_CCK11_A_CCK2_11, MASKBYTE0, tmpval);
  131. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  132. "CCK PWR 11M (rf-B) = 0x%x (reg 0x%x)\n",
  133. tmpval, RTXAGC_B_CCK11_A_CCK2_11);
  134. tmpval = tx_agc[RF90_PATH_B] & 0x00ffffff;
  135. rtl_set_bbreg(hw, RTXAGC_B_CCK1_55_MCS32, 0xffffff00, tmpval);
  136. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  137. "CCK PWR 1~5.5M (rf-B) = 0x%x (reg 0x%x)\n",
  138. tmpval, RTXAGC_B_CCK1_55_MCS32);
  139. }
  140. static void rtl92c_phy_get_power_base(struct ieee80211_hw *hw,
  141. u8 *ppowerlevel, u8 channel,
  142. u32 *ofdmbase, u32 *mcsbase)
  143. {
  144. struct rtl_priv *rtlpriv = rtl_priv(hw);
  145. struct rtl_phy *rtlphy = &(rtlpriv->phy);
  146. struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
  147. u32 powerBase0, powerBase1;
  148. u8 legacy_pwrdiff = 0, ht20_pwrdiff = 0;
  149. u8 i, powerlevel[2];
  150. for (i = 0; i < 2; i++) {
  151. powerlevel[i] = ppowerlevel[i];
  152. legacy_pwrdiff = rtlefuse->txpwr_legacyhtdiff[i][channel - 1];
  153. powerBase0 = powerlevel[i] + legacy_pwrdiff;
  154. powerBase0 = (powerBase0 << 24) | (powerBase0 << 16) |
  155. (powerBase0 << 8) | powerBase0;
  156. *(ofdmbase + i) = powerBase0;
  157. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  158. " [OFDM power base index rf(%c) = 0x%x]\n",
  159. i == 0 ? 'A' : 'B', *(ofdmbase + i));
  160. }
  161. for (i = 0; i < 2; i++) {
  162. if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20) {
  163. ht20_pwrdiff = rtlefuse->txpwr_ht20diff[i][channel - 1];
  164. powerlevel[i] += ht20_pwrdiff;
  165. }
  166. powerBase1 = powerlevel[i];
  167. powerBase1 = (powerBase1 << 24) |
  168. (powerBase1 << 16) | (powerBase1 << 8) | powerBase1;
  169. *(mcsbase + i) = powerBase1;
  170. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  171. " [MCS power base index rf(%c) = 0x%x]\n",
  172. i == 0 ? 'A' : 'B', *(mcsbase + i));
  173. }
  174. }
  175. static void _rtl92c_get_txpower_writeval_by_regulatory(struct ieee80211_hw *hw,
  176. u8 channel, u8 index,
  177. u32 *powerBase0,
  178. u32 *powerBase1,
  179. u32 *p_outwriteval)
  180. {
  181. struct rtl_priv *rtlpriv = rtl_priv(hw);
  182. struct rtl_phy *rtlphy = &(rtlpriv->phy);
  183. struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
  184. u8 i, chnlgroup = 0, pwr_diff_limit[4];
  185. u32 writeVal, customer_limit, rf;
  186. for (rf = 0; rf < 2; rf++) {
  187. switch (rtlefuse->eeprom_regulatory) {
  188. case 0:
  189. chnlgroup = 0;
  190. writeVal = rtlphy->mcs_offset
  191. [chnlgroup][index + (rf ? 8 : 0)]
  192. + ((index < 2) ? powerBase0[rf] : powerBase1[rf]);
  193. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  194. "RTK better performance,writeVal(%c) = 0x%x\n",
  195. rf == 0 ? 'A' : 'B', writeVal);
  196. break;
  197. case 1:
  198. if (rtlphy->pwrgroup_cnt == 1)
  199. chnlgroup = 0;
  200. if (rtlphy->pwrgroup_cnt >= 3) {
  201. if (channel <= 3)
  202. chnlgroup = 0;
  203. else if (channel >= 4 && channel <= 9)
  204. chnlgroup = 1;
  205. else if (channel > 9)
  206. chnlgroup = 2;
  207. if (rtlphy->current_chan_bw ==
  208. HT_CHANNEL_WIDTH_20)
  209. chnlgroup++;
  210. else
  211. chnlgroup += 4;
  212. }
  213. writeVal = rtlphy->mcs_offset[chnlgroup][index +
  214. (rf ? 8 : 0)] +
  215. ((index < 2) ? powerBase0[rf] :
  216. powerBase1[rf]);
  217. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  218. "Realtek regulatory, 20MHz, writeVal(%c) = 0x%x\n",
  219. rf == 0 ? 'A' : 'B', writeVal);
  220. break;
  221. case 2:
  222. writeVal = ((index < 2) ? powerBase0[rf] :
  223. powerBase1[rf]);
  224. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  225. "Better regulatory,writeVal(%c) = 0x%x\n",
  226. rf == 0 ? 'A' : 'B', writeVal);
  227. break;
  228. case 3:
  229. chnlgroup = 0;
  230. if (rtlphy->current_chan_bw ==
  231. HT_CHANNEL_WIDTH_20_40) {
  232. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  233. "customer's limit, 40MHzrf(%c) = 0x%x\n",
  234. rf == 0 ? 'A' : 'B',
  235. rtlefuse->pwrgroup_ht40[rf]
  236. [channel - 1]);
  237. } else {
  238. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  239. "customer's limit, 20MHz rf(%c) = 0x%x\n",
  240. rf == 0 ? 'A' : 'B',
  241. rtlefuse->pwrgroup_ht20[rf]
  242. [channel - 1]);
  243. }
  244. for (i = 0; i < 4; i++) {
  245. pwr_diff_limit[i] = (u8) ((rtlphy->mcs_offset
  246. [chnlgroup][index + (rf ? 8 : 0)]
  247. & (0x7f << (i * 8))) >> (i * 8));
  248. if (rtlphy->current_chan_bw ==
  249. HT_CHANNEL_WIDTH_20_40) {
  250. if (pwr_diff_limit[i] >
  251. rtlefuse->pwrgroup_ht40[rf]
  252. [channel - 1])
  253. pwr_diff_limit[i] = rtlefuse->
  254. pwrgroup_ht40[rf]
  255. [channel - 1];
  256. } else {
  257. if (pwr_diff_limit[i] >
  258. rtlefuse->pwrgroup_ht20[rf]
  259. [channel - 1])
  260. pwr_diff_limit[i] =
  261. rtlefuse->pwrgroup_ht20[rf]
  262. [channel - 1];
  263. }
  264. }
  265. customer_limit = (pwr_diff_limit[3] << 24) |
  266. (pwr_diff_limit[2] << 16) |
  267. (pwr_diff_limit[1] << 8) | (pwr_diff_limit[0]);
  268. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  269. "Customer's limit rf(%c) = 0x%x\n",
  270. rf == 0 ? 'A' : 'B', customer_limit);
  271. writeVal = customer_limit + ((index < 2) ?
  272. powerBase0[rf] : powerBase1[rf]);
  273. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  274. "Customer, writeVal rf(%c)= 0x%x\n",
  275. rf == 0 ? 'A' : 'B', writeVal);
  276. break;
  277. default:
  278. chnlgroup = 0;
  279. writeVal = rtlphy->mcs_offset[chnlgroup]
  280. [index + (rf ? 8 : 0)] + ((index < 2) ?
  281. powerBase0[rf] : powerBase1[rf]);
  282. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  283. "RTK better performance, writeValrf(%c) = 0x%x\n",
  284. rf == 0 ? 'A' : 'B', writeVal);
  285. break;
  286. }
  287. if (rtlpriv->dm.dynamic_txhighpower_lvl ==
  288. TXHIGHPWRLEVEL_LEVEL1)
  289. writeVal = 0x14141414;
  290. else if (rtlpriv->dm.dynamic_txhighpower_lvl ==
  291. TXHIGHPWRLEVEL_LEVEL2)
  292. writeVal = 0x00000000;
  293. if (rtlpriv->dm.dynamic_txhighpower_lvl == TXHIGHPWRLEVEL_BT1)
  294. writeVal = writeVal - 0x06060606;
  295. else if (rtlpriv->dm.dynamic_txhighpower_lvl ==
  296. TXHIGHPWRLEVEL_BT2)
  297. writeVal = writeVal;
  298. *(p_outwriteval + rf) = writeVal;
  299. }
  300. }
  301. static void _rtl92c_write_ofdm_power_reg(struct ieee80211_hw *hw,
  302. u8 index, u32 *pValue)
  303. {
  304. struct rtl_priv *rtlpriv = rtl_priv(hw);
  305. struct rtl_phy *rtlphy = &(rtlpriv->phy);
  306. u16 regoffset_a[6] = {
  307. RTXAGC_A_RATE18_06, RTXAGC_A_RATE54_24,
  308. RTXAGC_A_MCS03_MCS00, RTXAGC_A_MCS07_MCS04,
  309. RTXAGC_A_MCS11_MCS08, RTXAGC_A_MCS15_MCS12
  310. };
  311. u16 regoffset_b[6] = {
  312. RTXAGC_B_RATE18_06, RTXAGC_B_RATE54_24,
  313. RTXAGC_B_MCS03_MCS00, RTXAGC_B_MCS07_MCS04,
  314. RTXAGC_B_MCS11_MCS08, RTXAGC_B_MCS15_MCS12
  315. };
  316. u8 i, rf, pwr_val[4];
  317. u32 writeVal;
  318. u16 regoffset;
  319. for (rf = 0; rf < 2; rf++) {
  320. writeVal = pValue[rf];
  321. for (i = 0; i < 4; i++) {
  322. pwr_val[i] = (u8)((writeVal & (0x7f << (i * 8))) >>
  323. (i * 8));
  324. if (pwr_val[i] > RF6052_MAX_TX_PWR)
  325. pwr_val[i] = RF6052_MAX_TX_PWR;
  326. }
  327. writeVal = (pwr_val[3] << 24) | (pwr_val[2] << 16) |
  328. (pwr_val[1] << 8) | pwr_val[0];
  329. if (rf == 0)
  330. regoffset = regoffset_a[index];
  331. else
  332. regoffset = regoffset_b[index];
  333. rtl_set_bbreg(hw, regoffset, MASKDWORD, writeVal);
  334. RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
  335. "Set 0x%x = %08x\n", regoffset, writeVal);
  336. if (((get_rf_type(rtlphy) == RF_2T2R) &&
  337. (regoffset == RTXAGC_A_MCS15_MCS12 ||
  338. regoffset == RTXAGC_B_MCS15_MCS12)) ||
  339. ((get_rf_type(rtlphy) != RF_2T2R) &&
  340. (regoffset == RTXAGC_A_MCS07_MCS04 ||
  341. regoffset == RTXAGC_B_MCS07_MCS04))) {
  342. writeVal = pwr_val[3];
  343. if (regoffset == RTXAGC_A_MCS15_MCS12 ||
  344. regoffset == RTXAGC_A_MCS07_MCS04)
  345. regoffset = 0xc90;
  346. if (regoffset == RTXAGC_B_MCS15_MCS12 ||
  347. regoffset == RTXAGC_B_MCS07_MCS04)
  348. regoffset = 0xc98;
  349. for (i = 0; i < 3; i++) {
  350. if (i != 2)
  351. writeVal = (writeVal > 8) ?
  352. (writeVal - 8) : 0;
  353. else
  354. writeVal = (writeVal > 6) ?
  355. (writeVal - 6) : 0;
  356. rtl_write_byte(rtlpriv, (u32)(regoffset + i),
  357. (u8)writeVal);
  358. }
  359. }
  360. }
  361. }
  362. void rtl92cu_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw,
  363. u8 *ppowerlevel, u8 channel)
  364. {
  365. u32 writeVal[2], powerBase0[2], powerBase1[2];
  366. u8 index = 0;
  367. rtl92c_phy_get_power_base(hw, ppowerlevel,
  368. channel, &powerBase0[0], &powerBase1[0]);
  369. for (index = 0; index < 6; index++) {
  370. _rtl92c_get_txpower_writeval_by_regulatory(hw,
  371. channel, index,
  372. &powerBase0[0],
  373. &powerBase1[0],
  374. &writeVal[0]);
  375. _rtl92c_write_ofdm_power_reg(hw, index, &writeVal[0]);
  376. }
  377. }
  378. bool rtl92cu_phy_rf6052_config(struct ieee80211_hw *hw)
  379. {
  380. struct rtl_priv *rtlpriv = rtl_priv(hw);
  381. struct rtl_phy *rtlphy = &(rtlpriv->phy);
  382. bool rtstatus = true;
  383. u8 b_reg_hwparafile = 1;
  384. if (rtlphy->rf_type == RF_1T1R)
  385. rtlphy->num_total_rfpath = 1;
  386. else
  387. rtlphy->num_total_rfpath = 2;
  388. if (b_reg_hwparafile == 1)
  389. rtstatus = _rtl92c_phy_rf6052_config_parafile(hw);
  390. return rtstatus;
  391. }
  392. static bool _rtl92c_phy_rf6052_config_parafile(struct ieee80211_hw *hw)
  393. {
  394. struct rtl_priv *rtlpriv = rtl_priv(hw);
  395. struct rtl_phy *rtlphy = &(rtlpriv->phy);
  396. u32 u4_regvalue = 0;
  397. u8 rfpath;
  398. bool rtstatus = true;
  399. struct bb_reg_def *pphyreg;
  400. for (rfpath = 0; rfpath < rtlphy->num_total_rfpath; rfpath++) {
  401. pphyreg = &rtlphy->phyreg_def[rfpath];
  402. switch (rfpath) {
  403. case RF90_PATH_A:
  404. case RF90_PATH_C:
  405. u4_regvalue = rtl_get_bbreg(hw, pphyreg->rfintfs,
  406. BRFSI_RFENV);
  407. break;
  408. case RF90_PATH_B:
  409. case RF90_PATH_D:
  410. u4_regvalue = rtl_get_bbreg(hw, pphyreg->rfintfs,
  411. BRFSI_RFENV << 16);
  412. break;
  413. }
  414. rtl_set_bbreg(hw, pphyreg->rfintfe, BRFSI_RFENV << 16, 0x1);
  415. udelay(1);
  416. rtl_set_bbreg(hw, pphyreg->rfintfo, BRFSI_RFENV, 0x1);
  417. udelay(1);
  418. rtl_set_bbreg(hw, pphyreg->rfhssi_para2,
  419. B3WIREADDREAALENGTH, 0x0);
  420. udelay(1);
  421. rtl_set_bbreg(hw, pphyreg->rfhssi_para2, B3WIREDATALENGTH, 0x0);
  422. udelay(1);
  423. switch (rfpath) {
  424. case RF90_PATH_A:
  425. case RF90_PATH_B:
  426. rtstatus = rtl92cu_phy_config_rf_with_headerfile(hw,
  427. (enum radio_path) rfpath);
  428. break;
  429. case RF90_PATH_C:
  430. break;
  431. case RF90_PATH_D:
  432. break;
  433. }
  434. switch (rfpath) {
  435. case RF90_PATH_A:
  436. case RF90_PATH_C:
  437. rtl_set_bbreg(hw, pphyreg->rfintfs,
  438. BRFSI_RFENV, u4_regvalue);
  439. break;
  440. case RF90_PATH_B:
  441. case RF90_PATH_D:
  442. rtl_set_bbreg(hw, pphyreg->rfintfs,
  443. BRFSI_RFENV << 16, u4_regvalue);
  444. break;
  445. }
  446. if (!rtstatus) {
  447. RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
  448. "Radio[%d] Fail!!", rfpath);
  449. goto phy_rf_cfg_fail;
  450. }
  451. }
  452. RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "<---\n");
  453. phy_rf_cfg_fail:
  454. return rtstatus;
  455. }