/*
* 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.
*/
#ifndef _SYS_FC4_FC_TRANSPORT_H
#define _SYS_FC4_FC_TRANSPORT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* fc_devdata_t definitions
*
* See fc.h for TYPE field definitions
*/
typedef int fc_devdata_t;
/*
* fc_ioclass_t definitions.
*/
typedef enum {
} fc_ioclass_t;
/*
* This data structure is used by a Fiber Channel Adaptor driver client to
* request a Fiber Channel transaction.
*/
typedef struct fc_packet {
/*
* identifies which FC device
*
* In our case it is a pointer to the
* port_status structure. This structure
* contains the physical port (0 or 1).
*/
void *fc_pkt_private;
/*
* SOC status from soc status field in Response que.
*/
} fc_packet_t;
/*
* Fibre channel packet flags
*/
/*
* fc_transport() return values
*/
enum {
};
/*
* pkt_status return values
*/
#define FC_STATUS_OK 0
/*
* additional pseudo-status codes for login
*/
/*
* fc_uc_register() return values
*/
typedef void * fc_uc_cookie_t;
/*
* fc_transport() iotype parameter
*/
typedef enum {
} fc_iotype_t;
/*
* fc_transport() sleep parameter
*/
typedef enum {
} fc_sleep_t;
/*
* State changes related to the N-port interface communicated from below
*/
typedef enum {
} fc_statec_t;
typedef void * fc_statec_cookie_t;
/*
* This structure is allocated by Fiber Channel Adaptor at INITCHILD time,
* and is communicated to the child by ddi_set_driver_private().
* It defines the vectors by which the child obtains soc
* driver services, and all other information the child
* may need about its parent.
*/
typedef struct fc_transport {
/*
* Transport a command across the interface.
*/
int (*fc_transport)(
/*
* Reset the transport.
*/
int (*fc_reset)(
/*
* Allocate an fc_packet structure.
*/
void *cookie,
/*
* Free an fc_packet structure.
*/
void (*fc_pkt_free)(
void *cookie,
/*
* Register a routine to handle state changes on the interface
*
* The arg parameter, along with an fc_statec_t parameter, will
* be passed to the callback routine on all state changes
* after initialization.
*/
void *cookie,
void (*callback)(void *, fc_statec_t),
void *arg);
/*
* Unregister a routine to handle state changes
*/
void (*fc_statec_unregister)(
void *cookie,
/*
* Run the interface in polling mode. This allows interface
* state changes, etc. to be processed when system interrupts
* are disabled. This is used mostly for error recovery.
* Too bad Fibre Channel doesn't have a common error policy for
* all protocols so that we could do error recovery at
* the lowest level instead of having kludges like this...
*/
void (*fc_interface_poll)(
void *cookie);
/*
* Unsolicited Command Interface
*
* This interface operates with the presumption that the
* higher level driver (child) will process unsolicited
* commands that pertain to its protocol such as FCP or FCIP.
*/
/*
* Register a callback to be called in the event of an
* unsolicited command received by the soc for this child.
* No information is passed regarding the event, just that
* one occurred. The arg parameter to passed to the
* callback function as its parameter.
*/
(*fc_uc_register)(
void *cookie,
void (*callback)(void *),
void *arg);
/*
* Unregister a callback routine
*/
void (*fc_uc_unregister)(
void *cookie,
/*
* Return information about the unsolicited command
* event in pkt. The pkt must be a fully allocated
* fc_packet structure, with a valid cmd dataseg
* pointer, in which the received cmd payload will
* be placed. The length of the allocated dataseg should
* be greater than or equal to the length of the received
* command payload, otherwise the entire command cannot
* be copied into the data segment. This function
* returns -1 in the event of an error, or the
* actual length of the received command payload.
*/
int (*fc_uc_get_pkt)(
void *cookie,
#ifdef __cplusplus
}
#endif
#endif /* !_SYS_FC4_FC_TRANSPORT_H */