Lines Matching refs:bd

219 				 struct ethoc_bd *bd)  in ethoc_read_bd()  argument
222 bd->stat = ethoc_read(priv, offset + 0); in ethoc_read_bd()
223 bd->addr = ethoc_read(priv, offset + 4); in ethoc_read_bd()
227 const struct ethoc_bd *bd) in ethoc_write_bd() argument
230 ethoc_write(priv, offset + 0, bd->stat); in ethoc_write_bd()
231 ethoc_write(priv, offset + 4, bd->addr); in ethoc_write_bd()
263 struct ethoc_bd bd; in ethoc_init_ring() local
272 bd.stat = TX_BD_IRQ | TX_BD_CRC; in ethoc_init_ring()
273 bd.addr = 0; in ethoc_init_ring()
277 bd.addr = addr; in ethoc_init_ring()
281 bd.stat |= TX_BD_WRAP; in ethoc_init_ring()
283 ethoc_write_bd(priv, i, &bd); in ethoc_init_ring()
286 bd.stat = RX_BD_EMPTY | RX_BD_IRQ; in ethoc_init_ring()
290 bd.addr = addr; in ethoc_init_ring()
293 bd.addr = virt_to_phys(net_rx_packets[i]); in ethoc_init_ring()
296 bd.stat |= RX_BD_WRAP; in ethoc_init_ring()
300 ethoc_write_bd(priv, priv->num_tx + i, &bd); in ethoc_init_ring()
361 static int ethoc_update_rx_stats(struct ethoc_bd *bd) in ethoc_update_rx_stats() argument
365 if (bd->stat & RX_BD_TL) { in ethoc_update_rx_stats()
370 if (bd->stat & RX_BD_SF) { in ethoc_update_rx_stats()
375 if (bd->stat & RX_BD_DN) in ethoc_update_rx_stats()
378 if (bd->stat & RX_BD_CRC) { in ethoc_update_rx_stats()
383 if (bd->stat & RX_BD_OR) { in ethoc_update_rx_stats()
388 if (bd->stat & RX_BD_LC) { in ethoc_update_rx_stats()
398 struct ethoc_bd bd; in ethoc_rx_common() local
402 ethoc_read_bd(priv, entry, &bd); in ethoc_rx_common()
403 if (bd.stat & RX_BD_EMPTY) in ethoc_rx_common()
407 __func__, priv->cur_rx, bd.stat); in ethoc_rx_common()
408 if (ethoc_update_rx_stats(&bd) == 0) { in ethoc_rx_common()
409 int size = bd.stat >> 16; in ethoc_rx_common()
438 static int ethoc_update_tx_stats(struct ethoc_bd *bd) in ethoc_update_tx_stats() argument
440 if (bd->stat & TX_BD_LC) in ethoc_update_tx_stats()
443 if (bd->stat & TX_BD_RL) in ethoc_update_tx_stats()
446 if (bd->stat & TX_BD_UR) in ethoc_update_tx_stats()
449 if (bd->stat & TX_BD_CS) in ethoc_update_tx_stats()
458 struct ethoc_bd bd; in ethoc_tx() local
460 ethoc_read_bd(priv, entry, &bd); in ethoc_tx()
461 if ((bd.stat & TX_BD_READY) == 0) in ethoc_tx()
462 (void)ethoc_update_tx_stats(&bd); in ethoc_tx()
467 struct ethoc_bd bd; in ethoc_send_common() local
473 ethoc_read_bd(priv, entry, &bd); in ethoc_send_common()
475 bd.stat |= TX_BD_PAD; in ethoc_send_common()
477 bd.stat &= ~TX_BD_PAD; in ethoc_send_common()
485 bd.addr = virt_to_phys(packet); in ethoc_send_common()
488 bd.stat &= ~(TX_BD_STATS | TX_BD_LEN_MASK); in ethoc_send_common()
489 bd.stat |= TX_BD_LEN(length); in ethoc_send_common()
490 ethoc_write_bd(priv, entry, &bd); in ethoc_send_common()
493 bd.stat |= TX_BD_READY; in ethoc_send_common()
494 ethoc_write_bd(priv, entry, &bd); in ethoc_send_common()
520 struct ethoc_bd bd; in ethoc_free_pkt_common() local
525 ethoc_read_bd(priv, entry, &bd); in ethoc_free_pkt_common()
534 bd.stat &= ~RX_BD_STATS; in ethoc_free_pkt_common()
535 bd.stat |= RX_BD_EMPTY; in ethoc_free_pkt_common()
536 ethoc_write_bd(priv, entry, &bd); in ethoc_free_pkt_common()
759 static int ethoc_init(struct eth_device *dev, struct bd_info *bd) in ethoc_init() argument