This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What functions should I call in ethernet drv ?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]