Re: Return of PENDING status to SCSI driver

Alan Cox
2009-06-16T13:58:48Z

> If I call void (*done)(struct scsi_cmnd *) call back immediately after
> receiving a command, will I get another command ?

The mid layer will throw commands at you until either you tell it to
stop, there is an error or the amount of pending queued commands for the
target, or the adapter is reached.

In the utterly simplistic case of a totally dumb PIO adapter with no
interrupt support the flow is essentially

foo_queue_command(cmd)
cmd->done(cmd)
return 0

foo_queue_command(cmd)
cmd->done(cmd)
return 0

If you want the scsi mid layer to shut up for a bit then return one of
the MLQUEUE_xxx_BUSY forms and the command will be requeued and fed to
you again later.