Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
pci-sysfs.c File Reference
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/pci.h>
#include <linux/stat.h>
#include <linux/export.h>
#include <linux/topology.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/capability.h>
#include <linux/security.h>
#include <linux/pci-aspm.h>
#include <linux/slab.h>
#include <linux/vgaarb.h>
#include <linux/pm_runtime.h>
#include "pci.h"

Go to the source code of this file.


#define pci_config_attr(field, format_string)


 pci_config_attr (vendor,"0x%04x\n")
 pci_config_attr (device,"0x%04x\n")
 pci_config_attr (subsystem_vendor,"0x%04x\n")
 pci_config_attr (subsystem_device,"0x%04x\n")
 pci_config_attr (class,"0x%06x\n")
 pci_config_attr (irq,"%u\n")
int __weak pci_create_resource_files (struct pci_dev *dev)
void __weak pci_remove_resource_files (struct pci_dev *dev)
int __weak pcibios_add_platform_entries (struct pci_dev *dev)
int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
void pci_remove_sysfs_dev_files (struct pci_dev *pdev)
 late_initcall (pci_sysfs_init)


struct device_attribute pci_dev_attrs []
struct device_attribute pcibus_dev_attrs []
struct device_attribute vga_attr = __ATTR_RO(boot_vga)

Macro Definition Documentation

#define pci_config_attr (   field,
static ssize_t \
field##_show(struct device *dev, struct device_attribute *attr, char *buf) \
{ \
pdev = to_pci_dev (dev); \
return sprintf (buf, format_string, pdev->field); \

Definition at line 37 of file pci-sysfs.c.

Function Documentation

late_initcall ( pci_sysfs_init  )
pci_config_attr ( vendor  ,
pci_config_attr ( device  ,
pci_config_attr ( subsystem_vendor  ,
pci_config_attr ( subsystem_device  ,
pci_config_attr ( class  ,
pci_config_attr ( irq  ,
int __weak pci_create_resource_files ( struct pci_dev dev)

pci_create_resource_files - create resource files in sysfs for : dev in question

Walk the resources in creating files for each resource available.

Definition at line 1061 of file pci-sysfs.c.

int __must_check pci_create_sysfs_dev_files ( struct pci_dev pdev)

Definition at line 1226 of file pci-sysfs.c.

void __weak pci_remove_resource_files ( struct pci_dev dev)

pci_remove_resource_files - cleanup resource files : dev to cleanup

If we created resource files for , remove them from sysfs and free their resources.

Definition at line 1062 of file pci-sysfs.c.

void pci_remove_sysfs_dev_files ( struct pci_dev pdev)

pci_remove_sysfs_dev_files - cleanup PCI specific sysfs files : device whose entries we should free

Cleanup when is removed from sysfs.

Definition at line 1332 of file pci-sysfs.c.

int __weak pcibios_add_platform_entries ( struct pci_dev dev)

Definition at line 1152 of file pci-sysfs.c.

Variable Documentation

struct device_attribute pci_dev_attrs[]
Initial value:
= {
__ATTR(enable, 0600, is_enabled_show, is_enabled_store),
__ATTR(msi_bus, 0644, msi_bus_show, msi_bus_store),

Definition at line 407 of file pci-sysfs.c.

struct device_attribute pcibus_dev_attrs[]
Initial value:
= {
__ATTR(cpuaffinity, S_IRUGO, pci_bus_show_cpumaskaffinity, NULL),
__ATTR(cpulistaffinity, S_IRUGO, pci_bus_show_cpulistaffinity, NULL),

Definition at line 437 of file pci-sysfs.c.

struct device_attribute vga_attr = __ATTR_RO(boot_vga)

Definition at line 459 of file pci-sysfs.c.