From pornin@pc-freebsd-s7.ens.fr  Thu Jun  7 04:35:41 2001
Return-Path: <pornin@pc-freebsd-s7.ens.fr>
Received: from pc-freebsd-s7.ens.fr (pc-freebsd-s7.ens.fr [129.199.99.52])
	by hub.freebsd.org (Postfix) with ESMTP
	id 6BB1E37B406; Thu,  7 Jun 2001 04:35:38 -0700 (PDT)
	(envelope-from pornin@pc-freebsd-s7.ens.fr)
Received: (from pornin@localhost)
	by pc-freebsd-s7.ens.fr (8.11.1/8.9.3) id f57BZZt06415;
	Thu, 7 Jun 2001 13:35:35 +0200 (CEST)
	(envelope-from pornin)
Message-Id: <200106071135.f57BZZt06415@pc-freebsd-s7.ens.fr>
Date: Thu, 7 Jun 2001 13:35:35 +0200 (CEST)
From: thomas.pornin@ens.fr
Reply-To: 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
X-Send-Pr-Version: 3.2

>Number:         27930
>Category:       alpha
>Synopsis:       NE2000 not supported on FreeBSD Alpha 4.x; fix included
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-alpha
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 07 04:40:01 PDT 2001
>Closed-Date:    Tue May 24 02:07:22 GMT 2005
>Last-Modified:  Tue May 24 02:07:22 GMT 2005
>Originator:     Thomas Pornin
>Release:        FreeBSD 4.3-RELEASE alpha
>Organization:
Ecole Normale Superieure
>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)
>Release-Note:
>Audit-Trail:

From: Matthew Jacob <mjacob@feral.com>
To: thomas.pornin@ens.fr
Cc: FreeBSD-gnats-submit@FreeBSD.ORG, alpha@FreeBSD.ORG
Subject: Re: alpha/27930: NE2000 not supported on FreeBSD Alpha 4.x; fix
 included
Date: Thu, 7 Jun 2001 08:49:04 -0700 (PDT)

 No- I'm afraid this won't be the right answer. kvtop  will go away- what has
 to happen is that ed needs to be dmabus-ified.
 
 
 
 On Thu, 7 Jun 2001 thomas.pornin@ens.fr wrote:
 
 > 
 > >Number:         27930
 > >Category:       alpha
 > >Synopsis:       NE2000 not supported on FreeBSD Alpha 4.x; fix included
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       medium
 > >Responsible:    freebsd-alpha
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          change-request
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Thu Jun 07 04:40:01 PDT 2001
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Thomas Pornin
 > >Release:        FreeBSD 4.3-RELEASE alpha
 > >Organization:
 > Ecole Normale Superieure
 > >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)
 > >Release-Note:
 > >Audit-Trail:
 > >Unformatted:
 > 
 > To Unsubscribe: send mail to majordomo@FreeBSD.org
 > with "unsubscribe freebsd-alpha" in the body of the message
 > 
 
Responsible-Changed-From-To: freebsd-alpha->obrien 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Thu Jun 7 09:51:26 PDT 2001 
Responsible-Changed-Why:  

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27930 

From: Alexander Langer <alex@big.endian.de>
To: Matthew Jacob <mjacob@feral.com>
Cc: thomas.pornin@ens.fr, FreeBSD-gnats-submit@FreeBSD.ORG,
	alpha@FreeBSD.ORG
