d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * CDDL HEADER START
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * The contents of this file are subject to the terms of the
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * Common Development and Distribution License (the "License").
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * You may not use this file except in compliance with the License.
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * See the License for the specific language governing permissions
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * and limitations under the License.
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * When distributing Covered Code, include this CDDL HEADER in each
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * If applicable, add the following below this CDDL HEADER, with the
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * fields enclosed by brackets "[]" replaced with your own identifying
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * information: Portions Copyright [yyyy] [name of copyright owner]
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * CDDL HEADER END
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * Use is subject to license terms.
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * This file is part of the Chelsio T1 Ethernet driver.
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * Copyright (C) 2003-2005 Chelsio Communications. All rights reserved.
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#pragma ident "%Z%%M% %I% %E% SMI"
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwextern "C" {
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * Definitions for module_info
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define CH_NO_HWCKSUM 0x1 /* hardware should no add checksum */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * PCI registers
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * TOE pre-mapped buffer structure
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#endif /* CONFIG_CHELSIO_T1_OFFLOAD */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * header structures to hold pre-mapped (DMA) kernel memory buffers.
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw struct ch_esb *cs_owner; /* list of buffers owned by ch_t */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * structure for linked list of multicast addresses that have been
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * assigned to the card.
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * structure for linked list of pre-allocated dma handles for command Q
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * instance configuration
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * Per-card state information
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw ddi_acc_handle_t ch_hpci; /* PCI configuration access handle */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw ddi_iblock_cookie_t ch_icookp; /* hardware interrupt cookie ptr */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw uint32_t ch_sm_buf_aln; /* alignment of sm esballoc bufs */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw ch_esb_t *ch_small_esb_free; /* free list sm esballoc bufs */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw ch_esb_t *ch_small_owner; /* list small bufs owned by ch_t */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw uint_t ch_sm_index; /* small buffer in use count index */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw uint32_t ch_bg_buf_aln; /* alignment of bg esballoc bufs */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw ch_esb_t *ch_big_esb_free; /* free list of esballoc entries */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw ch_esb_t *ch_big_owner; /* list big bufs owned by ch_t */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw /* XXX see how we can use cmdQ_ce list and get rid of lock */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#if defined(__sparc)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw /* XXX see how we can use cmdQ_ce list and get rid of lock */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw free_dh_t *ch_vdh; /* list of free dvma headers for v2p */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw /* XXX config_data needs cleanup */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw pe_config_data_t config_data; /* card configuration vector */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw struct pe_port_t port[4]; /* from freebsd/oschtoe.h driver */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw /* statistics per card */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* ch_flags */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* open_device_map flag */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * DMA mapping defines
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define DMA_STREAM 1 /* use DDI_DMA_STREAMING for DMA xfers */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw * Number of multicast addresses per stream
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw/* ----- Solaris memory - PCI - DMA mapping functions ------ */
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwvoid *ch_alloc_dma_mem(ch_t *, int, int, int, uint64_t *, ulong_t *, ulong_t *);
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwvoid t1_write_reg_4(ch_t *obj, uint32_t reg_val, uint32_t write_val);
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwuint32_t t1_os_pci_read_config_2(ch_t *obj, uint32_t reg, uint16_t *val);
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwuint32_t t1_os_pci_read_config_4(ch_t *obj, uint32_t reg, uint32_t *val);
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwint t1_os_pci_write_config_2(ch_t *obj, uint32_t reg, uint16_t val);
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwint t1_os_pci_write_config_4(ch_t *obj, uint32_t reg, uint32_t val);
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwint pe_os_mem_copy(ch_t *obj, void *dst, void *src, size_t len);
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwvoid *pe_os_malloc_contig_wait_zero(ch_t *, size_t, uint64_t *,
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwint pe_get_stats(ch_t *sa, uint64_t *speed, uint32_t *intrcnt,
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw uint32_t *norcvbuf, uint32_t *oerrors, uint32_t *ierrors,
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw uint32_t *underrun, uint32_t *overrun, uint32_t *framing,
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw uint32_t *xerrs, uint32_t *rerrs, uint32_t *toolong, uint32_t *runt,
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw ulong_t *multixmt, ulong_t *multircv, ulong_t *brdcstxmt,
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xwvoid pe_init(void *);
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#define toe_running(a) (a->open_device_map & TOEDEV_DEVMAP_BIT)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#if defined(__sparc)
d39a76e7b087a3d0927cbe6898dc0a6770fa6c68xw#endif /* _CHELSIO_CH_H */