1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369
|
/******************************************************************************
* QLOGIC LINUX SOFTWARE
*
* QLogic ISP2x00 device driver for Linux 2.4.x
* Copyright (C) 2003 QLogic Corporation
* (www.qlogic.com)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
******************************************************************************/
#ifndef _QLA_GS_H
#define _QLA_GS_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* FC-GS-4 definitions.
*/
#define GS4_REVISION 0x01
#define GS_TYPE_MGMT_SERVER 0xFA
#define GS_TYPE_DIR_SERVER 0xFC
#define GS_SUBTYPE_FDMI_HBA 0x10
/* FDMI Command Codes. */
#define FDMI_CC_GRHL 0x100
#define FDMI_CC_GHAT 0x101
#define FDMI_CC_GRPL 0x102
#define FDMI_CC_GPAT 0x110
#define FDMI_CC_RHBA 0x200
#define FDMI_CC_RHAT 0x201
#define FDMI_CC_RPRT 0x210
#define FDMI_CC_RPA 0x211
#define FDMI_CC_DHBA 0x300
#define FDMI_CC_DHAT 0x301
#define FDMI_CC_DPRT 0x310
#define FDMI_CC_DPA 0x311
/*
* CT information unit basic preamble.
*/
typedef struct {
uint8_t revision;
uint8_t in_id[3];
uint8_t gs_type;
uint8_t gs_subtype;
uint8_t options;
uint8_t reserved;
uint16_t cmd_rsp_code;
uint16_t max_resid_size;
uint8_t fragment_id;
uint8_t reason;
uint8_t explanation;
uint8_t vendor_unique;
} ct_iu_preamble_t;
#define FDMI_STAT_OK 0
#define FDMI_STAT_ERR 1
#define FDMI_STAT_ALREADY_REGISTERED 2
#define FDMI_REASON_INVALID_CMD 0x01
#define FDMI_REASON_INVALID_VERSION 0x02
#define FDMI_REASON_LOGICAL_ERR 0x03
#define FDMI_REASON_INVALID_CTIU_SIZE 0x04
#define FDMI_REASON_LOGICAL_BUSY 0x05
#define FDMI_REASON_PROTOCOL_ERR 0x07
#define FDMI_REASON_CANNOT_PERFORM 0x09
#define FDMI_REASON_NOT_SUPPORTED 0x0B
#define FDMI_REASON_HARD_ENF_FAILED 0x0C
#define FDMI_EXPL_NO_ADDITIONAL_EXPLANATION 0x00
#define FDMI_EXPL_HBA_ALREADY_REGISTERED 0x10
#define FDMI_EXPL_HBA_ATTR_NOT_REGISTERED 0x11
#define FDMI_EXPL_HBA_ATTR_MULTI_SAME_TYPE 0x12
#define FDMI_EXPL_INVALID_HBA_ATTR_LEN 0x13
#define FDMI_EXPL_HBA_ATTR_NOT_PRESENT 0x14
#define FDMI_EXPL_PORT_NOT_IN_PORT_LIST 0x15
#define FDMI_EXPL_HBA_ID_NOT_IN_PORT_LIST 0x16
#define FDMI_EXPL_PORT_ATTR_NOT_REGISTERED 0x20
#define FDMI_EXPL_PORT_NOT_REGISTERED 0x21
#define FDMI_EXPL_PORT_ATTR_MULTI_SAME_TYPE 0x22
#define FDMI_EXPL_INVALID_PORT_ATTR_LEN 0x23
/*
* HBA attribute types.
*/
#define T_NODE_NAME 1
#define T_MANUFACTURER 2
#define T_SERIAL_NUMBER 3
#define T_MODEL 4
#define T_MODEL_DESCRIPTION 5
#define T_HARDWARE_VERSION 6
#define T_DRIVER_VERSION 7
#define T_OPTION_ROM_VERSION 8
#define T_FIRMWARE_VERSION 9
#define T_OS_NAME_AND_VERSION 0xa
#define T_MAXIMUM_CT_PAYLOAD_LENGTH 0xb
typedef struct {
uint16_t type;
uint16_t len;
uint8_t value[WWN_SIZE];
} hba_nn_attr_t;
typedef struct {
uint16_t type;
uint16_t len;
uint8_t value[20];
} hba_man_attr_t;
typedef struct {
uint16_t type;
uint16_t len;
uint8_t value[8];
} hba_sn_attr_t;
typedef struct {
uint16_t type;
uint16_t len;
uint8_t value[16];
} hba_mod_attr_t;
typedef struct {
uint16_t type;
uint16_t len;
uint8_t value[80];
} hba_mod_desc_attr_t;
typedef struct {
uint16_t type;
uint16_t len;
uint8_t value[16];
} hba_hv_attr_t;
typedef struct {
uint16_t type;
uint16_t len;
uint8_t value[28];
} hba_dv_attr_t;
typedef struct {
uint16_t type;
uint16_t len;
uint8_t value[16];
} hba_or_attr_t;
typedef struct {
uint16_t type;
uint16_t len;
uint8_t value[16];
} hba_fw_attr_t;
typedef struct {
uint16_t type;
uint16_t len;
uint8_t value[16];
} hba_os_attr_t;
typedef struct {
uint16_t type;
uint16_t len;
uint8_t value[4];
} hba_maxctlen_attr_t;
/*
* HBA Attribute Block.
*/
#define HBA_ATTR_COUNT 10
typedef struct {
uint32_t count;
hba_nn_attr_t nn;
hba_man_attr_t man;
hba_sn_attr_t sn;
hba_mod_attr_t mod;
hba_mod_desc_attr_t mod_desc;
hba_hv_attr_t hv;
hba_dv_attr_t dv;
hba_or_attr_t or;
hba_fw_attr_t fw;
hba_os_attr_t os;
#if 0
hba_maxctlen_attr_t max_ctlen;
#endif
} hba_attr_t;
/*
* Port attribute types.
*/
#define T_FC4_TYPES 1
#define T_SUPPORT_SPEED 2
#define T_CURRENT_SPEED 3
#define T_MAX_FRAME_SIZE 4
#define T_OS_DEVICE_NAME 5
#define T_HOST_NAME 6
typedef struct {
uint16_t type;
uint16_t len;
uint8_t value[32];
} port_fc4_attr_t;
typedef struct {
uint16_t type;
uint16_t len;
uint32_t value;
} port_speed_attr_t;
typedef struct {
uint16_t type;
uint16_t len;
uint32_t value;
} port_frame_attr_t;
typedef struct {
uint16_t type;
uint16_t len;
uint8_t value[24];
} port_os_attr_t;
typedef struct {
uint16_t type;
uint16_t len;
uint8_t value[80];
} port_host_name_attr_t;
/*
* Port Attribute Block.
*/
#define PORT_ATTR_COUNT 6
typedef struct {
uint32_t count;
port_fc4_attr_t fc4_types;
port_speed_attr_t sup_speed;
port_speed_attr_t cur_speed;
port_frame_attr_t max_fsize;
port_os_attr_t os_dev_name;
port_host_name_attr_t host_name;
} port_attr_t;
/*
* Registered Port List
*/
typedef struct {
uint32_t num_ports;
uint8_t port_entry[WWN_SIZE];
} reg_port_list_t;
/*
* Get HBA Attributes.
*/
typedef struct {
ct_iu_preamble_t hdr;
uint8_t hba_identifier[WWN_SIZE];
} ct_iu_ghat_req_t;
typedef struct {
ct_iu_preamble_t hdr;
reg_port_list_t plist;
hba_attr_t attr;
} ct_iu_ghat_rsp_t;
/*
* Register HBA.
*/
typedef struct {
ct_iu_preamble_t hdr;
uint8_t hba_identifier[WWN_SIZE];
reg_port_list_t plist;
hba_attr_t attr;
} ct_iu_rhba_t;
/*
* Register HBA Attributes.
*/
typedef struct {
ct_iu_preamble_t hdr;
uint8_t hba_identifier[WWN_SIZE];
hba_attr_t attr;
} ct_iu_rhat_t;
/*
* Register Port.
*/
typedef struct {
ct_iu_preamble_t hdr;
uint8_t hba_portname[WWN_SIZE];
uint8_t portname[WWN_SIZE];
port_attr_t attr;
} ct_iu_rprt_t;
/*
* Register Port Attributes.
*/
typedef struct {
ct_iu_preamble_t hdr;
uint8_t portname[WWN_SIZE];
port_attr_t attr;
} ct_iu_rpa_t;
/*
* Deregister HBA.
*/
typedef struct {
ct_iu_preamble_t hdr;
uint8_t hba_portname[WWN_SIZE];
} ct_iu_dhba_t;
/*
* Deregister HBA Attributes.
*/
typedef struct {
ct_iu_preamble_t hdr;
uint8_t hba_portname[WWN_SIZE];
} ct_iu_dhat_t;
/*
* Deregister Port.
*/
typedef struct {
ct_iu_preamble_t hdr;
uint8_t portname[WWN_SIZE];
} ct_iu_dprt_t;
/*
* Deregister Port Attributes.
*/
typedef struct {
ct_iu_preamble_t hdr;
uint8_t portname[WWN_SIZE];
} ct_iu_dpa_t;
typedef struct {
uint16_t loop_id;
uint32_t response_byte_count;
uint32_t command_byte_count;
} ct_iocb_t;
typedef struct ct_fdmi_pkt {
union {
ct_iu_ghat_req_t ghat_req;
ct_iu_ghat_rsp_t ghat_rsp;
ct_iu_rhba_t rhba;
ct_iu_rhat_t rhat;
ct_iu_rprt_t rprt;
ct_iu_rpa_t rpa;
ct_iu_dhba_t dhba;
ct_iu_dhat_t dhat;
ct_iu_dprt_t dprt;
ct_iu_dpa_t dpa;
} t;
} ct_fdmi_pkt_t;
#ifdef __cplusplus
}
#endif
#endif /* _QLA_GS_H */
|