Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (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 or http://www.opensolaris.org/os/licensing. 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]
#include <sys/scsi/scsi.h> int scsi_poll(struct scsi_pkt *pkt);
Solaris DDI specific (Solaris DDI).
Pointer to the scsi_pkt(9S) structure.
The scsi_poll() function requests the host adapter driver to run a polled command. Unlike scsi_transport(9F) which runs commands asynchronously, scsi_poll() runs commands to completion before returning. If the pkt_time member of pkt is 0, the value of pkt_time is defaulted to SCSI_POLL_TIMEOUT to prevent an indefinite hang of the system.
The scsi_poll() function returns: 0
command completed successfully.
command failed.
The scsi_poll() function can be called from user, interrupt, or kernel context. This function should not be called when the caller is executing timeout(9F) in the context of a thread.
makecom(9F), scsi_transport(9F), scsi_pkt(9S)
Writing Device Drivers
Since scsi_poll() runs commands to completion before returning, it may require more time than is desirable when called from interrupt context. Therefore, calling scsi_poll from interrupt context is not recommended.