Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
search.c File Reference
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include "pci.h"

Go to the source code of this file.

Functions

 DECLARE_RWSEM (pci_bus_sem)
 
 EXPORT_SYMBOL_GPL (pci_bus_sem)
 
struct pci_devpci_find_upstream_pcie_bridge (struct pci_dev *pdev)
 
struct pci_buspci_find_bus (int domain, int busnr)
 
struct pci_buspci_find_next_bus (const struct pci_bus *from)
 
struct pci_devpci_get_slot (struct pci_bus *bus, unsigned int devfn)
 
struct pci_devpci_get_domain_bus_and_slot (int domain, unsigned int bus, unsigned int devfn)
 
 EXPORT_SYMBOL (pci_get_domain_bus_and_slot)
 
struct pci_devpci_get_subsys (unsigned int vendor, unsigned int device, unsigned int ss_vendor, unsigned int ss_device, struct pci_dev *from)
 
struct pci_devpci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from)
 
struct pci_devpci_get_class (unsigned int class, struct pci_dev *from)
 
int pci_dev_present (const struct pci_device_id *ids)
 
 EXPORT_SYMBOL (pci_dev_present)
 
 EXPORT_SYMBOL (pci_find_bus)
 
 EXPORT_SYMBOL (pci_find_next_bus)
 
 EXPORT_SYMBOL (pci_get_device)
 
 EXPORT_SYMBOL (pci_get_subsys)
 
 EXPORT_SYMBOL (pci_get_slot)
 
 EXPORT_SYMBOL (pci_get_class)
 

Function Documentation

DECLARE_RWSEM ( pci_bus_sem  )
EXPORT_SYMBOL ( pci_get_domain_bus_and_slot  )
EXPORT_SYMBOL ( pci_dev_present  )
EXPORT_SYMBOL ( pci_find_bus  )
EXPORT_SYMBOL ( pci_find_next_bus  )
EXPORT_SYMBOL ( pci_get_device  )
EXPORT_SYMBOL ( pci_get_subsys  )
EXPORT_SYMBOL ( pci_get_slot  )
EXPORT_SYMBOL ( pci_get_class  )
EXPORT_SYMBOL_GPL ( pci_bus_sem  )
int pci_dev_present ( const struct pci_device_id ids)

pci_dev_present - Returns 1 if device matching the device list is present, 0 if not. : A pointer to a null terminated list of struct pci_device_id structures that describe the type of PCI device the caller is trying to find.

Obvious fact: You do not have a reference to any device that might be found by this function, so if that device is removed from the system right after this function is finished, the value will be stale. Use this function to find devices that are usually built into a system, or for a general hint as to if another device happens to be present at this specific moment in time.

Definition at line 315 of file search.c.

struct pci_bus* pci_find_bus ( int  domain,
int  busnr 
)
read

pci_find_bus - locate PCI bus from a given domain and bus number : number of PCI domain to search : number of desired PCI bus

Given a PCI bus number and domain number, the desired PCI bus is located in the global list of PCI buses. If the bus is found, a pointer to its data structure is returned. If no bus is found, NULL is returned.

Definition at line 80 of file search.c.

struct pci_bus* pci_find_next_bus ( const struct pci_bus from)
read

pci_find_next_bus - begin or continue searching for a PCI bus : Previous PCI bus found, or NULL for new search.

Iterates through the list of known PCI busses. A new search is initiated by passing NULL as the argument. Otherwise if is not NULL, searches continue from next device on the global list.

Definition at line 105 of file search.c.

struct pci_dev* pci_find_upstream_pcie_bridge ( struct pci_dev pdev)
read

pci_find_upstream_pcie_bridge - find upstream PCIe-to-PCI bridge of a device : the PCI device

if the device is PCIE, return NULL if the device isn't connected to a PCIe bridge (that is its parent is a legacy PCI bridge and the bridge is directly connected to bus 0), return its parent

Definition at line 28 of file search.c.

struct pci_dev* pci_get_class ( unsigned int  class,
struct pci_dev from 
)
read

Definition at line 290 of file search.c.

struct pci_dev* pci_get_device ( unsigned int  vendor,
unsigned int  device,
struct pci_dev from 
)
read

pci_get_device - begin or continue searching for a PCI device by vendor/device id : PCI vendor id to match, or PCI_ANY_ID to match all vendor ids : PCI device id to match, or PCI_ANY_ID to match all device ids : Previous PCI device found in search, or NULL for new search.

Iterates through the list of known PCI devices. If a PCI device is found with a matching and , the reference count to the device is incremented and a pointer to its device structure is returned. Otherwise, NULL is returned. A new search is initiated by passing NULL as the argument. Otherwise if is not NULL, searches continue from next device on the global list. The reference count for is always decremented if it is not NULL.

Definition at line 271 of file search.c.

struct pci_dev* pci_get_domain_bus_and_slot ( int  domain,
unsigned int  bus,
unsigned int  devfn 
)
read

pci_get_domain_bus_and_slot - locate PCI device for a given PCI domain (segment), bus, and slot : PCI domain/segment on which the PCI device resides. : PCI bus on which desired PCI device resides : 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.

Given a PCI domain, bus, and slot/function number, the desired PCI device is located in the list of PCI devices. If the device is found, its reference count is increased and this function returns a pointer to its data structure. The caller must decrement the reference count by calling pci_dev_put(). If no device is found, NULL is returned.

Definition at line 167 of file search.c.

struct pci_dev* pci_get_slot ( struct pci_bus bus,
unsigned int  devfn 
)
read

pci_get_slot - locate PCI device for a given PCI slot : PCI bus on which desired PCI device resides : 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.

Given a PCI bus and slot/function number, the desired PCI device is located in the list of PCI devices. If the device is found, its reference count is increased and this function returns a pointer to its data structure. The caller must decrement the reference count by calling pci_dev_put(). If no device is found, NULL is returned.

Definition at line 133 of file search.c.

struct pci_dev* pci_get_subsys ( unsigned int  vendor,
unsigned int  device,
unsigned int  ss_vendor,
unsigned int  ss_device,
struct pci_dev from 
)
read

pci_get_subsys - begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id : PCI vendor id to match, or PCI_ANY_ID to match all vendor ids : PCI device id to match, or PCI_ANY_ID to match all device ids : PCI subsystem vendor id to match, or PCI_ANY_ID to match all vendor ids : PCI subsystem device id to match, or PCI_ANY_ID to match all device ids : Previous PCI device found in search, or NULL for new search.

Iterates through the list of known PCI devices. If a PCI device is found with a matching , , and , a pointer to its device structure is returned, and the reference count to the device is incremented. Otherwise, NULL is returned. A new search is initiated by passing NULL as the argument. Otherwise if is not NULL, searches continue from next device on the global list. The reference count for is always decremented if it is not NULL.

Definition at line 242 of file search.c.