1
0
Fork 0
forked from len0rd/rockbox

Optimise (replace two loops with one) and bug-fix the ProductId string returned by SCSI Inquiry - the previous code was skipping 4 shorts (the first 8 chars) of the ProductId.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16285 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Chapman 2008-02-11 18:08:21 +00:00
parent 5f641ed3c2
commit fe4ffbd94c

View file

@ -486,15 +486,11 @@ static void identify2inquiry(int lun)
inquiry->DeviceTypeModifier = DEVICE_REMOVABLE; inquiry->DeviceTypeModifier = DEVICE_REMOVABLE;
/* ATA only has a 'model' field, so we copy the /* ATA only has a 'model' field, so we copy the
first 8 bytes to 'vendor' and the rest to 'product' */ first 8 bytes to 'vendor' and the rest to 'product' (they are
consecutive in the inquiry struct) */
src = (unsigned short*)&identify[27]; src = (unsigned short*)&identify[27];
dest = (unsigned short*)&inquiry->VendorId; dest = (unsigned short*)&inquiry->VendorId;
for (i=0;i<4;i++) for (i=0;i<12;i++)
dest[i] = htobe16(src[i]);
src = (unsigned short*)&identify[27+8];
dest = (unsigned short*)&inquiry->ProductId;
for (i=0;i<8;i++)
dest[i] = htobe16(src[i]); dest[i] = htobe16(src[i]);
src = (unsigned short*)&identify[23]; src = (unsigned short*)&identify[23];