• Home
  • Raw
  • Download

Lines Matching +full:pci +full:- +full:sig

1 // SPDX-License-Identifier: GPL-2.0+
3 * ACPI PCI Hot Plug IBM Extension
23 #include <linux/pci.h>
27 #include "../pci.h"
31 #define DRIVER_DESC "ACPI Hot Plug PCI Controller Driver IBM extension"
40 /* these are the names for the IBM ACPI pseudo-device */
44 #define hpslot_to_sun(A) (to_slot(A)->sun)
46 /* union apci_descriptor - allows access to the
52 char sig[4]; member
74 /* struct notification - keeps info about the device
112 * ibm_slot_from_id - workaround for bad ibm hardware
130 if (memcmp(des->header.sig, "aPCI", 4) != 0) in ibm_slot_from_id()
133 des = (union apci_descriptor *)&table[ind += des->header.len]; in ibm_slot_from_id()
134 while (ind < size && (des->generic.type != 0x82 || in ibm_slot_from_id()
135 des->slot.slot_num != id)) { in ibm_slot_from_id()
136 des = (union apci_descriptor *)&table[ind += des->generic.len]; in ibm_slot_from_id()
139 if (ind < size && des->slot.slot_num == id) in ibm_slot_from_id()
153 * ibm_set_attention_status - callback method to set the attention LED
172 return -ENODEV; in ibm_set_attention_status()
176 ibm_slot->slot.slot_num, ibm_slot->slot.slot_id, in ibm_set_attention_status()
180 args[0].integer.value = ibm_slot->slot.slot_id; in ibm_set_attention_status()
189 return -ENODEV; in ibm_set_attention_status()
192 return -ERANGE; in ibm_set_attention_status()
198 * ibm_get_attention_status - callback method to get attention LED status
217 return -ENODEV; in ibm_get_attention_status()
220 if (ibm_slot->slot.attn & 0xa0 || ibm_slot->slot.status[1] & 0x08) in ibm_get_attention_status()
226 ibm_slot->slot.slot_num, ibm_slot->slot.slot_id, in ibm_get_attention_status()
234 * ibm_handle_events - listens for ACPI events for the IBM37D0 device
248 * only re-enable the interrupt that causes this event AFTER this method
261 acpi_bus_generate_netlink_event(note->device->pnp.device_class, in ibm_handle_events()
262 dev_name(&note->device->dev), in ibm_handle_events()
263 note->event, detail); in ibm_handle_events()
265 note->event = event; in ibm_handle_events()
269 * ibm_get_table_from_acpi - reads the APLS buffer from ACPI
288 int i, size = -EIO; in ibm_get_table_from_acpi()
293 return -ENODEV; in ibm_get_table_from_acpi()
298 (package->type != ACPI_TYPE_PACKAGE) || in ibm_get_table_from_acpi()
299 !(package->package.elements)) { in ibm_get_table_from_acpi()
304 for (size = 0, i = 0; i < package->package.count; i++) { in ibm_get_table_from_acpi()
305 if (package->package.elements[i].type != ACPI_TYPE_BUFFER) { in ibm_get_table_from_acpi()
309 size += package->package.elements[i].buffer.length; in ibm_get_table_from_acpi()
317 __func__, package->package.count, size, lbuf); in ibm_get_table_from_acpi()
322 size = -ENOMEM; in ibm_get_table_from_acpi()
327 for (i = 0; i < package->package.count; i++) { in ibm_get_table_from_acpi()
329 package->package.elements[i].buffer.pointer, in ibm_get_table_from_acpi()
330 package->package.elements[i].buffer.length); in ibm_get_table_from_acpi()
331 size += package->package.elements[i].buffer.length; in ibm_get_table_from_acpi()
340 * ibm_read_apci_table - callback for the sysfs apci_table file
349 * to be executed when /sys/bus/pci/slots/apci_table gets read.
359 int bytes_read = -EINVAL; in ibm_read_apci_table()
374 * ibm_find_acpi_device - callback to find our ACPI device
381 * to find our device. When this method returns non-zero
402 if (current_status && (info->valid & ACPI_VALID_HID) && in ibm_find_acpi_device()
403 (!strcmp(info->hardware_id.string, IBM_HARDWARE_ID1) || in ibm_find_acpi_device()
404 !strcmp(info->hardware_id.string, IBM_HARDWARE_ID2))) { in ibm_find_acpi_device()
406 info->hardware_id.string, handle); in ibm_find_acpi_device()
408 /* returning non-zero causes the search to stop in ibm_find_acpi_device()
424 struct kobject *sysdir = &pci_slots_kset->kobj; in ibm_acpiphp_init()
432 retval = -ENODEV; in ibm_acpiphp_init()
439 retval = -ENODEV; in ibm_acpiphp_init()
443 retval = -ENODEV; in ibm_acpiphp_init()
454 retval = -EBUSY; in ibm_acpiphp_init()
472 struct kobject *sysdir = &pci_slots_kset->kobj; in ibm_acpiphp_exit()