xref: /openbmc/linux/include/uapi/scsi/scsi_netlink_fc.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2ee7afd71SDavid Howells /*
3ee7afd71SDavid Howells  *  FC Transport Netlink Interface
4ee7afd71SDavid Howells  *
5ee7afd71SDavid Howells  *  Copyright (C) 2006   James Smart, Emulex Corporation
6ee7afd71SDavid Howells  */
7ee7afd71SDavid Howells #ifndef SCSI_NETLINK_FC_H
8ee7afd71SDavid Howells #define SCSI_NETLINK_FC_H
9ee7afd71SDavid Howells 
10075c2b6bSMasahiro Yamada #include <linux/types.h>
11ee7afd71SDavid Howells #include <scsi/scsi_netlink.h>
12ee7afd71SDavid Howells 
13ee7afd71SDavid Howells /*
14ee7afd71SDavid Howells  * This file intended to be included by both kernel and user space
15ee7afd71SDavid Howells  */
16ee7afd71SDavid Howells 
17ee7afd71SDavid Howells /*
18ee7afd71SDavid Howells  * FC Transport Message Types
19ee7afd71SDavid Howells  */
20ee7afd71SDavid Howells 	/* kernel -> user */
21ee7afd71SDavid Howells #define FC_NL_ASYNC_EVENT			0x0100
22ee7afd71SDavid Howells 	/* user -> kernel */
23ee7afd71SDavid Howells /* none */
24ee7afd71SDavid Howells 
25ee7afd71SDavid Howells 
26ee7afd71SDavid Howells /*
27ee7afd71SDavid Howells  * Message Structures :
28ee7afd71SDavid Howells  */
29ee7afd71SDavid Howells 
30ee7afd71SDavid Howells /* macro to round up message lengths to 8byte boundary */
31ee7afd71SDavid Howells #define FC_NL_MSGALIGN(len)		(((len) + 7) & ~7)
32ee7afd71SDavid Howells 
33ee7afd71SDavid Howells 
34ee7afd71SDavid Howells /*
35ee7afd71SDavid Howells  * FC Transport Broadcast Event Message :
36ee7afd71SDavid Howells  *   FC_NL_ASYNC_EVENT
37ee7afd71SDavid Howells  *
38*d88a0240SKees Cook  * Note: if Vendor Unique message, event_data_flex will be start of
39ee7afd71SDavid Howells  * 	 vendor unique payload, and the length of the payload is
40ee7afd71SDavid Howells  *       per event_datalen
41ee7afd71SDavid Howells  *
42ee7afd71SDavid Howells  * Note: When specifying vendor_id, be sure to read the Vendor Type and ID
43ee7afd71SDavid Howells  *   formatting requirements specified in scsi_netlink.h
44ee7afd71SDavid Howells  */
45ee7afd71SDavid Howells struct fc_nl_event {
46ee7afd71SDavid Howells 	struct scsi_nl_hdr snlh;		/* must be 1st element ! */
47075c2b6bSMasahiro Yamada 	__u64 seconds;
48075c2b6bSMasahiro Yamada 	__u64 vendor_id;
49075c2b6bSMasahiro Yamada 	__u16 host_no;
50075c2b6bSMasahiro Yamada 	__u16 event_datalen;
51075c2b6bSMasahiro Yamada 	__u32 event_num;
52075c2b6bSMasahiro Yamada 	__u32 event_code;
53*d88a0240SKees Cook 	union {
54075c2b6bSMasahiro Yamada 		__u32 event_data;
55*d88a0240SKees Cook 		__DECLARE_FLEX_ARRAY(__u8, event_data_flex);
56*d88a0240SKees Cook 	};
57075c2b6bSMasahiro Yamada } __attribute__((aligned(sizeof(__u64))));
58ee7afd71SDavid Howells 
59ee7afd71SDavid Howells 
60ee7afd71SDavid Howells #endif /* SCSI_NETLINK_FC_H */
61ee7afd71SDavid Howells 
62