[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] using etharp from ethernetif
From: |
Jani Monoses |
Subject: |
Re: [lwip-users] using etharp from ethernetif |
Date: |
Wed, 30 Apr 2003 19:07:48 +0300 |
> {
> p = etharp_output(netif, ipaddr, p);
> if(p != NULL) {
> low_level_output(netif, p);
here -> p = NULL;
> }
> return ERR_OK;
> }
>
I don't know if this is enough though.
> err_t
> low_level_output(struct netif *rt_3c905cif, struct pbuf *p)
> {
> struct pbuf *q;
> unsigned char buf[1536];
> unsigned char *bufptr;
>
> //initiate transfer;
> bufptr = buf;
>
> 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. */
> bcopy(q->payload, bufptr, q->len);
> bufptr += q->len;
> }
>
> //signal that packet should be sent;
> {
> int tmp;
> int counter=0;
>
> while((tmp = write(rt_3c905cif_fd,buf,p->tot_len)) == -1){
> counter++;
> usleep(1);
> }
> }
>
> return ERR_OK;
> }
>
>
>
>
> What's wrong??? It looks like I need to allocate memory for a pbuf
> somewhere, but I don't see where, do you???
>
> Thanks.
> Sergio