This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
What functions should I call in ethernet drv ?
- From: "ariga masahiro" <ariga at link-lab dot co dot jp>
- To: "Andrew Lunn" <andrew at lunn dot ch>
- Cc: <ecos-discuss at ecos dot sourceware dot org>
- Date: Mon, 15 Oct 2007 14:55:03 +0900
- Subject: [ECOS] What functions should I call in ethernet drv ?
- References: <000501c7f691$4847e2f0$1c0110ac@ariga> <20070914082224.GA16840@lunn.ch>
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.
I need your help urgently.
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