• Home
  • Raw
  • Download

Lines Matching refs:lp

274 #define TX_BUFFS_AVAIL ((lp->tx_old<=lp->tx_new)?\
275 lp->tx_old+TX_RING_MOD_MASK-lp->tx_new:\
276 lp->tx_old - lp->tx_new-1)
302 static void load_csrs(struct lance_private *lp) in load_csrs() argument
304 volatile struct lance_regs *ll = lp->ll; in load_csrs()
317 writereg(&ll->rdp, lp->busmaster_regval); in load_csrs()
445 struct lance_private *lp = netdev_priv(dev); in lance_init_ring() local
452 lp->rx_new = lp->tx_new = 0; in lance_init_ring()
453 lp->rx_old = lp->tx_old = 0; in lance_init_ring()
458 *lib_ptr(ib, phys_addr[0], lp->type) = (dev->dev_addr[1] << 8) | in lance_init_ring()
460 *lib_ptr(ib, phys_addr[1], lp->type) = (dev->dev_addr[3] << 8) | in lance_init_ring()
462 *lib_ptr(ib, phys_addr[2], lp->type) = (dev->dev_addr[5] << 8) | in lance_init_ring()
468 *lib_ptr(ib, rx_len, lp->type) = (LANCE_LOG_RX_BUFFERS << 13) | in lance_init_ring()
470 *lib_ptr(ib, rx_ptr, lp->type) = leptr; in lance_init_ring()
473 leptr, lib_off(brx_ring, lp->type)); in lance_init_ring()
477 *lib_ptr(ib, tx_len, lp->type) = (LANCE_LOG_TX_BUFFERS << 13) | in lance_init_ring()
479 *lib_ptr(ib, tx_ptr, lp->type) = leptr; in lance_init_ring()
482 leptr, lib_off(btx_ring, lp->type)); in lance_init_ring()
489 leptr = lp->tx_buf_ptr_lnc[i]; in lance_init_ring()
490 *lib_ptr(ib, btx_ring[i].tmd0, lp->type) = leptr; in lance_init_ring()
491 *lib_ptr(ib, btx_ring[i].tmd1, lp->type) = (leptr >> 16) & in lance_init_ring()
493 *lib_ptr(ib, btx_ring[i].length, lp->type) = 0xf000; in lance_init_ring()
495 *lib_ptr(ib, btx_ring[i].misc, lp->type) = 0; in lance_init_ring()
498 i, leptr, (uint)lp->tx_buf_ptr_cpu[i]); in lance_init_ring()
505 leptr = lp->rx_buf_ptr_lnc[i]; in lance_init_ring()
506 *lib_ptr(ib, brx_ring[i].rmd0, lp->type) = leptr; in lance_init_ring()
507 *lib_ptr(ib, brx_ring[i].rmd1, lp->type) = ((leptr >> 16) & in lance_init_ring()
510 *lib_ptr(ib, brx_ring[i].length, lp->type) = -RX_BUFF_SIZE | in lance_init_ring()
512 *lib_ptr(ib, brx_ring[i].mblength, lp->type) = 0; in lance_init_ring()
515 i, leptr, (uint)lp->rx_buf_ptr_cpu[i]); in lance_init_ring()
520 static int init_restart_lance(struct lance_private *lp) in init_restart_lance() argument
522 volatile struct lance_regs *ll = lp->ll; in init_restart_lance()
551 struct lance_private *lp = netdev_priv(dev); in lance_rx() local
564 if (i == lp->rx_new) in lance_rx()
566 lp->type) & in lance_rx()
570 lp->type) & in lance_rx()
577 for (rd = lib_ptr(ib, brx_ring[lp->rx_new], lp->type); in lance_rx()
578 !((bits = *rds_ptr(rd, rmd1, lp->type)) & LE_R1_OWN); in lance_rx()
579 rd = lib_ptr(ib, brx_ring[lp->rx_new], lp->type)) { in lance_rx()
580 entry = lp->rx_new; in lance_rx()
601 len = (*rds_ptr(rd, mblength, lp->type) & 0xfff) - 4; in lance_rx()
608 *rds_ptr(rd, mblength, lp->type) = 0; in lance_rx()
609 *rds_ptr(rd, rmd1, lp->type) = in lance_rx()
610 ((lp->rx_buf_ptr_lnc[entry] >> 16) & in lance_rx()
612 lp->rx_new = (entry + 1) & RX_RING_MOD_MASK; in lance_rx()
620 cp_from_buf(lp->type, skb->data, in lance_rx()
621 (char *)lp->rx_buf_ptr_cpu[entry], len); in lance_rx()
629 *rds_ptr(rd, mblength, lp->type) = 0; in lance_rx()
630 *rds_ptr(rd, length, lp->type) = -RX_BUFF_SIZE | 0xf000; in lance_rx()
631 *rds_ptr(rd, rmd1, lp->type) = in lance_rx()
632 ((lp->rx_buf_ptr_lnc[entry] >> 16) & 0xff) | LE_R1_OWN; in lance_rx()
633 lp->rx_new = (entry + 1) & RX_RING_MOD_MASK; in lance_rx()
640 struct lance_private *lp = netdev_priv(dev); in lance_tx() local
642 volatile struct lance_regs *ll = lp->ll; in lance_tx()
647 j = lp->tx_old; in lance_tx()
649 spin_lock(&lp->lock); in lance_tx()
651 for (i = j; i != lp->tx_new; i = j) { in lance_tx()
652 td = lib_ptr(ib, btx_ring[i], lp->type); in lance_tx()
654 if (*tds_ptr(td, tmd1, lp->type) & LE_T1_OWN) in lance_tx()
657 if (*tds_ptr(td, tmd1, lp->type) & LE_T1_ERR) { in lance_tx()
658 status = *tds_ptr(td, misc, lp->type); in lance_tx()
673 load_csrs(lp); in lance_tx()
674 init_restart_lance(lp); in lance_tx()
689 load_csrs(lp); in lance_tx()
690 init_restart_lance(lp); in lance_tx()
693 } else if ((*tds_ptr(td, tmd1, lp->type) & LE_T1_POK) == in lance_tx()
698 *tds_ptr(td, tmd1, lp->type) &= ~(LE_T1_POK); in lance_tx()
701 if (*tds_ptr(td, tmd1, lp->type) & LE_T1_EONE) in lance_tx()
705 if (*tds_ptr(td, tmd1, lp->type) & LE_T1_EMORE) in lance_tx()
712 lp->tx_old = j; in lance_tx()
718 spin_unlock(&lp->lock); in lance_tx()
732 struct lance_private *lp = netdev_priv(dev); in lance_interrupt() local
733 volatile struct lance_regs *ll = lp->ll; in lance_interrupt()
765 load_csrs(lp); in lance_interrupt()
766 init_restart_lance(lp); in lance_interrupt()
778 struct lance_private *lp = netdev_priv(dev); in lance_open() local
779 volatile struct lance_regs *ll = lp->ll; in lance_open()
792 *lib_ptr(ib, mode, lp->type) = 0; in lance_open()
793 *lib_ptr(ib, filter[0], lp->type) = 0; in lance_open()
794 *lib_ptr(ib, filter[1], lp->type) = 0; in lance_open()
795 *lib_ptr(ib, filter[2], lp->type) = 0; in lance_open()
796 *lib_ptr(ib, filter[3], lp->type) = 0; in lance_open()
799 load_csrs(lp); in lance_open()
808 if (lp->dma_irq >= 0) { in lance_open()
811 if (request_irq(lp->dma_irq, &lance_dma_merr_int, 0, in lance_open()
815 lp->dma_irq); in lance_open()
830 status = init_restart_lance(lp); in lance_open()
836 struct lance_private *lp = netdev_priv(dev); in lance_close() local
837 volatile struct lance_regs *ll = lp->ll; in lance_close()
840 del_timer_sync(&lp->multicast_timer); in lance_close()
846 if (lp->dma_irq >= 0) { in lance_close()
859 free_irq(lp->dma_irq, dev); in lance_close()
867 struct lance_private *lp = netdev_priv(dev); in lance_reset() local
868 volatile struct lance_regs *ll = lp->ll; in lance_reset()
876 load_csrs(lp); in lance_reset()
878 status = init_restart_lance(lp); in lance_reset()
884 struct lance_private *lp = netdev_priv(dev); in lance_tx_timeout() local
885 volatile struct lance_regs *ll = lp->ll; in lance_tx_timeout()
895 struct lance_private *lp = netdev_priv(dev); in lance_start_xmit() local
896 volatile struct lance_regs *ll = lp->ll; in lance_start_xmit()
910 entry = lp->tx_new; in lance_start_xmit()
911 *lib_ptr(ib, btx_ring[entry].length, lp->type) = (-len); in lance_start_xmit()
912 *lib_ptr(ib, btx_ring[entry].misc, lp->type) = 0; in lance_start_xmit()
914 cp_to_buf(lp->type, (char *)lp->tx_buf_ptr_cpu[entry], skb->data, len); in lance_start_xmit()
917 *lib_ptr(ib, btx_ring[entry].tmd1, lp->type) = in lance_start_xmit()
918 ((lp->tx_buf_ptr_lnc[entry] >> 16) & 0xff) | in lance_start_xmit()
920 lp->tx_new = (entry + 1) & TX_RING_MOD_MASK; in lance_start_xmit()
936 struct lance_private *lp = netdev_priv(dev); in lance_load_multicast() local
945 *lib_ptr(ib, filter[0], lp->type) = 0xffff; in lance_load_multicast()
946 *lib_ptr(ib, filter[1], lp->type) = 0xffff; in lance_load_multicast()
947 *lib_ptr(ib, filter[2], lp->type) = 0xffff; in lance_load_multicast()
948 *lib_ptr(ib, filter[3], lp->type) = 0xffff; in lance_load_multicast()
952 *lib_ptr(ib, filter[0], lp->type) = 0; in lance_load_multicast()
953 *lib_ptr(ib, filter[1], lp->type) = 0; in lance_load_multicast()
954 *lib_ptr(ib, filter[2], lp->type) = 0; in lance_load_multicast()
955 *lib_ptr(ib, filter[3], lp->type) = 0; in lance_load_multicast()
968 *lib_ptr(ib, filter[crc >> 4], lp->type) |= 1 << (crc & 0xf); in lance_load_multicast()
975 struct lance_private *lp = netdev_priv(dev); in lance_set_multicast() local
977 volatile struct lance_regs *ll = lp->ll; in lance_set_multicast()
982 if (lp->tx_old != lp->tx_new) { in lance_set_multicast()
983 mod_timer(&lp->multicast_timer, jiffies + 4 * HZ/100); in lance_set_multicast()
996 *lib_ptr(ib, mode, lp->type) |= LE_MO_PROM; in lance_set_multicast()
998 *lib_ptr(ib, mode, lp->type) &= ~LE_MO_PROM; in lance_set_multicast()
1001 load_csrs(lp); in lance_set_multicast()
1002 init_restart_lance(lp); in lance_set_multicast()
1019 struct lance_private *lp; in dec_lance_probe() local
1036 lp = netdev_priv(dev); in dec_lance_probe()
1037 dev = lp->next; in dec_lance_probe()
1054 lp = netdev_priv(dev); in dec_lance_probe()
1055 spin_lock_init(&lp->lock); in dec_lance_probe()
1057 lp->type = type; in dec_lance_probe()
1079 lp->rx_buf_ptr_cpu[i] = in dec_lance_probe()
1082 lp->rx_buf_ptr_lnc[i] = in dec_lance_probe()
1086 lp->tx_buf_ptr_cpu[i] = in dec_lance_probe()
1090 lp->tx_buf_ptr_lnc[i] = in dec_lance_probe()
1097 lp->dma_irq = dec_interrupt[DEC_IRQ_LANCE_MERR]; in dec_lance_probe()
1121 lp->dma_irq = -1; in dec_lance_probe()
1124 lp->rx_buf_ptr_cpu[i] = in dec_lance_probe()
1127 lp->rx_buf_ptr_lnc[i] = in dec_lance_probe()
1131 lp->tx_buf_ptr_cpu[i] = in dec_lance_probe()
1135 lp->tx_buf_ptr_lnc[i] = in dec_lance_probe()
1149 lp->dma_irq = -1; in dec_lance_probe()
1155 lp->rx_buf_ptr_cpu[i] = in dec_lance_probe()
1158 lp->rx_buf_ptr_lnc[i] = in dec_lance_probe()
1162 lp->tx_buf_ptr_cpu[i] = in dec_lance_probe()
1166 lp->tx_buf_ptr_lnc[i] = in dec_lance_probe()
1234 lp->ll = ll; in dec_lance_probe()
1239 lp->busmaster_regval = 0; in dec_lance_probe()
1248 init_timer(&lp->multicast_timer); in dec_lance_probe()
1249 lp->multicast_timer.data = (unsigned long) dev; in dec_lance_probe()
1250 lp->multicast_timer.function = &lance_set_multicast_retry; in dec_lance_probe()
1260 lp->next = root_lance_dev; in dec_lance_probe()
1312 struct lance_private *lp = netdev_priv(dev); in dec_lance_platform_remove() local
1315 root_lance_dev = lp->next; in dec_lance_platform_remove()