^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ========================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) README for the SCSI media changer driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) ========================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) This is a driver for SCSI Medium Changer devices, which are listed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) with "Type: Medium Changer" in /proc/scsi/scsi.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) This is for *real* Jukeboxes. It is *not* supported to work with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) common small CD-ROM changers, neither one-lun-per-slot SCSI changers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) nor IDE drives.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) Userland tools available from here:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) http://linux.bytesex.org/misc/changer.html
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) General Information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) -------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) First some words about how changers work: A changer has 2 (possibly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) more) SCSI ID's. One for the changer device which controls the robot,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) and one for the device which actually reads and writes the data. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) later may be anything, a MOD, a CD-ROM, a tape or whatever. For the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) changer device this is a "don't care", he *only* shuffles around the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) media, nothing else.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) The SCSI changer model is complex, compared to - for example - IDE-CD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) changers. But it allows to handle nearly all possible cases. It knows
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 4 different types of changer elements:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) =============== ==================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) media transport this one shuffles around the media, i.e. the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) transport arm. Also known as "picker".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) storage a slot which can hold a media.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) import/export the same as above, but is accessible from outside,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) i.e. there the operator (you !) can use this to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) fill in and remove media from the changer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) Sometimes named "mailslot".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) data transfer this is the device which reads/writes, i.e. the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) CD-ROM / Tape / whatever drive.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) =============== ==================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) None of these is limited to one: A huge Jukebox could have slots for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 123 CD-ROM's, 5 CD-ROM readers (and therefore 6 SCSI ID's: the changer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) and each CD-ROM) and 2 transport arms. No problem to handle.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) How it is implemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) ---------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) I implemented the driver as character device driver with a NetBSD-like
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) ioctl interface. Just grabbed NetBSD's header file and one of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) other linux SCSI device drivers as starting point. The interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) should be source code compatible with NetBSD. So if there is any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) software (anybody knows ???) which supports a BSDish changer driver,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) it should work with this driver too.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) Over time a few more ioctls where added, volume tag support for example
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) wasn't covered by the NetBSD ioctl API.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) Current State
^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) Support for more than one transport arm is not implemented yet (and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) nobody asked for it so far...).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) I test and use the driver myself with a 35 slot cdrom jukebox from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) Grundig. I got some reports telling it works ok with tape autoloaders
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) (Exabyte, HP and DEC). Some People use this driver with amanda. It
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) works fine with small (11 slots) and a huge (4 MOs, 88 slots)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) magneto-optical Jukebox. Probably with lots of other changers too, most
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) (but not all :-) people mail me only if it does *not* work...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) I don't have any device lists, neither black-list nor white-list. Thus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) it is quite useless to ask me whenever a specific device is supported or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) not. In theory every changer device which supports the SCSI-2 media
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) changer command set should work out-of-the-box with this driver. If it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) doesn't, it is a bug. Either within the driver or within the firmware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) of the changer device.
^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) Using it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) --------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) This is a character device with major number is 86, so use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) "mknod /dev/sch0 c 86 0" to create the special file for the driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) If the module finds the changer, it prints some messages about the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) device [ try "dmesg" if you don't see anything ] and should show up in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) /proc/devices. If not.... some changers use ID ? / LUN 0 for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) device and ID ? / LUN 1 for the robot mechanism. But Linux does *not*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) look for LUNs other than 0 as default, because there are too many
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) broken devices. So you can try:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) 1) echo "scsi add-single-device 0 0 ID 1" > /proc/scsi/scsi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) (replace ID with the SCSI-ID of the device)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 2) boot the kernel with "max_scsi_luns=1" on the command line
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) (append="max_scsi_luns=1" in lilo.conf should do the trick)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) Trouble?
^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) If you insmod the driver with "insmod debug=1", it will be verbose and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) prints a lot of stuff to the syslog. Compiling the kernel with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) CONFIG_SCSI_CONSTANTS=y improves the quality of the error messages a lot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) because the kernel will translate the error codes into human-readable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) strings then.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) You can display these messages with the dmesg command (or check the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) logfiles). If you email me some question because of a problem with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) driver, please include these messages.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) Insmod options
^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) debug=0/1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) Enable debug messages (see above, default: 0).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) verbose=0/1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) Be verbose (default: 1).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) init=0/1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) Send INITIALIZE ELEMENT STATUS command to the changer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) at insmod time (default: 1).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) timeout_init=<seconds>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) timeout for the INITIALIZE ELEMENT STATUS command
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) (default: 3600).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) timeout_move=<seconds>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) timeout for all other commands (default: 120).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) dt_id=<id1>,<id2>,... / dt_lun=<lun1>,<lun2>,...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) These two allow to specify the SCSI ID and LUN for the data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) transfer elements. You likely don't need this as the jukebox
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) should provide this information. But some devices don't ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) vendor_firsts=, vendor_counts=, vendor_labels=
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) These insmod options can be used to tell the driver that there
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) are some vendor-specific element types. Grundig for example
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) does this. Some jukeboxes have a printer to label fresh burned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) CDs, which is addressed as element 0xc000 (type 5). To tell the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) driver about this vendor-specific element, use this::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) $ insmod ch \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) vendor_firsts=0xc000 \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) vendor_counts=1 \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) vendor_labels=printer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) All three insmod options accept up to four comma-separated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) values, this way you can configure the element types 5-8.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) You likely need the SCSI specs for the device in question to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) find the correct values as they are not covered by the SCSI-2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) standard.
^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) Credits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) -------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) I wrote this driver using the famous mailing-patches-around-the-world
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) method. With (more or less) help from:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) - Daniel Moehwald <moehwald@hdg.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) - Dane Jasper <dane@sonic.net>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) - R. Scott Bailey <sbailey@dsddi.eds.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) - Jonathan Corbet <corbet@lwn.net>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) Special thanks go to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) - Martin Kuehne <martin.kuehne@bnbt.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) for a old, second-hand (but full functional) cdrom jukebox which I use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) to develop/test driver and tools now.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) Have fun,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) Gerd
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) Gerd Knorr <kraxel@bytesex.org>