{"id":4151,"date":"2022-12-20T17:39:32","date_gmt":"2022-12-20T20:39:32","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/pcibios_find_class-man9\/"},"modified":"2022-12-20T17:39:32","modified_gmt":"2022-12-20T20:39:32","slug":"pcibios_find_class-man9","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/pcibios_find_class-man9\/","title":{"rendered":"pcibios_find_class (man9)"},"content":{"rendered":"<h1 align=\"center\">pcibios_find_class<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#RETURN VALUE\">RETURN VALUE<\/a><br \/> <a href=\"#AVAILABILITY\">AVAILABILITY<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a><br \/> <a href=\"#BUGS\">BUGS<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">pcibios_find_class, pcibios_find_device \u2212 find a PCI class or device<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <linux\/bios32.h> int pcibios_find_class(unsigned int<\/b> <i>class_code<\/i><b>, unsigned short<\/b> <i>index<\/i><b>, <br \/> unsigned char*<\/b> <i>bus<\/i><b>, unsigned char*<\/b> <i>device_fn<\/i><b>); <br \/> int pcibios_find_device(unsigned\u00a0short\u00a0\u00a0<\/b><i>vendor<\/i><b>, <br \/> unsigned\u00a0short\u00a0<\/b><i>device_id\u00a0&#8220;,<\/i><b>unsigned\u00a0short\u00a0&#8220;<\/b><i>index<\/i><b>, unsigned\u00a0char*\u00a0<\/b><i>bus<\/i><b>, <br \/> unsigned\u00a0char*\u00a0<\/b><i>device_fn<\/i><b>);<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>pcibios_find_class<\/b> function searches for a certain class of device on the PCI bus. In this instance, class is used to represent a few different categories of devices. Some examples are storage, network, display, and memory classes. The classes are defined by the PCI Specification, and the <i>class_code<\/i> is matched with the dword in the configuration space of the device at offset 0x08.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>pcibios_find_device<\/b> function finds a device on the PCI bus that has the matching device and vendor ids. The vendor ids are assigned to the PCI Sig to vendors, who in turn assign device ids to the devices they develop. The vendor and device ids are encoded in dword 0x00 of the configuration space.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Both <b>pcibios_find_class<\/b> and <b>pcibios_find_device<\/b> include an extra <i>index<\/i> parameter, which is used to select the specific device if there are multiple matches. An <i>index<\/i> of 0 matches the firts located board, 1 the second, and so on.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>bus<\/i> and <i>device_fn<\/i> parameters are PCI specific cookies that are passed to other pcibios functions to access the configuration space of the located device.<\/p>\n<h2>RETURN VALUE <a name=\"RETURN VALUE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">On success, the functions return <i>PCIBIOS_SUCCESSFUL<\/i>. Otherwise, one of the following error codes is returned:<\/p>\n<p style=\"margin-left:22%;\">PCIBIOS_DEVICE_NOT_FOUND<\/p>\n<p style=\"margin-left:32%;\">There is no device that matches the search criteria,<\/p>\n<p style=\"margin-left:22%;\">PCIBIOS_BAD_VENDOR_ID<\/p>\n<p style=\"margin-left:32%;\">The vendor id is invalid. (0xffff is not a valid id.)<\/p>\n<p style=\"margin-left:22%;\">PCIBIOS_FUNC_NOT_SUPPRTED<\/p>\n<p style=\"margin-left:32%;\">The PCI subsystem is not available<\/p>\n<h2>AVAILABILITY <a name=\"AVAILABILITY\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Linux 1.0+<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>pcibios_present<\/b>(9)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\/usr\/include\/linux\/pci.h<\/b>, <b>\/usr\/include\/linux\/bios32.h<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>PCI Local Bus Specification<\/i><\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Kirk Petersen (kirk@speakeasy.org)<\/p>\n<h2>BUGS <a name=\"BUGS\"><\/a> <\/h2>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  pcibios_find_class, pcibios_find_device \u2212 find a PCI class or device <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1222],"tags":[1226,1223,1225,1231],"class_list":["post-4151","post","type-post","status-publish","format-standard","hentry","category-9-rutinas-del-nucleo","tag-1226","tag-kernel","tag-man9","tag-pcibios_find_class"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=4151"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4151\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}