fas_callbacks.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ISSUES
*/
#ifdef FASDEBUG
extern int fasdebug;
extern int fasdebug_instance; /* debug all instances */
#endif /* FASDEBUG */
int
{
return (0);
}
void
{
}
void
{
"fas_empty_callbackQ_start");
/*
* don't recurse into calling back: the target driver
* may call scsi_transport() again which may call
* fas_empty_callbackQ again
*/
if (fas->f_c_in_callback) {
goto done;
}
while (qf) {
}
}
fas->f_c_in_callback = 0;
done:
"fas_empty_callbackQ_end");
}
/*
* fas_call_pkt_comp does sanity checking to ensure that we don't
* call completion twice on the same packet or a packet that has been freed.
* if there is a completion function specified, the packet is queued
* up and it is left to the fas_callback thread to empty the queue at
* a lower priority; note that there is one callback queue per fas
*
* we use a separate thread for calling back into the target driver
* this thread unqueues packets from the callback queue
*/
void
{
"fas_call_pkt_comp_start");
sp->cmd_qfull_retries = 0;
/*
* if this was an auto request sense, complete immediately to free
* the arq pkt
*/
IPRINTF6("completion for %d.%d, sp=0x%p, "
"reason=%s, stats=%x, state=%x\n",
} else {
EPRINTF2("completion queued for %d.%dn",
}
/*
* append the packet or start a new queue
*/
/*
* add to tail
*/
} else {
/*
* start new queue
*/
}
/*
* the callback will be redone later
*/
} else {
EPRINTF2("No completion routine for 0x%p reason %x\n",
}
"fas_call_pkt_comp_end");
}