SCSI Architectural Overview from http://tldp.org/HOWTO/SCSI-2.4-HOWTO/arch.html User Space -------------------------------------------------------------------------------- Kernel Space **************** **************** **************** **************** * sd.c * * sr.c * * st.c * * sg.c * Upper * disks, * * cdroms/dvds, * * tapes * * pass-through * Level * block device * * block device * * char device * * char device * * sd_mod.o * * sr_mod.o * * st.o * * sg.o * **************** **************** **************** **************** ***************************************************** Mid * scsi.[hc], hosts.[hc], constants.c * Level * Unifying Layer * * scsi_mod.o * ***************************************************** ************************ ************************ Lower * Host Bus Adapter * * Pseudo drivers for * Level * drivers * * non-SCSI buses * * (aic7xxx) * * (e.g. ide-scsi) * ************************ ************************ The new scsi-changer.2.4.21-15.EL.patch file uses CONFIG_CHR_DEV_SCH as its controlling .config variable. Similar CONFIG_CHR_DEV* variables include CONFIG_CHR_DEV_ST = Tape (st) driver = st.c CONFIG_CHR_DEV_OSST = OnSteam tape (osst) driver = osst.c CONFIG_CHR_DEV_SG = SCSI generic (sg) driver = sg.c So it appears my new ch.c driver is at the "Upper Level" and probably should more resemble st.c, osst.c, and sg.c, all of which can be found in the /usr/src/linux-2.4.21-15.0.2.EL.Jukebox/drivers/scsi directory. st.c README.st osst.c README.osst = The osst is a new high-level SCSI driver, just like st, sr, sd and sg. and If you want to have the module autoloaded on access to /dev/osst, you may add something like alias char-major-206 osst to your /etc/modules.conf (old name: conf.modules). (Remember my chnod command, "mknod /dev/sch0 c 86 0" which created crw-r--r-- ... 86, 0 Jun 18 15:26 sch0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!! so maybe I should have !!!!!!!!!!!! !!!!!!!!!!!! alias char-major-86 ch !!!!!!!!!!!! !!!!!!!!!!!! in /etc/module.conf. !!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! sg.c So ch.c should be similar to osst.c, hmmm? A quick check of external references (nm *.o | grep ' U ') shows these differences, ch scsi_allocate_device_Rsmp_4322e218 ----------\ osst scsi_allocate_request_Rsmp_c59b479f | | In scsi.c, you'll find this scsi_allocate_device <----------/ function with these comments, * Function: scsi_allocate_device Scsi_Cmnd *scsi_allocate_device(Scsi_Device * device, int wait, int interruptable) SCpnt = scsi_allocate_device(ch[target].device , 1 , TRUE); * Purpose: Allocate a command descriptor. * Notes: ... * This function is deprecated, and drivers should be * rewritten to use Scsi_Request instead of Scsi_Cmnd. The bottom line is, ch.c using the old scsi_allocate_device routine, is the old way. It should be using scsi_allocate_request instead. Searching around for an upgraded scsi-changer, I found http://www.uwsg.iu.edu/hypermail/linux/kernel/0305.1/0065.html which had a very similar scsi-changer patch file, but the key differences are #define VERSION "0.22" instead of #define VERSION "0.20" and it uses scsi_allocate_request instead of scsi_allocate_device =================================================================================== Regarding my note above, !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!! so maybe I should have !!!!!!!!!!!! !!!!!!!!!!!! alias char-major-86 ch !!!!!!!!!!!! !!!!!!!!!!!! in /etc/module.conf. !!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I tried this, followed by rmmod ch and insmod ch and now I see these lines in my /var/log/kernel.syslog (remember? I changed syslog?) Jul 12 10:33:37 vinu kernel: klogd 1.4.1, log source = /proc/kmsg started. Jul 13 14:41:04 vinu kernel: SCSI Media Changer driver v0.20 for Linux 2.4.21-15.0.2.EL.Jukebox Jul 13 14:41:04 vinu kernel: Detected scsi changer ch0 at scsi1, channel 0, id 6, lun 0 Jul 13 14:41:04 vinu kernel: ch0: type #1 (mt): 0x2000+1 [medium transport] Jul 13 14:41:04 vinu kernel: ch0: type #2 (st): 0x1+770 [storage] Jul 13 14:41:04 vinu kernel: ch0: type #3 (ie): 0x3000+2 [import/export] Jul 13 14:41:04 vinu kernel: ch0: type #4 (dt): 0x4000+5 [data transfer] Jul 13 14:41:04 vinu kernel: ch0: dt 0x4000: ID 0, LUN 0, Huh? device not found! Jul 13 14:41:04 vinu kernel: ch0: dt 0x4001: ID 2, LUN 0, name: PIONEER DVDROM DVD-D 7362 1.01 Jul 13 14:41:04 vinu kernel: ch0: dt 0x4002: ID 3, LUN 0, name: PIONEER DVDROM DVD-D 7362 1.01 Jul 13 14:41:04 vinu kernel: ch0: dt 0x4003: ID 4, LUN 0, name: PIONEER DVDROM DVD-D 7362 1.01 Jul 13 14:41:04 vinu kernel: ch0: dt 0x4004: ID 5, LUN 0, name: PIONEER DVDROM DVD-D 7362 1.01 Jul 13 14:41:04 vinu kernel: ch0: INITIALIZE ELEMENT STATUS, may take some time ... What I guess is happening, is the juke is going through all its elements. Yay! It is!!! =================================================================================== Other random SCSI notes: ------------------------------------------------------------------ - - - See the modprobe command, e.g. - - modprobe -c - - ... - - alias block-major-58 lvm-mod - alias block-major-88 ide-probe-mod - - ... - - - - Perhaps I should add somehow, a line saying - - alias block-major-86 ch - - no, not block, since the mknod was done with a "c" - - (e.g. mknod /dev/sch0 c 86 0), but rather - - alias char-major-86 ch - - and it's in /etc/modules.conf - - - ------------------------------------------------------------------ ------------------------------------------------------------------ - - - hwbrowser shows the Pioneer CHANGR DRM-7000 device as - - Manufacturer: Unknown - - Driver: none or built-in - - Device: /dev/sg5 - - - ------------------------------------------------------------------ ============================================================================================ sd.c = SCSI Disk Driver sg.c = Generic SCSI Driver sr.c = SCSI Disk Driver (Enhanced?) st.c = SCSI Tape Driver ============================================================================================ /proc/scsi Commands: ==================== 1) * Usage: echo "scsi dump #N" > /proc/scsi/scsi * to dump status of all scsi commands. The number is used to specify the level * of detail in the dump. 2) * Usage: echo "scsi log token #N" > /proc/scsi/scsi * where token is one of [error,scan,mlqueue,mlcomplete,llqueue, * llcomplete,hlqueue,hlcomplete] 3) * Usage: echo "scsi add-single-device 0 1 2 3" >/proc/scsi/scsi * with "0 1 2 3" replaced by your "Host Channel Id Lun". * Consider this feature BETA. * CAUTION: This is not for hotplugging your peripherals. As * SCSI was not designed for this you could damage your * hardware ! * However perhaps it is legal to switch on an * already connected device. It is perhaps not * guaranteed this device doesn't corrupt an ongoing data transfer. 4) * Usage: echo "scsi remove-single-device 0 1 2 3" >/proc/scsi/scsi * with "0 1 2 3" replaced by your "Host Channel Id Lun". 5) * Usage: echo "scsi scan-new-devices" >/proc/scsi/scsi * Scans all host adapters again to see if there are any new devices. ============================================================================================