hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c
....@@ -1,27 +1,5 @@
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
- * The full GNU General Public License is included in this distribution in the
15
- * file called LICENSE.
16
- *
17
- * Contact Information:
18
- * wlanfae <wlanfae@realtek.com>
19
- * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20
- * Hsinchu 300, Taiwan.
21
- *
22
- * Larry Finger <Larry.Finger@lwfinger.net>
23
- *
24
- *****************************************************************************/
1
+// SPDX-License-Identifier: GPL-2.0
2
+/* Copyright(c) 2009-2012 Realtek Corporation.*/
253
264 #include "../wifi.h"
275 #include "../pci.h"
....@@ -55,7 +33,7 @@
5533 }
5634
5735 static void _rtl92se_query_rxphystatus(struct ieee80211_hw *hw,
58
- struct rtl_stats *pstats, u8 *pdesc,
36
+ struct rtl_stats *pstats, __le32 *pdesc,
5937 struct rx_fwinfo *p_drvinfo,
6038 bool packet_match_bssid,
6139 bool packet_toself,
....@@ -215,11 +193,10 @@
215193
216194 static void _rtl92se_translate_rx_signal_stuff(struct ieee80211_hw *hw,
217195 struct sk_buff *skb, struct rtl_stats *pstats,
218
- u8 *pdesc, struct rx_fwinfo *p_drvinfo)
196
+ __le32 *pdesc, struct rx_fwinfo *p_drvinfo)
219197 {
220198 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
221199 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
222
-
223200 struct ieee80211_hdr *hdr;
224201 u8 *tmp_buf;
225202 u8 *praddr;
....@@ -254,29 +231,30 @@
254231 }
255232
256233 bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
257
- struct ieee80211_rx_status *rx_status, u8 *pdesc,
234
+ struct ieee80211_rx_status *rx_status, u8 *pdesc8,
258235 struct sk_buff *skb)
259236 {
260237 struct rx_fwinfo *p_drvinfo;
261
- u32 phystatus = (u32)GET_RX_STATUS_DESC_PHY_STATUS(pdesc);
238
+ __le32 *pdesc = (__le32 *)pdesc8;
239
+ u32 phystatus = (u32)get_rx_status_desc_phy_status(pdesc);
262240 struct ieee80211_hdr *hdr;
263241
264
- stats->length = (u16)GET_RX_STATUS_DESC_PKT_LEN(pdesc);
265
- stats->rx_drvinfo_size = (u8)GET_RX_STATUS_DESC_DRVINFO_SIZE(pdesc) * 8;
266
- stats->rx_bufshift = (u8)(GET_RX_STATUS_DESC_SHIFT(pdesc) & 0x03);
267
- stats->icv = (u16)GET_RX_STATUS_DESC_ICV(pdesc);
268
- stats->crc = (u16)GET_RX_STATUS_DESC_CRC32(pdesc);
242
+ stats->length = (u16)get_rx_status_desc_pkt_len(pdesc);
243
+ stats->rx_drvinfo_size = (u8)get_rx_status_desc_drvinfo_size(pdesc) * 8;
244
+ stats->rx_bufshift = (u8)(get_rx_status_desc_shift(pdesc) & 0x03);
245
+ stats->icv = (u16)get_rx_status_desc_icv(pdesc);
246
+ stats->crc = (u16)get_rx_status_desc_crc32(pdesc);
269247 stats->hwerror = (u16)(stats->crc | stats->icv);
270
- stats->decrypted = !GET_RX_STATUS_DESC_SWDEC(pdesc);
248
+ stats->decrypted = !get_rx_status_desc_swdec(pdesc);
271249
272
- stats->rate = (u8)GET_RX_STATUS_DESC_RX_MCS(pdesc);
273
- stats->shortpreamble = (u16)GET_RX_STATUS_DESC_SPLCP(pdesc);
274
- stats->isampdu = (bool)(GET_RX_STATUS_DESC_PAGGR(pdesc) == 1);
275
- stats->isfirst_ampdu = (bool) ((GET_RX_STATUS_DESC_PAGGR(pdesc) == 1)
276
- && (GET_RX_STATUS_DESC_FAGGR(pdesc) == 1));
277
- stats->timestamp_low = GET_RX_STATUS_DESC_TSFL(pdesc);
278
- stats->rx_is40Mhzpacket = (bool)GET_RX_STATUS_DESC_BW(pdesc);
279
- stats->is_ht = (bool)GET_RX_STATUS_DESC_RX_HT(pdesc);
250
+ stats->rate = (u8)get_rx_status_desc_rx_mcs(pdesc);
251
+ stats->shortpreamble = (u16)get_rx_status_desc_splcp(pdesc);
252
+ stats->isampdu = (bool)(get_rx_status_desc_paggr(pdesc) == 1);
253
+ stats->isfirst_ampdu = (bool)((get_rx_status_desc_paggr(pdesc) == 1) &&
254
+ (get_rx_status_desc_faggr(pdesc) == 1));
255
+ stats->timestamp_low = get_rx_status_desc_tsfl(pdesc);
256
+ stats->rx_is40mhzpacket = (bool)get_rx_status_desc_bw(pdesc);
257
+ stats->is_ht = (bool)get_rx_status_desc_rx_ht(pdesc);
280258 stats->is_cck = SE_RX_HAL_IS_CCK_RATE(pdesc);
281259
282260 if (stats->hwerror)
....@@ -288,7 +266,7 @@
288266 if (stats->crc)
289267 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
290268
291
- if (stats->rx_is40Mhzpacket)
269
+ if (stats->rx_is40mhzpacket)
292270 rx_status->bw = RATE_INFO_BW_40;
293271
294272 if (stats->is_ht)
....@@ -332,7 +310,7 @@
332310 }
333311
334312 void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
335
- struct ieee80211_hdr *hdr, u8 *pdesc_tx,
313
+ struct ieee80211_hdr *hdr, u8 *pdesc8,
336314 u8 *pbd_desc_tx, struct ieee80211_tx_info *info,
337315 struct ieee80211_sta *sta,
338316 struct sk_buff *skb,
....@@ -342,7 +320,7 @@
342320 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
343321 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
344322 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
345
- u8 *pdesc = pdesc_tx;
323
+ __le32 *pdesc = (__le32 *)pdesc8;
346324 u16 seq_number;
347325 __le16 fc = hdr->frame_control;
348326 u8 reserved_macid = 0;
....@@ -350,13 +328,13 @@
350328 bool firstseg = (!(hdr->seq_ctrl & cpu_to_le16(IEEE80211_SCTL_FRAG)));
351329 bool lastseg = (!(hdr->frame_control &
352330 cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)));
353
- dma_addr_t mapping = pci_map_single(rtlpci->pdev, skb->data, skb->len,
354
- PCI_DMA_TODEVICE);
331
+ dma_addr_t mapping = dma_map_single(&rtlpci->pdev->dev, skb->data,
332
+ skb->len, DMA_TO_DEVICE);
355333 u8 bw_40 = 0;
356334
357
- if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
358
- RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
359
- "DMA mapping error\n");
335
+ if (dma_mapping_error(&rtlpci->pdev->dev, mapping)) {
336
+ rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE,
337
+ "DMA mapping error\n");
360338 return;
361339 }
362340 if (mac->opmode == NL80211_IFTYPE_STATION) {
....@@ -382,13 +360,13 @@
382360 if (rtlpriv->dm.useramask) {
383361 /* set txdesc macId */
384362 if (ptcb_desc->mac_id < 32) {
385
- SET_TX_DESC_MACID(pdesc, ptcb_desc->mac_id);
363
+ set_tx_desc_macid(pdesc, ptcb_desc->mac_id);
386364 reserved_macid |= ptcb_desc->mac_id;
387365 }
388366 }
389
- SET_TX_DESC_RSVD_MACID(pdesc, reserved_macid);
367
+ set_tx_desc_rsvd_macid(pdesc, reserved_macid);
390368
391
- SET_TX_DESC_TXHT(pdesc, ((ptcb_desc->hw_rate >=
369
+ set_tx_desc_txht(pdesc, ((ptcb_desc->hw_rate >=
392370 DESC_RATEMCS0) ? 1 : 0));
393371
394372 if (rtlhal->version == VERSION_8192S_ACUT) {
....@@ -400,31 +378,32 @@
400378 }
401379 }
402380
403
- SET_TX_DESC_TX_RATE(pdesc, ptcb_desc->hw_rate);
381
+ set_tx_desc_tx_rate(pdesc, ptcb_desc->hw_rate);
404382
405383 if (ptcb_desc->use_shortgi || ptcb_desc->use_shortpreamble)
406
- SET_TX_DESC_TX_SHORT(pdesc, 0);
384
+ set_tx_desc_tx_short(pdesc, 0);
407385
408386 /* Aggregation related */
409387 if (info->flags & IEEE80211_TX_CTL_AMPDU)
410
- SET_TX_DESC_AGG_ENABLE(pdesc, 1);
388
+ set_tx_desc_agg_enable(pdesc, 1);
411389
412390 /* For AMPDU, we must insert SSN into TX_DESC */
413
- SET_TX_DESC_SEQ(pdesc, seq_number);
391
+ set_tx_desc_seq(pdesc, seq_number);
414392
415393 /* Protection mode related */
416394 /* For 92S, if RTS/CTS are set, HW will execute RTS. */
417395 /* We choose only one protection mode to execute */
418
- SET_TX_DESC_RTS_ENABLE(pdesc, ((ptcb_desc->rts_enable &&
419
- !ptcb_desc->cts_enable) ? 1 : 0));
420
- SET_TX_DESC_CTS_ENABLE(pdesc, ((ptcb_desc->cts_enable) ?
396
+ set_tx_desc_rts_enable(pdesc, ((ptcb_desc->rts_enable &&
397
+ !ptcb_desc->cts_enable) ?
398
+ 1 : 0));
399
+ set_tx_desc_cts_enable(pdesc, ((ptcb_desc->cts_enable) ?
421400 1 : 0));
422
- SET_TX_DESC_RTS_STBC(pdesc, ((ptcb_desc->rts_stbc) ? 1 : 0));
401
+ set_tx_desc_rts_stbc(pdesc, ((ptcb_desc->rts_stbc) ? 1 : 0));
423402
424
- SET_TX_DESC_RTS_RATE(pdesc, ptcb_desc->rts_rate);
425
- SET_TX_DESC_RTS_BANDWIDTH(pdesc, 0);
426
- SET_TX_DESC_RTS_SUB_CARRIER(pdesc, ptcb_desc->rts_sc);
427
- SET_TX_DESC_RTS_SHORT(pdesc, ((ptcb_desc->rts_rate <=
403
+ set_tx_desc_rts_rate(pdesc, ptcb_desc->rts_rate);
404
+ set_tx_desc_rts_bandwidth(pdesc, 0);
405
+ set_tx_desc_rts_sub_carrier(pdesc, ptcb_desc->rts_sc);
406
+ set_tx_desc_rts_short(pdesc, ((ptcb_desc->rts_rate <=
428407 DESC_RATE54M) ?
429408 (ptcb_desc->rts_use_shortpreamble ? 1 : 0)
430409 : (ptcb_desc->rts_use_shortgi ? 1 : 0)));
....@@ -433,27 +412,27 @@
433412 /* Set Bandwidth and sub-channel settings. */
434413 if (bw_40) {
435414 if (ptcb_desc->packet_bw) {
436
- SET_TX_DESC_TX_BANDWIDTH(pdesc, 1);
415
+ set_tx_desc_tx_bandwidth(pdesc, 1);
437416 /* use duplicated mode */
438
- SET_TX_DESC_TX_SUB_CARRIER(pdesc, 0);
417
+ set_tx_desc_tx_sub_carrier(pdesc, 0);
439418 } else {
440
- SET_TX_DESC_TX_BANDWIDTH(pdesc, 0);
441
- SET_TX_DESC_TX_SUB_CARRIER(pdesc,
419
+ set_tx_desc_tx_bandwidth(pdesc, 0);
420
+ set_tx_desc_tx_sub_carrier(pdesc,
442421 mac->cur_40_prime_sc);
443422 }
444423 } else {
445
- SET_TX_DESC_TX_BANDWIDTH(pdesc, 0);
446
- SET_TX_DESC_TX_SUB_CARRIER(pdesc, 0);
424
+ set_tx_desc_tx_bandwidth(pdesc, 0);
425
+ set_tx_desc_tx_sub_carrier(pdesc, 0);
447426 }
448427
449428 /* 3 Fill necessary field in First Descriptor */
450429 /*DWORD 0*/
451
- SET_TX_DESC_LINIP(pdesc, 0);
452
- SET_TX_DESC_OFFSET(pdesc, 32);
453
- SET_TX_DESC_PKT_SIZE(pdesc, (u16) skb->len);
430
+ set_tx_desc_linip(pdesc, 0);
431
+ set_tx_desc_offset(pdesc, 32);
432
+ set_tx_desc_pkt_size(pdesc, (u16)skb->len);
454433
455434 /*DWORD 1*/
456
- SET_TX_DESC_RA_BRSR_ID(pdesc, ptcb_desc->ratr_index);
435
+ set_tx_desc_ra_brsr_id(pdesc, ptcb_desc->ratr_index);
457436
458437 /* Fill security related */
459438 if (info->control.hw_key) {
....@@ -463,69 +442,70 @@
463442 switch (keyconf->cipher) {
464443 case WLAN_CIPHER_SUITE_WEP40:
465444 case WLAN_CIPHER_SUITE_WEP104:
466
- SET_TX_DESC_SEC_TYPE(pdesc, 0x1);
445
+ set_tx_desc_sec_type(pdesc, 0x1);
467446 break;
468447 case WLAN_CIPHER_SUITE_TKIP:
469
- SET_TX_DESC_SEC_TYPE(pdesc, 0x2);
448
+ set_tx_desc_sec_type(pdesc, 0x2);
470449 break;
471450 case WLAN_CIPHER_SUITE_CCMP:
472
- SET_TX_DESC_SEC_TYPE(pdesc, 0x3);
451
+ set_tx_desc_sec_type(pdesc, 0x3);
473452 break;
474453 default:
475
- SET_TX_DESC_SEC_TYPE(pdesc, 0x0);
454
+ set_tx_desc_sec_type(pdesc, 0x0);
476455 break;
477456
478457 }
479458 }
480459
481460 /* Set Packet ID */
482
- SET_TX_DESC_PACKET_ID(pdesc, 0);
461
+ set_tx_desc_packet_id(pdesc, 0);
483462
484463 /* We will assign magement queue to BK. */
485
- SET_TX_DESC_QUEUE_SEL(pdesc, fw_qsel);
464
+ set_tx_desc_queue_sel(pdesc, fw_qsel);
486465
487466 /* Alwasy enable all rate fallback range */
488
- SET_TX_DESC_DATA_RATE_FB_LIMIT(pdesc, 0x1F);
467
+ set_tx_desc_data_rate_fb_limit(pdesc, 0x1F);
489468
490469 /* Fix: I don't kown why hw use 6.5M to tx when set it */
491
- SET_TX_DESC_USER_RATE(pdesc,
470
+ set_tx_desc_user_rate(pdesc,
492471 ptcb_desc->use_driver_rate ? 1 : 0);
493472
494473 /* Set NON_QOS bit. */
495474 if (!ieee80211_is_data_qos(fc))
496
- SET_TX_DESC_NON_QOS(pdesc, 1);
475
+ set_tx_desc_non_qos(pdesc, 1);
497476
498477 }
499478
500479 /* Fill fields that are required to be initialized
501480 * in all of the descriptors */
502481 /*DWORD 0 */
503
- SET_TX_DESC_FIRST_SEG(pdesc, (firstseg ? 1 : 0));
504
- SET_TX_DESC_LAST_SEG(pdesc, (lastseg ? 1 : 0));
482
+ set_tx_desc_first_seg(pdesc, (firstseg ? 1 : 0));
483
+ set_tx_desc_last_seg(pdesc, (lastseg ? 1 : 0));
505484
506485 /* DWORD 7 */
507
- SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16) skb->len);
486
+ set_tx_desc_tx_buffer_size(pdesc, (u16)skb->len);
508487
509488 /* DOWRD 8 */
510
- SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping);
489
+ set_tx_desc_tx_buffer_address(pdesc, mapping);
511490
512
- RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "\n");
491
+ rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, "\n");
513492 }
514493
515
-void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
516
- bool firstseg, bool lastseg, struct sk_buff *skb)
494
+void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc8,
495
+ bool firstseg, bool lastseg, struct sk_buff *skb)
517496 {
518497 struct rtl_priv *rtlpriv = rtl_priv(hw);
519498 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
520499 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
521500 struct rtl_tcb_desc *tcb_desc = (struct rtl_tcb_desc *)(skb->cb);
501
+ __le32 *pdesc = (__le32 *)pdesc8;
522502
523
- dma_addr_t mapping = pci_map_single(rtlpci->pdev, skb->data, skb->len,
524
- PCI_DMA_TODEVICE);
503
+ dma_addr_t mapping = dma_map_single(&rtlpci->pdev->dev, skb->data,
504
+ skb->len, DMA_TO_DEVICE);
525505
526
- if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
527
- RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
528
- "DMA mapping error\n");
506
+ if (dma_mapping_error(&rtlpci->pdev->dev, mapping)) {
507
+ rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE,
508
+ "DMA mapping error\n");
529509 return;
530510 }
531511 /* Clear all status */
....@@ -534,53 +514,55 @@
534514 /* This bit indicate this packet is used for FW download. */
535515 if (tcb_desc->cmd_or_init == DESC_PACKET_TYPE_INIT) {
536516 /* For firmware downlaod we only need to set LINIP */
537
- SET_TX_DESC_LINIP(pdesc, tcb_desc->last_inipkt);
517
+ set_tx_desc_linip(pdesc, tcb_desc->last_inipkt);
538518
539519 /* 92SE must set as 1 for firmware download HW DMA error */
540
- SET_TX_DESC_FIRST_SEG(pdesc, 1);
541
- SET_TX_DESC_LAST_SEG(pdesc, 1);
520
+ set_tx_desc_first_seg(pdesc, 1);
521
+ set_tx_desc_last_seg(pdesc, 1);
542522
543523 /* 92SE need not to set TX packet size when firmware download */
544
- SET_TX_DESC_PKT_SIZE(pdesc, (u16)(skb->len));
545
- SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len));
546
- SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping);
524
+ set_tx_desc_pkt_size(pdesc, (u16)(skb->len));
525
+ set_tx_desc_tx_buffer_size(pdesc, (u16)(skb->len));
526
+ set_tx_desc_tx_buffer_address(pdesc, mapping);
547527
548528 wmb();
549
- SET_TX_DESC_OWN(pdesc, 1);
529
+ set_tx_desc_own(pdesc, 1);
550530 } else { /* H2C Command Desc format (Host TXCMD) */
551531 /* 92SE must set as 1 for firmware download HW DMA error */
552
- SET_TX_DESC_FIRST_SEG(pdesc, 1);
553
- SET_TX_DESC_LAST_SEG(pdesc, 1);
532
+ set_tx_desc_first_seg(pdesc, 1);
533
+ set_tx_desc_last_seg(pdesc, 1);
554534
555
- SET_TX_DESC_OFFSET(pdesc, 0x20);
535
+ set_tx_desc_offset(pdesc, 0x20);
556536
557537 /* Buffer size + command header */
558
- SET_TX_DESC_PKT_SIZE(pdesc, (u16)(skb->len));
538
+ set_tx_desc_pkt_size(pdesc, (u16)(skb->len));
559539 /* Fixed queue of H2C command */
560
- SET_TX_DESC_QUEUE_SEL(pdesc, 0x13);
540
+ set_tx_desc_queue_sel(pdesc, 0x13);
561541
562
- SET_BITS_TO_LE_4BYTE(skb->data, 24, 7, rtlhal->h2c_txcmd_seq);
563
-
564
- SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len));
565
- SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping);
542
+ le32p_replace_bits((__le32 *)skb->data, rtlhal->h2c_txcmd_seq,
543
+ GENMASK(30, 24));
544
+ set_tx_desc_tx_buffer_size(pdesc, (u16)(skb->len));
545
+ set_tx_desc_tx_buffer_address(pdesc, mapping);
566546
567547 wmb();
568
- SET_TX_DESC_OWN(pdesc, 1);
548
+ set_tx_desc_own(pdesc, 1);
569549
570550 }
571551 }
572552
573
-void rtl92se_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
553
+void rtl92se_set_desc(struct ieee80211_hw *hw, u8 *pdesc8, bool istx,
574554 u8 desc_name, u8 *val)
575555 {
556
+ __le32 *pdesc = (__le32 *)pdesc8;
557
+
576558 if (istx) {
577559 switch (desc_name) {
578560 case HW_DESC_OWN:
579561 wmb();
580
- SET_TX_DESC_OWN(pdesc, 1);
562
+ set_tx_desc_own(pdesc, 1);
581563 break;
582564 case HW_DESC_TX_NEXTDESC_ADDR:
583
- SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val);
565
+ set_tx_desc_next_desc_address(pdesc, *(u32 *)val);
584566 break;
585567 default:
586568 WARN_ONCE(true, "rtl8192se: ERR txdesc :%d not processed\n",
....@@ -591,16 +573,16 @@
591573 switch (desc_name) {
592574 case HW_DESC_RXOWN:
593575 wmb();
594
- SET_RX_STATUS_DESC_OWN(pdesc, 1);
576
+ set_rx_status_desc_own(pdesc, 1);
595577 break;
596578 case HW_DESC_RXBUFF_ADDR:
597
- SET_RX_STATUS__DESC_BUFF_ADDR(pdesc, *(u32 *) val);
579
+ set_rx_status__desc_buff_addr(pdesc, *(u32 *)val);
598580 break;
599581 case HW_DESC_RXPKT_LEN:
600
- SET_RX_STATUS_DESC_PKT_LEN(pdesc, *(u32 *) val);
582
+ set_rx_status_desc_pkt_len(pdesc, *(u32 *)val);
601583 break;
602584 case HW_DESC_RXERO:
603
- SET_RX_STATUS_DESC_EOR(pdesc, 1);
585
+ set_rx_status_desc_eor(pdesc, 1);
604586 break;
605587 default:
606588 WARN_ONCE(true, "rtl8192se: ERR rxdesc :%d not processed\n",
....@@ -611,17 +593,18 @@
611593 }
612594
613595 u64 rtl92se_get_desc(struct ieee80211_hw *hw,
614
- u8 *desc, bool istx, u8 desc_name)
596
+ u8 *desc8, bool istx, u8 desc_name)
615597 {
616598 u32 ret = 0;
599
+ __le32 *desc = (__le32 *)desc8;
617600
618601 if (istx) {
619602 switch (desc_name) {
620603 case HW_DESC_OWN:
621
- ret = GET_TX_DESC_OWN(desc);
604
+ ret = get_tx_desc_own(desc);
622605 break;
623606 case HW_DESC_TXBUFF_ADDR:
624
- ret = GET_TX_DESC_TX_BUFFER_ADDRESS(desc);
607
+ ret = get_tx_desc_tx_buffer_address(desc);
625608 break;
626609 default:
627610 WARN_ONCE(true, "rtl8192se: ERR txdesc :%d not processed\n",
....@@ -631,13 +614,13 @@
631614 } else {
632615 switch (desc_name) {
633616 case HW_DESC_OWN:
634
- ret = GET_RX_STATUS_DESC_OWN(desc);
617
+ ret = get_rx_status_desc_own(desc);
635618 break;
636619 case HW_DESC_RXPKT_LEN:
637
- ret = GET_RX_STATUS_DESC_PKT_LEN(desc);
620
+ ret = get_rx_status_desc_pkt_len(desc);
638621 break;
639622 case HW_DESC_RXBUFF_ADDR:
640
- ret = GET_RX_STATUS_DESC_BUFF_ADDR(desc);
623
+ ret = get_rx_status_desc_buff_addr(desc);
641624 break;
642625 default:
643626 WARN_ONCE(true, "rtl8192se: ERR rxdesc :%d not processed\n",