Date: Tue, 2 Oct 2018 17:01:42 +0000 (UTC) From: Mateusz Piotrowski <0mp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339088 - head/share/man/man9 Message-ID: <201810021701.w92H1gR3060905@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: 0mp (ports committer) Date: Tue Oct 2 17:01:42 2018 New Revision: 339088 URL: https://svnweb.freebsd.org/changeset/base/339088 Log: MODULE_PNP_INFO(9): Add example of T usage. Provide an example of specifying a common vendor value as the documentation is not clear enough at the moment. While here, add 'D:#' to the previous example to eat the remaining description string. Also, pet mandoc a bit. Submitted by: Yuri Pankov <yuripv@yuripv.net> Reviewed by: cem, imp Approved by: re (kib), krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D17321 Modified: head/share/man/man9/MODULE_PNP_INFO.9 Modified: head/share/man/man9/MODULE_PNP_INFO.9 ============================================================================== --- head/share/man/man9/MODULE_PNP_INFO.9 Tue Oct 2 16:23:33 2018 (r339087) +++ head/share/man/man9/MODULE_PNP_INFO.9 Tue Oct 2 17:01:42 2018 (r339088) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2018 +.Dd October 2, 2018 .Dt MODULE_PNP_INFO 9 .Os .Sh NAME @@ -113,7 +113,7 @@ A pointer that should be ignored. .It Dq Vt E EISA PNP Identifier. .It Dq Vt T -PNP info that's true for the for the whole table. +PNP info that is true for the for the whole table. The driver code checks for these condition pragmatically before using this table to match devices. This item must come last in the list. @@ -157,9 +157,18 @@ included in .Fa num_entries . .\" .Sh EXAMPLES -.Bd -literal -offset indent -compact +.Bl -tag -width "" +.It Sy Example 1\&: No Using W32 for vendor/device pair +.Pp +The following example shows usage of +.Vt W32 +type when vendor/device values are combined into single +.Vt uint32_t +value: +.Bd -literal #include <sys/param.h> #include <sys/module.h> + static struct my_pciids { uint32_t devid; const char *desc; @@ -168,14 +177,35 @@ static struct my_pciids { { 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 +.Pp +The following example shows usage of +.Vt T +type when all entries in the table have the same vendor value: +.Bd -literal +#include <sys/param.h> +#include <sys/module.h> + +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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810021701.w92H1gR3060905>