QUEUECOMMAND

Section: (9)
Updated: 17 July 2003
Index Return to Main Contents

 

NAME

queuecommand - queue scsi command, invoke 'done' on completion  

SYNOPSIS

int queuecommand (struct scsi_cmnd * scp, void (*done) struct scsi_cmnd *);  

ARGUMENTS

scp
pointer to scsi command object
done
function pointer to be invoked on completion
 

DESCRIPTION

Returns 1 if the adapter (host) is busy, else returns 0. One reason for an adapter to be busy is that the number of outstanding queued commands is already equal to  

STRUCT SCSI_HOST

:can_queue .  

REQUIRED

if struct Scsi_Host::can_queue is ever non-zero then this function is required.  

LOCKS

struct Scsi_Host::host_lock held on entry (with ``irqsave'') and is expected to be held on return.  

NOTES

This function should be relatively fast. Normally it will not wait for IO to complete. Hence the 'done' callback is invoked (often directly from an interrupt service routine) sometime after this command has returned. In some cases (e.g. pseudo adapter drivers that manufacture the response to a SCSI INQUIRY) the 'done' callback may be invoked before this function returns. If the 'done' callback is not invoked within a certain period the SCSI mid level will commence error processing. The integer with 4 component bytes that command uses as its return value should be generated by this function. However, in this case, it should be placed in scp->result before this function returns. If a status of CHECK CONDITION is placed in ``result'' when the 'done' callback is invoked, then the LLD driver should  

PERFORM AUTOSENSE AND FILL IN THE STRUCT SCSI_CMND

:sense_buffer array.  

DEFINED IN

LLD  

ABOUT THIS DOCUMENT

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

If you have comments on the formatting of this manpage, then please contact Michael Still (mikal@stillhq.com).

This documentation was generated with kernel version 2.5.71.


 

Index

NAME
SYNOPSIS
ARGUMENTS
DESCRIPTION
STRUCT SCSI_HOST
REQUIRED
LOCKS
NOTES
PERFORM AUTOSENSE AND FILL IN THE STRUCT SCSI_CMND
DEFINED IN
ABOUT THIS DOCUMENT

This document was created by man2html, using the manual pages.
Time: 02:18:33 GMT, July 17, 2003