2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright 2019 Cisco Systems, Inc.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 #ifndef __VMD_PRIVATE_H__
33 #define __VMD_PRIVATE_H__
35 struct vmd_irq_handler {
36 TAILQ_ENTRY(vmd_irq_handler) vmd_link;
38 driver_intr_t *vmd_intr;
44 struct resource *vmd_res;
47 struct vmd_softc *vmd_sc;
49 TAILQ_HEAD(,vmd_irq_handler) vmd_list;
59 uint32_t vmd_flags; /* flags */
60 #define PCIB_SUBTRACTIVE 0x1
61 #define PCIB_DISABLE_MSI 0x2
62 #define PCIB_DISABLE_MSIX 0x4
63 #define PCIB_ENABLE_ARI 0x8
64 #define PCIB_HOTPLUG 0x10
65 #define PCIB_HOTPLUG_CMD_PENDING 0x20
66 #define PCIB_DETACH_PENDING 0x40
67 #define PCIB_DETACHING 0x80
68 u_int vmd_domain; /* domain number */
69 struct pcib_secbus vmd_bus; /* secondary bus numbers */
72 struct resource *vmd_regs_resource[VMD_MAX_BAR];
73 int vmd_regs_rid[VMD_MAX_BAR];
74 bus_space_handle_t vmd_bhandle;
75 bus_space_tag_t vmd_btag;
77 struct resource *vmd_io_resource;
79 struct vmd_irq *vmd_irq;
81 #ifdef TASK_QUEUE_INTR
82 struct taskqueue *vmd_irq_tq;
83 struct task vmd_irq_task;
85 struct mtx vmd_irq_lock;