Main Page | Modules | Data Structures | File List | Data Fields | Related Pages

PCI
[Linux 2.6 support]

PCI. More...

Defines

#define PCI_IDS_MAX_LINE_LEN   512
 Maximum length of lines in pci.ids.


Functions

void pci_ids_line_iter_init ()
 Initialize the pci.ids line iterator to the beginning of the file.

char * pci_ids_line_iter_get_line (unsigned int *line_len)
 Get the next line from pci.ids.

dbus_bool_t pci_ids_line_iter_has_more ()
 See if there are more lines to process in pci.ids.

void pci_ids_find (int vendor_id, int product_id, int subsys_vendor_id, int subsys_product_id, char **vendor_name, char **product_name, char **subsys_vendor_name, char **subsys_product_name)
 Find the names for a PCI device.

dbus_bool_t pci_ids_load (const char *path)
 Load the PCI database used for mapping vendor, product, subsys_vendor and subsys_product numbers into names.

dbus_bool_t pci_ids_free ()
 Free resources used by to store the PCI database.

char * pci_device_compute_udi (HalDevice *d, int append_num)
 This function will compute the device uid based on other properties of the device.

void pci_device_init (BusDeviceHandler *self)
 Init function for PCI handling.

void pci_device_shutdown (BusDeviceHandler *self)
 Shutdown function for PCI handling.

void pci_device_pre_process (BusDeviceHandler *self, HalDevice *d, const char *sysfs_path, struct sysfs_device *device)

Variables

char * pci_ids = NULL
 Pointer to where the pci.ids file is loaded.

unsigned int pci_ids_len
 Length of data store at at pci_ids.

unsigned int pci_ids_iter_pos
 Iterator position into pci_ids.

BusDeviceHandler pci_bus_handler
 Method specialisations for bustype pci.


Detailed Description

PCI.


Function Documentation

char* pci_device_compute_udi HalDevice *  d,
int  append_num
[static]
 

This function will compute the device uid based on other properties of the device.

Specifically, the following properties are required:

  • pci.idVendor, pci.idProduct

Other properties may also be used.

Requirements for uid:

  • do not rely on bus, port etc.; we want this id to be as unique for the device as we can
  • make sure it doesn't rely on properties that cannot be obtained from the minimal information we can obtain on an unplug event

Parameters:
d HalDevice object
append_num Number to append to name if not -1
Returns:
New unique device id; only good until the next invocation of this function

Definition at line 346 of file pci_bus_device.c.

void pci_ids_find int  vendor_id,
int  product_id,
int  subsys_vendor_id,
int  subsys_product_id,
char **  vendor_name,
char **  product_name,
char **  subsys_vendor_name,
char **  subsys_product_name
[static]
 

Find the names for a PCI device.

The pointers returned are only valid until the next invocation of this function.

Parameters:
vendor_id PCI vendor id or 0 if unknown
product_id PCI product id or 0 if unknown
subsys_vendor_id PCI subsystem vendor id or 0 if unknown
subsys_product_id PCI subsystem product id or 0 if unknown
vendor_name Set to pointer of result or #NULL
product_name Set to pointer of result or #NULL
subsys_vendor_name Set to pointer of result or #NULL
subsys_product_name Set to pointer of result or #NULL

Definition at line 126 of file pci_bus_device.c.

References pci_ids_line_iter_get_line(), pci_ids_line_iter_has_more(), pci_ids_line_iter_init(), and PCI_IDS_MAX_LINE_LEN.

dbus_bool_t pci_ids_free  )  [static]
 

Free resources used by to store the PCI database.

Parameters:
#FALSE if the PCI database wasn't loaded

Definition at line 316 of file pci_bus_device.c.

References pci_ids.

Referenced by pci_device_shutdown().

char* pci_ids_line_iter_get_line unsigned int *  line_len  )  [static]
 

Get the next line from pci.ids.

Parameters:
line_len Pointer to where number of bytes in line will be stored
Returns:
Pointer to the line; only valid until the next invocation of this function

Definition at line 79 of file pci_bus_device.c.

References pci_ids, pci_ids_iter_pos, pci_ids_len, and PCI_IDS_MAX_LINE_LEN.

Referenced by pci_ids_find().

dbus_bool_t pci_ids_line_iter_has_more  )  [static]
 

See if there are more lines to process in pci.ids.

Returns:
#TRUE iff there are more lines to process

Definition at line 105 of file pci_bus_device.c.

References pci_ids_iter_pos, and pci_ids_len.

Referenced by pci_ids_find().

dbus_bool_t pci_ids_load const char *  path  )  [static]
 

Load the PCI database used for mapping vendor, product, subsys_vendor and subsys_product numbers into names.

Parameters:
path Path of the pci.ids file, e.g. /usr/share/hwdata/pci.ids
Returns:
#TRUE if the file was succesfully loaded

Definition at line 279 of file pci_bus_device.c.

References DIE, pci_ids, and pci_ids_len.

Referenced by pci_device_init().


Variable Documentation

BusDeviceHandler pci_bus_handler
 

Initial value:

 {
    pci_device_init,           
    bus_device_detection_done, 
    pci_device_shutdown,       
    bus_device_tick,           
    bus_device_accept,         
    bus_device_visit,          
    bus_device_removed,        
    pci_device_compute_udi,    
    pci_device_pre_process,    
    bus_device_got_udi,        
    "pci",                     
    "pci"                      
}
Method specialisations for bustype pci.

Definition at line 483 of file pci_bus_device.c.


Generated on Sat Apr 24 19:57:50 2004 for HAL by doxygen 1.3.6-20040222