Subject: Re: panic wi at obio (Re: ppcoea-rennovation branch merge soon)
To: KIYOHARA Takashi <kiyohara@kk.iij4u.or.jp>
From: Michael Lorenz <macallan@netbsd.org>
List: port-macppc
Date: 10/22/2007 15:06:23
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On Oct 22, 2007, at 13:32, KIYOHARA Takashi wrote:

> My kernel panics in wi_obio_attach() since after this merge.  We need
> following changes.
>
>
> Index: if_wi_obio.c
> ===================================================================
> RCS file: /cvsroot/src/sys/arch/macppc/dev/if_wi_obio.c,v
> retrieving revision 1.14
> diff -u -r1.14 if_wi_obio.c
> --- if_wi_obio.c        17 Oct 2007 19:55:18 -0000      1.14
> +++ if_wi_obio.c        22 Oct 2007 17:13:55 -0000
> @@ -96,13 +96,14 @@
>         aprint_normal(" irq %d:", ca->ca_intr[0]);
>         intr_establish(ca->ca_intr[0], IST_LEVEL, IPL_NET, wi_intr,  
> sc);
>
> -       wisc->sc_iot = ca->ca_tag;
> +       sc->sc_tag = wisc->sc_iot = ca->ca_tag;
>         bus_space_map(sc->sc_tag, 0x8000000, 0x20000, 0, &sc->sc_bsh);
>         bus_space_subregion(sc->sc_tag, sc->sc_bsh, 0x40, 4, &sc- 
> >sc_fcr2h);
>         bus_space_subregion(sc->sc_tag, sc->sc_bsh, 0x6a, 16, &sc- 
> >sc_gpioh);
>         bus_space_subregion(sc->sc_tag, sc->sc_bsh, 0x58, 16, &sc- 
> >sc_extint_gpioh);
>
> -       if (bus_space_map(wisc->sc_iot, ca->ca_reg[0], ca->ca_reg 
> [1], 0, &wisc->
> sc_ioh)) {
> +       if (bus_space_map(wisc->sc_iot, ca->ca_reg[0] + ca- 
> >ca_baseaddr,
> +           ca->ca_reg[1], 0, &wisc->sc_ioh)) {
>                 printf(" can't map i/o space\n");
>                 return;
>         }

Thanks, I'll commit that.

> By the way, I think that you should use ca->ca_baseaddr is better than
> 0x8000000.  ;-)

We should get rid of all the hardcoded offsets if at all possible.
Since I don't have an AirPort card in my G4 - could you please post  
the relevant ofctl -p output?

have fun
Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQEVAwUBRxz0r8pnzkX8Yg2nAQIDiggAvNQwuxQXWyua5pqIoQLFDqUNQaY3Qzxd
7zQGmTw7difR/jIg12EpdXQq8vlBAb1kK3NlrHAcPVHsZV9Zu7y0HkBQ3KXfpL9v
RTCBWkxm2tZ/zsP2X/QP9QMYAg47YicAIb3xsPrdgwRNvhHP8e9+2lAeesyRLSrg
cFDOE3pilZks4ROYhyo5bwrSjC8AgYCWBjOnf605IAX6jjSoRk3y/CKBD/MgD5a5
vrkWb9J4vgSY/K6hTVY+2uRb4s8rRkIZaUr9cvrZxQogfRJTgN0yMzIoFudLfCIn
SWOVkIaYIUwPSlfAoyJL5N5WsQ/oepyrGb5F/i5Ycc7brSPLGNU0ew==
=ZcuU
-----END PGP SIGNATURE-----