Commit 64b7907f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge kroah.com:/home/greg/linux/BK/bleed-2.6

into kroah.com:/home/greg/linux/BK/pci-2.6
parents 7b51a623 694924e4
...@@ -20,6 +20,10 @@ Part I - pci_ and dma_ Equivalent API ...@@ -20,6 +20,10 @@ Part I - pci_ and dma_ Equivalent API
To get the pci_ API, you must #include <linux/pci.h> To get the pci_ API, you must #include <linux/pci.h>
To get the dma_ API, you must #include <linux/dma-mapping.h> To get the dma_ API, you must #include <linux/dma-mapping.h>
Part Ia - Using large dma-coherent buffers
------------------------------------------
void * void *
dma_alloc_coherent(struct device *dev, size_t size, dma_alloc_coherent(struct device *dev, size_t size,
dma_addr_t *dma_handle, int flag) dma_addr_t *dma_handle, int flag)
...@@ -42,6 +46,7 @@ address space) or NULL if the allocation failed. ...@@ -42,6 +46,7 @@ address space) or NULL if the allocation failed.
Note: consistent memory can be expensive on some platforms, and the Note: consistent memory can be expensive on some platforms, and the
minimum allocation length may be as big as a page, so you should minimum allocation length may be as big as a page, so you should
consolidate your requests for consistent memory as much as possible. consolidate your requests for consistent memory as much as possible.
The simplest way to do that is to use the dma_pool calls (see below).
The flag parameter (dma_alloc_coherent only) allows the caller to The flag parameter (dma_alloc_coherent only) allows the caller to
specify the GFP_ flags (see kmalloc) for the allocation (the specify the GFP_ flags (see kmalloc) for the allocation (the
...@@ -61,6 +66,77 @@ size and dma_handle must all be the same as those passed into the ...@@ -61,6 +66,77 @@ size and dma_handle must all be the same as those passed into the
consistent allocate. cpu_addr must be the virtual address returned by consistent allocate. cpu_addr must be the virtual address returned by
the consistent allocate the consistent allocate
Part Ib - Using small dma-coherent buffers
------------------------------------------
To get this part of the dma_ API, you must #include <linux/dmapool.h>
Many drivers need lots of small dma-coherent memory regions for DMA
descriptors or I/O buffers. Rather than allocating in units of a page
or more using dma_alloc_coherent(), you can use DMA pools. These work
much like a kmem_cache_t, except that they use the dma-coherent allocator
not __get_free_pages(). Also, they understand common hardware constraints
for alignment, like queue heads needing to be aligned on N byte boundaries.
struct dma_pool *
dma_pool_create(const char *name, struct device *dev,
size_t size, size_t align, size_t alloc);
struct pci_pool *
pci_pool_create(const char *name, struct pci_device *dev,
size_t size, size_t align, size_t alloc);
The pool create() routines initialize a pool of dma-coherent buffers
for use with a given device. It must be called in a context which
can sleep.
The "name" is for diagnostics (like a kmem_cache_t name); dev and size
are like what you'd pass to dma_alloc_coherent(). The device's hardware
alignment requirement for this type of data is "align" (which is expressed
in bytes, and must be a power of two). If your device has no boundary
crossing restrictions, pass 0 for alloc; passing 4096 says memory allocated
from this pool must not cross 4KByte boundaries.
void *dma_pool_alloc(struct dma_pool *pool, int gfp_flags,
dma_addr_t *dma_handle);
void *pci_pool_alloc(struct pci_pool *pool, int gfp_flags,
dma_addr_t *dma_handle);
This allocates memory from the pool; the returned memory will meet the size
and alignment requirements specified at creation time. Pass GFP_ATOMIC to
prevent blocking, or if it's permitted (not in_interrupt, not holding SMP locks)
pass GFP_KERNEL to allow blocking. Like dma_alloc_coherent(), this returns
two values: an address usable by the cpu, and the dma address usable by the
pool's device.
void dma_pool_free(struct dma_pool *pool, void *vaddr,
dma_addr_t addr);
void pci_pool_free(struct pci_pool *pool, void *vaddr,
dma_addr_t addr);
This puts memory back into the pool. The pool is what was passed to
the the pool allocation routine; the cpu and dma addresses are what
were returned when that routine allocated the memory being freed.
void dma_pool_destroy(struct dma_pool *pool);
void pci_pool_destroy(struct pci_pool *pool);
The pool destroy() routines free the resources of the pool. They must be
called in a context which can sleep. Make sure you've freed all allocated
memory back to the pool before you destroy it.
Part Ic - DMA addressing limitations
------------------------------------
int int
dma_supported(struct device *dev, u64 mask) dma_supported(struct device *dev, u64 mask)
int int
...@@ -86,6 +162,10 @@ parameters if it is. ...@@ -86,6 +162,10 @@ parameters if it is.
Returns: 1 if successful and 0 if not Returns: 1 if successful and 0 if not
Part Id - Streaming DMA mappings
--------------------------------
dma_addr_t dma_addr_t
dma_map_single(struct device *dev, void *cpu_addr, size_t size, dma_map_single(struct device *dev, void *cpu_addr, size_t size,
enum dma_data_direction direction) enum dma_data_direction direction)
...@@ -254,6 +334,7 @@ Notes: You must do this: ...@@ -254,6 +334,7 @@ Notes: You must do this:
See also dma_map_single(). See also dma_map_single().
Part II - Advanced dma_ usage Part II - Advanced dma_ usage
----------------------------- -----------------------------
......
...@@ -943,12 +943,50 @@ int pirq_enable_irq(struct pci_dev *dev) ...@@ -943,12 +943,50 @@ int pirq_enable_irq(struct pci_dev *dev)
{ {
u8 pin; u8 pin;
extern int interrupt_line_quirk; extern int interrupt_line_quirk;
struct pci_dev *temp_dev;
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
if (pin && !pcibios_lookup_irq(dev, 1) && !dev->irq) { if (pin && !pcibios_lookup_irq(dev, 1) && !dev->irq) {
char *msg; char *msg;
if (io_apic_assign_pci_irqs) msg = "";
if (io_apic_assign_pci_irqs) {
int irq;
if (pin) {
pin--; /* interrupt pins are numbered starting from 1 */
irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, PCI_SLOT(dev->devfn), pin);
/*
* Busses behind bridges are typically not listed in the MP-table.
* In this case we have to look up the IRQ based on the parent bus,
* parent slot, and pin number. The SMP code detects such bridged
* busses itself so we should get into this branch reliably.
*/
temp_dev = dev;
while (irq < 0 && dev->bus->parent) { /* go back to the bridge */
struct pci_dev * bridge = dev->bus->self;
pin = (pin + PCI_SLOT(dev->devfn)) % 4;
irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number,
PCI_SLOT(bridge->devfn), pin);
if (irq >= 0)
printk(KERN_WARNING "PCI: using PPB(B%d,I%d,P%d) to get irq %d\n",
bridge->bus->number, PCI_SLOT(bridge->devfn), pin, irq);
dev = bridge;
}
dev = temp_dev;
if (irq >= 0) {
#ifdef CONFIG_PCI_USE_VECTOR
if (!platform_legacy_irq(irq))
irq = IO_APIC_VECTOR(irq);
#endif
printk(KERN_INFO "PCI->APIC IRQ transform: (B%d,I%d,P%d) -> %d\n",
dev->bus->number, PCI_SLOT(dev->devfn), pin, irq);
dev->irq = irq;
return 0;
} else
msg = " Probably buggy MP table."; msg = " Probably buggy MP table.";
else if (pci_probe & PCI_BIOS_IRQ_SCAN) }
} else if (pci_probe & PCI_BIOS_IRQ_SCAN)
msg = ""; msg = "";
else else
msg = " Please try using pci=biosirq."; msg = " Please try using pci=biosirq.";
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
obj-y := core.o sys.o interface.o bus.o \ obj-y := core.o sys.o interface.o bus.o \
driver.o class.o class_simple.o platform.o \ driver.o class.o class_simple.o platform.o \
cpu.o firmware.o init.o map.o cpu.o firmware.o init.o map.o dmapool.o
obj-y += power/ obj-y += power/
obj-$(CONFIG_FW_LOADER) += firmware_class.o obj-$(CONFIG_FW_LOADER) += firmware_class.o
obj-$(CONFIG_NUMA) += node.o obj-$(CONFIG_NUMA) += node.o
...@@ -197,6 +197,7 @@ void device_initialize(struct device *dev) ...@@ -197,6 +197,7 @@ void device_initialize(struct device *dev)
INIT_LIST_HEAD(&dev->children); INIT_LIST_HEAD(&dev->children);
INIT_LIST_HEAD(&dev->driver_list); INIT_LIST_HEAD(&dev->driver_list);
INIT_LIST_HEAD(&dev->bus_list); INIT_LIST_HEAD(&dev->bus_list);
INIT_LIST_HEAD(&dev->dma_pools);
} }
/** /**
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the PCI bus specific drivers. # Makefile for the PCI bus specific drivers.
# #
obj-y += access.o bus.o probe.o remove.o pci.o pool.o quirks.o \ obj-y += access.o bus.o probe.o remove.o pci.o quirks.o \
names.o pci-driver.o search.o pci-sysfs.o names.o pci-driver.o search.o pci-sysfs.o
obj-$(CONFIG_PROC_FS) += proc.o obj-$(CONFIG_PROC_FS) += proc.o
......
...@@ -116,7 +116,7 @@ static int pci_visit_bridge (struct pci_visit * fn, ...@@ -116,7 +116,7 @@ static int pci_visit_bridge (struct pci_visit * fn,
} }
bus = wrapped_dev->dev->subordinate; bus = wrapped_dev->dev->subordinate;
if(bus) { if (bus) {
memset(&wrapped_bus, 0, sizeof(struct pci_bus_wrapped)); memset(&wrapped_bus, 0, sizeof(struct pci_bus_wrapped));
wrapped_bus.bus = bus; wrapped_bus.bus = bus;
...@@ -130,7 +130,7 @@ static int pci_visit_bridge (struct pci_visit * fn, ...@@ -130,7 +130,7 @@ static int pci_visit_bridge (struct pci_visit * fn,
* Every bus and every function is presented to a custom * Every bus and every function is presented to a custom
* function that can act upon it. * function that can act upon it.
*/ */
int pci_visit_dev (struct pci_visit *fn, struct pci_dev_wrapped *wrapped_dev, int pci_visit_dev(struct pci_visit *fn, struct pci_dev_wrapped *wrapped_dev,
struct pci_bus_wrapped *wrapped_parent) struct pci_bus_wrapped *wrapped_parent)
{ {
struct pci_dev* dev = wrapped_dev ? wrapped_dev->dev : NULL; struct pci_dev* dev = wrapped_dev ? wrapped_dev->dev : NULL;
......
...@@ -374,7 +374,7 @@ static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp ...@@ -374,7 +374,7 @@ static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp
} }
static int init_acpi (void) static int __init init_acpi (void)
{ {
int retval; int retval;
...@@ -426,7 +426,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot) ...@@ -426,7 +426,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
* init_slots - initialize 'struct slot' structures for each slot * init_slots - initialize 'struct slot' structures for each slot
* *
*/ */
static int init_slots (void) static int __init init_slots (void)
{ {
struct slot *slot; struct slot *slot;
int retval = 0; int retval = 0;
...@@ -492,7 +492,7 @@ static int init_slots (void) ...@@ -492,7 +492,7 @@ static int init_slots (void)
} }
static void cleanup_slots (void) static void __exit cleanup_slots (void)
{ {
struct list_head *tmp, *n; struct list_head *tmp, *n;
struct slot *slot; struct slot *slot;
......
...@@ -87,7 +87,7 @@ static int is_ejectable (acpi_handle handle) ...@@ -87,7 +87,7 @@ static int is_ejectable (acpi_handle handle)
/* callback routine to check the existence of ejectable slots */ /* callback routine to check the existence of ejectable slots */
static acpi_status static acpi_status
is_ejectable_slot (acpi_handle handle, u32 lvl, void *context, void **rv) is_ejectable_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
{ {
int *count = (int *)context; int *count = (int *)context;
...@@ -103,7 +103,7 @@ is_ejectable_slot (acpi_handle handle, u32 lvl, void *context, void **rv) ...@@ -103,7 +103,7 @@ is_ejectable_slot (acpi_handle handle, u32 lvl, void *context, void **rv)
/* callback routine to register each ACPI PCI slot object */ /* callback routine to register each ACPI PCI slot object */
static acpi_status static acpi_status
register_slot (acpi_handle handle, u32 lvl, void *context, void **rv) register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
{ {
struct acpiphp_bridge *bridge = (struct acpiphp_bridge *)context; struct acpiphp_bridge *bridge = (struct acpiphp_bridge *)context;
struct acpiphp_slot *slot; struct acpiphp_slot *slot;
...@@ -212,7 +212,7 @@ register_slot (acpi_handle handle, u32 lvl, void *context, void **rv) ...@@ -212,7 +212,7 @@ register_slot (acpi_handle handle, u32 lvl, void *context, void **rv)
/* see if it's worth looking at this bridge */ /* see if it's worth looking at this bridge */
static int detect_ejectable_slots (acpi_handle *bridge_handle) static int detect_ejectable_slots(acpi_handle *bridge_handle)
{ {
acpi_status status; acpi_status status;
int count; int count;
...@@ -231,7 +231,7 @@ static int detect_ejectable_slots (acpi_handle *bridge_handle) ...@@ -231,7 +231,7 @@ static int detect_ejectable_slots (acpi_handle *bridge_handle)
* TBD: _TRA, etc. * TBD: _TRA, etc.
*/ */
static acpi_status static acpi_status
decode_acpi_resource (struct acpi_resource *resource, void *context) decode_acpi_resource(struct acpi_resource *resource, void *context)
{ {
struct acpiphp_bridge *bridge = (struct acpiphp_bridge *) context; struct acpiphp_bridge *bridge = (struct acpiphp_bridge *) context;
struct acpi_resource_address64 address; struct acpi_resource_address64 address;
...@@ -339,7 +339,7 @@ static void decode_hpp(struct acpiphp_bridge *bridge) ...@@ -339,7 +339,7 @@ static void decode_hpp(struct acpiphp_bridge *bridge)
/* initialize miscellaneous stuff for both root and PCI-to-PCI bridge */ /* initialize miscellaneous stuff for both root and PCI-to-PCI bridge */
static void init_bridge_misc (struct acpiphp_bridge *bridge) static void init_bridge_misc(struct acpiphp_bridge *bridge)
{ {
acpi_status status; acpi_status status;
...@@ -371,7 +371,7 @@ static void init_bridge_misc (struct acpiphp_bridge *bridge) ...@@ -371,7 +371,7 @@ static void init_bridge_misc (struct acpiphp_bridge *bridge)
/* allocate and initialize host bridge data structure */ /* allocate and initialize host bridge data structure */
static void add_host_bridge (acpi_handle *handle, int seg, int bus) static void add_host_bridge(acpi_handle *handle, int seg, int bus)
{ {
acpi_status status; acpi_status status;
struct acpiphp_bridge *bridge; struct acpiphp_bridge *bridge;
...@@ -423,7 +423,7 @@ static void add_host_bridge (acpi_handle *handle, int seg, int bus) ...@@ -423,7 +423,7 @@ static void add_host_bridge (acpi_handle *handle, int seg, int bus)
/* allocate and initialize PCI-to-PCI bridge data structure */ /* allocate and initialize PCI-to-PCI bridge data structure */
static void add_p2p_bridge (acpi_handle *handle, int seg, int bus, int dev, int fn) static void add_p2p_bridge(acpi_handle *handle, int seg, int bus, int dev, int fn)
{ {
struct acpiphp_bridge *bridge; struct acpiphp_bridge *bridge;
u8 tmp8; u8 tmp8;
...@@ -573,7 +573,7 @@ static void add_p2p_bridge (acpi_handle *handle, int seg, int bus, int dev, int ...@@ -573,7 +573,7 @@ static void add_p2p_bridge (acpi_handle *handle, int seg, int bus, int dev, int
/* callback routine to find P2P bridges */ /* callback routine to find P2P bridges */
static acpi_status static acpi_status
find_p2p_bridge (acpi_handle handle, u32 lvl, void *context, void **rv) find_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
{ {
acpi_status status; acpi_status status;
acpi_handle dummy_handle; acpi_handle dummy_handle;
...@@ -673,13 +673,13 @@ static int add_bridge(acpi_handle handle) ...@@ -673,13 +673,13 @@ static int add_bridge(acpi_handle handle)
} }
static void remove_bridge (acpi_handle handle) static void remove_bridge(acpi_handle handle)
{ {
/* No-op for now .. */ /* No-op for now .. */
} }
static int power_on_slot (struct acpiphp_slot *slot) static int power_on_slot(struct acpiphp_slot *slot)
{ {
acpi_status status; acpi_status status;
struct acpiphp_func *func; struct acpiphp_func *func;
...@@ -714,7 +714,7 @@ static int power_on_slot (struct acpiphp_slot *slot) ...@@ -714,7 +714,7 @@ static int power_on_slot (struct acpiphp_slot *slot)
} }
static int power_off_slot (struct acpiphp_slot *slot) static int power_off_slot(struct acpiphp_slot *slot)
{ {
acpi_status status; acpi_status status;
struct acpiphp_func *func; struct acpiphp_func *func;
...@@ -778,7 +778,7 @@ static int power_off_slot (struct acpiphp_slot *slot) ...@@ -778,7 +778,7 @@ static int power_off_slot (struct acpiphp_slot *slot)
* not per each slot object in ACPI namespace. * not per each slot object in ACPI namespace.
* *
*/ */
static int enable_device (struct acpiphp_slot *slot) static int enable_device(struct acpiphp_slot *slot)
{ {
u8 bus; u8 bus;
struct pci_dev *dev; struct pci_dev *dev;
...@@ -852,7 +852,7 @@ static int enable_device (struct acpiphp_slot *slot) ...@@ -852,7 +852,7 @@ static int enable_device (struct acpiphp_slot *slot)
/** /**
* disable_device - disable a slot * disable_device - disable a slot
*/ */
static int disable_device (struct acpiphp_slot *slot) static int disable_device(struct acpiphp_slot *slot)
{ {
int retval = 0; int retval = 0;
struct acpiphp_func *func; struct acpiphp_func *func;
...@@ -894,7 +894,7 @@ static int disable_device (struct acpiphp_slot *slot) ...@@ -894,7 +894,7 @@ static int disable_device (struct acpiphp_slot *slot)
* *
* otherwise return 0 * otherwise return 0
*/ */
static unsigned int get_slot_status (struct acpiphp_slot *slot) static unsigned int get_slot_status(struct acpiphp_slot *slot)
{ {
acpi_status status; acpi_status status;
unsigned long sta = 0; unsigned long sta = 0;
...@@ -939,7 +939,7 @@ static unsigned int get_slot_status (struct acpiphp_slot *slot) ...@@ -939,7 +939,7 @@ static unsigned int get_slot_status (struct acpiphp_slot *slot)
* handles ACPI event notification on {host,p2p} bridges * handles ACPI event notification on {host,p2p} bridges
* *
*/ */
static void handle_hotplug_event_bridge (acpi_handle handle, u32 type, void *context) static void handle_hotplug_event_bridge(acpi_handle handle, u32 type, void *context)
{ {
struct acpiphp_bridge *bridge; struct acpiphp_bridge *bridge;
char objname[64]; char objname[64];
...@@ -1005,7 +1005,7 @@ static void handle_hotplug_event_bridge (acpi_handle handle, u32 type, void *con ...@@ -1005,7 +1005,7 @@ static void handle_hotplug_event_bridge (acpi_handle handle, u32 type, void *con
* handles ACPI event notification on slots * handles ACPI event notification on slots
* *
*/ */
static void handle_hotplug_event_func (acpi_handle handle, u32 type, void *context) static void handle_hotplug_event_func(acpi_handle handle, u32 type, void *context)
{ {
struct acpiphp_func *func; struct acpiphp_func *func;
char objname[64]; char objname[64];
...@@ -1056,7 +1056,7 @@ static struct acpi_pci_driver acpi_pci_hp_driver = { ...@@ -1056,7 +1056,7 @@ static struct acpi_pci_driver acpi_pci_hp_driver = {
* acpiphp_glue_init - initializes all PCI hotplug - ACPI glue data structures * acpiphp_glue_init - initializes all PCI hotplug - ACPI glue data structures
* *
*/ */
int acpiphp_glue_init (void) int __init acpiphp_glue_init(void)
{ {
int num; int num;
...@@ -1077,7 +1077,7 @@ int acpiphp_glue_init (void) ...@@ -1077,7 +1077,7 @@ int acpiphp_glue_init (void)
* *
* This function frees all data allocated in acpiphp_glue_init() * This function frees all data allocated in acpiphp_glue_init()
*/ */
void acpiphp_glue_exit (void) void __exit acpiphp_glue_exit(void)
{ {
struct list_head *l1, *l2, *n1, *n2; struct list_head *l1, *l2, *n1, *n2;
struct acpiphp_bridge *bridge; struct acpiphp_bridge *bridge;
...@@ -1124,7 +1124,7 @@ void acpiphp_glue_exit (void) ...@@ -1124,7 +1124,7 @@ void acpiphp_glue_exit (void)
/** /**
* acpiphp_get_num_slots - count number of slots in a system * acpiphp_get_num_slots - count number of slots in a system
*/ */
int acpiphp_get_num_slots (void) int __init acpiphp_get_num_slots(void)
{ {
struct list_head *node; struct list_head *node;
struct acpiphp_bridge *bridge; struct acpiphp_bridge *bridge;
...@@ -1171,7 +1171,7 @@ int acpiphp_for_each_slot(acpiphp_callback fn, void *data) ...@@ -1171,7 +1171,7 @@ int acpiphp_for_each_slot(acpiphp_callback fn, void *data)
/* search matching slot from id */ /* search matching slot from id */
struct acpiphp_slot *get_slot_from_id (int id) struct acpiphp_slot *get_slot_from_id(int id)
{ {
struct list_head *node; struct list_head *node;
struct acpiphp_bridge *bridge; struct acpiphp_bridge *bridge;
...@@ -1193,7 +1193,7 @@ struct acpiphp_slot *get_slot_from_id (int id) ...@@ -1193,7 +1193,7 @@ struct acpiphp_slot *get_slot_from_id (int id)
/** /**
* acpiphp_enable_slot - power on slot * acpiphp_enable_slot - power on slot
*/ */
int acpiphp_enable_slot (struct acpiphp_slot *slot) int acpiphp_enable_slot(struct acpiphp_slot *slot)
{ {
int retval; int retval;
...@@ -1217,7 +1217,7 @@ int acpiphp_enable_slot (struct acpiphp_slot *slot) ...@@ -1217,7 +1217,7 @@ int acpiphp_enable_slot (struct acpiphp_slot *slot)
/** /**
* acpiphp_disable_slot - power off slot * acpiphp_disable_slot - power off slot
*/ */
int acpiphp_disable_slot (struct acpiphp_slot *slot) int acpiphp_disable_slot(struct acpiphp_slot *slot)
{ {
int retval = 0; int retval = 0;
...@@ -1249,7 +1249,7 @@ int acpiphp_disable_slot (struct acpiphp_slot *slot) ...@@ -1249,7 +1249,7 @@ int acpiphp_disable_slot (struct acpiphp_slot *slot)
/** /**
* acpiphp_check_bridge - re-enumerate devices * acpiphp_check_bridge - re-enumerate devices
*/ */
int acpiphp_check_bridge (struct acpiphp_bridge *bridge) int acpiphp_check_bridge(struct acpiphp_bridge *bridge)
{ {
struct acpiphp_slot *slot; struct acpiphp_slot *slot;
unsigned int sta; unsigned int sta;
...@@ -1296,7 +1296,7 @@ int acpiphp_check_bridge (struct acpiphp_bridge *bridge) ...@@ -1296,7 +1296,7 @@ int acpiphp_check_bridge (struct acpiphp_bridge *bridge)
* slot enabled: 1 * slot enabled: 1
* slot disabled: 0 * slot disabled: 0
*/ */
u8 acpiphp_get_power_status (struct acpiphp_slot *slot) u8 acpiphp_get_power_status(struct acpiphp_slot *slot)
{ {
unsigned int sta; unsigned int sta;
...@@ -1314,7 +1314,7 @@ u8 acpiphp_get_power_status (struct acpiphp_slot *slot) ...@@ -1314,7 +1314,7 @@ u8 acpiphp_get_power_status (struct acpiphp_slot *slot)
* no direct attention led status information via ACPI * no direct attention led status information via ACPI
* *
*/ */
u8 acpiphp_get_attention_status (struct acpiphp_slot *slot) u8 acpiphp_get_attention_status(struct acpiphp_slot *slot)
{ {
return 0; return 0;
} }
...@@ -1324,7 +1324,7 @@ u8 acpiphp_get_attention_status (struct acpiphp_slot *slot) ...@@ -1324,7 +1324,7 @@ u8 acpiphp_get_attention_status (struct acpiphp_slot *slot)
* latch closed: 1 * latch closed: 1
* latch open: 0 * latch open: 0
*/ */
u8 acpiphp_get_latch_status (struct acpiphp_slot *slot) u8 acpiphp_get_latch_status(struct acpiphp_slot *slot)
{ {
unsigned int sta; unsigned int sta;
...@@ -1338,7 +1338,7 @@ u8 acpiphp_get_latch_status (struct acpiphp_slot *slot) ...@@ -1338,7 +1338,7 @@ u8 acpiphp_get_latch_status (struct acpiphp_slot *slot)
* adapter presence : 1 * adapter presence : 1
* absence : 0 * absence : 0
*/ */
u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot) u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot)
{ {
unsigned int sta; unsigned int sta;
...@@ -1351,7 +1351,7 @@ u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot) ...@@ -1351,7 +1351,7 @@ u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot)
/* /*
* pci address (seg/bus/dev) * pci address (seg/bus/dev)
*/ */
u32 acpiphp_get_address (struct acpiphp_slot *slot) u32 acpiphp_get_address(struct acpiphp_slot *slot)
{ {
u32 address; u32 address;
......
...@@ -2446,7 +2446,7 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f ...@@ -2446,7 +2446,7 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
u8 behind_bridge, struct resource_lists * resources) u8 behind_bridge, struct resource_lists * resources)
{ {
int cloop; int cloop;
u8 IRQ; u8 IRQ = 0;
u8 temp_byte; u8 temp_byte;
u8 device; u8 device;
u8 class_code; u8 class_code;
...@@ -3021,6 +3021,7 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f ...@@ -3021,6 +3021,7 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
} }
} // End of base register loop } // End of base register loop
#if !defined(CONFIG_X86_IO_APIC)
// Figure out which interrupt pin this function uses // Figure out which interrupt pin this function uses
rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_INTERRUPT_PIN, &temp_byte); rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_INTERRUPT_PIN, &temp_byte);
...@@ -3045,6 +3046,7 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f ...@@ -3045,6 +3046,7 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
// IRQ Line // IRQ Line
rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_INTERRUPT_LINE, IRQ); rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_INTERRUPT_LINE, IRQ);
#endif
if (!behind_bridge) { if (!behind_bridge) {
rc = cpqhp_set_irq(func->bus, func->device, temp_byte + 0x09, IRQ); rc = cpqhp_set_irq(func->bus, func->device, temp_byte + 0x09, IRQ);
......
...@@ -123,7 +123,7 @@ int cpqhp_unconfigure_device(struct pci_func* func) ...@@ -123,7 +123,7 @@ int cpqhp_unconfigure_device(struct pci_func* func)
dbg("%s: bus/dev/func = %x/%x/%x\n", __FUNCTION__, func->bus, func->device, func->function); dbg("%s: bus/dev/func = %x/%x/%x\n", __FUNCTION__, func->bus, func->device, func->function);
for (j=0; j<8 ; j++) { for (j=0; j<8 ; j++) {
struct pci_dev* temp = pci_find_slot(func->bus, (func->device << 3) | j); struct pci_dev* temp = pci_find_slot(func->bus, PCI_DEVFN(func->device, j));
if (temp) if (temp)
pci_remove_bus_device(temp); pci_remove_bus_device(temp);
} }
...@@ -151,6 +151,7 @@ static int PCI_RefinedAccessConfig(struct pci_bus *bus, unsigned int devfn, u8 o ...@@ -151,6 +151,7 @@ static int PCI_RefinedAccessConfig(struct pci_bus *bus, unsigned int devfn, u8 o
*/ */
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)
{ {
#if !defined(CONFIG_X86_IO_APIC)
int rc; int rc;
u16 temp_word; u16 temp_word;
struct pci_dev fakedev; struct pci_dev fakedev;
...@@ -175,6 +176,7 @@ int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num) ...@@ -175,6 +176,7 @@ int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num)
// This should only be for x86 as it sets the Edge Level Control Register // This should only be for x86 as it sets the Edge Level Control Register
outb((u8) (temp_word & 0xFF), 0x4d0); outb((u8) (temp_word & 0xFF), 0x4d0);
outb((u8) ((temp_word & 0xFF00) >> 8), 0x4d1); outb((u8) ((temp_word & 0xFF00) >> 8), 0x4d1);
#endif
return 0; return 0;
} }
...@@ -545,10 +547,10 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) ...@@ -545,10 +547,10 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot)
} while (function < max_functions); } while (function < max_functions);
} // End of IF (device in slot?) } // End of IF (device in slot?)
else { else {
return(2); return 2;
} }
return(0); return 0;
} }
...@@ -594,9 +596,8 @@ int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func * func) ...@@ -594,9 +596,8 @@ int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func * func)
while (next != NULL) { while (next != NULL) {
rc = cpqhp_save_base_addr_length(ctrl, next); rc = cpqhp_save_base_addr_length(ctrl, next);
if (rc) if (rc)
return(rc); return rc;
next = next->next; next = next->next;
} }
...@@ -979,7 +980,6 @@ int cpqhp_configure_board(struct controller *ctrl, struct pci_func * func) ...@@ -979,7 +980,6 @@ int cpqhp_configure_board(struct controller *ctrl, struct pci_func * func)
while (next != NULL) { while (next != NULL) {
rc = cpqhp_configure_board(ctrl, next); rc = cpqhp_configure_board(ctrl, next);
if (rc) if (rc)
return rc; return rc;
...@@ -1076,9 +1076,8 @@ int cpqhp_valid_replace(struct controller *ctrl, struct pci_func * func) ...@@ -1076,9 +1076,8 @@ int cpqhp_valid_replace(struct controller *ctrl, struct pci_func * func)
while (next != NULL) { while (next != NULL) {
rc = cpqhp_valid_replace(ctrl, next); rc = cpqhp_valid_replace(ctrl, next);
if (rc) if (rc)
return(rc); return rc;
next = next->next; next = next->next;
} }
...@@ -1144,7 +1143,7 @@ int cpqhp_valid_replace(struct controller *ctrl, struct pci_func * func) ...@@ -1144,7 +1143,7 @@ int cpqhp_valid_replace(struct controller *ctrl, struct pci_func * func)
} }
return(0); return 0;
} }
...@@ -1229,9 +1228,8 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start) ...@@ -1229,9 +1228,8 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start)
i = readb(rom_resource_table + NUMBER_OF_ENTRIES); i = readb(rom_resource_table + NUMBER_OF_ENTRIES);
dbg("number_of_entries = %d\n", i); dbg("number_of_entries = %d\n", i);
if (!readb(one_slot + SECONDARY_BUS)) { if (!readb(one_slot + SECONDARY_BUS))
return(1); return 1;
}
dbg("dev|IO base|length|Mem base|length|Pre base|length|PB SB MB\n"); dbg("dev|IO base|length|Mem base|length|Pre base|length|PB SB MB\n");
...@@ -1391,7 +1389,7 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start) ...@@ -1391,7 +1389,7 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start)
rc &= cpqhp_resource_sort_and_combine(&(ctrl->io_head)); rc &= cpqhp_resource_sort_and_combine(&(ctrl->io_head));
rc &= cpqhp_resource_sort_and_combine(&(ctrl->bus_head)); rc &= cpqhp_resource_sort_and_combine(&(ctrl->bus_head));
return(rc); return rc;
} }
...@@ -1411,7 +1409,7 @@ int cpqhp_return_board_resources(struct pci_func * func, struct resource_lists * ...@@ -1411,7 +1409,7 @@ int cpqhp_return_board_resources(struct pci_func * func, struct resource_lists *
dbg("%s\n", __FUNCTION__); dbg("%s\n", __FUNCTION__);
if (!func) if (!func)
return(1); return 1;
node = func->io_head; node = func->io_head;
func->io_head = NULL; func->io_head = NULL;
...@@ -1450,7 +1448,7 @@ int cpqhp_return_board_resources(struct pci_func * func, struct resource_lists * ...@@ -1450,7 +1448,7 @@ int cpqhp_return_board_resources(struct pci_func * func, struct resource_lists *
rc |= cpqhp_resource_sort_and_combine(&(resources->io_head)); rc |= cpqhp_resource_sort_and_combine(&(resources->io_head));
rc |= cpqhp_resource_sort_and_combine(&(resources->bus_head)); rc |= cpqhp_resource_sort_and_combine(&(resources->bus_head));
return(rc); return rc;
} }
......
This diff is collapsed.
...@@ -89,36 +89,34 @@ static struct controller *alloc_ebda_hpc (u32 slot_count, u32 bus_count) ...@@ -89,36 +89,34 @@ static struct controller *alloc_ebda_hpc (u32 slot_count, u32 bus_count)
controller = kmalloc (sizeof (struct controller), GFP_KERNEL); controller = kmalloc (sizeof (struct controller), GFP_KERNEL);
if (!controller) if (!controller)
return NULL; goto error;
memset (controller, 0, sizeof (*controller)); memset (controller, 0, sizeof (*controller));
slots = kmalloc (sizeof (struct ebda_hpc_slot) * slot_count, GFP_KERNEL); slots = kmalloc (sizeof (struct ebda_hpc_slot) * slot_count, GFP_KERNEL);
if (!slots) { if (!slots)
kfree (controller); goto error_contr;
return NULL;
}
memset (slots, 0, sizeof (*slots) * slot_count); memset (slots, 0, sizeof (*slots) * slot_count);
controller->slots = slots; controller->slots = slots;
buses = kmalloc (sizeof (struct ebda_hpc_bus) * bus_count, GFP_KERNEL); buses = kmalloc (sizeof (struct ebda_hpc_bus) * bus_count, GFP_KERNEL);
if (!buses) { if (!buses)
kfree (controller->slots); goto error_slots;
kfree (controller);
return NULL;
}
memset (buses, 0, sizeof (*buses) * bus_count); memset (buses, 0, sizeof (*buses) * bus_count);
controller->buses = buses; controller->buses = buses;
return controller; return controller;
error_slots:
kfree(controller->slots);
error_contr:
kfree(controller);
error:
return NULL;
} }
static void free_ebda_hpc (struct controller *controller) static void free_ebda_hpc (struct controller *controller)
{ {
kfree (controller->slots); kfree (controller->slots);
controller->slots = NULL;
kfree (controller->buses); kfree (controller->buses);
controller->buses = NULL;
controller->ctrl_dev = NULL;
kfree (controller); kfree (controller);
} }
...@@ -171,7 +169,7 @@ static void print_lo_info (void) ...@@ -171,7 +169,7 @@ static void print_lo_info (void)
{ {
struct rio_detail *ptr; struct rio_detail *ptr;
struct list_head *ptr1; struct list_head *ptr1;
debug ("print_lo_info ---- \n"); debug ("print_lo_info ----\n");
list_for_each (ptr1, &rio_lo_head) { list_for_each (ptr1, &rio_lo_head) {
ptr = list_entry (ptr1, struct rio_detail, rio_detail_list); ptr = list_entry (ptr1, struct rio_detail, rio_detail_list);
debug ("%s - rio_node_id = %x\n", __FUNCTION__, ptr->rio_node_id); debug ("%s - rio_node_id = %x\n", __FUNCTION__, ptr->rio_node_id);
...@@ -188,7 +186,7 @@ static void print_vg_info (void) ...@@ -188,7 +186,7 @@ static void print_vg_info (void)
{ {
struct rio_detail *ptr; struct rio_detail *ptr;
struct list_head *ptr1; struct list_head *ptr1;
debug ("%s --- \n", __FUNCTION__); debug ("%s ---\n", __FUNCTION__);
list_for_each (ptr1, &rio_vg_head) { list_for_each (ptr1, &rio_vg_head) {
ptr = list_entry (ptr1, struct rio_detail, rio_detail_list); ptr = list_entry (ptr1, struct rio_detail, rio_detail_list);
debug ("%s - rio_node_id = %x\n", __FUNCTION__, ptr->rio_node_id); debug ("%s - rio_node_id = %x\n", __FUNCTION__, ptr->rio_node_id);
...@@ -220,7 +218,7 @@ static void __init print_ibm_slot (void) ...@@ -220,7 +218,7 @@ static void __init print_ibm_slot (void)
list_for_each (ptr1, &ibmphp_slot_head) { list_for_each (ptr1, &ibmphp_slot_head) {
ptr = list_entry (ptr1, struct slot, ibm_slot_list); ptr = list_entry (ptr1, struct slot, ibm_slot_list);
debug ("%s - slot_number: %x \n", __FUNCTION__, ptr->number); debug ("%s - slot_number: %x\n", __FUNCTION__, ptr->number);
} }
} }
...@@ -228,13 +226,13 @@ static void __init print_opt_vg (void) ...@@ -228,13 +226,13 @@ static void __init print_opt_vg (void)
{ {
struct opt_rio *ptr; struct opt_rio *ptr;
struct list_head *ptr1; struct list_head *ptr1;
debug ("%s --- \n", __FUNCTION__); debug ("%s ---\n", __FUNCTION__);
list_for_each (ptr1, &opt_vg_head) { list_for_each (ptr1, &opt_vg_head) {
ptr = list_entry (ptr1, struct opt_rio, opt_rio_list); ptr = list_entry (ptr1, struct opt_rio, opt_rio_list);
debug ("%s - rio_type %x \n", __FUNCTION__, ptr->rio_type); debug ("%s - rio_type %x\n", __FUNCTION__, ptr->rio_type);
debug ("%s - chassis_num: %x \n", __FUNCTION__, ptr->chassis_num); debug ("%s - chassis_num: %x\n", __FUNCTION__, ptr->chassis_num);
debug ("%s - first_slot_num: %x \n", __FUNCTION__, ptr->first_slot_num); debug ("%s - first_slot_num: %x\n", __FUNCTION__, ptr->first_slot_num);
debug ("%s - middle_num: %x \n", __FUNCTION__, ptr->middle_num); debug ("%s - middle_num: %x\n", __FUNCTION__, ptr->middle_num);
} }
} }
...@@ -286,7 +284,8 @@ static void __init print_ebda_hpc (void) ...@@ -286,7 +284,8 @@ static void __init print_ebda_hpc (void)
int __init ibmphp_access_ebda (void) int __init ibmphp_access_ebda (void)
{ {
u8 format, num_ctlrs, rio_complete, hs_complete; u8 format, num_ctlrs, rio_complete, hs_complete;
u16 ebda_seg, num_entries, next_offset, offset, blk_id, sub_addr, rc, re, rc_id, re_id, base; u16 ebda_seg, num_entries, next_offset, offset, blk_id, sub_addr, re, rc_id, re_id, base;
int rc = 0;
rio_complete = 0; rio_complete = 0;
...@@ -324,10 +323,8 @@ int __init ibmphp_access_ebda (void) ...@@ -324,10 +323,8 @@ int __init ibmphp_access_ebda (void)
format = readb (io_mem + offset); format = readb (io_mem + offset);
offset += 1; offset += 1;
if (format != 4) { if (format != 4)
iounmap (io_mem); goto error_nodev;
return -ENODEV;
}
debug ("hot blk format: %x\n", format); debug ("hot blk format: %x\n", format);
/* hot swap sub blk */ /* hot swap sub blk */
base = offset; base = offset;
...@@ -339,18 +336,16 @@ int __init ibmphp_access_ebda (void) ...@@ -339,18 +336,16 @@ int __init ibmphp_access_ebda (void)
rc_id = readw (io_mem + sub_addr); /* sub blk id */ rc_id = readw (io_mem + sub_addr); /* sub blk id */
sub_addr += 2; sub_addr += 2;
if (rc_id != 0x5243) { if (rc_id != 0x5243)
iounmap (io_mem); goto error_nodev;
return -ENODEV;
}
/* rc sub blk signature */ /* rc sub blk signature */
num_ctlrs = readb (io_mem + sub_addr); num_ctlrs = readb (io_mem + sub_addr);
sub_addr += 1; sub_addr += 1;
hpc_list_ptr = alloc_ebda_hpc_list (); hpc_list_ptr = alloc_ebda_hpc_list ();
if (!hpc_list_ptr) { if (!hpc_list_ptr) {
iounmap (io_mem); rc = -ENOMEM;
return -ENOMEM; goto out;
} }
hpc_list_ptr->format = format; hpc_list_ptr->format = format;
hpc_list_ptr->num_ctlrs = num_ctlrs; hpc_list_ptr->num_ctlrs = num_ctlrs;
...@@ -361,16 +356,15 @@ int __init ibmphp_access_ebda (void) ...@@ -361,16 +356,15 @@ int __init ibmphp_access_ebda (void)
debug ("offset of hpc data structure enteries: %x\n ", sub_addr); debug ("offset of hpc data structure enteries: %x\n ", sub_addr);
sub_addr = base + re; /* re sub blk */ sub_addr = base + re; /* re sub blk */
/* FIXME: rc is never used/checked */
rc = readw (io_mem + sub_addr); /* next sub blk */ rc = readw (io_mem + sub_addr); /* next sub blk */
sub_addr += 2; sub_addr += 2;
re_id = readw (io_mem + sub_addr); /* sub blk id */ re_id = readw (io_mem + sub_addr); /* sub blk id */
sub_addr += 2; sub_addr += 2;
if (re_id != 0x5245) { if (re_id != 0x5245)
iounmap (io_mem); goto error_nodev;
return -ENODEV;
}
/* signature of re */ /* signature of re */
num_entries = readw (io_mem + sub_addr); num_entries = readw (io_mem + sub_addr);
...@@ -378,8 +372,8 @@ int __init ibmphp_access_ebda (void) ...@@ -378,8 +372,8 @@ int __init ibmphp_access_ebda (void)
sub_addr += 2; /* offset of RSRC_ENTRIES blk */ sub_addr += 2; /* offset of RSRC_ENTRIES blk */
rsrc_list_ptr = alloc_ebda_rsrc_list (); rsrc_list_ptr = alloc_ebda_rsrc_list ();
if (!rsrc_list_ptr ) { if (!rsrc_list_ptr ) {
iounmap (io_mem); rc = -ENOMEM;
return -ENOMEM; goto out;
} }
rsrc_list_ptr->format = format; rsrc_list_ptr->format = format;
rsrc_list_ptr->num_entries = num_entries; rsrc_list_ptr->num_entries = num_entries;
...@@ -391,9 +385,8 @@ int __init ibmphp_access_ebda (void) ...@@ -391,9 +385,8 @@ int __init ibmphp_access_ebda (void)
debug ("offset of rsrc data structure enteries: %x\n ", sub_addr); debug ("offset of rsrc data structure enteries: %x\n ", sub_addr);
hs_complete = 1; hs_complete = 1;
} } else {
/* found rio table */ /* found rio table, blk_id == 0x4752 */
else if (blk_id == 0x4752) {
debug ("now enter io table ---\n"); debug ("now enter io table ---\n");
debug ("rio blk id: %x\n", blk_id); debug ("rio blk id: %x\n", blk_id);
...@@ -406,41 +399,36 @@ int __init ibmphp_access_ebda (void) ...@@ -406,41 +399,36 @@ int __init ibmphp_access_ebda (void)
rio_table_ptr->riodev_count = readb (io_mem + offset + 2); rio_table_ptr->riodev_count = readb (io_mem + offset + 2);
rio_table_ptr->offset = offset +3 ; rio_table_ptr->offset = offset +3 ;
debug ("info about rio table hdr ---\n"); debug("info about rio table hdr ---\n");
debug ("ver_num: %x\nscal_count: %x\nriodev_count: %x\noffset of rio table: %x\n ", rio_table_ptr->ver_num, rio_table_ptr->scal_count, rio_table_ptr->riodev_count, rio_table_ptr->offset); debug("ver_num: %x\nscal_count: %x\nriodev_count: %x\noffset of rio table: %x\n ",
rio_table_ptr->ver_num, rio_table_ptr->scal_count,
rio_table_ptr->riodev_count, rio_table_ptr->offset);
rio_complete = 1; rio_complete = 1;
} }
} }
if (!hs_complete && !rio_complete) { if (!hs_complete && !rio_complete)
iounmap (io_mem); goto error_nodev;
return -ENODEV;
}
if (rio_table_ptr) { if (rio_table_ptr) {
if (rio_complete == 1 && rio_table_ptr->ver_num == 3) { if (rio_complete && rio_table_ptr->ver_num == 3) {
rc = ebda_rio_table (); rc = ebda_rio_table ();
if (rc) { if (rc)
iounmap (io_mem); goto out;
return rc;
}
} }
} }
rc = ebda_rsrc_controller (); rc = ebda_rsrc_controller ();
if (rc) { if (rc)
iounmap (io_mem); goto out;
return rc;
}
rc = ebda_rsrc_rsrc (); rc = ebda_rsrc_rsrc ();
if (rc) { goto out;
error_nodev:
rc = -ENODEV;
out:
iounmap (io_mem); iounmap (io_mem);
return rc; return rc;
}
iounmap (io_mem);
return 0;
} }
/* /*
...@@ -670,7 +658,7 @@ static char *create_file_name (struct slot * slot_cur) ...@@ -670,7 +658,7 @@ static char *create_file_name (struct slot * slot_cur)
u8 flag = 0; u8 flag = 0;
if (!slot_cur) { if (!slot_cur) {
err ("Structure passed is empty \n"); err ("Structure passed is empty\n");
return NULL; return NULL;
} }
...@@ -1269,14 +1257,14 @@ static int ibmphp_probe (struct pci_dev * dev, const struct pci_device_id *ids) ...@@ -1269,14 +1257,14 @@ static int ibmphp_probe (struct pci_dev * dev, const struct pci_device_id *ids)
struct controller *ctrl; struct controller *ctrl;
struct list_head *tmp; struct list_head *tmp;
debug ("inside ibmphp_probe \n"); debug ("inside ibmphp_probe\n");
list_for_each (tmp, &ebda_hpc_head) { list_for_each (tmp, &ebda_hpc_head) {
ctrl = list_entry (tmp, struct controller, ebda_hpc_list); ctrl = list_entry (tmp, struct controller, ebda_hpc_list);
if (ctrl->ctlr_type == 1) { if (ctrl->ctlr_type == 1) {
if ((dev->devfn == ctrl->u.pci_ctlr.dev_fun) && (dev->bus->number == ctrl->u.pci_ctlr.bus)) { if ((dev->devfn == ctrl->u.pci_ctlr.dev_fun) && (dev->bus->number == ctrl->u.pci_ctlr.bus)) {
ctrl->ctrl_dev = dev; ctrl->ctrl_dev = dev;
debug ("found device!!! \n"); debug ("found device!!!\n");
debug ("dev->device = %x, dev->subsystem_device = %x\n", dev->device, dev->subsystem_device); debug ("dev->device = %x, dev->subsystem_device = %x\n", dev->device, dev->subsystem_device);
return 0; return 0;
} }
......
This diff is collapsed.
...@@ -52,13 +52,13 @@ static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8 ...@@ -52,13 +52,13 @@ static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8
struct bus_node * newbus; struct bus_node * newbus;
if (!(curr) && !(flag)) { if (!(curr) && !(flag)) {
err ("NULL pointer passed \n"); err ("NULL pointer passed\n");
return NULL; return NULL;
} }
newbus = kmalloc (sizeof (struct bus_node), GFP_KERNEL); newbus = kmalloc (sizeof (struct bus_node), GFP_KERNEL);
if (!newbus) { if (!newbus) {
err ("out of system memory \n"); err ("out of system memory\n");
return NULL; return NULL;
} }
...@@ -76,13 +76,13 @@ static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * cur ...@@ -76,13 +76,13 @@ static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * cur
struct resource_node *rs; struct resource_node *rs;
if (!curr) { if (!curr) {
err ("NULL passed to allocate \n"); err ("NULL passed to allocate\n");
return NULL; return NULL;
} }
rs = kmalloc (sizeof (struct resource_node), GFP_KERNEL); rs = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!rs) { if (!rs) {
err ("out of system memory \n"); err ("out of system memory\n");
return NULL; return NULL;
} }
memset (rs, 0, sizeof (struct resource_node)); memset (rs, 0, sizeof (struct resource_node));
...@@ -103,7 +103,7 @@ static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node ...@@ -103,7 +103,7 @@ static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node
if (first_bus) { if (first_bus) {
newbus = kmalloc (sizeof (struct bus_node), GFP_KERNEL); newbus = kmalloc (sizeof (struct bus_node), GFP_KERNEL);
if (!newbus) { if (!newbus) {
err ("out of system memory. \n"); err ("out of system memory.\n");
return -ENOMEM; return -ENOMEM;
} }
memset (newbus, 0, sizeof (struct bus_node)); memset (newbus, 0, sizeof (struct bus_node));
...@@ -127,7 +127,7 @@ static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node ...@@ -127,7 +127,7 @@ static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node
if (!newrange) { if (!newrange) {
if (first_bus) if (first_bus)
kfree (newbus); kfree (newbus);
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (newrange, 0, sizeof (struct range_node)); memset (newrange, 0, sizeof (struct range_node));
...@@ -607,7 +607,7 @@ int ibmphp_add_resource (struct resource_node *res) ...@@ -607,7 +607,7 @@ int ibmphp_add_resource (struct resource_node *res)
debug ("%s - enter\n", __FUNCTION__); debug ("%s - enter\n", __FUNCTION__);
if (!res) { if (!res) {
err ("NULL passed to add \n"); err ("NULL passed to add\n");
return -ENODEV; return -ENODEV;
} }
...@@ -634,7 +634,7 @@ int ibmphp_add_resource (struct resource_node *res) ...@@ -634,7 +634,7 @@ int ibmphp_add_resource (struct resource_node *res)
res_start = bus_cur->firstPFMem; res_start = bus_cur->firstPFMem;
break; break;
default: default:
err ("cannot read the type of the resource to add... problem \n"); err ("cannot read the type of the resource to add... problem\n");
return -EINVAL; return -EINVAL;
} }
while (range_cur) { while (range_cur) {
...@@ -787,7 +787,7 @@ int ibmphp_remove_resource (struct resource_node *res) ...@@ -787,7 +787,7 @@ int ibmphp_remove_resource (struct resource_node *res)
char * type = ""; char * type = "";
if (!res) { if (!res) {
err ("resource to remove is NULL \n"); err ("resource to remove is NULL\n");
return -ENODEV; return -ENODEV;
} }
...@@ -813,7 +813,7 @@ int ibmphp_remove_resource (struct resource_node *res) ...@@ -813,7 +813,7 @@ int ibmphp_remove_resource (struct resource_node *res)
type = "pfmem"; type = "pfmem";
break; break;
default: default:
err ("unknown type for resource to remove \n"); err ("unknown type for resource to remove\n");
return -EINVAL; return -EINVAL;
} }
res_prev = NULL; res_prev = NULL;
...@@ -954,7 +954,7 @@ static struct range_node * find_range (struct bus_node *bus_cur, struct resource ...@@ -954,7 +954,7 @@ static struct range_node * find_range (struct bus_node *bus_cur, struct resource
range = bus_cur->rangePFMem; range = bus_cur->rangePFMem;
break; break;
default: default:
err ("cannot read resource type in find_range \n"); err ("cannot read resource type in find_range\n");
} }
while (range) { while (range) {
...@@ -1002,7 +1002,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge) ...@@ -1002,7 +1002,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
if (!bus_cur) { if (!bus_cur) {
/* didn't find a bus, smth's wrong!!! */ /* didn't find a bus, smth's wrong!!! */
debug ("no bus in the system, either pci_dev's wrong or allocation failed \n"); debug ("no bus in the system, either pci_dev's wrong or allocation failed\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1027,7 +1027,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge) ...@@ -1027,7 +1027,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
noranges = bus_cur->noPFMemRanges; noranges = bus_cur->noPFMemRanges;
break; break;
default: default:
err ("wrong type of resource to check \n"); err ("wrong type of resource to check\n");
return -EINVAL; return -EINVAL;
} }
res_prev = NULL; res_prev = NULL;
...@@ -1496,7 +1496,7 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour ...@@ -1496,7 +1496,7 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour
char * type = ""; char * type = "";
if (!bus) { if (!bus) {
err ("The bus passed in NULL to find resource \n"); err ("The bus passed in NULL to find resource\n");
return -ENODEV; return -ENODEV;
} }
...@@ -1514,7 +1514,7 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour ...@@ -1514,7 +1514,7 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour
type = "pfmem"; type = "pfmem";
break; break;
default: default:
err ("wrong type of flag \n"); err ("wrong type of flag\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1540,17 +1540,17 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour ...@@ -1540,17 +1540,17 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour
res_cur = res_cur->next; res_cur = res_cur->next;
} }
if (!res_cur) { if (!res_cur) {
debug ("SOS...cannot find %s resource in the bus. \n", type); debug ("SOS...cannot find %s resource in the bus.\n", type);
return -EINVAL; return -EINVAL;
} }
} else { } else {
debug ("SOS... cannot find %s resource in the bus. \n", type); debug ("SOS... cannot find %s resource in the bus.\n", type);
return -EINVAL; return -EINVAL;
} }
} }
if (*res) if (*res)
debug ("*res->start = %x \n", (*res)->start); debug ("*res->start = %x\n", (*res)->start);
return 0; return 0;
} }
...@@ -1708,7 +1708,7 @@ static int __init once_over (void) ...@@ -1708,7 +1708,7 @@ static int __init once_over (void)
mem = kmalloc (sizeof (struct resource_node), GFP_KERNEL); mem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!mem) { if (!mem) {
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (mem, 0, sizeof (struct resource_node)); memset (mem, 0, sizeof (struct resource_node));
...@@ -1792,7 +1792,7 @@ void ibmphp_print_test (void) ...@@ -1792,7 +1792,7 @@ void ibmphp_print_test (void)
list_for_each (tmp, &gbuses) { list_for_each (tmp, &gbuses) {
bus_cur = list_entry (tmp, struct bus_node, bus_list); bus_cur = list_entry (tmp, struct bus_node, bus_list);
debug_pci ("This is bus # %d. There are \n", bus_cur->busno); debug_pci ("This is bus # %d. There are\n", bus_cur->busno);
debug_pci ("IORanges = %d\t", bus_cur->noIORanges); debug_pci ("IORanges = %d\t", bus_cur->noIORanges);
debug_pci ("MemRanges = %d\t", bus_cur->noMemRanges); debug_pci ("MemRanges = %d\t", bus_cur->noMemRanges);
debug_pci ("PFMemRanges = %d\n", bus_cur->noPFMemRanges); debug_pci ("PFMemRanges = %d\n", bus_cur->noPFMemRanges);
...@@ -1903,7 +1903,7 @@ static int range_exists_already (struct range_node * range, struct bus_node * bu ...@@ -1903,7 +1903,7 @@ static int range_exists_already (struct range_node * range, struct bus_node * bu
range_cur = bus_cur->rangePFMem; range_cur = bus_cur->rangePFMem;
break; break;
default: default:
err ("wrong type passed to find out if range already exists \n"); err ("wrong type passed to find out if range already exists\n");
return -ENODEV; return -ENODEV;
} }
...@@ -1948,7 +1948,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -1948,7 +1948,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
return -ENODEV; return -ENODEV;
ibmphp_pci_bus->number = bus_cur->busno; ibmphp_pci_bus->number = bus_cur->busno;
debug ("inside %s \n", __FUNCTION__); debug ("inside %s\n", __FUNCTION__);
debug ("bus_cur->busno = %x\n", bus_cur->busno); debug ("bus_cur->busno = %x\n", bus_cur->busno);
for (device = 0; device < 32; device++) { for (device = 0; device < 32; device++) {
...@@ -1997,7 +1997,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -1997,7 +1997,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
if ((start_address) && (start_address <= end_address)) { if ((start_address) && (start_address <= end_address)) {
range = kmalloc (sizeof (struct range_node), GFP_KERNEL); range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
if (!range) { if (!range) {
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (range, 0, sizeof (struct range_node)); memset (range, 0, sizeof (struct range_node));
...@@ -2024,7 +2024,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -2024,7 +2024,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
io = kmalloc (sizeof (struct resource_node), GFP_KERNEL); io = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!io) { if (!io) {
kfree (range); kfree (range);
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (io, 0, sizeof (struct resource_node)); memset (io, 0, sizeof (struct resource_node));
...@@ -2048,7 +2048,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -2048,7 +2048,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
range = kmalloc (sizeof (struct range_node), GFP_KERNEL); range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
if (!range) { if (!range) {
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (range, 0, sizeof (struct range_node)); memset (range, 0, sizeof (struct range_node));
...@@ -2076,7 +2076,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -2076,7 +2076,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
mem = kmalloc (sizeof (struct resource_node), GFP_KERNEL); mem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!mem) { if (!mem) {
kfree (range); kfree (range);
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (mem, 0, sizeof (struct resource_node)); memset (mem, 0, sizeof (struct resource_node));
...@@ -2104,7 +2104,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -2104,7 +2104,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
range = kmalloc (sizeof (struct range_node), GFP_KERNEL); range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
if (!range) { if (!range) {
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (range, 0, sizeof (struct range_node)); memset (range, 0, sizeof (struct range_node));
...@@ -2131,7 +2131,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -2131,7 +2131,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
pfmem = kmalloc (sizeof (struct resource_node), GFP_KERNEL); pfmem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!pfmem) { if (!pfmem) {
kfree (range); kfree (range);
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (pfmem, 0, sizeof (struct resource_node)); memset (pfmem, 0, sizeof (struct resource_node));
......
...@@ -19,9 +19,8 @@ ...@@ -19,9 +19,8 @@
#include <asm/io_apic.h> #include <asm/io_apic.h>
#include <mach_apic.h> #include <mach_apic.h>
#include <linux/pci_msi.h> #include "msi.h"
_DEFINE_DBG_BUFFER
static spinlock_t msi_lock = SPIN_LOCK_UNLOCKED; static spinlock_t msi_lock = SPIN_LOCK_UNLOCKED;
static struct msi_desc* msi_desc[NR_IRQS] = { [0 ... NR_IRQS-1] = NULL }; static struct msi_desc* msi_desc[NR_IRQS] = { [0 ... NR_IRQS-1] = NULL };
......
/* /*
* ../include/linux/pci_msi.h * msi.h
* *
*/ */
#ifndef _ASM_PCI_MSI_H #ifndef MSI_H
#define _ASM_PCI_MSI_H #define MSI_H
#include <linux/pci.h>
#define MSI_AUTO -1 #define MSI_AUTO -1
#define NR_REPEATS 23 #define NR_REPEATS 23
...@@ -82,29 +80,6 @@ extern void restore_ioapic_irq_handler(int irq); ...@@ -82,29 +80,6 @@ extern void restore_ioapic_irq_handler(int irq);
#define msix_mask(address) (address | PCI_MSIX_FLAGS_BITMASK) #define msix_mask(address) (address | PCI_MSIX_FLAGS_BITMASK)
#define msix_is_pending(address) (address & PCI_MSIX_FLAGS_PENDMASK) #define msix_is_pending(address) (address & PCI_MSIX_FLAGS_PENDMASK)
extern char __dbg_str_buf[256];
#define _DEFINE_DBG_BUFFER char __dbg_str_buf[256];
#define _DBG_K_TRACE_ENTRY ((unsigned int)0x00000001)
#define _DBG_K_TRACE_EXIT ((unsigned int)0x00000002)
#define _DBG_K_INFO ((unsigned int)0x00000004)
#define _DBG_K_ERROR ((unsigned int)0x00000008)
#define _DBG_K_TRACE (_DBG_K_TRACE_ENTRY | _DBG_K_TRACE_EXIT)
#define _DEBUG_LEVEL (_DBG_K_INFO | _DBG_K_ERROR | _DBG_K_TRACE)
#define _DBG_PRINT( dbg_flags, args... ) \
if ( _DEBUG_LEVEL & (dbg_flags) ) \
{ \
int len; \
len = sprintf(__dbg_str_buf, "%s:%d: %s ", \
__FILE__, __LINE__, __FUNCTION__ ); \
sprintf(__dbg_str_buf + len, args); \
printk(KERN_INFO "%s\n", __dbg_str_buf); \
}
#define MSI_FUNCTION_TRACE_ENTER \
_DBG_PRINT (_DBG_K_TRACE_ENTRY, "%s", "[Entry]");
#define MSI_FUNCTION_TRACE_EXIT \
_DBG_PRINT (_DBG_K_TRACE_EXIT, "%s", "[Entry]");
/* /*
* MSI Defined Data Structures * MSI Defined Data Structures
...@@ -190,4 +165,4 @@ struct msi_desc { ...@@ -190,4 +165,4 @@ struct msi_desc {
struct pci_dev *dev; struct pci_dev *dev;
}; };
#endif /* _ASM_PCI_MSI_H */ #endif /* MSI_H */
...@@ -241,7 +241,7 @@ pci_device_probe_static(struct pci_driver *drv, struct pci_dev *pci_dev) ...@@ -241,7 +241,7 @@ pci_device_probe_static(struct pci_driver *drv, struct pci_dev *pci_dev)
error = drv->probe(pci_dev, id); error = drv->probe(pci_dev, id);
if (error >= 0) { if (error >= 0) {
pci_dev->driver = drv; pci_dev->driver = drv;
return 0; error = 0;
} }
return error; return error;
} }
......
...@@ -5871,6 +5871,11 @@ ...@@ -5871,6 +5871,11 @@
14f1 2004 Dynalink 56PMi 14f1 2004 Dynalink 56PMi
8234 RS8234 ATM SAR Controller [ServiceSAR Plus] 8234 RS8234 ATM SAR Controller [ServiceSAR Plus]
14f2 MOBILITY Electronics 14f2 MOBILITY Electronics
0120 EV1000 bridge
0121 EV1000 Parallel port
0122 EV1000 Serial port
0123 EV1000 Keyboard controller
0124 EV1000 Mouse controller
14f3 BROADLOGIC 14f3 BROADLOGIC
14f4 TOKYO Electronic Industry CO Ltd 14f4 TOKYO Electronic Industry CO Ltd
14f5 SOPAC Ltd 14f5 SOPAC Ltd
...@@ -6667,6 +6672,9 @@ ...@@ -6667,6 +6672,9 @@
1040 536EP Data Fax Modem 1040 536EP Data Fax Modem
16be 1040 V.9X DSP Data Fax Modem 16be 1040 V.9X DSP Data Fax Modem
1043 PRO/Wireless LAN 2100 3B Mini PCI Adapter 1043 PRO/Wireless LAN 2100 3B Mini PCI Adapter
1048 82597EX 10GbE Ethernet Controller
8086 a01f PRO/10GbE LR Server Adapter
8086 a11f PRO/10GbE LR Server Adapter
1059 82551QM Ethernet Controller 1059 82551QM Ethernet Controller
1130 82815 815 Chipset Host Bridge and Memory Controller Hub 1130 82815 815 Chipset Host Bridge and Memory Controller Hub
1025 1016 Travelmate 612 TX 1025 1016 Travelmate 612 TX
......
...@@ -456,8 +456,6 @@ static int pci_setup_device(struct pci_dev * dev) ...@@ -456,8 +456,6 @@ static int pci_setup_device(struct pci_dev * dev)
sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus), sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus),
dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
INIT_LIST_HEAD(&dev->pools);
pci_read_config_dword(dev, PCI_CLASS_REVISION, &class); pci_read_config_dword(dev, PCI_CLASS_REVISION, &class);
class >>= 8; /* upper 3 bytes */ class >>= 8; /* upper 3 bytes */
dev->class = class; dev->class = class;
......
...@@ -83,7 +83,7 @@ void pci_remove_bus_device(struct pci_dev *dev) ...@@ -83,7 +83,7 @@ void pci_remove_bus_device(struct pci_dev *dev)
list_del(&b->node); list_del(&b->node);
spin_unlock(&pci_bus_lock); spin_unlock(&pci_bus_lock);
kfree(b); class_device_unregister(&b->class_dev);
dev->subordinate = NULL; dev->subordinate = NULL;
} }
......
...@@ -43,20 +43,12 @@ ...@@ -43,20 +43,12 @@
#define FL_BASE4 0x0004 #define FL_BASE4 0x0004
#define FL_GET_BASE(x) (x & FL_BASE_MASK) #define FL_GET_BASE(x) (x & FL_BASE_MASK)
#define FL_IRQ_MASK (0x0007 << 4)
#define FL_IRQBASE0 (0x0000 << 4)
#define FL_IRQBASE1 (0x0001 << 4)
#define FL_IRQBASE2 (0x0002 << 4)
#define FL_IRQBASE3 (0x0003 << 4)
#define FL_IRQBASE4 (0x0004 << 4)
#define FL_GET_IRQBASE(x) ((x & FL_IRQ_MASK) >> 4)
/* Use successive BARs (PCI base address registers), /* Use successive BARs (PCI base address registers),
else use offset into some specified BAR */ else use offset into some specified BAR */
#define FL_BASE_BARS 0x0008 #define FL_BASE_BARS 0x0008
/* Use the irq resource table instead of dev->irq */ /* do not assign an irq */
#define FL_IRQRESOURCE 0x0080 #define FL_NOIRQ 0x0080
/* Use the Base address register size to cap number of ports */ /* Use the Base address register size to cap number of ports */
#define FL_REGION_SZ_CAP 0x0100 #define FL_REGION_SZ_CAP 0x0100
...@@ -850,17 +842,10 @@ static struct pci_serial_quirk *find_quirk(struct pci_dev *dev) ...@@ -850,17 +842,10 @@ static struct pci_serial_quirk *find_quirk(struct pci_dev *dev)
static _INLINE_ int static _INLINE_ int
get_pci_irq(struct pci_dev *dev, struct pci_board *board, int idx) get_pci_irq(struct pci_dev *dev, struct pci_board *board, int idx)
{ {
int base_idx; if (board->flags & FL_NOIRQ)
if ((board->flags & FL_IRQRESOURCE) == 0)
return dev->irq;
base_idx = FL_GET_IRQBASE(board->flags);
if (base_idx > DEVICE_COUNT_IRQ)
return 0; return 0;
else
return dev->irq_resource[base_idx].start; return dev->irq;
} }
/* /*
...@@ -1314,7 +1299,7 @@ static struct pci_board pci_boards[] __devinitdata = { ...@@ -1314,7 +1299,7 @@ static struct pci_board pci_boards[] __devinitdata = {
.first_offset = 0x10000, .first_offset = 0x10000,
}, },
[pbn_sgi_ioc3] = { [pbn_sgi_ioc3] = {
.flags = FL_BASE0|FL_IRQRESOURCE, .flags = FL_BASE0|FL_NOIRQ,
.num_ports = 1, .num_ports = 1,
.base_baud = 458333, .base_baud = 458333,
.uart_offset = 8, .uart_offset = 8,
......
...@@ -284,6 +284,7 @@ struct device { ...@@ -284,6 +284,7 @@ struct device {
detached from its driver. */ detached from its driver. */
u64 *dma_mask; /* dma mask (if dma'able device) */ u64 *dma_mask; /* dma mask (if dma'able device) */
struct list_head dma_pools; /* dma pools (if dma'ble) */
void (*release)(struct device * dev); void (*release)(struct device * dev);
}; };
......
/*
* include/linux/dmapool.h
*
* Allocation pools for DMAable (coherent) memory.
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#ifndef LINUX_DMAPOOL_H
#define LINUX_DMAPOOL_H
#include <asm/io.h>
#include <asm/scatterlist.h>
struct dma_pool *dma_pool_create(const char *name, struct device *dev,
size_t size, size_t align, size_t allocation);
void dma_pool_destroy(struct dma_pool *pool);
void *dma_pool_alloc(struct dma_pool *pool, int mem_flags, dma_addr_t *handle);
void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr);
#endif
...@@ -393,7 +393,6 @@ struct pci_dev { ...@@ -393,7 +393,6 @@ struct pci_dev {
0xffffffff. You only need to change 0xffffffff. You only need to change
this if your device has broken DMA this if your device has broken DMA
or supports 64-bit transfers. */ or supports 64-bit transfers. */
struct list_head pools; /* pci_pools tied to this device */
u64 consistent_dma_mask;/* Like dma_mask, but for u64 consistent_dma_mask;/* Like dma_mask, but for
pci_alloc_consistent mappings as pci_alloc_consistent mappings as
...@@ -416,8 +415,6 @@ struct pci_dev { ...@@ -416,8 +415,6 @@ struct pci_dev {
*/ */
unsigned int irq; unsigned int irq;
struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */ struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */
struct resource dma_resource[DEVICE_COUNT_DMA];
struct resource irq_resource[DEVICE_COUNT_IRQ];
char * slot_name; /* pointer to dev.bus_id */ char * slot_name; /* pointer to dev.bus_id */
...@@ -694,12 +691,15 @@ const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, co ...@@ -694,12 +691,15 @@ const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, co
int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass); int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass);
/* kmem_cache style wrapper around pci_alloc_consistent() */ /* kmem_cache style wrapper around pci_alloc_consistent() */
struct pci_pool *pci_pool_create (const char *name, struct pci_dev *dev,
size_t size, size_t align, size_t allocation);
void pci_pool_destroy (struct pci_pool *pool);
void *pci_pool_alloc (struct pci_pool *pool, int flags, dma_addr_t *handle); #include <linux/dmapool.h>
void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr);
#define pci_pool dma_pool
#define pci_pool_create(name, pdev, size, align, allocation) \
dma_pool_create(name, &pdev->dev, size, align, allocation)
#define pci_pool_destroy(pool) dma_pool_destroy(pool)
#define pci_pool_alloc(pool, flags, handle) dma_pool_alloc(pool, flags, handle)
#define pci_pool_free(pool, vaddr, addr) dma_pool_free(pool, vaddr, addr)
#if defined(CONFIG_ISA) || defined(CONFIG_EISA) #if defined(CONFIG_ISA) || defined(CONFIG_EISA)
extern struct pci_dev *isa_bridge; extern struct pci_dev *isa_bridge;
......
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