1 .\" Copyright (c) 2018 Conrad Meyer <cem@FreeBSD.org>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd register plug and play information for device matching
37 .Fa "const char *descriptor_string"
41 .Fa "size_t entry_len"
42 .Fa "size_t num_entries"
50 of device-identifying data for use by
55 that describes the memory layout of table entries.
56 The string is a series of members separated by semi-colons.
57 Members are identified by a type and a name.
58 They are encoded in the descriptor string by concatenating the type with a
59 colon, followed by the name.
62 represents two members.
63 The first name is encoded like any other type.
64 The second name is encoded by appending a forward slash and the second
65 name after the first.)
67 Types are one of the following:
75 except that the sentinel value 0xFF matches any.
78 element; any value greater than or equal matches.
81 element; any value less than or equal matches.
84 element; mask of which of the following fields to use.
91 except that the sentinel value 0xFFFF matches any.
98 except that the sentinel value 0xFFFFFFFF matches any.
102 values; the first named member is in the least significant word and the second
103 named member is in the most significant word.
105 A pointer to a string to match exactly.
107 A pointer to a human readable description for the device.
109 A pointer that should be ignored.
116 is reserved for fields that should be ignored.
117 Any member that does not match the parent device's pnpinfo output must be
122 parameter is an unquoted word naming the parent bus of the driver.
128 parameter is also an unquoted word.
129 It must be unique to the driver.
130 Usually the driver's name is used.
134 parameter points to the device matching data with entries matching the
135 .Fa descriptor_string .
139 parameter is the size of each table entry, i.e.,
140 .Ql sizeof(table[0]) .
144 parameter is the number of entries in the table, i.e.,
146 Note that only valid entries should be included.
147 If the table contains trailing zero or bogus values, they should not be
152 .Bd -literal -offset indent -compact
153 #include <sys/param.h>
154 #include <sys/module.h>
155 static struct my_pciids {
159 { 0x12345678, "Foo bar" },
160 { 0x9abcdef0, "Baz fizz" },
162 MODULE_PNP_INFO("W32:vendor/device", pci, my_driver, my_ids, sizeof(my_ids[0]),
168 .Xr DRIVER_MODULE 9 ,
176 The PNP framework and
178 utility were written by
179 .An Warner Losh Aq Mt imp@FreeBSD.org .