Index: share/man/man9/MODULE_PNP_INFO.9 =================================================================== --- share/man/man9/MODULE_PNP_INFO.9 +++ share/man/man9/MODULE_PNP_INFO.9 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2018 +.Dd September 25, 2018 .Dt MODULE_PNP_INFO 9 .Os .Sh NAME @@ -157,9 +157,17 @@ .Fa num_entries . .\" .Sh EXAMPLES -.Bd -literal -offset indent -compact +.Bl -tag -width Ds +.It Sy Example 1 No Using W32 for vendor/device pair +The following example shows usage of +.Vt W32 +type when vendor/device values are combined into single +.Vt uint32_t +value: +.Bd -literal #include #include + static struct my_pciids { uint32_t devid; const char *desc; @@ -168,14 +176,34 @@ { 0x9abcdef0, "Baz fizz" }, }; -MODULE_PNP_INFO("W32:vendor/device", pci, my_driver, my_ids, sizeof(my_ids[0]), - nitems(my_ids)); +MODULE_PNP_INFO("W32:vendor/device;D:#", pci, my_driver, my_ids, + sizeof(my_ids[0]), nitems(my_ids)); +.Ed +.It Sy Example 2 No Using T for common vendor value +The following example shows usage of +.Vt T +type when all entries in the table have the same vendor value: +.Bd -literal +#include +#include + +static struct my_pciids { + uint16_t device; + const char *desc; +} my_ids[] = { + { 0x9abc, "Foo bar" }, + { 0xdef0, "Baz fizz" }, +}; + +MODULE_PNP_INFO("U16:device;D:#;T:vendor=0x1234", pci, my_driver, + my_ids, sizeof(my_ids[0]), nitems(my_ids)); .Ed +.El .\" .Sh SEE ALSO -.Xr module 9 , +.Xr devmatch 8 , .Xr DRIVER_MODULE 9 , -.Xr devmatch 8 +.Xr module 9 .Sh HISTORY The macro .Nm