From owner-freebsd-mobile@FreeBSD.ORG Mon Mar 28 14:42:49 2005 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D440916A4EC; Mon, 28 Mar 2005 14:42:49 +0000 (GMT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36D2D43D2F; Mon, 28 Mar 2005 14:42:49 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [10.1.1.7]) (authenticated bits=0)j2SEgcsf097060 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 28 Mar 2005 16:42:40 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id j2SEfaVK088131 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 28 Mar 2005 16:41:37 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.11/8.12.11) with ESMTP id j2SEfagw027784; Mon, 28 Mar 2005 16:41:36 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id j2SEfZNH027783; Mon, 28 Mar 2005 16:41:36 +0200 (CEST) (envelope-from ticso) Date: Mon, 28 Mar 2005 16:41:35 +0200 From: Bernd Walter To: Poul-Henning Kamp Message-ID: <20050328144135.GI14532@cicely12.cicely.de> References: <20050328134856.GF14532@cicely12.cicely.de> <32733.1112019870@critter.freebsd.dk> <20050328143801.GH14532@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050328143801.GH14532@cicely12.cicely.de> X-Operating-System: FreeBSD cicely12.cicely.de 5.2-CURRENT alpha User-Agent: Mutt/1.5.6i X-Spam-Status: No, hits=-4.9 required=3.0 tests=BAYES_00 autolearn=no version=2.64 X-Spam-Report: * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0001] X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on cicely12.cicely.de cc: "current@freebsd.org" cc: vova@fbsd.ru cc: "Matthew N. Dodd" cc: freebsd-mobile@freebsd.org cc: Julian Elischer cc: ticso@cicely.de Subject: Re: Reattach/redetect allways connected umass device - is it possible ? X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2005 14:42:50 -0000 On Mon, Mar 28, 2005 at 04:38:02PM +0200, Bernd Walter wrote: > On Mon, Mar 28, 2005 at 04:24:30PM +0200, Poul-Henning Kamp wrote: > > In message <20050328134856.GF14532@cicely12.cicely.de>, 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: This even works for my USB flash drives: [67]cicely13# camcontrol tur -n da -u 1 -v Unit is not ready (pass1:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0 (pass1:umass-sim0:0:0:0): CAM Status: SCSI Status Error (pass1:umass-sim0:0:0:0): SCSI Status: Check Condition (pass1:umass-sim0:0:0:0): NOT READY asc:3a,0 (pass1:umass-sim0:0:0:0): Medium not present Exit 1 [68]cicely13# camcontrol tur -n da -u 1 -v Unit is not ready (pass1:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0 (pass1:umass-sim0:0:0:0): CAM Status: SCSI Status Error (pass1:umass-sim0:0:0:0): SCSI Status: Check Condition (pass1:umass-sim0:0:0:0): UNIT ATTENTION asc:28,0 (pass1:umass-sim0:0:0:0): Not ready to ready change, medium may have changed Exit 1 [69]cicely13# camcontrol tur -n da -u 1 -v Unit is ready [71]cicely13# camcontrol tur -n da -u 4 -v Unit is not ready (pass4:umass-sim1:1:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0 (pass4:umass-sim1:1:0:0): CAM Status: SCSI Status Error (pass4:umass-sim1:1:0:0): SCSI Status: Check Condition (pass4:umass-sim1:1:0:0): UNIT ATTENTION asc:28,0 (pass4:umass-sim1:1:0:0): Not ready to ready change, medium may have changed Exit 1 [72]cicely13# camcontrol tur -n da -u 4 -v Unit is ready Those are both more or less random flash card readers, so it seems that even cheap devices work. -- B.Walter BWCT http://www.bwct.de bernd@bwct.de info@bwct.de