rx.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
  2. /* Copyright(c) 2018-2019 Realtek Corporation
  3. */
  4. #ifndef __RTW_RX_H_
  5. #define __RTW_RX_H_
  6. enum rtw_rx_desc_enc {
  7. RX_DESC_ENC_NONE = 0,
  8. RX_DESC_ENC_WEP40 = 1,
  9. RX_DESC_ENC_TKIP_WO_MIC = 2,
  10. RX_DESC_ENC_TKIP_MIC = 3,
  11. RX_DESC_ENC_AES = 4,
  12. RX_DESC_ENC_WEP104 = 5,
  13. };
  14. #define GET_RX_DESC_PHYST(rxdesc) \
  15. le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(26))
  16. #define GET_RX_DESC_ICV_ERR(rxdesc) \
  17. le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(15))
  18. #define GET_RX_DESC_CRC32(rxdesc) \
  19. le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(14))
  20. #define GET_RX_DESC_SWDEC(rxdesc) \
  21. le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(27))
  22. #define GET_RX_DESC_C2H(rxdesc) \
  23. le32_get_bits(*((__le32 *)(rxdesc) + 0x02), BIT(28))
  24. #define GET_RX_DESC_PKT_LEN(rxdesc) \
  25. le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(13, 0))
  26. #define GET_RX_DESC_DRV_INFO_SIZE(rxdesc) \
  27. le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(19, 16))
  28. #define GET_RX_DESC_SHIFT(rxdesc) \
  29. le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(25, 24))
  30. #define GET_RX_DESC_ENC_TYPE(rxdesc) \
  31. le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(22, 20))
  32. #define GET_RX_DESC_RX_RATE(rxdesc) \
  33. le32_get_bits(*((__le32 *)(rxdesc) + 0x03), GENMASK(6, 0))
  34. #define GET_RX_DESC_MACID(rxdesc) \
  35. le32_get_bits(*((__le32 *)(rxdesc) + 0x01), GENMASK(6, 0))
  36. #define GET_RX_DESC_PPDU_CNT(rxdesc) \
  37. le32_get_bits(*((__le32 *)(rxdesc) + 0x02), GENMASK(30, 29))
  38. #define GET_RX_DESC_TSFL(rxdesc) \
  39. le32_get_bits(*((__le32 *)(rxdesc) + 0x05), GENMASK(31, 0))
  40. void rtw_rx_stats(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,
  41. struct sk_buff *skb);
  42. void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
  43. struct rtw_rx_pkt_stat *pkt_stat,
  44. struct ieee80211_hdr *hdr,
  45. struct ieee80211_rx_status *rx_status,
  46. u8 *phy_status);
  47. #endif