Use device_private() more.
This commit is contained in:
parent
6ecb4ef75f
commit
516792c317
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: bba.c,v 1.28 2006/03/30 18:14:37 thorpej Exp $ */
|
/* $NetBSD: bba.c,v 1.29 2006/03/30 18:16:20 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||||
@ -36,7 +36,7 @@
|
|||||||
/* maxine/alpha baseboard audio (bba) */
|
/* maxine/alpha baseboard audio (bba) */
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: bba.c,v 1.28 2006/03/30 18:14:37 thorpej Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: bba.c,v 1.29 2006/03/30 18:16:20 thorpej Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
@ -216,13 +216,14 @@ bba_attach(struct device *parent, struct device *self, void *aux)
|
|||||||
struct ioasicdev_attach_args *ia;
|
struct ioasicdev_attach_args *ia;
|
||||||
struct bba_softc *sc;
|
struct bba_softc *sc;
|
||||||
struct am7930_softc *asc;
|
struct am7930_softc *asc;
|
||||||
|
struct ioasic_softc *iosc = device_private(parent);
|
||||||
|
|
||||||
ia = aux;
|
ia = aux;
|
||||||
sc = device_private(self);
|
sc = device_private(self);
|
||||||
asc = &sc->sc_am7930;
|
asc = &sc->sc_am7930;
|
||||||
sc->sc_bst = ((struct ioasic_softc *)parent)->sc_bst;
|
sc->sc_bst = iosc->sc_bst;
|
||||||
sc->sc_bsh = ((struct ioasic_softc *)parent)->sc_bsh;
|
sc->sc_bsh = iosc->sc_bsh;
|
||||||
sc->sc_dmat = ((struct ioasic_softc *)parent)->sc_dmat;
|
sc->sc_dmat = iosc->sc_dmat;
|
||||||
|
|
||||||
/* get the bus space handle for codec */
|
/* get the bus space handle for codec */
|
||||||
if (bus_space_subregion(sc->sc_bst, sc->sc_bsh,
|
if (bus_space_subregion(sc->sc_bst, sc->sc_bsh,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: if_le_ioasic.c,v 1.25 2006/03/30 16:18:49 thorpej Exp $ */
|
/* $NetBSD: if_le_ioasic.c,v 1.26 2006/03/30 18:18:39 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1996 Carnegie-Mellon University.
|
* Copyright (c) 1996 Carnegie-Mellon University.
|
||||||
@ -32,7 +32,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_le_ioasic.c,v 1.25 2006/03/30 16:18:49 thorpej Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_le_ioasic.c,v 1.26 2006/03/30 18:18:39 thorpej Exp $");
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
|
||||||
@ -110,6 +110,7 @@ le_ioasic_attach(parent, self, aux)
|
|||||||
struct le_ioasic_softc *sc = device_private(self);
|
struct le_ioasic_softc *sc = device_private(self);
|
||||||
struct ioasicdev_attach_args *d = aux;
|
struct ioasicdev_attach_args *d = aux;
|
||||||
struct lance_softc *le = &sc->sc_am7990.lsc;
|
struct lance_softc *le = &sc->sc_am7990.lsc;
|
||||||
|
struct ioasic_softc *iosc = device_private(parent);
|
||||||
bus_space_tag_t ioasic_bst;
|
bus_space_tag_t ioasic_bst;
|
||||||
bus_space_handle_t ioasic_bsh;
|
bus_space_handle_t ioasic_bsh;
|
||||||
bus_dma_tag_t dmat;
|
bus_dma_tag_t dmat;
|
||||||
@ -119,9 +120,9 @@ le_ioasic_attach(parent, self, aux)
|
|||||||
int rseg;
|
int rseg;
|
||||||
caddr_t le_iomem;
|
caddr_t le_iomem;
|
||||||
|
|
||||||
ioasic_bst = ((struct ioasic_softc *)parent)->sc_bst;
|
ioasic_bst = iosc->sc_bst;
|
||||||
ioasic_bsh = ((struct ioasic_softc *)parent)->sc_bsh;
|
ioasic_bsh = iosc->sc_bsh;
|
||||||
dmat = sc->sc_dmat = ((struct ioasic_softc *)parent)->sc_dmat;
|
dmat = sc->sc_dmat = iosc->sc_dmat;
|
||||||
/*
|
/*
|
||||||
* Allocate a DMA area for the chip.
|
* Allocate a DMA area for the chip.
|
||||||
*/
|
*/
|
||||||
@ -168,8 +169,7 @@ le_ioasic_attach(parent, self, aux)
|
|||||||
le->sc_zerobuf = le_ioasic_zerobuf_gap16;
|
le->sc_zerobuf = le_ioasic_zerobuf_gap16;
|
||||||
|
|
||||||
dec_le_common_attach(&sc->sc_am7990,
|
dec_le_common_attach(&sc->sc_am7990,
|
||||||
(u_char *)((struct ioasic_softc *)parent)->sc_base
|
(u_char *)iosc->sc_base + IOASIC_SLOT_2_START);
|
||||||
+ IOASIC_SLOT_2_START);
|
|
||||||
|
|
||||||
ioasic_intr_establish(parent, d->iada_cookie, TC_IPL_NET,
|
ioasic_intr_establish(parent, d->iada_cookie, TC_IPL_NET,
|
||||||
am7990_intr, sc);
|
am7990_intr, sc);
|
||||||
|
Loading…
Reference in New Issue
Block a user