/*
* 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 _FCSM_H
#define _FCSM_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
/*
* Message printing flags
*/
/*
* Debug levels
*/
#ifdef DEBUG
extern uint32_t fcsm_debug;
#else /* DEBUG */
#endif /* DEBUG */
/*
* Open flags
*/
/* Definitions for command retries */
/*
* fcsm_job - Job structure to issue commands using command thread
*/
typedef struct fcsm_job {
/* completion func */
} fcsm_job_t;
/*
* fcsm_t - FCSM Structure for per port information
*/
typedef struct fcsm {
/* Mgmt Server Login Params */
} fcsm_t;
typedef struct fcsm_cmd {
int cmd_retry_count;
int cmd_retry_interval;
int cmd_max_retries;
} fcsm_cmd_t;
/*
* sm_flags in the per port FCSM Structure
*/
/* Command flags for Job structure */
/* Command codes */
/* Private flags for command */
/* Command DMA Flags */
}
/*
* Macros to address endian issues
* local variable "fcsm" must exist before using these
*/
{ \
DDI_DEV_AUTOINCR); \
} else { \
} \
}
{ \
DDI_DEV_AUTOINCR); \
} else { \
} \
}
#endif /* _KERNEL */
/*
* IOCTL Definitions
*/
typedef struct fc_ct_aiu {
/* aiu_payload can be up to 'm' bytes (arbitrary length) */
} fc_ct_aiu_t;
/* Management Server - Fabric Configuration Server Commands */
#ifdef _KERNEL
/*
* Driver entry point functions
*/
/*
* FC Transport functions
*/
/*
* Internal functions
*/
static void fcsm_suspend_port(fcsm_t *);
static void fcsm_resume_port(fcsm_t *);
static void fcsm_cleanup_port(fcsm_t *);
static void fcsm_offline_timeout(void *);
static int fcsm_job_cache_constructor(void *, void *, int);
static void fcsm_job_cache_destructor(void *, void *);
static fcsm_job_t *fcsm_alloc_job(int);
static void fcsm_dealloc_job(fcsm_job_t *);
opaque_t);
static int fcsm_process_job(fcsm_job_t *, int);
static int fcsm_cmd_cache_constructor(void *, void *, int);
static void fcsm_cmd_cache_destructor(void *, void *);
static void fcsm_free_cmd_dma(fcsm_cmd_t *);
static void fcsm_job_thread(fcsm_t *);
static void fcsm_jobdone(fcsm_job_t *);
void (*comp_func)());
static void fcsm_ct_intr(fcsm_cmd_t *);
static void fcsm_job_ct_passthru(fcsm_job_t *);
static void fcsm_xlogi_intr(fcsm_cmd_t *);
static void fcsm_job_login_mgmt_server(fcsm_job_t *);
int fcsm_ct_passthru(int, fcio_t *, int, int,
static void fcsm_pkt_common_intr(fc_packet_t *);
static int fcsm_issue_cmd(fcsm_cmd_t *);
static int fcsm_retry_cmd(fcsm_cmd_t *);
static void fcsm_retry_timeout(void *);
static void fcsm_force_port_detach_all(void);
/*
* Utility functions
*/
static void fcsm_display(int, int, fcsm_t *,
fc_packet_t *, const char *, ...);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _FCSM_H */