how to get the port number of the SCSI Host based adapter on my system?
Posted on 2012-09-08
I have two SAS host based adapters on my system. i want to fire an IOCTL on the miniport driver for these adapters to find out some hardware specific details.
To be able to fire an IOCTL, i need to create a handle for these scsi adapters using createFile function. While doing this, i need to prepare the file name is \\.\scsiN, where N stands for the number of the SCSI adapter.
Is there anyway to determine N (the number of the SCSI adapter) directly here instead of starting with 0 iterating until my IOCTL on the minport succeeds?
I have a way to do it when i have some SCSI drives connected to the HBAs. I will fire an IOCTL with the control code IOCTL_SCSI_GET_ADDRESS on to one of the drives connected to the HBA and in return i will get a SCSI_ADDRESS structure for the SCSI disk. This structure contains the port number of the disk, which is same as the controller number.
But i don't want to do this because i want to be able to fire the IOCTL on the miniport even when the disks are not connected.
Please let me know if anybody can help.