Module Name:    src
Committed By:   jdolecek
Date:           Mon Apr 24 08:29:33 UTC 2017

Modified Files:
        src/sys/dev/ic [jdolecek-ncq]: ninjaata32.c ninjaata32var.h

Log Message:
adjust to interface changes - ata_queue is now dynamically allocated


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.28.1 src/sys/dev/ic/ninjaata32.c
cvs rdiff -u -r1.5 -r1.5.44.1 src/sys/dev/ic/ninjaata32var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/ninjaata32.c
diff -u src/sys/dev/ic/ninjaata32.c:1.18 src/sys/dev/ic/ninjaata32.c:1.18.28.1
--- src/sys/dev/ic/ninjaata32.c:1.18	Tue Jul 31 15:50:34 2012
+++ src/sys/dev/ic/ninjaata32.c	Mon Apr 24 08:29:33 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ninjaata32.c,v 1.18 2012/07/31 15:50:34 bouyer Exp $	*/
+/*	$NetBSD: ninjaata32.c,v 1.18.28.1 2017/04/24 08:29:33 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 ITOH Yasufumi.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ninjaata32.c,v 1.18 2012/07/31 15:50:34 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ninjaata32.c,v 1.18.28.1 2017/04/24 08:29:33 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -191,7 +191,7 @@ njata32_attach(struct njata32_softc *sc)
 	sc->sc_wdc_chanarray[0] = &sc->sc_ch[0].ch_ata_channel;
 	sc->sc_ch[0].ch_ata_channel.ch_channel = 0;
 	sc->sc_ch[0].ch_ata_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
-	sc->sc_ch[0].ch_ata_channel.ch_queue = &sc->sc_wdc_chqueue;
+	sc->sc_ch[0].ch_ata_channel.ch_queue = ata_queue_alloc(1);
 	sc->sc_wdcdev.wdc_maxdrives = 2; /* max number of drives per channel */
 
 	/* map ATA registers */
@@ -264,6 +264,8 @@ njata32_detach(struct njata32_softc *sc,
 		bus_dmamem_unmap(sc->sc_dmat, (void *)sc->sc_sgtpg,
 		    sizeof(struct njata32_dma_page));
 		bus_dmamem_free(sc->sc_dmat, &sc->sc_sgt_seg, sc->sc_sgt_nsegs);
+
+		ata_queue_free(sc->sc_ch[0].ch_ata_channel.ch_queue);
 	}
 
 	return 0;

Index: src/sys/dev/ic/ninjaata32var.h
diff -u src/sys/dev/ic/ninjaata32var.h:1.5 src/sys/dev/ic/ninjaata32var.h:1.5.44.1
--- src/sys/dev/ic/ninjaata32var.h:1.5	Mon Feb 21 02:32:00 2011
+++ src/sys/dev/ic/ninjaata32var.h	Mon Apr 24 08:29:33 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ninjaata32var.h,v 1.5 2011/02/21 02:32:00 itohy Exp $	*/
+/*	$NetBSD: ninjaata32var.h,v 1.5.44.1 2017/04/24 08:29:33 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 ITOH Yasufumi.
@@ -69,7 +69,6 @@ struct njata32_softc {
 	} sc_ch[NJATA32_NCHAN];
 
 	struct ata_channel	*sc_wdc_chanarray[NJATA32_NCHAN];
-	struct ata_queue	sc_wdc_chqueue;
 	struct wdc_regs		sc_wdc_regs;
 #define NJATA32_REGT(sc)	(sc)->sc_wdc_regs.cmd_iot
 #define NJATA32_REGH(sc)	(sc)->sc_wdc_regs.cmd_baseioh

Reply via email to