Home | History | Annotate | Line # | Download | only in ixgbe
ixgbe_netbsd.h revision 1.2.4.2
      1  1.2.4.2   skrll /*$NetBSD: ixgbe_netbsd.h,v 1.2.4.2 2016/12/05 10:55:17 skrll Exp $*/
      2      1.1  dyoung /*
      3      1.1  dyoung  * Copyright (c) 2011 The NetBSD Foundation, Inc.
      4      1.1  dyoung  * All rights reserved.
      5      1.1  dyoung  *
      6      1.1  dyoung  * This code is derived from software contributed to The NetBSD Foundation
      7      1.1  dyoung  * by Coyote Point Systems, Inc.
      8      1.1  dyoung  *
      9      1.1  dyoung  * Redistribution and use in source and binary forms, with or without
     10      1.1  dyoung  * modification, are permitted provided that the following conditions
     11      1.1  dyoung  * are met:
     12      1.1  dyoung  * 1. Redistributions of source code must retain the above copyright
     13      1.1  dyoung  *    notice, this list of conditions and the following disclaimer.
     14      1.1  dyoung  * 2. Redistributions in binary form must reproduce the above copyright
     15      1.1  dyoung  *    notice, this list of conditions and the following disclaimer in the
     16      1.1  dyoung  *    documentation and/or other materials provided with the distribution.
     17      1.1  dyoung  *
     18      1.1  dyoung  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     19      1.1  dyoung  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     20      1.1  dyoung  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     21      1.1  dyoung  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     22      1.1  dyoung  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     23      1.1  dyoung  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     24      1.1  dyoung  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     25      1.1  dyoung  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     26      1.1  dyoung  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     27      1.1  dyoung  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     28      1.1  dyoung  * POSSIBILITY OF SUCH DAMAGE.
     29      1.1  dyoung  */
     30      1.1  dyoung 
     31      1.1  dyoung #ifndef _IXGBE_NETBSD_H
     32      1.1  dyoung #define _IXGBE_NETBSD_H
     33      1.1  dyoung 
     34  1.2.4.1   skrll #define	IXGBE_LEGACY_TX	1
     35  1.2.4.1   skrll 
     36      1.1  dyoung #define	ETHERCAP_VLAN_HWFILTER	0
     37      1.1  dyoung #define	ETHERCAP_VLAN_HWCSUM	0
     38      1.1  dyoung #define	MJUM9BYTES	(9 * 1024)
     39      1.1  dyoung #define	MJUM16BYTES	(16 * 1024)
     40      1.1  dyoung #define	MJUMPAGESIZE	PAGE_SIZE
     41      1.1  dyoung 
     42      1.1  dyoung #define IFCAP_RXCSUM	\
     43      1.1  dyoung 	(IFCAP_CSUM_IPv4_Rx|IFCAP_CSUM_TCPv4_Rx|IFCAP_CSUM_UDPv4_Rx|\
     44      1.1  dyoung 	IFCAP_CSUM_TCPv6_Rx|IFCAP_CSUM_UDPv6_Rx)
     45      1.1  dyoung 
     46      1.1  dyoung #define IFCAP_TXCSUM	\
     47      1.1  dyoung 	(IFCAP_CSUM_IPv4_Tx|IFCAP_CSUM_TCPv4_Tx|IFCAP_CSUM_UDPv4_Tx|\
     48      1.1  dyoung 	IFCAP_CSUM_TCPv6_Tx|IFCAP_CSUM_UDPv6_Tx)
     49      1.1  dyoung 
     50      1.1  dyoung #define IFCAP_HWCSUM	(IFCAP_RXCSUM|IFCAP_TXCSUM)
     51      1.1  dyoung 
     52      1.1  dyoung #define	ETHER_ALIGN		2
     53      1.1  dyoung 
     54      1.1  dyoung struct ixgbe_dma_tag {
     55      1.1  dyoung 	bus_dma_tag_t	dt_dmat;
     56      1.1  dyoung 	bus_size_t	dt_alignment;
     57      1.1  dyoung 	bus_size_t	dt_boundary;
     58      1.1  dyoung 	bus_size_t	dt_maxsize;
     59      1.1  dyoung 	int		dt_nsegments;
     60      1.1  dyoung 	bus_size_t	dt_maxsegsize;
     61      1.1  dyoung 	int		dt_flags;
     62      1.1  dyoung };
     63      1.1  dyoung 
     64      1.1  dyoung typedef struct ixgbe_dma_tag ixgbe_dma_tag_t;
     65      1.1  dyoung 
     66      1.1  dyoung struct ixgbe_extmem_head;
     67      1.1  dyoung typedef struct ixgbe_extmem_head ixgbe_extmem_head_t;
     68      1.1  dyoung 
     69      1.1  dyoung struct ixgbe_extmem {
     70      1.1  dyoung 	ixgbe_extmem_head_t		*em_head;
     71      1.1  dyoung 	bus_dma_tag_t			em_dmat;
     72      1.1  dyoung 	bus_size_t			em_size;
     73      1.1  dyoung 	bus_dma_segment_t		em_seg;
     74      1.1  dyoung 	void				*em_vaddr;
     75      1.1  dyoung 	TAILQ_ENTRY(ixgbe_extmem)	em_link;
     76      1.1  dyoung };
     77      1.1  dyoung 
     78      1.1  dyoung typedef struct ixgbe_extmem ixgbe_extmem_t;
     79      1.1  dyoung 
     80      1.1  dyoung struct ixgbe_extmem_head {
     81      1.1  dyoung 	TAILQ_HEAD(, ixgbe_extmem)	eh_freelist;
     82      1.1  dyoung 	kmutex_t			eh_mtx;
     83      1.1  dyoung 	bool				eh_initialized;
     84      1.1  dyoung };
     85      1.1  dyoung 
     86      1.1  dyoung int ixgbe_dma_tag_create(bus_dma_tag_t, bus_size_t, bus_size_t, bus_size_t, int,
     87      1.1  dyoung     bus_size_t, int, ixgbe_dma_tag_t **);
     88      1.1  dyoung void ixgbe_dma_tag_destroy(ixgbe_dma_tag_t *);
     89      1.1  dyoung int ixgbe_dmamap_create(ixgbe_dma_tag_t *, int, bus_dmamap_t *);
     90      1.1  dyoung void ixgbe_dmamap_destroy(ixgbe_dma_tag_t *, bus_dmamap_t);
     91      1.1  dyoung void ixgbe_dmamap_sync(ixgbe_dma_tag_t *, bus_dmamap_t, int);
     92      1.1  dyoung void ixgbe_dmamap_unload(ixgbe_dma_tag_t *, bus_dmamap_t);
     93      1.1  dyoung 
     94      1.1  dyoung void ixgbe_jcl_reinit(ixgbe_extmem_head_t *, bus_dma_tag_t, int, size_t);
     95      1.1  dyoung struct mbuf *ixgbe_getjcl(ixgbe_extmem_head_t *, int, int, int, size_t);
     96  1.2.4.2   skrll void ixgbe_pci_enable_busmaster(pci_chipset_tag_t, pcitag_t);
     97      1.1  dyoung 
     98      1.1  dyoung #endif /* _IXGBE_NETBSD_H */
     99