Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/jdolecek-ncq]: src/sys change wdc_init_shadow_regs() to accept only stru...
details: https://anonhg.NetBSD.org/src/rev/4c5ee5f599a0
branches: jdolecek-ncq
changeset: 352786:4c5ee5f599a0
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Wed Sep 27 07:19:33 2017 +0000
description:
change wdc_init_shadow_regs() to accept only struct wdc_regs, it doesn't
touch anything else
factor out the probe-only struct ata_channel initialization to wdcprobe(), to
reduce duplication of logic in individual drivers, and to actually work now
that more init is needed beyond the memset()
diffstat:
sys/arch/acorn32/eb7500atx/rside.c | 6 +++---
sys/arch/acorn32/mainbus/wdc_pioc.c | 17 +++++------------
sys/arch/acorn32/podulebus/icside.c | 6 +++---
sys/arch/acorn32/podulebus/rapide.c | 6 +++---
sys/arch/acorn32/podulebus/simide.c | 6 +++---
sys/arch/amiga/dev/efa.c | 6 +++---
sys/arch/amiga/dev/wdc_acafh.c | 6 +++---
sys/arch/amiga/dev/wdc_amiga.c | 6 +++---
sys/arch/amiga/dev/wdc_buddha.c | 4 ++--
sys/arch/amiga/dev/wdc_xsurf.c | 4 ++--
sys/arch/atari/dev/wdc_mb.c | 12 +++++-------
sys/arch/i386/pnpbios/pciide_pnpbios.c | 6 +++---
sys/arch/landisk/dev/wdc_obio.c | 17 +++++------------
sys/arch/mac68k/obio/wdc_obio.c | 17 +++++------------
sys/arch/macppc/dev/kauai.c | 6 +++---
sys/arch/macppc/dev/wdc_obio.c | 6 +++---
sys/arch/playstation2/dev/wdc_spd.c | 26 +++++++++-----------------
sys/arch/prep/pnpbus/wdc_pnpbus.c | 6 +++---
sys/dev/ic/mvsata.c | 6 +++---
sys/dev/ic/ninjaata32.c | 6 +++---
sys/dev/ic/wdc.c | 33 +++++++++++++++++++++++----------
sys/dev/ic/wdcvar.h | 6 +++---
sys/dev/isa/wdc_isa.c | 21 +++++----------------
sys/dev/pci/pciide_common.c | 12 ++++++------
sys/dev/pci/pdcsata.c | 6 +++---
sys/dev/pci/satalink.c | 6 +++---
sys/dev/pci/svwsata.c | 6 +++---
sys/dev/pci/viaide.c | 6 +++---
sys/dev/pcmcia/wdc_pcmcia.c | 6 +++---
29 files changed, 124 insertions(+), 153 deletions(-)
diffs (truncated from 1071 to 300 lines):
diff -r 832db103e3ab -r 4c5ee5f599a0 sys/arch/acorn32/eb7500atx/rside.c
--- a/sys/arch/acorn32/eb7500atx/rside.c Tue Sep 26 22:13:08 2017 +0000
+++ b/sys/arch/acorn32/eb7500atx/rside.c Wed Sep 27 07:19:33 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rside.c,v 1.14.28.1 2017/04/24 08:48:45 jdolecek Exp $ */
+/* $NetBSD: rside.c,v 1.14.28.2 2017/09/27 07:19:33 jdolecek Exp $ */
/*
* Copyright (c) 2004 Christopher Gilbert
@@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rside.c,v 1.14.28.1 2017/04/24 08:48:45 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rside.c,v 1.14.28.2 2017/09/27 07:19:33 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -217,7 +217,7 @@
continue;
}
}
- wdc_init_shadow_regs(cp);
+ wdc_init_shadow_regs(wdr);
if (bus_space_map(wdr->ctl_iot,
rside_info[channel].aux_register, 0x4, 0, &wdr->ctl_ioh))
diff -r 832db103e3ab -r 4c5ee5f599a0 sys/arch/acorn32/mainbus/wdc_pioc.c
--- a/sys/arch/acorn32/mainbus/wdc_pioc.c Tue Sep 26 22:13:08 2017 +0000
+++ b/sys/arch/acorn32/mainbus/wdc_pioc.c Wed Sep 27 07:19:33 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_pioc.c,v 1.28.28.1 2017/09/26 22:13:08 jdolecek Exp $ */
+/* $NetBSD: wdc_pioc.c,v 1.28.28.2 2017/09/27 07:19:33 jdolecek Exp $ */
/*
* Copyright (c) 1997-1998 Mark Brinicombe.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_pioc.c,v 1.28.28.1 2017/09/26 22:13:08 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_pioc.c,v 1.28.28.2 2017/09/27 07:19:33 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -83,8 +83,6 @@
wdc_pioc_probe(device_t parent, cfdata_t cf, void *aux)
{
struct pioc_attach_args *pa = aux;
- struct ata_channel ch;
- struct wdc_softc wdc;
struct wdc_regs wdr;
int res, i;
u_int iobase;
@@ -96,11 +94,6 @@
if (pa->pa_offset == PIOCCF_OFFSET_DEFAULT)
return(0);
- memset(&wdc, 0, sizeof(wdc));
- memset(&ch, 0, sizeof(ch));
- ch.ch_atac = &wdc.sc_atac;
- wdc.regs = &wdr;
-
iobase = pa->pa_iobase + pa->pa_offset;
wdr.cmd_iot = pa->pa_iot;
wdr.ctl_iot = pa->pa_iot;
@@ -116,7 +109,7 @@
return 0;
}
}
- wdc_init_shadow_regs(&ch);
+ wdc_init_shadow_regs(&wdr);
if (bus_space_map(wdr.ctl_iot, iobase + WDC_PIOC_AUXREG_OFFSET,
WDC_PIOC_AUXREG_NPORTS, 0, &wdr.ctl_ioh)) {
@@ -125,7 +118,7 @@
return(0);
}
- res = wdcprobe(&ch);
+ res = wdcprobe(&wdr);
bus_space_unmap(wdr.ctl_iot, wdr.ctl_ioh, WDC_PIOC_AUXREG_NPORTS);
bus_space_unmap(wdr.cmd_iot, wdr.cmd_baseioh, WDC_PIOC_REG_NPORTS);
@@ -188,7 +181,7 @@
sc->sc_channel.ch_channel = 0;
sc->sc_channel.ch_queue = ata_queue_alloc(1);
- wdc_init_shadow_regs(&sc->sc_channel);
+ wdc_init_shadow_regs(wdr);
wdcattach(&sc->sc_channel);
}
diff -r 832db103e3ab -r 4c5ee5f599a0 sys/arch/acorn32/podulebus/icside.c
--- a/sys/arch/acorn32/podulebus/icside.c Tue Sep 26 22:13:08 2017 +0000
+++ b/sys/arch/acorn32/podulebus/icside.c Wed Sep 27 07:19:33 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: icside.c,v 1.32.28.1 2017/04/24 08:48:45 jdolecek Exp $ */
+/* $NetBSD: icside.c,v 1.32.28.2 2017/09/27 07:19:33 jdolecek Exp $ */
/*
* Copyright (c) 1997-1998 Mark Brinicombe
@@ -42,7 +42,7 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: icside.c,v 1.32.28.1 2017/04/24 08:48:45 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: icside.c,v 1.32.28.2 2017/09/27 07:19:33 jdolecek Exp $");
#include <sys/systm.h>
#include <sys/conf.h>
@@ -285,7 +285,7 @@
i, i == 0 ? 4 : 1, &wdr->cmd_iohs[i]) != 0)
return;
}
- wdc_init_shadow_regs(cp);
+ wdc_init_shadow_regs(wdr);
if (bus_space_map(iot, iobase + ide->auxregs[channel],
AUX_REGISTER_SPACE, 0, &wdr->ctl_ioh))
return;
diff -r 832db103e3ab -r 4c5ee5f599a0 sys/arch/acorn32/podulebus/rapide.c
--- a/sys/arch/acorn32/podulebus/rapide.c Tue Sep 26 22:13:08 2017 +0000
+++ b/sys/arch/acorn32/podulebus/rapide.c Wed Sep 27 07:19:33 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rapide.c,v 1.30.28.1 2017/04/24 08:48:45 jdolecek Exp $ */
+/* $NetBSD: rapide.c,v 1.30.28.2 2017/09/27 07:19:33 jdolecek Exp $ */
/*
* Copyright (c) 1997-1998 Mark Brinicombe
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rapide.c,v 1.30.28.1 2017/04/24 08:48:45 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rapide.c,v 1.30.28.2 2017/09/27 07:19:33 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -274,7 +274,7 @@
continue;
}
}
- wdc_init_shadow_regs(cp);
+ wdc_init_shadow_regs(wdr);
if (bus_space_map(iot, iobase +
rapide_info[channel].aux_register, 4, 0, &wdr->ctl_ioh)) {
bus_space_unmap(iot, wdr->cmd_baseioh,
diff -r 832db103e3ab -r 4c5ee5f599a0 sys/arch/acorn32/podulebus/simide.c
--- a/sys/arch/acorn32/podulebus/simide.c Tue Sep 26 22:13:08 2017 +0000
+++ b/sys/arch/acorn32/podulebus/simide.c Wed Sep 27 07:19:33 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: simide.c,v 1.29.28.1 2017/04/24 08:48:45 jdolecek Exp $ */
+/* $NetBSD: simide.c,v 1.29.28.2 2017/09/27 07:19:33 jdolecek Exp $ */
/*
* Copyright (c) 1997-1998 Mark Brinicombe
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: simide.c,v 1.29.28.1 2017/04/24 08:48:45 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: simide.c,v 1.29.28.2 2017/09/27 07:19:33 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -272,7 +272,7 @@
continue;
}
}
- wdc_init_shadow_regs(cp);
+ wdc_init_shadow_regs(wdr);
if (bus_space_map(wdr->ctl_iot, iobase +
simide_info[channel].aux_register, 4, 0, &wdr->ctl_ioh)) {
bus_space_unmap(wdr->cmd_iot, wdr->cmd_baseioh,
diff -r 832db103e3ab -r 4c5ee5f599a0 sys/arch/amiga/dev/efa.c
--- a/sys/arch/amiga/dev/efa.c Tue Sep 26 22:13:08 2017 +0000
+++ b/sys/arch/amiga/dev/efa.c Wed Sep 27 07:19:33 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efa.c,v 1.12.18.1 2017/04/24 08:48:45 jdolecek Exp $ */
+/* $NetBSD: efa.c,v 1.12.18.2 2017/09/27 07:19:33 jdolecek Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -211,7 +211,7 @@
else
efa_select_regset(sc, chnum, 3);
- wdc_init_shadow_regs(&sc->sc_ports[chnum].chan);
+ wdc_init_shadow_regs(CHAN_TO_WDC_REGS(&sc->sc_ports[chnum].chan));
wdcattach(&sc->sc_ports[chnum].chan);
@@ -502,7 +502,7 @@
/* Change FastATA register set. */
efa_select_regset(sc, chnum, mode);
/* re-init shadow regs */
- wdc_init_shadow_regs(&sc->sc_ports[chnum].chan);
+ wdc_init_shadow_regs(CHAN_TO_WDC_REGS(&sc->sc_ports[chnum].chan));
splx(ipl);
}
diff -r 832db103e3ab -r 4c5ee5f599a0 sys/arch/amiga/dev/wdc_acafh.c
--- a/sys/arch/amiga/dev/wdc_acafh.c Tue Sep 26 22:13:08 2017 +0000
+++ b/sys/arch/amiga/dev/wdc_acafh.c Wed Sep 27 07:19:33 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_acafh.c,v 1.3.24.1 2017/04/24 08:48:45 jdolecek Exp $ */
+/* $NetBSD: wdc_acafh.c,v 1.3.24.2 2017/09/27 07:19:33 jdolecek Exp $ */
/*-
* Copyright (c) 2000, 2003, 2013 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_acafh.c,v 1.3.24.1 2017/04/24 08:48:45 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_acafh.c,v 1.3.24.2 2017/09/27 07:19:33 jdolecek Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -155,7 +155,7 @@
wdc_acafh_map_channel(sc, chnum);
- wdc_init_shadow_regs(&sc->sc_slots[chnum].channel);
+ wdc_init_shadow_regs(CHAN_TO_WDC_REGS(&sc->sc_slots[chnum].channel));
wdcattach(&sc->sc_slots[chnum].channel);
#ifdef WDC_ACAFH_DEBUG
diff -r 832db103e3ab -r 4c5ee5f599a0 sys/arch/amiga/dev/wdc_amiga.c
--- a/sys/arch/amiga/dev/wdc_amiga.c Tue Sep 26 22:13:08 2017 +0000
+++ b/sys/arch/amiga/dev/wdc_amiga.c Wed Sep 27 07:19:33 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_amiga.c,v 1.38.6.1 2017/09/26 22:13:08 jdolecek Exp $ */
+/* $NetBSD: wdc_amiga.c,v 1.38.6.2 2017/09/27 07:19:33 jdolecek Exp $ */
/*-
* Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_amiga.c,v 1.38.6.1 2017/09/26 22:13:08 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_amiga.c,v 1.38.6.2 2017/09/27 07:19:33 jdolecek Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -137,7 +137,7 @@
sc->sc_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
sc->sc_channel.ch_queue = ata_queue_alloc(1);
- wdc_init_shadow_regs(&sc->sc_channel);
+ wdc_init_shadow_regs(wdr);
sc->sc_isr.isr_intr = wdc_amiga_intr;
sc->sc_isr.isr_arg = sc;
diff -r 832db103e3ab -r 4c5ee5f599a0 sys/arch/amiga/dev/wdc_buddha.c
--- a/sys/arch/amiga/dev/wdc_buddha.c Tue Sep 26 22:13:08 2017 +0000
+++ b/sys/arch/amiga/dev/wdc_buddha.c Wed Sep 27 07:19:33 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_buddha.c,v 1.8.28.1 2017/04/24 08:48:45 jdolecek Exp $ */
+/* $NetBSD: wdc_buddha.c,v 1.8.28.2 2017/09/27 07:19:33 jdolecek Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -173,7 +173,7 @@
}
}
- wdc_init_shadow_regs(cp);
+ wdc_init_shadow_regs(wdr);
wdcattach(cp);
}
diff -r 832db103e3ab -r 4c5ee5f599a0 sys/arch/amiga/dev/wdc_xsurf.c
--- a/sys/arch/amiga/dev/wdc_xsurf.c Tue Sep 26 22:13:08 2017 +0000
+++ b/sys/arch/amiga/dev/wdc_xsurf.c Wed Sep 27 07:19:33 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_xsurf.c,v 1.2.30.2 2017/09/26 21:06:24 jdolecek Exp $ */
+/* $NetBSD: wdc_xsurf.c,v 1.2.30.3 2017/09/27 07:19:33 jdolecek Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -166,7 +166,7 @@
wdc_xsurf_map_channel(sc, chnum);
- wdc_init_shadow_regs(&sc->sc_ports[chnum].channel);
+ wdc_init_shadow_regs(CHAN_TO_WDC_REGS(&sc->sc_ports[chnum].channel));
wdcattach(&sc->sc_ports[chnum].channel);
#ifdef WDC_XSURF_DEBUG
diff -r 832db103e3ab -r 4c5ee5f599a0 sys/arch/atari/dev/wdc_mb.c
--- a/sys/arch/atari/dev/wdc_mb.c Tue Sep 26 22:13:08 2017 +0000
+++ b/sys/arch/atari/dev/wdc_mb.c Wed Sep 27 07:19:33 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_mb.c,v 1.38.28.1 2017/04/24 08:48:45 jdolecek Exp $ */
+/* $NetBSD: wdc_mb.c,v 1.38.28.2 2017/09/27 07:19:33 jdolecek Exp $ */
/*-
* Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
Home |
Main Index |
Thread Index |
Old Index