[Cbe-oss-dev] [Q] INQURIY, READ CAPACITY for PS3 BD-ROM
Aegis Lin
aegislin at gmail.com
Mon Jan 28 23:15:39 EST 2008
Hi,
I think this problem should be able to be solved if I dig deeper enough,
but if someone can give me some quick hint about the following problem, I'll
apereciate it very much.
I tried to issue ATAPI commands by using SG_IO ioctl, for which codes can
be verified correct for ATA and USB CDROM device under X86, and even
USB devices under PS3-Linux.
But, when I tried to issue commands like INQUIRY(0x12) and READ
CAPACITY(0x25) for the built-in PS3-ROM device, I always got
Status=0x2, SC/ASC/ASCQ=B/0/0 .
Since it can be traced to ps3rom.c:
... ps3rom_atapi_request()->lv1_storage_send_device_command(),
it seems that the LV1 driver intentionally returns such an error, maybe to
indicate that the sent CDB didn't qualify some more strict restrictions.
>From dmesg it seems that OS can still get the drive info from INQUIRY command.
Is there any public documentation about the PS3 BD-ROM driver APIs?
///pseudo code for issuing INQUIRY
struct sg_io_hdr sih;
unsigned char buf[256];
unsigned char cmd[12];
unsigned char sense[16];
memset(buf,0,256);
SetCDB6(cmd, 0x12, 0, 0, 1, 0, 0);
sih.cmdp = cmd;
sih.interface_id='S';
sih.timeout = 1000;
sih.cmd_len = 6;
sih.dxfer_direction = SG_DXFER_FROM_DEV;
sih.dxferp = buf;
sih.dxfer_len = 256;
sih.buflen = 256;
sih.sbp = sense;
sih.mx_sb_len=16;
ioctl(fd, SG_IO, &sih);
More information about the cbe-oss-dev
mailing list