1 /******************************************************************************
3 * Copyright(c) 2009-2012 Realtek Corporation.
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.
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
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
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
21 * Contact Information:
22 * wlanfae <wlanfae@realtek.com>
23 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
24 * Hsinchu 300, Taiwan.
26 * Larry Finger <Larry.Finger@lwfinger.net>
28 *****************************************************************************/
37 #include "../rtl8192c/phy_common.h"
40 #include "../rtl8192c/dm_common.h"
41 #include "../rtl8192c/fw_common.h"
44 u32
rtl92cu_phy_query_rf_reg(struct ieee80211_hw
*hw
,
45 enum radio_path rfpath
, u32 regaddr
, u32 bitmask
)
47 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
48 u32 original_value
, readback_value
, bitshift
;
49 struct rtl_phy
*rtlphy
= &(rtlpriv
->phy
);
51 RT_TRACE(rtlpriv
, COMP_RF
, DBG_TRACE
,
52 "regaddr(%#x), rfpath(%#x), bitmask(%#x)\n",
53 regaddr
, rfpath
, bitmask
);
54 if (rtlphy
->rf_mode
!= RF_OP_BY_FW
) {
55 original_value
= _rtl92c_phy_rf_serial_read(hw
,
58 original_value
= _rtl92c_phy_fw_rf_serial_read(hw
,
61 bitshift
= _rtl92c_phy_calculate_bit_shift(bitmask
);
62 readback_value
= (original_value
& bitmask
) >> bitshift
;
63 RT_TRACE(rtlpriv
, COMP_RF
, DBG_TRACE
,
64 "regaddr(%#x), rfpath(%#x), bitmask(%#x), original_value(%#x)\n",
65 regaddr
, rfpath
, bitmask
, original_value
);
66 return readback_value
;
69 void rtl92cu_phy_set_rf_reg(struct ieee80211_hw
*hw
,
70 enum radio_path rfpath
,
71 u32 regaddr
, u32 bitmask
, u32 data
)
73 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
74 struct rtl_phy
*rtlphy
= &(rtlpriv
->phy
);
75 u32 original_value
, bitshift
;
77 RT_TRACE(rtlpriv
, COMP_RF
, DBG_TRACE
,
78 "regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n",
79 regaddr
, bitmask
, data
, rfpath
);
80 if (rtlphy
->rf_mode
!= RF_OP_BY_FW
) {
81 if (bitmask
!= RFREG_OFFSET_MASK
) {
82 original_value
= _rtl92c_phy_rf_serial_read(hw
,
85 bitshift
= _rtl92c_phy_calculate_bit_shift(bitmask
);
87 ((original_value
& (~bitmask
)) |
90 _rtl92c_phy_rf_serial_write(hw
, rfpath
, regaddr
, data
);
92 if (bitmask
!= RFREG_OFFSET_MASK
) {
93 original_value
= _rtl92c_phy_fw_rf_serial_read(hw
,
96 bitshift
= _rtl92c_phy_calculate_bit_shift(bitmask
);
98 ((original_value
& (~bitmask
)) |
101 _rtl92c_phy_fw_rf_serial_write(hw
, rfpath
, regaddr
, data
);
103 RT_TRACE(rtlpriv
, COMP_RF
, DBG_TRACE
,
104 "regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n",
105 regaddr
, bitmask
, data
, rfpath
);
108 bool rtl92cu_phy_mac_config(struct ieee80211_hw
*hw
)
112 rtstatus
= _rtl92cu_phy_config_mac_with_headerfile(hw
);
116 bool rtl92cu_phy_bb_config(struct ieee80211_hw
*hw
)
118 bool rtstatus
= true;
119 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
122 u8 b_reg_hwparafile
= 1;
124 _rtl92c_phy_init_bb_rf_register_definition(hw
);
125 regval
= rtl_read_word(rtlpriv
, REG_SYS_FUNC_EN
);
126 rtl_write_word(rtlpriv
, REG_SYS_FUNC_EN
, regval
| BIT(13) |
128 rtl_write_byte(rtlpriv
, REG_AFE_PLL_CTRL
, 0x83);
129 rtl_write_byte(rtlpriv
, REG_AFE_PLL_CTRL
+ 1, 0xdb);
130 rtl_write_byte(rtlpriv
, REG_RF_CTRL
, RF_EN
| RF_RSTB
| RF_SDMRSTB
);
131 rtl_write_byte(rtlpriv
, REG_SYS_FUNC_EN
, FEN_USBA
| FEN_USBD
|
132 FEN_BB_GLB_RSTn
| FEN_BBRSTB
);
133 regval32
= rtl_read_dword(rtlpriv
, 0x87c);
134 rtl_write_dword(rtlpriv
, 0x87c, regval32
& (~BIT(31)));
135 rtl_write_byte(rtlpriv
, REG_LDOHCI12_CTRL
, 0x0f);
136 rtl_write_byte(rtlpriv
, REG_AFE_XTAL_CTRL
+ 1, 0x80);
137 if (b_reg_hwparafile
== 1)
138 rtstatus
= _rtl92c_phy_bb8192c_config_parafile(hw
);
142 bool _rtl92cu_phy_config_mac_with_headerfile(struct ieee80211_hw
*hw
)
144 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
145 struct rtl_phy
*rtlphy
= &(rtlpriv
->phy
);
150 RT_TRACE(rtlpriv
, COMP_INIT
, DBG_TRACE
, "Read Rtl819XMACPHY_Array\n");
151 arraylength
= rtlphy
->hwparam_tables
[MAC_REG
].length
;
152 ptrarray
= rtlphy
->hwparam_tables
[MAC_REG
].pdata
;
153 RT_TRACE(rtlpriv
, COMP_INIT
, DBG_TRACE
, "Img:RTL8192CUMAC_2T_ARRAY\n");
154 for (i
= 0; i
< arraylength
; i
= i
+ 2)
155 rtl_write_byte(rtlpriv
, ptrarray
[i
], (u8
) ptrarray
[i
+ 1]);
159 bool _rtl92cu_phy_config_bb_with_headerfile(struct ieee80211_hw
*hw
,
163 u32
*phy_regarray_table
;
164 u32
*agctab_array_table
;
165 u16 phy_reg_arraylen
, agctab_arraylen
;
166 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
167 struct rtl_hal
*rtlhal
= rtl_hal(rtl_priv(hw
));
168 struct rtl_phy
*rtlphy
= &(rtlpriv
->phy
);
170 if (IS_92C_SERIAL(rtlhal
->version
)) {
171 agctab_arraylen
= rtlphy
->hwparam_tables
[AGCTAB_2T
].length
;
172 agctab_array_table
= rtlphy
->hwparam_tables
[AGCTAB_2T
].pdata
;
173 phy_reg_arraylen
= rtlphy
->hwparam_tables
[PHY_REG_2T
].length
;
174 phy_regarray_table
= rtlphy
->hwparam_tables
[PHY_REG_2T
].pdata
;
176 agctab_arraylen
= rtlphy
->hwparam_tables
[AGCTAB_1T
].length
;
177 agctab_array_table
= rtlphy
->hwparam_tables
[AGCTAB_1T
].pdata
;
178 phy_reg_arraylen
= rtlphy
->hwparam_tables
[PHY_REG_1T
].length
;
179 phy_regarray_table
= rtlphy
->hwparam_tables
[PHY_REG_1T
].pdata
;
181 if (configtype
== BASEBAND_CONFIG_PHY_REG
) {
182 for (i
= 0; i
< phy_reg_arraylen
; i
= i
+ 2) {
183 rtl_addr_delay(phy_regarray_table
[i
]);
184 rtl_set_bbreg(hw
, phy_regarray_table
[i
], MASKDWORD
,
185 phy_regarray_table
[i
+ 1]);
187 RT_TRACE(rtlpriv
, COMP_INIT
, DBG_TRACE
,
188 "The phy_regarray_table[0] is %x Rtl819XPHY_REGArray[1] is %x\n",
189 phy_regarray_table
[i
],
190 phy_regarray_table
[i
+ 1]);
192 } else if (configtype
== BASEBAND_CONFIG_AGC_TAB
) {
193 for (i
= 0; i
< agctab_arraylen
; i
= i
+ 2) {
194 rtl_set_bbreg(hw
, agctab_array_table
[i
], MASKDWORD
,
195 agctab_array_table
[i
+ 1]);
197 RT_TRACE(rtlpriv
, COMP_INIT
, DBG_TRACE
,
198 "The agctab_array_table[0] is %x Rtl819XPHY_REGArray[1] is %x\n",
199 agctab_array_table
[i
],
200 agctab_array_table
[i
+ 1]);
206 bool _rtl92cu_phy_config_bb_with_pgheaderfile(struct ieee80211_hw
*hw
,
209 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
210 struct rtl_phy
*rtlphy
= &(rtlpriv
->phy
);
212 u32
*phy_regarray_table_pg
;
213 u16 phy_regarray_pg_len
;
215 rtlphy
->pwrgroup_cnt
= 0;
216 phy_regarray_pg_len
= rtlphy
->hwparam_tables
[PHY_REG_PG
].length
;
217 phy_regarray_table_pg
= rtlphy
->hwparam_tables
[PHY_REG_PG
].pdata
;
218 if (configtype
== BASEBAND_CONFIG_PHY_REG
) {
219 for (i
= 0; i
< phy_regarray_pg_len
; i
= i
+ 3) {
220 rtl_addr_delay(phy_regarray_table_pg
[i
]);
221 _rtl92c_store_pwrIndex_diffrate_offset(hw
,
222 phy_regarray_table_pg
[i
],
223 phy_regarray_table_pg
[i
+ 1],
224 phy_regarray_table_pg
[i
+ 2]);
227 RT_TRACE(rtlpriv
, COMP_SEND
, DBG_TRACE
,
228 "configtype != BaseBand_Config_PHY_REG\n");
233 bool rtl92cu_phy_config_rf_with_headerfile(struct ieee80211_hw
*hw
,
234 enum radio_path rfpath
)
237 u32
*radioa_array_table
;
238 u32
*radiob_array_table
;
239 u16 radioa_arraylen
, radiob_arraylen
;
240 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
241 struct rtl_hal
*rtlhal
= rtl_hal(rtl_priv(hw
));
242 struct rtl_phy
*rtlphy
= &(rtlpriv
->phy
);
244 if (IS_92C_SERIAL(rtlhal
->version
)) {
245 radioa_arraylen
= rtlphy
->hwparam_tables
[RADIOA_2T
].length
;
246 radioa_array_table
= rtlphy
->hwparam_tables
[RADIOA_2T
].pdata
;
247 radiob_arraylen
= rtlphy
->hwparam_tables
[RADIOB_2T
].length
;
248 radiob_array_table
= rtlphy
->hwparam_tables
[RADIOB_2T
].pdata
;
249 RT_TRACE(rtlpriv
, COMP_INIT
, DBG_TRACE
,
250 "Radio_A:RTL8192CURADIOA_2TARRAY\n");
251 RT_TRACE(rtlpriv
, COMP_INIT
, DBG_TRACE
,
252 "Radio_B:RTL8192CU_RADIOB_2TARRAY\n");
254 radioa_arraylen
= rtlphy
->hwparam_tables
[RADIOA_1T
].length
;
255 radioa_array_table
= rtlphy
->hwparam_tables
[RADIOA_1T
].pdata
;
256 radiob_arraylen
= rtlphy
->hwparam_tables
[RADIOB_1T
].length
;
257 radiob_array_table
= rtlphy
->hwparam_tables
[RADIOB_1T
].pdata
;
258 RT_TRACE(rtlpriv
, COMP_INIT
, DBG_TRACE
,
259 "Radio_A:RTL8192CU_RADIOA_1TARRAY\n");
260 RT_TRACE(rtlpriv
, COMP_INIT
, DBG_TRACE
,
261 "Radio_B:RTL8192CU_RADIOB_1TARRAY\n");
263 RT_TRACE(rtlpriv
, COMP_INIT
, DBG_TRACE
, "Radio No %x\n", rfpath
);
266 for (i
= 0; i
< radioa_arraylen
; i
= i
+ 2) {
267 rtl_rfreg_delay(hw
, rfpath
, radioa_array_table
[i
],
269 radioa_array_table
[i
+ 1]);
273 for (i
= 0; i
< radiob_arraylen
; i
= i
+ 2) {
274 rtl_rfreg_delay(hw
, rfpath
, radiob_array_table
[i
],
276 radiob_array_table
[i
+ 1]);
280 RT_TRACE(rtlpriv
, COMP_ERR
, DBG_EMERG
,
281 "switch case not processed\n");
284 RT_TRACE(rtlpriv
, COMP_ERR
, DBG_EMERG
,
285 "switch case not processed\n");
293 void rtl92cu_phy_set_bw_mode_callback(struct ieee80211_hw
*hw
)
295 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
296 struct rtl_hal
*rtlhal
= rtl_hal(rtl_priv(hw
));
297 struct rtl_phy
*rtlphy
= &(rtlpriv
->phy
);
298 struct rtl_mac
*mac
= rtl_mac(rtl_priv(hw
));
302 RT_TRACE(rtlpriv
, COMP_SCAN
, DBG_TRACE
, "Switch to %s bandwidth\n",
303 rtlphy
->current_chan_bw
== HT_CHANNEL_WIDTH_20
?
305 if (is_hal_stop(rtlhal
)) {
306 rtlphy
->set_bwmode_inprogress
= false;
309 reg_bw_opmode
= rtl_read_byte(rtlpriv
, REG_BWOPMODE
);
310 reg_prsr_rsc
= rtl_read_byte(rtlpriv
, REG_RRSR
+ 2);
311 switch (rtlphy
->current_chan_bw
) {
312 case HT_CHANNEL_WIDTH_20
:
313 reg_bw_opmode
|= BW_OPMODE_20MHZ
;
314 rtl_write_byte(rtlpriv
, REG_BWOPMODE
, reg_bw_opmode
);
316 case HT_CHANNEL_WIDTH_20_40
:
317 reg_bw_opmode
&= ~BW_OPMODE_20MHZ
;
318 rtl_write_byte(rtlpriv
, REG_BWOPMODE
, reg_bw_opmode
);
320 (reg_prsr_rsc
& 0x90) | (mac
->cur_40_prime_sc
<< 5);
321 rtl_write_byte(rtlpriv
, REG_RRSR
+ 2, reg_prsr_rsc
);
324 RT_TRACE(rtlpriv
, COMP_ERR
, DBG_EMERG
,
325 "unknown bandwidth: %#X\n", rtlphy
->current_chan_bw
);
328 switch (rtlphy
->current_chan_bw
) {
329 case HT_CHANNEL_WIDTH_20
:
330 rtl_set_bbreg(hw
, RFPGA0_RFMOD
, BRFMOD
, 0x0);
331 rtl_set_bbreg(hw
, RFPGA1_RFMOD
, BRFMOD
, 0x0);
332 rtl_set_bbreg(hw
, RFPGA0_ANALOGPARAMETER2
, BIT(10), 1);
334 case HT_CHANNEL_WIDTH_20_40
:
335 rtl_set_bbreg(hw
, RFPGA0_RFMOD
, BRFMOD
, 0x1);
336 rtl_set_bbreg(hw
, RFPGA1_RFMOD
, BRFMOD
, 0x1);
337 rtl_set_bbreg(hw
, RCCK0_SYSTEM
, BCCK_SIDEBAND
,
338 (mac
->cur_40_prime_sc
>> 1));
339 rtl_set_bbreg(hw
, ROFDM1_LSTF
, 0xC00, mac
->cur_40_prime_sc
);
340 rtl_set_bbreg(hw
, RFPGA0_ANALOGPARAMETER2
, BIT(10), 0);
341 rtl_set_bbreg(hw
, 0x818, (BIT(26) | BIT(27)),
342 (mac
->cur_40_prime_sc
==
343 HAL_PRIME_CHNL_OFFSET_LOWER
) ? 2 : 1);
346 RT_TRACE(rtlpriv
, COMP_ERR
, DBG_EMERG
,
347 "unknown bandwidth: %#X\n", rtlphy
->current_chan_bw
);
350 rtl92cu_phy_rf6052_set_bandwidth(hw
, rtlphy
->current_chan_bw
);
351 rtlphy
->set_bwmode_inprogress
= false;
352 RT_TRACE(rtlpriv
, COMP_SCAN
, DBG_TRACE
, "<==\n");
355 void rtl92cu_bb_block_on(struct ieee80211_hw
*hw
)
357 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
359 mutex_lock(&rtlpriv
->io
.bb_mutex
);
360 rtl_set_bbreg(hw
, RFPGA0_RFMOD
, BCCKEN
, 0x1);
361 rtl_set_bbreg(hw
, RFPGA0_RFMOD
, BOFDMEN
, 0x1);
362 mutex_unlock(&rtlpriv
->io
.bb_mutex
);
365 void _rtl92cu_phy_lc_calibrate(struct ieee80211_hw
*hw
, bool is2t
)
368 u32 rf_a_mode
= 0, rf_b_mode
= 0, lc_cal
;
369 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
371 tmpreg
= rtl_read_byte(rtlpriv
, 0xd03);
373 if ((tmpreg
& 0x70) != 0)
374 rtl_write_byte(rtlpriv
, 0xd03, tmpreg
& 0x8F);
376 rtl_write_byte(rtlpriv
, REG_TXPAUSE
, 0xFF);
378 if ((tmpreg
& 0x70) != 0) {
379 rf_a_mode
= rtl_get_rfreg(hw
, RF90_PATH_A
, 0x00, MASK12BITS
);
381 rf_b_mode
= rtl_get_rfreg(hw
, RF90_PATH_B
, 0x00,
383 rtl_set_rfreg(hw
, RF90_PATH_A
, 0x00, MASK12BITS
,
384 (rf_a_mode
& 0x8FFFF) | 0x10000);
386 rtl_set_rfreg(hw
, RF90_PATH_B
, 0x00, MASK12BITS
,
387 (rf_b_mode
& 0x8FFFF) | 0x10000);
389 lc_cal
= rtl_get_rfreg(hw
, RF90_PATH_A
, 0x18, MASK12BITS
);
390 rtl_set_rfreg(hw
, RF90_PATH_A
, 0x18, MASK12BITS
, lc_cal
| 0x08000);
392 if ((tmpreg
& 0x70) != 0) {
393 rtl_write_byte(rtlpriv
, 0xd03, tmpreg
);
394 rtl_set_rfreg(hw
, RF90_PATH_A
, 0x00, MASK12BITS
, rf_a_mode
);
396 rtl_set_rfreg(hw
, RF90_PATH_B
, 0x00, MASK12BITS
,
399 rtl_write_byte(rtlpriv
, REG_TXPAUSE
, 0x00);
403 static bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw
*hw
,
404 enum rf_pwrstate rfpwr_state
)
406 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
407 struct rtl_pci_priv
*pcipriv
= rtl_pcipriv(hw
);
408 struct rtl_mac
*mac
= rtl_mac(rtl_priv(hw
));
409 struct rtl_ps_ctl
*ppsc
= rtl_psc(rtl_priv(hw
));
412 struct rtl8192_tx_ring
*ring
= NULL
;
414 switch (rfpwr_state
) {
416 if ((ppsc
->rfpwr_state
== ERFOFF
) &&
417 RT_IN_PS_LEVEL(ppsc
, RT_RF_OFF_LEVL_HALT_NIC
)) {
419 u32 InitializeCount
= 0;
423 RT_TRACE(rtlpriv
, COMP_RF
, DBG_DMESG
,
424 "IPS Set eRf nic enable\n");
425 rtstatus
= rtl_ps_enable_nic(hw
);
426 } while (!rtstatus
&& (InitializeCount
< 10));
427 RT_CLEAR_PS_LEVEL(ppsc
,
428 RT_RF_OFF_LEVL_HALT_NIC
);
430 RT_TRACE(rtlpriv
, COMP_RF
, DBG_DMESG
,
431 "Set ERFON sleeped:%d ms\n",
432 jiffies_to_msecs(jiffies
-
433 ppsc
->last_sleep_jiffies
));
434 ppsc
->last_awake_jiffies
= jiffies
;
435 rtl92ce_phy_set_rf_on(hw
);
437 if (mac
->link_state
== MAC80211_LINKED
) {
438 rtlpriv
->cfg
->ops
->led_control(hw
,
441 rtlpriv
->cfg
->ops
->led_control(hw
,
446 for (queue_id
= 0, i
= 0;
447 queue_id
< RTL_PCI_MAX_TX_QUEUE_COUNT
;) {
448 ring
= &pcipriv
->dev
.tx_ring
[queue_id
];
449 if (skb_queue_len(&ring
->queue
) == 0 ||
450 queue_id
== BEACON_QUEUE
) {
454 RT_TRACE(rtlpriv
, COMP_ERR
, DBG_WARNING
,
455 "eRf Off/Sleep: %d times TcbBusyQueue[%d] =%d before doze!\n",
458 skb_queue_len(&ring
->queue
));
462 if (i
>= MAX_DOZE_WAITING_TIMES_9x
) {
463 RT_TRACE(rtlpriv
, COMP_ERR
, DBG_WARNING
,
464 "ERFOFF: %d times TcbBusyQueue[%d] = %d !\n",
465 MAX_DOZE_WAITING_TIMES_9x
,
467 skb_queue_len(&ring
->queue
));
471 if (ppsc
->reg_rfps_level
& RT_RF_OFF_LEVL_HALT_NIC
) {
472 RT_TRACE(rtlpriv
, COMP_RF
, DBG_DMESG
,
473 "IPS Set eRf nic disable\n");
474 rtl_ps_disable_nic(hw
);
475 RT_SET_PS_LEVEL(ppsc
, RT_RF_OFF_LEVL_HALT_NIC
);
477 if (ppsc
->rfoff_reason
== RF_CHANGE_BY_IPS
) {
478 rtlpriv
->cfg
->ops
->led_control(hw
,
481 rtlpriv
->cfg
->ops
->led_control(hw
,
487 if (ppsc
->rfpwr_state
== ERFOFF
)
489 for (queue_id
= 0, i
= 0;
490 queue_id
< RTL_PCI_MAX_TX_QUEUE_COUNT
;) {
491 ring
= &pcipriv
->dev
.tx_ring
[queue_id
];
492 if (skb_queue_len(&ring
->queue
) == 0) {
496 RT_TRACE(rtlpriv
, COMP_ERR
, DBG_WARNING
,
497 "eRf Off/Sleep: %d times TcbBusyQueue[%d] =%d before doze!\n",
499 skb_queue_len(&ring
->queue
));
503 if (i
>= MAX_DOZE_WAITING_TIMES_9x
) {
504 RT_TRACE(rtlpriv
, COMP_ERR
, DBG_WARNING
,
505 "ERFSLEEP: %d times TcbBusyQueue[%d] = %d !\n",
506 MAX_DOZE_WAITING_TIMES_9x
,
508 skb_queue_len(&ring
->queue
));
512 RT_TRACE(rtlpriv
, COMP_RF
, DBG_DMESG
,
513 "Set ERFSLEEP awaked:%d ms\n",
514 jiffies_to_msecs(jiffies
- ppsc
->last_awake_jiffies
));
515 ppsc
->last_sleep_jiffies
= jiffies
;
516 _rtl92c_phy_set_rf_sleep(hw
);
519 RT_TRACE(rtlpriv
, COMP_ERR
, DBG_EMERG
,
520 "switch case not processed\n");
525 ppsc
->rfpwr_state
= rfpwr_state
;
529 bool rtl92cu_phy_set_rf_power_state(struct ieee80211_hw
*hw
,
530 enum rf_pwrstate rfpwr_state
)
532 struct rtl_ps_ctl
*ppsc
= rtl_psc(rtl_priv(hw
));
533 bool bresult
= false;
535 if (rfpwr_state
== ppsc
->rfpwr_state
)
537 bresult
= _rtl92cu_phy_set_rf_power_state(hw
, rfpwr_state
);