1 /* linux/drivers/scsi/esas2r/atioctl.h
4 * Copyright (c) 2001-2013 ATTO Technology, Inc.
5 * (mailto:linuxdrivers@attotech.com)
7 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
19 * THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
20 * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
21 * LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
22 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
23 * solely responsible for determining the appropriateness of using and
24 * distributing the Program and assumes all risks associated with its
25 * exercise of rights under this Agreement, including but not limited to
26 * the risks and costs of program errors, damage to or loss of data,
27 * programs or equipment, and unavailability or interruption of operations.
29 * DISCLAIMER OF LIABILITY
30 * NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
31 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
33 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
34 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
35 * USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
36 * HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
38 * You should have received a copy of the GNU General Public License
39 * along with this program; if not, write to the Free Software
40 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
42 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
49 #define EXPRESS_IOCTL_SIGNATURE "Express"
50 #define EXPRESS_IOCTL_SIGNATURE_SIZE 8
52 /* structure definitions for IOCTls */
54 struct __packed atto_express_ioctl_header
{
55 u8 signature
[EXPRESS_IOCTL_SIGNATURE_SIZE
];
58 #define IOCTL_SUCCESS 0
59 #define IOCTL_ERR_INVCMD 101
60 #define IOCTL_INIT_FAILED 102
61 #define IOCTL_NOT_IMPLEMENTED 103
62 #define IOCTL_BAD_CHANNEL 104
63 #define IOCTL_TARGET_OVERRUN 105
64 #define IOCTL_TARGET_NOT_ENABLED 106
65 #define IOCTL_BAD_FLASH_IMGTYPE 107
66 #define IOCTL_OUT_OF_RESOURCES 108
67 #define IOCTL_GENERAL_ERROR 109
68 #define IOCTL_INVALID_PARAM 110
76 * NOTE - if channel == 0xFF, the request is
77 * handled on the adapter it came in on.
79 #define MAX_NODE_NAMES 256
81 struct __packed atto_firmware_rw_request
{
83 #define FUNC_FW_DOWNLOAD 0x09
84 #define FUNC_FW_UPLOAD 0x12
87 #define FW_IMG_FW 0x01
88 #define FW_IMG_BIOS 0x02
89 #define FW_IMG_NVR 0x03
90 #define FW_IMG_RAW 0x04
91 #define FW_IMG_FM_API 0x05
92 #define FW_IMG_FS_API 0x06
100 struct __packed atto_param_rw_request
{
102 char data_buffer
[512];
105 #define MAX_CHANNEL 256
107 struct __packed atto_channel_list
{
109 u8 channel
[MAX_CHANNEL
];
112 struct __packed atto_channel_info
{
132 #define CSMI_CC_GET_DRVR_INFO 1
133 #define CSMI_CC_GET_CNTLR_CFG 2
134 #define CSMI_CC_GET_CNTLR_STS 3
135 #define CSMI_CC_FW_DOWNLOAD 4
138 #define CSMI_CC_GET_RAID_INFO 10
139 #define CSMI_CC_GET_RAID_CFG 11
142 #define CSMI_CC_GET_PHY_INFO 20
143 #define CSMI_CC_SET_PHY_INFO 21
144 #define CSMI_CC_GET_LINK_ERRORS 22
145 #define CSMI_CC_SMP_PASSTHRU 23
146 #define CSMI_CC_SSP_PASSTHRU 24
147 #define CSMI_CC_STP_PASSTHRU 25
148 #define CSMI_CC_GET_SATA_SIG 26
149 #define CSMI_CC_GET_SCSI_ADDR 27
150 #define CSMI_CC_GET_DEV_ADDR 28
151 #define CSMI_CC_TASK_MGT 29
152 #define CSMI_CC_GET_CONN_INFO 30
155 #define CSMI_CC_PHY_CTRL 60
161 #define CSMI_STS_SUCCESS 0
162 #define CSMI_STS_FAILED 1
163 #define CSMI_STS_BAD_CTRL_CODE 2
164 #define CSMI_STS_INV_PARAM 3
165 #define CSMI_STS_WRITE_ATTEMPTED 4
168 #define CSMI_STS_INV_RAID_SET 1000
171 #define CSMI_STS_PHY_CHANGED CSMI_STS_SUCCESS
172 #define CSMI_STS_PHY_UNCHANGEABLE 2000
173 #define CSMI_STS_INV_LINK_RATE 2001
174 #define CSMI_STS_INV_PHY 2002
175 #define CSMI_STS_INV_PHY_FOR_PORT 2003
176 #define CSMI_STS_PHY_UNSELECTABLE 2004
177 #define CSMI_STS_SELECT_PHY_OR_PORT 2005
178 #define CSMI_STS_INV_PORT 2006
179 #define CSMI_STS_PORT_UNSELECTABLE 2007
180 #define CSMI_STS_CONNECTION_FAILED 2008
181 #define CSMI_STS_NO_SATA_DEV 2009
182 #define CSMI_STS_NO_SATA_SIGNATURE 2010
183 #define CSMI_STS_SCSI_EMULATION 2011
184 #define CSMI_STS_NOT_AN_END_DEV 2012
185 #define CSMI_STS_NO_SCSI_ADDR 2013
186 #define CSMI_STS_NO_DEV_ADDR 2014
188 /* CSMI class independent structures */
189 struct atto_csmi_get_driver_info
{
191 char description
[81];
198 #define CSMI_MAJOR_REV_0_81 0
199 #define CSMI_MINOR_REV_0_81 81
201 #define CSMI_MAJOR_REV CSMI_MAJOR_REV_0_81
202 #define CSMI_MINOR_REV CSMI_MINOR_REV_0_81
205 struct atto_csmi_get_pci_bus_addr
{
212 struct atto_csmi_get_cntlr_cfg
{
222 #define CSMI_SLOT_NUM_UNKNOWN 0xFFFF
225 #define CSMI_CNTLR_CLASS_HBA 5
228 #define CSMI_BUS_TYPE_PCI 3
229 #define CSMI_BUS_TYPE_PCMCIA 4
232 struct atto_csmi_get_pci_bus_addr pci_addr
;
244 u16 bios_release_rev
;
246 #define CSMI_CNTLRF_SAS_HBA 0x00000001
247 #define CSMI_CNTLRF_SAS_RAID 0x00000002
248 #define CSMI_CNTLRF_SATA_HBA 0x00000004
249 #define CSMI_CNTLRF_SATA_RAID 0x00000008
250 #define CSMI_CNTLRF_FWD_SUPPORT 0x00010000
251 #define CSMI_CNTLRF_FWD_ONLINE 0x00020000
252 #define CSMI_CNTLRF_FWD_SRESET 0x00040000
253 #define CSMI_CNTLRF_FWD_HRESET 0x00080000
254 #define CSMI_CNTLRF_FWD_RROM 0x00100000
259 u16 rrom_release_rev
;
260 u16 rrom_biosmajor_rev
;
261 u16 rrom_biosminor_rev
;
262 u16 rrom_biosbuild_rev
;
263 u16 rrom_biosrelease_rev
;
267 struct atto_csmi_get_cntlr_sts
{
269 #define CSMI_CNTLR_STS_GOOD 1
270 #define CSMI_CNTLR_STS_FAILED 2
271 #define CSMI_CNTLR_STS_OFFLINE 3
272 #define CSMI_CNTLR_STS_POWEROFF 4
275 #define CSMI_OFFLINE_NO_REASON 0
276 #define CSMI_OFFLINE_INITIALIZING 1
277 #define CSMI_OFFLINE_BUS_DEGRADED 2
278 #define CSMI_OFFLINE_BUS_FAILURE 3
283 struct atto_csmi_fw_download
{
286 #define CSMI_FWDF_VALIDATE 0x00000001
287 #define CSMI_FWDF_SOFT_RESET 0x00000002
288 #define CSMI_FWDF_HARD_RESET 0x00000004
292 #define CSMI_FWD_STS_SUCCESS 0
293 #define CSMI_FWD_STS_FAILED 1
294 #define CSMI_FWD_STS_USING_RROM 2
295 #define CSMI_FWD_STS_REJECT 3
296 #define CSMI_FWD_STS_DOWNREV 4
299 #define CSMI_FWD_SEV_INFO 0
300 #define CSMI_FWD_SEV_WARNING 1
301 #define CSMI_FWD_SEV_ERROR 2
302 #define CSMI_FWD_SEV_FATAL 3
306 /* CSMI RAID class structures */
307 struct atto_csmi_get_raid_info
{
309 u32 max_drivesper_set
;
313 struct atto_csmi_raid_drives
{
320 #define CSMI_DRV_STS_OK 0
321 #define CSMI_DRV_STS_REBUILDING 1
322 #define CSMI_DRV_STS_FAILED 2
323 #define CSMI_DRV_STS_DEGRADED 3
326 #define CSMI_DRV_USE_NOT_USED 0
327 #define CSMI_DRV_USE_MEMBER 1
328 #define CSMI_DRV_USE_SPARE 2
330 u8 reserved
[30]; /* spec says 22 */
333 struct atto_csmi_get_raid_cfg
{
343 struct atto_csmi_raid_drives drives
[1];
346 /* CSMI HBA class structures */
347 struct atto_csmi_phy_entity
{
348 u8 ident_frame
[0x1C];
355 #define CSMI_DISC_NOT_SUPPORTED 0x00
356 #define CSMI_DISC_NOT_STARTED 0x01
357 #define CSMI_DISC_IN_PROGRESS 0x02
358 #define CSMI_DISC_COMPLETE 0x03
359 #define CSMI_DISC_ERROR 0x04
362 u8 attach_ident_frame
[0x1C];
365 struct atto_csmi_get_phy_info
{
368 struct atto_csmi_phy_entity
372 struct atto_csmi_set_phy_info
{
375 #define CSMI_NEG_RATE_NEGOTIATE 0x00
376 #define CSMI_NEG_RATE_PHY_DIS 0x01
378 u8 prog_minlink_rate
;
379 u8 prog_maxlink_rate
;
381 #define CSMI_SIG_CLASS_UNKNOWN 0x00
382 #define CSMI_SIG_CLASS_DIRECT 0x01
383 #define CSMI_SIG_CLASS_SERVER 0x02
384 #define CSMI_SIG_CLASS_ENCLOSURE 0x03
389 struct atto_csmi_get_link_errors
{
392 #define CSMI_RESET_CNTS_NO 0x00
393 #define CSMI_RESET_CNTS_YES 0x01
398 u32 loss_ofdw_sync_cnt
;
399 u32 phy_reseterr_cnt
;
402 * The following field has been added by ATTO for ease of
403 * implementation of additional statistics. Drivers must validate
404 * the length of the IOCTL payload prior to filling them in so CSMI
405 * complaint applications function correctly.
411 struct atto_csmi_smp_passthru
{
425 struct atto_csmi_ssp_passthru_sts
{
435 struct atto_csmi_ssp_passthru
{
447 #define CSMI_SSPF_DD_READ 0x00000001
448 #define CSMI_SSPF_DD_WRITE 0x00000002
449 #define CSMI_SSPF_DD_UNSPECIFIED 0x00000004
450 #define CSMI_SSPF_TA_SIMPLE 0x00000000
451 #define CSMI_SSPF_TA_HEAD_OF_Q 0x00000010
452 #define CSMI_SSPF_TA_ORDERED 0x00000020
453 #define CSMI_SSPF_TA_ACA 0x00000040
458 struct atto_csmi_ssp_passthru_sts sts
;
461 struct atto_csmi_stp_passthru_sts
{
469 struct atto_csmi_stp_passthru
{
478 #define CSMI_STPF_DD_READ 0x00000001
479 #define CSMI_STPF_DD_WRITE 0x00000002
480 #define CSMI_STPF_DD_UNSPECIFIED 0x00000004
481 #define CSMI_STPF_PIO 0x00000010
482 #define CSMI_STPF_DMA 0x00000020
483 #define CSMI_STPF_PACKET 0x00000040
484 #define CSMI_STPF_DMA_QUEUED 0x00000080
485 #define CSMI_STPF_EXECUTE_DIAG 0x00000100
486 #define CSMI_STPF_RESET_DEVICE 0x00000200
490 struct atto_csmi_stp_passthru_sts sts
;
493 struct atto_csmi_get_sata_sig
{
499 struct atto_csmi_get_scsi_addr
{
508 struct atto_csmi_get_dev_addr
{
517 struct atto_csmi_task_mgmt
{
523 #define CSMI_TMF_TASK_IU 0x00000001
524 #define CSMI_TMF_HARD_RST 0x00000002
525 #define CSMI_TMF_SUPPRESS_RSLT 0x00000004
532 #define CSMI_TM_INFO_TEST 1
533 #define CSMI_TM_INFO_EXCEEDED 2
534 #define CSMI_TM_INFO_DEMAND 3
535 #define CSMI_TM_INFO_TRIGGER 4
537 struct atto_csmi_ssp_passthru_sts sts
;
541 struct atto_csmi_get_conn_info
{
543 #define CSMI_CON_UNKNOWN 0x00000001
544 #define CSMI_CON_SFF_8482 0x00000002
545 #define CSMI_CON_SFF_8470_LANE_1 0x00000100
546 #define CSMI_CON_SFF_8470_LANE_2 0x00000200
547 #define CSMI_CON_SFF_8470_LANE_3 0x00000400
548 #define CSMI_CON_SFF_8470_LANE_4 0x00000800
549 #define CSMI_CON_SFF_8484_LANE_1 0x00010000
550 #define CSMI_CON_SFF_8484_LANE_2 0x00020000
551 #define CSMI_CON_SFF_8484_LANE_3 0x00040000
552 #define CSMI_CON_SFF_8484_LANE_4 0x00080000
556 #define CSMI_CON_INTERNAL 0x02
557 #define CSMI_CON_EXTERNAL 0x04
558 #define CSMI_CON_SWITCHABLE 0x08
559 #define CSMI_CON_AUTO 0x10
564 /* CSMI PHY class structures */
565 struct atto_csmi_character
{
567 #define CSMI_CTF_POS_DISP 0x01
568 #define CSMI_CTF_NEG_DISP 0x02
569 #define CSMI_CTF_CTRL_CHAR 0x04
574 struct atto_csmi_pc_ctrl
{
576 #define CSMI_PC_TYPE_UNDEFINED 0x00
577 #define CSMI_PC_TYPE_SATA 0x01
578 #define CSMI_PC_TYPE_SAS 0x02
581 u32 vendor_unique
[8];
583 #define CSMI_PC_TXF_PREEMP_DIS 0x00000001
585 signed char tx_amplitude
;
586 signed char tx_preemphasis
;
587 signed char tx_slew_rate
;
588 signed char tx_reserved
[13];
589 u8 tx_vendor_unique
[64];
591 #define CSMI_PC_RXF_EQ_DIS 0x00000001
593 signed char rx_threshold
;
594 signed char rx_equalization_gain
;
595 signed char rx_reserved
[14];
596 u8 rx_vendor_unique
[64];
598 #define CSMI_PC_PATF_FIXED 0x00000001
599 #define CSMI_PC_PATF_DIS_SCR 0x00000002
600 #define CSMI_PC_PATF_DIS_ALIGN 0x00000004
601 #define CSMI_PC_PATF_DIS_SSC 0x00000008
604 #define CSMI_PC_FP_CJPAT 0x00000001
605 #define CSMI_PC_FP_ALIGN 0x00000002
608 u8 pattern_reserved
[6];
610 struct atto_csmi_character user_pattern_buffer
[16];
613 struct atto_csmi_phy_ctrl
{
615 #define CSMI_PC_FUNC_GET_SETUP 0x00000100
622 #define CSMI_PHY_ACTIVATE_CTRL 0x00000001
623 #define CSMI_PHY_UPD_SPINUP_RATE 0x00000002
624 #define CSMI_PHY_AUTO_COMWAKE 0x00000004
628 u32 vendor_unique
[8];
630 struct atto_csmi_pc_ctrl control
[1];
633 union atto_ioctl_csmi
{
634 struct atto_csmi_get_driver_info drvr_info
;
635 struct atto_csmi_get_cntlr_cfg cntlr_cfg
;
636 struct atto_csmi_get_cntlr_sts cntlr_sts
;
637 struct atto_csmi_fw_download fw_dwnld
;
638 struct atto_csmi_get_raid_info raid_info
;
639 struct atto_csmi_get_raid_cfg raid_cfg
;
640 struct atto_csmi_get_phy_info get_phy_info
;
641 struct atto_csmi_set_phy_info set_phy_info
;
642 struct atto_csmi_get_link_errors link_errs
;
643 struct atto_csmi_smp_passthru smp_pass_thru
;
644 struct atto_csmi_ssp_passthru ssp_pass_thru
;
645 struct atto_csmi_stp_passthru stp_pass_thru
;
646 struct atto_csmi_task_mgmt tsk_mgt
;
647 struct atto_csmi_get_sata_sig sata_sig
;
648 struct atto_csmi_get_scsi_addr scsi_addr
;
649 struct atto_csmi_get_dev_addr dev_addr
;
650 struct atto_csmi_get_conn_info conn_info
[32];
651 struct atto_csmi_phy_ctrl phy_ctrl
;
657 union atto_ioctl_csmi data
;
660 struct atto_module_info
{
664 unsigned short host_no
;
674 #define ATTO_FUNC_GET_ADAP_INFO 0x00
675 #define ATTO_VER_GET_ADAP_INFO0 0
676 #define ATTO_VER_GET_ADAP_INFO ATTO_VER_GET_ADAP_INFO0
678 struct __packed atto_hba_get_adapter_info
{
692 #define ATTO_GAI_PCILW_UNKNOWN 0x00
696 #define ATTO_GAI_PCILS_UNKNOWN 0x00
697 #define ATTO_GAI_PCILS_GEN1 0x01
698 #define ATTO_GAI_PCILS_GEN2 0x02
699 #define ATTO_GAI_PCILS_GEN3 0x03
702 #define ATTO_GAI_PCIIM_UNKNOWN 0x00
703 #define ATTO_GAI_PCIIM_LEGACY 0x01
704 #define ATTO_GAI_PCIIM_MSI 0x02
705 #define ATTO_GAI_PCIIM_MSIX 0x03
712 #define ATTO_GAI_AT_EPCIU320 0x00
713 #define ATTO_GAI_AT_ESASRAID 0x01
714 #define ATTO_GAI_AT_ESASRAID2 0x02
715 #define ATTO_GAI_AT_ESASHBA 0x03
716 #define ATTO_GAI_AT_ESASHBA2 0x04
717 #define ATTO_GAI_AT_CELERITY 0x05
718 #define ATTO_GAI_AT_CELERITY8 0x06
719 #define ATTO_GAI_AT_FASTFRAME 0x07
720 #define ATTO_GAI_AT_ESASHBA3 0x08
721 #define ATTO_GAI_AT_CELERITY16 0x09
722 #define ATTO_GAI_AT_TLSASHBA 0x0A
723 #define ATTO_GAI_AT_ESASHBA4 0x0B
726 #define ATTO_GAI_AF_DEGRADED 0x01
727 #define ATTO_GAI_AF_SPT_SUPP 0x02
728 #define ATTO_GAI_AF_DEVADDR_SUPP 0x04
729 #define ATTO_GAI_AF_PHYCTRL_SUPP 0x08
730 #define ATTO_GAI_AF_TEST_SUPP 0x10
731 #define ATTO_GAI_AF_DIAG_SUPP 0x20
732 #define ATTO_GAI_AF_VIRT_SES 0x40
733 #define ATTO_GAI_AF_CONN_CTRL 0x80
739 u8 drvr_revsub_minor
;
741 char drvr_rev_ascii
[16];
743 char firmware_rev
[16];
745 char model_name_short
[16];
748 u32 num_targsper_bus
;
749 u32 num_lunsper_targ
;
753 #define ATTO_GAI_AF2_FCOE_SUPP 0x01
754 #define ATTO_GAI_AF2_NIC_SUPP 0x02
755 #define ATTO_GAI_AF2_LOCATE_SUPP 0x04
756 #define ATTO_GAI_AF2_ADAP_CTRL_SUPP 0x08
757 #define ATTO_GAI_AF2_DEV_INFO_SUPP 0x10
758 #define ATTO_GAI_AF2_NPIV_SUPP 0x20
759 #define ATTO_GAI_AF2_MP_SUPP 0x40
762 u32 num_targets_backend
;
764 #define ATTO_GAI_TF_MEM_RW 0x00000001
765 #define ATTO_GAI_TF_TRACE 0x00000002
766 #define ATTO_GAI_TF_SCSI_PASS_THRU 0x00000004
767 #define ATTO_GAI_TF_GET_DEV_ADDR 0x00000008
768 #define ATTO_GAI_TF_PHY_CTRL 0x00000010
769 #define ATTO_GAI_TF_CONN_CTRL 0x00000020
770 #define ATTO_GAI_TF_GET_DEV_INFO 0x00000040
775 #define ATTO_FUNC_GET_ADAP_ADDR 0x01
776 #define ATTO_VER_GET_ADAP_ADDR0 0
777 #define ATTO_VER_GET_ADAP_ADDR ATTO_VER_GET_ADAP_ADDR0
779 struct __packed atto_hba_get_adapter_address
{
782 #define ATTO_GAA_AT_PORT 0x00
783 #define ATTO_GAA_AT_NODE 0x01
784 #define ATTO_GAA_AT_CURR_MAC 0x02
785 #define ATTO_GAA_AT_PERM_MAC 0x03
786 #define ATTO_GAA_AT_VNIC 0x04
793 #define ATTO_FUNC_MEM_RW 0x02
794 #define ATTO_VER_MEM_RW0 0
795 #define ATTO_VER_MEM_RW ATTO_VER_MEM_RW0
797 struct __packed atto_hba_memory_read_write
{
811 #define ATTO_FUNC_TRACE 0x03
812 #define ATTO_VER_TRACE0 0
813 #define ATTO_VER_TRACE1 1
814 #define ATTO_VER_TRACE ATTO_VER_TRACE1
816 struct __packed atto_hba_trace
{
818 #define ATTO_TRC_TF_GET_INFO 0x00
819 #define ATTO_TRC_TF_ENABLE 0x01
820 #define ATTO_TRC_TF_DISABLE 0x02
821 #define ATTO_TRC_TF_SET_MASK 0x03
822 #define ATTO_TRC_TF_UPLOAD 0x04
823 #define ATTO_TRC_TF_RESET 0x05
826 #define ATTO_TRC_TT_DRIVER 0x00
827 #define ATTO_TRC_TT_FWCOREDUMP 0x01
836 #define ATTO_FUNC_SCSI_PASS_THRU 0x04
837 #define ATTO_VER_SCSI_PASS_THRU0 0
838 #define ATTO_VER_SCSI_PASS_THRU ATTO_VER_SCSI_PASS_THRU0
840 struct __packed atto_hba_scsi_pass_thru
{
844 #define ATTO_SPT_RS_SUCCESS 0x00
845 #define ATTO_SPT_RS_FAILED 0x01
846 #define ATTO_SPT_RS_OVERRUN 0x02
847 #define ATTO_SPT_RS_UNDERRUN 0x03
848 #define ATTO_SPT_RS_NO_DEVICE 0x04
849 #define ATTO_SPT_RS_NO_LUN 0x05
850 #define ATTO_SPT_RS_TIMEOUT 0x06
851 #define ATTO_SPT_RS_BUS_RESET 0x07
852 #define ATTO_SPT_RS_ABORTED 0x08
853 #define ATTO_SPT_RS_BUSY 0x09
854 #define ATTO_SPT_RS_DEGRADED 0x0A
859 #define ATTO_SPTF_DATA_IN 0x00000001
860 #define ATTO_SPTF_DATA_OUT 0x00000002
861 #define ATTO_SPTF_SIMPLE_Q 0x00000004
862 #define ATTO_SPTF_HEAD_OF_Q 0x00000008
863 #define ATTO_SPTF_ORDERED_Q 0x00000010
873 #define ATTO_FUNC_GET_DEV_ADDR 0x05
874 #define ATTO_VER_GET_DEV_ADDR0 0
875 #define ATTO_VER_GET_DEV_ADDR ATTO_VER_GET_DEV_ADDR0
877 struct __packed atto_hba_get_device_address
{
879 #define ATTO_GDA_AT_PORT 0x00
880 #define ATTO_GDA_AT_NODE 0x01
881 #define ATTO_GDA_AT_MAC 0x02
882 #define ATTO_GDA_AT_PORTID 0x03
883 #define ATTO_GDA_AT_UNIQUE 0x04
891 /* The following functions are supported by firmware but do not have any
892 * associated driver structures
894 #define ATTO_FUNC_PHY_CTRL 0x06
895 #define ATTO_FUNC_CONN_CTRL 0x0C
896 #define ATTO_FUNC_ADAP_CTRL 0x0E
897 #define ATTO_VER_ADAP_CTRL0 0
898 #define ATTO_VER_ADAP_CTRL ATTO_VER_ADAP_CTRL0
900 struct __packed atto_hba_adap_ctrl
{
902 #define ATTO_AC_AF_HARD_RST 0x00
903 #define ATTO_AC_AF_GET_STATE 0x01
904 #define ATTO_AC_AF_GET_TEMP 0x02
907 #define ATTO_AC_AS_UNKNOWN 0x00
908 #define ATTO_AC_AS_OK 0x01
909 #define ATTO_AC_AS_RST_SCHED 0x02
910 #define ATTO_AC_AS_RST_IN_PROG 0x03
911 #define ATTO_AC_AS_RST_DISC 0x04
912 #define ATTO_AC_AS_DEGRADED 0x05
913 #define ATTO_AC_AS_DISABLED 0x06
914 #define ATTO_AC_AS_TEMP 0x07
923 #define ATTO_AC_TS_UNSUPP 0x00
924 #define ATTO_AC_TS_UNKNOWN 0x01
925 #define ATTO_AC_TS_INIT_FAILED 0x02
926 #define ATTO_AC_TS_NORMAL 0x03
927 #define ATTO_AC_TS_OUT_OF_RANGE 0x04
928 #define ATTO_AC_TS_FAULT 0x05
930 signed short temp_value
;
931 signed short temp_lower_lim
;
932 signed short temp_upper_lim
;
939 #define ATTO_FUNC_GET_DEV_INFO 0x0F
940 #define ATTO_VER_GET_DEV_INFO0 0
941 #define ATTO_VER_GET_DEV_INFO ATTO_VER_GET_DEV_INFO0
943 struct __packed atto_hba_sas_device_info
{
945 #define ATTO_SDI_MAX_PHYS_WIDE_PORT 16
947 u8 phy_id
[ATTO_SDI_MAX_PHYS_WIDE_PORT
]; /* IDs of parent exp/adapt */
948 #define ATTO_SDI_PHY_ID_INV ATTO_SAS_PHY_ID_INV
952 #define ATTO_SDI_SAS_LVL_INV 0xFF
955 #define ATTO_SDI_SLOT_NUM_INV ATTO_SLOT_NUM_INV
958 #define ATTO_SDI_DT_END_DEVICE 0
959 #define ATTO_SDI_DT_EXPANDER 1
960 #define ATTO_SDI_DT_PORT_MULT 2
964 u8 link_rate
; /* SMP_RATE_XXX */
966 #define ATTO_SDI_LF_DIRECT 0x01
967 #define ATTO_SDI_LF_EXPANDER 0x02
968 #define ATTO_SDI_LF_PORT_MULT 0x04
973 union atto_hba_device_info
{
974 struct atto_hba_sas_device_info sas_dev_info
;
977 struct __packed atto_hba_get_device_info
{
980 #define ATTO_GDI_IT_UNKNOWN 0x00
981 #define ATTO_GDI_IT_SAS 0x01
982 #define ATTO_GDI_IT_FC 0x02
983 #define ATTO_GDI_IT_FCOE 0x03
986 union atto_hba_device_info dev_info
;
991 u8 function
; /* ATTO_FUNC_XXX */
993 #define ATTO_STS_SUCCESS 0x00
994 #define ATTO_STS_FAILED 0x01
995 #define ATTO_STS_INV_VERSION 0x02
996 #define ATTO_STS_OUT_OF_RSRC 0x03
997 #define ATTO_STS_INV_FUNC 0x04
998 #define ATTO_STS_UNSUPPORTED 0x05
999 #define ATTO_STS_INV_ADAPTER 0x06
1000 #define ATTO_STS_INV_DRVR_VER 0x07
1001 #define ATTO_STS_INV_PARAM 0x08
1002 #define ATTO_STS_TIMEOUT 0x09
1003 #define ATTO_STS_NOT_APPL 0x0A
1004 #define ATTO_STS_DEGRADED 0x0B
1007 #define HBAF_TUNNEL 0x01
1014 struct atto_hba_get_adapter_info get_adap_info
;
1015 struct atto_hba_get_adapter_address get_adap_addr
;
1016 struct atto_hba_scsi_pass_thru scsi_pass_thru
;
1017 struct atto_hba_get_device_address get_dev_addr
;
1018 struct atto_hba_adap_ctrl adap_ctrl
;
1019 struct atto_hba_get_device_info get_dev_info
;
1020 struct atto_hba_trace trace
;
1025 struct __packed atto_ioctl_vda_scsi_cmd
{
1027 #define ATTO_VDA_SCSI_VER0 0
1028 #define ATTO_VDA_SCSI_VER ATTO_VDA_SCSI_VER0
1033 u32 residual_length
;
1041 struct __packed atto_ioctl_vda_flash_cmd
{
1043 #define ATTO_VDA_FLASH_VER0 0
1044 #define ATTO_VDA_FLASH_VER ATTO_VDA_FLASH_VER0
1059 char file_name
[16]; /* 8.3 fname, NULL term, wc=* */
1066 struct __packed atto_ioctl_vda_diag_cmd
{
1068 #define ATTO_VDA_DIAG_VER0 0
1069 #define ATTO_VDA_DIAG_VER ATTO_VDA_DIAG_VER0
1078 struct __packed atto_ioctl_vda_cli_cmd
{
1080 #define ATTO_VDA_CLI_VER0 0
1081 #define ATTO_VDA_CLI_VER ATTO_VDA_CLI_VER0
1086 struct __packed atto_ioctl_vda_smp_cmd
{
1088 #define ATTO_VDA_SMP_VER0 0
1089 #define ATTO_VDA_SMP_VER ATTO_VDA_SMP_VER0
1095 struct __packed atto_ioctl_vda_cfg_cmd
{
1097 #define ATTO_VDA_CFG_VER0 0
1098 #define ATTO_VDA_CFG_VER ATTO_VDA_CFG_VER0
1106 struct atto_vda_cfg_init init
;
1111 struct __packed atto_ioctl_vda_mgt_cmd
{
1113 #define ATTO_VDA_MGT_VER0 0
1114 #define ATTO_VDA_MGT_VER ATTO_VDA_MGT_VER0
1123 struct atto_vda_devinfo dev_info
;
1124 struct atto_vda_grp_info grp_info
;
1125 struct atto_vdapart_info part_info
;
1126 struct atto_vda_dh_info dh_info
;
1127 struct atto_vda_metrics_info metrics_info
;
1128 struct atto_vda_schedule_info sched_info
;
1129 struct atto_vda_n_vcache_info nvcache_info
;
1130 struct atto_vda_buzzer_info buzzer_info
;
1131 struct atto_vda_adapter_info adapter_info
;
1132 struct atto_vda_temp_info temp_info
;
1133 struct atto_vda_fan_info fan_info
;
1137 struct __packed atto_ioctl_vda_gsv_cmd
{
1139 #define ATTO_VDA_GSV_VER0 0
1140 #define ATTO_VDA_GSV_VER ATTO_VDA_GSV_VER0
1145 #define ATTO_VDA_VER_UNSUPPORTED 0xFF
1149 struct __packed atto_ioctl_vda
{
1151 u8 function
; /* VDA_FUNC_XXXX */
1152 u8 status
; /* ATTO_STS_XXX */
1153 u8 vda_status
; /* RS_XXX (if status == ATTO_STS_SUCCESS) */
1158 struct atto_ioctl_vda_scsi_cmd scsi
;
1159 struct atto_ioctl_vda_flash_cmd flash
;
1160 struct atto_ioctl_vda_diag_cmd diag
;
1161 struct atto_ioctl_vda_cli_cmd cli
;
1162 struct atto_ioctl_vda_smp_cmd smp
;
1163 struct atto_ioctl_vda_cfg_cmd cfg
;
1164 struct atto_ioctl_vda_mgt_cmd mgt
;
1165 struct atto_ioctl_vda_gsv_cmd gsv
;
1171 struct atto_vda_devinfo2 dev_info2
;
1176 struct __packed atto_ioctl_smp
{
1178 #define ATTO_SMP_VERSION0 0
1179 #define ATTO_SMP_VERSION1 1
1180 #define ATTO_SMP_VERSION2 2
1181 #define ATTO_SMP_VERSION ATTO_SMP_VERSION2
1184 #define ATTO_SMP_FUNC_DISC_SMP 0x00
1185 #define ATTO_SMP_FUNC_DISC_TARG 0x01
1186 #define ATTO_SMP_FUNC_SEND_CMD 0x02
1187 #define ATTO_SMP_FUNC_DISC_TARG_DIRECT 0x03
1188 #define ATTO_SMP_FUNC_SEND_CMD_DIRECT 0x04
1189 #define ATTO_SMP_FUNC_DISC_SMP_DIRECT 0x05
1191 u8 status
; /* ATTO_STS_XXX */
1192 u8 smp_status
; /* if status == ATTO_STS_SUCCESS */
1193 #define ATTO_SMP_STS_SUCCESS 0x00
1194 #define ATTO_SMP_STS_FAILURE 0x01
1195 #define ATTO_SMP_STS_RESCAN 0x02
1196 #define ATTO_SMP_STS_NOT_FOUND 0x03
1206 #define ATTO_SMPF_ROOT_EXP 0x01 /* expander direct attached */
1217 struct __packed atto_express_ioctl
{
1218 struct atto_express_ioctl_header header
;
1221 struct atto_firmware_rw_request fwrw
;
1222 struct atto_param_rw_request prw
;
1223 struct atto_channel_list chanlist
;
1224 struct atto_channel_info chaninfo
;
1225 struct atto_ioctl ioctl_hba
;
1226 struct atto_module_info modinfo
;
1227 struct atto_ioctl_vda ioctl_vda
;
1228 struct atto_ioctl_smp ioctl_smp
;
1229 struct atto_csmi csmi
;
1234 /* The struct associated with the code is listed after the definition */
1235 #define EXPRESS_IOCTL_MIN 0x4500
1236 #define EXPRESS_IOCTL_RW_FIRMWARE 0x4500 /* FIRMWARERW */
1237 #define EXPRESS_IOCTL_READ_PARAMS 0x4501 /* PARAMRW */
1238 #define EXPRESS_IOCTL_WRITE_PARAMS 0x4502 /* PARAMRW */
1239 #define EXPRESS_IOCTL_FC_API 0x4503 /* internal */
1240 #define EXPRESS_IOCTL_GET_CHANNELS 0x4504 /* CHANNELLIST */
1241 #define EXPRESS_IOCTL_CHAN_INFO 0x4505 /* CHANNELINFO */
1242 #define EXPRESS_IOCTL_DEFAULT_PARAMS 0x4506 /* PARAMRW */
1243 #define EXPRESS_ADDR_MEMORY 0x4507 /* MEMADDR */
1244 #define EXPRESS_RW_MEMORY 0x4508 /* MEMRW */
1245 #define EXPRESS_TSDK_DUMP 0x4509 /* TSDKDUMP */
1246 #define EXPRESS_IOCTL_SMP 0x450A /* IOCTL_SMP */
1247 #define EXPRESS_CSMI 0x450B /* CSMI */
1248 #define EXPRESS_IOCTL_HBA 0x450C /* IOCTL_HBA */
1249 #define EXPRESS_IOCTL_VDA 0x450D /* IOCTL_VDA */
1250 #define EXPRESS_IOCTL_GET_ID 0x450E /* GET_ID */
1251 #define EXPRESS_IOCTL_GET_MOD_INFO 0x450F /* MODULE_INFO */
1252 #define EXPRESS_IOCTL_MAX 0x450F