Home | History | Annotate | Line # | Download | only in isa
wdsreg.h revision 1.1
      1  1.1  mycroft typedef u_char physaddr[3];
      2  1.1  mycroft typedef u_char physlen[3];
      3  1.1  mycroft #define	ltophys	_lto3b
      4  1.1  mycroft #define	phystol	_3btol
      5  1.1  mycroft 
      6  1.1  mycroft /* WD7000 registers */
      7  1.1  mycroft #define WDS_STAT		0	/* read */
      8  1.1  mycroft #define WDS_IRQSTAT		1	/* read */
      9  1.1  mycroft 
     10  1.1  mycroft #define WDS_CMD			0	/* write */
     11  1.1  mycroft #define WDS_IRQACK		1	/* write */
     12  1.1  mycroft #define WDS_HCR			2	/* write */
     13  1.1  mycroft 
     14  1.1  mycroft /* WDS_STAT (read) defs */
     15  1.1  mycroft #define WDSS_IRQ		0x80
     16  1.1  mycroft #define WDSS_RDY		0x40
     17  1.1  mycroft #define WDSS_REJ		0x20
     18  1.1  mycroft #define WDSS_INIT		0x10
     19  1.1  mycroft 
     20  1.1  mycroft /* WDS_IRQSTAT (read) defs */
     21  1.1  mycroft #define WDSI_MASK		0xc0
     22  1.1  mycroft #define WDSI_ERR		0x00
     23  1.1  mycroft #define WDSI_MFREE		0x80
     24  1.1  mycroft #define WDSI_MSVC		0xc0
     25  1.1  mycroft 
     26  1.1  mycroft /* WDS_CMD (write) defs */
     27  1.1  mycroft #define WDSC_NOOP		0x00
     28  1.1  mycroft #define WDSC_INIT		0x01
     29  1.1  mycroft #define WDSC_DISUNSOL		0x02
     30  1.1  mycroft #define WDSC_ENAUNSOL		0x03
     31  1.1  mycroft #define WDSC_IRQMFREE		0x04
     32  1.1  mycroft #define WDSC_SCSIRESETSOFT	0x05
     33  1.1  mycroft #define WDSC_SCSIRESETHARD	0x06
     34  1.1  mycroft #define WDSC_MSTART(m)		(0x80 + (m))
     35  1.1  mycroft #define WDSC_MMSTART(m)		(0xc0 + (m))
     36  1.1  mycroft 
     37  1.1  mycroft /* WDS_HCR (write) defs */
     38  1.1  mycroft #define WDSH_IRQEN		0x08
     39  1.1  mycroft #define WDSH_DRQEN		0x04
     40  1.1  mycroft #define WDSH_SCSIRESET		0x02
     41  1.1  mycroft #define WDSH_ASCRESET		0x01
     42  1.1  mycroft 
     43  1.1  mycroft #define WDS_NSEG	17
     44  1.1  mycroft 
     45  1.1  mycroft struct wds_scat_gath {
     46  1.1  mycroft 	physlen seg_len;
     47  1.1  mycroft 	physaddr seg_addr;
     48  1.1  mycroft };
     49  1.1  mycroft 
     50  1.1  mycroft struct wds_cmd {
     51  1.1  mycroft 	u_char opcode;
     52  1.1  mycroft 	u_char targ;
     53  1.1  mycroft 	struct scsi_generic scb;
     54  1.1  mycroft 	u_char stat;
     55  1.1  mycroft 	u_char venderr;
     56  1.1  mycroft 	physlen len;
     57  1.1  mycroft 	physaddr data;
     58  1.1  mycroft 	physaddr link;
     59  1.1  mycroft 	u_char write;
     60  1.1  mycroft 	u_char xx[6];
     61  1.1  mycroft };
     62  1.1  mycroft 
     63  1.1  mycroft struct wds_scb {
     64  1.1  mycroft 	struct wds_cmd cmd;
     65  1.1  mycroft 	struct wds_cmd sense;
     66  1.1  mycroft 
     67  1.1  mycroft 	struct wds_scat_gath scat_gath[WDS_NSEG];
     68  1.1  mycroft 	struct scsi_sense_data sense_data;
     69  1.1  mycroft 
     70  1.1  mycroft 	TAILQ_ENTRY(wds_scb) chain;
     71  1.1  mycroft 	struct wds_scb *nexthash;
     72  1.1  mycroft 	long hashkey;
     73  1.1  mycroft 	struct scsi_xfer *xs;
     74  1.1  mycroft 	int flags;
     75  1.1  mycroft #define	SCB_ALLOC	0x01
     76  1.1  mycroft #define	SCB_ABORT	0x02
     77  1.1  mycroft #ifdef WDSDIAG
     78  1.1  mycroft #define	SCB_SENDING	0x04
     79  1.1  mycroft #endif
     80  1.1  mycroft #define	SCB_POLLED	0x08
     81  1.1  mycroft #define	SCB_SENSE	0x10
     82  1.1  mycroft #define	SCB_DONE	0x20	/* for internal commands only */
     83  1.1  mycroft #define	SCB_BUFFER	0x40
     84  1.1  mycroft 	int timeout;
     85  1.1  mycroft 
     86  1.1  mycroft 	struct wds_buf *buf;
     87  1.1  mycroft };
     88  1.1  mycroft 
     89  1.1  mycroft #define WDSX_SCSICMD		0x00
     90  1.1  mycroft #define WDSX_SCSISG		0x01
     91  1.1  mycroft #define WDSX_OPEN_RCVBUF	0x80
     92  1.1  mycroft #define WDSX_RCV_CMD		0x81
     93  1.1  mycroft #define WDSX_RCV_DATA		0x82
     94  1.1  mycroft #define WDSX_RCV_DATASTAT	0x83
     95  1.1  mycroft #define WDSX_SND_DATA		0x84
     96  1.1  mycroft #define WDSX_SND_DATASTAT	0x85
     97  1.1  mycroft #define WDSX_SND_CMDSTAT	0x86
     98  1.1  mycroft #define WDSX_READINIT		0x88
     99  1.1  mycroft #define WDSX_READSCSIID		0x89
    100  1.1  mycroft #define WDSX_SETUNSOLIRQMASK	0x8a
    101  1.1  mycroft #define WDSX_GETUNSOLIRQMASK	0x8b
    102  1.1  mycroft #define WDSX_GETFIRMREV		0x8c
    103  1.1  mycroft #define WDSX_EXECDIAG		0x8d
    104  1.1  mycroft #define WDSX_SETEXECPARM	0x8e
    105  1.1  mycroft #define WDSX_GETEXECPARM	0x8f
    106  1.1  mycroft 
    107  1.1  mycroft struct wds_mbx_out {
    108  1.1  mycroft 	u_char cmd;
    109  1.1  mycroft 	physaddr scb_addr;
    110  1.1  mycroft };
    111  1.1  mycroft 
    112  1.1  mycroft struct wds_mbx_in {
    113  1.1  mycroft 	u_char stat;
    114  1.1  mycroft 	physaddr scb_addr;
    115  1.1  mycroft };
    116  1.1  mycroft 
    117  1.1  mycroft /*
    118  1.1  mycroft  * mbo.cmd values
    119  1.1  mycroft  */
    120  1.1  mycroft #define	WDS_MBO_FREE		0x0	/* MBO entry is free */
    121  1.1  mycroft #define	WDS_MBO_START		0x1	/* MBO activate entry */
    122  1.1  mycroft 
    123  1.1  mycroft /*
    124  1.1  mycroft  * mbi.stat values
    125  1.1  mycroft  */
    126  1.1  mycroft #define	WDS_MBI_FREE		0x00	/* MBI entry is free */
    127  1.1  mycroft #define WDS_MBI_OK		0x01	/* completed without error */
    128  1.1  mycroft #define WDS_MBI_OKERR		0x02	/* completed with error */
    129  1.1  mycroft #define WDS_MBI_ETIME		0x04
    130  1.1  mycroft #define WDS_MBI_ERESET		0x05
    131  1.1  mycroft #define WDS_MBI_ETARCMD		0x06
    132  1.1  mycroft #define WDS_MBI_ERESEL		0x80
    133  1.1  mycroft #define WDS_MBI_ESEL		0x81
    134  1.1  mycroft #define WDS_MBI_EABORT		0x82
    135  1.1  mycroft #define WDS_MBI_ESRESET		0x83
    136  1.1  mycroft #define WDS_MBI_EHRESET		0x84
    137  1.1  mycroft 
    138  1.1  mycroft struct wds_setup {
    139  1.1  mycroft 	u_char opcode;
    140  1.1  mycroft 	u_char scsi_id;
    141  1.1  mycroft 	u_char buson_t;
    142  1.1  mycroft 	u_char busoff_t;
    143  1.1  mycroft 	u_char xx;
    144  1.1  mycroft 	physaddr mbaddr;
    145  1.1  mycroft 	u_char nomb;
    146  1.1  mycroft 	u_char nimb;
    147  1.1  mycroft };
    148