From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10075 invoked by alias); 19 Oct 2007 09:55:04 -0000 Received: (qmail 10065 invoked by uid 22791); 19 Oct 2007 09:55:03 -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; Fri, 19 Oct 2007 09:54:59 +0000 Received: by mail.chez-thomas.org (Postfix, from userid 999) id C3F08195011F; Fri, 19 Oct 2007 03:54:55 -0600 (MDT) Received: from [192.168.1.101] (hermes_local [192.168.1.101]) by mail.chez-thomas.org (Postfix) with ESMTP id 847251950093; Fri, 19 Oct 2007 03:54:52 -0600 (MDT) Message-ID: <47187EEB.5020109@mlbassoc.com> Date: Fri, 19 Oct 2007 09:55: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> <4715F2D0.7080704@mlbassoc.com> <000c01c81151$9add59c0$1c0110ac@ariga> <47173F99.80405@mlbassoc.com> <000601c8120c$667aa3c0$1c0110ac@ariga> In-Reply-To: <000601c8120c$667aa3c0$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/msg00108.txt.bz2 ariga masahiro wrote: > Hello Gary and others, > > Gary, > thanks for your help, I think I came close to the root of the trouble.(I > hope) > > I discovered(to the truth,I dicovered previously) received data upsidedown. > Please refer to 809-line in last-sent output log > > 8C05ECEC: FF FF FF FF FF FF 15 00 6D C5 F0 23 06 08 > |........m..#.. | > > Whereas host sends. > 0000 ff ff ff ff ff ff 00 15 c5 6d 23 f0 08 06 00 01 ........ .m#..... > 0010 08 00 06 04 00 01 00 15 c5 6d 23 f0 ac 10 01 1c ........ .m#..... > 0020 00 00 00 00 00 00 ac 10 01 1c ........ .. > > ARP command should be 08 06. > > (I am very sorry if it deliberately display them in little endian form.) > > I thought I could amend this and I amended(I thought) like next in > \packages\devs\eth\smsc\lan91cxx\current\src\if_lan91cxx.c. > (I risk of appearing stupid but I henestly tell what I did.) > cyg_uint8 get_data_byte(struct eth_drv_sc *sc) > { > //20070919 > int sf; > > cyg_uint8 c; > struct lan91cxx_priv_data *cpd = > (struct lan91cxx_priv_data *)sc->driver_private; > > // //20070919 > // db_printf("cpd->data_pos=%d rxd_t=%d\n",cpd->data_pos,sizeof(rxd_t)); > > if( cpd->data_pos == sizeof(rxd_t) ) > { > cpd->data_buf = get_data(sc); > cpd->data_pos = 0; > //20070919 > sf = 1; > } > //20070919 begin > else{ > sf = 0; > } > //20070919 end > > //20070919 begin > //ORG c = (cpd->data_buf>>(cpd->data_pos*8))&0xFF; > c = (cpd->data_buf>>(sf*8))&0xFF; > > // //20070919 > // db_printf("cpd->data_buf=%x c=%x\n",cpd->data_buf,c); > > cpd->data_pos++; > > return c; > > } > > After that I ran and stored output log(I send gzip file). > To my astonishment,I found RxEvent errored. > Please refer to 795-line. > RxEvent - bad rx: stat: 0x7f40, len: 0x41fa > > Apparantly I wrongly concocted. > I am still tracing source but I haven't found smart answer. > Even if I thought I could have corrected it myself, > I worries that my bad coding affects anywhere else. > > Please teach me how to best amend this behaviour. > (I am afraid this time also I am missing target.) > > I honestly hope this breaks the stagnation. > > I would appreciate your reply. > Thanks in advance. > > Masahiro Ariga 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. -- ------------------------------------------------------------ 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