This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
VIA Rhine ethernet
- From: Chuck McManis <ecos at mcmanis dot com>
- To: ECOS Discussion Group <ecos-discuss at sources dot redhat dot com>
- Date: Sun, 12 Feb 2006 20:52:49 -0800
- Subject: [ECOS] VIA Rhine ethernet
So I'm guessing nobody has actually used this code before, there are pieces
missing.
So to create a target I needed to populate the
devs/eth/i386/pc/rhine/*
tree.
I created a .inl file and a CDL file based on what I saw in the Intel and
AMD lance files. I can now create a configuration that is Redboot + VIA
Rhine. Now I'm trying to get it to compile.
As you know there are a mix of generated symbols vs real symbols and
sometimes finding out how something is generated is fairly tricky.
I've populated the rhine_priv_data structure based on configuration values
from the .ecc file. Near the bottom of the INL file is a section like this:
// These arrays are used for sanity checking of pointers
struct rhine_priv_data *
rhine_priv_array[CYGNUM_DEVS_ETH_VIA_RHINE_DEV_COUNT] = {
#ifdef CYGPKG_DEVS_ETH_I386_PC_RHINE_ETH0
&via_eth0_priv_data,
#endif
};
This is pretty much stolen directly from every other ethernet driver file
in the distro, although I'm not sure how it is supposed to work. Clearly it
creates an array with a pointer to the private data structure but not sure
how it helps sanity check a pointer. Except that these lines are generating
an error for me. The error is shown below in the build error transcript.
Basically things start going pear shaped when gcc complains that
../devs_eth_i386_pc_rhine.inl:101: error: `via_eth0_priv_data' undeclared
here (not in a function)
And of course it is declared earlier in the file, but the file has it
inside an if/endif pair that keys off :
#ifdef CYGPKG_DEVS_ETH_I386_PC_VIA_RHINE_ETH0
Hmm, I'm not sure if that is actually defined either. But it should be.
More work to do, but if someone has used this code and just forgot to check
in this part of it, it will save me some development time, otherwise I'll
keep plugging away and send my results to ecos-source
--Chuck
=========== Build Error Transcript :
i386-elf-gcc
-c -I/u/home/cmcmanis/unix/ecos/usr/redboot-new/install/include
-I/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current
-I/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src
-I/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/tests -I.
-I/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/
-finline-limit=7000 -Wall -Wpointer-arith -Wstrict-prototypes -Winline
-Wundef -g -O2 -ffunction-sections
-fdata-sections -fno-exceptions -D_KERNEL -D__ECOS
-Wp,-MD,src/if_rhine.tmp -o src/devs_eth_via_rhine_if_rhine.o
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c
In file included from
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/via_rhine.h:61,
from
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:103:
/u/home/cmcmanis/unix/ecos/usr/redboot-new/install/include/cyg/io/devs_eth_i386_pc_rhine.inl:101:
error: `via_eth0_priv_data' undeclared here (not in a function)
/u/home/cmcmanis/unix/ecos/usr/redboot-new/install/include/cyg/io/devs_eth_i386_pc_rhine.inl:101:
error: initializer element is not constant
/u/home/cmcmanis/unix/ecos/usr/redboot-new/install/include/cyg/io/devs_eth_i386_pc_rhine.inl:101:
error: (near initialization for `rhine_priv_array[0]')
In file included from
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:103:
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/via_rhine.h:100:3:
#error "HAL PCI support must define translation macros"
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/via_rhine.h:468:8:
warning: extra tokens at end of #endif directive
In file included from
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:106:
/u/home/cmcmanis/unix/ecos/usr/redboot-new/install/include/cyg/io/devs_eth_i386_pc_rhine.inl:99:
error: redefinition of 'rhine_priv_array'
/u/home/cmcmanis/unix/ecos/usr/redboot-new/install/include/cyg/io/devs_eth_i386_pc_rhine.inl:99:
error: previous definition of 'rhine_priv_array' was here
/u/home/cmcmanis/unix/ecos/usr/redboot-new/install/include/cyg/io/devs_eth_i386_pc_rhine.inl:101:
error: initializer element is not constant
/u/home/cmcmanis/unix/ecos/usr/redboot-new/install/include/cyg/io/devs_eth_i386_pc_rhine.inl:101:
error: (near initialization for `rhine_priv_array[0]')
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c: In
function `pci_init_find_rhines':
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:306:
error: `CYGHWR_VIA_RHINE_PCI_MEM_MAP_BASE' undeclared (first use in this
function)
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:306:
error: (Each undeclared identifier is reported only once
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:306:
error: for each function it appears in.)
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:308:
error: `CYGHWR_VIA_RHINE_PCI_MEM_MAP_SIZE' undeclared (first use in this
function)
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c: In
function `via_rhine_init':
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:577:
warning: implicit declaration of function `HAL_PCI_CPU_TO_BUS'
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c: At top
level:
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:149:
warning: 'rhine_deliver' defined but not used
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:162:
warning: 'rhine_int_vector' defined but not used
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:503:
warning: 'via_rhine_init' defined but not used
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:666:
warning: 'rhine_stop' defined but not used
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:684:
warning: 'rhine_start' defined but not used
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:734:
warning: 'rhine_control' defined but not used
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:875:
warning: 'rhine_can_send' defined but not used
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:900:
warning: 'rhine_send' defined but not used
/u/u2/ecos/ecos/packages/devs/eth/via/rhine/current/src/if_rhine.c:1230:
warning: 'rhine_recv' defined but not used
gmake[1]: *** [src/if_rhine.o.d] Error 1
gmake[1]: Leaving directory
`/u/home/cmcmanis/unix/ecos/usr/redboot-new/devs/eth/via/rhine/current'
gmake: *** [build] Error 2
demon - %
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss