1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
4 * Copyright (c) 2014- QLogic Corporation.
8 * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
14 #include "bfa_defs_fcs.h"
16 /* Definitions of vendor unique structures and command codes passed in
17 * using FC_BSG_HST_VENDOR message code.
20 IOCMD_IOC_ENABLE
= 0x1,
25 IOCMD_IOC_GET_FWSTATS
,
26 IOCMD_IOC_RESET_STATS
,
27 IOCMD_IOC_RESET_FWSTATS
,
28 IOCMD_IOC_SET_ADAPTER_NAME
,
29 IOCMD_IOC_SET_PORT_NAME
,
37 IOCMD_PORT_RESET_STATS
,
41 IOCMD_PORT_CFG_MAXFRSZ
,
43 IOCMD_PORT_BBCR_ENABLE
,
44 IOCMD_PORT_BBCR_DISABLE
,
45 IOCMD_PORT_BBCR_GET_ATTR
,
47 IOCMD_LPORT_GET_RPORTS
,
48 IOCMD_LPORT_GET_STATS
,
49 IOCMD_LPORT_RESET_STATS
,
50 IOCMD_LPORT_GET_IOSTATS
,
53 IOCMD_RPORT_GET_STATS
,
54 IOCMD_RPORT_RESET_STATS
,
55 IOCMD_RPORT_SET_SPEED
,
57 IOCMD_VPORT_GET_STATS
,
58 IOCMD_VPORT_RESET_STATS
,
59 IOCMD_FABRIC_GET_LPORTS
,
61 IOCMD_RATELIM_DISABLE
,
62 IOCMD_RATELIM_DEF_SPEED
,
65 IOCMD_FCPIM_MODSTATSCLR
,
66 IOCMD_FCPIM_DEL_ITN_STATS
,
68 IOCMD_ITNIM_GET_IOSTATS
,
69 IOCMD_ITNIM_RESET_STATS
,
70 IOCMD_ITNIM_GET_ITNSTATS
,
77 IOCMD_ADAPTER_CFG_MODE
,
79 IOCMD_FLASH_ENABLE_OPTROM
,
80 IOCMD_FLASH_DISABLE_OPTROM
,
84 IOCMD_CEE_RESET_STATS
,
88 IOCMD_FLASH_ERASE_PART
,
89 IOCMD_FLASH_UPDATE_PART
,
90 IOCMD_FLASH_READ_PART
,
98 IOCMD_DIAG_BEACON_LPORT
,
107 IOCMD_DEBUG_FW_STATE_CLR
,
108 IOCMD_DEBUG_PORTLOG_CLR
,
109 IOCMD_DEBUG_START_DTRC
,
110 IOCMD_DEBUG_STOP_DTRC
,
111 IOCMD_DEBUG_PORTLOG_CTL
,
112 IOCMD_FCPIM_PROFILE_ON
,
113 IOCMD_FCPIM_PROFILE_OFF
,
114 IOCMD_ITNIM_GET_IOPROFILE
,
115 IOCMD_FCPORT_GET_STATS
,
116 IOCMD_FCPORT_RESET_STATS
,
124 IOCMD_TRUNK_GET_ATTR
,
128 IOCMD_QOS_GET_VC_ATTR
,
130 IOCMD_QOS_RESET_STATS
,
132 IOCMD_VF_RESET_STATS
,
133 IOCMD_FCPIM_LUNMASK_ENABLE
,
134 IOCMD_FCPIM_LUNMASK_DISABLE
,
135 IOCMD_FCPIM_LUNMASK_CLEAR
,
136 IOCMD_FCPIM_LUNMASK_QUERY
,
137 IOCMD_FCPIM_LUNMASK_ADD
,
138 IOCMD_FCPIM_LUNMASK_DELETE
,
139 IOCMD_DIAG_DPORT_ENABLE
,
140 IOCMD_DIAG_DPORT_DISABLE
,
142 IOCMD_FCPIM_THROTTLE_QUERY
,
143 IOCMD_FCPIM_THROTTLE_SET
,
148 IOCMD_FRUVPD_GET_MAX_SIZE
,
149 IOCMD_DIAG_DPORT_SHOW
,
150 IOCMD_DIAG_DPORT_START
,
153 struct bfa_bsg_gen_s
{
159 struct bfa_bsg_portlogctl_s
{
167 struct bfa_bsg_fcpim_profile_s
{
173 struct bfa_bsg_itnim_ioprofile_s
{
179 struct bfa_itnim_ioprofile_s ioprofile
;
182 struct bfa_bsg_fcport_stats_s
{
186 union bfa_fcport_stats_u stats
;
189 struct bfa_bsg_ioc_name_s
{
193 char name
[BFA_ADAPTER_SYM_NAME_LEN
];
196 struct bfa_bsg_ioc_info_s
{
201 char hwpath
[BFA_STRING_32
];
202 char adapter_hwpath
[BFA_STRING_32
];
203 char guid
[BFA_ADAPTER_SYM_NAME_LEN
*2];
204 char name
[BFA_ADAPTER_SYM_NAME_LEN
];
205 char port_name
[BFA_ADAPTER_SYM_NAME_LEN
];
206 char eth_name
[BFA_ADAPTER_SYM_NAME_LEN
];
212 mac_t factory_mac
; /* Factory mac address */
213 mac_t current_mac
; /* Currently assigned mac address */
214 enum bfa_ioc_type_e ioc_type
;
215 u16 pvid
; /* Port vlan id */
218 u32 bandwidth
; /* For PF support */
222 struct bfa_bsg_ioc_attr_s
{
226 struct bfa_ioc_attr_s ioc_attr
;
229 struct bfa_bsg_ioc_stats_s
{
233 struct bfa_ioc_stats_s ioc_stats
;
236 struct bfa_bsg_ioc_fwstats_s
{
245 struct bfa_bsg_iocfc_attr_s
{
249 struct bfa_iocfc_attr_s iocfc_attr
;
252 struct bfa_bsg_iocfc_intr_s
{
256 struct bfa_iocfc_intr_attr_s attr
;
259 struct bfa_bsg_port_attr_s
{
263 struct bfa_port_attr_s attr
;
266 struct bfa_bsg_port_cfg_s
{
274 struct bfa_bsg_port_cfg_maxfrsize_s
{
280 struct bfa_bsg_port_stats_s
{
289 struct bfa_bsg_lport_attr_s
{
294 struct bfa_lport_attr_s port_attr
;
297 struct bfa_bsg_lport_stats_s
{
302 struct bfa_lport_stats_s port_stats
;
305 struct bfa_bsg_lport_iostats_s
{
310 struct bfa_itnim_iostats_s iostats
;
313 struct bfa_bsg_lport_get_rports_s
{
323 struct bfa_bsg_rport_attr_s
{
331 struct bfa_rport_attr_s attr
;
334 struct bfa_bsg_rport_stats_s
{
340 struct bfa_rport_stats_s stats
;
343 struct bfa_bsg_rport_scsi_addr_s
{
355 struct bfa_bsg_rport_reset_stats_s
{
363 struct bfa_bsg_rport_set_speed_s
{
367 enum bfa_port_speed speed
;
373 struct bfa_bsg_vport_attr_s
{
378 struct bfa_vport_attr_s vport_attr
;
381 struct bfa_bsg_vport_stats_s
{
386 struct bfa_vport_stats_s vport_stats
;
389 struct bfa_bsg_reset_stats_s
{
396 struct bfa_bsg_fabric_get_lports_s
{
405 struct bfa_bsg_trl_speed_s
{
409 enum bfa_port_speed speed
;
412 struct bfa_bsg_fcpim_s
{
418 struct bfa_bsg_fcpim_modstats_s
{
421 struct bfa_itnim_iostats_s modstats
;
424 struct bfa_bsg_fcpim_del_itn_stats_s
{
427 struct bfa_fcpim_del_itn_stats_s modstats
;
430 struct bfa_bsg_fcpim_modstatsclr_s
{
435 struct bfa_bsg_itnim_attr_s
{
441 struct bfa_itnim_attr_s attr
;
444 struct bfa_bsg_itnim_iostats_s
{
450 struct bfa_itnim_iostats_s iostats
;
453 struct bfa_bsg_itnim_itnstats_s
{
459 struct bfa_itnim_stats_s itnstats
;
462 struct bfa_bsg_pcifn_cfg_s
{
466 struct bfa_ablk_cfg_s pcifn_cfg
;
469 struct bfa_bsg_pcifn_s
{
476 enum bfi_pcifn_class pcifn_class
;
480 struct bfa_bsg_adapter_cfg_mode_s
{
484 struct bfa_adapter_cfg_mode_s cfg
;
487 struct bfa_bsg_port_cfg_mode_s
{
491 struct bfa_port_cfg_mode_s cfg
;
494 struct bfa_bsg_bbcr_enable_s
{
501 struct bfa_bsg_bbcr_attr_s
{
505 struct bfa_bbcr_attr_s attr
;
508 struct bfa_bsg_faa_attr_s
{
512 struct bfa_faa_attr_s faa_attr
;
515 struct bfa_bsg_cee_attr_s
{
524 struct bfa_bsg_cee_stats_s
{
533 struct bfa_bsg_sfp_media_s
{
537 enum bfa_defs_sfp_media_e media
;
540 struct bfa_bsg_sfp_speed_s
{
544 enum bfa_port_speed speed
;
547 struct bfa_bsg_flash_attr_s
{
551 struct bfa_flash_attr_s attr
;
554 struct bfa_bsg_flash_s
{
559 enum bfa_flash_part_type type
;
564 struct bfa_bsg_diag_get_temp_s
{
568 struct bfa_diag_results_tempsensor_s result
;
571 struct bfa_bsg_diag_memtest_s
{
576 struct bfa_diag_memtest_result result
;
577 struct bfa_diag_memtest_s memtest
;
580 struct bfa_bsg_diag_loopback_s
{
584 enum bfa_port_opmode opmode
;
585 enum bfa_port_speed speed
;
588 struct bfa_diag_loopback_result_s result
;
591 struct bfa_bsg_diag_dport_show_s
{
595 struct bfa_diag_dport_result_s result
;
598 struct bfa_bsg_dport_enable_s
{
606 struct bfa_bsg_diag_fwping_s
{
612 struct bfa_diag_results_fwping result
;
615 struct bfa_bsg_diag_qtest_s
{
621 struct bfa_diag_qtest_result_s result
;
624 struct bfa_bsg_sfp_show_s
{
628 struct sfp_mem_s sfp
;
631 struct bfa_bsg_diag_led_s
{
635 struct bfa_diag_ledtest_s ledtest
;
638 struct bfa_bsg_diag_beacon_s
{
642 bfa_boolean_t beacon
;
643 bfa_boolean_t link_e2e_beacon
;
647 struct bfa_bsg_diag_lb_stat_s
{
653 struct bfa_bsg_phy_attr_s
{
657 struct bfa_phy_attr_s attr
;
660 struct bfa_bsg_phy_s
{
668 struct bfa_bsg_debug_s
{
678 struct bfa_bsg_phy_stats_s
{
682 struct bfa_phy_stats_s stats
;
685 struct bfa_bsg_vhba_attr_s
{
689 struct bfa_vhba_attr_s attr
;
692 struct bfa_bsg_boot_s
{
696 struct bfa_boot_cfg_s cfg
;
699 struct bfa_bsg_preboot_s
{
703 struct bfa_boot_pbc_s cfg
;
706 struct bfa_bsg_ethboot_s
{
710 struct bfa_ethboot_cfg_s cfg
;
713 struct bfa_bsg_trunk_attr_s
{
717 struct bfa_trunk_attr_s attr
;
720 struct bfa_bsg_qos_attr_s
{
724 struct bfa_qos_attr_s attr
;
727 struct bfa_bsg_qos_vc_attr_s
{
731 struct bfa_qos_vc_attr_s attr
;
734 struct bfa_bsg_qos_bw_s
{
738 struct bfa_qos_bw_s qos_bw
;
741 struct bfa_bsg_vf_stats_s
{
745 struct bfa_vf_stats_s stats
;
748 struct bfa_bsg_vf_reset_stats_s
{
754 struct bfa_bsg_fcpim_lunmask_query_s
{
757 struct bfa_lunmask_cfg_s lun_mask
;
760 struct bfa_bsg_fcpim_lunmask_s
{
769 struct bfa_bsg_fcpim_throttle_s
{
773 struct bfa_defs_fcpim_throttle_s throttle
;
776 #define BFA_TFRU_DATA_SIZE 64
777 #define BFA_MAX_FRUVPD_TRANSFER_SIZE 0x1000
779 struct bfa_bsg_tfru_s
{
785 u8 data
[BFA_TFRU_DATA_SIZE
];
788 struct bfa_bsg_fruvpd_s
{
794 u8 data
[BFA_MAX_FRUVPD_TRANSFER_SIZE
];
799 struct bfa_bsg_fruvpd_max_size_s
{
806 struct bfa_bsg_fcpt_s
{
816 #define bfa_bsg_fcpt_t struct bfa_bsg_fcpt_s
819 struct bfa_bsg_data
{
825 #define bfad_chk_iocmd_sz(__payload_len, __hdrsz, __bufsz) \
826 (((__payload_len) != ((__hdrsz) + (__bufsz))) ? \
827 BFA_STATUS_FAILED : BFA_STATUS_OK)
829 #endif /* BFAD_BSG_H */