fcal_transport.h 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.
*/
#ifndef _SYS_FC4_FCAL_TRANSPORT_H
#define _SYS_FC4_FCAL_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;
/*
* fc_transport() sleep parameter
*/
typedef enum {
FCAL_SLEEP, /* sleep on queue full */
FCAL_NOSLEEP /* do not sleep on queue full */
} fcal_sleep_t;
typedef struct fcal_packet {
void *fcal_pkt_cookie; /* identifies which FC device */
struct fcal_packet *fcal_pkt_next;
void (*fcal_pkt_comp)(struct fcal_packet *);
void *fcal_pkt_private;
union {
longlong_t l;
} w;
#define fcal_socal_request w.req
/*
* Fibre channel packet flags
*/
/*
* definitions for the cmd_state
*/
#define FCALP_MAGIC 0x4750703
typedef struct fcal_transport {
void *fcal_handle; /* identifies which FC dev */
struct fcal_transport_ops *fcal_ops;
typedef struct fcal_transport_ops {
fcal_sleep_t sleep, int
req_q_no);
int req_q_no);
void (*callback)(),
void *arg,
void (*fcal_force_reset)(void *fcal_handle,
void (*fcal_add_ulp)(void *fcal_handle,
void (*ulp_statec_callback)(),
void (*ulp_els_callback)(),
void (*ulp_data_callback)(),
void *arg);
void (*fcal_remove_ulp)(void *fcal_handle,
void *arg);
void (*fcal_take_core)(void *fcal_handle);
/*
* additional pseudo-status codes for login
*/
#define FCAL_STATUS_LOGIN_TIMEOUT 0x80000001
#define FCAL_STATUS_CQFULL 0x80000002
#define FCAL_STATUS_TRANSFAIL 0x80000003
#define FCAL_STATUS_RESETFAIL 0x80000004
/*
* interface and transport function return values
*/
#define FCAL_SUCCESS 0x000
#define FCAL_TIMEOUT 0x001
#define FCAL_ALLOC_FAILED 0x002
#define FCAL_OLD_PORT 0x003
#define FCAL_LINK_ERROR 0x004
#define FCAL_OFFLINE 0x005
#define FCAL_ABORTED 0x006
#define FCAL_ABORT_FAILED 0x007
#define FCAL_BAD_ABORT 0x008
#define FCAL_BAD_PARAMS 0x009
#define FCAL_OVERRUN 0x00a
#define FCAL_NO_TRANSPORT 0x00b
#define FCAL_TRANSPORT_SUCCESS 0x000
#define FCAL_TRANSPORT_FAILURE 0x101
#define FCAL_BAD_PACKET 0x102
#define FCAL_TRANSPORT_UNAVAIL 0x103
#define FCAL_TRANSPORT_QFULL 0x104
#define FCAL_TRANSPORT_TIMEOUT 0x105
#define FCAL_FAILURE 0xffffffff
/*
* fc_uc_register() return values
*/
typedef void * fc_uc_cookie_t;
/*
* fc_transport() iotype parameter
*/
typedef enum {
} fc_iotype_t;
/*
* State changes related to the N-port interface communicated from below
*/
#define FCAL_STATE_RESET ((int)0xffffffffu)
/* port reset, all cmds lost */
#define FCAL_LILP_MAGIC 0x1107
#define FCAL_BADLILP_MAGIC 0x1105
#define FCAL_NO_LIP 0x0
#define FCAL_FORCE_LIP 0x1
typedef struct fcal_lilp_map {
#ifdef __cplusplus
}
#endif
#endif /* !_SYS_FC4_FCAL_TRANSPORT_H */