Date: Thu, 5 Oct 2000 22:54:26 -0600 From: "Kenneth D. Merry" <ken@kdm.org> To: John Reynolds <jjreynold@home.com> Cc: scsi@FreeBSD.ORG Subject: Re: what part of the driver locks the CD tray? Message-ID: <20001005225426.A45446@panzer.kdm.org> In-Reply-To: <14813.21325.718668.456937@whale.home-net>; from jjreynold@home.com on Thu, Oct 05, 2000 at 09:21:33PM -0700 References: <14813.21325.718668.456937@whale.home-net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Oct 05, 2000 at 21:21:33 -0700, John Reynolds wrote: > > Hello -scsi, > > What part of the cd driver locks the tray when media is mounted? > > I have a 1.8 year old son who LOVES to push the buttons on my CD and CDRW, > watch the tray come out, then, with all the grace and skill a > 2-year-old-wanna-be can must, shoving the tray back into the drive (of course > making the stepper motors squeel with pain). > > I've resorted to keeping CDs in both drives and mounting the iso9660 > filesystems. This keeps the drives from being messed with as the eject button > is "disabled" while the media is mounted. > > What I'm wondering is where this is in the cd driver? Is it deep down in the cd > driver? Some CAM layer? ioctl? The function in question is cdprevent(), which is called from cdopen() and cdclose(). While the device is open, ejects aren't allowed. > I would love to be able to figure this out and perhaps add something into > camcontrol to lock the drive trays in without having media in them (it's just a > PITA to have discs in the drives all the time). Sort like the evil reverse of > "camcontrol eject". > > I also see from the man page that there is a 'cmd' option to camcontrol. Is > there a specific command I can send to the device to lock and unlock its tray? > What would this be? Yes. To prevent removal: camcontrol cmd cd0 -v -c "1e 0 0 0 1 0" To allow removal: camcontrol cmd cd0 -v -c "1e 0 0 0 0 0" > I would much appreciate any help I can get 2-year-old proofing this machine :) > (already had to "unplug" the ATX power and reset lines from the easy-to-push > switches :). :) Ken -- Kenneth Merry ken@kdm.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001005225426.A45446>