Home | History | Annotate | Line # | Download | only in ixgbe
ixgbe_netbsd.h revision 1.14
      1  1.14  msaitoh /* $NetBSD: ixgbe_netbsd.h,v 1.14 2021/08/25 09:06:02 msaitoh 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.7  msaitoh #if 0 /* Enable this if you don't want to use TX multiqueue function */
     35   1.3  msaitoh #define	IXGBE_LEGACY_TX	1
     36   1.6  msaitoh #endif
     37   1.3  msaitoh 
     38   1.1   dyoung #define	ETHERCAP_VLAN_HWCSUM	0
     39   1.1   dyoung #define	MJUM9BYTES	(9 * 1024)
     40   1.1   dyoung #define	MJUM16BYTES	(16 * 1024)
     41   1.1   dyoung #define	MJUMPAGESIZE	PAGE_SIZE
     42   1.1   dyoung 
     43   1.1   dyoung #define IFCAP_RXCSUM	\
     44   1.1   dyoung 	(IFCAP_CSUM_IPv4_Rx|IFCAP_CSUM_TCPv4_Rx|IFCAP_CSUM_UDPv4_Rx|\
     45   1.1   dyoung 	IFCAP_CSUM_TCPv6_Rx|IFCAP_CSUM_UDPv6_Rx)
     46   1.1   dyoung 
     47   1.1   dyoung #define IFCAP_TXCSUM	\
     48   1.1   dyoung 	(IFCAP_CSUM_IPv4_Tx|IFCAP_CSUM_TCPv4_Tx|IFCAP_CSUM_UDPv4_Tx|\
     49   1.1   dyoung 	IFCAP_CSUM_TCPv6_Tx|IFCAP_CSUM_UDPv6_Tx)
     50   1.1   dyoung 
     51   1.1   dyoung #define IFCAP_HWCSUM	(IFCAP_RXCSUM|IFCAP_TXCSUM)
     52   1.1   dyoung 
     53   1.1   dyoung struct ixgbe_dma_tag {
     54   1.1   dyoung 	bus_dma_tag_t	dt_dmat;
     55   1.1   dyoung 	bus_size_t	dt_alignment;
     56   1.1   dyoung 	bus_size_t	dt_boundary;
     57   1.1   dyoung 	bus_size_t	dt_maxsize;
     58   1.1   dyoung 	int		dt_nsegments;
     59   1.1   dyoung 	bus_size_t	dt_maxsegsize;
     60   1.1   dyoung 	int		dt_flags;
     61   1.1   dyoung };
     62   1.1   dyoung 
     63   1.1   dyoung typedef struct ixgbe_dma_tag ixgbe_dma_tag_t;
     64   1.1   dyoung 
     65  1.13  msaitoh int ixgbe_dma_tag_create(bus_dma_tag_t, bus_size_t, bus_size_t, bus_size_t,
     66  1.13  msaitoh     int, bus_size_t, int, ixgbe_dma_tag_t **);
     67   1.1   dyoung void ixgbe_dma_tag_destroy(ixgbe_dma_tag_t *);
     68   1.1   dyoung int ixgbe_dmamap_create(ixgbe_dma_tag_t *, int, bus_dmamap_t *);
     69   1.1   dyoung void ixgbe_dmamap_destroy(ixgbe_dma_tag_t *, bus_dmamap_t);
     70   1.1   dyoung void ixgbe_dmamap_sync(ixgbe_dma_tag_t *, bus_dmamap_t, int);
     71   1.1   dyoung void ixgbe_dmamap_unload(ixgbe_dma_tag_t *, bus_dmamap_t);
     72   1.1   dyoung 
     73  1.14  msaitoh struct mbuf *ixgbe_getcl(void);
     74   1.4  msaitoh void ixgbe_pci_enable_busmaster(pci_chipset_tag_t, pcitag_t);
     75   1.1   dyoung 
     76   1.9  msaitoh u_int atomic_load_acq_uint(volatile u_int *);
     77   1.9  msaitoh 
     78   1.1   dyoung #endif /* _IXGBE_NETBSD_H */
     79