Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jun 2001 13:35:35 +0200 (CEST)
From:      thomas.pornin@ens.fr
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        alpha@freebsd.org
Subject:   NE2000 not supported on FreeBSD Alpha 4.x; fix included
Message-ID:  <200106071135.f57BZZt06415@pc-freebsd-s7.ens.fr>

next in thread | raw e-mail | index | archive | help

>Submitter-Id:   current-users
>Originator:     Thomas Pornin
>Organization:   Ecole Normale Superieure
>Confidential:   no
>Synopsis:       NE2000 not supported on FreeBSD Alpha 4.x; fix included
>Severity:       non-critical
>Priority:       medium
>Category:       alpha
>Release:        FreeBSD 4.3-RELEASE alpha
>Class:          change-request
>Environment: 

The machine is an AXPpci (NoName) Alpha board, with a 166 MHz 21066 cpu,
32 MBytes ram, 256 Kbytes cache. I added an add-on Realtek 8029 PCI
ethernet card, which is supposed to emulate a NE2000 10Mbits card.


>Description: 

The NE2000 support is i386-only, although one of the kernel source
files (/dev/ed/if_ed_pci.c) is in sys/conf/files, not in sys/conf/files.i386.


>How-To-Repeat: 

Try compiling a 4.3-RELEASE (or 4.2-RELEASE) kernel with the line:

device ed0

in the config file. It won't link, complaining about not found symbols
(such as ed_probe_Novell_generic, which is in sys/dev/ed/if_ed.c).


>Fix: 

I stole a patch from FreeBSD-5.0; the fix is the following:

** add the following function at the end of src/sys/alpha/alpha/vm_machdep.c:

u_long kvtop(void *addr)
{
	vm_offset_t va;

	if (va == 0) panic("kvtop: zero page frame");
	return (int)va;
}

** add the following prototype in sys/dev/ed/if_ed.c:

u_long kvtop(void *);

** move the following three lines from sys/conf/files.i386 to sys/conf/files:

dev/ed/if_ed.c          optional ed
dev/ed/if_ed_isa.c      optional ed isa
dev/ed/if_ed_pccard.c   optional ed card


Then compile the kernel with the line 'device ed0' in the config file.
It will link, boot up, recognize the card and use it. At least it works
for me (this message is sent from that machine, through that network
adapter).


I do not provide a unified diff because I think the patch will have to
be a bit sorted out:
-- the cast to int in kvtop() looks suspicious to me
-- cc complains a bit about kvtop() defined without a prior prototype
-- adding a prototype to if_ed.c does not look "clean" and I am not
sure it won't break things on i386
-- credits should be given: I am not the original author of that fix,
I stole it from some message in some mailing-list which would cite
it as coming from the FreeBSD-5.0-current cvs source repository


Yet I believe that it should be fairly easy to add the NE2000 Alpha
support in FreeBDS 4.4 without breaking anything else.

(I do know that NE2000 clones are lousy cards, but they are really cheap)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106071135.f57BZZt06415>