/* Called by midlayer with host locked to queue a new request  */
static int mesh_queue(struct scsi_cmnd *cmd, void(*done)(struct scsi_cmnd *))
/* Called by midlayer with host locked to queue a new request  */
static int mesh_queue(struct scsi_cmnd *cmd, void(*done)(struct scsi_cmnd *))
{
	struct mesh_state *ms;
	cmd->scsi_done = done;
	cmd->host_scribble = NULL;
	ms = (struct mesh_state *) cmd->device->host->hostdata;
	if (ms->request_q == NULL)
		ms->request_q = cmd;
	else
		ms->request_qtail->host_scribble = (void *) cmd;
	ms->request_qtail = cmd;
	if (ms->phase == idle)
		mesh_start(ms);
	return 0;
}