• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This header was generated from the Linux kernel headers by update_headers.py,
3  * to provide necessary information from kernel to userspace, such as constants,
4  * structures, and macros, and thus, contains no copyrightable information.
5  */
6 #ifndef SCSI_NETLINK_H
7 #define SCSI_NETLINK_H
8 #include <linux/netlink.h>
9 #include <linux/types.h>
10 #define SCSI_TRANSPORT_MSG		NLMSG_MIN_TYPE + 1
11 
12 #define SCSI_NL_GRP_FC_EVENTS		(1<<2)
13 #define SCSI_NL_GRP_CNT			3
14 struct scsi_nl_hdr {
15 	uint8_t version;
16 	uint8_t transport;
17 	uint16_t magic;
18 	uint16_t msgtype;
19 	uint16_t msglen;
20 } __attribute__((aligned(sizeof(uint64_t))));
21 #define SCSI_NL_VERSION				1
22 #define SCSI_NL_MAGIC				0xA1B2
23 #define SCSI_NL_TRANSPORT			0
24 #define SCSI_NL_TRANSPORT_FC			1
25 #define SCSI_NL_MAX_TRANSPORTS			2
26 
27 #define SCSI_NL_SHOST_VENDOR			0x0001
28 
29 #define SCSI_NL_MSGALIGN(len)		(((len) + 7) & ~7)
30 struct scsi_nl_host_vendor_msg {
31 	struct scsi_nl_hdr snlh;
32 	uint64_t vendor_id;
33 	uint16_t host_no;
34 	uint16_t vmsg_datalen;
35 } __attribute__((aligned(sizeof(uint64_t))));
36 #define SCSI_NL_VID_TYPE_SHIFT		56
37 #define SCSI_NL_VID_TYPE_MASK		((__u64)0xFF << SCSI_NL_VID_TYPE_SHIFT)
38 #define SCSI_NL_VID_TYPE_PCI		((__u64)0x01 << SCSI_NL_VID_TYPE_SHIFT)
39 #define SCSI_NL_VID_ID_MASK		(~ SCSI_NL_VID_TYPE_MASK)
40 #define INIT_SCSI_NL_HDR(hdr, t, mtype, mlen)			\
41 	{							\
42 	(hdr)->version = SCSI_NL_VERSION;			\
43 	(hdr)->transport = t;					\
44 	(hdr)->magic = SCSI_NL_MAGIC;				\
45 	(hdr)->msgtype = mtype;					\
46 	(hdr)->msglen = mlen;					\
47 	}
48 #endif
49