aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/shpchp.h
diff options
context:
space:
mode:
authorrajesh.shah@intel.com <rajesh.shah@intel.com>2005-10-13 15:05:41 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 18:37:00 -0400
commit2178bfad9ccb0cbeb79599dd1dc349dd4567aa49 (patch)
tree9a58ee4a73e36b31edd8b5660966403d7c6c5562 /drivers/pci/hotplug/shpchp.h
parent70b6091946ab486c4dab8abeb4a3fc2bf7d3e7fe (diff)
[PATCH] shpchp: remove redundant data structures
State information is currently stored in per-slot as well as per-pci-function data structures in shpchp. There's a lot of overlap in the information kept, and some of it is never used. This patch consolidates the state information to per-slot and eliminates unused data structures. The biggest change is to eliminate the pci_func structure and the code around managing its lists. Signed-off-by: Rajesh Shah <rajesh.shah@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/shpchp.h')
-rw-r--r--drivers/pci/hotplug/shpchp.h35
1 files changed, 3 insertions, 32 deletions
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index 5e99260987e8..052c11f14a79 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -52,34 +52,18 @@ extern int shpchp_debug;
52#define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg) 52#define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg)
53#define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg) 53#define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg)
54 54
55struct pci_func {
56 struct pci_func *next;
57 u8 bus;
58 u8 device;
59 u8 function;
60 u8 is_a_board;
61 u16 status;
62 u8 configured;
63 u8 switch_save;
64 u8 presence_save;
65 u8 pwr_save;
66 struct pci_dev* pci_dev;
67};
68
69#define SLOT_MAGIC 0x67267321 55#define SLOT_MAGIC 0x67267321
70struct slot { 56struct slot {
71 u32 magic; 57 u32 magic;
72 struct slot *next; 58 struct slot *next;
73 u8 bus; 59 u8 bus;
74 u8 device; 60 u8 device;
61 u16 status;
75 u32 number; 62 u32 number;
76 u8 is_a_board; 63 u8 is_a_board;
77 u8 configured;
78 u8 state; 64 u8 state;
79 u8 switch_save;
80 u8 presence_save; 65 u8 presence_save;
81 u32 capabilities; 66 u8 pwr_save;
82 u16 reserved2;
83 struct timer_list task_event; 67 struct timer_list task_event;
84 u8 hp_slot; 68 u8 hp_slot;
85 struct controller *ctrl; 69 struct controller *ctrl;
@@ -106,19 +90,14 @@ struct controller {
106 struct hpc_ops *hpc_ops; 90 struct hpc_ops *hpc_ops;
107 wait_queue_head_t queue; /* sleep & wake process */ 91 wait_queue_head_t queue; /* sleep & wake process */
108 u8 next_event; 92 u8 next_event;
109 u8 seg;
110 u8 bus; 93 u8 bus;
111 u8 device; 94 u8 device;
112 u8 function; 95 u8 function;
113 u8 rev;
114 u8 slot_device_offset; 96 u8 slot_device_offset;
115 u8 add_support; 97 u8 add_support;
116 enum pci_bus_speed speed; 98 enum pci_bus_speed speed;
117 u32 first_slot; /* First physical slot number */ 99 u32 first_slot; /* First physical slot number */
118 u8 slot_bus; /* Bus where the slots handled by this controller sit */ 100 u8 slot_bus; /* Bus where the slots handled by this controller sit */
119 u8 push_flag;
120 u16 ctlrcap;
121 u16 vendor_id;
122}; 101};
123 102
124struct hotplug_params { 103struct hotplug_params {
@@ -169,13 +148,9 @@ struct hotplug_params {
169 * error Messages 148 * error Messages
170 */ 149 */
171#define msg_initialization_err "Initialization failure, error=%d\n" 150#define msg_initialization_err "Initialization failure, error=%d\n"
172#define msg_HPC_rev_error "Unsupported revision of the PCI hot plug controller found.\n"
173#define msg_HPC_non_shpc "The PCI hot plug controller is not supported by this driver.\n"
174#define msg_HPC_not_supported "This system is not supported by this version of shpcphd mdoule. Upgrade to a newer version of shpchpd\n"
175#define msg_button_on "PCI slot #%d - powering on due to button press.\n" 151#define msg_button_on "PCI slot #%d - powering on due to button press.\n"
176#define msg_button_off "PCI slot #%d - powering off due to button press.\n" 152#define msg_button_off "PCI slot #%d - powering off due to button press.\n"
177#define msg_button_cancel "PCI slot #%d - action canceled due to button press.\n" 153#define msg_button_cancel "PCI slot #%d - action canceled due to button press.\n"
178#define msg_button_ignore "PCI slot #%d - button press ignored. (action in progress...)\n"
179 154
180/* sysfs functions for the hotplug controller info */ 155/* sysfs functions for the hotplug controller info */
181extern void shpchp_create_ctrl_files (struct controller *ctrl); 156extern void shpchp_create_ctrl_files (struct controller *ctrl);
@@ -183,8 +158,6 @@ extern void shpchp_create_ctrl_files (struct controller *ctrl);
183/* controller functions */ 158/* controller functions */
184extern int shpchp_event_start_thread(void); 159extern int shpchp_event_start_thread(void);
185extern void shpchp_event_stop_thread(void); 160extern void shpchp_event_stop_thread(void);
186extern struct pci_func *shpchp_slot_create(unsigned char busnumber);
187extern struct pci_func *shpchp_slot_find(unsigned char bus, unsigned char device, unsigned char index);
188extern int shpchp_enable_slot(struct slot *slot); 161extern int shpchp_enable_slot(struct slot *slot);
189extern int shpchp_disable_slot(struct slot *slot); 162extern int shpchp_disable_slot(struct slot *slot);
190 163
@@ -195,9 +168,8 @@ extern u8 shpchp_handle_power_fault(u8 hp_slot, void *inst_id);
195 168
196/* pci functions */ 169/* pci functions */
197extern int shpchp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slots, int first_device_num); 170extern int shpchp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slots, int first_device_num);
198extern int shpchp_save_slot_config(struct controller *ctrl, struct pci_func * new_slot);
199extern int shpchp_configure_device(struct slot *p_slot); 171extern int shpchp_configure_device(struct slot *p_slot);
200extern int shpchp_unconfigure_device(struct pci_func* func); 172extern int shpchp_unconfigure_device(struct slot *p_slot);
201extern void get_hp_hw_control_from_firmware(struct pci_dev *dev); 173extern void get_hp_hw_control_from_firmware(struct pci_dev *dev);
202extern void get_hp_params_from_firmware(struct pci_dev *dev, 174extern void get_hp_params_from_firmware(struct pci_dev *dev,
203 struct hotplug_params *hpp); 175 struct hotplug_params *hpp);
@@ -207,7 +179,6 @@ extern int shpchprm_get_physical_slot_number(struct controller *ctrl,
207 179
208/* Global variables */ 180/* Global variables */
209extern struct controller *shpchp_ctrl_list; 181extern struct controller *shpchp_ctrl_list;
210extern struct pci_func *shpchp_slot_list[256];
211 182
212struct ctrl_reg { 183struct ctrl_reg {
213 volatile u32 base_offset; 184 volatile u32 base_offset;