[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Mapping pbuf to Buffer Descriptor on MPC582T
From: |
Jonathan Larmour |
Subject: |
Re: [lwip-users] Mapping pbuf to Buffer Descriptor on MPC582T |
Date: |
Wed, 14 Nov 2007 15:19:32 +0000 |
User-agent: |
Thunderbird 1.5.0.12 (X11/20070530) |
Muhamad Ikhwan Ismail wrote:
>
>
> Hmm I thought this is the flow of the output :
> netif->output(ethernetif_output) --> etharp_output (resolve
> ARP)-->netif->lowleveloutput
No, you will see in netif/etharp.c that etharp_send_ip calls
netif->linkoutput (which will be the low_level_output function set up
previously).
So:
netif->output == etharp_output
netif->linkoutput == low_level_output
and the flow is:
The stack calls netif->output (==etharp_output), which in due course calls
netif->linkoutput (==low_level_output)
There will be also be other calls from the etharp module to the linkoutput
function, to handle making ARP requests.
> I know that low level output is meant for for the actual
> transmission but my q really is..
> is the the first pbuf in the chain's payload pointer points to the
> headers...or the actual data
It points to the headers.
> without the headers..cause I read adam dunkel's notes and there he
> mentioned that the
> payload points the to the actual data.. skipping the headers. Can
> someone help me clarify that ?
The payload points to the data for an application - i.e. when using the
APIs. When an application sends or receives a pbuf, the payload points to
the data then. Deep in the stack, things are different.
Jifl
>> Date: Tue, 13 Nov 2007 18:47:17 +0000
>> From: address@hidden
>> To: address@hidden
>> Subject: Re: [lwip-users] Mapping pbuf to Buffer Descriptor on MPC582T
>>
>> Muhamad Ikhwan Ismail wrote:
>> >
>> > Hi guys,
>> >
>> > I am porting lwip1.2.0(not using CVS for updates) to MPC852t with a
>> > commercial RTOS from MQX I am a beginner in lwip. Got 2 qs on a problem
>> > I am having.
>> >
>> > 1. MPC852T has a dual port ram with buffer descriptors, which have
>> > pointers to the buffer/frame to be sent and the Ethernet controller
>> > automatically fetch the pointed data for transmission as soon as I set a
>> > flag up. The problem lies on the fact that the first-in-chain pbuf
>> > payload pointer points to the actual data and skipped the headers, or at
>> > least that is the way I understood it from the manual.
>>
>> No, the netif output function should be being called with the payload
>> pointing to the headers, as you would hope and expect.
>>
>> But perhaps the problem is that you have set the netif->output function to
>> be your driver, rather than etharp_output. You should find the
>> src/netif/ethernetif.c template driver gives you an idea of what's
>> involved, including in its init function:
>>
>> netif->output = etharp_output;
>> netif->linkoutput = low_level_output;
>>
>> Where low_level_output is that driver's call to transmit a packet.
>>
>> > 2. Can someone show me how do I initialise the lwip stack to be used
>> > with the sockets API (maybe the flow)?
>>
>> This has been tidied up and changed quite a bit in CVS, but even for 1.2.0
>> you should find an example of the functions to call to initialise the
> stack
>> in the ports directory hierarchy.
>>
>> > And is the usage of the sockets
>> > api allows the lwip to be multithreading able ?
>>
>> The code in CVS is a bit safer for multithreading. But in whichever code
>> base, it's important to remember that with lwIP you cannot use the same
>> socket (or netconn) from multiple threads. You can have different sockets
>> used by different threads though.
>>
>> Jifl
>> --
>> eCosCentric Limited http://www.eCosCentric.com/ The eCos experts
>> Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
>> Registered in England and Wales: Reg No 4422071.
>> ------["Si fractum non sit, noli id reficere"]------ Opinions==mine
>>
>>
>> _______________________________________________
>> lwip-users mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
> Windows Live Hotmail and Microsoft Office Outlook – together at last.
> Get it now!
> <http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
--
eCosCentric Limited http://www.eCosCentric.com/ The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------ Opinions==mine