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_BBCR_ENABLE
,
50 IOCMD_PORT_BBCR_DISABLE
,
51 IOCMD_PORT_BBCR_GET_ATTR
,
53 IOCMD_LPORT_GET_RPORTS
,
54 IOCMD_LPORT_GET_STATS
,
55 IOCMD_LPORT_RESET_STATS
,
56 IOCMD_LPORT_GET_IOSTATS
,
59 IOCMD_RPORT_GET_STATS
,
60 IOCMD_RPORT_RESET_STATS
,
61 IOCMD_RPORT_SET_SPEED
,
63 IOCMD_VPORT_GET_STATS
,
64 IOCMD_VPORT_RESET_STATS
,
65 IOCMD_FABRIC_GET_LPORTS
,
67 IOCMD_RATELIM_DISABLE
,
68 IOCMD_RATELIM_DEF_SPEED
,
71 IOCMD_FCPIM_MODSTATSCLR
,
72 IOCMD_FCPIM_DEL_ITN_STATS
,
74 IOCMD_ITNIM_GET_IOSTATS
,
75 IOCMD_ITNIM_RESET_STATS
,
76 IOCMD_ITNIM_GET_ITNSTATS
,
83 IOCMD_ADAPTER_CFG_MODE
,
85 IOCMD_FLASH_ENABLE_OPTROM
,
86 IOCMD_FLASH_DISABLE_OPTROM
,
90 IOCMD_CEE_RESET_STATS
,
94 IOCMD_FLASH_ERASE_PART
,
95 IOCMD_FLASH_UPDATE_PART
,
96 IOCMD_FLASH_READ_PART
,
101 IOCMD_DIAG_QUEUETEST
,
104 IOCMD_DIAG_BEACON_LPORT
,
113 IOCMD_DEBUG_FW_STATE_CLR
,
114 IOCMD_DEBUG_PORTLOG_CLR
,
115 IOCMD_DEBUG_START_DTRC
,
116 IOCMD_DEBUG_STOP_DTRC
,
117 IOCMD_DEBUG_PORTLOG_CTL
,
118 IOCMD_FCPIM_PROFILE_ON
,
119 IOCMD_FCPIM_PROFILE_OFF
,
120 IOCMD_ITNIM_GET_IOPROFILE
,
121 IOCMD_FCPORT_GET_STATS
,
122 IOCMD_FCPORT_RESET_STATS
,
130 IOCMD_TRUNK_GET_ATTR
,
134 IOCMD_QOS_GET_VC_ATTR
,
136 IOCMD_QOS_RESET_STATS
,
138 IOCMD_VF_RESET_STATS
,
139 IOCMD_FCPIM_LUNMASK_ENABLE
,
140 IOCMD_FCPIM_LUNMASK_DISABLE
,
141 IOCMD_FCPIM_LUNMASK_CLEAR
,
142 IOCMD_FCPIM_LUNMASK_QUERY
,
143 IOCMD_FCPIM_LUNMASK_ADD
,
144 IOCMD_FCPIM_LUNMASK_DELETE
,
145 IOCMD_DIAG_DPORT_ENABLE
,
146 IOCMD_DIAG_DPORT_DISABLE
,
148 IOCMD_FCPIM_THROTTLE_QUERY
,
149 IOCMD_FCPIM_THROTTLE_SET
,
154 IOCMD_FRUVPD_GET_MAX_SIZE
,
155 IOCMD_DIAG_DPORT_SHOW
,
156 IOCMD_DIAG_DPORT_START
,
159 struct bfa_bsg_gen_s
{
165 struct bfa_bsg_portlogctl_s
{
173 struct bfa_bsg_fcpim_profile_s
{
179 struct bfa_bsg_itnim_ioprofile_s
{
185 struct bfa_itnim_ioprofile_s ioprofile
;
188 struct bfa_bsg_fcport_stats_s
{
192 union bfa_fcport_stats_u stats
;
195 struct bfa_bsg_ioc_name_s
{
199 char name
[BFA_ADAPTER_SYM_NAME_LEN
];
202 struct bfa_bsg_ioc_info_s
{
207 char hwpath
[BFA_STRING_32
];
208 char adapter_hwpath
[BFA_STRING_32
];
209 char guid
[BFA_ADAPTER_SYM_NAME_LEN
*2];
210 char name
[BFA_ADAPTER_SYM_NAME_LEN
];
211 char port_name
[BFA_ADAPTER_SYM_NAME_LEN
];
212 char eth_name
[BFA_ADAPTER_SYM_NAME_LEN
];
218 mac_t factory_mac
; /* Factory mac address */
219 mac_t current_mac
; /* Currently assigned mac address */
220 enum bfa_ioc_type_e ioc_type
;
221 u16 pvid
; /* Port vlan id */
224 u32 bandwidth
; /* For PF support */
228 struct bfa_bsg_ioc_attr_s
{
232 struct bfa_ioc_attr_s ioc_attr
;
235 struct bfa_bsg_ioc_stats_s
{
239 struct bfa_ioc_stats_s ioc_stats
;
242 struct bfa_bsg_ioc_fwstats_s
{
251 struct bfa_bsg_iocfc_attr_s
{
255 struct bfa_iocfc_attr_s iocfc_attr
;
258 struct bfa_bsg_iocfc_intr_s
{
262 struct bfa_iocfc_intr_attr_s attr
;
265 struct bfa_bsg_port_attr_s
{
269 struct bfa_port_attr_s attr
;
272 struct bfa_bsg_port_cfg_s
{
280 struct bfa_bsg_port_cfg_maxfrsize_s
{
286 struct bfa_bsg_port_stats_s
{
295 struct bfa_bsg_lport_attr_s
{
300 struct bfa_lport_attr_s port_attr
;
303 struct bfa_bsg_lport_stats_s
{
308 struct bfa_lport_stats_s port_stats
;
311 struct bfa_bsg_lport_iostats_s
{
316 struct bfa_itnim_iostats_s iostats
;
319 struct bfa_bsg_lport_get_rports_s
{
329 struct bfa_bsg_rport_attr_s
{
337 struct bfa_rport_attr_s attr
;
340 struct bfa_bsg_rport_stats_s
{
346 struct bfa_rport_stats_s stats
;
349 struct bfa_bsg_rport_scsi_addr_s
{
361 struct bfa_bsg_rport_reset_stats_s
{
369 struct bfa_bsg_rport_set_speed_s
{
373 enum bfa_port_speed speed
;
379 struct bfa_bsg_vport_attr_s
{
384 struct bfa_vport_attr_s vport_attr
;
387 struct bfa_bsg_vport_stats_s
{
392 struct bfa_vport_stats_s vport_stats
;
395 struct bfa_bsg_reset_stats_s
{
402 struct bfa_bsg_fabric_get_lports_s
{
411 struct bfa_bsg_trl_speed_s
{
415 enum bfa_port_speed speed
;
418 struct bfa_bsg_fcpim_s
{
424 struct bfa_bsg_fcpim_modstats_s
{
427 struct bfa_itnim_iostats_s modstats
;
430 struct bfa_bsg_fcpim_del_itn_stats_s
{
433 struct bfa_fcpim_del_itn_stats_s modstats
;
436 struct bfa_bsg_fcpim_modstatsclr_s
{
441 struct bfa_bsg_itnim_attr_s
{
447 struct bfa_itnim_attr_s attr
;
450 struct bfa_bsg_itnim_iostats_s
{
456 struct bfa_itnim_iostats_s iostats
;
459 struct bfa_bsg_itnim_itnstats_s
{
465 struct bfa_itnim_stats_s itnstats
;
468 struct bfa_bsg_pcifn_cfg_s
{
472 struct bfa_ablk_cfg_s pcifn_cfg
;
475 struct bfa_bsg_pcifn_s
{
482 enum bfi_pcifn_class pcifn_class
;
486 struct bfa_bsg_adapter_cfg_mode_s
{
490 struct bfa_adapter_cfg_mode_s cfg
;
493 struct bfa_bsg_port_cfg_mode_s
{
497 struct bfa_port_cfg_mode_s cfg
;
500 struct bfa_bsg_bbcr_enable_s
{
507 struct bfa_bsg_bbcr_attr_s
{
511 struct bfa_bbcr_attr_s attr
;
514 struct bfa_bsg_faa_attr_s
{
518 struct bfa_faa_attr_s faa_attr
;
521 struct bfa_bsg_cee_attr_s
{
530 struct bfa_bsg_cee_stats_s
{
539 struct bfa_bsg_sfp_media_s
{
543 enum bfa_defs_sfp_media_e media
;
546 struct bfa_bsg_sfp_speed_s
{
550 enum bfa_port_speed speed
;
553 struct bfa_bsg_flash_attr_s
{
557 struct bfa_flash_attr_s attr
;
560 struct bfa_bsg_flash_s
{
565 enum bfa_flash_part_type type
;
570 struct bfa_bsg_diag_get_temp_s
{
574 struct bfa_diag_results_tempsensor_s result
;
577 struct bfa_bsg_diag_memtest_s
{
582 struct bfa_diag_memtest_result result
;
583 struct bfa_diag_memtest_s memtest
;
586 struct bfa_bsg_diag_loopback_s
{
590 enum bfa_port_opmode opmode
;
591 enum bfa_port_speed speed
;
594 struct bfa_diag_loopback_result_s result
;
597 struct bfa_bsg_diag_dport_show_s
{
601 struct bfa_diag_dport_result_s result
;
604 struct bfa_bsg_dport_enable_s
{
612 struct bfa_bsg_diag_fwping_s
{
618 struct bfa_diag_results_fwping result
;
621 struct bfa_bsg_diag_qtest_s
{
627 struct bfa_diag_qtest_result_s result
;
630 struct bfa_bsg_sfp_show_s
{
634 struct sfp_mem_s sfp
;
637 struct bfa_bsg_diag_led_s
{
641 struct bfa_diag_ledtest_s ledtest
;
644 struct bfa_bsg_diag_beacon_s
{
648 bfa_boolean_t beacon
;
649 bfa_boolean_t link_e2e_beacon
;
653 struct bfa_bsg_diag_lb_stat_s
{
659 struct bfa_bsg_phy_attr_s
{
663 struct bfa_phy_attr_s attr
;
666 struct bfa_bsg_phy_s
{
674 struct bfa_bsg_debug_s
{
684 struct bfa_bsg_phy_stats_s
{
688 struct bfa_phy_stats_s stats
;
691 struct bfa_bsg_vhba_attr_s
{
695 struct bfa_vhba_attr_s attr
;
698 struct bfa_bsg_boot_s
{
702 struct bfa_boot_cfg_s cfg
;
705 struct bfa_bsg_preboot_s
{
709 struct bfa_boot_pbc_s cfg
;
712 struct bfa_bsg_ethboot_s
{
716 struct bfa_ethboot_cfg_s cfg
;
719 struct bfa_bsg_trunk_attr_s
{
723 struct bfa_trunk_attr_s attr
;
726 struct bfa_bsg_qos_attr_s
{
730 struct bfa_qos_attr_s attr
;
733 struct bfa_bsg_qos_vc_attr_s
{
737 struct bfa_qos_vc_attr_s attr
;
740 struct bfa_bsg_qos_bw_s
{
744 struct bfa_qos_bw_s qos_bw
;
747 struct bfa_bsg_vf_stats_s
{
751 struct bfa_vf_stats_s stats
;
754 struct bfa_bsg_vf_reset_stats_s
{
760 struct bfa_bsg_fcpim_lunmask_query_s
{
763 struct bfa_lunmask_cfg_s lun_mask
;
766 struct bfa_bsg_fcpim_lunmask_s
{
775 struct bfa_bsg_fcpim_throttle_s
{
779 struct bfa_defs_fcpim_throttle_s throttle
;
782 #define BFA_TFRU_DATA_SIZE 64
783 #define BFA_MAX_FRUVPD_TRANSFER_SIZE 0x1000
785 struct bfa_bsg_tfru_s
{
791 u8 data
[BFA_TFRU_DATA_SIZE
];
794 struct bfa_bsg_fruvpd_s
{
800 u8 data
[BFA_MAX_FRUVPD_TRANSFER_SIZE
];
805 struct bfa_bsg_fruvpd_max_size_s
{
812 struct bfa_bsg_fcpt_s
{
822 #define bfa_bsg_fcpt_t struct bfa_bsg_fcpt_s
825 struct bfa_bsg_data
{
831 #define bfad_chk_iocmd_sz(__payload_len, __hdrsz, __bufsz) \
832 (((__payload_len) != ((__hdrsz) + (__bufsz))) ? \
833 BFA_STATUS_FAILED : BFA_STATUS_OK)
835 #endif /* BFAD_BSG_H */