1

I am writing a program which will print host, channel number, id number, lun of a SCSI device.

cat /proc/scsi/scsi 

giving the information about it. But i want print it through c program. I'm getting vendor id, device type, revision level... but not lun , bus no etc.

Is there any ioctl command to get lun, bus, id numbers?

Siva Charan
  • 17,940
  • 9
  • 60
  • 95
gangadhars
  • 2,584
  • 7
  • 41
  • 68

1 Answers1

0

Did you try the ioctls for SCSI generic :

http://sg.danny.cz/sg/p/sg_v3_ho.html#ioctl ?

SCSI_IOCTL_GET_IDLUN, SG_GET_SCSI_ID should do the trick.

I did not use any SCSI HW in the last years though, and I hope the documentation is still valid for current kernels. I don't see any reason to have changed the ioctls though.

Eric Fournie
  • 1,362
  • 8
  • 10