fcoei.h revision 7ff836697c120cb94bd30d5c2204eb9b74718e4c
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _FCOEI_H
#define _FCOEI_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
/*
* FCOEI logging
*/
extern int fcoei_use_ext_log;
extern void *fcoei_state;
#define FCOEI_EXT_LOG(log_ident, ...) \
{ \
if (fcoei_use_ext_log) { \
} \
}
/*
* IOCTL supporting stuff
*/
#define FCOEI_IOCTL_FLAG_MASK 0xFF
#define FCOEI_IOCTL_FLAG_IDLE 0x00
#define FCOEI_IOCTL_FLAG_OPEN 0x01
#define FCOEI_IOCTL_FLAG_EXCL 0x02
/*
* define common constants
*/
#define FCOEI_MAX_OPEN_XCHS 2048
#define FCOEI_SOL_HASH_SIZE 2048
#define FCOEI_UNSOL_HASH_SIZE 128
#define FCOEI_VERSION "20090729-1.00"
/*
* define RNID Management Info
*/
#define FCOEI_RNID_HBA 0x7
#define FCOEI_RNID_IPV4 0x1
#define FCOEI_RNID_IPV6 0x2
typedef enum event_type {
AE_EVENT_NONE = 0,
} event_type_e;
typedef struct fcoei_event {
/*
* event specific
*/
/*
* event related object
*/
void *ae_obj;
typedef struct fcoei_soft_state {
/*
* common data structure (fc_local_port_t) between leadville and fcoei
*/
void *ss_port;
/*
* common data structure between fcoei and fcoe module
*/
/*
* We will use ss_taskq to dispatch watchdog and other tasks
*/
/*
* current port state, speed. see fctl.h
*/
/*
*/
/*
* solicited and unsolicited exchanges timing checking
*/
/*
* ioctl related stuff
*/
/*
* fp-defined routines that fcoei will call
*/
/*
* fcoei-defined plogi response that fp will use
*/
/*
* fcoei-defined routines that fp will call
*/
/*
* Direct p2p information, and ss's fcid will be stored here
*/
/*
* RNID Management Information
*/
#define SS_FLAG_LV_NONE 0x0000
#define SS_FLAG_LV_BOUND 0x0001
#define SS_FLAG_PORT_DISABLED 0x0002
#define SS_FLAG_TERMINATE_WATCHDOG 0x0004
#define SS_FLAG_WATCHDOG_RUNNING 0x0008
#define SS_FLAG_WATCHDOG_IDLE 0x0010
#define SS_FLAG_TRIGGER_FP_ATTACH 0x0020
#define SS_FLAG_FLOGI_FAILED 0x0040
/*
* fcoei_frame - corresponding data structure to fcoe_frame/fc_frame
*/
typedef struct fcoei_frame {
struct fcoei_exchange *ifm_xch;
/*
* will be used after the relevant frame mblk was released by ETH layer
*/
#define IFM_FLAG_NONE 0x0000
#define IFM_FLAG_FREE_NETB 0x0001
/*
* fcoei_exchange - corresponding data structure to leadville fc_packet
*/
typedef struct fcoei_exchange {
int xch_resid;
/*
* current cnt for timing check, when the exchange is created
*/
/*
* so fcoei exchange need do it
*/
/*
* to link leadville's stuff
*/
#define XCH_FLAG_NONE 0x00000000
#define XCH_FLAG_TMOUT 0x00000001
#define XCH_FLAG_ABORT 0x00000002
#define XCH_FLAG_IN_SOL_HASH 0x00000004
#define XCH_FLAG_IN_UNSOL_HASH 0x00000008
typedef struct fcoei_walk_arg
{
/*
* Define conversion and calculation macros
*/
{ \
}
{ \
}
{ \
}
{ \
do { \
} \
(mod_hash_val_t)&xch_tmp) == 0); \
}
{ \
do { \
} \
(mod_hash_val_t)&xch_tmp) == 0); \
}
#define FCOEI_INIT_UNSOL_ID_HASH(xch) \
{ \
}
/*
* Common functions defined in fcoei.c
*/
/*
* Common functions defined in fcoei_lv.c
*/
/*
* Common functions defined in fcoei_eth.c
*/
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _FCOEI_H */