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
,
44 IOCMD_PORT_RESET_STATS
,
48 IOCMD_PORT_CFG_MAXFRSZ
,
50 IOCMD_PORT_BBCR_ENABLE
,
51 IOCMD_PORT_BBCR_DISABLE
,
52 IOCMD_PORT_BBCR_GET_ATTR
,
54 IOCMD_LPORT_GET_RPORTS
,
55 IOCMD_LPORT_GET_STATS
,
56 IOCMD_LPORT_RESET_STATS
,
57 IOCMD_LPORT_GET_IOSTATS
,
60 IOCMD_RPORT_GET_STATS
,
61 IOCMD_RPORT_RESET_STATS
,
62 IOCMD_RPORT_SET_SPEED
,
64 IOCMD_VPORT_GET_STATS
,
65 IOCMD_VPORT_RESET_STATS
,
66 IOCMD_FABRIC_GET_LPORTS
,
68 IOCMD_RATELIM_DISABLE
,
69 IOCMD_RATELIM_DEF_SPEED
,
72 IOCMD_FCPIM_MODSTATSCLR
,
73 IOCMD_FCPIM_DEL_ITN_STATS
,
75 IOCMD_ITNIM_GET_IOSTATS
,
76 IOCMD_ITNIM_RESET_STATS
,
77 IOCMD_ITNIM_GET_ITNSTATS
,
84 IOCMD_ADAPTER_CFG_MODE
,
86 IOCMD_FLASH_ENABLE_OPTROM
,
87 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
,
146 IOCMD_DIAG_DPORT_ENABLE
,
147 IOCMD_DIAG_DPORT_DISABLE
,
149 IOCMD_FCPIM_THROTTLE_QUERY
,
150 IOCMD_FCPIM_THROTTLE_SET
,
155 IOCMD_FRUVPD_GET_MAX_SIZE
,
156 IOCMD_DIAG_DPORT_SHOW
,
157 IOCMD_DIAG_DPORT_START
,
160 struct bfa_bsg_gen_s
{
166 struct bfa_bsg_portlogctl_s
{
174 struct bfa_bsg_fcpim_profile_s
{
180 struct bfa_bsg_itnim_ioprofile_s
{
186 struct bfa_itnim_ioprofile_s ioprofile
;
189 struct bfa_bsg_fcport_stats_s
{
193 union bfa_fcport_stats_u stats
;
196 struct bfa_bsg_ioc_name_s
{
200 char name
[BFA_ADAPTER_SYM_NAME_LEN
];
203 struct bfa_bsg_ioc_info_s
{
208 char hwpath
[BFA_STRING_32
];
209 char adapter_hwpath
[BFA_STRING_32
];
210 char guid
[BFA_ADAPTER_SYM_NAME_LEN
*2];
211 char name
[BFA_ADAPTER_SYM_NAME_LEN
];
212 char port_name
[BFA_ADAPTER_SYM_NAME_LEN
];
213 char eth_name
[BFA_ADAPTER_SYM_NAME_LEN
];
219 mac_t factory_mac
; /* Factory mac address */
220 mac_t current_mac
; /* Currently assigned mac address */
221 enum bfa_ioc_type_e ioc_type
;
222 u16 pvid
; /* Port vlan id */
225 u32 bandwidth
; /* For PF support */
229 struct bfa_bsg_ioc_attr_s
{
233 struct bfa_ioc_attr_s ioc_attr
;
236 struct bfa_bsg_ioc_stats_s
{
240 struct bfa_ioc_stats_s ioc_stats
;
243 struct bfa_bsg_ioc_fwstats_s
{
252 struct bfa_bsg_iocfc_attr_s
{
256 struct bfa_iocfc_attr_s iocfc_attr
;
259 struct bfa_bsg_iocfc_intr_s
{
263 struct bfa_iocfc_intr_attr_s attr
;
266 struct bfa_bsg_port_attr_s
{
270 struct bfa_port_attr_s attr
;
273 struct bfa_bsg_port_cfg_s
{
281 struct bfa_bsg_port_cfg_maxfrsize_s
{
287 struct bfa_bsg_port_stats_s
{
296 struct bfa_bsg_lport_attr_s
{
301 struct bfa_lport_attr_s port_attr
;
304 struct bfa_bsg_lport_stats_s
{
309 struct bfa_lport_stats_s port_stats
;
312 struct bfa_bsg_lport_iostats_s
{
317 struct bfa_itnim_iostats_s iostats
;
320 struct bfa_bsg_lport_get_rports_s
{
330 struct bfa_bsg_rport_attr_s
{
338 struct bfa_rport_attr_s attr
;
341 struct bfa_bsg_rport_stats_s
{
347 struct bfa_rport_stats_s stats
;
350 struct bfa_bsg_rport_scsi_addr_s
{
362 struct bfa_bsg_rport_reset_stats_s
{
370 struct bfa_bsg_rport_set_speed_s
{
374 enum bfa_port_speed speed
;
380 struct bfa_bsg_vport_attr_s
{
385 struct bfa_vport_attr_s vport_attr
;
388 struct bfa_bsg_vport_stats_s
{
393 struct bfa_vport_stats_s vport_stats
;
396 struct bfa_bsg_reset_stats_s
{
403 struct bfa_bsg_fabric_get_lports_s
{
412 struct bfa_bsg_trl_speed_s
{
416 enum bfa_port_speed speed
;
419 struct bfa_bsg_fcpim_s
{
425 struct bfa_bsg_fcpim_modstats_s
{
428 struct bfa_itnim_iostats_s modstats
;
431 struct bfa_bsg_fcpim_del_itn_stats_s
{
434 struct bfa_fcpim_del_itn_stats_s modstats
;
437 struct bfa_bsg_fcpim_modstatsclr_s
{
442 struct bfa_bsg_itnim_attr_s
{
448 struct bfa_itnim_attr_s attr
;
451 struct bfa_bsg_itnim_iostats_s
{
457 struct bfa_itnim_iostats_s iostats
;
460 struct bfa_bsg_itnim_itnstats_s
{
466 struct bfa_itnim_stats_s itnstats
;
469 struct bfa_bsg_pcifn_cfg_s
{
473 struct bfa_ablk_cfg_s pcifn_cfg
;
476 struct bfa_bsg_pcifn_s
{
483 enum bfi_pcifn_class pcifn_class
;
487 struct bfa_bsg_adapter_cfg_mode_s
{
491 struct bfa_adapter_cfg_mode_s cfg
;
494 struct bfa_bsg_port_cfg_mode_s
{
498 struct bfa_port_cfg_mode_s cfg
;
501 struct bfa_bsg_bbcr_enable_s
{
508 struct bfa_bsg_bbcr_attr_s
{
512 struct bfa_bbcr_attr_s attr
;
515 struct bfa_bsg_faa_attr_s
{
519 struct bfa_faa_attr_s faa_attr
;
522 struct bfa_bsg_cee_attr_s
{
531 struct bfa_bsg_cee_stats_s
{
540 struct bfa_bsg_sfp_media_s
{
544 enum bfa_defs_sfp_media_e media
;
547 struct bfa_bsg_sfp_speed_s
{
551 enum bfa_port_speed speed
;
554 struct bfa_bsg_flash_attr_s
{
558 struct bfa_flash_attr_s attr
;
561 struct bfa_bsg_flash_s
{
566 enum bfa_flash_part_type type
;
571 struct bfa_bsg_diag_get_temp_s
{
575 struct bfa_diag_results_tempsensor_s result
;
578 struct bfa_bsg_diag_memtest_s
{
583 struct bfa_diag_memtest_result result
;
584 struct bfa_diag_memtest_s memtest
;
587 struct bfa_bsg_diag_loopback_s
{
591 enum bfa_port_opmode opmode
;
592 enum bfa_port_speed speed
;
595 struct bfa_diag_loopback_result_s result
;
598 struct bfa_bsg_diag_dport_show_s
{
602 struct bfa_diag_dport_result_s result
;
605 struct bfa_bsg_dport_enable_s
{
613 struct bfa_bsg_diag_fwping_s
{
619 struct bfa_diag_results_fwping result
;
622 struct bfa_bsg_diag_qtest_s
{
628 struct bfa_diag_qtest_result_s result
;
631 struct bfa_bsg_sfp_show_s
{
635 struct sfp_mem_s sfp
;
638 struct bfa_bsg_diag_led_s
{
642 struct bfa_diag_ledtest_s ledtest
;
645 struct bfa_bsg_diag_beacon_s
{
649 bfa_boolean_t beacon
;
650 bfa_boolean_t link_e2e_beacon
;
654 struct bfa_bsg_diag_lb_stat_s
{
660 struct bfa_bsg_phy_attr_s
{
664 struct bfa_phy_attr_s attr
;
667 struct bfa_bsg_phy_s
{
675 struct bfa_bsg_debug_s
{
685 struct bfa_bsg_phy_stats_s
{
689 struct bfa_phy_stats_s stats
;
692 struct bfa_bsg_vhba_attr_s
{
696 struct bfa_vhba_attr_s attr
;
699 struct bfa_bsg_boot_s
{
703 struct bfa_boot_cfg_s cfg
;
706 struct bfa_bsg_preboot_s
{
710 struct bfa_boot_pbc_s cfg
;
713 struct bfa_bsg_ethboot_s
{
717 struct bfa_ethboot_cfg_s cfg
;
720 struct bfa_bsg_trunk_attr_s
{
724 struct bfa_trunk_attr_s attr
;
727 struct bfa_bsg_qos_attr_s
{
731 struct bfa_qos_attr_s attr
;
734 struct bfa_bsg_qos_vc_attr_s
{
738 struct bfa_qos_vc_attr_s attr
;
741 struct bfa_bsg_qos_bw_s
{
745 struct bfa_qos_bw_s qos_bw
;
748 struct bfa_bsg_vf_stats_s
{
752 struct bfa_vf_stats_s stats
;
755 struct bfa_bsg_vf_reset_stats_s
{
761 struct bfa_bsg_fcpim_lunmask_query_s
{
764 struct bfa_lunmask_cfg_s lun_mask
;
767 struct bfa_bsg_fcpim_lunmask_s
{
776 struct bfa_bsg_fcpim_throttle_s
{
780 struct bfa_defs_fcpim_throttle_s throttle
;
783 #define BFA_TFRU_DATA_SIZE 64
784 #define BFA_MAX_FRUVPD_TRANSFER_SIZE 0x1000
786 struct bfa_bsg_tfru_s
{
792 u8 data
[BFA_TFRU_DATA_SIZE
];
795 struct bfa_bsg_fruvpd_s
{
801 u8 data
[BFA_MAX_FRUVPD_TRANSFER_SIZE
];
806 struct bfa_bsg_fruvpd_max_size_s
{
813 struct bfa_bsg_fcpt_s
{
823 #define bfa_bsg_fcpt_t struct bfa_bsg_fcpt_s
826 struct bfa_bsg_data
{
832 #define bfad_chk_iocmd_sz(__payload_len, __hdrsz, __bufsz) \
833 (((__payload_len) != ((__hdrsz) + (__bufsz))) ? \
834 BFA_STATUS_FAILED : BFA_STATUS_OK)
836 #endif /* BFAD_BSG_H */