wl1251.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /*
  2. * This file is part of wl12xx
  3. *
  4. * Copyright (C) 2008 Nokia Corporation
  5. *
  6. * Contact: Kalle Valo <kalle.valo@nokia.com>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * version 2 as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA
  21. *
  22. */
  23. #ifndef __WL1251_H__
  24. #define __WL1251_H__
  25. #include <linux/bitops.h>
  26. #include "wl12xx.h"
  27. #include "acx.h"
  28. #define WL1251_FW_NAME "wl1251-fw.bin"
  29. #define WL1251_NVS_NAME "wl1251-nvs.bin"
  30. #define WL1251_POWER_ON_SLEEP 10 /* in miliseconds */
  31. void wl1251_setup(struct wl12xx *wl);
  32. struct wl1251_acx_memory {
  33. __le16 num_stations; /* number of STAs to be supported. */
  34. u16 reserved_1;
  35. /*
  36. * Nmber of memory buffers for the RX mem pool.
  37. * The actual number may be less if there are
  38. * not enough blocks left for the minimum num
  39. * of TX ones.
  40. */
  41. u8 rx_mem_block_num;
  42. u8 reserved_2;
  43. u8 num_tx_queues; /* From 1 to 16 */
  44. u8 host_if_options; /* HOST_IF* */
  45. u8 tx_min_mem_block_num;
  46. u8 num_ssid_profiles;
  47. __le16 debug_buffer_size;
  48. } __attribute__ ((packed));
  49. #define ACX_RX_DESC_MIN 1
  50. #define ACX_RX_DESC_MAX 127
  51. #define ACX_RX_DESC_DEF 32
  52. struct wl1251_acx_rx_queue_config {
  53. u8 num_descs;
  54. u8 pad;
  55. u8 type;
  56. u8 priority;
  57. __le32 dma_address;
  58. } __attribute__ ((packed));
  59. #define ACX_TX_DESC_MIN 1
  60. #define ACX_TX_DESC_MAX 127
  61. #define ACX_TX_DESC_DEF 16
  62. struct wl1251_acx_tx_queue_config {
  63. u8 num_descs;
  64. u8 pad[2];
  65. u8 attributes;
  66. } __attribute__ ((packed));
  67. #define MAX_TX_QUEUE_CONFIGS 5
  68. #define MAX_TX_QUEUES 4
  69. struct wl1251_acx_config_memory {
  70. struct acx_header header;
  71. struct wl1251_acx_memory mem_config;
  72. struct wl1251_acx_rx_queue_config rx_queue_config;
  73. struct wl1251_acx_tx_queue_config tx_queue_config[MAX_TX_QUEUE_CONFIGS];
  74. } __attribute__ ((packed));
  75. struct wl1251_acx_mem_map {
  76. struct acx_header header;
  77. void *code_start;
  78. void *code_end;
  79. void *wep_defkey_start;
  80. void *wep_defkey_end;
  81. void *sta_table_start;
  82. void *sta_table_end;
  83. void *packet_template_start;
  84. void *packet_template_end;
  85. void *queue_memory_start;
  86. void *queue_memory_end;
  87. void *packet_memory_pool_start;
  88. void *packet_memory_pool_end;
  89. void *debug_buffer1_start;
  90. void *debug_buffer1_end;
  91. void *debug_buffer2_start;
  92. void *debug_buffer2_end;
  93. /* Number of blocks FW allocated for TX packets */
  94. u32 num_tx_mem_blocks;
  95. /* Number of blocks FW allocated for RX packets */
  96. u32 num_rx_mem_blocks;
  97. } __attribute__ ((packed));
  98. /*************************************************************************
  99. Host Interrupt Register (WiLink -> Host)
  100. **************************************************************************/
  101. /* RX packet is ready in Xfer buffer #0 */
  102. #define WL1251_ACX_INTR_RX0_DATA BIT(0)
  103. /* TX result(s) are in the TX complete buffer */
  104. #define WL1251_ACX_INTR_TX_RESULT BIT(1)
  105. /* OBSOLETE */
  106. #define WL1251_ACX_INTR_TX_XFR BIT(2)
  107. /* RX packet is ready in Xfer buffer #1 */
  108. #define WL1251_ACX_INTR_RX1_DATA BIT(3)
  109. /* Event was entered to Event MBOX #A */
  110. #define WL1251_ACX_INTR_EVENT_A BIT(4)
  111. /* Event was entered to Event MBOX #B */
  112. #define WL1251_ACX_INTR_EVENT_B BIT(5)
  113. /* OBSOLETE */
  114. #define WL1251_ACX_INTR_WAKE_ON_HOST BIT(6)
  115. /* Trace meassge on MBOX #A */
  116. #define WL1251_ACX_INTR_TRACE_A BIT(7)
  117. /* Trace meassge on MBOX #B */
  118. #define WL1251_ACX_INTR_TRACE_B BIT(8)
  119. /* Command processing completion */
  120. #define WL1251_ACX_INTR_CMD_COMPLETE BIT(9)
  121. /* Init sequence is done */
  122. #define WL1251_ACX_INTR_INIT_COMPLETE BIT(14)
  123. #define WL1251_ACX_INTR_ALL 0xFFFFFFFF
  124. #endif