aakash berde wrote:
> Hi,
> I misunderstood the prtconf -v output.
> 
> I am now in  a state of detecting the SCSI disks  attached to HBA.
> I assigend a pointer to cfgadm -al output where I get the details of
> disks attached to HBA.
> Then one by one I send the uscsi ioctl devices to get the scsi disk details.
> I hope this method will also works.
> 
> But I want to get the details of HBA also on which SCSI disks are attached.
> I am setting a system environment variable and providing the HBA
> driver details to system environment. Then I am getting this variable
> in applicaton for getting the HBA driver type and giving this HBA
> driver details to prtconf -Dv to see the HBA instances for this HBA
> driver. I hope this will work to detect HBA for HBA driver provided.
> 
> But after that, how I can see the details of HBA i.e HBA vendor name
> and Product ID?
> Do I need to use any ioctl to communicate with HBA and if yes then
> which ioctl to be used?

Hi Aakash,
I don't think you're going about this in a very easy
fashion - you appear to be reinventing the wheel.


Please make use of libdevinfo(3LIB).


Once you have found your device in the libdevinfo
output you can search for various properties so that
your application can make decisions programmatically
instead of using an env var which might not be
correct.

It sounds to me as if the properties you want to
check for - initially at least - would include

binding-name
driver-name
compatible
subsystem-vendor-id
subsystem-id
class-code
revision-id
vendor-id, and
device-id


If you have a child node, such as an sd instance,
you can get details on the parent node by calling
di_parent_node(3DEVINFO) and passing the returned
node to the property query. Similarly, you can
iterate over the child nodes for a parent by using
the di_child_node(3DEVINFO) call.


Ioctls don't really come into this, because unless
you identify a specific driver which *you know*
has an ioctl which you want to use, you should be
sticking with functions from libdevinfo(3LIB).


James C. McPherson
--
Senior Kernel Software Engineer, Solaris
Sun Microsystems
http://blogs.sun.com/jmcp       http://www.jmcp.homeunix.com/blog
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to