Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: cdrom: convert docs to ReST and rename to *.rst

The stuff there is almost already at ReST format. A
conversion for them is trivial: just add a missing titles
and fix some scape codes for them to match ReST syntax.

While here, rename the cdrom-standard.txt, with was converted
from LaTeX to ReST on the previous patch, and add it to the
index file.

At its new index.rst, let's add a :orphan: while this is not linked to
the main index.rst file, in order to avoid build warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
8ea61889 e327cfcb

+131 -101
Documentation/cdrom/cdrom-standard.txt Documentation/cdrom/cdrom-standard.rst
+91 -87
Documentation/cdrom/ide-cd Documentation/cdrom/ide-cd.rst
··· 1 1 IDE-CD driver documentation 2 - Originally by scott snyder <snyder@fnald0.fnal.gov> (19 May 1996) 3 - Carrying on the torch is: Erik Andersen <andersee@debian.org> 4 - New maintainers (19 Oct 1998): Jens Axboe <axboe@image.dk> 2 + =========================== 3 + 4 + :Originally by: scott snyder <snyder@fnald0.fnal.gov> (19 May 1996) 5 + :Carrying on the torch is: Erik Andersen <andersee@debian.org> 6 + :New maintainers (19 Oct 1998): Jens Axboe <axboe@image.dk> 5 7 6 8 1. Introduction 7 9 --------------- 8 10 9 - The ide-cd driver should work with all ATAPI ver 1.2 to ATAPI 2.6 compliant 11 + The ide-cd driver should work with all ATAPI ver 1.2 to ATAPI 2.6 compliant 10 12 CDROM drives which attach to an IDE interface. Note that some CDROM vendors 11 13 (including Mitsumi, Sony, Creative, Aztech, and Goldstar) have made 12 14 both ATAPI-compliant drives and drives which use a proprietary 13 15 interface. If your drive uses one of those proprietary interfaces, 14 16 this driver will not work with it (but one of the other CDROM drivers 15 - probably will). This driver will not work with `ATAPI' drives which 17 + probably will). This driver will not work with `ATAPI` drives which 16 18 attach to the parallel port. In addition, there is at least one drive 17 19 (CyCDROM CR520ie) which attaches to the IDE port but is not ATAPI; 18 20 this driver will not work with drives like that either (but see the ··· 33 31 from audio tracks. The program cdda2wav can be used for this. 34 32 Note, however, that only some drives actually support this. 35 33 36 - - There is now support for CDROM changers which comply with the 34 + - There is now support for CDROM changers which comply with the 37 35 ATAPI 2.6 draft standard (such as the NEC CDR-251). This additional 38 36 functionality includes a function call to query which slot is the 39 37 currently selected slot, a function call to query which slots contain ··· 51 49 driver. 52 50 53 51 1. Make sure that the ide and ide-cd drivers are compiled into the 54 - kernel you're using. When configuring the kernel, in the section 55 - entitled "Floppy, IDE, and other block devices", say either `Y' 56 - (which will compile the support directly into the kernel) or `M' 52 + kernel you're using. When configuring the kernel, in the section 53 + entitled "Floppy, IDE, and other block devices", say either `Y` 54 + (which will compile the support directly into the kernel) or `M` 57 55 (to compile support as a module which can be loaded and unloaded) 58 - to the options: 56 + to the options:: 59 57 60 58 ATA/ATAPI/MFM/RLL support 61 59 Include IDE/ATAPI CDROM support ··· 74 72 address and an IRQ number, the standard assignments being 75 73 0x1f0 and 14 for the primary interface and 0x170 and 15 for the 76 74 secondary interface. Each interface can control up to two devices, 77 - where each device can be a hard drive, a CDROM drive, a floppy drive, 78 - or a tape drive. The two devices on an interface are called `master' 79 - and `slave'; this is usually selectable via a jumper on the drive. 75 + where each device can be a hard drive, a CDROM drive, a floppy drive, 76 + or a tape drive. The two devices on an interface are called `master` 77 + and `slave`; this is usually selectable via a jumper on the drive. 80 78 81 79 Linux names these devices as follows. The master and slave devices 82 - on the primary IDE interface are called `hda' and `hdb', 80 + on the primary IDE interface are called `hda` and `hdb`, 83 81 respectively. The drives on the secondary interface are called 84 - `hdc' and `hdd'. (Interfaces at other locations get other letters 82 + `hdc` and `hdd`. (Interfaces at other locations get other letters 85 83 in the third position; see Documentation/ide/ide.txt.) 86 84 87 85 If you want your CDROM drive to be found automatically by the 88 86 driver, you should make sure your IDE interface uses either the 89 87 primary or secondary addresses mentioned above. In addition, if 90 88 the CDROM drive is the only device on the IDE interface, it should 91 - be jumpered as `master'. (If for some reason you cannot configure 89 + be jumpered as `master`. (If for some reason you cannot configure 92 90 your system in this manner, you can probably still use the driver. 93 91 You may have to pass extra configuration information to the kernel 94 92 when you boot, however. See Documentation/ide/ide.txt for more 95 93 information.) 96 94 97 95 4. Boot the system. If the drive is recognized, you should see a 98 - message which looks like 96 + message which looks like:: 99 97 100 98 hdb: NEC CD-ROM DRIVE:260, ATAPI CDROM drive 101 99 102 100 If you do not see this, see section 5 below. 103 101 104 102 5. You may want to create a symbolic link /dev/cdrom pointing to the 105 - actual device. You can do this with the command 103 + actual device. You can do this with the command:: 106 104 107 105 ln -s /dev/hdX /dev/cdrom 108 106 ··· 110 108 drive is installed. 111 109 112 110 6. You should be able to see any error messages from the driver with 113 - the `dmesg' command. 111 + the `dmesg` command. 114 112 115 113 116 114 3. Basic usage 117 115 -------------- 118 116 119 - An ISO 9660 CDROM can be mounted by putting the disc in the drive and 120 - typing (as root) 117 + An ISO 9660 CDROM can be mounted by putting the disc in the drive and 118 + typing (as root):: 121 119 122 120 mount -t iso9660 /dev/cdrom /mnt/cdrom 123 121 ··· 125 123 device (as described in step 5 of the last section) and /mnt/cdrom is 126 124 an empty directory. You should now be able to see the contents of the 127 125 CDROM under the /mnt/cdrom directory. If you want to eject the CDROM, 128 - you must first dismount it with a command like 126 + you must first dismount it with a command like:: 129 127 130 128 umount /mnt/cdrom 131 129 ··· 150 148 this are Sony and Toshiba drives. You will get errors if you try to 151 149 use this function on a drive which does not support it. 152 150 153 - For supported changers, you can use the `cdchange' program (appended to 151 + For supported changers, you can use the `cdchange` program (appended to 154 152 the end of this file) to switch between changer slots. Note that the 155 153 drive should be unmounted before attempting this. The program takes 156 154 two arguments: the CDROM device, and the slot number to which you wish ··· 167 165 IDE support code. Some of these items apply only to earlier versions 168 166 of the driver, but are mentioned here for completeness. 169 167 170 - In most cases, you should probably check with `dmesg' for any errors 168 + In most cases, you should probably check with `dmesg` for any errors 171 169 from the driver. 172 170 173 171 a. Drive is not detected during booting. ··· 186 184 187 185 - If the autoprobing is not finding your drive, you can tell the 188 186 driver to assume that one exists by using a lilo option of the 189 - form `hdX=cdrom', where X is the drive letter corresponding to 190 - where your drive is installed. Note that if you do this and you 191 - see a boot message like 187 + form `hdX=cdrom`, where X is the drive letter corresponding to 188 + where your drive is installed. Note that if you do this and you 189 + see a boot message like:: 192 190 193 191 hdX: ATAPI cdrom (?) 194 192 ··· 222 220 probably not making it to the host. 223 221 224 222 - IRQ problems may also be indicated by the message 225 - `IRQ probe failed (<n>)' while booting. If <n> is zero, that 223 + `IRQ probe failed (<n>)` while booting. If <n> is zero, that 226 224 means that the system did not see an interrupt from the drive when 227 225 it was expecting one (on any feasible IRQ). If <n> is negative, 228 226 that means the system saw interrupts on multiple IRQ lines, when ··· 242 240 there are hardware problems with the interrupt setup; they 243 241 apparently don't use interrupts. 244 242 245 - - If you own a Pioneer DR-A24X, you _will_ get nasty error messages 243 + - If you own a Pioneer DR-A24X, you _will_ get nasty error messages 246 244 on boot such as "irq timeout: status=0x50 { DriveReady SeekComplete }" 247 245 The Pioneer DR-A24X CDROM drives are fairly popular these days. 248 246 Unfortunately, these drives seem to become very confused when we perform 249 247 the standard Linux ATA disk drive probe. If you own one of these drives, 250 - you can bypass the ATA probing which confuses these CDROM drives, by 251 - adding `append="hdX=noprobe hdX=cdrom"' to your lilo.conf file and running 252 - lilo (again where X is the drive letter corresponding to where your drive 248 + you can bypass the ATA probing which confuses these CDROM drives, by 249 + adding `append="hdX=noprobe hdX=cdrom"` to your lilo.conf file and running 250 + lilo (again where X is the drive letter corresponding to where your drive 253 251 is installed.) 254 - 252 + 255 253 c. System hangups. 256 254 257 255 - If the system locks up when you try to access the CDROM, the most 258 256 likely cause is that you have a buggy IDE adapter which doesn't 259 257 properly handle simultaneous transactions on multiple interfaces. 260 258 The most notorious of these is the CMD640B chip. This problem can 261 - be worked around by specifying the `serialize' option when 259 + be worked around by specifying the `serialize` option when 262 260 booting. Recent kernels should be able to detect the need for 263 261 this automatically in most cases, but the detection is not 264 262 foolproof. See Documentation/ide/ide.txt for more information 265 - about the `serialize' option and the CMD640B. 263 + about the `serialize` option and the CMD640B. 266 264 267 265 - Note that many MS-DOS CDROM drivers will work with such buggy 268 266 hardware, apparently because they never attempt to overlap CDROM ··· 271 269 272 270 d. Can't mount a CDROM. 273 271 274 - - If you get errors from mount, it may help to check `dmesg' to see 272 + - If you get errors from mount, it may help to check `dmesg` to see 275 273 if there are any more specific errors from the driver or from the 276 274 filesystem. 277 275 278 276 - Make sure there's a CDROM loaded in the drive, and that's it's an 279 277 ISO 9660 disc. You can't mount an audio CD. 280 278 281 - - With the CDROM in the drive and unmounted, try something like 279 + - With the CDROM in the drive and unmounted, try something like:: 282 280 283 281 cat /dev/cdrom | od | more 284 282 ··· 286 284 OK, and the problem is at the filesystem level (i.e., the CDROM is 287 285 not ISO 9660 or has errors in the filesystem structure). 288 286 289 - - If you see `not a block device' errors, check that the definitions 287 + - If you see `not a block device` errors, check that the definitions 290 288 of the device special files are correct. They should be as 291 - follows: 289 + follows:: 292 290 293 291 brw-rw---- 1 root disk 3, 0 Nov 11 18:48 /dev/hda 294 292 brw-rw---- 1 root disk 3, 64 Nov 11 18:48 /dev/hdb ··· 303 301 If you have a /dev/cdrom symbolic link, check that it is pointing 304 302 to the correct device file. 305 303 306 - If you hear people talking of the devices `hd1a' and `hd1b', these 304 + If you hear people talking of the devices `hd1a` and `hd1b`, these 307 305 were old names for what are now called hdc and hdd. Those names 308 306 should be considered obsolete. 309 307 ··· 313 311 always give meaningful error messages. 314 312 315 313 316 - e. Directory listings are unpredictably truncated, and `dmesg' shows 317 - `buffer botch' error messages from the driver. 314 + e. Directory listings are unpredictably truncated, and `dmesg` shows 315 + `buffer botch` error messages from the driver. 318 316 319 317 - There was a bug in the version of the driver in 1.2.x kernels 320 318 which could cause this. It was fixed in 1.3.0. If you can't ··· 337 335 5. cdchange.c 338 336 ------------- 339 337 340 - /* 341 - * cdchange.c [-v] <device> [<slot>] 342 - * 343 - * This loads a CDROM from a specified slot in a changer, and displays 344 - * information about the changer status. The drive should be unmounted before 345 - * using this program. 346 - * 347 - * Changer information is displayed if either the -v flag is specified 348 - * or no slot was specified. 349 - * 350 - * Based on code originally from Gerhard Zuber <zuber@berlin.snafu.de>. 351 - * Changer status information, and rewrite for the new Uniform CDROM driver 352 - * interface by Erik Andersen <andersee@debian.org>. 353 - */ 338 + :: 354 339 355 - #include <stdio.h> 356 - #include <stdlib.h> 357 - #include <errno.h> 358 - #include <string.h> 359 - #include <unistd.h> 360 - #include <fcntl.h> 361 - #include <sys/ioctl.h> 362 - #include <linux/cdrom.h> 340 + /* 341 + * cdchange.c [-v] <device> [<slot>] 342 + * 343 + * This loads a CDROM from a specified slot in a changer, and displays 344 + * information about the changer status. The drive should be unmounted before 345 + * using this program. 346 + * 347 + * Changer information is displayed if either the -v flag is specified 348 + * or no slot was specified. 349 + * 350 + * Based on code originally from Gerhard Zuber <zuber@berlin.snafu.de>. 351 + * Changer status information, and rewrite for the new Uniform CDROM driver 352 + * interface by Erik Andersen <andersee@debian.org>. 353 + */ 354 + 355 + #include <stdio.h> 356 + #include <stdlib.h> 357 + #include <errno.h> 358 + #include <string.h> 359 + #include <unistd.h> 360 + #include <fcntl.h> 361 + #include <sys/ioctl.h> 362 + #include <linux/cdrom.h> 363 363 364 364 365 - int 366 - main (int argc, char **argv) 367 - { 365 + int 366 + main (int argc, char **argv) 367 + { 368 368 char *program; 369 369 char *device; 370 370 int fd; /* file descriptor for CD-ROM device */ ··· 386 382 fprintf (stderr, " Slots are numbered 1 -- n.\n"); 387 383 exit (1); 388 384 } 389 - 385 + 390 386 if (strcmp (argv[0], "-v") == 0) { 391 387 verbose = 1; 392 388 ++argv; 393 389 --argc; 394 390 } 395 - 391 + 396 392 device = argv[0]; 397 - 393 + 398 394 if (argc == 2) 399 395 slot = atoi (argv[1]) - 1; 400 396 401 - /* open device */ 397 + /* open device */ 402 398 fd = open(device, O_RDONLY | O_NONBLOCK); 403 399 if (fd < 0) { 404 - fprintf (stderr, "%s: open failed for `%s': %s\n", 400 + fprintf (stderr, "%s: open failed for `%s`: %s\n", 405 401 program, device, strerror (errno)); 406 402 exit (1); 407 403 } 408 404 409 - /* Check CD player status */ 405 + /* Check CD player status */ 410 406 total_slots_available = ioctl (fd, CDROM_CHANGER_NSLOTS); 411 407 if (total_slots_available <= 1 ) { 412 - fprintf (stderr, "%s: Device `%s' is not an ATAPI " 408 + fprintf (stderr, "%s: Device `%s` is not an ATAPI " 413 409 "compliant CD changer.\n", program, device); 414 410 exit (1); 415 411 } ··· 422 418 exit (1); 423 419 } 424 420 425 - /* load */ 421 + /* load */ 426 422 slot=ioctl (fd, CDROM_SELECT_DISC, slot); 427 423 if (slot<0) { 428 424 fflush(stdout); ··· 466 462 467 463 for (x_slot=0; x_slot<total_slots_available; x_slot++) { 468 464 printf ("Slot %2d: ", x_slot+1); 469 - status = ioctl (fd, CDROM_DRIVE_STATUS, x_slot); 470 - if (status<0) { 471 - perror(" CDROM_DRIVE_STATUS"); 472 - } else switch(status) { 465 + status = ioctl (fd, CDROM_DRIVE_STATUS, x_slot); 466 + if (status<0) { 467 + perror(" CDROM_DRIVE_STATUS"); 468 + } else switch(status) { 473 469 case CDS_DISC_OK: 474 470 printf ("Disc present."); 475 471 break; 476 - case CDS_NO_DISC: 472 + case CDS_NO_DISC: 477 473 printf ("Empty slot."); 478 474 break; 479 475 case CDS_TRAY_OPEN: ··· 511 507 break; 512 508 } 513 509 } 514 - status = ioctl (fd, CDROM_MEDIA_CHANGED, x_slot); 515 - if (status<0) { 510 + status = ioctl (fd, CDROM_MEDIA_CHANGED, x_slot); 511 + if (status<0) { 516 512 perror(" CDROM_MEDIA_CHANGED"); 517 - } 518 - switch (status) { 513 + } 514 + switch (status) { 519 515 case 1: 520 516 printf ("Changed.\n"); 521 517 break; ··· 529 525 /* close device */ 530 526 status = close (fd); 531 527 if (status != 0) { 532 - fprintf (stderr, "%s: close failed for `%s': %s\n", 528 + fprintf (stderr, "%s: close failed for `%s`: %s\n", 533 529 program, device, strerror (errno)); 534 530 exit (1); 535 531 } 536 - 532 + 537 533 exit (0); 538 - } 534 + }
+19
Documentation/cdrom/index.rst
··· 1 + :orphan: 2 + 3 + ===== 4 + cdrom 5 + ===== 6 + 7 + .. toctree:: 8 + :maxdepth: 1 9 + 10 + cdrom-standard 11 + ide-cd 12 + packet-writing 13 + 14 + .. only:: subproject and html 15 + 16 + Indices 17 + ======= 18 + 19 + * :ref:`genindex`
+17 -10
Documentation/cdrom/packet-writing.txt Documentation/cdrom/packet-writing.rst
··· 1 + ============== 2 + Packet writing 3 + ============== 4 + 1 5 Getting started quick 2 6 --------------------- 3 7 ··· 14 10 Download from http://sourceforge.net/projects/linux-udf/ 15 11 16 12 - Grab a new CD-RW disc and format it (assuming CD-RW is hdc, substitute 17 - as appropriate): 13 + as appropriate):: 14 + 18 15 # cdrwtool -d /dev/hdc -q 19 16 20 - - Setup your writer 17 + - Setup your writer:: 18 + 21 19 # pktsetup dev_name /dev/hdc 22 20 23 - - Now you can mount /dev/pktcdvd/dev_name and copy files to it. Enjoy! 21 + - Now you can mount /dev/pktcdvd/dev_name and copy files to it. Enjoy:: 22 + 24 23 # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime 25 24 26 25 ··· 32 25 33 26 DVD-RW discs can be written to much like CD-RW discs if they are in 34 27 the so called "restricted overwrite" mode. To put a disc in restricted 35 - overwrite mode, run: 28 + overwrite mode, run:: 36 29 37 30 # dvd+rw-format /dev/hdc 38 31 39 - You can then use the disc the same way you would use a CD-RW disc: 32 + You can then use the disc the same way you would use a CD-RW disc:: 40 33 41 34 # pktsetup dev_name /dev/hdc 42 35 # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime ··· 48 41 According to the DVD+RW specification, a drive supporting DVD+RW discs 49 42 shall implement "true random writes with 2KB granularity", which means 50 43 that it should be possible to put any filesystem with a block size >= 51 - 2KB on such a disc. For example, it should be possible to do: 44 + 2KB on such a disc. For example, it should be possible to do:: 52 45 53 46 # dvd+rw-format /dev/hdc (only needed if the disc has never 54 47 been formatted) ··· 61 54 writes are not 32KB aligned. 62 55 63 56 Both problems can be solved by using the pktcdvd driver, which always 64 - generates aligned writes. 57 + generates aligned writes:: 65 58 66 59 # dvd+rw-format /dev/hdc 67 60 # pktsetup dev_name /dev/hdc ··· 90 83 91 84 - Since the pktcdvd driver makes the disc appear as a regular block 92 85 device with a 2KB block size, you can put any filesystem you like on 93 - the disc. For example, run: 86 + the disc. For example, run:: 94 87 95 88 # /sbin/mke2fs /dev/pktcdvd/dev_name 96 89 ··· 104 97 and can be controlled by it. For example the "pktcdvd" tool uses 105 98 this interface. (see http://tom.ist-im-web.de/download/pktcdvd ) 106 99 107 - "pktcdvd" works similar to "pktsetup", e.g.: 100 + "pktcdvd" works similar to "pktsetup", e.g.:: 108 101 109 102 # pktcdvd -a dev_name /dev/hdc 110 103 # mkudffs /dev/pktcdvd/dev_name ··· 122 115 Using the pktcdvd debugfs interface 123 116 ----------------------------------- 124 117 125 - To read pktcdvd device infos in human readable form, do: 118 + To read pktcdvd device infos in human readable form, do:: 126 119 127 120 # cat /sys/kernel/debug/pktcdvd/pktcdvd[0-7]/info 128 121
+1 -1
MAINTAINERS
··· 7610 7610 M: Borislav Petkov <bp@alien8.de> 7611 7611 L: linux-ide@vger.kernel.org 7612 7612 S: Maintained 7613 - F: Documentation/cdrom/ide-cd 7613 + F: Documentation/cdrom/ide-cd.rst 7614 7614 F: drivers/ide/ide-cd* 7615 7615 7616 7616 IDEAPAD LAPTOP EXTRAS DRIVER
+1 -1
drivers/block/Kconfig
··· 347 347 is possible. 348 348 DVD-RW disks must be in restricted overwrite mode. 349 349 350 - See the file <file:Documentation/cdrom/packet-writing.txt> 350 + See the file <file:Documentation/cdrom/packet-writing.rst> 351 351 for further information on the use of this driver. 352 352 353 353 To compile this driver as a module, choose M here: the
+1 -1
drivers/cdrom/cdrom.c
··· 7 7 License. See linux/COPYING for more information. 8 8 9 9 Uniform CD-ROM driver for Linux. 10 - See Documentation/cdrom/cdrom-standard.txt for usage information. 10 + See Documentation/cdrom/cdrom-standard.rst for usage information. 11 11 12 12 The routines in the file provide a uniform interface between the 13 13 software that uses CD-ROMs and the various low-level drivers that
+1 -1
drivers/ide/ide-cd.c
··· 9 9 * May be copied or modified under the terms of the GNU General Public 10 10 * License. See linux/COPYING for more information. 11 11 * 12 - * See Documentation/cdrom/ide-cd for usage information. 12 + * See Documentation/cdrom/ide-cd.rst for usage information. 13 13 * 14 14 * Suggestions are welcome. Patches that work are more welcome though. ;-) 15 15 *