diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2006-12-16 18:25:57 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-12-20 13:54:44 -0500 |
commit | 8352e04eb427db0ca8ebb9a8547971d433627cad (patch) | |
tree | 07c9a8a0f7c9e04449dd43247b91c3b360eb48aa /drivers/pci/hotplug | |
parent | 6f39be2e05cc6e66481f1395264297f06bef1e21 (diff) |
shpchp: cleanup shpchp.h
This patch cleans up shpchp.h.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r-- | drivers/pci/hotplug/shpchp.h | 190 | ||||
-rw-r--r-- | drivers/pci/hotplug/shpchp_core.c | 22 | ||||
-rw-r--r-- | drivers/pci/hotplug/shpchp_ctrl.c | 9 |
3 files changed, 77 insertions, 144 deletions
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h index e21714982476..3ca6a4f574b3 100644 --- a/drivers/pci/hotplug/shpchp.h +++ b/drivers/pci/hotplug/shpchp.h | |||
@@ -47,11 +47,17 @@ extern int shpchp_poll_time; | |||
47 | extern int shpchp_debug; | 47 | extern int shpchp_debug; |
48 | extern struct workqueue_struct *shpchp_wq; | 48 | extern struct workqueue_struct *shpchp_wq; |
49 | 49 | ||
50 | /*#define dbg(format, arg...) do { if (shpchp_debug) printk(KERN_DEBUG "%s: " format, MY_NAME , ## arg); } while (0)*/ | 50 | #define dbg(format, arg...) \ |
51 | #define dbg(format, arg...) do { if (shpchp_debug) printk("%s: " format, MY_NAME , ## arg); } while (0) | 51 | do { \ |
52 | #define err(format, arg...) printk(KERN_ERR "%s: " format, MY_NAME , ## arg) | 52 | if (shpchp_debug) \ |
53 | #define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg) | 53 | printk("%s: " format, MY_NAME , ## arg); \ |
54 | #define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg) | 54 | } while (0) |
55 | #define err(format, arg...) \ | ||
56 | printk(KERN_ERR "%s: " format, MY_NAME , ## arg) | ||
57 | #define info(format, arg...) \ | ||
58 | printk(KERN_INFO "%s: " format, MY_NAME , ## arg) | ||
59 | #define warn(format, arg...) \ | ||
60 | printk(KERN_WARNING "%s: " format, MY_NAME , ## arg) | ||
55 | 61 | ||
56 | #define SLOT_NAME_SIZE 10 | 62 | #define SLOT_NAME_SIZE 10 |
57 | struct slot { | 63 | struct slot { |
@@ -99,13 +105,11 @@ struct controller { | |||
99 | struct timer_list poll_timer; | 105 | struct timer_list poll_timer; |
100 | }; | 106 | }; |
101 | 107 | ||
102 | |||
103 | /* Define AMD SHPC ID */ | 108 | /* Define AMD SHPC ID */ |
104 | #define PCI_DEVICE_ID_AMD_GOLAM_7450 0x7450 | 109 | #define PCI_DEVICE_ID_AMD_GOLAM_7450 0x7450 |
105 | #define PCI_DEVICE_ID_AMD_POGO_7458 0x7458 | 110 | #define PCI_DEVICE_ID_AMD_POGO_7458 0x7458 |
106 | 111 | ||
107 | /* AMD PCIX bridge registers */ | 112 | /* AMD PCIX bridge registers */ |
108 | |||
109 | #define PCIX_MEM_BASE_LIMIT_OFFSET 0x1C | 113 | #define PCIX_MEM_BASE_LIMIT_OFFSET 0x1C |
110 | #define PCIX_MISCII_OFFSET 0x48 | 114 | #define PCIX_MISCII_OFFSET 0x48 |
111 | #define PCIX_MISC_BRIDGE_ERRORS_OFFSET 0x80 | 115 | #define PCIX_MISC_BRIDGE_ERRORS_OFFSET 0x80 |
@@ -140,8 +144,6 @@ struct controller { | |||
140 | #define POWERON_STATE 3 | 144 | #define POWERON_STATE 3 |
141 | #define POWEROFF_STATE 4 | 145 | #define POWEROFF_STATE 4 |
142 | 146 | ||
143 | #define PCI_TO_PCI_BRIDGE_CLASS 0x00060400 | ||
144 | |||
145 | /* Error messages */ | 147 | /* Error messages */ |
146 | #define INTERLOCK_OPEN 0x00000002 | 148 | #define INTERLOCK_OPEN 0x00000002 |
147 | #define ADD_NOT_SUPPORTED 0x00000003 | 149 | #define ADD_NOT_SUPPORTED 0x00000003 |
@@ -153,50 +155,32 @@ struct controller { | |||
153 | #define WRONG_BUS_FREQUENCY 0x0000000D | 155 | #define WRONG_BUS_FREQUENCY 0x0000000D |
154 | #define POWER_FAILURE 0x0000000E | 156 | #define POWER_FAILURE 0x0000000E |
155 | 157 | ||
156 | #define REMOVE_NOT_SUPPORTED 0x00000003 | ||
157 | |||
158 | #define DISABLE_CARD 1 | ||
159 | |||
160 | /* | ||
161 | * error Messages | ||
162 | */ | ||
163 | #define msg_initialization_err "Initialization failure, error=%d\n" | ||
164 | #define msg_button_on "PCI slot #%s - powering on due to button press.\n" | ||
165 | #define msg_button_off "PCI slot #%s - powering off due to button press.\n" | ||
166 | #define msg_button_cancel "PCI slot #%s - action canceled due to button press.\n" | ||
167 | |||
168 | /* sysfs functions for the hotplug controller info */ | ||
169 | extern int __must_check shpchp_create_ctrl_files(struct controller *ctrl); | 158 | extern int __must_check shpchp_create_ctrl_files(struct controller *ctrl); |
170 | 159 | extern void shpchp_remove_ctrl_files(struct controller *ctrl); | |
171 | extern int shpchp_sysfs_enable_slot(struct slot *slot); | 160 | extern int shpchp_sysfs_enable_slot(struct slot *slot); |
172 | extern int shpchp_sysfs_disable_slot(struct slot *slot); | 161 | extern int shpchp_sysfs_disable_slot(struct slot *slot); |
173 | |||
174 | extern u8 shpchp_handle_attention_button(u8 hp_slot, struct controller *ctrl); | 162 | extern u8 shpchp_handle_attention_button(u8 hp_slot, struct controller *ctrl); |
175 | extern u8 shpchp_handle_switch_change(u8 hp_slot, struct controller *ctrl); | 163 | extern u8 shpchp_handle_switch_change(u8 hp_slot, struct controller *ctrl); |
176 | extern u8 shpchp_handle_presence_change(u8 hp_slot, struct controller *ctrl); | 164 | extern u8 shpchp_handle_presence_change(u8 hp_slot, struct controller *ctrl); |
177 | extern u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl); | 165 | extern u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl); |
178 | 166 | extern int shpchp_configure_device(struct slot *p_slot); | |
179 | /* pci functions */ | 167 | extern int shpchp_unconfigure_device(struct slot *p_slot); |
180 | extern int shpchp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slots, int first_device_num); | 168 | extern void cleanup_slots(struct controller *ctrl); |
181 | extern int shpchp_configure_device(struct slot *p_slot); | 169 | extern void queue_pushbutton_work(struct work_struct *work); |
182 | extern int shpchp_unconfigure_device(struct slot *p_slot); | 170 | extern int shpc_init( struct controller *ctrl, struct pci_dev *pdev); |
183 | extern void shpchp_remove_ctrl_files(struct controller *ctrl); | ||
184 | extern void cleanup_slots(struct controller *ctrl); | ||
185 | extern void queue_pushbutton_work(struct work_struct *work); | ||
186 | |||
187 | 171 | ||
188 | #ifdef CONFIG_ACPI | 172 | #ifdef CONFIG_ACPI |
189 | static inline int get_hp_params_from_firmware(struct pci_dev *dev, | 173 | static inline int get_hp_params_from_firmware(struct pci_dev *dev, |
190 | struct hotplug_params *hpp) | 174 | struct hotplug_params *hpp) |
191 | { | 175 | { |
192 | if (ACPI_FAILURE(acpi_get_hp_params_from_firmware(dev->bus, hpp))) | 176 | if (ACPI_FAILURE(acpi_get_hp_params_from_firmware(dev->bus, hpp))) |
193 | return -ENODEV; | 177 | return -ENODEV; |
194 | return 0; | 178 | return 0; |
195 | } | 179 | } |
196 | #define get_hp_hw_control_from_firmware(pdev) \ | 180 | #define get_hp_hw_control_from_firmware(pdev) \ |
197 | do { \ | 181 | do { \ |
198 | if (DEVICE_ACPI_HANDLE(&(pdev->dev))) \ | 182 | if (DEVICE_ACPI_HANDLE(&(pdev->dev))) \ |
199 | acpi_run_oshp(DEVICE_ACPI_HANDLE(&(pdev->dev))); \ | 183 | acpi_run_oshp(DEVICE_ACPI_HANDLE(&(pdev->dev)));\ |
200 | } while (0) | 184 | } while (0) |
201 | #else | 185 | #else |
202 | #define get_hp_params_from_firmware(dev, hpp) (-ENODEV) | 186 | #define get_hp_params_from_firmware(dev, hpp) (-ENODEV) |
@@ -217,90 +201,40 @@ struct ctrl_reg { | |||
217 | volatile u32 serr_loc; | 201 | volatile u32 serr_loc; |
218 | volatile u32 serr_intr_enable; | 202 | volatile u32 serr_intr_enable; |
219 | volatile u32 slot1; | 203 | volatile u32 slot1; |
220 | volatile u32 slot2; | ||
221 | volatile u32 slot3; | ||
222 | volatile u32 slot4; | ||
223 | volatile u32 slot5; | ||
224 | volatile u32 slot6; | ||
225 | volatile u32 slot7; | ||
226 | volatile u32 slot8; | ||
227 | volatile u32 slot9; | ||
228 | volatile u32 slot10; | ||
229 | volatile u32 slot11; | ||
230 | volatile u32 slot12; | ||
231 | } __attribute__ ((packed)); | 204 | } __attribute__ ((packed)); |
232 | 205 | ||
233 | /* offsets to the controller registers based on the above structure layout */ | 206 | /* offsets to the controller registers based on the above structure layout */ |
234 | enum ctrl_offsets { | 207 | enum ctrl_offsets { |
235 | BASE_OFFSET = offsetof(struct ctrl_reg, base_offset), | 208 | BASE_OFFSET = offsetof(struct ctrl_reg, base_offset), |
236 | SLOT_AVAIL1 = offsetof(struct ctrl_reg, slot_avail1), | 209 | SLOT_AVAIL1 = offsetof(struct ctrl_reg, slot_avail1), |
237 | SLOT_AVAIL2 = offsetof(struct ctrl_reg, slot_avail2), | 210 | SLOT_AVAIL2 = offsetof(struct ctrl_reg, slot_avail2), |
238 | SLOT_CONFIG = offsetof(struct ctrl_reg, slot_config), | 211 | SLOT_CONFIG = offsetof(struct ctrl_reg, slot_config), |
239 | SEC_BUS_CONFIG = offsetof(struct ctrl_reg, sec_bus_config), | 212 | SEC_BUS_CONFIG = offsetof(struct ctrl_reg, sec_bus_config), |
240 | MSI_CTRL = offsetof(struct ctrl_reg, msi_ctrl), | 213 | MSI_CTRL = offsetof(struct ctrl_reg, msi_ctrl), |
241 | PROG_INTERFACE = offsetof(struct ctrl_reg, prog_interface), | 214 | PROG_INTERFACE = offsetof(struct ctrl_reg, prog_interface), |
242 | CMD = offsetof(struct ctrl_reg, cmd), | 215 | CMD = offsetof(struct ctrl_reg, cmd), |
243 | CMD_STATUS = offsetof(struct ctrl_reg, cmd_status), | 216 | CMD_STATUS = offsetof(struct ctrl_reg, cmd_status), |
244 | INTR_LOC = offsetof(struct ctrl_reg, intr_loc), | 217 | INTR_LOC = offsetof(struct ctrl_reg, intr_loc), |
245 | SERR_LOC = offsetof(struct ctrl_reg, serr_loc), | 218 | SERR_LOC = offsetof(struct ctrl_reg, serr_loc), |
246 | SERR_INTR_ENABLE = offsetof(struct ctrl_reg, serr_intr_enable), | 219 | SERR_INTR_ENABLE = offsetof(struct ctrl_reg, serr_intr_enable), |
247 | SLOT1 = offsetof(struct ctrl_reg, slot1), | 220 | SLOT1 = offsetof(struct ctrl_reg, slot1), |
248 | SLOT2 = offsetof(struct ctrl_reg, slot2), | ||
249 | SLOT3 = offsetof(struct ctrl_reg, slot3), | ||
250 | SLOT4 = offsetof(struct ctrl_reg, slot4), | ||
251 | SLOT5 = offsetof(struct ctrl_reg, slot5), | ||
252 | SLOT6 = offsetof(struct ctrl_reg, slot6), | ||
253 | SLOT7 = offsetof(struct ctrl_reg, slot7), | ||
254 | SLOT8 = offsetof(struct ctrl_reg, slot8), | ||
255 | SLOT9 = offsetof(struct ctrl_reg, slot9), | ||
256 | SLOT10 = offsetof(struct ctrl_reg, slot10), | ||
257 | SLOT11 = offsetof(struct ctrl_reg, slot11), | ||
258 | SLOT12 = offsetof(struct ctrl_reg, slot12), | ||
259 | }; | 221 | }; |
260 | 222 | ||
261 | /* Inline functions to check the sanity of a pointer that is passed to us */ | 223 | static inline struct slot *get_slot(struct hotplug_slot *hotplug_slot) |
262 | static inline int slot_paranoia_check (struct slot *slot, const char *function) | ||
263 | { | ||
264 | if (!slot) { | ||
265 | dbg("%s - slot == NULL", function); | ||
266 | return -1; | ||
267 | } | ||
268 | if (!slot->hotplug_slot) { | ||
269 | dbg("%s - slot->hotplug_slot == NULL!", function); | ||
270 | return -1; | ||
271 | } | ||
272 | return 0; | ||
273 | } | ||
274 | |||
275 | static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const char *function) | ||
276 | { | 224 | { |
277 | struct slot *slot; | 225 | return hotplug_slot->private; |
278 | |||
279 | if (!hotplug_slot) { | ||
280 | dbg("%s - hotplug_slot == NULL\n", function); | ||
281 | return NULL; | ||
282 | } | ||
283 | |||
284 | slot = (struct slot *)hotplug_slot->private; | ||
285 | if (slot_paranoia_check (slot, function)) | ||
286 | return NULL; | ||
287 | return slot; | ||
288 | } | 226 | } |
289 | 227 | ||
290 | static inline struct slot *shpchp_find_slot (struct controller *ctrl, u8 device) | 228 | static inline struct slot *shpchp_find_slot(struct controller *ctrl, u8 device) |
291 | { | 229 | { |
292 | struct slot *slot; | 230 | struct slot *slot; |
293 | 231 | ||
294 | if (!ctrl) | ||
295 | return NULL; | ||
296 | |||
297 | list_for_each_entry(slot, &ctrl->slot_list, slot_list) { | 232 | list_for_each_entry(slot, &ctrl->slot_list, slot_list) { |
298 | if (slot->device == device) | 233 | if (slot->device == device) |
299 | return slot; | 234 | return slot; |
300 | } | 235 | } |
301 | 236 | ||
302 | err("%s: slot (device=0x%x) not found\n", __FUNCTION__, device); | 237 | err("%s: slot (device=0x%x) not found\n", __FUNCTION__, device); |
303 | |||
304 | return NULL; | 238 | return NULL; |
305 | } | 239 | } |
306 | 240 | ||
@@ -377,31 +311,27 @@ static inline void amd_pogo_errata_restore_misc_reg(struct slot *p_slot) | |||
377 | pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MISCII_OFFSET, pcix_misc2_temp); | 311 | pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MISCII_OFFSET, pcix_misc2_temp); |
378 | } | 312 | } |
379 | 313 | ||
380 | int shpc_init( struct controller *ctrl, struct pci_dev *pdev); | ||
381 | |||
382 | struct hpc_ops { | 314 | struct hpc_ops { |
383 | int (*power_on_slot ) (struct slot *slot); | 315 | int (*power_on_slot)(struct slot *slot); |
384 | int (*slot_enable ) (struct slot *slot); | 316 | int (*slot_enable)(struct slot *slot); |
385 | int (*slot_disable ) (struct slot *slot); | 317 | int (*slot_disable)(struct slot *slot); |
386 | int (*set_bus_speed_mode) (struct slot *slot, enum pci_bus_speed speed); | 318 | int (*set_bus_speed_mode)(struct slot *slot, enum pci_bus_speed speed); |
387 | int (*get_power_status) (struct slot *slot, u8 *status); | 319 | int (*get_power_status)(struct slot *slot, u8 *status); |
388 | int (*get_attention_status) (struct slot *slot, u8 *status); | 320 | int (*get_attention_status)(struct slot *slot, u8 *status); |
389 | int (*set_attention_status) (struct slot *slot, u8 status); | 321 | int (*set_attention_status)(struct slot *slot, u8 status); |
390 | int (*get_latch_status) (struct slot *slot, u8 *status); | 322 | int (*get_latch_status)(struct slot *slot, u8 *status); |
391 | int (*get_adapter_status) (struct slot *slot, u8 *status); | 323 | int (*get_adapter_status)(struct slot *slot, u8 *status); |
392 | 324 | int (*get_max_bus_speed)(struct slot *slot, enum pci_bus_speed *speed); | |
393 | int (*get_max_bus_speed) (struct slot *slot, enum pci_bus_speed *speed); | 325 | int (*get_cur_bus_speed)(struct slot *slot, enum pci_bus_speed *speed); |
394 | int (*get_cur_bus_speed) (struct slot *slot, enum pci_bus_speed *speed); | 326 | int (*get_adapter_speed)(struct slot *slot, enum pci_bus_speed *speed); |
395 | int (*get_adapter_speed) (struct slot *slot, enum pci_bus_speed *speed); | 327 | int (*get_mode1_ECC_cap)(struct slot *slot, u8 *mode); |
396 | int (*get_mode1_ECC_cap) (struct slot *slot, u8 *mode); | 328 | int (*get_prog_int)(struct slot *slot, u8 *prog_int); |
397 | int (*get_prog_int) (struct slot *slot, u8 *prog_int); | 329 | int (*query_power_fault)(struct slot *slot); |
398 | 330 | void (*green_led_on)(struct slot *slot); | |
399 | int (*query_power_fault) (struct slot *slot); | 331 | void (*green_led_off)(struct slot *slot); |
400 | void (*green_led_on) (struct slot *slot); | 332 | void (*green_led_blink)(struct slot *slot); |
401 | void (*green_led_off) (struct slot *slot); | 333 | void (*release_ctlr)(struct controller *ctrl); |
402 | void (*green_led_blink) (struct slot *slot); | 334 | int (*check_cmd_status)(struct controller *ctrl); |
403 | void (*release_ctlr) (struct controller *ctrl); | ||
404 | int (*check_cmd_status) (struct controller *ctrl); | ||
405 | }; | 335 | }; |
406 | 336 | ||
407 | #endif /* _SHPCHP_H */ | 337 | #endif /* _SHPCHP_H */ |
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index 24d1afa4cf97..590cd3cbe010 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c | |||
@@ -193,7 +193,7 @@ void cleanup_slots(struct controller *ctrl) | |||
193 | */ | 193 | */ |
194 | static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status) | 194 | static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status) |
195 | { | 195 | { |
196 | struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); | 196 | struct slot *slot = get_slot(hotplug_slot); |
197 | 197 | ||
198 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); | 198 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); |
199 | 199 | ||
@@ -205,7 +205,7 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status) | |||
205 | 205 | ||
206 | static int enable_slot (struct hotplug_slot *hotplug_slot) | 206 | static int enable_slot (struct hotplug_slot *hotplug_slot) |
207 | { | 207 | { |
208 | struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); | 208 | struct slot *slot = get_slot(hotplug_slot); |
209 | 209 | ||
210 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); | 210 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); |
211 | 211 | ||
@@ -214,7 +214,7 @@ static int enable_slot (struct hotplug_slot *hotplug_slot) | |||
214 | 214 | ||
215 | static int disable_slot (struct hotplug_slot *hotplug_slot) | 215 | static int disable_slot (struct hotplug_slot *hotplug_slot) |
216 | { | 216 | { |
217 | struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); | 217 | struct slot *slot = get_slot(hotplug_slot); |
218 | 218 | ||
219 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); | 219 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); |
220 | 220 | ||
@@ -223,7 +223,7 @@ static int disable_slot (struct hotplug_slot *hotplug_slot) | |||
223 | 223 | ||
224 | static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value) | 224 | static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value) |
225 | { | 225 | { |
226 | struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); | 226 | struct slot *slot = get_slot(hotplug_slot); |
227 | int retval; | 227 | int retval; |
228 | 228 | ||
229 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); | 229 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); |
@@ -237,7 +237,7 @@ static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value) | |||
237 | 237 | ||
238 | static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value) | 238 | static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value) |
239 | { | 239 | { |
240 | struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); | 240 | struct slot *slot = get_slot(hotplug_slot); |
241 | int retval; | 241 | int retval; |
242 | 242 | ||
243 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); | 243 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); |
@@ -251,7 +251,7 @@ static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value) | |||
251 | 251 | ||
252 | static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value) | 252 | static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value) |
253 | { | 253 | { |
254 | struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); | 254 | struct slot *slot = get_slot(hotplug_slot); |
255 | int retval; | 255 | int retval; |
256 | 256 | ||
257 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); | 257 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); |
@@ -265,7 +265,7 @@ static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value) | |||
265 | 265 | ||
266 | static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value) | 266 | static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value) |
267 | { | 267 | { |
268 | struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); | 268 | struct slot *slot = get_slot(hotplug_slot); |
269 | int retval; | 269 | int retval; |
270 | 270 | ||
271 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); | 271 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); |
@@ -279,7 +279,7 @@ static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value) | |||
279 | 279 | ||
280 | static int get_address (struct hotplug_slot *hotplug_slot, u32 *value) | 280 | static int get_address (struct hotplug_slot *hotplug_slot, u32 *value) |
281 | { | 281 | { |
282 | struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); | 282 | struct slot *slot = get_slot(hotplug_slot); |
283 | struct pci_bus *bus = slot->ctrl->pci_dev->subordinate; | 283 | struct pci_bus *bus = slot->ctrl->pci_dev->subordinate; |
284 | 284 | ||
285 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); | 285 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); |
@@ -291,7 +291,7 @@ static int get_address (struct hotplug_slot *hotplug_slot, u32 *value) | |||
291 | 291 | ||
292 | static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) | 292 | static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) |
293 | { | 293 | { |
294 | struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); | 294 | struct slot *slot = get_slot(hotplug_slot); |
295 | int retval; | 295 | int retval; |
296 | 296 | ||
297 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); | 297 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); |
@@ -305,7 +305,7 @@ static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp | |||
305 | 305 | ||
306 | static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) | 306 | static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) |
307 | { | 307 | { |
308 | struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); | 308 | struct slot *slot = get_slot(hotplug_slot); |
309 | int retval; | 309 | int retval; |
310 | 310 | ||
311 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); | 311 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); |
@@ -355,7 +355,7 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
355 | /* Setup the slot information structures */ | 355 | /* Setup the slot information structures */ |
356 | rc = init_slots(ctrl); | 356 | rc = init_slots(ctrl); |
357 | if (rc) { | 357 | if (rc) { |
358 | err(msg_initialization_err, 6); | 358 | err("%s: slot initialization failed\n", SHPC_MODULE_NAME); |
359 | goto err_out_release_ctlr; | 359 | goto err_out_release_ctlr; |
360 | } | 360 | } |
361 | 361 | ||
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index 39893c77d008..6bb84734cd6c 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c | |||
@@ -493,10 +493,12 @@ static void handle_button_press_event(struct slot *p_slot) | |||
493 | p_slot->hpc_ops->get_power_status(p_slot, &getstatus); | 493 | p_slot->hpc_ops->get_power_status(p_slot, &getstatus); |
494 | if (getstatus) { | 494 | if (getstatus) { |
495 | p_slot->state = BLINKINGOFF_STATE; | 495 | p_slot->state = BLINKINGOFF_STATE; |
496 | info(msg_button_off, p_slot->name); | 496 | info("PCI slot #%s - powering off due to button " |
497 | "press.\n", p_slot->name); | ||
497 | } else { | 498 | } else { |
498 | p_slot->state = BLINKINGON_STATE; | 499 | p_slot->state = BLINKINGON_STATE; |
499 | info(msg_button_on, p_slot->name); | 500 | info("PCI slot #%s - powering on due to button " |
501 | "press.\n", p_slot->name); | ||
500 | } | 502 | } |
501 | /* blink green LED and turn off amber */ | 503 | /* blink green LED and turn off amber */ |
502 | p_slot->hpc_ops->green_led_blink(p_slot); | 504 | p_slot->hpc_ops->green_led_blink(p_slot); |
@@ -519,7 +521,8 @@ static void handle_button_press_event(struct slot *p_slot) | |||
519 | else | 521 | else |
520 | p_slot->hpc_ops->green_led_off(p_slot); | 522 | p_slot->hpc_ops->green_led_off(p_slot); |
521 | p_slot->hpc_ops->set_attention_status(p_slot, 0); | 523 | p_slot->hpc_ops->set_attention_status(p_slot, 0); |
522 | info(msg_button_cancel, p_slot->name); | 524 | info("PCI slot #%s - action canceled due to button press\n", |
525 | p_slot->name); | ||
523 | p_slot->state = STATIC_STATE; | 526 | p_slot->state = STATIC_STATE; |
524 | break; | 527 | break; |
525 | case POWEROFF_STATE: | 528 | case POWEROFF_STATE: |