History

Merge tag 'for-5.14/libata-2021-06-27' of git://git.kernel.dk/linux-block

Pull libata updates from Jens Axboe: "The big change in this round is that we're finally in a position where we can sanely remove the old drivers/ide/ code, as libata covers everything we need by now. This is exciting for two reasons: 1) we delete a lot of legacy code that doesn't really meet the standards we have today, and 2) it enables us to clean up various bits in the block layer that exist only because of the old IDE code. Outside of that, just a few minor fixes here, fixups for warnings, etc" * tag 'for-5.14/libata-2021-06-27' of git://git.kernel.dk/linux-block: (29 commits) ata: rb532_cf: remove redundant codes ide: remove the legacy ide driver m68k: use libata instead of the legacy ide driver ARM: disable CONFIG_IDE in pxa_defconfig ARM: disable CONFIG_IDE in footbridge_defconfig alpha: use libata instead of the legacy ide driver pata_cypress: add a module option to disable BM-DMA ata: pata_macio: Avoid overwriting initialised field in 'pata_macio_sht' ata: pata_serverworks: Avoid overwriting initialised field in 'serverworks_osb4_sht ata: pata_sc1200: sc1200_sht'Avoid overwriting initialised field in ' ata: pata_cs5530: Avoid overwriting initialised field in 'cs5530_sht' ata: pata_cs5520: Avoid overwriting initialised field in 'cs5520_sht' ata: pata_atiixp: Avoid overwriting initialised field in 'atiixp_sht' ata: sata_nv: Do not over-write initialise fields in 'nv_adma_sht' and 'nv_swncq_sht' ata: sata_mv: Do not over-write initialise fields in 'mv6_sht' ata: sata_sil24: Do not over-write initialise fields in 'sil24_sht' ata: ahci: Ensure initialised fields are not overwritten in AHCI_SHT() ata: include: libata: Move fields commonly over-written to separate MACRO ahci: Add support for Dell S140 and later controllers ata: ahci_sunxi: Disable DIPM ...

Linus Torvalds committed 5 years ago

Commit 43bd8a62 parents 66d9282 1af11d0136 files · +224 −41635Browse files

Showing the changes to Documentation/userspace-api (1 of 136 files). Show all

Unified · Split