Subject: Re: alpha/27930: NE2000 not supported on FreeBSD Alpha 4.x; fix included
Date: Fri, 8 Jun 2001 00:35:18 +0200

 Thus spake Matthew Jacob (mjacob@feral.com):
 
 > No- I'm afraid this won't be the right answer. kvtop  will go away- what has
 > to happen is that ed needs to be dmabus-ified.
 
 I have a one-year-old patch for that on
 http://people.freebsd.org/~alex/remove-kvtop.diff
 (it probably won't apply any more).
 
 It removes all occurrencies of kvtop() and replaces it with the more
 correct pmap_extract().
 
 Given this, the ed driver compiles again on -alpha as it did when I
 initially bus_spacifed the ed driver (that was the reason why I did
 it:  One of my alphas only had an NE2000 NIC).
 
 Is there a fix in -CURRENT?  I don't think so (sys/dev/ed/* still use
 kvtop()).
 
 Maybe one can rework the above patch, PLEASE?
 (Or at least tell me what's wrong, so _I_ can do it).
 
 Alex
 -- 
 cat: /home/alex/.sig: No such file or directory

From: Matthew Jacob <mjacob@feral.com>
To: Alexander Langer <alex@big.endian.de>
Cc: <thomas.pornin@ens.fr>, <FreeBSD-gnats-submit@FreeBSD.ORG>,
	<alpha@FreeBSD.ORG>
Subject: Re: alpha/27930: NE2000 not supported on FreeBSD Alpha 4.x; fix
 included
Date: Thu, 7 Jun 2001 15:41:08 -0700 (PDT)

 I have nothing wrong with kvtop or pmap_extract. I don't care one way or the
 other.
 
 But I do want to see drivers using the dmabus routines. Sometime this year
 we'll turn off the hack in alpha that allows PCI drivers to continue to work
 on systems with < 2GB of memory.
 
 On Fri, 8 Jun 2001, Alexander Langer wrote:
 
 > Thus spake Matthew Jacob (mjacob@feral.com):
 >
 > > No- I'm afraid this won't be the right answer. kvtop  will go away- what has
 > > to happen is that ed needs to be dmabus-ified.
 >
 > I have a one-year-old patch for that on
 > http://people.freebsd.org/~alex/remove-kvtop.diff
 > (it probably won't apply any more).
 >
 > It removes all occurrencies of kvtop() and replaces it with the more
 > correct pmap_extract().
 >
 > Given this, the ed driver compiles again on -alpha as it did when I
 > initially bus_spacifed the ed driver (that was the reason why I did
 > it:  One of my alphas only had an NE2000 NIC).
 >
 > Is there a fix in -CURRENT?  I don't think so (sys/dev/ed/* still use
 > kvtop()).
 >
 > Maybe one can rework the above patch, PLEASE?
 > (Or at least tell me what's wrong, so _I_ can do it).
 >
 > Alex
 > --
 > cat: /home/alex/.sig: No such file or directory
 >
 

From: "David O'Brien" <obrien@FreeBSD.ORG>
To: Matthew Jacob <mjacob@feral.com>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: alpha/27930: NE2000 not supported on FreeBSD Alpha 4.x; fix included
Date: Thu, 7 Jun 2001 18:29:24 -0700

 On Thu, Jun 07, 2001 at 03:50:02PM -0700, Matthew Jacob wrote:
 >  Sometime this year
 >  we'll turn off the hack in alpha that allows PCI drivers to continue to work
 >  on systems with < 2GB of memory.
                    ^
 
                 < or > ?
 

From: Matthew Jacob <mjacob@feral.com>
To: "David O'Brien" <obrien@FreeBSD.ORG>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: alpha/27930: NE2000 not supported on FreeBSD Alpha 4.x; fix
 included
Date: Thu, 7 Jun 2001 18:35:00 -0700 (PDT)

 On Thu, 7 Jun 2001, David O'Brien wrote:
 
 > On Thu, Jun 07, 2001 at 03:50:02PM -0700, Matthew Jacob wrote:
 > >  Sometime this year
 > >  we'll turn off the hack in alpha that allows PCI drivers to continue to work
 > >  on systems with < 2GB of memory.
 >                    ^
 > 
 >                 < or > ?
 
 Less than. They cannot possibly work even now with systems > 2GB of memory
 because we have no direct-mapped implementations that allow for the 1-to-1
 mapping of device DMA to primary memory that map more than 2GB.
 
 The hack that allows direct mapping should and will go away because as more
 than 2GB systems become even more common, it'll be silly to try and support
 things otherwise. The only correct mechanism is bus_dma. 
 
 -matt
 
 

From: Alexander Langer <alex@big.endian.de>
To: freebsd-gnats-submit@FreeBSD.org, thomas.pornin@ens.fr
Cc:  
Subject: Re: alpha/27930: NE2000 not supported on FreeBSD%2
Date: Sun,  9 Sep 2001 20:48:29 +0200 (CEST)

 According to Bill Paul, ed boards don't do bus dma.
 
 However, kvtop is only used in the code of two card types.
 We could #ifdef out support for these cards on alpha
 so it at least works for most no-name cards.
 
 I would prefer to use bus_dma stuff for the kvtop things, but
 I don't own such cards and therefore won't be able to do that.
 
 Alex
 
Responsible-Changed-From-To: obrien->freebsd-bugs 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Mon Sep 10 09:33:51 PDT 2001 
Responsible-Changed-Why:  
Someone else is working on this. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27930 
Responsible-Changed-From-To: freebsd-bugs->freebsd-alpha 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Jul 22 09:36:18 GMT 2004 
Responsible-Changed-Why:  
Canonicalize responsible. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=27930 

From: Sten Spans <sten@blinkenlights.nl>
To: bug-followup@FreeBSD.org, thomas.pornin@ens.fr
Cc:  
Subject: Re: alpha/27930: NE2000 not supported on FreeBSD Alpha 4.x; fix
 included
Date: Mon, 23 May 2005 22:54:36 +0200 (CEST)

 The fbsd4 branch has been retired, this won't be fixed in 4.x.
 Please close the PR.
 
 -- 
 Sten Spans
 
 "There is a crack in everything, that's how the light gets in."
 Leonard Cohen - Anthem
State-Changed-From-To: open->closed 
State-Changed-By: marcel 
State-Changed-When: Tue May 24 02:06:37 GMT 2005 
State-Changed-Why:  
Expired. Sorry about that... 

http://www.freebsd.org/cgi/query-pr.cgi?pr=27930 
>Unformatted:
