> + * Some commands are specified to transfer (a multiple of) 512 bytes of data
static u32 ata_sector_or_block[]={...};
if (test_bit(tf->cmd, &ata_sector_or_block))
looks so much more elegant than a giant switch statement and I suspect
produces far better code
word 106 is not defined in early ATA standards so it would be wise to
check that ATA8 is reported by the drive - and trust the relevant bits
for ATA7/8 as appropriate.
The drivers also need to know when a command is being issued which is a
funny shape as some hardware cannot do it because the internal state
machine knows the sector size and other stuff seems to need the internal
FIFO turning off or other things whacked repeatedly on the head to make
it work.
You also don't need to bother listing all the commands that don't have
data transfer phases as a sector size is meaningless there so we
shouldn't even bother doing a lookup for them. Indeed the more I look at
this the more it seems that keeping long complex ever out of date arrays
is the wrong way to do it.
We will also need a driver flag to indicate support in that HBA but that
is pretty trivial to add
Alan
--