i have a pbuf from pool, where my driver has copied a packet.
i used this code:
/* We allocate a pbuf chain of pbufs from the pool. */ p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
if (p != NULL) {
#if ETH_PAD_SIZE pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */ #endif
// lock eth irq disableEthInterrupt();
/* We iterate over the pbuf chain until we have read the entire
* packet into the pbuf. */ cpyix = 0;
for( q = p; q != NULL; q = q->next ) { /* Read enough bytes to fill this pbuf in the chain. The * available data in the pbuf is given by the q->len
* variable. */