From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13825 invoked by alias); 20 Oct 2007 06:19:52 -0000 Received: (qmail 13811 invoked by uid 22791); 20 Oct 2007 06:19:52 -0000 X-Spam-Check-By: sourceware.org Received: from defer117.ocn.ad.jp (HELO defer117.ocn.ad.jp) (125.206.148.136) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 20 Oct 2007 06:19:49 +0000 Received: from pop132.ocn.ne.jp (pop132.ocn.ne.jp [60.37.31.215]) by defer117.ocn.ad.jp (Postfix) with ESMTP id 50F23B9EB2; Sat, 20 Oct 2007 15:19:46 +0900 (JST) Received: from ariga (p1143-ipbf2202marunouchi.tokyo.ocn.ne.jp [122.17.131.143]) by pop132.ocn.ne.jp (OCN) with SMTP id l9K6Jjx2000177; Sat, 20 Oct 2007 15:19:45 +0900 (JST) Message-ID: <000501c812e1$2d7f2cf0$1c0110ac@ariga> From: "ariga masahiro" To: "Gary Thomas" Cc: 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> <4715F2D0.7080704@mlbassoc.com> <000c01c81151$9add59c0$1c0110ac@ariga> <47173F99.80405@mlbassoc.com> <000601c8120c$667aa3c0$1c0110ac@ariga> <47187EEB.5020109@mlbassoc.com> Date: Sat, 20 Oct 2007 06:19:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook Express 6.00.2900.2869 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] What functions should I call in ethernet drv ? X-SW-Source: 2007-10/txt/msg00110.txt.bz2 Hello Gary and others, > Gray wrote: > You should not have to change the driver. The differences in > endian-ness are handled by the macros CYG_CPU_TO_LE16() and > CYG_LE16_TO_CPU(). Make sure that your HAL defines them > correctly. The received data are reserved into data buffer in lan91cxx_recv's line 1230 - line 1235 lan91cxx_recv() 1230: if (data) { 1231: while( clen > 0 ) { 1232: *data++ = get_data_byte(sc); 1233: clen--; 1234: } 1235: } --> cyg_uint8 get_data_byte(struct eth_drv_sc *sc) { cyg_uint8 c; struct lan91cxx_priv_data *cpd = (struct lan91cxx_priv_data *)sc->driver_private; if( cpd->data_pos == sizeof(rxd_t) ) { cpd->data_buf = get_data(sc); cpd->data_pos = 0; } c = (cpd->data_buf>>(cpd->data_pos*8))&0xFF; cpd->data_pos++; return c; } --> get_data(struct eth_drv_sc *sc) { rxd_t val; struct lan91cxx_priv_data *cpd = (struct lan91cxx_priv_data *)sc->driver_private; #ifdef LAN91CXX_32BIT_RX HAL_READ_UINT32(cpd->base+((LAN91CXX_DATA_HIGH & 0x7) << cpd->addrsh), val); #else HAL_READ_UINT16(cpd->base+((LAN91CXX_DATA & 0x7) << cpd->addrsh), val); #endif #if DEBUG & 2 diag_printf("read data 0x%x\n", val); #endif return val; } --> #define HAL_READ_UINT16( _register_, _value_ ) \ CYG_MACRO_START \ ((_value_) = *((volatile CYG_WORD16 *)(_register_))); \ CYG_MACRO_END As you can see CYG_CPU_TO_LE16() and CYG_LE16_TO_CPU() are never used, and it is impossible to reserve data in BigEndian form without change. Maybe at the time of interpriting ARP-request, reading data exchangedly ? I tried to find where ARP-request is parsed and interpreted,but couldn't find where it is. I checked that ISR,DSR are called(although I'm not sure they are called right time) so I suppose that if ARP-request is correctly interpreted and ARP-reply is made and sent out, it will work. I sincerely ask your favor. Would you please let me know next few questions ? 1.I would like to know where ARP-request is parsed and interpreted, entry function name, and if possible line numbers. 2.After ARP-request is recognised, by what sequence lan91cxx_send is called. 3.Where ARP-reply packet is made ? entry function name, and if possible line numbers. I look forward to your reply. Thank you in advance. Masahiro Ariga -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss