2005-01-06 01:43:34 +00:00
|
|
|
/*-
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
* Copyright (c) 1997, Stefan Esser <se@freebsd.org>
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice unmodified, this list of conditions, and the following
|
|
|
|
* disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
1999-08-28 01:08:13 +00:00
|
|
|
* $FreeBSD$
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
1998-09-15 08:21:13 +00:00
|
|
|
#ifndef _PCIVAR_H_
|
|
|
|
#define _PCIVAR_H_
|
|
|
|
|
|
|
|
#include <sys/queue.h>
|
|
|
|
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
/* some PCI bus constants */
|
|
|
|
|
|
|
|
#define PCI_BUSMAX 255 /* highest supported bus number */
|
|
|
|
#define PCI_SLOTMAX 31 /* highest supported slot number */
|
|
|
|
#define PCI_FUNCMAX 7 /* highest supported function number */
|
|
|
|
#define PCI_REGMAX 255 /* highest supported config register addr. */
|
|
|
|
|
|
|
|
#define PCI_MAXMAPS_0 6 /* max. no. of memory/port maps */
|
|
|
|
#define PCI_MAXMAPS_1 2 /* max. no. of maps for PCI to PCI bridge */
|
|
|
|
#define PCI_MAXMAPS_2 1 /* max. no. of maps for CardBus bridge */
|
|
|
|
|
|
|
|
/* pci_addr_t covers this system's PCI bus address space: 32 or 64 bit */
|
|
|
|
|
|
|
|
#ifdef PCI_A64
|
2003-08-22 03:11:53 +00:00
|
|
|
typedef uint64_t pci_addr_t; /* uint64_t for system with 64bit addresses */
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
#else
|
2003-08-22 03:11:53 +00:00
|
|
|
typedef uint32_t pci_addr_t; /* uint64_t for system with 64bit addresses */
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
#endif
|
|
|
|
|
2003-09-14 19:30:00 +00:00
|
|
|
/* Interesting values for PCI power management */
|
|
|
|
struct pcicfg_pp {
|
|
|
|
uint16_t pp_cap; /* PCI power management capabilities */
|
|
|
|
uint8_t pp_status; /* config space address of PCI power status reg */
|
|
|
|
uint8_t pp_pmcsr; /* config space address of PMCSR reg */
|
|
|
|
uint8_t pp_data; /* config space address of PCI power data reg */
|
|
|
|
};
|
|
|
|
|
2006-10-09 16:15:56 +00:00
|
|
|
struct vpd_readonly {
|
|
|
|
char keyword[2];
|
|
|
|
char *value;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct vpd_write {
|
|
|
|
char keyword[2];
|
|
|
|
char *value;
|
|
|
|
int start;
|
|
|
|
int len;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct pcicfg_vpd {
|
|
|
|
uint8_t vpd_reg; /* base register, + 2 for addr, + 4 data */
|
|
|
|
char *vpd_ident; /* string identifier */
|
|
|
|
int vpd_rocnt;
|
|
|
|
struct vpd_readonly *vpd_ros;
|
|
|
|
int vpd_wcnt;
|
|
|
|
struct vpd_write *vpd_w;
|
|
|
|
};
|
|
|
|
|
2003-09-14 19:30:00 +00:00
|
|
|
/* Interesting values for PCI MSI */
|
|
|
|
struct pcicfg_msi {
|
|
|
|
uint16_t msi_ctrl; /* Message Control */
|
|
|
|
uint8_t msi_msgnum; /* Number of messages */
|
|
|
|
uint16_t msi_data; /* Location of MSI data word */
|
|
|
|
};
|
|
|
|
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
/* config header information common to all header types */
|
|
|
|
typedef struct pcicfg {
|
1999-04-16 21:22:55 +00:00
|
|
|
struct device *dev; /* device which owns this */
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
|
2004-04-07 20:46:16 +00:00
|
|
|
uint32_t bar[PCI_MAXMAPS_0]; /* BARs */
|
|
|
|
uint32_t bios; /* BIOS mapping */
|
|
|
|
|
2003-08-22 03:11:53 +00:00
|
|
|
uint16_t subvendor; /* card vendor ID */
|
|
|
|
uint16_t subdevice; /* card device ID, assigned by card vendor */
|
|
|
|
uint16_t vendor; /* chip vendor ID */
|
|
|
|
uint16_t device; /* chip device ID, assigned by chip vendor */
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
|
2003-08-22 03:11:53 +00:00
|
|
|
uint16_t cmdreg; /* disable/enable chip and PCI options */
|
|
|
|
uint16_t statreg; /* supported PCI features and error state */
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
|
2003-08-22 03:11:53 +00:00
|
|
|
uint8_t baseclass; /* chip PCI class */
|
|
|
|
uint8_t subclass; /* chip PCI subclass */
|
|
|
|
uint8_t progif; /* chip PCI programming interface */
|
|
|
|
uint8_t revid; /* chip revision ID */
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
|
2003-08-22 03:11:53 +00:00
|
|
|
uint8_t hdrtype; /* chip config header type */
|
|
|
|
uint8_t cachelnsz; /* cache line size in 4byte units */
|
|
|
|
uint8_t intpin; /* PCI interrupt pin */
|
|
|
|
uint8_t intline; /* interrupt line (IRQ for PC arch) */
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
|
2003-08-22 03:11:53 +00:00
|
|
|
uint8_t mingnt; /* min. useful bus grant time in 250ns units */
|
|
|
|
uint8_t maxlat; /* max. tolerated bus grant latency in 250ns */
|
|
|
|
uint8_t lattimer; /* latency timer in units of 30ns bus cycles */
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
|
2003-08-22 03:11:53 +00:00
|
|
|
uint8_t mfdev; /* multi-function device (from hdrtype reg) */
|
|
|
|
uint8_t nummaps; /* actual number of PCI maps used */
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
|
2003-08-22 03:11:53 +00:00
|
|
|
uint8_t bus; /* config space bus address */
|
|
|
|
uint8_t slot; /* config space slot address */
|
|
|
|
uint8_t func; /* config space function number */
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
|
2003-09-14 19:30:00 +00:00
|
|
|
struct pcicfg_pp pp; /* pci power management */
|
2006-10-09 16:15:56 +00:00
|
|
|
struct pcicfg_vpd vpd; /* pci vital product data */
|
2003-09-14 19:30:00 +00:00
|
|
|
struct pcicfg_msi msi; /* pci msi */
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
} pcicfgregs;
|
|
|
|
|
|
|
|
/* additional type 1 device config header information (PCI to PCI bridge) */
|
|
|
|
|
|
|
|
#ifdef PCI_A64
|
|
|
|
#define PCI_PPBMEMBASE(h,l) ((((pci_addr_t)(h) << 32) + ((l)<<16)) & ~0xfffff)
|
|
|
|
#define PCI_PPBMEMLIMIT(h,l) ((((pci_addr_t)(h) << 32) + ((l)<<16)) | 0xfffff)
|
|
|
|
#else
|
|
|
|
#define PCI_PPBMEMBASE(h,l) (((l)<<16) & ~0xfffff)
|
|
|
|
#define PCI_PPBMEMLIMIT(h,l) (((l)<<16) | 0xfffff)
|
|
|
|
#endif /* PCI_A64 */
|
|
|
|
|
|
|
|
#define PCI_PPBIOBASE(h,l) ((((h)<<16) + ((l)<<8)) & ~0xfff)
|
|
|
|
#define PCI_PPBIOLIMIT(h,l) ((((h)<<16) + ((l)<<8)) | 0xfff)
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
pci_addr_t pmembase; /* base address of prefetchable memory */
|
|
|
|
pci_addr_t pmemlimit; /* topmost address of prefetchable memory */
|
2003-08-22 03:11:53 +00:00
|
|
|
uint32_t membase; /* base address of memory window */
|
|
|
|
uint32_t memlimit; /* topmost address of memory window */
|
|
|
|
uint32_t iobase; /* base address of port window */
|
|
|
|
uint32_t iolimit; /* topmost address of port window */
|
|
|
|
uint16_t secstat; /* secondary bus status register */
|
|
|
|
uint16_t bridgectl; /* bridge control register */
|
|
|
|
uint8_t seclat; /* CardBus latency timer */
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
} pcih1cfgregs;
|
|
|
|
|
|
|
|
/* additional type 2 device config header information (CardBus bridge) */
|
|
|
|
|
|
|
|
typedef struct {
|
2003-08-22 03:11:53 +00:00
|
|
|
uint32_t membase0; /* base address of memory window */
|
|
|
|
uint32_t memlimit0; /* topmost address of memory window */
|
|
|
|
uint32_t membase1; /* base address of memory window */
|
|
|
|
uint32_t memlimit1; /* topmost address of memory window */
|
|
|
|
uint32_t iobase0; /* base address of port window */
|
|
|
|
uint32_t iolimit0; /* topmost address of port window */
|
|
|
|
uint32_t iobase1; /* base address of port window */
|
|
|
|
uint32_t iolimit1; /* topmost address of port window */
|
|
|
|
uint32_t pccardif; /* PC Card 16bit IF legacy more base addr. */
|
|
|
|
uint16_t secstat; /* secondary bus status register */
|
|
|
|
uint16_t bridgectl; /* bridge control register */
|
|
|
|
uint8_t seclat; /* CardBus latency timer */
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
} pcih2cfgregs;
|
|
|
|
|
2003-08-22 03:11:53 +00:00
|
|
|
extern uint32_t pci_numdevs;
|
1998-09-15 08:21:13 +00:00
|
|
|
|
2000-05-28 16:35:57 +00:00
|
|
|
/* Only if the prerequisites are present */
|
|
|
|
#if defined(_SYS_BUS_H_) && defined(_SYS_PCIIO_H_)
|
|
|
|
struct pci_devinfo {
|
|
|
|
STAILQ_ENTRY(pci_devinfo) pci_links;
|
|
|
|
struct resource_list resources;
|
|
|
|
pcicfgregs cfg;
|
|
|
|
struct pci_conf conf;
|
|
|
|
};
|
|
|
|
#endif
|
1998-09-15 08:21:13 +00:00
|
|
|
|
1999-04-16 21:22:55 +00:00
|
|
|
#ifdef _SYS_BUS_H_
|
|
|
|
|
|
|
|
#include "pci_if.h"
|
|
|
|
|
1999-10-14 21:38:33 +00:00
|
|
|
/*
|
|
|
|
* Define pci-specific resource flags for accessing memory via dense
|
|
|
|
* or bwx memory spaces. These flags are ignored on i386.
|
|
|
|
*/
|
|
|
|
#define PCI_RF_DENSE 0x10000
|
|
|
|
#define PCI_RF_BWX 0x20000
|
|
|
|
|
1999-04-16 21:22:55 +00:00
|
|
|
enum pci_device_ivars {
|
2000-12-13 01:25:11 +00:00
|
|
|
PCI_IVAR_SUBVENDOR,
|
|
|
|
PCI_IVAR_SUBDEVICE,
|
|
|
|
PCI_IVAR_VENDOR,
|
|
|
|
PCI_IVAR_DEVICE,
|
|
|
|
PCI_IVAR_DEVID,
|
|
|
|
PCI_IVAR_CLASS,
|
|
|
|
PCI_IVAR_SUBCLASS,
|
|
|
|
PCI_IVAR_PROGIF,
|
|
|
|
PCI_IVAR_REVID,
|
|
|
|
PCI_IVAR_INTPIN,
|
|
|
|
PCI_IVAR_IRQ,
|
|
|
|
PCI_IVAR_BUS,
|
|
|
|
PCI_IVAR_SLOT,
|
|
|
|
PCI_IVAR_FUNCTION,
|
2002-11-27 06:41:28 +00:00
|
|
|
PCI_IVAR_ETHADDR,
|
2005-09-11 03:22:03 +00:00
|
|
|
PCI_IVAR_CMDREG,
|
|
|
|
PCI_IVAR_CACHELNSZ,
|
|
|
|
PCI_IVAR_MINGNT,
|
|
|
|
PCI_IVAR_MAXLAT,
|
|
|
|
PCI_IVAR_LATTIMER,
|
1999-04-16 21:22:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Simplified accessors for pci devices
|
|
|
|
*/
|
2002-08-19 22:51:23 +00:00
|
|
|
#define PCI_ACCESSOR(var, ivar, type) \
|
2001-12-21 21:49:57 +00:00
|
|
|
__BUS_ACCESSOR(pci, var, PCI, ivar, type)
|
1999-04-16 21:22:55 +00:00
|
|
|
|
2003-08-22 03:11:53 +00:00
|
|
|
PCI_ACCESSOR(subvendor, SUBVENDOR, uint16_t)
|
|
|
|
PCI_ACCESSOR(subdevice, SUBDEVICE, uint16_t)
|
|
|
|
PCI_ACCESSOR(vendor, VENDOR, uint16_t)
|
|
|
|
PCI_ACCESSOR(device, DEVICE, uint16_t)
|
|
|
|
PCI_ACCESSOR(devid, DEVID, uint32_t)
|
|
|
|
PCI_ACCESSOR(class, CLASS, uint8_t)
|
|
|
|
PCI_ACCESSOR(subclass, SUBCLASS, uint8_t)
|
|
|
|
PCI_ACCESSOR(progif, PROGIF, uint8_t)
|
|
|
|
PCI_ACCESSOR(revid, REVID, uint8_t)
|
|
|
|
PCI_ACCESSOR(intpin, INTPIN, uint8_t)
|
|
|
|
PCI_ACCESSOR(irq, IRQ, uint8_t)
|
|
|
|
PCI_ACCESSOR(bus, BUS, uint8_t)
|
|
|
|
PCI_ACCESSOR(slot, SLOT, uint8_t)
|
|
|
|
PCI_ACCESSOR(function, FUNCTION, uint8_t)
|
|
|
|
PCI_ACCESSOR(ether, ETHADDR, uint8_t *)
|
2005-09-11 03:22:03 +00:00
|
|
|
PCI_ACCESSOR(cmdreg, CMDREG, uint8_t)
|
|
|
|
PCI_ACCESSOR(cachelnsz, CACHELNSZ, uint8_t)
|
|
|
|
PCI_ACCESSOR(mingnt, MINGNT, uint8_t)
|
|
|
|
PCI_ACCESSOR(maxlat, MAXLAT, uint8_t)
|
|
|
|
PCI_ACCESSOR(lattimer, LATTIMER, uint8_t)
|
1999-04-16 21:22:55 +00:00
|
|
|
|
2000-09-28 00:37:32 +00:00
|
|
|
#undef PCI_ACCESSOR
|
|
|
|
|
2000-12-13 01:25:11 +00:00
|
|
|
/*
|
|
|
|
* Operations on configuration space.
|
|
|
|
*/
|
2003-08-22 03:11:53 +00:00
|
|
|
static __inline uint32_t
|
1999-04-16 21:22:55 +00:00
|
|
|
pci_read_config(device_t dev, int reg, int width)
|
|
|
|
{
|
|
|
|
return PCI_READ_CONFIG(device_get_parent(dev), dev, reg, width);
|
|
|
|
}
|
|
|
|
|
|
|
|
static __inline void
|
2003-08-22 03:11:53 +00:00
|
|
|
pci_write_config(device_t dev, int reg, uint32_t val, int width)
|
1999-04-16 21:22:55 +00:00
|
|
|
{
|
|
|
|
PCI_WRITE_CONFIG(device_get_parent(dev), dev, reg, val, width);
|
|
|
|
}
|
|
|
|
|
1999-05-20 15:33:33 +00:00
|
|
|
/*
|
|
|
|
* Ivars for pci bridges.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*typedef enum pci_device_ivars pcib_device_ivars;*/
|
|
|
|
enum pcib_device_ivars {
|
2000-08-28 21:48:13 +00:00
|
|
|
PCIB_IVAR_BUS
|
1999-05-20 15:33:33 +00:00
|
|
|
};
|
|
|
|
|
2002-08-19 22:50:08 +00:00
|
|
|
#define PCIB_ACCESSOR(var, ivar, type) \
|
|
|
|
__BUS_ACCESSOR(pcib, var, PCIB, ivar, type)
|
1999-05-20 15:33:33 +00:00
|
|
|
|
2003-08-22 03:11:53 +00:00
|
|
|
PCIB_ACCESSOR(bus, BUS, uint32_t)
|
1999-05-20 15:33:33 +00:00
|
|
|
|
2000-09-28 00:37:32 +00:00
|
|
|
#undef PCIB_ACCESSOR
|
|
|
|
|
2002-02-12 01:28:49 +00:00
|
|
|
/*
|
2002-06-07 15:28:16 +00:00
|
|
|
* PCI interrupt validation. Invalid interrupt values such as 0 or 128
|
|
|
|
* on i386 or other platforms should be mapped out in the MD pcireadconf
|
|
|
|
* code and not here, since the only MI invalid IRQ is 255.
|
2002-02-12 01:28:49 +00:00
|
|
|
*/
|
2002-06-01 05:40:33 +00:00
|
|
|
#define PCI_INVALID_IRQ 255
|
2002-06-07 15:28:16 +00:00
|
|
|
#define PCI_INTERRUPT_VALID(x) ((x) != PCI_INVALID_IRQ)
|
2002-02-12 01:28:49 +00:00
|
|
|
|
2000-12-13 01:25:11 +00:00
|
|
|
/*
|
|
|
|
* Convenience functions.
|
|
|
|
*
|
|
|
|
* These should be used in preference to manually manipulating
|
|
|
|
* configuration space.
|
|
|
|
*/
|
2003-04-16 03:15:08 +00:00
|
|
|
static __inline int
|
2001-02-27 23:13:20 +00:00
|
|
|
pci_enable_busmaster(device_t dev)
|
|
|
|
{
|
2003-04-16 03:15:08 +00:00
|
|
|
return(PCI_ENABLE_BUSMASTER(device_get_parent(dev), dev));
|
2001-02-27 23:13:20 +00:00
|
|
|
}
|
|
|
|
|
2003-04-16 03:15:08 +00:00
|
|
|
static __inline int
|
2001-02-27 23:13:20 +00:00
|
|
|
pci_disable_busmaster(device_t dev)
|
|
|
|
{
|
2003-04-16 03:15:08 +00:00
|
|
|
return(PCI_DISABLE_BUSMASTER(device_get_parent(dev), dev));
|
2001-02-27 23:13:20 +00:00
|
|
|
}
|
|
|
|
|
2003-04-16 03:15:08 +00:00
|
|
|
static __inline int
|
2001-02-27 23:13:20 +00:00
|
|
|
pci_enable_io(device_t dev, int space)
|
|
|
|
{
|
2003-04-16 03:15:08 +00:00
|
|
|
return(PCI_ENABLE_IO(device_get_parent(dev), dev, space));
|
2001-02-27 23:13:20 +00:00
|
|
|
}
|
|
|
|
|
2003-04-16 03:15:08 +00:00
|
|
|
static __inline int
|
2001-02-27 23:13:20 +00:00
|
|
|
pci_disable_io(device_t dev, int space)
|
|
|
|
{
|
2003-04-16 03:15:08 +00:00
|
|
|
return(PCI_DISABLE_IO(device_get_parent(dev), dev, space));
|
2001-02-27 23:13:20 +00:00
|
|
|
}
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
|
2006-10-09 16:15:56 +00:00
|
|
|
static __inline int
|
|
|
|
pci_get_vpd_ident(device_t dev, const char **identptr)
|
|
|
|
{
|
|
|
|
return(PCI_GET_VPD_IDENT(device_get_parent(dev), dev, identptr));
|
|
|
|
}
|
|
|
|
|
|
|
|
static __inline int
|
|
|
|
pci_get_vpd_readonly(device_t dev, const char *kw, const char **identptr)
|
|
|
|
{
|
|
|
|
return(PCI_GET_VPD_READONLY(device_get_parent(dev), dev, kw, identptr));
|
|
|
|
}
|
|
|
|
|
2005-04-29 02:03:11 +00:00
|
|
|
/*
|
|
|
|
* Check if the address range falls within the VGA defined address range(s)
|
|
|
|
*/
|
|
|
|
static __inline int
|
|
|
|
pci_is_vga_ioport_range(u_long start, u_long end)
|
|
|
|
{
|
|
|
|
|
|
|
|
return (((start >= 0x3b0 && end <= 0x3bb) ||
|
|
|
|
(start >= 0x3c0 && end <= 0x3df)) ? 1 : 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static __inline int
|
|
|
|
pci_is_vga_memory_range(u_long start, u_long end)
|
|
|
|
{
|
|
|
|
|
|
|
|
return ((start >= 0xa0000 && end <= 0xbffff) ? 1 : 0);
|
|
|
|
}
|
|
|
|
|
2000-12-13 01:25:11 +00:00
|
|
|
/*
|
|
|
|
* PCI power states are as defined by ACPI:
|
|
|
|
*
|
|
|
|
* D0 State in which device is on and running. It is receiving full
|
|
|
|
* power from the system and delivering full functionality to the user.
|
|
|
|
* D1 Class-specific low-power state in which device context may or may not
|
|
|
|
* be lost. Buses in D1 cannot do anything to the bus that would force
|
2006-08-04 07:56:35 +00:00
|
|
|
* devices on that bus to lose context.
|
2000-12-13 01:25:11 +00:00
|
|
|
* D2 Class-specific low-power state in which device context may or may
|
|
|
|
* not be lost. Attains greater power savings than D1. Buses in D2
|
2006-08-04 07:56:35 +00:00
|
|
|
* can cause devices on that bus to lose some context. Devices in D2
|
2000-12-13 01:25:11 +00:00
|
|
|
* must be prepared for the bus to be in D2 or higher.
|
|
|
|
* D3 State in which the device is off and not running. Device context is
|
|
|
|
* lost. Power can be removed from the device.
|
|
|
|
*/
|
|
|
|
#define PCI_POWERSTATE_D0 0
|
|
|
|
#define PCI_POWERSTATE_D1 1
|
|
|
|
#define PCI_POWERSTATE_D2 2
|
|
|
|
#define PCI_POWERSTATE_D3 3
|
|
|
|
#define PCI_POWERSTATE_UNKNOWN -1
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
|
2001-02-27 23:13:20 +00:00
|
|
|
static __inline int
|
|
|
|
pci_set_powerstate(device_t dev, int state)
|
|
|
|
{
|
|
|
|
return PCI_SET_POWERSTATE(device_get_parent(dev), dev, state);
|
|
|
|
}
|
|
|
|
|
|
|
|
static __inline int
|
|
|
|
pci_get_powerstate(device_t dev)
|
|
|
|
{
|
|
|
|
return PCI_GET_POWERSTATE(device_get_parent(dev), dev);
|
|
|
|
}
|
Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .
The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...
This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.
A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:
1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.
The following features are currently missing, but will be added back,
soon:
1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets
This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
|
|
|
|
2005-12-20 19:57:47 +00:00
|
|
|
static __inline int
|
|
|
|
pci_find_extcap(device_t dev, int capability, int *capreg)
|
|
|
|
{
|
|
|
|
return PCI_FIND_EXTCAP(device_get_parent(dev), dev, capability, capreg);
|
|
|
|
}
|
|
|
|
|
2003-08-22 03:11:53 +00:00
|
|
|
device_t pci_find_bsf(uint8_t, uint8_t, uint8_t);
|
|
|
|
device_t pci_find_device(uint16_t, uint16_t);
|
2000-12-13 01:25:11 +00:00
|
|
|
#endif /* _SYS_BUS_H_ */
|
1995-02-01 22:56:55 +00:00
|
|
|
|
2000-12-13 01:25:11 +00:00
|
|
|
/*
|
|
|
|
* cdev switch for control device, initialised in generic PCI code
|
|
|
|
*/
|
|
|
|
extern struct cdevsw pcicdev;
|
1998-07-22 08:39:08 +00:00
|
|
|
|
2000-12-13 01:25:11 +00:00
|
|
|
/*
|
|
|
|
* List of all PCI devices, generation count for the list.
|
|
|
|
*/
|
2001-12-19 08:49:11 +00:00
|
|
|
STAILQ_HEAD(devlist, pci_devinfo);
|
|
|
|
|
|
|
|
extern struct devlist pci_devq;
|
2003-08-22 03:11:53 +00:00
|
|
|
extern uint32_t pci_generation;
|
1999-04-24 19:59:20 +00:00
|
|
|
|
1998-09-15 08:21:13 +00:00
|
|
|
#endif /* _PCIVAR_H_ */
|