1507c3241Smlf /*
2507c3241Smlf  * CDDL HEADER START
3507c3241Smlf  *
4507c3241Smlf  * The contents of this file are subject to the terms of the
5507c3241Smlf  * Common Development and Distribution License (the "License").
6507c3241Smlf  * You may not use this file except in compliance with the License.
7507c3241Smlf  *
8507c3241Smlf  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9507c3241Smlf  * or http://www.opensolaris.org/os/licensing.
10507c3241Smlf  * See the License for the specific language governing permissions
11507c3241Smlf  * and limitations under the License.
12507c3241Smlf  *
13507c3241Smlf  * When distributing Covered Code, include this CDDL HEADER in each
14507c3241Smlf  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15507c3241Smlf  * If applicable, add the following below this CDDL HEADER, with the
16507c3241Smlf  * fields enclosed by brackets "[]" replaced with your own identifying
17507c3241Smlf  * information: Portions Copyright [yyyy] [name of copyright owner]
18507c3241Smlf  *
19507c3241Smlf  * CDDL HEADER END
20507c3241Smlf  */
21507c3241Smlf 
22507c3241Smlf /*
230f1b305eSSeth Goldberg  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24507c3241Smlf  * Use is subject to license terms.
25507c3241Smlf  */
26507c3241Smlf 
27507c3241Smlf #ifndef _ATA_COMMON_H
28507c3241Smlf #define	_ATA_COMMON_H
29507c3241Smlf 
30507c3241Smlf #ifdef	__cplusplus
31507c3241Smlf extern "C" {
32507c3241Smlf #endif
33507c3241Smlf 
34507c3241Smlf #include <sys/varargs.h>
35507c3241Smlf 
36507c3241Smlf #include <sys/scsi/scsi.h>
37507c3241Smlf #include <sys/dktp/dadkio.h>
38507c3241Smlf #include <sys/dktp/dadev.h>
39507c3241Smlf #include <sys/dkio.h>
40507c3241Smlf #include <sys/dktp/tgdk.h>
41507c3241Smlf 
42507c3241Smlf #include <sys/ddi.h>
43507c3241Smlf #include <sys/sunddi.h>
44507c3241Smlf 
45507c3241Smlf #include "ghd.h"
46507c3241Smlf 
47507c3241Smlf #include "pciide.h"
48507c3241Smlf #include "ata_cmd.h"
49507c3241Smlf #include "ata_fsm.h"
50507c3241Smlf #include "ata_debug.h"
51507c3241Smlf 
52507c3241Smlf 
53507c3241Smlf /*
54507c3241Smlf  * device types
55507c3241Smlf  */
56507c3241Smlf #define	ATA_DEV_NONE	0
57507c3241Smlf #define	ATA_DEV_DISK	1
58507c3241Smlf #define	ATA_DEV_ATAPI	2
59507c3241Smlf 
60507c3241Smlf /*
61507c3241Smlf  * Largest sector allowed in 28 bit mode
62507c3241Smlf  */
63507c3241Smlf #define	MAX_28BIT_CAPACITY	0xfffffff
64507c3241Smlf 
650f2c99a4Syt /*
660f2c99a4Syt  * Largest sector count allowed for device firmware file in one command.
670f2c99a4Syt  */
680f2c99a4Syt #define	MAX_FWFILE_SIZE_ONECMD	0xffff
69507c3241Smlf 
70507c3241Smlf /*
71507c3241Smlf  * ata-options property configuration bits
72507c3241Smlf  */
73507c3241Smlf 
74507c3241Smlf #define	ATA_OPTIONS_DMA		0x01
75507c3241Smlf 
760f2c99a4Syt #define	ATAPRT(fmt)	ghd_err fmt
77507c3241Smlf 
78507c3241Smlf /* ad_flags (per-drive) */
79507c3241Smlf 
80507c3241Smlf #define	AD_ATAPI		0x01	/* is an ATAPI drive */
81507c3241Smlf #define	AD_DISK			0x02
82507c3241Smlf #define	AD_MUTEX_INIT		0x04
83507c3241Smlf #define	AD_NO_CDB_INTR		0x20
84507c3241Smlf #define	AD_1SECTOR		0x40
85507c3241Smlf #define	AD_INT13LBA		0x80	/* supports LBA at Int13 interface */
86507c3241Smlf #define	AD_NORVRT		0x100	/* block revert-to-defaults */
87507c3241Smlf #define	AD_EXT48		0x200	/* 48 bit (extended) LBA */
888c112d45SColin Yi #define	AD_BLLBA48		0x400
89507c3241Smlf #define	ATAPIDRV(X)  ((X)->ad_flags & AD_ATAPI)
90507c3241Smlf 
91507c3241Smlf 
92507c3241Smlf /* max targets and luns */
93507c3241Smlf 
94507c3241Smlf #define	ATA_MAXTARG	2
95507c3241Smlf #define	ATA_MAXLUN	16
96507c3241Smlf 
97507c3241Smlf /*
98507c3241Smlf  * PCI-IDE Bus Mastering Scatter/Gather list size
99507c3241Smlf  */
100507c3241Smlf #define	ATA_DMA_NSEGS	17	/* enough for at least 64K */
101507c3241Smlf 
102507c3241Smlf /*
103507c3241Smlf  * Controller port address defaults
104507c3241Smlf  */
105507c3241Smlf #define	ATA_BASE0	0x1f0
106507c3241Smlf #define	ATA_BASE1	0x170
107507c3241Smlf 
108507c3241Smlf /*
109507c3241Smlf  * port offsets from base address ioaddr1
110507c3241Smlf  */
111507c3241Smlf #define	AT_DATA		0x00	/* data register 			*/
112507c3241Smlf #define	AT_ERROR	0x01	/* error register (read)		*/
113507c3241Smlf #define	AT_FEATURE	0x01	/* features (write)			*/
114507c3241Smlf #define	AT_COUNT	0x02    /* sector count 			*/
115507c3241Smlf #define	AT_SECT		0x03	/* sector number 			*/
116507c3241Smlf #define	AT_LCYL		0x04	/* cylinder low byte 			*/
117507c3241Smlf #define	AT_HCYL		0x05	/* cylinder high byte 			*/
118507c3241Smlf #define	AT_DRVHD	0x06    /* drive/head register 			*/
119507c3241Smlf #define	AT_STATUS	0x07	/* status/command register 		*/
120507c3241Smlf #define	AT_CMD		0x07	/* status/command register 		*/
121507c3241Smlf 
122507c3241Smlf /*
123507c3241Smlf  * port offsets from base address ioaddr2
124507c3241Smlf  */
125507c3241Smlf #define	AT_ALTSTATUS	0x00	/* alternate status (read)		*/
126507c3241Smlf #define	AT_DEVCTL	0x00	/* device control (write)		*/
127507c3241Smlf 
128507c3241Smlf /*	Device control register						*/
129507c3241Smlf #define	ATDC_NIEN    	0x02    /* disable interrupts 			*/
130507c3241Smlf #define	ATDC_SRST	0x04	/* controller reset			*/
131507c3241Smlf #define	ATDC_D3		0x08	/* Mysterious bit, must be set  	*/
132507c3241Smlf /*
133507c3241Smlf  * ATA-6 spec
134507c3241Smlf  * In 48-bit addressing, reading the LBA location and count
135507c3241Smlf  * registers when the high-order bit is set reads the "previous
136507c3241Smlf  * content" (LBA bits 47:24, count bits 15:8) instead of the
137507c3241Smlf  * "most recent" values (LBA bits 23:0, count bits 7:0).
138507c3241Smlf  */
139507c3241Smlf #define	ATDC_HOB	0x80	/* High order bit			*/
140507c3241Smlf 
141507c3241Smlf /*
142507c3241Smlf  * Status bits from AT_STATUS register
143507c3241Smlf  */
144507c3241Smlf #define	ATS_BSY		0x80    /* controller busy 			*/
145507c3241Smlf #define	ATS_DRDY	0x40    /* drive ready 				*/
146507c3241Smlf #define	ATS_DF		0x20    /* device fault				*/
147507c3241Smlf #define	ATS_DSC    	0x10    /* seek operation complete 		*/
148507c3241Smlf #define	ATS_DRQ		0x08	/* data request 			*/
149507c3241Smlf #define	ATS_CORR	0x04    /* ECC correction applied 		*/
150507c3241Smlf #define	ATS_IDX		0x02    /* disk revolution index 		*/
151507c3241Smlf #define	ATS_ERR		0x01    /* error flag 				*/
152507c3241Smlf 
153507c3241Smlf /*
154507c3241Smlf  * Status bits from AT_ERROR register
155507c3241Smlf  */
156507c3241Smlf #define	ATE_BBK_ICRC	0x80	/* bad block detected in ATA-1		*/
157507c3241Smlf 				/* ICRC error in ATA-4 and newer	*/
158507c3241Smlf #define	ATE_UNC		0x40	/* uncorrectable data error		*/
159507c3241Smlf #define	ATE_MC		0x20    /* Media change				*/
160507c3241Smlf #define	ATE_IDNF	0x10    /* ID not found				*/
161507c3241Smlf #define	ATE_MCR		0x08	/* media change request			*/
162507c3241Smlf #define	ATE_ABORT	0x04    /* aborted command			*/
163507c3241Smlf #define	ATE_TKONF	0x02    /* track 0 not found			*/
164507c3241Smlf #define	ATE_AMNF	0x01    /* address mark not found		*/
165507c3241Smlf 
166507c3241Smlf #define	ATE_NM		0x02	/* no media				*/
167507c3241Smlf 
168507c3241Smlf /*
169507c3241Smlf  * Drive selectors for AT_DRVHD register
170507c3241Smlf  */
171507c3241Smlf #define	ATDH_LBA	0x40	/* addressing in LBA mode not chs 	*/
172507c3241Smlf #define	ATDH_DRIVE0	0xa0    /* or into AT_DRVHD to select drive 0 	*/
173507c3241Smlf #define	ATDH_DRIVE1	0xb0    /* or into AT_DRVHD to select drive 1 	*/
174507c3241Smlf 
175507c3241Smlf /*
176507c3241Smlf  * Feature register bits
177507c3241Smlf  */
178507c3241Smlf #define	ATF_ATAPI_DMA	0x01	/* ATAPI DMA enable bit */
179c8531848Syt #define	ATF_XFRMOD_MDMA	0x20	/* Multi-Word DMA mode */
1802df1fe9cSrandyf #define	ATF_XFRMOD_UDMA	0x40	/* Ultra DMA mode	*/
1812df1fe9cSrandyf #define	ATACM_UDMA_SEL(id)	(((id)->ai_ultradma >> 8) & 0x7f)
1822df1fe9cSrandyf 
1832df1fe9cSrandyf /*
1842df1fe9cSrandyf  * Set feature register definitions.
1852df1fe9cSrandyf  */
1862df1fe9cSrandyf #define	ATSF_SET_XFRMOD	0X03	/* Set transfer mode			  */
1872df1fe9cSrandyf #define	ATSF_DIS_REVPOD	0x66	/* Disable reverting to power on defaults */
1882df1fe9cSrandyf #define	ATSF_ENA_REVPOD	0xcc	/* Enable reverting to power on defaults  */
189507c3241Smlf 
190507c3241Smlf /*
191507c3241Smlf  * common bits and options for set features (ATC_SET_FEAT)
192507c3241Smlf  */
193507c3241Smlf #define	FC_WRITE_CACHE_ON	0x02
194507c3241Smlf #define	FC_WRITE_CACHE_OFF	0x82
195507c3241Smlf 
196507c3241Smlf /* Test which version of ATA is supported */
197507c3241Smlf #define	IS_ATA_VERSION_SUPPORTED(idp, n) \
198507c3241Smlf 	((idp->ai_majorversion != 0xffff) && \
199507c3241Smlf 	(idp->ai_majorversion & (1<<n)))
200507c3241Smlf 
201507c3241Smlf /* Test if supported version >= ATA-n */
202507c3241Smlf #define	IS_ATA_VERSION_GE(idp, n) \
203507c3241Smlf 	((idp->ai_majorversion != 0xffff) && \
204507c3241Smlf 	(idp->ai_majorversion != 0) && \
205507c3241Smlf 	(idp->ai_majorversion >= (1<<n)))
206507c3241Smlf 
207507c3241Smlf /* Test whether a device is a CD drive */
208507c3241Smlf #define	IS_CDROM(dp) \
209507c3241Smlf 		((dp->ad_flags & AD_ATAPI) && \
210507c3241Smlf 		    ((dp->ad_id.ai_config >> 8) & DTYPE_MASK) == \
211507c3241Smlf 		    DTYPE_RODIRECT)
212507c3241Smlf 
2133a7782feSxun ni - Sun Microsystems - Beijing China /* Test whether the device support write cache */
2143a7782feSxun ni - Sun Microsystems - Beijing China #define	IS_WRITE_CACHE_SUPPORTED(x) \
2153a7782feSxun ni - Sun Microsystems - Beijing China 	((((x).ai_cmdset82) & 0x20) >> 5)
2163a7782feSxun ni - Sun Microsystems - Beijing China 
217507c3241Smlf /*  macros from old common hba code */
218507c3241Smlf 
219507c3241Smlf #define	ATA_INTPROP(devi, pname, pval, plen) \
220507c3241Smlf 	(ddi_prop_op(DDI_DEV_T_ANY, (devi), PROP_LEN_AND_VAL_BUF, \
221507c3241Smlf 		DDI_PROP_DONTPASS, (pname), (caddr_t)(pval), (plen)))
222507c3241Smlf 
223507c3241Smlf #define	ATA_LONGPROP(devi, pname, pval, plen) \
224507c3241Smlf 	(ddi_getlongprop(DDI_DEV_T_ANY, (devi), DDI_PROP_DONTPASS, \
225507c3241Smlf 		(pname), (caddr_t)(pval), (plen)))
226507c3241Smlf 
227507c3241Smlf /*
228507c3241Smlf  *
229507c3241Smlf  * per-controller soft-state data structure
230507c3241Smlf  *
231507c3241Smlf  */
232507c3241Smlf 
233507c3241Smlf #define	CTL2DRV(cp, t, l)	(cp->ac_drvp[t][l])
234507c3241Smlf 
235507c3241Smlf typedef struct ata_ctl {
236507c3241Smlf 
237507c3241Smlf 	dev_info_t	*ac_dip;
238507c3241Smlf 	uint_t		 ac_flags;
239507c3241Smlf 	uint_t		 ac_timing_flags;
240507c3241Smlf 	struct ata_drv	*ac_drvp[ATA_MAXTARG][ATA_MAXLUN];
241507c3241Smlf 	int		 ac_max_transfer; /* max transfer in sectors */
242507c3241Smlf 	uint_t		 ac_standby_time; /* timer value seconds */
243507c3241Smlf 
244507c3241Smlf 	ccc_t		 ac_ccc;	  /* for GHD module */
245507c3241Smlf 	struct ata_drv	*ac_active_drvp;  /* active drive, if any */
246507c3241Smlf 	struct ata_pkt	*ac_active_pktp;  /* active packet, if any */
247507c3241Smlf 	uchar_t		 ac_state;
248507c3241Smlf 
249507c3241Smlf 	scsi_hba_tran_t *ac_atapi_tran;	  /* for atapi module */
250507c3241Smlf 
251507c3241Smlf 	/*
252507c3241Smlf 	 * port addresses associated with ioaddr1
253507c3241Smlf 	 */
254507c3241Smlf 	ddi_acc_handle_t ac_iohandle1;	  /* DDI I/O handle */
255507c3241Smlf 	caddr_t		 ac_ioaddr1;
256507c3241Smlf 	ushort_t	*ac_data;	  /* data register 		*/
257507c3241Smlf 	uchar_t		*ac_error;	  /* error register (read)	*/
258507c3241Smlf 	uchar_t		*ac_feature;	  /* features (write)		*/
259507c3241Smlf 	uchar_t		*ac_count;	  /* sector count 		*/
260507c3241Smlf 	uchar_t		*ac_sect;	  /* sector number 		*/
261507c3241Smlf 	uchar_t		*ac_lcyl;	  /* cylinder low byte 		*/
262507c3241Smlf 	uchar_t		*ac_hcyl;	  /* cylinder high byte 	*/
263507c3241Smlf 	uchar_t		*ac_drvhd;	  /* drive/head register 	*/
264507c3241Smlf 	uchar_t		*ac_status;	  /* status/command register 	*/
265507c3241Smlf 	uchar_t		*ac_cmd;	  /* status/command register 	*/
266507c3241Smlf 
267507c3241Smlf 	/*
268507c3241Smlf 	 * port addresses associated with ioaddr2
269507c3241Smlf 	 */
270507c3241Smlf 	ddi_acc_handle_t ac_iohandle2;	  /* DDI I/O handle		*/
271507c3241Smlf 	caddr_t		 ac_ioaddr2;
272507c3241Smlf 	uchar_t		*ac_altstatus;	  /* alternate status (read)	*/
273507c3241Smlf 	uchar_t		*ac_devctl;	  /* device control (write)	*/
274507c3241Smlf 
275507c3241Smlf 	/*
276507c3241Smlf 	 * handle and port addresss for PCI-IDE Bus Master controller
277507c3241Smlf 	 */
278507c3241Smlf 	ddi_acc_handle_t ac_bmhandle;	  /* DDI I/O handle		*/
279507c3241Smlf 	caddr_t		 ac_bmaddr;	  /* base addr of Bus Master Regs */
280507c3241Smlf 	uchar_t		 ac_pciide;	  /* PCI-IDE device */
281507c3241Smlf 	uchar_t		 ac_pciide_bm;	  /* Bus Mastering PCI-IDE device */
282507c3241Smlf 
283507c3241Smlf 	/*
284507c3241Smlf 	 * Scatter/Gather list for PCI-IDE Bus Mastering controllers
285507c3241Smlf 	 */
286507c3241Smlf 	caddr_t		 ac_sg_list;	  /* virtual addr of S/G list */
287507c3241Smlf 	paddr_t		 ac_sg_paddr;	  /* phys addr of S/G list */
288507c3241Smlf 	ddi_acc_handle_t ac_sg_acc_handle;
289507c3241Smlf 	ddi_dma_handle_t ac_sg_handle;
290507c3241Smlf 
291507c3241Smlf 	/*
292507c3241Smlf 	 * data for managing ARQ on ATAPI devices
293507c3241Smlf 	 */
294507c3241Smlf 	struct ata_pkt	*ac_arq_pktp;	  /* pkt for performing ATAPI ARQ */
295507c3241Smlf 	struct ata_pkt	*ac_fault_pktp;	  /* pkt that caused ARQ */
296507c3241Smlf 	uchar_t		 ac_arq_cdb[6];
2972df1fe9cSrandyf 
2982df1fe9cSrandyf 	/*
2992df1fe9cSrandyf 	 * Power Management
3002df1fe9cSrandyf 	 */
3012df1fe9cSrandyf 	int		ac_pm_support;
3022df1fe9cSrandyf 	int		ac_pm_level;
303507c3241Smlf } ata_ctl_t;
304507c3241Smlf 
305507c3241Smlf /* ac_flags (per-controller) */
306507c3241Smlf 
307507c3241Smlf #define	AC_GHD_INIT			0x02
308507c3241Smlf #define	AC_ATAPI_INIT			0x04
309507c3241Smlf #define	AC_DISK_INIT			0x08
310507c3241Smlf #define	AC_ATTACHED			0x10
311507c3241Smlf #define	AC_SCSI_HBA_TRAN_ALLOC		0x1000
312507c3241Smlf #define	AC_SCSI_HBA_ATTACH		0x2000
313507c3241Smlf 
314507c3241Smlf #define	AC_BMSTATREG_PIO_BROKEN		0x80000000
315507c3241Smlf 
316507c3241Smlf /*
317507c3241Smlf  * Bug 1256489:
318507c3241Smlf  *
319507c3241Smlf  * If AC_BSY_WAIT needs to be set  for laptops that do
320507c3241Smlf  * suspend/resume but do not correctly wait for the busy bit to
321507c3241Smlf  * drop after a resume.
322507c3241Smlf  */
323507c3241Smlf 
324507c3241Smlf /* ac_timing_flags (per-controller) */
325507c3241Smlf #define	AC_BSY_WAIT	0x1	/* tweak timing in ata_start & atapi_start */
326507c3241Smlf 
327507c3241Smlf 
328507c3241Smlf 
329507c3241Smlf /* Identify drive data */
330507c3241Smlf struct ata_id {
331507c3241Smlf /*  					WORD				*/
332507c3241Smlf /* 					OFFSET COMMENT			*/
333507c3241Smlf 	ushort_t  ai_config;	  /*   0  general configuration bits 	*/
334507c3241Smlf 	ushort_t  ai_fixcyls;	  /*   1  # of fixed cylinders		*/
335507c3241Smlf 	ushort_t  ai_resv0;	  /*   2  # reserved			*/
336507c3241Smlf 	ushort_t  ai_heads;	  /*   3  # of heads			*/
337507c3241Smlf 	ushort_t  ai_trksiz;	  /*   4  # of unformatted bytes/track 	*/
338507c3241Smlf 	ushort_t  ai_secsiz;	  /*   5  # of unformatted bytes/sector	*/
339507c3241Smlf 	ushort_t  ai_sectors;	  /*   6  # of sectors/track		*/
340507c3241Smlf 	ushort_t  ai_resv1[3];	  /*   7  "Vendor Unique"		*/
341507c3241Smlf 	char	ai_drvser[20];	  /*  10  Serial number			*/
342507c3241Smlf 	ushort_t ai_buftype;	  /*  20  Buffer type			*/
343507c3241Smlf 	ushort_t ai_bufsz;	  /*  21  Buffer size in 512 byte incr  */
344507c3241Smlf 	ushort_t ai_ecc;	  /*  22  # of ecc bytes avail on rd/wr */
345507c3241Smlf 	char	ai_fw[8];	  /*  23  Firmware revision		*/
346507c3241Smlf 	char	ai_model[40];	  /*  27  Model #			*/
347507c3241Smlf 	ushort_t ai_mult1;	  /*  47  Multiple command flags	*/
348507c3241Smlf 	ushort_t ai_dwcap;	  /*  48  Doubleword capabilities	*/
349507c3241Smlf 	ushort_t ai_cap;	  /*  49  Capabilities			*/
350507c3241Smlf 	ushort_t ai_resv2;	  /*  50  Reserved			*/
351507c3241Smlf 	ushort_t ai_piomode;	  /*  51  PIO timing mode		*/
352507c3241Smlf 	ushort_t ai_dmamode;	  /*  52  DMA timing mode		*/
353507c3241Smlf 	ushort_t ai_validinfo;	  /*  53  bit0: wds 54-58, bit1: 64-70	*/
354507c3241Smlf 	ushort_t ai_curcyls;	  /*  54  # of current cylinders	*/
355507c3241Smlf 	ushort_t ai_curheads;	  /*  55  # of current heads		*/
356507c3241Smlf 	ushort_t ai_cursectrk;	  /*  56  # of current sectors/track	*/
357507c3241Smlf 	ushort_t ai_cursccp[2];	  /*  57  current sectors capacity	*/
358507c3241Smlf 	ushort_t ai_mult2;	  /*  59  multiple sectors info		*/
359507c3241Smlf 	ushort_t ai_addrsec[2];	  /*  60  LBA only: no of addr secs	*/
360507c3241Smlf 	ushort_t ai_sworddma;	  /*  62  single word dma modes		*/
361507c3241Smlf 	ushort_t ai_dworddma;	  /*  63  double word dma modes		*/
362507c3241Smlf 	ushort_t ai_advpiomode;	  /*  64  advanced PIO modes supported	*/
363507c3241Smlf 	ushort_t ai_minmwdma;	  /*  65  min multi-word dma cycle info	*/
364507c3241Smlf 	ushort_t ai_recmwdma;	  /*  66  rec multi-word dma cycle info	*/
365507c3241Smlf 	ushort_t ai_minpio;	  /*  67  min PIO cycle info		*/
366507c3241Smlf 	ushort_t ai_minpioflow;	  /*  68  min PIO cycle info w/flow ctl */
367507c3241Smlf 	ushort_t ai_resv3[2];	  /* 69,70 reserved			*/
368507c3241Smlf 	ushort_t ai_resv4[4];	  /* 71-74 reserved			*/
369507c3241Smlf 	ushort_t ai_qdepth;	  /*  75  queue depth			*/
370507c3241Smlf 	ushort_t ai_resv5[4];	  /* 76-79 reserved			*/
371507c3241Smlf 	ushort_t ai_majorversion; /*  80  major versions supported	*/
372507c3241Smlf 	ushort_t ai_minorversion; /*  81  minor version number supported */
373507c3241Smlf 	ushort_t ai_cmdset82;	  /*  82  command set supported		*/
374507c3241Smlf 	ushort_t ai_cmdset83;	  /*  83  more command sets supported	*/
375507c3241Smlf 	ushort_t ai_cmdset84;	  /*  84  more command sets supported	*/
376507c3241Smlf 	ushort_t ai_features85;	  /*  85 enabled features		*/
377507c3241Smlf 	ushort_t ai_features86;	  /*  86 enabled features		*/
378507c3241Smlf 	ushort_t ai_features87;	  /*  87 enabled features		*/
379507c3241Smlf 	ushort_t ai_ultradma;	  /*  88 Ultra DMA mode			*/
380507c3241Smlf 	ushort_t ai_erasetime;	  /*  89 security erase time		*/
381507c3241Smlf 	ushort_t ai_erasetimex;	  /*  90 enhanced security erase time	*/
382507c3241Smlf 	ushort_t ai_padding1[9];  /* pad through 99			*/
383507c3241Smlf 	ushort_t ai_addrsecxt[4]; /* 100 extended max LBA sector	*/
384507c3241Smlf 	ushort_t ai_padding2[22]; /* pad to 126				*/
385507c3241Smlf 	ushort_t ai_lastlun;	  /* 126 last LUN, as per SFF-8070i	*/
386507c3241Smlf 	ushort_t ai_resv6;	  /* 127 reserved			*/
387507c3241Smlf 	ushort_t ai_securestatus; /* 128 security status		*/
388507c3241Smlf 	ushort_t ai_vendor[31];	  /* 129-159 vendor specific		*/
389507c3241Smlf 	ushort_t ai_padding3[16]; /* 160 pad to 176			*/
390507c3241Smlf 	ushort_t ai_curmedser[30]; /* 176-205 current media serial number */
391507c3241Smlf 	ushort_t ai_padding4[49]; /* 206 pad to 255			*/
392507c3241Smlf 	ushort_t ai_integrity;	  /* 255 integrity word			*/
393