1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 #ifndef _FC_MS_H_
   9 #define _FC_MS_H_
  10 
  11 #include <linux/types.h>
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 
  23 
  24 
  25 #define FC_FDMI_SUBTYPE     0x10 
  26 
  27 
  28 
  29 
  30 enum fc_fdmi_req {
  31         FC_FDMI_GRHL = 0x0100,  
  32         FC_FDMI_GHAT = 0x0101,  
  33         FC_FDMI_GRPL = 0x0102,  
  34         FC_FDMI_GPAT = 0x0110,  
  35         FC_FDMI_RHBA = 0x0200,  
  36         FC_FDMI_RHAT = 0x0201,  
  37         FC_FDMI_RPRT = 0x0210,  
  38         FC_FDMI_RPA = 0x0211,   
  39         FC_FDMI_DHBA = 0x0300,  
  40         FC_FDMI_DHAT = 0x0301,  
  41         FC_FDMI_DPRT = 0x0310,  
  42         FC_FDMI_DPA = 0x0311,   
  43 };
  44 
  45 
  46 
  47 
  48 enum fc_fdmi_hba_attr_type {
  49         FC_FDMI_HBA_ATTR_NODENAME = 0x0001,
  50         FC_FDMI_HBA_ATTR_MANUFACTURER = 0x0002,
  51         FC_FDMI_HBA_ATTR_SERIALNUMBER = 0x0003,
  52         FC_FDMI_HBA_ATTR_MODEL = 0x0004,
  53         FC_FDMI_HBA_ATTR_MODELDESCRIPTION = 0x0005,
  54         FC_FDMI_HBA_ATTR_HARDWAREVERSION = 0x0006,
  55         FC_FDMI_HBA_ATTR_DRIVERVERSION = 0x0007,
  56         FC_FDMI_HBA_ATTR_OPTIONROMVERSION = 0x0008,
  57         FC_FDMI_HBA_ATTR_FIRMWAREVERSION = 0x0009,
  58         FC_FDMI_HBA_ATTR_OSNAMEVERSION = 0x000A,
  59         FC_FDMI_HBA_ATTR_MAXCTPAYLOAD = 0x000B,
  60 };
  61 
  62 
  63 
  64 
  65 #define FC_FDMI_HBA_ATTR_NODENAME_LEN           8
  66 #define FC_FDMI_HBA_ATTR_MANUFACTURER_LEN       64
  67 #define FC_FDMI_HBA_ATTR_SERIALNUMBER_LEN       64
  68 #define FC_FDMI_HBA_ATTR_MODEL_LEN              256
  69 #define FC_FDMI_HBA_ATTR_MODELDESCR_LEN         256
  70 #define FC_FDMI_HBA_ATTR_HARDWAREVERSION_LEN    256
  71 #define FC_FDMI_HBA_ATTR_DRIVERVERSION_LEN      256
  72 #define FC_FDMI_HBA_ATTR_OPTIONROMVERSION_LEN   256
  73 #define FC_FDMI_HBA_ATTR_FIRMWAREVERSION_LEN    256
  74 #define FC_FDMI_HBA_ATTR_OSNAMEVERSION_LEN      256
  75 #define FC_FDMI_HBA_ATTR_MAXCTPAYLOAD_LEN       4
  76 
  77 
  78 
  79 
  80 enum fc_fdmi_port_attr_type {
  81         FC_FDMI_PORT_ATTR_FC4TYPES = 0x0001,
  82         FC_FDMI_PORT_ATTR_SUPPORTEDSPEED = 0x0002,
  83         FC_FDMI_PORT_ATTR_CURRENTPORTSPEED = 0x0003,
  84         FC_FDMI_PORT_ATTR_MAXFRAMESIZE = 0x0004,
  85         FC_FDMI_PORT_ATTR_OSDEVICENAME = 0x0005,
  86         FC_FDMI_PORT_ATTR_HOSTNAME = 0x0006,
  87 };
  88 
  89 
  90 
  91 
  92 #define FC_FDMI_PORT_ATTR_FC4TYPES_LEN          32
  93 #define FC_FDMI_PORT_ATTR_SUPPORTEDSPEED_LEN    4
  94 #define FC_FDMI_PORT_ATTR_CURRENTPORTSPEED_LEN  4
  95 #define FC_FDMI_PORT_ATTR_MAXFRAMESIZE_LEN      4
  96 #define FC_FDMI_PORT_ATTR_OSDEVICENAME_LEN      256
  97 #define FC_FDMI_PORT_ATTR_HOSTNAME_LEN          256
  98 
  99 
 100 
 101 
 102 struct fc_fdmi_hba_identifier {
 103         __be64          id;
 104 };
 105 
 106 
 107 
 108 
 109 struct fc_fdmi_port_name {
 110         __be64          portname;
 111 };
 112 
 113 
 114 
 115 
 116 #define FC_FDMI_ATTR_ENTRY_HEADER_LEN   4
 117 struct fc_fdmi_attr_entry {
 118         __be16          type;
 119         __be16          len;
 120         __u8            value[1];
 121 } __attribute__((__packed__));
 122 
 123 
 124 
 125 
 126 struct fs_fdmi_attrs {
 127         __be32                          numattrs;
 128         struct fc_fdmi_attr_entry       attr[1];
 129 } __attribute__((__packed__));
 130 
 131 
 132 
 133 
 134 struct fc_fdmi_rpl {
 135         __be32                          numport;
 136         struct fc_fdmi_port_name        port[1];
 137 } __attribute__((__packed__));
 138 
 139 
 140 
 141 
 142 struct fc_fdmi_rhba {
 143         struct fc_fdmi_hba_identifier hbaid;
 144         struct fc_fdmi_rpl               port;
 145         struct fs_fdmi_attrs             hba_attrs;
 146 } __attribute__((__packed__));
 147 
 148 
 149 
 150 
 151 struct fc_fdmi_rhat {
 152         struct fc_fdmi_hba_identifier hbaid;
 153         struct fs_fdmi_attrs             hba_attrs;
 154 } __attribute__((__packed__));
 155 
 156 
 157 
 158 
 159 struct fc_fdmi_rprt {
 160         struct fc_fdmi_hba_identifier hbaid;
 161         struct fc_fdmi_port_name         port;
 162         struct fs_fdmi_attrs             hba_attrs;
 163 } __attribute__((__packed__));
 164 
 165 
 166 
 167 
 168 struct fc_fdmi_rpa {
 169         struct fc_fdmi_port_name         port;
 170         struct fs_fdmi_attrs             hba_attrs;
 171 } __attribute__((__packed__));
 172 
 173 
 174 
 175 
 176 struct fc_fdmi_dprt {
 177         struct fc_fdmi_port_name         port;
 178 } __attribute__((__packed__));
 179 
 180 
 181 
 182 
 183 struct fc_fdmi_dpa {
 184         struct fc_fdmi_port_name         port;
 185         struct fs_fdmi_attrs             hba_attrs;
 186 } __attribute__((__packed__));
 187 
 188 
 189 
 190 
 191 struct fc_fdmi_dhat {
 192         struct fc_fdmi_hba_identifier hbaid;
 193 } __attribute__((__packed__));
 194 
 195 
 196 
 197 
 198 struct fc_fdmi_dhba {
 199         struct fc_fdmi_hba_identifier hbaid;
 200 } __attribute__((__packed__));
 201 
 202 #endif