.. | .. |
---|
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 | | - * 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-2010 Realtek Corporation.*/ |
---|
25 | 3 | |
---|
26 | 4 | #include "../wifi.h" |
---|
27 | 5 | #include "../pci.h" |
---|
.. | .. |
---|
29 | 7 | #include "../stats.h" |
---|
30 | 8 | #include "reg.h" |
---|
31 | 9 | #include "def.h" |
---|
32 | | -#include "phy.h" |
---|
33 | 10 | #include "trx.h" |
---|
34 | 11 | #include "led.h" |
---|
35 | 12 | #include "dm.h" |
---|
.. | .. |
---|
79 | 56 | } |
---|
80 | 57 | |
---|
81 | 58 | static void query_rxphystatus(struct ieee80211_hw *hw, |
---|
82 | | - struct rtl_stats *pstatus, u8 *pdesc, |
---|
| 59 | + struct rtl_stats *pstatus, __le32 *pdesc, |
---|
83 | 60 | struct rx_fwinfo_8821ae *p_drvinfo, |
---|
84 | 61 | bool bpacket_match_bssid, |
---|
85 | 62 | bool bpacket_toself, bool packet_beacon) |
---|
.. | .. |
---|
297 | 274 | |
---|
298 | 275 | static void translate_rx_signal_stuff(struct ieee80211_hw *hw, |
---|
299 | 276 | struct sk_buff *skb, |
---|
300 | | - struct rtl_stats *pstatus, u8 *pdesc, |
---|
| 277 | + struct rtl_stats *pstatus, __le32 *pdesc, |
---|
301 | 278 | struct rx_fwinfo_8821ae *p_drvinfo) |
---|
302 | 279 | { |
---|
303 | 280 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); |
---|
.. | .. |
---|
307 | 284 | u8 *praddr; |
---|
308 | 285 | u8 *psaddr; |
---|
309 | 286 | __le16 fc; |
---|
310 | | - u16 type; |
---|
311 | 287 | bool packet_matchbssid, packet_toself, packet_beacon; |
---|
312 | 288 | |
---|
313 | 289 | tmp_buf = skb->data + pstatus->rx_drvinfo_size + pstatus->rx_bufshift; |
---|
314 | 290 | |
---|
315 | 291 | hdr = (struct ieee80211_hdr *)tmp_buf; |
---|
316 | 292 | fc = hdr->frame_control; |
---|
317 | | - type = WLAN_FC_GET_TYPE(hdr->frame_control); |
---|
318 | 293 | praddr = hdr->addr1; |
---|
319 | 294 | psaddr = ieee80211_get_SA(hdr); |
---|
320 | 295 | ether_addr_copy(pstatus->psaddr, psaddr); |
---|
.. | .. |
---|
357 | 332 | rtl_process_phyinfo(hw, tmp_buf, pstatus); |
---|
358 | 333 | } |
---|
359 | 334 | |
---|
360 | | -static void _rtl8821ae_insert_emcontent(struct rtl_tcb_desc *ptcb_desc, |
---|
361 | | - u8 *virtualaddress) |
---|
| 335 | +static void rtl8821ae_insert_emcontent(struct rtl_tcb_desc *ptcb_desc, |
---|
| 336 | + __le32 *virtualaddress) |
---|
362 | 337 | { |
---|
363 | 338 | u32 dwtmp = 0; |
---|
364 | 339 | |
---|
365 | 340 | memset(virtualaddress, 0, 8); |
---|
366 | 341 | |
---|
367 | | - SET_EARLYMODE_PKTNUM(virtualaddress, ptcb_desc->empkt_num); |
---|
| 342 | + set_earlymode_pktnum(virtualaddress, ptcb_desc->empkt_num); |
---|
368 | 343 | if (ptcb_desc->empkt_num == 1) { |
---|
369 | 344 | dwtmp = ptcb_desc->empkt_len[0]; |
---|
370 | 345 | } else { |
---|
.. | .. |
---|
372 | 347 | dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0)+4; |
---|
373 | 348 | dwtmp += ptcb_desc->empkt_len[1]; |
---|
374 | 349 | } |
---|
375 | | - SET_EARLYMODE_LEN0(virtualaddress, dwtmp); |
---|
| 350 | + set_earlymode_len0(virtualaddress, dwtmp); |
---|
376 | 351 | |
---|
377 | 352 | if (ptcb_desc->empkt_num <= 3) { |
---|
378 | 353 | dwtmp = ptcb_desc->empkt_len[2]; |
---|
.. | .. |
---|
381 | 356 | dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0)+4; |
---|
382 | 357 | dwtmp += ptcb_desc->empkt_len[3]; |
---|
383 | 358 | } |
---|
384 | | - SET_EARLYMODE_LEN1(virtualaddress, dwtmp); |
---|
| 359 | + set_earlymode_len1(virtualaddress, dwtmp); |
---|
385 | 360 | if (ptcb_desc->empkt_num <= 5) { |
---|
386 | 361 | dwtmp = ptcb_desc->empkt_len[4]; |
---|
387 | 362 | } else { |
---|
.. | .. |
---|
389 | 364 | dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0)+4; |
---|
390 | 365 | dwtmp += ptcb_desc->empkt_len[5]; |
---|
391 | 366 | } |
---|
392 | | - SET_EARLYMODE_LEN2_1(virtualaddress, dwtmp & 0xF); |
---|
393 | | - SET_EARLYMODE_LEN2_2(virtualaddress, dwtmp >> 4); |
---|
| 367 | + set_earlymode_len2_1(virtualaddress, dwtmp & 0xF); |
---|
| 368 | + set_earlymode_len2_2(virtualaddress, dwtmp >> 4); |
---|
394 | 369 | if (ptcb_desc->empkt_num <= 7) { |
---|
395 | 370 | dwtmp = ptcb_desc->empkt_len[6]; |
---|
396 | 371 | } else { |
---|
.. | .. |
---|
398 | 373 | dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0)+4; |
---|
399 | 374 | dwtmp += ptcb_desc->empkt_len[7]; |
---|
400 | 375 | } |
---|
401 | | - SET_EARLYMODE_LEN3(virtualaddress, dwtmp); |
---|
| 376 | + set_earlymode_len3(virtualaddress, dwtmp); |
---|
402 | 377 | if (ptcb_desc->empkt_num <= 9) { |
---|
403 | 378 | dwtmp = ptcb_desc->empkt_len[8]; |
---|
404 | 379 | } else { |
---|
.. | .. |
---|
406 | 381 | dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0)+4; |
---|
407 | 382 | dwtmp += ptcb_desc->empkt_len[9]; |
---|
408 | 383 | } |
---|
409 | | - SET_EARLYMODE_LEN4(virtualaddress, dwtmp); |
---|
| 384 | + set_earlymode_len4(virtualaddress, dwtmp); |
---|
410 | 385 | } |
---|
411 | 386 | |
---|
412 | | -static bool rtl8821ae_get_rxdesc_is_ht(struct ieee80211_hw *hw, u8 *pdesc) |
---|
| 387 | +static bool rtl8821ae_get_rxdesc_is_ht(struct ieee80211_hw *hw, __le32 *pdesc) |
---|
413 | 388 | { |
---|
414 | 389 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
---|
415 | 390 | u8 rx_rate = 0; |
---|
416 | 391 | |
---|
417 | | - rx_rate = GET_RX_DESC_RXMCS(pdesc); |
---|
| 392 | + rx_rate = get_rx_desc_rxmcs(pdesc); |
---|
418 | 393 | |
---|
419 | | - RT_TRACE(rtlpriv, COMP_RXDESC, DBG_LOUD, "rx_rate=0x%02x.\n", rx_rate); |
---|
| 394 | + rtl_dbg(rtlpriv, COMP_RXDESC, DBG_LOUD, "rx_rate=0x%02x.\n", rx_rate); |
---|
420 | 395 | |
---|
421 | 396 | if ((rx_rate >= DESC_RATEMCS0) && (rx_rate <= DESC_RATEMCS15)) |
---|
422 | 397 | return true; |
---|
423 | 398 | return false; |
---|
424 | 399 | } |
---|
425 | 400 | |
---|
426 | | -static bool rtl8821ae_get_rxdesc_is_vht(struct ieee80211_hw *hw, u8 *pdesc) |
---|
| 401 | +static bool rtl8821ae_get_rxdesc_is_vht(struct ieee80211_hw *hw, __le32 *pdesc) |
---|
427 | 402 | { |
---|
428 | 403 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
---|
429 | 404 | u8 rx_rate = 0; |
---|
430 | 405 | |
---|
431 | | - rx_rate = GET_RX_DESC_RXMCS(pdesc); |
---|
| 406 | + rx_rate = get_rx_desc_rxmcs(pdesc); |
---|
432 | 407 | |
---|
433 | | - RT_TRACE(rtlpriv, COMP_RXDESC, DBG_LOUD, "rx_rate=0x%02x.\n", rx_rate); |
---|
| 408 | + rtl_dbg(rtlpriv, COMP_RXDESC, DBG_LOUD, "rx_rate=0x%02x.\n", rx_rate); |
---|
434 | 409 | |
---|
435 | 410 | if (rx_rate >= DESC_RATEVHT1SS_MCS0) |
---|
436 | 411 | return true; |
---|
437 | 412 | return false; |
---|
438 | 413 | } |
---|
439 | 414 | |
---|
440 | | -static u8 rtl8821ae_get_rx_vht_nss(struct ieee80211_hw *hw, u8 *pdesc) |
---|
| 415 | +static u8 rtl8821ae_get_rx_vht_nss(struct ieee80211_hw *hw, __le32 *pdesc) |
---|
441 | 416 | { |
---|
442 | 417 | u8 rx_rate = 0; |
---|
443 | 418 | u8 vht_nss = 0; |
---|
444 | 419 | |
---|
445 | | - rx_rate = GET_RX_DESC_RXMCS(pdesc); |
---|
| 420 | + rx_rate = get_rx_desc_rxmcs(pdesc); |
---|
446 | 421 | if ((rx_rate >= DESC_RATEVHT1SS_MCS0) && |
---|
447 | 422 | (rx_rate <= DESC_RATEVHT1SS_MCS9)) |
---|
448 | 423 | vht_nss = 1; |
---|
.. | .. |
---|
456 | 431 | bool rtl8821ae_rx_query_desc(struct ieee80211_hw *hw, |
---|
457 | 432 | struct rtl_stats *status, |
---|
458 | 433 | struct ieee80211_rx_status *rx_status, |
---|
459 | | - u8 *pdesc, struct sk_buff *skb) |
---|
| 434 | + u8 *pdesc8, struct sk_buff *skb) |
---|
460 | 435 | { |
---|
461 | 436 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
---|
462 | 437 | struct rx_fwinfo_8821ae *p_drvinfo; |
---|
463 | 438 | struct ieee80211_hdr *hdr; |
---|
| 439 | + u8 wake_match; |
---|
| 440 | + __le32 *pdesc = (__le32 *)pdesc8; |
---|
| 441 | + u32 phystatus = get_rx_desc_physt(pdesc); |
---|
464 | 442 | |
---|
465 | | - u32 phystatus = GET_RX_DESC_PHYST(pdesc); |
---|
466 | | - |
---|
467 | | - status->length = (u16)GET_RX_DESC_PKT_LEN(pdesc); |
---|
468 | | - status->rx_drvinfo_size = (u8)GET_RX_DESC_DRV_INFO_SIZE(pdesc) * |
---|
| 443 | + status->length = (u16)get_rx_desc_pkt_len(pdesc); |
---|
| 444 | + status->rx_drvinfo_size = (u8)get_rx_desc_drv_info_size(pdesc) * |
---|
469 | 445 | RX_DRV_INFO_SIZE_UNIT; |
---|
470 | | - status->rx_bufshift = (u8)(GET_RX_DESC_SHIFT(pdesc) & 0x03); |
---|
471 | | - status->icv = (u16)GET_RX_DESC_ICV(pdesc); |
---|
472 | | - status->crc = (u16)GET_RX_DESC_CRC32(pdesc); |
---|
| 446 | + status->rx_bufshift = (u8)(get_rx_desc_shift(pdesc) & 0x03); |
---|
| 447 | + status->icv = (u16)get_rx_desc_icv(pdesc); |
---|
| 448 | + status->crc = (u16)get_rx_desc_crc32(pdesc); |
---|
473 | 449 | status->hwerror = (status->crc | status->icv); |
---|
474 | | - status->decrypted = !GET_RX_DESC_SWDEC(pdesc); |
---|
475 | | - status->rate = (u8)GET_RX_DESC_RXMCS(pdesc); |
---|
476 | | - status->shortpreamble = (u16)GET_RX_DESC_SPLCP(pdesc); |
---|
477 | | - status->isampdu = (bool)(GET_RX_DESC_PAGGR(pdesc) == 1); |
---|
478 | | - status->isfirst_ampdu = (bool)(GET_RX_DESC_PAGGR(pdesc) == 1); |
---|
479 | | - status->timestamp_low = GET_RX_DESC_TSFL(pdesc); |
---|
480 | | - status->rx_packet_bw = GET_RX_DESC_BW(pdesc); |
---|
481 | | - status->macid = GET_RX_DESC_MACID(pdesc); |
---|
482 | | - status->is_short_gi = !(bool)GET_RX_DESC_SPLCP(pdesc); |
---|
| 450 | + status->decrypted = !get_rx_desc_swdec(pdesc); |
---|
| 451 | + status->rate = (u8)get_rx_desc_rxmcs(pdesc); |
---|
| 452 | + status->shortpreamble = (u16)get_rx_desc_splcp(pdesc); |
---|
| 453 | + status->isampdu = (bool)(get_rx_desc_paggr(pdesc) == 1); |
---|
| 454 | + status->isfirst_ampdu = (bool)(get_rx_desc_paggr(pdesc) == 1); |
---|
| 455 | + status->timestamp_low = get_rx_desc_tsfl(pdesc); |
---|
| 456 | + status->rx_packet_bw = get_rx_desc_bw(pdesc); |
---|
| 457 | + status->macid = get_rx_desc_macid(pdesc); |
---|
| 458 | + status->is_short_gi = !(bool)get_rx_desc_splcp(pdesc); |
---|
483 | 459 | status->is_ht = rtl8821ae_get_rxdesc_is_ht(hw, pdesc); |
---|
484 | 460 | status->is_vht = rtl8821ae_get_rxdesc_is_vht(hw, pdesc); |
---|
485 | 461 | status->vht_nss = rtl8821ae_get_rx_vht_nss(hw, pdesc); |
---|
486 | 462 | status->is_cck = RTL8821AE_RX_HAL_IS_CCK_RATE(status->rate); |
---|
487 | 463 | |
---|
488 | | - RT_TRACE(rtlpriv, COMP_RXDESC, DBG_LOUD, |
---|
489 | | - "rx_packet_bw=%s,is_ht %d, is_vht %d, vht_nss=%d,is_short_gi %d.\n", |
---|
490 | | - (status->rx_packet_bw == 2) ? "80M" : |
---|
491 | | - (status->rx_packet_bw == 1) ? "40M" : "20M", |
---|
492 | | - status->is_ht, status->is_vht, status->vht_nss, |
---|
493 | | - status->is_short_gi); |
---|
| 464 | + rtl_dbg(rtlpriv, COMP_RXDESC, DBG_LOUD, |
---|
| 465 | + "rx_packet_bw=%s,is_ht %d, is_vht %d, vht_nss=%d,is_short_gi %d.\n", |
---|
| 466 | + (status->rx_packet_bw == 2) ? "80M" : |
---|
| 467 | + (status->rx_packet_bw == 1) ? "40M" : "20M", |
---|
| 468 | + status->is_ht, status->is_vht, status->vht_nss, |
---|
| 469 | + status->is_short_gi); |
---|
494 | 470 | |
---|
495 | | - if (GET_RX_STATUS_DESC_RPT_SEL(pdesc)) |
---|
| 471 | + if (get_rx_status_desc_rpt_sel(pdesc)) |
---|
496 | 472 | status->packet_report_type = C2H_PACKET; |
---|
497 | 473 | else |
---|
498 | 474 | status->packet_report_type = NORMAL_RX; |
---|
499 | 475 | |
---|
500 | | - if (GET_RX_STATUS_DESC_PATTERN_MATCH(pdesc)) |
---|
501 | | - status->wake_match = BIT(2); |
---|
502 | | - else if (GET_RX_STATUS_DESC_MAGIC_MATCH(pdesc)) |
---|
503 | | - status->wake_match = BIT(1); |
---|
504 | | - else if (GET_RX_STATUS_DESC_UNICAST_MATCH(pdesc)) |
---|
505 | | - status->wake_match = BIT(0); |
---|
| 476 | + if (get_rx_status_desc_pattern_match(pdesc)) |
---|
| 477 | + wake_match = BIT(2); |
---|
| 478 | + else if (get_rx_status_desc_magic_match(pdesc)) |
---|
| 479 | + wake_match = BIT(1); |
---|
| 480 | + else if (get_rx_status_desc_unicast_match(pdesc)) |
---|
| 481 | + wake_match = BIT(0); |
---|
506 | 482 | else |
---|
507 | | - status->wake_match = 0; |
---|
| 483 | + wake_match = 0; |
---|
508 | 484 | |
---|
509 | | - if (status->wake_match) |
---|
510 | | - RT_TRACE(rtlpriv, COMP_RXDESC, DBG_LOUD, |
---|
511 | | - "GGGGGGGGGGGGGet Wakeup Packet!! WakeMatch=%d\n", |
---|
512 | | - status->wake_match); |
---|
| 485 | + if (wake_match) |
---|
| 486 | + rtl_dbg(rtlpriv, COMP_RXDESC, DBG_LOUD, |
---|
| 487 | + "GGGGGGGGGGGGGet Wakeup Packet!! WakeMatch=%d\n", |
---|
| 488 | + wake_match); |
---|
513 | 489 | rx_status->freq = hw->conf.chandef.chan->center_freq; |
---|
514 | 490 | rx_status->band = hw->conf.chandef.chan->band; |
---|
515 | 491 | |
---|
.. | .. |
---|
568 | 544 | rx_status->signal = status->recvsignalpower + 10; |
---|
569 | 545 | if (status->packet_report_type == TX_REPORT2) { |
---|
570 | 546 | status->macid_valid_entry[0] = |
---|
571 | | - GET_RX_RPT2_DESC_MACID_VALID_1(pdesc); |
---|
| 547 | + get_rx_rpt2_desc_macid_valid_1(pdesc); |
---|
572 | 548 | status->macid_valid_entry[1] = |
---|
573 | | - GET_RX_RPT2_DESC_MACID_VALID_2(pdesc); |
---|
| 549 | + get_rx_rpt2_desc_macid_valid_2(pdesc); |
---|
574 | 550 | } |
---|
575 | 551 | return true; |
---|
576 | 552 | } |
---|
.. | .. |
---|
582 | 558 | struct rtl_phy *rtlphy = &rtlpriv->phy; |
---|
583 | 559 | u8 bw_setting_of_desc = 0; |
---|
584 | 560 | |
---|
585 | | - RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, |
---|
586 | | - "rtl8821ae_bw_mapping, current_chan_bw %d, packet_bw %d\n", |
---|
587 | | - rtlphy->current_chan_bw, ptcb_desc->packet_bw); |
---|
| 561 | + rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, |
---|
| 562 | + "%s, current_chan_bw %d, packet_bw %d\n", |
---|
| 563 | + __func__, |
---|
| 564 | + rtlphy->current_chan_bw, ptcb_desc->packet_bw); |
---|
588 | 565 | |
---|
589 | 566 | if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_80) { |
---|
590 | 567 | if (ptcb_desc->packet_bw == HT_CHANNEL_WIDTH_80) |
---|
.. | .. |
---|
626 | 603 | sc_setting_of_desc = |
---|
627 | 604 | VHT_DATA_SC_40_UPPER_OF_80MHZ; |
---|
628 | 605 | else |
---|
629 | | - RT_TRACE(rtlpriv, COMP_SEND, DBG_LOUD, |
---|
630 | | - "rtl8821ae_sc_mapping: Not Correct Primary40MHz Setting\n"); |
---|
| 606 | + rtl_dbg(rtlpriv, COMP_SEND, DBG_LOUD, |
---|
| 607 | + "%s: Not Correct Primary40MHz Setting\n", |
---|
| 608 | + __func__); |
---|
631 | 609 | } else { |
---|
632 | 610 | if ((mac->cur_40_prime_sc == |
---|
633 | 611 | HAL_PRIME_CHNL_OFFSET_LOWER) && |
---|
.. | .. |
---|
654 | 632 | sc_setting_of_desc = |
---|
655 | 633 | VHT_DATA_SC_20_UPPERST_OF_80MHZ; |
---|
656 | 634 | else |
---|
657 | | - RT_TRACE(rtlpriv, COMP_SEND, DBG_LOUD, |
---|
658 | | - "rtl8821ae_sc_mapping: Not Correct Primary40MHz Setting\n"); |
---|
| 635 | + rtl_dbg(rtlpriv, COMP_SEND, DBG_LOUD, |
---|
| 636 | + "%s: Not Correct Primary40MHz Setting\n", |
---|
| 637 | + __func__); |
---|
659 | 638 | } |
---|
660 | 639 | } else if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) { |
---|
661 | 640 | if (ptcb_desc->packet_bw == HT_CHANNEL_WIDTH_20_40) { |
---|
.. | .. |
---|
681 | 660 | } |
---|
682 | 661 | |
---|
683 | 662 | void rtl8821ae_tx_fill_desc(struct ieee80211_hw *hw, |
---|
684 | | - struct ieee80211_hdr *hdr, u8 *pdesc_tx, u8 *txbd, |
---|
| 663 | + struct ieee80211_hdr *hdr, u8 *pdesc8, u8 *txbd, |
---|
685 | 664 | struct ieee80211_tx_info *info, |
---|
686 | 665 | struct ieee80211_sta *sta, |
---|
687 | 666 | struct sk_buff *skb, |
---|
.. | .. |
---|
692 | 671 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
---|
693 | 672 | struct rtl_hal *rtlhal = rtl_hal(rtlpriv); |
---|
694 | 673 | struct rtlwifi_tx_info *tx_info = rtl_tx_skb_cb_info(skb); |
---|
695 | | - u8 *pdesc = (u8 *)pdesc_tx; |
---|
696 | 674 | u16 seq_number; |
---|
697 | 675 | __le16 fc = hdr->frame_control; |
---|
698 | 676 | unsigned int buf_len = 0; |
---|
.. | .. |
---|
704 | 682 | cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)) == 0); |
---|
705 | 683 | dma_addr_t mapping; |
---|
706 | 684 | u8 short_gi = 0; |
---|
| 685 | + bool tmp_bool; |
---|
| 686 | + __le32 *pdesc = (__le32 *)pdesc8; |
---|
707 | 687 | |
---|
708 | 688 | seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; |
---|
709 | 689 | rtl_get_tcb_desc(hw, info, sta, skb, ptcb_desc); |
---|
.. | .. |
---|
713 | 693 | memset(skb->data, 0, EM_HDR_LEN); |
---|
714 | 694 | } |
---|
715 | 695 | buf_len = skb->len; |
---|
716 | | - mapping = pci_map_single(rtlpci->pdev, skb->data, skb->len, |
---|
717 | | - PCI_DMA_TODEVICE); |
---|
718 | | - if (pci_dma_mapping_error(rtlpci->pdev, mapping)) { |
---|
719 | | - RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, |
---|
720 | | - "DMA mapping error\n"); |
---|
| 696 | + mapping = dma_map_single(&rtlpci->pdev->dev, skb->data, skb->len, |
---|
| 697 | + DMA_TO_DEVICE); |
---|
| 698 | + if (dma_mapping_error(&rtlpci->pdev->dev, mapping)) { |
---|
| 699 | + rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, |
---|
| 700 | + "DMA mapping error\n"); |
---|
721 | 701 | return; |
---|
722 | 702 | } |
---|
723 | | - CLEAR_PCI_TX_DESC_CONTENT(pdesc, sizeof(struct tx_desc_8821ae)); |
---|
| 703 | + clear_pci_tx_desc_content(pdesc, sizeof(struct tx_desc_8821ae)); |
---|
724 | 704 | if (ieee80211_is_nullfunc(fc) || ieee80211_is_ctl(fc)) { |
---|
725 | 705 | firstseg = true; |
---|
726 | 706 | lastseg = true; |
---|
727 | 707 | } |
---|
728 | 708 | if (firstseg) { |
---|
729 | 709 | if (rtlhal->earlymode_enable) { |
---|
730 | | - SET_TX_DESC_PKT_OFFSET(pdesc, 1); |
---|
731 | | - SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN + |
---|
| 710 | + set_tx_desc_pkt_offset(pdesc, 1); |
---|
| 711 | + set_tx_desc_offset(pdesc, USB_HWDESC_HEADER_LEN + |
---|
732 | 712 | EM_HDR_LEN); |
---|
733 | 713 | if (ptcb_desc->empkt_num) { |
---|
734 | | - RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, |
---|
735 | | - "Insert 8 byte.pTcb->EMPktNum:%d\n", |
---|
736 | | - ptcb_desc->empkt_num); |
---|
737 | | - _rtl8821ae_insert_emcontent(ptcb_desc, |
---|
738 | | - (u8 *)(skb->data)); |
---|
| 714 | + rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, |
---|
| 715 | + "Insert 8 byte.pTcb->EMPktNum:%d\n", |
---|
| 716 | + ptcb_desc->empkt_num); |
---|
| 717 | + rtl8821ae_insert_emcontent(ptcb_desc, |
---|
| 718 | + (__le32 *)skb->data); |
---|
739 | 719 | } |
---|
740 | 720 | } else { |
---|
741 | | - SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN); |
---|
| 721 | + set_tx_desc_offset(pdesc, USB_HWDESC_HEADER_LEN); |
---|
742 | 722 | } |
---|
743 | 723 | |
---|
744 | 724 | |
---|
745 | 725 | /* ptcb_desc->use_driver_rate = true; */ |
---|
746 | | - SET_TX_DESC_TX_RATE(pdesc, ptcb_desc->hw_rate); |
---|
| 726 | + set_tx_desc_tx_rate(pdesc, ptcb_desc->hw_rate); |
---|
747 | 727 | if (ptcb_desc->hw_rate > DESC_RATEMCS0) |
---|
748 | 728 | short_gi = (ptcb_desc->use_shortgi) ? 1 : 0; |
---|
749 | 729 | else |
---|
750 | 730 | short_gi = (ptcb_desc->use_shortpreamble) ? 1 : 0; |
---|
751 | 731 | |
---|
752 | | - SET_TX_DESC_DATA_SHORTGI(pdesc, short_gi); |
---|
| 732 | + set_tx_desc_data_shortgi(pdesc, short_gi); |
---|
753 | 733 | |
---|
754 | 734 | if (info->flags & IEEE80211_TX_CTL_AMPDU) { |
---|
755 | | - SET_TX_DESC_AGG_ENABLE(pdesc, 1); |
---|
756 | | - SET_TX_DESC_MAX_AGG_NUM(pdesc, 0x1f); |
---|
| 735 | + set_tx_desc_agg_enable(pdesc, 1); |
---|
| 736 | + set_tx_desc_max_agg_num(pdesc, 0x1f); |
---|
757 | 737 | } |
---|
758 | | - SET_TX_DESC_SEQ(pdesc, seq_number); |
---|
759 | | - SET_TX_DESC_RTS_ENABLE(pdesc, ((ptcb_desc->rts_enable && |
---|
| 738 | + set_tx_desc_seq(pdesc, seq_number); |
---|
| 739 | + set_tx_desc_rts_enable(pdesc, |
---|
| 740 | + ((ptcb_desc->rts_enable && |
---|
760 | 741 | !ptcb_desc->cts_enable) ? 1 : 0)); |
---|
761 | | - SET_TX_DESC_HW_RTS_ENABLE(pdesc, 0); |
---|
762 | | - SET_TX_DESC_CTS2SELF(pdesc, ((ptcb_desc->cts_enable) ? 1 : 0)); |
---|
| 742 | + set_tx_desc_hw_rts_enable(pdesc, 0); |
---|
| 743 | + set_tx_desc_cts2self(pdesc, ((ptcb_desc->cts_enable) ? 1 : 0)); |
---|
763 | 744 | |
---|
764 | | - SET_TX_DESC_RTS_RATE(pdesc, ptcb_desc->rts_rate); |
---|
765 | | - SET_TX_DESC_RTS_SC(pdesc, ptcb_desc->rts_sc); |
---|
766 | | - SET_TX_DESC_RTS_SHORT(pdesc, |
---|
767 | | - ((ptcb_desc->rts_rate <= DESC_RATE54M) ? |
---|
768 | | - (ptcb_desc->rts_use_shortpreamble ? 1 : 0) : |
---|
769 | | - (ptcb_desc->rts_use_shortgi ? 1 : 0))); |
---|
| 745 | + set_tx_desc_rts_rate(pdesc, ptcb_desc->rts_rate); |
---|
| 746 | + set_tx_desc_rts_sc(pdesc, ptcb_desc->rts_sc); |
---|
| 747 | + tmp_bool = ((ptcb_desc->rts_rate <= DESC_RATE54M) ? |
---|
| 748 | + (ptcb_desc->rts_use_shortpreamble ? 1 : 0) : |
---|
| 749 | + (ptcb_desc->rts_use_shortgi ? 1 : 0)); |
---|
| 750 | + set_tx_desc_rts_short(pdesc, tmp_bool); |
---|
770 | 751 | |
---|
771 | 752 | if (ptcb_desc->tx_enable_sw_calc_duration) |
---|
772 | | - SET_TX_DESC_NAV_USE_HDR(pdesc, 1); |
---|
| 753 | + set_tx_desc_nav_use_hdr(pdesc, 1); |
---|
773 | 754 | |
---|
774 | | - SET_TX_DESC_DATA_BW(pdesc, |
---|
775 | | - rtl8821ae_bw_mapping(hw, ptcb_desc)); |
---|
| 755 | + set_tx_desc_data_bw(pdesc, |
---|
| 756 | + rtl8821ae_bw_mapping(hw, ptcb_desc)); |
---|
776 | 757 | |
---|
777 | | - SET_TX_DESC_TX_SUB_CARRIER(pdesc, |
---|
778 | | - rtl8821ae_sc_mapping(hw, ptcb_desc)); |
---|
| 758 | + set_tx_desc_tx_sub_carrier(pdesc, |
---|
| 759 | + rtl8821ae_sc_mapping(hw, ptcb_desc)); |
---|
779 | 760 | |
---|
780 | | - SET_TX_DESC_LINIP(pdesc, 0); |
---|
781 | | - SET_TX_DESC_PKT_SIZE(pdesc, (u16)skb_len); |
---|
| 761 | + set_tx_desc_linip(pdesc, 0); |
---|
| 762 | + set_tx_desc_pkt_size(pdesc, (u16)skb_len); |
---|
782 | 763 | if (sta) { |
---|
783 | 764 | u8 ampdu_density = sta->ht_cap.ampdu_density; |
---|
784 | 765 | |
---|
785 | | - SET_TX_DESC_AMPDU_DENSITY(pdesc, ampdu_density); |
---|
| 766 | + set_tx_desc_ampdu_density(pdesc, ampdu_density); |
---|
786 | 767 | } |
---|
787 | 768 | if (info->control.hw_key) { |
---|
788 | 769 | struct ieee80211_key_conf *keyconf = |
---|
.. | .. |
---|
791 | 772 | case WLAN_CIPHER_SUITE_WEP40: |
---|
792 | 773 | case WLAN_CIPHER_SUITE_WEP104: |
---|
793 | 774 | case WLAN_CIPHER_SUITE_TKIP: |
---|
794 | | - SET_TX_DESC_SEC_TYPE(pdesc, 0x1); |
---|
| 775 | + set_tx_desc_sec_type(pdesc, 0x1); |
---|
795 | 776 | break; |
---|
796 | 777 | case WLAN_CIPHER_SUITE_CCMP: |
---|
797 | | - SET_TX_DESC_SEC_TYPE(pdesc, 0x3); |
---|
| 778 | + set_tx_desc_sec_type(pdesc, 0x3); |
---|
798 | 779 | break; |
---|
799 | 780 | default: |
---|
800 | | - SET_TX_DESC_SEC_TYPE(pdesc, 0x0); |
---|
| 781 | + set_tx_desc_sec_type(pdesc, 0x0); |
---|
801 | 782 | break; |
---|
802 | 783 | } |
---|
803 | 784 | } |
---|
804 | 785 | |
---|
805 | | - SET_TX_DESC_QUEUE_SEL(pdesc, fw_qsel); |
---|
806 | | - SET_TX_DESC_DATA_RATE_FB_LIMIT(pdesc, 0x1F); |
---|
807 | | - SET_TX_DESC_RTS_RATE_FB_LIMIT(pdesc, 0xF); |
---|
808 | | - SET_TX_DESC_DISABLE_FB(pdesc, ptcb_desc->disable_ratefallback ? |
---|
| 786 | + set_tx_desc_queue_sel(pdesc, fw_qsel); |
---|
| 787 | + set_tx_desc_data_rate_fb_limit(pdesc, 0x1F); |
---|
| 788 | + set_tx_desc_rts_rate_fb_limit(pdesc, 0xF); |
---|
| 789 | + set_tx_desc_disable_fb(pdesc, ptcb_desc->disable_ratefallback ? |
---|
809 | 790 | 1 : 0); |
---|
810 | | - SET_TX_DESC_USE_RATE(pdesc, ptcb_desc->use_driver_rate ? 1 : 0); |
---|
| 791 | + set_tx_desc_use_rate(pdesc, ptcb_desc->use_driver_rate ? 1 : 0); |
---|
811 | 792 | |
---|
812 | 793 | if (ieee80211_is_data_qos(fc)) { |
---|
813 | 794 | if (mac->rdg_en) { |
---|
814 | | - RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, |
---|
815 | | - "Enable RDG function.\n"); |
---|
816 | | - SET_TX_DESC_RDG_ENABLE(pdesc, 1); |
---|
817 | | - SET_TX_DESC_HTC(pdesc, 1); |
---|
| 795 | + rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, |
---|
| 796 | + "Enable RDG function.\n"); |
---|
| 797 | + set_tx_desc_rdg_enable(pdesc, 1); |
---|
| 798 | + set_tx_desc_htc(pdesc, 1); |
---|
818 | 799 | } |
---|
819 | 800 | } |
---|
820 | 801 | /* tx report */ |
---|
821 | | - rtl_set_tx_report(ptcb_desc, pdesc, hw, tx_info); |
---|
| 802 | + rtl_set_tx_report(ptcb_desc, pdesc8, hw, tx_info); |
---|
822 | 803 | } |
---|
823 | 804 | |
---|
824 | | - SET_TX_DESC_FIRST_SEG(pdesc, (firstseg ? 1 : 0)); |
---|
825 | | - SET_TX_DESC_LAST_SEG(pdesc, (lastseg ? 1 : 0)); |
---|
826 | | - SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)buf_len); |
---|
827 | | - SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping); |
---|
| 805 | + set_tx_desc_first_seg(pdesc, (firstseg ? 1 : 0)); |
---|
| 806 | + set_tx_desc_last_seg(pdesc, (lastseg ? 1 : 0)); |
---|
| 807 | + set_tx_desc_tx_buffer_size(pdesc, buf_len); |
---|
| 808 | + set_tx_desc_tx_buffer_address(pdesc, mapping); |
---|
828 | 809 | /* if (rtlpriv->dm.useramask) { */ |
---|
829 | 810 | if (1) { |
---|
830 | | - SET_TX_DESC_RATE_ID(pdesc, ptcb_desc->ratr_index); |
---|
831 | | - SET_TX_DESC_MACID(pdesc, ptcb_desc->mac_id); |
---|
| 811 | + set_tx_desc_rate_id(pdesc, ptcb_desc->ratr_index); |
---|
| 812 | + set_tx_desc_macid(pdesc, ptcb_desc->mac_id); |
---|
832 | 813 | } else { |
---|
833 | | - SET_TX_DESC_RATE_ID(pdesc, 0xC + ptcb_desc->ratr_index); |
---|
834 | | - SET_TX_DESC_MACID(pdesc, ptcb_desc->mac_id); |
---|
| 814 | + set_tx_desc_rate_id(pdesc, 0xC + ptcb_desc->ratr_index); |
---|
| 815 | + set_tx_desc_macid(pdesc, ptcb_desc->mac_id); |
---|
835 | 816 | } |
---|
836 | 817 | if (!ieee80211_is_data_qos(fc)) { |
---|
837 | | - SET_TX_DESC_HWSEQ_EN(pdesc, 1); |
---|
838 | | - SET_TX_DESC_HWSEQ_SEL(pdesc, 0); |
---|
| 818 | + set_tx_desc_hwseq_en(pdesc, 1); |
---|
| 819 | + set_tx_desc_hwseq_sel(pdesc, 0); |
---|
839 | 820 | } |
---|
840 | | - SET_TX_DESC_MORE_FRAG(pdesc, (lastseg ? 0 : 1)); |
---|
| 821 | + set_tx_desc_more_frag(pdesc, (lastseg ? 0 : 1)); |
---|
841 | 822 | if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) || |
---|
842 | 823 | is_broadcast_ether_addr(ieee80211_get_DA(hdr))) { |
---|
843 | | - SET_TX_DESC_BMC(pdesc, 1); |
---|
| 824 | + set_tx_desc_bmc(pdesc, 1); |
---|
844 | 825 | } |
---|
845 | 826 | |
---|
846 | | - rtl8821ae_dm_set_tx_ant_by_tx_info(hw, pdesc, ptcb_desc->mac_id); |
---|
847 | | - RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "\n"); |
---|
| 827 | + rtl8821ae_dm_set_tx_ant_by_tx_info(hw, pdesc8, ptcb_desc->mac_id); |
---|
| 828 | + rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, "\n"); |
---|
848 | 829 | } |
---|
849 | 830 | |
---|
850 | 831 | void rtl8821ae_tx_fill_cmddesc(struct ieee80211_hw *hw, |
---|
851 | | - u8 *pdesc, bool firstseg, |
---|
| 832 | + u8 *pdesc8, bool firstseg, |
---|
852 | 833 | bool lastseg, struct sk_buff *skb) |
---|
853 | 834 | { |
---|
854 | 835 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
---|
855 | 836 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
---|
856 | 837 | u8 fw_queue = QSLT_BEACON; |
---|
| 838 | + __le32 *pdesc = (__le32 *)pdesc8; |
---|
857 | 839 | |
---|
858 | | - dma_addr_t mapping = pci_map_single(rtlpci->pdev, |
---|
859 | | - skb->data, skb->len, |
---|
860 | | - PCI_DMA_TODEVICE); |
---|
| 840 | + dma_addr_t mapping = dma_map_single(&rtlpci->pdev->dev, skb->data, |
---|
| 841 | + skb->len, DMA_TO_DEVICE); |
---|
861 | 842 | |
---|
862 | | - if (pci_dma_mapping_error(rtlpci->pdev, mapping)) { |
---|
863 | | - RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, |
---|
864 | | - "DMA mapping error\n"); |
---|
| 843 | + if (dma_mapping_error(&rtlpci->pdev->dev, mapping)) { |
---|
| 844 | + rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, |
---|
| 845 | + "DMA mapping error\n"); |
---|
865 | 846 | return; |
---|
866 | 847 | } |
---|
867 | | - CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE); |
---|
| 848 | + clear_pci_tx_desc_content(pdesc, TX_DESC_SIZE); |
---|
868 | 849 | |
---|
869 | | - SET_TX_DESC_FIRST_SEG(pdesc, 1); |
---|
870 | | - SET_TX_DESC_LAST_SEG(pdesc, 1); |
---|
| 850 | + set_tx_desc_first_seg(pdesc, 1); |
---|
| 851 | + set_tx_desc_last_seg(pdesc, 1); |
---|
871 | 852 | |
---|
872 | | - SET_TX_DESC_PKT_SIZE((u8 *)pdesc, (u16)(skb->len)); |
---|
| 853 | + set_tx_desc_pkt_size(pdesc, (u16)(skb->len)); |
---|
873 | 854 | |
---|
874 | | - SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN); |
---|
| 855 | + set_tx_desc_offset(pdesc, USB_HWDESC_HEADER_LEN); |
---|
875 | 856 | |
---|
876 | | - SET_TX_DESC_USE_RATE(pdesc, 1); |
---|
877 | | - SET_TX_DESC_TX_RATE(pdesc, DESC_RATE1M); |
---|
878 | | - SET_TX_DESC_DISABLE_FB(pdesc, 1); |
---|
| 857 | + set_tx_desc_use_rate(pdesc, 1); |
---|
| 858 | + set_tx_desc_tx_rate(pdesc, DESC_RATE1M); |
---|
| 859 | + set_tx_desc_disable_fb(pdesc, 1); |
---|
879 | 860 | |
---|
880 | | - SET_TX_DESC_DATA_BW(pdesc, 0); |
---|
| 861 | + set_tx_desc_data_bw(pdesc, 0); |
---|
881 | 862 | |
---|
882 | | - SET_TX_DESC_HWSEQ_EN(pdesc, 1); |
---|
| 863 | + set_tx_desc_hwseq_en(pdesc, 1); |
---|
883 | 864 | |
---|
884 | | - SET_TX_DESC_QUEUE_SEL(pdesc, fw_queue); |
---|
| 865 | + set_tx_desc_queue_sel(pdesc, fw_queue); |
---|
885 | 866 | |
---|
886 | | - SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len)); |
---|
| 867 | + set_tx_desc_tx_buffer_size(pdesc, skb->len); |
---|
887 | 868 | |
---|
888 | | - SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping); |
---|
| 869 | + set_tx_desc_tx_buffer_address(pdesc, mapping); |
---|
889 | 870 | |
---|
890 | | - SET_TX_DESC_MACID(pdesc, 0); |
---|
| 871 | + set_tx_desc_macid(pdesc, 0); |
---|
891 | 872 | |
---|
892 | | - SET_TX_DESC_OWN(pdesc, 1); |
---|
| 873 | + set_tx_desc_own(pdesc, 1); |
---|
893 | 874 | |
---|
894 | 875 | RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_LOUD, |
---|
895 | 876 | "H2C Tx Cmd Content\n", |
---|
896 | | - pdesc, TX_DESC_SIZE); |
---|
| 877 | + pdesc8, TX_DESC_SIZE); |
---|
897 | 878 | } |
---|
898 | 879 | |
---|
899 | | -void rtl8821ae_set_desc(struct ieee80211_hw *hw, u8 *pdesc, |
---|
| 880 | +void rtl8821ae_set_desc(struct ieee80211_hw *hw, u8 *pdesc8, |
---|
900 | 881 | bool istx, u8 desc_name, u8 *val) |
---|
901 | 882 | { |
---|
| 883 | + __le32 *pdesc = (__le32 *)pdesc8; |
---|
| 884 | + |
---|
902 | 885 | if (istx) { |
---|
903 | 886 | switch (desc_name) { |
---|
904 | 887 | case HW_DESC_OWN: |
---|
905 | | - SET_TX_DESC_OWN(pdesc, 1); |
---|
| 888 | + set_tx_desc_own(pdesc, 1); |
---|
906 | 889 | break; |
---|
907 | 890 | case HW_DESC_TX_NEXTDESC_ADDR: |
---|
908 | | - SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *)val); |
---|
| 891 | + set_tx_desc_next_desc_address(pdesc, *(u32 *)val); |
---|
909 | 892 | break; |
---|
910 | 893 | default: |
---|
911 | 894 | WARN_ONCE(true, |
---|
.. | .. |
---|
916 | 899 | } else { |
---|
917 | 900 | switch (desc_name) { |
---|
918 | 901 | case HW_DESC_RXOWN: |
---|
919 | | - SET_RX_DESC_OWN(pdesc, 1); |
---|
| 902 | + set_rx_desc_own(pdesc, 1); |
---|
920 | 903 | break; |
---|
921 | 904 | case HW_DESC_RXBUFF_ADDR: |
---|
922 | | - SET_RX_DESC_BUFF_ADDR(pdesc, *(u32 *)val); |
---|
| 905 | + set_rx_desc_buff_addr(pdesc, *(u32 *)val); |
---|
923 | 906 | break; |
---|
924 | 907 | case HW_DESC_RXPKT_LEN: |
---|
925 | | - SET_RX_DESC_PKT_LEN(pdesc, *(u32 *)val); |
---|
| 908 | + set_rx_desc_pkt_len(pdesc, *(u32 *)val); |
---|
926 | 909 | break; |
---|
927 | 910 | case HW_DESC_RXERO: |
---|
928 | | - SET_RX_DESC_EOR(pdesc, 1); |
---|
| 911 | + set_rx_desc_eor(pdesc, 1); |
---|
929 | 912 | break; |
---|
930 | 913 | default: |
---|
931 | 914 | WARN_ONCE(true, |
---|
.. | .. |
---|
937 | 920 | } |
---|
938 | 921 | |
---|
939 | 922 | u64 rtl8821ae_get_desc(struct ieee80211_hw *hw, |
---|
940 | | - u8 *pdesc, bool istx, u8 desc_name) |
---|
| 923 | + u8 *pdesc8, bool istx, u8 desc_name) |
---|
941 | 924 | { |
---|
942 | 925 | u32 ret = 0; |
---|
| 926 | + __le32 *pdesc = (__le32 *)pdesc8; |
---|
943 | 927 | |
---|
944 | 928 | if (istx) { |
---|
945 | 929 | switch (desc_name) { |
---|
946 | 930 | case HW_DESC_OWN: |
---|
947 | | - ret = GET_TX_DESC_OWN(pdesc); |
---|
| 931 | + ret = get_tx_desc_own(pdesc); |
---|
948 | 932 | break; |
---|
949 | 933 | case HW_DESC_TXBUFF_ADDR: |
---|
950 | | - ret = GET_TX_DESC_TX_BUFFER_ADDRESS(pdesc); |
---|
| 934 | + ret = get_tx_desc_tx_buffer_address(pdesc); |
---|
951 | 935 | break; |
---|
952 | 936 | default: |
---|
953 | 937 | WARN_ONCE(true, |
---|
.. | .. |
---|
958 | 942 | } else { |
---|
959 | 943 | switch (desc_name) { |
---|
960 | 944 | case HW_DESC_OWN: |
---|
961 | | - ret = GET_RX_DESC_OWN(pdesc); |
---|
| 945 | + ret = get_rx_desc_own(pdesc); |
---|
962 | 946 | break; |
---|
963 | 947 | case HW_DESC_RXPKT_LEN: |
---|
964 | | - ret = GET_RX_DESC_PKT_LEN(pdesc); |
---|
| 948 | + ret = get_rx_desc_pkt_len(pdesc); |
---|
965 | 949 | break; |
---|
966 | 950 | case HW_DESC_RXBUFF_ADDR: |
---|
967 | | - ret = GET_RX_DESC_BUFF_ADDR(pdesc); |
---|
| 951 | + ret = get_rx_desc_buff_addr(pdesc); |
---|
968 | 952 | break; |
---|
969 | 953 | default: |
---|
970 | 954 | WARN_ONCE(true, |
---|