summaryrefslogtreecommitdiffstats
path: root/sys/pci/ide_pci.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-01-17 05:46:25 +0000
committerbde <bde@FreeBSD.org>1999-01-17 05:46:25 +0000
commitdbb879887a22e434e5cf1a725ed4225cc87d67bd (patch)
tree4876f56b000cd56ffb8972e67767fd0b320ff451 /sys/pci/ide_pci.c
parent66115cf2aaeeaf0faf0a598f154171fccae928d9 (diff)
downloadFreeBSD-src-dbb879887a22e434e5cf1a725ed4225cc87d67bd.zip
FreeBSD-src-dbb879887a22e434e5cf1a725ed4225cc87d67bd.tar.gz
Pass the unit number to the DMA cookie lookup routine and use it
to look up cookies properly, at least for standard controllers. Cookies are used so that we don't have to pass around lots of args. All of the dmainit functions use the unit number so it is essential that we pass them a cookie with the correct unit number. This may break working configurations if there are bugs in the dmainit functions like the ones I just fixed for VIA chipsets. Broken in: rev 1.4 of ide_pci.c and rev.1.139 of wd.c.
Diffstat (limited to 'sys/pci/ide_pci.c')
-rw-r--r--sys/pci/ide_pci.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/pci/ide_pci.c b/sys/pci/ide_pci.c
index 099aed4..39c53a5 100644
--- a/sys/pci/ide_pci.c
+++ b/sys/pci/ide_pci.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ide_pci.c,v 1.26 1999/01/16 19:48:01 bde Exp $
+ * $Id: ide_pci.c,v 1.27 1999/01/17 05:18:54 bde Exp $
*/
#include "pci.h"
@@ -159,7 +159,7 @@ mkcookie(int iobase_wd,
static void ide_pci_attach(pcici_t tag, int unit);
-static void *ide_pci_candma(int, int);
+static void *ide_pci_candma(int, int, int);
static int ide_pci_dmainit(void *,
struct wdparams *,
int (*)(int, void *),
@@ -1449,16 +1449,17 @@ static struct pci_device ide_pci_device = {
DATA_SET(pcidevice_set, ide_pci_device);
/*
- * Return a cookie if we can do DMA on the specified (iobase_wd, ctlr).
+ * Return a cookie if we may be able to do DMA on the specified
+ * (iobase_wd, ctlr, unit).
*/
static void *
-ide_pci_candma(int iobase_wd, int ctlr)
+ide_pci_candma(int iobase_wd, int ctlr, int unit)
{
struct ide_pci_cookie *cp;
cp = softc.cookies.lh_first;
while(cp) {
- if (cp->ctlr == ctlr &&
+ if (cp->ctlr == ctlr && cp->unit == unit &&
((iobase_wd == 0) || (cp->iobase_wd == iobase_wd)))
break;
cp = cp->le.le_next;
OpenPOWER on IntegriCloud