struct UDPAC
{ /* UDC command packet */
char _pksiz
; /* 21 bytes */
char _pkdev
; /* device # */
char _pkcmd
; /* Command type */
char _pkfnc
; /* Function type */
short _pkcnt
; /* # of data blocks (1/4K each) */
short _pbsiz
; /* Block length size (0x100 = 1/4K) */
short _pkmem
[2] ; /* Starting memory address.Should be 'long' but
we can't write it this way on Tahoe,
because of alignment problems - the C
will gap after the previous 'short' */
short _pcksm
; /* Checksum (unused) */
long _psecno
; /* Starting sector # */
#define SECTSIZ 256 /* sector size */
#define L2SIZ 8 /* log2 of sector size */
#define L2BSIZ 10 /* log2 of block size */
#define NUDC 1 /* number of UDC controllers */
#define NUNIT 8 /* number of units per controller */
#define NUDDRV 5 /* number of drive types supported */
#define DK_N 1 /* Monitoring device bit */
** Block devices sizes structure
#define udaddr ( (char *)(0xff0000+IOBASE) )
#define INT 0x00d /* interrupt offset */
#define RST 0x00f /* controller reset offset */
#define PKID 0x187 /* packet id */
#define PKLEN 0x189 /* packet length */
#define PKDEV 0x18b /* device # */
#define PKCMD 0x18d /* command type */
#define PKSTT 0x18f /* status type */
#define STAT1 0x191 /* i/o status result offset */
#define DEVSIZE 0x199 /* # of sectors in device status message */
#define UDWTRY 0x01 /* read with retry */
#define UDWCRC 0x01 /* write sectors and check CRC */
#define UDWSECT 0x02 /* write sectors */
#define UDSTAT 0x02 /* Test status */
#define DEVRDY 0x80 /* device ready bit in status byte */
#define DEVTYPE 0x7 /* bits 0-2 in status byte define device */
/* Some I/O addresses used to generate pulses for scopes */
extern char vmem
[][16*NBPG
];
#define IOaddr(off) (caddr_t)((int)vmem + ((off) & 0x0fffff))
#define scope_out(x) if(iospace_mapped) movob(IOaddr(OUT/**/x),0)
#define scope_in(x) if(iospace_mapped) dummy = *IOaddr(IN/**/x)