~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/scsi/scsi_netlink.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2 /*
  3  *  SCSI Transport Netlink Interface
  4  *    Used for the posting of outbound SCSI transport events
  5  *
  6  *  Copyright (C) 2006   James Smart, Emulex Corporation
  7  */
  8 #ifndef SCSI_NETLINK_H
  9 #define SCSI_NETLINK_H
 10 
 11 #include <linux/netlink.h>
 12 #include <linux/types.h>
 13 
 14 /*
 15  * This file intended to be included by both kernel and user space
 16  */
 17 
 18 /* Single Netlink Message type to send all SCSI Transport messages */
 19 #define SCSI_TRANSPORT_MSG              NLMSG_MIN_TYPE + 1
 20 
 21 /* SCSI Transport Broadcast Groups */
 22         /* leaving groups 0 and 1 unassigned */
 23 #define SCSI_NL_GRP_FC_EVENTS           (1<<2)          /* Group 2 */
 24 #define SCSI_NL_GRP_CNT                 3
 25 
 26 
 27 /* SCSI_TRANSPORT_MSG event message header */
 28 struct scsi_nl_hdr {
 29         __u8 version;
 30         __u8 transport;
 31         __u16 magic;
 32         __u16 msgtype;
 33         __u16 msglen;
 34 } __attribute__((aligned(sizeof(__u64))));
 35 
 36 /* scsi_nl_hdr->version value */
 37 #define SCSI_NL_VERSION                         1
 38 
 39 /* scsi_nl_hdr->magic value */
 40 #define SCSI_NL_MAGIC                           0xA1B2
 41 
 42 /* scsi_nl_hdr->transport value */
 43 #define SCSI_NL_TRANSPORT                       0
 44 #define SCSI_NL_TRANSPORT_FC                    1
 45 #define SCSI_NL_MAX_TRANSPORTS                  2
 46 
 47 /* Transport-based scsi_nl_hdr->msgtype values are defined in each transport */
 48 
 49 /*
 50  * GENERIC SCSI scsi_nl_hdr->msgtype Values
 51  */
 52         /* kernel -> user */
 53 #define SCSI_NL_SHOST_VENDOR                    0x0001
 54         /* user -> kernel */
 55 /* SCSI_NL_SHOST_VENDOR msgtype is kernel->user and user->kernel */
 56 
 57 
 58 /*
 59  * Message Structures :
 60  */
 61 
 62 /* macro to round up message lengths to 8byte boundary */
 63 #define SCSI_NL_MSGALIGN(len)           (((len) + 7) & ~7)
 64 
 65 
 66 /*
 67  * SCSI HOST Vendor Unique messages :
 68  *   SCSI_NL_SHOST_VENDOR
 69  *
 70  * Note: The Vendor Unique message payload will begin directly after
 71  *       this structure, with the length of the payload per vmsg_datalen.
 72  *
 73  * Note: When specifying vendor_id, be sure to read the Vendor Type and ID
 74  *   formatting requirements specified below
 75  */
 76 struct scsi_nl_host_vendor_msg {
 77         struct scsi_nl_hdr snlh;                /* must be 1st element ! */
 78         __u64 vendor_id;
 79         __u16 host_no;
 80         __u16 vmsg_datalen;
 81 } __attribute__((aligned(sizeof(__u64))));
 82 
 83 
 84 /*
 85  * Vendor ID:
 86  *   If transports post vendor-unique events, they must pass a well-known
 87  *   32-bit vendor identifier. This identifier consists of 8 bits indicating
 88  *   the "type" of identifier contained, and 24 bits of id data.
 89  *
 90  *   Identifiers for each type:
 91  *    PCI :  ID data is the 16 bit PCI Registered Vendor ID
 92  */
 93 #define SCSI_NL_VID_TYPE_SHIFT          56
 94 #define SCSI_NL_VID_TYPE_MASK           ((__u64)0xFF << SCSI_NL_VID_TYPE_SHIFT)
 95 #define SCSI_NL_VID_TYPE_PCI            ((__u64)0x01 << SCSI_NL_VID_TYPE_SHIFT)
 96 #define SCSI_NL_VID_ID_MASK             (~ SCSI_NL_VID_TYPE_MASK)
 97 
 98 
 99 #define INIT_SCSI_NL_HDR(hdr, t, mtype, mlen)                   \
100         {                                                       \
101         (hdr)->version = SCSI_NL_VERSION;                       \
102         (hdr)->transport = t;                                   \
103         (hdr)->magic = SCSI_NL_MAGIC;                           \
104         (hdr)->msgtype = mtype;                                 \
105         (hdr)->msglen = mlen;                                   \
106         }
107 
108 #endif /* SCSI_NETLINK_H */
109 
110 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php