Date: Mon, 1 Oct 2001 19:11:51 +0400 From: Nikolai Saoukh <nms+tokenring@otdel-1.org> To: julien@mail.iside.net Cc: freebsd-tokenring@freebsd.org Subject: Re: HELP needed with Olicom 3540 and 4.3 Message-ID: <20011001191151.A36856@otdel-1.org> In-Reply-To: <web-3902731@mail.iside.net> References: <web-3902731@mail.iside.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 26, 2001 at 01:22:20PM +0200, julien@mail.iside.net wrote: > I'm currently trying to use an Olicom 3540 in a compaq proliant dl360, with > 4.3-RC2 . My kernel is properly compiled ( I believe ), with "pseudo-device > token" and "device oltr0", and the card is correctly detected at bootup > time. > > Problems start when I try to configure the card : > ifconfig oltr0 inet xxx.xxx.xxx.xxx > oltr0: unknown open error (4) > oltr0: spurious interrupt > oltr0: not multicast capable, IPv6 not enabled You need the following patch (it already commited to -current, but not to -stable). Apply it in /usr/src/sys/contrib/dev/oltr directory. --- if_oltr.c Tue Oct 10 04:47:12 2000 +++ if_oltr.c.new Mon Oct 23 20:49:53 2000 @@ -289,7 +289,7 @@ oltr_pci_attach(device_t dev) { int i, s, rc = 0, rid, - scratch_size, work_size; + scratch_size; int media = IFM_TOKEN|IFM_TOK_UTP16; u_long command; char PCIConfigHeader[64]; @@ -339,26 +339,6 @@ goto config_failed; } - switch(sc->config.type) { - case TRLLD_ADAPTER_PCI4: /* OC-3139 */ - work_size = 32 * 1024; - break; - case TRLLD_ADAPTER_PCI7: /* OC-3540 */ - work_size = 256; - break; - default: - work_size = 0; - } - - if (work_size) { - if ((sc->work_memory = malloc(work_size, M_DEVBUF, M_NOWAIT)) == NULL) { - device_printf(dev, "failed to allocate work memory.\n"); - } else { - TRlldAddMemory(sc->TRlldAdapter, sc->work_memory, - vtophys(sc->work_memory), work_size); - } - } - /* * Allocate RX/TX Pools */ @@ -545,7 +525,7 @@ static void oltr_pci_attach(pcici_t config_id, int unit) { - int i, s, rc = 0, scratch_size, work_size; + int i, s, rc = 0, scratch_size; int media = IFM_TOKEN|IFM_TOK_UTP16; u_long command; char PCIConfigHeader[64]; @@ -600,26 +580,6 @@ goto config_failed; } - switch(sc->config.type) { - case TRLLD_ADAPTER_PCI4: /* OC-3139 */ - work_size = 32 * 1024; - break; - case TRLLD_ADAPTER_PCI7: /* OC-3540 */ - work_size = 256; - break; - default: - work_size = 0; - } - - if (work_size) { - if ((sc->work_memory = malloc(work_size, M_DEVBUF, M_NOWAIT)) == NULL) { - printf("oltr%d: failed to allocate work memory.\n", unit); - } else { - TRlldAddMemory(sc->TRlldAdapter, sc->work_memory, - vtophys(sc->work_memory), work_size); - } - } - /* * Allocate RX/TX Pools */ @@ -843,6 +803,7 @@ struct ifnet *ifp = &sc->arpcom.ac_if; struct ifmedia *ifm = &sc->ifmedia; int poll = 0, i, rc = 0, s; + int work_size; /* * Check adapter state, don't allow multiple inits @@ -880,6 +841,26 @@ } sc->state = OL_INIT; + switch(sc->config.type) { + case TRLLD_ADAPTER_PCI4: /* OC-3139 */ + work_size = 32 * 1024; + break; + case TRLLD_ADAPTER_PCI7: /* OC-3540 */ + work_size = 256; + break; + default: + work_size = 0; + } + + if (work_size) { + if ((sc->work_memory = malloc(work_size, M_DEVBUF, M_NOWAIT)) == NULL) { + printf("oltr%d: failed to allocate work memory (%d octets).\n", sc->unit, work_size); + } else { + TRlldAddMemory(sc->TRlldAdapter, sc->work_memory, + vtophys(sc->work_memory), work_size); + } + } + switch(IFM_SUBTYPE(ifm->ifm_media)) { case IFM_AUTO: rc = TRlldSetSpeed(sc->TRlldAdapter, 0); /* TRLLD_SPEED_AUTO */ @@ -992,7 +973,7 @@ (void)splx(s); return; default: - printf("oltr%d: unkown open error (%d)\n", sc->unit, rc); + printf("oltr%d: unknown open error (%d)\n", sc->unit, rc); (void)splx(s); return; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-tokenring" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011001191151.A36856>