You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'pci/trivial' into next
* pci/trivial: PCI: shpchp: Constify hpc_ops structure PCI: Use kobj_to_dev() instead of open-coding it PCI: Use to_pci_dev() instead of open-coding it PCI: Fix all whitespace issues PCI/MSI: Fix typos in <linux/msi.h>
This commit is contained in:
@@ -25,7 +25,7 @@ DEFINE_RAW_SPINLOCK(pci_lock);
|
||||
#define PCI_word_BAD (pos & 1)
|
||||
#define PCI_dword_BAD (pos & 3)
|
||||
|
||||
#define PCI_OP_READ(size,type,len) \
|
||||
#define PCI_OP_READ(size, type, len) \
|
||||
int pci_bus_read_config_##size \
|
||||
(struct pci_bus *bus, unsigned int devfn, int pos, type *value) \
|
||||
{ \
|
||||
@@ -40,7 +40,7 @@ int pci_bus_read_config_##size \
|
||||
return res; \
|
||||
}
|
||||
|
||||
#define PCI_OP_WRITE(size,type,len) \
|
||||
#define PCI_OP_WRITE(size, type, len) \
|
||||
int pci_bus_write_config_##size \
|
||||
(struct pci_bus *bus, unsigned int devfn, int pos, type value) \
|
||||
{ \
|
||||
@@ -231,7 +231,7 @@ static noinline void pci_wait_cfg(struct pci_dev *dev)
|
||||
}
|
||||
|
||||
/* Returns 0 on success, negative values indicate error. */
|
||||
#define PCI_USER_READ_CONFIG(size,type) \
|
||||
#define PCI_USER_READ_CONFIG(size, type) \
|
||||
int pci_user_read_config_##size \
|
||||
(struct pci_dev *dev, int pos, type *val) \
|
||||
{ \
|
||||
@@ -251,7 +251,7 @@ int pci_user_read_config_##size \
|
||||
EXPORT_SYMBOL_GPL(pci_user_read_config_##size);
|
||||
|
||||
/* Returns 0 on success, negative values indicate error. */
|
||||
#define PCI_USER_WRITE_CONFIG(size,type) \
|
||||
#define PCI_USER_WRITE_CONFIG(size, type) \
|
||||
int pci_user_write_config_##size \
|
||||
(struct pci_dev *dev, int pos, type val) \
|
||||
{ \
|
||||
|
||||
@@ -122,7 +122,7 @@ static int pcie_phy_wait_ack(void __iomem *dbi_base, int addr)
|
||||
}
|
||||
|
||||
/* Read from the 16-bit PCIe PHY control registers (not memory-mapped) */
|
||||
static int pcie_phy_read(void __iomem *dbi_base, int addr , int *data)
|
||||
static int pcie_phy_read(void __iomem *dbi_base, int addr, int *data)
|
||||
{
|
||||
u32 val, phy_ctl;
|
||||
int ret;
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
|
||||
#define MY_NAME "acpi_pcihp"
|
||||
|
||||
#define dbg(fmt, arg...) do { if (debug_acpi) printk(KERN_DEBUG "%s: %s: " fmt , MY_NAME , __func__ , ## arg); } while (0)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
|
||||
#define dbg(fmt, arg...) do { if (debug_acpi) printk(KERN_DEBUG "%s: %s: " fmt, MY_NAME, __func__, ## arg); } while (0)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format, MY_NAME, ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME, ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME, ## arg)
|
||||
|
||||
#define METHOD_NAME__SUN "_SUN"
|
||||
#define METHOD_NAME_OSHP "OSHP"
|
||||
@@ -132,7 +132,7 @@ int acpi_get_hp_hw_control_from_firmware(struct pci_dev *pdev, u32 flags)
|
||||
|
||||
while (handle) {
|
||||
acpi_get_name(handle, ACPI_FULL_PATHNAME, &string);
|
||||
dbg("Trying to get hotplug control for %s \n",
|
||||
dbg("Trying to get hotplug control for %s\n",
|
||||
(char *)string.pointer);
|
||||
status = acpi_run_oshp(handle);
|
||||
if (ACPI_SUCCESS(status))
|
||||
|
||||
@@ -181,7 +181,7 @@ struct acpiphp_attention_info
|
||||
/* function prototypes */
|
||||
|
||||
/* acpiphp_core.c */
|
||||
int acpiphp_register_attention(struct acpiphp_attention_info*info);
|
||||
int acpiphp_register_attention(struct acpiphp_attention_info *info);
|
||||
int acpiphp_unregister_attention(struct acpiphp_attention_info *info);
|
||||
int acpiphp_register_hotplug_slot(struct acpiphp_slot *slot, unsigned int sun);
|
||||
void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *slot);
|
||||
|
||||
@@ -63,13 +63,13 @@ MODULE_LICENSE("GPL");
|
||||
MODULE_PARM_DESC(disable, "disable acpiphp driver");
|
||||
module_param_named(disable, acpiphp_disabled, bool, 0444);
|
||||
|
||||
static int enable_slot (struct hotplug_slot *slot);
|
||||
static int disable_slot (struct hotplug_slot *slot);
|
||||
static int set_attention_status (struct hotplug_slot *slot, u8 value);
|
||||
static int get_power_status (struct hotplug_slot *slot, u8 *value);
|
||||
static int get_attention_status (struct hotplug_slot *slot, u8 *value);
|
||||
static int get_latch_status (struct hotplug_slot *slot, u8 *value);
|
||||
static int get_adapter_status (struct hotplug_slot *slot, u8 *value);
|
||||
static int enable_slot(struct hotplug_slot *slot);
|
||||
static int disable_slot(struct hotplug_slot *slot);
|
||||
static int set_attention_status(struct hotplug_slot *slot, u8 value);
|
||||
static int get_power_status(struct hotplug_slot *slot, u8 *value);
|
||||
static int get_attention_status(struct hotplug_slot *slot, u8 *value);
|
||||
static int get_latch_status(struct hotplug_slot *slot, u8 *value);
|
||||
static int get_adapter_status(struct hotplug_slot *slot, u8 *value);
|
||||
|
||||
static struct hotplug_slot_ops acpi_hotplug_slot_ops = {
|
||||
.enable_slot = enable_slot,
|
||||
|
||||
@@ -707,7 +707,7 @@ static void acpiphp_sanitize_bus(struct pci_bus *bus)
|
||||
unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM;
|
||||
|
||||
list_for_each_entry_safe_reverse(dev, tmp, &bus->devices, bus_list) {
|
||||
for (i=0; i<PCI_BRIDGE_RESOURCES; i++) {
|
||||
for (i = 0; i < PCI_BRIDGE_RESOURCES; i++) {
|
||||
struct resource *res = &dev->resource[i];
|
||||
if ((res->flags & type_mask) && !res->start &&
|
||||
res->end) {
|
||||
|
||||
@@ -336,7 +336,7 @@ static int ibm_get_table_from_acpi(char **bufp)
|
||||
}
|
||||
|
||||
size = 0;
|
||||
for (i=0; i<package->package.count; i++) {
|
||||
for (i = 0; i < package->package.count; i++) {
|
||||
memcpy(&lbuf[size],
|
||||
package->package.elements[i].buffer.pointer,
|
||||
package->package.elements[i].buffer.length);
|
||||
|
||||
@@ -52,13 +52,13 @@ struct slot {
|
||||
};
|
||||
|
||||
struct cpci_hp_controller_ops {
|
||||
int (*query_enum) (void);
|
||||
int (*enable_irq) (void);
|
||||
int (*disable_irq) (void);
|
||||
int (*check_irq) (void *dev_id);
|
||||
int (*hardware_test) (struct slot *slot, u32 value);
|
||||
u8 (*get_power) (struct slot *slot);
|
||||
int (*set_power) (struct slot *slot, int value);
|
||||
int (*query_enum)(void);
|
||||
int (*enable_irq)(void);
|
||||
int (*disable_irq)(void);
|
||||
int (*check_irq)(void *dev_id);
|
||||
int (*hardware_test)(struct slot *slot, u32 value);
|
||||
u8 (*get_power)(struct slot *slot);
|
||||
int (*set_power)(struct slot *slot, int value);
|
||||
};
|
||||
|
||||
struct cpci_hp_controller {
|
||||
|
||||
@@ -45,12 +45,12 @@
|
||||
#define dbg(format, arg...) \
|
||||
do { \
|
||||
if (cpci_debug) \
|
||||
printk (KERN_DEBUG "%s: " format "\n", \
|
||||
MY_NAME , ## arg); \
|
||||
printk(KERN_DEBUG "%s: " format "\n", \
|
||||
MY_NAME, ## arg); \
|
||||
} while (0)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME, ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME, ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME, ## arg)
|
||||
|
||||
/* local variables */
|
||||
static DECLARE_RWSEM(list_rwsem);
|
||||
@@ -238,21 +238,21 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last)
|
||||
* with the pci_hotplug subsystem.
|
||||
*/
|
||||
for (i = first; i <= last; ++i) {
|
||||
slot = kzalloc(sizeof (struct slot), GFP_KERNEL);
|
||||
slot = kzalloc(sizeof(struct slot), GFP_KERNEL);
|
||||
if (!slot) {
|
||||
status = -ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
|
||||
hotplug_slot =
|
||||
kzalloc(sizeof (struct hotplug_slot), GFP_KERNEL);
|
||||
kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
|
||||
if (!hotplug_slot) {
|
||||
status = -ENOMEM;
|
||||
goto error_slot;
|
||||
}
|
||||
slot->hotplug_slot = hotplug_slot;
|
||||
|
||||
info = kzalloc(sizeof (struct hotplug_slot_info), GFP_KERNEL);
|
||||
info = kzalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL);
|
||||
if (!info) {
|
||||
status = -ENOMEM;
|
||||
goto error_hpslot;
|
||||
|
||||
@@ -38,12 +38,12 @@ extern int cpci_debug;
|
||||
#define dbg(format, arg...) \
|
||||
do { \
|
||||
if (cpci_debug) \
|
||||
printk (KERN_DEBUG "%s: " format "\n", \
|
||||
MY_NAME , ## arg); \
|
||||
printk(KERN_DEBUG "%s: " format "\n", \
|
||||
MY_NAME, ## arg); \
|
||||
} while (0)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME, ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME, ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME, ## arg)
|
||||
|
||||
|
||||
u8 cpci_get_attention_status(struct slot *slot)
|
||||
|
||||
@@ -54,12 +54,12 @@
|
||||
#define dbg(format, arg...) \
|
||||
do { \
|
||||
if (debug) \
|
||||
printk (KERN_DEBUG "%s: " format "\n", \
|
||||
MY_NAME , ## arg); \
|
||||
printk(KERN_DEBUG "%s: " format "\n", \
|
||||
MY_NAME, ## arg); \
|
||||
} while (0)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME, ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME, ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME, ## arg)
|
||||
|
||||
/* local variables */
|
||||
static bool debug;
|
||||
@@ -164,7 +164,7 @@ static int __init cpcihp_generic_init(void)
|
||||
bus = dev->subordinate;
|
||||
pci_dev_put(dev);
|
||||
|
||||
memset(&generic_hpc, 0, sizeof (struct cpci_hp_controller));
|
||||
memset(&generic_hpc, 0, sizeof(struct cpci_hp_controller));
|
||||
generic_hpc_ops.query_enum = query_enum;
|
||||
generic_hpc.ops = &generic_hpc_ops;
|
||||
|
||||
|
||||
@@ -49,12 +49,12 @@
|
||||
#define dbg(format, arg...) \
|
||||
do { \
|
||||
if (debug) \
|
||||
printk (KERN_DEBUG "%s: " format "\n", \
|
||||
MY_NAME , ## arg); \
|
||||
printk(KERN_DEBUG "%s: " format "\n", \
|
||||
MY_NAME, ## arg); \
|
||||
} while (0)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME, ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME, ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME, ## arg)
|
||||
|
||||
/* local variables */
|
||||
static bool debug;
|
||||
@@ -204,7 +204,7 @@ static int zt5550_hc_disable_irq(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int zt5550_hc_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
static int zt5550_hc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
{
|
||||
int status;
|
||||
|
||||
@@ -214,7 +214,7 @@ static int zt5550_hc_init_one (struct pci_dev *pdev, const struct pci_device_id
|
||||
|
||||
dbg("returned from zt5550_hc_config");
|
||||
|
||||
memset(&zt5550_hpc, 0, sizeof (struct cpci_hp_controller));
|
||||
memset(&zt5550_hpc, 0, sizeof(struct cpci_hp_controller));
|
||||
zt5550_hpc_ops.query_enum = zt5550_hc_query_enum;
|
||||
zt5550_hpc.ops = &zt5550_hpc_ops;
|
||||
if (!poll) {
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
|
||||
#define MY_NAME "cpqphp"
|
||||
|
||||
#define dbg(fmt, arg...) do { if (cpqhp_debug) printk(KERN_DEBUG "%s: " fmt , MY_NAME , ## arg); } while (0)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
|
||||
#define dbg(fmt, arg...) do { if (cpqhp_debug) printk(KERN_DEBUG "%s: " fmt, MY_NAME, ## arg); } while (0)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format, MY_NAME, ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME, ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME, ## arg)
|
||||
|
||||
|
||||
|
||||
@@ -424,7 +424,7 @@ int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func);
|
||||
int cpqhp_hardware_test(struct controller *ctrl, int test_num);
|
||||
|
||||
/* resource functions */
|
||||
int cpqhp_resource_sort_and_combine (struct pci_resource **head);
|
||||
int cpqhp_resource_sort_and_combine(struct pci_resource **head);
|
||||
|
||||
/* pci functions */
|
||||
int cpqhp_set_irq(u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num);
|
||||
@@ -685,7 +685,7 @@ static inline int cpq_get_latch_status(struct controller *ctrl,
|
||||
u8 hp_slot;
|
||||
|
||||
hp_slot = slot->device - ctrl->slot_device_offset;
|
||||
dbg("%s: slot->device = %d, ctrl->slot_device_offset = %d \n",
|
||||
dbg("%s: slot->device = %d, ctrl->slot_device_offset = %d\n",
|
||||
__func__, slot->device, ctrl->slot_device_offset);
|
||||
|
||||
status = (readl(ctrl->hpc_reg + INT_INPUT_CLEAR) & (0x01L << hp_slot));
|
||||
@@ -712,7 +712,7 @@ static inline int get_presence_status(struct controller *ctrl,
|
||||
|
||||
static inline int wait_for_ctrl_irq(struct controller *ctrl)
|
||||
{
|
||||
DECLARE_WAITQUEUE(wait, current);
|
||||
DECLARE_WAITQUEUE(wait, current);
|
||||
int retval = 0;
|
||||
|
||||
dbg("%s - start\n", __func__);
|
||||
|
||||
@@ -291,7 +291,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
|
||||
kfree(slot);
|
||||
}
|
||||
|
||||
static int ctrl_slot_cleanup (struct controller *ctrl)
|
||||
static int ctrl_slot_cleanup(struct controller *ctrl)
|
||||
{
|
||||
struct slot *old_slot, *next_slot;
|
||||
|
||||
@@ -301,7 +301,7 @@ static int ctrl_slot_cleanup (struct controller *ctrl)
|
||||
while (old_slot) {
|
||||
/* memory will be freed by the release_slot callback */
|
||||
next_slot = old_slot->next;
|
||||
pci_hp_deregister (old_slot->hotplug_slot);
|
||||
pci_hp_deregister(old_slot->hotplug_slot);
|
||||
old_slot = next_slot;
|
||||
}
|
||||
|
||||
@@ -413,9 +413,9 @@ cpqhp_set_attention_status(struct controller *ctrl, struct pci_func *func,
|
||||
mutex_lock(&ctrl->crit_sect);
|
||||
|
||||
if (status == 1)
|
||||
amber_LED_on (ctrl, hp_slot);
|
||||
amber_LED_on(ctrl, hp_slot);
|
||||
else if (status == 0)
|
||||
amber_LED_off (ctrl, hp_slot);
|
||||
amber_LED_off(ctrl, hp_slot);
|
||||
else {
|
||||
/* Done with exclusive hardware access */
|
||||
mutex_unlock(&ctrl->crit_sect);
|
||||
@@ -425,7 +425,7 @@ cpqhp_set_attention_status(struct controller *ctrl, struct pci_func *func,
|
||||
set_SOGO(ctrl);
|
||||
|
||||
/* Wait for SOBS to be unset */
|
||||
wait_for_ctrl_irq (ctrl);
|
||||
wait_for_ctrl_irq(ctrl);
|
||||
|
||||
/* Done with exclusive hardware access */
|
||||
mutex_unlock(&ctrl->crit_sect);
|
||||
@@ -439,7 +439,7 @@ cpqhp_set_attention_status(struct controller *ctrl, struct pci_func *func,
|
||||
* @hotplug_slot: slot to change LED on
|
||||
* @status: LED control flag
|
||||
*/
|
||||
static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
|
||||
static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
|
||||
{
|
||||
struct pci_func *slot_func;
|
||||
struct slot *slot = hotplug_slot->private;
|
||||
@@ -610,7 +610,7 @@ static int ctrl_slot_setup(struct controller *ctrl,
|
||||
u8 ctrl_slot;
|
||||
u32 tempdword;
|
||||
char name[SLOT_NAME_SIZE];
|
||||
void __iomem *slot_entry= NULL;
|
||||
void __iomem *slot_entry = NULL;
|
||||
int result;
|
||||
|
||||
dbg("%s\n", __func__);
|
||||
@@ -755,7 +755,7 @@ static int one_time_init(void)
|
||||
if (cpqhp_debug)
|
||||
pci_print_IRQ_route();
|
||||
|
||||
dbg("Initialize + Start the notification mechanism \n");
|
||||
dbg("Initialize + Start the notification mechanism\n");
|
||||
|
||||
retval = cpqhp_event_start_thread();
|
||||
if (retval)
|
||||
@@ -772,7 +772,7 @@ static int one_time_init(void)
|
||||
/* Map rom address */
|
||||
cpqhp_rom_start = ioremap(ROM_PHY_ADDR, ROM_PHY_LEN);
|
||||
if (!cpqhp_rom_start) {
|
||||
err ("Could not ioremap memory region for ROM\n");
|
||||
err("Could not ioremap memory region for ROM\n");
|
||||
retval = -EIO;
|
||||
goto error;
|
||||
}
|
||||
@@ -786,7 +786,7 @@ static int one_time_init(void)
|
||||
smbios_table = detect_SMBIOS_pointer(cpqhp_rom_start,
|
||||
cpqhp_rom_start + ROM_PHY_LEN);
|
||||
if (!smbios_table) {
|
||||
err ("Could not find the SMBIOS pointer in memory\n");
|
||||
err("Could not find the SMBIOS pointer in memory\n");
|
||||
retval = -EIO;
|
||||
goto error_rom_start;
|
||||
}
|
||||
@@ -794,7 +794,7 @@ static int one_time_init(void)
|
||||
smbios_start = ioremap(readl(smbios_table + ST_ADDRESS),
|
||||
readw(smbios_table + ST_LENGTH));
|
||||
if (!smbios_start) {
|
||||
err ("Could not ioremap memory region taken from SMBIOS values\n");
|
||||
err("Could not ioremap memory region taken from SMBIOS values\n");
|
||||
retval = -EIO;
|
||||
goto error_smbios_start;
|
||||
}
|
||||
@@ -1181,7 +1181,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
* Finish setting up the hot plug ctrl device
|
||||
*/
|
||||
ctrl->slot_device_offset = readb(ctrl->hpc_reg + SLOT_MASK) >> 4;
|
||||
dbg("NumSlots %d \n", ctrl->slot_device_offset);
|
||||
dbg("NumSlots %d\n", ctrl->slot_device_offset);
|
||||
|
||||
ctrl->next_event = 0;
|
||||
|
||||
@@ -1198,7 +1198,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_MASK);
|
||||
|
||||
/* set up the interrupt */
|
||||
dbg("HPC interrupt = %d \n", ctrl->interrupt);
|
||||
dbg("HPC interrupt = %d\n", ctrl->interrupt);
|
||||
if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr,
|
||||
IRQF_SHARED, MY_NAME, ctrl)) {
|
||||
err("Can't get irq %d for the hotplug pci controller\n",
|
||||
@@ -1321,7 +1321,7 @@ static void __exit unload_cpqphpd(void)
|
||||
while (ctrl) {
|
||||
if (ctrl->hpc_reg) {
|
||||
u16 misc;
|
||||
rc = read_slot_enable (ctrl);
|
||||
rc = read_slot_enable(ctrl);
|
||||
|
||||
writeb(0, ctrl->hpc_reg + SLOT_SERR);
|
||||
writel(0xFFFFFFC0L | ~rc, ctrl->hpc_reg + INT_MASK);
|
||||
@@ -1361,7 +1361,7 @@ static void __exit unload_cpqphpd(void)
|
||||
kfree(tres);
|
||||
}
|
||||
|
||||
kfree (ctrl->pci_bus);
|
||||
kfree(ctrl->pci_bus);
|
||||
|
||||
tctrl = ctrl;
|
||||
ctrl = ctrl->next;
|
||||
@@ -1446,7 +1446,7 @@ static int __init cpqhpc_init(void)
|
||||
|
||||
cpqhp_debug = debug;
|
||||
|
||||
info (DRIVER_DESC " version: " DRIVER_VERSION "\n");
|
||||
info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
|
||||
cpqhp_initialize_debugfs();
|
||||
result = pci_register_driver(&cpqhpc_driver);
|
||||
dbg("pci_register_driver = %d\n", result);
|
||||
|
||||
+100
-100
File diff suppressed because it is too large
Load Diff
@@ -114,10 +114,10 @@ static u32 add_byte(u32 **p_buffer, u8 value, u32 *used, u32 *avail)
|
||||
if ((*used + 1) > *avail)
|
||||
return(1);
|
||||
|
||||
*((u8*)*p_buffer) = value;
|
||||
tByte = (u8**)p_buffer;
|
||||
*((u8 *)*p_buffer) = value;
|
||||
tByte = (u8 **)p_buffer;
|
||||
(*tByte)++;
|
||||
*used+=1;
|
||||
*used += 1;
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ static u32 add_dword(u32 **p_buffer, u32 value, u32 *used, u32 *avail)
|
||||
|
||||
**p_buffer = value;
|
||||
(*p_buffer)++;
|
||||
*used+=4;
|
||||
*used += 4;
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ static u32 add_dword(u32 **p_buffer, u32 value, u32 *used, u32 *avail)
|
||||
*
|
||||
* returns 0 for non-Compaq ROM, 1 for Compaq ROM
|
||||
*/
|
||||
static int check_for_compaq_ROM (void __iomem *rom_start)
|
||||
static int check_for_compaq_ROM(void __iomem *rom_start)
|
||||
{
|
||||
u8 temp1, temp2, temp3, temp4, temp5, temp6;
|
||||
int result = 0;
|
||||
@@ -160,12 +160,12 @@ static int check_for_compaq_ROM (void __iomem *rom_start)
|
||||
(temp6 == 'Q')) {
|
||||
result = 1;
|
||||
}
|
||||
dbg ("%s - returned %d\n", __func__, result);
|
||||
dbg("%s - returned %d\n", __func__, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static u32 access_EV (u16 operation, u8 *ev_name, u8 *buffer, u32 *buf_size)
|
||||
static u32 access_EV(u16 operation, u8 *ev_name, u8 *buffer, u32 *buf_size)
|
||||
{
|
||||
unsigned long flags;
|
||||
int op = operation;
|
||||
@@ -197,7 +197,7 @@ static u32 access_EV (u16 operation, u8 *ev_name, u8 *buffer, u32 *buf_size)
|
||||
*
|
||||
* Read the hot plug Resource Table from NVRAM
|
||||
*/
|
||||
static int load_HRT (void __iomem *rom_start)
|
||||
static int load_HRT(void __iomem *rom_start)
|
||||
{
|
||||
u32 available;
|
||||
u32 temp_dword;
|
||||
@@ -232,7 +232,7 @@ static int load_HRT (void __iomem *rom_start)
|
||||
*
|
||||
* Save the hot plug Resource Table in NVRAM
|
||||
*/
|
||||
static u32 store_HRT (void __iomem *rom_start)
|
||||
static u32 store_HRT(void __iomem *rom_start)
|
||||
{
|
||||
u32 *buffer;
|
||||
u32 *pFill;
|
||||
@@ -252,7 +252,7 @@ static u32 store_HRT (void __iomem *rom_start)
|
||||
if (!check_for_compaq_ROM(rom_start))
|
||||
return(1);
|
||||
|
||||
buffer = (u32*) evbuffer;
|
||||
buffer = (u32 *) evbuffer;
|
||||
|
||||
if (!buffer)
|
||||
return(1);
|
||||
@@ -306,7 +306,7 @@ static u32 store_HRT (void __iomem *rom_start)
|
||||
loop = 0;
|
||||
|
||||
while (resNode) {
|
||||
loop ++;
|
||||
loop++;
|
||||
|
||||
/* base */
|
||||
rc = add_dword(&pFill, resNode->base, &usedbytes, &available);
|
||||
@@ -331,7 +331,7 @@ static u32 store_HRT (void __iomem *rom_start)
|
||||
loop = 0;
|
||||
|
||||
while (resNode) {
|
||||
loop ++;
|
||||
loop++;
|
||||
|
||||
/* base */
|
||||
rc = add_dword(&pFill, resNode->base, &usedbytes, &available);
|
||||
@@ -356,7 +356,7 @@ static u32 store_HRT (void __iomem *rom_start)
|
||||
loop = 0;
|
||||
|
||||
while (resNode) {
|
||||
loop ++;
|
||||
loop++;
|
||||
|
||||
/* base */
|
||||
rc = add_dword(&pFill, resNode->base, &usedbytes, &available);
|
||||
@@ -381,7 +381,7 @@ static u32 store_HRT (void __iomem *rom_start)
|
||||
loop = 0;
|
||||
|
||||
while (resNode) {
|
||||
loop ++;
|
||||
loop++;
|
||||
|
||||
/* base */
|
||||
rc = add_dword(&pFill, resNode->base, &usedbytes, &available);
|
||||
@@ -408,7 +408,7 @@ static u32 store_HRT (void __iomem *rom_start)
|
||||
|
||||
temp_dword = usedbytes;
|
||||
|
||||
rc = access_EV(WRITE_EV, "CQTHPS", (u8*) buffer, &temp_dword);
|
||||
rc = access_EV(WRITE_EV, "CQTHPS", (u8 *) buffer, &temp_dword);
|
||||
|
||||
dbg("usedbytes = 0x%x, length = 0x%x\n", usedbytes, temp_dword);
|
||||
|
||||
@@ -423,7 +423,7 @@ static u32 store_HRT (void __iomem *rom_start)
|
||||
}
|
||||
|
||||
|
||||
void compaq_nvram_init (void __iomem *rom_start)
|
||||
void compaq_nvram_init(void __iomem *rom_start)
|
||||
{
|
||||
if (rom_start)
|
||||
compaq_int15_entry_point = (rom_start + ROM_INT15_PHY_ADDR - ROM_PHY_ADDR);
|
||||
@@ -435,7 +435,7 @@ void compaq_nvram_init (void __iomem *rom_start)
|
||||
}
|
||||
|
||||
|
||||
int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
|
||||
int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl)
|
||||
{
|
||||
u8 bus, device, function;
|
||||
u8 nummem, numpmem, numio, numbus;
|
||||
@@ -451,7 +451,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
|
||||
if (!evbuffer_init) {
|
||||
/* Read the resource list information in from NVRAM */
|
||||
if (load_HRT(rom_start))
|
||||
memset (evbuffer, 0, 1024);
|
||||
memset(evbuffer, 0, 1024);
|
||||
|
||||
evbuffer_init = 1;
|
||||
}
|
||||
@@ -472,7 +472,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
|
||||
|
||||
p_byte += 3;
|
||||
|
||||
if (p_byte > ((u8*)p_EV_header + evbuffer_length))
|
||||
if (p_byte > ((u8 *)p_EV_header + evbuffer_length))
|
||||
return 2;
|
||||
|
||||
bus = p_ev_ctrl->bus;
|
||||
@@ -489,20 +489,20 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
|
||||
|
||||
p_byte += 4;
|
||||
|
||||
if (p_byte > ((u8*)p_EV_header + evbuffer_length))
|
||||
if (p_byte > ((u8 *)p_EV_header + evbuffer_length))
|
||||
return 2;
|
||||
|
||||
/* Skip forward to the next entry */
|
||||
p_byte += (nummem + numpmem + numio + numbus) * 8;
|
||||
|
||||
if (p_byte > ((u8*)p_EV_header + evbuffer_length))
|
||||
if (p_byte > ((u8 *)p_EV_header + evbuffer_length))
|
||||
return 2;
|
||||
|
||||
p_ev_ctrl = (struct ev_hrt_ctrl *) p_byte;
|
||||
|
||||
p_byte += 3;
|
||||
|
||||
if (p_byte > ((u8*)p_EV_header + evbuffer_length))
|
||||
if (p_byte > ((u8 *)p_EV_header + evbuffer_length))
|
||||
return 2;
|
||||
|
||||
bus = p_ev_ctrl->bus;
|
||||
@@ -517,7 +517,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
|
||||
|
||||
p_byte += 4;
|
||||
|
||||
if (p_byte > ((u8*)p_EV_header + evbuffer_length))
|
||||
if (p_byte > ((u8 *)p_EV_header + evbuffer_length))
|
||||
return 2;
|
||||
|
||||
while (nummem--) {
|
||||
@@ -526,20 +526,20 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
|
||||
if (!mem_node)
|
||||
break;
|
||||
|
||||
mem_node->base = *(u32*)p_byte;
|
||||
dbg("mem base = %8.8x\n",mem_node->base);
|
||||
mem_node->base = *(u32 *)p_byte;
|
||||
dbg("mem base = %8.8x\n", mem_node->base);
|
||||
p_byte += 4;
|
||||
|
||||
if (p_byte > ((u8*)p_EV_header + evbuffer_length)) {
|
||||
if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) {
|
||||
kfree(mem_node);
|
||||
return 2;
|
||||
}
|
||||
|
||||
mem_node->length = *(u32*)p_byte;
|
||||
dbg("mem length = %8.8x\n",mem_node->length);
|
||||
mem_node->length = *(u32 *)p_byte;
|
||||
dbg("mem length = %8.8x\n", mem_node->length);
|
||||
p_byte += 4;
|
||||
|
||||
if (p_byte > ((u8*)p_EV_header + evbuffer_length)) {
|
||||
if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) {
|
||||
kfree(mem_node);
|
||||
return 2;
|
||||
}
|
||||
@@ -554,20 +554,20 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
|
||||
if (!p_mem_node)
|
||||
break;
|
||||
|
||||
p_mem_node->base = *(u32*)p_byte;
|
||||
dbg("pre-mem base = %8.8x\n",p_mem_node->base);
|
||||
p_mem_node->base = *(u32 *)p_byte;
|
||||
dbg("pre-mem base = %8.8x\n", p_mem_node->base);
|
||||
p_byte += 4;
|
||||
|
||||
if (p_byte > ((u8*)p_EV_header + evbuffer_length)) {
|
||||
if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) {
|
||||
kfree(p_mem_node);
|
||||
return 2;
|
||||
}
|
||||
|
||||
p_mem_node->length = *(u32*)p_byte;
|
||||
dbg("pre-mem length = %8.8x\n",p_mem_node->length);
|
||||
p_mem_node->length = *(u32 *)p_byte;
|
||||
dbg("pre-mem length = %8.8x\n", p_mem_node->length);
|
||||
p_byte += 4;
|
||||
|
||||
if (p_byte > ((u8*)p_EV_header + evbuffer_length)) {
|
||||
if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) {
|
||||
kfree(p_mem_node);
|
||||
return 2;
|
||||
}
|
||||
@@ -582,20 +582,20 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
|
||||
if (!io_node)
|
||||
break;
|
||||
|
||||
io_node->base = *(u32*)p_byte;
|
||||
dbg("io base = %8.8x\n",io_node->base);
|
||||
io_node->base = *(u32 *)p_byte;
|
||||
dbg("io base = %8.8x\n", io_node->base);
|
||||
p_byte += 4;
|
||||
|
||||
if (p_byte > ((u8*)p_EV_header + evbuffer_length)) {
|
||||
if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) {
|
||||
kfree(io_node);
|
||||
return 2;
|
||||
}
|
||||
|
||||
io_node->length = *(u32*)p_byte;
|
||||
dbg("io length = %8.8x\n",io_node->length);
|
||||
io_node->length = *(u32 *)p_byte;
|
||||
dbg("io length = %8.8x\n", io_node->length);
|
||||
p_byte += 4;
|
||||
|
||||
if (p_byte > ((u8*)p_EV_header + evbuffer_length)) {
|
||||
if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) {
|
||||
kfree(io_node);
|
||||
return 2;
|
||||
}
|
||||
@@ -610,18 +610,18 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
|
||||
if (!bus_node)
|
||||
break;
|
||||
|
||||
bus_node->base = *(u32*)p_byte;
|
||||
bus_node->base = *(u32 *)p_byte;
|
||||
p_byte += 4;
|
||||
|
||||
if (p_byte > ((u8*)p_EV_header + evbuffer_length)) {
|
||||
if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) {
|
||||
kfree(bus_node);
|
||||
return 2;
|
||||
}
|
||||
|
||||
bus_node->length = *(u32*)p_byte;
|
||||
bus_node->length = *(u32 *)p_byte;
|
||||
p_byte += 4;
|
||||
|
||||
if (p_byte > ((u8*)p_EV_header + evbuffer_length)) {
|
||||
if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) {
|
||||
kfree(bus_node);
|
||||
return 2;
|
||||
}
|
||||
@@ -650,7 +650,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
|
||||
}
|
||||
|
||||
|
||||
int compaq_nvram_store (void __iomem *rom_start)
|
||||
int compaq_nvram_store(void __iomem *rom_start)
|
||||
{
|
||||
int rc = 1;
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ static void __iomem *detect_HRT_floating_pointer(void __iomem *begin, void __iom
|
||||
}
|
||||
|
||||
|
||||
int cpqhp_configure_device (struct controller *ctrl, struct pci_func *func)
|
||||
int cpqhp_configure_device(struct controller *ctrl, struct pci_func *func)
|
||||
{
|
||||
struct pci_bus *child;
|
||||
int num;
|
||||
@@ -89,7 +89,7 @@ int cpqhp_configure_device (struct controller *ctrl, struct pci_func *func)
|
||||
pci_lock_rescan_remove();
|
||||
|
||||
if (func->pci_dev == NULL)
|
||||
func->pci_dev = pci_get_bus_and_slot(func->bus,PCI_DEVFN(func->device, func->function));
|
||||
func->pci_dev = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, func->function));
|
||||
|
||||
/* No pci device, we need to create it then */
|
||||
if (func->pci_dev == NULL) {
|
||||
@@ -128,7 +128,7 @@ int cpqhp_unconfigure_device(struct pci_func *func)
|
||||
dbg("%s: bus/dev/func = %x/%x/%x\n", __func__, func->bus, func->device, func->function);
|
||||
|
||||
pci_lock_rescan_remove();
|
||||
for (j=0; j<8 ; j++) {
|
||||
for (j = 0; j < 8 ; j++) {
|
||||
struct pci_dev *temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j));
|
||||
if (temp) {
|
||||
pci_dev_put(temp);
|
||||
@@ -143,11 +143,11 @@ static int PCI_RefinedAccessConfig(struct pci_bus *bus, unsigned int devfn, u8 o
|
||||
{
|
||||
u32 vendID = 0;
|
||||
|
||||
if (pci_bus_read_config_dword (bus, devfn, PCI_VENDOR_ID, &vendID) == -1)
|
||||
if (pci_bus_read_config_dword(bus, devfn, PCI_VENDOR_ID, &vendID) == -1)
|
||||
return -1;
|
||||
if (vendID == 0xffffffff)
|
||||
return -1;
|
||||
return pci_bus_read_config_dword (bus, devfn, offset, value);
|
||||
return pci_bus_read_config_dword(bus, devfn, offset, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ static int PCI_RefinedAccessConfig(struct pci_bus *bus, unsigned int devfn, u8 o
|
||||
* @dev_num: device number of PCI device
|
||||
* @slot: pointer to u8 where slot number will be returned
|
||||
*/
|
||||
int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num)
|
||||
int cpqhp_set_irq(u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
@@ -230,7 +230,7 @@ static int PCI_ScanBusForNonBridge(struct controller *ctrl, u8 bus_num, u8 *dev_
|
||||
dbg("Looking for bridge bus_num %d dev_num %d\n", bus_num, tdevice);
|
||||
/* Yep we got one. bridge ? */
|
||||
if ((work >> 8) == PCI_TO_PCI_BRIDGE_CLASS) {
|
||||
pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(tdevice, 0), PCI_SECONDARY_BUS, &tbus);
|
||||
pci_bus_read_config_byte(ctrl->pci_bus, PCI_DEVFN(tdevice, 0), PCI_SECONDARY_BUS, &tbus);
|
||||
/* XXX: no recursion, wtf? */
|
||||
dbg("Recurse on bus_num %d tdevice %d\n", tbus, tdevice);
|
||||
return 0;
|
||||
@@ -257,16 +257,16 @@ static int PCI_GetBusDevHelper(struct controller *ctrl, u8 *bus_num, u8 *dev_num
|
||||
*bus_num = tbus;
|
||||
*dev_num = tdevice;
|
||||
ctrl->pci_bus->number = tbus;
|
||||
pci_bus_read_config_dword (ctrl->pci_bus, *dev_num, PCI_VENDOR_ID, &work);
|
||||
pci_bus_read_config_dword(ctrl->pci_bus, *dev_num, PCI_VENDOR_ID, &work);
|
||||
if (!nobridge || (work == 0xffffffff))
|
||||
return 0;
|
||||
|
||||
dbg("bus_num %d devfn %d\n", *bus_num, *dev_num);
|
||||
pci_bus_read_config_dword (ctrl->pci_bus, *dev_num, PCI_CLASS_REVISION, &work);
|
||||
pci_bus_read_config_dword(ctrl->pci_bus, *dev_num, PCI_CLASS_REVISION, &work);
|
||||
dbg("work >> 8 (%x) = BRIDGE (%x)\n", work >> 8, PCI_TO_PCI_BRIDGE_CLASS);
|
||||
|
||||
if ((work >> 8) == PCI_TO_PCI_BRIDGE_CLASS) {
|
||||
pci_bus_read_config_byte (ctrl->pci_bus, *dev_num, PCI_SECONDARY_BUS, &tbus);
|
||||
pci_bus_read_config_byte(ctrl->pci_bus, *dev_num, PCI_SECONDARY_BUS, &tbus);
|
||||
dbg("Scan bus for Non Bridge: bus %d\n", tbus);
|
||||
if (PCI_ScanBusForNonBridge(ctrl, tbus, dev_num) == 0) {
|
||||
*bus_num = tbus;
|
||||
@@ -280,7 +280,7 @@ static int PCI_GetBusDevHelper(struct controller *ctrl, u8 *bus_num, u8 *dev_num
|
||||
}
|
||||
|
||||
|
||||
int cpqhp_get_bus_dev (struct controller *ctrl, u8 *bus_num, u8 *dev_num, u8 slot)
|
||||
int cpqhp_get_bus_dev(struct controller *ctrl, u8 *bus_num, u8 *dev_num, u8 slot)
|
||||
{
|
||||
/* plain (bridges allowed) */
|
||||
return PCI_GetBusDevHelper(ctrl, bus_num, dev_num, slot, 0);
|
||||
@@ -419,7 +419,7 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug)
|
||||
new_slot->pci_dev = pci_get_bus_and_slot(new_slot->bus, (new_slot->device << 3) | new_slot->function);
|
||||
|
||||
for (cloop = 0; cloop < 0x20; cloop++) {
|
||||
rc = pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(device, function), cloop << 2, (u32 *) & (new_slot-> config_space [cloop]));
|
||||
rc = pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(device, function), cloop << 2, (u32 *) &(new_slot->config_space[cloop]));
|
||||
if (rc)
|
||||
return rc;
|
||||
}
|
||||
@@ -465,7 +465,7 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug)
|
||||
*
|
||||
* returns 0 if success
|
||||
*/
|
||||
int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func *new_slot)
|
||||
int cpqhp_save_slot_config(struct controller *ctrl, struct pci_func *new_slot)
|
||||
{
|
||||
long rc;
|
||||
u8 class_code;
|
||||
@@ -481,7 +481,7 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func *new_slot)
|
||||
ID = 0xFFFFFFFF;
|
||||
|
||||
ctrl->pci_bus->number = new_slot->bus;
|
||||
pci_bus_read_config_dword (ctrl->pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_VENDOR_ID, &ID);
|
||||
pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_VENDOR_ID, &ID);
|
||||
|
||||
if (ID == 0xFFFFFFFF)
|
||||
return 2;
|
||||
@@ -497,7 +497,7 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func *new_slot)
|
||||
while (function < max_functions) {
|
||||
if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {
|
||||
/* Recurse the subordinate bus */
|
||||
pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), PCI_SECONDARY_BUS, &secondary_bus);
|
||||
pci_bus_read_config_byte(ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), PCI_SECONDARY_BUS, &secondary_bus);
|
||||
|
||||
sub_bus = (int) secondary_bus;
|
||||
|
||||
@@ -514,7 +514,7 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func *new_slot)
|
||||
new_slot->status = 0;
|
||||
|
||||
for (cloop = 0; cloop < 0x20; cloop++)
|
||||
pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), cloop << 2, (u32 *) & (new_slot-> config_space [cloop]));
|
||||
pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), cloop << 2, (u32 *) &(new_slot->config_space[cloop]));
|
||||
|
||||
function++;
|
||||
|
||||
@@ -571,10 +571,10 @@ int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func *func)
|
||||
devfn = PCI_DEVFN(func->device, func->function);
|
||||
|
||||
/* Check for Bridge */
|
||||
pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type);
|
||||
pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &header_type);
|
||||
|
||||
if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {
|
||||
pci_bus_read_config_byte (pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus);
|
||||
pci_bus_read_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus);
|
||||
|
||||
sub_bus = (int) secondary_bus;
|
||||
|
||||
@@ -595,8 +595,8 @@ int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func *func)
|
||||
*/
|
||||
for (cloop = 0x10; cloop <= 0x14; cloop += 4) {
|
||||
temp_register = 0xFFFFFFFF;
|
||||
pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register);
|
||||
pci_bus_read_config_dword (pci_bus, devfn, cloop, &base);
|
||||
pci_bus_write_config_dword(pci_bus, devfn, cloop, temp_register);
|
||||
pci_bus_read_config_dword(pci_bus, devfn, cloop, &base);
|
||||
/* If this register is implemented */
|
||||
if (base) {
|
||||
if (base & 0x01L) {
|
||||
@@ -631,8 +631,8 @@ int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func *func)
|
||||
/* Figure out IO and memory base lengths */
|
||||
for (cloop = 0x10; cloop <= 0x24; cloop += 4) {
|
||||
temp_register = 0xFFFFFFFF;
|
||||
pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register);
|
||||
pci_bus_read_config_dword (pci_bus, devfn, cloop, &base);
|
||||
pci_bus_write_config_dword(pci_bus, devfn, cloop, temp_register);
|
||||
pci_bus_read_config_dword(pci_bus, devfn, cloop, &base);
|
||||
|
||||
/* If this register is implemented */
|
||||
if (base) {
|
||||
@@ -686,7 +686,7 @@ int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func *func)
|
||||
*
|
||||
* returns 0 if success
|
||||
*/
|
||||
int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func *func)
|
||||
int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func)
|
||||
{
|
||||
u8 cloop;
|
||||
u8 header_type;
|
||||
@@ -791,7 +791,7 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func *func)
|
||||
}
|
||||
/* Figure out IO and memory base lengths */
|
||||
for (cloop = 0x10; cloop <= 0x14; cloop += 4) {
|
||||
pci_bus_read_config_dword (pci_bus, devfn, cloop, &save_base);
|
||||
pci_bus_read_config_dword(pci_bus, devfn, cloop, &save_base);
|
||||
|
||||
temp_register = 0xFFFFFFFF;
|
||||
pci_bus_write_config_dword(pci_bus, devfn, cloop, temp_register);
|
||||
@@ -972,13 +972,13 @@ int cpqhp_configure_board(struct controller *ctrl, struct pci_func *func)
|
||||
* registers are programmed last
|
||||
*/
|
||||
for (cloop = 0x3C; cloop > 0; cloop -= 4)
|
||||
pci_bus_write_config_dword (pci_bus, devfn, cloop, func->config_space[cloop >> 2]);
|
||||
pci_bus_write_config_dword(pci_bus, devfn, cloop, func->config_space[cloop >> 2]);
|
||||
|
||||
pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type);
|
||||
pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &header_type);
|
||||
|
||||
/* If this is a bridge device, restore subordinate devices */
|
||||
if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {
|
||||
pci_bus_read_config_byte (pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus);
|
||||
pci_bus_read_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus);
|
||||
|
||||
sub_bus = (int) secondary_bus;
|
||||
|
||||
@@ -998,7 +998,7 @@ int cpqhp_configure_board(struct controller *ctrl, struct pci_func *func)
|
||||
*/
|
||||
|
||||
for (cloop = 16; cloop < 40; cloop += 4) {
|
||||
pci_bus_read_config_dword (pci_bus, devfn, cloop, &temp);
|
||||
pci_bus_read_config_dword(pci_bus, devfn, cloop, &temp);
|
||||
|
||||
if (temp != func->config_space[cloop >> 2]) {
|
||||
dbg("Config space compare failure!!! offset = %x\n", cloop);
|
||||
@@ -1050,7 +1050,7 @@ int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func)
|
||||
pci_bus->number = func->bus;
|
||||
devfn = PCI_DEVFN(func->device, func->function);
|
||||
|
||||
pci_bus_read_config_dword (pci_bus, devfn, PCI_VENDOR_ID, &temp_register);
|
||||
pci_bus_read_config_dword(pci_bus, devfn, PCI_VENDOR_ID, &temp_register);
|
||||
|
||||
/* No adapter present */
|
||||
if (temp_register == 0xFFFFFFFF)
|
||||
@@ -1060,14 +1060,14 @@ int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func)
|
||||
return(ADAPTER_NOT_SAME);
|
||||
|
||||
/* Check for same revision number and class code */
|
||||
pci_bus_read_config_dword (pci_bus, devfn, PCI_CLASS_REVISION, &temp_register);
|
||||
pci_bus_read_config_dword(pci_bus, devfn, PCI_CLASS_REVISION, &temp_register);
|
||||
|
||||
/* Adapter not the same */
|
||||
if (temp_register != func->config_space[0x08 >> 2])
|
||||
return(ADAPTER_NOT_SAME);
|
||||
|
||||
/* Check for Bridge */
|
||||
pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type);
|
||||
pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &header_type);
|
||||
|
||||
if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {
|
||||
/* In order to continue checking, we must program the
|
||||
@@ -1076,7 +1076,7 @@ int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func)
|
||||
*/
|
||||
|
||||
temp_register = func->config_space[0x18 >> 2];
|
||||
pci_bus_write_config_dword (pci_bus, devfn, PCI_PRIMARY_BUS, temp_register);
|
||||
pci_bus_write_config_dword(pci_bus, devfn, PCI_PRIMARY_BUS, temp_register);
|
||||
|
||||
secondary_bus = (temp_register >> 8) & 0xFF;
|
||||
|
||||
@@ -1094,7 +1094,7 @@ int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func)
|
||||
/* Check to see if it is a standard config header */
|
||||
else if ((header_type & 0x7F) == PCI_HEADER_TYPE_NORMAL) {
|
||||
/* Check subsystem vendor and ID */
|
||||
pci_bus_read_config_dword (pci_bus, devfn, PCI_SUBSYSTEM_VENDOR_ID, &temp_register);
|
||||
pci_bus_read_config_dword(pci_bus, devfn, PCI_SUBSYSTEM_VENDOR_ID, &temp_register);
|
||||
|
||||
if (temp_register != func->config_space[0x2C >> 2]) {
|
||||
/* If it's a SMART-2 and the register isn't
|
||||
@@ -1108,8 +1108,8 @@ int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func)
|
||||
/* Figure out IO and memory base lengths */
|
||||
for (cloop = 0x10; cloop <= 0x24; cloop += 4) {
|
||||
temp_register = 0xFFFFFFFF;
|
||||
pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register);
|
||||
pci_bus_read_config_dword (pci_bus, devfn, cloop, &base);
|
||||
pci_bus_write_config_dword(pci_bus, devfn, cloop, temp_register);
|
||||
pci_bus_read_config_dword(pci_bus, devfn, cloop, &base);
|
||||
|
||||
/* If this register is implemented */
|
||||
if (base) {
|
||||
@@ -1234,7 +1234,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
one_slot = rom_resource_table + sizeof (struct hrt);
|
||||
one_slot = rom_resource_table + sizeof(struct hrt);
|
||||
|
||||
i = readb(rom_resource_table + NUMBER_OF_ENTRIES);
|
||||
dbg("number_of_entries = %d\n", i);
|
||||
@@ -1263,12 +1263,12 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st
|
||||
/* If this entry isn't for our controller's bus, ignore it */
|
||||
if (primary_bus != ctrl->bus) {
|
||||
i--;
|
||||
one_slot += sizeof (struct slot_rt);
|
||||
one_slot += sizeof(struct slot_rt);
|
||||
continue;
|
||||
}
|
||||
/* find out if this entry is for an occupied slot */
|
||||
ctrl->pci_bus->number = primary_bus;
|
||||
pci_bus_read_config_dword (ctrl->pci_bus, dev_func, PCI_VENDOR_ID, &temp_dword);
|
||||
pci_bus_read_config_dword(ctrl->pci_bus, dev_func, PCI_VENDOR_ID, &temp_dword);
|
||||
dbg("temp_D_word = %x\n", temp_dword);
|
||||
|
||||
if (temp_dword != 0xFFFFFFFF) {
|
||||
@@ -1283,7 +1283,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st
|
||||
/* If we can't find a match, skip this table entry */
|
||||
if (!func) {
|
||||
i--;
|
||||
one_slot += sizeof (struct slot_rt);
|
||||
one_slot += sizeof(struct slot_rt);
|
||||
continue;
|
||||
}
|
||||
/* this may not work and shouldn't be used */
|
||||
@@ -1395,7 +1395,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st
|
||||
}
|
||||
|
||||
i--;
|
||||
one_slot += sizeof (struct slot_rt);
|
||||
one_slot += sizeof(struct slot_rt);
|
||||
}
|
||||
|
||||
/* If all of the following fail, we don't have any resources for
|
||||
@@ -1475,7 +1475,7 @@ int cpqhp_return_board_resources(struct pci_func *func, struct resource_lists *r
|
||||
*
|
||||
* Puts node back in the resource list pointed to by head
|
||||
*/
|
||||
void cpqhp_destroy_resource_list (struct resource_lists *resources)
|
||||
void cpqhp_destroy_resource_list(struct resource_lists *resources)
|
||||
{
|
||||
struct pci_resource *res, *tres;
|
||||
|
||||
@@ -1522,7 +1522,7 @@ void cpqhp_destroy_resource_list (struct resource_lists *resources)
|
||||
*
|
||||
* Puts node back in the resource list pointed to by head
|
||||
*/
|
||||
void cpqhp_destroy_board_resources (struct pci_func *func)
|
||||
void cpqhp_destroy_board_resources(struct pci_func *func)
|
||||
{
|
||||
struct pci_resource *res, *tres;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "cpqphp.h"
|
||||
|
||||
static DEFINE_MUTEX(cpqphp_mutex);
|
||||
static int show_ctrl (struct controller *ctrl, char *buf)
|
||||
static int show_ctrl(struct controller *ctrl, char *buf)
|
||||
{
|
||||
char *out = buf;
|
||||
int index;
|
||||
@@ -77,7 +77,7 @@ static int show_ctrl (struct controller *ctrl, char *buf)
|
||||
return out - buf;
|
||||
}
|
||||
|
||||
static int show_dev (struct controller *ctrl, char *buf)
|
||||
static int show_dev(struct controller *ctrl, char *buf)
|
||||
{
|
||||
char *out = buf;
|
||||
int index;
|
||||
@@ -119,7 +119,7 @@ static int show_dev (struct controller *ctrl, char *buf)
|
||||
out += sprintf(out, "start = %8.8x, length = %8.8x\n", res->base, res->length);
|
||||
res = res->next;
|
||||
}
|
||||
slot=slot->next;
|
||||
slot = slot->next;
|
||||
}
|
||||
|
||||
return out - buf;
|
||||
|
||||
@@ -39,11 +39,11 @@ extern int ibmphp_debug;
|
||||
#else
|
||||
#define MY_NAME THIS_MODULE->name
|
||||
#endif
|
||||
#define debug(fmt, arg...) do { if (ibmphp_debug == 1) printk(KERN_DEBUG "%s: " fmt , MY_NAME , ## arg); } while (0)
|
||||
#define debug_pci(fmt, arg...) do { if (ibmphp_debug) printk(KERN_DEBUG "%s: " fmt , MY_NAME , ## arg); } while (0)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
|
||||
#define debug(fmt, arg...) do { if (ibmphp_debug == 1) printk(KERN_DEBUG "%s: " fmt, MY_NAME, ## arg); } while (0)
|
||||
#define debug_pci(fmt, arg...) do { if (ibmphp_debug) printk(KERN_DEBUG "%s: " fmt, MY_NAME, ## arg); } while (0)
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format, MY_NAME, ## arg)
|
||||
#define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME, ## arg)
|
||||
#define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME, ## arg)
|
||||
|
||||
|
||||
/* EBDA stuff */
|
||||
@@ -603,7 +603,7 @@ void ibmphp_hpc_stop_poll_thread(void);
|
||||
#define SLOT_CONNECT(s) ((u8) ((s & HPC_SLOT_CONNECT) \
|
||||
? HPC_SLOT_DISCONNECTED : HPC_SLOT_CONNECTED))
|
||||
|
||||
#define SLOT_ATTN(s,es) ((u8) ((es & HPC_SLOT_BLINK_ATTN) \
|
||||
#define SLOT_ATTN(s, es) ((u8) ((es & HPC_SLOT_BLINK_ATTN) \
|
||||
? HPC_SLOT_ATTN_BLINK \
|
||||
: ((s & HPC_SLOT_ATTN) ? HPC_SLOT_ATTN_ON : HPC_SLOT_ATTN_OFF)))
|
||||
|
||||
|
||||
@@ -39,11 +39,11 @@
|
||||
#include <asm/io_apic.h>
|
||||
#include "ibmphp.h"
|
||||
|
||||
#define attn_on(sl) ibmphp_hpc_writeslot (sl, HPC_SLOT_ATTNON)
|
||||
#define attn_off(sl) ibmphp_hpc_writeslot (sl, HPC_SLOT_ATTNOFF)
|
||||
#define attn_LED_blink(sl) ibmphp_hpc_writeslot (sl, HPC_SLOT_BLINKLED)
|
||||
#define get_ctrl_revision(sl, rev) ibmphp_hpc_readslot (sl, READ_REVLEVEL, rev)
|
||||
#define get_hpc_options(sl, opt) ibmphp_hpc_readslot (sl, READ_HPCOPTIONS, opt)
|
||||
#define attn_on(sl) ibmphp_hpc_writeslot(sl, HPC_SLOT_ATTNON)
|
||||
#define attn_off(sl) ibmphp_hpc_writeslot(sl, HPC_SLOT_ATTNOFF)
|
||||
#define attn_LED_blink(sl) ibmphp_hpc_writeslot(sl, HPC_SLOT_BLINKLED)
|
||||
#define get_ctrl_revision(sl, rev) ibmphp_hpc_readslot(sl, READ_REVLEVEL, rev)
|
||||
#define get_hpc_options(sl, opt) ibmphp_hpc_readslot(sl, READ_HPCOPTIONS, opt)
|
||||
|
||||
#define DRIVER_VERSION "0.6"
|
||||
#define DRIVER_DESC "IBM Hot Plug PCI Controller Driver"
|
||||
@@ -52,9 +52,9 @@ int ibmphp_debug;
|
||||
|
||||
static bool debug;
|
||||
module_param(debug, bool, S_IRUGO | S_IWUSR);
|
||||
MODULE_PARM_DESC (debug, "Debugging mode enabled or not");
|
||||
MODULE_LICENSE ("GPL");
|
||||
MODULE_DESCRIPTION (DRIVER_DESC);
|
||||
MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION(DRIVER_DESC);
|
||||
|
||||
struct pci_bus *ibmphp_pci_bus;
|
||||
static int max_slots;
|
||||
@@ -113,7 +113,7 @@ static inline int slot_update(struct slot **sl)
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int __init get_max_slots (void)
|
||||
static int __init get_max_slots(void)
|
||||
{
|
||||
struct slot *slot_cur;
|
||||
u8 slot_count = 0;
|
||||
@@ -457,7 +457,7 @@ static int get_max_adapter_speed_1(struct hotplug_slot *hotplug_slot, u8 *value,
|
||||
*value = SLOT_SPEED(myslot.ext_status);
|
||||
} else
|
||||
*value = MAX_ADAPTER_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag)
|
||||
@@ -612,11 +612,11 @@ int ibmphp_update_slot_info(struct slot *slot_cur)
|
||||
info->attention_status = SLOT_ATTN(slot_cur->status,
|
||||
slot_cur->ext_status);
|
||||
info->latch_status = SLOT_LATCH(slot_cur->status);
|
||||
if (!SLOT_PRESENT(slot_cur->status)) {
|
||||
info->adapter_status = 0;
|
||||
if (!SLOT_PRESENT(slot_cur->status)) {
|
||||
info->adapter_status = 0;
|
||||
/* info->max_adapter_speed_status = MAX_ADAPTER_NONE; */
|
||||
} else {
|
||||
info->adapter_status = 1;
|
||||
info->adapter_status = 1;
|
||||
/* get_max_adapter_speed_1(slot_cur->hotplug_slot,
|
||||
&info->max_adapter_speed_status, 0); */
|
||||
}
|
||||
@@ -854,7 +854,7 @@ static int set_bus(struct slot *slot_cur)
|
||||
int retval;
|
||||
static struct pci_device_id ciobx[] = {
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, 0x0101) },
|
||||
{ },
|
||||
{ },
|
||||
};
|
||||
|
||||
debug("%s - entry slot # %d\n", __func__, slot_cur->number);
|
||||
@@ -1170,7 +1170,7 @@ error_power:
|
||||
* HOT REMOVING ADAPTER CARD *
|
||||
* INPUT: POINTER TO THE HOTPLUG SLOT STRUCTURE *
|
||||
* OUTPUT: SUCCESS 0 ; FAILURE: UNCONFIGURE , VALIDATE *
|
||||
DISABLE POWER , *
|
||||
* DISABLE POWER , *
|
||||
**************************************************************/
|
||||
static int ibmphp_disable_slot(struct hotplug_slot *hotplug_slot)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user