문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top