Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Aug 1999 12:49:13 -0700
From:      Amancio Hasty <hasty@rah.star-gate.com>
To:        "Kenneth D. Merry" <ken@kdm.org>
Cc:        dillon@apollo.backplane.com, wilko@yedi.iaf.nl, current@FreeBSD.ORG
Subject:   Re: [re]writable cdrom drive 
Message-ID:  <199908181949.MAA01438@rah.star-gate.com>
In-Reply-To: Your message of "Wed, 18 Aug 1999 13:39:45 MDT." <199908181939.NAA21622@panzer.kdm.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Amancio Hasty wrote...
> > > Amancio Hasty wrote...
> > > > I have to agree with Matt on this plus the set of defaults is system wide .
> > > 
> > > What are you agreeing with him on?  Why not quote what you're talking
> > > about?
> > > 
> > > > Is it possible to get a system bus enumeration from the system so 
> > > > a program such a cdrecord can attempt to make an intelligent
> > > > decision as to which device is the cd recorder for instance we
> > > > know that the system can print the device's name and its
> > > > scsi address:
> > > 
> > > If you want a bus number, there's a really easy way to get it:
> > > 
> > > # camcontrol devlist
> > > <EXABYTE EXB-10i 2.6>              at scbus0 target 3 lun 0 (pass0,ch0)
> > > <EXABYTE EXB-8500-85Qanx0 0415>    at scbus0 target 4 lun 0 (pass1,sa0)
> > > <SEAGATE ST31230W 0510>            at scbus1 target 0 lun 0 (pass2,da0)
> > > <SEAGATE ST32155N 0318>            at scbus1 target 1 lun 0 (pass3,da1)
> > > <PLEXTOR CD-R   PX-R412C 1.04>     at scbus1 target 3 lun 0 (pass4,cd0)
> > > <PLEXTOR CD-ROM PX-4XCS 1.04>      at scbus1 target 6 lun 0 (pass5,cd1)
> > > <SEAGATE ST34371N 0484>            at scbus2 target 0 lun 0 (pass6,da2)
> > > 
> > > So, in this case, the bus,target,lun combination for my CD-R is 1,3,0.
> > > 
> > > cdrecord itself also has a slightly more obtuse way of doing the same
> > > thing:
> > > 
> > > # cdrecord -scanbus
> > > Cdrecord release 1.8a22 Copyright (C) 1995-1999 J_rg Schilling
> > > scsibus0:
> > >                   0) *
> > >                   1) *
> 
> [ ... ]
> 
> > > The camcontrol output is easier to figure out, though.
> > > 
> > > Ken
> > 
> > This is about ease of use . cdrecord in the absence of a device specification 
> > should
> > query the bus and present the user with a choice of cd recorder devices ideally
> > if there is one cd recorder it should go ahead an use it if such behavior is 
> > not desired then create an option "--confirm" to ask the user if its okay
> > to use the "guessed" cd recorder.
> 
> If you think cdrecord should do something different, talk to Joerg
> Schilling <schilling@fokus.gmd.de> about it.
> 
> > camcontrol is a generic scsi command line interface and very nice . What I am 
> > after
> > is a generic bus enumerator  API so apps like cd recorder or fxtv can use
> > to locate the device in the absence of a specified device.
> 
> There is a generic SCSI bus enumerator API, and one for PCI as well.  There
> isn't a generic API to get trees of devices of any type in the system,
> though.  With new-bus that might be possible, but having done two
> enumerator APIs already (I wrote the CAM and PCI enumerator code), I can
> predict that it might be very complicated to do properly.  (Things get
> really hairy when you have to keep the device tree from changing while
> you're traversing it.)
> 
> In any case, for the two applications you specified, cdrecord is only
> interested in SCSI devices, and there is already an API -- that cdrecord
> already supports -- to do bus/device enumeration.  The cdrecord -scanbus
> code already uses that API.
> 
> Similarly, there is already a PCI device listing interface, so fxtv should
> be able to easily pull out the devices it is interested in.  All it has to
> do is search for all "meteor" or "bktr" devices to find what it wants.
> 
> Ken

Now how can I map a device name from this bus enumeration  so that I can issue
an "open" to the device:

pciconf -l
chip0@pci0:0:0: class=0x060000 card=0x00000000 chip=0x12378086 rev=0x02 
hdr=0x00
isab0@pci0:1:0: class=0x060100 card=0x00000000 chip=0x70008086 rev=0x01 
hdr=0x00
ide_pci0@pci0:1:1:      class=0x010180 card=0x00000000 chip=0x70108086 
rev=0x00 hdr=0x00
chip1@pci0:1:2: class=0x0c0300 card=0x00000000 chip=0x70208086 rev=0x01 
hdr=0x00
de0@pci0:9:0:   class=0x020000 card=0x11001385 chip=0x00091011 rev=0x22 
hdr=0x00
bktr0@pci0:10:0:        class=0x040000 card=0x13eb0070 chip=0x036e109e 
rev=0x02 hdr=0x00
none0@pci0:10:1:        class=0x048000 card=0x13eb0070 chip=0x0878109e 
rev=0x02 hdr=0x00
ahc0@pci0:11:0: class=0x010000 card=0x00000000 chip=0x81789004 rev=0x00 
hdr=0x00
ahc1@pci0:12:0: class=0x010000 card=0x00000000 chip=0x71789004 rev=0x03 
hdr=0x00
vga-pci0@pci0:13:0:     class=0x030000 card=0x00000000 chip=0x0519102b 
rev=0x01 hdr=0x00

-- 

 Amancio Hasty
 hasty@rah.star-gate.com




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908181949.MAA01438>