[ECOS] RedBoot: __eth_install_handler?

Grant Edwards grante@visi.com
Mon Jan 22 15:56:00 GMT 2001


> Attached is a patch that impliments __eth_install_handler()
> functionality.  It's currently hard-wired to allow up to 4
> handlers. The normal IP/ARP/RARP handlers are still handled
> seperately.

I should have added a warning:

The ethernet header data pointed to by pkt->eth_hdr is non-
persistent data.  It's an automatic variable in the function
calling the registered handler.  You should neither attempt to
free it nor expect it to be there after your handler returns to
the caller.

The pkt->pkt_bytes value passed to the registered handler
includes the 14 bytes in the Ethernet headers.  In hindsight, I
think __enet_poll should subtract 14 before calling the handler
so that pkt->pkt_bytes is the number of data bytes pointed to
by pkt->buf.

-- 
Grant Edwards
grante@visi.com


More information about the Ecos-discuss mailing list