Lines Matching refs:bd

218 				 struct ethoc_bd *bd)  in ethoc_read_bd()  argument
221 bd->stat = ethoc_read(priv, offset + 0); in ethoc_read_bd()
222 bd->addr = ethoc_read(priv, offset + 4); in ethoc_read_bd()
226 const struct ethoc_bd *bd) in ethoc_write_bd() argument
229 ethoc_write(priv, offset + 0, bd->stat); in ethoc_write_bd()
230 ethoc_write(priv, offset + 4, bd->addr); in ethoc_write_bd()
262 struct ethoc_bd bd; in ethoc_init_ring() local
271 bd.stat = TX_BD_IRQ | TX_BD_CRC; in ethoc_init_ring()
272 bd.addr = 0; in ethoc_init_ring()
276 bd.addr = addr; in ethoc_init_ring()
280 bd.stat |= TX_BD_WRAP; in ethoc_init_ring()
282 ethoc_write_bd(priv, i, &bd); in ethoc_init_ring()
285 bd.stat = RX_BD_EMPTY | RX_BD_IRQ; in ethoc_init_ring()
289 bd.addr = addr; in ethoc_init_ring()
292 bd.addr = virt_to_phys(net_rx_packets[i]); in ethoc_init_ring()
295 bd.stat |= RX_BD_WRAP; in ethoc_init_ring()
299 ethoc_write_bd(priv, priv->num_tx + i, &bd); in ethoc_init_ring()
360 static int ethoc_update_rx_stats(struct ethoc_bd *bd) in ethoc_update_rx_stats() argument
364 if (bd->stat & RX_BD_TL) { in ethoc_update_rx_stats()
369 if (bd->stat & RX_BD_SF) { in ethoc_update_rx_stats()
374 if (bd->stat & RX_BD_DN) in ethoc_update_rx_stats()
377 if (bd->stat & RX_BD_CRC) { in ethoc_update_rx_stats()
382 if (bd->stat & RX_BD_OR) { in ethoc_update_rx_stats()
387 if (bd->stat & RX_BD_LC) { in ethoc_update_rx_stats()
397 struct ethoc_bd bd; in ethoc_rx_common() local
401 ethoc_read_bd(priv, entry, &bd); in ethoc_rx_common()
402 if (bd.stat & RX_BD_EMPTY) in ethoc_rx_common()
406 __func__, priv->cur_rx, bd.stat); in ethoc_rx_common()
407 if (ethoc_update_rx_stats(&bd) == 0) { in ethoc_rx_common()
408 int size = bd.stat >> 16; in ethoc_rx_common()
437 static int ethoc_update_tx_stats(struct ethoc_bd *bd) in ethoc_update_tx_stats() argument
439 if (bd->stat & TX_BD_LC) in ethoc_update_tx_stats()
442 if (bd->stat & TX_BD_RL) in ethoc_update_tx_stats()
445 if (bd->stat & TX_BD_UR) in ethoc_update_tx_stats()
448 if (bd->stat & TX_BD_CS) in ethoc_update_tx_stats()
457 struct ethoc_bd bd; in ethoc_tx() local
459 ethoc_read_bd(priv, entry, &bd); in ethoc_tx()
460 if ((bd.stat & TX_BD_READY) == 0) in ethoc_tx()
461 (void)ethoc_update_tx_stats(&bd); in ethoc_tx()
466 struct ethoc_bd bd; in ethoc_send_common() local
472 ethoc_read_bd(priv, entry, &bd); in ethoc_send_common()
474 bd.stat |= TX_BD_PAD; in ethoc_send_common()
476 bd.stat &= ~TX_BD_PAD; in ethoc_send_common()
484 bd.addr = virt_to_phys(packet); in ethoc_send_common()
487 bd.stat &= ~(TX_BD_STATS | TX_BD_LEN_MASK); in ethoc_send_common()
488 bd.stat |= TX_BD_LEN(length); in ethoc_send_common()
489 ethoc_write_bd(priv, entry, &bd); in ethoc_send_common()
492 bd.stat |= TX_BD_READY; in ethoc_send_common()
493 ethoc_write_bd(priv, entry, &bd); in ethoc_send_common()
519 struct ethoc_bd bd; in ethoc_free_pkt_common() local
524 ethoc_read_bd(priv, entry, &bd); in ethoc_free_pkt_common()
533 bd.stat &= ~RX_BD_STATS; in ethoc_free_pkt_common()
534 bd.stat |= RX_BD_EMPTY; in ethoc_free_pkt_common()
535 ethoc_write_bd(priv, entry, &bd); in ethoc_free_pkt_common()
758 static int ethoc_init(struct eth_device *dev, bd_t *bd) in ethoc_init() argument