2 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License (GPL) Version 2 as
10 * published by the Free Software Foundation
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
21 #include <protocol/types.h>
22 #include <protocol/fc.h>
23 #include <protocol/ct.h>
30 #define FDMI_GRHL 0x0100
31 #define FDMI_GHAT 0x0101
32 #define FDMI_GRPL 0x0102
33 #define FDMI_GPAT 0x0110
34 #define FDMI_RHBA 0x0200
35 #define FDMI_RHAT 0x0201
36 #define FDMI_RPRT 0x0210
37 #define FDMI_RPA 0x0211
38 #define FDMI_DHBA 0x0300
39 #define FDMI_DPRT 0x0310
44 #define FDMI_NO_ADDITIONAL_EXP 0x00
45 #define FDMI_HBA_ALREADY_REG 0x10
46 #define FDMI_HBA_ATTRIB_NOT_REG 0x11
47 #define FDMI_HBA_ATTRIB_MULTIPLE 0x12
48 #define FDMI_HBA_ATTRIB_LENGTH_INVALID 0x13
49 #define FDMI_HBA_ATTRIB_NOT_PRESENT 0x14
50 #define FDMI_PORT_ORIG_NOT_IN_LIST 0x15
51 #define FDMI_PORT_HBA_NOT_IN_LIST 0x16
52 #define FDMI_PORT_ATTRIB_NOT_REG 0x20
53 #define FDMI_PORT_NOT_REG 0x21
54 #define FDMI_PORT_ATTRIB_MULTIPLE 0x22
55 #define FDMI_PORT_ATTRIB_LENGTH_INVALID 0x23
56 #define FDMI_PORT_ALREADY_REGISTEREED 0x24
59 * FDMI Transmission Speed Mask values
61 #define FDMI_TRANS_SPEED_1G 0x00000001
62 #define FDMI_TRANS_SPEED_2G 0x00000002
63 #define FDMI_TRANS_SPEED_10G 0x00000004
64 #define FDMI_TRANS_SPEED_4G 0x00000008
65 #define FDMI_TRANS_SPEED_8G 0x00000010
66 #define FDMI_TRANS_SPEED_16G 0x00000020
67 #define FDMI_TRANS_SPEED_UNKNOWN 0x00008000
70 * FDMI HBA attribute types
72 enum fdmi_hba_attribute_type
{
73 FDMI_HBA_ATTRIB_NODENAME
= 1, /* 0x0001 */
74 FDMI_HBA_ATTRIB_MANUFACTURER
, /* 0x0002 */
75 FDMI_HBA_ATTRIB_SERIALNUM
, /* 0x0003 */
76 FDMI_HBA_ATTRIB_MODEL
, /* 0x0004 */
77 FDMI_HBA_ATTRIB_MODEL_DESC
, /* 0x0005 */
78 FDMI_HBA_ATTRIB_HW_VERSION
, /* 0x0006 */
79 FDMI_HBA_ATTRIB_DRIVER_VERSION
, /* 0x0007 */
80 FDMI_HBA_ATTRIB_ROM_VERSION
, /* 0x0008 */
81 FDMI_HBA_ATTRIB_FW_VERSION
, /* 0x0009 */
82 FDMI_HBA_ATTRIB_OS_NAME
, /* 0x000A */
83 FDMI_HBA_ATTRIB_MAX_CT
, /* 0x000B */
85 FDMI_HBA_ATTRIB_MAX_TYPE
89 * FDMI Port attribute types
91 enum fdmi_port_attribute_type
{
92 FDMI_PORT_ATTRIB_FC4_TYPES
= 1, /* 0x0001 */
93 FDMI_PORT_ATTRIB_SUPP_SPEED
, /* 0x0002 */
94 FDMI_PORT_ATTRIB_PORT_SPEED
, /* 0x0003 */
95 FDMI_PORT_ATTRIB_FRAME_SIZE
, /* 0x0004 */
96 FDMI_PORT_ATTRIB_DEV_NAME
, /* 0x0005 */
97 FDMI_PORT_ATTRIB_HOST_NAME
, /* 0x0006 */
99 FDMI_PORT_ATTR_MAX_TYPE
112 * HBA Attribute Block
114 struct fdmi_hba_attr_s
{
115 u32 attr_count
; /* # of attributes */
116 struct fdmi_attr_s hba_attr
; /* n attributes */
120 * Registered Port List
122 struct fdmi_port_list_s
{
123 u32 num_ports
; /* number Of Port Entries */
124 wwn_t port_entry
; /* one or more */
128 * Port Attribute Block
130 struct fdmi_port_attr_s
{
131 u32 attr_count
; /* # of attributes */
132 struct fdmi_attr_s port_attr
; /* n attributes */
136 * FDMI Register HBA Attributes
139 wwn_t hba_id
; /* HBA Identifier */
140 struct fdmi_port_list_s port_list
; /* Registered Port List */
141 struct fdmi_hba_attr_s hba_attr_blk
; /* HBA attribute block */
148 wwn_t hba_id
; /* HBA Identifier */
149 wwn_t port_name
; /* Port wwn */
150 struct fdmi_port_attr_s port_attr_blk
; /* Port Attr Block */
154 * FDMI Register Port Attributes
157 wwn_t port_name
; /* port wwn */
158 struct fdmi_port_attr_s port_attr_blk
; /* Port Attr Block */