wl18xx.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 2
  27. #define WL18XX_MAJOR_VER 0
  28. #define WL18XX_SUBTYPE_VER 0
  29. #define WL18XX_MINOR_VER 100
  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. struct wl18xx_priv {
  36. /* buffer for sending commands to FW */
  37. u8 cmd_buf[WL18XX_CMD_MAX_SIZE];
  38. struct wl18xx_priv_conf conf;
  39. /* Index of last released Tx desc in FW */
  40. u8 last_fw_rls_idx;
  41. /* number of VIFs requiring extra spare mem-blocks */
  42. int extra_spare_vif_count;
  43. };
  44. #define WL18XX_FW_MAX_TX_STATUS_DESC 33
  45. struct wl18xx_fw_status_priv {
  46. /*
  47. * Index in released_tx_desc for first byte that holds
  48. * released tx host desc
  49. */
  50. u8 fw_release_idx;
  51. /*
  52. * Array of host Tx descriptors, where fw_release_idx
  53. * indicated the first released idx.
  54. */
  55. u8 released_tx_desc[WL18XX_FW_MAX_TX_STATUS_DESC];
  56. u8 padding[2];
  57. };
  58. #define WL18XX_PHY_VERSION_MAX_LEN 20
  59. struct wl18xx_static_data_priv {
  60. char phy_version[WL18XX_PHY_VERSION_MAX_LEN];
  61. };
  62. struct wl18xx_clk_cfg {
  63. u32 n;
  64. u32 m;
  65. u32 p;
  66. u32 q;
  67. bool swallow;
  68. };
  69. enum {
  70. CLOCK_CONFIG_16_2_M = 1,
  71. CLOCK_CONFIG_16_368_M,
  72. CLOCK_CONFIG_16_8_M,
  73. CLOCK_CONFIG_19_2_M,
  74. CLOCK_CONFIG_26_M,
  75. CLOCK_CONFIG_32_736_M,
  76. CLOCK_CONFIG_33_6_M,
  77. CLOCK_CONFIG_38_468_M,
  78. CLOCK_CONFIG_52_M,
  79. NUM_CLOCK_CONFIGS,
  80. };
  81. #endif /* __WL18XX_PRIV_H__ */