public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: ariga masahiro <ariga@link-lab.co.jp>
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] What functions should I call in ethernet drv ?
Date: Fri, 19 Oct 2007 09:55:00 -0000	[thread overview]
Message-ID: <47187EEB.5020109@mlbassoc.com> (raw)
In-Reply-To: <000601c8120c$667aa3c0$1c0110ac@ariga>

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

  reply	other threads:[~2007-10-19  9:55 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-14  5:37 [ECOS] Building error on CVS checkout sources ariga masahiro
2007-09-14  8:22 ` [ECOS] " Andrew Lunn
2007-09-14  9:38   ` [ECOS] Virtual Vector Configuration Stefan Sommerfeld
2007-09-14 10:17     ` Nick Garnett
2007-10-15  5:59   ` [ECOS] What functions should I call in ethernet drv ? ariga masahiro
2007-10-15 11:20     ` Gary Thomas
2007-10-16  3:04       ` ariga masahiro
2007-10-16 11:08         ` Gary Thomas
2007-10-17  7:41           ` ariga masahiro
2007-10-17 11:32             ` Gary Thomas
2007-10-18  7:17               ` ariga masahiro
     [not found]               ` <000c01c81151$9add59c0$1c0110ac@ariga>
2007-10-18 11:12                 ` Gary Thomas
2007-10-19  4:56                   ` ariga masahiro
2007-10-19  9:55                     ` Gary Thomas [this message]
2007-10-20  6:19                       ` ariga masahiro
2007-10-23  8:23                       ` ariga masahiro
2007-10-23  8:27                         ` Alok Singh
2007-10-23  9:05                           ` ariga masahiro
2007-10-25  2:05                           ` ariga masahiro
2007-10-30  2:41                             ` [ECOS] Can't Connect,TCP CHECKSUM INCORRECT ariga masahiro
2007-10-30  3:02                               ` Andrew Lunn
2007-10-30  4:17                               ` [ECOS] " Grant Edwards
2007-10-30  8:51                                 ` Alok Singh
2007-11-06  7:14                               ` [ECOS] " ariga masahiro
2007-11-06  7:58                                 ` Alok Singh
2007-11-06  8:30                                   ` ariga masahiro
2007-11-06  8:35                                     ` Andrew Lunn
2007-11-06 23:47                                       ` ariga masahiro
2007-11-07  1:05                                         ` ariga masahiro
2007-11-07  7:15                                           ` ariga masahiro
2007-11-07  8:24                                             ` ariga masahiro
2007-11-07 11:55                                               ` Alok Singh
2007-11-08  1:56                                               ` ariga masahiro
2007-11-08  8:23                                                 ` ariga masahiro
2007-11-09  1:25                                                   ` ariga masahiro
2007-11-13  1:13                                                     ` ariga masahiro
2007-11-16  7:40                                                       ` ariga masahiro
2007-11-08  9:13                                                 ` Alok Singh
2008-01-07  1:36                                       ` [ECOS] Wrongfully compiled code ariga masahiro
2007-10-17  8:45           ` [ECOS] What functions should I call in ethernet drv ? ariga masahiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47187EEB.5020109@mlbassoc.com \
    --to=gary@mlbassoc.com \
    --cc=ariga@link-lab.co.jp \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).