Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
pciehp.h File Reference
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/pci_hotplug.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/pcieport_if.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>

Go to the source code of this file.

Data Structures

struct  slot
 
struct  event_info
 
struct  controller
 

Macros

#define MY_NAME   "pciehp"
 
#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 ctrl_dbg(ctrl, format, arg...)
 
#define ctrl_err(ctrl, format, arg...)   dev_err(&ctrl->pcie->device, format, ## arg)
 
#define ctrl_info(ctrl, format, arg...)   dev_info(&ctrl->pcie->device, format, ## arg)
 
#define ctrl_warn(ctrl, format, arg...)   dev_warn(&ctrl->pcie->device, format, ## arg)
 
#define SLOT_NAME_SIZE   10
 
#define INT_BUTTON_IGNORE   0
 
#define INT_PRESENCE_ON   1
 
#define INT_PRESENCE_OFF   2
 
#define INT_SWITCH_CLOSE   3
 
#define INT_SWITCH_OPEN   4
 
#define INT_POWER_FAULT   5
 
#define INT_POWER_FAULT_CLEAR   6
 
#define INT_BUTTON_PRESS   7
 
#define INT_BUTTON_RELEASE   8
 
#define INT_BUTTON_CANCEL   9
 
#define STATIC_STATE   0
 
#define BLINKINGON_STATE   1
 
#define BLINKINGOFF_STATE   2
 
#define POWERON_STATE   3
 
#define POWEROFF_STATE   4
 
#define ATTN_BUTTN(ctrl)   ((ctrl)->slot_cap & PCI_EXP_SLTCAP_ABP)
 
#define POWER_CTRL(ctrl)   ((ctrl)->slot_cap & PCI_EXP_SLTCAP_PCP)
 
#define MRL_SENS(ctrl)   ((ctrl)->slot_cap & PCI_EXP_SLTCAP_MRLSP)
 
#define ATTN_LED(ctrl)   ((ctrl)->slot_cap & PCI_EXP_SLTCAP_AIP)
 
#define PWR_LED(ctrl)   ((ctrl)->slot_cap & PCI_EXP_SLTCAP_PIP)
 
#define HP_SUPR_RM(ctrl)   ((ctrl)->slot_cap & PCI_EXP_SLTCAP_HPS)
 
#define EMI(ctrl)   ((ctrl)->slot_cap & PCI_EXP_SLTCAP_EIP)
 
#define NO_CMD_CMPL(ctrl)   ((ctrl)->slot_cap & PCI_EXP_SLTCAP_NCCS)
 
#define PSN(ctrl)   ((ctrl)->slot_cap >> 19)
 
#define pciehp_firmware_init()   do {} while (0)
 

Functions

int pciehp_sysfs_enable_slot (struct slot *slot)
 
int pciehp_sysfs_disable_slot (struct slot *slot)
 
u8 pciehp_handle_attention_button (struct slot *p_slot)
 
u8 pciehp_handle_switch_change (struct slot *p_slot)
 
u8 pciehp_handle_presence_change (struct slot *p_slot)
 
u8 pciehp_handle_power_fault (struct slot *p_slot)
 
int pciehp_configure_device (struct slot *p_slot)
 
int pciehp_unconfigure_device (struct slot *p_slot)
 
void pciehp_queue_pushbutton_work (struct work_struct *work)
 
struct controllerpcie_init (struct pcie_device *dev)
 
int pcie_init_notification (struct controller *ctrl)
 
int pciehp_enable_slot (struct slot *p_slot)
 
int pciehp_disable_slot (struct slot *p_slot)
 
int pcie_enable_notification (struct controller *ctrl)
 
int pciehp_power_on_slot (struct slot *slot)
 
int pciehp_power_off_slot (struct slot *slot)
 
int pciehp_get_power_status (struct slot *slot, u8 *status)
 
int pciehp_get_attention_status (struct slot *slot, u8 *status)
 
int pciehp_set_attention_status (struct slot *slot, u8 status)
 
int pciehp_get_latch_status (struct slot *slot, u8 *status)
 
int pciehp_get_adapter_status (struct slot *slot, u8 *status)
 
int pciehp_query_power_fault (struct slot *slot)
 
