Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2005-2010 Brocade Communications Systems, Inc. |
| 3 | * All rights reserved |
| 4 | * www.brocade.com |
| 5 | * |
| 6 | * Linux driver for Brocade Fibre Channel Host Bus Adapter. |
| 7 | * |
| 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 |
| 11 | * |
| 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. |
| 16 | */ |
| 17 | #ifndef BFAD_BSG_H |
| 18 | #define BFAD_BSG_H |
| 19 | |
| 20 | #include "bfa_defs.h" |
| 21 | #include "bfa_defs_fcs.h" |
| 22 | |
| 23 | /* Definitions of vendor unique structures and command codes passed in |
| 24 | * using FC_BSG_HST_VENDOR message code. |
| 25 | */ |
| 26 | enum { |
Krishna Gudipati | 6013806 | 2011-06-24 20:25:15 -0700 | [diff] [blame] | 27 | IOCMD_IOC_ENABLE = 0x1, |
| 28 | IOCMD_IOC_DISABLE, |
| 29 | IOCMD_IOC_GET_ATTR, |
Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 30 | IOCMD_IOC_GET_INFO, |
Krishna Gudipati | 6013806 | 2011-06-24 20:25:15 -0700 | [diff] [blame] | 31 | IOCMD_IOC_GET_STATS, |
| 32 | IOCMD_IOC_GET_FWSTATS, |
| 33 | IOCMD_IOCFC_GET_ATTR, |
| 34 | IOCMD_IOCFC_SET_INTR, |
| 35 | IOCMD_PORT_ENABLE, |
| 36 | IOCMD_PORT_DISABLE, |
Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 37 | IOCMD_PORT_GET_ATTR, |
Krishna Gudipati | 6013806 | 2011-06-24 20:25:15 -0700 | [diff] [blame] | 38 | IOCMD_PORT_GET_STATS, |
Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 39 | IOCMD_LPORT_GET_ATTR, |
Krishna Gudipati | 6013806 | 2011-06-24 20:25:15 -0700 | [diff] [blame] | 40 | IOCMD_LPORT_GET_RPORTS, |
| 41 | IOCMD_LPORT_GET_STATS, |
| 42 | IOCMD_LPORT_GET_IOSTATS, |
| 43 | IOCMD_RPORT_GET_ATTR, |
Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 44 | IOCMD_RPORT_GET_ADDR, |
Krishna Gudipati | 6013806 | 2011-06-24 20:25:15 -0700 | [diff] [blame] | 45 | IOCMD_RPORT_GET_STATS, |
Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 46 | IOCMD_FABRIC_GET_LPORTS, |
Krishna Gudipati | 6013806 | 2011-06-24 20:25:15 -0700 | [diff] [blame] | 47 | IOCMD_FCPIM_MODSTATS, |
| 48 | IOCMD_FCPIM_DEL_ITN_STATS, |
Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 49 | IOCMD_ITNIM_GET_ATTR, |
Krishna Gudipati | 6013806 | 2011-06-24 20:25:15 -0700 | [diff] [blame] | 50 | IOCMD_ITNIM_GET_IOSTATS, |
| 51 | IOCMD_ITNIM_GET_ITNSTATS, |
Krishna Gudipati | 1a4d8e1 | 2011-06-24 20:22:28 -0700 | [diff] [blame] | 52 | IOCMD_IOC_PCIFN_CFG, |
Krishna Gudipati | 6013806 | 2011-06-24 20:25:15 -0700 | [diff] [blame] | 53 | IOCMD_FCPORT_ENABLE, |
| 54 | IOCMD_FCPORT_DISABLE, |
Krishna Gudipati | 1a4d8e1 | 2011-06-24 20:22:28 -0700 | [diff] [blame] | 55 | IOCMD_PCIFN_CREATE, |
| 56 | IOCMD_PCIFN_DELETE, |
| 57 | IOCMD_PCIFN_BW, |
| 58 | IOCMD_ADAPTER_CFG_MODE, |
| 59 | IOCMD_PORT_CFG_MODE, |
| 60 | IOCMD_FLASH_ENABLE_OPTROM, |
| 61 | IOCMD_FLASH_DISABLE_OPTROM, |
Krishna Gudipati | a714134 | 2011-06-24 20:23:19 -0700 | [diff] [blame] | 62 | IOCMD_FAA_ENABLE, |
| 63 | IOCMD_FAA_DISABLE, |
| 64 | IOCMD_FAA_QUERY, |
Krishna Gudipati | 148d610 | 2011-06-24 20:25:36 -0700 | [diff] [blame^] | 65 | IOCMD_CEE_GET_ATTR, |
| 66 | IOCMD_CEE_GET_STATS, |
| 67 | IOCMD_CEE_RESET_STATS, |
Krishna Gudipati | 1a4d8e1 | 2011-06-24 20:22:28 -0700 | [diff] [blame] | 68 | }; |
| 69 | |
| 70 | struct bfa_bsg_gen_s { |
| 71 | bfa_status_t status; |
| 72 | u16 bfad_num; |
| 73 | u16 rsvd; |
Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 74 | }; |
| 75 | |
| 76 | struct bfa_bsg_ioc_info_s { |
| 77 | bfa_status_t status; |
| 78 | u16 bfad_num; |
| 79 | u16 rsvd; |
| 80 | char serialnum[64]; |
| 81 | char hwpath[BFA_STRING_32]; |
| 82 | char adapter_hwpath[BFA_STRING_32]; |
| 83 | char guid[BFA_ADAPTER_SYM_NAME_LEN*2]; |
| 84 | char name[BFA_ADAPTER_SYM_NAME_LEN]; |
| 85 | char port_name[BFA_ADAPTER_SYM_NAME_LEN]; |
| 86 | char eth_name[BFA_ADAPTER_SYM_NAME_LEN]; |
| 87 | wwn_t pwwn; |
| 88 | wwn_t nwwn; |
| 89 | wwn_t factorypwwn; |
| 90 | wwn_t factorynwwn; |
| 91 | mac_t mac; |
| 92 | mac_t factory_mac; /* Factory mac address */ |
| 93 | mac_t current_mac; /* Currently assigned mac address */ |
| 94 | enum bfa_ioc_type_e ioc_type; |
| 95 | u16 pvid; /* Port vlan id */ |
| 96 | u16 rsvd1; |
| 97 | u32 host; |
| 98 | u32 bandwidth; /* For PF support */ |
| 99 | u32 rsvd2; |
| 100 | }; |
| 101 | |
| 102 | struct bfa_bsg_ioc_attr_s { |
| 103 | bfa_status_t status; |
| 104 | u16 bfad_num; |
| 105 | u16 rsvd; |
| 106 | struct bfa_ioc_attr_s ioc_attr; |
| 107 | }; |
| 108 | |
Krishna Gudipati | 6013806 | 2011-06-24 20:25:15 -0700 | [diff] [blame] | 109 | struct bfa_bsg_ioc_stats_s { |
| 110 | bfa_status_t status; |
| 111 | u16 bfad_num; |
| 112 | u16 rsvd; |
| 113 | struct bfa_ioc_stats_s ioc_stats; |
| 114 | }; |
| 115 | |
| 116 | struct bfa_bsg_ioc_fwstats_s { |
| 117 | bfa_status_t status; |
| 118 | u16 bfad_num; |
| 119 | u16 rsvd; |
| 120 | u32 buf_size; |
| 121 | u32 rsvd1; |
| 122 | u64 buf_ptr; |
| 123 | }; |
| 124 | |
| 125 | struct bfa_bsg_iocfc_attr_s { |
| 126 | bfa_status_t status; |
| 127 | u16 bfad_num; |
| 128 | u16 rsvd; |
| 129 | struct bfa_iocfc_attr_s iocfc_attr; |
| 130 | }; |
| 131 | |
| 132 | struct bfa_bsg_iocfc_intr_s { |
| 133 | bfa_status_t status; |
| 134 | u16 bfad_num; |
| 135 | u16 rsvd; |
| 136 | struct bfa_iocfc_intr_attr_s attr; |
| 137 | }; |
| 138 | |
Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 139 | struct bfa_bsg_port_attr_s { |
| 140 | bfa_status_t status; |
| 141 | u16 bfad_num; |
| 142 | u16 rsvd; |
| 143 | struct bfa_port_attr_s attr; |
| 144 | }; |
| 145 | |
Krishna Gudipati | 6013806 | 2011-06-24 20:25:15 -0700 | [diff] [blame] | 146 | struct bfa_bsg_port_stats_s { |
| 147 | bfa_status_t status; |
| 148 | u16 bfad_num; |
| 149 | u16 rsvd; |
| 150 | u32 buf_size; |
| 151 | u32 rsvd1; |
| 152 | u64 buf_ptr; |
| 153 | }; |
| 154 | |
Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 155 | struct bfa_bsg_lport_attr_s { |
| 156 | bfa_status_t status; |
| 157 | u16 bfad_num; |
| 158 | u16 vf_id; |
| 159 | wwn_t pwwn; |
| 160 | struct bfa_lport_attr_s port_attr; |
| 161 | }; |
| 162 | |
Krishna Gudipati | 6013806 | 2011-06-24 20:25:15 -0700 | [diff] [blame] | 163 | struct bfa_bsg_lport_stats_s { |
| 164 | bfa_status_t status; |
| 165 | u16 bfad_num; |
| 166 | u16 vf_id; |
| 167 | wwn_t pwwn; |
| 168 | struct bfa_lport_stats_s port_stats; |
| 169 | }; |
| 170 | |
| 171 | struct bfa_bsg_lport_iostats_s { |
| 172 | bfa_status_t status; |
| 173 | u16 bfad_num; |
| 174 | u16 vf_id; |
| 175 | wwn_t pwwn; |
| 176 | struct bfa_itnim_iostats_s iostats; |
| 177 | }; |
| 178 | |
| 179 | struct bfa_bsg_lport_get_rports_s { |
| 180 | bfa_status_t status; |
| 181 | u16 bfad_num; |
| 182 | u16 vf_id; |
| 183 | wwn_t pwwn; |
| 184 | u64 rbuf_ptr; |
| 185 | u32 nrports; |
| 186 | u32 rsvd; |
| 187 | }; |
| 188 | |
| 189 | struct bfa_bsg_rport_attr_s { |
| 190 | bfa_status_t status; |
| 191 | u16 bfad_num; |
| 192 | u16 vf_id; |
| 193 | wwn_t pwwn; |
| 194 | wwn_t rpwwn; |
| 195 | struct bfa_rport_attr_s attr; |
| 196 | }; |
| 197 | |
| 198 | struct bfa_bsg_rport_stats_s { |
| 199 | bfa_status_t status; |
| 200 | u16 bfad_num; |
| 201 | u16 vf_id; |
| 202 | wwn_t pwwn; |
| 203 | wwn_t rpwwn; |
| 204 | struct bfa_rport_stats_s stats; |
| 205 | }; |
| 206 | |
Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 207 | struct bfa_bsg_rport_scsi_addr_s { |
| 208 | bfa_status_t status; |
| 209 | u16 bfad_num; |
| 210 | u16 vf_id; |
| 211 | wwn_t pwwn; |
| 212 | wwn_t rpwwn; |
| 213 | u32 host; |
| 214 | u32 bus; |
| 215 | u32 target; |
| 216 | u32 lun; |
| 217 | }; |
| 218 | |
| 219 | struct bfa_bsg_fabric_get_lports_s { |
| 220 | bfa_status_t status; |
| 221 | u16 bfad_num; |
| 222 | u16 vf_id; |
| 223 | u64 buf_ptr; |
| 224 | u32 nports; |
| 225 | u32 rsvd; |
| 226 | }; |
| 227 | |
Krishna Gudipati | 6013806 | 2011-06-24 20:25:15 -0700 | [diff] [blame] | 228 | struct bfa_bsg_fcpim_modstats_s { |
| 229 | bfa_status_t status; |
| 230 | u16 bfad_num; |
| 231 | struct bfa_itnim_iostats_s modstats; |
| 232 | }; |
| 233 | |
| 234 | struct bfa_bsg_fcpim_del_itn_stats_s { |
| 235 | bfa_status_t status; |
| 236 | u16 bfad_num; |
| 237 | struct bfa_fcpim_del_itn_stats_s modstats; |
| 238 | }; |
| 239 | |
Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 240 | struct bfa_bsg_itnim_attr_s { |
| 241 | bfa_status_t status; |
| 242 | u16 bfad_num; |
| 243 | u16 vf_id; |
| 244 | wwn_t lpwwn; |
| 245 | wwn_t rpwwn; |
| 246 | struct bfa_itnim_attr_s attr; |
| 247 | }; |
| 248 | |
Krishna Gudipati | 6013806 | 2011-06-24 20:25:15 -0700 | [diff] [blame] | 249 | struct bfa_bsg_itnim_iostats_s { |
| 250 | bfa_status_t status; |
| 251 | u16 bfad_num; |
| 252 | u16 vf_id; |
| 253 | wwn_t lpwwn; |
| 254 | wwn_t rpwwn; |
| 255 | struct bfa_itnim_iostats_s iostats; |
| 256 | }; |
| 257 | |
| 258 | struct bfa_bsg_itnim_itnstats_s { |
| 259 | bfa_status_t status; |
| 260 | u16 bfad_num; |
| 261 | u16 vf_id; |
| 262 | wwn_t lpwwn; |
| 263 | wwn_t rpwwn; |
| 264 | struct bfa_itnim_stats_s itnstats; |
| 265 | }; |
| 266 | |
Krishna Gudipati | 1a4d8e1 | 2011-06-24 20:22:28 -0700 | [diff] [blame] | 267 | struct bfa_bsg_pcifn_cfg_s { |
| 268 | bfa_status_t status; |
| 269 | u16 bfad_num; |
| 270 | u16 rsvd; |
| 271 | struct bfa_ablk_cfg_s pcifn_cfg; |
| 272 | }; |
| 273 | |
| 274 | struct bfa_bsg_pcifn_s { |
| 275 | bfa_status_t status; |
| 276 | u16 bfad_num; |
| 277 | u16 pcifn_id; |
| 278 | u32 bandwidth; |
| 279 | u8 port; |
| 280 | enum bfi_pcifn_class pcifn_class; |
| 281 | u8 rsvd[1]; |
| 282 | }; |
| 283 | |
| 284 | struct bfa_bsg_adapter_cfg_mode_s { |
| 285 | bfa_status_t status; |
| 286 | u16 bfad_num; |
| 287 | u16 rsvd; |
| 288 | struct bfa_adapter_cfg_mode_s cfg; |
| 289 | }; |
| 290 | |
| 291 | struct bfa_bsg_port_cfg_mode_s { |
| 292 | bfa_status_t status; |
| 293 | u16 bfad_num; |
| 294 | u16 instance; |
| 295 | struct bfa_port_cfg_mode_s cfg; |
| 296 | }; |
| 297 | |
Krishna Gudipati | a714134 | 2011-06-24 20:23:19 -0700 | [diff] [blame] | 298 | struct bfa_bsg_faa_attr_s { |
| 299 | bfa_status_t status; |
| 300 | u16 bfad_num; |
| 301 | u16 rsvd; |
| 302 | struct bfa_faa_attr_s faa_attr; |
| 303 | }; |
| 304 | |
Krishna Gudipati | 148d610 | 2011-06-24 20:25:36 -0700 | [diff] [blame^] | 305 | struct bfa_bsg_cee_attr_s { |
| 306 | bfa_status_t status; |
| 307 | u16 bfad_num; |
| 308 | u16 rsvd; |
| 309 | u32 buf_size; |
| 310 | u32 rsvd1; |
| 311 | u64 buf_ptr; |
| 312 | }; |
| 313 | |
| 314 | struct bfa_bsg_cee_stats_s { |
| 315 | bfa_status_t status; |
| 316 | u16 bfad_num; |
| 317 | u16 rsvd; |
| 318 | u32 buf_size; |
| 319 | u32 rsvd1; |
| 320 | u64 buf_ptr; |
| 321 | }; |
| 322 | |
Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 323 | struct bfa_bsg_fcpt_s { |
| 324 | bfa_status_t status; |
| 325 | u16 vf_id; |
| 326 | wwn_t lpwwn; |
| 327 | wwn_t dpwwn; |
| 328 | u32 tsecs; |
| 329 | int cts; |
| 330 | enum fc_cos cos; |
| 331 | struct fchs_s fchs; |
| 332 | }; |
| 333 | #define bfa_bsg_fcpt_t struct bfa_bsg_fcpt_s |
| 334 | |
| 335 | struct bfa_bsg_data { |
| 336 | int payload_len; |
| 337 | void *payload; |
| 338 | }; |
| 339 | |
| 340 | #define bfad_chk_iocmd_sz(__payload_len, __hdrsz, __bufsz) \ |
| 341 | (((__payload_len) != ((__hdrsz) + (__bufsz))) ? \ |
| 342 | BFA_STATUS_FAILED : BFA_STATUS_OK) |
| 343 | |
| 344 | #endif /* BFAD_BSG_H */ |