wl12xx.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * This file is part of wl12xx
  4. *
  5. * Copyright (C) 2011 Texas Instruments Inc.
  6. */
  7. #ifndef __WL12XX_PRIV_H__
  8. #define __WL12XX_PRIV_H__
  9. #include "conf.h"
  10. /* WiLink 6/7 chip IDs */
  11. #define CHIP_ID_127X_PG10 (0x04030101)
  12. #define CHIP_ID_127X_PG20 (0x04030111)
  13. #define CHIP_ID_128X_PG10 (0x05030101)
  14. #define CHIP_ID_128X_PG20 (0x05030111)
  15. /* FW chip version for wl127x */
  16. #define WL127X_CHIP_VER 6
  17. /* minimum single-role FW version for wl127x */
  18. #define WL127X_IFTYPE_SR_VER 3
  19. #define WL127X_MAJOR_SR_VER 10
  20. #define WL127X_SUBTYPE_SR_VER WLCORE_FW_VER_IGNORE
  21. #define WL127X_MINOR_SR_VER 133
  22. /* minimum multi-role FW version for wl127x */
  23. #define WL127X_IFTYPE_MR_VER 5
  24. #define WL127X_MAJOR_MR_VER 7
  25. #define WL127X_SUBTYPE_MR_VER WLCORE_FW_VER_IGNORE
  26. #define WL127X_MINOR_MR_VER 42
  27. /* FW chip version for wl128x */
  28. #define WL128X_CHIP_VER 7
  29. /* minimum single-role FW version for wl128x */
  30. #define WL128X_IFTYPE_SR_VER 3
  31. #define WL128X_MAJOR_SR_VER 10
  32. #define WL128X_SUBTYPE_SR_VER WLCORE_FW_VER_IGNORE
  33. #define WL128X_MINOR_SR_VER 133
  34. /* minimum multi-role FW version for wl128x */
  35. #define WL128X_IFTYPE_MR_VER 5
  36. #define WL128X_MAJOR_MR_VER 7
  37. #define WL128X_SUBTYPE_MR_VER WLCORE_FW_VER_IGNORE
  38. #define WL128X_MINOR_MR_VER 42
  39. #define WL12XX_AGGR_BUFFER_SIZE (4 * PAGE_SIZE)
  40. #define WL12XX_NUM_TX_DESCRIPTORS 16
  41. #define WL12XX_NUM_RX_DESCRIPTORS 8
  42. #define WL12XX_NUM_MAC_ADDRESSES 2
  43. #define WL12XX_RX_BA_MAX_SESSIONS 3
  44. #define WL12XX_MAX_AP_STATIONS 8
  45. #define WL12XX_MAX_LINKS 12
  46. struct wl127x_rx_mem_pool_addr {
  47. u32 addr;
  48. u32 addr_extra;
  49. };
  50. struct wl12xx_priv {
  51. struct wl12xx_priv_conf conf;
  52. int ref_clock;
  53. int tcxo_clock;
  54. struct wl127x_rx_mem_pool_addr *rx_mem_addr;
  55. };
  56. /* Reference clock values */
  57. enum {
  58. WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */
  59. WL12XX_REFCLOCK_26 = 1, /* 26 MHz */
  60. WL12XX_REFCLOCK_38 = 2, /* 38.4 MHz */
  61. WL12XX_REFCLOCK_52 = 3, /* 52 MHz */
  62. WL12XX_REFCLOCK_38_XTAL = 4, /* 38.4 MHz, XTAL */
  63. WL12XX_REFCLOCK_26_XTAL = 5, /* 26 MHz, XTAL */
  64. };
  65. /* TCXO clock values */
  66. enum {
  67. WL12XX_TCXOCLOCK_19_2 = 0, /* 19.2MHz */
  68. WL12XX_TCXOCLOCK_26 = 1, /* 26 MHz */
  69. WL12XX_TCXOCLOCK_38_4 = 2, /* 38.4MHz */
  70. WL12XX_TCXOCLOCK_52 = 3, /* 52 MHz */
  71. WL12XX_TCXOCLOCK_16_368 = 4, /* 16.368 MHz */
  72. WL12XX_TCXOCLOCK_32_736 = 5, /* 32.736 MHz */
  73. WL12XX_TCXOCLOCK_16_8 = 6, /* 16.8 MHz */
  74. WL12XX_TCXOCLOCK_33_6 = 7, /* 33.6 MHz */
  75. };
  76. struct wl12xx_clock {
  77. u32 freq;
  78. bool xtal;
  79. u8 hw_idx;
  80. };
  81. struct wl12xx_fw_packet_counters {
  82. /* Cumulative counter of released packets per AC */
  83. u8 tx_released_pkts[NUM_TX_QUEUES];
  84. /* Cumulative counter of freed packets per HLID */
  85. u8 tx_lnk_free_pkts[WL12XX_MAX_LINKS];
  86. /* Cumulative counter of released Voice memory blocks */
  87. u8 tx_voice_released_blks;
  88. /* Tx rate of the last transmitted packet */
  89. u8 tx_last_rate;
  90. u8 padding[2];
  91. } __packed;
  92. /* FW status registers */
  93. struct wl12xx_fw_status {
  94. __le32 intr;
  95. u8 fw_rx_counter;
  96. u8 drv_rx_counter;
  97. u8 reserved;
  98. u8 tx_results_counter;
  99. __le32 rx_pkt_descs[WL12XX_NUM_RX_DESCRIPTORS];
  100. __le32 fw_localtime;
  101. /*
  102. * A bitmap (where each bit represents a single HLID)
  103. * to indicate if the station is in PS mode.
  104. */
  105. __le32 link_ps_bitmap;
  106. /*
  107. * A bitmap (where each bit represents a single HLID) to indicate
  108. * if the station is in Fast mode
  109. */
  110. __le32 link_fast_bitmap;
  111. /* Cumulative counter of total released mem blocks since FW-reset */
  112. __le32 total_released_blks;
  113. /* Size (in Memory Blocks) of TX pool */
  114. __le32 tx_total;
  115. struct wl12xx_fw_packet_counters counters;
  116. __le32 log_start_addr;
  117. } __packed;
  118. #endif /* __WL12XX_PRIV_H__ */