[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Implement mode_select for atapi tape drives
On Sat, 8 Aug 2009, Marc Balmer wrote:
But the calculated value of *_select_len is actually passed to
routine scsipi_mode_select() a little bit later on, so we still
need the calculated value.
why cant sizeof be used there, too?
It actually controls amount of data that is sent to the device.
Most devices have 0 bytes for st->page_0_size but some have 12 bytes.
The attached patch revision includes the change to use sizeof() in
the calls to memset(), adds a KASSERT when loading the quirk data to
ensure that the st->page_0_size is not larger than MAX_PAGE_0_SIZE,
and adds the necessary quirk for my tape drive.
I like this. Maybe KASSERT that MAX_PAG_0_SIZE is <= sizeof(struct
atapi_select) ? That could be combined into a single KASSERT, even.
Additional comments/criticisms welcomed!
Main Index |
Thread Index |