Date: Sat, 22 Jan 2000 10:01:56 +0900 From: Tatsumi Hosokawa <hosokawa@itc.keio.ac.jp> To: imp@village.org Cc: mobile@FreeBSD.ORG Subject: Re: if_sn now works on -current (Re: One more serious problem with -current PCCARD support ) Message-ID: <867lh29awr.wl@ringo.FromTo.Cc> In-Reply-To: In your message of "Fri, 21 Jan 2000 10:41:06 -0700" <200001211741.KAA12408@harmony.village.org> References: <86embbrebw.wl@ringo.FromTo.Cc> <863drs1vdr.wl@ringo.FromTo.Cc> <86r9fisfe2.wl@ringo.FromTo.Cc> <86u2kesizg.wl@ringo.FromTo.Cc> <200001180742.AAA15379@harmony.village.org> <864sc820u4.wl@ringo.FromTo.Cc> <200001210801.BAA09842@harmony.village.org> <200001211741.KAA12408@harmony.village.org>
next in thread | previous in thread | raw e-mail | index | archive | help
At Fri, 21 Jan 2000 10:41:06 -0700, Warner Losh <imp@village.org> wrote: > In message <86embbrebw.wl@ringo.FromTo.Cc> Tatsumi Hosokawa writes: > : Oops. I rewrote it. > : + > : + for (j = 0; j < 3; j++) { > : + u_short w; > : > : + w = (u_short)sc->arpcom.ac_enaddr[j * 2] | > : + (((u_short)sc->arpcom.ac_enaddr[j * 2 + 1]) << 8); > : + outw(BASE + IAR_ADDR0_REG_W + j * 2, w); > : } > > This is much better. I think it may even be right. I'll have to > check it against the isa cards we have here at work to make sure. How about it? Index: if_sn.c =================================================================== RCS file: /home/ncvs/src/sys/dev/sn/if_sn.c,v retrieving revision 1.6 diff -u -r1.6 if_sn.c --- if_sn.c 2000/01/21 09:05:49 1.6 +++ if_sn.c 2000/01/22 00:50:23 @@ -190,13 +190,14 @@ i = inw(BASE + CONFIG_REG_W); printf(i & CR_AUI_SELECT ? "AUI" : "UTP"); - for (j = 0; j < 3; j++) { - u_short w; + if (sc->pccard_enaddr) + for (j = 0; j < 3; j++) { + u_short w; - w = (u_short)sc->arpcom.ac_enaddr[j * 2] | - (((u_short)sc->arpcom.ac_enaddr[j * 2 + 1]) << 8); - outw(BASE + IAR_ADDR0_REG_W + j * 2, w); - } + w = (u_short)sc->arpcom.ac_enaddr[j * 2] | + (((u_short)sc->arpcom.ac_enaddr[j * 2 + 1]) << 8); + outw(BASE + IAR_ADDR0_REG_W + j * 2, w); + } /* * Read the station address from the chip. The MAC address is bank 1, Index: if_sn_isa.c =================================================================== RCS file: /home/ncvs/src/sys/dev/sn/if_sn_isa.c,v retrieving revision 1.2 diff -u -r1.2 if_sn_isa.c --- if_sn_isa.c 1999/12/28 01:07:16 1.2 +++ if_sn_isa.c 2000/01/22 00:50:23 @@ -70,6 +70,13 @@ static int sn_isa_attach (device_t dev) { +#if 0 /* currently not tested */ + struct sn_softc *sc = device_get_softc(dev); +#endif + +#if 0 /* currently not tested */ + sc->pccard_enaddr = 0; +#endif return (0); } Index: if_sn_pccard.c =================================================================== RCS file: /home/ncvs/src/sys/dev/sn/if_sn_pccard.c,v retrieving revision 1.2 diff -u -r1.2 if_sn_pccard.c --- if_sn_pccard.c 2000/01/21 09:05:49 1.2 +++ if_sn_pccard.c 2000/01/22 00:50:24 @@ -72,11 +72,14 @@ u_char sum; u_char ether_addr[ETHER_ADDR_LEN]; + sc->pccard_enaddr = 0; pccard_get_ether(dev, ether_addr); for (i = 0, sum = 0; i < ETHER_ADDR_LEN; i++) sum |= ether_addr[i]; - if (sum) + if (sum) { + sc->pccard_enaddr = 1; bcopy(ether_addr, sc->arpcom.ac_enaddr, ETHER_ADDR_LEN); + } return (sn_attach(dev)); } Index: if_snvar.h =================================================================== RCS file: /home/ncvs/src/sys/dev/sn/if_snvar.h,v retrieving revision 1.1 diff -u -r1.1 if_snvar.h --- if_snvar.h 1999/12/22 08:44:13 1.1 +++ if_snvar.h 2000/01/22 00:50:24 @@ -47,6 +47,7 @@ int irq_rid; struct resource *port_res; int port_rid; + int pccard_enaddr; /* MAC address in pccard CIS tupple */ }; int sn_probe(device_t, int); -- --------------------------- Tatsumi Hosokawa hosokawa@itc.keio.ac.jp To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?867lh29awr.wl>