]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/misc/iwmc3200top/fw-msg.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[karo-tx-linux.git] / drivers / misc / iwmc3200top / fw-msg.h
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
27 #ifndef __FWMSG_H__
28 #define __FWMSG_H__
29
30 #define COMM_TYPE_D2H                   0xFF
31 #define COMM_TYPE_H2D                   0xEE
32
33 #define COMM_CATEGORY_OPERATIONAL       0x00
34 #define COMM_CATEGORY_DEBUG             0x01
35 #define COMM_CATEGORY_TESTABILITY       0x02
36 #define COMM_CATEGORY_DIAGNOSTICS       0x03
37
38 #define OP_DBG_ZSTR_MSG                 cpu_to_le16(0x1A)
39
40 #define FW_LOG_SRC_MAX                  32
41 #define FW_LOG_SRC_ALL                  255
42
43 #define FW_STRING_TABLE_ADDR            cpu_to_le32(0x0C000000)
44
45 #define CMD_DBG_LOG_LEVEL               cpu_to_le16(0x0001)
46 #define CMD_TST_DEV_RESET               cpu_to_le16(0x0060)
47 #define CMD_TST_FUNC_RESET              cpu_to_le16(0x0062)
48 #define CMD_TST_IFACE_RESET             cpu_to_le16(0x0064)
49 #define CMD_TST_CPU_UTILIZATION         cpu_to_le16(0x0065)
50 #define CMD_TST_TOP_DEEP_SLEEP          cpu_to_le16(0x0080)
51 #define CMD_TST_WAKEUP                  cpu_to_le16(0x0081)
52 #define CMD_TST_FUNC_WAKEUP             cpu_to_le16(0x0082)
53 #define CMD_TST_FUNC_DEEP_SLEEP_REQUEST cpu_to_le16(0x0083)
54 #define CMD_TST_GET_MEM_DUMP            cpu_to_le16(0x0096)
55
56 #define OP_OPR_ALIVE                    cpu_to_le16(0x0010)
57 #define OP_OPR_CMD_ACK                  cpu_to_le16(0x001F)
58 #define OP_OPR_CMD_NACK                 cpu_to_le16(0x0020)
59 #define OP_TST_MEM_DUMP                 cpu_to_le16(0x0043)
60
61 #define CMD_FLAG_PADDING_256            0x80
62
63 #define FW_HCMD_BLOCK_SIZE              256
64
65 struct msg_hdr {
66         u8 type;
67         u8 category;
68         __le16 opcode;
69         u8 seqnum;
70         u8 flags;
71         __le16 length;
72 } __attribute__((__packed__));
73
74 struct log_hdr {
75         __le32 timestamp;
76         u8 severity;
77         u8 logsource;
78         __le16 reserved;
79 } __attribute__((__packed__));
80
81 struct mdump_hdr {
82         u8 dmpid;
83         u8 frag;
84         __le16 size;
85         __le32 addr;
86 } __attribute__((__packed__));
87
88 struct top_msg {
89         struct msg_hdr hdr;
90         union {
91                 /* D2H messages */
92                 struct {
93                         struct log_hdr log_hdr;
94                         u8 data[1];
95                 } __attribute__((__packed__)) log;
96
97                 struct {
98                         struct log_hdr log_hdr;
99                         struct mdump_hdr md_hdr;
100                         u8 data[1];
101                 } __attribute__((__packed__)) mdump;
102
103                 /* H2D messages */
104                 struct {
105                         u8 logsource;
106                         u8 sevmask;
107                 } __attribute__((__packed__)) logdefs[FW_LOG_SRC_MAX];
108                 struct mdump_hdr mdump_req;
109         } u;
110 } __attribute__((__packed__));
111
112
113 #endif /* __FWMSG_H__ */