|
|
1.1 ! root 1: /* ! 2: * /usr/include/sys/hdioctl.h ! 3: * ! 4: * Ioctl support for hard disk devices. ! 5: * ! 6: * Revised: Sun Aug 1 17:24:39 1993 CDT ! 7: */ ! 8: #ifndef __SYS_HDIOCTL_H__ ! 9: #define __SYS_HDIOCTL_H__ ! 10: ! 11: #define HDIOC ('H' << 8) ! 12: #define HDGETA (HDIOC|1) /* get drive attributes */ ! 13: #define HDSETA (HDIOC|2) /* set drive attributes */ ! 14: ! 15: /* ! 16: * Drive attributes ! 17: * Note: all fields defined as bytes to prevent compiler arith probs. ! 18: * All multi-byte fields are stored low-byte first. ! 19: * This struct is configured for binary compatibility with ROM data! ! 20: */ ! 21: typedef struct hdparm_s { ! 22: unsigned char ncyl[2]; /* number of cylinders */ ! 23: unsigned char nhead; /* number heads */ ! 24: unsigned char rwccp[2]; /* reduced write curr cyl */ ! 25: unsigned char wpcc[2]; /* write pre-compensation cyl */ ! 26: unsigned char eccl; /* max ecc data length */ ! 27: unsigned char ctrl; /* control byte */ ! 28: unsigned char fill2[3]; ! 29: unsigned char landc[2]; /* landing zone cylinder */ ! 30: unsigned char nspt; /* number of sectors per track */ ! 31: unsigned char hdfill3; ! 32: } hdparm_t; ! 33: ! 34: /* Macro for initializing drive parameter tables. */ ! 35: #define _HDPARMS(cyl,hd,spt,ctl,pcomp) { \ ! 36: { (cyl) & 0xFF, (cyl) >> 8 }, hd, { 0, 0 }, \ ! 37: { (pcomp) & 0xFF, (pcomp) >> 8 }, 0, ctl, \ ! 38: { 0, 0, 0 }, { 0 , 0 }, spt, 0 } ! 39: ! 40: /* Convert from a 2-element unsigned char array to unsigned short. */ ! 41: #define _CHAR2_TO_USHORT(c_array) \ ! 42: ((unsigned short) ((c_array)[1] << 8) | (c_array)[0]) ! 43: ! 44: /* Copy number into a 2-element unsigned char array. */ ! 45: #define _NUM_TO_CHAR2(c_array, num) \ ! 46: (((c_array)[0] = num & 0xFF), ((c_array)[1] = num >> 8)) ! 47: ! 48: #if __KERNEL__ ! 49: #define N_ATDRV 2 /* only two drives supported */ ! 50: #endif ! 51: ! 52: #endif /* ndef __SYS_HDIOCTL_H__ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.