2 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
3 * Copyright (c) 2014- QLogic Corporation.
7 * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License (GPL) Version 2 as
11 * published by the Free Software Foundation
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
22 #include "bfa_defs_fcs.h"
24 /* Definitions of vendor unique structures and command codes passed in
25 * using FC_BSG_HST_VENDOR message code.
28 IOCMD_IOC_ENABLE
= 0x1,
33 IOCMD_IOC_GET_FWSTATS
,
34 IOCMD_IOC_RESET_STATS
,
35 IOCMD_IOC_RESET_FWSTATS
,
36 IOCMD_IOC_SET_ADAPTER_NAME
,
37 IOCMD_IOC_SET_PORT_NAME
,
45 IOCMD_PORT_RESET_STATS
,
49 IOCMD_PORT_CFG_MAXFRSZ
,
51 IOCMD_PORT_BBCR_ENABLE
,
52 IOCMD_PORT_BBCR_DISABLE
,
53 IOCMD_PORT_BBCR_GET_ATTR
,
55 IOCMD_LPORT_GET_RPORTS
,
56 IOCMD_LPORT_GET_STATS
,
57 IOCMD_LPORT_RESET_STATS
,
58 IOCMD_LPORT_GET_IOSTATS
,
61 IOCMD_RPORT_GET_STATS
,
62 IOCMD_RPORT_RESET_STATS
,
63 IOCMD_RPORT_SET_SPEED
,
65 IOCMD_VPORT_GET_STATS
,
66 IOCMD_VPORT_RESET_STATS
,
67 IOCMD_FABRIC_GET_LPORTS
,
69 IOCMD_RATELIM_DISABLE
,
70 IOCMD_RATELIM_DEF_SPEED
,
73 IOCMD_FCPIM_MODSTATSCLR
,
74 IOCMD_FCPIM_DEL_ITN_STATS
,
76 IOCMD_ITNIM_GET_IOSTATS
,
77 IOCMD_ITNIM_RESET_STATS
,
78 IOCMD_ITNIM_GET_ITNSTATS
,
85 IOCMD_ADAPTER_CFG_MODE
,
87 IOCMD_FLASH_ENABLE_OPTROM
,
88 IOCMD_FLASH_DISABLE_OPTROM
,
92 IOCMD_CEE_RESET_STATS
,
96 IOCMD_FLASH_ERASE_PART
,
97 IOCMD_FLASH_UPDATE_PART
,
98 IOCMD_FLASH_READ_PART
,
103 IOCMD_DIAG_QUEUETEST
,
106 IOCMD_DIAG_BEACON_LPORT
,
115 IOCMD_DEBUG_FW_STATE_CLR
,
116 IOCMD_DEBUG_PORTLOG_CLR
,
117 IOCMD_DEBUG_START_DTRC
,
118 IOCMD_DEBUG_STOP_DTRC
,
119 IOCMD_DEBUG_PORTLOG_CTL
,
120 IOCMD_FCPIM_PROFILE_ON
,
121 IOCMD_FCPIM_PROFILE_OFF
,
122 IOCMD_ITNIM_GET_IOPROFILE
,
123 IOCMD_FCPORT_GET_STATS
,
124 IOCMD_FCPORT_RESET_STATS
,
132 IOCMD_TRUNK_GET_ATTR
,
136 IOCMD_QOS_GET_VC_ATTR
,
138 IOCMD_QOS_RESET_STATS
,
140 IOCMD_VF_RESET_STATS
,
141 IOCMD_FCPIM_LUNMASK_ENABLE
,
142 IOCMD_FCPIM_LUNMASK_DISABLE
,
143 IOCMD_FCPIM_LUNMASK_CLEAR
,
144 IOCMD_FCPIM_LUNMASK_QUERY
,
145 IOCMD_FCPIM_LUNMASK_ADD
,
146 IOCMD_FCPIM_LUNMASK_DELETE
,
147 IOCMD_DIAG_DPORT_ENABLE
,
148 IOCMD_DIAG_DPORT_DISABLE
,
150 IOCMD_FCPIM_THROTTLE_QUERY
,
151 IOCMD_FCPIM_THROTTLE_SET
,
156 IOCMD_FRUVPD_GET_MAX_SIZE
,
157 IOCMD_DIAG_DPORT_SHOW
,
158 IOCMD_DIAG_DPORT_START
,
161 struct bfa_bsg_gen_s
{
167 struct bfa_bsg_portlogctl_s
{
175 struct bfa_bsg_fcpim_profile_s
{
181 struct bfa_bsg_itnim_ioprofile_s
{
187 struct bfa_itnim_ioprofile_s ioprofile
;
190 struct bfa_bsg_fcport_stats_s
{
194 union bfa_fcport_stats_u stats
;
197 struct bfa_bsg_ioc_name_s
{
201 char name
[BFA_ADAPTER_SYM_NAME_LEN
];
204 struct bfa_bsg_ioc_info_s
{
209 char hwpath
[BFA_STRING_32
];
210 char adapter_hwpath
[BFA_STRING_32
];
211 char guid
[BFA_ADAPTER_SYM_NAME_LEN
*2];
212 char name
[BFA_ADAPTER_SYM_NAME_LEN
];
213 char port_name
[BFA_ADAPTER_SYM_NAME_LEN
];
214 char eth_name
[BFA_ADAPTER_SYM_NAME_LEN
];
220 mac_t factory_mac
; /* Factory mac address */
221 mac_t current_mac
; /* Currently assigned mac address */
222 enum bfa_ioc_type_e ioc_type
;
223 u16 pvid
; /* Port vlan id */
226 u32 bandwidth
; /* For PF support */
230 struct bfa_bsg_ioc_attr_s
{
234 struct bfa_ioc_attr_s ioc_attr
;
237 struct bfa_bsg_ioc_stats_s
{
241 struct bfa_ioc_stats_s ioc_stats
;
244 struct bfa_bsg_ioc_fwstats_s
{
253 struct bfa_bsg_iocfc_attr_s
{
257 struct bfa_iocfc_attr_s iocfc_attr
;
260 struct bfa_bsg_iocfc_intr_s
{
264 struct bfa_iocfc_intr_attr_s attr
;
267 struct bfa_bsg_port_attr_s
{
271 struct bfa_port_attr_s attr
;
274 struct bfa_bsg_port_cfg_s
{
282 struct bfa_bsg_port_cfg_maxfrsize_s
{
288 struct bfa_bsg_port_stats_s
{
297 struct bfa_bsg_lport_attr_s
{
302 struct bfa_lport_attr_s port_attr
;
305 struct bfa_bsg_lport_stats_s
{
310 struct bfa_lport_stats_s port_stats
;
313 struct bfa_bsg_lport_iostats_s
{
318 struct bfa_itnim_iostats_s iostats
;
321 struct bfa_bsg_lport_get_rports_s
{
331 struct bfa_bsg_rport_attr_s
{
339 struct bfa_rport_attr_s attr
;
342 struct bfa_bsg_rport_stats_s
{
348 struct bfa_rport_stats_s stats
;
351 struct bfa_bsg_rport_scsi_addr_s
{
363 struct bfa_bsg_rport_reset_stats_s
{
371 struct bfa_bsg_rport_set_speed_s
{
375 enum bfa_port_speed speed
;
381 struct bfa_bsg_vport_attr_s
{
386 struct bfa_vport_attr_s vport_attr
;
389 struct bfa_bsg_vport_stats_s
{
394 struct bfa_vport_stats_s vport_stats
;
397 struct bfa_bsg_reset_stats_s
{
404 struct bfa_bsg_fabric_get_lports_s
{
413 struct bfa_bsg_trl_speed_s
{
417 enum bfa_port_speed speed
;
420 struct bfa_bsg_fcpim_s
{
426 struct bfa_bsg_fcpim_modstats_s
{
429 struct bfa_itnim_iostats_s modstats
;
432 struct bfa_bsg_fcpim_del_itn_stats_s
{
435 struct bfa_fcpim_del_itn_stats_s modstats
;
438 struct bfa_bsg_fcpim_modstatsclr_s
{
443 struct bfa_bsg_itnim_attr_s
{
449 struct bfa_itnim_attr_s attr
;
452 struct bfa_bsg_itnim_iostats_s
{
458 struct bfa_itnim_iostats_s iostats
;
461 struct bfa_bsg_itnim_itnstats_s
{
467 struct bfa_itnim_stats_s itnstats
;
470 struct bfa_bsg_pcifn_cfg_s
{
474 struct bfa_ablk_cfg_s pcifn_cfg
;
477 struct bfa_bsg_pcifn_s
{
484 enum bfi_pcifn_class pcifn_class
;
488 struct bfa_bsg_adapter_cfg_mode_s
{
492 struct bfa_adapter_cfg_mode_s cfg
;
495 struct bfa_bsg_port_cfg_mode_s
{
499 struct bfa_port_cfg_mode_s cfg
;
502 struct bfa_bsg_bbcr_enable_s
{
509 struct bfa_bsg_bbcr_attr_s
{
513 struct bfa_bbcr_attr_s attr
;
516 struct bfa_bsg_faa_attr_s
{
520 struct bfa_faa_attr_s faa_attr
;
523 struct bfa_bsg_cee_attr_s
{
532 struct bfa_bsg_cee_stats_s
{
541 struct bfa_bsg_sfp_media_s
{
545 enum bfa_defs_sfp_media_e media
;
548 struct bfa_bsg_sfp_speed_s
{
552 enum bfa_port_speed speed
;
555 struct bfa_bsg_flash_attr_s
{
559 struct bfa_flash_attr_s attr
;
562 struct bfa_bsg_flash_s
{
567 enum bfa_flash_part_type type
;
572 struct bfa_bsg_diag_get_temp_s
{
576 struct bfa_diag_results_tempsensor_s result
;
579 struct bfa_bsg_diag_memtest_s
{
584 struct bfa_diag_memtest_result result
;
585 struct bfa_diag_memtest_s memtest
;
588 struct bfa_bsg_diag_loopback_s
{
592 enum bfa_port_opmode opmode
;
593 enum bfa_port_speed speed
;
596 struct bfa_diag_loopback_result_s result
;
599 struct bfa_bsg_diag_dport_show_s
{
603 struct bfa_diag_dport_result_s result
;
606 struct bfa_bsg_dport_enable_s
{
614 struct bfa_bsg_diag_fwping_s
{
620 struct bfa_diag_results_fwping result
;
623 struct bfa_bsg_diag_qtest_s
{
629 struct bfa_diag_qtest_result_s result
;
632 struct bfa_bsg_sfp_show_s
{
636 struct sfp_mem_s sfp
;
639 struct bfa_bsg_diag_led_s
{
643 struct bfa_diag_ledtest_s ledtest
;
646 struct bfa_bsg_diag_beacon_s
{
650 bfa_boolean_t beacon
;
651 bfa_boolean_t link_e2e_beacon
;
655 struct bfa_bsg_diag_lb_stat_s
{
661 struct bfa_bsg_phy_attr_s
{
665 struct bfa_phy_attr_s attr
;
668 struct bfa_bsg_phy_s
{
676 struct bfa_bsg_debug_s
{
686 struct bfa_bsg_phy_stats_s
{
690 struct bfa_phy_stats_s stats
;
693 struct bfa_bsg_vhba_attr_s
{
697 struct bfa_vhba_attr_s attr
;
700 struct bfa_bsg_boot_s
{
704 struct bfa_boot_cfg_s cfg
;
707 struct bfa_bsg_preboot_s
{
711 struct bfa_boot_pbc_s cfg
;
714 struct bfa_bsg_ethboot_s
{
718 struct bfa_ethboot_cfg_s cfg
;
721 struct bfa_bsg_trunk_attr_s
{
725 struct bfa_trunk_attr_s attr
;
728 struct bfa_bsg_qos_attr_s
{
732 struct bfa_qos_attr_s attr
;
735 struct bfa_bsg_qos_vc_attr_s
{
739 struct bfa_qos_vc_attr_s attr
;
742 struct bfa_bsg_qos_bw_s
{
746 struct bfa_qos_bw_s qos_bw
;
749 struct bfa_bsg_vf_stats_s
{
753 struct bfa_vf_stats_s stats
;
756 struct bfa_bsg_vf_reset_stats_s
{
762 struct bfa_bsg_fcpim_lunmask_query_s
{
765 struct bfa_lunmask_cfg_s lun_mask
;
768 struct bfa_bsg_fcpim_lunmask_s
{
777 struct bfa_bsg_fcpim_throttle_s
{
781 struct bfa_defs_fcpim_throttle_s throttle
;
784 #define BFA_TFRU_DATA_SIZE 64
785 #define BFA_MAX_FRUVPD_TRANSFER_SIZE 0x1000
787 struct bfa_bsg_tfru_s
{
793 u8 data
[BFA_TFRU_DATA_SIZE
];
796 struct bfa_bsg_fruvpd_s
{
802 u8 data
[BFA_MAX_FRUVPD_TRANSFER_SIZE
];
807 struct bfa_bsg_fruvpd_max_size_s
{
814 struct bfa_bsg_fcpt_s
{
824 #define bfa_bsg_fcpt_t struct bfa_bsg_fcpt_s
827 struct bfa_bsg_data
{
833 #define bfad_chk_iocmd_sz(__payload_len, __hdrsz, __bufsz) \
834 (((__payload_len) != ((__hdrsz) + (__bufsz))) ? \
835 BFA_STATUS_FAILED : BFA_STATUS_OK)
837 #endif /* BFAD_BSG_H */