Date: Wed, 7 Jun 2000 15:21:30 +0200 (CEST) From: alex@big.endian.de To: FreeBSD-gnats-submit@freebsd.org Subject: alpha/19089: Patch: Add if_ed support to FreeBSD/Alpha Message-ID: <20000607132130.25D7F14AA8@cichlids.cichlids.com>
next in thread | raw e-mail | index | archive | help
>Number: 19089 >Category: alpha >Synopsis: Patch: Add if_ed support to FreeBSD/Alpha >Confidential: yes >Severity: serious >Priority: high >Responsible: freebsd-alpha >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Jun 07 06:30:02 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Alexander Langer >Release: FreeBSD 5.0-CURRENT i386 >Organization: none >Environment: FreeBSD/Alpha >Description: With this patch we are able to use more high-quality cards from the NE2000 compatible range on FreeBSD/Alpha: bash-2.04# uname -a ; ifconfig ed0 ; route get 192.168.0.1 ; ping -c 2 192.168. 0.1 FreeBSD parca.cichlids.com 5.0-CURRENT FreeBSD 5.0-CURRENT #13: Wed Jun 7 15:04:33 CEST 2000 root@parca.cichlids.com:/usr/src/sys/compile/ALPINE.ed alpha ed0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet 192.168.0.16 netmask 0xffffff00 broadcast 192.168.0.255 inet6 fe80::200:b4ff:fe5e:fa71%ed0 prefixlen 64 scopeid 0x1 ether 00:00:b4:5e:fa:71 route to: neutron destination: neutron interface: ed0 flags: <UP,HOST,DONE,LLINFO,WASCLONED> recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 794 PING 192.168.0.1 (192.168.0.1): 48 data bytes 64 bytes from 192.168.0.1: icmp_seq=0 ttl=255 time=0.741 ms 64 bytes from 192.168.0.1: icmp_seq=1 ttl=255 time=0.854 ms --- 192.168.0.1 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.741/0.797/0.854/0.057 ms bash-2.04# >How-To-Repeat: >Fix: Index: alpha/alpha/vm_machdep.c =================================================================== RCS file: /usr/home/ncvs/src/sys/alpha/alpha/vm_machdep.c,v retrieving revision 1.30 diff -u -r1.30 vm_machdep.c --- alpha/alpha/vm_machdep.c 2000/05/05 09:54:57 1.30 +++ alpha/alpha/vm_machdep.c 2000/06/07 09:30:45 @@ -296,6 +296,20 @@ #endif /* + * Convert kernel VA to physical address + */ +u_long +kvtop(void *addr) +{ + vm_offset_t va; + + va = pmap_kextract((vm_offset_t)addr); + if (va == 0) + panic("kvtop: zero page frame"); + return((int)va); +} + +/* * Map an IO request into kernel virtual address space. * * All requests are (re)mapped into kernel VA space. Index: conf/files =================================================================== RCS file: /usr/home/ncvs/src/sys/conf/files,v retrieving revision 1.372 diff -u -r1.372 files --- conf/files 2000/06/07 04:53:48 1.372 +++ conf/files 2000/06/07 13:12:18 @@ -123,6 +123,9 @@ dev/dpt/dpt_pci.c optional dpt pci dev/dpt/dpt_scsi.c optional dpt dev/ed/if_ed_pci.c optional ed pci +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 dev/en/midway.c optional en dev/ep/if_ep.c optional ep dev/ep/if_ep_eisa.c optional ep eisa Index: conf/files.i386 =================================================================== RCS file: /usr/home/ncvs/src/sys/conf/files.i386,v retrieving revision 1.319 diff -u -r1.319 files.i386 --- conf/files.i386 2000/06/02 09:27:47 1.319 +++ conf/files.i386 2000/06/07 13:12:24 @@ -71,9 +71,6 @@ dev/ata/atapi-cd.c optional atapicd dev/ata/atapi-fd.c optional atapifd dev/ata/atapi-tape.c optional atapist -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 dev/eisa/eisaconf.c optional eisa dev/fb/fb.c optional fb dev/fb/fb.c optional vga Index: dev/ed/if_ed.c =================================================================== RCS file: /usr/home/ncvs/src/sys/dev/ed/if_ed.c,v retrieving revision 1.180 diff -u -r1.180 if_ed.c --- dev/ed/if_ed.c 2000/06/01 21:55:49 1.180 +++ dev/ed/if_ed.c 2000/06/07 13:11:29 @@ -75,7 +75,7 @@ static void ed_reset __P((struct ifnet *)); static void ed_watchdog __P((struct ifnet *)); -static void ds_getmcaf __P((struct ed_softc *, u_long *)); +static void ds_getmcaf __P((struct ed_softc *, u_int32_t *)); static void ed_get_packet __P((struct ed_softc *, char *, /* u_short */ int)); @@ -98,7 +98,7 @@ static void ed_setrcr __P((struct ed_softc *)); -static u_long ds_crc __P((u_char *ep)); +static u_int32_t ds_crc __P((u_char *ep)); static u_short ed_get_Linksys __P((struct ed_softc *)); @@ -3211,13 +3214,13 @@ } else { /* set up multicast addresses and filter modes */ if (ifp->if_flags & IFF_MULTICAST) { - u_long mcaf[2]; + u_int32_t mcaf[2]; if (ifp->if_flags & IFF_ALLMULTI) { mcaf[0] = 0xffffffff; mcaf[1] = 0xffffffff; } else ds_getmcaf(sc, mcaf); /* * Set multicast filter on chip. @@ -3254,12 +3258,12 @@ /* * Compute crc for ethernet address */ -static u_long +static u_int32_t ds_crc(ep) u_char *ep; { #define POLYNOMIAL 0x04c11db6 - register u_long crc = 0xffffffffL; + register u_int32_t crc = 0xffffffffL; register int carry, i, j; register u_char b; @@ -3284,9 +3288,9 @@ static void ds_getmcaf(sc, mcaf) struct ed_softc *sc; - u_long *mcaf; + u_int32_t *mcaf; { - register u_int index; + register u_int32_t index; register u_char *af = (u_char *) mcaf; struct ifmultiaddr *ifma; Index: dev/ed/if_edreg.h =================================================================== RCS file: /usr/home/ncvs/src/sys/dev/ed/if_edreg.h,v retrieving revision 1.27 diff -u -r1.27 if_edreg.h --- dev/ed/if_edreg.h 1999/09/02 15:06:23 1.27 +++ dev/ed/if_edreg.h 2000/06/07 13:14:53 @@ -788,8 +788,13 @@ #define ED_WD_ROM_CHECKSUM_TOTAL 0xFF #endif +#ifdef __alpha__ +#define ED_WD_NIC_OFFSET 0x00 /* I/O base offset to NIC */ +#define ED_WD_ASIC_OFFSET 0x10 /* I/O base offset to ASIC */ +#else #define ED_WD_NIC_OFFSET 0x10 /* I/O base offset to NIC */ #define ED_WD_ASIC_OFFSET 0 /* I/O base offset to ASIC */ +#endif #define ED_WD_IO_PORTS 32 /* # of i/o addresses used */ #define ED_WD_PAGE_OFFSET 0 /* page offset for NIC access to mem */ Index: dev/ed/if_edvar.h =================================================================== RCS file: /usr/home/ncvs/src/sys/dev/ed/if_edvar.h,v retrieving revision 1.4 diff -u -r1.4 if_edvar.h --- dev/ed/if_edvar.h 1999/12/10 07:22:53 1.4 +++ dev/ed/if_edvar.h 2000/06/07 13:15:24 @@ -48,8 +48,13 @@ struct resource* irq_res; /* resource for irq */ void* irq_handle; /* handle for irq handler */ +#ifdef __alpha__ + u_int asic_addr; /* ASIC I/O bus address */ + u_int nic_addr; /* NIC (DS8390) I/O bus address */ +#else u_short asic_addr; /* ASIC I/O bus address */ u_short nic_addr; /* NIC (DS8390) I/O bus address */ +#endif /* * The following 'proto' variable is part of a work-around for 8013EBT asics @@ -71,7 +76,7 @@ caddr_t mem_start; /* NIC memory start address */ caddr_t mem_end; /* NIC memory end address */ - u_long mem_size; /* total NIC memory size */ + u_int32_t mem_size; /* total NIC memory size */ caddr_t mem_ring; /* start of RX ring-buffer (in NIC mem) */ u_char mem_shared; /* NIC memory is shared with host */ >Release-Note: >Audit-Trail: >Unformatted: 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?20000607132130.25D7F14AA8>