reg_wow.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. * Copyright (c) 2015 Qualcomm Atheros Inc.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef REG_WOW_H
  17. #define REG_WOW_H
  18. #define AR_WOW_PATTERN 0x825C
  19. #define AR_WOW_COUNT 0x8260
  20. #define AR_WOW_BCN_EN 0x8270
  21. #define AR_WOW_BCN_TIMO 0x8274
  22. #define AR_WOW_KEEP_ALIVE_TIMO 0x8278
  23. #define AR_WOW_KEEP_ALIVE 0x827c
  24. #define AR_WOW_KEEP_ALIVE_DELAY 0x8288
  25. #define AR_WOW_PATTERN_MATCH 0x828c
  26. /*
  27. * AR_WOW_LENGTH1
  28. * bit 31:24 pattern 0 length
  29. * bit 23:16 pattern 1 length
  30. * bit 15:8 pattern 2 length
  31. * bit 7:0 pattern 3 length
  32. *
  33. * AR_WOW_LENGTH2
  34. * bit 31:24 pattern 4 length
  35. * bit 23:16 pattern 5 length
  36. * bit 15:8 pattern 6 length
  37. * bit 7:0 pattern 7 length
  38. *
  39. * AR_WOW_LENGTH3
  40. * bit 31:24 pattern 8 length
  41. * bit 23:16 pattern 9 length
  42. * bit 15:8 pattern 10 length
  43. * bit 7:0 pattern 11 length
  44. *
  45. * AR_WOW_LENGTH4
  46. * bit 31:24 pattern 12 length
  47. * bit 23:16 pattern 13 length
  48. * bit 15:8 pattern 14 length
  49. * bit 7:0 pattern 15 length
  50. */
  51. #define AR_WOW_LENGTH1 0x8360
  52. #define AR_WOW_LENGTH2 0X8364
  53. #define AR_WOW_LENGTH3 0X8380
  54. #define AR_WOW_LENGTH4 0X8384
  55. #define AR_WOW_PATTERN_MATCH_LT_256B 0x8368
  56. #define AR_MAC_PCU_WOW4 0x8370
  57. #define AR_SW_WOW_CONTROL 0x20018
  58. #define AR_SW_WOW_ENABLE 0x1
  59. #define AR_SWITCH_TO_REFCLK 0x2
  60. #define AR_RESET_CONTROL 0x4
  61. #define AR_RESET_VALUE_MASK 0x8
  62. #define AR_HW_WOW_DISABLE 0x10
  63. #define AR_CLR_MAC_INTERRUPT 0x20
  64. #define AR_CLR_KA_INTERRUPT 0x40
  65. #define AR_WOW_BACK_OFF_SHIFT(x) ((x & 0xf) << 27) /* in usecs */
  66. #define AR_WOW_MAC_INTR_EN 0x00040000
  67. #define AR_WOW_MAGIC_EN 0x00010000
  68. #define AR_WOW_PATTERN_EN(x) (x & 0xff)
  69. #define AR_WOW_PAT_FOUND_SHIFT 8
  70. #define AR_WOW_PATTERN_FOUND(x) (x & (0xff << AR_WOW_PAT_FOUND_SHIFT))
  71. #define AR_WOW_PATTERN_FOUND_MASK ((0xff) << AR_WOW_PAT_FOUND_SHIFT)
  72. #define AR_WOW_MAGIC_PAT_FOUND 0x00020000
  73. #define AR_WOW_MAC_INTR 0x00080000
  74. #define AR_WOW_KEEP_ALIVE_FAIL 0x00100000
  75. #define AR_WOW_BEACON_FAIL 0x00200000
  76. #define AR_WOW_STATUS(x) (x & (AR_WOW_PATTERN_FOUND_MASK | \
  77. AR_WOW_MAGIC_PAT_FOUND | \
  78. AR_WOW_KEEP_ALIVE_FAIL | \
  79. AR_WOW_BEACON_FAIL))
  80. #define AR_WOW_CLEAR_EVENTS(x) (x & ~(AR_WOW_PATTERN_EN(0xff) | \
  81. AR_WOW_MAGIC_EN | \
  82. AR_WOW_MAC_INTR_EN | \
  83. AR_WOW_BEACON_FAIL | \
  84. AR_WOW_KEEP_ALIVE_FAIL))
  85. #define AR_WOW2_PATTERN_EN(x) ((x & 0xff) << 0)
  86. #define AR_WOW2_PATTERN_FOUND_SHIFT 8
  87. #define AR_WOW2_PATTERN_FOUND(x) (x & (0xff << AR_WOW2_PATTERN_FOUND_SHIFT))
  88. #define AR_WOW2_PATTERN_FOUND_MASK ((0xff) << AR_WOW2_PATTERN_FOUND_SHIFT)
  89. #define AR_WOW_STATUS2(x) (x & AR_WOW2_PATTERN_FOUND_MASK)
  90. #define AR_WOW_CLEAR_EVENTS2(x) (x & ~(AR_WOW2_PATTERN_EN(0xff)))
  91. #define AR_WOW_AIFS_CNT(x) (x & 0xff)
  92. #define AR_WOW_SLOT_CNT(x) ((x & 0xff) << 8)
  93. #define AR_WOW_KEEP_ALIVE_CNT(x) ((x & 0xff) << 16)
  94. #define AR_WOW_BEACON_FAIL_EN 0x00000001
  95. #define AR_WOW_BEACON_TIMO 0x40000000
  96. #define AR_WOW_KEEP_ALIVE_NEVER 0xffffffff
  97. #define AR_WOW_KEEP_ALIVE_AUTO_DIS 0x00000001
  98. #define AR_WOW_KEEP_ALIVE_FAIL_DIS 0x00000002
  99. #define AR_WOW_KEEP_ALIVE_DELAY_VALUE 0x000003e8 /* 1 msec */
  100. #define AR_WOW_BMISSTHRESHOLD 0x20
  101. #define AR_WOW_PAT_END_OF_PKT(x) (x & 0xf)
  102. #define AR_WOW_PAT_OFF_MATCH(x) ((x & 0xf) << 8)
  103. #define AR_WOW_PAT_BACKOFF 0x00000004
  104. #define AR_WOW_CNT_AIFS_CNT 0x00000022
  105. #define AR_WOW_CNT_SLOT_CNT 0x00000009
  106. #define AR_WOW_CNT_KA_CNT 0x00000008
  107. #define AR_WOW_TRANSMIT_BUFFER 0xe000
  108. #define AR_WOW_TXBUF(i) (AR_WOW_TRANSMIT_BUFFER + ((i) << 2))
  109. #define AR_WOW_KA_DESC_WORD2 0xe000
  110. #define AR_WOW_TB_PATTERN(i) (0xe100 + (i << 8))
  111. #define AR_WOW_TB_MASK(i) (0xec00 + (i << 5))
  112. #define AR_WOW_PATTERN_SUPPORTED_LEGACY 0xff
  113. #define AR_WOW_PATTERN_SUPPORTED 0xffff
  114. #define AR_WOW_LENGTH_MAX 0xff
  115. #define AR_WOW_LEN1_SHIFT(_i) ((0x3 - ((_i) & 0x3)) << 0x3)
  116. #define AR_WOW_LENGTH1_MASK(_i) (AR_WOW_LENGTH_MAX << AR_WOW_LEN1_SHIFT(_i))
  117. #define AR_WOW_LEN2_SHIFT(_i) ((0x7 - ((_i) & 0x7)) << 0x3)
  118. #define AR_WOW_LENGTH2_MASK(_i) (AR_WOW_LENGTH_MAX << AR_WOW_LEN2_SHIFT(_i))
  119. #define AR_WOW_LEN3_SHIFT(_i) ((0xb - ((_i) & 0xb)) << 0x3)
  120. #define AR_WOW_LENGTH3_MASK(_i) (AR_WOW_LENGTH_MAX << AR_WOW_LEN3_SHIFT(_i))
  121. #define AR_WOW_LEN4_SHIFT(_i) ((0xf - ((_i) & 0xf)) << 0x3)
  122. #define AR_WOW_LENGTH4_MASK(_i) (AR_WOW_LENGTH_MAX << AR_WOW_LEN4_SHIFT(_i))
  123. #endif /* REG_WOW_H */