3 pnp \- Plug 'n' Play ISA and PCI Interfaces
8 .BI /dev/pci/ bus\fL.\fPdev\fL.\fPfn ctl
9 .BI /dev/pci/ bus\fL.\fPdev\fL.\fPfn raw
12 .BI /dev/pnp/csn n ctl
13 .BI /dev/pnp/csn n raw
19 This device provides a limited interface to the PCI bus and
20 Plug 'n' Play ISA devices.
23 PCI devices are addressed logically by a bus number,
24 a device number on that bus, and a function number
26 The set of all such device functions may be enumerated
29 directory; the driver serves two files for each function.
30 These are a control file
31 .RL ( /dev/pci/\fIbus\fP.\fIdev\fP.\fIfn\fPctl )
32 which may be read for a textual summary of the device function,
34 .RL ( /dev/pci/\fIbus\fP.\fIdev\fP.\fIfn\fPraw )
35 which may be used to read or write the raw contents of PCI configuration space.
37 The first field of a PCI control file contains the class, sub-class and
38 programming interface values for the device function, expressed
39 as 2-digit hexadecimal values, and separated by periods.
40 The second field yields the vendor ID and device ID, each as 4-digit
41 hex numbers, separated by a slash.
42 The third field is the associated interrupt line in decimal.
43 The remainder of the line enumerates any valid base address
44 registers for the function, using two fields for each.
45 In the first field, the index of the register is followed by
46 a colon, and then the value of the register itself.
47 The following field gives the associated size of the memory
48 (or I/O space) that is mapped by the register.
51 Plug 'n' Play ISA devices are discovered by sending a fixed `unlock' sequence
52 over an I/O port, and then reading back data from another port.
53 An arbitration algorithm is used to separate out the individual
54 cards and enumerate them in turn.
55 Each card is assigned a unique number, called a CSN, in the range 1-255 as a
56 result of enumeration.
57 Cards also have a fixed 64 bit identification number, set by the
58 manufacturer, which is used by the arbitration algorithm to
60 The first 32 bits describe the type of the card, and the second
61 32 bits form a serial number for the particular instance of that card type.
62 When formatted textually, it appears as 3 upper-case letters
63 (typically representing the manufacturer),
64 followed by 4 hex digits, then a period, then 8 hex digits.
65 The substring before the period is the card type, and the substring
66 after the period is the serial number.
68 The enumeration algorithm needs to be enabled by specifying the
69 port number to write the unlock sequence out on.
70 This can be configured to take place at boot time by adding a line
80 should be chosen to not conflict with any existing devices.
81 It must be in the range
83 Alternatively, one can use the following command:
86 echo port 0x203 >/dev/pnp/ctl
89 Note that a side-effect of PnP enumeration is to reset the configuration
90 state of all such cards; any settings made by a Plug and Play BIOS will be lost.
93 returns one of the strings
94 .B "enabled\fI port\fP"
98 For each enumerated card, two files are served in
101 .RL ( /dev/pnp/csn\fIn\fPctl )
102 may be read to determine the ID of the card, and a raw file
103 .RL ( /dev/pnp/csn\fIn\fPraw )
104 may be read to obtain the configuration data associated with the card.
105 It is intended that the control file should take commands which set the
106 various configurable resources of the card, but this has not been
109 A mechanism is provided for configuring cards via
112 .BI pnp n = "idstring ..."
113 will cause the driver to look for the card named by
115 and, if found, assign it the CSN
117 The intention is that
118 any additional text after the idstring is interpreted as if it
119 was written to the card's
121 file, but this is not yet implemented.
124 To list all PCI functions:
130 To find just the PCI video card (class 3):
133 grep '^03' /dev/pci/*ctl
136 .B /sys/src/9/port/devpnp.c
140 Access to the I/O and memory regions of a PCI device is not provided.
142 The ability to set a Plug 'n' Play card's configurable settings has not been
145 There should be a user program for identifying and configuring