aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/acpiphp_ibm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/acpiphp_ibm.c')
-rw-r--r--drivers/pci/hotplug/acpiphp_ibm.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
index 56829f82be4a..47d26b65e99a 100644
--- a/drivers/pci/hotplug/acpiphp_ibm.c
+++ b/drivers/pci/hotplug/acpiphp_ibm.c
@@ -134,11 +134,11 @@ static struct acpiphp_attention_info ibm_attention_info =
134 * ibm_slot_from_id - workaround for bad ibm hardware 134 * ibm_slot_from_id - workaround for bad ibm hardware
135 * @id: the slot number that linux refers to the slot by 135 * @id: the slot number that linux refers to the slot by
136 * 136 *
137 * Description: this method returns the aCPI slot descriptor 137 * Description: This method returns the aCPI slot descriptor
138 * corresponding to the Linux slot number. This descriptor 138 * corresponding to the Linux slot number. This descriptor
139 * has info about the aPCI slot id and attention status. 139 * has info about the aPCI slot id and attention status.
140 * This descriptor must be freed using kfree when done. 140 * This descriptor must be freed using kfree when done.
141 **/ 141 */
142static union apci_descriptor *ibm_slot_from_id(int id) 142static union apci_descriptor *ibm_slot_from_id(int id)
143{ 143{
144 int ind = 0, size; 144 int ind = 0, size;
@@ -173,9 +173,9 @@ ibm_slot_done:
173 * @slot: the hotplug_slot to work with 173 * @slot: the hotplug_slot to work with
174 * @status: what to set the LED to (0 or 1) 174 * @status: what to set the LED to (0 or 1)
175 * 175 *
176 * Description: this method is registered with the acpiphp module as a 176 * Description: This method is registered with the acpiphp module as a
177 * callback to do the device specific task of setting the LED status 177 * callback to do the device specific task of setting the LED status.
178 **/ 178 */
179static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status) 179static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status)
180{ 180{
181 union acpi_object args[2]; 181 union acpi_object args[2];
@@ -213,13 +213,13 @@ static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status)
213 * @slot: the hotplug_slot to work with 213 * @slot: the hotplug_slot to work with
214 * @status: returns what the LED is set to (0 or 1) 214 * @status: returns what the LED is set to (0 or 1)
215 * 215 *
216 * Description: this method is registered with the acpiphp module as a 216 * Description: This method is registered with the acpiphp module as a
217 * callback to do the device specific task of getting the LED status 217 * callback to do the device specific task of getting the LED status.
218 * 218 *
219 * Because there is no direct method of getting the LED status directly 219 * Because there is no direct method of getting the LED status directly
220 * from an ACPI call, we read the aPCI table and parse out our 220 * from an ACPI call, we read the aPCI table and parse out our
221 * slot descriptor to read the status from that. 221 * slot descriptor to read the status from that.
222 **/ 222 */
223static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status) 223static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status)
224{ 224{
225 union apci_descriptor *ibm_slot; 225 union apci_descriptor *ibm_slot;
@@ -245,8 +245,8 @@ static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status)
245 * @event: the event info (device specific) 245 * @event: the event info (device specific)
246 * @context: passed context (our notification struct) 246 * @context: passed context (our notification struct)
247 * 247 *
248 * Description: this method is registered as a callback with the ACPI 248 * Description: This method is registered as a callback with the ACPI
249 * subsystem it is called when this device has an event to notify the OS of 249 * subsystem it is called when this device has an event to notify the OS of.
250 * 250 *
251 * The events actually come from the device as two events that get 251 * The events actually come from the device as two events that get
252 * synthesized into one event with data by this function. The event 252 * synthesized into one event with data by this function. The event
@@ -256,7 +256,7 @@ static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status)
256 * From section 5.6.2.2 of the ACPI 2.0 spec, I understand that the OSPM will 256 * From section 5.6.2.2 of the ACPI 2.0 spec, I understand that the OSPM will
257 * only re-enable the interrupt that causes this event AFTER this method 257 * only re-enable the interrupt that causes this event AFTER this method
258 * has returned, thereby enforcing serial access for the notification struct. 258 * has returned, thereby enforcing serial access for the notification struct.
259 **/ 259 */
260static void ibm_handle_events(acpi_handle handle, u32 event, void *context) 260static void ibm_handle_events(acpi_handle handle, u32 event, void *context)
261{ 261{
262 u8 detail = event & 0x0f; 262 u8 detail = event & 0x0f;
@@ -279,16 +279,16 @@ static void ibm_handle_events(acpi_handle handle, u32 event, void *context)
279 * ibm_get_table_from_acpi - reads the APLS buffer from ACPI 279 * ibm_get_table_from_acpi - reads the APLS buffer from ACPI
280 * @bufp: address to pointer to allocate for the table 280 * @bufp: address to pointer to allocate for the table
281 * 281 *
282 * Description: this method reads the APLS buffer in from ACPI and 282 * Description: This method reads the APLS buffer in from ACPI and
283 * stores the "stripped" table into a single buffer 283 * stores the "stripped" table into a single buffer
284 * it allocates and passes the address back in bufp 284 * it allocates and passes the address back in bufp.
285 * 285 *
286 * If NULL is passed in as buffer, this method only calculates 286 * If NULL is passed in as buffer, this method only calculates
287 * the size of the table and returns that without filling 287 * the size of the table and returns that without filling
288 * in the buffer 288 * in the buffer.
289 * 289 *
290 * returns < 0 on error or the size of the table on success 290 * Returns < 0 on error or the size of the table on success.
291 **/ 291 */
292static int ibm_get_table_from_acpi(char **bufp) 292static int ibm_get_table_from_acpi(char **bufp)
293{ 293{
294 union acpi_object *package; 294 union acpi_object *package;
@@ -349,17 +349,18 @@ read_table_done:
349/** 349/**
350 * ibm_read_apci_table - callback for the sysfs apci_table file 350 * ibm_read_apci_table - callback for the sysfs apci_table file
351 * @kobj: the kobject this binary attribute is a part of 351 * @kobj: the kobject this binary attribute is a part of
352 * @bin_attr: struct bin_attribute for this file
352 * @buffer: the kernel space buffer to fill 353 * @buffer: the kernel space buffer to fill
353 * @pos: the offset into the file 354 * @pos: the offset into the file
354 * @size: the number of bytes requested 355 * @size: the number of bytes requested
355 * 356 *
356 * Description: gets registered with sysfs as the reader callback 357 * Description: Gets registered with sysfs as the reader callback
357 * to be executed when /sys/bus/pci/slots/apci_table gets read 358 * to be executed when /sys/bus/pci/slots/apci_table gets read.
358 * 359 *
359 * Since we don't get notified on open and close for this file, 360 * Since we don't get notified on open and close for this file,
360 * things get really tricky here... 361 * things get really tricky here...
361 * our solution is to only allow reading the table in all at once 362 * our solution is to only allow reading the table in all at once.
362 **/ 363 */
363static ssize_t ibm_read_apci_table(struct kobject *kobj, 364static ssize_t ibm_read_apci_table(struct kobject *kobj,
364 struct bin_attribute *bin_attr, 365 struct bin_attribute *bin_attr,
365 char *buffer, loff_t pos, size_t size) 366 char *buffer, loff_t pos, size_t size)
@@ -385,10 +386,10 @@ static ssize_t ibm_read_apci_table(struct kobject *kobj,
385 * @context: a pointer to our handle to fill when we find the device 386 * @context: a pointer to our handle to fill when we find the device
386 * @rv: a return value to fill if desired 387 * @rv: a return value to fill if desired
387 * 388 *
388 * Description: used as a callback when calling acpi_walk_namespace 389 * Description: Used as a callback when calling acpi_walk_namespace
389 * to find our device. When this method returns non-zero 390 * to find our device. When this method returns non-zero
390 * acpi_walk_namespace quits its search and returns our value 391 * acpi_walk_namespace quits its search and returns our value.
391 **/ 392 */
392static acpi_status __init ibm_find_acpi_device(acpi_handle handle, 393static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
393 u32 lvl, void *context, void **rv) 394 u32 lvl, void *context, void **rv)
394{ 395{