Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
eeh_sysfs.c File Reference
#include <linux/pci.h>
#include <linux/stat.h>
#include <asm/ppc-pci.h>
#include <asm/pci-bridge.h>

Go to the source code of this file.

Macros

#define EEH_SHOW_ATTR(_name, _memb, _format)
 

Functions

 EEH_SHOW_ATTR (eeh_mode, mode,"0x%x")
 
 EEH_SHOW_ATTR (eeh_config_addr, config_addr,"0x%x")
 
 EEH_SHOW_ATTR (eeh_pe_config_addr, pe_config_addr,"0x%x")
 
void eeh_sysfs_add_device (struct pci_dev *pdev)
 
void eeh_sysfs_remove_device (struct pci_dev *pdev)
 

Macro Definition Documentation

#define EEH_SHOW_ATTR (   _name,
  _memb,
  _format 
)
Value:
static ssize_t eeh_show_##_name(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
struct eeh_dev *edev = pci_dev_to_eeh_dev(pdev); \
if (!edev) \
return 0; \
\
return sprintf(buf, _format "\n", edev->_memb); \
} \
static DEVICE_ATTR(_name, S_IRUGO, eeh_show_##_name, NULL);

EEH_SHOW_ATTR – Create sysfs entry for eeh statistic : name of file in sysfs directory : name of member in struct pci_dn to access : printf format for display

All of the attributes look very similar, so just auto-gen a cut-n-paste routine to display them.

Definition at line 39 of file eeh_sysfs.c.

Function Documentation

EEH_SHOW_ATTR ( eeh_mode  ,
mode  ,
"0x%x"   
)
EEH_SHOW_ATTR ( eeh_config_addr  ,
config_addr  ,
"0x%x"   
)
EEH_SHOW_ATTR ( eeh_pe_config_addr  ,
pe_config_addr  ,
"0x%x"   
)
void eeh_sysfs_add_device ( struct pci_dev pdev)

Definition at line 57 of file eeh_sysfs.c.

void eeh_sysfs_remove_device ( struct pci_dev pdev)

Definition at line 69 of file eeh_sysfs.c.