From owner-freebsd-mobile@FreeBSD.ORG Tue Mar 29 07:04:09 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 F410E16A4CE; Tue, 29 Mar 2005 07:04:08 +0000 (GMT) Received: from vbook.fbsd.ru (swsoft-mipt-nat.sw.ru [195.214.233.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B40743D39; Tue, 29 Mar 2005 07:04:08 +0000 (GMT) (envelope-from vova@vbook.fbsd.ru) Received: from vova by vbook.fbsd.ru with local (Exim 4.50 (FreeBSD)) id 1DFzNU-0000K8-DR; Mon, 28 Mar 2005 22:54:20 +0400 From: Vladimir Grebenschikov To: ticso@cicely.de In-Reply-To: <20050328143801.GH14532@cicely12.cicely.de> References: <20050328134856.GF14532@cicely12.cicely.de> <32733.1112019870@critter.freebsd.dk> <20050328143801.GH14532@cicely12.cicely.de> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Organization: SWsoft Date: Mon, 28 Mar 2005 22:54:19 +0400 Message-Id: <1112036059.1077.2.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 FreeBSD GNOME Team Port Sender: Vladimir Grebenschikov cc: "current@freebsd.org" cc: "Matthew N. Dodd" cc: freebsd-mobile@freebsd.org cc: Poul-Henning Kamp cc: Julian Elischer 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: vova@fbsd.ru List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2005 07:04:09 -0000 =F7 =D0=CE, 28/03/2005 =D7 16:38 +0200, Bernd Walter =D0=C9=DB=C5=D4: > On Mon, Mar 28, 2005 at 04:24:30PM +0200, Poul-Henning Kamp wrote: > > In message <20050328134856.GF14532@cicely12.cicely.de>, Bernd Walter wr= ites: > >=20 > > >> 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? > >=20 > > Right now I belive floppy disks DTRT. >=20 > Interesting. >=20 > > >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. > >=20 > > 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. >=20 > 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=20 (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=20 (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 # --=20 Vladimir B. Grebenchikov vova@fbsd.ru