Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright(c) 2011 Intel Corporation. All rights reserved.
0004  *
0005  * Maintained at www.Open-FCoE.org
0006  */
0007 
0008 #ifndef _FC_MS_H_
0009 #define _FC_MS_H_
0010 
0011 #include <linux/types.h>
0012 
0013 /*
0014  * Fibre Channel Services - Management Service (MS)
0015  * From T11.org FC-GS-4 Rev 7.91 February 4, 2004
0016  */
0017 
0018 /*
0019  * Fabric Device Management Interface
0020  */
0021 
0022 /*
0023  * Common-transport sub-type for FDMI
0024  */
0025 #define FC_FDMI_SUBTYPE     0x10 /* fs_ct_hdr.ct_fs_subtype */
0026 
0027 /*
0028  * Management server FDMI specifications.
0029  */
0030 #define FDMI_V1     1 /* FDMI version 1 specifications */
0031 #define FDMI_V2     2 /* FDMI version 2 specifications */
0032 
0033 /*
0034  * Management server FDMI Requests.
0035  */
0036 enum fc_fdmi_req {
0037     FC_FDMI_GRHL = 0x0100,  /* Get Registered HBA List */
0038     FC_FDMI_GHAT = 0x0101,  /* Get HBA Attributes */
0039     FC_FDMI_GRPL = 0x0102,  /* Get Registered Port List */
0040     FC_FDMI_GPAT = 0x0110,  /* Get Port Attributes */
0041     FC_FDMI_RHBA = 0x0200,  /* Register HBA */
0042     FC_FDMI_RHAT = 0x0201,  /* Register HBA Attributes */
0043     FC_FDMI_RPRT = 0x0210,  /* Register Port */
0044     FC_FDMI_RPA = 0x0211,   /* Register Port Attributes */
0045     FC_FDMI_DHBA = 0x0300,  /* Deregister HBA */
0046     FC_FDMI_DHAT = 0x0301,  /* Deregister HBA Attributes */
0047     FC_FDMI_DPRT = 0x0310,  /* Deregister Port */
0048     FC_FDMI_DPA = 0x0311,   /* Deregister Port Attributes */
0049 };
0050 
0051 /*
0052  * HBA Attribute Entry Type
0053  */
0054 enum fc_fdmi_hba_attr_type {
0055     FC_FDMI_HBA_ATTR_NODENAME = 0x0001,
0056     FC_FDMI_HBA_ATTR_MANUFACTURER = 0x0002,
0057     FC_FDMI_HBA_ATTR_SERIALNUMBER = 0x0003,
0058     FC_FDMI_HBA_ATTR_MODEL = 0x0004,
0059     FC_FDMI_HBA_ATTR_MODELDESCRIPTION = 0x0005,
0060     FC_FDMI_HBA_ATTR_HARDWAREVERSION = 0x0006,
0061     FC_FDMI_HBA_ATTR_DRIVERVERSION = 0x0007,
0062     FC_FDMI_HBA_ATTR_OPTIONROMVERSION = 0x0008,
0063     FC_FDMI_HBA_ATTR_FIRMWAREVERSION = 0x0009,
0064     FC_FDMI_HBA_ATTR_OSNAMEVERSION = 0x000A,
0065     FC_FDMI_HBA_ATTR_MAXCTPAYLOAD = 0x000B,
0066     FC_FDMI_HBA_ATTR_NODESYMBLNAME = 0x000C,
0067     FC_FDMI_HBA_ATTR_VENDORSPECIFICINFO = 0x000D,
0068     FC_FDMI_HBA_ATTR_NUMBEROFPORTS = 0x000E,
0069     FC_FDMI_HBA_ATTR_FABRICNAME = 0x000F,
0070     FC_FDMI_HBA_ATTR_BIOSVERSION = 0x0010,
0071     FC_FDMI_HBA_ATTR_BIOSSTATE = 0x0011,
0072     FC_FDMI_HBA_ATTR_VENDORIDENTIFIER = 0x00E0,
0073 };
0074 
0075 /*
0076  * HBA Attribute Length
0077  */
0078 #define FC_FDMI_HBA_ATTR_NODENAME_LEN       8
0079 #define FC_FDMI_HBA_ATTR_MANUFACTURER_LEN   64
0080 #define FC_FDMI_HBA_ATTR_SERIALNUMBER_LEN   64
0081 #define FC_FDMI_HBA_ATTR_MODEL_LEN      64
0082 #define FC_FDMI_HBA_ATTR_MODELDESCR_LEN     64
0083 #define FC_FDMI_HBA_ATTR_HARDWAREVERSION_LEN    64
0084 #define FC_FDMI_HBA_ATTR_DRIVERVERSION_LEN  64
0085 #define FC_FDMI_HBA_ATTR_OPTIONROMVERSION_LEN   64
0086 #define FC_FDMI_HBA_ATTR_FIRMWAREVERSION_LEN    64
0087 #define FC_FDMI_HBA_ATTR_OSNAMEVERSION_LEN  128
0088 #define FC_FDMI_HBA_ATTR_MAXCTPAYLOAD_LEN   4
0089 #define FC_FDMI_HBA_ATTR_NODESYMBLNAME_LEN  64
0090 #define FC_FDMI_HBA_ATTR_VENDORSPECIFICINFO_LEN 4
0091 #define FC_FDMI_HBA_ATTR_NUMBEROFPORTS_LEN  4
0092 #define FC_FDMI_HBA_ATTR_FABRICNAME_LEN 8
0093 #define FC_FDMI_HBA_ATTR_BIOSVERSION_LEN    64
0094 #define FC_FDMI_HBA_ATTR_BIOSSTATE_LEN    4
0095 #define FC_FDMI_HBA_ATTR_VENDORIDENTIFIER_LEN 8
0096 
0097 /*
0098  * Port Attribute Type
0099  */
0100 enum fc_fdmi_port_attr_type {
0101     FC_FDMI_PORT_ATTR_FC4TYPES = 0x0001,
0102     FC_FDMI_PORT_ATTR_SUPPORTEDSPEED = 0x0002,
0103     FC_FDMI_PORT_ATTR_CURRENTPORTSPEED = 0x0003,
0104     FC_FDMI_PORT_ATTR_MAXFRAMESIZE = 0x0004,
0105     FC_FDMI_PORT_ATTR_OSDEVICENAME = 0x0005,
0106     FC_FDMI_PORT_ATTR_HOSTNAME = 0x0006,
0107     FC_FDMI_PORT_ATTR_NODENAME = 0x0007,
0108     FC_FDMI_PORT_ATTR_PORTNAME = 0x0008,
0109     FC_FDMI_PORT_ATTR_SYMBOLICNAME = 0x0009,
0110     FC_FDMI_PORT_ATTR_PORTTYPE = 0x000A,
0111     FC_FDMI_PORT_ATTR_SUPPORTEDCLASSSRVC = 0x000B,
0112     FC_FDMI_PORT_ATTR_FABRICNAME = 0x000C,
0113     FC_FDMI_PORT_ATTR_CURRENTFC4TYPE = 0x000D,
0114     FC_FDMI_PORT_ATTR_PORTSTATE = 0x101,
0115     FC_FDMI_PORT_ATTR_DISCOVEREDPORTS = 0x102,
0116     FC_FDMI_PORT_ATTR_PORTID = 0x103,
0117 };
0118 
0119 /*
0120  * Port Attribute Length
0121  */
0122 #define FC_FDMI_PORT_ATTR_FC4TYPES_LEN      32
0123 #define FC_FDMI_PORT_ATTR_SUPPORTEDSPEED_LEN    4
0124 #define FC_FDMI_PORT_ATTR_CURRENTPORTSPEED_LEN  4
0125 #define FC_FDMI_PORT_ATTR_MAXFRAMESIZE_LEN  4
0126 #define FC_FDMI_PORT_ATTR_OSDEVICENAME_LEN  256
0127 #define FC_FDMI_PORT_ATTR_HOSTNAME_LEN      256
0128 #define FC_FDMI_PORT_ATTR_NODENAME_LEN      8
0129 #define FC_FDMI_PORT_ATTR_PORTNAME_LEN      8
0130 #define FC_FDMI_PORT_ATTR_SYMBOLICNAME_LEN  256
0131 #define FC_FDMI_PORT_ATTR_PORTTYPE_LEN      4
0132 #define FC_FDMI_PORT_ATTR_SUPPORTEDCLASSSRVC_LEN    4
0133 #define FC_FDMI_PORT_ATTR_FABRICNAME_LEN    8
0134 #define FC_FDMI_PORT_ATTR_CURRENTFC4TYPE_LEN    32
0135 #define FC_FDMI_PORT_ATTR_PORTSTATE_LEN     4
0136 #define FC_FDMI_PORT_ATTR_DISCOVEREDPORTS_LEN   4
0137 #define FC_FDMI_PORT_ATTR_PORTID_LEN        4
0138 
0139 
0140 /*
0141  * HBA Attribute ID
0142  */
0143 struct fc_fdmi_hba_identifier {
0144     __be64      id;
0145 };
0146 
0147 /*
0148  * Port Name
0149  */
0150 struct fc_fdmi_port_name {
0151     __be64      portname;
0152 };
0153 
0154 /*
0155  * Attribute Entry Block for HBA/Port Attributes
0156  */
0157 #define FC_FDMI_ATTR_ENTRY_HEADER_LEN   4
0158 struct fc_fdmi_attr_entry {
0159     __be16      type;
0160     __be16      len;
0161     __u8        value[];
0162 } __attribute__((__packed__));
0163 
0164 /*
0165  * Common for HBA/Port Attributes
0166  */
0167 struct fs_fdmi_attrs {
0168     __be32              numattrs;
0169     struct fc_fdmi_attr_entry   attr[];
0170 } __attribute__((__packed__));
0171 
0172 /*
0173  * Registered Port List
0174  */
0175 struct fc_fdmi_rpl {
0176     __be32              numport;
0177     struct fc_fdmi_port_name    port[1];
0178 } __attribute__((__packed__));
0179 
0180 /*
0181  * Register HBA (RHBA)
0182  */
0183 struct fc_fdmi_rhba {
0184     struct fc_fdmi_hba_identifier hbaid;
0185     struct fc_fdmi_rpl       port;
0186     struct fs_fdmi_attrs         hba_attrs;
0187 } __attribute__((__packed__));
0188 
0189 /*
0190  * Register HBA Attributes (RHAT)
0191  */
0192 struct fc_fdmi_rhat {
0193     struct fc_fdmi_hba_identifier hbaid;
0194     struct fs_fdmi_attrs         hba_attrs;
0195 } __attribute__((__packed__));
0196 
0197 /*
0198  * Register Port (RPRT)
0199  */
0200 struct fc_fdmi_rprt {
0201     struct fc_fdmi_hba_identifier hbaid;
0202     struct fc_fdmi_port_name     port;
0203     struct fs_fdmi_attrs         hba_attrs;
0204 } __attribute__((__packed__));
0205 
0206 /*
0207  * Register Port Attributes (RPA)
0208  */
0209 struct fc_fdmi_rpa {
0210     struct fc_fdmi_port_name     port;
0211     struct fs_fdmi_attrs         hba_attrs;
0212 } __attribute__((__packed__));
0213 
0214 /*
0215  * Deregister Port (DPRT)
0216  */
0217 struct fc_fdmi_dprt {
0218     struct fc_fdmi_port_name     port;
0219 } __attribute__((__packed__));
0220 
0221 /*
0222  * Deregister Port Attributes (DPA)
0223  */
0224 struct fc_fdmi_dpa {
0225     struct fc_fdmi_port_name     port;
0226     struct fs_fdmi_attrs         hba_attrs;
0227 } __attribute__((__packed__));
0228 
0229 /*
0230  * Deregister HBA Attributes (DHAT)
0231  */
0232 struct fc_fdmi_dhat {
0233     struct fc_fdmi_hba_identifier hbaid;
0234 } __attribute__((__packed__));
0235 
0236 /*
0237  * Deregister HBA (DHBA)
0238  */
0239 struct fc_fdmi_dhba {
0240     struct fc_fdmi_hba_identifier hbaid;
0241 } __attribute__((__packed__));
0242 
0243 #endif /* _FC_MS_H_ */