Lines Matching refs:np

475 	struct netdev_private *np;  in fealnx_init_one()  local
536 np = netdev_priv(dev); in fealnx_init_one()
537 np->mem = ioaddr; in fealnx_init_one()
538 spin_lock_init(&np->lock); in fealnx_init_one()
539 np->pci_dev = pdev; in fealnx_init_one()
540 np->flags = skel_netdrv_tbl[chip_id].flags; in fealnx_init_one()
542 np->mii.dev = dev; in fealnx_init_one()
543 np->mii.mdio_read = mdio_read; in fealnx_init_one()
544 np->mii.mdio_write = mdio_write; in fealnx_init_one()
545 np->mii.phy_id_mask = 0x1f; in fealnx_init_one()
546 np->mii.reg_num_mask = 0x1f; in fealnx_init_one()
554 np->rx_ring = ring_space; in fealnx_init_one()
555 np->rx_ring_dma = ring_dma; in fealnx_init_one()
563 np->tx_ring = ring_space; in fealnx_init_one()
564 np->tx_ring_dma = ring_dma; in fealnx_init_one()
567 if (np->flags == HAS_MII_XCVR) { in fealnx_init_one()
570 for (phy = 1; phy < 32 && phy_idx < ARRAY_SIZE(np->phys); in fealnx_init_one()
575 np->phys[phy_idx++] = phy; in fealnx_init_one()
583 data = mdio_read(dev, np->phys[0], 2); in fealnx_init_one()
585 np->PHYType = SeeqPHY; in fealnx_init_one()
587 np->PHYType = AhdocPHY; in fealnx_init_one()
589 np->PHYType = MarvellPHY; in fealnx_init_one()
591 np->PHYType = Myson981; in fealnx_init_one()
593 np->PHYType = LevelOnePHY; in fealnx_init_one()
595 np->PHYType = OtherPHY; in fealnx_init_one()
600 np->mii_cnt = phy_idx; in fealnx_init_one()
606 np->phys[0] = 32; in fealnx_init_one()
610 np->PHYType = MysonPHY; in fealnx_init_one()
612 np->PHYType = OtherPHY; in fealnx_init_one()
614 np->mii.phy_id = np->phys[0]; in fealnx_init_one()
622 np->mii.full_duplex = 1; in fealnx_init_one()
623 np->default_port = option & 15; in fealnx_init_one()
627 np->mii.full_duplex = full_duplex[card_idx]; in fealnx_init_one()
629 if (np->mii.full_duplex) { in fealnx_init_one()
633 if ((np->PHYType == MarvellPHY) || (np->PHYType == LevelOnePHY)) { in fealnx_init_one()
636 data = mdio_read(dev, np->phys[0], 9); in fealnx_init_one()
638 mdio_write(dev, np->phys[0], 9, data); in fealnx_init_one()
641 if (np->flags == HAS_MII_XCVR) in fealnx_init_one()
642 mdio_write(dev, np->phys[0], MII_ADVERTISE, ADVERTISE_FULL); in fealnx_init_one()
645 np->mii.force_media = 1; in fealnx_init_one()
663 dma_free_coherent(&pdev->dev, TX_TOTAL_SIZE, np->tx_ring, in fealnx_init_one()
664 np->tx_ring_dma); in fealnx_init_one()
666 dma_free_coherent(&pdev->dev, RX_TOTAL_SIZE, np->rx_ring, in fealnx_init_one()
667 np->rx_ring_dma); in fealnx_init_one()
683 struct netdev_private *np = netdev_priv(dev); in fealnx_remove_one() local
685 dma_free_coherent(&pdev->dev, TX_TOTAL_SIZE, np->tx_ring, in fealnx_remove_one()
686 np->tx_ring_dma); in fealnx_remove_one()
687 dma_free_coherent(&pdev->dev, RX_TOTAL_SIZE, np->rx_ring, in fealnx_remove_one()
688 np->rx_ring_dma); in fealnx_remove_one()
690 pci_iounmap(pdev, np->mem); in fealnx_remove_one()
749 struct netdev_private *np = netdev_priv(dev); in mdio_read() local
750 void __iomem *miiport = np->mem + MANAGEMENT; in mdio_read()
788 struct netdev_private *np = netdev_priv(dev); in mdio_write() local
789 void __iomem *miiport = np->mem + MANAGEMENT; in mdio_write()
820 struct netdev_private *np = netdev_priv(dev); in netdev_open() local
821 void __iomem *ioaddr = np->mem; in netdev_open()
822 const int irq = np->pci_dev->irq; in netdev_open()
837 iowrite32(np->rx_ring_dma, ioaddr + RXLBA); in netdev_open()
838 iowrite32(np->tx_ring_dma, ioaddr + TXLBA); in netdev_open()
857 np->bcrvalue = 0x10; /* little-endian, 8 burst length */ in netdev_open()
859 np->bcrvalue |= 0x04; /* big-endian */ in netdev_open()
864 np->crvalue = 0xa00; in netdev_open()
867 np->crvalue = 0xe00; /* rx 128 burst length */ in netdev_open()
873 np->imrvalue = TUNF | CNTOVF | RBU | TI | RI; in netdev_open()
874 if (np->pci_dev->device == 0x891) { in netdev_open()
875 np->bcrvalue |= 0x200; /* set PROG bit */ in netdev_open()
876 np->crvalue |= CR_W_ENH; /* set enhanced bit */ in netdev_open()
877 np->imrvalue |= ETI; in netdev_open()
879 iowrite32(np->bcrvalue, ioaddr + BCR); in netdev_open()
882 dev->if_port = np->default_port; in netdev_open()
887 np->crvalue |= 0x00e40001; /* tx store and forward, tx/rx enable */ in netdev_open()
888 np->mii.full_duplex = np->mii.force_media; in netdev_open()
890 if (np->linkok) in netdev_open()
898 iowrite32(np->imrvalue, ioaddr + IMR); in netdev_open()
904 timer_setup(&np->timer, netdev_timer, 0); in netdev_open()
905 np->timer.expires = RUN_AT(3 * HZ); in netdev_open()
908 add_timer(&np->timer); in netdev_open()
910 timer_setup(&np->reset_timer, reset_timer, 0); in netdev_open()
911 np->reset_timer_armed = 0; in netdev_open()
921 struct netdev_private *np = netdev_priv(dev); in getlinkstatus() local
924 np->linkok = 0; in getlinkstatus()
926 if (np->PHYType == MysonPHY) { in getlinkstatus()
928 if (ioread32(np->mem + BMCRSR) & LinkIsUp2) { in getlinkstatus()
929 np->linkok = 1; in getlinkstatus()
936 if (mdio_read(dev, np->phys[0], MII_BMSR) & BMSR_LSTATUS) { in getlinkstatus()
937 np->linkok = 1; in getlinkstatus()
948 struct netdev_private *np = netdev_priv(dev); in getlinktype() local
950 if (np->PHYType == MysonPHY) { /* 3-in-1 case */ in getlinktype()
951 if (ioread32(np->mem + TCRRCR) & CR_R_FD) in getlinktype()
952 np->duplexmode = 2; /* full duplex */ in getlinktype()
954 np->duplexmode = 1; /* half duplex */ in getlinktype()
955 if (ioread32(np->mem + TCRRCR) & CR_R_PS10) in getlinktype()
956 np->line_speed = 1; /* 10M */ in getlinktype()
958 np->line_speed = 2; /* 100M */ in getlinktype()
960 if (np->PHYType == SeeqPHY) { /* this PHY is SEEQ 80225 */ in getlinktype()
963 data = mdio_read(dev, np->phys[0], MIIRegister18); in getlinktype()
965 np->line_speed = 2; /* 100M */ in getlinktype()
967 np->line_speed = 1; /* 10M */ in getlinktype()
969 np->duplexmode = 2; /* full duplex mode */ in getlinktype()
971 np->duplexmode = 1; /* half duplex mode */ in getlinktype()
972 } else if (np->PHYType == AhdocPHY) { in getlinktype()
975 data = mdio_read(dev, np->phys[0], DiagnosticReg); in getlinktype()
977 np->line_speed = 2; /* 100M */ in getlinktype()
979 np->line_speed = 1; /* 10M */ in getlinktype()
981 np->duplexmode = 2; /* full duplex mode */ in getlinktype()
983 np->duplexmode = 1; /* half duplex mode */ in getlinktype()
986 else if (np->PHYType == MarvellPHY) { in getlinktype()
989 data = mdio_read(dev, np->phys[0], SpecificReg); in getlinktype()
991 np->duplexmode = 2; /* full duplex mode */ in getlinktype()
993 np->duplexmode = 1; /* half duplex mode */ in getlinktype()
996 np->line_speed = 3; /* 1000M */ in getlinktype()
998 np->line_speed = 2; /* 100M */ in getlinktype()
1000 np->line_speed = 1; /* 10M */ in getlinktype()
1004 else if (np->PHYType == Myson981) { in getlinktype()
1007 data = mdio_read(dev, np->phys[0], StatusRegister); in getlinktype()
1010 np->line_speed = 2; in getlinktype()
1012 np->line_speed = 1; in getlinktype()
1015 np->duplexmode = 2; in getlinktype()
1017 np->duplexmode = 1; in getlinktype()
1021 else if (np->PHYType == LevelOnePHY) { in getlinktype()
1024 data = mdio_read(dev, np->phys[0], SpecificReg); in getlinktype()
1026 np->duplexmode = 2; /* full duplex mode */ in getlinktype()
1028 np->duplexmode = 1; /* half duplex mode */ in getlinktype()
1031 np->line_speed = 3; /* 1000M */ in getlinktype()
1033 np->line_speed = 2; /* 100M */ in getlinktype()
1035 np->line_speed = 1; /* 10M */ in getlinktype()
1037 np->crvalue &= (~CR_W_PS10) & (~CR_W_FD) & (~CR_W_PS1000); in getlinktype()
1038 if (np->line_speed == 1) in getlinktype()
1039 np->crvalue |= CR_W_PS10; in getlinktype()
1040 else if (np->line_speed == 3) in getlinktype()
1041 np->crvalue |= CR_W_PS1000; in getlinktype()
1042 if (np->duplexmode == 2) in getlinktype()
1043 np->crvalue |= CR_W_FD; in getlinktype()
1051 struct netdev_private *np = netdev_priv(dev); in allocate_rx_buffers() local
1054 while (np->really_rx_count != RX_RING_SIZE) { in allocate_rx_buffers()
1057 skb = netdev_alloc_skb(dev, np->rx_buf_sz); in allocate_rx_buffers()
1061 while (np->lack_rxbuf->skbuff) in allocate_rx_buffers()
1062 np->lack_rxbuf = np->lack_rxbuf->next_desc_logical; in allocate_rx_buffers()
1064 np->lack_rxbuf->skbuff = skb; in allocate_rx_buffers()
1065 np->lack_rxbuf->buffer = dma_map_single(&np->pci_dev->dev, in allocate_rx_buffers()
1067 np->rx_buf_sz, in allocate_rx_buffers()
1069 np->lack_rxbuf->status = RXOWN; in allocate_rx_buffers()
1070 ++np->really_rx_count; in allocate_rx_buffers()
1077 struct netdev_private *np = from_timer(np, t, timer); in netdev_timer() local
1078 struct net_device *dev = np->mii.dev; in netdev_timer()
1079 void __iomem *ioaddr = np->mem; in netdev_timer()
1080 int old_crvalue = np->crvalue; in netdev_timer()
1081 unsigned int old_linkok = np->linkok; in netdev_timer()
1089 spin_lock_irqsave(&np->lock, flags); in netdev_timer()
1091 if (np->flags == HAS_MII_XCVR) { in netdev_timer()
1093 if ((old_linkok == 0) && (np->linkok == 1)) { /* we need to detect the media type again */ in netdev_timer()
1095 if (np->crvalue != old_crvalue) { in netdev_timer()
1096 stop_nic_rxtx(ioaddr, np->crvalue); in netdev_timer()
1097 iowrite32(np->crvalue, ioaddr + TCRRCR); in netdev_timer()
1104 spin_unlock_irqrestore(&np->lock, flags); in netdev_timer()
1106 np->timer.expires = RUN_AT(10 * HZ); in netdev_timer()
1107 add_timer(&np->timer); in netdev_timer()
1115 struct netdev_private *np = netdev_priv(dev); in reset_and_disable_rxtx() local
1116 void __iomem *ioaddr = np->mem; in reset_and_disable_rxtx()
1141 struct netdev_private *np = netdev_priv(dev); in enable_rxtx() local
1142 void __iomem *ioaddr = np->mem; in enable_rxtx()
1146 iowrite32(np->tx_ring_dma + ((char*)np->cur_tx - (char*)np->tx_ring), in enable_rxtx()
1148 iowrite32(np->rx_ring_dma + ((char*)np->cur_rx - (char*)np->rx_ring), in enable_rxtx()
1151 iowrite32(np->bcrvalue, ioaddr + BCR); in enable_rxtx()
1158 iowrite32(np->imrvalue, ioaddr + IMR); in enable_rxtx()
1166 struct netdev_private *np = from_timer(np, t, reset_timer); in reset_timer() local
1167 struct net_device *dev = np->mii.dev; in reset_timer()
1172 spin_lock_irqsave(&np->lock, flags); in reset_timer()
1173 np->crvalue = np->crvalue_sv; in reset_timer()
1174 np->imrvalue = np->imrvalue_sv; in reset_timer()
1182 np->reset_timer_armed = 0; in reset_timer()
1184 spin_unlock_irqrestore(&np->lock, flags); in reset_timer()
1190 struct netdev_private *np = netdev_priv(dev); in fealnx_tx_timeout() local
1191 void __iomem *ioaddr = np->mem; in fealnx_tx_timeout()
1200 printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring); in fealnx_tx_timeout()
1203 (unsigned int) np->rx_ring[i].status); in fealnx_tx_timeout()
1205 printk(KERN_DEBUG " Tx ring %p: ", np->tx_ring); in fealnx_tx_timeout()
1207 printk(KERN_CONT " %4.4x", np->tx_ring[i].status); in fealnx_tx_timeout()
1211 spin_lock_irqsave(&np->lock, flags); in fealnx_tx_timeout()
1217 spin_unlock_irqrestore(&np->lock, flags); in fealnx_tx_timeout()
1228 struct netdev_private *np = netdev_priv(dev); in init_ring() local
1232 np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32); in init_ring()
1233 np->cur_rx = &np->rx_ring[0]; in init_ring()
1234 np->lack_rxbuf = np->rx_ring; in init_ring()
1235 np->really_rx_count = 0; in init_ring()
1239 np->rx_ring[i].status = 0; in init_ring()
1240 np->rx_ring[i].control = np->rx_buf_sz << RBSShift; in init_ring()
1241 np->rx_ring[i].next_desc = np->rx_ring_dma + in init_ring()
1243 np->rx_ring[i].next_desc_logical = &np->rx_ring[i + 1]; in init_ring()
1244 np->rx_ring[i].skbuff = NULL; in init_ring()
1248 np->rx_ring[i - 1].next_desc = np->rx_ring_dma; in init_ring()
1249 np->rx_ring[i - 1].next_desc_logical = np->rx_ring; in init_ring()
1253 struct sk_buff *skb = netdev_alloc_skb(dev, np->rx_buf_sz); in init_ring()
1256 np->lack_rxbuf = &np->rx_ring[i]; in init_ring()
1260 ++np->really_rx_count; in init_ring()
1261 np->rx_ring[i].skbuff = skb; in init_ring()
1262 np->rx_ring[i].buffer = dma_map_single(&np->pci_dev->dev, in init_ring()
1264 np->rx_buf_sz, in init_ring()
1266 np->rx_ring[i].status = RXOWN; in init_ring()
1267 np->rx_ring[i].control |= RXIC; in init_ring()
1271 np->cur_tx = &np->tx_ring[0]; in init_ring()
1272 np->cur_tx_copy = &np->tx_ring[0]; in init_ring()
1273 np->really_tx_count = 0; in init_ring()
1274 np->free_tx_count = TX_RING_SIZE; in init_ring()
1277 np->tx_ring[i].status = 0; in init_ring()
1279 np->tx_ring[i].next_desc = np->tx_ring_dma + in init_ring()
1281 np->tx_ring[i].next_desc_logical = &np->tx_ring[i + 1]; in init_ring()
1282 np->tx_ring[i].skbuff = NULL; in init_ring()
1286 np->tx_ring[i - 1].next_desc = np->tx_ring_dma; in init_ring()
1287 np->tx_ring[i - 1].next_desc_logical = &np->tx_ring[0]; in init_ring()
1293 struct netdev_private *np = netdev_priv(dev); in start_tx() local
1296 spin_lock_irqsave(&np->lock, flags); in start_tx()
1298 np->cur_tx_copy->skbuff = skb; in start_tx()
1303 np->cur_tx_copy->buffer = dma_map_single(&np->pci_dev->dev, skb->data, in start_tx()
1305 np->cur_tx_copy->control = TXIC | TXLD | TXFD | CRCEnable | PADEnable; in start_tx()
1306 np->cur_tx_copy->control |= (skb->len << PKTSShift); /* pkt size */ in start_tx()
1307 np->cur_tx_copy->control |= (skb->len << TBSShift); /* buffer size */ in start_tx()
1309 if (np->pci_dev->device == 0x891) in start_tx()
1310 np->cur_tx_copy->control |= ETIControl | RetryTxLC; in start_tx()
1311 np->cur_tx_copy->status = TXOWN; in start_tx()
1312 np->cur_tx_copy = np->cur_tx_copy->next_desc_logical; in start_tx()
1313 --np->free_tx_count; in start_tx()
1319 np->cur_tx_copy->buffer = dma_map_single(&np->pci_dev->dev, in start_tx()
1322 np->cur_tx_copy->control = TXIC | TXFD | CRCEnable | PADEnable; in start_tx()
1323 np->cur_tx_copy->control |= (skb->len << PKTSShift); /* pkt size */ in start_tx()
1324 np->cur_tx_copy->control |= (BPT << TBSShift); /* buffer size */ in start_tx()
1327 next = np->cur_tx_copy->next_desc_logical; in start_tx()
1333 if (np->pci_dev->device == 0x891) in start_tx()
1334 np->cur_tx_copy->control |= ETIControl | RetryTxLC; in start_tx()
1340 np->cur_tx_copy->status = TXOWN; in start_tx()
1342 np->cur_tx_copy = next->next_desc_logical; in start_tx()
1343 np->free_tx_count -= 2; in start_tx()
1345 np->cur_tx_copy->buffer = dma_map_single(&np->pci_dev->dev, in start_tx()
1348 np->cur_tx_copy->control = TXIC | TXLD | TXFD | CRCEnable | PADEnable; in start_tx()
1349 np->cur_tx_copy->control |= (skb->len << PKTSShift); /* pkt size */ in start_tx()
1350 np->cur_tx_copy->control |= (skb->len << TBSShift); /* buffer size */ in start_tx()
1352 if (np->pci_dev->device == 0x891) in start_tx()
1353 np->cur_tx_copy->control |= ETIControl | RetryTxLC; in start_tx()
1354 np->cur_tx_copy->status = TXOWN; in start_tx()
1355 np->cur_tx_copy = np->cur_tx_copy->next_desc_logical; in start_tx()
1356 --np->free_tx_count; in start_tx()
1360 if (np->free_tx_count < 2) in start_tx()
1362 ++np->really_tx_count; in start_tx()
1363 iowrite32(0, np->mem + TXPDR); in start_tx()
1365 spin_unlock_irqrestore(&np->lock, flags); in start_tx()
1374 struct netdev_private *np = netdev_priv(dev); in reset_tx_descriptors() local
1379 np->cur_tx = &np->tx_ring[0]; in reset_tx_descriptors()
1380 np->cur_tx_copy = &np->tx_ring[0]; in reset_tx_descriptors()
1381 np->really_tx_count = 0; in reset_tx_descriptors()
1382 np->free_tx_count = TX_RING_SIZE; in reset_tx_descriptors()
1385 cur = &np->tx_ring[i]; in reset_tx_descriptors()
1387 dma_unmap_single(&np->pci_dev->dev, cur->buffer, in reset_tx_descriptors()
1395 cur->next_desc = np->tx_ring_dma + in reset_tx_descriptors()
1397 cur->next_desc_logical = &np->tx_ring[i + 1]; in reset_tx_descriptors()
1400 np->tx_ring[TX_RING_SIZE - 1].next_desc = np->tx_ring_dma; in reset_tx_descriptors()
1401 np->tx_ring[TX_RING_SIZE - 1].next_desc_logical = &np->tx_ring[0]; in reset_tx_descriptors()
1408 struct netdev_private *np = netdev_priv(dev); in reset_rx_descriptors() local
1409 struct fealnx_desc *cur = np->cur_rx; in reset_rx_descriptors()
1420 iowrite32(np->rx_ring_dma + ((char*)np->cur_rx - (char*)np->rx_ring), in reset_rx_descriptors()
1421 np->mem + RXLBA); in reset_rx_descriptors()
1430 struct netdev_private *np = netdev_priv(dev); in intr_handler() local
1431 void __iomem *ioaddr = np->mem; in intr_handler()
1436 spin_lock(&np->lock); in intr_handler()
1450 if (!(intr_status & np->imrvalue)) in intr_handler()
1481 stop_nic_rx(ioaddr, np->crvalue); in intr_handler()
1483 iowrite32(np->crvalue, ioaddr + TCRRCR); in intr_handler()
1487 while (np->really_tx_count) { in intr_handler()
1488 long tx_status = np->cur_tx->status; in intr_handler()
1489 long tx_control = np->cur_tx->control; in intr_handler()
1494 next = np->cur_tx->next_desc_logical; in intr_handler()
1502 if (!(np->crvalue & CR_W_ENH)) { in intr_handler()
1513 if ((tx_status & HF) && np->mii.full_duplex == 0) in intr_handler()
1531 dma_unmap_single(&np->pci_dev->dev, in intr_handler()
1532 np->cur_tx->buffer, in intr_handler()
1533 np->cur_tx->skbuff->len, in intr_handler()
1535 dev_consume_skb_irq(np->cur_tx->skbuff); in intr_handler()
1536 np->cur_tx->skbuff = NULL; in intr_handler()
1537 --np->really_tx_count; in intr_handler()
1538 if (np->cur_tx->control & TXLD) { in intr_handler()
1539 np->cur_tx = np->cur_tx->next_desc_logical; in intr_handler()
1540 ++np->free_tx_count; in intr_handler()
1542 np->cur_tx = np->cur_tx->next_desc_logical; in intr_handler()
1543 np->cur_tx = np->cur_tx->next_desc_logical; in intr_handler()
1544 np->free_tx_count += 2; in intr_handler()
1549 if (num_tx && np->free_tx_count >= 2) in intr_handler()
1553 if (np->crvalue & CR_W_ENH) { in intr_handler()
1568 if (!np->reset_timer_armed) { in intr_handler()
1569 np->reset_timer_armed = 1; in intr_handler()
1570 np->reset_timer.expires = RUN_AT(HZ/2); in intr_handler()
1571 add_timer(&np->reset_timer); in intr_handler()
1576 np->crvalue_sv = np->crvalue; in intr_handler()
1577 np->imrvalue_sv = np->imrvalue; in intr_handler()
1578 np->crvalue &= ~(CR_W_TXEN | CR_W_RXEN); /* or simply = 0? */ in intr_handler()
1579 np->imrvalue = 0; in intr_handler()
1598 iowrite32(np->imrvalue, ioaddr + IMR); in intr_handler()
1600 spin_unlock(&np->lock); in intr_handler()
1610 struct netdev_private *np = netdev_priv(dev); in netdev_rx() local
1611 void __iomem *ioaddr = np->mem; in netdev_rx()
1614 while (!(np->cur_rx->status & RXOWN) && np->cur_rx->skbuff) { in netdev_rx()
1615 s32 rx_status = np->cur_rx->status; in netdev_rx()
1617 if (np->really_rx_count == 0) in netdev_rx()
1646 cur = np->cur_rx; in netdev_rx()
1647 while (desno <= np->really_rx_count) { in netdev_rx()
1655 if (desno > np->really_rx_count) in netdev_rx()
1667 if (!np->cur_rx->skbuff) { in netdev_rx()
1672 np->cur_rx->status = RXOWN; in netdev_rx()
1673 np->cur_rx = np->cur_rx->next_desc_logical; in netdev_rx()
1677 stop_nic_rx(ioaddr, np->crvalue); in netdev_rx()
1679 iowrite32(np->crvalue, ioaddr + TCRRCR); in netdev_rx()
1700 dma_sync_single_for_cpu(&np->pci_dev->dev, in netdev_rx()
1701 np->cur_rx->buffer, in netdev_rx()
1702 np->rx_buf_sz, in netdev_rx()
1708 np->cur_rx->skbuff->data, pkt_len); in netdev_rx()
1711 skb_put_data(skb, np->cur_rx->skbuff->data, in netdev_rx()
1714 dma_sync_single_for_device(&np->pci_dev->dev, in netdev_rx()
1715 np->cur_rx->buffer, in netdev_rx()
1716 np->rx_buf_sz, in netdev_rx()
1719 dma_unmap_single(&np->pci_dev->dev, in netdev_rx()
1720 np->cur_rx->buffer, in netdev_rx()
1721 np->rx_buf_sz, in netdev_rx()
1723 skb_put(skb = np->cur_rx->skbuff, pkt_len); in netdev_rx()
1724 np->cur_rx->skbuff = NULL; in netdev_rx()
1725 --np->really_rx_count; in netdev_rx()
1733 np->cur_rx = np->cur_rx->next_desc_logical; in netdev_rx()
1745 struct netdev_private *np = netdev_priv(dev); in get_stats() local
1746 void __iomem *ioaddr = np->mem; in get_stats()
1774 struct netdev_private *np = netdev_priv(dev); in __set_rx_mode() local
1775 void __iomem *ioaddr = np->mem; in __set_rx_mode()
1799 stop_nic_rxtx(ioaddr, np->crvalue); in __set_rx_mode()
1803 np->crvalue &= ~CR_W_RXMODEMASK; in __set_rx_mode()
1804 np->crvalue |= rx_mode; in __set_rx_mode()
1805 iowrite32(np->crvalue, ioaddr + TCRRCR); in __set_rx_mode()
1810 struct netdev_private *np = netdev_priv(dev); in netdev_get_drvinfo() local
1813 strscpy(info->bus_info, pci_name(np->pci_dev), sizeof(info->bus_info)); in netdev_get_drvinfo()
1819 struct netdev_private *np = netdev_priv(dev); in netdev_get_link_ksettings() local
1821 spin_lock_irq(&np->lock); in netdev_get_link_ksettings()
1822 mii_ethtool_get_link_ksettings(&np->mii, cmd); in netdev_get_link_ksettings()
1823 spin_unlock_irq(&np->lock); in netdev_get_link_ksettings()
1831 struct netdev_private *np = netdev_priv(dev); in netdev_set_link_ksettings() local
1834 spin_lock_irq(&np->lock); in netdev_set_link_ksettings()
1835 rc = mii_ethtool_set_link_ksettings(&np->mii, cmd); in netdev_set_link_ksettings()
1836 spin_unlock_irq(&np->lock); in netdev_set_link_ksettings()
1843 struct netdev_private *np = netdev_priv(dev); in netdev_nway_reset() local
1844 return mii_nway_restart(&np->mii); in netdev_nway_reset()
1849 struct netdev_private *np = netdev_priv(dev); in netdev_get_link() local
1850 return mii_link_ok(&np->mii); in netdev_get_link()
1875 struct netdev_private *np = netdev_priv(dev); in mii_ioctl() local
1881 spin_lock_irq(&np->lock); in mii_ioctl()
1882 rc = generic_mii_ioctl(&np->mii, if_mii(rq), cmd, NULL); in mii_ioctl()
1883 spin_unlock_irq(&np->lock); in mii_ioctl()
1891 struct netdev_private *np = netdev_priv(dev); in netdev_close() local
1892 void __iomem *ioaddr = np->mem; in netdev_close()
1903 del_timer_sync(&np->timer); in netdev_close()
1904 del_timer_sync(&np->reset_timer); in netdev_close()
1906 free_irq(np->pci_dev->irq, dev); in netdev_close()
1910 struct sk_buff *skb = np->rx_ring[i].skbuff; in netdev_close()
1912 np->rx_ring[i].status = 0; in netdev_close()
1914 dma_unmap_single(&np->pci_dev->dev, in netdev_close()
1915 np->rx_ring[i].buffer, np->rx_buf_sz, in netdev_close()
1918 np->rx_ring[i].skbuff = NULL; in netdev_close()
1923 struct sk_buff *skb = np->tx_ring[i].skbuff; in netdev_close()
1926 dma_unmap_single(&np->pci_dev->dev, in netdev_close()
1927 np->tx_ring[i].buffer, skb->len, in netdev_close()
1930 np->tx_ring[i].skbuff = NULL; in netdev_close()