lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] LLDP Implementation for lwIP


From: Sergio R. Caprile
Subject: Re: [lwip-users] LLDP Implementation for lwIP
Date: Thu, 4 Aug 2016 11:31:31 -0300
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

>  psNetif->linkoutput = tivaif_transmit;

> If i check the tivaif_transmit function, "tivaif_transmit(struct
> netif *psNetif, struct pbuf *p)" it maps the pbuf to the MAC
> controller for transmission. It is this buffer that needs to be
> modified for LLDP frame.

Not exactly. You need to allocate a pbuf, fill it with your data, give
it to tivaif_transmit(), and free it when it is done. Unless there is
some retransmission mechanism inside LLDP (which I don't know), then it
is done when the controller has it in its memory. Unless it is a
zero-copy driver (looks so, DMA perhaps?), in which "the controller
memory and the pbuf memory is the same space", so you need to know when
it has been transmitted to free it. I have no expertise in this area,
but there is this:
http://lwip.wikia.com/wiki/Writing_a_device_driver#Notes_on_Zero-Copy_Network_interface_drivers

> However the call stack is always from TCP or DHCP (even when ARP is
> called which is a link layer packet).

That is because you said you just needed the output phase ;^)
The stack is answering because it is receiving the datagrams.
Now you need to check your input to see why. You can go two paths, and I
suggest you take both, not necessarily in this order.

(1) Go back to my first mail, where I've shown you code that explains this

(2) Read this:
        http://lwip.wikia.com/wiki/Writing_a_device_driver

ARP is link layer but is part of the IP suite, so the stack supports ARP
and the link level driver has been configured to deliver ARP to lwIP
input function.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]