xref: /freebsd/share/man/man4/pci.4 (revision cc05f8de571dcb9f8c64a4151d7a5567873295e3)
164ae346bSKenneth D. Merry.\"
264ae346bSKenneth D. Merry.\" Copyright (c) 1999 Kenneth D. Merry.
364ae346bSKenneth D. Merry.\" All rights reserved.
464ae346bSKenneth D. Merry.\"
564ae346bSKenneth D. Merry.\" Redistribution and use in source and binary forms, with or without
664ae346bSKenneth D. Merry.\" modification, are permitted provided that the following conditions
764ae346bSKenneth D. Merry.\" are met:
864ae346bSKenneth D. Merry.\" 1. Redistributions of source code must retain the above copyright
964ae346bSKenneth D. Merry.\"    notice, this list of conditions and the following disclaimer.
1064ae346bSKenneth D. Merry.\" 2. The name of the author may not be used to endorse or promote products
1164ae346bSKenneth D. Merry.\"    derived from this software without specific prior written permission.
1264ae346bSKenneth D. Merry.\"
1364ae346bSKenneth D. Merry.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1464ae346bSKenneth D. Merry.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1564ae346bSKenneth D. Merry.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1664ae346bSKenneth D. Merry.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1764ae346bSKenneth D. Merry.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1864ae346bSKenneth D. Merry.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1964ae346bSKenneth D. Merry.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2064ae346bSKenneth D. Merry.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2164ae346bSKenneth D. Merry.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2264ae346bSKenneth D. Merry.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2364ae346bSKenneth D. Merry.\" SUCH DAMAGE.
2464ae346bSKenneth D. Merry.\"
25*cc05f8deSNavdeep Parhar.Dd April 2, 2025
2664ae346bSKenneth D. Merry.Dt PCI 4
273d45e180SRuslan Ermilov.Os
2864ae346bSKenneth D. Merry.Sh NAME
2964ae346bSKenneth D. Merry.Nm pci
3085ae35efSKonstantin Belousov.Nd generic PCI/PCIe bus driver
31251c176fSRuslan Ermilov.Sh SYNOPSIS
32c97a3872SJohn BaldwinTo compile the PCI bus driver into the kernel,
33c97a3872SJohn Baldwinplace the following line in your
34c97a3872SJohn Baldwinkernel configuration file:
35c97a3872SJohn Baldwin.Bd -ragged -offset indent
366b713d58SJeroen Ruigrok van der Werven.Cd device pci
37c97a3872SJohn Baldwin.Ed
38c97a3872SJohn Baldwin.Pp
39c97a3872SJohn BaldwinTo compile in support for Single Root I/O Virtualization
40c97a3872SJohn Baldwin.Pq SR-IOV :
41c97a3872SJohn Baldwin.Bd -ragged -offset indent
42c97a3872SJohn Baldwin.Cd options PCI_IOV
43c97a3872SJohn Baldwin.Ed
44c97a3872SJohn Baldwin.Pp
45c97a3872SJohn BaldwinTo compile in support for native PCI-express HotPlug:
46c97a3872SJohn Baldwin.Bd -ragged -offset indent
47c97a3872SJohn Baldwin.Cd options PCI_HP
48c97a3872SJohn Baldwin.Ed
4964ae346bSKenneth D. Merry.Sh DESCRIPTION
5064ae346bSKenneth D. MerryThe
514b66483fSRuslan Ermilov.Nm
52c97a3872SJohn Baldwindriver provides support for
53c97a3872SJohn Baldwin.Tn PCI
5485ae35efSKonstantin Belousovand
5585ae35efSKonstantin Belousov.Tn PCIe
56c97a3872SJohn Baldwindevices in the kernel and limited access to
57c97a3872SJohn Baldwin.Tn PCI
58c97a3872SJohn Baldwindevices for userland.
59c97a3872SJohn Baldwin.Pp
60c97a3872SJohn BaldwinThe
61c97a3872SJohn Baldwin.Nm
62c97a3872SJohn Baldwindriver provides a
63c97a3872SJohn Baldwin.Pa /dev/pci
64c97a3872SJohn Baldwincharacter device that can be used by userland programs to read and write
6564ae346bSKenneth D. Merry.Tn PCI
66b5e7e999SRuslan Ermilovconfiguration registers.
67c97a3872SJohn BaldwinPrograms can also use this device to get a list of all
6864ae346bSKenneth D. Merry.Tn PCI
6964ae346bSKenneth D. Merrydevices, or all
7064ae346bSKenneth D. Merry.Tn PCI
7164ae346bSKenneth D. Merrydevices that match various patterns.
7264ae346bSKenneth D. Merry.Pp
7364ae346bSKenneth D. MerrySince the
744b66483fSRuslan Ermilov.Nm
7564ae346bSKenneth D. Merrydriver provides a write interface for
7664ae346bSKenneth D. Merry.Tn PCI
7764ae346bSKenneth D. Merryconfiguration registers, system administrators should exercise caution when
7864ae346bSKenneth D. Merrygranting access to the
794b66483fSRuslan Ermilov.Nm
80b5e7e999SRuslan Ermilovdevice.
81b5e7e999SRuslan ErmilovIf used improperly, this driver can allow userland applications to
8264ae346bSKenneth D. Merrycrash a machine or cause data loss.
8385ae35efSKonstantin BelousovIn particular, driver only allows operations on the opened
8485ae35efSKonstantin Belousov.Pa /dev/pci
8585ae35efSKonstantin Belousovto modify system state if the file descriptor was opened for writing.
8685ae35efSKonstantin BelousovFor instance, the
8785ae35efSKonstantin Belousov.Dv PCIOCREAD
8885ae35efSKonstantin Belousovand
8985ae35efSKonstantin Belousov.Dv PCIOCBARMMAP
9085ae35efSKonstantin Belousovoperations require a writeable descriptor, because reading a config register
9185ae35efSKonstantin Belousovor a BAR read access could have function-specific side-effects.
920ade47aeSWarner Losh.Pp
930ade47aeSWarner LoshThe
944b66483fSRuslan Ermilov.Nm
95c0c7deaaSChristian Bruefferdriver implements the
96c0c7deaaSChristian Brueffer.Tn PCI
97c0c7deaaSChristian Bruefferbus in the kernel.
98c0c7deaaSChristian BruefferIt enumerates any devices on the
99c0c7deaaSChristian Brueffer.Tn PCI
100c0c7deaaSChristian Bruefferbus and gives
101c0c7deaaSChristian Brueffer.Tn PCI
102c0c7deaaSChristian Bruefferclient drivers the chance to attach to them.
103c0c7deaaSChristian BruefferIt assigns resources to children, when the BIOS does not.
1040ade47aeSWarner LoshIt takes care of routing interrupts when necessary.
105c0c7deaaSChristian BruefferIt reprobes the unattached
106c0c7deaaSChristian Brueffer.Tn PCI
107c0c7deaaSChristian Bruefferchildren when
108c0c7deaaSChristian Brueffer.Tn PCI
109c0c7deaaSChristian Bruefferclient drivers are dynamically
1100ade47aeSWarner Loshloaded at runtime.
1110ade47aeSWarner LoshThe
1120ade47aeSWarner Losh.Nm
113c97a3872SJohn Baldwindriver also includes support for PCI-PCI bridges,
114c97a3872SJohn Baldwinvarious platform-specific Host-PCI bridges,
115c97a3872SJohn Baldwinand basic support for
116c97a3872SJohn Baldwin.Tn PCI
117c97a3872SJohn BaldwinVGA adapters.
11864ae346bSKenneth D. Merry.Sh IOCTLS
11964ae346bSKenneth D. MerryThe following
12064ae346bSKenneth D. Merry.Xr ioctl 2
12164ae346bSKenneth D. Merrycalls are supported by the
1224b66483fSRuslan Ermilov.Nm
123b5e7e999SRuslan Ermilovdriver.
124b5e7e999SRuslan ErmilovThey are defined in the header file
125fe08efe6SRuslan Ermilov.In sys/pciio.h .
12664ae346bSKenneth D. Merry.Bl -tag -width 012345678901234
12764ae346bSKenneth D. Merry.It PCIOCGETCONF
12864ae346bSKenneth D. MerryThis
12964ae346bSKenneth D. Merry.Xr ioctl 2
13064ae346bSKenneth D. Merrytakes a
13164ae346bSKenneth D. Merry.Va pci_conf_io
132b5e7e999SRuslan Ermilovstructure.
133b5e7e999SRuslan ErmilovIt allows the user to retrieve information on all
13464ae346bSKenneth D. Merry.Tn PCI
13564ae346bSKenneth D. Merrydevices in the system, or on
13664ae346bSKenneth D. Merry.Tn PCI
1375203edcdSRuslan Ermilovdevices matching patterns supplied by the user.
1385203edcdSRuslan ErmilovThe call may set
13907e3ed79SJohn-Mark Gurney.Va errno
14007e3ed79SJohn-Mark Gurneyto any value specified in either
14107e3ed79SJohn-Mark Gurney.Xr copyin 9
14207e3ed79SJohn-Mark Gurneyor
14307e3ed79SJohn-Mark Gurney.Xr copyout 9 .
14464ae346bSKenneth D. MerryThe
14564ae346bSKenneth D. Merry.Va pci_conf_io
14664ae346bSKenneth D. Merrystructure consists of a number of fields:
14764ae346bSKenneth D. Merry.Bl -tag -width match_buf_len
14864ae346bSKenneth D. Merry.It pat_buf_len
14964ae346bSKenneth D. MerryThe length, in bytes, of the buffer filled with user-supplied patterns.
15064ae346bSKenneth D. Merry.It num_patterns
15164ae346bSKenneth D. MerryThe number of user-supplied patterns.
15264ae346bSKenneth D. Merry.It patterns
15364ae346bSKenneth D. MerryPointer to a buffer filled with user-supplied patterns.
15464ae346bSKenneth D. Merry.Va patterns
15564ae346bSKenneth D. Merryis a pointer to
15664ae346bSKenneth D. Merry.Va num_patterns
15764ae346bSKenneth D. Merry.Va pci_match_conf
1585203edcdSRuslan Ermilovstructures.
1595203edcdSRuslan ErmilovThe
16064ae346bSKenneth D. Merry.Va pci_match_conf
16164ae346bSKenneth D. Merrystructure consists of the following elements:
16264ae346bSKenneth D. Merry.Bl -tag -width pd_vendor
16364ae346bSKenneth D. Merry.It pc_sel
16464ae346bSKenneth D. Merry.Tn PCI
16555aaf894SMarius Strobldomain, bus, slot and function.
16664ae346bSKenneth D. Merry.It pd_name
16764ae346bSKenneth D. Merry.Tn PCI
16864ae346bSKenneth D. Merrydevice driver name.
16964ae346bSKenneth D. Merry.It pd_unit
17064ae346bSKenneth D. Merry.Tn PCI
17164ae346bSKenneth D. Merrydevice driver unit number.
17264ae346bSKenneth D. Merry.It pc_vendor
17364ae346bSKenneth D. Merry.Tn PCI
17464ae346bSKenneth D. Merryvendor ID.
17564ae346bSKenneth D. Merry.It pc_device
17664ae346bSKenneth D. Merry.Tn PCI
17764ae346bSKenneth D. Merrydevice ID.
17864ae346bSKenneth D. Merry.It pc_class
17964ae346bSKenneth D. Merry.Tn PCI
18064ae346bSKenneth D. Merrydevice class.
18164ae346bSKenneth D. Merry.It flags
18264ae346bSKenneth D. MerryThe flags describe which of the fields the kernel should match against.
183b5e7e999SRuslan ErmilovA device must match all specified fields in order to be returned.
184b5e7e999SRuslan ErmilovThe match flags are enumerated in the
18564ae346bSKenneth D. Merry.Va pci_getconf_flags
18664ae346bSKenneth D. Merrystructure.
1870227791bSRuslan ErmilovHopefully the flag values are obvious enough that they do not need to
18864ae346bSKenneth D. Merrydescribed in detail.
18964ae346bSKenneth D. Merry.El
19064ae346bSKenneth D. Merry.It match_buf_len
19164ae346bSKenneth D. MerryLength of the
19264ae346bSKenneth D. Merry.Va matches
19364ae346bSKenneth D. Merrybuffer allocated by the user to hold the results of the
19464ae346bSKenneth D. Merry.Dv PCIOCGETCONF
19564ae346bSKenneth D. Merryquery.
19664ae346bSKenneth D. Merry.It num_matches
19764ae346bSKenneth D. MerryNumber of matches returned by the kernel.
19864ae346bSKenneth D. Merry.It matches
199b5e7e999SRuslan ErmilovBuffer containing matching devices returned by the kernel.
200b5e7e999SRuslan ErmilovThe items in this buffer are of type
20164ae346bSKenneth D. Merry.Va pci_conf ,
20264ae346bSKenneth D. Merrywhich consists of the following items:
20364ae346bSKenneth D. Merry.Bl -tag -width pc_subvendor
20464ae346bSKenneth D. Merry.It pc_sel
20564ae346bSKenneth D. Merry.Tn PCI
20655aaf894SMarius Strobldomain, bus, slot and function.
20764ae346bSKenneth D. Merry.It pc_hdr
20864ae346bSKenneth D. Merry.Tn PCI
20964ae346bSKenneth D. Merryheader type.
21064ae346bSKenneth D. Merry.It pc_subvendor
21164ae346bSKenneth D. Merry.Tn PCI
21264ae346bSKenneth D. Merrysubvendor ID.
21364ae346bSKenneth D. Merry.It pc_subdevice
21464ae346bSKenneth D. Merry.Tn PCI
21564ae346bSKenneth D. Merrysubdevice ID.
21664ae346bSKenneth D. Merry.It pc_vendor
21764ae346bSKenneth D. Merry.Tn PCI
21864ae346bSKenneth D. Merryvendor ID.
21964ae346bSKenneth D. Merry.It pc_device
22064ae346bSKenneth D. Merry.Tn PCI
22164ae346bSKenneth D. Merrydevice ID.
22264ae346bSKenneth D. Merry.It pc_class
22364ae346bSKenneth D. Merry.Tn PCI
22464ae346bSKenneth D. Merrydevice class.
22564ae346bSKenneth D. Merry.It pc_subclass
22664ae346bSKenneth D. Merry.Tn PCI
22764ae346bSKenneth D. Merrydevice subclass.
22864ae346bSKenneth D. Merry.It pc_progif
22964ae346bSKenneth D. Merry.Tn PCI
23064ae346bSKenneth D. Merrydevice programming interface.
23164ae346bSKenneth D. Merry.It pc_revid
23264ae346bSKenneth D. Merry.Tn PCI
23364ae346bSKenneth D. Merryrevision ID.
23464ae346bSKenneth D. Merry.It pd_name
23564ae346bSKenneth D. MerryDriver name.
23664ae346bSKenneth D. Merry.It pd_unit
23764ae346bSKenneth D. MerryDriver unit number.
23864ae346bSKenneth D. Merry.El
23964ae346bSKenneth D. Merry.It offset
24064ae346bSKenneth D. MerryThe offset is passed in by the user to tell the kernel where it should
241b5e7e999SRuslan Ermilovstart traversing the device list.
242b5e7e999SRuslan ErmilovThe value passed out by the kernel
243b5e7e999SRuslan Ermilovpoints to the record immediately after the last one returned.
244b5e7e999SRuslan ErmilovThe user may
24564ae346bSKenneth D. Merrypass the value returned by the kernel in subsequent calls to the
24664ae346bSKenneth D. Merry.Dv PCIOCGETCONF
247b5e7e999SRuslan Ermilovioctl.
248b5e7e999SRuslan ErmilovIf the user does not intend to use the offset, it must be set to zero.
24964ae346bSKenneth D. Merry.It generation
25064ae346bSKenneth D. Merry.Tn PCI
251b5e7e999SRuslan Ermilovconfiguration generation.
252b5e7e999SRuslan ErmilovThis value only needs to be set if the offset is set.
253b5e7e999SRuslan ErmilovThe kernel will compare the current generation number of its internal
25464ae346bSKenneth D. Merrydevice list to the generation passed in by the user to determine whether
25564ae346bSKenneth D. Merryits device list has changed since the user last called the
25664ae346bSKenneth D. Merry.Dv PCIOCGETCONF
257b5e7e999SRuslan Ermilovioctl.
258b5e7e999SRuslan ErmilovIf the device list has changed, a status of
25964ae346bSKenneth D. Merry.Va PCI_GETCONF_LIST_CHANGED
26064ae346bSKenneth D. Merrywill be passed back.
26164ae346bSKenneth D. Merry.It status
26264ae346bSKenneth D. MerryThe status tells the user the disposition of his request for a device list.
26364ae346bSKenneth D. MerryThe possible status values are:
26464ae346bSKenneth D. Merry.Bl -ohang
26564ae346bSKenneth D. Merry.It PCI_GETCONF_LAST_DEVICE
26610012d53SJohn BaldwinThis means that there are no more devices in the PCI device list matching
26710012d53SJohn Baldwinthe specified criteria after the
26864ae346bSKenneth D. Merryones returned in the
26964ae346bSKenneth D. Merry.Va matches
27064ae346bSKenneth D. Merrybuffer.
27164ae346bSKenneth D. Merry.It PCI_GETCONF_LIST_CHANGED
27264ae346bSKenneth D. MerryThis status tells the user that the
27364ae346bSKenneth D. Merry.Tn PCI
27464ae346bSKenneth D. Merrydevice list has changed since his last call to the
27564ae346bSKenneth D. Merry.Dv PCIOCGETCONF
27664ae346bSKenneth D. Merryioctl and he must reset the
27764ae346bSKenneth D. Merry.Va offset
27864ae346bSKenneth D. Merryand
27964ae346bSKenneth D. Merry.Va generation
28064ae346bSKenneth D. Merryto zero to start over at the beginning of the list.
28164ae346bSKenneth D. Merry.It PCI_GETCONF_MORE_DEVS
28264ae346bSKenneth D. MerryThis tells the user that his buffer was not large enough to hold all of the
28310012d53SJohn Baldwinremaining devices in the device list that match his criteria.
28464ae346bSKenneth D. Merry.It PCI_GETCONF_ERROR
285b5e7e999SRuslan ErmilovThis indicates a general error while servicing the user's request.
286b5e7e999SRuslan ErmilovIf the
28707e3ed79SJohn-Mark Gurney.Va pat_buf_len
28807e3ed79SJohn-Mark Gurneyis not equal to
28907e3ed79SJohn-Mark Gurney.Va num_patterns
29007e3ed79SJohn-Mark Gurneytimes
291b5e7e999SRuslan Ermilov.Fn sizeof "struct pci_match_conf" ,
292b5e7e999SRuslan Ermilov.Va errno
293b5e7e999SRuslan Ermilovwill be set to
294b5e7e999SRuslan Ermilov.Er EINVAL .
29564ae346bSKenneth D. Merry.El
29664ae346bSKenneth D. Merry.El
29764ae346bSKenneth D. Merry.It PCIOCREAD
29864ae346bSKenneth D. MerryThis
29964ae346bSKenneth D. Merry.Xr ioctl 2
30064ae346bSKenneth D. Merryreads the
30164ae346bSKenneth D. Merry.Tn PCI
302f1bb9412SNiclas Zeisingconfiguration registers specified by the passed-in
30364ae346bSKenneth D. Merry.Va pci_io
3045203edcdSRuslan Ermilovstructure.
3055203edcdSRuslan ErmilovThe
30664ae346bSKenneth D. Merry.Va pci_io
30764ae346bSKenneth D. Merrystructure consists of the following fields:
30864ae346bSKenneth D. Merry.Bl -tag -width pi_width
30964ae346bSKenneth D. Merry.It pi_sel
31064ae346bSKenneth D. MerryA
31164ae346bSKenneth D. Merry.Va pcisel
31255aaf894SMarius Stroblstructure which specifies the domain, bus, slot and function the user would
31355aaf894SMarius Strobllike to query.
31455aaf894SMarius StroblIf the specific bus is not found, errno will be set to ENODEV and -1 returned
31555aaf894SMarius Stroblfrom the ioctl.
31664ae346bSKenneth D. Merry.It pi_reg
31764ae346bSKenneth D. MerryThe
31864ae346bSKenneth D. Merry.Tn PCI
3192d4a74d7SNiclas Zeisingconfiguration registers the user would like to access.
32064ae346bSKenneth D. Merry.It pi_width
321b5e7e999SRuslan ErmilovThe width, in bytes, of the data the user would like to read.
322b5e7e999SRuslan ErmilovThis value
3235203edcdSRuslan Ermilovmay be either 1, 2, or 4.
3245203edcdSRuslan Ermilov3-byte reads and reads larger than 4 bytes are
3255203edcdSRuslan Ermilovnot supported.
3265203edcdSRuslan ErmilovIf an invalid width is passed, errno will be set to EINVAL.
32764ae346bSKenneth D. Merry.It pi_data
32864ae346bSKenneth D. MerryThe data returned by the kernel.
32964ae346bSKenneth D. Merry.El
33064ae346bSKenneth D. Merry.It PCIOCWRITE
33164ae346bSKenneth D. MerryThis
33264ae346bSKenneth D. Merry.Xr ioctl 2
33364ae346bSKenneth D. Merryallows users to write to the
33464ae346bSKenneth D. Merry.Tn PCI
3352d4a74d7SNiclas Zeisingconfiguration registers specified in the passed-in
33664ae346bSKenneth D. Merry.Va pci_io
3375203edcdSRuslan Ermilovstructure.
3385203edcdSRuslan ErmilovThe
33964ae346bSKenneth D. Merry.Va pci_io
340b5e7e999SRuslan Ermilovstructure is described above.
341b5e7e999SRuslan ErmilovThe limitations on data width described for
34264ae346bSKenneth D. Merryreading registers, above, also apply to writing
34364ae346bSKenneth D. Merry.Tn PCI
34464ae346bSKenneth D. Merryconfiguration registers.
34565d328a3SNiclas Zeising.It PCIOCATTACHED
34665d328a3SNiclas ZeisingThis
34765d328a3SNiclas Zeising.Xr ioctl 2
34865d328a3SNiclas Zeisingallows users to query if a driver is attached to the
34965d328a3SNiclas Zeising.Tn PCI
350999546e1SNiclas Zeisingdevice specified in the passed-in
35165d328a3SNiclas Zeising.Va pci_io
35265d328a3SNiclas Zeisingstructure.
35365d328a3SNiclas ZeisingThe
35465d328a3SNiclas Zeising.Va pci_io
35565d328a3SNiclas Zeisingstructure is described above, however, the
35665d328a3SNiclas Zeising.Va pi_reg
35765d328a3SNiclas Zeisingand
35865d328a3SNiclas Zeising.Va pi_width
35965d328a3SNiclas Zeisingfields are not used.
36065d328a3SNiclas ZeisingThe status of the device is stored in the
36165d328a3SNiclas Zeising.Va pi_data
36265d328a3SNiclas Zeisingfield.
36365d328a3SNiclas ZeisingA value of 0 indicates no driver is attached, while a value larger than 0
36465d328a3SNiclas Zeisingindicates that a driver is attached.
36587842989SKonstantin Belousov.It PCIOCBARMMAP
36687842989SKonstantin BelousovThis
36787842989SKonstantin Belousov.Xr ioctl 2
36887842989SKonstantin Belousovcommand allows userspace processes to
36987842989SKonstantin Belousov.Xr mmap 2
37087842989SKonstantin Belousovthe memory-mapped PCI BAR into its address space.
37187842989SKonstantin BelousovThe input parameters and results are passed in the
37287842989SKonstantin Belousov.Va pci_bar_mmap
37387842989SKonstantin Belousovstructure, which has the following fields:
37487842989SKonstantin Belousov.Bl -tag -width Vt struct pcise pbm_sel
375*cc05f8deSNavdeep Parhar.It Vt void *pbm_map_base
37687842989SKonstantin BelousovReports the established mapping base to the caller.
37787842989SKonstantin BelousovIf
37887842989SKonstantin Belousov.Va PCIIO_BAR_MMAP_FIXED
37987842989SKonstantin Belousovflag was specified, then this field must be filled before the call
38087842989SKonstantin Belousovwith the desired address for the mapping.
381*cc05f8deSNavdeep Parhar.It Vt size_t pbm_map_length
38287842989SKonstantin BelousovReports the mapped length of the BAR, in bytes.
383*cc05f8deSNavdeep ParharIts
384*cc05f8deSNavdeep Parhar.Vt size_t
385*cc05f8deSNavdeep Parharvalue is always multiple of machine pages.
386*cc05f8deSNavdeep Parhar.It Vt uint64_t pbm_bar_length
38787842989SKonstantin BelousovReports length of the bar as exposed by the device.
38887842989SKonstantin Belousov.It Vt int pbm_bar_off
38987842989SKonstantin BelousovReports offset from the mapped base to the start of the
39087842989SKonstantin Belousovfirst register in the bar.
39187842989SKonstantin Belousov.It Vt struct pcisel pbm_sel
39287842989SKonstantin BelousovShould be filled before the call.
39387842989SKonstantin BelousovDescribes the device to operate on.
39487842989SKonstantin Belousov.It Vt int pbm_reg
39587842989SKonstantin BelousovThe BAR index to mmap.
39687842989SKonstantin Belousov.It Vt int pbm_flags
39787842989SKonstantin BelousovFlags which augments the operation.
39887842989SKonstantin BelousovSee below.
39987842989SKonstantin Belousov.It Vt int pbm_memattr
40087842989SKonstantin BelousovThe caching attribute for the mapping.
40187842989SKonstantin BelousovTypical values are
40287842989SKonstantin Belousov.Dv VM_MEMATTR_UNCACHEABLE
40387842989SKonstantin Belousovfor control registers BARs, and
40487842989SKonstantin Belousov.Dv VM_MEMATTR_WRITE_COMBINING
40587842989SKonstantin Belousovfor frame buffers.
40687842989SKonstantin BelousovRegular memory-like BAR should be mapped with
40787842989SKonstantin Belousov.Dv VM_MEMATTR_DEFAULT
40887842989SKonstantin Belousovattribute.
40987842989SKonstantin Belousov.El
41087842989SKonstantin Belousov.Pp
41187842989SKonstantin BelousovCurrently defined flags are:
41287842989SKonstantin Belousov.Bl -tag -width PCIIO_BAR_MMAP_ACTIVATE
41387842989SKonstantin Belousov.It PCIIO_BAR_MMAP_FIXED
41487842989SKonstantin BelousovThe resulted mappings should be established at the address
41587842989SKonstantin Belousovspecified by the
41687842989SKonstantin Belousov.Va pbm_map_base
41787842989SKonstantin Belousovmember, otherwise fail.
41887842989SKonstantin Belousov.It PCIIO_BAR_MMAP_EXCL
41987842989SKonstantin BelousovMust be used together with
4201adc28f5SChristian Brueffer.Dv PCIIO_BAR_MMAP_FIXED
42187842989SKonstantin BelousovIf the specified base contains already established mappings, the
42287842989SKonstantin Belousovoperation fails instead of implicitly unmapping them.
42387842989SKonstantin Belousov.It PCIIO_BAR_MMAP_RW
42487842989SKonstantin BelousovThe requested mapping allows both reading and writing.
42587842989SKonstantin BelousovWithout the flag, read-only mapping is established.
42687842989SKonstantin BelousovNote that it is common for the device registers to have side-effects
42787842989SKonstantin Belousoveven on reads.
42887842989SKonstantin Belousov.It PCIIO_BAR_MMAP_ACTIVATE
42987842989SKonstantin Belousov(Unimplemented) If the BAR is not activated, activate it in the course
43087842989SKonstantin Belousovof mapping.
43187842989SKonstantin BelousovCurrently attempt to mmap an inactive BAR results in error.
43287842989SKonstantin Belousov.El
4337e14be0bSMark Johnston.It PCIOCBARIO
4347e14be0bSMark JohnstonThis
4357e14be0bSMark Johnston.Xr ioctl 2
4367e14be0bSMark Johnstoncommand allows users to read from and write to BARs.
4377e14be0bSMark JohnstonThe I/O request parameters are passed in a
4387e14be0bSMark Johnston.Va struct pci_bar_ioreq
4397e14be0bSMark Johnstonstructure, which has the following fields:
4407e14be0bSMark Johnston.Bl -tag
4417e14be0bSMark Johnston.It Vt struct pcisel pbi_sel
4427e14be0bSMark JohnstonDescribes the device to operate on.
4437e14be0bSMark Johnston.It Vt int pbi_op
4447e14be0bSMark JohnstonThe operation to perform.
4457e14be0bSMark JohnstonCurrently supported values are
4467e14be0bSMark Johnston.Dv PCIBARIO_READ
4477e14be0bSMark Johnstonand
4487e14be0bSMark Johnston.Dv PCIBARIO_WRITE .
4497e14be0bSMark Johnston.It Vt uint32_t pbi_bar
4507e14be0bSMark JohnstonThe index of the BAR on which to operate.
4517e14be0bSMark Johnston.It Vt uint32_t pbi_offset
4527e14be0bSMark JohnstonThe offset into the BAR at which to operate.
4537e14be0bSMark Johnston.It Vt uint32_t pbi_width
4547e14be0bSMark JohnstonThe size, in bytes, of the I/O operation.
4557e14be0bSMark Johnston1-byte, 2-byte, 4-byte and 8-byte perations are supported.
4567e14be0bSMark Johnston.It Vt uint32_t pbi_value
4577e14be0bSMark JohnstonFor reads, the value is returned in this field.
4587e14be0bSMark JohnstonFor writes, the caller specifies the value to be written in this field.
4597e14be0bSMark Johnston.Pp
4607e14be0bSMark JohnstonNote that this operation maps and unmaps the corresponding resource and
4617e14be0bSMark Johnstonso is relatively expensive for memory BARs.
4627e14be0bSMark JohnstonThe
4637e14be0bSMark Johnston.Va PCIOCBARMMAP
4647e14be0bSMark Johnston.Xr ioctl 2
4657e14be0bSMark Johnstoncan be used to create a persistent userspace mapping for such BARs instead.
4667e14be0bSMark Johnston.El
46764ae346bSKenneth D. Merry.El
468c97a3872SJohn Baldwin.Sh LOADER TUNABLES
469c97a3872SJohn BaldwinTunables can be set at the
470c97a3872SJohn Baldwin.Xr loader 8
471c97a3872SJohn Baldwinprompt before booting the kernel, or stored in
472c97a3872SJohn Baldwin.Xr loader.conf 5 .
473c97a3872SJohn BaldwinThe current value of these tunables can be examined at runtime via
474c97a3872SJohn Baldwin.Xr sysctl 8
475c97a3872SJohn Baldwinnodes of the same name.
476c97a3872SJohn BaldwinUnless otherwise specified,
477c97a3872SJohn Baldwineach of these tunables is a boolean that can be enabled by setting the
478c97a3872SJohn Baldwintunable to a non-zero value.
479c97a3872SJohn Baldwin.Bl -tag -width indent
480c97a3872SJohn Baldwin.It Va hw.pci.clear_bars Pq Defaults to 0
481c97a3872SJohn BaldwinIgnore any firmware-assigned memory and I/O port resources.
482c97a3872SJohn BaldwinThis forces the
483c97a3872SJohn Baldwin.Tn PCI
484c97a3872SJohn Baldwinbus driver to allocate resource ranges for memory and I/O port resources
485c97a3872SJohn Baldwinfrom scratch.
486c97a3872SJohn Baldwin.It Va hw.pci.clear_buses Pq Defaults to 0
487c97a3872SJohn BaldwinIgnore any firmware-assigned bus number registers in PCI-PCI bridges.
488c97a3872SJohn BaldwinThis forces the
489c97a3872SJohn Baldwin.Tn PCI
490c97a3872SJohn Baldwinbus driver and PCI-PCI bridge driver to allocate bus numbers for secondary
491c97a3872SJohn Baldwinbuses behind PCI-PCI bridges.
492c97a3872SJohn Baldwin.It Va hw.pci.clear_pcib Pq Defaults to 0
493c97a3872SJohn BaldwinIgnore any firmware-assigned memory and I/O port resource windows in PCI-PCI
494c97a3872SJohn Baldwinbridges.
495c97a3872SJohn BaldwinThis forces the PCI-PCI bridge driver to allocate memory and I/O port resources
496c97a3872SJohn Baldwinfor resource windows from scratch.
497c97a3872SJohn Baldwin.Pp
498c97a3872SJohn BaldwinBy default the PCI-PCI bridge driver will allocate windows that
499c97a3872SJohn Baldwincontain the firmware-assigned resources devices behind the bridge.
500c97a3872SJohn BaldwinIn addition, the PCI-PCI bridge driver will suballocate from existing window
501c97a3872SJohn Baldwinregions when possible to satisfy a resource request.
502c97a3872SJohn BaldwinAs a result,
503c97a3872SJohn Baldwinboth
504c97a3872SJohn Baldwin.Va hw.pci.clear_bars
505c97a3872SJohn Baldwinand
506c97a3872SJohn Baldwin.Va hw.pci.clear_pcib
507c97a3872SJohn Baldwinmust be enabled to fully ignore firmware-supplied resource assignments.
508c97a3872SJohn Baldwin.It Va hw.pci.default_vgapci_unit Pq Defaults to -1
509c97a3872SJohn BaldwinBy default,
510c97a3872SJohn Baldwinthe first
511c97a3872SJohn Baldwin.Tn PCI
512c97a3872SJohn BaldwinVGA adapter encountered by the system is assumed to be the boot display device.
513c97a3872SJohn BaldwinThis tunable can be set to choose a specific VGA adapter by specifying the
514c97a3872SJohn Baldwinunit number of the associated
515c97a3872SJohn Baldwin.Va vgapci Ns Ar X
516c97a3872SJohn Baldwindevice.
517c97a3872SJohn Baldwin.It Va hw.pci.do_power_nodriver Pq Defaults to 0
518c97a3872SJohn BaldwinPlace devices into a low power state
519c97a3872SJohn Baldwin.Pq D3
520c97a3872SJohn Baldwinwhen a suitable device driver is not found.
521c97a3872SJohn BaldwinCan be set to one of the following values:
522c97a3872SJohn Baldwin.Bl -tag -width indent
523c97a3872SJohn Baldwin.It 3
524c97a3872SJohn BaldwinPowers down all
525c97a3872SJohn Baldwin.Tn PCI
526c97a3872SJohn Baldwindevices without a device driver.
527c97a3872SJohn Baldwin.It 2
528c97a3872SJohn BaldwinPowers down most devices without a device driver.
529c97a3872SJohn BaldwinPCI devices with the display, memory, and base peripheral device classes
530c97a3872SJohn Baldwinare not powered down.
531c97a3872SJohn Baldwin.It 1
532c97a3872SJohn BaldwinSimilar to a setting of 2 except that storage controllers are also not
533c97a3872SJohn Baldwinpowered down.
534c97a3872SJohn Baldwin.It 0
535c97a3872SJohn BaldwinAll devices are left fully powered.
536c97a3872SJohn Baldwin.El
537c97a3872SJohn Baldwin.Pp
538c97a3872SJohn BaldwinA
539c97a3872SJohn Baldwin.Tn PCI
540c97a3872SJohn Baldwindevice must support power management to be powered down.
541c97a3872SJohn BaldwinPlacing a device into a low power state may not reduce power consumption.
542c97a3872SJohn Baldwin.It Va hw.pci.do_power_resume Pq Defaults to 1
543c97a3872SJohn BaldwinPlace
544c97a3872SJohn Baldwin.Tn PCI
545c97a3872SJohn Baldwindevices into the fully powered state when resuming either the system or an
546c97a3872SJohn Baldwinindividual device.
547c97a3872SJohn BaldwinSetting this to zero is discouraged as the system will not attempt to power
548c97a3872SJohn Baldwinup non-powered PCI devices after a suspend.
549c97a3872SJohn Baldwin.It Va hw.pci.do_power_suspend Pq Defaults to 1
550c97a3872SJohn BaldwinPlace
551c97a3872SJohn Baldwin.Tn PCI
552c97a3872SJohn Baldwindevices into a low power state when suspending either the system or individual
553c97a3872SJohn Baldwindevices.
554c97a3872SJohn BaldwinNormally the D3 state is used as the low power state,
555c97a3872SJohn Baldwinbut firmware may override the desired power state during a system suspend.
556c97a3872SJohn Baldwin.It Va hw.pci.enable_ari Pq Defaults to 1
557c97a3872SJohn BaldwinEnable support for PCI-express Alternative RID Interpretation.
558c97a3872SJohn BaldwinThis is often used in conjunction with SR-IOV.
559c97a3872SJohn Baldwin.It Va hw.pci.enable_io_modes Pq Defaults to 1
560c97a3872SJohn BaldwinEnable memory or I/O port decoding in a PCI device's command register if it has
561c97a3872SJohn Baldwinfirmware-assigned memory or I/O port resources.
562c97a3872SJohn BaldwinThe firmware
563c97a3872SJohn Baldwin.Pq BIOS
564c97a3872SJohn Baldwinin some systems does not enable memory or I/O port decoding for some devices
565c97a3872SJohn Baldwineven when it has assigned resources to the device.
566c97a3872SJohn BaldwinThis enables decoding for such resources during bus probe.
567c97a3872SJohn Baldwin.It Va hw.pci.enable_msi Pq Defaults to 1
568c97a3872SJohn BaldwinEnable support for Message Signalled Interrupts
569c97a3872SJohn Baldwin.Pq MSI .
570c97a3872SJohn BaldwinMSI interrupts can be disabled by setting this tunable to 0.
571c97a3872SJohn Baldwin.It Va hw.pci.enable_msix Pq Defaults to 1
572c97a3872SJohn BaldwinEnable support for extended Message Signalled Interrupts
573c97a3872SJohn Baldwin.Pq MSI-X .
574c97a3872SJohn BaldwinMSI-X interrupts can be disabled by setting this tunable to 0.
575a58536b9SAlexander Motin.It Va hw.pci.enable_pcie_ei Pq Defaults to 0
576a58536b9SAlexander MotinEnable support for PCI-express Electromechanical Interlock.
577c97a3872SJohn Baldwin.It Va hw.pci.enable_pcie_hp Pq Defaults to 1
578c97a3872SJohn BaldwinEnable support for native PCI-express HotPlug.
579c97a3872SJohn Baldwin.It Va hw.pci.honor_msi_blacklist Pq Defaults to 1
580c97a3872SJohn BaldwinMSI and MSI-X interrupts are disabled for certain chipsets known to have
581c97a3872SJohn Baldwinbroken MSI and MSI-X implementations when this tunable is set.
582c97a3872SJohn BaldwinIt can be set to zero to permit use of MSI and MSI-X interrupts if the
583c97a3872SJohn Baldwinchipset match is a false positive.
584c97a3872SJohn Baldwin.It Va hw.pci.iov_max_config Pq Defaults to 1MB
585c97a3872SJohn BaldwinThe maximum amount of memory permitted for the configuration parameters
586c97a3872SJohn Baldwinused when creating Virtual Functions via SR-IOV.
587c97a3872SJohn BaldwinThis tunable can also be changed at runtime via
588c97a3872SJohn Baldwin.Xr sysctl 8 .
589c97a3872SJohn Baldwin.It Va hw.pci.realloc_bars Pq Defaults to 0
590c97a3872SJohn BaldwinAttempt to allocate a new resource range during the initial device scan
591c97a3872SJohn Baldwinfor any memory or I/O port resources with firmware-assigned ranges that
592c97a3872SJohn Baldwinconflict with another active resource.
593c97a3872SJohn Baldwin.It Va hw.pci.usb_early_takeover Pq Defaults to 1 on Tn amd64 and Tn i386
594c97a3872SJohn BaldwinDisable legacy device emulation of USB devices during the initial device
595c97a3872SJohn Baldwinscan.
596c97a3872SJohn BaldwinSet this tunable to zero to use USB devices via legacy emulation when
597c97a3872SJohn Baldwinusing a custom kernel without USB controller drivers.
598c97a3872SJohn Baldwin.It Va hw.pci<D>.<B>.<S>.INT<P>.irq
599c97a3872SJohn BaldwinThese tunables can be used to override the interrupt routing for legacy
600c97a3872SJohn BaldwinPCI INTx interrupts.
601c97a3872SJohn BaldwinUnlike other tunables in this list,
602c97a3872SJohn Baldwinthese do not have corresponding sysctl nodes.
603c97a3872SJohn BaldwinThe tunable name includes the address of the PCI device as well as the
604c97a3872SJohn Baldwinpin of the desired INTx IRQ to override:
605c97a3872SJohn Baldwin.Bl -tag -width indent
606c97a3872SJohn Baldwin.It <D>
607c97a3872SJohn BaldwinThe domain
608c97a3872SJohn Baldwin.Pq or segment
609c97a3872SJohn Baldwinof the PCI device in decimal.
610c97a3872SJohn Baldwin.It <B>
611c97a3872SJohn BaldwinThe bus address of the PCI device in decimal.
612c97a3872SJohn Baldwin.It <S>
613c97a3872SJohn BaldwinThe slot of the PCI device in decimal.
614c97a3872SJohn Baldwin.It <P>
615c97a3872SJohn BaldwinThe interrupt pin of the PCI slot to override.
616c97a3872SJohn BaldwinOne of
617c97a3872SJohn Baldwin.Ql A ,
618c97a3872SJohn Baldwin.Ql B ,
619c97a3872SJohn Baldwin.Ql C ,
620c97a3872SJohn Baldwinor
621c97a3872SJohn Baldwin.Ql D .
622c97a3872SJohn Baldwin.El
623c97a3872SJohn Baldwin.Pp
624c97a3872SJohn BaldwinThe value of the tunable is the raw IRQ value to use for the INTx interrupt
625c97a3872SJohn Baldwinpin identified by the tunable name.
626c97a3872SJohn BaldwinMapping of IRQ values to platform interrupt sources is machine dependent.
627c97a3872SJohn Baldwin.El
6289b94cc24SWarner Losh.Sh DEVICE WIRING
62923da585dSWarner LoshYou can wire the device unit at a given location with
63023da585dSWarner Losh.Xr device.hints 5 .
63123da585dSWarner Losh.Ss BSF Based Wiring
63223da585dSWarner LoshDevices may be wired to a Bus / Slot / Function (BSF) address.
63323da585dSWarner LoshThis is the form reported by
63423da585dSWarner Losh.Xr pciconf 8
6359b94cc24SWarner LoshEntries of the form
6369b94cc24SWarner Losh.Va hints.<name>.<unit>.at="pci<B>:<S>:<F>"
6379b94cc24SWarner Loshor
6389b94cc24SWarner Losh.Va hints.<name>.<unit>.at="pci<D>:<B>:<S>:<F>"
6399b94cc24SWarner Loshwill force the driver
6409b94cc24SWarner Losh.Va name
6419b94cc24SWarner Loshto probe and attach at unit
6429b94cc24SWarner Losh.Va unit
6439b94cc24SWarner Loshfor any PCI device found to match the specification, where:
6449b94cc24SWarner Losh.Bl -tag -width -indent
6459b94cc24SWarner Losh.It <D>
6469b94cc24SWarner LoshThe domain
6479b94cc24SWarner Losh.Pq or segment
6489b94cc24SWarner Loshof the PCI device in decimal.
64923da585dSWarner LoshDefaults to 0 if unspecified.
6509b94cc24SWarner Losh.It <B>
6519b94cc24SWarner LoshThe bus address of the PCI device in decimal.
6529b94cc24SWarner Losh.It <S>
6539b94cc24SWarner LoshThe slot of the PCI device in decimal.
6549b94cc24SWarner Losh.It <F>
6559b94cc24SWarner LoshThe function of the PCI device in decimal.
6569b94cc24SWarner Losh.El
6579b94cc24SWarner Losh.Pp
6589b94cc24SWarner LoshThe code to do the matching requires an exact string match.
6599b94cc24SWarner LoshDo not specify the angle brackets
6609b94cc24SWarner Losh.Pq < >
6619b94cc24SWarner Loshin the hints file.
6629b94cc24SWarner LoshWiring multiple devices to the same
6639b94cc24SWarner Losh.Va name
6649b94cc24SWarner Loshand
6659b94cc24SWarner Losh.Va unit
6669b94cc24SWarner Loshproduces undefined results.
6679b94cc24SWarner Losh.Ss Examples
6689b94cc24SWarner LoshGiven the following lines in
6699b94cc24SWarner Losh.Pa /boot/device.hints :
67023da585dSWarner Losh.Bd -literal
67123da585dSWarner Loshhint.nvme.3.at="pci6:0:0"
67223da585dSWarner Loshhint.igb.8.at="pci14:0:0"
67323da585dSWarner Losh.Ed
67423da585dSWarner Losh.Pp
6759b94cc24SWarner LoshIf there is a device that supports
6769b94cc24SWarner Losh.Xr igb 4
6779b94cc24SWarner Loshat PCI bus 14 slot 0 function 0,
6789b94cc24SWarner Loshthen it will be assigned igb8 for probe and attach.
6799b94cc24SWarner LoshLikewise, if there is an
6809b94cc24SWarner Losh.Xr nvme 4
68123da585dSWarner Loshdevice at PCI bus 6 slot 0 function 0,
6829b94cc24SWarner Loshthen it will be assigned nvme3 for probe and attach.
6839b94cc24SWarner LoshIf another type of card is in either of these locations, the name and
6849b94cc24SWarner Loshunit of that card will be the default names and will be unaffected by
6859b94cc24SWarner Loshthese hints.
6869b94cc24SWarner LoshIf other igb or nvme cards are located elsewhere, they will be
6879b94cc24SWarner Loshassigned their unit numbers sequentially, skipping the unit numbers
6889b94cc24SWarner Loshthat have 'at' hints.
68923da585dSWarner Losh.Ss Location Based Wiring
69023da585dSWarner LoshWhile simple to locate where to place a device for BSF wiring, the
69123da585dSWarner Loshbus number of that is not invariant.
69223da585dSWarner LoshAny number of changes to the devices within the system can cause
69323da585dSWarner Loshthis value to vary from boot to boot.
69423da585dSWarner LoshThe UEFI Standard defines a device path that's based only on the invariant parts
69523da585dSWarner Loshof the address: The root complex (domain), the slot number and the function.
69623da585dSWarner LoshThese paths are hard to construct by hand, please see
69723da585dSWarner Losh.Xr devctl 8
69823da585dSWarner Losh.Sq Cm getpath
69923da585dSWarner Loshcommand with a
70023da585dSWarner Losh.Sq Ar UEFI
70123da585dSWarner Loshlocator.
70223da585dSWarner LoshThe above example could also be expressed as
70323da585dSWarner Losh.Bd -literal
70423da585dSWarner Loshhint.nvme.3.at="PciRoot(0x2)/Pci(0x1,0x3)/Pci(0x0,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)"
70523da585dSWarner Loshhint.nvme.8.at="PciRoot(0x1)/Pci(0x2,0x2)/Pci(0x0,0x0)/Pci(0x0,0x0)"
70623da585dSWarner Losh.Ed
70723da585dSWarner Losh.Pp
70823da585dSWarner LoshThe advantage of this notation is that you can specify the exact location a
70923da585dSWarner Loshdevice will be at.
71023da585dSWarner LoshFor deployments of multiple systems with the same configuration, this can be
71123da585dSWarner Loshhelpful in managing the devices.
71223da585dSWarner LoshHowever, even slight variation in motherboards can cause the path to change
71323da585dSWarner Loshsubstantially.
71423da585dSWarner LoshIt is also less natural to think of the UEFI Device Paths since little else
71523da585dSWarner Loshwill report it.
71664ae346bSKenneth D. Merry.Sh FILES
7173136363fSRuslan Ermilov.Bl -tag -width /dev/pci -compact
71864ae346bSKenneth D. Merry.It Pa /dev/pci
71964ae346bSKenneth D. MerryCharacter device for the
7204b66483fSRuslan Ermilov.Nm
72164ae346bSKenneth D. Merrydriver.
72264ae346bSKenneth D. Merry.El
72364ae346bSKenneth D. Merry.Sh SEE ALSO
72423da585dSWarner Losh.Xr device.hints 5
72564ae346bSKenneth D. Merry.Xr pciconf 8
72664ae346bSKenneth D. Merry.Sh HISTORY
72764ae346bSKenneth D. MerryThe
7284b66483fSRuslan Ermilov.Nm
72964ae346bSKenneth D. Merrydriver (not the kernel's
73064ae346bSKenneth D. Merry.Tn PCI
73164ae346bSKenneth D. Merrysupport code) first appeared in
73264ae346bSKenneth D. Merry.Fx 2.2 ,
73364ae346bSKenneth D. Merryand was written by Stefan Esser and Garrett Wollman.
73464ae346bSKenneth D. MerrySupport for device listing and matching was re-implemented by
73564ae346bSKenneth D. MerryKenneth Merry, and first appeared in
73664ae346bSKenneth D. Merry.Fx 3.0 .
73764ae346bSKenneth D. Merry.Sh AUTHORS
7386c899950SBaptiste Daroussin.An Kenneth Merry Aq Mt ken@FreeBSD.org
73964ae346bSKenneth D. Merry.Sh BUGS
7400227791bSRuslan ErmilovIt is not possible for users to specify an accurate offset into the device
74164ae346bSKenneth D. Merrylist without calling the
74264ae346bSKenneth D. Merry.Dv PCIOCGETCONF
74364ae346bSKenneth D. Merryat least once, since they have no way of knowing the current generation
744b5e7e999SRuslan Ermilovnumber otherwise.
7450227791bSRuslan ErmilovThis probably is not a serious problem, though, since
74664ae346bSKenneth D. Merryusers can easily narrow their search by specifying a pattern or patterns
74764ae346bSKenneth D. Merryfor the kernel to match against.
748