This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / Documentation / ioctl / hdio.txt
1                 Summary of HDIO_ ioctl calls.
2                 ============================
3
4                 Edward A. Falk <efalk@google.com>
5
6                 November, 2004
7
8 This document attempts to describe the ioctl(2) calls supported by
9 the HD/IDE layer.  These are by-and-large implemented (as of Linux 2.6)
10 in drivers/ide/ide.c and drivers/block/scsi_ioctl.c
11
12 ioctl values are listed in <linux/hdreg.h>.  As of this writing, they
13 are as follows:
14
15     ioctls that pass argument pointers to user space:
16
17         HDIO_GETGEO             get device geometry
18         HDIO_GET_UNMASKINTR     get current unmask setting
19         HDIO_GET_MULTCOUNT      get current IDE blockmode setting
20         HDIO_GET_QDMA           get use-qdma flag
21         HDIO_SET_XFER           set transfer rate via proc
22         HDIO_OBSOLETE_IDENTITY  OBSOLETE, DO NOT USE
23         HDIO_GET_KEEPSETTINGS   get keep-settings-on-reset flag
24         HDIO_GET_32BIT          get current io_32bit setting
25         HDIO_GET_NOWERR         get ignore-write-error flag
26         HDIO_GET_DMA            get use-dma flag
27         HDIO_GET_NICE           get nice flags
28         HDIO_GET_IDENTITY       get IDE identification info
29         HDIO_GET_WCACHE         get write cache mode on|off
30         HDIO_GET_ACOUSTIC       get acoustic value
31         HDIO_GET_ADDRESS        get sector addressing mode
32         HDIO_GET_BUSSTATE       get the bus state of the hwif
33         HDIO_TRISTATE_HWIF      execute a channel tristate
34         HDIO_DRIVE_RESET        execute a device reset
35         HDIO_DRIVE_TASKFILE     execute raw taskfile
36         HDIO_DRIVE_TASK         execute task and special drive command
37         HDIO_DRIVE_CMD          execute a special drive command
38         HDIO_DRIVE_CMD_AEB      HDIO_DRIVE_TASK
39
40     ioctls that pass non-pointer values:
41
42         HDIO_SET_MULTCOUNT      change IDE blockmode
43         HDIO_SET_UNMASKINTR     permit other irqs during I/O
44         HDIO_SET_KEEPSETTINGS   keep ioctl settings on reset
45         HDIO_SET_32BIT          change io_32bit flags
46         HDIO_SET_NOWERR         change ignore-write-error flag
47         HDIO_SET_DMA            change use-dma flag
48         HDIO_SET_PIO_MODE       reconfig interface to new speed
49         HDIO_SCAN_HWIF          register and (re)scan interface
50         HDIO_SET_NICE           set nice flags
51         HDIO_UNREGISTER_HWIF    unregister interface
52         HDIO_SET_WCACHE         change write cache enable-disable
53         HDIO_SET_ACOUSTIC       change acoustic behavior
54         HDIO_SET_BUSSTATE       set the bus state of the hwif
55         HDIO_SET_QDMA           change use-qdma flag
56         HDIO_SET_ADDRESS        change lba addressing modes
57
58         HDIO_SET_IDE_SCSI       Set scsi emulation mode on/off
59         HDIO_SET_SCSI_IDE       not implemented yet
60
61
62 The information that follows was determined from reading kernel source
63 code.  It is likely that some corrections will be made over time.
64
65
66
67
68
69
70
71 General:
72
73         Unless otherwise specified, all ioctl calls return 0 on success
74         and -1 with errno set to an appropriate value on error.
75
76         Unless otherwise specified, all ioctl calls return -1 and set
77         errno to EFAULT on a failed attempt to copy data to or from user
78         address space.
79
80         Unless otherwise specified, all data structures and constants
81         are defined in <linux/hdreg.h>
82
83
84
85 HDIO_GETGEO                     get device geometry
86
87         usage:
88
89           struct hd_geometry geom;
90           ioctl(fd, HDIO_GETGEO, &geom);
91
92
93         inputs:         none
94
95         outputs:
96
97           hd_geometry structure containing:
98
99             heads       number of heads
100             sectors     number of sectors/track
101             cylinders   number of cylinders, mod 65536
102             start       starting sector of this partition.
103
104
105         error returns:
106           EINVAL        if the device is not a disk drive or floppy drive,
107                         or if the user passes a null pointer
108
109
110         notes:
111
112           Not particularly useful with modern disk drives, whose geometry
113           is a polite fiction anyway.  Modern drives are addressed
114           purely by sector number nowadays (lba addressing), and the
115           drive geometry is an abstraction which is actually subject
116           to change.  Currently (as of Nov 2004), the geometry values
117           are the "bios" values -- presumably the values the drive had
118           when Linux first booted.
119
120           In addition, the cylinders field of the hd_geometry is an
121           unsigned short, meaning that on most architectures, this
122           ioctl will not return a meaningful value on drives with more
123           than 65535 tracks.
124
125           The start field is unsigned long, meaning that it will not
126           contain a meaningful value for disks over 219 Gb in size.
127
128
129
130
131 HDIO_GET_UNMASKINTR             get current unmask setting
132
133         usage:
134
135           long val;
136           ioctl(fd, HDIO_GET_UNMASKINTR, &val);
137
138         inputs:         none
139
140         outputs:
141           The value of the drive's current unmask setting
142
143
144
145 HDIO_SET_UNMASKINTR             permit other irqs during I/O
146
147         usage:
148
149           unsigned long val;
150           ioctl(fd, HDIO_SET_UNMASKINTR, val);
151
152         inputs:
153           New value for unmask flag
154
155         outputs:        none
156
157         error return:
158           EINVAL        (bdev != bdev->bd_contains) (not sure what this means)
159           EACCES        Access denied:  requires CAP_SYS_ADMIN
160           EINVAL        value out of range [0 1]
161           EBUSY         Controller busy
162
163
164
165
166 HDIO_GET_MULTCOUNT              get current IDE blockmode setting
167
168         usage:
169
170           long val;
171           ioctl(fd, HDIO_GET_MULTCOUNT, &val);
172
173         inputs:         none
174
175         outputs:
176           The value of the current IDE block mode setting.  This
177           controls how many sectors the drive will transfer per
178           interrupt.
179
180
181
182 HDIO_SET_MULTCOUNT              change IDE blockmode
183
184         usage:
185
186           int val;
187           ioctl(fd, HDIO_SET_MULTCOUNT, val);
188
189         inputs:
190           New value for IDE block mode setting.  This controls how many
191           sectors the drive will transfer per interrupt.
192
193         outputs:        none
194
195         error return:
196           EINVAL        (bdev != bdev->bd_contains) (not sure what this means)
197           EACCES        Access denied:  requires CAP_SYS_ADMIN
198           EINVAL        value out of range supported by disk.
199           EBUSY         Controller busy or blockmode already set.
200           EIO           Drive did not accept new block mode.
201
202         notes:
203
204           Source code comments read:
205
206             This is tightly woven into the driver->do_special can not
207             touch.  DON'T do it again until a total personality rewrite
208             is committed.
209
210           If blockmode has already been set, this ioctl will fail with
211           EBUSY
212
213
214
215 HDIO_GET_QDMA                   get use-qdma flag
216
217         Not implemented, as of 2.6.8.1
218
219
220
221 HDIO_SET_XFER                   set transfer rate via proc
222
223         Not implemented, as of 2.6.8.1
224
225
226
227 HDIO_OBSOLETE_IDENTITY          OBSOLETE, DO NOT USE
228
229         Same as HDIO_GET_IDENTITY (see below), except that it only
230         returns the first 142 bytes of drive identity information.
231
232
233
234 HDIO_GET_IDENTITY               get IDE identification info
235
236         usage:
237
238           unsigned char identity[512];
239           ioctl(fd, HDIO_GET_IDENTITY, identity);
240
241         inputs:         none
242
243         outputs:
244
245           ATA drive identity information.  For full description, see
246           the IDENTIFY DEVICE and IDENTIFY PACKET DEVICE commands in
247           the ATA specification.
248
249         error returns:
250           EINVAL        (bdev != bdev->bd_contains) (not sure what this means)
251           ENOMSG        IDENTIFY DEVICE information not available
252
253         notes:
254
255           Returns information that was obtained when the drive was
256           probed.  Some of this information is subject to change, and
257           this ioctl does not re-probe the drive to update the
258           information.
259
260           This information is also available from /proc/ide/hdX/identify
261
262
263
264 HDIO_GET_KEEPSETTINGS           get keep-settings-on-reset flag
265
266         usage:
267
268           long val;
269           ioctl(fd, HDIO_GET_KEEPSETTINGS, &val);
270
271         inputs:         none
272
273         outputs:
274           The value of the current "keep settings" flag
275
276         notes:
277
278           When set, indicates that kernel should restore settings
279           after a drive reset.
280
281
282
283 HDIO_SET_KEEPSETTINGS           keep ioctl settings on reset
284
285         usage:
286
287           long val;
288           ioctl(fd, HDIO_SET_KEEPSETTINGS, val);
289
290         inputs:
291           New value for keep_settings flag
292
293         outputs:        none
294
295         error return:
296           EINVAL        (bdev != bdev->bd_contains) (not sure what this means)
297           EACCES        Access denied:  requires CAP_SYS_ADMIN
298           EINVAL        value out of range [0 1]
299           EBUSY         Controller busy
300
301
302
303 HDIO_GET_32BIT                  get current io_32bit setting
304
305         usage:
306
307           long val;
308           ioctl(fd, HDIO_GET_32BIT, &val);
309
310         inputs:         none
311
312         outputs:
313           The value of the current io_32bit setting
314
315         notes:
316
317           0=16-bit, 1=32-bit, 2,3 = 32bit+sync
318
319
320
321 HDIO_GET_NOWERR                 get ignore-write-error flag
322
323         usage:
324
325           long val;
326           ioctl(fd, HDIO_GET_NOWERR, &val);
327
328         inputs:         none
329
330         outputs:
331           The value of the current ignore-write-error flag
332
333
334
335 HDIO_GET_DMA                    get use-dma flag
336
337         usage:
338
339           long val;
340           ioctl(fd, HDIO_GET_DMA, &val);
341
342         inputs:         none
343
344         outputs:
345           The value of the current use-dma flag
346
347
348
349 HDIO_GET_NICE                   get nice flags
350
351         usage:
352
353           long nice;
354           ioctl(fd, HDIO_GET_NICE, &nice);
355
356         inputs:         none
357
358         outputs:
359
360           The drive's "nice" values.
361
362         notes:
363
364           Per-drive flags which determine when the system will give more
365           bandwidth to other devices sharing the same IDE bus.
366           See <linux/hdreg.h>, near symbol IDE_NICE_DSC_OVERLAP.
367
368
369
370
371 HDIO_SET_NICE                   set nice flags
372
373         usage:
374
375           unsigned long nice;
376           ...
377           ioctl(fd, HDIO_SET_NICE, nice);
378
379         inputs:
380           bitmask of nice flags.
381
382         outputs:        none
383
384         error returns:
385           EACCES        Access denied:  requires CAP_SYS_ADMIN
386           EPERM         Flags other than DSC_OVERLAP and NICE_1 set.
387           EPERM         DSC_OVERLAP specified but not supported by drive
388
389         notes:
390
391           This ioctl sets the DSC_OVERLAP and NICE_1 flags from values
392           provided by the user.
393
394           Nice flags are listed in <linux/hdreg.h>, starting with
395           IDE_NICE_DSC_OVERLAP.  These values represent shifts.
396
397
398
399
400
401 HDIO_GET_WCACHE                 get write cache mode on|off
402
403         usage:
404
405           long val;
406           ioctl(fd, HDIO_GET_WCACHE, &val);
407
408         inputs:         none
409
410         outputs:
411           The value of the current write cache mode
412
413
414
415 HDIO_GET_ACOUSTIC               get acoustic value
416
417         usage:
418
419           long val;
420           ioctl(fd, HDIO_GET_ACOUSTIC, &val);
421
422         inputs:         none
423
424         outputs:
425           The value of the current acoustic settings
426
427         notes:
428
429           See HDIO_SET_ACOUSTIC
430
431
432
433 HDIO_GET_ADDRESS
434
435         usage:
436
437           long val;
438           ioctl(fd, HDIO_GET_ADDRESS, &val);
439
440         inputs:         none
441
442         outputs:
443           The value of the current addressing mode:
444             0 = 28-bit
445             1 = 48-bit
446             2 = 48-bit doing 28-bit
447             3 = 64-bit
448
449
450
451 HDIO_GET_BUSSTATE               get the bus state of the hwif
452
453         usage:
454
455           long state;
456           ioctl(fd, HDIO_SCAN_HWIF, &state);
457
458         inputs:         none
459
460         outputs:
461           Current power state of the IDE bus.  One of BUSSTATE_OFF,
462           BUSSTATE_ON, or BUSSTATE_TRISTATE
463
464         error returns:
465           EACCES        Access denied:  requires CAP_SYS_ADMIN
466
467
468
469
470 HDIO_SET_BUSSTATE               set the bus state of the hwif
471
472         usage:
473
474           int state;
475           ...
476           ioctl(fd, HDIO_SCAN_HWIF, state);
477
478         inputs:
479           Desired IDE power state.  One of BUSSTATE_OFF, BUSSTATE_ON,
480           or BUSSTATE_TRISTATE
481
482         outputs:        none
483
484         error returns:
485           EACCES        Access denied:  requires CAP_SYS_RAWIO
486           EOPNOTSUPP    Hardware interface does not support bus power control
487
488
489
490
491 HDIO_TRISTATE_HWIF              execute a channel tristate
492
493         Not implemented, as of 2.6.8.1.  See HDIO_SET_BUSSTATE
494
495
496
497 HDIO_DRIVE_RESET                execute a device reset
498
499         usage:
500
501           int args[3]
502           ...
503           ioctl(fd, HDIO_DRIVE_RESET, args);
504
505         inputs:         none
506
507         outputs:        none
508
509         error returns:
510           EACCES        Access denied:  requires CAP_SYS_ADMIN
511
512         notes:
513
514           Abort any current command, prevent anything else from being
515           queued, execute a reset on the device, and issue BLKRRPART
516           ioctl on the block device.
517
518           Executes an ATAPI soft reset if applicable, otherwise
519           executes an ATA soft reset on the controller.
520
521
522
523 HDIO_DRIVE_TASKFILE             execute raw taskfile
524
525         Note:  If you don't have a copy of the ANSI ATA specification
526         handy, you should probably ignore this ioctl.
527
528         Execute an ATA disk command directly by writing the "taskfile"
529         registers of the drive.  Requires ADMIN and RAWIO access
530         privileges.
531
532         usage:
533
534           struct {
535             ide_task_request_t req_task;
536             u8 outbuf[OUTPUT_SIZE];
537             u8 inbuf[INPUT_SIZE];
538           } task;
539           memset(&task.req_task, 0, sizeof(task.req_task));
540           task.req_task.out_size = sizeof(task.outbuf);
541           task.req_task.in_size = sizeof(task.inbuf);
542           ...
543           ioctl(fd, HDIO_DRIVE_TASKFILE, &task);
544           ...
545
546         inputs:
547
548           (See below for details on memory area passed to ioctl.)
549
550           io_ports[8]   values to be written to taskfile registers
551           hob_ports[8]  high-order bytes, for extended commands.
552           out_flags     flags indicating which registers are valid
553           in_flags      flags indicating which registers should be returned
554           data_phase    see below
555           req_cmd       command type to be executed
556           out_size      size of output buffer
557           outbuf        buffer of data to be transmitted to disk
558           inbuf         buffer of data to be received from disk (see [1])
559
560         outputs:
561
562           io_ports[]    values returned in the taskfile registers
563           hob_ports[]   high-order bytes, for extended commands.
564           out_flags     flags indicating which registers are valid (see [2])
565           in_flags      flags indicating which registers should be returned
566           outbuf        buffer of data to be transmitted to disk (see [1])
567           inbuf         buffer of data to be received from disk
568
569         error returns:
570           EACCES        CAP_SYS_ADMIN or CAP_SYS_RAWIO privilege not set.
571           ENOMSG        Device is not a disk drive.
572           ENOMEM        Unable to allocate memory for task
573           EFAULT        req_cmd == TASKFILE_IN_OUT (not implemented as of 2.6.8)
574           EPERM         req_cmd == TASKFILE_MULTI_OUT and drive
575                         multi-count not yet set.
576
577
578         notes:
579
580           [1] Currently (2.6.8), both the input and output buffers are
581           copied from the user and written back to the user, even when
582           not used.  This may be a bug.
583
584           [2] The out_flags and in_flags are returned to the user after
585           the ioctl completes.  Currently (2.6.8) these are the same
586           as the input values, unchanged.  In the future, they may have
587           more significance.
588
589           Extreme caution should be used with using this ioctl.  A
590           mistake can easily corrupt data or hang the system.
591
592           The argument to the ioctl is a pointer to a region of memory
593           containing a ide_task_request_t structure, followed by an
594           optional buffer of data to be transmitted to the drive,
595           followed by an optional buffer to receive data from the drive.
596
597           Command is passed to the disk drive via the ide_task_request_t
598           structure, which contains these fields:
599
600             io_ports[8]         values for the taskfile registers
601             hob_ports[8]        high-order bytes, for extended commands
602             out_flags           flags indicating which entries in the
603                                 io_ports[] and hob_ports[] arrays
604                                 contain valid values.  Type ide_reg_valid_t.
605             in_flags            flags indicating which entries in the
606                                 io_ports[] and hob_ports[] arrays
607                                 are expected to contain valid values
608                                 on return.
609             data_phase          See below
610             req_cmd             Command type, see below
611             out_size            output (user->drive) buffer size, bytes
612             in_size             input (drive->user) buffer size, bytes
613
614           This ioctl does not necessarily respect all flags in the
615           out_flags and in_flags values -- some taskfile registers
616           may be written or read even if not requested in the flags.
617           Unused fields of io_ports[] and hob_ports[] should be set
618           to zero.
619
620           The data_phase field describes the data transfer to be
621           performed.  Value is one of:
622
623             TASKFILE_IN
624             TASKFILE_MULTI_IN
625             TASKFILE_OUT
626             TASKFILE_MULTI_OUT
627             TASKFILE_IN_OUT
628             TASKFILE_IN_DMA
629             TASKFILE_IN_DMAQ
630             TASKFILE_OUT_DMA
631             TASKFILE_OUT_DMAQ
632             TASKFILE_P_IN
633             TASKFILE_P_IN_DMA
634             TASKFILE_P_IN_DMAQ
635             TASKFILE_P_OUT
636             TASKFILE_P_OUT_DMA
637             TASKFILE_P_OUT_DMAQ
638
639           The req_cmd field classifies the command type.  It may be
640           one of:
641
642             IDE_DRIVE_TASK_NO_DATA
643             IDE_DRIVE_TASK_SET_XFER
644             IDE_DRIVE_TASK_IN
645             IDE_DRIVE_TASK_OUT
646             IDE_DRIVE_TASK_RAW_WRITE
647
648
649
650
651
652
653 HDIO_DRIVE_CMD                  execute a special drive command
654
655         Note:  If you don't have a copy of the ANSI ATA specification
656         handy, you should probably ignore this ioctl.
657
658         usage:
659
660           u8 args[4+XFER_SIZE];
661           ...
662           ioctl(fd, HDIO_DRIVE_CMD, args);
663
664         inputs:
665
666           Taskfile register values:
667             args[0]     COMMAND
668             args[1]     SECTOR
669             args[2]     FEATURE
670             args[3]     NSECTOR
671
672         outputs:
673
674           args[] buffer is filled with register values followed by any
675           data returned by the disk.
676             args[0]     status
677             args[1]     error
678             args[2]     NSECTOR
679             args[3]     undefined
680             args[4+]    NSECTOR * 512 bytes of data returned by the command.
681
682         error returns:
683           EACCES        Access denied:  requires CAP_SYS_RAWIO
684           ENOMEM        Unable to allocate memory for task
685
686         notes:
687
688           Taskfile registers IDE_LCYL, IDE_HCYL, and IDE_SELECT are
689           set to zero before executing the command.
690
691
692
693 HDIO_DRIVE_TASK                 execute task and special drive command
694
695         Note:  If you don't have a copy of the ANSI ATA specification
696         handy, you should probably ignore this ioctl.
697
698         usage:
699
700           u8 args[7];
701           ...
702           ioctl(fd, HDIO_DRIVE_TASK, args);
703
704         inputs:
705
706           Taskfile register values:
707             args[0]     COMMAND
708             args[1]     FEATURE
709             args[2]     NSECTOR
710             args[3]     SECTOR
711             args[4]     LCYL
712             args[5]     HCYL
713             args[6]     SELECT
714
715         outputs:
716
717           Taskfile register values:
718             args[0]     status
719             args[1]     error
720             args[2]     NSECTOR
721             args[3]     SECTOR
722             args[4]     LCYL
723             args[5]     HCYL
724             args[6]     SELECT
725
726         error returns:
727           EACCES        Access denied:  requires CAP_SYS_RAWIO
728           ENOMEM        Unable to allocate memory for task
729
730
731
732
733 HDIO_DRIVE_CMD_AEB              HDIO_DRIVE_TASK
734
735         Not implemented, as of 2.6.8.1
736
737
738
739 HDIO_SET_32BIT                  change io_32bit flags
740
741         usage:
742
743           int val;
744           ioctl(fd, HDIO_SET_32BIT, val);
745
746         inputs:
747           New value for io_32bit flag
748
749         outputs:        none
750
751         error return:
752           EINVAL        (bdev != bdev->bd_contains) (not sure what this means)
753           EACCES        Access denied:  requires CAP_SYS_ADMIN
754           EINVAL        value out of range [0 3]
755           EBUSY         Controller busy
756
757
758
759
760 HDIO_SET_NOWERR                 change ignore-write-error flag
761
762         usage:
763
764           int val;
765           ioctl(fd, HDIO_SET_NOWERR, val);
766
767         inputs:
768           New value for ignore-write-error flag.  Used for ignoring
769           WRERR_STAT
770
771         outputs:        none
772
773         error return:
774           EINVAL        (bdev != bdev->bd_contains) (not sure what this means)
775           EACCES        Access denied:  requires CAP_SYS_ADMIN
776           EINVAL        value out of range [0 1]
777           EBUSY         Controller busy
778
779
780
781 HDIO_SET_DMA                    change use-dma flag
782
783         usage:
784
785           long val;
786           ioctl(fd, HDIO_SET_DMA, val);
787
788         inputs:
789           New value for use-dma flag
790
791         outputs:        none
792
793         error return:
794           EINVAL        (bdev != bdev->bd_contains) (not sure what this means)
795           EACCES        Access denied:  requires CAP_SYS_ADMIN
796           EINVAL        value out of range [0 1]
797           EBUSY         Controller busy
798
799
800
801 HDIO_SET_PIO_MODE               reconfig interface to new speed
802
803         usage:
804
805           long val;
806           ioctl(fd, HDIO_SET_PIO_MODE, val);
807
808         inputs:
809           New interface speed.
810
811         outputs:        none
812
813         error return:
814           EINVAL        (bdev != bdev->bd_contains) (not sure what this means)
815           EACCES        Access denied:  requires CAP_SYS_ADMIN
816           EINVAL        value out of range [0 255]
817           EBUSY         Controller busy
818
819
820
821 HDIO_SCAN_HWIF                  register and (re)scan interface
822
823         usage:
824
825           int args[3]
826           ...
827           ioctl(fd, HDIO_SCAN_HWIF, args);
828
829         inputs:
830           args[0]       io address to probe
831           args[1]       control address to probe
832           args[2]       irq number
833
834         outputs:        none
835
836         error returns:
837           EACCES        Access denied:  requires CAP_SYS_RAWIO
838           EIO           Probe failed.
839
840         notes:
841
842           This ioctl initializes the addresses and irq for a disk
843           controller, probes for drives, and creates /proc/ide
844           interfaces as appropiate.
845
846
847
848 HDIO_UNREGISTER_HWIF            unregister interface
849
850         usage:
851
852           int index;
853           ioctl(fd, HDIO_UNREGISTER_HWIF, index);
854
855         inputs:
856           index         index of hardware interface to unregister
857
858         outputs:        none
859
860         error returns:
861           EACCES        Access denied:  requires CAP_SYS_RAWIO
862
863         notes:
864
865           This ioctl removes a hardware interface from the kernel.
866
867           Currently (2.6.8) this ioctl silently fails if any drive on
868           the interface is busy.
869
870
871
872 HDIO_SET_WCACHE                 change write cache enable-disable
873
874         usage:
875
876           int val;
877           ioctl(fd, HDIO_SET_WCACHE, val);
878
879         inputs:
880           New value for write cache enable
881
882         outputs:        none
883
884         error return:
885           EINVAL        (bdev != bdev->bd_contains) (not sure what this means)
886           EACCES        Access denied:  requires CAP_SYS_ADMIN
887           EINVAL        value out of range [0 1]
888           EBUSY         Controller busy
889
890
891
892 HDIO_SET_ACOUSTIC               change acoustic behavior
893
894         usage:
895
896           int val;
897           ioctl(fd, HDIO_SET_ACOUSTIC, val);
898
899         inputs:
900           New value for drive acoustic settings
901
902         outputs:        none
903
904         error return:
905           EINVAL        (bdev != bdev->bd_contains) (not sure what this means)
906           EACCES        Access denied:  requires CAP_SYS_ADMIN
907           EINVAL        value out of range [0 254]
908           EBUSY         Controller busy
909
910
911
912 HDIO_SET_QDMA                   change use-qdma flag
913
914         Not implemented, as of 2.6.8.1
915
916
917
918 HDIO_SET_ADDRESS                change lba addressing modes
919
920         usage:
921
922           int val;
923           ioctl(fd, HDIO_SET_ADDRESS, val);
924
925         inputs:
926           New value for addressing mode
927             0 = 28-bit
928             1 = 48-bit
929             2 = 48-bit doing 28-bit
930
931         outputs:        none
932
933         error return:
934           EINVAL        (bdev != bdev->bd_contains) (not sure what this means)
935           EACCES        Access denied:  requires CAP_SYS_ADMIN
936           EINVAL        value out of range [0 2]
937           EBUSY         Controller busy
938           EIO           Drive does not support lba48 mode.
939
940
941 HDIO_SET_IDE_SCSI
942
943         usage:
944
945           long val;
946           ioctl(fd, HDIO_SET_IDE_SCSI, val);
947
948         inputs:
949           New value for scsi emulation mode (?)
950
951         outputs:        none
952
953         error return:
954           EINVAL        (bdev != bdev->bd_contains) (not sure what this means)
955           EACCES        Access denied:  requires CAP_SYS_ADMIN
956           EINVAL        value out of range [0 1]
957           EBUSY         Controller busy
958
959
960
961 HDIO_SET_SCSI_IDE
962
963         Not implemented, as of 2.6.8.1
964
965