1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 2009-2012 Realtek Corporation.*/
14 static u8
_rtl92ce_map_hwqueue_to_fwqueue(struct sk_buff
*skb
, u8 hw_queue
)
16 __le16 fc
= rtl_get_fc(skb
);
18 if (unlikely(ieee80211_is_beacon(fc
)))
20 if (ieee80211_is_mgmt(fc
) || ieee80211_is_ctl(fc
))
26 static void _rtl92ce_query_rxphystatus(struct ieee80211_hw
*hw
,
27 struct rtl_stats
*pstats
,
28 struct rx_desc_92c
*pdesc
,
29 struct rx_fwinfo_92c
*p_drvinfo
,
30 bool packet_match_bssid
,
34 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
35 struct phy_sts_cck_8192s_t
*cck_buf
;
36 struct rtl_ps_ctl
*ppsc
= rtl_psc(rtlpriv
);
37 s8 rx_pwr_all
= 0, rx_pwr
[4];
38 u8 evm
, pwdb_all
, rf_rx_num
= 0;
39 u8 i
, max_spatial_stream
;
40 u32 rssi
, total_rssi
= 0;
43 is_cck_rate
= RX_HAL_IS_CCK_RATE(pdesc
->rxmcs
);
44 pstats
->packet_matchbssid
= packet_match_bssid
;
45 pstats
->packet_toself
= packet_toself
;
46 pstats
->is_cck
= is_cck_rate
;
47 pstats
->packet_beacon
= packet_beacon
;
48 pstats
->rx_mimo_sig_qual
[0] = -1;
49 pstats
->rx_mimo_sig_qual
[1] = -1;
52 u8 report
, cck_highpwr
;
54 cck_buf
= (struct phy_sts_cck_8192s_t
*)p_drvinfo
;
56 if (ppsc
->rfpwr_state
== ERFON
)
57 cck_highpwr
= (u8
) rtl_get_bbreg(hw
,
58 RFPGA0_XA_HSSIPARAMETER2
,
64 u8 cck_agc_rpt
= cck_buf
->cck_agc_rpt
;
66 report
= cck_buf
->cck_agc_rpt
& 0xc0;
70 rx_pwr_all
= -46 - (cck_agc_rpt
& 0x3e);
73 rx_pwr_all
= -26 - (cck_agc_rpt
& 0x3e);
76 rx_pwr_all
= -12 - (cck_agc_rpt
& 0x3e);
79 rx_pwr_all
= 16 - (cck_agc_rpt
& 0x3e);
83 u8 cck_agc_rpt
= cck_buf
->cck_agc_rpt
;
85 report
= p_drvinfo
->cfosho
[0] & 0x60;
89 rx_pwr_all
= -46 - ((cck_agc_rpt
& 0x1f) << 1);
92 rx_pwr_all
= -26 - ((cck_agc_rpt
& 0x1f) << 1);
95 rx_pwr_all
= -12 - ((cck_agc_rpt
& 0x1f) << 1);
98 rx_pwr_all
= 16 - ((cck_agc_rpt
& 0x1f) << 1);
103 pwdb_all
= rtl_query_rxpwrpercentage(rx_pwr_all
);
104 /* CCK gain is smaller than OFDM/MCS gain,
105 * so we add gain diff by experiences,
111 /* modify the offset to make the same
112 * gain index with OFDM.
114 if (pwdb_all
> 34 && pwdb_all
<= 42)
116 else if (pwdb_all
> 26 && pwdb_all
<= 34)
118 else if (pwdb_all
> 14 && pwdb_all
<= 26)
120 else if (pwdb_all
> 4 && pwdb_all
<= 14)
123 pstats
->rx_pwdb_all
= pwdb_all
;
124 pstats
->recvsignalpower
= rx_pwr_all
;
126 /* (3) Get Signal Quality (EVM) */
127 if (packet_match_bssid
) {
130 if (pstats
->rx_pwdb_all
> 40)
133 sq
= cck_buf
->sq_rpt
;
139 sq
= ((64 - sq
) * 100) / 44;
142 pstats
->signalquality
= sq
;
143 pstats
->rx_mimo_sig_qual
[0] = sq
;
144 pstats
->rx_mimo_sig_qual
[1] = -1;
147 rtlpriv
->dm
.rfpath_rxenable
[0] =
148 rtlpriv
->dm
.rfpath_rxenable
[1] = true;
149 /* (1)Get RSSI for HT rate */
150 for (i
= RF90_PATH_A
; i
< RF90_PATH_MAX
; i
++) {
151 /* we will judge RF RX path now. */
152 if (rtlpriv
->dm
.rfpath_rxenable
[i
])
156 ((p_drvinfo
->gain_trsw
[i
] & 0x3f) * 2) - 110;
157 /* Translate DBM to percentage. */
158 rssi
= rtl_query_rxpwrpercentage(rx_pwr
[i
]);
160 /* Get Rx snr value in DB */
161 rtlpriv
->stats
.rx_snr_db
[i
] =
162 (long)(p_drvinfo
->rxsnr
[i
] / 2);
164 /* Record Signal Strength for next packet */
165 if (packet_match_bssid
)
166 pstats
->rx_mimo_signalstrength
[i
] = (u8
) rssi
;
169 /* (2)PWDB, Average PWDB cacluated by
170 * hardware (for rate adaptive)
172 rx_pwr_all
= ((p_drvinfo
->pwdb_all
>> 1) & 0x7f) - 110;
173 pwdb_all
= rtl_query_rxpwrpercentage(rx_pwr_all
);
174 pstats
->rx_pwdb_all
= pwdb_all
;
175 pstats
->rxpower
= rx_pwr_all
;
176 pstats
->recvsignalpower
= rx_pwr_all
;
178 /* (3)EVM of HT rate */
179 if (pstats
->is_ht
&& pstats
->rate
>= DESC_RATEMCS8
&&
180 pstats
->rate
<= DESC_RATEMCS15
)
181 max_spatial_stream
= 2;
183 max_spatial_stream
= 1;
185 for (i
= 0; i
< max_spatial_stream
; i
++) {
186 evm
= rtl_evm_db_to_percentage(p_drvinfo
->rxevm
[i
]);
188 if (packet_match_bssid
) {
189 /* Fill value in RFD, Get the first
190 * spatial stream only
193 pstats
->signalquality
=
195 pstats
->rx_mimo_sig_qual
[i
] = (u8
)(evm
& 0xff);
200 /* UI BSS List signal strength(in percentage),
201 * make it good looking, from 0~100.
204 pstats
->signalstrength
=
205 (u8
)(rtl_signal_scale_mapping(hw
, pwdb_all
));
206 else if (rf_rx_num
!= 0)
207 pstats
->signalstrength
=
208 (u8
)(rtl_signal_scale_mapping(hw
, total_rssi
/= rf_rx_num
));
211 static void _rtl92ce_translate_rx_signal_stuff(struct ieee80211_hw
*hw
,
213 struct rtl_stats
*pstats
,
214 struct rx_desc_92c
*pdesc
,
215 struct rx_fwinfo_92c
*p_drvinfo
)
217 struct rtl_mac
*mac
= rtl_mac(rtl_priv(hw
));
218 struct rtl_efuse
*rtlefuse
= rtl_efuse(rtl_priv(hw
));
220 struct ieee80211_hdr
*hdr
;
225 bool packet_matchbssid
, packet_toself
, packet_beacon
= false;
227 tmp_buf
= skb
->data
+ pstats
->rx_drvinfo_size
+ pstats
->rx_bufshift
;
229 hdr
= (struct ieee80211_hdr
*)tmp_buf
;
230 fc
= hdr
->frame_control
;
231 c_fc
= le16_to_cpu(fc
);
232 type
= WLAN_FC_GET_TYPE(fc
);
236 ((IEEE80211_FTYPE_CTL
!= type
) &&
237 ether_addr_equal(mac
->bssid
,
238 (c_fc
& IEEE80211_FCTL_TODS
) ? hdr
->addr1
:
239 (c_fc
& IEEE80211_FCTL_FROMDS
) ? hdr
->addr2
:
241 (!pstats
->hwerror
) && (!pstats
->crc
) && (!pstats
->icv
));
243 packet_toself
= packet_matchbssid
&&
244 ether_addr_equal(praddr
, rtlefuse
->dev_addr
);
246 if (ieee80211_is_beacon(fc
))
247 packet_beacon
= true;
249 _rtl92ce_query_rxphystatus(hw
, pstats
, pdesc
, p_drvinfo
,
250 packet_matchbssid
, packet_toself
,
253 rtl_process_phyinfo(hw
, tmp_buf
, pstats
);
256 bool rtl92ce_rx_query_desc(struct ieee80211_hw
*hw
,
257 struct rtl_stats
*stats
,
258 struct ieee80211_rx_status
*rx_status
,
259 u8
*p_desc8
, struct sk_buff
*skb
)
261 struct rx_fwinfo_92c
*p_drvinfo
;
262 struct rx_desc_92c
*pdesc
= (struct rx_desc_92c
*)p_desc8
;
263 struct ieee80211_hdr
*hdr
;
264 __le32
*p_desc
= (__le32
*)p_desc8
;
265 u32 phystatus
= get_rx_desc_physt(p_desc
);
267 stats
->length
= (u16
)get_rx_desc_pkt_len(p_desc
);
268 stats
->rx_drvinfo_size
= (u8
)get_rx_desc_drv_info_size(p_desc
) *
269 RX_DRV_INFO_SIZE_UNIT
;
270 stats
->rx_bufshift
= (u8
)(get_rx_desc_shift(p_desc
) & 0x03);
271 stats
->icv
= (u16
)get_rx_desc_icv(p_desc
);
272 stats
->crc
= (u16
)get_rx_desc_crc32(p_desc
);
273 stats
->hwerror
= (stats
->crc
| stats
->icv
);
274 stats
->decrypted
= !get_rx_desc_swdec(p_desc
);
275 stats
->rate
= (u8
)get_rx_desc_rxmcs(p_desc
);
276 stats
->shortpreamble
= (u16
)get_rx_desc_splcp(p_desc
);
277 stats
->isampdu
= (bool)(get_rx_desc_paggr(p_desc
) == 1);
278 stats
->isfirst_ampdu
= (bool)((get_rx_desc_paggr(p_desc
) == 1) &&
279 (get_rx_desc_faggr(p_desc
) == 1));
280 stats
->timestamp_low
= get_rx_desc_tsfl(p_desc
);
281 stats
->rx_is40mhzpacket
= (bool)get_rx_desc_bw(p_desc
);
282 stats
->is_ht
= (bool)get_rx_desc_rxht(p_desc
);
284 stats
->is_cck
= RX_HAL_IS_CCK_RATE(pdesc
->rxmcs
);
286 rx_status
->freq
= hw
->conf
.chandef
.chan
->center_freq
;
287 rx_status
->band
= hw
->conf
.chandef
.chan
->band
;
289 hdr
= (struct ieee80211_hdr
*)(skb
->data
+ stats
->rx_drvinfo_size
290 + stats
->rx_bufshift
);
293 rx_status
->flag
|= RX_FLAG_FAILED_FCS_CRC
;
295 if (stats
->rx_is40mhzpacket
)
296 rx_status
->bw
= RATE_INFO_BW_40
;
299 rx_status
->encoding
= RX_ENC_HT
;
301 rx_status
->flag
|= RX_FLAG_MACTIME_START
;
303 /* hw will set stats->decrypted true, if it finds the
304 * frame is open data frame or mgmt frame.
305 * So hw will not decryption robust managment frame
306 * for IEEE80211w but still set status->decrypted
307 * true, so here we should set it back to undecrypted
308 * for IEEE80211w frame, and mac80211 sw will help
311 if (stats
->decrypted
) {
312 if ((_ieee80211_is_robust_mgmt_frame(hdr
)) &&
313 (ieee80211_has_protected(hdr
->frame_control
)))
314 rx_status
->flag
&= ~RX_FLAG_DECRYPTED
;
316 rx_status
->flag
|= RX_FLAG_DECRYPTED
;
318 /* rate_idx: index of data rate into band's
319 * supported rates or MCS index if HT rates
320 * are use (RX_FLAG_HT)
321 * Notice: this is diff with windows define
323 rx_status
->rate_idx
= rtlwifi_rate_mapping(hw
, stats
->is_ht
,
326 rx_status
->mactime
= stats
->timestamp_low
;
328 p_drvinfo
= (struct rx_fwinfo_92c
*)(skb
->data
+
331 _rtl92ce_translate_rx_signal_stuff(hw
,
336 /*rx_status->qual = stats->signal; */
337 rx_status
->signal
= stats
->recvsignalpower
+ 10;
342 void rtl92ce_tx_fill_desc(struct ieee80211_hw
*hw
,
343 struct ieee80211_hdr
*hdr
, u8
*pdesc8
,
344 u8
*pbd_desc_tx
, struct ieee80211_tx_info
*info
,
345 struct ieee80211_sta
*sta
,
347 u8 hw_queue
, struct rtl_tcb_desc
*tcb_desc
)
349 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
350 struct rtl_mac
*mac
= rtl_mac(rtl_priv(hw
));
351 struct rtl_pci
*rtlpci
= rtl_pcidev(rtl_pcipriv(hw
));
352 struct rtl_ps_ctl
*ppsc
= rtl_psc(rtl_priv(hw
));
353 bool defaultadapter
= true;
354 __le32
*pdesc
= (__le32
*)pdesc8
;
356 __le16 fc
= hdr
->frame_control
;
357 u8 fw_qsel
= _rtl92ce_map_hwqueue_to_fwqueue(skb
, hw_queue
);
358 bool firstseg
= ((hdr
->seq_ctrl
&
359 cpu_to_le16(IEEE80211_SCTL_FRAG
)) == 0);
361 bool lastseg
= ((hdr
->frame_control
&
362 cpu_to_le16(IEEE80211_FCTL_MOREFRAGS
)) == 0);
364 dma_addr_t mapping
= pci_map_single(rtlpci
->pdev
,
370 if (pci_dma_mapping_error(rtlpci
->pdev
, mapping
)) {
371 RT_TRACE(rtlpriv
, COMP_SEND
, DBG_TRACE
,
372 "DMA mapping error\n");
376 sta
= get_sta(hw
, mac
->vif
, mac
->bssid
);
377 if (mac
->opmode
== NL80211_IFTYPE_STATION
) {
379 } else if (mac
->opmode
== NL80211_IFTYPE_AP
||
380 mac
->opmode
== NL80211_IFTYPE_ADHOC
||
381 mac
->opmode
== NL80211_IFTYPE_MESH_POINT
) {
383 bw_40
= sta
->bandwidth
>= IEEE80211_STA_RX_BW_40
;
386 seq_number
= (le16_to_cpu(hdr
->seq_ctrl
) & IEEE80211_SCTL_SEQ
) >> 4;
388 rtl_get_tcb_desc(hw
, info
, sta
, skb
, tcb_desc
);
390 clear_pci_tx_desc_content(pdesc
, sizeof(struct tx_desc_92c
));
392 if (ieee80211_is_nullfunc(fc
) || ieee80211_is_ctl(fc
)) {
397 set_tx_desc_offset(pdesc
, USB_HWDESC_HEADER_LEN
);
399 set_tx_desc_tx_rate(pdesc
, tcb_desc
->hw_rate
);
401 if (tcb_desc
->use_shortgi
|| tcb_desc
->use_shortpreamble
)
402 set_tx_desc_data_shortgi(pdesc
, 1);
404 if (info
->flags
& IEEE80211_TX_CTL_AMPDU
) {
405 set_tx_desc_agg_break(pdesc
, 1);
406 set_tx_desc_max_agg_num(pdesc
, 0x14);
408 set_tx_desc_seq(pdesc
, seq_number
);
410 set_tx_desc_rts_enable(pdesc
, ((tcb_desc
->rts_enable
&&
412 cts_enable
) ? 1 : 0));
413 set_tx_desc_hw_rts_enable(pdesc
,
414 ((tcb_desc
->rts_enable
415 || tcb_desc
->cts_enable
) ? 1 : 0));
416 set_tx_desc_cts2self(pdesc
, ((tcb_desc
->cts_enable
) ? 1 : 0));
417 set_tx_desc_rts_stbc(pdesc
, ((tcb_desc
->rts_stbc
) ? 1 : 0));
419 set_tx_desc_rts_rate(pdesc
, tcb_desc
->rts_rate
);
420 set_tx_desc_rts_bw(pdesc
, 0);
421 set_tx_desc_rts_sc(pdesc
, tcb_desc
->rts_sc
);
422 set_tx_desc_rts_short(pdesc
,
423 ((tcb_desc
->rts_rate
<= DESC_RATE54M
) ?
424 (tcb_desc
->rts_use_shortpreamble
? 1 : 0)
425 : (tcb_desc
->rts_use_shortgi
? 1 : 0)));
428 if (tcb_desc
->packet_bw
) {
429 set_tx_desc_data_bw(pdesc
, 1);
430 set_tx_desc_tx_sub_carrier(pdesc
, 3);
432 set_tx_desc_data_bw(pdesc
, 0);
433 set_tx_desc_tx_sub_carrier(pdesc
,
434 mac
->cur_40_prime_sc
);
437 set_tx_desc_data_bw(pdesc
, 0);
438 set_tx_desc_tx_sub_carrier(pdesc
, 0);
441 set_tx_desc_linip(pdesc
, 0);
442 set_tx_desc_pkt_size(pdesc
, (u16
)skb
->len
);
445 u8 ampdu_density
= sta
->ht_cap
.ampdu_density
;
447 set_tx_desc_ampdu_density(pdesc
, ampdu_density
);
450 if (info
->control
.hw_key
) {
451 struct ieee80211_key_conf
*keyconf
=
452 info
->control
.hw_key
;
454 switch (keyconf
->cipher
) {
455 case WLAN_CIPHER_SUITE_WEP40
:
456 case WLAN_CIPHER_SUITE_WEP104
:
457 case WLAN_CIPHER_SUITE_TKIP
:
458 set_tx_desc_sec_type(pdesc
, 0x1);
460 case WLAN_CIPHER_SUITE_CCMP
:
461 set_tx_desc_sec_type(pdesc
, 0x3);
464 set_tx_desc_sec_type(pdesc
, 0x0);
470 set_tx_desc_pkt_id(pdesc
, 0);
471 set_tx_desc_queue_sel(pdesc
, fw_qsel
);
473 set_tx_desc_data_rate_fb_limit(pdesc
, 0x1F);
474 set_tx_desc_rts_rate_fb_limit(pdesc
, 0xF);
475 set_tx_desc_disable_fb(pdesc
, 0);
476 set_tx_desc_use_rate(pdesc
, tcb_desc
->use_driver_rate
? 1 : 0);
478 if (ieee80211_is_data_qos(fc
)) {
480 RT_TRACE(rtlpriv
, COMP_SEND
, DBG_TRACE
,
481 "Enable RDG function\n");
482 set_tx_desc_rdg_enable(pdesc
, 1);
483 set_tx_desc_htc(pdesc
, 1);
489 set_tx_desc_first_seg(pdesc
, (firstseg
? 1 : 0));
490 set_tx_desc_last_seg(pdesc
, (lastseg
? 1 : 0));
492 set_tx_desc_tx_buffer_size(pdesc
, (u16
)skb
->len
);
494 set_tx_desc_tx_buffer_address(pdesc
, mapping
);
496 if (rtlpriv
->dm
.useramask
) {
497 set_tx_desc_rate_id(pdesc
, tcb_desc
->ratr_index
);
498 set_tx_desc_macid(pdesc
, tcb_desc
->mac_id
);
500 set_tx_desc_rate_id(pdesc
, 0xC + tcb_desc
->ratr_index
);
501 set_tx_desc_macid(pdesc
, tcb_desc
->ratr_index
);
504 if ((!ieee80211_is_data_qos(fc
)) && ppsc
->fwctrl_lps
) {
505 set_tx_desc_hwseq_en(pdesc
, 1);
506 set_tx_desc_pkt_id(pdesc
, 8);
509 set_tx_desc_qos(pdesc
, 1);
512 set_tx_desc_more_frag(pdesc
, (lastseg
? 0 : 1));
514 if (is_multicast_ether_addr(ieee80211_get_DA(hdr
)) ||
515 is_broadcast_ether_addr(ieee80211_get_DA(hdr
))) {
516 set_tx_desc_bmc(pdesc
, 1);
519 RT_TRACE(rtlpriv
, COMP_SEND
, DBG_TRACE
, "\n");
522 void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw
*hw
,
523 u8
*pdesc8
, bool firstseg
,
524 bool lastseg
, struct sk_buff
*skb
)
526 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
527 struct rtl_pci
*rtlpci
= rtl_pcidev(rtl_pcipriv(hw
));
528 u8 fw_queue
= QSLT_BEACON
;
529 __le32
*pdesc
= (__le32
*)pdesc8
;
531 dma_addr_t mapping
= pci_map_single(rtlpci
->pdev
,
535 struct ieee80211_hdr
*hdr
= (struct ieee80211_hdr
*)(skb
->data
);
536 __le16 fc
= hdr
->frame_control
;
538 if (pci_dma_mapping_error(rtlpci
->pdev
, mapping
)) {
539 RT_TRACE(rtlpriv
, COMP_SEND
, DBG_TRACE
,
540 "DMA mapping error\n");
543 clear_pci_tx_desc_content(pdesc
, TX_DESC_SIZE
);
546 set_tx_desc_offset(pdesc
, USB_HWDESC_HEADER_LEN
);
548 set_tx_desc_tx_rate(pdesc
, DESC_RATE1M
);
550 set_tx_desc_seq(pdesc
, 0);
552 set_tx_desc_linip(pdesc
, 0);
554 set_tx_desc_queue_sel(pdesc
, fw_queue
);
556 set_tx_desc_first_seg(pdesc
, 1);
557 set_tx_desc_last_seg(pdesc
, 1);
559 set_tx_desc_tx_buffer_size(pdesc
, (u16
)(skb
->len
));
561 set_tx_desc_tx_buffer_address(pdesc
, mapping
);
563 set_tx_desc_rate_id(pdesc
, 7);
564 set_tx_desc_macid(pdesc
, 0);
566 set_tx_desc_own(pdesc
, 1);
568 set_tx_desc_pkt_size(pdesc
, (u16
)(skb
->len
));
570 set_tx_desc_first_seg(pdesc
, 1);
571 set_tx_desc_last_seg(pdesc
, 1);
573 set_tx_desc_offset(pdesc
, 0x20);
575 set_tx_desc_use_rate(pdesc
, 1);
577 if (!ieee80211_is_data_qos(fc
)) {
578 set_tx_desc_hwseq_en(pdesc
, 1);
579 set_tx_desc_pkt_id(pdesc
, 8);
582 RT_PRINT_DATA(rtlpriv
, COMP_CMD
, DBG_LOUD
,
583 "H2C Tx Cmd Content", pdesc
, TX_DESC_SIZE
);
586 void rtl92ce_set_desc(struct ieee80211_hw
*hw
, u8
*pdesc8
, bool istx
,
587 u8 desc_name
, u8
*val
)
589 __le32
*pdesc
= (__le32
*)pdesc8
;
595 set_tx_desc_own(pdesc
, 1);
597 case HW_DESC_TX_NEXTDESC_ADDR
:
598 set_tx_desc_next_desc_address(pdesc
, *(u32
*)val
);
601 WARN_ONCE(true, "rtl8192ce: ERR txdesc :%d not processed\n",
609 set_rx_desc_own(pdesc
, 1);
611 case HW_DESC_RXBUFF_ADDR
:
612 set_rx_desc_buff_addr(pdesc
, *(u32
*)val
);
614 case HW_DESC_RXPKT_LEN
:
615 set_rx_desc_pkt_len(pdesc
, *(u32
*)val
);
618 set_rx_desc_eor(pdesc
, 1);
621 WARN_ONCE(true, "rtl8192ce: ERR rxdesc :%d not processed\n",
628 u64
rtl92ce_get_desc(struct ieee80211_hw
*hw
, u8
*p_desc8
,
629 bool istx
, u8 desc_name
)
632 __le32
*p_desc
= (__le32
*)p_desc8
;
637 ret
= get_tx_desc_own(p_desc
);
639 case HW_DESC_TXBUFF_ADDR
:
640 ret
= get_tx_desc_tx_buffer_address(p_desc
);
643 WARN_ONCE(true, "rtl8192ce: ERR txdesc :%d not processed\n",
650 ret
= get_rx_desc_own(p_desc
);
652 case HW_DESC_RXPKT_LEN
:
653 ret
= get_rx_desc_pkt_len(p_desc
);
655 case HW_DESC_RXBUFF_ADDR
:
656 ret
= get_rx_desc_buff_addr(p_desc
);
659 WARN_ONCE(true, "rtl8192ce: ERR rxdesc :%d not processed\n",
667 bool rtl92ce_is_tx_desc_closed(struct ieee80211_hw
*hw
,
668 u8 hw_queue
, u16 index
)
670 struct rtl_pci
*rtlpci
= rtl_pcidev(rtl_pcipriv(hw
));
671 struct rtl8192_tx_ring
*ring
= &rtlpci
->tx_ring
[hw_queue
];
672 u8
*entry
= (u8
*)(&ring
->desc
[ring
->idx
]);
673 u8 own
= (u8
)rtl92ce_get_desc(hw
, entry
, true, HW_DESC_OWN
);
675 /*beacon packet will only use the first
676 *descriptor defautly,and the own may not
677 *be cleared by the hardware
684 void rtl92ce_tx_polling(struct ieee80211_hw
*hw
, u8 hw_queue
)
686 struct rtl_priv
*rtlpriv
= rtl_priv(hw
);
688 if (hw_queue
== BEACON_QUEUE
) {
689 rtl_write_word(rtlpriv
, REG_PCIE_CTRL_REG
, BIT(4));
691 rtl_write_word(rtlpriv
, REG_PCIE_CTRL_REG
,
692 BIT(0) << (hw_queue
));