Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    1) ==============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    2) Summary of `HDIO_` ioctl calls
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    3) ==============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    5) - Edward A. Falk <efalk@google.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    7) November, 2004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    9) This document attempts to describe the ioctl(2) calls supported by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   10) the HD/IDE layer.  These are by-and-large implemented (as of Linux 2.6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   11) in drivers/ide/ide.c and drivers/block/scsi_ioctl.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   13) ioctl values are listed in <linux/hdreg.h>.  As of this writing, they
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   14) are as follows:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   16)     ioctls that pass argument pointers to user space:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   18) 	=======================	=======================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   19) 	HDIO_GETGEO		get device geometry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   20) 	HDIO_GET_UNMASKINTR	get current unmask setting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   21) 	HDIO_GET_MULTCOUNT	get current IDE blockmode setting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   22) 	HDIO_GET_QDMA		get use-qdma flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   23) 	HDIO_SET_XFER		set transfer rate via proc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   24) 	HDIO_OBSOLETE_IDENTITY	OBSOLETE, DO NOT USE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   25) 	HDIO_GET_KEEPSETTINGS	get keep-settings-on-reset flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   26) 	HDIO_GET_32BIT		get current io_32bit setting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   27) 	HDIO_GET_NOWERR		get ignore-write-error flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   28) 	HDIO_GET_DMA		get use-dma flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   29) 	HDIO_GET_NICE		get nice flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   30) 	HDIO_GET_IDENTITY	get IDE identification info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   31) 	HDIO_GET_WCACHE		get write cache mode on|off
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   32) 	HDIO_GET_ACOUSTIC	get acoustic value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   33) 	HDIO_GET_ADDRESS	get sector addressing mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   34) 	HDIO_GET_BUSSTATE	get the bus state of the hwif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   35) 	HDIO_TRISTATE_HWIF	execute a channel tristate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   36) 	HDIO_DRIVE_RESET	execute a device reset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   37) 	HDIO_DRIVE_TASKFILE	execute raw taskfile
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   38) 	HDIO_DRIVE_TASK		execute task and special drive command
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   39) 	HDIO_DRIVE_CMD		execute a special drive command
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   40) 	HDIO_DRIVE_CMD_AEB	HDIO_DRIVE_TASK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   41) 	=======================	=======================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   43)     ioctls that pass non-pointer values:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   45) 	=======================	=======================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   46) 	HDIO_SET_MULTCOUNT	change IDE blockmode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   47) 	HDIO_SET_UNMASKINTR	permit other irqs during I/O
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   48) 	HDIO_SET_KEEPSETTINGS	keep ioctl settings on reset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   49) 	HDIO_SET_32BIT		change io_32bit flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   50) 	HDIO_SET_NOWERR		change ignore-write-error flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   51) 	HDIO_SET_DMA		change use-dma flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   52) 	HDIO_SET_PIO_MODE	reconfig interface to new speed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   53) 	HDIO_SCAN_HWIF		register and (re)scan interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   54) 	HDIO_SET_NICE		set nice flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   55) 	HDIO_UNREGISTER_HWIF	unregister interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   56) 	HDIO_SET_WCACHE		change write cache enable-disable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   57) 	HDIO_SET_ACOUSTIC	change acoustic behavior
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   58) 	HDIO_SET_BUSSTATE	set the bus state of the hwif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   59) 	HDIO_SET_QDMA		change use-qdma flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   60) 	HDIO_SET_ADDRESS	change lba addressing modes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   62) 	HDIO_SET_IDE_SCSI	Set scsi emulation mode on/off
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   63) 	HDIO_SET_SCSI_IDE	not implemented yet
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   64) 	=======================	=======================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   67) The information that follows was determined from reading kernel source
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   68) code.  It is likely that some corrections will be made over time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   70) ------------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   72) General:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   74) 	Unless otherwise specified, all ioctl calls return 0 on success
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   75) 	and -1 with errno set to an appropriate value on error.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   77) 	Unless otherwise specified, all ioctl calls return -1 and set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   78) 	errno to EFAULT on a failed attempt to copy data to or from user
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   79) 	address space.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   80) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   81) 	Unless otherwise specified, all data structures and constants
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   82) 	are defined in <linux/hdreg.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   84) ------------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   86) HDIO_GETGEO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   87) 	get device geometry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   90) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   92) 	  struct hd_geometry geom;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   94) 	  ioctl(fd, HDIO_GETGEO, &geom);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   97) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   98) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  102) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  103) 		hd_geometry structure containing:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  106) 	    =========	==================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  107) 	    heads	number of heads
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  108) 	    sectors	number of sectors/track
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  109) 	    cylinders	number of cylinders, mod 65536
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  110) 	    start	starting sector of this partition.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  111) 	    =========	==================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  114) 	error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  115) 	  - EINVAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  117) 			if the device is not a disk drive or floppy drive,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  118) 			or if the user passes a null pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  121) 	notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  122) 		Not particularly useful with modern disk drives, whose geometry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  123) 		is a polite fiction anyway.  Modern drives are addressed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  124) 		purely by sector number nowadays (lba addressing), and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  125) 		drive geometry is an abstraction which is actually subject
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  126) 		to change.  Currently (as of Nov 2004), the geometry values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  127) 		are the "bios" values -- presumably the values the drive had
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  128) 		when Linux first booted.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  130) 		In addition, the cylinders field of the hd_geometry is an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  131) 		unsigned short, meaning that on most architectures, this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  132) 		ioctl will not return a meaningful value on drives with more
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  133) 		than 65535 tracks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  135) 		The start field is unsigned long, meaning that it will not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  136) 		contain a meaningful value for disks over 219 Gb in size.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  139) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  141) HDIO_GET_UNMASKINTR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  142) 	get current unmask setting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  145) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  147) 	  long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  149) 	  ioctl(fd, HDIO_GET_UNMASKINTR, &val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  151) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  152) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  156) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  157) 		The value of the drive's current unmask setting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  162) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  163) HDIO_SET_UNMASKINTR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  164) 	permit other irqs during I/O
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  165) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  167) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  169) 	  unsigned long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  171) 	  ioctl(fd, HDIO_SET_UNMASKINTR, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  173) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  174) 		New value for unmask flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  178) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  179) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  183) 	error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  184) 	  - EINVAL	Called on a partition instead of the whole disk device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  185) 	  - EACCES	Access denied:  requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  186) 	  - EINVAL	value out of range [0 1]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  187) 	  - EBUSY	Controller busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  192) HDIO_GET_MULTCOUNT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  193) 	get current IDE blockmode setting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  196) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  198) 	  long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  200) 	  ioctl(fd, HDIO_GET_MULTCOUNT, &val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  202) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  203) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  205) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  207) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  208) 		The value of the current IDE block mode setting.  This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  209) 		controls how many sectors the drive will transfer per
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  210) 		interrupt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  214) HDIO_SET_MULTCOUNT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  215) 	change IDE blockmode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  218) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  220) 	  int val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  222) 	  ioctl(fd, HDIO_SET_MULTCOUNT, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  223) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  224) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  225) 		New value for IDE block mode setting.  This controls how many
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  226) 		sectors the drive will transfer per interrupt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  228) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  229) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  233) 	error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  234) 	  - EINVAL	Called on a partition instead of the whole disk device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  235) 	  - EACCES	Access denied:  requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  236) 	  - EINVAL	value out of range supported by disk.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  237) 	  - EBUSY	Controller busy or blockmode already set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  238) 	  - EIO		Drive did not accept new block mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  240) 	notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  241) 	  Source code comments read::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  242) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  243) 	    This is tightly woven into the driver->do_special cannot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  244) 	    touch.  DON'T do it again until a total personality rewrite
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  245) 	    is committed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  246) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  247) 	  If blockmode has already been set, this ioctl will fail with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  248) 	  -EBUSY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  249) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  250) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  251) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  252) HDIO_GET_QDMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  253) 	get use-qdma flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  254) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  255) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  256) 	Not implemented, as of 2.6.8.1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  257) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  258) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  259) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  260) HDIO_SET_XFER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  261) 	set transfer rate via proc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  262) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  264) 	Not implemented, as of 2.6.8.1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  265) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  266) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  267) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  268) HDIO_OBSOLETE_IDENTITY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  269) 	OBSOLETE, DO NOT USE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  270) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  271) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  272) 	Same as HDIO_GET_IDENTITY (see below), except that it only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  273) 	returns the first 142 bytes of drive identity information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  274) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  275) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  276) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  277) HDIO_GET_IDENTITY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  278) 	get IDE identification info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  279) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  280) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  281) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  282) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  283) 	  unsigned char identity[512];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  284) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  285) 	  ioctl(fd, HDIO_GET_IDENTITY, identity);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  286) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  287) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  288) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  289) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  290) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  291) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  292) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  293) 		ATA drive identity information.  For full description, see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  294) 		the IDENTIFY DEVICE and IDENTIFY PACKET DEVICE commands in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  295) 		the ATA specification.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  296) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  297) 	error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  298) 	  - EINVAL	Called on a partition instead of the whole disk device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  299) 	  - ENOMSG	IDENTIFY DEVICE information not available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  300) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  301) 	notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  302) 		Returns information that was obtained when the drive was
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  303) 		probed.  Some of this information is subject to change, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  304) 		this ioctl does not re-probe the drive to update the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  305) 		information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  306) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  307) 		This information is also available from /proc/ide/hdX/identify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  308) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  309) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  310) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  311) HDIO_GET_KEEPSETTINGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  312) 	get keep-settings-on-reset flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  313) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  314) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  315) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  316) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  317) 	  long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  318) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  319) 	  ioctl(fd, HDIO_GET_KEEPSETTINGS, &val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  320) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  321) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  322) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  323) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  324) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  325) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  326) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  327) 		The value of the current "keep settings" flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  328) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  329) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  330) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  331) 	notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  332) 		When set, indicates that kernel should restore settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  333) 		after a drive reset.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  334) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  335) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  336) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  337) HDIO_SET_KEEPSETTINGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  338) 	keep ioctl settings on reset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  339) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  340) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  341) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  342) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  343) 	  long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  344) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  345) 	  ioctl(fd, HDIO_SET_KEEPSETTINGS, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  346) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  347) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  348) 		New value for keep_settings flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  349) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  350) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  351) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  352) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  353) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  354) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  355) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  356) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  357) 	error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  358) 	  - EINVAL	Called on a partition instead of the whole disk device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  359) 	  - EACCES	Access denied:  requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  360) 	  - EINVAL	value out of range [0 1]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  361) 	  - EBUSY		Controller busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  362) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  363) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  364) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  365) HDIO_GET_32BIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  366) 	get current io_32bit setting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  367) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  368) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  369) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  370) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  371) 	  long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  372) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  373) 	  ioctl(fd, HDIO_GET_32BIT, &val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  374) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  375) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  376) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  377) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  378) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  379) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  380) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  381) 		The value of the current io_32bit setting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  382) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  383) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  384) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  385) 	notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  386) 		0=16-bit, 1=32-bit, 2,3 = 32bit+sync
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  387) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  388) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  389) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  390) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  391) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  392) HDIO_GET_NOWERR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  393) 	get ignore-write-error flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  394) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  395) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  396) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  397) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  398) 	  long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  399) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  400) 	  ioctl(fd, HDIO_GET_NOWERR, &val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  401) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  402) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  403) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  404) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  405) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  406) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  407) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  408) 		The value of the current ignore-write-error flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  409) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  410) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  411) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  412) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  413) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  414) HDIO_GET_DMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  415) 	get use-dma flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  416) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  417) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  418) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  419) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  420) 	  long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  421) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  422) 	  ioctl(fd, HDIO_GET_DMA, &val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  423) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  424) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  425) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  426) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  427) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  428) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  429) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  430) 		The value of the current use-dma flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  431) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  432) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  433) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  434) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  435) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  436) HDIO_GET_NICE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  437) 	get nice flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  438) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  439) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  440) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  441) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  442) 	  long nice;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  443) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  444) 	  ioctl(fd, HDIO_GET_NICE, &nice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  445) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  446) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  447) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  448) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  449) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  450) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  451) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  452) 		The drive's "nice" values.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  453) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  454) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  455) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  456) 	notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  457) 		Per-drive flags which determine when the system will give more
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  458) 		bandwidth to other devices sharing the same IDE bus.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  459) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  460) 		See <linux/hdreg.h>, near symbol IDE_NICE_DSC_OVERLAP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  461) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  462) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  463) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  464) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  465) HDIO_SET_NICE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  466) 	set nice flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  467) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  468) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  469) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  470) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  471) 	  unsigned long nice;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  472) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  473) 	  ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  474) 	  ioctl(fd, HDIO_SET_NICE, nice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  475) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  476) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  477) 		bitmask of nice flags.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  478) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  479) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  480) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  481) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  482) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  483) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  484) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  485) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  486) 	error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  487) 	  - EACCES	Access denied:  requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  488) 	  - EPERM	Flags other than DSC_OVERLAP and NICE_1 set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  489) 	  - EPERM	DSC_OVERLAP specified but not supported by drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  490) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  491) 	notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  492) 		This ioctl sets the DSC_OVERLAP and NICE_1 flags from values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  493) 		provided by the user.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  494) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  495) 		Nice flags are listed in <linux/hdreg.h>, starting with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  496) 		IDE_NICE_DSC_OVERLAP.  These values represent shifts.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  497) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  498) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  499) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  500) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  501) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  502) HDIO_GET_WCACHE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  503) 	get write cache mode on|off
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  504) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  505) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  506) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  507) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  508) 	  long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  509) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  510) 	  ioctl(fd, HDIO_GET_WCACHE, &val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  511) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  512) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  513) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  514) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  515) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  516) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  517) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  518) 		The value of the current write cache mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  519) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  520) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  521) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  522) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  523) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  524) HDIO_GET_ACOUSTIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  525) 	get acoustic value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  526) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  527) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  528) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  529) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  530) 	  long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  531) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  532) 	  ioctl(fd, HDIO_GET_ACOUSTIC, &val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  533) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  534) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  535) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  536) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  537) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  538) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  539) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  540) 		The value of the current acoustic settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  541) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  542) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  543) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  544) 	notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  545) 		See HDIO_SET_ACOUSTIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  546) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  547) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  548) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  549) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  550) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  551) HDIO_GET_ADDRESS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  552) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  553) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  554) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  555) 	  long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  556) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  557) 	  ioctl(fd, HDIO_GET_ADDRESS, &val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  558) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  559) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  560) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  561) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  562) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  563) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  564) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  565) 		The value of the current addressing mode:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  566) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  567) 	    =  ===================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  568) 	    0  28-bit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  569) 	    1  48-bit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  570) 	    2  48-bit doing 28-bit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  571) 	    3  64-bit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  572) 	    =  ===================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  573) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  574) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  575) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  576) HDIO_GET_BUSSTATE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  577) 	get the bus state of the hwif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  578) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  579) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  580) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  581) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  582) 	  long state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  583) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  584) 	  ioctl(fd, HDIO_SCAN_HWIF, &state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  585) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  586) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  587) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  588) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  589) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  590) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  591) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  592) 		Current power state of the IDE bus.  One of BUSSTATE_OFF,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  593) 		BUSSTATE_ON, or BUSSTATE_TRISTATE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  594) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  595) 	error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  596) 	  - EACCES	Access denied:  requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  597) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  598) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  599) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  600) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  601) HDIO_SET_BUSSTATE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  602) 	set the bus state of the hwif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  603) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  604) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  605) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  606) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  607) 	  int state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  608) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  609) 	  ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  610) 	  ioctl(fd, HDIO_SCAN_HWIF, state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  611) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  612) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  613) 		Desired IDE power state.  One of BUSSTATE_OFF, BUSSTATE_ON,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  614) 		or BUSSTATE_TRISTATE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  615) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  616) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  617) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  618) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  619) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  620) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  621) 	error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  622) 	  - EACCES	Access denied:  requires CAP_SYS_RAWIO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  623) 	  - EOPNOTSUPP	Hardware interface does not support bus power control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  624) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  625) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  626) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  627) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  628) HDIO_TRISTATE_HWIF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  629) 	execute a channel tristate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  630) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  631) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  632) 	Not implemented, as of 2.6.8.1.  See HDIO_SET_BUSSTATE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  633) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  634) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  635) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  636) HDIO_DRIVE_RESET
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  637) 	execute a device reset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  638) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  639) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  640) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  641) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  642) 	  int args[3]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  643) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  644) 	  ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  645) 	  ioctl(fd, HDIO_DRIVE_RESET, args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  646) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  647) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  648) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  649) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  650) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  651) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  652) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  653) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  654) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  655) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  656) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  657) 	error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  658) 	  - EACCES	Access denied:  requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  659) 	  - ENXIO	No such device:	phy dead or ctl_addr == 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  660) 	  - EIO		I/O error:	reset timed out or hardware error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  661) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  662) 	notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  663) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  664) 	  - Execute a reset on the device as soon as the current IO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  665) 	    operation has completed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  666) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  667) 	  - Executes an ATAPI soft reset if applicable, otherwise
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  668) 	    executes an ATA soft reset on the controller.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  669) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  670) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  671) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  672) HDIO_DRIVE_TASKFILE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  673) 	execute raw taskfile
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  674) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  675) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  676) 	Note:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  677) 		If you don't have a copy of the ANSI ATA specification
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  678) 		handy, you should probably ignore this ioctl.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  679) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  680) 	- Execute an ATA disk command directly by writing the "taskfile"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  681) 	  registers of the drive.  Requires ADMIN and RAWIO access
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  682) 	  privileges.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  683) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  684) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  685) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  686) 	  struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  687) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  688) 	    ide_task_request_t req_task;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  689) 	    u8 outbuf[OUTPUT_SIZE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  690) 	    u8 inbuf[INPUT_SIZE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  691) 	  } task;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  692) 	  memset(&task.req_task, 0, sizeof(task.req_task));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  693) 	  task.req_task.out_size = sizeof(task.outbuf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  694) 	  task.req_task.in_size = sizeof(task.inbuf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  695) 	  ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  696) 	  ioctl(fd, HDIO_DRIVE_TASKFILE, &task);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  697) 	  ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  698) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  699) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  700) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  701) 	  (See below for details on memory area passed to ioctl.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  702) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  703) 	  ============	===================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  704) 	  io_ports[8]	values to be written to taskfile registers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  705) 	  hob_ports[8]	high-order bytes, for extended commands.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  706) 	  out_flags	flags indicating which registers are valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  707) 	  in_flags	flags indicating which registers should be returned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  708) 	  data_phase	see below
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  709) 	  req_cmd	command type to be executed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  710) 	  out_size	size of output buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  711) 	  outbuf	buffer of data to be transmitted to disk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  712) 	  inbuf		buffer of data to be received from disk (see [1])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  713) 	  ============	===================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  714) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  715) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  716) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  717) 	  ===========	====================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  718) 	  io_ports[]	values returned in the taskfile registers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  719) 	  hob_ports[]	high-order bytes, for extended commands.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  720) 	  out_flags	flags indicating which registers are valid (see [2])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  721) 	  in_flags	flags indicating which registers should be returned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  722) 	  outbuf	buffer of data to be transmitted to disk (see [1])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  723) 	  inbuf		buffer of data to be received from disk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  724) 	  ===========	====================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  725) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  726) 	error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  727) 	  - EACCES	CAP_SYS_ADMIN or CAP_SYS_RAWIO privilege not set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  728) 	  - ENOMSG	Device is not a disk drive.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  729) 	  - ENOMEM	Unable to allocate memory for task
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  730) 	  - EFAULT	req_cmd == TASKFILE_IN_OUT (not implemented as of 2.6.8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  731) 	  - EPERM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  732) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  733) 			req_cmd == TASKFILE_MULTI_OUT and drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  734) 			multi-count not yet set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  735) 	  - EIO		Drive failed the command.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  736) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  737) 	notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  738) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  739) 	  [1] READ THE FOLLOWING NOTES *CAREFULLY*.  THIS IOCTL IS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  740) 	  FULL OF GOTCHAS.  Extreme caution should be used with using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  741) 	  this ioctl.  A mistake can easily corrupt data or hang the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  742) 	  system.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  743) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  744) 	  [2] Both the input and output buffers are copied from the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  745) 	  user and written back to the user, even when not used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  746) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  747) 	  [3] If one or more bits are set in out_flags and in_flags is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  748) 	  zero, the following values are used for in_flags.all and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  749) 	  written back into in_flags on completion.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  750) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  751) 	   * IDE_TASKFILE_STD_IN_FLAGS | (IDE_HOB_STD_IN_FLAGS << 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  752) 	     if LBA48 addressing is enabled for the drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  753) 	   * IDE_TASKFILE_STD_IN_FLAGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  754) 	     if CHS/LBA28
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  755) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  756) 	  The association between in_flags.all and each enable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  757) 	  bitfield flips depending on endianness; fortunately, TASKFILE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  758) 	  only uses inflags.b.data bit and ignores all other bits.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  759) 	  The end result is that, on any endian machines, it has no
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  760) 	  effect other than modifying in_flags on completion.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  761) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  762) 	  [4] The default value of SELECT is (0xa0|DEV_bit|LBA_bit)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  763) 	  except for four drives per port chipsets.  For four drives
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  764) 	  per port chipsets, it's (0xa0|DEV_bit|LBA_bit) for the first
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  765) 	  pair and (0x80|DEV_bit|LBA_bit) for the second pair.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  766) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  767) 	  [5] The argument to the ioctl is a pointer to a region of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  768) 	  memory containing a ide_task_request_t structure, followed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  769) 	  by an optional buffer of data to be transmitted to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  770) 	  drive, followed by an optional buffer to receive data from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  771) 	  the drive.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  772) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  773) 	  Command is passed to the disk drive via the ide_task_request_t
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  774) 	  structure, which contains these fields:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  775) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  776) 	    ============	===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  777) 	    io_ports[8]		values for the taskfile registers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  778) 	    hob_ports[8]	high-order bytes, for extended commands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  779) 	    out_flags		flags indicating which entries in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  780) 				io_ports[] and hob_ports[] arrays
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  781) 				contain valid values.  Type ide_reg_valid_t.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  782) 	    in_flags		flags indicating which entries in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  783) 				io_ports[] and hob_ports[] arrays
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  784) 				are expected to contain valid values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  785) 				on return.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  786) 	    data_phase		See below
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  787) 	    req_cmd		Command type, see below
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  788) 	    out_size		output (user->drive) buffer size, bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  789) 	    in_size		input (drive->user) buffer size, bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  790) 	    ============	===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  791) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  792) 	  When out_flags is zero, the following registers are loaded.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  793) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  794) 	    ============	===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  795) 	    HOB_FEATURE		If the drive supports LBA48
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  796) 	    HOB_NSECTOR		If the drive supports LBA48
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  797) 	    HOB_SECTOR		If the drive supports LBA48
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  798) 	    HOB_LCYL		If the drive supports LBA48
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  799) 	    HOB_HCYL		If the drive supports LBA48
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  800) 	    FEATURE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  801) 	    NSECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  802) 	    SECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  803) 	    LCYL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  804) 	    HCYL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  805) 	    SELECT		First, masked with 0xE0 if LBA48, 0xEF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  806) 				otherwise; then, or'ed with the default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  807) 				value of SELECT.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  808) 	    ============	===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  809) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  810) 	  If any bit in out_flags is set, the following registers are loaded.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  811) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  812) 	    ============	===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  813) 	    HOB_DATA		If out_flags.b.data is set.  HOB_DATA will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  814) 				travel on DD8-DD15 on little endian machines
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  815) 				and on DD0-DD7 on big endian machines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  816) 	    DATA		If out_flags.b.data is set.  DATA will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  817) 				travel on DD0-DD7 on little endian machines
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  818) 				and on DD8-DD15 on big endian machines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  819) 	    HOB_NSECTOR		If out_flags.b.nsector_hob is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  820) 	    HOB_SECTOR		If out_flags.b.sector_hob is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  821) 	    HOB_LCYL		If out_flags.b.lcyl_hob is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  822) 	    HOB_HCYL		If out_flags.b.hcyl_hob is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  823) 	    FEATURE		If out_flags.b.feature is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  824) 	    NSECTOR		If out_flags.b.nsector is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  825) 	    SECTOR		If out_flags.b.sector is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  826) 	    LCYL		If out_flags.b.lcyl is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  827) 	    HCYL		If out_flags.b.hcyl is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  828) 	    SELECT		Or'ed with the default value of SELECT and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  829) 				loaded regardless of out_flags.b.select.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  830) 	    ============	===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  831) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  832) 	  Taskfile registers are read back from the drive into
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  833) 	  {io|hob}_ports[] after the command completes iff one of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  834) 	  following conditions is met; otherwise, the original values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  835) 	  will be written back, unchanged.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  836) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  837) 	    1. The drive fails the command (EIO).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  838) 	    2. One or more than one bits are set in out_flags.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  839) 	    3. The requested data_phase is TASKFILE_NO_DATA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  840) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  841) 	    ============	===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  842) 	    HOB_DATA		If in_flags.b.data is set.  It will contain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  843) 				DD8-DD15 on little endian machines and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  844) 				DD0-DD7 on big endian machines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  845) 	    DATA		If in_flags.b.data is set.  It will contain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  846) 				DD0-DD7 on little endian machines and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  847) 				DD8-DD15 on big endian machines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  848) 	    HOB_FEATURE		If the drive supports LBA48
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  849) 	    HOB_NSECTOR		If the drive supports LBA48
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  850) 	    HOB_SECTOR		If the drive supports LBA48
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  851) 	    HOB_LCYL		If the drive supports LBA48
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  852) 	    HOB_HCYL		If the drive supports LBA48
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  853) 	    NSECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  854) 	    SECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  855) 	    LCYL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  856) 	    HCYL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  857) 	    ============	===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  858) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  859) 	  The data_phase field describes the data transfer to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  860) 	  performed.  Value is one of:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  861) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  862) 	    ===================        ========================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  863) 	    TASKFILE_IN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  864) 	    TASKFILE_MULTI_IN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  865) 	    TASKFILE_OUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  866) 	    TASKFILE_MULTI_OUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  867) 	    TASKFILE_IN_OUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  868) 	    TASKFILE_IN_DMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  869) 	    TASKFILE_IN_DMAQ		== IN_DMA (queueing not supported)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  870) 	    TASKFILE_OUT_DMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  871) 	    TASKFILE_OUT_DMAQ		== OUT_DMA (queueing not supported)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  872) 	    TASKFILE_P_IN		unimplemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  873) 	    TASKFILE_P_IN_DMA		unimplemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  874) 	    TASKFILE_P_IN_DMAQ		unimplemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  875) 	    TASKFILE_P_OUT		unimplemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  876) 	    TASKFILE_P_OUT_DMA		unimplemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  877) 	    TASKFILE_P_OUT_DMAQ		unimplemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  878) 	    ===================        ========================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  879) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  880) 	  The req_cmd field classifies the command type.  It may be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  881) 	  one of:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  882) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  883) 	    ========================    =======================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  884) 	    IDE_DRIVE_TASK_NO_DATA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  885) 	    IDE_DRIVE_TASK_SET_XFER	unimplemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  886) 	    IDE_DRIVE_TASK_IN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  887) 	    IDE_DRIVE_TASK_OUT		unimplemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  888) 	    IDE_DRIVE_TASK_RAW_WRITE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  889) 	    ========================    =======================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  890) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  891) 	  [6] Do not access {in|out}_flags->all except for resetting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  892) 	  all the bits.  Always access individual bit fields.  ->all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  893) 	  value will flip depending on endianness.  For the same
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  894) 	  reason, do not use IDE_{TASKFILE|HOB}_STD_{OUT|IN}_FLAGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  895) 	  constants defined in hdreg.h.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  896) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  897) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  898) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  899) HDIO_DRIVE_CMD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  900) 	execute a special drive command
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  901) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  902) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  903) 	Note:  If you don't have a copy of the ANSI ATA specification
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  904) 	handy, you should probably ignore this ioctl.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  905) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  906) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  907) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  908) 	  u8 args[4+XFER_SIZE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  909) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  910) 	  ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  911) 	  ioctl(fd, HDIO_DRIVE_CMD, args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  912) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  913) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  914) 	    Commands other than WIN_SMART:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  915) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  916) 	    =======     =======
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  917) 	    args[0]	COMMAND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  918) 	    args[1]	NSECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  919) 	    args[2]	FEATURE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  920) 	    args[3]	NSECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  921) 	    =======     =======
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  922) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  923) 	    WIN_SMART:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  924) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  925) 	    =======     =======
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  926) 	    args[0]	COMMAND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  927) 	    args[1]	SECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  928) 	    args[2]	FEATURE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  929) 	    args[3]	NSECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  930) 	    =======     =======
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  931) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  932) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  933) 		args[] buffer is filled with register values followed by any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  934) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  935) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  936) 	  data returned by the disk.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  937) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  938) 	    ========	====================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  939) 	    args[0]	status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  940) 	    args[1]	error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  941) 	    args[2]	NSECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  942) 	    args[3]	undefined
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  943) 	    args[4+]	NSECTOR * 512 bytes of data returned by the command.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  944) 	    ========	====================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  945) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  946) 	error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  947) 	  - EACCES	Access denied:  requires CAP_SYS_RAWIO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  948) 	  - ENOMEM	Unable to allocate memory for task
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  949) 	  - EIO		Drive reports error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  950) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  951) 	notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  952) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  953) 	  [1] For commands other than WIN_SMART, args[1] should equal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  954) 	  args[3].  SECTOR, LCYL and HCYL are undefined.  For
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  955) 	  WIN_SMART, 0x4f and 0xc2 are loaded into LCYL and HCYL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  956) 	  respectively.  In both cases SELECT will contain the default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  957) 	  value for the drive.  Please refer to HDIO_DRIVE_TASKFILE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  958) 	  notes for the default value of SELECT.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  959) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  960) 	  [2] If NSECTOR value is greater than zero and the drive sets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  961) 	  DRQ when interrupting for the command, NSECTOR * 512 bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  962) 	  are read from the device into the area following NSECTOR.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  963) 	  In the above example, the area would be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  964) 	  args[4..4+XFER_SIZE].  16bit PIO is used regardless of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  965) 	  HDIO_SET_32BIT setting.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  966) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  967) 	  [3] If COMMAND == WIN_SETFEATURES && FEATURE == SETFEATURES_XFER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  968) 	  && NSECTOR >= XFER_SW_DMA_0 && the drive supports any DMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  969) 	  mode, IDE driver will try to tune the transfer mode of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  970) 	  drive accordingly.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  971) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  972) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  973) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  974) HDIO_DRIVE_TASK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  975) 	execute task and special drive command
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  976) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  977) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  978) 	Note:  If you don't have a copy of the ANSI ATA specification
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  979) 	handy, you should probably ignore this ioctl.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  980) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  981) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  982) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  983) 	  u8 args[7];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  984) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  985) 	  ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  986) 	  ioctl(fd, HDIO_DRIVE_TASK, args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  987) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  988) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  989) 	    Taskfile register values:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  990) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  991) 	    =======	=======
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  992) 	    args[0]	COMMAND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  993) 	    args[1]	FEATURE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  994) 	    args[2]	NSECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  995) 	    args[3]	SECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  996) 	    args[4]	LCYL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  997) 	    args[5]	HCYL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  998) 	    args[6]	SELECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  999) 	    =======	=======
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1000) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1001) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1002) 	    Taskfile register values:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1003) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1004) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1005) 	    =======	=======
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1006) 	    args[0]	status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1007) 	    args[1]	error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1008) 	    args[2]	NSECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1009) 	    args[3]	SECTOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1010) 	    args[4]	LCYL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1011) 	    args[5]	HCYL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1012) 	    args[6]	SELECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1013) 	    =======	=======
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1014) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1015) 	error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1016) 	  - EACCES	Access denied:  requires CAP_SYS_RAWIO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1017) 	  - ENOMEM	Unable to allocate memory for task
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1018) 	  - ENOMSG	Device is not a disk drive.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1019) 	  - EIO		Drive failed the command.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1020) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1021) 	notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1022) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1023) 	  [1] DEV bit (0x10) of SELECT register is ignored and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1024) 	  appropriate value for the drive is used.  All other bits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1025) 	  are used unaltered.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1026) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1027) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1028) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1029) HDIO_DRIVE_CMD_AEB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1030) 	HDIO_DRIVE_TASK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1031) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1032) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1033) 	Not implemented, as of 2.6.8.1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1034) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1035) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1036) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1037) HDIO_SET_32BIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1038) 	change io_32bit flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1039) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1040) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1041) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1042) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1043) 	  int val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1044) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1045) 	  ioctl(fd, HDIO_SET_32BIT, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1046) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1047) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1048) 		New value for io_32bit flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1049) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1050) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1051) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1052) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1053) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1054) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1055) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1056) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1057) 	error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1058) 	  - EINVAL	Called on a partition instead of the whole disk device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1059) 	  - EACCES	Access denied:  requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1060) 	  - EINVAL	value out of range [0 3]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1061) 	  - EBUSY	Controller busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1062) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1063) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1064) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1065) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1066) HDIO_SET_NOWERR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1067) 	change ignore-write-error flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1068) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1069) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1070) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1071) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1072) 	  int val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1073) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1074) 	  ioctl(fd, HDIO_SET_NOWERR, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1075) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1076) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1077) 		New value for ignore-write-error flag.  Used for ignoring
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1078) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1079) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1080) 	  WRERR_STAT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1081) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1082) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1083) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1084) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1085) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1086) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1087) 	error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1088) 	  - EINVAL	Called on a partition instead of the whole disk device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1089) 	  - EACCES	Access denied:  requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1090) 	  - EINVAL	value out of range [0 1]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1091) 	  - EBUSY		Controller busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1092) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1093) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1094) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1095) HDIO_SET_DMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1096) 	change use-dma flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1097) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1098) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1099) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1101) 	  long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1103) 	  ioctl(fd, HDIO_SET_DMA, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1105) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1106) 		New value for use-dma flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1109) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1110) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1111) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1115) 	error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1116) 	  - EINVAL	Called on a partition instead of the whole disk device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1117) 	  - EACCES	Access denied:  requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1118) 	  - EINVAL	value out of range [0 1]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1119) 	  - EBUSY	Controller busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1123) HDIO_SET_PIO_MODE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1124) 	reconfig interface to new speed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1127) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1129) 	  long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1131) 	  ioctl(fd, HDIO_SET_PIO_MODE, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1133) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1134) 		New interface speed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1138) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1139) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1143) 	error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1144) 	  - EINVAL	Called on a partition instead of the whole disk device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1145) 	  - EACCES	Access denied:  requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1146) 	  - EINVAL	value out of range [0 255]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1147) 	  - EBUSY	Controller busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1151) HDIO_SCAN_HWIF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1152) 	register and (re)scan interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1155) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1157) 	  int args[3]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1159) 	  ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1160) 	  ioctl(fd, HDIO_SCAN_HWIF, args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1162) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1163) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1164) 	  =======	=========================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1165) 	  args[0]	io address to probe
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1167) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1168) 	  args[1]	control address to probe
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1169) 	  args[2]	irq number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1170) 	  =======	=========================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1172) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1173) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1177) 	error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1178) 	  - EACCES	Access denied:  requires CAP_SYS_RAWIO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1179) 	  - EIO		Probe failed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1181) 	notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1182) 		This ioctl initializes the addresses and irq for a disk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1183) 		controller, probes for drives, and creates /proc/ide
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1184) 		interfaces as appropriate.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1185) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1188) HDIO_UNREGISTER_HWIF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1189) 	unregister interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1192) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1194) 	  int index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1196) 	  ioctl(fd, HDIO_UNREGISTER_HWIF, index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1198) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1199) 		index		index of hardware interface to unregister
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1200) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1203) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1204) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1205) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1207) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1208) 	error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1209) 	  - EACCES	Access denied:  requires CAP_SYS_RAWIO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1211) 	notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1212) 		This ioctl removes a hardware interface from the kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1214) 		Currently (2.6.8) this ioctl silently fails if any drive on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1215) 		the interface is busy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1219) HDIO_SET_WCACHE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1220) 	change write cache enable-disable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1222) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1223) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1225) 	  int val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1227) 	  ioctl(fd, HDIO_SET_WCACHE, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1228) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1229) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1230) 		New value for write cache enable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1234) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1235) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1237) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1238) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1239) 	error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1240) 	  - EINVAL	Called on a partition instead of the whole disk device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1241) 	  - EACCES	Access denied:  requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1242) 	  - EINVAL	value out of range [0 1]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1243) 	  - EBUSY	Controller busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1244) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1245) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1246) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1247) HDIO_SET_ACOUSTIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1248) 	change acoustic behavior
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1249) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1250) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1251) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1252) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1253) 	  int val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1254) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1255) 	  ioctl(fd, HDIO_SET_ACOUSTIC, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1256) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1257) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1258) 		New value for drive acoustic settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1259) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1260) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1261) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1262) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1263) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1264) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1265) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1266) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1267) 	error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1268) 	  - EINVAL	Called on a partition instead of the whole disk device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1269) 	  - EACCES	Access denied:  requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1270) 	  - EINVAL	value out of range [0 254]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1271) 	  - EBUSY	Controller busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1272) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1273) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1274) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1275) HDIO_SET_QDMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1276) 	change use-qdma flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1277) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1278) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1279) 	Not implemented, as of 2.6.8.1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1280) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1281) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1282) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1283) HDIO_SET_ADDRESS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1284) 	change lba addressing modes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1285) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1286) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1287) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1288) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1289) 	  int val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1290) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1291) 	  ioctl(fd, HDIO_SET_ADDRESS, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1292) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1293) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1294) 		New value for addressing mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1295) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1296) 	    =   ===================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1297) 	    0   28-bit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1298) 	    1   48-bit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1299) 	    2   48-bit doing 28-bit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1300) 	    =   ===================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1301) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1302) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1303) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1304) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1305) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1306) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1307) 	error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1308) 	  - EINVAL	Called on a partition instead of the whole disk device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1309) 	  - EACCES	Access denied:  requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1310) 	  - EINVAL	value out of range [0 2]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1311) 	  - EBUSY		Controller busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1312) 	  - EIO		Drive does not support lba48 mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1313) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1314) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1315) HDIO_SET_IDE_SCSI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1316) 	usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1317) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1318) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1319) 	  long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1320) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1321) 	  ioctl(fd, HDIO_SET_IDE_SCSI, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1322) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1323) 	inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1324) 		New value for scsi emulation mode (?)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1325) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1326) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1327) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1328) 	outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1329) 		none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1330) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1331) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1332) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1333) 	error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1334) 	  - EINVAL	Called on a partition instead of the whole disk device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1335) 	  - EACCES	Access denied:  requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1336) 	  - EINVAL	value out of range [0 1]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1337) 	  - EBUSY	Controller busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1338) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1339) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1340) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1341) HDIO_SET_SCSI_IDE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1342) 	Not implemented, as of 2.6.8.1