Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Instead of calling wddone() directly, set a (*drv_do...
details: https://anonhg.NetBSD.org/src/rev/d06462d15a33
branches: trunk
changeset: 556361:d06462d15a33
user: thorpej <thorpej%NetBSD.org@localhost>
date: Sun Dec 14 05:33:29 2003 +0000
description:
Instead of calling wddone() directly, set a (*drv_done)() callback in
the ata_drive_datas structure and invoke that.
diffstat:
sys/dev/ata/ata_wdc.c | 12 ++++++------
sys/dev/ata/atavar.h | 5 ++++-
sys/dev/ata/wd.c | 7 ++++---
sys/dev/usb/umass_isdata.c | 8 ++++----
4 files changed, 18 insertions(+), 14 deletions(-)
diffs (123 lines):
diff -r 5fe75dd7283f -r d06462d15a33 sys/dev/ata/ata_wdc.c
--- a/sys/dev/ata/ata_wdc.c Sun Dec 14 05:33:22 2003 +0000
+++ b/sys/dev/ata/ata_wdc.c Sun Dec 14 05:33:29 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ata_wdc.c,v 1.45 2003/12/14 02:48:36 thorpej Exp $ */
+/* $NetBSD: ata_wdc.c,v 1.46 2003/12/14 05:33:29 thorpej Exp $ */
/*
* Copyright (c) 1998, 2001, 2003 Manuel Bouyer.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.45 2003/12/14 02:48:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.46 2003/12/14 05:33:29 thorpej Exp $");
#ifndef WDCDEBUG
#define WDCDEBUG
@@ -748,8 +748,8 @@
ata_bio->flags |= ATA_ITSDONE;
ata_bio->error = ERR_NODEV;
ata_bio->r_error = WDCE_ABRT;
- WDCDEBUG_PRINT(("wdc_ata_done: wddone\n"), DEBUG_XFERS);
- wddone(chp->ch_drive[drive].drv_softc);
+ WDCDEBUG_PRINT(("wdc_ata_done: drv_done\n"), DEBUG_XFERS);
+ (*chp->ch_drive[drive].drv_done)(chp->ch_drive[drive].drv_softc);
}
static void
@@ -772,8 +772,8 @@
wdc_free_xfer(chp, xfer);
ata_bio->flags |= ATA_ITSDONE;
- WDCDEBUG_PRINT(("wdc_ata_done: wddone\n"), DEBUG_XFERS);
- wddone(chp->ch_drive[drive].drv_softc);
+ WDCDEBUG_PRINT(("wdc_ata_done: drv_done\n"), DEBUG_XFERS);
+ (*chp->ch_drive[drive].drv_done)(chp->ch_drive[drive].drv_softc);
WDCDEBUG_PRINT(("wdcstart from wdc_ata_done, flags 0x%x\n",
chp->ch_flags), DEBUG_XFERS);
wdcstart(chp);
diff -r 5fe75dd7283f -r d06462d15a33 sys/dev/ata/atavar.h
--- a/sys/dev/ata/atavar.h Sun Dec 14 05:33:22 2003 +0000
+++ b/sys/dev/ata/atavar.h Sun Dec 14 05:33:29 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atavar.h,v 1.34 2003/12/14 05:14:39 thorpej Exp $ */
+/* $NetBSD: atavar.h,v 1.35 2003/12/14 05:33:29 thorpej Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -85,6 +85,9 @@
#define NERRS_MAX 4
#define NXFER 4000
+ /* Callbacks into the drive's driver. */
+ void (*drv_done)(void *); /* transfer is done */
+
struct device *drv_softc; /* ATA drives softc, if any */
void *chnl_softc; /* channel softc */
};
diff -r 5fe75dd7283f -r d06462d15a33 sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c Sun Dec 14 05:33:22 2003 +0000
+++ b/sys/dev/ata/wd.c Sun Dec 14 05:33:29 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wd.c,v 1.269 2003/12/04 13:57:30 keihan Exp $ */
+/* $NetBSD: wd.c,v 1.270 2003/12/14 05:33:29 thorpej Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.269 2003/12/04 13:57:30 keihan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.270 2003/12/14 05:33:29 thorpej Exp $");
#ifndef WDCDEBUG
#define WDCDEBUG
@@ -289,7 +289,8 @@
wd->atabus = adev->adev_bustype;
wd->openings = adev->adev_openings;
wd->drvp = adev->adev_drv_data;
- /* give back our softc to our caller */
+
+ wd->drvp->drv_done = wddone;
wd->drvp->drv_softc = &wd->sc_dev;
aprint_naive("\n");
diff -r 5fe75dd7283f -r d06462d15a33 sys/dev/usb/umass_isdata.c
--- a/sys/dev/usb/umass_isdata.c Sun Dec 14 05:33:22 2003 +0000
+++ b/sys/dev/usb/umass_isdata.c Sun Dec 14 05:33:29 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umass_isdata.c,v 1.6 2003/10/08 10:58:13 bouyer Exp $ */
+/* $NetBSD: umass_isdata.c,v 1.7 2003/12/14 05:33:29 thorpej Exp $ */
/*
* TODO:
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass_isdata.c,v 1.6 2003/10/08 10:58:13 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass_isdata.c,v 1.7 2003/12/14 05:33:29 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -260,7 +260,7 @@
DPRINTF(("%s: wakeup %p\n", __func__, ata_bio));
wakeup(ata_bio);
} else {
- wddone(scbus->sc_drv_data.drv_softc);
+ (*scbus->sc_drv_data.drv_done)(scbus->sc_drv_data.drv_softc);
}
splx(s);
}
@@ -495,7 +495,7 @@
ata_bio->flags |= ATA_ITSDONE;
ata_bio->error = ERR_NODEV;
ata_bio->r_error = WDCE_ABRT;
- wddone(scbus->sc_drv_data.drv_softc);
+ (*scbus->sc_drv_data.drv_done)(scbus->sc_drv_data.drv_softc);
}
int
Home |
Main Index |
Thread Index |
Old Index