• Home
  • Raw
  • Download

Lines Matching refs:lp

47 	struct sonic_local *lp = netdev_priv(dev);  in sonic_open()  local
58 dev_kfree_skb(lp->rx_skb[i]); in sonic_open()
59 lp->rx_skb[i] = NULL; in sonic_open()
66 if (SONIC_BUS_SCALE(lp->dma_bitmode) == 2) in sonic_open()
68 lp->rx_skb[i] = skb; in sonic_open()
72 dma_addr_t laddr = dma_map_single(lp->device, skb_put(lp->rx_skb[i], SONIC_RBSIZE), in sonic_open()
77 dma_unmap_single(lp->device, lp->rx_laddr[i], SONIC_RBSIZE, DMA_FROM_DEVICE); in sonic_open()
78 lp->rx_laddr[i] = (dma_addr_t)0; in sonic_open()
81 dev_kfree_skb(lp->rx_skb[i]); in sonic_open()
82 lp->rx_skb[i] = NULL; in sonic_open()
88 lp->rx_laddr[i] = laddr; in sonic_open()
110 struct sonic_local *lp = netdev_priv(dev); in sonic_close() local
127 if(lp->tx_laddr[i]) { in sonic_close()
128 dma_unmap_single(lp->device, lp->tx_laddr[i], lp->tx_len[i], DMA_TO_DEVICE); in sonic_close()
129 lp->tx_laddr[i] = (dma_addr_t)0; in sonic_close()
131 if(lp->tx_skb[i]) { in sonic_close()
132 dev_kfree_skb(lp->tx_skb[i]); in sonic_close()
133 lp->tx_skb[i] = NULL; in sonic_close()
139 if(lp->rx_laddr[i]) { in sonic_close()
140 dma_unmap_single(lp->device, lp->rx_laddr[i], SONIC_RBSIZE, DMA_FROM_DEVICE); in sonic_close()
141 lp->rx_laddr[i] = (dma_addr_t)0; in sonic_close()
143 if(lp->rx_skb[i]) { in sonic_close()
144 dev_kfree_skb(lp->rx_skb[i]); in sonic_close()
145 lp->rx_skb[i] = NULL; in sonic_close()
154 struct sonic_local *lp = netdev_priv(dev); in sonic_tx_timeout() local
165 if(lp->tx_laddr[i]) { in sonic_tx_timeout()
166 dma_unmap_single(lp->device, lp->tx_laddr[i], lp->tx_len[i], DMA_TO_DEVICE); in sonic_tx_timeout()
167 lp->tx_laddr[i] = (dma_addr_t)0; in sonic_tx_timeout()
169 if(lp->tx_skb[i]) { in sonic_tx_timeout()
170 dev_kfree_skb(lp->tx_skb[i]); in sonic_tx_timeout()
171 lp->tx_skb[i] = NULL; in sonic_tx_timeout()
176 lp->stats.tx_errors++; in sonic_tx_timeout()
203 struct sonic_local *lp = netdev_priv(dev); in sonic_send_packet() local
206 int entry = lp->next_tx; in sonic_send_packet()
222 laddr = dma_map_single(lp->device, skb->data, length, DMA_TO_DEVICE); in sonic_send_packet()
243 lp->tx_len[entry] = length; in sonic_send_packet()
244 lp->tx_laddr[entry] = laddr; in sonic_send_packet()
245 lp->tx_skb[entry] = skb; in sonic_send_packet()
248 sonic_tda_put(dev, lp->eol_tx, SONIC_TD_LINK, in sonic_send_packet()
249 sonic_tda_get(dev, lp->eol_tx, SONIC_TD_LINK) & ~SONIC_EOL); in sonic_send_packet()
250 lp->eol_tx = entry; in sonic_send_packet()
252 lp->next_tx = (entry + 1) & SONIC_TDS_MASK; in sonic_send_packet()
253 if (lp->tx_skb[lp->next_tx] != NULL) { in sonic_send_packet()
278 struct sonic_local *lp = netdev_priv(dev); in sonic_interrupt() local
293 int entry = lp->cur_tx; in sonic_interrupt()
307 while (lp->tx_skb[entry] != NULL) { in sonic_interrupt()
312 lp->stats.tx_packets++; in sonic_interrupt()
313 lp->stats.tx_bytes += sonic_tda_get(dev, entry, SONIC_TD_PKTSIZE); in sonic_interrupt()
315 lp->stats.tx_errors++; in sonic_interrupt()
317 lp->stats.tx_aborted_errors++; in sonic_interrupt()
319 lp->stats.tx_carrier_errors++; in sonic_interrupt()
321 lp->stats.tx_window_errors++; in sonic_interrupt()
323 lp->stats.tx_fifo_errors++; in sonic_interrupt()
327 dev_kfree_skb_irq(lp->tx_skb[entry]); in sonic_interrupt()
328 lp->tx_skb[entry] = NULL; in sonic_interrupt()
330 dma_unmap_single(lp->device, lp->tx_laddr[entry], lp->tx_len[entry], DMA_TO_DEVICE); in sonic_interrupt()
331 lp->tx_laddr[entry] = (dma_addr_t)0; in sonic_interrupt()
341 if (freed_some || lp->tx_skb[entry] == NULL) in sonic_interrupt()
343 lp->cur_tx = entry; in sonic_interrupt()
353 lp->stats.rx_fifo_errors++; in sonic_interrupt()
359 lp->stats.rx_dropped++; in sonic_interrupt()
365 lp->stats.rx_dropped++; in sonic_interrupt()
371 lp->stats.rx_frame_errors += 65536; in sonic_interrupt()
375 lp->stats.rx_crc_errors += 65536; in sonic_interrupt()
379 lp->stats.rx_missed_errors += 65536; in sonic_interrupt()
412 struct sonic_local *lp = netdev_priv(dev); in sonic_rx() local
414 int entry = lp->cur_rx; in sonic_rx()
430 lp->stats.rx_dropped++; in sonic_rx()
434 if(SONIC_BUS_SCALE(lp->dma_bitmode) == 2) in sonic_rx()
437 new_laddr = dma_map_single(lp->device, skb_put(new_skb, SONIC_RBSIZE), in sonic_rx()
442 lp->stats.rx_dropped++; in sonic_rx()
447 dma_unmap_single(lp->device, lp->rx_laddr[entry], SONIC_RBSIZE, DMA_FROM_DEVICE); in sonic_rx()
448 used_skb = lp->rx_skb[entry]; in sonic_rx()
453 lp->stats.rx_packets++; in sonic_rx()
454 lp->stats.rx_bytes += pkt_len; in sonic_rx()
457 lp->rx_laddr[entry] = new_laddr; in sonic_rx()
458 lp->rx_skb[entry] = new_skb; in sonic_rx()
466 lp->stats.rx_errors++; in sonic_rx()
468 lp->stats.rx_frame_errors++; in sonic_rx()
470 lp->stats.rx_crc_errors++; in sonic_rx()
477 lp->cur_rwp += SIZEOF_SONIC_RR * SONIC_BUS_SCALE(lp->dma_bitmode); in sonic_rx()
478 if (lp->cur_rwp >= lp->rra_end) lp->cur_rwp = lp->rra_laddr & 0xffff; in sonic_rx()
479 SONIC_WRITE(SONIC_RWP, lp->cur_rwp); in sonic_rx()
494 sonic_rda_put(dev, lp->eol_rx, SONIC_RD_LINK, in sonic_rx()
495 sonic_rda_get(dev, lp->eol_rx, SONIC_RD_LINK) & ~SONIC_EOL); in sonic_rx()
496 lp->eol_rx = entry; in sonic_rx()
497 lp->cur_rx = entry = (entry + 1) & SONIC_RDS_MASK; in sonic_rx()
513 struct sonic_local *lp = netdev_priv(dev); in sonic_get_stats() local
516 lp->stats.rx_crc_errors += SONIC_READ(SONIC_CRCT); in sonic_get_stats()
518 lp->stats.rx_frame_errors += SONIC_READ(SONIC_FAET); in sonic_get_stats()
520 lp->stats.rx_missed_errors += SONIC_READ(SONIC_MPT); in sonic_get_stats()
523 return &lp->stats; in sonic_get_stats()
532 struct sonic_local *lp = netdev_priv(dev); in sonic_multicast_list() local
560 SONIC_WRITE(SONIC_CDP, lp->cda_laddr & 0xffff); in sonic_multicast_list()
578 struct sonic_local *lp = netdev_priv(dev); in sonic_init() local
603 u16 bufadr_l = (unsigned long)lp->rx_laddr[i] & 0xffff; in sonic_init()
604 u16 bufadr_h = (unsigned long)lp->rx_laddr[i] >> 16; in sonic_init()
612 lp->rra_end = (lp->rra_laddr + SONIC_NUM_RRS * SIZEOF_SONIC_RR * in sonic_init()
613 SONIC_BUS_SCALE(lp->dma_bitmode)) & 0xffff; in sonic_init()
614 lp->cur_rwp = (lp->rra_laddr + (SONIC_NUM_RRS - 1) * SIZEOF_SONIC_RR * in sonic_init()
615 SONIC_BUS_SCALE(lp->dma_bitmode)) & 0xffff; in sonic_init()
617 SONIC_WRITE(SONIC_RSA, lp->rra_laddr & 0xffff); in sonic_init()
618 SONIC_WRITE(SONIC_REA, lp->rra_end); in sonic_init()
619 SONIC_WRITE(SONIC_RRP, lp->rra_laddr & 0xffff); in sonic_init()
620 SONIC_WRITE(SONIC_RWP, lp->cur_rwp); in sonic_init()
621 SONIC_WRITE(SONIC_URRA, lp->rra_laddr >> 16); in sonic_init()
622 SONIC_WRITE(SONIC_EOBC, (SONIC_RBSIZE >> 1) - (lp->dma_bitmode ? 2 : 1)); in sonic_init()
653 lp->rda_laddr + in sonic_init()
654 ((i+1) * SIZEOF_SONIC_RD * SONIC_BUS_SCALE(lp->dma_bitmode))); in sonic_init()
658 (lp->rda_laddr & 0xffff) | SONIC_EOL); in sonic_init()
659 lp->eol_rx = SONIC_NUM_RDS - 1; in sonic_init()
660 lp->cur_rx = 0; in sonic_init()
661 SONIC_WRITE(SONIC_URDA, lp->rda_laddr >> 16); in sonic_init()
662 SONIC_WRITE(SONIC_CRDA, lp->rda_laddr & 0xffff); in sonic_init()
675 (lp->tda_laddr & 0xffff) + in sonic_init()
676 (i + 1) * SIZEOF_SONIC_TD * SONIC_BUS_SCALE(lp->dma_bitmode)); in sonic_init()
677 lp->tx_skb[i] = NULL; in sonic_init()
681 (lp->tda_laddr & 0xffff)); in sonic_init()
683 SONIC_WRITE(SONIC_UTDA, lp->tda_laddr >> 16); in sonic_init()
684 SONIC_WRITE(SONIC_CTDA, lp->tda_laddr & 0xffff); in sonic_init()
685 lp->cur_tx = lp->next_tx = 0; in sonic_init()
686 lp->eol_tx = SONIC_NUM_TDS - 1; in sonic_init()
702 SONIC_WRITE(SONIC_CDP, lp->cda_laddr & 0xffff); in sonic_init()