public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "ariga masahiro" <ariga@link-lab.co.jp>
To: "Alok Singh" <alok.singh@broadcom.com>
Cc: <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] What functions should I call in ethernet drv ?
Date: Tue, 23 Oct 2007 09:05:00 -0000	[thread overview]
Message-ID: <001401c81553$c95f6440$1c0110ac@ariga> (raw)
In-Reply-To: <E06E3B7BBC07864CADE892DAF1EB0FBD01A1E856@NT-SJCA-0752.brcm.ad.broadcom.com>

[-- Attachment #1: Type: text/plain, Size: 5886 bytes --]

Hello sir,

I send target's output log file.
This is after I chnged coding.

I also send Etherreal file from host.
I am sorry I don't know how to change text.

Are they suitable for your request ?

Masahiro Ariga

----- Original Message ----- 
From: "Alok Singh" <alok.singh@broadcom.com>
To: "ariga masahiro" <ariga@link-lab.co.jp>
Cc: <ecos-discuss@ecos.sourceware.org>
Sent: Tuesday, October 23, 2007 5:27 PM
Subject: RE: [ECOS] What functions should I call in ethernet drv ?


Ariga,
Can you send us the dump of IP packet also (not ARP) on your system? We want 
to make sure that you are seeing the problem only with Arp packet. Send 64 
bytes starting with Ethernet header.

-Alok

-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org 
[mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of ariga masahiro
Sent: Tuesday, October 23, 2007 1:53 PM
To: Gary Thomas
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] What functions should I call in ethernet drv ?

Hello Gary and others,

I have learned ARP operation.
I've got "TCP/IP illustrated vol2" by W.Richard Stevens.

I have traced to ARP interpreting point.
First I breaked lan91cxx_recv() when received ARP packet,
and next breaked if_ethersubr.c's ether_input(ifp, eh, m) function.
And I traced into ether_demux().

ether_demux(ifp, eh, m)
       594:     switch (ether_type) {
       595: #ifdef INET
       596:     case ETHERTYPE_IP:
       597:         if (ipflow_fastforward(m))
       598:             return;
       599:         schednetisr(NETISR_IP);
       600:         inq = &ipintrq;
       601:         break;
       602:
       603:     case ETHERTYPE_ARP:
       604:         if (ifp->if_flags & IFF_NOARP) {
       605:             /* Discard packet if ARP is disabled on interface */
       606:             m_freem(m);
       607:             return;
       608:         }
       609:         schednetisr(NETISR_ARP);
       610:         inq = &arpintrq;
       611:         break;

and I found ether_type==0x0608,so couldn't recognize ARP.

I concluded entering data in little Endian is wrong,
so as a makeshift I amended source next.

First I concocted get_data_byte(struct eth_drv_sc *sc)
to get data exchangedly like I previously sent the coding.

And I alse concocted in cyg_uint16 get_data_short like below
to echange data.

      1079: cyg_uint16 get_data_short(struct eth_drv_sc *sc)
      1080: {
      1081:     cyg_uint16 val;
      1082:
      1083:     val = get_data_byte(sc);
      1084:     //val |= get_data_byte(sc)<<8;
                val = val<<8 | get_data_byte(sc);  --I concocted to reverse
data.
      1085:
      1086:     return CYG_LE16_TO_CPU(val);
      1087: }

I know it's bad coding but as I said this is a makeshift and
I expect your best amended source.(on condition I was right)

Anyway I could continue debugging.

After that I confirmed that following interrrupt,
it entered in if_ether.c's arpintr().

Then I traced into in_arpinput(m), and
according to the book,here send ARP-reply.
My expectancy reached high.

But alas,in in_arpinput(m)
didn't go to the point of sending packet.

The reason was, in first part of coding,
       529: in_arpinput(m)
       530:     struct mbuf *m;
       531: {
       532:     register struct ether_arp *ea;
       533:     register struct arpcom *ac = (struct arpcom
*)m->m_pkthdr.rcvif;
       534:     struct ether_header *eh;
       535:     struct iso88025_header *th = (struct iso88025_header *)0;
       536:     register struct llinfo_arp *la = 0;
       537:     register struct rtentry *rt;
       538:     struct in_ifaddr *ia, *maybe_ia = 0;
       539:     struct sockaddr_dl *sdl;
       540:     struct sockaddr sa;
       541:     struct in_addr isaddr, itaddr, myaddr;
       542:     int op, rif_len;
       543:
       544:     if (m->m_len < sizeof(struct ether_arp) &&
       545:         (m = m_pullup(m, sizeof(struct ether_arp))) == NULL) {
       546:         log(LOG_ERR, "in_arp: runt packet -- m_pullup
failed\n");
       547:         return;
       548:     }
       549:
       550:     ea = mtod(m, struct ether_arp *);
       551:     op = ntohs(ea->arp_op);
       552:     (void)memcpy(&isaddr, ea->arp_spa, sizeof (isaddr));
       553:     (void)memcpy(&itaddr, ea->arp_tpa, sizeof (itaddr));
       554:     for (ia = in_ifaddrhead.tqh_first; ia; ia =
ia->ia_link.tqe_next) {
       555:         /*
       556:          * For a bridge, we want to check the address
irrespective
       557:          * of the receive interface. (This will change slightly
       558:          * when we have clusters of interfaces).
       559:          */
       560: #ifdef BRIDGE
       561: #define BRIDGE_TEST (do_bridge)
       562: #else
       563: #define BRIDGE_TEST (0) /* cc will optimise the test away */
       564: #endif
       565:         if ((BRIDGE_TEST) || (ia->ia_ifp == &ac->ac_if)) {
       566:             maybe_ia = ia;
       567:             if ((itaddr.s_addr == ia->ia_addr.sin_addr.s_addr)
||
       568:                  (isaddr.s_addr == ia->ia_addr.sin_addr.s_addr))
{
       569:                 break;
       570:             }
       571:         }
       572:     }
       573:     if (maybe_ia == 0) {
       574:         m_freem(m);
       575:         return;
       576:     }
       577:     myaddr = ia ? ia->ia_addr.sin_addr :
maybe_ia->ia_addr.sin_addr;  --ia,ª00

at 554 line,there was nothing in_ifaddrhead.tqh_first,
and at 577, ia became 00000000.

Here,Gary, I sincerely ask your opinion.
The trouble is there is nothing in in_ifaddrhead.tqh_first,
do you have any idea what caused this mishappening ?

I expect your any hints whatever.

Thanks 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




[-- Attachment #2: MyFlashIDis422f9019.txt.gz --]
[-- Type: application/x-gzip, Size: 2457 bytes --]

[-- Attachment #3: thisishost --]
[-- Type: application/octet-stream, Size: 1567 bytes --]

[-- Attachment #4: Type: text/plain, Size: 148 bytes --]

-- 
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-23  9:05 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
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 [this message]
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='001401c81553$c95f6440$1c0110ac@ariga' \
    --to=ariga@link-lab.co.jp \
    --cc=alok.singh@broadcom.com \
    --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).