Lines Matching refs:sis_priv

375 	struct sis900_private *sis_priv;  in sis900_probe()  local
417 sis_priv = net_dev->priv; in sis900_probe()
420 sis_priv->pci_dev = pci_dev; in sis900_probe()
421 spin_lock_init(&sis_priv->lock); in sis900_probe()
430 sis_priv->tx_ring = (BufferDesc *)ring_space; in sis900_probe()
431 sis_priv->tx_ring_dma = ring_dma; in sis900_probe()
438 sis_priv->rx_ring = (BufferDesc *)ring_space; in sis900_probe()
439 sis_priv->rx_ring_dma = ring_dma; in sis900_probe()
488 pci_read_config_byte(dev, PCI_CLASS_REVISION, &sis_priv->host_bridge_rev); in sis900_probe()
502 pci_free_consistent(pci_dev, RX_TOTAL_SIZE, sis_priv->rx_ring, in sis900_probe()
503 sis_priv->rx_ring_dma); in sis900_probe()
505 pci_free_consistent(pci_dev, TX_TOTAL_SIZE, sis_priv->tx_ring, in sis900_probe()
506 sis_priv->tx_ring_dma); in sis900_probe()
526 struct sis900_private * sis_priv = net_dev->priv; in sis900_mii_probe() local
532 sis_priv->mii = NULL; in sis900_mii_probe()
550 mii_phy = sis_priv->first_mii; in sis900_mii_probe()
564 mii_phy->next = sis_priv->mii; in sis900_mii_probe()
565 sis_priv->mii = mii_phy; in sis900_mii_probe()
566 sis_priv->first_mii = mii_phy; in sis900_mii_probe()
585 if (sis_priv->mii == NULL) { in sis900_mii_probe()
592 sis_priv->mii = NULL; in sis900_mii_probe()
596 if ((sis_priv->mii->phy_id0 == 0x001D) && in sis900_mii_probe()
597 ((sis_priv->mii->phy_id1&0xFFF0) == 0x8000)) in sis900_mii_probe()
598 status = sis900_reset_phy(net_dev, sis_priv->cur_phy); in sis900_mii_probe()
601 if ((sis_priv->mii->phy_id0 == 0x0015) && in sis900_mii_probe()
602 ((sis_priv->mii->phy_id1&0xFFF0) == 0xF440)) in sis900_mii_probe()
603 mdio_write(net_dev, sis_priv->cur_phy, 0x0018, 0xD200); in sis900_mii_probe()
609 poll_bit ^= (mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS) & poll_bit); in sis900_mii_probe()
617 pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); in sis900_mii_probe()
620 mdio_write(net_dev, sis_priv->cur_phy, MII_ANADV, 0x05e1); in sis900_mii_probe()
621 mdio_write(net_dev, sis_priv->cur_phy, MII_CONFIG1, 0x22); in sis900_mii_probe()
622 mdio_write(net_dev, sis_priv->cur_phy, MII_CONFIG2, 0xff00); in sis900_mii_probe()
623 mdio_write(net_dev, sis_priv->cur_phy, MII_MASK, 0xffc0); in sis900_mii_probe()
627 if (sis_priv->mii->status & MII_STAT_LINK) in sis900_mii_probe()
646 struct sis900_private * sis_priv = net_dev->priv; in sis900_default_phy() local
650 for( phy=sis_priv->first_mii; phy; phy=phy->next ){ in sis900_default_phy()
669 default_phy = sis_priv->first_mii; in sis900_default_phy()
671 if( sis_priv->mii != default_phy ){ in sis900_default_phy()
672 sis_priv->mii = default_phy; in sis900_default_phy()
673 sis_priv->cur_phy = default_phy->phy_addr; in sis900_default_phy()
674 …printk(KERN_INFO "%s: Using transceiver found at address %d as default\n", net_dev->name,sis_priv-… in sis900_default_phy()
677 status = mdio_read(net_dev, sis_priv->cur_phy, MII_CONTROL); in sis900_default_phy()
680 mdio_write(net_dev, sis_priv->cur_phy, MII_CONTROL, status); in sis900_default_phy()
681 status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); in sis900_default_phy()
682 status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); in sis900_default_phy()
923 struct sis900_private *sis_priv = net_dev->priv; in sis900_open() local
932 pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); in sis900_open()
956 sis900_check_mode(net_dev, sis_priv->mii); in sis900_open()
960 init_timer(&sis_priv->timer); in sis900_open()
961 sis_priv->timer.expires = jiffies + HZ; in sis900_open()
962 sis_priv->timer.data = (unsigned long)net_dev; in sis900_open()
963 sis_priv->timer.function = &sis900_timer; in sis900_open()
964 add_timer(&sis_priv->timer); in sis900_open()
1017 struct sis900_private *sis_priv = net_dev->priv; in sis900_init_tx_ring() local
1021 sis_priv->tx_full = 0; in sis900_init_tx_ring()
1022 sis_priv->dirty_tx = sis_priv->cur_tx = 0; in sis900_init_tx_ring()
1025 sis_priv->tx_skbuff[i] = NULL; in sis900_init_tx_ring()
1027 sis_priv->tx_ring[i].link = sis_priv->tx_ring_dma + in sis900_init_tx_ring()
1029 sis_priv->tx_ring[i].cmdsts = 0; in sis900_init_tx_ring()
1030 sis_priv->tx_ring[i].bufptr = 0; in sis900_init_tx_ring()
1034 outl(sis_priv->tx_ring_dma, ioaddr + txdp); in sis900_init_tx_ring()
1051 struct sis900_private *sis_priv = net_dev->priv; in sis900_init_rx_ring() local
1055 sis_priv->cur_rx = 0; in sis900_init_rx_ring()
1056 sis_priv->dirty_rx = 0; in sis900_init_rx_ring()
1060 sis_priv->rx_skbuff[i] = NULL; in sis900_init_rx_ring()
1062 sis_priv->rx_ring[i].link = sis_priv->rx_ring_dma + in sis900_init_rx_ring()
1064 sis_priv->rx_ring[i].cmdsts = 0; in sis900_init_rx_ring()
1065 sis_priv->rx_ring[i].bufptr = 0; in sis900_init_rx_ring()
1080 sis_priv->rx_skbuff[i] = skb; in sis900_init_rx_ring()
1081 sis_priv->rx_ring[i].cmdsts = RX_BUF_SIZE; in sis900_init_rx_ring()
1082 sis_priv->rx_ring[i].bufptr = pci_map_single(sis_priv->pci_dev, in sis900_init_rx_ring()
1085 sis_priv->dirty_rx = (unsigned int) (i - NUM_RX_DESC); in sis900_init_rx_ring()
1088 outl(sis_priv->rx_ring_dma, ioaddr + rxdp); in sis900_init_rx_ring()
1123 struct sis900_private *sis_priv = net_dev->priv; in sis630_set_eq() local
1132 reg14h=mdio_read(net_dev, sis_priv->cur_phy, MII_RESV); in sis630_set_eq()
1133 mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, (0x2200 | reg14h) & 0xBFFF); in sis630_set_eq()
1135 eq_value=(0x00F8 & mdio_read(net_dev, sis_priv->cur_phy, MII_RESV)) >> 3; in sis630_set_eq()
1153 (sis_priv->host_bridge_rev == SIS630B0 || in sis630_set_eq()
1154 sis_priv->host_bridge_rev == SIS630B1)) { in sis630_set_eq()
1161 reg14h=mdio_read(net_dev, sis_priv->cur_phy, MII_RESV); in sis630_set_eq()
1164 mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, reg14h); in sis630_set_eq()
1167 reg14h=mdio_read(net_dev, sis_priv->cur_phy, MII_RESV); in sis630_set_eq()
1169 (sis_priv->host_bridge_rev == SIS630B0 || in sis630_set_eq()
1170 sis_priv->host_bridge_rev == SIS630B1)) in sis630_set_eq()
1171 mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, (reg14h | 0x2200) & 0xBFFF); in sis630_set_eq()
1173 mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, (reg14h | 0x2000) & 0xBFFF); in sis630_set_eq()
1189 struct sis900_private *sis_priv = net_dev->priv; in sis900_timer() local
1190 struct mii_phy *mii_phy = sis_priv->mii; in sis900_timer()
1195 if (!sis_priv->autong_complete){ in sis900_timer()
1201 pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); in sis900_timer()
1206 sis_priv->timer.expires = jiffies + HZ; in sis900_timer()
1207 add_timer(&sis_priv->timer); in sis900_timer()
1211 status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); in sis900_timer()
1212 status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); in sis900_timer()
1219 mii_phy = sis_priv->mii; in sis900_timer()
1235 sis900_reset_phy(net_dev, sis_priv->cur_phy); in sis900_timer()
1237 pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); in sis900_timer()
1244 sis_priv->timer.expires = jiffies + next_tick; in sis900_timer()
1245 add_timer(&sis_priv->timer); in sis900_timer()
1262 struct sis900_private *sis_priv = net_dev->priv; in sis900_check_mode() local
1269 sis900_auto_negotiate(net_dev, sis_priv->cur_phy); in sis900_check_mode()
1275 sis_priv->autong_complete = 1; in sis900_check_mode()
1336 struct sis900_private *sis_priv = net_dev->priv; in sis900_auto_negotiate() local
1345 sis_priv->autong_complete = 1; in sis900_auto_negotiate()
1353 sis_priv->autong_complete = 0; in sis900_auto_negotiate()
1370 struct sis900_private *sis_priv = net_dev->priv; in sis900_read_mode() local
1371 struct mii_phy *phy = sis_priv->mii; in sis900_read_mode()
1372 int phy_addr = sis_priv->cur_phy; in sis900_read_mode()
1396 sis_priv->autong_complete = 1; in sis900_read_mode()
1424 struct sis900_private *sis_priv = net_dev->priv; in sis900_tx_timeout() local
1436 spin_lock_irqsave(&sis_priv->lock, flags); in sis900_tx_timeout()
1439 sis_priv->dirty_tx = sis_priv->cur_tx = 0; in sis900_tx_timeout()
1441 struct sk_buff *skb = sis_priv->tx_skbuff[i]; in sis900_tx_timeout()
1444 pci_unmap_single(sis_priv->pci_dev, in sis900_tx_timeout()
1445 sis_priv->tx_ring[i].bufptr, skb->len, in sis900_tx_timeout()
1448 sis_priv->tx_skbuff[i] = 0; in sis900_tx_timeout()
1449 sis_priv->tx_ring[i].cmdsts = 0; in sis900_tx_timeout()
1450 sis_priv->tx_ring[i].bufptr = 0; in sis900_tx_timeout()
1451 sis_priv->stats.tx_dropped++; in sis900_tx_timeout()
1454 sis_priv->tx_full = 0; in sis900_tx_timeout()
1457 spin_unlock_irqrestore(&sis_priv->lock, flags); in sis900_tx_timeout()
1462 outl(sis_priv->tx_ring_dma, ioaddr + txdp); in sis900_tx_timeout()
1482 struct sis900_private *sis_priv = net_dev->priv; in sis900_start_xmit() local
1490 if(!sis_priv->autong_complete){ in sis900_start_xmit()
1495 spin_lock_irqsave(&sis_priv->lock, flags); in sis900_start_xmit()
1498 entry = sis_priv->cur_tx % NUM_TX_DESC; in sis900_start_xmit()
1499 sis_priv->tx_skbuff[entry] = skb; in sis900_start_xmit()
1502 sis_priv->tx_ring[entry].bufptr = pci_map_single(sis_priv->pci_dev, in sis900_start_xmit()
1504 sis_priv->tx_ring[entry].cmdsts = (OWN | skb->len); in sis900_start_xmit()
1507 sis_priv->cur_tx ++; in sis900_start_xmit()
1508 index_cur_tx = sis_priv->cur_tx; in sis900_start_xmit()
1509 index_dirty_tx = sis_priv->dirty_tx; in sis900_start_xmit()
1516 sis_priv->tx_full = 1; in sis900_start_xmit()
1523 sis_priv->tx_full = 1; in sis900_start_xmit()
1527 spin_unlock_irqrestore(&sis_priv->lock, flags); in sis900_start_xmit()
1552 struct sis900_private *sis_priv = net_dev->priv; in sis900_interrupt() local
1558 spin_lock (&sis_priv->lock); in sis900_interrupt()
1596 spin_unlock (&sis_priv->lock); in sis900_interrupt()
1612 struct sis900_private *sis_priv = net_dev->priv; in sis900_rx() local
1614 unsigned int entry = sis_priv->cur_rx % NUM_RX_DESC; in sis900_rx()
1615 u32 rx_status = sis_priv->rx_ring[entry].cmdsts; in sis900_rx()
1621 sis_priv->cur_rx, sis_priv->dirty_rx, rx_status); in sis900_rx()
1622 rx_work_limit = sis_priv->dirty_rx + NUM_RX_DESC - sis_priv->cur_rx; in sis900_rx()
1638 sis_priv->stats.rx_errors++; in sis900_rx()
1640 sis_priv->stats.rx_over_errors++; in sis900_rx()
1642 sis_priv->stats.rx_length_errors++; in sis900_rx()
1644 sis_priv->stats.rx_frame_errors++; in sis900_rx()
1646 sis_priv->stats.rx_crc_errors++; in sis900_rx()
1648 sis_priv->rx_ring[entry].cmdsts = RX_BUF_SIZE; in sis900_rx()
1655 if (sis_priv->rx_skbuff[entry] == NULL) { in sis900_rx()
1659 net_dev->name, sis_priv->cur_rx, in sis900_rx()
1660 sis_priv->dirty_rx); in sis900_rx()
1664 pci_dma_sync_single(sis_priv->pci_dev, in sis900_rx()
1665 sis_priv->rx_ring[entry].bufptr, RX_BUF_SIZE, in sis900_rx()
1667 pci_unmap_single(sis_priv->pci_dev, in sis900_rx()
1668 sis_priv->rx_ring[entry].bufptr, RX_BUF_SIZE, in sis900_rx()
1671 skb = sis_priv->rx_skbuff[entry]; in sis900_rx()
1678 sis_priv->stats.multicast++; in sis900_rx()
1680 sis_priv->stats.rx_bytes += rx_size; in sis900_rx()
1681 sis_priv->stats.rx_packets++; in sis900_rx()
1693 sis_priv->rx_skbuff[entry] = NULL; in sis900_rx()
1695 sis_priv->rx_ring[entry].cmdsts = 0; in sis900_rx()
1696 sis_priv->rx_ring[entry].bufptr = 0; in sis900_rx()
1697 sis_priv->stats.rx_dropped++; in sis900_rx()
1698 sis_priv->cur_rx++; in sis900_rx()
1702 sis_priv->rx_skbuff[entry] = skb; in sis900_rx()
1703 sis_priv->rx_ring[entry].cmdsts = RX_BUF_SIZE; in sis900_rx()
1704 sis_priv->rx_ring[entry].bufptr = in sis900_rx()
1705 pci_map_single(sis_priv->pci_dev, skb->tail, in sis900_rx()
1707 sis_priv->dirty_rx++; in sis900_rx()
1709 sis_priv->cur_rx++; in sis900_rx()
1710 entry = sis_priv->cur_rx % NUM_RX_DESC; in sis900_rx()
1711 rx_status = sis_priv->rx_ring[entry].cmdsts; in sis900_rx()
1716 for (; sis_priv->cur_rx != sis_priv->dirty_rx; sis_priv->dirty_rx++) { in sis900_rx()
1719 entry = sis_priv->dirty_rx % NUM_RX_DESC; in sis900_rx()
1721 if (sis_priv->rx_skbuff[entry] == NULL) { in sis900_rx()
1730 sis_priv->stats.rx_dropped++; in sis900_rx()
1734 sis_priv->rx_skbuff[entry] = skb; in sis900_rx()
1735 sis_priv->rx_ring[entry].cmdsts = RX_BUF_SIZE; in sis900_rx()
1736 sis_priv->rx_ring[entry].bufptr = in sis900_rx()
1737 pci_map_single(sis_priv->pci_dev, skb->tail, in sis900_rx()
1759 struct sis900_private *sis_priv = net_dev->priv; in sis900_finish_xmit() local
1761 for (; sis_priv->dirty_tx != sis_priv->cur_tx; sis_priv->dirty_tx++) { in sis900_finish_xmit()
1766 entry = sis_priv->dirty_tx % NUM_TX_DESC; in sis900_finish_xmit()
1767 tx_status = sis_priv->tx_ring[entry].cmdsts; in sis900_finish_xmit()
1782 sis_priv->stats.tx_errors++; in sis900_finish_xmit()
1784 sis_priv->stats.tx_fifo_errors++; in sis900_finish_xmit()
1786 sis_priv->stats.tx_aborted_errors++; in sis900_finish_xmit()
1788 sis_priv->stats.tx_carrier_errors++; in sis900_finish_xmit()
1790 sis_priv->stats.tx_window_errors++; in sis900_finish_xmit()
1793 sis_priv->stats.collisions += (tx_status & COLCNT) >> 16; in sis900_finish_xmit()
1794 sis_priv->stats.tx_bytes += tx_status & DSIZE; in sis900_finish_xmit()
1795 sis_priv->stats.tx_packets++; in sis900_finish_xmit()
1798 skb = sis_priv->tx_skbuff[entry]; in sis900_finish_xmit()
1799 pci_unmap_single(sis_priv->pci_dev, in sis900_finish_xmit()
1800 sis_priv->tx_ring[entry].bufptr, skb->len, in sis900_finish_xmit()
1803 sis_priv->tx_skbuff[entry] = NULL; in sis900_finish_xmit()
1804 sis_priv->tx_ring[entry].bufptr = 0; in sis900_finish_xmit()
1805 sis_priv->tx_ring[entry].cmdsts = 0; in sis900_finish_xmit()
1808 if (sis_priv->tx_full && netif_queue_stopped(net_dev) && in sis900_finish_xmit()
1809 sis_priv->cur_tx - sis_priv->dirty_tx < NUM_TX_DESC - 4) { in sis900_finish_xmit()
1812 sis_priv->tx_full = 0; in sis900_finish_xmit()
1829 struct sis900_private *sis_priv = net_dev->priv; in sis900_close() local
1842 del_timer(&sis_priv->timer); in sis900_close()
1848 skb = sis_priv->rx_skbuff[i]; in sis900_close()
1850 pci_unmap_single(sis_priv->pci_dev, in sis900_close()
1851 sis_priv->rx_ring[i].bufptr, in sis900_close()
1854 sis_priv->rx_skbuff[i] = 0; in sis900_close()
1858 skb = sis_priv->tx_skbuff[i]; in sis900_close()
1860 pci_unmap_single(sis_priv->pci_dev, in sis900_close()
1861 sis_priv->tx_ring[i].bufptr, skb->len, in sis900_close()
1864 sis_priv->tx_skbuff[i] = 0; in sis900_close()
1884 struct sis900_private *sis_priv = net_dev->priv; in sis900_get_drvinfo() local
1888 strcpy (info->bus_info, pci_name(sis_priv->pci_dev)); in sis900_get_drvinfo()
1906 struct sis900_private *sis_priv = net_dev->priv; in mii_ioctl() local
1912 data->phy_id = sis_priv->mii->phy_addr; in mii_ioctl()
1941 struct sis900_private *sis_priv = net_dev->priv; in sis900_get_stats() local
1943 return &sis_priv->stats; in sis900_get_stats()
1958 struct sis900_private *sis_priv = dev->priv; in sis900_set_config() local
1959 struct mii_phy *mii_phy = sis_priv->mii; in sis900_set_config()
2078 struct sis900_private * sis_priv = net_dev->priv; in set_rx_mode() local
2085 pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); in set_rx_mode()
2151 struct sis900_private * sis_priv = net_dev->priv; in sis900_reset() local
2168 pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); in sis900_reset()
2185 struct sis900_private * sis_priv = net_dev->priv; in sis900_remove() local
2188 while (sis_priv->first_mii) { in sis900_remove()
2189 phy = sis_priv->first_mii; in sis900_remove()
2190 sis_priv->first_mii = phy->next; in sis900_remove()
2194 pci_free_consistent(pci_dev, RX_TOTAL_SIZE, sis_priv->rx_ring, in sis900_remove()
2195 sis_priv->rx_ring_dma); in sis900_remove()
2196 pci_free_consistent(pci_dev, TX_TOTAL_SIZE, sis_priv->tx_ring, in sis900_remove()
2197 sis_priv->tx_ring_dma); in sis900_remove()
2209 struct sis900_private *sis_priv = net_dev->priv; in sis900_suspend() local
2222 pci_save_state(pci_dev, sis_priv->pci_state); in sis900_suspend()
2230 struct sis900_private *sis_priv = net_dev->priv; in sis900_resume() local
2235 pci_restore_state(pci_dev, sis_priv->pci_state); in sis900_resume()
2256 sis900_check_mode(net_dev, sis_priv->mii); in sis900_resume()