wl18xx.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /*
  2. * This file is part of wl18xx
  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 __WL18XX_PRIV_H__
  22. #define __WL18XX_PRIV_H__
  23. #include "conf.h"
  24. /* minimum FW required for driver */
  25. #define WL18XX_CHIP_VER 8
  26. #define WL18XX_IFTYPE_VER 5
  27. #define WL18XX_MAJOR_VER WLCORE_FW_VER_IGNORE
  28. #define WL18XX_SUBTYPE_VER WLCORE_FW_VER_IGNORE
  29. #define WL18XX_MINOR_VER 39
  30. #define WL18XX_CMD_MAX_SIZE 740
  31. #define WL18XX_AGGR_BUFFER_SIZE (13 * PAGE_SIZE)
  32. #define WL18XX_NUM_TX_DESCRIPTORS 32
  33. #define WL18XX_NUM_RX_DESCRIPTORS 32
  34. #define WL18XX_NUM_MAC_ADDRESSES 3
  35. #define WL18XX_RX_BA_MAX_SESSIONS 5
  36. struct wl18xx_priv {
  37. /* buffer for sending commands to FW */
  38. u8 cmd_buf[WL18XX_CMD_MAX_SIZE];
  39. struct wl18xx_priv_conf conf;
  40. /* Index of last released Tx desc in FW */
  41. u8 last_fw_rls_idx;
  42. /* number of keys requiring extra spare mem-blocks */
  43. int extra_spare_key_count;
  44. };
  45. #define WL18XX_FW_MAX_TX_STATUS_DESC 33
  46. struct wl18xx_fw_status_priv {
  47. /*
  48. * Index in released_tx_desc for first byte that holds
  49. * released tx host desc
  50. */
  51. u8 fw_release_idx;
  52. /*
  53. * Array of host Tx descriptors, where fw_release_idx
  54. * indicated the first released idx.
  55. */
  56. u8 released_tx_desc[WL18XX_FW_MAX_TX_STATUS_DESC];
  57. /* A bitmap representing the currently suspended links. The suspend
  58. * is short lived, for multi-channel Tx requirements.
  59. */
  60. __le32 link_suspend_bitmap;
  61. /* packet threshold for an "almost empty" AC,
  62. * for Tx schedulng purposes
  63. */
  64. u8 tx_ac_threshold;
  65. /* number of packets to queue up for a link in PS */
  66. u8 tx_ps_threshold;
  67. /* number of packet to queue up for a suspended link */
  68. u8 tx_suspend_threshold;
  69. /* Should have less than this number of packets in queue of a slow
  70. * link to qualify as high priority link
  71. */
  72. u8 tx_slow_link_prio_threshold;
  73. /* Should have less than this number of packets in queue of a fast
  74. * link to qualify as high priority link
  75. */
  76. u8 tx_fast_link_prio_threshold;
  77. /* Should have less than this number of packets in queue of a slow
  78. * link before we stop queuing up packets for it.
  79. */
  80. u8 tx_slow_stop_threshold;
  81. /* Should have less than this number of packets in queue of a fast
  82. * link before we stop queuing up packets for it.
  83. */
  84. u8 tx_fast_stop_threshold;
  85. u8 padding[3];
  86. };
  87. #define WL18XX_PHY_VERSION_MAX_LEN 20
  88. struct wl18xx_static_data_priv {
  89. char phy_version[WL18XX_PHY_VERSION_MAX_LEN];
  90. };
  91. struct wl18xx_clk_cfg {
  92. u32 n;
  93. u32 m;
  94. u32 p;
  95. u32 q;
  96. bool swallow;
  97. };
  98. enum {
  99. CLOCK_CONFIG_16_2_M = 1,
  100. CLOCK_CONFIG_16_368_M,
  101. CLOCK_CONFIG_16_8_M,
  102. CLOCK_CONFIG_19_2_M,
  103. CLOCK_CONFIG_26_M,
  104. CLOCK_CONFIG_32_736_M,
  105. CLOCK_CONFIG_33_6_M,
  106. CLOCK_CONFIG_38_468_M,
  107. CLOCK_CONFIG_52_M,
  108. NUM_CLOCK_CONFIGS,
  109. };
  110. #endif /* __WL18XX_PRIV_H__ */