Home | History | Annotate | Line # | Download | only in pci
amrreg.h revision 1.3.54.1
      1  1.3.54.1     mjf /*	$NetBSD: amrreg.h,v 1.3.54.1 2008/06/02 13:23:36 mjf Exp $	*/
      2       1.1      ad 
      3       1.1      ad /*-
      4       1.2      ad  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
      5       1.1      ad  * All rights reserved.
      6       1.1      ad  *
      7       1.1      ad  * This code is derived from software contributed to The NetBSD Foundation
      8       1.1      ad  * by Andrew Doran.
      9       1.1      ad  *
     10       1.1      ad  * Redistribution and use in source and binary forms, with or without
     11       1.1      ad  * modification, are permitted provided that the following conditions
     12       1.1      ad  * are met:
     13       1.1      ad  * 1. Redistributions of source code must retain the above copyright
     14       1.1      ad  *    notice, this list of conditions and the following disclaimer.
     15       1.1      ad  * 2. Redistributions in binary form must reproduce the above copyright
     16       1.1      ad  *    notice, this list of conditions and the following disclaimer in the
     17       1.1      ad  *    documentation and/or other materials provided with the distribution.
     18       1.1      ad  *
     19       1.1      ad  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20       1.1      ad  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21       1.1      ad  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22       1.1      ad  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23       1.1      ad  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24       1.1      ad  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25       1.1      ad  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26       1.1      ad  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27       1.1      ad  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28       1.1      ad  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29       1.1      ad  * POSSIBILITY OF SUCH DAMAGE.
     30       1.1      ad  */
     31       1.1      ad 
     32       1.1      ad /*-
     33       1.1      ad  * Copyright (c) 1999,2000 Michael Smith
     34       1.1      ad  * Copyright (c) 2000 BSDi
     35       1.1      ad  * All rights reserved.
     36       1.1      ad  *
     37       1.1      ad  * Redistribution and use in source and binary forms, with or without
     38       1.1      ad  * modification, are permitted provided that the following conditions
     39       1.1      ad  * are met:
     40       1.1      ad  * 1. Redistributions of source code must retain the above copyright
     41       1.1      ad  *    notice, this list of conditions and the following disclaimer.
     42       1.1      ad  * 2. Redistributions in binary form must reproduce the above copyright
     43       1.1      ad  *    notice, this list of conditions and the following disclaimer in the
     44       1.1      ad  *    documentation and/or other materials provided with the distribution.
     45       1.1      ad  *
     46       1.1      ad  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     47       1.1      ad  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     48       1.1      ad  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     49       1.1      ad  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     50       1.1      ad  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     51       1.1      ad  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     52       1.1      ad  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     53       1.1      ad  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     54       1.1      ad  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     55       1.1      ad  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     56       1.1      ad  * SUCH DAMAGE.
     57       1.1      ad  *
     58       1.1      ad  * from FreeBSD: amrreg.h,v 1.2 2000/08/30 07:52:40 msmith Exp
     59       1.1      ad  */
     60       1.1      ad 
     61       1.1      ad #ifndef	_PCI_AMRREG_H_
     62       1.1      ad #define	_PCI_AMRREG_H_
     63       1.1      ad 
     64       1.1      ad #ifdef AMR_CRASH_ME
     65       1.1      ad #define	AMR_MAX_CMDS		255		/* ident = 0 not allowed */
     66       1.1      ad #else
     67       1.1      ad #define	AMR_MAX_CMDS		120
     68       1.1      ad #endif
     69       1.1      ad #define	AMR_MAXLD      		40
     70       1.1      ad 
     71       1.1      ad #define	AMR_MAX_CMDS_PU		63
     72       1.1      ad 
     73       1.2      ad #define	AMR_MAX_SEGS		26
     74       1.1      ad #define	AMR_MAX_CHANNEL		3
     75       1.1      ad #define	AMR_MAX_TARGET		15
     76       1.1      ad #define	AMR_MAX_LUN		7
     77       1.1      ad 
     78       1.1      ad #define	AMR_MAX_CDB_LEN		0x0a
     79       1.1      ad #define	AMR_MAX_REQ_SENSE_LEN	0x20
     80       1.1      ad 
     81       1.1      ad #define	AMR_SECTOR_SIZE		512
     82       1.1      ad 
     83       1.1      ad /* Mailbox commands.*/
     84       1.1      ad #define	AMR_CMD_LREAD		0x01
     85       1.1      ad #define	AMR_CMD_LWRITE		0x02
     86       1.1      ad #define	AMR_CMD_PASS		0x03
     87       1.1      ad #define	AMR_CMD_EXT_ENQUIRY	0x04
     88       1.1      ad #define	AMR_CMD_ENQUIRY		0x05
     89       1.1      ad #define	AMR_CMD_FLUSH		0x0a
     90       1.1      ad #define	AMR_CMD_EXT_ENQUIRY2	0x0c
     91       1.1      ad #define	AMR_CMD_GET_MACHINEID	0x36
     92       1.1      ad #define	AMR_CMD_GET_INITIATOR	0x7d	/* returns one byte */
     93       1.1      ad #define	AMR_CMD_CONFIG		0xa1
     94       1.1      ad #define	AMR_CONFIG_PRODUCT_INFO			0x0e
     95       1.1      ad #define	AMR_CONFIG_ENQ3				0x0f
     96       1.1      ad #define	AMR_CONFIG_ENQ3_SOLICITED_NOTIFY	0x01
     97       1.1      ad #define	AMR_CONFIG_ENQ3_SOLICITED_FULL		0x02
     98       1.1      ad #define	AMR_CONFIG_ENQ3_UNSOLICITED		0x03
     99       1.1      ad 
    100       1.1      ad /* Command completion status. */
    101       1.1      ad #define	AMR_STATUS_SUCCESS	0x00
    102       1.1      ad #define	AMR_STATUS_ABORTED	0x02
    103       1.1      ad #define	AMR_STATUS_FAILED	0x80
    104       1.1      ad 
    105       1.1      ad /* Physical/logical drive states. */
    106       1.1      ad #define	AMR_DRV_CURSTATE(x)	((x) & 0x0f)
    107       1.1      ad #define	AMR_DRV_PREVSTATE(x)	(((x) >> 4) & 0x0f)
    108       1.1      ad #define	AMR_DRV_OFFLINE		0x00
    109       1.1      ad #define	AMR_DRV_DEGRADED	0x01
    110       1.1      ad #define	AMR_DRV_OPTIMAL		0x02
    111       1.1      ad #define	AMR_DRV_ONLINE		0x03
    112       1.1      ad #define	AMR_DRV_FAILED		0x04
    113       1.1      ad #define	AMR_DRV_REBUILD		0x05
    114       1.1      ad #define	AMR_DRV_HOTSPARE	0x06
    115       1.1      ad 
    116       1.1      ad /* Logical drive properties. */
    117       1.1      ad #define	AMR_DRV_RAID_MASK	0x0f	/* RAID level 0, 1, 3, 5, etc. */
    118       1.1      ad #define	AMR_DRV_WRITEBACK	0x10	/* write-back enabled */
    119       1.1      ad #define	AMR_DRV_READHEAD	0x20	/* readhead policy enabled */
    120       1.1      ad #define	AMR_DRV_ADAPTIVE	0x40	/* adaptive I/O policy enabled */
    121       1.1      ad 
    122       1.1      ad /* Battery status. */
    123       1.1      ad #define	AMR_BATT_MODULE_MISSING		0x01
    124       1.1      ad #define	AMR_BATT_LOW_VOLTAGE		0x02
    125       1.1      ad #define	AMR_BATT_TEMP_HIGH		0x04
    126       1.1      ad #define	AMR_BATT_PACK_MISSING		0x08
    127       1.1      ad #define	AMR_BATT_CHARGE_MASK		0x30
    128       1.1      ad #define	AMR_BATT_CHARGE_DONE		0x00
    129       1.1      ad #define	AMR_BATT_CHARGE_INPROG		0x10
    130       1.1      ad #define	AMR_BATT_CHARGE_FAIL		0x20
    131       1.1      ad #define	AMR_BATT_CYCLES_EXCEEDED	0x40
    132       1.1      ad 
    133       1.1      ad /*
    134       1.1      ad  * 8LD firmware interface.
    135       1.1      ad  */
    136       1.1      ad 
    137       1.1      ad /* Array constraints. */
    138       1.1      ad #define	AMR_8LD_MAXDRIVES	8
    139       1.1      ad #define	AMR_8LD_MAXCHAN		5
    140       1.1      ad #define	AMR_8LD_MAXTARG		15
    141       1.1      ad #define	AMR_8LD_MAXPHYSDRIVES	(AMR_8LD_MAXCHAN * AMR_8LD_MAXTARG)
    142       1.1      ad 
    143       1.1      ad /* Adapter information. */
    144       1.1      ad struct amr_adapter_info {
    145       1.1      ad 	u_int8_t	aa_maxio;
    146       1.1      ad 	u_int8_t	aa_rebuild_rate;
    147       1.1      ad 	u_int8_t	aa_maxtargchan;
    148       1.1      ad 	u_int8_t	aa_channels;
    149       1.1      ad 	u_int8_t	aa_firmware[4];
    150       1.1      ad 	u_int16_t	aa_flashage;
    151       1.1      ad 	u_int8_t	aa_chipsetvalue;
    152       1.1      ad 	u_int8_t	aa_memorysize;
    153       1.1      ad 	u_int8_t	aa_cacheflush;
    154       1.1      ad 	u_int8_t	aa_bios[4];
    155       1.1      ad 	u_int8_t	aa_boardtype;
    156       1.1      ad 	u_int8_t	aa_scsisensealert;
    157       1.1      ad 	u_int8_t	aa_writeconfigcount;
    158       1.1      ad 	u_int8_t	aa_driveinsertioncount;
    159       1.1      ad 	u_int8_t	aa_inserteddrive;
    160       1.1      ad 	u_int8_t	aa_batterystatus;
    161       1.1      ad 	u_int8_t   	aa_res1;
    162       1.1      ad } __attribute__ ((__packed__));
    163       1.1      ad 
    164       1.1      ad /* Logical drive information. */
    165       1.1      ad struct amr_logdrive_info {
    166       1.1      ad 	u_int8_t	al_numdrives;
    167       1.1      ad 	u_int8_t	al_res1[3];
    168       1.1      ad 	u_int32_t	al_size[AMR_8LD_MAXDRIVES];
    169       1.1      ad 	u_int8_t	al_properties[AMR_8LD_MAXDRIVES];
    170       1.1      ad 	u_int8_t	al_state[AMR_8LD_MAXDRIVES];
    171       1.1      ad } __attribute__ ((__packed__));
    172       1.1      ad 
    173       1.1      ad /* Physical drive information. */
    174       1.1      ad struct amr_physdrive_info {
    175       1.1      ad 	/* Low nybble is current state, high nybble is previous state. */
    176       1.1      ad 	u_int8_t	ap_state[AMR_8LD_MAXPHYSDRIVES];
    177       1.1      ad 	u_int8_t	ap_predictivefailure;
    178       1.1      ad } __attribute__ ((__packed__));
    179       1.1      ad 
    180       1.1      ad /*
    181       1.1      ad  * Enquiry response structure for AMR_CMD_ENQUIRY (e), AMR_CMD_EXT_ENQUIRY (x)
    182       1.1      ad  * and AMR_CMD_EXT_ENQUIRY2 (2).
    183       1.1      ad  */
    184       1.1      ad struct amr_enquiry {
    185       1.1      ad 	struct		amr_adapter_info ae_adapter;		/* e x 2 */
    186       1.1      ad 	struct		amr_logdrive_info ae_ldrv;		/* e x 2 */
    187       1.1      ad 	struct		amr_physdrive_info ae_pdrv;		/* e x 2 */
    188       1.1      ad 	u_int8_t	ae_formatting[AMR_8LD_MAXDRIVES];	/*   x 2 */
    189       1.1      ad 	u_int8_t	res1[AMR_8LD_MAXDRIVES];		/*   x 2 */
    190       1.1      ad 	u_int32_t	ae_extlen;				/*     2 */
    191       1.1      ad 	u_int16_t	ae_subsystem;				/*     2 */
    192       1.1      ad 	u_int16_t	ae_subvendor;				/*     2 */
    193       1.1      ad 	u_int32_t	ae_signature;				/*     2 */
    194       1.1      ad #define	AMR_SIG_431	0xfffe0001
    195       1.1      ad #define	AMR_SIG_438	0xfffd0002
    196       1.1      ad #define	AMR_SIG_762	0xfffc0003
    197       1.1      ad #define	AMR_SIG_T5	0xfffb0004
    198       1.1      ad #define	AMR_SIG_466	0xfffa0005
    199       1.1      ad #define	AMR_SIG_467	0xfff90006
    200       1.1      ad #define	AMR_SIG_T7	0xfff80007
    201       1.1      ad #define	AMR_SIG_490	0xfff70008
    202       1.1      ad 	u_int8_t	res2[844];				/*     2 */
    203       1.1      ad } __attribute__ ((__packed__));
    204       1.1      ad 
    205       1.1      ad /*
    206       1.1      ad  * 40LD firmware interface.
    207       1.1      ad  */
    208       1.1      ad 
    209       1.1      ad /* Array constraints. */
    210       1.1      ad #define	AMR_40LD_MAXDRIVES	40
    211       1.1      ad #define	AMR_40LD_MAXCHAN	16
    212       1.1      ad #define	AMR_40LD_MAXTARG	16
    213       1.1      ad #define	AMR_40LD_MAXPHYSDRIVES	256
    214       1.1      ad 
    215       1.1      ad /* Product information structure. */
    216       1.1      ad struct amr_prodinfo {
    217       1.1      ad 	u_int32_t	ap_size;		/* current size in bytes (not including resvd) */
    218       1.1      ad 	u_int32_t	ap_configsig;		/* default is 0x00282008, indicating 0x28 maximum
    219       1.1      ad 					 * logical drives, 0x20 maximum stripes and 0x08
    220       1.1      ad 					 * maximum spans */
    221       1.1      ad 	u_int8_t	ap_firmware[16];	/* printable identifiers */
    222       1.1      ad 	u_int8_t	ap_bios[16];
    223       1.1      ad 	u_int8_t	ap_product[80];
    224       1.1      ad 	u_int8_t	ap_maxio;		/* maximum number of concurrent commands supported */
    225       1.1      ad 	u_int8_t	ap_nschan;		/* number of SCSI channels present */
    226       1.1      ad 	u_int8_t	ap_fcloops;		/* number of fibre loops present */
    227       1.1      ad 	u_int8_t	ap_memtype;		/* memory type */
    228       1.1      ad 	u_int32_t	ap_signature;
    229       1.1      ad 	u_int16_t	ap_memsize;		/* onboard memory in MB */
    230       1.1      ad 	u_int16_t	ap_subsystem;		/* subsystem identifier */
    231       1.1      ad 	u_int16_t	ap_subvendor;		/* subsystem vendor ID */
    232       1.1      ad 	u_int8_t	ap_numnotifyctr;	/* number of notify counters */
    233       1.1      ad } __attribute__ ((__packed__));
    234       1.1      ad 
    235       1.1      ad /* Notify structure. */
    236       1.1      ad struct amr_notify {
    237       1.1      ad 	u_int32_t	an_globalcounter;	/* change counter */
    238       1.1      ad 
    239       1.1      ad 	u_int8_t	an_paramcounter;	/* parameter change counter */
    240       1.1      ad 	u_int8_t	an_paramid;
    241       1.1      ad #define	AMR_PARAM_REBUILD_RATE		0x01	/* value = new rebuild rate */
    242       1.1      ad #define	AMR_PARAM_FLUSH_INTERVAL	0x02	/* value = new flush interval */
    243       1.1      ad #define	AMR_PARAM_SENSE_ALERT		0x03	/* value = last physical drive with check condition set */
    244       1.1      ad #define	AMR_PARAM_DRIVE_INSERTED	0x04	/* value = last physical drive inserted */
    245       1.1      ad #define	AMR_PARAM_BATTERY_STATUS	0x05	/* value = battery status */
    246       1.1      ad 	u_int16_t	an_paramval;
    247       1.1      ad 
    248       1.1      ad 	u_int8_t	an_writeconfigcounter;	/* write config occurred */
    249       1.1      ad 	u_int8_t	res1[3];
    250       1.1      ad 
    251       1.1      ad 	u_int8_t	an_ldrvopcounter;	/* logical drive operation started/completed */
    252       1.1      ad 	u_int8_t	an_ldrvopid;
    253       1.1      ad 	u_int8_t	an_ldrvopcmd;
    254       1.1      ad #define	AMR_LDRVOP_CHECK	0x01
    255       1.1      ad #define	AMR_LDRVOP_INIT		0x02
    256       1.1      ad #define	AMR_LDRVOP_REBUILD	0x03
    257       1.1      ad 	u_int8_t	an_ldrvopstatus;
    258       1.1      ad #define	AMR_LDRVOP_SUCCESS	0x00
    259       1.1      ad #define	AMR_LDRVOP_FAILED	0x01
    260       1.1      ad #define	AMR_LDRVOP_ABORTED	0x02
    261       1.1      ad #define	AMR_LDRVOP_CORRECTED	0x03
    262       1.1      ad #define	AMR_LDRVOP_STARTED	0x04
    263       1.1      ad 
    264       1.1      ad 	u_int8_t	an_ldrvstatecounter;	/* logical drive state change occurred */
    265       1.1      ad 	u_int8_t	an_ldrvstateid;
    266       1.1      ad 	u_int8_t	an_ldrvstatenew;
    267       1.1      ad 	u_int8_t	an_ldrvstateold;
    268       1.1      ad 
    269       1.1      ad 	u_int8_t	an_pdrvstatecounter;	/* physical drive state change occurred */
    270       1.1      ad 	u_int8_t	an_pdrvstateid;
    271       1.1      ad 	u_int8_t	an_pdrvstatenew;
    272       1.1      ad 	u_int8_t	an_pdrvstateold;
    273       1.1      ad 
    274       1.1      ad 	u_int8_t	an_pdrvfmtcounter;
    275       1.1      ad 	u_int8_t	an_pdrvfmtid;
    276       1.1      ad 	u_int8_t	an_pdrvfmtval;
    277       1.1      ad #define	AMR_FORMAT_START	0x01
    278       1.1      ad #define	AMR_FORMAT_COMPLETE	0x02
    279       1.1      ad 	u_int8_t	res2;
    280       1.1      ad 
    281       1.1      ad 	u_int8_t	an_targxfercounter;	/* scsi xfer rate change */
    282       1.1      ad 	u_int8_t	an_targxferid;
    283       1.1      ad 	u_int8_t	an_targxferval;
    284       1.1      ad 	u_int8_t	res3;
    285       1.1      ad 
    286       1.1      ad 	u_int8_t	an_fcloopidcounter;	/* FC/AL loop ID changed */
    287       1.1      ad 	u_int8_t	an_fcloopidpdrvid;
    288       1.1      ad 	u_int8_t	an_fcloopid0;
    289       1.1      ad 	u_int8_t	an_fcloopid1;
    290       1.1      ad 
    291       1.1      ad 	u_int8_t	an_fcloopstatecounter;	/* FC/AL loop status changed */
    292       1.1      ad 	u_int8_t	an_fcloopstate0;
    293       1.1      ad 	u_int8_t	an_fcloopstate1;
    294       1.1      ad 	u_int8_t	res4;
    295       1.1      ad } __attribute__ ((__packed__));
    296       1.1      ad 
    297       1.1      ad /* Enquiry3 structure. */
    298       1.1      ad struct amr_enquiry3 {
    299       1.1      ad 	u_int32_t	ae_datasize;		/* valid data size in this structure */
    300       1.1      ad 	union {				/* event notify structure */
    301       1.1      ad 	struct amr_notify	n;
    302       1.1      ad 	u_int8_t		pad[0x80];
    303       1.1      ad 	} 		ae_notify;
    304       1.1      ad 	u_int8_t	ae_rebuildrate;		/* current rebuild rate in % */
    305       1.1      ad 	u_int8_t	ae_cacheflush;		/* flush interval in seconds */
    306       1.1      ad 	u_int8_t	ae_sensealert;
    307       1.1      ad 	u_int8_t	ae_driveinsertcount;	/* count of inserted drives */
    308       1.1      ad 	u_int8_t	ae_batterystatus;
    309       1.1      ad 	u_int8_t	ae_numldrives;
    310       1.1      ad 	u_int8_t	ae_reconstate[AMR_40LD_MAXDRIVES / 8];	/* reconstruction state */
    311       1.1      ad 	u_int16_t	ae_opstatus[AMR_40LD_MAXDRIVES / 8];	/* operation status per drive */
    312       1.1      ad 	u_int32_t	ae_drivesize[AMR_40LD_MAXDRIVES];	/* logical drive size */
    313       1.1      ad 	u_int8_t	ae_driveprop[AMR_40LD_MAXDRIVES];	/* logical drive properties */
    314       1.1      ad 	u_int8_t	ae_drivestate[AMR_40LD_MAXDRIVES];	/* physical drive state */
    315       1.3  bouyer 	u_int8_t	ae_pdrivestate[AMR_40LD_MAXPHYSDRIVES]; /* physical drive state */
    316       1.1      ad 	u_int16_t	ae_driveformat[AMR_40LD_MAXPHYSDRIVES];
    317       1.1      ad 	u_int8_t	ae_targxfer[80];			/* physical drive transfer rates */
    318       1.1      ad 
    319       1.1      ad 	u_int8_t	res1[263];		/* pad to 1024 bytes */
    320       1.1      ad } __attribute__ ((__packed__));
    321       1.1      ad 
    322       1.1      ad /*
    323       1.1      ad  * Mailbox and command structures.
    324       1.1      ad  */
    325       1.1      ad 
    326       1.2      ad struct amr_mailbox_cmd {
    327       1.1      ad 	u_int8_t	mb_command;
    328       1.1      ad 	u_int8_t	mb_ident;
    329       1.1      ad 	u_int16_t	mb_blkcount;
    330       1.1      ad 	u_int32_t	mb_lba;
    331       1.1      ad 	u_int32_t	mb_physaddr;
    332       1.1      ad 	u_int8_t	mb_drive;
    333       1.1      ad 	u_int8_t	mb_nsgelem;
    334       1.1      ad 	u_int8_t	res1;
    335       1.1      ad 	u_int8_t	mb_busy;
    336       1.2      ad } __attribute__ ((__packed__));
    337       1.2      ad 
    338       1.2      ad struct amr_mailbox_resp {
    339       1.1      ad 	u_int8_t	mb_nstatus;
    340       1.1      ad 	u_int8_t	mb_status;
    341       1.1      ad 	u_int8_t	mb_completed[46];
    342       1.2      ad }  __attribute__ ((__packed__));
    343       1.2      ad 
    344       1.2      ad struct amr_mailbox {
    345       1.2      ad 	u_int32_t	mb_res1[3];
    346       1.2      ad 	u_int32_t	mb_segment;
    347       1.2      ad 	struct		amr_mailbox_cmd mb_cmd;
    348       1.2      ad 	struct		amr_mailbox_resp mb_resp;
    349       1.1      ad 	u_int8_t	mb_poll;
    350       1.1      ad 	u_int8_t	mb_ack;
    351       1.2      ad 	u_int8_t	res2[62];		/* Pad to 128+16 bytes. */
    352       1.1      ad } __attribute__ ((__packed__));
    353       1.1      ad 
    354       1.1      ad struct amr_mailbox_ioctl {
    355       1.1      ad 	u_int8_t	mb_command;
    356       1.1      ad 	u_int8_t	mb_ident;
    357       1.1      ad 	u_int8_t	mb_channel;
    358       1.1      ad 	u_int8_t	mb_param;
    359       1.1      ad 	u_int8_t	mb_pad[4];
    360       1.1      ad 	u_int32_t	mb_physaddr;
    361       1.1      ad 	u_int8_t	mb_drive;
    362       1.1      ad 	u_int8_t	mb_nsgelem;
    363       1.1      ad 	u_int8_t	res1;
    364       1.1      ad 	u_int8_t	mb_busy;
    365       1.1      ad 	u_int8_t	mb_nstatus;
    366       1.1      ad 	u_int8_t	mb_completed[46];
    367       1.1      ad 	u_int8_t	mb_poll;
    368       1.1      ad 	u_int8_t	mb_ack;
    369       1.1      ad 	u_int8_t	res4[16];
    370       1.1      ad } __attribute__ ((__packed__));
    371       1.1      ad 
    372       1.1      ad struct amr_sgentry {
    373       1.1      ad 	u_int32_t	sge_addr;
    374       1.1      ad 	u_int32_t	sge_count;
    375       1.1      ad } __attribute__ ((__packed__));
    376       1.1      ad 
    377       1.1      ad struct amr_passthrough {
    378       1.1      ad 	u_int8_t	ap_timeout:3;
    379       1.1      ad 	u_int8_t	ap_ars:1;
    380       1.1      ad 	u_int8_t	ap_dummy:3;
    381       1.1      ad 	u_int8_t	ap_islogical:1;
    382       1.1      ad 	u_int8_t	ap_logical_drive_no;
    383       1.1      ad 	u_int8_t	ap_channel;
    384       1.1      ad 	u_int8_t	ap_scsi_id;
    385       1.1      ad 	u_int8_t	ap_queue_tag;
    386       1.1      ad 	u_int8_t	ap_queue_action;
    387       1.1      ad 	u_int8_t	ap_cdb[AMR_MAX_CDB_LEN];
    388       1.1      ad 	u_int8_t	ap_cdb_length;
    389       1.1      ad 	u_int8_t	ap_request_sense_length;
    390       1.1      ad 	u_int8_t	ap_request_sense_area[AMR_MAX_REQ_SENSE_LEN];
    391       1.1      ad 	u_int8_t	ap_no_sg_elements;
    392       1.1      ad 	u_int8_t	ap_scsi_status;
    393       1.1      ad 	u_int32_t	ap_data_transfer_address;
    394       1.1      ad 	u_int32_t	ap_data_transfer_length;
    395       1.1      ad } __attribute__ ((__packed__));
    396       1.1      ad 
    397       1.1      ad /*
    398       1.1      ad  * "Quartz" i960 PCI bridge interface.
    399       1.1      ad  */
    400       1.1      ad 
    401       1.1      ad #define	AMR_QUARTZ_SIG_REG	0xa0
    402       1.1      ad #define	AMR_QUARTZ_SIG0		0xcccc
    403       1.1      ad #define	AMR_QUARTZ_SIG1		0x3344
    404       1.1      ad 
    405       1.1      ad /* Doorbell registers. */
    406       1.1      ad #define	AMR_QREG_IDB		0x20
    407       1.1      ad #define	AMR_QREG_ODB		0x2c
    408       1.1      ad 
    409       1.1      ad #define	AMR_QIDB_SUBMIT		0x00000001	/* mailbox ready for work */
    410       1.1      ad #define	AMR_QIDB_ACK		0x00000002	/* mailbox done */
    411       1.1      ad #define	AMR_QODB_READY		0x10001234	/* work ready to be processed */
    412       1.1      ad 
    413       1.1      ad /*
    414       1.1      ad  * Old-style ("standard") ASIC bridge interface.
    415       1.1      ad  */
    416       1.1      ad 
    417       1.1      ad /* I/O registers. */
    418       1.1      ad #define	AMR_SREG_CMD		0x10	/* Command/ack register (w) */
    419       1.1      ad #define	AMR_SREG_MBOX_BUSY	0x10	/* Mailbox status (r) */
    420       1.1      ad #define	AMR_SREG_TOGL		0x11	/* Interrupt enable */
    421       1.1      ad #define	AMR_SREG_MBOX		0x14	/* Mailbox physical address */
    422       1.1      ad #define	AMR_SREG_MBOX_ENABLE	0x18	/* Atomic mailbox address enable */
    423       1.1      ad #define	AMR_SREG_INTR		0x1a	/* Interrupt status */
    424       1.1      ad 
    425       1.1      ad /* I/O magic numbers. */
    426       1.1      ad #define	AMR_SCMD_POST		0x10	/* in SCMD to initiate action on mailbox */
    427       1.1      ad #define	AMR_SCMD_ACKINTR	0x08	/* in SCMD to ack mailbox retrieved */
    428       1.1      ad #define	AMR_STOGL_ENABLE	0xc0	/* in STOGL */
    429       1.1      ad #define	AMR_SINTR_VALID		0x40	/* in SINTR */
    430       1.1      ad #define	AMR_SMBOX_BUSY_FLAG	0x10	/* in SMBOX_BUSY */
    431       1.1      ad #define	AMR_SMBOX_ENABLE_ADDR	0x00	/* in SMBOX_ENABLE */
    432       1.1      ad 
    433       1.1      ad #endif	/* !_PCI_AMRREG_H_ */
    434