<commit_before>.\" Copyright (c) 1997
.\"	<NAME> <<EMAIL>>. 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, 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
.\"
.\" $FreeBSD$
.\"
.Dd November 7, 2007
.Dt PCICONF 8
.Os
.Sh NAME
.Nm pciconf
.Nd diagnostic utility for the PCI bus
.Sh SYNOPSIS
.Nm
.Fl l Op Fl bcv
.Nm
.Fl a Ar selector
.Nm
.Fl r Oo Fl b | h Oc Ar selector addr Ns Op : Ns Ar addr2
.Nm
.Fl w Oo Fl b | h Oc Ar selector addr value
.Sh DESCRIPTION
The
.Nm
utility provides a command line interface to functionality provided by the
.Xr pci 4
.Xr ioctl 2
interface.
As such, some of the functions are only available to users with write
access to
.Pa /dev/pci ,
normally only the super-user.
.Pp
With the
.Fl l
option, it lists all devices found by the boot probe in the following format:
.Bd -literal
foo0@pci0:0:4:0: class=0x010000 card=0x00000000 chip=0x000f1000 rev=0x01 \
hdr=0x00
bar0@pci0:0:5:0: class=0x000100 card=0x00000000 chip=0x88c15333 rev=0x00 \
hdr=0x00
none0@pci0:0:6:0: class=0x020000 card=0x00000000 chip=0x802910ec rev=0x00 \
hdr=0x00
.Ed
.Pp
The first column gives the
device name, unit number, and
.Ar selector .
If there is no device configured in the kernel for the
.Tn PCI
device in question, the device name will be
.Dq none .
Unit numbers for unconfigured devices start at zero and are incremented for
each unconfigured device that is encountered.
The
.Ar selector
is in a form which may directly be used for the other forms of the command.
The second column is the class code, with the class byte printed as two
hex digits, followed by the sub-class and the interface bytes.
The third column gives the contents of the subvendorid register, introduced
in revision 2.1 of the
.Tn PCI
standard.
Note that it will be 0 for older cards.
The field consists of the card ID in the upper
half and the card vendor ID in the lower half of the value.
.Pp
The fourth column contains the chip device ID, which identifies the chip
this card is based on.
It consists of two fields, identifying the chip and
its vendor, as above.
The fifth column prints the chip's revision.
The sixth column describes the header type.
Currently assigned header types include 0 for most devices,
1 for
.Tn PCI
to
.Tn PCI
bridges, and 2 for
.Tn PCI
to
.Tn CardBus
bridges.
If the most significant bit
of the header type register is set for
function 0 of a
.Tn PCI
device, it is a
.Em multi-function
device, which contains several (similar or independent) functions on
one chip.
.Pp
If the
.Fl b
option is supplied,
.Nm
will list any base address registers
.Pq BARs
that are assigned resources for each device.
Each BAR will be enumerated via a line in the following format:
.Bd -literal
    bar   [10] = type Memory, range 32, base 0xda060000, size 131072, enabled
.Ed
.Pp
The first value after the
.Dq Li bar
prefix in the square brackets is the offset of the BAR in config space in
hexadecimal.
The type of a BAR is one of
.Dq Memory ,
.Dq Prefetchable Memory ,
or
.Dq I/O Port .
The range indicates the maximum address the BAR decodes.
The base and size indicate the start and length of the BAR's address window,
respectively.
Finally, the last flag indicates if the BAR is enabled or disabled.
.Pp
If the
.Fl c
option is supplied,
.Nm
will list any capabilities supported by each device.
Each capability will be enumerated via a line in the following format:
.Bd -literal
    cap 10[40] = PCI-Express 1 root port
