Commit 42f49a6a authored by Rajesh Shah's avatar Rajesh Shah Committed by Greg Kroah-Hartman

[PATCH] acpi hotplug: convert acpiphp to use generic resource code

This patch converts acpiphp to use the generic PCI resource assignment code.
It's quite large, but most of it is deleting the acpiphp_pci and acpiphp_res
files.  It's tested on an hp Integrity rx8620 (which won't work without this
patch).  Testers with other hardware welcomed.
Signed-off-by: default avatarMatthew Wilcox <matthew@wil.cx>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4ce448e5
...@@ -36,9 +36,7 @@ ibmphp-objs := ibmphp_core.o \ ...@@ -36,9 +36,7 @@ ibmphp-objs := ibmphp_core.o \
ibmphp_hpc.o ibmphp_hpc.o
acpiphp-objs := acpiphp_core.o \ acpiphp-objs := acpiphp_core.o \
acpiphp_glue.o \ acpiphp_glue.o
acpiphp_pci.o \
acpiphp_res.o
rpaphp-objs := rpaphp_core.o \ rpaphp-objs := rpaphp_core.o \
rpaphp_pci.o \ rpaphp_pci.o \
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* Copyright (C) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com) * Copyright (C) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
* Copyright (C) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com) * Copyright (C) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
* Copyright (C) 2002,2003 NEC Corporation * Copyright (C) 2002,2003 NEC Corporation
* Copyright (C) 2003-2005 Matthew Wilcox (matthew.wilcox@hp.com)
* Copyright (C) 2003-2005 Hewlett Packard
* *
* All rights reserved. * All rights reserved.
* *
...@@ -52,7 +54,6 @@ ...@@ -52,7 +54,6 @@
struct acpiphp_bridge; struct acpiphp_bridge;
struct acpiphp_slot; struct acpiphp_slot;
struct pci_resource;
/* /*
* struct slot - slot information for each *physical* slot * struct slot - slot information for each *physical* slot
...@@ -65,15 +66,6 @@ struct slot { ...@@ -65,15 +66,6 @@ struct slot {
struct acpiphp_slot *acpi_slot; struct acpiphp_slot *acpi_slot;
}; };
/*
* struct pci_resource - describes pci resource (mem, pfmem, io, bus)
*/
struct pci_resource {
struct pci_resource * next;
u64 base;
u32 length;
};
/** /**
* struct hpp_param - ACPI 2.0 _HPP Hot Plug Parameters * struct hpp_param - ACPI 2.0 _HPP Hot Plug Parameters
* @cache_line_size in DWORD * @cache_line_size in DWORD
...@@ -101,10 +93,6 @@ struct acpiphp_bridge { ...@@ -101,10 +93,6 @@ struct acpiphp_bridge {
int type; int type;
int nr_slots; int nr_slots;
u8 seg;
u8 bus;
u8 sub;
u32 flags; u32 flags;
/* This bus (host bridge) or Secondary bus (PCI-to-PCI bridge) */ /* This bus (host bridge) or Secondary bus (PCI-to-PCI bridge) */
...@@ -117,12 +105,6 @@ struct acpiphp_bridge { ...@@ -117,12 +105,6 @@ struct acpiphp_bridge {
struct hpp_param hpp; struct hpp_param hpp;
spinlock_t res_lock; spinlock_t res_lock;
/* available resources on this bus */
struct pci_resource *mem_head;
struct pci_resource *p_mem_head;
struct pci_resource *io_head;
struct pci_resource *bus_head;
}; };
...@@ -163,12 +145,6 @@ struct acpiphp_func { ...@@ -163,12 +145,6 @@ struct acpiphp_func {
u8 function; /* pci function# */ u8 function; /* pci function# */
u32 flags; /* see below */ u32 flags; /* see below */
/* resources used for this function */
struct pci_resource *mem_head;
struct pci_resource *p_mem_head;
struct pci_resource *io_head;
struct pci_resource *bus_head;
}; };
/** /**
...@@ -243,25 +219,6 @@ extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot); ...@@ -243,25 +219,6 @@ extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot);
extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot); extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot);
extern u32 acpiphp_get_address (struct acpiphp_slot *slot); extern u32 acpiphp_get_address (struct acpiphp_slot *slot);
/* acpiphp_pci.c */
extern struct pci_dev *acpiphp_allocate_pcidev (struct pci_bus *pbus, int dev, int fn);
extern int acpiphp_configure_slot (struct acpiphp_slot *slot);
extern int acpiphp_configure_function (struct acpiphp_func *func);
extern void acpiphp_unconfigure_function (struct acpiphp_func *func);
extern int acpiphp_detect_pci_resource (struct acpiphp_bridge *bridge);
extern int acpiphp_init_func_resource (struct acpiphp_func *func);
/* acpiphp_res.c */
extern struct pci_resource *acpiphp_get_io_resource (struct pci_resource **head, u32 size);
extern struct pci_resource *acpiphp_get_resource (struct pci_resource **head, u32 size);
extern struct pci_resource *acpiphp_get_resource_with_base (struct pci_resource **head, u64 base, u32 size);
extern int acpiphp_resource_sort_and_combine (struct pci_resource **head);
extern struct pci_resource *acpiphp_make_resource (u64 base, u32 length);
extern void acpiphp_move_resource (struct pci_resource **from, struct pci_resource **to);
extern void acpiphp_free_resource (struct pci_resource **res);
extern void acpiphp_dump_resource (struct acpiphp_bridge *bridge); /* debug */
extern void acpiphp_dump_func_resource (struct acpiphp_func *func); /* debug */
/* variables */ /* variables */
extern int acpiphp_debug; extern int acpiphp_debug;
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* Copyright (C) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com) * Copyright (C) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
* Copyright (C) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com) * Copyright (C) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
* Copyright (C) 2002,2003 NEC Corporation * Copyright (C) 2002,2003 NEC Corporation
* Copyright (C) 2003-2005 Matthew Wilcox (matthew.wilcox@hp.com)
* Copyright (C) 2003-2005 Hewlett Packard
* *
* All rights reserved. * All rights reserved.
* *
...@@ -53,8 +55,8 @@ int acpiphp_debug; ...@@ -53,8 +55,8 @@ int acpiphp_debug;
static int num_slots; static int num_slots;
static struct acpiphp_attention_info *attention_info; static struct acpiphp_attention_info *attention_info;
#define DRIVER_VERSION "0.4" #define DRIVER_VERSION "0.5"
#define DRIVER_AUTHOR "Greg Kroah-Hartman <gregkh@us.ibm.com>, Takayoshi Kochi <t-kochi@bq.jp.nec.com>" #define DRIVER_AUTHOR "Greg Kroah-Hartman <gregkh@us.ibm.com>, Takayoshi Kochi <t-kochi@bq.jp.nec.com>, Matthew Wilcox <willy@hp.com>"
#define DRIVER_DESC "ACPI Hot Plug PCI Controller Driver" #define DRIVER_DESC "ACPI Hot Plug PCI Controller Driver"
MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_AUTHOR(DRIVER_AUTHOR);
...@@ -281,8 +283,7 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) ...@@ -281,8 +283,7 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
/** /**
* get_address - get pci address of a slot * get_address - get pci address of a slot
* @hotplug_slot: slot to get status * @hotplug_slot: slot to get status
* @busdev: pointer to struct pci_busdev (seg, bus, dev) * @value: pointer to struct pci_busdev (seg, bus, dev)
*
*/ */
static int get_address(struct hotplug_slot *hotplug_slot, u32 *value) static int get_address(struct hotplug_slot *hotplug_slot, u32 *value)
{ {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment