qlt.h revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _QLT_H
#define _QLT_H
#include <stmf_defines.h>
#include <qlt_regs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Qlogic logging
*/
extern int enable_extended_logging;
/*
* 2) Anything which can potentially flood the log should be under
* extended logging, and use QLT_EXT_LOG.
* 3) Don't use QLT_EXT_LOG in performance-critical code path, such
* as normal SCSI I/O code path. It could hurt system performance.
* 4) Use kmdb to change enable_extened_logging in the fly to adjust
* tracing
*/
#define QLT_EXT_LOG(log_ident, ...) \
if (enable_extended_logging) { \
}
/*
* Error codes. FSC stands for Failure sub code.
*/
#define QLT_FAILURE FCT_FCA_FAILURE
#define QLT_SUCCESS FCT_SUCCESS
extern uint32_t fw2400_code01[];
extern uint32_t fw2400_length01;
extern uint32_t fw2400_addr01;
extern uint32_t fw2400_code02[];
extern uint32_t fw2400_length02;
extern uint32_t fw2400_addr02;
extern uint32_t fw2500_code01[];
extern uint32_t fw2500_length01;
extern uint32_t fw2500_addr01;
extern uint32_t fw2500_code02[];
extern uint32_t fw2500_length02;
extern uint32_t fw2500_addr02;
typedef enum {
MBOX_STATE_UNKNOWN = 0,
} mbox_state_t;
#define IOCB_SIZE 64
/*
* These should not be constents but should be obtained from fw.
*/
#define QLT_MAX_LOGINS 2048
#define QLT_MAX_XCHGES 2048
#define MAX_MBOXES 32
typedef struct {
} mbox_cmd_t;
typedef struct qlt_abts_cmd {
struct qlt_dmem_bucket;
#define QLT_INTR_FIXED 0x1
#define QLT_INTR_MSI 0x2
#define QLT_INTR_MSIX 0x4
typedef struct qlt_state {
char qlt_minor_name[16];
char qlt_port_alias[16];
struct qlt_dmem_bucket **dmem_buckets;
int instance;
qlt_rsvd1:4;
/* Registers */
/* Interrupt stuff */
int intr_sneak_counter;
int intr_size;
int intr_cnt;
int intr_cap;
int intr_flags;
/* Queues */
/* MailBox data */
} qlt_state_t;
/*
* FWDUMP flags (part of IOCTL flags)
*/
#define QLT_FWDUMP_ISVALID 0x0800
/*
* IOCTL supporting stuff
*/
#define QLT_IOCTL_FLAG_MASK 0xFF
#define QLT_IOCTL_FLAG_IDLE 0x00
#define QLT_IOCTL_FLAG_OPEN 0x01
#define QLT_IOCTL_FLAG_EXCL 0x02
typedef struct qlt_cmd {
union {
} param;
} qlt_cmd_t;
/*
* cmd flags
*/
#define QLT_CMD_ABORTING 1
#define QLT_CMD_ABORTED 2
#define QLT_CMD_TYPE_SOLICITED 4
typedef struct {
int dummy;
#define REQUEST_QUEUE_ENTRIES 2048
#define RESPONSE_QUEUE_ENTRIES 2048
#define ATIO_QUEUE_ENTRIES 2048
#define PRIORITY_QUEUE_ENTRIES 128
#define REQUEST_QUEUE_OFFSET 0
#define RESPONSE_QUEUE_OFFSET (REQUEST_QUEUE_OFFSET + \
#define ATIO_QUEUE_OFFSET (RESPONSE_QUEUE_OFFSET + \
#define PRIORITY_QUEUE_OFFSET (ATIO_QUEUE_OFFSET + \
#define MBOX_DMA_MEM_SIZE 4096
#define MBOX_DMA_MEM_OFFSET (PRIORITY_QUEUE_OFFSET + \
#define QLT_MAX_ITERATIONS_PER_INTR 32
/*
* #define QMEM_RD64(qlt, addr) \
* ddi_get64(qlt->queue_mem_acc_handle, (uint64_t *)(addr))
*/
/*
* [QD]MEM is always little endian so the [QD]MEM_WR64 macro works for
* both sparc and x86.
*/
#ifdef __cplusplus
}
#endif
#endif /* _QLT_H */