I am trying to get Maximum LBA of the disk using SCSI Read Capacity Command.
I have created 10 byte CDB as follows
ccb->cam_flags = NO_DATA;
ccb->cdb[0] = READ_CAPACITY; /* 0x25 SCSI Opcode for Read Capacity Command */ ccb->cdb[1] = 0x01;
ccb->cdb[2] = 0;
ccb->cdb[3] = 0;
ccb->cdb[4] = 0;
ccb->cdb[5] = 0;
ccb->cdb[6] = 0;
ccb->cdb[7] = 0;
ccb->cdb[8] = 0x01;
ccb->cdb[9] = 0;
The SCSI command is successful. Unfortunately I am not getting the expected LBA and it is displaying it as zero.
My basic question is whether the SCSI CDB command created above is correct or not ?
Try to set ccb->cdb[1] to 0. Relative address bit should not be used in such case.