Tue Oct 13 04:34:38 2015 UTC ()
 Add missing pci_intr_setattr(). The function first appeared in NetBSD 5.0.


(msaitoh)
diff -r1.20 -r1.21 src/share/man/man9/pci_intr.9

cvs diff -r1.20 -r1.21 src/share/man/man9/pci_intr.9 (expand / switch to unified diff)

--- src/share/man/man9/pci_intr.9 2015/08/06 06:56:00 1.20
+++ src/share/man/man9/pci_intr.9 2015/10/13 04:34:38 1.21
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: pci_intr.9,v 1.20 2015/08/06 06:56:00 wiz Exp $ 1.\" $NetBSD: pci_intr.9,v 1.21 2015/10/13 04:34:38 msaitoh Exp $
2.\" 2.\"
3.\" Copyright (c) 2000 The NetBSD Foundation, Inc. 3.\" Copyright (c) 2000 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 Bill Sommerfeld 7.\" by Bill Sommerfeld
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,50 +17,52 @@ @@ -17,50 +17,52 @@
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 August 4, 2015 30.Dd October 13, 2015
31.Dt PCI_INTR 9 31.Dt PCI_INTR 9
32.Os 32.Os
33.Sh NAME 33.Sh NAME
34.Nm pci_intr , 34.Nm pci_intr ,
35.Nm pci_intr_map , 35.Nm pci_intr_map ,
36.Nm pci_intr_string , 36.Nm pci_intr_string ,
37.Nm pci_intr_evcnt , 37.Nm pci_intr_evcnt ,
38.Nm pci_intr_establish , 38.Nm pci_intr_establish ,
39.Nm pci_intr_disestablish 39.Nm pci_intr_disestablish
 40.Nm pci_intr_setattr
40.Nd PCI bus interrupt manipulation functions 41.Nd PCI bus interrupt manipulation functions
41.Sh SYNOPSIS 42.Sh SYNOPSIS
42.In dev/pci/pcivar.h 43.In dev/pci/pcivar.h
43.Ft int 44.Ft int
44.Fn pci_intr_map "const struct pci_attach_args *pa" "pci_intr_handle_t *ih" 45.Fn pci_intr_map "const struct pci_attach_args *pa" "pci_intr_handle_t *ih"
45.Ft const char * 46.Ft const char *
46.Fn pci_intr_string "pci_chipset_tag_t pc" "pci_intr_handle_t ih" "char *buf" "size_t len" 47.Fn pci_intr_string "pci_chipset_tag_t pc" "pci_intr_handle_t ih" "char *buf" "size_t len"
47.Ft const struct evcnt * 48.Ft const struct evcnt *
48.Fn pci_intr_evcnt "pci_chipset_tag_t pc" "pci_intr_handle_t ih" 49.Fn pci_intr_evcnt "pci_chipset_tag_t pc" "pci_intr_handle_t ih"
49.Ft void * 50.Ft void *
50.Fn pci_intr_establish "pci_chipset_tag_t pc" "pci_intr_handle_t ih" \ 51.Fn pci_intr_establish "pci_chipset_tag_t pc" "pci_intr_handle_t ih" \
51"int ipl" "int (*intrhand)(void *)" "void *intrarg" 52"int ipl" "int (*intrhand)(void *)" "void *intrarg"
52.Ft void 53.Ft void
53.Fn pci_intr_disestablish "pci_chipset_tag_t pc" "void *ih" 54.Fn pci_intr_disestablish "pci_chipset_tag_t pc" "void *ih"
 55.Fn pci_intr_setattr "pci_chipset_tag_t pc" "pci_intr_handle_t *ih" "int attr" "uint64_t data"
54.Sh DESCRIPTION 56.Sh DESCRIPTION
55The 57The
56.Nm 58.Nm
57functions exist to allow device drivers machine-independent access to 59functions exist to allow device drivers machine-independent access to
58PCI bus interrupts. 60PCI bus interrupts.
59The functions described in this page are typically declared in a port's 61The functions described in this page are typically declared in a port's
60.In machine/pci_machdep.h 62.In machine/pci_machdep.h
61header file; however, drivers should generally include 63header file; however, drivers should generally include
62.In dev/pci/pcivar.h 64.In dev/pci/pcivar.h
63to get other PCI-specific declarations as well. 65to get other PCI-specific declarations as well.
64.Pp 66.Pp
65Each driver has an 67Each driver has an
66.Fn attach 68.Fn attach
@@ -101,26 +103,44 @@ to actually establish the handler; when  @@ -101,26 +103,44 @@ to actually establish the handler; when
101will be called with a single argument 103will be called with a single argument
102.Fa intrarg , 104.Fa intrarg ,
103and will run at the interrupt priority level 105and will run at the interrupt priority level
104.Fa ipl . 106.Fa ipl .
105.Pp 107.Pp
106The return value of 108The return value of
107.Fn pci_intr_establish 109.Fn pci_intr_establish
108may be saved and passed to 110may be saved and passed to
109.Fn pci_intr_disestablish 111.Fn pci_intr_disestablish
110to disable the interrupt handler 112to disable the interrupt handler
111when the driver is no longer interested in interrupts from the device. 113when the driver is no longer interested in interrupts from the device.
112.Pp 114.Pp
113The 115The
 116.Fn pci_intr_setattr
 117function sets an attribute
 118.Fa attr
 119of the interrupt handler to
 120.Fa data .
 121Currenty, only the following attribute is supported:
 122.Bl -tag -width PCI_INTR_MPSAFE
 123.It Dv PCI_INTR_MPSAFE
 124If this attribute is set to
 125.Dv true ,
 126it specifies that the interrupt handler is multiprocessor safe and works its
 127own locking; otherwise the kernel lock will be held for the call to the
 128interrupt handler.
 129The default is
 130.Dv false .
 131.El
 132.Pp
 133The
114.Fn pci_intr_evcnt 134.Fn pci_intr_evcnt
115function should return an evcnt structure pointer or 135function should return an evcnt structure pointer or
116.Dv NULL 136.Dv NULL
117if there is no evcnt associated with this interrupt. 137if there is no evcnt associated with this interrupt.
118See 138See
119.Xr evcnt 9 139.Xr evcnt 9
120for more details. 140for more details.
121.Ss PORTING 141.Ss PORTING
122A port's implementation of 142A port's implementation of
123.Fn pci_intr_map 143.Fn pci_intr_map
124may use the following members of 144may use the following members of
125.Ft struct pci_attach_args 145.Ft struct pci_attach_args
126to determine how the device's interrupts are routed. 146to determine how the device's interrupts are routed.