fw-msg.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * iwmc3200top - Intel Wireless MultiCom 3200 Top Driver
  3. * drivers/misc/iwmc3200top/fw-msg.h
  4. *
  5. * Copyright (C) 2009 Intel Corporation. All rights reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License version
  9. * 2 as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19. * 02110-1301, USA.
  20. *
  21. *
  22. * Author Name: Maxim Grabarnik <maxim.grabarnink@intel.com>
  23. * -
  24. *
  25. */
  26. #ifndef __FWMSG_H__
  27. #define __FWMSG_H__
  28. #define COMM_TYPE_D2H 0xFF
  29. #define COMM_TYPE_H2D 0xEE
  30. #define COMM_CATEGORY_OPERATIONAL 0x00
  31. #define COMM_CATEGORY_DEBUG 0x01
  32. #define COMM_CATEGORY_TESTABILITY 0x02
  33. #define COMM_CATEGORY_DIAGNOSTICS 0x03
  34. #define OP_DBG_ZSTR_MSG cpu_to_le16(0x1A)
  35. #define FW_LOG_SRC_MAX 32
  36. #define FW_LOG_SRC_ALL 255
  37. #define FW_STRING_TABLE_ADDR cpu_to_le32(0x0C000000)
  38. #define CMD_DBG_LOG_LEVEL cpu_to_le16(0x0001)
  39. #define CMD_TST_DEV_RESET cpu_to_le16(0x0060)
  40. #define CMD_TST_FUNC_RESET cpu_to_le16(0x0062)
  41. #define CMD_TST_IFACE_RESET cpu_to_le16(0x0064)
  42. #define CMD_TST_CPU_UTILIZATION cpu_to_le16(0x0065)
  43. #define CMD_TST_TOP_DEEP_SLEEP cpu_to_le16(0x0080)
  44. #define CMD_TST_WAKEUP cpu_to_le16(0x0081)
  45. #define CMD_TST_FUNC_WAKEUP cpu_to_le16(0x0082)
  46. #define CMD_TST_FUNC_DEEP_SLEEP_REQUEST cpu_to_le16(0x0083)
  47. #define CMD_TST_GET_MEM_DUMP cpu_to_le16(0x0096)
  48. #define OP_OPR_ALIVE cpu_to_le16(0x0010)
  49. #define OP_OPR_CMD_ACK cpu_to_le16(0x001F)
  50. #define OP_OPR_CMD_NACK cpu_to_le16(0x0020)
  51. #define OP_TST_MEM_DUMP cpu_to_le16(0x0043)
  52. #define CMD_FLAG_PADDING_256 0x80
  53. #define FW_HCMD_BLOCK_SIZE 256
  54. struct msg_hdr {
  55. u8 type;
  56. u8 category;
  57. __le16 opcode;
  58. u8 seqnum;
  59. u8 flags;
  60. __le16 length;
  61. } __attribute__((__packed__));
  62. struct log_hdr {
  63. __le32 timestamp;
  64. u8 severity;
  65. u8 logsource;
  66. __le16 reserved;
  67. } __attribute__((__packed__));
  68. struct mdump_hdr {
  69. u8 dmpid;
  70. u8 frag;
  71. __le16 size;
  72. __le32 addr;
  73. } __attribute__((__packed__));
  74. struct top_msg {
  75. struct msg_hdr hdr;
  76. union {
  77. /* D2H messages */
  78. struct {
  79. struct log_hdr log_hdr;
  80. u8 data[1];
  81. } __attribute__((__packed__)) log;
  82. struct {
  83. struct log_hdr log_hdr;
  84. struct mdump_hdr md_hdr;
  85. u8 data[1];
  86. } __attribute__((__packed__)) mdump;
  87. /* H2D messages */
  88. struct {
  89. u8 logsource;
  90. u8 sevmask;
  91. } __attribute__((__packed__)) logdefs[FW_LOG_SRC_MAX];
  92. struct mdump_hdr mdump_req;
  93. } u;
  94. } __attribute__((__packed__));
  95. #endif /* __FWMSG_H__ */