Re: [PATCH] smsc-ircc2: Add PnP support.

From: matthieu castet
Date: Fri Nov 26 2004 - 20:01:30 EST


Meelis Roos wrote:
could you try this patch with the previous one. (You must enable ACPI DEBUG in kernel config)


After fixing one res -> resource, it compiled.
Oups that's the wrong fix : there was a line missing in my previous patch


The output is uninteresting - it only prints one debug message during echoing activate to resources:

That's because resource point at the end of the resources list, so there is nothing to read. With this patch, you should see something.

******845*******
pnp: Device 00:0a activated.
NET: Registered protocol family 23
found SMC SuperIO Chip (devid=0x5a rev=00 base=0x002e): LPC47N227
smsc_superio_flat(): IrDA not enabled
smsc_superio_flat(): fir: 0x00, sir: 0x00, dma: 15, irq: 0, mode: 0x02


thanks for testing


Matthieu --- drivers/pnp/pnpacpi/rsparser.c.int 2004-11-27 01:46:10.000000000 +0100
+++ drivers/pnp/pnpacpi/rsparser.c 2004-11-26 16:33:42.000000000 +0100
@@ -29,6 +29,18 @@
#define valid_IRQ(i) (((i) != 0) && ((i) != 2))
#endif

+static void debug_pnp(struct acpi_resource *res, int line) {
+ int tmp = acpi_dbg_level;
+ int tmp1 = acpi_dbg_layer;
+
+ acpi_dbg_level = 0x00010000;
+ acpi_dbg_layer = 0x00000100;
+ printk("******%d*******\n",line);
+ ACPI_DUMP_RESOURCE_LIST(res);
+ acpi_dbg_level = tmp;
+ acpi_dbg_layer = tmp1;
+}
+
/*
* Allocated Resources
*/
@@ -152,6 +164,8 @@
{
struct pnp_resource_table * res_table = (struct pnp_resource_table *)data;

+ debug_pnp(res,__LINE__);
+
switch (res->id) {
case ACPI_RSTYPE_IRQ:
if ((res->data.irq.number_of_interrupts > 0) &&
@@ -455,6 +469,8 @@
struct pnp_dev *dev = parse_data->dev;
struct pnp_option *option = parse_data->option;

+ debug_pnp(res,__LINE__);
+
switch (res->id) {
case ACPI_RSTYPE_IRQ:
pnpacpi_parse_irq_option(option, &res->data.irq);
@@ -765,6 +781,7 @@
/* pnpacpi_build_resource_template allocates extra mem */
int res_cnt = (buffer->length - 1)/sizeof(struct acpi_resource) - 1;
struct acpi_resource *resource = (struct acpi_resource*)buffer->pointer;
+ struct acpi_resource *res = resource;
int port = 0, irq = 0, dma = 0, mem = 0;

pnp_dbg("res cnt %d", res_cnt);
@@ -826,5 +843,7 @@
resource ++;
i ++;
}
+ debug_pnp(res,__LINE__);
+
return 0;
}