Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/jdolecek-ncq]: src/sys/dev add detach code for umass_isdata; compile-tes...
details: https://anonhg.NetBSD.org/src/rev/c7f31bcb9ff7
branches: jdolecek-ncq
changeset: 352693:c7f31bcb9ff7
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Sat Jun 24 00:23:39 2017 +0000
description:
add detach code for umass_isdata; compile-tested only
diffstat:
sys/dev/ata/TODO.ncq | 1 -
sys/dev/usb/umass.c | 19 +++++++++++++++++--
sys/dev/usb/umass_isdata.c | 14 ++++++++++++--
sys/dev/usb/umass_isdata.h | 3 ++-
4 files changed, 31 insertions(+), 6 deletions(-)
diffs (100 lines):
diff -r f7c55c6c08ec -r c7f31bcb9ff7 sys/dev/ata/TODO.ncq
--- a/sys/dev/ata/TODO.ncq Sat Jun 24 00:00:10 2017 +0000
+++ b/sys/dev/ata/TODO.ncq Sat Jun 24 00:23:39 2017 +0000
@@ -7,7 +7,6 @@
siisata - fix all new XXX and unmergable bits
test wd* at umass?, confirm the ata_channel kludge works
-+ add detach code (channel detach, free queue)
test device error handling (currently appears to not work well, at least in NCQ case)
diff -r f7c55c6c08ec -r c7f31bcb9ff7 sys/dev/usb/umass.c
--- a/sys/dev/usb/umass.c Sat Jun 24 00:00:10 2017 +0000
+++ b/sys/dev/usb/umass.c Sat Jun 24 00:23:39 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umass.c,v 1.157 2016/11/21 08:27:30 skrll Exp $ */
+/* $NetBSD: umass.c,v 1.157.4.1 2017/06/24 00:23:39 jdolecek Exp $ */
/*
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.157 2016/11/21 08:27:30 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.157.4.1 2017/06/24 00:23:39 jdolecek Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -819,6 +819,21 @@
if (scbus != NULL) {
if (scbus->sc_child != NULL)
rv = config_detach(scbus->sc_child, flags);
+
+ switch (sc->sc_cmd) {
+ case UMASS_CPROTO_ISD_ATA:
+#if NWD > 0
+ umass_isdata_detach(sc);
+#else
+ aprint_error_dev(self, "isdata not configured\n");
+#endif
+ break;
+
+ default:
+ /* nothing to do */
+ break;
+ }
+
free(scbus, M_DEVBUF);
sc->bus = NULL;
}
diff -r f7c55c6c08ec -r c7f31bcb9ff7 sys/dev/usb/umass_isdata.c
--- a/sys/dev/usb/umass_isdata.c Sat Jun 24 00:00:10 2017 +0000
+++ b/sys/dev/usb/umass_isdata.c Sat Jun 24 00:23:39 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umass_isdata.c,v 1.33.4.5 2017/06/21 19:38:43 jdolecek Exp $ */
+/* $NetBSD: umass_isdata.c,v 1.33.4.6 2017/06/24 00:23:39 jdolecek Exp $ */
/*
* TODO:
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass_isdata.c,v 1.33.4.5 2017/06/21 19:38:43 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass_isdata.c,v 1.33.4.6 2017/06/24 00:23:39 jdolecek Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -233,6 +233,16 @@
return 0;
}
+void
+umass_isdata_detach(struct umass_softc *sc)
+{
+ struct uisdata_softc *scbus = (struct uisdata_softc *)sc->bus;
+
+ ata_queue_free(scbus->sc_channel.ch_queue);
+ scbus->sc_channel.ch_queue = NULL;
+
+ ata_channel_destroy(&scbus->sc_channel);
+}
void
uisdata_bio_cb(struct umass_softc *sc, void *priv, int residue, int status)
diff -r f7c55c6c08ec -r c7f31bcb9ff7 sys/dev/usb/umass_isdata.h
--- a/sys/dev/usb/umass_isdata.h Sat Jun 24 00:00:10 2017 +0000
+++ b/sys/dev/usb/umass_isdata.h Sat Jun 24 00:23:39 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umass_isdata.h,v 1.3 2016/04/23 10:15:32 skrll Exp $ */
+/* $NetBSD: umass_isdata.h,v 1.3.6.1 2017/06/24 00:23:39 jdolecek Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,3 +31,4 @@
*/
int umass_isdata_attach(struct umass_softc *);
+void umass_isdata_detach(struct umass_softc *);
Home |
Main Index |
Thread Index |
Old Index