tables_nphy.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. #ifndef B43_TABLES_NPHY_H_
  2. #define B43_TABLES_NPHY_H_
  3. #include <linux/types.h>
  4. struct b43_nphy_channeltab_entry {
  5. /* The channel number */
  6. u8 channel;
  7. /* Radio register values on channelswitch */
  8. u8 radio_pll_ref;
  9. u8 radio_rf_pllmod0;
  10. u8 radio_rf_pllmod1;
  11. u8 radio_vco_captail;
  12. u8 radio_vco_cal1;
  13. u8 radio_vco_cal2;
  14. u8 radio_pll_lfc1;
  15. u8 radio_pll_lfr1;
  16. u8 radio_pll_lfc2;
  17. u8 radio_lgbuf_cenbuf;
  18. u8 radio_lgen_tune1;
  19. u8 radio_lgen_tune2;
  20. u8 radio_c1_lgbuf_atune;
  21. u8 radio_c1_lgbuf_gtune;
  22. u8 radio_c1_rx_rfr1;
  23. u8 radio_c1_tx_pgapadtn;
  24. u8 radio_c1_tx_mxbgtrim;
  25. u8 radio_c2_lgbuf_atune;
  26. u8 radio_c2_lgbuf_gtune;
  27. u8 radio_c2_rx_rfr1;
  28. u8 radio_c2_tx_pgapadtn;
  29. u8 radio_c2_tx_mxbgtrim;
  30. /* PHY register values on channelswitch */
  31. u16 phy_bw1a;
  32. u16 phy_bw2;
  33. u16 phy_bw3;
  34. u16 phy_bw4;
  35. u16 phy_bw5;
  36. u16 phy_bw6;
  37. /* The channel frequency in MHz */
  38. u16 freq;
  39. /* An unknown value */
  40. u16 unk2;
  41. };
  42. struct b43_wldev;
  43. /* Upload the default register value table.
  44. * If "ghz5" is true, we upload the 5Ghz table. Otherwise the 2.4Ghz
  45. * table is uploaded. If "ignore_uploadflag" is true, we upload any value
  46. * and ignore the "UPLOAD" flag. */
  47. void b2055_upload_inittab(struct b43_wldev *dev,
  48. bool ghz5, bool ignore_uploadflag);
  49. /* Get the NPHY Channel Switch Table entry for a channel number.
  50. * Returns NULL on failure to find an entry. */
  51. const struct b43_nphy_channeltab_entry *
  52. b43_nphy_get_chantabent(struct b43_wldev *dev, u8 channel);
  53. /* The N-PHY tables. */
  54. #define B43_NTAB_TYPEMASK 0xF0000000
  55. #define B43_NTAB_8BIT 0x10000000
  56. #define B43_NTAB_16BIT 0x20000000
  57. #define B43_NTAB_32BIT 0x30000000
  58. #define B43_NTAB8(table, offset) (((table) << 10) | (offset) | B43_NTAB_8BIT)
  59. #define B43_NTAB16(table, offset) (((table) << 10) | (offset) | B43_NTAB_16BIT)
  60. #define B43_NTAB32(table, offset) (((table) << 10) | (offset) | B43_NTAB_32BIT)
  61. /* Static N-PHY tables */
  62. #define B43_NTAB_FRAMESTRUCT B43_NTAB32(0x0A, 0x000) /* Frame Struct Table */
  63. #define B43_NTAB_FRAMESTRUCT_SIZE 832
  64. #define B43_NTAB_FRAMELT B43_NTAB8 (0x18, 0x000) /* Frame Lookup Table */
  65. #define B43_NTAB_FRAMELT_SIZE 32
  66. #define B43_NTAB_TMAP B43_NTAB32(0x0C, 0x000) /* T Map Table */
  67. #define B43_NTAB_TMAP_SIZE 448
  68. #define B43_NTAB_TDTRN B43_NTAB32(0x0E, 0x000) /* TDTRN Table */
  69. #define B43_NTAB_TDTRN_SIZE 704
  70. #define B43_NTAB_INTLEVEL B43_NTAB32(0x0D, 0x000) /* Int Level Table */
  71. #define B43_NTAB_INTLEVEL_SIZE 7
  72. #define B43_NTAB_PILOT B43_NTAB16(0x0B, 0x000) /* Pilot Table */
  73. #define B43_NTAB_PILOT_SIZE 88
  74. #define B43_NTAB_PILOTLT B43_NTAB32(0x14, 0x000) /* Pilot Lookup Table */
  75. #define B43_NTAB_PILOTLT_SIZE 6
  76. #define B43_NTAB_TDI20A0 B43_NTAB32(0x13, 0x080) /* TDI Table 20 Antenna 0 */
  77. #define B43_NTAB_TDI20A0_SIZE 55
  78. #define B43_NTAB_TDI20A1 B43_NTAB32(0x13, 0x100) /* TDI Table 20 Antenna 1 */
  79. #define B43_NTAB_TDI20A1_SIZE 55
  80. #define B43_NTAB_TDI40A0 B43_NTAB32(0x13, 0x280) /* TDI Table 40 Antenna 0 */
  81. #define B43_NTAB_TDI40A0_SIZE 110
  82. #define B43_NTAB_TDI40A1 B43_NTAB32(0x13, 0x300) /* TDI Table 40 Antenna 1 */
  83. #define B43_NTAB_TDI40A1_SIZE 110
  84. #define B43_NTAB_BDI B43_NTAB16(0x15, 0x000) /* BDI Table */
  85. #define B43_NTAB_BDI_SIZE 6
  86. #define B43_NTAB_CHANEST B43_NTAB32(0x16, 0x000) /* Channel Estimate Table */
  87. #define B43_NTAB_CHANEST_SIZE 96
  88. #define B43_NTAB_MCS B43_NTAB8 (0x12, 0x000) /* MCS Table */
  89. #define B43_NTAB_MCS_SIZE 128
  90. /* Volatile N-PHY tables */
  91. #define B43_NTAB_NOISEVAR10 B43_NTAB32(0x10, 0x000) /* Noise Var Table 10 */
  92. #define B43_NTAB_NOISEVAR10_SIZE 256
  93. #define B43_NTAB_NOISEVAR11 B43_NTAB32(0x10, 0x080) /* Noise Var Table 11 */
  94. #define B43_NTAB_NOISEVAR11_SIZE 256
  95. #define B43_NTAB_C0_ESTPLT B43_NTAB8 (0x1A, 0x000) /* Estimate Power Lookup Table Core 0 */
  96. #define B43_NTAB_C0_ESTPLT_SIZE 64
  97. #define B43_NTAB_C1_ESTPLT B43_NTAB8 (0x1B, 0x000) /* Estimate Power Lookup Table Core 1 */
  98. #define B43_NTAB_C1_ESTPLT_SIZE 64
  99. #define B43_NTAB_C0_ADJPLT B43_NTAB8 (0x1A, 0x040) /* Adjust Power Lookup Table Core 0 */
  100. #define B43_NTAB_C0_ADJPLT_SIZE 128
  101. #define B43_NTAB_C1_ADJPLT B43_NTAB8 (0x1B, 0x040) /* Adjust Power Lookup Table Core 1 */
  102. #define B43_NTAB_C1_ADJPLT_SIZE 128
  103. #define B43_NTAB_C0_GAINCTL B43_NTAB32(0x1A, 0x0C0) /* Gain Control Lookup Table Core 0 */
  104. #define B43_NTAB_C0_GAINCTL_SIZE 128
  105. #define B43_NTAB_C1_GAINCTL B43_NTAB32(0x1B, 0x0C0) /* Gain Control Lookup Table Core 1 */
  106. #define B43_NTAB_C1_GAINCTL_SIZE 128
  107. #define B43_NTAB_C0_IQLT B43_NTAB32(0x1A, 0x140) /* IQ Lookup Table Core 0 */
  108. #define B43_NTAB_C0_IQLT_SIZE 128
  109. #define B43_NTAB_C1_IQLT B43_NTAB32(0x1B, 0x140) /* IQ Lookup Table Core 1 */
  110. #define B43_NTAB_C1_IQLT_SIZE 128
  111. #define B43_NTAB_C0_LOFEEDTH B43_NTAB16(0x1A, 0x1C0) /* Local Oscillator Feed Through Lookup Table Core 0 */
  112. #define B43_NTAB_C0_LOFEEDTH_SIZE 128
  113. #define B43_NTAB_C1_LOFEEDTH B43_NTAB16(0x1B, 0x1C0) /* Local Oscillator Feed Through Lookup Table Core 1 */
  114. #define B43_NTAB_C1_LOFEEDTH_SIZE 128
  115. void b43_ntab_write(struct b43_wldev *dev, u32 offset, u32 value);
  116. extern const u8 b43_ntab_adjustpower0[];
  117. extern const u8 b43_ntab_adjustpower1[];
  118. extern const u16 b43_ntab_bdi[];
  119. extern const u32 b43_ntab_channelest[];
  120. extern const u8 b43_ntab_estimatepowerlt0[];
  121. extern const u8 b43_ntab_estimatepowerlt1[];
  122. extern const u8 b43_ntab_framelookup[];
  123. extern const u32 b43_ntab_framestruct[];
  124. extern const u32 b43_ntab_gainctl0[];
  125. extern const u32 b43_ntab_gainctl1[];
  126. extern const u32 b43_ntab_intlevel[];
  127. extern const u32 b43_ntab_iqlt0[];
  128. extern const u32 b43_ntab_iqlt1[];
  129. extern const u16 b43_ntab_loftlt0[];
  130. extern const u16 b43_ntab_loftlt1[];
  131. extern const u8 b43_ntab_mcs[];
  132. extern const u32 b43_ntab_noisevar10[];
  133. extern const u32 b43_ntab_noisevar11[];
  134. extern const u16 b43_ntab_pilot[];
  135. extern const u32 b43_ntab_pilotlt[];
  136. extern const u32 b43_ntab_tdi20a0[];
  137. extern const u32 b43_ntab_tdi20a1[];
  138. extern const u32 b43_ntab_tdi40a0[];
  139. extern const u32 b43_ntab_tdi40a1[];
  140. extern const u32 b43_ntab_tdtrn[];
  141. extern const u32 b43_ntab_tmap[];
  142. #endif /* B43_TABLES_NPHY_H_ */