.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "QUEUECOMMAND" "9" "29 May 2003" "" "" .SH NAME queuecommand \- queue scsi command, invoke 'done' on completion .SH SYNOPSIS .sp \fB .sp int queuecommand (struct scsi_cmnd * \fIscp\fB, void (*\fIdone\fB) struct scsi_cmnd *); \fR .SH "ARGUMENTS" .TP \fB\fIscp\fB\fR pointer to scsi command object .TP \fB\fIdone\fB\fR function pointer to be invoked on completion .SH "DESCRIPTION" .PP 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 .SH "STRUCT SCSI_HOST" .PP :can_queue . .SH "REQUIRED" .PP if struct Scsi_Host::can_queue is ever non-zero then this function is required. .SH "LOCKS" .PP struct Scsi_Host::host_lock held on entry (with ``irqsave'') and is expected to be held on return. .SH "NOTES" .PP 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 \fBcommand\fR 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 .SH "PERFORM AUTOSENSE AND FILL IN THE STRUCT SCSI_CMND" .PP :sense_buffer array. .SH "DEFINED IN" .PP LLD .SH "ABOUT THIS DOCUMENT" .PP 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". .PP If you have comments on the formatting of this manpage, then please contact Michael Still (mikal@stillhq.com). .PP This documentation was generated with kernel version 2.5.70.