void pciehp_green_led_on (struct slot *slot)
 
void pciehp_green_led_off (struct slot *slot)
 
void pciehp_green_led_blink (struct slot *slot)
 
int pciehp_check_link_status (struct controller *ctrl)
 
void pciehp_release_ctrl (struct controller *ctrl)
 

Variables

bool pciehp_poll_mode
 
int pciehp_poll_time
 
bool pciehp_debug
 
bool pciehp_force
 
struct workqueue_structpciehp_wq
 

Macro Definition Documentation

#define ATTN_BUTTN (   ctrl)    ((ctrl)->slot_cap & PCI_EXP_SLTCAP_ABP)

Definition at line 120 of file pciehp.h.

#define ATTN_LED (   ctrl)    ((ctrl)->slot_cap & PCI_EXP_SLTCAP_AIP)

Definition at line 123 of file pciehp.h.

#define BLINKINGOFF_STATE   2

Definition at line 116 of file pciehp.h.

#define BLINKINGON_STATE   1

Definition at line 115 of file pciehp.h.

#define ctrl_dbg (   ctrl,
  format,
  arg... 
)
Value:
do { \
if (pciehp_debug) \
dev_printk(KERN_DEBUG, &ctrl->pcie->device, \
format, ## arg); \
} while (0)

Definition at line 61 of file pciehp.h.

#define ctrl_err (   ctrl,
  format,
  arg... 
)    dev_err(&ctrl->pcie->device, format, ## arg)

Definition at line 67 of file pciehp.h.

#define ctrl_info (   ctrl,
  format,
  arg... 
)    dev_info(&ctrl->pcie->device, format, ## arg)

Definition at line 69 of file pciehp.h.

#define ctrl_warn (   ctrl,
  format,
  arg... 
)    dev_warn(&ctrl->pcie->device, format, ## arg)

Definition at line 71 of file pciehp.h.

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

Definition at line 49 of file pciehp.h.

#define EMI (   ctrl)    ((ctrl)->slot_cap & PCI_EXP_SLTCAP_EIP)

Definition at line 126 of file pciehp.h.

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

Definition at line 54 of file pciehp.h.

#define HP_SUPR_RM (   ctrl)    ((ctrl)->slot_cap & PCI_EXP_SLTCAP_HPS)

Definition at line 125 of file pciehp.h.

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

Definition at line 56 of file pciehp.h.

#define INT_BUTTON_CANCEL   9

Definition at line 112 of file pciehp.h.

#define INT_BUTTON_IGNORE   0

Definition at line 103 of file pciehp.h.

#define INT_BUTTON_PRESS   7

Definition at line 110 of file pciehp.h.

#define INT_BUTTON_RELEASE   8

Definition at line 111 of file pciehp.h.

#define INT_POWER_FAULT   5

Definition at line 108 of file pciehp.h.

#define INT_POWER_FAULT_CLEAR   6

Definition at line 109 of file pciehp.h.

#define INT_PRESENCE_OFF   2

Definition at line 105 of file pciehp.h.

#define INT_PRESENCE_ON   1

Definition at line 104 of file pciehp.h.

#define INT_SWITCH_CLOSE   3

Definition at line 106 of file pciehp.h.

#define INT_SWITCH_OPEN   4

Definition at line 107 of file pciehp.h.

#define MRL_SENS (   ctrl)    ((ctrl)->slot_cap & PCI_EXP_SLTCAP_MRLSP)

Definition at line 122 of file pciehp.h.

#define MY_NAME   "pciehp"

Definition at line 41 of file pciehp.h.

#define NO_CMD_CMPL (   ctrl)    ((ctrl)->slot_cap & PCI_EXP_SLTCAP_NCCS)

Definition at line 127 of file pciehp.h.

#define pciehp_firmware_init ( )    do {} while (0)

Definition at line 177 of file pciehp.h.

#define POWER_CTRL (   ctrl)    ((ctrl)->slot_cap & PCI_EXP_SLTCAP_PCP)

Definition at line 121 of file pciehp.h.

#define POWEROFF_STATE   4

Definition at line 118 of file pciehp.h.

#define POWERON_STATE   3

Definition at line 117 of file pciehp.h.

#define PSN (   ctrl)    ((ctrl)->slot_cap >> 19)

Definition at line 128 of file pciehp.h.

#define PWR_LED (   ctrl)    ((ctrl)->slot_cap & PCI_EXP_SLTCAP_PIP)

Definition at line 124 of file pciehp.h.

#define SLOT_NAME_SIZE   10

Definition at line 74 of file pciehp.h.

#define STATIC_STATE   0

Definition at line 114 of file pciehp.h.

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

Definition at line 58 of file pciehp.h.

Function Documentation

int pcie_enable_notification ( struct controller ctrl)

Definition at line 708 of file pciehp_hpc.c.

struct controller* pcie_init ( struct pcie_device dev)
read

Definition at line 846 of file pciehp_hpc.c.

int pcie_init_notification ( struct controller ctrl)

Definition at line 752 of file pciehp_hpc.c.

int pciehp_check_link_status ( struct controller ctrl)

Definition at line 312 of file pciehp_hpc.c.

int pciehp_configure_device ( struct slot p_slot)

Definition at line 37 of file pciehp_pci.c.

int pciehp_disable_slot ( struct slot p_slot)

Definition at line 518 of file pciehp_ctrl.c.

int pciehp_enable_slot ( struct slot p_slot)

Definition at line 479 of file pciehp_ctrl.c.

int pciehp_get_adapter_status ( struct slot slot,
u8 status 
)

Definition at line 478 of file pciehp_hpc.c.

int pciehp_get_attention_status ( struct slot slot,
u8 status 
)

Definition at line 391 of file pciehp_hpc.c.

int pciehp_get_latch_status ( struct slot slot,
u8 status 
)

Definition at line 462 of file pciehp_hpc.c.

int pciehp_get_power_status ( struct slot slot,
u8 status 
)

Definition at line 430 of file pciehp_hpc.c.

void pciehp_green_led_blink ( struct slot slot)

Definition at line 559 of file pciehp_hpc.c.

void pciehp_green_led_off ( struct slot slot)

Definition at line 546 of file pciehp_hpc.c.

void pciehp_green_led_on ( struct slot slot)

Definition at line 533 of file pciehp_hpc.c.

u8 pciehp_handle_attention_button ( struct slot p_slot)

Definition at line 57 of file pciehp_ctrl.c.

u8 pciehp_handle_power_fault ( struct slot p_slot)

Definition at line 138 of file pciehp_ctrl.c.

u8 pciehp_handle_presence_change ( struct slot p_slot)

Definition at line 105 of file pciehp_ctrl.c.

u8 pciehp_handle_switch_change ( struct slot p_slot)

Definition at line 76 of file pciehp_ctrl.c.

int pciehp_power_off_slot ( struct slot slot)

Definition at line 616 of file pciehp_hpc.c.

int pciehp_power_on_slot ( struct slot slot)

Definition at line 572 of file pciehp_hpc.c.

int pciehp_query_power_fault ( struct slot slot)

Definition at line 494 of file pciehp_hpc.c.

void pciehp_queue_pushbutton_work ( struct work_struct work)

Definition at line 321 of file pciehp_ctrl.c.

void pciehp_release_ctrl ( struct controller ctrl)

Definition at line 909 of file pciehp_hpc.c.

int pciehp_set_attention_status ( struct slot slot,
u8  status 
)

Definition at line 508 of file pciehp_hpc.c.

int pciehp_sysfs_disable_slot ( struct slot slot)

Definition at line 592 of file pciehp_ctrl.c.

int pciehp_sysfs_enable_slot ( struct slot slot)

Definition at line 557 of file pciehp_ctrl.c.

int pciehp_unconfigure_device ( struct slot p_slot)

Definition at line 89 of file pciehp_pci.c.

Variable Documentation

bool pciehp_debug

Definition at line 41 of file pciehp_core.c.

bool pciehp_force

Definition at line 44 of file pciehp_core.c.

bool pciehp_poll_mode

Definition at line 42 of file pciehp_core.c.

int pciehp_poll_time

Definition at line 43 of file pciehp_core.c.

Definition at line 45 of file pciehp_core.c.