2 * Copyright (c) 2005-2010 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 "bfa_defs_fcs.h"
23 /* Definitions of vendor unique structures and command codes passed in
24 * using FC_BSG_HST_VENDOR message code.
27 IOCMD_IOC_ENABLE
= 0x1,
32 IOCMD_IOC_GET_FWSTATS
,
33 IOCMD_IOC_RESET_STATS
,
34 IOCMD_IOC_RESET_FWSTATS
,
35 IOCMD_IOC_SET_ADAPTER_NAME
,
36 IOCMD_IOC_SET_PORT_NAME
,
43 IOCMD_PORT_RESET_STATS
,
47 IOCMD_PORT_CFG_MAXFRSZ
,
49 IOCMD_PORT_BBSC_ENABLE
,
50 IOCMD_PORT_BBSC_DISABLE
,
52 IOCMD_LPORT_GET_RPORTS
,
53 IOCMD_LPORT_GET_STATS
,
54 IOCMD_LPORT_RESET_STATS
,
55 IOCMD_LPORT_GET_IOSTATS
,
58 IOCMD_RPORT_GET_STATS
,
59 IOCMD_RPORT_RESET_STATS
,
60 IOCMD_RPORT_SET_SPEED
,
62 IOCMD_VPORT_GET_STATS
,
63 IOCMD_VPORT_RESET_STATS
,
64 IOCMD_FABRIC_GET_LPORTS
,
66 IOCMD_RATELIM_DISABLE
,
67 IOCMD_RATELIM_DEF_SPEED
,
70 IOCMD_FCPIM_MODSTATSCLR
,
71 IOCMD_FCPIM_DEL_ITN_STATS
,
73 IOCMD_ITNIM_GET_IOSTATS
,
74 IOCMD_ITNIM_RESET_STATS
,
75 IOCMD_ITNIM_GET_ITNSTATS
,
82 IOCMD_ADAPTER_CFG_MODE
,
84 IOCMD_FLASH_ENABLE_OPTROM
,
85 IOCMD_FLASH_DISABLE_OPTROM
,
91 IOCMD_CEE_RESET_STATS
,
95 IOCMD_FLASH_ERASE_PART
,
96 IOCMD_FLASH_UPDATE_PART
,
97 IOCMD_FLASH_READ_PART
,
102 IOCMD_DIAG_QUEUETEST
,
105 IOCMD_DIAG_BEACON_LPORT
,
114 IOCMD_DEBUG_FW_STATE_CLR
,
115 IOCMD_DEBUG_PORTLOG_CLR
,
116 IOCMD_DEBUG_START_DTRC
,
117 IOCMD_DEBUG_STOP_DTRC
,
118 IOCMD_DEBUG_PORTLOG_CTL
,
119 IOCMD_FCPIM_PROFILE_ON
,
120 IOCMD_FCPIM_PROFILE_OFF
,
121 IOCMD_ITNIM_GET_IOPROFILE
,
122 IOCMD_FCPORT_GET_STATS
,
123 IOCMD_FCPORT_RESET_STATS
,
131 IOCMD_TRUNK_GET_ATTR
,
135 IOCMD_QOS_GET_VC_ATTR
,
137 IOCMD_QOS_RESET_STATS
,
139 IOCMD_VF_RESET_STATS
,
140 IOCMD_FCPIM_LUNMASK_ENABLE
,
141 IOCMD_FCPIM_LUNMASK_DISABLE
,
142 IOCMD_FCPIM_LUNMASK_CLEAR
,
143 IOCMD_FCPIM_LUNMASK_QUERY
,
144 IOCMD_FCPIM_LUNMASK_ADD
,
145 IOCMD_FCPIM_LUNMASK_DELETE
,
148 struct bfa_bsg_gen_s
{
154 struct bfa_bsg_portlogctl_s
{
162 struct bfa_bsg_fcpim_profile_s
{
168 struct bfa_bsg_itnim_ioprofile_s
{
174 struct bfa_itnim_ioprofile_s ioprofile
;
177 struct bfa_bsg_fcport_stats_s
{
181 union bfa_fcport_stats_u stats
;
184 struct bfa_bsg_ioc_name_s
{
188 char name
[BFA_ADAPTER_SYM_NAME_LEN
];
191 struct bfa_bsg_ioc_info_s
{
196 char hwpath
[BFA_STRING_32
];
197 char adapter_hwpath
[BFA_STRING_32
];
198 char guid
[BFA_ADAPTER_SYM_NAME_LEN
*2];
199 char name
[BFA_ADAPTER_SYM_NAME_LEN
];
200 char port_name
[BFA_ADAPTER_SYM_NAME_LEN
];
201 char eth_name
[BFA_ADAPTER_SYM_NAME_LEN
];
207 mac_t factory_mac
; /* Factory mac address */
208 mac_t current_mac
; /* Currently assigned mac address */
209 enum bfa_ioc_type_e ioc_type
;
210 u16 pvid
; /* Port vlan id */
213 u32 bandwidth
; /* For PF support */
217 struct bfa_bsg_ioc_attr_s
{
221 struct bfa_ioc_attr_s ioc_attr
;
224 struct bfa_bsg_ioc_stats_s
{
228 struct bfa_ioc_stats_s ioc_stats
;
231 struct bfa_bsg_ioc_fwstats_s
{
240 struct bfa_bsg_iocfc_attr_s
{
244 struct bfa_iocfc_attr_s iocfc_attr
;
247 struct bfa_bsg_iocfc_intr_s
{
251 struct bfa_iocfc_intr_attr_s attr
;
254 struct bfa_bsg_port_attr_s
{
258 struct bfa_port_attr_s attr
;
261 struct bfa_bsg_port_cfg_s
{
269 struct bfa_bsg_port_cfg_maxfrsize_s
{
275 struct bfa_bsg_port_stats_s
{
284 struct bfa_bsg_lport_attr_s
{
289 struct bfa_lport_attr_s port_attr
;
292 struct bfa_bsg_lport_stats_s
{
297 struct bfa_lport_stats_s port_stats
;
300 struct bfa_bsg_lport_iostats_s
{
305 struct bfa_itnim_iostats_s iostats
;
308 struct bfa_bsg_lport_get_rports_s
{
318 struct bfa_bsg_rport_attr_s
{
324 struct bfa_rport_attr_s attr
;
327 struct bfa_bsg_rport_stats_s
{
333 struct bfa_rport_stats_s stats
;
336 struct bfa_bsg_rport_scsi_addr_s
{
348 struct bfa_bsg_rport_reset_stats_s
{
356 struct bfa_bsg_rport_set_speed_s
{
360 enum bfa_port_speed speed
;
366 struct bfa_bsg_vport_attr_s
{
371 struct bfa_vport_attr_s vport_attr
;
374 struct bfa_bsg_vport_stats_s
{
379 struct bfa_vport_stats_s vport_stats
;
382 struct bfa_bsg_reset_stats_s
{
389 struct bfa_bsg_fabric_get_lports_s
{
398 struct bfa_bsg_trl_speed_s
{
402 enum bfa_port_speed speed
;
405 struct bfa_bsg_fcpim_s
{
411 struct bfa_bsg_fcpim_modstats_s
{
414 struct bfa_itnim_iostats_s modstats
;
417 struct bfa_bsg_fcpim_del_itn_stats_s
{
420 struct bfa_fcpim_del_itn_stats_s modstats
;
423 struct bfa_bsg_fcpim_modstatsclr_s
{
428 struct bfa_bsg_itnim_attr_s
{
434 struct bfa_itnim_attr_s attr
;
437 struct bfa_bsg_itnim_iostats_s
{
443 struct bfa_itnim_iostats_s iostats
;
446 struct bfa_bsg_itnim_itnstats_s
{
452 struct bfa_itnim_stats_s itnstats
;
455 struct bfa_bsg_pcifn_cfg_s
{
459 struct bfa_ablk_cfg_s pcifn_cfg
;
462 struct bfa_bsg_pcifn_s
{
468 enum bfi_pcifn_class pcifn_class
;
472 struct bfa_bsg_adapter_cfg_mode_s
{
476 struct bfa_adapter_cfg_mode_s cfg
;
479 struct bfa_bsg_port_cfg_mode_s
{
483 struct bfa_port_cfg_mode_s cfg
;
486 struct bfa_bsg_faa_attr_s
{
490 struct bfa_faa_attr_s faa_attr
;
493 struct bfa_bsg_cee_attr_s
{
502 struct bfa_bsg_cee_stats_s
{
511 struct bfa_bsg_sfp_media_s
{
515 enum bfa_defs_sfp_media_e media
;
518 struct bfa_bsg_sfp_speed_s
{
522 enum bfa_port_speed speed
;
525 struct bfa_bsg_flash_attr_s
{
529 struct bfa_flash_attr_s attr
;
532 struct bfa_bsg_flash_s
{
537 enum bfa_flash_part_type type
;
542 struct bfa_bsg_diag_get_temp_s
{
546 struct bfa_diag_results_tempsensor_s result
;
549 struct bfa_bsg_diag_memtest_s
{
554 struct bfa_diag_memtest_result result
;
555 struct bfa_diag_memtest_s memtest
;
558 struct bfa_bsg_diag_loopback_s
{
562 enum bfa_port_opmode opmode
;
563 enum bfa_port_speed speed
;
566 struct bfa_diag_loopback_result_s result
;
569 struct bfa_bsg_diag_fwping_s
{
575 struct bfa_diag_results_fwping result
;
578 struct bfa_bsg_diag_qtest_s
{
584 struct bfa_diag_qtest_result_s result
;
587 struct bfa_bsg_sfp_show_s
{
591 struct sfp_mem_s sfp
;
594 struct bfa_bsg_diag_led_s
{
598 struct bfa_diag_ledtest_s ledtest
;
601 struct bfa_bsg_diag_beacon_s
{
605 bfa_boolean_t beacon
;
606 bfa_boolean_t link_e2e_beacon
;
610 struct bfa_bsg_diag_lb_stat_s
{
616 struct bfa_bsg_phy_attr_s
{
620 struct bfa_phy_attr_s attr
;
623 struct bfa_bsg_phy_s
{
631 struct bfa_bsg_debug_s
{
641 struct bfa_bsg_phy_stats_s
{
645 struct bfa_phy_stats_s stats
;
648 struct bfa_bsg_vhba_attr_s
{
652 struct bfa_vhba_attr_s attr
;
655 struct bfa_bsg_boot_s
{
659 struct bfa_boot_cfg_s cfg
;
662 struct bfa_bsg_preboot_s
{
666 struct bfa_boot_pbc_s cfg
;
669 struct bfa_bsg_ethboot_s
{
673 struct bfa_ethboot_cfg_s cfg
;
676 struct bfa_bsg_trunk_attr_s
{
680 struct bfa_trunk_attr_s attr
;
683 struct bfa_bsg_qos_attr_s
{
687 struct bfa_qos_attr_s attr
;
690 struct bfa_bsg_qos_vc_attr_s
{
694 struct bfa_qos_vc_attr_s attr
;
697 struct bfa_bsg_vf_stats_s
{
701 struct bfa_vf_stats_s stats
;
704 struct bfa_bsg_vf_reset_stats_s
{
710 struct bfa_bsg_fcpim_lunmask_query_s
{
713 struct bfa_lunmask_cfg_s lun_mask
;
716 struct bfa_bsg_fcpim_lunmask_s
{
725 struct bfa_bsg_fcpt_s
{
735 #define bfa_bsg_fcpt_t struct bfa_bsg_fcpt_s
737 struct bfa_bsg_data
{
742 #define bfad_chk_iocmd_sz(__payload_len, __hdrsz, __bufsz) \
743 (((__payload_len) != ((__hdrsz) + (__bufsz))) ? \
744 BFA_STATUS_FAILED : BFA_STATUS_OK)
746 #endif /* BFAD_BSG_H */