| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: pci.9,v 1.34 2011/05/30 01:48:40 dyoung Exp $ | | 1 | .\" $NetBSD: pci.9,v 1.35 2011/08/25 02:01:32 dyoung Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2001, 2003 The NetBSD Foundation, Inc. | | 3 | .\" Copyright (c) 2001, 2003 The NetBSD Foundation, Inc. |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | | 6 | .\" This code is derived from software contributed to The NetBSD Foundation |
7 | .\" by Gregory McGarry. | | 7 | .\" by Gregory McGarry. |
8 | .\" | | 8 | .\" |
9 | .\" Redistribution and use in source and binary forms, with or without | | 9 | .\" Redistribution and use in source and binary forms, with or without |
10 | .\" modification, are permitted provided that the following conditions | | 10 | .\" modification, are permitted provided that the following conditions |
11 | .\" are met: | | 11 | .\" are met: |
12 | .\" 1. Redistributions of source code must retain the above copyright | | 12 | .\" 1. Redistributions of source code must retain the above copyright |
13 | .\" notice, this list of conditions and the following disclaimer. | | 13 | .\" notice, this list of conditions and the following disclaimer. |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| @@ -17,32 +17,33 @@ | | | @@ -17,32 +17,33 @@ |
17 | .\" | | 17 | .\" |
18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
28 | .\" POSSIBILITY OF SUCH DAMAGE. | | 28 | .\" POSSIBILITY OF SUCH DAMAGE. |
29 | .\" | | 29 | .\" |
30 | .Dd April 5, 2011 | | 30 | .Dd August 24, 2011 |
31 | .Dt PCI 9 | | 31 | .Dt PCI 9 |
32 | .Os | | 32 | .Os |
33 | .Sh NAME | | 33 | .Sh NAME |
34 | .Nm PCI , | | 34 | .Nm PCI , |
35 | .Nm pci_activate , | | 35 | .Nm pci_activate , |
| | | 36 | .Nm pci_bus_devorder , |
36 | .Nm pci_chipset_tag_create , | | 37 | .Nm pci_chipset_tag_create , |
37 | .Nm pci_chipset_tag_destroy , | | 38 | .Nm pci_chipset_tag_destroy , |
38 | .Nm pci_conf_read , | | 39 | .Nm pci_conf_read , |
39 | .Nm pci_conf_write , | | 40 | .Nm pci_conf_write , |
40 | .Nm pci_conf_print , | | 41 | .Nm pci_conf_print , |
41 | .Nm pci_conf_capture , | | 42 | .Nm pci_conf_capture , |
42 | .Nm pci_conf_restore , | | 43 | .Nm pci_conf_restore , |
43 | .Nm pci_find_device , | | 44 | .Nm pci_find_device , |
44 | .Nm pci_get_capability , | | 45 | .Nm pci_get_capability , |
45 | .Nm pci_mapreg_type , | | 46 | .Nm pci_mapreg_type , |
46 | .Nm pci_mapreg_map , | | 47 | .Nm pci_mapreg_map , |
47 | .Nm pci_mapreg_info , | | 48 | .Nm pci_mapreg_info , |
48 | .Nm pci_intr_map , | | 49 | .Nm pci_intr_map , |
| @@ -58,26 +59,29 @@ | | | @@ -58,26 +59,29 @@ |
58 | .Nm pci_decompose_tag , | | 59 | .Nm pci_decompose_tag , |
59 | .Nm pci_findvendor , | | 60 | .Nm pci_findvendor , |
60 | .Nm pci_devinfo , | | 61 | .Nm pci_devinfo , |
61 | .Nm PCI_VENDOR , | | 62 | .Nm PCI_VENDOR , |
62 | .Nm PCI_PRODUCT , | | 63 | .Nm PCI_PRODUCT , |
63 | .Nm PCI_REVISION | | 64 | .Nm PCI_REVISION |
64 | .Nd Peripheral Component Interconnect | | 65 | .Nd Peripheral Component Interconnect |
65 | .Sh SYNOPSIS | | 66 | .Sh SYNOPSIS |
66 | .In sys/bus.h | | 67 | .In sys/bus.h |
67 | .In dev/pci/pcivar.h | | 68 | .In dev/pci/pcivar.h |
68 | .In dev/pci/pcireg.h | | 69 | .In dev/pci/pcireg.h |
69 | .In dev/pci/pcidevs.h | | 70 | .In dev/pci/pcidevs.h |
70 | .Ft int | | 71 | .Ft int |
| | | 72 | .Fn pci_bus_devorder "pci_chipset_tag_t pc" "int bus" "uint8_t *devs" \ |
| | | 73 | "int maxdevs" |
| | | 74 | .Ft int |
71 | .Fn pci_activate "pci_chipset_tag_t pc" "pcitag_t tag" "device_t dev" \ | | 75 | .Fn pci_activate "pci_chipset_tag_t pc" "pcitag_t tag" "device_t dev" \ |
72 | "int (*wakeup)(pci_chipset_tag_t pc, pcitag_t tag" \ | | 76 | "int (*wakeup)(pci_chipset_tag_t pc, pcitag_t tag" \ |
73 | "\t\tdevice_t dev, pcireg_t reg)" | | 77 | "\t\tdevice_t dev, pcireg_t reg)" |
74 | .Ft int | | 78 | .Ft int |
75 | .Fn pci_chipset_tag_create "pci_chipset_tag_t opc" "uint64_t present" \ | | 79 | .Fn pci_chipset_tag_create "pci_chipset_tag_t opc" "uint64_t present" \ |
76 | "const struct pci_overrides *ov" "void *ctx" "pci_chipset_tag_t *pcp" | | 80 | "const struct pci_overrides *ov" "void *ctx" "pci_chipset_tag_t *pcp" |
77 | .Ft void | | 81 | .Ft void |
78 | .Fn pci_chipset_tag_destroy "pci_chipset_tag_t pc" | | 82 | .Fn pci_chipset_tag_destroy "pci_chipset_tag_t pc" |
79 | .Ft pcireg_t | | 83 | .Ft pcireg_t |
80 | .Fn pci_conf_read "pci_chipset_tag_t pc" "pcitag_t tag" "int reg" | | 84 | .Fn pci_conf_read "pci_chipset_tag_t pc" "pcitag_t tag" "int reg" |
81 | .Ft void | | 85 | .Ft void |
82 | .Fn pci_conf_write "pci_chipset_tag_t pc" "pcitag_t tag" "int reg" \ | | 86 | .Fn pci_conf_write "pci_chipset_tag_t pc" "pcitag_t tag" "int reg" \ |
83 | "pcireg_t val" | | 87 | "pcireg_t val" |
| @@ -242,26 +246,47 @@ It contains the following members: | | | @@ -242,26 +246,47 @@ It contains the following members: |
242 | void *(*ov_intr_establish)(void *, | | 246 | void *(*ov_intr_establish)(void *, |
243 | pci_chipset_tag_t, pci_intr_handle_t, | | 247 | pci_chipset_tag_t, pci_intr_handle_t, |
244 | int, int (*)(void *), void *); | | 248 | int, int (*)(void *), void *); |
245 | void (*ov_intr_disestablish)(void *, | | 249 | void (*ov_intr_disestablish)(void *, |
246 | pci_chipset_tag_t, void *); | | 250 | pci_chipset_tag_t, void *); |
247 | pcitag_t (*ov_make_tag)(void *, | | 251 | pcitag_t (*ov_make_tag)(void *, |
248 | pci_chipset_tag_t, int, int, int); | | 252 | pci_chipset_tag_t, int, int, int); |
249 | void (*ov_decompose_tag)(void *, | | 253 | void (*ov_decompose_tag)(void *, |
250 | pci_chipset_tag_t, pcitag_t, int *, int *, int *); | | 254 | pci_chipset_tag_t, pcitag_t, int *, int *, int *); |
251 | .Ed | | 255 | .Ed |
252 | .El | | 256 | .El |
253 | .Sh FUNCTIONS | | 257 | .Sh FUNCTIONS |
254 | .Bl -tag -width compact | | 258 | .Bl -tag -width compact |
| | | 259 | .It Fn pci_bus_devorder "pc" "bus" "devs" "maxdevs" |
| | | 260 | Tell how many devices a PCI bus driver should probe |
| | | 261 | and in what order. |
| | | 262 | If |
| | | 263 | .Fa maxdevs |
| | | 264 | is less than or equal to zero, return 0 and |
| | | 265 | do not modify |
| | | 266 | .Fa devs . |
| | | 267 | Otherwise, return |
| | | 268 | .Fa maxdevs |
| | | 269 | or the number of devices on |
| | | 270 | .Fa bus |
| | | 271 | to probe, whichever is less, and copy to |
| | | 272 | .Fa devs |
| | | 273 | each of the PCI device numbers to probe in the order that they |
| | | 274 | should be probed. |
| | | 275 | .Fn pci_bus_devorder |
| | | 276 | will not copy more than |
| | | 277 | .Fa maxdevs |
| | | 278 | device numbers to |
| | | 279 | .Fa devs . |
255 | .It Fn pci_activate "pc" "tag" "dev" "fun" | | 280 | .It Fn pci_activate "pc" "tag" "dev" "fun" |
256 | Attempt to bring the device to state D0. | | 281 | Attempt to bring the device to state D0. |
257 | If the device is not in the D0 state call | | 282 | If the device is not in the D0 state call |
258 | .Fa fun | | 283 | .Fa fun |
259 | to restore its state. | | 284 | to restore its state. |
260 | If | | 285 | If |
261 | .Fa fun | | 286 | .Fa fun |
262 | is | | 287 | is |
263 | .Dv NULL | | 288 | .Dv NULL |
264 | then restoring from state D3 is going to fail. | | 289 | then restoring from state D3 is going to fail. |
265 | .It Fn pci_chipset_tag_create "opc" "present" "ov" "ctx" "pcp" | | 290 | .It Fn pci_chipset_tag_create "opc" "present" "ov" "ctx" "pcp" |
266 | Create a copy of the tag | | 291 | Create a copy of the tag |
267 | .Fa opc | | 292 | .Fa opc |