sta
tic struct pbuf * low_level_input(struct netif *netif)
{
struct pbuf *p, *q;
u16_t len;
int l =0;
FrameTypeDef frame;
u8 *buffer;
p = NULL;
frame=ETH_Rx_Packet();
len=frame.length;
buffer=(u8 *)frame.buffer;
p=pbuf_alloc(PBUF_RAW,len,PBUF_POOL);
if(p!=NULL)
{
for(q=p;q!=NULL;q=q->next)
{
memcpy((u8_t*)q->payload,(u8_t*)&buffer[l], q->len);
l=l+q->len;
}
}
frame.descriptor->Status=ETH_DMARxDesc_OWN;
if((ETH->DMASRÐ_DMASR_RBUS)!=(u32)RESET)
{
ETH->DMASR=ETH_DMASR_RBUS;
ETH->DMARPDR=0;
}
return p;
}
返回的P是什么意思?不是应该返回q才对吗?