Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
shpchp.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/mutex.h>
#include <linux/workqueue.h>

Go to the source code of this file.

Data Structures

struct  slot
 
struct  event_info
 
struct  controller
 
struct  ctrl_reg
 
struct  hpc_ops
 

Macros

#define MY_NAME   "shpchp"
 
#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->pci_dev->dev, format, ## arg)
 
#define ctrl_info(ctrl, format, arg...)   dev_info(&ctrl->pci_dev->dev, format, ## arg)
 
#define ctrl_warn(ctrl, format, arg...)   dev_warn(&ctrl->pci_dev->dev, format, ## arg)
 
#define SLOT_NAME_SIZE   10
 
#define PCI_DEVICE_ID_AMD_GOLAM_7450   0x7450
 
#define PCI_DEVICE_ID_AMD_POGO_7458   0x7458
 
#define PCIX_MEM_BASE_LIMIT_OFFSET   0x1C
 
#define PCIX_MISCII_OFFSET   0x48
 
#define PCIX_MISC_BRIDGE_ERRORS_OFFSET   0x80
 
#define PERRNONFATALENABLE_MASK   0x00040000
 
#define PERRFATALENABLE_MASK   0x00080000
 
#define PERRFLOODENABLE_MASK   0x00100000
 
#define SERRNONFATALENABLE_MASK   0x00200000
 
#define SERRFATALENABLE_MASK   0x00400000
 
#define PERR_OBSERVED_MASK   0x00000001
 
#define RSE_MASK   0x40000000
 
#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 INTERLOCK_OPEN   0x00000002
 
#define ADD_NOT_SUPPORTED   0x00000003
 
#define CARD_FUNCTIONING   0x00000005
 
#define ADAPTER_NOT_SAME   0x00000006
 
#define NO_ADAPTER_PRESENT   0x00000009
 
#define NOT_ENOUGH_RESOURCES   0x0000000B
 
#define DEVICE_TYPE_NOT_SUPPORTED   0x0000000C
 
#define WRONG_BUS_FREQUENCY   0x0000000D
 
#define POWER_FAILURE   0x0000000E
 
#define get_hp_hw_control_from_firmware(dev)   (0)
 

Enumerations

enum  ctrl_offsets {
  SLOT_RST = offsetof(struct ctrl_reg, slot_RST), SLOT_ENABLE = offsetof(struct ctrl_reg, slot_enable), MISC = offsetof(struct ctrl_reg, misc), LED_CONTROL = offsetof(struct ctrl_reg, led_control),
  INT_INPUT_CLEAR = offsetof(struct ctrl_reg, int_input_clear), INT_MASK = offsetof(struct ctrl_reg, int_mask), CTRL_RESERVED0 = offsetof(struct ctrl_reg, reserved0), CTRL_RESERVED1 = offsetof(struct ctrl_reg, reserved1),
  CTRL_RESERVED2 = offsetof(struct ctrl_reg, reserved1), GEN_OUTPUT_AB = offsetof(struct ctrl_reg, gen_output_AB), NON_INT_INPUT = offsetof(struct ctrl_reg, non_int_input), CTRL_RESERVED3 = offsetof(struct ctrl_reg, reserved3),
  CTRL_RESERVED4 = offsetof(struct ctrl_reg, reserved4), CTRL_RESERVED5 = offsetof(struct ctrl_reg, reserved5), CTRL_RESERVED6 = offsetof(struct ctrl_reg, reserved6), CTRL_RESERVED7 = offsetof(struct ctrl_reg, reserved7),
  CTRL_RESERVED8 = offsetof(struct ctrl_reg, reserved8), SLOT_MASK = offsetof(struct ctrl_reg, slot_mask), CTRL_RESERVED9 = offsetof(struct ctrl_reg, reserved9), CTRL_RESERVED10 = offsetof(struct ctrl_reg, reserved10),
  CTRL_RESERVED11 = offsetof(struct ctrl_reg, reserved11), SLOT_SERR = offsetof(struct ctrl_reg, slot_SERR), SLOT_POWER = offsetof(struct ctrl_reg, slot_power), NEXT_CURR_FREQ = offsetof(struct ctrl_reg, next_curr_freq),
  RESET_FREQ_MODE = offsetof(struct ctrl_reg, reset_freq_mode), BASE_OFFSET = offsetof(struct ctrl_reg, base_offset), SLOT_AVAIL1 = offsetof(struct ctrl_reg, slot_avail1), SLOT_AVAIL2 = offsetof(struct ctrl_reg, slot_avail2),
  SLOT_CONFIG = offsetof(struct ctrl_reg, slot_config), SEC_BUS_CONFIG = offsetof(struct ctrl_reg, sec_bus_config), MSI_CTRL = offsetof(struct ctrl_reg, msi_ctrl), PROG_INTERFACE = offsetof(struct ctrl_reg, prog_interface),
  CMD = offsetof(struct ctrl_reg, cmd), CMD_STATUS = offsetof(struct ctrl_reg, cmd_status), INTR_LOC = offsetof(struct ctrl_reg, intr_loc), SERR_LOC = offsetof(struct ctrl_reg, serr_loc),
  SERR_INTR_ENABLE = offsetof(struct ctrl_reg, serr_intr_enable), SLOT1 = offsetof(struct ctrl_reg, slot1)
}
 

