26 #include <linux/module.h>
27 #include <linux/kernel.h>
28 #include <linux/pci.h>
34 #define MY_NAME "cpci_hotplug"
38 #define dbg(format, arg...) \
41 printk (KERN_DEBUG "%s: " format "\n", \
44 #define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
45 #define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
46 #define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg)
60 if (pci_bus_read_config_word(slot->
bus,
66 return hs_csr & 0x0008 ? 1 : 0;
79 if (pci_bus_read_config_word(slot->
bus,
88 if (pci_bus_write_config_word(slot->
bus,
106 if (pci_bus_read_config_word(slot->
bus,
125 if (pci_bus_read_config_word(slot->
bus,
132 if (pci_bus_write_config_word(slot->
bus,
154 if (pci_bus_read_config_word(slot->
bus,
174 if (pci_bus_read_config_word(slot->
bus,
181 if (pci_bus_write_config_word(slot->
bus,
200 if (pci_bus_read_config_word(slot->
bus,
207 if (pci_bus_write_config_word(slot->
bus,
211 err(
"Could not set LOO for slot %s",
229 if (pci_bus_read_config_word(slot->
bus,
235 hs_csr &= ~HS_CSR_LOO;
236 if (pci_bus_write_config_word(slot->
bus,
240 err(
"Could not clear LOO for slot %s",
258 dbg(
"%s - enter", __func__);
261 dbg(
"pci_dev null, finding %02x:%02x:%x",
269 dbg(
"pci_dev still null");
276 dbg(
"%s: pci_scan_slot returned %d", __func__, n);
279 err(
"Could not find PCI device for slot %02x", slot->
number);
283 parent = slot->
dev->bus;
285 for (fn = 0; fn < 8; fn++) {
302 dbg(
"%s - exit", __func__);
311 dbg(
"%s - enter", __func__);
313 err(
"No device for slot %02x\n", slot->
number);
317 for (i = 0; i < 8; i++) {
328 dbg(
"%s - exit", __func__);