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,
89 IOCMD_CEE_RESET_STATS,
93 IOCMD_FLASH_ERASE_PART,
94 IOCMD_FLASH_UPDATE_PART,
95 IOCMD_FLASH_READ_PART,
100 IOCMD_DIAG_QUEUETEST,
103 IOCMD_DIAG_BEACON_LPORT,
112 IOCMD_DEBUG_FW_STATE_CLR,
113 IOCMD_DEBUG_PORTLOG_CLR,
114 IOCMD_DEBUG_START_DTRC,
115 IOCMD_DEBUG_STOP_DTRC,
116 IOCMD_DEBUG_PORTLOG_CTL,
117 IOCMD_FCPIM_PROFILE_ON,
118 IOCMD_FCPIM_PROFILE_OFF,
119 IOCMD_ITNIM_GET_IOPROFILE,
120 IOCMD_FCPORT_GET_STATS,
121 IOCMD_FCPORT_RESET_STATS,
129 IOCMD_TRUNK_GET_ATTR,
133 IOCMD_QOS_GET_VC_ATTR,
135 IOCMD_QOS_RESET_STATS,
137 IOCMD_VF_RESET_STATS,
138 IOCMD_FCPIM_LUNMASK_ENABLE,
139 IOCMD_FCPIM_LUNMASK_DISABLE,
140 IOCMD_FCPIM_LUNMASK_CLEAR,
141 IOCMD_FCPIM_LUNMASK_QUERY,
142 IOCMD_FCPIM_LUNMASK_ADD,
143 IOCMD_FCPIM_LUNMASK_DELETE,
144 IOCMD_DIAG_DPORT_ENABLE,
145 IOCMD_DIAG_DPORT_DISABLE,
146 IOCMD_DIAG_DPORT_GET_STATE,
148 IOCMD_FCPIM_THROTTLE_QUERY,
149 IOCMD_FCPIM_THROTTLE_SET,
154 IOCMD_FRUVPD_GET_MAX_SIZE,
157 struct bfa_bsg_gen_s {
163 struct bfa_bsg_portlogctl_s {
171 struct bfa_bsg_fcpim_profile_s {
177 struct bfa_bsg_itnim_ioprofile_s {
183 struct bfa_itnim_ioprofile_s ioprofile;
186 struct bfa_bsg_fcport_stats_s {
190 union bfa_fcport_stats_u stats;
193 struct bfa_bsg_ioc_name_s {
197 char name[BFA_ADAPTER_SYM_NAME_LEN];
200 struct bfa_bsg_ioc_info_s {
205 char hwpath[BFA_STRING_32];
206 char adapter_hwpath[BFA_STRING_32];
207 char guid[BFA_ADAPTER_SYM_NAME_LEN*2];
208 char name[BFA_ADAPTER_SYM_NAME_LEN];
209 char port_name[BFA_ADAPTER_SYM_NAME_LEN];
210 char eth_name[BFA_ADAPTER_SYM_NAME_LEN];
216 mac_t factory_mac; /* Factory mac address */
217 mac_t current_mac; /* Currently assigned mac address */
218 enum bfa_ioc_type_e ioc_type;
219 u16 pvid; /* Port vlan id */
222 u32 bandwidth; /* For PF support */
226 struct bfa_bsg_ioc_attr_s {
230 struct bfa_ioc_attr_s ioc_attr;
233 struct bfa_bsg_ioc_stats_s {
237 struct bfa_ioc_stats_s ioc_stats;
240 struct bfa_bsg_ioc_fwstats_s {
249 struct bfa_bsg_iocfc_attr_s {
253 struct bfa_iocfc_attr_s iocfc_attr;
256 struct bfa_bsg_iocfc_intr_s {
260 struct bfa_iocfc_intr_attr_s attr;
263 struct bfa_bsg_port_attr_s {
267 struct bfa_port_attr_s attr;
270 struct bfa_bsg_port_cfg_s {
278 struct bfa_bsg_port_cfg_maxfrsize_s {
284 struct bfa_bsg_port_stats_s {
293 struct bfa_bsg_lport_attr_s {
298 struct bfa_lport_attr_s port_attr;
301 struct bfa_bsg_lport_stats_s {
306 struct bfa_lport_stats_s port_stats;
309 struct bfa_bsg_lport_iostats_s {
314 struct bfa_itnim_iostats_s iostats;
317 struct bfa_bsg_lport_get_rports_s {
327 struct bfa_bsg_rport_attr_s {
335 struct bfa_rport_attr_s attr;
338 struct bfa_bsg_rport_stats_s {
344 struct bfa_rport_stats_s stats;
347 struct bfa_bsg_rport_scsi_addr_s {
359 struct bfa_bsg_rport_reset_stats_s {
367 struct bfa_bsg_rport_set_speed_s {
371 enum bfa_port_speed speed;
377 struct bfa_bsg_vport_attr_s {
382 struct bfa_vport_attr_s vport_attr;
385 struct bfa_bsg_vport_stats_s {
390 struct bfa_vport_stats_s vport_stats;
393 struct bfa_bsg_reset_stats_s {
400 struct bfa_bsg_fabric_get_lports_s {
409 struct bfa_bsg_trl_speed_s {
413 enum bfa_port_speed speed;
416 struct bfa_bsg_fcpim_s {
422 struct bfa_bsg_fcpim_modstats_s {
425 struct bfa_itnim_iostats_s modstats;
428 struct bfa_bsg_fcpim_del_itn_stats_s {
431 struct bfa_fcpim_del_itn_stats_s modstats;
434 struct bfa_bsg_fcpim_modstatsclr_s {
439 struct bfa_bsg_itnim_attr_s {
445 struct bfa_itnim_attr_s attr;
448 struct bfa_bsg_itnim_iostats_s {
454 struct bfa_itnim_iostats_s iostats;
457 struct bfa_bsg_itnim_itnstats_s {
463 struct bfa_itnim_stats_s itnstats;
466 struct bfa_bsg_pcifn_cfg_s {
470 struct bfa_ablk_cfg_s pcifn_cfg;
473 struct bfa_bsg_pcifn_s {
480 enum bfi_pcifn_class pcifn_class;
484 struct bfa_bsg_adapter_cfg_mode_s {
488 struct bfa_adapter_cfg_mode_s cfg;
491 struct bfa_bsg_port_cfg_mode_s {
495 struct bfa_port_cfg_mode_s cfg;
498 struct bfa_bsg_faa_attr_s {
502 struct bfa_faa_attr_s faa_attr;
505 struct bfa_bsg_cee_attr_s {
514 struct bfa_bsg_cee_stats_s {
523 struct bfa_bsg_sfp_media_s {
527 enum bfa_defs_sfp_media_e media;
530 struct bfa_bsg_sfp_speed_s {
534 enum bfa_port_speed speed;
537 struct bfa_bsg_flash_attr_s {
541 struct bfa_flash_attr_s attr;
544 struct bfa_bsg_flash_s {
549 enum bfa_flash_part_type type;
554 struct bfa_bsg_diag_get_temp_s {
558 struct bfa_diag_results_tempsensor_s result;
561 struct bfa_bsg_diag_memtest_s {
566 struct bfa_diag_memtest_result result;
567 struct bfa_diag_memtest_s memtest;
570 struct bfa_bsg_diag_loopback_s {
574 enum bfa_port_opmode opmode;
575 enum bfa_port_speed speed;
578 struct bfa_diag_loopback_result_s result;
581 struct bfa_bsg_diag_fwping_s {
587 struct bfa_diag_results_fwping result;
590 struct bfa_bsg_diag_qtest_s {
596 struct bfa_diag_qtest_result_s result;
599 struct bfa_bsg_sfp_show_s {
603 struct sfp_mem_s sfp;
606 struct bfa_bsg_diag_led_s {
610 struct bfa_diag_ledtest_s ledtest;
613 struct bfa_bsg_diag_beacon_s {
617 bfa_boolean_t beacon;
618 bfa_boolean_t link_e2e_beacon;
622 struct bfa_bsg_diag_lb_stat_s {
628 struct bfa_bsg_diag_dport_get_state_s {
632 enum bfa_dport_state state;
635 struct bfa_bsg_phy_attr_s {
639 struct bfa_phy_attr_s attr;
642 struct bfa_bsg_phy_s {
650 struct bfa_bsg_debug_s {
660 struct bfa_bsg_phy_stats_s {
664 struct bfa_phy_stats_s stats;
667 struct bfa_bsg_vhba_attr_s {
671 struct bfa_vhba_attr_s attr;
674 struct bfa_bsg_boot_s {
678 struct bfa_boot_cfg_s cfg;
681 struct bfa_bsg_preboot_s {
685 struct bfa_boot_pbc_s cfg;
688 struct bfa_bsg_ethboot_s {
692 struct bfa_ethboot_cfg_s cfg;
695 struct bfa_bsg_trunk_attr_s {
699 struct bfa_trunk_attr_s attr;
702 struct bfa_bsg_qos_attr_s {
706 struct bfa_qos_attr_s attr;
709 struct bfa_bsg_qos_vc_attr_s {
713 struct bfa_qos_vc_attr_s attr;
716 struct bfa_bsg_qos_bw_s {
720 struct bfa_qos_bw_s qos_bw;
723 struct bfa_bsg_vf_stats_s {
727 struct bfa_vf_stats_s stats;
730 struct bfa_bsg_vf_reset_stats_s {
736 struct bfa_bsg_fcpim_lunmask_query_s {
739 struct bfa_lunmask_cfg_s lun_mask;
742 struct bfa_bsg_fcpim_lunmask_s {
751 struct bfa_bsg_fcpim_throttle_s {
755 struct bfa_defs_fcpim_throttle_s throttle;
758 #define BFA_TFRU_DATA_SIZE 64
759 #define BFA_MAX_FRUVPD_TRANSFER_SIZE 0x1000
761 struct bfa_bsg_tfru_s {
767 u8 data[BFA_TFRU_DATA_SIZE];
770 struct bfa_bsg_fruvpd_s {
776 u8 data[BFA_MAX_FRUVPD_TRANSFER_SIZE];
779 struct bfa_bsg_fruvpd_max_size_s {
786 struct bfa_bsg_fcpt_s {
796 #define bfa_bsg_fcpt_t struct bfa_bsg_fcpt_s
798 struct bfa_bsg_data {
803 #define bfad_chk_iocmd_sz(__payload_len, __hdrsz, __bufsz) \
804 (((__payload_len) != ((__hdrsz) + (__bufsz))) ? \
805 BFA_STATUS_FAILED : BFA_STATUS_OK)
807 #endif /* BFAD_BSG_H */