/*
* 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 2010 QLogic Corporation. All rights reserved.
*/
#ifndef _QLGE_H
#define _QLGE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/mac_provider.h>
#include <sys/mac_flow.h>
#include <sys/mac_ether.h>
#include <sys/ethernet.h>
#include <sys/byteorder.h>
#include <qlge_hw.h>
#include <qlge_dbg.h>
#include <qlge_open.h>
/*
* Local Macro Definitions.
*/
#ifdef TRUE
#endif
#ifdef FALSE
#endif
#define FALSE 0
/* #define QLGE_TRACK_BUFFER_USAGE */
/*
* byte order, sparc is big endian, x86 is little endian,
* but PCI is little endian only
*/
#ifdef sparc
#else
#define cpu_to_le64(x) (x)
#define cpu_to_le32(x) (x)
#define cpu_to_le16(x) (x)
#define le64_to_cpu(x) (x)
#define le32_to_cpu(x) (x)
#define le16_to_cpu(x) (x)
#endif
/*
* Macros to help code, maintain, etc.
*/
SWAP_ENDIAN_16(MSW(x)))
SWAP_ENDIAN_32(MS32(x)))
#define QL_MIN(x, y) ((x < y) ? x : y)
/*
* qlge local function return status codes
*/
#define QL_SUCCESS 0
/*
* Solaris version compatibility definitions.
*/
/*
* Host adapter default definitions.
*/
/* Timeout timer counts in seconds (must greater than 1 second). */
/*
* DMA attributes definitions.
*/
#define QL_DMA_XFER_FLAGS 0
/*
* ISP PCI Configuration.
*/
/* GLD */
/* GLD DMA */
extern ddi_device_acc_attr_t ql_dev_acc_attr;
extern ddi_device_acc_attr_t ql_buf_acc_attr;
struct dma_info {
void *vaddr;
};
/*
* Sync a DMA area described by a dma_info
*/
/*
* Find the (kernel virtual) address of block of memory
* described by a dma_info
*/
/*
* Zero a block of memory described by a dma_info
*/
/*
* ISP PCI Configuration.
*/
/* Initialize steps */
/*
* LSO can support up to 65535 bytes of data, but can not be sent in one IOCB
* which only has 8 TX OALs, additional OALs must be applied separately.
*/
enum tx_mode_t {
};
#ifndef VLAN_ID_MASK
#endif
#ifndef VLAN_TAGSZ
#endif
#ifndef ETHERTYPE_VLAN
#endif
#ifndef MBLKL
#endif
/*
* Checksum Offload
*/
/*
* Driver must be in one of these states
*/
enum mac_state {
};
/*
* Soft Request Flag
*/
/*
* (Internal) return values from ioctl subroutines
*/
enum ioc_reply {
};
/*
* Link Speed,in Mbps
*/
/*
* Multicast List
*/
typedef struct {
typedef struct {
/*
* Device kstate structure.
*/
enum {
QL_KSTAT_CHIP = 0,
};
/*
*/
enum {
BIT_SET = 0,
};
/*
* Flash Image Search State
*/
};
/*
* Loop Back Modes
*/
enum { QLGE_LOOP_NONE,
};
/* for soft state routine */
typedef struct {
char *name;
} ql_ksindex_t;
struct bq_desc {
/* is to be freed by OS */
/* being freed, new one should not */
/* be allocated */
};
/* value, arm the chip */
/* if less than 16 free lrg buf nodes in the free list, then */
/* rx has to use copy method to send packets upstream */
/* if there are more than TX_STOP_THRESHOLD free tx buffers, try to send it */
struct tx_ring_desc {
int tx_dma_handle_used;
void *oal;
};
struct tx_ring {
/* tx completions */
/* shadow copy of consumer idx */
/* dma-shadow copy consumer */
};
struct bq_element {
};
/*
* Type of inbound queue.
*/
enum {
};
struct rx_ring {
/* GLD required flags */
/* statistics */
/* miscellaneous */
/* completion queue */
/* large buffer queue */
/* small buffer queue */
/* for test purpose */
#ifdef QLGE_PERFORMANCE
#endif
};
struct intr_ctx {
/*
* It's incremented for
* each irq handler that is scheduled.
* When each handler finishes it
* decrements irq_cnt and enables
* interrupts if it's zero.
*/
};
struct tx_buf_desc {
};
typedef struct qlge {
/*
* Solaris adapter configuration data
*/
int instance;
/* fault management capabilities */
int fm_capabilities;
/* For Shadow Registers, used by adapter to write to host memory */
/*
* for each CQICB and read by chip, new request since 8100
*/
/*
* Debugging
*/
/*
* GLD
*/
/*
* mutex
*/
/*
* Generic timer
*/
/*
* Interrupt
*/
int intr_type;
/* for legacy interrupt */
/* for MSI and Fixed interrupts */
/* interrupt handlers */
/* Power management context. */
#define MAX_POWER_LEVEL 0
/*
* General NIC
*/
/*
* PCI status
*/
/*
* Multicast list
*/
/*
* MAC address information
*/
/*
* Soft Interrupt handlers
*/
/* soft interrupt handle for MPI interrupt */
/* soft interrupt handle for asic reset */
/* soft interrupt handle for mpi reset */
/*
* IOCTL
*/
/* new ioctl admin flags to work around the 1024 max data copy in&out */
/*
* Mailbox lock and flags
*/
/*
* Flash
*/
/*
* TX / RX
*/
int tx_ring_size;
int rx_ring_size;
#ifdef QLGE_TRACK_BUFFER_USAGE
/* Count no of times the buffers fell below 32 */
#endif
} qlge_t;
/*
* Reconfiguring the network devices requires the net_config privilege
* in Solaris 10+.
*/
/*
* Global Function Prototypes in qlge_dbg.c source file.
*/
extern int ql_fw_dump(qlge_t *);
extern void ql_dump_all_contrl_regs(qlge_t *);
extern void ql_dump_pci_config(qlge_t *);
extern void ql_dump_host_pci_regs(qlge_t *);
/*
* Global Data in qlge.c source file.
*/
extern int ql_init_misc_registers(qlge_t *);
extern int ql_init_mem_resources(qlge_t *);
extern int ql_do_start(qlge_t *);
extern int ql_do_stop(qlge_t *);
extern void ql_set_promiscuous(qlge_t *, int);
extern void ql_get_hw_stats(qlge_t *);
extern void ql_wake_asic_reset_soft_intr(qlge_t *);
extern mblk_t *ql_ring_rx_poll(void *, int);
extern int ql_route_initialize(qlge_t *);
/*
* Global Function Prototypes in qlge_flash.c source file.
*/
extern int ql_sem_flash_lock(qlge_t *);
extern void ql_sem_flash_unlock(qlge_t *);
/*
* Global Function Prototypes in qlge_mpi.c source file.
*/
extern int ql_reset_mpi_risc(qlge_t *);
extern int ql_get_LED_config(qlge_t *);
extern int ql_get_firmware_version(qlge_t *,
struct qlnic_mpi_version_info *);
extern void ql_core_dump(qlge_t *);
extern void ql_dump_crash_record(qlge_t *);
extern void ql_printf(const char *, ...);
/*
* Global Function Prototypes in qlge_gld.c source file.
*/
/*
* Global Function Prototypes in qlge_fm.c source file.
*/
#ifdef __cplusplus
}
#endif
#endif /* _QLGE_H */