From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8852 invoked by alias); 27 Jun 2007 22:57:37 -0000 Received: (qmail 8842 invoked by uid 22791); 27 Jun 2007 22:57:36 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 27 Jun 2007 22:57:32 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1I3gS1-0002kF-00; Thu, 28 Jun 2007 00:57:29 +0200 Date: Thu, 28 Jun 2007 13:27:00 -0000 To: Michele Paselli Cc: ecos-discuss@ecos.sourceware.org Message-ID: <20070627225729.GD8009@lunn.ch> Mail-Followup-To: Michele Paselli , ecos-discuss@ecos.sourceware.org References: <19489034.1182961244153.JavaMail.root@ps22> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19489034.1182961244153.JavaMail.root@ps22> User-Agent: Mutt/1.5.13 (2006-08-11) From: Andrew Lunn X-IsSubscribed: yes 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] Interfacing directly to the low level ethernet driver, how?? X-SW-Source: 2007-06/txt/msg00265.txt.bz2 On Wed, Jun 27, 2007 at 06:20:44PM +0200, Michele Paselli wrote: > Hi , > > I'm about to develop a raw ethernet driver. After spending quite a lot > of time reading the forum and analyzing the code I finally decide to > implement a raw I/O API as suggested by Grant Edwards here: > > http://www.cygwin.com/ml/ecos-discuss/2003-06/msg00017.html > > The problem is that I'm finding quite a lot of difficulties in > interfacing my I/O driver to the low level device driver of my eth > controller. My idea is to use the netdevtab entry created in the .inl > file and from there be able to access the eth_drv_sc structure and all > the related functions. First problem, I saw that the existing network > implementations (lwip and freebsd) before initializing the device the > macros: > CYG_HAL_TABLE_BEGIN( __NETDEVTAB__, netdev ); > CYG_HAL_TABLE_END( __NETDEVTAB_END__, netdev ); > are called. Should I also use these macro? What is exactly their job? These macros just create the beginning and end pointers to the list of network devices. The Ethernet drivers then insert an entry into the list for each network device. In packages/net/bsd_tcpip/current/src/ecos/support.c:cyg_net_init_devs() there is code which iterates over this list initialising each device. > Second problem, in order to use the low level eth driver (packet > CYGPKG_DEVS_ETH_HRDWR) I have to include also CYGPKG_IO_ETH_DRIVERS. > When I compile everything with configtool I don't get any error but > when I compile my test application this is what I get: > > Building base.out > arm-elf-gcc -g -Ifmtc_install/include base.c -Lfmtc_install/lib - > Ttarget.ld -nostdlib -o base.out > fmtc_install/lib/libtarget.a(io_eth_eth_drv.o): In function > `eth_drv_write': > /imecnl/software/common/ecos/opt/ecos/ecos-2.0.43 > /packages/io/eth/v2_0_43/src/stand_alone/eth_drv.c:303: undefined > reference to `start_console' > /imecnl/software/common/ecos/opt/ecos/ecos-2.0.43 > /packages/io/eth/v2_0_43/src/stand_alone/eth_drv.c:307: undefined > reference to `end_console' > fmtc_install/lib/libtarget.a(io_eth_eth_drv.o): In function > `eth_drv_recv': > /imecnl/software/common/ecos/opt/ecos/ecos-2.0.43 > /packages/io/eth/v2_0_43/src/stand_alone/eth_drv.c:493: undefined > reference to `start_console' > /imecnl/software/common/ecos/opt/ecos/ecos-2.0.43 > /packages/io/eth/v2_0_43/src/stand_alone/eth_drv.c:501: undefined > reference to `end_console' > collect2: ld returned 1 exit status > make: *** [out] Error 1 > > I checked the various cdl files and I found out that the standalone > eth i/o is automatically selected if I don't include any networking > stack (but I don't want to, I want to get rid of TCP and all the upper > layers). You probably need to modify the CDL in order to just have the packages you need and configured how you want. In particular, CYGPKG_IO_ETH_DRIVERS_NET probably wants active_if CYGPKG_NET || CYGPKG_RAW_ETH Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss