summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2007-09-30 11:05:18 +0000
committermarius <marius@FreeBSD.org>2007-09-30 11:05:18 +0000
commitd60b8a3096c2760d921f7f4b6e99280cb82f8c7b (patch)
tree8043b70223b1a26b9d8903a04633a168390b18dc /share
parent9ea9e12f35ecb014cf0a8b5047b850605706741b (diff)
downloadFreeBSD-src-d60b8a3096c2760d921f7f4b6e99280cb82f8c7b.zip
FreeBSD-src-d60b8a3096c2760d921f7f4b6e99280cb82f8c7b.tar.gz
Make the PCI code aware of PCI domains (aka PCI segments) so we can
support machines having multiple independently numbered PCI domains and don't support reenumeration without ambiguity amongst the devices as seen by the OS and represented by PCI location strings. This includes introducing a function pci_find_dbsf(9) which works like pci_find_bsf(9) but additionally takes a domain number argument and limiting pci_find_bsf(9) to only search devices in domain 0 (the only domain in single-domain systems). Bge(4) and ofw_pcibus(4) are changed to use pci_find_dbsf(9) instead of pci_find_bsf(9) in order to no longer report false positives when searching for siblings and dupe devices in the same domain respectively. Along with this change the sole host-PCI bridge driver converted to actually make use of PCI domain support is uninorth(4), the others continue to use domain 0 only for now and need to be converted as appropriate later on. Note that this means that the format of the location strings as used by pciconf(8) has been changed and that consumers of <sys/pciio.h> potentially need to be recompiled. Suggested by: jhb Reviewed by: grehan, jhb, marcel Approved by: re (kensmith), jhb (PCI maintainer hat)
Diffstat (limited to 'share')
-rw-r--r--share/man/man4/pci.413
-rw-r--r--share/man/man9/pci.929
2 files changed, 35 insertions, 7 deletions
diff --git a/share/man/man4/pci.4 b/share/man/man4/pci.4
index db03d91..dd77630 100644
--- a/share/man/man4/pci.4
+++ b/share/man/man4/pci.4
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 24, 1999
+.Dd September 30, 2007
.Dt PCI 4
.Os
.Sh NAME
@@ -109,7 +109,7 @@ structure consists of the following elements:
.Bl -tag -width pd_vendor
.It pc_sel
.Tn PCI
-bus, slot and function.
+domain, bus, slot and function.
.It pd_name
.Tn PCI
device driver name.
@@ -150,7 +150,7 @@ which consists of the following items:
.Bl -tag -width pc_subvendor
.It pc_sel
.Tn PCI
-bus, slot and function.
+domain, bus, slot and function.
.It pc_hdr
.Tn PCI
header type.
@@ -257,9 +257,10 @@ structure consists of the following fields:
.It pi_sel
A
.Va pcisel
-structure which specifies the bus, slot and function the user would like to
-query.
-If the specific bus is not found, errno will be set to ENODEV and -1 returned from the ioctl.
+structure which specifies the domain, bus, slot and function the user would
+like to query.
+If the specific bus is not found, errno will be set to ENODEV and -1 returned
+from the ioctl.
.It pi_reg
The
.Tn PCI
diff --git a/share/man/man9/pci.9 b/share/man/man9/pci.9
index 781614c..21dfbbe 100644
--- a/share/man/man9/pci.9
+++ b/share/man/man9/pci.9
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 22, 2005
+.Dd September 30, 2007
.Dt PCI 9
.Os
.Sh NAME
@@ -39,6 +39,7 @@
.Nm pci_set_powerstate ,
.Nm pci_get_powerstate ,
.Nm pci_find_bsf ,
+.Nm pci_find_dbsf ,
.Nm pci_find_device
.Nd PCI bus interface
.Sh SYNOPSIS
@@ -65,6 +66,8 @@
.Ft device_t
.Fn pci_find_bsf "uint8_t bus" "uint8_t slot" "uint8_t func"
.Ft device_t
+.Fn pci_find_dbsf "uint32_t domain" "uint8_t bus" "uint8_t slot" "uint8_t func"
+.Ft device_t
.Fn pci_find_device "uint16_t vendor" "uint16_t device"
.Sh DESCRIPTION
The
@@ -198,6 +201,30 @@ The
number actually refers to the number of the device on the bus,
which does not necessarily indicate its geographic location
in terms of a physical slot.
+Note that in case the system has multiple PCI domains,
+the
+.Fn pci_find_bsf
+function only searches the first one.
+Actually, it is equivalent to:
+.Bd -literal -offset indent
+pci_find_dbsf(0, bus, slot, func);
+.Ed
+.Pp
+The
+.Fn pci_find_dbsf
+function looks up the
+.Vt device_t
+of a PCI device, given its
+.Fa domain ,
+.Fa bus ,
+.Fa slot ,
+and
+.Fa func .
+The
+.Fa slot
+number actually refers to the number of the device on the bus,
+which does not necessarily indicate its geographic location
+in terms of a physical slot.
.Pp
The
.Fn pci_find_device
OpenPOWER on IntegriCloud