aac_priv() uses scsi_cmd_priv() which has the comment:
/*
* Return the driver private allocation behind the command.
* Only works if cmd_size is set in the host template.
*/
This is set for this driver:
static struct scsi_host_template aac_driver_template = {
[...]
.cmd_size = sizeof(struct aac_cmd_priv),
I looked around to see if there was some kind of "allocate cmd" helper,
but couldn't find it -- scsi_ioctl_reset() allocates one (together with
struct request) and there are a few uses of ->cmd_size in
drivers/scsi/scsi_lib.c but there doesn't seem to be a common code path
for this.
I guess you could use dev->host->hostt->cmd_size or something, but that
doesn't seem worth it since this is driver specific and we already know
what the correct value should be.