.Ed
.Pp
The first value after the
.Dq Li cap
prefix is the capability ID in hexadecimal.
The second value in the square brackets is the offset of the capability
in config space in hexadecimal.
The format of the text after the equals sign is capability-specific.
.Pp
If the
.Fl v
option is supplied,
.Nm
will attempt to load the vendor/device information database, and print
vendor, device, class and subclass identification strings for each device.
.Pp
All invocations of
.Nm
except for
.Fl l
require a
.Ar selector
of the form
.Li pci Ns Va domain Ns \&: Ns Va bus Ns \&: Ns Va device Ns \&: \
Ns Va function Ns ,
.Li pci Ns Va bus Ns \&: Ns Va device Ns \&: Ns Va function Ns , or<commit_msg>Document the format of extended capabilities in the '-c' output.<commit_after>.\" Copyright (c) 1997
.\"	<NAME> <<EMAIL>>. 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, 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
.\"
.\" $FreeBSD$
.\"
.Dd November 7, 2007
.Dt PCICONF 8
.Os
.Sh NAME
.Nm pciconf
.Nd diagnostic utility for the PCI bus
.Sh SYNOPSIS
.Nm
.Fl l Op Fl bcv
.Nm
.Fl a Ar selector
.Nm
.Fl r Oo Fl b | h Oc Ar selector addr Ns Op : Ns Ar addr2
.Nm
.Fl w Oo Fl b | h Oc Ar selector addr value
.Sh DESCRIPTION
The
.Nm
utility provides a command line interface to functionality provided by the
.Xr pci 4
.Xr ioctl 2
interface.
As such, some of the functions are only available to users with write
access to
.Pa /dev/pci ,
normally only the super-user.
.Pp
With the
.Fl l
option, it lists all devices found by the boot probe in the following format:
.Bd -literal
foo0@pci0:0:4:0: class=0x010000 card=0x00000000 chip=0x000f1000 rev=0x01 \
hdr=0x00
bar0@pci0:0:5:0: class=0x000100 card=0x00000000 chip=0x88c15333 rev=0x00 \
hdr=0x00
none0@pci0:0:6:0: class=0x020000 card=0x00000000 chip=0x802910ec rev=0x00 \
hdr=0x00
.Ed
.Pp
The first column gives the
device name, unit number, and
.Ar selector .
If there is no device configured in the kernel for the
.Tn PCI
device in question, the device name will be
.Dq none .
Unit numbers for unconfigured devices start at zero and are incremented for
each unconfigured device that is encountered.
The
.Ar selector
is in a form which may directly be used for the other forms of the command.
The second column is the class code, with the class byte printed as two
hex digits, followed by the sub-class and the interface bytes.
The third column gives the contents of the subvendorid register, introduced
in revision 2.1 of the
.Tn PCI
standard.
Note that it will be 0 for older cards.
The field consists of the card ID in the upper
half and the card vendor ID in the lower half of the value.
.Pp
The fourth column contains the chip device ID, which identifies the chip
this card is based on.
It consists of two fields, identifying the chip and
its vendor, as above.
The fifth column prints the chip's revision.
The sixth column describes the header type.
Currently assigned header types include 0 for most devices,
1 for
.Tn PCI
to
.Tn PCI
bridges, and 2 for
.Tn PCI
to
.Tn CardBus
bridges.
If the most significant bit
of the header type register is set for
function 0 of a
.Tn PCI
device, it is a
.Em multi-function
device, which contains several (similar or independent) functions on
one chip.
.Pp
If the
.Fl b
option is supplied,
.Nm
will list any base address registers
.Pq BARs
that are assigned resources for each device.
Each BAR will be enumerated via a line in the following format:
.Bd -literal
    bar   [10] = type Memory, range 32, base 0xda060000, size 131072, enabled
.Ed
.Pp
The first value after the
.Dq Li bar
prefix in the square brackets is the offset of the BAR in config space in
hexadecimal.
The type of a BAR is one of
.Dq Memory ,
.Dq Prefetchable Memory ,
or
.Dq I/O Port .
The range indicates the maximum address the BAR decodes.
The base and size indicate the start and length of the BAR's address window,
respectively.
Finally, the last flag indicates if the BAR is enabled or disabled.
.Pp
If the
.Fl c
option is supplied,
.Nm
will list any capabilities supported by each device.
Each capability is enumerated via a line in the following format:
.Bd -literal
    cap 10[40] = PCI-Express 1 root port
.Ed
.Pp
The first value after the
.Dq Li cap
prefix is the capability ID in hexadecimal.
The second value in the square brackets is the offset of the capability
in config space in hexadecimal.
The format of the text after the equals sign is capability-specific.
.Pp
Each extended capability is enumerated via a line in a similar format:
.Bd -literal
ecap 0002[100] = VC 1 max VC0
.Ed
.Pp
The first value after the
.Dq Li ecap
prefix is the extended capability ID in hexadecimal.
The second value in the square brackets is the offset of the extended
capability in config space in hexadecimal.
The format of the text after the equals sign is capability-specific.
.Pp
If the
.Fl v
option is supplied,
.Nm
will attempt to load the vendor/device information database, and print
vendor, device, class and subclass identification strings for each device.
.Pp
All invocations of
.Nm
except for
.Fl l
require a
.Ar selector
of the form
.Li pci Ns Va domain Ns \&: Ns Va bus Ns \&: Ns Va device Ns \&: \
Ns Va function Ns ,
.Li pci Ns Va bus Ns \&: Ns Va device Ns \&: Ns Va function Ns , or
{'fraction_non_alphanumeric': 0.061933399156269636, 'fraction_numerical': 0.027376357598061216, 'mean_word_length': 3.767650834403081, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4908667', 'n_tokens_mistral': 3602, 'n_tokens_neox': 3218, 'n_words': 1836}