1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef SCSI_NETLINK_H
20 #define SCSI_NETLINK_H
21 #include <linux/netlink.h>
22 #include <linux/types.h>
23 #define SCSI_TRANSPORT_MSG NLMSG_MIN_TYPE + 1
24 #define SCSI_NL_GRP_FC_EVENTS (1 << 2)
25 #define SCSI_NL_GRP_CNT 3
26 struct scsi_nl_hdr {
27   __u8 version;
28   __u8 transport;
29   __u16 magic;
30   __u16 msgtype;
31   __u16 msglen;
32 } __attribute__((aligned(sizeof(__u64))));
33 #define SCSI_NL_VERSION 1
34 #define SCSI_NL_MAGIC 0xA1B2
35 #define SCSI_NL_TRANSPORT 0
36 #define SCSI_NL_TRANSPORT_FC 1
37 #define SCSI_NL_MAX_TRANSPORTS 2
38 #define SCSI_NL_SHOST_VENDOR 0x0001
39 #define SCSI_NL_MSGALIGN(len) (((len) + 7) & ~7)
40 struct scsi_nl_host_vendor_msg {
41   struct scsi_nl_hdr snlh;
42   __u64 vendor_id;
43   __u16 host_no;
44   __u16 vmsg_datalen;
45 } __attribute__((aligned(sizeof(__u64))));
46 #define SCSI_NL_VID_TYPE_SHIFT 56
47 #define SCSI_NL_VID_TYPE_MASK ((__u64) 0xFF << SCSI_NL_VID_TYPE_SHIFT)
48 #define SCSI_NL_VID_TYPE_PCI ((__u64) 0x01 << SCSI_NL_VID_TYPE_SHIFT)
49 #define SCSI_NL_VID_ID_MASK (~SCSI_NL_VID_TYPE_MASK)
50 #define INIT_SCSI_NL_HDR(hdr,t,mtype,mlen) { (hdr)->version = SCSI_NL_VERSION; (hdr)->transport = t; (hdr)->magic = SCSI_NL_MAGIC; (hdr)->msgtype = mtype; (hdr)->msglen = mlen; }
51 #endif
52