1 /* SPDX-License-Identifier: MIT */
2 /* Copyright (C) 2006-2017 Oracle Corporation */
4 #ifndef __HGSMI_DEFS_H__
5 #define __HGSMI_DEFS_H__
7 /* Buffer sequence type mask. */
8 #define HGSMI_BUFFER_HEADER_F_SEQ_MASK 0x03
9 /* Single buffer, not a part of a sequence. */
10 #define HGSMI_BUFFER_HEADER_F_SEQ_SINGLE 0x00
11 /* The first buffer in a sequence. */
12 #define HGSMI_BUFFER_HEADER_F_SEQ_START 0x01
13 /* A middle buffer in a sequence. */
14 #define HGSMI_BUFFER_HEADER_F_SEQ_CONTINUE 0x02
15 /* The last buffer in a sequence. */
16 #define HGSMI_BUFFER_HEADER_F_SEQ_END 0x03
18 /* 16 bytes buffer header. */
19 struct hgsmi_buffer_header
{
20 u32 data_size
; /* Size of data that follows the header. */
21 u8 flags
; /* HGSMI_BUFFER_HEADER_F_* */
22 u8 channel
; /* The channel the data must be routed to. */
23 u16 channel_info
; /* Opaque to the HGSMI, used by the channel. */
26 /* Opaque placeholder to make the union 8 bytes. */
29 /* HGSMI_BUFFER_HEADER_F_SEQ_SINGLE */
31 u32 reserved1
; /* A reserved field, initialize to 0. */
32 u32 reserved2
; /* A reserved field, initialize to 0. */
35 /* HGSMI_BUFFER_HEADER_F_SEQ_START */
37 /* Must be the same for all buffers in the sequence. */
39 /* The total size of the sequence. */
44 * HGSMI_BUFFER_HEADER_F_SEQ_CONTINUE and
45 * HGSMI_BUFFER_HEADER_F_SEQ_END
48 /* Must be the same for all buffers in the sequence. */
50 /* Data offset in the entire sequence. */
56 /* 8 bytes buffer tail. */
57 struct hgsmi_buffer_tail
{
58 /* Reserved, must be initialized to 0. */
61 * One-at-a-Time Hash: https://www.burtleburtle.net/bob/hash/doobs.html
62 * Over the header, offset and for first 4 bytes of the tail.
68 * The size of the array of channels. Array indexes are u8.
69 * Note: the value must not be changed.
71 #define HGSMI_NUMBER_OF_CHANNELS 0x100