lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] using etharp from ethernetif


From: Sergio PérezAlcañiz
Subject: Re: [lwip-users] using etharp from ethernetif
Date: Wed, 30 Apr 2003 17:52:11 +0200 (CEST)
User-agent: IMP/PHP IMAP webmail program 2.2.3

Mensaje citado por: Jani Monoses <address@hidden>:

> the coldfire and cs8900 drivers are up to date
> ethernetif.c is still not
> what problems are you experiencing?
> 

The problem is sending packets. It looks like etharp_output doesn't returns what
it should. Take a look at my code:

 /*---------------------------------------------------------*/
static err_t
rt_3c905cif_output(struct netif *netif, struct pbuf *p,
                  struct ip_addr *ipaddr)
{
  p = etharp_output(netif, ipaddr, p);
  if(p != NULL) {
    low_level_output(netif, p);
  }
  return ERR_OK;
}


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




reply via email to

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