Functions

int __must_check shpchp_create_ctrl_files (struct controller *ctrl)
 
void shpchp_remove_ctrl_files (struct controller *ctrl)
 
int shpchp_sysfs_enable_slot (struct slot *slot)
 
int shpchp_sysfs_disable_slot (struct slot *slot)
 
u8 shpchp_handle_attention_button (u8 hp_slot, struct controller *ctrl)
 
u8 shpchp_handle_switch_change (u8 hp_slot, struct controller *ctrl)
 
u8 shpchp_handle_presence_change (u8 hp_slot, struct controller *ctrl)
 
u8 shpchp_handle_power_fault (u8 hp_slot, struct controller *ctrl)
 
int shpchp_configure_device (struct slot *p_slot)
 
int shpchp_unconfigure_device (struct slot *p_slot)
 
void cleanup_slots (struct controller *ctrl)
 
void shpchp_queue_pushbutton_work (struct work_struct *work)
 
int shpc_init (struct controller *ctrl, struct pci_dev *pdev)
 
struct ctrl_reg __attribute__ ((packed))
 

Variables

bool shpchp_poll_mode
 
int shpchp_poll_time
 
bool shpchp_debug
 
struct workqueue_structshpchp_wq
 
struct workqueue_structshpchp_ordered_wq
 
volatile u32 base_offset
 
volatile u32 slot_avail1
 
volatile u32 slot_avail2
 
volatile u32 slot_config
 
volatile u16 sec_bus_config
 
volatile u8 msi_ctrl
 
volatile u8 prog_interface
 
volatile u16 cmd
 
volatile u16 cmd_status
 
volatile u32 intr_loc
 
volatile u32 serr_loc
 
volatile u32 serr_intr_enable
 
volatile u32 slot1
 
enum ctrl_offsets __attribute__
 

Macro Definition Documentation

#define ADAPTER_NOT_SAME   0x00000006

Definition at line 165 of file shpchp.h.

#define ADD_NOT_SUPPORTED   0x00000003

Definition at line 163 of file shpchp.h.

#define BLINKINGOFF_STATE   2

Definition at line 157 of file shpchp.h.

#define BLINKINGON_STATE   1

Definition at line 156 of file shpchp.h.

#define CARD_FUNCTIONING   0x00000005

Definition at line 164 of file shpchp.h.

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

Definition at line 64 of file shpchp.h.

