• 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
990 tp = netdev_priv(dev); in rtl8139_init_one()
991 tp->dev = dev; in rtl8139_init_one()
993 ioaddr = tp->mmio_addr; in rtl8139_init_one()
1005 netif_napi_add(dev, &tp->napi, rtl8139_poll); in rtl8139_init_one()
1022 tp = netdev_priv(dev); in rtl8139_init_one()
1025 tp->drv_flags = board_info[ent->driver_data].hw_flags; in rtl8139_init_one()
1026 tp->mmio_addr = ioaddr; in rtl8139_init_one()
1027 tp->msg_enable = in rtl8139_init_one()
1029 spin_lock_init (&tp->lock); in rtl8139_init_one()
1030 spin_lock_init (&tp->rx_lock); in rtl8139_init_one()
1031 INIT_DELAYED_WORK(&tp->thread, rtl8139_thread); in rtl8139_init_one()
1032 tp->mii.dev = dev; in rtl8139_init_one()
1033 tp->mii.mdio_read = mdio_read; in rtl8139_init_one()
1034 tp->mii.mdio_write = mdio_write; in rtl8139_init_one()
1035 tp->mii.phy_id_mask = 0x3f; in rtl8139_init_one()
1036 tp->mii.reg_num_mask = 0x1f; in rtl8139_init_one()
1051 rtl_chip_info[tp->chipset].name); in rtl8139_init_one()
1057 if (tp->drv_flags & HAS_MII_XCVR) { in rtl8139_init_one()
1059 for (phy = 0; phy < 32 && phy_idx < sizeof(tp->phys); phy++) { in rtl8139_init_one()
1063 tp->phys[phy_idx++] = phy; in rtl8139_init_one()
1070 tp->phys[0] = 32; in rtl8139_init_one()
1074 tp->phys[0] = 32; in rtl8139_init_one()
1075 tp->mii.phy_id = tp->phys[0]; in rtl8139_init_one()
1080 tp->mii.full_duplex = (option & 0x210) ? 1 : 0; in rtl8139_init_one()
1081 tp->default_port = option & 0xFF; in rtl8139_init_one()
1082 if (tp->default_port) in rtl8139_init_one()
1083 tp->mii.force_media = 1; in rtl8139_init_one()
1086 tp->mii.full_duplex = full_duplex[board_idx]; in rtl8139_init_one()
1087 if (tp->mii.full_duplex) { in rtl8139_init_one()
1091 tp->mii.force_media = 1; in rtl8139_init_one()
1093 if (tp->default_port) { in rtl8139_init_one()
1097 mdio_write(dev, tp->phys[0], 0, in rtl8139_init_one()
1103 if (rtl_chip_info[tp->chipset].flags & HasHltClk) in rtl8139_init_one()
1118 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_remove_one() local
1122 cancel_delayed_work_sync(&tp->thread); in rtl8139_remove_one()
1236 struct rtl8139_private *tp = netdev_priv(dev); in mdio_read() local
1239 void __iomem *ioaddr = tp->mmio_addr; in mdio_read()
1245 void __iomem *ioaddr = tp->mmio_addr; in mdio_read()
1279 struct rtl8139_private *tp = netdev_priv(dev); in mdio_write() local
1281 void __iomem *ioaddr = tp->mmio_addr; in mdio_write()
1287 void __iomem *ioaddr = tp->mmio_addr; in mdio_write()
1322 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_open() local
1323 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_open()
1324 const int irq = tp->pci_dev->irq; in rtl8139_open()
1331 tp->tx_bufs = dma_alloc_coherent(&tp->pci_dev->dev, TX_BUF_TOT_LEN, in rtl8139_open()
1332 &tp->tx_bufs_dma, GFP_KERNEL); in rtl8139_open()
1333 tp->rx_ring = dma_alloc_coherent(&tp->pci_dev->dev, RX_BUF_TOT_LEN, in rtl8139_open()
1334 &tp->rx_ring_dma, GFP_KERNEL); in rtl8139_open()
1335 if (tp->tx_bufs == NULL || tp->rx_ring == NULL) { in rtl8139_open()
1338 if (tp->tx_bufs) in rtl8139_open()
1339 dma_free_coherent(&tp->pci_dev->dev, TX_BUF_TOT_LEN, in rtl8139_open()
1340 tp->tx_bufs, tp->tx_bufs_dma); in rtl8139_open()
1341 if (tp->rx_ring) in rtl8139_open()
1342 dma_free_coherent(&tp->pci_dev->dev, RX_BUF_TOT_LEN, in rtl8139_open()
1343 tp->rx_ring, tp->rx_ring_dma); in rtl8139_open()
1349 napi_enable(&tp->napi); in rtl8139_open()
1351 tp->mii.full_duplex = tp->mii.force_media; in rtl8139_open()
1352 tp->tx_flag = (TX_FIFO_THRESH << 11) & 0x003f0000; in rtl8139_open()
1358 netif_dbg(tp, ifup, dev, in rtl8139_open()
1361 (unsigned long long)pci_resource_start (tp->pci_dev, 1), in rtl8139_open()
1363 tp->mii.full_duplex ? "full" : "half"); in rtl8139_open()
1365 rtl8139_start_thread(tp); in rtl8139_open()
1373 struct rtl8139_private *tp = netdev_priv(dev); in rtl_check_media() local
1375 if (tp->phys[0] >= 0) { in rtl_check_media()
1376 mii_check_media(&tp->mii, netif_msg_link(tp), init_media); in rtl_check_media()
1383 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_hw_start() local
1384 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_hw_start()
1389 if (rtl_chip_info[tp->chipset].flags & HasHltClk) in rtl8139_hw_start()
1400 tp->cur_rx = 0; in rtl8139_hw_start()
1403 RTL_W32_F (RxBuf, tp->rx_ring_dma); in rtl8139_hw_start()
1408 tp->rx_config = rtl8139_rx_config | AcceptBroadcast | AcceptMyPhys; in rtl8139_hw_start()
1409 RTL_W32 (RxConfig, tp->rx_config); in rtl8139_hw_start()
1414 if (tp->chipset >= CH_8139B) { in rtl8139_hw_start()
1428 RTL_W32_F (TxAddr0 + (i * 4), tp->tx_bufs_dma + (tp->tx_buf[i] - tp->tx_bufs)); in rtl8139_hw_start()
1450 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_init_ring() local
1453 tp->cur_rx = 0; in rtl8139_init_ring()
1454 tp->cur_tx = 0; in rtl8139_init_ring()
1455 tp->dirty_tx = 0; in rtl8139_init_ring()
1458 tp->tx_buf[i] = &tp->tx_bufs[i * TX_BUF_SIZE]; in rtl8139_init_ring()
1467 struct rtl8139_private *tp) {} in rtl8139_tune_twister() argument
1483 struct rtl8139_private *tp) in rtl8139_tune_twister() argument
1486 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_tune_twister()
1492 switch (tp->twistie) { in rtl8139_tune_twister()
1497 tp->twistie = 2; /* Change to state 2. */ in rtl8139_tune_twister()
1505 tp->twistie = 0; /* Bail from future actions. */ in rtl8139_tune_twister()
1512 tp->twist_row = 3; in rtl8139_tune_twister()
1514 tp->twist_row = 2; in rtl8139_tune_twister()
1516 tp->twist_row = 1; in rtl8139_tune_twister()
1518 tp->twist_row = 0; in rtl8139_tune_twister()
1519 tp->twist_col = 0; in rtl8139_tune_twister()
1520 tp->twistie = 3; /* Change to state 2. */ in rtl8139_tune_twister()
1525 if (tp->twist_col == 0) in rtl8139_tune_twister()
1527 RTL_W32 (PARA7c, param[(int) tp->twist_row] in rtl8139_tune_twister()
1528 [(int) tp->twist_col]); in rtl8139_tune_twister()
1530 if (++tp->twist_col >= 4) { in rtl8139_tune_twister()
1533 tp->twistie = in rtl8139_tune_twister()
1534 (tp->twist_row == 3) ? 4 : 0; in rtl8139_tune_twister()
1541 tp->twistie = 0; in rtl8139_tune_twister()
1545 tp->twistie = 5; in rtl8139_tune_twister()
1555 tp->twist_row = 2; in rtl8139_tune_twister()
1556 tp->twist_col = 0; in rtl8139_tune_twister()
1557 tp->twistie = 3; in rtl8139_tune_twister()
1569 struct rtl8139_private *tp, in rtl8139_thread_iter() argument
1574 mii_lpa = mdio_read (dev, tp->phys[0], MII_LPA); in rtl8139_thread_iter()
1576 if (!tp->mii.force_media && mii_lpa != 0xffff) { in rtl8139_thread_iter()
1579 if (tp->mii.full_duplex != duplex) { in rtl8139_thread_iter()
1580 tp->mii.full_duplex = duplex; in rtl8139_thread_iter()
1584 tp->mii.full_duplex ? "full" : "half", in rtl8139_thread_iter()
1585 tp->phys[0], mii_lpa); in rtl8139_thread_iter()
1591 RTL_W8 (Config1, tp->mii.full_duplex ? 0x60 : 0x20); in rtl8139_thread_iter()
1599 rtl8139_tune_twister (dev, tp); in rtl8139_thread_iter()
1611 struct rtl8139_private *tp = in rtl8139_thread() local
1613 struct net_device *dev = tp->mii.dev; in rtl8139_thread()
1621 if (tp->watchdog_fired) { in rtl8139_thread()
1622 tp->watchdog_fired = 0; in rtl8139_thread()
1625 rtl8139_thread_iter(dev, tp, tp->mmio_addr); in rtl8139_thread()
1627 if (tp->have_thread) in rtl8139_thread()
1628 schedule_delayed_work(&tp->thread, thr_delay); in rtl8139_thread()
1633 static void rtl8139_start_thread(struct rtl8139_private *tp) in rtl8139_start_thread() argument
1635 tp->twistie = 0; in rtl8139_start_thread()
1636 if (tp->chipset == CH_8139_K) in rtl8139_start_thread()
1637 tp->twistie = 1; in rtl8139_start_thread()
1638 else if (tp->drv_flags & HAS_LNK_CHNG) in rtl8139_start_thread()
1641 tp->have_thread = 1; in rtl8139_start_thread()
1642 tp->watchdog_fired = 0; in rtl8139_start_thread()
1644 schedule_delayed_work(&tp->thread, next_tick); in rtl8139_start_thread()
1647 static inline void rtl8139_tx_clear (struct rtl8139_private *tp) in rtl8139_tx_clear() argument
1649 tp->cur_tx = 0; in rtl8139_tx_clear()
1650 tp->dirty_tx = 0; in rtl8139_tx_clear()
1657 struct rtl8139_private *tp = in rtl8139_tx_timeout_task() local
1659 struct net_device *dev = tp->mii.dev; in rtl8139_tx_timeout_task()
1660 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_tx_timeout_task()
1664 napi_disable(&tp->napi); in rtl8139_tx_timeout_task()
1673 tp->cur_tx, tp->dirty_tx); in rtl8139_tx_timeout_task()
1677 i == tp->dirty_tx % NUM_TX_DESC ? in rtl8139_tx_timeout_task()
1680 tp->xstats.tx_timeouts++; in rtl8139_tx_timeout_task()
1687 spin_lock_bh(&tp->rx_lock); in rtl8139_tx_timeout_task()
1692 spin_lock_irq(&tp->lock); in rtl8139_tx_timeout_task()
1693 rtl8139_tx_clear (tp); in rtl8139_tx_timeout_task()
1694 spin_unlock_irq(&tp->lock); in rtl8139_tx_timeout_task()
1697 napi_enable(&tp->napi); in rtl8139_tx_timeout_task()
1701 spin_unlock_bh(&tp->rx_lock); in rtl8139_tx_timeout_task()
1706 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_tx_timeout() local
1708 tp->watchdog_fired = 1; in rtl8139_tx_timeout()
1709 if (!tp->have_thread) { in rtl8139_tx_timeout()
1710 INIT_DELAYED_WORK(&tp->thread, rtl8139_thread); in rtl8139_tx_timeout()
1711 schedule_delayed_work(&tp->thread, next_tick); in rtl8139_tx_timeout()
1718 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_start_xmit() local
1719 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_start_xmit()
1725 entry = tp->cur_tx % NUM_TX_DESC; in rtl8139_start_xmit()
1730 memset(tp->tx_buf[entry], 0, ETH_ZLEN); in rtl8139_start_xmit()
1731 skb_copy_and_csum_dev(skb, tp->tx_buf[entry]); in rtl8139_start_xmit()
1739 spin_lock_irqsave(&tp->lock, flags); in rtl8139_start_xmit()
1747 tp->tx_flag | max(len, (unsigned int)ETH_ZLEN)); in rtl8139_start_xmit()
1749 tp->cur_tx++; in rtl8139_start_xmit()
1751 if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx) in rtl8139_start_xmit()
1753 spin_unlock_irqrestore(&tp->lock, flags); in rtl8139_start_xmit()
1755 netif_dbg(tp, tx_queued, dev, "Queued Tx packet size %u to slot %d\n", in rtl8139_start_xmit()
1763 struct rtl8139_private *tp, in rtl8139_tx_interrupt() argument
1771 dirty_tx = tp->dirty_tx; in rtl8139_tx_interrupt()
1772 tx_left = tp->cur_tx - dirty_tx; in rtl8139_tx_interrupt()
1785 netif_dbg(tp, tx_err, dev, "Transmit error, Tx status %08x\n", in rtl8139_tx_interrupt()
1801 if (tp->tx_flag < 0x00300000) in rtl8139_tx_interrupt()
1802 tp->tx_flag += 0x00020000; in rtl8139_tx_interrupt()
1806 u64_stats_update_begin(&tp->tx_stats.syncp); in rtl8139_tx_interrupt()
1807 tp->tx_stats.packets++; in rtl8139_tx_interrupt()
1808 tp->tx_stats.bytes += txstatus & 0x7ff; in rtl8139_tx_interrupt()
1809 u64_stats_update_end(&tp->tx_stats.syncp); in rtl8139_tx_interrupt()
1817 if (tp->cur_tx - dirty_tx > NUM_TX_DESC) { in rtl8139_tx_interrupt()
1819 dirty_tx, tp->cur_tx); in rtl8139_tx_interrupt()
1825 if (tp->dirty_tx != dirty_tx) { in rtl8139_tx_interrupt()
1826 tp->dirty_tx = dirty_tx; in rtl8139_tx_interrupt()
1835 struct rtl8139_private *tp, void __iomem *ioaddr) in rtl8139_rx_err() argument
1842 netif_dbg(tp, rx_err, dev, "Ethernet frame had errors, status %08x\n", in rtl8139_rx_err()
1858 tp->xstats.rx_lost_in_ring++; in rtl8139_rx_err()
1865 RTL_W32 (RxConfig, tp->rx_config); in rtl8139_rx_err()
1866 tp->cur_rx = 0; in rtl8139_rx_err()
1898 tp->rx_config = rtl8139_rx_config | AcceptBroadcast | AcceptMyPhys; in rtl8139_rx_err()
1899 RTL_W32 (RxConfig, tp->rx_config); in rtl8139_rx_err()
1900 tp->cur_rx = 0; in rtl8139_rx_err()
1908 RTL_W32_F (RxBuf, tp->rx_ring_dma); in rtl8139_rx_err()
1929 static void rtl8139_isr_ack(struct rtl8139_private *tp) in rtl8139_isr_ack() argument
1931 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_isr_ack()
1939 tp->dev->stats.rx_errors++; in rtl8139_isr_ack()
1941 tp->dev->stats.rx_fifo_errors++; in rtl8139_isr_ack()
1947 static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp, in rtl8139_rx() argument
1950 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_rx()
1952 unsigned char *rx_ring = tp->rx_ring; in rtl8139_rx()
1953 unsigned int cur_rx = tp->cur_rx; in rtl8139_rx()
1977 netif_dbg(tp, rx_status, dev, "%s() status %04x, size %04x, cur %04x\n", in rtl8139_rx()
1990 if (!tp->fifo_copy_timeout) in rtl8139_rx()
1991 tp->fifo_copy_timeout = jiffies + 2; in rtl8139_rx()
1992 else if (time_after(jiffies, tp->fifo_copy_timeout)) { in rtl8139_rx()
1997 netif_dbg(tp, intr, dev, "fifo copy in progress\n"); in rtl8139_rx()
1998 tp->xstats.early_rx++; in rtl8139_rx()
2003 tp->fifo_copy_timeout = 0; in rtl8139_rx()
2031 rtl8139_rx_err (rx_status, dev, tp, ioaddr); in rtl8139_rx()
2040 skb = napi_alloc_skb(&tp->napi, pkt_size); in rtl8139_rx()
2051 u64_stats_update_begin(&tp->rx_stats.syncp); in rtl8139_rx()
2052 tp->rx_stats.packets++; in rtl8139_rx()
2053 tp->rx_stats.bytes += pkt_size; in rtl8139_rx()
2054 u64_stats_update_end(&tp->rx_stats.syncp); in rtl8139_rx()
2065 rtl8139_isr_ack(tp); in rtl8139_rx()
2069 rtl8139_isr_ack(tp); in rtl8139_rx()
2075 tp->cur_rx = cur_rx; in rtl8139_rx()
2081 if (tp->fifo_copy_timeout) in rtl8139_rx()
2090 struct rtl8139_private *tp, in rtl8139_weird_interrupt() argument
2097 assert (tp != NULL); in rtl8139_weird_interrupt()
2105 (tp->drv_flags & HAS_LNK_CHNG)) { in rtl8139_weird_interrupt()
2119 pci_read_config_word (tp->pci_dev, PCI_STATUS, &pci_cmd_status); in rtl8139_weird_interrupt()
2120 pci_write_config_word (tp->pci_dev, PCI_STATUS, pci_cmd_status); in rtl8139_weird_interrupt()
2128 struct rtl8139_private *tp = container_of(napi, struct rtl8139_private, napi); in rtl8139_poll() local
2129 struct net_device *dev = tp->dev; in rtl8139_poll()
2130 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_poll()
2133 spin_lock(&tp->rx_lock); in rtl8139_poll()
2136 work_done += rtl8139_rx(dev, tp, budget); in rtl8139_poll()
2141 spin_lock_irqsave(&tp->lock, flags); in rtl8139_poll()
2144 spin_unlock_irqrestore(&tp->lock, flags); in rtl8139_poll()
2146 spin_unlock(&tp->rx_lock); in rtl8139_poll()
2156 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_interrupt() local
2157 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_interrupt()
2162 spin_lock (&tp->lock); in rtl8139_interrupt()
2193 if (napi_schedule_prep(&tp->napi)) { in rtl8139_interrupt()
2195 __napi_schedule(&tp->napi); in rtl8139_interrupt()
2201 rtl8139_weird_interrupt (dev, tp, ioaddr, in rtl8139_interrupt()
2205 rtl8139_tx_interrupt (dev, tp, ioaddr); in rtl8139_interrupt()
2210 spin_unlock (&tp->lock); in rtl8139_interrupt()
2224 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_poll_controller() local
2225 const int irq = tp->pci_dev->irq; in rtl8139_poll_controller()
2235 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_set_mac_address() local
2236 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_set_mac_address()
2244 spin_lock_irq(&tp->lock); in rtl8139_set_mac_address()
2251 spin_unlock_irq(&tp->lock); in rtl8139_set_mac_address()
2258 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_close() local
2259 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_close()
2263 napi_disable(&tp->napi); in rtl8139_close()
2265 netif_dbg(tp, ifdown, dev, "Shutting down ethercard, status was 0x%04x\n", in rtl8139_close()
2268 spin_lock_irqsave (&tp->lock, flags); in rtl8139_close()
2280 spin_unlock_irqrestore (&tp->lock, flags); in rtl8139_close()
2282 free_irq(tp->pci_dev->irq, dev); in rtl8139_close()
2284 rtl8139_tx_clear (tp); in rtl8139_close()
2286 dma_free_coherent(&tp->pci_dev->dev, RX_BUF_TOT_LEN, in rtl8139_close()
2287 tp->rx_ring, tp->rx_ring_dma); in rtl8139_close()
2288 dma_free_coherent(&tp->pci_dev->dev, TX_BUF_TOT_LEN, in rtl8139_close()
2289 tp->tx_bufs, tp->tx_bufs_dma); in rtl8139_close()
2290 tp->rx_ring = NULL; in rtl8139_close()
2291 tp->tx_bufs = NULL; in rtl8139_close()
2296 if (rtl_chip_info[tp->chipset].flags & HasHltClk) in rtl8139_close()
2308 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_get_wol() local
2309 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_get_wol()
2311 spin_lock_irq(&tp->lock); in rtl8139_get_wol()
2312 if (rtl_chip_info[tp->chipset].flags & HasLWake) { in rtl8139_get_wol()
2333 spin_unlock_irq(&tp->lock); in rtl8139_get_wol()
2342 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_set_wol() local
2343 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_set_wol()
2347 support = ((rtl_chip_info[tp->chipset].flags & HasLWake) in rtl8139_set_wol()
2354 spin_lock_irq(&tp->lock); in rtl8139_set_wol()
2375 spin_unlock_irq(&tp->lock); in rtl8139_set_wol()
2382 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_get_drvinfo() local
2385 strscpy(info->bus_info, pci_name(tp->pci_dev), sizeof(info->bus_info)); in rtl8139_get_drvinfo()
2391 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_get_link_ksettings() local
2392 spin_lock_irq(&tp->lock); in rtl8139_get_link_ksettings()
2393 mii_ethtool_get_link_ksettings(&tp->mii, cmd); in rtl8139_get_link_ksettings()
2394 spin_unlock_irq(&tp->lock); in rtl8139_get_link_ksettings()
2401 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_set_link_ksettings() local
2403 spin_lock_irq(&tp->lock); in rtl8139_set_link_ksettings()
2404 rc = mii_ethtool_set_link_ksettings(&tp->mii, cmd); in rtl8139_set_link_ksettings()
2405 spin_unlock_irq(&tp->lock); in rtl8139_set_link_ksettings()
2411 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_nway_reset() local
2412 return mii_nway_restart(&tp->mii); in rtl8139_nway_reset()
2417 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_get_link() local
2418 return mii_link_ok(&tp->mii); in rtl8139_get_link()
2423 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_get_msglevel() local
2424 return tp->msg_enable; in rtl8139_get_msglevel()
2429 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_set_msglevel() local
2430 tp->msg_enable = datum; in rtl8139_set_msglevel()
2435 struct rtl8139_private *tp; in rtl8139_get_regs_len() local
2439 tp = netdev_priv(dev); in rtl8139_get_regs_len()
2440 return tp->regs_len; in rtl8139_get_regs_len()
2445 struct rtl8139_private *tp; in rtl8139_get_regs() local
2450 tp = netdev_priv(dev); in rtl8139_get_regs()
2454 spin_lock_irq(&tp->lock); in rtl8139_get_regs()
2455 memcpy_fromio(regbuf, tp->mmio_addr, regs->len); in rtl8139_get_regs()
2456 spin_unlock_irq(&tp->lock); in rtl8139_get_regs()
2471 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_get_ethtool_stats() local
2473 data[0] = tp->xstats.early_rx; in rtl8139_get_ethtool_stats()
2474 data[1] = tp->xstats.tx_buf_mapped; in rtl8139_get_ethtool_stats()
2475 data[2] = tp->xstats.tx_timeouts; in rtl8139_get_ethtool_stats()
2476 data[3] = tp->xstats.rx_lost_in_ring; in rtl8139_get_ethtool_stats()
2503 struct rtl8139_private *tp = netdev_priv(dev); in netdev_ioctl() local
2509 spin_lock_irq(&tp->lock); in netdev_ioctl()
2510 rc = generic_mii_ioctl(&tp->mii, if_mii(rq), cmd, NULL); in netdev_ioctl()
2511 spin_unlock_irq(&tp->lock); in netdev_ioctl()
2520 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_get_stats64() local
2521 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_get_stats64()
2526 spin_lock_irqsave (&tp->lock, flags); in rtl8139_get_stats64()
2529 spin_unlock_irqrestore (&tp->lock, flags); in rtl8139_get_stats64()
2535 start = u64_stats_fetch_begin_irq(&tp->rx_stats.syncp); in rtl8139_get_stats64()
2536 stats->rx_packets = tp->rx_stats.packets; in rtl8139_get_stats64()
2537 stats->rx_bytes = tp->rx_stats.bytes; in rtl8139_get_stats64()
2538 } while (u64_stats_fetch_retry_irq(&tp->rx_stats.syncp, start)); in rtl8139_get_stats64()
2541 start = u64_stats_fetch_begin_irq(&tp->tx_stats.syncp); in rtl8139_get_stats64()
2542 stats->tx_packets = tp->tx_stats.packets; in rtl8139_get_stats64()
2543 stats->tx_bytes = tp->tx_stats.bytes; in rtl8139_get_stats64()
2544 } while (u64_stats_fetch_retry_irq(&tp->tx_stats.syncp, start)); in rtl8139_get_stats64()
2552 struct rtl8139_private *tp = netdev_priv(dev); in __set_rx_mode() local
2553 void __iomem *ioaddr = tp->mmio_addr; in __set_rx_mode()
2589 if (tp->rx_config != tmp) { in __set_rx_mode()
2591 tp->rx_config = tmp; in __set_rx_mode()
2600 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_set_rx_mode() local
2602 spin_lock_irqsave (&tp->lock, flags); in rtl8139_set_rx_mode()
2604 spin_unlock_irqrestore (&tp->lock, flags); in rtl8139_set_rx_mode()
2610 struct rtl8139_private *tp = netdev_priv(dev); in rtl8139_suspend() local
2611 void __iomem *ioaddr = tp->mmio_addr; in rtl8139_suspend()
2619 spin_lock_irqsave (&tp->lock, flags); in rtl8139_suspend()
2629 spin_unlock_irqrestore (&tp->lock, flags); in rtl8139_suspend()