stmf_impl.h revision 034d83c4b3be1c9bbe03552a652ebb90d4d66885
843e19887f64dde75055cf8842fc4db2171eff45johnlev * CDDL HEADER START
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The contents of this file are subject to the terms of the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Common Development and Distribution License (the "License").
843e19887f64dde75055cf8842fc4db2171eff45johnlev * You may not use this file except in compliance with the License.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
843e19887f64dde75055cf8842fc4db2171eff45johnlev * See the License for the specific language governing permissions
843e19887f64dde75055cf8842fc4db2171eff45johnlev * and limitations under the License.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * When distributing Covered Code, include this CDDL HEADER in each
843e19887f64dde75055cf8842fc4db2171eff45johnlev * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * If applicable, add the following below this CDDL HEADER, with the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * fields enclosed by brackets "[]" replaced with your own identifying
843e19887f64dde75055cf8842fc4db2171eff45johnlev * information: Portions Copyright [yyyy] [name of copyright owner]
843e19887f64dde75055cf8842fc4db2171eff45johnlev * CDDL HEADER END
d62bc4badc1c1f1549c961cfb8b420e650e1272byz * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Use is subject to license terms.
843e19887f64dde75055cf8842fc4db2171eff45johnlevextern "C" {
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define STMF_MAX_NUM_EVENTS (sizeof (stmf_event_handle_t) * 8)
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define STMF_EVENT_REMOVE(h, e) (atomic_and_32(&(h), \
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define STMF_EVENT_ENABLED(h, e) (((h) & ((uint32_t)1) << (e)) != 0)
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define STMF_EVENT_CLEAR_ALL(h) ((h) = 0)
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define STMF_EVENT_ALLOC_HANDLE(h) ((h) = 0)
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define STMF_EVENT_FREE_HANDLE(h) ((h) = 0)
843e19887f64dde75055cf8842fc4db2171eff45johnlevtypedef struct stmf_i_lu_provider {
843e19887f64dde75055cf8842fc4db2171eff45johnlevtypedef struct stmf_i_lu {
843e19887f64dde75055cf8842fc4db2171eff45johnlev uint32_t ilu_ntasks; /* # of tasks in the ilu_task list */
843e19887f64dde75055cf8842fc4db2171eff45johnlev uint32_t ilu_ntasks_free; /* # of tasks that are free */
843e19887f64dde75055cf8842fc4db2171eff45johnlev uint32_t ilu_ntasks_min_free; /* # minimal free tasks */
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* point to the luid entry in stmf_state.stmf_luid_list */
843e19887f64dde75055cf8842fc4db2171eff45johnlev * ilu_flags
843e19887f64dde75055cf8842fc4db2171eff45johnlevtypedef struct stmf_i_port_provider {
843e19887f64dde75055cf8842fc4db2171eff45johnlevtypedef struct stmf_i_local_port {
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* which target group this port belongs to in stmf_state.stmf_tg_list */
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* XXX Need something to track all the remote ports also */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define STMF_AVG_ONLINE_INTERVAL (30 * drv_usectohz(1000000))
d62bc4badc1c1f1549c961cfb8b420e650e1272byz * ilport flags
d62bc4badc1c1f1549c961cfb8b420e650e1272byztypedef struct stmf_i_scsi_session {
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Ideally we should maintain 2 maps. One would indicate a new map
d62bc4badc1c1f1549c961cfb8b420e650e1272byz * which will become available only upon receipt of a REPORT LUN
843e19887f64dde75055cf8842fc4db2171eff45johnlev * which host group the host of this session belongs to in
843e19887f64dde75055cf8842fc4db2171eff45johnlev * iss flags
843e19887f64dde75055cf8842fc4db2171eff45johnlevtypedef struct stmf_i_scsi_task {
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* For now we only support 4 parallel buffers. Should be enough. */
typedef struct stmf_itl_data {
void *itl_handle;
typedef struct stmf_pp_data {
void *ppd_provider;
typedef struct stmf_worker {
typedef struct stmf_xfer_data {
void stmf_dlun_init();
void stmf_worker_init();
#ifdef __cplusplus