socalvar.h revision 3db86aab554edbb4244c8d1a1c90f152eee768af
/*
* CDDL HEADER START
*
* 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
* 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 2001 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_SOCALVAR_H
#define _SYS_SOCALVAR_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* socalvar.h - SOC+ Driver data struct definitions
*/
/*
* Define default name and # of SOC+s to allocate to the system
*/
#define SOCAL_NT_PORT NULL
#define SOCAL_INIT_ITEMS 5
/*
* Defines for the Circular Queues
*/
#define SOCAL_TAKE_CORE 0x1
#define SOCAL_FAILED_LIP 0x2
/*
* Misc. Macros
*/
#define SOCAL_POOL_SIZE 2112
#define SOCAL_SVC_LENGTH 80
#define FABRIC_FLAG 1
#define NPORT_FLAG 2
#define SOC_DIAG_LBTFQ 0x0a
#define PORT_LBF_PENDING 0x00100000
/* Macros to speed handling of 32-bit IDs */
#define SOCAL_ID_GET(x, w) id32_alloc((x), (w))
#define SOCAL_ID_LOOKUP(x) id32_lookup((x))
#define SOCAL_ID_FREE(x) id32_free((x))
typedef struct flb_hdr {
} flb_hdr_t;
struct socal_state;
/*
* SOC UNIX circular queue descriptor.
*/
typedef struct socal_kernel_cq {
struct fcal_packet *skc_overflowt;
struct socal_state *skc_socalp;
} socal_kcq_t;
/*
* Values for skc_full
*/
#define SOCAL_SKC_FULL 1
#define SOCAL_SKC_SLEEP 2
/*
* State change callback routine descriptor
*
* There is one entry in this list for each hba that is attached
* to this port.
* This structure will need to be mutex protected when parallel
* attaches are supported.
*/
typedef struct socal_unsol_cb {
struct socal_unsol_cb *next;
void *arg;
/*
* SOC+ port status decriptor.
*/
typedef struct socal_port {
} socal_port_t;
#define PORT_FABRIC_PRESENT 0x00000001
#define PORT_OFFLINE 0x00000002
#define NPORT_LOGIN_SUCCESS 0x00000004
#define PORT_LOGIN_ACTIVE 0x00000008
#define PORT_LOGIN_RECOVERY 0x00000010
#define PORT_ONLINE_LOOP 0x00000020
#define PORT_ONLINE 0x00000040
#define PORT_STATUS_FLAG 0x00000080
#define PORT_STATUS_MASK 0x000000ff
#define PORT_OPEN 0x00000100
#define PORT_CHILD_INIT 0x00000200
#define PORT_TARGET_MODE 0x00000400
#define PORT_LILP_PENDING 0x00001000
#define PORT_LIP_PENDING 0x00002000
#define PORT_ABORT_PENDING 0x00004000
#define PORT_ELS_PENDING 0x00008000
#define PORT_BYPASS_PENDING 0x00010000
#define PORT_OFFLINE_PENDING 0x00020000
#define PORT_ADISC_PENDING 0x00040000
#define PORT_RLS_PENDING 0x00080000
#define PORT_DISABLED 0x00100000
/*
* We wait for up to SOC_INITIAL_ONLINE seconds for the first
* soc to come on line. The timeout in the soc firmware is 10 seconds.
* The timeout is to let any outstanding commands drain before
* coming back on line, after going off-line.
*/
/*
* SOC state structure
*/
typedef struct socal_state {
/* handles to soc+ ports */
char socal_name[MAXPATHLEN];
int socal_on_intr;
/*
* Structure used when the soc driver needs to issue commands of its own
*/
typedef struct socal_priv_cmd {
void *fapktp;
void (*callback)(); /* callback to ULP, if any */
void *arg; /* callback arg */
#ifdef __cplusplus
}
#endif
#endif /* !_SYS_SOCALVAR_H */