'\" t .\" Title: pci_get_device .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Hardware Interfaces .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "PCI_GET_DEVICE" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Hardware Interfaces" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" pci_get_device \- begin or continue searching for a PCI device by vendor/device id .SH "SYNOPSIS" .HP \w'struct\ pci_dev\ *\ pci_get_device('u .BI "struct pci_dev * pci_get_device(unsigned\ int\ " "vendor" ", unsigned\ int\ " "device" ", struct\ pci_dev\ *\ " "from" ");" .SH "ARGUMENTS" .PP \fIvendor\fR .RS 4 PCI vendor id to match, or \fBPCI_ANY_ID\fR to match all vendor ids .RE .PP \fIdevice\fR .RS 4 PCI device id to match, or \fBPCI_ANY_ID\fR to match all device ids .RE .PP \fIfrom\fR .RS 4 Previous PCI device found in search, or \fBNULL\fR for new search\&. .RE .SH "DESCRIPTION" .PP Iterates through the list of known PCI devices\&. If a PCI device is found with a matching \fIvendor\fR and \fIdevice\fR, the reference count to the device is incremented and a pointer to its device structure is returned\&. Otherwise, \fBNULL\fR is returned\&. A new search is initiated by passing \fBNULL\fR as the \fIfrom\fR argument\&. Otherwise if \fIfrom\fR is not \fBNULL\fR, searches continue from next device on the global list\&. The reference count for \fIfrom\fR is always decremented if it is not \fBNULL\fR\&. .SH "COPYRIGHT" .br