154dfc97bSShailend Chand /*- 254dfc97bSShailend Chand * SPDX-License-Identifier: BSD-3-Clause 354dfc97bSShailend Chand * 454dfc97bSShailend Chand * Copyright (c) 2023 Google LLC 554dfc97bSShailend Chand * 654dfc97bSShailend Chand * Redistribution and use in source and binary forms, with or without modification, 754dfc97bSShailend Chand * are permitted provided that the following conditions are met: 854dfc97bSShailend Chand * 954dfc97bSShailend Chand * 1. Redistributions of source code must retain the above copyright notice, this 1054dfc97bSShailend Chand * list of conditions and the following disclaimer. 1154dfc97bSShailend Chand * 1254dfc97bSShailend Chand * 2. Redistributions in binary form must reproduce the above copyright notice, 1354dfc97bSShailend Chand * this list of conditions and the following disclaimer in the documentation 1454dfc97bSShailend Chand * and/or other materials provided with the distribution. 1554dfc97bSShailend Chand * 1654dfc97bSShailend Chand * 3. Neither the name of the copyright holder nor the names of its contributors 1754dfc97bSShailend Chand * may be used to endorse or promote products derived from this software without 1854dfc97bSShailend Chand * specific prior written permission. 1954dfc97bSShailend Chand * 2054dfc97bSShailend Chand * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 2154dfc97bSShailend Chand * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 2254dfc97bSShailend Chand * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 2354dfc97bSShailend Chand * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 2454dfc97bSShailend Chand * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 2554dfc97bSShailend Chand * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 2654dfc97bSShailend Chand * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 2754dfc97bSShailend Chand * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2854dfc97bSShailend Chand * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 2954dfc97bSShailend Chand * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3054dfc97bSShailend Chand */ 3154dfc97bSShailend Chand #ifndef _GVE_PLAT_FBSD_H 3254dfc97bSShailend Chand #define _GVE_PLAT_FBSD_H 3354dfc97bSShailend Chand 3454dfc97bSShailend Chand #include <sys/param.h> 3554dfc97bSShailend Chand #include <sys/systm.h> 3654dfc97bSShailend Chand #include <sys/bitset.h> 3754dfc97bSShailend Chand #include <sys/bus.h> 3854dfc97bSShailend Chand #include <sys/endian.h> 3954dfc97bSShailend Chand #include <sys/eventhandler.h> 4054dfc97bSShailend Chand #include <sys/kernel.h> 4154dfc97bSShailend Chand #include <sys/kthread.h> 4254dfc97bSShailend Chand #include <sys/malloc.h> 4354dfc97bSShailend Chand #include <sys/mbuf.h> 4454dfc97bSShailend Chand #include <sys/module.h> 4554dfc97bSShailend Chand #include <sys/rman.h> 4654dfc97bSShailend Chand #include <sys/smp.h> 4754dfc97bSShailend Chand #include <sys/socket.h> 4854dfc97bSShailend Chand #include <sys/sockio.h> 4954dfc97bSShailend Chand #include <sys/sysctl.h> 5054dfc97bSShailend Chand #include <sys/taskqueue.h> 5154dfc97bSShailend Chand #include <sys/time.h> 5254dfc97bSShailend Chand 5354dfc97bSShailend Chand #include <net/bpf.h> 5454dfc97bSShailend Chand #include <net/ethernet.h> 5554dfc97bSShailend Chand #include <net/if.h> 5654dfc97bSShailend Chand #include <net/if_arp.h> 5754dfc97bSShailend Chand #include <net/if_dl.h> 5854dfc97bSShailend Chand #include <net/if_media.h> 5954dfc97bSShailend Chand #include <net/if_types.h> 6054dfc97bSShailend Chand #include <net/if_var.h> 6154dfc97bSShailend Chand #include <net/if_vlan_var.h> 6254dfc97bSShailend Chand #include <netinet/in.h> 6354dfc97bSShailend Chand #include <netinet/in_systm.h> 6454dfc97bSShailend Chand #include <netinet/if_ether.h> 6554dfc97bSShailend Chand #include <netinet/ip.h> 6654dfc97bSShailend Chand #include <netinet/ip6.h> 6754dfc97bSShailend Chand #include <netinet/tcp.h> 6854dfc97bSShailend Chand #include <netinet/tcp_lro.h> 6954dfc97bSShailend Chand #include <netinet/udp.h> 7054dfc97bSShailend Chand 7154dfc97bSShailend Chand #include <vm/vm.h> 7254dfc97bSShailend Chand #include <vm/pmap.h> 7354dfc97bSShailend Chand #include <vm/vm_extern.h> 7454dfc97bSShailend Chand #include <vm/vm_kern.h> 7554dfc97bSShailend Chand #include <vm/vm_page.h> 7654dfc97bSShailend Chand 7754dfc97bSShailend Chand #include <machine/atomic.h> 7854dfc97bSShailend Chand #include <machine/bus.h> 7954dfc97bSShailend Chand #include <machine/in_cksum.h> 8054dfc97bSShailend Chand #include <machine/resource.h> 8154dfc97bSShailend Chand 8254dfc97bSShailend Chand #include <dev/pci/pcireg.h> 8354dfc97bSShailend Chand #include <dev/pci/pcivar.h> 8454dfc97bSShailend Chand 8554dfc97bSShailend Chand typedef uint16_t __be16; 8654dfc97bSShailend Chand typedef uint32_t __be32; 8754dfc97bSShailend Chand typedef uint64_t __be64; 88*d438b4efSShailend Chand typedef uint16_t __le16; 89*d438b4efSShailend Chand typedef uint32_t __le32; 90*d438b4efSShailend Chand typedef uint64_t __le64; 9154dfc97bSShailend Chand #define BIT(nr) (1UL << (nr)) 9254dfc97bSShailend Chand 9354dfc97bSShailend Chand #define FBSD_VERSION_MAJOR (__FreeBSD_version / 100000) 9454dfc97bSShailend Chand #define FBSD_VERSION_MINOR ((__FreeBSD_version / 1000) - FBSD_VERSION_MAJOR * 100) 9554dfc97bSShailend Chand #define FBSD_VERSION_PATCH (__FreeBSD_version - ((FBSD_VERSION_MAJOR * 100 + FBSD_VERSION_MINOR) * 1000)) 9654dfc97bSShailend Chand 9754dfc97bSShailend Chand #endif // _GVE_PLAT_FBSD_H 98