aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/pciehp.h
diff options
context:
space:
mode:
authorrajesh.shah@intel.com <rajesh.shah@intel.com>2005-10-31 19:20:08 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2005-11-10 19:09:14 -0500
commitca22a5e4d70620b7f3d809e424daa5214b0aa00d (patch)
tree13f69e742475642f382bcb0350e399d14315b534 /drivers/pci/hotplug/pciehp.h
parenta8a2be949267cb0d1d933a92d9fb43eda4f4fe88 (diff)
[PATCH] pciehp: remove redundant data structures
State information is currently stored in per-slot as well as per-pci-function data structures in pciehp. 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/pciehp.h')
-rw-r--r--drivers/pci/hotplug/pciehp.h30
1 files changed, 3 insertions, 27 deletions
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
index e9c09566f851..3e17e3d4dd65 100644
--- a/drivers/pci/hotplug/pciehp.h
+++ b/drivers/pci/hotplug/pciehp.h
@@ -56,25 +56,11 @@ struct hotplug_params {
56 u8 enable_perr; 56 u8 enable_perr;
57}; 57};
58 58
59struct pci_func {
60 struct pci_func *next;
61 u8 bus;
62 u8 device;
63 u8 function;
64 u8 is_a_board;
65 u16 status;
66 u8 configured;
67 u8 switch_save;
68 u8 presence_save;
69 u16 reserved2;
70 u32 config_space[0x20];
71 struct pci_dev* pci_dev;
72};
73
74struct slot { 59struct slot {
75 struct slot *next; 60 struct slot *next;
76 u8 bus; 61 u8 bus;
77 u8 device; 62 u8 device;
63 u16 status;
78 u32 number; 64 u32 number;
79 u8 is_a_board; 65 u8 is_a_board;
80 u8 configured; 66 u8 configured;
@@ -177,9 +163,6 @@ struct controller {
177 * error Messages 163 * error Messages
178 */ 164 */
179#define msg_initialization_err "Initialization failure, error=%d\n" 165#define msg_initialization_err "Initialization failure, error=%d\n"
180#define msg_HPC_rev_error "Unsupported revision of the PCI hot plug controller found.\n"
181#define msg_HPC_non_pcie "The PCI hot plug controller is not supported by this driver.\n"
182#define msg_HPC_not_supported "This system is not supported by this version of pciephd module. Upgrade to a newer version of pciehpd\n"
183#define msg_button_on "PCI slot #%d - powering on due to button press.\n" 166#define msg_button_on "PCI slot #%d - powering on due to button press.\n"
184#define msg_button_off "PCI slot #%d - powering off due to button press.\n" 167#define msg_button_off "PCI slot #%d - powering off due to button press.\n"
185#define msg_button_cancel "PCI slot #%d - action canceled due to button press.\n" 168#define msg_button_cancel "PCI slot #%d - action canceled due to button press.\n"
@@ -188,8 +171,6 @@ struct controller {
188/* controller functions */ 171/* controller functions */
189extern int pciehp_event_start_thread (void); 172extern int pciehp_event_start_thread (void);
190extern void pciehp_event_stop_thread (void); 173extern void pciehp_event_stop_thread (void);
191extern struct pci_func *pciehp_slot_create (unsigned char busnumber);
192extern struct pci_func *pciehp_slot_find (unsigned char bus, unsigned char device, unsigned char index);
193extern int pciehp_enable_slot (struct slot *slot); 174extern int pciehp_enable_slot (struct slot *slot);
194extern int pciehp_disable_slot (struct slot *slot); 175extern int pciehp_disable_slot (struct slot *slot);
195 176
@@ -200,12 +181,8 @@ extern u8 pciehp_handle_power_fault (u8 hp_slot, void *inst_id);
200/* extern void long_delay (int delay); */ 181/* extern void long_delay (int delay); */
201 182
202/* pci functions */ 183/* pci functions */
203extern int pciehp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num); 184extern int pciehp_configure_device (struct slot *p_slot);
204/*extern int pciehp_get_bus_dev (struct controller *ctrl, u8 *bus_num, u8 *dev_num, struct slot *slot);*/ 185extern int pciehp_unconfigure_device (struct slot *p_slot);
205extern int pciehp_save_config (struct controller *ctrl, int busnumber, int num_ctlr_slots, int first_device_num);
206extern int pciehp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot);
207extern int pciehp_configure_device (struct slot *ctrl);
208extern int pciehp_unconfigure_device (struct pci_func* func);
209extern int get_hp_hw_control_from_firmware(struct pci_dev *dev); 186extern int get_hp_hw_control_from_firmware(struct pci_dev *dev);
210extern void get_hp_params_from_firmware(struct pci_dev *dev, 187extern void get_hp_params_from_firmware(struct pci_dev *dev,
211 struct hotplug_params *hpp); 188 struct hotplug_params *hpp);
@@ -214,7 +191,6 @@ extern void get_hp_params_from_firmware(struct pci_dev *dev,
214 191
215/* Global variables */ 192/* Global variables */
216extern struct controller *pciehp_ctrl_list; 193extern struct controller *pciehp_ctrl_list;
217extern struct pci_func *pciehp_slot_list[256];
218 194
219/* Inline functions */ 195/* Inline functions */
220 196