wl12xx.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /*
  2. * This file is part of wl12xx
  3. *
  4. * Copyright (C) 2011 Texas Instruments Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * version 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  18. * 02110-1301 USA
  19. *
  20. */
  21. #ifndef __WL12XX_PRIV_H__
  22. #define __WL12XX_PRIV_H__
  23. #include "conf.h"
  24. /* WiLink 6/7 chip IDs */
  25. #define CHIP_ID_127X_PG10 (0x04030101)
  26. #define CHIP_ID_127X_PG20 (0x04030111)
  27. #define CHIP_ID_128X_PG10 (0x05030101)
  28. #define CHIP_ID_128X_PG20 (0x05030111)
  29. /* FW chip version for wl127x */
  30. #define WL127X_CHIP_VER 6
  31. /* minimum single-role FW version for wl127x */
  32. #define WL127X_IFTYPE_SR_VER 3
  33. #define WL127X_MAJOR_SR_VER 10
  34. #define WL127X_SUBTYPE_SR_VER WLCORE_FW_VER_IGNORE
  35. #define WL127X_MINOR_SR_VER 133
  36. /* minimum multi-role FW version for wl127x */
  37. #define WL127X_IFTYPE_MR_VER 5
  38. #define WL127X_MAJOR_MR_VER 7
  39. #define WL127X_SUBTYPE_MR_VER WLCORE_FW_VER_IGNORE
  40. #define WL127X_MINOR_MR_VER 42
  41. /* FW chip version for wl128x */
  42. #define WL128X_CHIP_VER 7
  43. /* minimum single-role FW version for wl128x */
  44. #define WL128X_IFTYPE_SR_VER 3
  45. #define WL128X_MAJOR_SR_VER 10
  46. #define WL128X_SUBTYPE_SR_VER WLCORE_FW_VER_IGNORE
  47. #define WL128X_MINOR_SR_VER 133
  48. /* minimum multi-role FW version for wl128x */
  49. #define WL128X_IFTYPE_MR_VER 5
  50. #define WL128X_MAJOR_MR_VER 7
  51. #define WL128X_SUBTYPE_MR_VER WLCORE_FW_VER_IGNORE
  52. #define WL128X_MINOR_MR_VER 42
  53. #define WL12XX_AGGR_BUFFER_SIZE (4 * PAGE_SIZE)
  54. #define WL12XX_NUM_TX_DESCRIPTORS 16
  55. #define WL12XX_NUM_RX_DESCRIPTORS 8
  56. #define WL12XX_NUM_MAC_ADDRESSES 2
  57. #define WL12XX_RX_BA_MAX_SESSIONS 3
  58. #define WL12XX_MAX_AP_STATIONS 8
  59. #define WL12XX_MAX_LINKS 12
  60. struct wl127x_rx_mem_pool_addr {
  61. u32 addr;
  62. u32 addr_extra;
  63. };
  64. struct wl12xx_priv {
  65. struct wl12xx_priv_conf conf;
  66. int ref_clock;
  67. int tcxo_clock;
  68. struct wl127x_rx_mem_pool_addr *rx_mem_addr;
  69. };
  70. /* Reference clock values */
  71. enum {
  72. WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */
  73. WL12XX_REFCLOCK_26 = 1, /* 26 MHz */
  74. WL12XX_REFCLOCK_38 = 2, /* 38.4 MHz */
  75. WL12XX_REFCLOCK_52 = 3, /* 52 MHz */
  76. WL12XX_REFCLOCK_38_XTAL = 4, /* 38.4 MHz, XTAL */
  77. WL12XX_REFCLOCK_26_XTAL = 5, /* 26 MHz, XTAL */
  78. };
  79. /* TCXO clock values */
  80. enum {
  81. WL12XX_TCXOCLOCK_19_2 = 0, /* 19.2MHz */
  82. WL12XX_TCXOCLOCK_26 = 1, /* 26 MHz */
  83. WL12XX_TCXOCLOCK_38_4 = 2, /* 38.4MHz */
  84. WL12XX_TCXOCLOCK_52 = 3, /* 52 MHz */
  85. WL12XX_TCXOCLOCK_16_368 = 4, /* 16.368 MHz */
  86. WL12XX_TCXOCLOCK_32_736 = 5, /* 32.736 MHz */
  87. WL12XX_TCXOCLOCK_16_8 = 6, /* 16.8 MHz */
  88. WL12XX_TCXOCLOCK_33_6 = 7, /* 33.6 MHz */
  89. };
  90. struct wl12xx_clock {
  91. u32 freq;
  92. bool xtal;
  93. u8 hw_idx;
  94. };
  95. struct wl12xx_fw_packet_counters {
  96. /* Cumulative counter of released packets per AC */
  97. u8 tx_released_pkts[NUM_TX_QUEUES];
  98. /* Cumulative counter of freed packets per HLID */
  99. u8 tx_lnk_free_pkts[WL12XX_MAX_LINKS];
  100. /* Cumulative counter of released Voice memory blocks */
  101. u8 tx_voice_released_blks;
  102. /* Tx rate of the last transmitted packet */
  103. u8 tx_last_rate;
  104. u8 padding[2];
  105. } __packed;
  106. /* FW status registers */
  107. struct wl12xx_fw_status {
  108. __le32 intr;
  109. u8 fw_rx_counter;
  110. u8 drv_rx_counter;
  111. u8 reserved;
  112. u8 tx_results_counter;
  113. __le32 rx_pkt_descs[WL12XX_NUM_RX_DESCRIPTORS];
  114. __le32 fw_localtime;
  115. /*
  116. * A bitmap (where each bit represents a single HLID)
  117. * to indicate if the station is in PS mode.
  118. */
  119. __le32 link_ps_bitmap;
  120. /*
  121. * A bitmap (where each bit represents a single HLID) to indicate
  122. * if the station is in Fast mode
  123. */
  124. __le32 link_fast_bitmap;
  125. /* Cumulative counter of total released mem blocks since FW-reset */
  126. __le32 total_released_blks;
  127. /* Size (in Memory Blocks) of TX pool */
  128. __le32 tx_total;
  129. struct wl12xx_fw_packet_counters counters;
  130. __le32 log_start_addr;
  131. } __packed;
  132. #endif /* __WL12XX_PRIV_H__ */