mirror of
https://github.com/erichelgeson/BlueSCSI.git
synced 2024-12-22 12:30:12 +00:00
added a full lookup table for cdb length
this fixes the issue of 16 byte cdb commands from causing problems by not being detected correctly
This commit is contained in:
parent
5bb2dee71f
commit
6ec75300c4
@ -1182,8 +1182,7 @@ void loop()
|
||||
|
||||
LOGHEX(cmd[0]);
|
||||
// Command length selection, reception
|
||||
static const int cmd_class_len[8]={6,10,10,6,6,12,6,6};
|
||||
len = cmd_class_len[cmd[0] >> 5];
|
||||
len = cdb_len_lookup[cmd[0]];
|
||||
cmd[1] = readHandshake(); LOG(":");LOGHEX(cmd[1]);
|
||||
cmd[2] = readHandshake(); LOG(":");LOGHEX(cmd[2]);
|
||||
cmd[3] = readHandshake(); LOG(":");LOGHEX(cmd[3]);
|
||||
|
@ -325,5 +325,19 @@ typedef __attribute__((aligned(4))) struct _SCSI_DEVICE
|
||||
uint8_t m_sector_offset; // optical sector offset for missing sync header
|
||||
} SCSI_DEVICE;
|
||||
|
||||
static byte cdb_len_lookup[] = {
|
||||
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
|
||||
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
|
||||
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
|
||||
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
|
||||
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
|
||||
10,10,10,10,10,10,10,10,10,10,10,10,10,16,16,16,16,16,16,16,16,
|
||||
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
|
||||
16,16,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
|
||||
12,12,12,12,12,12,12,12,12,12,12,12,12,12,10,10,10,10,10,10,10,
|
||||
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
|
||||
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
|
||||
10,10,10,10,10,10,10,10,10,10,10,10,10,10
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user