Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
rpaphp.h File Reference
#include <linux/pci.h>
#include <linux/pci_hotplug.h>

Go to the source code of this file.

Data Structures

struct  slot
 

Macros

#define DR_INDICATOR   9002
 
#define DR_ENTITY_SENSE   9003
 
#define POWER_ON   100
 
#define POWER_OFF   0
 
#define LED_OFF   0
 
#define LED_ON   1 /* continuous on */
 
#define LED_ID   2 /* slow blinking */
 
#define LED_ACTION   3 /* fast blinking */
 
#define EMPTY   0 /* No card in slot */
 
#define PRESENT   1 /* Card in slot */
 
#define MY_NAME   "rpaphp"
 
#define dbg(format, arg...)
 
#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 NOT_VALID   3
 
#define NOT_CONFIGURED   2
 
#define CONFIGURED   1
 
#define EMPTY   0
 

Functions

int rpaphp_enable_slot (struct slot *slot)
 
int rpaphp_get_sensor_state (struct slot *slot, int *state)
 
int rpaphp_add_slot (struct device_node *dn)
 
int rpaphp_get_drc_props (struct device_node *dn, int *drc_index, char **drc_name, char **drc_type, int *drc_power_domain)
 
void dealloc_slot_struct (struct slot *slot)
 
struct slotalloc_slot_struct (struct device_node *dn, int drc_index, char *drc_name, int power_domain)
 
int rpaphp_register_slot (struct slot *slot)
 
int rpaphp_deregister_slot (struct slot *slot)
 

Variables

bool rpaphp_debug
 
struct hotplug_slot_ops rpaphp_hotplug_slot_ops
 
struct list_head rpaphp_slot_head
 

Macro Definition Documentation

#define CONFIGURED   1

Definition at line 64 of file rpaphp.h.

#define dbg (   format,
  arg... 
)
Value:
do { \
if (rpaphp_debug) \
printk(KERN_DEBUG "%s: " format, \
MY_NAME , ## arg); \
} while (0)

Definition at line 50 of file rpaphp.h.

#define DR_ENTITY_SENSE   9003

Definition at line 34 of file rpaphp.h.

#define DR_INDICATOR   9002

Definition at line 33 of file rpaphp.h.

#define EMPTY   0 /* No card in slot */

Definition at line 65 of file rpaphp.h.

#define EMPTY   0

Definition at line 65 of file rpaphp.h.

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

Definition at line 56 of file rpaphp.h.

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

Definition at line 57 of file rpaphp.h.

#define LED_ACTION   3 /* fast blinking */

Definition at line 42 of file rpaphp.h.

#define LED_ID   2 /* slow blinking */

Definition at line 41 of file rpaphp.h.

#define LED_OFF   0

Definition at line 39 of file rpaphp.h.

#define LED_ON   1 /* continuous on */

Definition at line 40 of file rpaphp.h.

#define MY_NAME   "rpaphp"

Definition at line 48 of file rpaphp.h.

#define NOT_CONFIGURED   2

Definition at line 63 of file rpaphp.h.

#define NOT_VALID   3

Definition at line 62 of file rpaphp.h.

#define POWER_OFF   0

Definition at line 37 of file rpaphp.h.

#define POWER_ON   100

Definition at line 36 of file rpaphp.h.

#define PRESENT   1 /* Card in slot */

Definition at line 46 of file rpaphp.h.

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

Definition at line 58 of file rpaphp.h.

Function Documentation

struct slot* alloc_slot_struct ( struct device_node dn,
int  drc_index,
char drc_name,
int  power_domain 
)
read

Definition at line 50 of file rpaphp_slot.c.

void dealloc_slot_struct ( struct slot slot)

Definition at line 42 of file rpaphp_slot.c.

int rpaphp_add_slot ( struct device_node dn)

rpaphp_add_slot – declare a hotplug slot to the hotplug subsystem. : device node of slot

This subroutine will register a hotplugable slot with the PCI hotplug infrastructure. This routine is typically called during boot time, if the hotplug slots are present at boot time, or is called later, by the dlpar add code, if the slot is being dynamically added during runtime.

If the device node points at an embedded (built-in) slot, this routine will just return without doing anything, since embedded slots cannot be hotplugged.

To remove a slot, it suffices to call rpaphp_deregister_slot().

Definition at line 304 of file rpaphp_core.c.

int rpaphp_deregister_slot ( struct slot slot)

Definition at line 98 of file rpaphp_slot.c.

int rpaphp_enable_slot ( struct slot slot)

rpaphp_enable_slot - record slot state, config pci device : target &slot

Initialize values in the slot, and the hotplug_slot info structures to indicate if there is a pci card plugged into the slot. If the slot is not empty, run the pcibios routine to get pcibios stuff correctly set up.

Definition at line 76 of file rpaphp_pci.c.

int rpaphp_get_drc_props ( struct device_node dn,
int drc_index,
char **  drc_name,
char **  drc_type,
int drc_power_domain 
)

Definition at line 202 of file rpaphp_core.c.

int rpaphp_get_sensor_state ( struct slot slot,
int state 
)

Definition at line 35 of file rpaphp_pci.c.

int rpaphp_register_slot ( struct slot slot)

Definition at line 117 of file rpaphp_slot.c.

Variable Documentation

bool rpaphp_debug

Definition at line 40 of file rpaphp_core.c.

struct hotplug_slot_ops rpaphp_hotplug_slot_ops

Definition at line 428 of file rpaphp_core.c.

struct list_head rpaphp_slot_head