#define ctrl_err (   ctrl,
  format,
  arg... 
)    dev_err(&ctrl->pci_dev->dev, format, ## arg)

Definition at line 70 of file shpchp.h.

#define ctrl_info (   ctrl,
  format,
  arg... 
)    dev_info(&ctrl->pci_dev->dev, format, ## arg)

Definition at line 72 of file shpchp.h.

#define ctrl_warn (   ctrl,
  format,
  arg... 
)    dev_warn(&ctrl->pci_dev->dev, format, ## arg)

Definition at line 74 of file shpchp.h.

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

Definition at line 52 of file shpchp.h.

#define DEVICE_TYPE_NOT_SUPPORTED   0x0000000C

Definition at line 168 of file shpchp.h.

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

Definition at line 57 of file shpchp.h.

#define get_hp_hw_control_from_firmware (   dev)    (0)

Definition at line 199 of file shpchp.h.

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

Definition at line 59 of file shpchp.h.

#define INT_BUTTON_CANCEL   9

Definition at line 153 of file shpchp.h.

#define INT_BUTTON_IGNORE   0

Definition at line 144 of file shpchp.h.

#define INT_BUTTON_PRESS   7

Definition at line 151 of file shpchp.h.

#define INT_BUTTON_RELEASE   8

Definition at line 152 of file shpchp.h.

#define INT_POWER_FAULT   5

Definition at line 149 of file shpchp.h.

#define INT_POWER_FAULT_CLEAR   6

Definition at line 150 of file shpchp.h.

#define INT_PRESENCE_OFF   2

Definition at line 146 of file shpchp.h.

#define INT_PRESENCE_ON   1

Definition at line 145 of file shpchp.h.

#define INT_SWITCH_CLOSE   3

Definition at line 147 of file shpchp.h.

#define INT_SWITCH_OPEN   4

Definition at line 148 of file shpchp.h.

#define INTERLOCK_OPEN   0x00000002

Definition at line 162 of file shpchp.h.

#define MY_NAME   "shpchp"

Definition at line 41 of file shpchp.h.

#define NO_ADAPTER_PRESENT   0x00000009

Definition at line 166 of file shpchp.h.

#define NOT_ENOUGH_RESOURCES   0x0000000B

Definition at line 167 of file shpchp.h.

#define PCI_DEVICE_ID_AMD_GOLAM_7450   0x7450

Definition at line 123 of file shpchp.h.

#define PCI_DEVICE_ID_AMD_POGO_7458   0x7458

Definition at line 124 of file shpchp.h.

#define PCIX_MEM_BASE_LIMIT_OFFSET   0x1C

Definition at line 127 of file shpchp.h.

#define PCIX_MISC_BRIDGE_ERRORS_OFFSET   0x80

Definition at line 129 of file shpchp.h.

#define PCIX_MISCII_OFFSET   0x48

Definition at line 128 of file shpchp.h.

#define PERR_OBSERVED_MASK   0x00000001

Definition at line 139 of file shpchp.h.

#define PERRFATALENABLE_MASK   0x00080000

Definition at line 133 of file shpchp.h.

#define PERRFLOODENABLE_MASK   0x00100000

Definition at line 134 of file shpchp.h.

#define PERRNONFATALENABLE_MASK   0x00040000

Definition at line 132 of file shpchp.h.

#define POWER_FAILURE   0x0000000E

Definition at line 170 of file shpchp.h.

#define POWEROFF_STATE   4

Definition at line 159 of file shpchp.h.

#define POWERON_STATE   3

Definition at line 158 of file shpchp.h.

#define RSE_MASK   0x40000000

Definition at line 142 of file shpchp.h.

#define SERRFATALENABLE_MASK   0x00400000

Definition at line 136 of file shpchp.h.

#define SERRNONFATALENABLE_MASK   0x00200000

Definition at line 135 of file shpchp.h.

#define SLOT_NAME_SIZE   10

Definition at line 78 of file shpchp.h.

#define STATIC_STATE   0

Definition at line 155 of file shpchp.h.

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

Definition at line 61 of file shpchp.h.

#define WRONG_BUS_FREQUENCY   0x0000000D

Definition at line 169 of file shpchp.h.

Enumeration Type Documentation

Enumerator:
SLOT_RST 
SLOT_ENABLE 
MISC 
LED_CONTROL 
INT_INPUT_CLEAR 
INT_MASK 
CTRL_RESERVED0 
CTRL_RESERVED1 
CTRL_RESERVED2 
GEN_OUTPUT_AB 
NON_INT_INPUT 
CTRL_RESERVED3 
CTRL_RESERVED4 
CTRL_RESERVED5 
CTRL_RESERVED6 
CTRL_RESERVED7 
CTRL_RESERVED8 
SLOT_MASK 
CTRL_RESERVED9 
CTRL_RESERVED10 
CTRL_RESERVED11 
SLOT_SERR 
SLOT_POWER 
NEXT_CURR_FREQ 
RESET_FREQ_MODE 
BASE_OFFSET 
SLOT_AVAIL1 
SLOT_AVAIL2 
SLOT_CONFIG 
SEC_BUS_CONFIG 
MSI_CTRL 
PROG_INTERFACE 
CMD 
CMD_STATUS 
INTR_LOC 
SERR_LOC 
SERR_INTR_ENABLE 
SLOT1 

Definition at line 219 of file shpchp.h.

Function Documentation

struct ctrl_reg __attribute__ ( (packed)  )
read

Definition at line 171 of file esd_usb2.c.

void cleanup_slots ( struct controller ctrl)

Definition at line 173 of file shpchp_core.c.

int shpc_init ( struct controller ctrl,
struct pci_dev pdev 
)

Definition at line 936 of file shpchp_hpc.c.

int shpchp_configure_device ( struct slot p_slot)

Definition at line 37 of file shpchp_pci.c.

int __must_check shpchp_create_ctrl_files ( struct controller ctrl)

Definition at line 88 of file shpchp_sysfs.c.

u8 shpchp_handle_attention_button ( u8  hp_slot,
struct controller ctrl 
)

Definition at line 59 of file shpchp_ctrl.c.

u8 shpchp_handle_power_fault ( u8  hp_slot,
struct controller ctrl 
)

Definition at line 155 of file shpchp_ctrl.c.

u8 shpchp_handle_presence_change ( u8  hp_slot,
struct controller ctrl 
)

Definition at line 120 of file shpchp_ctrl.c.

u8 shpchp_handle_switch_change ( u8  hp_slot,
struct controller ctrl 
)

Definition at line 82 of file shpchp_ctrl.c.

void shpchp_queue_pushbutton_work ( struct work_struct work)

Definition at line 430 of file shpchp_ctrl.c.

void shpchp_remove_ctrl_files ( struct controller ctrl)

Definition at line 93 of file shpchp_sysfs.c.

int shpchp_sysfs_disable_slot ( struct slot slot)

Definition at line 695 of file shpchp_ctrl.c.

int shpchp_sysfs_enable_slot ( struct slot slot)

Definition at line 660 of file shpchp_ctrl.c.

int shpchp_unconfigure_device ( struct slot p_slot)

Definition at line 85 of file shpchp_pci.c.

Variable Documentation

volatile u32 base_offset

Definition at line 217 of file shpchp.h.

volatile u16 cmd

Definition at line 224 of file shpchp.h.

u8 cmd_status

Definition at line 225 of file shpchp.h.

volatile u32 intr_loc

Definition at line 226 of file shpchp.h.

volatile u8 msi_ctrl

Definition at line 222 of file shpchp.h.

volatile u8 prog_interface

Definition at line 223 of file shpchp.h.

volatile u16 sec_bus_config

Definition at line 221 of file shpchp.h.

volatile u32 serr_intr_enable

Definition at line 228 of file shpchp.h.

volatile u32 serr_loc

Definition at line 227 of file shpchp.h.

bool shpchp_debug

Definition at line 39 of file shpchp_core.c.

struct workqueue_struct* shpchp_ordered_wq

Definition at line 43 of file shpchp_core.c.

bool shpchp_poll_mode

Definition at line 40 of file shpchp_core.c.

int shpchp_poll_time

Definition at line 41 of file shpchp_core.c.

Definition at line 42 of file shpchp_core.c.

volatile u32 slot1

Definition at line 229 of file shpchp.h.

volatile u32 slot_avail1

Definition at line 218 of file shpchp.h.

volatile u32 slot_avail2

Definition at line 219 of file shpchp.h.

volatile u32 slot_config

Definition at line 220 of file shpchp.h.