---
name: "pci_get_bus_and_slot"
section: "9"
platform: "linux"
package: "linux-manual-2.6.32"
version: "2.6.32-48squeeze6"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/pci_get_bus_and_slot"
---

# pci\_get\_bus\_and\_slot(9)

locate PCI device from a given PCI bus & slot

## NAME

pci\_get\_bus\_and\_slot - locate PCI device from a given PCI bus & slot

## SYNOPSIS

**struct pci\_dev \* pci\_get\_bus\_and\_slot(unsigned int** *bus***, unsigned int** *devfn***);**

## ARGUMENTS

*bus*

number of PCI bus on which desired PCI device resides

*devfn*

encodes number of PCI slot in which the desired PCI device resides and the logical device number within that slot in case of multi-function devices.

## NOTE

the bus/slot search is limited to PCI domain (segment) 0.

Given a PCI bus and slot/function number, the desired PCI device is located in system global list of PCI devices. If the device is found, a pointer to its data structure is returned. If no device is found, **NULL** is returned. The returned device has its reference count bumped by one.

## COPYRIGHT
