From nobody@FreeBSD.ORG Sun Sep 19 16:49:43 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id B503B14A28; Sun, 19 Sep 1999 16:49:43 -0700 (PDT)
Message-Id: <19990919234943.B503B14A28@hub.freebsd.org>
Date: Sun, 19 Sep 1999 16:49:43 -0700 (PDT)
From: kientzle@acm.org
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: da driver does not support 'CDIOCEJECT' ioctl
X-Send-Pr-Version: www-1.0

>Number:         13843
>Category:       kern
>Synopsis:       da driver does not support 'CDIOCEJECT' ioctl
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ken
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 19 16:50:00 PDT 1999
>Closed-Date:    Wed Feb 07 02:43:32 GMT 2007
>Last-Modified:  Wed Feb 07 02:43:32 GMT 2007
>Originator:     Tim Kientzle
>Release:        3.2-RELEASE
>Organization:
>Environment:
FreeBSD clover.kientzle.com 3.2-RELEASE FreeBSD 3.2-RELEASE #3: Sun Sep 19 15:28:03 PDT 1999
root@clover.kientzle.com:/usr/src/sys/compile/CLOVER  i386
>Description:
Since 'od' isn't a CAM driver, shouldn't 'da' support
the 'CDIOCEJECT' ioctl, which is used to eject a variety
of removable media (e.g., ZIP drives)?

Having a way to programatically eject ZIP disks is quite
handy; using 'od' on 2.2.X, I had edited rc.shutdown to
eject any ZIP disks, which avoids some painful drive-lettering
problems when you boot Windows.  (It also ejects the disk,
which is otherwise impossible---at least for internal
drives---without turning the machine back on.)

				- Tim Kientzle

>How-To-Repeat:
The command: cdcontrol -f da0 eject

Does not work with a SCSI internal ZIP drive (nor with an
external parallel-port drive accessed through vp interface).

>Fix:
It looks like the code might be cut/pasted from scsi_cd.c to scsi_da.c.
I don't know enough about the code to be sure; might be necessary
to check and do this only for removable drives.


>Release-Note:
>Audit-Trail:

From: "Kenneth D. Merry" <ken@kdm.org>
To: kientzle@acm.org
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/13843: da driver does not support 'CDIOCEJECT' ioctl
Date: Sun, 19 Sep 1999 22:15:37 -0600 (MDT)

 kientzle@acm.org wrote...
 > Since 'od' isn't a CAM driver, shouldn't 'da' support
 > the 'CDIOCEJECT' ioctl, which is used to eject a variety
 > of removable media (e.g., ZIP drives)?
 > 
 > Having a way to programatically eject ZIP disks is quite
 > handy; using 'od' on 2.2.X, I had edited rc.shutdown to
 > eject any ZIP disks, which avoids some painful drive-lettering
 > problems when you boot Windows.  (It also ejects the disk,
 > which is otherwise impossible---at least for internal
 > drives---without turning the machine back on.)
 > 
 > 				- Tim Kientzle
 > 
 > >How-To-Repeat:
 > The command: cdcontrol -f da0 eject
 > 
 > Does not work with a SCSI internal ZIP drive (nor with an
 > external parallel-port drive accessed through vp interface).
 > 
 > >Fix:
 > It looks like the code might be cut/pasted from scsi_cd.c to scsi_da.c.
 > I don't know enough about the code to be sure; might be necessary
 > to check and do this only for removable drives.
 
 It seems sort of kludgy to use part of the CD ioctl set with drives that
 obviously aren't CDROM drives.
 
 In any case, there is already a way to eject media from any SCSI device
 that has removable media:
 
 camcontrol eject da0
 
 Note that this won't work unless the disk is unmounted.  When the da device
 is open, removal will be prevented.
 
 Ken
 -- 
 Kenneth Merry
 ken@kdm.org
 
State-Changed-From-To: open->suspended 
State-Changed-By: ken 
State-Changed-When: Mon Sep 20 22:17:00 PDT 1999 
State-Changed-Why:  
There's already a way to eject any SCSI removable media -- with camcontrol. 
However the PR author brought up a reasonable point about a generic ioctl 
to handle removable media.  I'm sticking this in suspended state until 
I get a chance to think about it some more.  At that point, I may either 
do something about it or decide that it isn't worth dealing with and close 
the PR. 


Responsible-Changed-From-To: freebsd-bugs->ken 
Responsible-Changed-By: ken 
Responsible-Changed-When: Mon Sep 20 22:17:00 PDT 1999 
Responsible-Changed-Why:  
I'll take this one. 
State-Changed-From-To: suspended->closed 
State-Changed-By: rodrigc 
State-Changed-When: Wed Feb 7 02:42:47 UTC 2007 
State-Changed-Why:  
"camcontrol eject da0" is the way to eject media from a removable 
SCSI device. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=13843 
>Unformatted:
