rtw8852a.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
  2. /* Copyright(c) 2019-2020 Realtek Corporation
  3. */
  4. #ifndef __RTW89_8852A_H__
  5. #define __RTW89_8852A_H__
  6. #include "core.h"
  7. #define RF_PATH_NUM_8852A 2
  8. enum rtw8852a_pmac_mode {
  9. NONE_TEST,
  10. PKTS_TX,
  11. PKTS_RX,
  12. CONT_TX
  13. };
  14. struct rtw8852au_efuse {
  15. u8 rsvd[0x38];
  16. u8 mac_addr[ETH_ALEN];
  17. };
  18. struct rtw8852ae_efuse {
  19. u8 mac_addr[ETH_ALEN];
  20. };
  21. struct rtw8852a_tssi_offset {
  22. u8 cck_tssi[TSSI_CCK_CH_GROUP_NUM];
  23. u8 bw40_tssi[TSSI_MCS_2G_CH_GROUP_NUM];
  24. u8 rsvd[7];
  25. u8 bw40_1s_tssi_5g[TSSI_MCS_5G_CH_GROUP_NUM];
  26. } __packed;
  27. struct rtw8852a_efuse {
  28. u8 rsvd[0x210];
  29. struct rtw8852a_tssi_offset path_a_tssi;
  30. u8 rsvd1[10];
  31. struct rtw8852a_tssi_offset path_b_tssi;
  32. u8 rsvd2[94];
  33. u8 channel_plan;
  34. u8 xtal_k;
  35. u8 rsvd3;
  36. u8 iqk_lck;
  37. u8 rsvd4[5];
  38. u8 reg_setting:2;
  39. u8 tx_diversity:1;
  40. u8 rx_diversity:2;
  41. u8 ac_mode:1;
  42. u8 module_type:2;
  43. u8 rsvd5;
  44. u8 shared_ant:1;
  45. u8 coex_type:3;
  46. u8 ant_iso:1;
  47. u8 radio_on_off:1;
  48. u8 rsvd6:2;
  49. u8 eeprom_version;
  50. u8 customer_id;
  51. u8 tx_bb_swing_2g;
  52. u8 tx_bb_swing_5g;
  53. u8 tx_cali_pwr_trk_mode;
  54. u8 trx_path_selection;
  55. u8 rfe_type;
  56. u8 country_code[2];
  57. u8 rsvd7[3];
  58. u8 path_a_therm;
  59. u8 path_b_therm;
  60. u8 rsvd8[46];
  61. u8 path_a_cck_pwr_idx[6];
  62. u8 path_a_bw40_1tx_pwr_idx[5];
  63. u8 path_a_ofdm_1tx_pwr_idx_diff:4;
  64. u8 path_a_bw20_1tx_pwr_idx_diff:4;
  65. u8 path_a_bw20_2tx_pwr_idx_diff:4;
  66. u8 path_a_bw40_2tx_pwr_idx_diff:4;
  67. u8 path_a_cck_2tx_pwr_idx_diff:4;
  68. u8 path_a_ofdm_2tx_pwr_idx_diff:4;
  69. u8 rsvd9[0xf2];
  70. union {
  71. struct rtw8852au_efuse u;
  72. struct rtw8852ae_efuse e;
  73. };
  74. } __packed;
  75. struct rtw8852a_bb_pmac_info {
  76. u8 en_pmac_tx:1;
  77. u8 is_cck:1;
  78. u8 mode:3;
  79. u8 rsvd:3;
  80. u16 tx_cnt;
  81. u16 period;
  82. u16 tx_time;
  83. u8 duty_cycle;
  84. };
  85. extern const struct rtw89_chip_info rtw8852a_chip_info;
  86. void rtw8852a_bb_set_plcp_tx(struct rtw89_dev *rtwdev);
  87. void rtw8852a_bb_set_pmac_tx(struct rtw89_dev *rtwdev,
  88. struct rtw8852a_bb_pmac_info *tx_info,
  89. enum rtw89_phy_idx idx);
  90. void rtw8852a_bb_set_pmac_pkt_tx(struct rtw89_dev *rtwdev, u8 enable,
  91. u16 tx_cnt, u16 period, u16 tx_time,
  92. enum rtw89_phy_idx idx);
  93. void rtw8852a_bb_set_power(struct rtw89_dev *rtwdev, s16 pwr_dbm,
  94. enum rtw89_phy_idx idx);
  95. void rtw8852a_bb_cfg_tx_path(struct rtw89_dev *rtwdev, u8 tx_path);
  96. void rtw8852a_bb_tx_mode_switch(struct rtw89_dev *rtwdev,
  97. enum rtw89_phy_idx idx, u8 mode);
  98. #endif