Skip to content

Commit 66b6a8b

Browse files
committed
pcictl(8): improve markup, edit for brevity
1 parent 1df3569 commit 66b6a8b

1 file changed

Lines changed: 111 additions & 65 deletions

File tree

usr.sbin/pcictl/pcictl.8

Lines changed: 111 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" $NetBSD: pcictl.8,v 1.20 2019/11/30 02:47:14 riastradh Exp $
1+
.\" $NetBSD: pcictl.8,v 1.21 2026/01/25 00:59:36 uwe Exp $
22
.\"
33
.\" Copyright 2001 Wasabi Systems, Inc.
44
.\" All rights reserved.
@@ -33,116 +33,162 @@
3333
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3434
.\" POSSIBILITY OF SUCH DAMAGE.
3535
.\"
36-
.Dd September 23, 2016
36+
.Dd January 25, 2026
3737
.Dt PCICTL 8
3838
.Os
39+
.
3940
.Sh NAME
4041
.Nm pcictl
4142
.Nd a program to manipulate the PCI bus
43+
.
4244
.Sh SYNOPSIS
4345
.Nm
4446
.Ar pcibus
4547
.Ar command
46-
.Oo
47-
.Ar arg Oo ...
48-
.Oc
49-
.Oc
48+
.Op Ar arg \&...
49+
.
5050
.Sh DESCRIPTION
5151
.Nm
5252
allows a user or system administrator to access various resources
53-
on a PCI bus.
54-
.Pp
55-
The following commands are available:
53+
on a
54+
.Tn PCI
55+
bus.
56+
The
57+
.Ar pcibus
58+
argument names a special file for the
59+
.Tn PCI
60+
bus device.
61+
If the file name is relative, it's interpreted relative to the
62+
.Pa /dev
63+
directory, so e.g. plain
64+
.Ql pci0
65+
refers to
66+
.Pa /dev/pci0 .
67+
.
5668
.Pp
69+
The following
70+
.Ar command\^ Ns s
71+
are available:
72+
.
73+
.Bl -tag -width Cm
74+
.
75+
.It Xo
5776
.Cm list
5877
.Op Fl Nn
5978
.Op Fl b Ar bus
6079
.Op Fl d Ar device
6180
.Op Fl f Ar function
62-
.Pp
63-
List the devices in the PCI domain, either as names or, if
81+
.Xc
82+
List the devices in the
83+
.Tn PCI
84+
domain, either as names or, if
6485
.Fl n
6586
is given, as numbers.
66-
The bus, device, and function
67-
numbers may be specified by flags.
68-
Any locator not specified defaults
69-
to a wildcard, or may be explicitly wildcarded by specifying
70-
.Dq any .
87+
.Pp
7188
If
7289
.Fl N
73-
is given, the driver name for this PCI device will be listed
74-
if any driver is attached.
90+
is given, the driver name for this
91+
.Tn PCI
92+
device will be listed if any driver is attached.
7593
.Pp
76-
.Cm dump
77-
.Op Fl b Ar bus
78-
.Fl d Ar device
79-
.Op Fl f Ar function
94+
Any locator not specified defaults
95+
to a wildcard, or may be explicitly wildcarded by specifying
96+
.Sq Li all ,
97+
or
98+
.Sq Li any .
99+
.
100+
.El
101+
.\"
80102
.Pp
81-
Dump the PCI configuration space for the specified device located
82-
at the specified bus, device, and function.
103+
The remaining commands operate on a single
104+
.Tn PCI
105+
device, the
106+
.Fl d
107+
argument is mandatory.
83108
If the bus is not specified, it defaults to the bus number of the
84-
PCI bus specified on the command line.
109+
.Ar pcibus .
85110
If the function is not specified, it defaults to 0.
86-
.Pp
87-
.Cm read
111+
.
112+
.Bl -tag -width Cm
113+
.
114+
.It Xo
115+
.Cm dump
88116
.Op Fl b Ar bus
89-
.Fl d Ar device
117+
. Fl d Ar device
90118
.Op Fl f Ar function
91-
.Ar reg
92-
.Pp
93-
Read the specified 32-bit aligned PCI configuration register and print
94-
it in hexadecimal to standard output.
95-
If the bus is not specified, it defaults to the bus number of the
96-
PCI bus specified on the command line.
97-
If the function is not specified, it defaults to 0.
98-
.Pp
99-
.Sy WARNING :
100-
.Nm
119+
.Xc
120+
Dump the
121+
.Tn PCI
122+
configuration space for the specified device.
123+
.
124+
.It Xo
101125
.Cm read
102-
is a dangerous command that can damage hardware and panic the operating
103-
system, even though it appears to be a harmless read-only operation.
104-
It is meant as a diagnostic tool for experiments or to debug device
105-
drivers.
106-
Do not use it as a substitute for a device driver!
107-
.Pp
126+
.Op Fl b Ar bus
127+
. Fl d Ar device
128+
.Op Fl f Ar function
129+
.Ar register
130+
.Xc
131+
Read the specified 32-bit aligned
132+
.Tn PCI
133+
configuration
134+
.Ar register
135+
and print it in hexadecimal to standard output.
136+
.
137+
.It Xo
108138
.Cm write
109139
.Op Fl b Ar bus
110-
.Fl d Ar device
140+
. Fl d Ar device
111141
.Op Fl f Ar function
112-
.Ar reg
142+
.Ar register
113143
.Ar value
114-
.Pp
115-
Write the specified value to the specified 32-bit aligned PCI
116-
configuration register.
117-
If the bus is not specified, it defaults to the bus number of the
118-
PCI bus specified on the command line.
119-
If the function is not specified, it defaults to 0.
120-
.Pp
121-
.Sy WARNING :
122-
.Nm
123-
.Cm write
124-
is a dangerous command that can damage hardware and panic the operating
125-
system.
126-
It is meant as a diagnostic tool for experiments or to debug device
127-
drivers.
128-
Do not use it as a substitute for a device driver!
144+
.Xc
145+
Write the specified
146+
.Ar value
147+
to the specified 32-bit aligned
148+
.Tn PCI
149+
configuration
150+
.Ar register .
151+
.
152+
.El
153+
.
129154
.Sh FILES
130-
.Pa /dev/pci*
131-
- PCI bus device nodes
155+
.Bl -tag -width Pa
156+
.It Pa /dev/pci*
157+
.Tn PCI
158+
bus device nodes
159+
.El
160+
.
132161
.Sh EXAMPLES
133-
This shows all PCI devices on the system:
162+
This shows all
163+
.Tn PCI
164+
devices on the system:
134165
.Pp
135166
.Dl pcictl pci0 list
136167
.Pp
137-
This shows all PCI devices on the system, including attached drivers:
168+
This shows all
169+
.Tn PCI
170+
devices on the system, including attached drivers:
138171
.Pp
139172
.Dl pcictl pci0 list -N
173+
.
140174
.Sh SEE ALSO
141175
.Xr pci 3 ,
142176
.Xr pci 4 ,
143177
.Xr drvctl 8
178+
.
144179
.Sh HISTORY
145180
The
146181
.Nm
147182
command first appeared in
148183
.Nx 1.6 .
184+
.
185+
.Sh CAVEATS
186+
.Nm
187+
.Cm read
188+
and
189+
.Cm write
190+
are dangerous commands that can damage hardware
191+
and panic the operating system.
192+
They are meant as a diagnostic tool for experiments or to debug device
193+
drivers.
194+
Do not use them as substitutes for a device driver!

0 commit comments

Comments
 (0)