[9374] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: finding target id of a scsi device [and back :-)?]

daemon@ATHENA.MIT.EDU (Giuseppe Corbelli)
Sat Aug 12 05:53:50 2000

Date:	Fri, 11 Aug 2000 16:44:27 +0200 (CEST)
From:	Giuseppe Corbelli <cowo@yoda.ing.unibs.it>
To:	Douglas Gilbert <dgilbert@interlog.com>
Cc:	"linux-scsi@vger.rutgers.edu" <linux-scsi@vger.rutgers.edu>
In-Reply-To: <Pine.LNX.4.21.0008050950420.584-100000@braveheart.cowo.net>
Message-ID: <Pine.LNX.4.21.0008111643570.9369-100000@braveheart.cowo.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Thu, 3 Aug 2000, Douglas Gilbert wrote:
> > 
> > is there a way in user-space to map from the dev_t ( retrive from
> > stat(2) ) to the scsi target & logical ids?
> > if no can i do it in kernel-space ?
> 
> With an open file descriptor to a SCSI device the
> SCSI_IOCTL_GET_IDLUN ioctl() can be used. 
> The struct associated with this ioctl() is
> described in:
> http://www.torque.net/scsi/linux_scsi_24
> 
> You may also be able to deduce it from looking at
> 'cat /proc/scsi/scsi' [but that is a bit hard to
> parse].
I'd like to "extend the original question" :-)
How can I translate between BUS,ID,LUN <-> sg <-> sr (hd)?
Of course I should take a look at cdrecord's source but it's too hard for
me without documentation. Forgive me :-)
--
  	Giuseppe "Cowo" Corbelli  -->>  Riding on Linux-2.2.16
  -<! The Moment Is Now In All History, The Time Has Arrived And This Is The
  		One Place To Be. !>-
  			Savatage - This Is The Time


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post