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 ?


ariga masahiro wrote:
> Hello,
>
> I am in a complete predicament,please help me.
>
> I am testing SMSC LAN91C111 ethernet driver using nc_test_slave/master
> and managed to make it run,correctly say,I succeeded to receive ARP
> from host.
>
> But I discovered that in ether_input and ether_output functions in
> if_ethersubr.c file,
> ng_ether_input_p and ng_ether_output_p pointers are both NULL,and
> passed out function calls.
>
> \packages\net\bsd_tcpip\current\src\sys\net\if_ethersubr.c
> ether_input(ifp, eh, m)
> /* Handle ng_ether(4) processing, if any */
> if (ng_ether_input_p != NULL) {
>  (*ng_ether_input_p)(ifp, &m, eh);
>  if (m == NULL)
>   return;
> }
>
> ether_output(ifp, m, dst, rt0)
> /* Handle ng_ether(4) processing, if any */
> if (ng_ether_output_p != NULL) {
>  if ((error = (*ng_ether_output_p)(ifp, &m)) != 0) {
> bad:   if (m != NULL)
>    m_freem(m);
>   return (error);
>  }
>  if (m == NULL)
>   return (0);
> }
>
> I encountered the same problem in ether_ifattach in the same file
> where ng_ether_attach_p were NULL and passed out function call.
> But at that time I found next function fulfill need,
> so I inserted pointer assignment before function call like below.
>
> packages\net\bsd_tcpip\current\src\sys\net\if.c
> if_attach(ifp)
>
> ether_ifattach(ifp, bpf)
>    ng_ether_attach_p = if_attach;  // inserted
>   if (ng_ether_attach_p != NULL)
>      (*ng_ether_attach_p)(ifp);
>
> I hope I was right.
>
> But this time I can't find suitable functions in ether_input and
> ether_output.
> It is crestfallen to select every functions.Is there any way to select
> correctly ?
>
> Or rather,since I configured to use LAN91C111 driver specifically,
> it is unreasonable to choose each functions manually.
> There ought be the way to initialize cyg_ pointers in param.h.
>
> Please let me know how to initialize cyg_ pointers so I could use
> LAN91C111 driver properly.
You should not need to be messing with *any* of this.  The lanC91xx
driver is known to work,
as is, on a number of platforms.

I assume that this is for a new platform/port?  Did you follow the model
of how other platforms
are using this device?

-- 
------------------------------------------------------------
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


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