From: Adam Belay <ambx1@neo.rr.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] PnP Changes for 2.5.64
Date: Mon, 10 Mar 2003 00:05:21 +0000 [thread overview]
Message-ID: <20030310000521.GA2118@neo.rr.com> (raw)
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.1077 -> 1.1078
# drivers/pnp/resource.c 1.9 -> 1.10
# drivers/pnp/manager.c 1.4 -> 1.5
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/03/06 ambx1@neo.rr.com 1.1078
# Manual Resource Setting Update
#
# This patch allows for partial setting of manual resources as needed by ALSA.
# It does not change any existing APIs.
# --------------------------------------------
#
diff -Nru a/drivers/pnp/manager.c b/drivers/pnp/manager.c
--- a/drivers/pnp/manager.c Sun Mar 9 23:48:20 2003
+++ b/drivers/pnp/manager.c Sun Mar 9 23:48:20 2003
@@ -532,6 +532,39 @@
return error;
}
+static void pnp_process_manual_resources(struct pnp_resource_table * ctab, struct pnp_resource_table * ntab)
+{
+ int idx;
+ for (idx = 0; idx < PNP_MAX_IRQ; idx++) {
+ if (ntab->irq_resource[idx].flags & IORESOURCE_AUTO)
+ continue;
+ ctab->irq_resource[idx].start = ntab->irq_resource[idx].start;
+ ctab->irq_resource[idx].end = ntab->irq_resource[idx].end;
+ ctab->irq_resource[idx].flags = ntab->irq_resource[idx].flags;
+ }
+ for (idx = 0; idx < PNP_MAX_DMA; idx++) {
+ if (ntab->dma_resource[idx].flags & IORESOURCE_AUTO)
+ continue;
+ ctab->dma_resource[idx].start = ntab->dma_resource[idx].start;
+ ctab->dma_resource[idx].end = ntab->dma_resource[idx].end;
+ ctab->dma_resource[idx].flags = ntab->dma_resource[idx].flags;
+ }
+ for (idx = 0; idx < PNP_MAX_PORT; idx++) {
+ if (ntab->port_resource[idx].flags & IORESOURCE_AUTO)
+ continue;
+ ctab->port_resource[idx].start = ntab->port_resource[idx].start;
+ ctab->port_resource[idx].end = ntab->port_resource[idx].end;
+ ctab->port_resource[idx].flags = ntab->port_resource[idx].flags;
+ }
+ for (idx = 0; idx < PNP_MAX_MEM; idx++) {
+ if (ntab->irq_resource[idx].flags & IORESOURCE_AUTO)
+ continue;
+ ctab->irq_resource[idx].start = ntab->mem_resource[idx].start;
+ ctab->irq_resource[idx].end = ntab->mem_resource[idx].end;
+ ctab->irq_resource[idx].flags = ntab->mem_resource[idx].flags;
+ }
+}
+
/**
* pnp_manual_config_dev - Disables Auto Config and Manually sets the resource table
* @dev: pointer to the desired device
@@ -554,7 +587,7 @@
*bak = dev->res;
spin_lock(&pnp_lock);
- dev->res = *res;
+ pnp_process_manual_resources(&dev->res, res);
if (!(mode & PNP_CONFIG_FORCE)) {
for (i = 0; i < PNP_MAX_PORT; i++) {
if(pnp_check_port(dev,i))
@@ -681,7 +714,7 @@
return -1;
}
dev->active = 0; /* just in case the protocol doesn't do this */
- pnp_dbg("the device '%s' has been disabled.", dev->dev.bus_id);
+ pnp_dbg("res: the device '%s' has been disabled.", dev->dev.bus_id);
return 0;
}
diff -Nru a/drivers/pnp/resource.c b/drivers/pnp/resource.c
--- a/drivers/pnp/resource.c Sun Mar 9 23:48:20 2003
+++ b/drivers/pnp/resource.c Sun Mar 9 23:48:20 2003
@@ -558,25 +558,25 @@
table->irq_resource[idx].name = NULL;
table->irq_resource[idx].start = -1;
table->irq_resource[idx].end = -1;
- table->irq_resource[idx].flags = 0;
+ table->irq_resource[idx].flags = IORESOURCE_AUTO;
}
for (idx = 0; idx < PNP_MAX_DMA; idx++) {
table->dma_resource[idx].name = NULL;
table->dma_resource[idx].start = -1;
table->dma_resource[idx].end = -1;
- table->dma_resource[idx].flags = 0;
+ table->dma_resource[idx].flags = IORESOURCE_AUTO;
}
for (idx = 0; idx < PNP_MAX_PORT; idx++) {
table->port_resource[idx].name = NULL;
table->port_resource[idx].start = 0;
table->port_resource[idx].end = 0;
- table->port_resource[idx].flags = 0;
+ table->port_resource[idx].flags = IORESOURCE_AUTO;
}
for (idx = 0; idx < PNP_MAX_MEM; idx++) {
table->mem_resource[idx].name = NULL;
table->mem_resource[idx].start = 0;
table->mem_resource[idx].end = 0;
- table->mem_resource[idx].flags = 0;
+ table->mem_resource[idx].flags = IORESOURCE_AUTO;
}
}
next reply other threads:[~2003-03-10 4:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-10 0:05 Adam Belay [this message]
2003-03-10 0:05 ` [PATCH] PnP Changes for 2.5.64 Adam Belay
2003-03-10 0:06 ` Adam Belay
2003-03-10 0:07 ` Adam Belay
2003-03-10 23:15 ` Ruslan U. Zakirov
2003-03-10 20:17 ` Adam Belay
2003-03-10 0:07 ` Adam Belay
2003-03-10 0:07 ` Adam Belay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030310000521.GA2118@neo.rr.com \
--to=ambx1@neo.rr.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox