2 * Copyright (C) 2006-2017 Oracle Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
23 #ifndef __HGSMI_DEFS_H__
24 #define __HGSMI_DEFS_H__
26 /* Buffer sequence type mask. */
27 #define HGSMI_BUFFER_HEADER_F_SEQ_MASK 0x03
28 /* Single buffer, not a part of a sequence. */
29 #define HGSMI_BUFFER_HEADER_F_SEQ_SINGLE 0x00
30 /* The first buffer in a sequence. */
31 #define HGSMI_BUFFER_HEADER_F_SEQ_START 0x01
32 /* A middle buffer in a sequence. */
33 #define HGSMI_BUFFER_HEADER_F_SEQ_CONTINUE 0x02
34 /* The last buffer in a sequence. */
35 #define HGSMI_BUFFER_HEADER_F_SEQ_END 0x03
37 /* 16 bytes buffer header. */
38 struct hgsmi_buffer_header {
39 u32 data_size; /* Size of data that follows the header. */
40 u8 flags; /* HGSMI_BUFFER_HEADER_F_* */
41 u8 channel; /* The channel the data must be routed to. */
42 u16 channel_info; /* Opaque to the HGSMI, used by the channel. */
45 /* Opaque placeholder to make the union 8 bytes. */
48 /* HGSMI_BUFFER_HEADER_F_SEQ_SINGLE */
50 u32 reserved1; /* A reserved field, initialize to 0. */
51 u32 reserved2; /* A reserved field, initialize to 0. */
54 /* HGSMI_BUFFER_HEADER_F_SEQ_START */
56 /* Must be the same for all buffers in the sequence. */
58 /* The total size of the sequence. */
63 * HGSMI_BUFFER_HEADER_F_SEQ_CONTINUE and
64 * HGSMI_BUFFER_HEADER_F_SEQ_END
67 /* Must be the same for all buffers in the sequence. */
69 /* Data offset in the entire sequence. */
75 /* 8 bytes buffer tail. */
76 struct hgsmi_buffer_tail {
77 /* Reserved, must be initialized to 0. */
80 * One-at-a-Time Hash: http://www.burtleburtle.net/bob/hash/doobs.html
81 * Over the header, offset and for first 4 bytes of the tail.
87 * The size of the array of channels. Array indexes are u8.
88 * Note: the value must not be changed.
90 #define HGSMI_NUMBER_OF_CHANNELS 0x100