/*
* 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 2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* 1394 Services Layer FCP Support Routines
*/
#include <sys/tnf_probe.h>
cmd1394_cmd_t *req);
/*
* number of retries to notify registered targets in case target list
* changes while the list rwlock is dropped for the time of callback
*/
};
};
int
{
"h1394-fcp-claim-on-demand")) == 0) {
/* if not on-demand, claim addresses now */
if (ret == DDI_SUCCESS) {
if (ret != DDI_SUCCESS) {
}
}
}
return (ret);
}
int
{
}
int
{
}
int
{
}
int
{
}
static int
{
return (DDI_FAILURE);
}
}
/* Add on the target list */
return (DDI_SUCCESS);
}
static int
{
int result;
if (result == DDI_SUCCESS) {
}
} else {
S1394_TNF_SL_FCP_ERROR, "");
}
return (result);
}
/*
* s1394_fcp_write_check_cmd()
* Check if an FCP command is formed correctly;
* set cmd_result and return DDI_FAILURE if not.
*/
int
{
int len;
/* 4-byte writes must be quadlet writes */
if (len == 4) {
S1394_TNF_SL_FCP_ERROR, "");
return (DDI_FAILURE);
}
} else {
len = 4;
}
/*
* request must be within FCP range. we avoid extra checks by
* using the fact that command and response are of the same size
*/
return (DDI_FAILURE);
}
/* some options don't make sense for FCP commands */
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static void
{
}
static void
{
}
/*
* s1394_fcp_recv_write_request()
* Common write request handler
*/
static void
{
int num_retries = 0;
S1394_TNF_SL_FCP_STACK, "");
if (target) {
/* Find a target that claims the request */
do {
continue;
}
if (ret == T1394_REQ_CLAIMED) {
break;
}
/*
* List could change while we dropped the lock. In such
* case, start all over again, because missing a write
* request can have more serious consequences for a
* target than receiving same request more than once
*/
num_retries++;
if (num_retries <= s1394_fcp_notify_retry_cnt) {
goto start;
} else {
break;
}
}
}
if (ret != T1394_REQ_CLAIMED) {
S1394_TNF_SL_FCP_ERROR, "");
if (restored) {
}
}
S1394_TNF_SL_FCP_STACK, "");
}
/*
* none of the targets claimed the request - send an appropriate response
*/
static void
{
}