1*63278Smckusick /*- 2*63278Smckusick * Copyright (c) 1993 The Regents of the University of California. 3*63278Smckusick * All rights reserved. 4*63278Smckusick * 5*63278Smckusick * %sccs.include.redist.c% 6*63278Smckusick * 7*63278Smckusick * @(#)saio.h 7.1 (Berkeley) 06/11/93 8*63278Smckusick */ 9*63278Smckusick 10*63278Smckusick /* I/O block */ 11*63278Smckusick struct iob { 12*63278Smckusick int i_flgs; /* flags (see F_*) */ 13*63278Smckusick int i_adapt; /* adapter or bus */ 14*63278Smckusick int i_ctlr; /* controller */ 15*63278Smckusick int i_unit; /* pseudo device unit */ 16*63278Smckusick int i_part; /* disk partition */ 17*63278Smckusick daddr_t i_boff; /* block offset on device */ 18*63278Smckusick daddr_t i_cyloff; /* cylinder offset on device */ 19*63278Smckusick off_t i_offset; /* seek offset in file */ 20*63278Smckusick dev_t i_dev; /* associated device */ 21*63278Smckusick daddr_t i_bn; /* 1st block # of next read */ 22*63278Smckusick char *i_ma; /* memory address of I/O buffer */ 23*63278Smckusick int i_cc; /* character count of transfer */ 24*63278Smckusick int i_error; /* error # return */ 25*63278Smckusick int i_errcnt; /* error count for driver retries */ 26*63278Smckusick int i_errblk; /* block # in error for error reporting */ 27*63278Smckusick }; 28*63278Smckusick 29*63278Smckusick /* Codes for sector header word 1 */ 30*63278Smckusick #define HDR1_FMT22 0x1000 /* standard 16 bit format */ 31*63278Smckusick #define HDR1_OKSCT 0xc000 /* sector ok */ 32*63278Smckusick #define HDR1_SSF 0x2000 /* skip sector flag */ 33*63278Smckusick 34*63278Smckusick /* I/O flag values */ 35*63278Smckusick #define F_READ 0x0001 /* file opened for reading */ 36*63278Smckusick #define F_WRITE 0x0002 /* file opened for writing */ 37*63278Smckusick #define F_ALLOC 0x0004 /* buffer allocated */ 38*63278Smckusick #define F_FILE 0x0008 /* file instead of device */ 39*63278Smckusick #define F_NBSF 0x0010 /* no bad sector forwarding */ 40*63278Smckusick #define F_ECCLM 0x0020 /* limit # of bits in ecc correction */ 41*63278Smckusick #define F_SSI 0x0040 /* set skip sector inhibit */ 42*63278Smckusick #define F_SEVRE 0x0080 /* Severe burnin (no retries, no ECC) */ 43*63278Smckusick 44*63278Smckusick /* I/O types */ 45*63278Smckusick #define F_RDDATA 0x0100 /* read data */ 46*63278Smckusick #define F_WRDATA 0x0200 /* write data */ 47*63278Smckusick #define F_HDR 0x0400 /* include header on next i/o */ 48*63278Smckusick #define F_CHECK 0x0800 /* perform check of data read/write */ 49*63278Smckusick #define F_HCHECK 0x1000 /* perform check of header and data */ 50*63278Smckusick 51*63278Smckusick #define F_TYPEMASK 0xff00 /* I/O type mask */ 52*63278Smckusick 53*63278Smckusick #ifdef COMPAT_42 54*63278Smckusick /* 55*63278Smckusick * Old drive description table. 56*63278Smckusick * still used by some drivers for now. 57*63278Smckusick */ 58*63278Smckusick struct st { 59*63278Smckusick short nsect; /* # sectors/track */ 60*63278Smckusick short ntrak; /* # tracks/surfaces/heads */ 61*63278Smckusick short nspc; /* # sectors/cylinder */ 62*63278Smckusick short ncyl; /* # cylinders */ 63*63278Smckusick short *off; /* partition offset table (cylinders) */ 64*63278Smckusick }; 65*63278Smckusick #endif 66