Lines Matching refs:p
85 static status_t pcnet_output(struct device *dev, struct pbuf *p);
218 struct pbuf *p = pbuf_alloc(PBUF_RAW, MAX_PACKET_SIZE, PBUF_RAM); in pcnet_init() local
220 state->rd[i].rbadr = (uint32_t) p->payload; in pcnet_init()
221 state->rd[i].bcnt = -p->tot_len; in pcnet_init()
225 state->rx_buffers[i] = p; in pcnet_init()
406 struct pbuf *p = state->tx_buffers[state->td_tail]; in pcnet_service_tx() local
407 DEBUG_ASSERT(p); in pcnet_service_tx()
411 LTRACEF("Retiring packet: td_tail=%d p=%p tot_len=%u\n", state->td_tail, p, p->tot_len); in pcnet_service_tx()
423 pbuf_free(p); in pcnet_service_tx()
450 struct pbuf *p = state->rx_buffers[state->rd_head]; in pcnet_service_rx() local
451 DEBUG_ASSERT(p); in pcnet_service_rx()
459 if (rd->mcnt <= p->tot_len) { in pcnet_service_rx()
461 pbuf_realloc(p, rd->mcnt); in pcnet_service_rx()
464 LTRACEF("payload=%p len=%u\n", p->payload, p->tot_len); in pcnet_service_rx()
465 hexdump8(p->payload, p->tot_len); in pcnet_service_rx()
468 class_netstack_input(dev, state->netstack_state, p); in pcnet_service_rx()
470 … p = state->rx_buffers[state->rd_head] = pbuf_alloc(PBUF_RAW, MAX_PACKET_SIZE, PBUF_RAM); in pcnet_service_rx()
472 LTRACEF("RX packet size error: mcnt = %u, buf len = %u\n", rd->mcnt, p->tot_len); in pcnet_service_rx()
477 memset(p->payload, 0, p->tot_len); in pcnet_service_rx()
479 rd->rbadr = (uint32_t) p->payload; in pcnet_service_rx()
480 rd->bcnt = -p->tot_len; in pcnet_service_rx()
536 static status_t pcnet_output(struct device *dev, struct pbuf *p) { in pcnet_output() argument
539 if (!dev || !p) in pcnet_output()
558 pbuf_ref(p); in pcnet_output()
559 p = pbuf_coalesce(p, PBUF_RAW); in pcnet_output()
562 LTRACEF("Queuing packet: td_head=%d p=%p tot_len=%u\n", state->td_head, p, p->tot_len); in pcnet_output()
563 hexdump8(p->payload, p->tot_len); in pcnet_output()
569 td->tbadr = (uint32_t) p->payload; in pcnet_output()
570 td->bcnt = -p->tot_len; in pcnet_output()
576 state->tx_buffers[state->td_head] = p; in pcnet_output()