Re: Reattach/redetect allways connected umass device - is it possible ?

Vladimir Grebenschikov <[email protected]>
Newsgroups gmane.os.freebsd.current,gmane.os.freebsd.devel.mobile
Organization SWsoft
Message-ID <1112036059.1077.2.camel@localhost>
В пн, 28/03/2005 в 16:38 +0200, Bernd Walter пишет:
> On Mon, Mar 28, 2005 at 04:24:30PM +0200, Poul-Henning Kamp wrote:
> > In message <[email protected]>, Bernd Walter writes:
> > 
> > >> Driver support for this is not really meaterialized and therefore
> > >> the model now is that when the media is ejected the geom device
> > >> is removed and a new one created right away, even if a new media
> > >> is not inserted right away.
> > >
> > >Do you get eject notifications from any device type?
> > 
> > Right now I belive floppy disks DTRT.
> 
> Interesting.
> 
> > >One of my problems is that it is possible with SCSI MO drives to
> > >eject the media, reinsert a new one and errously continue to work
> > >with the old GEOM layout.
> > >I already trashed the data on one media by forgetting to trigger
> > >a reprobe - since then I use a mount script.
> > 
> > Well, I have no idea how to pull the information out of the CAM/SCSI
> > code, but I'm sure there is _some_ way it can be done.
> 
> There is the test unit ready command.
> Either it returns OK, or you may get usefull sense data.
> Here is an example:

Same with my memory stick:

// card in card-reader
# camcontrol tur -n da -u 0 -v
Unit is ready

// card is just removed
# camcontrol tur -n da -u 0 -v
Unit is not ready
(pass0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0 
(pass0:umass-sim0:0:0:0): CAM Status: SCSI Status Error
(pass0:umass-sim0:0:0:0): SCSI Status: Check Condition
(pass0:umass-sim0:0:0:0): UNIT ATTENTION asc:28,0
(pass0:umass-sim0:0:0:0): Not ready to ready change, medium may have
changed

// card is just inserted
# camcontrol tur -n da -u 0 -v
Unit is not ready
(pass0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0 
(pass0:umass-sim0:0:0:0): CAM Status: SCSI Status Error
(pass0:umass-sim0:0:0:0): SCSI Status: Check Condition
(pass0:umass-sim0:0:0:0): UNIT ATTENTION asc:28,0
(pass0:umass-sim0:0:0:0): Not ready to ready change, medium may have
changed

// 1 sec later (card still here)
# camcontrol tur -n da -u 0 -v
Unit is ready
#


-- 
Vladimir B. Grebenchikov
[email protected]
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.