lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] network driver code for ethernetif.c


From: FreeRTOS Info
Subject: Re: [lwip-users] network driver code for ethernetif.c
Date: Sun, 15 Jan 2012 14:01:58 +0000
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0


On 15/01/2012 13:41, V l wrote:
> I studied through my network interface driver and gained sufficient
> understanding of the network stack.
> I have ported lwip to the ARM device and now in stage of writing the
> ethernetif.c file to interface with my network driver .
> I know now that I have to just replace
> 
> for(q = p; q != NULL; q = q->next) {
>     /* Send the data from the pbuf to the interface, one pbuf at a
>        time. The size of the data in each pbuf is kept in the ->len
>        variable. */
>     send data from(q->payload, q->len);
>   }
> 
> 
> send data from(q->payload, q->len); with my driver specific code to send
> the packet . Very nice ! But when I compile this code , its going to ask
> where this driver specific senddata is defined , the header file or
> library .
> How do I resolve this part of the riddle . Its a little newbie kind of
> question . But I have tried , I give up now. Plz help.
> Regards
> Sraddha


You need to write a driver function that sends q->len bytes from
q->payload to the Ethernet hardware.  Where you define that function is
up to you.  You then replace the place-holder text with whatever your
function is called.  Say your function has the following prototype:

long lSendBytesToMAC( xNIC *pvYourInterface, uint8_t *pucBuffer,
uint32_t ulNumBytesToSend );

Then you simply change the code:
"send data from(q->payload, q->len)

to:
lSendBytesToMAC( [whatever], q->payload, q->len );

To compile the file you need to place the prototype for your driver
specific file in a header file (forget the name) that is included from
the same source file.  Naturally, you also have to add your driver
source files (the one where lSendBytesToMAC() is implemented) to the
build too.

I'm not sure if that answers your question.


Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers.
More than 7000 downloads per month.








reply via email to

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