Deleted Added
full compact
pcireg.h (264006) pcireg.h (264007)
1/*-
2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/dev/pci/pcireg.h 264006 2014-04-01 15:06:03Z rstone $
26 * $FreeBSD: head/sys/dev/pci/pcireg.h 264007 2014-04-01 15:47:24Z rstone $
27 *
28 */
29
30/*
31 * PCIM_xxx: mask to locate subfield in register
32 * PCIR_xxx: config register offset
33 * PCIC_xxx: device class
34 * PCIS_xxx: device subclass

--- 8 unchanged lines hidden (view full) ---

43#define PCI_DOMAINMAX 65535 /* highest supported domain number */
44#define PCI_BUSMAX 255 /* highest supported bus number */
45#define PCI_SLOTMAX 31 /* highest supported slot number */
46#define PCI_FUNCMAX 7 /* highest supported function number */
47#define PCI_REGMAX 255 /* highest supported config register addr. */
48#define PCIE_REGMAX 4095 /* highest supported config register addr. */
49#define PCI_MAXHDRTYPE 2
50
27 *
28 */
29
30/*
31 * PCIM_xxx: mask to locate subfield in register
32 * PCIR_xxx: config register offset
33 * PCIC_xxx: device class
34 * PCIS_xxx: device subclass

--- 8 unchanged lines hidden (view full) ---

43#define PCI_DOMAINMAX 65535 /* highest supported domain number */
44#define PCI_BUSMAX 255 /* highest supported bus number */
45#define PCI_SLOTMAX 31 /* highest supported slot number */
46#define PCI_FUNCMAX 7 /* highest supported function number */
47#define PCI_REGMAX 255 /* highest supported config register addr. */
48#define PCIE_REGMAX 4095 /* highest supported config register addr. */
49#define PCI_MAXHDRTYPE 2
50
51#define PCI_RID_BUS_SHIFT 8
52#define PCI_RID_SLOT_SHIFT 3
53#define PCI_RID_FUNC_SHIFT 0
54
55#define PCI_RID(bus, slot, func) \
56 ((((bus) & PCI_BUSMAX) << PCI_RID_BUS_SHIFT) | \
57 (((slot) & PCI_SLOTMAX) << PCI_RID_SLOT_SHIFT) | \
58 (((func) & PCI_FUNCMAX) << PCI_RID_FUNC_SHIFT))
59
60#define PCI_ARI_RID(bus, func) \
61 ((((bus) & PCI_BUSMAX) << PCI_RID_BUS_SHIFT) | \
62 (((func) & PCIE_ARI_FUNCMAX) << PCI_RID_FUNC_SHIFT))
63
64#define PCI_RID2BUS(rid) (((rid) >> PCI_RID_BUS_SHIFT) & PCI_BUSMAX)
65#define PCI_RID2SLOT(rid) (((rid) >> PCI_RID_SLOT_SHIFT) & PCI_SLOTMAX)
66#define PCI_RID2FUNC(rid) (((rid) >> PCI_RID_FUNC_SHIFT) & PCI_FUNCMAX)
67
51/* PCI config header registers for all devices */
52
53#define PCIR_DEVVENDOR 0x00
54#define PCIR_VENDOR 0x00
55#define PCIR_DEVICE 0x02
56#define PCIR_COMMAND 0x04
57#define PCIM_CMD_PORTEN 0x0001
58#define PCIM_CMD_MEMEN 0x0002

--- 838 unchanged lines hidden ---
68/* PCI config header registers for all devices */
69
70#define PCIR_DEVVENDOR 0x00
71#define PCIR_VENDOR 0x00
72#define PCIR_DEVICE 0x02
73#define PCIR_COMMAND 0x04
74#define PCIM_CMD_PORTEN 0x0001
75#define PCIM_CMD_MEMEN 0x0002

--- 838 unchanged lines hidden ---