From db5c5815bd6593bd6c0a571fa39ba56ed9ed40b2 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Thu, 13 Nov 2008 21:46:03 +0000 Subject: [PATCH] Some mdoc cleanup: Improve markup, adjust list width. --- share/man/man4/pci.4 | 190 +++++++++++++++++++++++-------------------- 1 file changed, 102 insertions(+), 88 deletions(-) diff --git a/share/man/man4/pci.4 b/share/man/man4/pci.4 index a7b54cb9c7..2889a24969 100644 --- a/share/man/man4/pci.4 +++ b/share/man/man4/pci.4 @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: src/share/man/man4/pci.4,v 1.3.2.5 2001/08/17 13:08:39 ru Exp $ -.\" $DragonFly: src/share/man/man4/pci.4,v 1.4 2008/05/02 02:05:05 swildner Exp $ +.\" $DragonFly: src/share/man/man4/pci.4,v 1.5 2008/11/13 21:46:03 swildner Exp $ .\" .Dd October 24, 1999 .Dt PCI 4 @@ -38,8 +38,8 @@ The .Nm driver provides a way for userland programs to read and write .Tn PCI -configuration registers. It also provides a way for userland programs to -get a list of all +configuration registers. +It also provides a way for userland programs to get a list of all .Tn PCI devices, or all .Tn PCI @@ -52,12 +52,14 @@ driver provides a write interface for configuration registers, system administrators should exercise caution when granting access to the .Nm -device. If used improperly, this driver can allow userland applications to +device. +If used improperly, this driver can allow userland applications to crash a machine or cause data loss. .Sh KERNEL CONFIGURATION It is only necessary to specify one .Nm -controller in the kernel. Additional +controller in the kernel. +Additional .Tn PCI busses are handled automatically as they are encountered. .Sh IOCTLS @@ -65,15 +67,17 @@ The following .Xr ioctl 2 calls are supported by the .Nm -driver. They are defined in the header file +driver. +They are defined in the header file .In sys/pciio.h . -.Bl -tag -width 012345678901234 -.It PCIOCGETCONF +.Bl -tag -width ".It Dv PCIOCGETCONF" +.It Dv PCIOCGETCONF This .Xr ioctl 2 takes a .Va pci_conf_io -structure. It allows the user to retrieve information on all +structure. +It allows the user to retrieve information on all .Tn PCI devices in the system, or on .Tn PCI @@ -81,182 +85,191 @@ devices matching patterns supplied by the user. The .Va pci_conf_io structure consists of a number of fields: -.Bl -tag -width match_buf_len -.It pat_buf_len +.Bl -tag -width ".Fa match_buf_len" +.It Fa pat_buf_len The length, in bytes, of the buffer filled with user-supplied patterns. -.It num_patterns +.It Fa num_patterns The number of user-supplied patterns. -.It patterns +.It Fa patterns Pointer to a buffer filled with user-supplied patterns. -.Va patterns +.Fa patterns is a pointer to .Va num_patterns -.Va pci_match_conf -structures. The -.Va pci_match_conf +.Vt pci_match_conf +structures. +The +.Vt pci_match_conf structure consists of the following elements: -.Bl -tag -width pd_vendor -.It pc_sel +.Bl -tag -width ".Fa pd_vendor" +.It Fa pc_sel .Tn PCI bus, slot and function. -.It pd_name +.It Fa pd_name .Tn PCI device driver name. -.It pd_unit +.It Fa pd_unit .Tn PCI device driver unit number. -.It pc_vendor +.It Fa pc_vendor .Tn PCI vendor ID. -.It pc_device +.It Fa pc_device .Tn PCI device ID. -.It pc_class +.It Fa pc_class .Tn PCI device class. -.It flags +.It Fa flags The flags describe which of the fields the kernel should match against. -A device must match all specified fields in order to be returned. The -match flags are enumerated in the -.Va pci_getconf_flags +A device must match all specified fields in order to be returned. +The match flags are enumerated in the +.Vt pci_getconf_flags structure. Hopefully the flag values are obvious enough that they don't need to described in detail. .El -.It match_buf_len +.It Fa match_buf_len Length of the -.Va matches +.Fa matches buffer allocated by the user to hold the results of the .Dv PCIOCGETCONF query. -.It num_matches +.It Fa num_matches Number of matches returned by the kernel. -.It matches -Buffer containing matching devices returned by the kernel. The items in -this buffer are of type -.Va pci_conf , +.It Fa matches +Buffer containing matching devices returned by the kernel. +The items in this buffer are of type +.Vt pci_conf , which consists of the following items: -.Bl -tag -width pc_subvendor -.It pc_sel +.Bl -tag -width ".Fa pc_subvendor" +.It Fa pc_sel .Tn PCI bus, slot and function. -.It pc_hdr +.It Fa pc_hdr .Tn PCI header type. -.It pc_subvendor +.It Fa pc_subvendor .Tn PCI subvendor ID. -.It pc_subdevice +.It Fa pc_subdevice .Tn PCI subdevice ID. -.It pc_vendor +.It Fa pc_vendor .Tn PCI vendor ID. -.It pc_device +.It Fa pc_device .Tn PCI device ID. -.It pc_class +.It Fa pc_class .Tn PCI device class. -.It pc_subclass +.It Fa pc_subclass .Tn PCI device subclass. -.It pc_progif +.It Fa pc_progif .Tn PCI device programming interface. -.It pc_revid +.It Fa pc_revid .Tn PCI revision ID. -.It pd_name +.It Fa pd_name Driver name. -.It pd_unit +.It Fa pd_unit Driver unit number. .El -.It offset +.It Fa offset The offset is passed in by the user to tell the kernel where it should -start traversing the device list. The value passed out by the kernel -points to the record immediately after the last one returned. The user may +start traversing the device list. +The value passed out by the kernel +points to the record immediately after the last one returned. +The user may pass the value returned by the kernel in subsequent calls to the .Dv PCIOCGETCONF -ioctl. If the user does not intend to use the offset, it must be set to -zero. -.It generation +ioctl. +If the user does not intend to use the offset, it must be set to zero. +.It Fa generation .Tn PCI -configuration generation. This value only needs to be set if the offset is -set. The kernel will compare the current generation number of its internal +configuration generation. +This value only needs to be set if the offset is set. +The kernel will compare the current generation number of its internal device list to the generation passed in by the user to determine whether its device list has changed since the user last called the .Dv PCIOCGETCONF -ioctl. If the device list has changed, a status of -.Va PCI_GETCONF_LIST_CHANGED +ioctl. +If the device list has changed, a status of +.Dv PCI_GETCONF_LIST_CHANGED will be passed back. -.It status +.It Fa status The status tells the user the disposition of his request for a device list. The possible status values are: .Bl -ohang -.It PCI_GETCONF_LAST_DEVICE +.It Dv PCI_GETCONF_LAST_DEVICE This means that there are no more devices in the PCI device list after the ones returned in the -.Va matches +.Fa matches buffer. -.It PCI_GETCONF_LIST_CHANGED +.It Dv PCI_GETCONF_LIST_CHANGED This status tells the user that the .Tn PCI device list has changed since his last call to the .Dv PCIOCGETCONF ioctl and he must reset the -.Va offset +.Fa offset and -.Va generation +.Fa generation to zero to start over at the beginning of the list. -.It PCI_GETCONF_MORE_DEVS +.It Dv PCI_GETCONF_MORE_DEVS This tells the user that his buffer was not large enough to hold all of the -remaining devices in the device list that possibly match his criteria. It -is possible for this status to be returned, even when none of the remaining +remaining devices in the device list that possibly match his criteria. +It is possible for this status to be returned, even when none of the remaining devices in the list would match the user's criteria. -.It PCI_GETCONF_ERROR -This indicates a general error while servicing the user's request. A more +.It Dv PCI_GETCONF_ERROR +This indicates a general error while servicing the user's request. +A more specific indication of the problem may or may not be printed in the kernel message buffer (and by implication, the system console). .El .El -.It PCIOCREAD +.It Dv PCIOCREAD This .Xr ioctl 2 reads the .Tn PCI configuration registers specified by the passed-in -.Va pci_io -structure. The -.Va pci_io +.Vt pci_io +structure. +The +.Vt pci_io structure consists of the following fields: -.Bl -tag -width pi_width -.It pi_sel +.Bl -tag -width ".Fa pi_width" +.It Fa pi_sel A -.Va pcisel +.Vt pcisel structure which specifies the bus, slot and function the user would like to query. -.It pi_reg +.It Fa pi_reg The .Tn PCI configuration register the user would like to access. -.It pi_width -The width, in bytes, of the data the user would like to read. This value -may be either 1, 2, or 4. 3-byte reads and reads larger than 4 bytes are -not supported. -.It pi_data +.It Fa pi_width +The width, in bytes, of the data the user would like to read. +This value may be either 1, 2, or 4. +3-byte reads and reads larger than 4 bytes are not supported. +.It Fa pi_data The data returned by the kernel. .El -.It PCIOCWRITE +.It Dv PCIOCWRITE This .Xr ioctl 2 allows users to write to the .Tn PCI specified in the passed-in -.Va pci_io -structure. The -.Va pci_io -structure is described above. The limitations on data width described for +.Vt pci_io +structure. +The +.Vt pci_io +structure is described above. +The limitations on data width described for reading registers, above, also apply to writing .Tn PCI configuration registers. @@ -290,6 +303,7 @@ It isn't possible for users to specify an accurate offset into the device list without calling the .Dv PCIOCGETCONF at least once, since they have no way of knowing the current generation -number otherwise. This probably isn't a serious problem, though, since +number otherwise. +This probably isn't a serious problem, though, since users can easily narrow their search by specifying a pattern or patterns for the kernel to match against. -- 2.41.0