Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
pci_hotplug_core.c File Reference
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/list.h>
#include <linux/kobject.h>
#include <linux/sysfs.h>
#include <linux/pagemap.h>
#include <linux/init.h>
#include <linux/mount.h>
#include <linux/namei.h>
#include <linux/mutex.h>
#include <linux/pci.h>
#include <linux/pci_hotplug.h>
#include <asm/uaccess.h>
#include "../pci.h"

Go to the source code of this file.

Macros

#define MY_NAME   "pci_hotplug"
 
#define dbg(fmt, arg...)   do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt , MY_NAME , __func__ , ## arg); } while (0)
 
#define err(format, arg...)   printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
 
#define info(format, arg...)   printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
 
#define warn(format, arg...)   printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
 
#define DRIVER_VERSION   "0.5"
 
#define DRIVER_AUTHOR   "Greg Kroah-Hartman <[email protected]>, Scott Murray <[email protected]>"
 
#define DRIVER_DESC   "PCI Hot Plug PCI Core"
 
#define GET_STATUS(name, type)
 

Functions

: name registered with kobject core

__pci_hp_register - register a hotplug_slot with the PCI hotplug subsystem : bus this slot is on : pointer to the &struct hotplug_slot to register : device number

: caller module owner : caller module name

Registers a hotplug slot with the pci hotplug subsystem, which will allow userspace interaction to the slot.

Returns 0 if successful, anything else for an error.

int __pci_hp_register (struct hotplug_slot *slot, struct pci_bus *bus, int devnr, const char *name, struct module *owner, const char *mod_name)
 
int pci_hp_deregister (struct hotplug_slot *hotplug)
 
int __must_check pci_hp_change_slot_info (struct hotplug_slot *hotplug, struct hotplug_slot_info *info)
 
 module_init (pci_hotplug_init)
 
 module_exit (pci_hotplug_exit)
 
 MODULE_AUTHOR (DRIVER_AUTHOR)
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 
 MODULE_LICENSE ("GPL")
 
 module_param (debug, bool, 0644)
 
 MODULE_PARM_DESC (debug,"Debugging mode enabled or not")
 
 EXPORT_SYMBOL_GPL (__pci_hp_register)
 
 EXPORT_SYMBOL_GPL (pci_hp_deregister)
 
 EXPORT_SYMBOL_GPL (pci_hp_change_slot_info)
 

Macro Definition Documentation

#define dbg (   fmt,
  arg... 
)    do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt , MY_NAME , __func__ , ## arg); } while (0)

Definition at line 47 of file pci_hotplug_core.c.

#define DRIVER_AUTHOR   "Greg Kroah-Hartman <[email protected]>, Scott Murray <[email protected]>"

Definition at line 57 of file pci_hotplug_core.c.

#define DRIVER_DESC   "PCI Hot Plug PCI Core"

Definition at line 58 of file pci_hotplug_core.c.

#define DRIVER_VERSION   "0.5"

Definition at line 56 of file pci_hotplug_core.c.

#define err (   format,
  arg... 
)    printk(KERN_ERR "%s: " format , MY_NAME , ## arg)

Definition at line 48 of file pci_hotplug_core.c.

#define GET_STATUS (   name,
  type 
)
Value:
static int get_##name (struct hotplug_slot *slot, type *value) \
{ \
int retval = 0; \
if (!try_module_get(ops->owner)) \
return -ENODEV; \
if (ops->get_##name) \
retval = ops->get_##name(slot, value); \
else \
*value = slot->info->name; \
module_put(ops->owner); \
return retval; \
}

Definition at line 75 of file pci_hotplug_core.c.

#define info (   format,
  arg... 
)    printk(KERN_INFO "%s: " format , MY_NAME , ## arg)

Definition at line 49 of file pci_hotplug_core.c.

#define MY_NAME   "pci_hotplug"

Definition at line 45 of file pci_hotplug_core.c.

#define warn (   format,
  arg... 
)    printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)

Definition at line 50 of file pci_hotplug_core.c.

Function Documentation

int __pci_hp_register ( struct hotplug_slot *  slot,
struct pci_bus bus,
int  devnr,
const char name,
struct module owner,
const char mod_name 
)

Definition at line 434 of file pci_hotplug_core.c.

EXPORT_SYMBOL_GPL ( __pci_hp_register  )
EXPORT_SYMBOL_GPL ( pci_hp_deregister  )
EXPORT_SYMBOL_GPL ( pci_hp_change_slot_info  )
MODULE_AUTHOR ( DRIVER_AUTHOR  )
MODULE_DESCRIPTION ( DRIVER_DESC  )
module_exit ( pci_hotplug_exit  )
module_init ( pci_hotplug_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
bool  ,
0644   
)
MODULE_PARM_DESC ( debug  ,
"Debugging mode enabled or not"   
)
int __must_check pci_hp_change_slot_info ( struct hotplug_slot *  hotplug,
struct hotplug_slot_info info 
)

pci_hp_change_slot_info - changes the slot's information structure in the core : pointer to the slot whose info has changed : pointer to the info copy into the slot's info structure

must have been registered with the pci hotplug subsystem previously with a call to pci_hp_register().

Returns 0 if successful, anything else for an error.

Definition at line 527 of file pci_hotplug_core.c.

int pci_hp_deregister ( struct hotplug_slot *  hotplug)

pci_hp_deregister - deregister a hotplug_slot with the PCI hotplug subsystem : pointer to the &struct hotplug_slot to deregister

The must have been registered with the pci hotplug subsystem previously with a call to pci_hp_register().

Returns 0 if successful, anything else for an error.

Definition at line 488 of file pci_hotplug_core.c.