• Home
  • Raw
  • Download

Lines Matching refs:tp

644 static void rtl8139_start_thread(struct rtl8139_private *tp);
720 struct rtl8139_private *tp = netdev_priv(dev); in __rtl8139_cleanup_dev() local
724 assert (tp->pci_dev != NULL); in __rtl8139_cleanup_dev()
725 pdev = tp->pci_dev; in __rtl8139_cleanup_dev()
727 if (tp->mmio_addr) in __rtl8139_cleanup_dev()
728 pci_iounmap (pdev, tp->mmio_addr); in __rtl8139_cleanup_dev()
759 struct rtl8139_private *tp; in rtl8139_init_board() local
776 dev = alloc_etherdev (sizeof (*tp)); in rtl8139_init_board()
782 tp = netdev_priv(dev); in rtl8139_init_board()
783 tp->pci_dev = pdev; in rtl8139_init_board()
797 u64_stats_init(&tp->rx_stats.syncp); in rtl8139_init_board()
798 u64_stats_init(&tp->tx_stats.syncp); in rtl8139_init_board()
831 tp->regs_len = io_len; in rtl8139_init_board()
832 tp->mmio_addr = ioaddr; in rtl8139_init_board()
848 tp->chipset = i; in rtl8139_init_board()
856 tp->chipset = 0; in rtl8139_init_board()
862 if (tp->chipset >= CH_8139B) { in rtl8139_init_board()
865 if ((rtl_chip_info[tp->chipset].flags & HasLWake) && in rtl8139_init_board()
874 if (rtl_chip_info[tp->chipset].flags & HasLWake) { in rtl8139_init_board()
902 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_set_features() local
905 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_set_features()
910 spin_lock_irqsave(&tp->lock, flags); in rtl8139_set_features()
913 int rx_mode = tp->rx_config; in rtl8139_set_features()
918 tp->rx_config = rtl8139_rx_config | rx_mode; in rtl8139_set_features()
919 RTL_W32_F(RxConfig, tp->rx_config); in rtl8139_set_features()
922 spin_unlock_irqrestore(&tp->lock, flags); in rtl8139_set_features()
947 struct rtl8139_private *tp; in rtl8139_init_one() local
989 tp = netdev_priv(dev); in rtl8139_init_one()
990 tp->dev = dev; in rtl8139_init_one()
992 ioaddr = tp->mmio_addr; in rtl8139_init_one()
1004 netif_napi_add(dev, &tp->napi, rtl8139_poll, 64); in rtl8139_init_one()
1021 tp = netdev_priv(dev); in rtl8139_init_one()
1024 tp->drv_flags = board_info[ent->driver_data].hw_flags; in rtl8139_init_one()
1025 tp->mmio_addr = ioaddr; in rtl8139_init_one()
1026 tp->msg_enable = in rtl8139_init_one()
1028 spin_lock_init (&tp->lock); in rtl8139_init_one()
1029 spin_lock_init (&tp->rx_lock); in rtl8139_init_one()
1030 INIT_DELAYED_WORK(&tp->thread, rtl8139_thread); in rtl8139_init_one()
1031 tp->mii.dev = dev; in rtl8139_init_one()
1032 tp->mii.mdio_read = mdio_read; in rtl8139_init_one()
1033 tp->mii.mdio_write = mdio_write; in rtl8139_init_one()
1034 tp->mii.phy_id_mask = 0x3f; in rtl8139_init_one()
1035 tp->mii.reg_num_mask = 0x1f; in rtl8139_init_one()
1050 rtl_chip_info[tp->chipset].name); in rtl8139_init_one()
1056 if (tp->drv_flags & HAS_MII_XCVR) { in rtl8139_init_one()
1058 for (phy = 0; phy < 32 && phy_idx < sizeof(tp->phys); phy++) { in rtl8139_init_one()
1062 tp->phys[phy_idx++] = phy; in rtl8139_init_one()
1069 tp->phys[0] = 32; in rtl8139_init_one()
1073 tp->phys[0] = 32; in rtl8139_init_one()
1074 tp->mii.phy_id = tp->phys[0]; in rtl8139_init_one()
1079 tp->mii.full_duplex = (option & 0x210) ? 1 : 0; in rtl8139_init_one()
1080 tp->default_port = option & 0xFF; in rtl8139_init_one()
1081 if (tp->default_port) in rtl8139_init_one()
1082 tp->mii.force_media = 1; in rtl8139_init_one()
1085 tp->mii.full_duplex = full_duplex[board_idx]; in rtl8139_init_one()
1086 if (tp->mii.full_duplex) { in rtl8139_init_one()
1090 tp->mii.force_media = 1; in rtl8139_init_one()
1092 if (tp->default_port) { in rtl8139_init_one()
1096 mdio_write(dev, tp->phys[0], 0, in rtl8139_init_one()
1102 if (rtl_chip_info[tp->chipset].flags & HasHltClk) in rtl8139_init_one()
1117 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_remove_one() local
1121 cancel_delayed_work_sync(&tp->thread); in rtl8139_remove_one()
1235 struct rtl8139_private *tp = netdev_priv(dev); in mdio_read() local
1238 void __iomem *ioaddr = tp->mmio_addr; in mdio_read()
1244 void __iomem *ioaddr = tp->mmio_addr; in mdio_read()
1278 struct rtl8139_private *tp = netdev_priv(dev); in mdio_write() local
1280 void __iomem *ioaddr = tp->mmio_addr; in mdio_write()
1286 void __iomem *ioaddr = tp->mmio_addr; in mdio_write()
1321 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_open() local
1322 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_open()
1323 const int irq = tp->pci_dev->irq; in rtl8139_open()
1330 tp->tx_bufs = dma_alloc_coherent(&tp->pci_dev->dev, TX_BUF_TOT_LEN, in rtl8139_open()
1331 &tp->tx_bufs_dma, GFP_KERNEL); in rtl8139_open()
1332 tp->rx_ring = dma_alloc_coherent(&tp->pci_dev->dev, RX_BUF_TOT_LEN, in rtl8139_open()
1333 &tp->rx_ring_dma, GFP_KERNEL); in rtl8139_open()
1334 if (tp->tx_bufs == NULL || tp->rx_ring == NULL) { in rtl8139_open()
1337 if (tp->tx_bufs) in rtl8139_open()
1338 dma_free_coherent(&tp->pci_dev->dev, TX_BUF_TOT_LEN, in rtl8139_open()
1339 tp->tx_bufs, tp->tx_bufs_dma); in rtl8139_open()
1340 if (tp->rx_ring) in rtl8139_open()
1341 dma_free_coherent(&tp->pci_dev->dev, RX_BUF_TOT_LEN, in rtl8139_open()
1342 tp->rx_ring, tp->rx_ring_dma); in rtl8139_open()
1348 napi_enable(&tp->napi); in rtl8139_open()
1350 tp->mii.full_duplex = tp->mii.force_media; in rtl8139_open()
1351 tp->tx_flag = (TX_FIFO_THRESH << 11) & 0x003f0000; in rtl8139_open()
1357 netif_dbg(tp, ifup, dev, in rtl8139_open()
1360 (unsigned long long)pci_resource_start (tp->pci_dev, 1), in rtl8139_open()
1362 tp->mii.full_duplex ? "full" : "half"); in rtl8139_open()
1364 rtl8139_start_thread(tp); in rtl8139_open()
1372 struct rtl8139_private *tp = netdev_priv(dev); in rtl_check_media() local
1374 if (tp->phys[0] >= 0) { in rtl_check_media()
1375 mii_check_media(&tp->mii, netif_msg_link(tp), init_media); in rtl_check_media()
1382 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_hw_start() local
1383 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_hw_start()
1388 if (rtl_chip_info[tp->chipset].flags & HasHltClk) in rtl8139_hw_start()
1399 tp->cur_rx = 0; in rtl8139_hw_start()
1402 RTL_W32_F (RxBuf, tp->rx_ring_dma); in rtl8139_hw_start()
1407 tp->rx_config = rtl8139_rx_config | AcceptBroadcast | AcceptMyPhys; in rtl8139_hw_start()
1408 RTL_W32 (RxConfig, tp->rx_config); in rtl8139_hw_start()
1413 if (tp->chipset >= CH_8139B) { in rtl8139_hw_start()
1427 RTL_W32_F (TxAddr0 + (i * 4), tp->tx_bufs_dma + (tp->tx_buf[i] - tp->tx_bufs)); in rtl8139_hw_start()
1449 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_init_ring() local
1452 tp->cur_rx = 0; in rtl8139_init_ring()
1453 tp->cur_tx = 0; in rtl8139_init_ring()
1454 tp->dirty_tx = 0; in rtl8139_init_ring()
1457 tp->tx_buf[i] = &tp->tx_bufs[i * TX_BUF_SIZE]; in rtl8139_init_ring()
1466 struct rtl8139_private *tp) {} in rtl8139_tune_twister() argument
1482 struct rtl8139_private *tp) in rtl8139_tune_twister() argument
1485 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_tune_twister()
1491 switch (tp->twistie) { in rtl8139_tune_twister()
1496 tp->twistie = 2; /* Change to state 2. */ in rtl8139_tune_twister()
1504 tp->twistie = 0; /* Bail from future actions. */ in rtl8139_tune_twister()
1511 tp->twist_row = 3; in rtl8139_tune_twister()
1513 tp->twist_row = 2; in rtl8139_tune_twister()
1515 tp->twist_row = 1; in rtl8139_tune_twister()
1517 tp->twist_row = 0; in rtl8139_tune_twister()
1518 tp->twist_col = 0; in rtl8139_tune_twister()
1519 tp->twistie = 3; /* Change to state 2. */ in rtl8139_tune_twister()
1524 if (tp->twist_col == 0) in rtl8139_tune_twister()
1526 RTL_W32 (PARA7c, param[(int) tp->twist_row] in rtl8139_tune_twister()
1527 [(int) tp->twist_col]); in rtl8139_tune_twister()
1529 if (++tp->twist_col >= 4) { in rtl8139_tune_twister()
1532 tp->twistie = in rtl8139_tune_twister()
1533 (tp->twist_row == 3) ? 4 : 0; in rtl8139_tune_twister()
1540 tp->twistie = 0; in rtl8139_tune_twister()
1544 tp->twistie = 5; in rtl8139_tune_twister()
1554 tp->twist_row = 2; in rtl8139_tune_twister()
1555 tp->twist_col = 0; in rtl8139_tune_twister()
1556 tp->twistie = 3; in rtl8139_tune_twister()
1568 struct rtl8139_private *tp, in rtl8139_thread_iter() argument
1573 mii_lpa = mdio_read (dev, tp->phys[0], MII_LPA); in rtl8139_thread_iter()
1575 if (!tp->mii.force_media && mii_lpa != 0xffff) { in rtl8139_thread_iter()
1578 if (tp->mii.full_duplex != duplex) { in rtl8139_thread_iter()
1579 tp->mii.full_duplex = duplex; in rtl8139_thread_iter()
1583 tp->mii.full_duplex ? "full" : "half", in rtl8139_thread_iter()
1584 tp->phys[0], mii_lpa); in rtl8139_thread_iter()
1590 RTL_W8 (Config1, tp->mii.full_duplex ? 0x60 : 0x20); in rtl8139_thread_iter()
1598 rtl8139_tune_twister (dev, tp); in rtl8139_thread_iter()
1610 struct rtl8139_private *tp = in rtl8139_thread() local
1612 struct net_device *dev = tp->mii.dev; in rtl8139_thread()
1620 if (tp->watchdog_fired) { in rtl8139_thread()
1621 tp->watchdog_fired = 0; in rtl8139_thread()
1624 rtl8139_thread_iter(dev, tp, tp->mmio_addr); in rtl8139_thread()
1626 if (tp->have_thread) in rtl8139_thread()
1627 schedule_delayed_work(&tp->thread, thr_delay); in rtl8139_thread()
1632 static void rtl8139_start_thread(struct rtl8139_private *tp) in rtl8139_start_thread() argument
1634 tp->twistie = 0; in rtl8139_start_thread()
1635 if (tp->chipset == CH_8139_K) in rtl8139_start_thread()
1636 tp->twistie = 1; in rtl8139_start_thread()
1637 else if (tp->drv_flags & HAS_LNK_CHNG) in rtl8139_start_thread()
1640 tp->have_thread = 1; in rtl8139_start_thread()
1641 tp->watchdog_fired = 0; in rtl8139_start_thread()
1643 schedule_delayed_work(&tp->thread, next_tick); in rtl8139_start_thread()
1646 static inline void rtl8139_tx_clear (struct rtl8139_private *tp) in rtl8139_tx_clear() argument
1648 tp->cur_tx = 0; in rtl8139_tx_clear()
1649 tp->dirty_tx = 0; in rtl8139_tx_clear()
1656 struct rtl8139_private *tp = in rtl8139_tx_timeout_task() local
1658 struct net_device *dev = tp->mii.dev; in rtl8139_tx_timeout_task()
1659 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_tx_timeout_task()
1663 napi_disable(&tp->napi); in rtl8139_tx_timeout_task()
1672 tp->cur_tx, tp->dirty_tx); in rtl8139_tx_timeout_task()
1676 i == tp->dirty_tx % NUM_TX_DESC ? in rtl8139_tx_timeout_task()
1679 tp->xstats.tx_timeouts++; in rtl8139_tx_timeout_task()
1686 spin_lock_bh(&tp->rx_lock); in rtl8139_tx_timeout_task()
1691 spin_lock_irq(&tp->lock); in rtl8139_tx_timeout_task()
1692 rtl8139_tx_clear (tp); in rtl8139_tx_timeout_task()
1693 spin_unlock_irq(&tp->lock); in rtl8139_tx_timeout_task()
1696 napi_enable(&tp->napi); in rtl8139_tx_timeout_task()
1700 spin_unlock_bh(&tp->rx_lock); in rtl8139_tx_timeout_task()
1705 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_tx_timeout() local
1707 tp->watchdog_fired = 1; in rtl8139_tx_timeout()
1708 if (!tp->have_thread) { in rtl8139_tx_timeout()
1709 INIT_DELAYED_WORK(&tp->thread, rtl8139_thread); in rtl8139_tx_timeout()
1710 schedule_delayed_work(&tp->thread, next_tick); in rtl8139_tx_timeout()
1717 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_start_xmit() local
1718 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_start_xmit()
1724 entry = tp->cur_tx % NUM_TX_DESC; in rtl8139_start_xmit()
1729 memset(tp->tx_buf[entry], 0, ETH_ZLEN); in rtl8139_start_xmit()
1730 skb_copy_and_csum_dev(skb, tp->tx_buf[entry]); in rtl8139_start_xmit()
1738 spin_lock_irqsave(&tp->lock, flags); in rtl8139_start_xmit()
1746 tp->tx_flag | max(len, (unsigned int)ETH_ZLEN)); in rtl8139_start_xmit()
1748 tp->cur_tx++; in rtl8139_start_xmit()
1750 if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx) in rtl8139_start_xmit()
1752 spin_unlock_irqrestore(&tp->lock, flags); in rtl8139_start_xmit()
1754 netif_dbg(tp, tx_queued, dev, "Queued Tx packet size %u to slot %d\n", in rtl8139_start_xmit()
1762 struct rtl8139_private *tp, in rtl8139_tx_interrupt() argument
1770 dirty_tx = tp->dirty_tx; in rtl8139_tx_interrupt()
1771 tx_left = tp->cur_tx - dirty_tx; in rtl8139_tx_interrupt()
1784 netif_dbg(tp, tx_err, dev, "Transmit error, Tx status %08x\n", in rtl8139_tx_interrupt()
1800 if (tp->tx_flag < 0x00300000) in rtl8139_tx_interrupt()
1801 tp->tx_flag += 0x00020000; in rtl8139_tx_interrupt()
1805 u64_stats_update_begin(&tp->tx_stats.syncp); in rtl8139_tx_interrupt()
1806 tp->tx_stats.packets++; in rtl8139_tx_interrupt()
1807 tp->tx_stats.bytes += txstatus & 0x7ff; in rtl8139_tx_interrupt()
1808 u64_stats_update_end(&tp->tx_stats.syncp); in rtl8139_tx_interrupt()
1816 if (tp->cur_tx - dirty_tx > NUM_TX_DESC) { in rtl8139_tx_interrupt()
1818 dirty_tx, tp->cur_tx); in rtl8139_tx_interrupt()
1824 if (tp->dirty_tx != dirty_tx) { in rtl8139_tx_interrupt()
1825 tp->dirty_tx = dirty_tx; in rtl8139_tx_interrupt()
1834 struct rtl8139_private *tp, void __iomem *ioaddr) in rtl8139_rx_err() argument
1841 netif_dbg(tp, rx_err, dev, "Ethernet frame had errors, status %08x\n", in rtl8139_rx_err()
1857 tp->xstats.rx_lost_in_ring++; in rtl8139_rx_err()
1864 RTL_W32 (RxConfig, tp->rx_config); in rtl8139_rx_err()
1865 tp->cur_rx = 0; in rtl8139_rx_err()
1897 tp->rx_config = rtl8139_rx_config | AcceptBroadcast | AcceptMyPhys; in rtl8139_rx_err()
1898 RTL_W32 (RxConfig, tp->rx_config); in rtl8139_rx_err()
1899 tp->cur_rx = 0; in rtl8139_rx_err()
1907 RTL_W32_F (RxBuf, tp->rx_ring_dma); in rtl8139_rx_err()
1928 static void rtl8139_isr_ack(struct rtl8139_private *tp) in rtl8139_isr_ack() argument
1930 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_isr_ack()
1938 tp->dev->stats.rx_errors++; in rtl8139_isr_ack()
1940 tp->dev->stats.rx_fifo_errors++; in rtl8139_isr_ack()
1946 static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp, in rtl8139_rx() argument
1949 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_rx()
1951 unsigned char *rx_ring = tp->rx_ring; in rtl8139_rx()
1952 unsigned int cur_rx = tp->cur_rx; in rtl8139_rx()
1976 netif_dbg(tp, rx_status, dev, "%s() status %04x, size %04x, cur %04x\n", in rtl8139_rx()
1989 if (!tp->fifo_copy_timeout) in rtl8139_rx()
1990 tp->fifo_copy_timeout = jiffies + 2; in rtl8139_rx()
1991 else if (time_after(jiffies, tp->fifo_copy_timeout)) { in rtl8139_rx()
1996 netif_dbg(tp, intr, dev, "fifo copy in progress\n"); in rtl8139_rx()
1997 tp->xstats.early_rx++; in rtl8139_rx()
2002 tp->fifo_copy_timeout = 0; in rtl8139_rx()
2030 rtl8139_rx_err (rx_status, dev, tp, ioaddr); in rtl8139_rx()
2039 skb = napi_alloc_skb(&tp->napi, pkt_size); in rtl8139_rx()
2050 u64_stats_update_begin(&tp->rx_stats.syncp); in rtl8139_rx()
2051 tp->rx_stats.packets++; in rtl8139_rx()
2052 tp->rx_stats.bytes += pkt_size; in rtl8139_rx()
2053 u64_stats_update_end(&tp->rx_stats.syncp); in rtl8139_rx()
2064 rtl8139_isr_ack(tp); in rtl8139_rx()
2068 rtl8139_isr_ack(tp); in rtl8139_rx()
2074 tp->cur_rx = cur_rx; in rtl8139_rx()
2080 if (tp->fifo_copy_timeout) in rtl8139_rx()
2089 struct rtl8139_private *tp, in rtl8139_weird_interrupt() argument
2096 assert (tp != NULL); in rtl8139_weird_interrupt()
2104 (tp->drv_flags & HAS_LNK_CHNG)) { in rtl8139_weird_interrupt()
2118 pci_read_config_word (tp->pci_dev, PCI_STATUS, &pci_cmd_status); in rtl8139_weird_interrupt()
2119 pci_write_config_word (tp->pci_dev, PCI_STATUS, pci_cmd_status); in rtl8139_weird_interrupt()
2127 struct rtl8139_private *tp = container_of(napi, struct rtl8139_private, napi); in rtl8139_poll() local
2128 struct net_device *dev = tp->dev; in rtl8139_poll()
2129 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_poll()
2132 spin_lock(&tp->rx_lock); in rtl8139_poll()
2135 work_done += rtl8139_rx(dev, tp, budget); in rtl8139_poll()
2140 spin_lock_irqsave(&tp->lock, flags); in rtl8139_poll()
2143 spin_unlock_irqrestore(&tp->lock, flags); in rtl8139_poll()
2145 spin_unlock(&tp->rx_lock); in rtl8139_poll()
2155 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_interrupt() local
2156 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_interrupt()
2161 spin_lock (&tp->lock); in rtl8139_interrupt()
2192 if (napi_schedule_prep(&tp->napi)) { in rtl8139_interrupt()
2194 __napi_schedule(&tp->napi); in rtl8139_interrupt()
2200 rtl8139_weird_interrupt (dev, tp, ioaddr, in rtl8139_interrupt()
2204 rtl8139_tx_interrupt (dev, tp, ioaddr); in rtl8139_interrupt()
2209 spin_unlock (&tp->lock); in rtl8139_interrupt()
2223 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_poll_controller() local
2224 const int irq = tp->pci_dev->irq; in rtl8139_poll_controller()
2234 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_set_mac_address() local
2235 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_set_mac_address()
2243 spin_lock_irq(&tp->lock); in rtl8139_set_mac_address()
2250 spin_unlock_irq(&tp->lock); in rtl8139_set_mac_address()
2257 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_close() local
2258 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_close()
2262 napi_disable(&tp->napi); in rtl8139_close()
2264 netif_dbg(tp, ifdown, dev, "Shutting down ethercard, status was 0x%04x\n", in rtl8139_close()
2267 spin_lock_irqsave (&tp->lock, flags); in rtl8139_close()
2279 spin_unlock_irqrestore (&tp->lock, flags); in rtl8139_close()
2281 free_irq(tp->pci_dev->irq, dev); in rtl8139_close()
2283 rtl8139_tx_clear (tp); in rtl8139_close()
2285 dma_free_coherent(&tp->pci_dev->dev, RX_BUF_TOT_LEN, in rtl8139_close()
2286 tp->rx_ring, tp->rx_ring_dma); in rtl8139_close()
2287 dma_free_coherent(&tp->pci_dev->dev, TX_BUF_TOT_LEN, in rtl8139_close()
2288 tp->tx_bufs, tp->tx_bufs_dma); in rtl8139_close()
2289 tp->rx_ring = NULL; in rtl8139_close()
2290 tp->tx_bufs = NULL; in rtl8139_close()
2295 if (rtl_chip_info[tp->chipset].flags & HasHltClk) in rtl8139_close()
2307 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_get_wol() local
2308 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_get_wol()
2310 spin_lock_irq(&tp->lock); in rtl8139_get_wol()
2311 if (rtl_chip_info[tp->chipset].flags & HasLWake) { in rtl8139_get_wol()
2332 spin_unlock_irq(&tp->lock); in rtl8139_get_wol()
2341 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_set_wol() local
2342 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_set_wol()
2346 support = ((rtl_chip_info[tp->chipset].flags & HasLWake) in rtl8139_set_wol()
2353 spin_lock_irq(&tp->lock); in rtl8139_set_wol()
2374 spin_unlock_irq(&tp->lock); in rtl8139_set_wol()
2381 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_get_drvinfo() local
2384 strlcpy(info->bus_info, pci_name(tp->pci_dev), sizeof(info->bus_info)); in rtl8139_get_drvinfo()
2390 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_get_link_ksettings() local
2391 spin_lock_irq(&tp->lock); in rtl8139_get_link_ksettings()
2392 mii_ethtool_get_link_ksettings(&tp->mii, cmd); in rtl8139_get_link_ksettings()
2393 spin_unlock_irq(&tp->lock); in rtl8139_get_link_ksettings()
2400 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_set_link_ksettings() local
2402 spin_lock_irq(&tp->lock); in rtl8139_set_link_ksettings()
2403 rc = mii_ethtool_set_link_ksettings(&tp->mii, cmd); in rtl8139_set_link_ksettings()
2404 spin_unlock_irq(&tp->lock); in rtl8139_set_link_ksettings()
2410 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_nway_reset() local
2411 return mii_nway_restart(&tp->mii); in rtl8139_nway_reset()
2416 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_get_link() local
2417 return mii_link_ok(&tp->mii); in rtl8139_get_link()
2422 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_get_msglevel() local
2423 return tp->msg_enable; in rtl8139_get_msglevel()
2428 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_set_msglevel() local
2429 tp->msg_enable = datum; in rtl8139_set_msglevel()
2434 struct rtl8139_private *tp; in rtl8139_get_regs_len() local
2438 tp = netdev_priv(dev); in rtl8139_get_regs_len()
2439 return tp->regs_len; in rtl8139_get_regs_len()
2444 struct rtl8139_private *tp; in rtl8139_get_regs() local
2449 tp = netdev_priv(dev); in rtl8139_get_regs()
2453 spin_lock_irq(&tp->lock); in rtl8139_get_regs()
2454 memcpy_fromio(regbuf, tp->mmio_addr, regs->len); in rtl8139_get_regs()
2455 spin_unlock_irq(&tp->lock); in rtl8139_get_regs()
2470 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_get_ethtool_stats() local
2472 data[0] = tp->xstats.early_rx; in rtl8139_get_ethtool_stats()
2473 data[1] = tp->xstats.tx_buf_mapped; in rtl8139_get_ethtool_stats()
2474 data[2] = tp->xstats.tx_timeouts; in rtl8139_get_ethtool_stats()
2475 data[3] = tp->xstats.rx_lost_in_ring; in rtl8139_get_ethtool_stats()
2502 struct rtl8139_private *tp = netdev_priv(dev); in netdev_ioctl() local
2508 spin_lock_irq(&tp->lock); in netdev_ioctl()
2509 rc = generic_mii_ioctl(&tp->mii, if_mii(rq), cmd, NULL); in netdev_ioctl()
2510 spin_unlock_irq(&tp->lock); in netdev_ioctl()
2519 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_get_stats64() local
2520 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_get_stats64()
2525 spin_lock_irqsave (&tp->lock, flags); in rtl8139_get_stats64()
2528 spin_unlock_irqrestore (&tp->lock, flags); in rtl8139_get_stats64()
2534 start = u64_stats_fetch_begin_irq(&tp->rx_stats.syncp); in rtl8139_get_stats64()
2535 stats->rx_packets = tp->rx_stats.packets; in rtl8139_get_stats64()
2536 stats->rx_bytes = tp->rx_stats.bytes; in rtl8139_get_stats64()
2537 } while (u64_stats_fetch_retry_irq(&tp->rx_stats.syncp, start)); in rtl8139_get_stats64()
2540 start = u64_stats_fetch_begin_irq(&tp->tx_stats.syncp); in rtl8139_get_stats64()
2541 stats->tx_packets = tp->tx_stats.packets; in rtl8139_get_stats64()
2542 stats->tx_bytes = tp->tx_stats.bytes; in rtl8139_get_stats64()
2543 } while (u64_stats_fetch_retry_irq(&tp->tx_stats.syncp, start)); in rtl8139_get_stats64()
2551 struct rtl8139_private *tp = netdev_priv(dev); in __set_rx_mode() local
2552 void __iomem *ioaddr = tp->mmio_addr; in __set_rx_mode()
2588 if (tp->rx_config != tmp) { in __set_rx_mode()
2590 tp->rx_config = tmp; in __set_rx_mode()
2599 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_set_rx_mode() local
2601 spin_lock_irqsave (&tp->lock, flags); in rtl8139_set_rx_mode()
2603 spin_unlock_irqrestore (&tp->lock, flags); in rtl8139_set_rx_mode()
2609 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_suspend() local
2610 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_suspend()
2618 spin_lock_irqsave (&tp->lock, flags); in rtl8139_suspend()
2628 spin_unlock_irqrestore (&tp->lock, flags); in rtl8139_suspend()