Lines Matching refs:lp

335 #define HAVE_DMA_RXALIGN(lp)	likely((lp)->chiptype != TC35815CF)  argument
440 static inline dma_addr_t fd_virt_to_bus(struct tc35815_local *lp, void *virt) in fd_virt_to_bus() argument
442 return lp->fd_buf_dma + ((u8 *)virt - (u8 *)lp->fd_buf); in fd_virt_to_bus()
445 static inline void *fd_bus_to_virt(struct tc35815_local *lp, dma_addr_t bus) in fd_bus_to_virt() argument
447 return (void *)((u8 *)lp->fd_buf + (bus - lp->fd_buf_dma)); in fd_bus_to_virt()
541 struct tc35815_local *lp = netdev_priv(dev); in tc_handle_link_change() local
542 struct phy_device *phydev = lp->phy_dev; in tc_handle_link_change()
546 spin_lock_irqsave(&lp->lock, flags); in tc_handle_link_change()
548 (lp->speed != phydev->speed || lp->duplex != phydev->duplex)) { in tc_handle_link_change()
574 lp->chiptype != TC35815_TX4939) in tc_handle_link_change()
578 lp->speed = phydev->speed; in tc_handle_link_change()
579 lp->duplex = phydev->duplex; in tc_handle_link_change()
583 if (phydev->link != lp->link) { in tc_handle_link_change()
589 lp->speed = 0; in tc_handle_link_change()
590 lp->duplex = -1; in tc_handle_link_change()
592 lp->link = phydev->link; in tc_handle_link_change()
596 spin_unlock_irqrestore(&lp->lock, flags); in tc_handle_link_change()
598 if (status_change && netif_msg_link(lp)) { in tc_handle_link_change()
610 struct tc35815_local *lp = netdev_priv(dev); in tc_mii_probe() local
617 if (lp->mii_bus->phy_map[phy_addr]) { in tc_mii_probe()
623 phydev = lp->mii_bus->phy_map[phy_addr]; in tc_mii_probe()
636 lp->chiptype == TC35815_TX4939 ? PHY_INTERFACE_MODE_RMII : PHY_INTERFACE_MODE_MII); in tc_mii_probe()
660 lp->link = 0; in tc_mii_probe()
661 lp->speed = 0; in tc_mii_probe()
662 lp->duplex = -1; in tc_mii_probe()
663 lp->phy_dev = phydev; in tc_mii_probe()
670 struct tc35815_local *lp = netdev_priv(dev); in tc_mii_init() local
674 lp->mii_bus = mdiobus_alloc(); in tc_mii_init()
675 if (lp->mii_bus == NULL) { in tc_mii_init()
680 lp->mii_bus->name = "tc35815_mii_bus"; in tc_mii_init()
681 lp->mii_bus->read = tc_mdio_read; in tc_mii_init()
682 lp->mii_bus->write = tc_mdio_write; in tc_mii_init()
683 snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "%x", in tc_mii_init()
684 (lp->pci_dev->bus->number << 8) | lp->pci_dev->devfn); in tc_mii_init()
685 lp->mii_bus->priv = dev; in tc_mii_init()
686 lp->mii_bus->parent = &lp->pci_dev->dev; in tc_mii_init()
687 lp->mii_bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); in tc_mii_init()
688 if (!lp->mii_bus->irq) { in tc_mii_init()
694 lp->mii_bus->irq[i] = PHY_POLL; in tc_mii_init()
696 err = mdiobus_register(lp->mii_bus); in tc_mii_init()
705 mdiobus_unregister(lp->mii_bus); in tc_mii_init()
707 kfree(lp->mii_bus->irq); in tc_mii_init()
709 mdiobus_free(lp->mii_bus); in tc_mii_init()
730 struct tc35815_local *lp = netdev_priv(dev); in tc35815_read_plat_dev_addr() local
732 lp->pci_dev, tc35815_mac_match); in tc35815_read_plat_dev_addr()
791 struct tc35815_local *lp; in tc35815_init_one() local
808 dev = alloc_etherdev(sizeof(*lp)); in tc35815_init_one()
813 lp = netdev_priv(dev); in tc35815_init_one()
814 lp->dev = dev; in tc35815_init_one()
830 netif_napi_add(dev, &lp->napi, tc35815_poll, NAPI_WEIGHT); in tc35815_init_one()
835 INIT_WORK(&lp->restart_work, tc35815_restart_work); in tc35815_init_one()
836 spin_lock_init(&lp->lock); in tc35815_init_one()
837 spin_lock_init(&lp->rx_lock); in tc35815_init_one()
838 lp->pci_dev = pdev; in tc35815_init_one()
839 lp->chiptype = ent->driver_data; in tc35815_init_one()
841 lp->msg_enable = NETIF_MSG_TX_ERR | NETIF_MSG_HW | NETIF_MSG_DRV | NETIF_MSG_LINK; in tc35815_init_one()
881 struct tc35815_local *lp = netdev_priv(dev); in tc35815_remove_one() local
883 phy_disconnect(lp->phy_dev); in tc35815_remove_one()
884 mdiobus_unregister(lp->mii_bus); in tc35815_remove_one()
885 kfree(lp->mii_bus->irq); in tc35815_remove_one()
886 mdiobus_free(lp->mii_bus); in tc35815_remove_one()
894 struct tc35815_local *lp = netdev_priv(dev); in tc35815_init_queues() local
898 if (!lp->fd_buf) { in tc35815_init_queues()
905 lp->fd_buf = pci_alloc_consistent(lp->pci_dev, in tc35815_init_queues()
907 &lp->fd_buf_dma); in tc35815_init_queues()
908 if (!lp->fd_buf) in tc35815_init_queues()
911 lp->rx_skbs[i].skb = in tc35815_init_queues()
912 alloc_rxbuf_skb(dev, lp->pci_dev, in tc35815_init_queues()
913 &lp->rx_skbs[i].skb_dma); in tc35815_init_queues()
914 if (!lp->rx_skbs[i].skb) { in tc35815_init_queues()
916 free_rxbuf_skb(lp->pci_dev, in tc35815_init_queues()
917 lp->rx_skbs[i].skb, in tc35815_init_queues()
918 lp->rx_skbs[i].skb_dma); in tc35815_init_queues()
919 lp->rx_skbs[i].skb = NULL; in tc35815_init_queues()
921 pci_free_consistent(lp->pci_dev, in tc35815_init_queues()
923 lp->fd_buf, in tc35815_init_queues()
924 lp->fd_buf_dma); in tc35815_init_queues()
925 lp->fd_buf = NULL; in tc35815_init_queues()
930 dev->name, lp->fd_buf); in tc35815_init_queues()
934 clear_page((void *)((unsigned long)lp->fd_buf + in tc35815_init_queues()
937 fd_addr = (unsigned long)lp->fd_buf; in tc35815_init_queues()
940 lp->rfd_base = (struct RxFD *)fd_addr; in tc35815_init_queues()
943 lp->rfd_base[i].fd.FDCtl = cpu_to_le32(FD_CownsFD); in tc35815_init_queues()
944 lp->rfd_cur = lp->rfd_base; in tc35815_init_queues()
945 lp->rfd_limit = (struct RxFD *)fd_addr - (RX_FD_RESERVE + 1); in tc35815_init_queues()
948 lp->tfd_base = (struct TxFD *)fd_addr; in tc35815_init_queues()
951 lp->tfd_base[i].fd.FDNext = cpu_to_le32(fd_virt_to_bus(lp, &lp->tfd_base[i+1])); in tc35815_init_queues()
952 lp->tfd_base[i].fd.FDSystem = cpu_to_le32(0xffffffff); in tc35815_init_queues()
953 lp->tfd_base[i].fd.FDCtl = cpu_to_le32(0); in tc35815_init_queues()
955 lp->tfd_base[TX_FD_NUM-1].fd.FDNext = cpu_to_le32(fd_virt_to_bus(lp, &lp->tfd_base[0])); in tc35815_init_queues()
956 lp->tfd_start = 0; in tc35815_init_queues()
957 lp->tfd_end = 0; in tc35815_init_queues()
960 lp->fbl_ptr = (struct FrFD *)fd_addr; in tc35815_init_queues()
961 lp->fbl_ptr->fd.FDNext = cpu_to_le32(fd_virt_to_bus(lp, lp->fbl_ptr)); in tc35815_init_queues()
962 lp->fbl_ptr->fd.FDCtl = cpu_to_le32(RX_BUF_NUM | FD_CownsFD); in tc35815_init_queues()
968 lp->fbl_count = 0; in tc35815_init_queues()
970 if (lp->rx_skbs[i].skb) { in tc35815_init_queues()
971 if (i != lp->fbl_count) { in tc35815_init_queues()
972 lp->rx_skbs[lp->fbl_count].skb = in tc35815_init_queues()
973 lp->rx_skbs[i].skb; in tc35815_init_queues()
974 lp->rx_skbs[lp->fbl_count].skb_dma = in tc35815_init_queues()
975 lp->rx_skbs[i].skb_dma; in tc35815_init_queues()
977 lp->fbl_count++; in tc35815_init_queues()
981 if (i >= lp->fbl_count) { in tc35815_init_queues()
982 lp->fbl_ptr->bd[i].BuffData = 0; in tc35815_init_queues()
983 lp->fbl_ptr->bd[i].BDCtl = 0; in tc35815_init_queues()
986 lp->fbl_ptr->bd[i].BuffData = in tc35815_init_queues()
987 cpu_to_le32(lp->rx_skbs[i].skb_dma); in tc35815_init_queues()
989 lp->fbl_ptr->bd[i].BDCtl = in tc35815_init_queues()
995 dev->name, lp->tfd_base, lp->rfd_base, lp->fbl_ptr); in tc35815_init_queues()
1002 struct tc35815_local *lp = netdev_priv(dev); in tc35815_clear_queues() local
1006 u32 fdsystem = le32_to_cpu(lp->tfd_base[i].fd.FDSystem); in tc35815_clear_queues()
1009 lp->tx_skbs[fdsystem].skb : NULL; in tc35815_clear_queues()
1011 if (lp->tx_skbs[i].skb != skb) { in tc35815_clear_queues()
1016 BUG_ON(lp->tx_skbs[i].skb != skb); in tc35815_clear_queues()
1019 pci_unmap_single(lp->pci_dev, lp->tx_skbs[i].skb_dma, skb->len, PCI_DMA_TODEVICE); in tc35815_clear_queues()
1020 lp->tx_skbs[i].skb = NULL; in tc35815_clear_queues()
1021 lp->tx_skbs[i].skb_dma = 0; in tc35815_clear_queues()
1024 lp->tfd_base[i].fd.FDSystem = cpu_to_le32(0xffffffff); in tc35815_clear_queues()
1033 struct tc35815_local *lp = netdev_priv(dev); in tc35815_free_queues() local
1036 if (lp->tfd_base) { in tc35815_free_queues()
1038 u32 fdsystem = le32_to_cpu(lp->tfd_base[i].fd.FDSystem); in tc35815_free_queues()
1041 lp->tx_skbs[fdsystem].skb : NULL; in tc35815_free_queues()
1043 if (lp->tx_skbs[i].skb != skb) { in tc35815_free_queues()
1048 BUG_ON(lp->tx_skbs[i].skb != skb); in tc35815_free_queues()
1052 pci_unmap_single(lp->pci_dev, lp->tx_skbs[i].skb_dma, skb->len, PCI_DMA_TODEVICE); in tc35815_free_queues()
1053 lp->tx_skbs[i].skb = NULL; in tc35815_free_queues()
1054 lp->tx_skbs[i].skb_dma = 0; in tc35815_free_queues()
1056 lp->tfd_base[i].fd.FDSystem = cpu_to_le32(0xffffffff); in tc35815_free_queues()
1060 lp->rfd_base = NULL; in tc35815_free_queues()
1061 lp->rfd_limit = NULL; in tc35815_free_queues()
1062 lp->rfd_cur = NULL; in tc35815_free_queues()
1063 lp->fbl_ptr = NULL; in tc35815_free_queues()
1066 if (lp->rx_skbs[i].skb) { in tc35815_free_queues()
1067 free_rxbuf_skb(lp->pci_dev, lp->rx_skbs[i].skb, in tc35815_free_queues()
1068 lp->rx_skbs[i].skb_dma); in tc35815_free_queues()
1069 lp->rx_skbs[i].skb = NULL; in tc35815_free_queues()
1072 if (lp->fd_buf) { in tc35815_free_queues()
1073 pci_free_consistent(lp->pci_dev, PAGE_SIZE * FD_PAGE_NUM, in tc35815_free_queues()
1074 lp->fd_buf, lp->fd_buf_dma); in tc35815_free_queues()
1075 lp->fd_buf = NULL; in tc35815_free_queues()
1137 struct tc35815_local *lp = netdev_priv(dev); in panic_queues() local
1141 lp->tfd_base, lp->tfd_start, lp->tfd_end); in panic_queues()
1143 lp->rfd_base, lp->rfd_limit, lp->rfd_cur); in panic_queues()
1144 printk("FrFD %p\n", lp->fbl_ptr); in panic_queues()
1146 dump_txfd(&lp->tfd_base[i]); in panic_queues()
1148 int bd_count = dump_rxfd(&lp->rfd_base[i]); in panic_queues()
1151 dump_frfd(lp->fbl_ptr); in panic_queues()
1165 struct tc35815_local *lp = netdev_priv(dev); in tc35815_tx_full() local
1166 return (lp->tfd_start + 1) % TX_FD_NUM == lp->tfd_end; in tc35815_tx_full()
1171 struct tc35815_local *lp = netdev_priv(dev); in tc35815_restart() local
1174 if (lp->phy_dev) { in tc35815_restart()
1175 ret = phy_init_hw(lp->phy_dev); in tc35815_restart()
1180 spin_lock_bh(&lp->rx_lock); in tc35815_restart()
1181 spin_lock_irq(&lp->lock); in tc35815_restart()
1187 spin_unlock_irq(&lp->lock); in tc35815_restart()
1188 spin_unlock_bh(&lp->rx_lock); in tc35815_restart()
1195 struct tc35815_local *lp = in tc35815_restart_work() local
1197 struct net_device *dev = lp->dev; in tc35815_restart_work()
1204 struct tc35815_local *lp = netdev_priv(dev); in tc35815_schedule_restart() local
1210 spin_lock_irqsave(&lp->lock, flags); in tc35815_schedule_restart()
1213 schedule_work(&lp->restart_work); in tc35815_schedule_restart()
1214 spin_unlock_irqrestore(&lp->lock, flags); in tc35815_schedule_restart()
1241 struct tc35815_local *lp = netdev_priv(dev); in tc35815_open() local
1258 napi_enable(&lp->napi); in tc35815_open()
1261 spin_lock_irq(&lp->lock); in tc35815_open()
1263 spin_unlock_irq(&lp->lock); in tc35815_open()
1267 phy_start(lp->phy_dev); in tc35815_open()
1284 struct tc35815_local *lp = netdev_priv(dev); in tc35815_send_packet() local
1302 spin_lock_irqsave(&lp->lock, flags); in tc35815_send_packet()
1305 if ((lp->tfd_start + TX_FD_NUM - lp->tfd_end) % TX_FD_NUM > in tc35815_send_packet()
1309 if (netif_msg_pktdata(lp)) in tc35815_send_packet()
1312 if (lp->tx_skbs[lp->tfd_start].skb) { in tc35815_send_packet()
1317 BUG_ON(lp->tx_skbs[lp->tfd_start].skb); in tc35815_send_packet()
1319 lp->tx_skbs[lp->tfd_start].skb = skb; in tc35815_send_packet()
1320lp->tx_skbs[lp->tfd_start].skb_dma = pci_map_single(lp->pci_dev, skb->data, skb->len, PCI_DMA_TODE… in tc35815_send_packet()
1323 txfd = &lp->tfd_base[lp->tfd_start]; in tc35815_send_packet()
1324 txfd->bd.BuffData = cpu_to_le32(lp->tx_skbs[lp->tfd_start].skb_dma); in tc35815_send_packet()
1326 txfd->fd.FDSystem = cpu_to_le32(lp->tfd_start); in tc35815_send_packet()
1329 if (lp->tfd_start == lp->tfd_end) { in tc35815_send_packet()
1335 if (netif_msg_tx_queued(lp)) { in tc35815_send_packet()
1339 tc_writel(fd_virt_to_bus(lp, txfd), &tr->TxFrmPtr); in tc35815_send_packet()
1342 if (netif_msg_tx_queued(lp)) { in tc35815_send_packet()
1347 lp->tfd_start = (lp->tfd_start + 1) % TX_FD_NUM; in tc35815_send_packet()
1354 if (netif_msg_tx_queued(lp)) in tc35815_send_packet()
1363 spin_unlock_irqrestore(&lp->lock, flags); in tc35815_send_packet()
1390 struct tc35815_local *lp = netdev_priv(dev); in tc35815_do_interrupt() local
1400 if (netif_msg_rx_err(lp)) in tc35815_do_interrupt()
1408 if (netif_msg_rx_err(lp)) in tc35815_do_interrupt()
1416 if (netif_msg_rx_err(lp)) in tc35815_do_interrupt()
1428 lp->lstats.rx_ints++; in tc35815_do_interrupt()
1432 lp->lstats.tx_ints++; in tc35815_do_interrupt()
1433 spin_lock_irq(&lp->lock); in tc35815_do_interrupt()
1435 spin_unlock_irq(&lp->lock); in tc35815_do_interrupt()
1449 struct tc35815_local *lp = netdev_priv(dev); in tc35815_interrupt() local
1457 if (napi_schedule_prep(&lp->napi)) in tc35815_interrupt()
1458 __napi_schedule(&lp->napi); in tc35815_interrupt()
1483 struct tc35815_local *lp = netdev_priv(dev); in tc35815_rx() local
1488 while (!((fdctl = le32_to_cpu(lp->rfd_cur->fd.FDCtl)) & FD_CownsFD)) { in tc35815_rx()
1489 int status = le32_to_cpu(lp->rfd_cur->fd.FDStat); in tc35815_rx()
1499 if (netif_msg_rx_status(lp)) in tc35815_rx()
1500 dump_rxfd(lp->rfd_cur); in tc35815_rx()
1509 cur_bd = (le32_to_cpu(lp->rfd_cur->bd[0].BDCtl) in tc35815_rx()
1516 BUG_ON(lp->rx_skbs[cur_bd].skb_dma != in tc35815_rx()
1517 (le32_to_cpu(lp->rfd_cur->bd[0].BuffData) & ~3)); in tc35815_rx()
1518 if (!lp->rx_skbs[cur_bd].skb) { in tc35815_rx()
1525 skb = lp->rx_skbs[cur_bd].skb; in tc35815_rx()
1527 lp->rx_skbs[cur_bd].skb = NULL; in tc35815_rx()
1528 pci_unmap_single(lp->pci_dev, in tc35815_rx()
1529 lp->rx_skbs[cur_bd].skb_dma, in tc35815_rx()
1531 if (!HAVE_DMA_RXALIGN(lp) && NET_IP_ALIGN) in tc35815_rx()
1535 if (netif_msg_pktdata(lp)) in tc35815_rx()
1544 if (netif_msg_rx_err(lp)) in tc35815_rx()
1564 int bdctl = le32_to_cpu(lp->rfd_cur->bd[bd_count - 1].BDCtl); in tc35815_rx()
1576 lp->fbl_count--; in tc35815_rx()
1577 while (lp->fbl_count < RX_BUF_NUM) in tc35815_rx()
1580 (id + 1 + lp->fbl_count) % RX_BUF_NUM; in tc35815_rx()
1581 struct BDesc *bd = &lp->fbl_ptr->bd[curid]; in tc35815_rx()
1591 if (!lp->rx_skbs[curid].skb) { in tc35815_rx()
1592 lp->rx_skbs[curid].skb = in tc35815_rx()
1594 lp->pci_dev, in tc35815_rx()
1595 &lp->rx_skbs[curid].skb_dma); in tc35815_rx()
1596 if (!lp->rx_skbs[curid].skb) in tc35815_rx()
1598 bd->BuffData = cpu_to_le32(lp->rx_skbs[curid].skb_dma); in tc35815_rx()
1604 lp->fbl_count++; in tc35815_rx()
1610 next_rfd = fd_bus_to_virt(lp, in tc35815_rx()
1611 le32_to_cpu(lp->rfd_cur->fd.FDNext)); in tc35815_rx()
1612 if (next_rfd < lp->rfd_base || next_rfd > lp->rfd_limit) { in tc35815_rx()
1620 lp->rfd_cur->fd.FDNext = cpu_to_le32(0xdeaddead); in tc35815_rx()
1622 lp->rfd_cur->fd.FDNext = cpu_to_le32(FD_Next_EOL); in tc35815_rx()
1624 lp->rfd_cur->fd.FDCtl = cpu_to_le32(FD_CownsFD); in tc35815_rx()
1625 lp->rfd_cur++; in tc35815_rx()
1627 if (lp->rfd_cur > lp->rfd_limit) in tc35815_rx()
1628 lp->rfd_cur = lp->rfd_base; in tc35815_rx()
1630 if (lp->rfd_cur != next_rfd) in tc35815_rx()
1632 lp->rfd_cur, next_rfd); in tc35815_rx()
1641 struct tc35815_local *lp = container_of(napi, struct tc35815_local, napi); in tc35815_poll() local
1642 struct net_device *dev = lp->dev; in tc35815_poll()
1651 spin_lock(&lp->rx_lock); in tc35815_poll()
1669 spin_unlock(&lp->rx_lock); in tc35815_poll()
1684 struct tc35815_local *lp = netdev_priv(dev); in tc35815_check_tx_stat() local
1694 if (lp->chiptype == TC35815_TX4939) in tc35815_check_tx_stat()
1697 if (!lp->link || lp->duplex == DUPLEX_FULL) in tc35815_check_tx_stat()
1714 if (lp->lstats.tx_underrun < TX_THRESHOLD_KEEP_LIMIT) { in tc35815_check_tx_stat()
1715 lp->lstats.tx_underrun++; in tc35815_check_tx_stat()
1716 if (lp->lstats.tx_underrun >= TX_THRESHOLD_KEEP_LIMIT) { in tc35815_check_tx_stat()
1744 if (msg && netif_msg_tx_err(lp)) in tc35815_check_tx_stat()
1754 struct tc35815_local *lp = netdev_priv(dev); in tc35815_txdone() local
1758 txfd = &lp->tfd_base[lp->tfd_end]; in tc35815_txdone()
1759 while (lp->tfd_start != lp->tfd_end && in tc35815_txdone()
1766 if (netif_msg_tx_done(lp)) { in tc35815_txdone()
1773 lp->tx_skbs[fdsystem].skb : NULL; in tc35815_txdone()
1775 if (lp->tx_skbs[lp->tfd_end].skb != skb) { in tc35815_txdone()
1780 BUG_ON(lp->tx_skbs[lp->tfd_end].skb != skb); in tc35815_txdone()
1784 pci_unmap_single(lp->pci_dev, lp->tx_skbs[lp->tfd_end].skb_dma, skb->len, PCI_DMA_TODEVICE); in tc35815_txdone()
1785 lp->tx_skbs[lp->tfd_end].skb = NULL; in tc35815_txdone()
1786 lp->tx_skbs[lp->tfd_end].skb_dma = 0; in tc35815_txdone()
1791 lp->tfd_end = (lp->tfd_end + 1) % TX_FD_NUM; in tc35815_txdone()
1792 txfd = &lp->tfd_base[lp->tfd_end]; in tc35815_txdone()
1794 if ((fdnext & ~FD_Next_EOL) != fd_virt_to_bus(lp, txfd)) { in tc35815_txdone()
1801 if (lp->tfd_end != lp->tfd_start) { in tc35815_txdone()
1804 int head = (lp->tfd_start + TX_FD_NUM - 1) % TX_FD_NUM; in tc35815_txdone()
1805 struct TxFD *txhead = &lp->tfd_base[head]; in tc35815_txdone()
1806 int qlen = (lp->tfd_start + TX_FD_NUM in tc35815_txdone()
1807 - lp->tfd_end) % TX_FD_NUM; in tc35815_txdone()
1816 if (lp->lstats.max_tx_qlen < qlen) in tc35815_txdone()
1817 lp->lstats.max_tx_qlen = qlen; in tc35815_txdone()
1823 if (netif_msg_tx_queued(lp)) { in tc35815_txdone()
1828 tc_writel(fd_virt_to_bus(lp, txfd), &tr->TxFrmPtr); in tc35815_txdone()
1846 struct tc35815_local *lp = netdev_priv(dev); in tc35815_close() local
1849 napi_disable(&lp->napi); in tc35815_close()
1850 if (lp->phy_dev) in tc35815_close()
1851 phy_stop(lp->phy_dev); in tc35815_close()
1852 cancel_work_sync(&lp->restart_work); in tc35815_close()
1881 struct tc35815_local *lp = netdev_priv(dev); in tc35815_set_cam_entry() local
1890 if (netif_msg_hw(lp)) in tc35815_set_cam_entry()
1935 struct tc35815_local *lp = netdev_priv(dev); in tc35815_set_multicast_list() local
1937 if (!lp->link) in tc35815_set_multicast_list()
1970 struct tc35815_local *lp = netdev_priv(dev); in tc35815_get_drvinfo() local
1974 strlcpy(info->bus_info, pci_name(lp->pci_dev), sizeof(info->bus_info)); in tc35815_get_drvinfo()
1979 struct tc35815_local *lp = netdev_priv(dev); in tc35815_get_settings() local
1981 if (!lp->phy_dev) in tc35815_get_settings()
1983 return phy_ethtool_gset(lp->phy_dev, cmd); in tc35815_get_settings()
1988 struct tc35815_local *lp = netdev_priv(dev); in tc35815_set_settings() local
1990 if (!lp->phy_dev) in tc35815_set_settings()
1992 return phy_ethtool_sset(lp->phy_dev, cmd); in tc35815_set_settings()
1997 struct tc35815_local *lp = netdev_priv(dev); in tc35815_get_msglevel() local
1998 return lp->msg_enable; in tc35815_get_msglevel()
2003 struct tc35815_local *lp = netdev_priv(dev); in tc35815_set_msglevel() local
2004 lp->msg_enable = datum; in tc35815_set_msglevel()
2009 struct tc35815_local *lp = netdev_priv(dev); in tc35815_get_sset_count() local
2013 return sizeof(lp->lstats) / sizeof(int); in tc35815_get_sset_count()
2021 struct tc35815_local *lp = netdev_priv(dev); in tc35815_get_ethtool_stats() local
2022 data[0] = lp->lstats.max_tx_qlen; in tc35815_get_ethtool_stats()
2023 data[1] = lp->lstats.tx_ints; in tc35815_get_ethtool_stats()
2024 data[2] = lp->lstats.rx_ints; in tc35815_get_ethtool_stats()
2025 data[3] = lp->lstats.tx_underrun; in tc35815_get_ethtool_stats()
2056 struct tc35815_local *lp = netdev_priv(dev); in tc35815_ioctl() local
2060 if (!lp->phy_dev) in tc35815_ioctl()
2062 return phy_mii_ioctl(lp->phy_dev, rq, cmd); in tc35815_ioctl()
2109 struct tc35815_local *lp = netdev_priv(dev); in tc35815_chip_init() local
2122 if (HAVE_DMA_RXALIGN(lp)) in tc35815_chip_init()
2131 tc_writel(fd_virt_to_bus(lp, lp->rfd_base), &tr->FDA_Bas); in tc35815_chip_init()
2132 tc_writel((unsigned long)lp->rfd_limit - (unsigned long)lp->rfd_base, in tc35815_chip_init()
2139 tc_writel(fd_virt_to_bus(lp, lp->fbl_ptr), &tr->BLFrmPtr); /* start DMA receiver */ in tc35815_chip_init()
2144 if (lp->chiptype == TC35815_TX4939) in tc35815_chip_init()
2147 if (!lp->phy_dev || !lp->link || lp->duplex == DUPLEX_FULL) in tc35815_chip_init()
2156 struct tc35815_local *lp = netdev_priv(dev); in tc35815_suspend() local
2163 if (lp->phy_dev) in tc35815_suspend()
2164 phy_stop(lp->phy_dev); in tc35815_suspend()
2165 spin_lock_irqsave(&lp->lock, flags); in tc35815_suspend()
2167 spin_unlock_irqrestore(&lp->lock, flags); in tc35815_suspend()
2175 struct tc35815_local *lp = netdev_priv(dev); in tc35815_resume() local
2183 if (lp->phy_dev) in tc35815_resume()
2184 phy_start(lp->phy_dev); in tc35815_resume()