From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8045 invoked by alias); 17 Oct 2007 11:32:45 -0000 Received: (qmail 8033 invoked by uid 22791); 17 Oct 2007 11:32:44 -0000 X-Spam-Check-By: sourceware.org Received: from 204-133-123-27.dia.static.slbbi.com (HELO mail.chez-thomas.org) (204.133.123.27) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 17 Oct 2007 11:32:39 +0000 Received: by mail.chez-thomas.org (Postfix, from userid 999) id 29728195021D; Wed, 17 Oct 2007 05:32:35 -0600 (MDT) Received: from [192.168.1.101] (hermes_local [192.168.1.101]) by mail.chez-thomas.org (Postfix) with ESMTP id B057819500A5; Wed, 17 Oct 2007 05:32:32 -0600 (MDT) Message-ID: <4715F2D0.7080704@mlbassoc.com> Date: Wed, 17 Oct 2007 11:32:00 -0000 From: Gary Thomas User-Agent: Thunderbird 1.5.0.12 (X11/20070530) MIME-Version: 1.0 To: ariga masahiro CC: ecos-discuss@ecos.sourceware.org References: <000501c7f691$4847e2f0$1c0110ac@ariga> <20070914082224.GA16840@lunn.ch> <000501c80eef$edf10f30$1c0110ac@ariga> <47134CDD.1080604@mlbassoc.com> <004301c80fa1$3dcb15d0$1c0110ac@ariga> <47149BA6.1080500@mlbassoc.com> <001301c81091$1d11b060$1c0110ac@ariga> In-Reply-To: <001301c81091$1d11b060$1c0110ac@ariga> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] What functions should I call in ethernet drv ? X-SW-Source: 2007-10/txt/msg00096.txt.bz2 ariga masahiro wrote: > Hello Gary and others, > > Sorry I missed 10/16/2007 20:08 mail, > I will prepare tar file and send you soon. > > Before that, > Some points became cleared and also arose other question > and I rely on your suggestion. > > I think the trouble is not my amendment or coding,rather how I 'use' > eCos application. > Let me explain. > > I debugged on the next premise. > > [premise] > There are no assingments to function > pointers(e.g.ng_ether_attach_p,ng_ether_input_p) in coding, > so their inside values(=function addresses) are settled at the time of > loading binary into RAM. > They are initially defined in > \packages\net\bsd_tcpip\current\include\sys\param.h like next > #define ng_ether_attach_p cyg_ng_ether_attach_p > . > > On the above premise I decided to check on sampled > Hitachi SE77x9 Template that I used as protocol to develop my target > template. > Source is CVS current version ,so it must work correctly. > I just only amended memory layout as same as my target template. > > I built 'RAM' Start Mode and linked to nc_test_slave test. > I loaded elf file on RAM using ICE,and dumped memory addresses. > > Result was just as same as my template. > > --from memory map > COMMON 0x000000008c0c0208 0x18 > /ecos-c/cygwin/home/LINK/ecoscvs_se-net-SE7709-2/untitled_install/lib/libtarget.a(net_bsd_tcpip_if_ethersubr.o) > > 0x0 (size before relaxing) > 0x000000008c0c0208 _cyg_ng_ether_input_p > 0x000000008c0c020c _cyg_ng_ether_detach_p > 0x000000008c0c0210 _sysctl__net_link_ether_children > 0x000000008c0c0214 _cyg_ng_ether_attach_p > 0x000000008c0c0218 _cyg_ng_ether_output_p > 0x000000008c0c021c _cyg_ng_ether_input_orphan_p > COMMON 0x000000008c0c0220 0xe8 > /ecos-c/cygwin/home/LINK/ecoscvs_se-net-SE7709-2/untitled_install/lib/libtarget.a(net_bsd_tcpip_if_loop.o) > > > and memory dump after loading. > URAM 8C0C0214 cyg_ng_ether_attach_p 00 00 00 00 00 00 00 00 > ........ > URAM 8C0C021C cyg_ng_ether_input_orphan_p 00 00 00 00 00 00 00 00 > ........ > URAM 8C0C0224 cyg_loif+4 00 00 00 00 00 00 00 00 > ........ > URAM 8C0C022C cyg_loif+c 00 00 00 00 00 00 00 00 > ........ > URAM 8C0C0234 cyg_loif+14 00 00 00 00 00 00 00 00 > ........ > URAM 8C0C023C cyg_loif+1c 00 00 00 00 00 00 00 00 > ........ > URAM 8C0C0244 cyg_loif+24 00 00 00 00 00 00 00 00 > ........ > URAM 8C0C024C cyg_loif+2c 00 00 00 00 00 00 00 00 > ........ > URAM 8C0C0254 cyg_loif+34 00 00 00 00 00 00 00 00 > ........ > URAM 8C0C025C cyg_loif+3c 00 00 00 00 00 00 00 00 > ........ > URAM 8C0C0264 cyg_loif+44 00 00 00 00 00 00 00 00 > ........ > URAM 8C0C026C cyg_loif+4c 00 00 00 00 00 00 00 00 > ........ > URAM 8C0C0274 cyg_loif+54 00 00 00 00 00 00 00 00 > ........ > URAM 8C0C027C cyg_loif+5c 00 00 00 00 00 00 00 00 > ........ > > I put on my target's memory layout files. > \packages\hal\sh\inserter\current\include\pkgconf\mlt_sh_sh77x9_inserter_ram.ldi > > --- begin > #include > > MEMORY > { > ram : ORIGIN = 0x8c000000, LENGTH = 0x4000000 > } > > SECTIONS > { > SECTIONS_BEGIN > SECTION_vectors (ram, 0x8c010000, LMA_EQ_VMA) > SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA) > SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA) > SECTION_rodata1 (ram, ALIGN (0x8), LMA_EQ_VMA) > SECTION_rodata (ram, ALIGN (0x8), LMA_EQ_VMA) > SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA) > SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA) > SECTION_data (ram, ALIGN (0x8), LMA_EQ_VMA) > SECTION_bss (ram, ALIGN (0x10), LMA_EQ_VMA) > CYG_LABEL_DEFN(__heap1) = ALIGN (0x8); > SECTIONS_END > } > --- end > > \packages\hal\sh\inserter\current\include\pkgconf\mlt_sh_sh77x9_inserter_ram.h > > --- begin > #ifndef __ASSEMBLER__ > #include > #include > > #endif > #define CYGMEM_REGION_ram (0x8c000000) > #define CYGMEM_REGION_ram_SIZE (0x4000000) > #define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | > CYGMEM_REGION_ATTR_W) > #ifndef __ASSEMBLER__ > extern char CYG_LABEL_NAME (__heap1) []; > #endif > #define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1)) > #define CYGMEM_SECTION_heap1_SIZE (0x90000000 - (size_t) CYG_LABEL_NAME > (__heap1)) > #ifndef __ASSEMBLER__ > extern char CYG_LABEL_NAME (__pci_window) []; > #endif > --- end > > and application makefile > --- begin > export PREFIX := > /ecos-c/cygwin/home/LINK/ecoscvs_l_net_20071015/unnamed2_install > > export COMMAND_PREFIX := sh-elf- > export CC := $(COMMAND_PREFIX)gcc > export OBJCOPY := $(COMMAND_PREFIX)objcopy > export HOST := CYGWIN > export AR := $(COMMAND_PREFIX)ar > > XCC = sh-elf-gcc > > ## Build flags. > CFLAGS = -g -Wall -I$(PREFIX)/include -ffunction-sections -fdata-sections > LDFLAGS = -nostartfiles -L$(PREFIX)/lib -Wl,--gc-sections -Wl,--Map > -Wl,nc_test_slave.map > LIBS = -Ttarget.ld -nostdlib > LD = $(XCC) > > ## Build rules. > all: nc_test_slave > > nc_test_slave.o: nc_test_slave.c > $(XCC) -c -o $*.o $(CFLAGS) $< > > nc_test_slave: nc_test_slave.o > $(LD) $(LDFLAGS) -o $@ $@.o $(LIBS) > > clean: > -rm -f nc_test_slave.exe nc_test_slave.o nc_test_slave.map > --- end > >> From above result I suppose I must do 'something' to make LAN91C111 >> driver > work, > or my environments lack somthing ? > > If you could elicit any conclusion from above accounts > please enligten me. > > I look foward to any suggestion. Firstly, the fact that cyg_ng_ether_input_p is NULL is not important. This is just an [optional] hook function for handling NetGraph protocol events. Have you traced the actual ethernet driver ? (.../devs/eth/smsc/lan91cxx/current/src/if_lan91cxx.c ) I'd start by setting DEBUG=0xFF (manually, you have to edit that file). This will turn on lots of messages and should guide you as to why the driver is not working. Note: the upper layers of the network code (and indeed most of the drivers) are well proven - you probably don't need to be hunting there for bugs, at least not the "out of the starting block" kind that you have. Stick to the actual driver :-) -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------ -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss