DCMD_CAM_DEVINFO and HD serial number

I am trying to get the physical serial number from the hard drive under QNX
RTP and found DCMD_CAM_DEVINFO, which seems to give some of the physical
information on the disk, but it doesn’t seem to give the serial number.

Is it possible to read the unique hard drive serial number with
DCMD_CAM_DEVINFO?

What is held in the reserved section of struct cam_devinfo?

Thanks
Jens

Jens H Jorgensen <jhj@remove-nospam-videk.com> wrote:

I am trying to get the physical serial number from the hard drive under QNX
RTP and found DCMD_CAM_DEVINFO, which seems to give some of the physical
information on the disk, but it doesn’t seem to give the serial number.
Is it possible to read the unique hard drive serial number with
DCMD_CAM_DEVINFO?

No. You’d have to send a ATA_IDENTIFY command, and I can’t see a way
of doing that. You can send a SC_INQUIRY, which will return the
model name and firmware revision, but does not have the serial number.
So I’m not aware of any existing method of obtaining this detail.

What is held in the reserved section of struct cam_devinfo?

It is currently unused. Funnily enough, it is reserved for expansion
to 64-bit disk sizes and for holding a unique device identifier, such
as the SCSI WWID or EIDE serial number. Unfortunately it is currently
not implemented.