Documentation/userspace-api/ioctl/hdio.rst+25−820
@@ -7,8 +7,8 @@ Summary of `HDIO_` ioctl calls · 6 unmodified lines
7November, 20047November, 2004
8 8
9This document attempts to describe the ioctl(2) calls supported by9This document attempts to describe the ioctl(2) calls supported by
10the HD/IDE layer. These are by-and-large implemented (as of Linux 2.6)10the HD/IDE layer. These are by-and-large implemented (as of Linux 5.11)
11in drivers/ide/ide.c and drivers/block/scsi_ioctl.c11drivers/ata/libata-scsi.c.
12 12
13ioctl values are listed in <linux/hdreg.h>. As of this writing, they13ioctl values are listed in <linux/hdreg.h>. As of this writing, they
14are as follows:14are as follows:
@@ -17,50 +17,17 @@ are as follows: · 2 unmodified lines
17 17
18 ======================= =======================================18 ======================= =======================================
19 HDIO_GETGEO get device geometry19 HDIO_GETGEO get device geometry
20 HDIO_GET_UNMASKINTR get current unmask setting
21 HDIO_GET_MULTCOUNT get current IDE blockmode setting
22 HDIO_GET_QDMA get use-qdma flag
23 HDIO_SET_XFER set transfer rate via proc
24 HDIO_OBSOLETE_IDENTITY OBSOLETE, DO NOT USE
25 HDIO_GET_KEEPSETTINGS get keep-settings-on-reset flag
26 HDIO_GET_32BIT get current io_32bit setting20 HDIO_GET_32BIT get current io_32bit setting
27 HDIO_GET_NOWERR get ignore-write-error flag
28 HDIO_GET_DMA get use-dma flag
29 HDIO_GET_NICE get nice flags
30 HDIO_GET_IDENTITY get IDE identification info21 HDIO_GET_IDENTITY get IDE identification info
31 HDIO_GET_WCACHE get write cache mode on|off
32 HDIO_GET_ACOUSTIC get acoustic value
33 HDIO_GET_ADDRESS get sector addressing mode
34 HDIO_GET_BUSSTATE get the bus state of the hwif
35 HDIO_TRISTATE_HWIF execute a channel tristate
36 HDIO_DRIVE_RESET execute a device reset
37 HDIO_DRIVE_TASKFILE execute raw taskfile22 HDIO_DRIVE_TASKFILE execute raw taskfile
38 HDIO_DRIVE_TASK execute task and special drive command23 HDIO_DRIVE_TASK execute task and special drive command
39 HDIO_DRIVE_CMD execute a special drive command24 HDIO_DRIVE_CMD execute a special drive command
40 HDIO_DRIVE_CMD_AEB HDIO_DRIVE_TASK
41 ======================= =======================================25 ======================= =======================================
42 26
43 ioctls that pass non-pointer values:27 ioctls that pass non-pointer values:
44 28
45 ======================= =======================================29 ======================= =======================================
46 HDIO_SET_MULTCOUNT change IDE blockmode
47 HDIO_SET_UNMASKINTR permit other irqs during I/O
48 HDIO_SET_KEEPSETTINGS keep ioctl settings on reset
49 HDIO_SET_32BIT change io_32bit flags30 HDIO_SET_32BIT change io_32bit flags
50 HDIO_SET_NOWERR change ignore-write-error flag
51 HDIO_SET_DMA change use-dma flag
52 HDIO_SET_PIO_MODE reconfig interface to new speed
53 HDIO_SCAN_HWIF register and (re)scan interface
54 HDIO_SET_NICE set nice flags
55 HDIO_UNREGISTER_HWIF unregister interface
56 HDIO_SET_WCACHE change write cache enable-disable
57 HDIO_SET_ACOUSTIC change acoustic behavior
58 HDIO_SET_BUSSTATE set the bus state of the hwif
59 HDIO_SET_QDMA change use-qdma flag
60 HDIO_SET_ADDRESS change lba addressing modes
61
62 HDIO_SET_IDE_SCSI Set scsi emulation mode on/off
63 HDIO_SET_SCSI_IDE not implemented yet
64 ======================= =======================================31 ======================= =======================================
65 32
66 33
@@ -137,512 +104,49 @@ HDIO_GETGEO · 70 unmodified lines
137 104
138 105
139 106
140 107HDIO_GET_IDENTITY
141HDIO_GET_UNMASKINTR108 get IDE identification info
142 get current unmask setting
143
144
145 usage::
146
147 long val;
148
149 ioctl(fd, HDIO_GET_UNMASKINTR, &val);
150
151 inputs:
152 none
153
154
155
156 outputs:
157 The value of the drive's current unmask setting
158
159
160
161
162
163HDIO_SET_UNMASKINTR
164 permit other irqs during I/O
165
166
167 usage::
168
169 unsigned long val;
170
171 ioctl(fd, HDIO_SET_UNMASKINTR, val);
172
173 inputs:
174 New value for unmask flag
175
176
177
178 outputs:
179 none
180
181
182
183 error return:
184 - EINVAL Called on a partition instead of the whole disk device
185 - EACCES Access denied: requires CAP_SYS_ADMIN
186 - EINVAL value out of range [0 1]
187 - EBUSY Controller busy
188
189
190
191
192HDIO_GET_MULTCOUNT
193 get current IDE blockmode setting
194
195
196 usage::
197
198 long val;
199
200 ioctl(fd, HDIO_GET_MULTCOUNT, &val);
201
202 inputs:
203 none
204
205
206
207 outputs:
208 The value of the current IDE block mode setting. This
209 controls how many sectors the drive will transfer per
210 interrupt.
211
212
213
214HDIO_SET_MULTCOUNT
215 change IDE blockmode
216
217
218 usage::
219
220 int val;
221
222 ioctl(fd, HDIO_SET_MULTCOUNT, val);
223
224 inputs:
225 New value for IDE block mode setting. This controls how many
226 sectors the drive will transfer per interrupt.
227
228 outputs:
229 none
230
231
232
233 error return:
234 - EINVAL Called on a partition instead of the whole disk device
235 - EACCES Access denied: requires CAP_SYS_ADMIN
236 - EINVAL value out of range supported by disk.
237 - EBUSY Controller busy or blockmode already set.
238 - EIO Drive did not accept new block mode.
239
240 notes:
241 Source code comments read::
242
243 This is tightly woven into the driver->do_special cannot
244 touch. DON'T do it again until a total personality rewrite
245 is committed.
246
247 If blockmode has already been set, this ioctl will fail with
248 -EBUSY
249
250
251
252HDIO_GET_QDMA
253 get use-qdma flag
254
255
256 Not implemented, as of 2.6.8.1
257
258
259
260HDIO_SET_XFER
261 set transfer rate via proc
262
263
264 Not implemented, as of 2.6.8.1
265
266
267
268HDIO_OBSOLETE_IDENTITY
269 OBSOLETE, DO NOT USE
270
271
272 Same as HDIO_GET_IDENTITY (see below), except that it only
273 returns the first 142 bytes of drive identity information.
274
275
276
277HDIO_GET_IDENTITY
278 get IDE identification info
279
280
281 usage::
282
283 unsigned char identity[512];
284
285 ioctl(fd, HDIO_GET_IDENTITY, identity);
286
287 inputs:
288 none
289
290
291
292 outputs:
293 ATA drive identity information. For full description, see
294 the IDENTIFY DEVICE and IDENTIFY PACKET DEVICE commands in
295 the ATA specification.
296
297 error returns:
298 - EINVAL Called on a partition instead of the whole disk device
299 - ENOMSG IDENTIFY DEVICE information not available
300
301 notes:
302 Returns information that was obtained when the drive was
303 probed. Some of this information is subject to change, and
304 this ioctl does not re-probe the drive to update the
305 information.
306
307 This information is also available from /proc/ide/hdX/identify
308
309
310
311HDIO_GET_KEEPSETTINGS
312 get keep-settings-on-reset flag
313
314
315 usage::
316
317 long val;
318
319 ioctl(fd, HDIO_GET_KEEPSETTINGS, &val);
320
321 inputs:
322 none
323
324
325
326 outputs:
327 The value of the current "keep settings" flag
328
329
330
331 notes:
332 When set, indicates that kernel should restore settings
333 after a drive reset.
334
335
336
337HDIO_SET_KEEPSETTINGS
338 keep ioctl settings on reset
339
340
341 usage::
342
343 long val;
344
345 ioctl(fd, HDIO_SET_KEEPSETTINGS, val);
346
347 inputs:
348 New value for keep_settings flag
349
350
351
352 outputs:
353 none
354
355
356
357 error return:
358 - EINVAL Called on a partition instead of the whole disk device
359 - EACCES Access denied: requires CAP_SYS_ADMIN
360 - EINVAL value out of range [0 1]
361 - EBUSY Controller busy
362
363
364
365HDIO_GET_32BIT
366 get current io_32bit setting
367
368
369 usage::
370
371 long val;
372
373 ioctl(fd, HDIO_GET_32BIT, &val);
374
375 inputs:
376 none
377
378
379
380 outputs:
381 The value of the current io_32bit setting
382
383
384
385 notes:
386 0=16-bit, 1=32-bit, 2,3 = 32bit+sync
387
388
389
390
391
392HDIO_GET_NOWERR
393 get ignore-write-error flag
394
395
396 usage::
397
398 long val;
399
400 ioctl(fd, HDIO_GET_NOWERR, &val);
401
402 inputs:
403 none
404
405
406
407 outputs:
408 The value of the current ignore-write-error flag
409
410
411
412
413
414HDIO_GET_DMA
415 get use-dma flag
416
417
418 usage::
419
420 long val;
421
422 ioctl(fd, HDIO_GET_DMA, &val);
423
424 inputs:
425 none
426
427
428
429 outputs:
430 The value of the current use-dma flag
431
432
433
434
435
436HDIO_GET_NICE
437 get nice flags
438
439
440 usage::
441
442 long nice;
443
444 ioctl(fd, HDIO_GET_NICE, &nice);
445
446 inputs:
447 none
448
449
450
451 outputs:
452 The drive's "nice" values.
453
454
455
456 notes:
457 Per-drive flags which determine when the system will give more
458 bandwidth to other devices sharing the same IDE bus.
459
460 See <linux/hdreg.h>, near symbol IDE_NICE_DSC_OVERLAP.
461
462
463
464
465HDIO_SET_NICE
466 set nice flags
467
468
469 usage::
470
471 unsigned long nice;
472
473 ...
474 ioctl(fd, HDIO_SET_NICE, nice);
475
476 inputs:
477 bitmask of nice flags.
478
479
480
481 outputs:
482 none
483
484
485
486 error returns:
487 - EACCES Access denied: requires CAP_SYS_ADMIN
488 - EPERM Flags other than DSC_OVERLAP and NICE_1 set.
489 - EPERM DSC_OVERLAP specified but not supported by drive
490
491 notes:
492 This ioctl sets the DSC_OVERLAP and NICE_1 flags from values
493 provided by the user.
494
495 Nice flags are listed in <linux/hdreg.h>, starting with
496 IDE_NICE_DSC_OVERLAP. These values represent shifts.
497
498
499
500
501
502HDIO_GET_WCACHE
503 get write cache mode on|off
504
505
506 usage::
507
508 long val;
509
510 ioctl(fd, HDIO_GET_WCACHE, &val);
511
512 inputs:
513 none
514
515
516
517 outputs:
518 The value of the current write cache mode
519
520
521
522
523
524HDIO_GET_ACOUSTIC
525 get acoustic value
526
527
528 usage::
529
530 long val;
531
532 ioctl(fd, HDIO_GET_ACOUSTIC, &val);
533
534 inputs:
535 none
536
537
538
539 outputs:
540 The value of the current acoustic settings
541
542
543
544 notes:
545 See HDIO_SET_ACOUSTIC
546
547
548
549
550
551HDIO_GET_ADDRESS
552 usage::
553
554
555 long val;
556
557 ioctl(fd, HDIO_GET_ADDRESS, &val);
558
559 inputs:
560 none
561
562
563
564 outputs:
565 The value of the current addressing mode:
566
567 = ===================
568 0 28-bit
569 1 48-bit
570 2 48-bit doing 28-bit
571 3 64-bit
572 = ===================
573
574
575
576HDIO_GET_BUSSTATE
577 get the bus state of the hwif
578
579
580 usage::
581
582 long state;
583
584 ioctl(fd, HDIO_SCAN_HWIF, &state);
585
586 inputs:
587 none
588
589
590
591 outputs:
592 Current power state of the IDE bus. One of BUSSTATE_OFF,
593 BUSSTATE_ON, or BUSSTATE_TRISTATE
594
595 error returns:
596 - EACCES Access denied: requires CAP_SYS_ADMIN
597
598
599
600
601HDIO_SET_BUSSTATE
602 set the bus state of the hwif
603 109
604 110
605 usage::111 usage::
606 112
607 int state;113 unsigned char identity[512];
608 114
609 ...115 ioctl(fd, HDIO_GET_IDENTITY, identity);
610 ioctl(fd, HDIO_SCAN_HWIF, state);
611 116
612 inputs:117 inputs:
613 Desired IDE power state. One of BUSSTATE_OFF, BUSSTATE_ON,
614 or BUSSTATE_TRISTATE
615
616 outputs:
617 none118 none
618 119
619 120
620 121
621 error returns:122 outputs:
622 - EACCES Access denied: requires CAP_SYS_RAWIO123 ATA drive identity information. For full description, see
623 - EOPNOTSUPP Hardware interface does not support bus power control124 the IDENTIFY DEVICE and IDENTIFY PACKET DEVICE commands in
624 125 the ATA specification.
625
626
627 126
628HDIO_TRISTATE_HWIF127 error returns:
629 execute a channel tristate128 - EINVAL Called on a partition instead of the whole disk device
129 - ENOMSG IDENTIFY DEVICE information not available
630 130
131 notes:
132 Returns information that was obtained when the drive was
133 probed. Some of this information is subject to change, and
134 this ioctl does not re-probe the drive to update the
135 information.
631 136
632 Not implemented, as of 2.6.8.1. See HDIO_SET_BUSSTATE137 This information is also available from /proc/ide/hdX/identify
633 138
634 139
635 140
636HDIO_DRIVE_RESET141HDIO_GET_32BIT
637 execute a device reset142 get current io_32bit setting
638 143
639 144
640 usage::145 usage::
641 146
642 int args[3]147 long val;
643 148
644 ...149 ioctl(fd, HDIO_GET_32BIT, &val);
645 ioctl(fd, HDIO_DRIVE_RESET, args);
646 150
647 inputs:151 inputs:
648 none152 none
@@ -650,22 +154,12 @@ HDIO_DRIVE_RESET · 1 unmodified line
650 154
651 155
652 outputs:156 outputs:
653 none157 The value of the current io_32bit setting
654
655 158
656 159
657 error returns:
658 - EACCES Access denied: requires CAP_SYS_ADMIN
659 - ENXIO No such device: phy dead or ctl_addr == 0
660 - EIO I/O error: reset timed out or hardware error
661 160
662 notes:161 notes:
663 162 0=16-bit, 1=32-bit, 2,3 = 32bit+sync
664 - Execute a reset on the device as soon as the current IO
665 operation has completed.
666
667 - Executes an ATAPI soft reset if applicable, otherwise
668 executes an ATA soft reset on the controller.
669 163
670 164
671 165
@@ -1026,14 +520,6 @@ HDIO_DRIVE_TASK · 354 unmodified lines
1026 520
1027 521
1028 522
1029HDIO_DRIVE_CMD_AEB
1030 HDIO_DRIVE_TASK
1031
1032
1033 Not implemented, as of 2.6.8.1
1034
1035
1036
1037HDIO_SET_32BIT523HDIO_SET_32BIT
1038 change io_32bit flags524 change io_32bit flags
1039 525
@@ -1059,284 +545,3 @@ HDIO_SET_32BIT · 19 unmodified lines
1059 - EACCES Access denied: requires CAP_SYS_ADMIN545 - EACCES Access denied: requires CAP_SYS_ADMIN
1060 - EINVAL value out of range [0 3]546 - EINVAL value out of range [0 3]
1061 - EBUSY Controller busy547 - EBUSY Controller busy
1062
1063
1064
1065
1066HDIO_SET_NOWERR
1067 change ignore-write-error flag
1068
1069
1070 usage::
1071
1072 int val;
1073
1074 ioctl(fd, HDIO_SET_NOWERR, val);
1075
1076 inputs:
1077 New value for ignore-write-error flag. Used for ignoring
1078
1079
1080 WRERR_STAT
1081
1082 outputs:
1083 none
1084
1085
1086
1087 error return:
1088 - EINVAL Called on a partition instead of the whole disk device
1089 - EACCES Access denied: requires CAP_SYS_ADMIN
1090 - EINVAL value out of range [0 1]
1091 - EBUSY Controller busy
1092
1093
1094
1095HDIO_SET_DMA
1096 change use-dma flag
1097
1098
1099 usage::
1100
1101 long val;
1102
1103 ioctl(fd, HDIO_SET_DMA, val);
1104
1105 inputs:
1106 New value for use-dma flag
1107
1108
1109
1110 outputs:
1111 none
1112
1113
1114
1115 error return:
1116 - EINVAL Called on a partition instead of the whole disk device
1117 - EACCES Access denied: requires CAP_SYS_ADMIN
1118 - EINVAL value out of range [0 1]
1119 - EBUSY Controller busy
1120
1121
1122
1123HDIO_SET_PIO_MODE
1124 reconfig interface to new speed
1125
1126
1127 usage::
1128
1129 long val;
1130
1131 ioctl(fd, HDIO_SET_PIO_MODE, val);
1132
1133 inputs:
1134 New interface speed.
1135
1136
1137
1138 outputs:
1139 none
1140
1141
1142
1143 error return:
1144 - EINVAL Called on a partition instead of the whole disk device
1145 - EACCES Access denied: requires CAP_SYS_ADMIN
1146 - EINVAL value out of range [0 255]
1147 - EBUSY Controller busy
1148
1149
1150
1151HDIO_SCAN_HWIF
1152 register and (re)scan interface
1153
1154
1155 usage::
1156
1157 int args[3]
1158
1159 ...
1160 ioctl(fd, HDIO_SCAN_HWIF, args);
1161
1162 inputs:
1163
1164 ======= =========================
1165 args[0] io address to probe
1166
1167
1168 args[1] control address to probe
1169 args[2] irq number
1170 ======= =========================
1171
1172 outputs:
1173 none
1174
1175
1176
1177 error returns:
1178 - EACCES Access denied: requires CAP_SYS_RAWIO
1179 - EIO Probe failed.
1180
1181 notes:
1182 This ioctl initializes the addresses and irq for a disk
1183 controller, probes for drives, and creates /proc/ide
1184 interfaces as appropriate.
1185
1186
1187
1188HDIO_UNREGISTER_HWIF
1189 unregister interface
1190
1191
1192 usage::
1193
1194 int index;
1195
1196 ioctl(fd, HDIO_UNREGISTER_HWIF, index);
1197
1198 inputs:
1199 index index of hardware interface to unregister
1200
1201
1202
1203 outputs:
1204 none
1205
1206
1207
1208 error returns:
1209 - EACCES Access denied: requires CAP_SYS_RAWIO
1210
1211 notes:
1212 This ioctl removes a hardware interface from the kernel.
1213
1214 Currently (2.6.8) this ioctl silently fails if any drive on
1215 the interface is busy.
1216
1217
1218
1219HDIO_SET_WCACHE
1220 change write cache enable-disable
1221
1222
1223 usage::
1224
1225 int val;
1226
1227 ioctl(fd, HDIO_SET_WCACHE, val);
1228
1229 inputs:
1230 New value for write cache enable
1231
1232
1233
1234 outputs:
1235 none
1236
1237
1238
1239 error return:
1240 - EINVAL Called on a partition instead of the whole disk device
1241 - EACCES Access denied: requires CAP_SYS_ADMIN
1242 - EINVAL value out of range [0 1]
1243 - EBUSY Controller busy
1244
1245
1246
1247HDIO_SET_ACOUSTIC
1248 change acoustic behavior
1249
1250
1251 usage::
1252
1253 int val;
1254
1255 ioctl(fd, HDIO_SET_ACOUSTIC, val);
1256
1257 inputs:
1258 New value for drive acoustic settings
1259
1260
1261
1262 outputs:
1263 none
1264
1265
1266
1267 error return:
1268 - EINVAL Called on a partition instead of the whole disk device
1269 - EACCES Access denied: requires CAP_SYS_ADMIN
1270 - EINVAL value out of range [0 254]
1271 - EBUSY Controller busy
1272
1273
1274
1275HDIO_SET_QDMA
1276 change use-qdma flag
1277
1278
1279 Not implemented, as of 2.6.8.1
1280
1281
1282
1283HDIO_SET_ADDRESS
1284 change lba addressing modes
1285
1286
1287 usage::
1288
1289 int val;
1290
1291 ioctl(fd, HDIO_SET_ADDRESS, val);
1292
1293 inputs:
1294 New value for addressing mode
1295
1296 = ===================
1297 0 28-bit
1298 1 48-bit
1299 2 48-bit doing 28-bit
1300 = ===================
1301
1302 outputs:
1303 none
1304
1305
1306
1307 error return:
1308 - EINVAL Called on a partition instead of the whole disk device
1309 - EACCES Access denied: requires CAP_SYS_ADMIN
1310 - EINVAL value out of range [0 2]
1311 - EBUSY Controller busy
1312 - EIO Drive does not support lba48 mode.
1313
1314
1315HDIO_SET_IDE_SCSI
1316 usage::
1317
1318
1319 long val;
1320
1321 ioctl(fd, HDIO_SET_IDE_SCSI, val);
1322
1323 inputs:
1324 New value for scsi emulation mode (?)
1325
1326
1327
1328 outputs:
1329 none
1330
1331
1332
1333 error return:
1334 - EINVAL Called on a partition instead of the whole disk device
1335 - EACCES Access denied: requires CAP_SYS_ADMIN
1336 - EINVAL value out of range [0 1]
1337 - EBUSY Controller busy
1338
1339
1340
1341HDIO_SET_SCSI_IDE
1342 Not implemented, as of 2.6.8.1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t