Lines Matching refs:sis_priv
431 struct sis900_private *sis_priv; in sis900_probe() local
472 sis_priv = netdev_priv(net_dev); in sis900_probe()
475 sis_priv->pci_dev = pci_dev; in sis900_probe()
476 spin_lock_init(&sis_priv->lock); in sis900_probe()
485 sis_priv->tx_ring = (BufferDesc *)ring_space; in sis900_probe()
486 sis_priv->tx_ring_dma = ring_dma; in sis900_probe()
493 sis_priv->rx_ring = (BufferDesc *)ring_space; in sis900_probe()
494 sis_priv->rx_ring_dma = ring_dma; in sis900_probe()
502 sis_priv->msg_enable = sis900_debug; in sis900_probe()
504 sis_priv->msg_enable = SIS900_DEF_MSG; in sis900_probe()
506 sis_priv->mii_info.dev = net_dev; in sis900_probe()
507 sis_priv->mii_info.mdio_read = mdio_read; in sis900_probe()
508 sis_priv->mii_info.mdio_write = mdio_write; in sis900_probe()
509 sis_priv->mii_info.phy_id_mask = 0x1f; in sis900_probe()
510 sis_priv->mii_info.reg_num_mask = 0x1f; in sis900_probe()
513 sis_priv->chipset_rev = pci_dev->revision; in sis900_probe()
514 if(netif_msg_probe(sis_priv)) in sis900_probe()
517 dev_name, sis_priv->chipset_rev); in sis900_probe()
520 if (sis_priv->chipset_rev == SIS630E_900_REV) in sis900_probe()
522 else if ((sis_priv->chipset_rev > 0x81) && (sis_priv->chipset_rev <= 0x90) ) in sis900_probe()
524 else if (sis_priv->chipset_rev == SIS96x_900_REV) in sis900_probe()
536 if (sis_priv->chipset_rev == SIS630ET_900_REV) in sis900_probe()
550 sis_priv->host_bridge_rev = dev->revision; in sis900_probe()
565 if (netif_msg_probe(sis_priv) && (ret & PME_D3C) == 0) in sis900_probe()
571 pci_free_consistent(pci_dev, RX_TOTAL_SIZE, sis_priv->rx_ring, in sis900_probe()
572 sis_priv->rx_ring_dma); in sis900_probe()
574 pci_free_consistent(pci_dev, TX_TOTAL_SIZE, sis_priv->tx_ring, in sis900_probe()
575 sis_priv->tx_ring_dma); in sis900_probe()
595 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_mii_probe() local
596 const char *dev_name = pci_name(sis_priv->pci_dev); in sis900_mii_probe()
601 sis_priv->mii = NULL; in sis900_mii_probe()
614 if (netif_msg_probe(sis_priv)) in sis900_mii_probe()
623 mii_phy = sis_priv->first_mii; in sis900_mii_probe()
637 mii_phy->next = sis_priv->mii; in sis900_mii_probe()
638 sis_priv->mii = mii_phy; in sis900_mii_probe()
639 sis_priv->first_mii = mii_phy; in sis900_mii_probe()
663 if (sis_priv->mii == NULL) { in sis900_mii_probe()
669 sis_priv->mii = NULL; in sis900_mii_probe()
673 if ((sis_priv->mii->phy_id0 == 0x001D) && in sis900_mii_probe()
674 ((sis_priv->mii->phy_id1&0xFFF0) == 0x8000)) in sis900_mii_probe()
675 status = sis900_reset_phy(net_dev, sis_priv->cur_phy); in sis900_mii_probe()
678 if ((sis_priv->mii->phy_id0 == 0x0015) && in sis900_mii_probe()
679 ((sis_priv->mii->phy_id1&0xFFF0) == 0xF440)) in sis900_mii_probe()
680 mdio_write(net_dev, sis_priv->cur_phy, 0x0018, 0xD200); in sis900_mii_probe()
686 poll_bit ^= (mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS) & poll_bit); in sis900_mii_probe()
695 if (sis_priv->chipset_rev == SIS630E_900_REV) { in sis900_mii_probe()
697 mdio_write(net_dev, sis_priv->cur_phy, MII_ANADV, 0x05e1); in sis900_mii_probe()
698 mdio_write(net_dev, sis_priv->cur_phy, MII_CONFIG1, 0x22); in sis900_mii_probe()
699 mdio_write(net_dev, sis_priv->cur_phy, MII_CONFIG2, 0xff00); in sis900_mii_probe()
700 mdio_write(net_dev, sis_priv->cur_phy, MII_MASK, 0xffc0); in sis900_mii_probe()
704 if (sis_priv->mii->status & MII_STAT_LINK) in sis900_mii_probe()
723 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_default_phy() local
728 for (phy=sis_priv->first_mii; phy; phy=phy->next) { in sis900_default_phy()
752 default_phy = sis_priv->first_mii; in sis900_default_phy()
754 if (sis_priv->mii != default_phy) { in sis900_default_phy()
755 sis_priv->mii = default_phy; in sis900_default_phy()
756 sis_priv->cur_phy = default_phy->phy_addr; in sis900_default_phy()
758 pci_name(sis_priv->pci_dev), sis_priv->cur_phy); in sis900_default_phy()
761 sis_priv->mii_info.phy_id = sis_priv->cur_phy; in sis900_default_phy()
763 status = mdio_read(net_dev, sis_priv->cur_phy, MII_CONTROL); in sis900_default_phy()
766 mdio_write(net_dev, sis_priv->cur_phy, MII_CONTROL, status); in sis900_default_phy()
767 status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); in sis900_default_phy()
768 status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); in sis900_default_phy()
1021 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_open() local
1029 sis630_set_eq(net_dev, sis_priv->chipset_rev); in sis900_open()
1053 sis900_check_mode(net_dev, sis_priv->mii); in sis900_open()
1057 init_timer(&sis_priv->timer); in sis900_open()
1058 sis_priv->timer.expires = jiffies + HZ; in sis900_open()
1059 sis_priv->timer.data = (unsigned long)net_dev; in sis900_open()
1060 sis_priv->timer.function = sis900_timer; in sis900_open()
1061 add_timer(&sis_priv->timer); in sis900_open()
1077 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_init_rxfilter() local
1095 if (netif_msg_hw(sis_priv)) { in sis900_init_rxfilter()
1115 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_init_tx_ring() local
1119 sis_priv->tx_full = 0; in sis900_init_tx_ring()
1120 sis_priv->dirty_tx = sis_priv->cur_tx = 0; in sis900_init_tx_ring()
1123 sis_priv->tx_skbuff[i] = NULL; in sis900_init_tx_ring()
1125 sis_priv->tx_ring[i].link = sis_priv->tx_ring_dma + in sis900_init_tx_ring()
1127 sis_priv->tx_ring[i].cmdsts = 0; in sis900_init_tx_ring()
1128 sis_priv->tx_ring[i].bufptr = 0; in sis900_init_tx_ring()
1132 outl(sis_priv->tx_ring_dma, ioaddr + txdp); in sis900_init_tx_ring()
1133 if (netif_msg_hw(sis_priv)) in sis900_init_tx_ring()
1149 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_init_rx_ring() local
1153 sis_priv->cur_rx = 0; in sis900_init_rx_ring()
1154 sis_priv->dirty_rx = 0; in sis900_init_rx_ring()
1158 sis_priv->rx_skbuff[i] = NULL; in sis900_init_rx_ring()
1160 sis_priv->rx_ring[i].link = sis_priv->rx_ring_dma + in sis900_init_rx_ring()
1162 sis_priv->rx_ring[i].cmdsts = 0; in sis900_init_rx_ring()
1163 sis_priv->rx_ring[i].bufptr = 0; in sis900_init_rx_ring()
1177 sis_priv->rx_skbuff[i] = skb; in sis900_init_rx_ring()
1178 sis_priv->rx_ring[i].cmdsts = RX_BUF_SIZE; in sis900_init_rx_ring()
1179 sis_priv->rx_ring[i].bufptr = pci_map_single(sis_priv->pci_dev, in sis900_init_rx_ring()
1182 sis_priv->dirty_rx = (unsigned int) (i - NUM_RX_DESC); in sis900_init_rx_ring()
1185 outl(sis_priv->rx_ring_dma, ioaddr + rxdp); in sis900_init_rx_ring()
1186 if (netif_msg_hw(sis_priv)) in sis900_init_rx_ring()
1220 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis630_set_eq() local
1229 reg14h = mdio_read(net_dev, sis_priv->cur_phy, MII_RESV); in sis630_set_eq()
1230 mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, in sis630_set_eq()
1234 sis_priv->cur_phy, MII_RESV)) >> 3; in sis630_set_eq()
1256 (sis_priv->host_bridge_rev == SIS630B0 || in sis630_set_eq()
1257 sis_priv->host_bridge_rev == SIS630B1)) { in sis630_set_eq()
1264 reg14h = mdio_read(net_dev, sis_priv->cur_phy, MII_RESV); in sis630_set_eq()
1267 mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, reg14h); in sis630_set_eq()
1269 reg14h = mdio_read(net_dev, sis_priv->cur_phy, MII_RESV); in sis630_set_eq()
1271 (sis_priv->host_bridge_rev == SIS630B0 || in sis630_set_eq()
1272 sis_priv->host_bridge_rev == SIS630B1)) in sis630_set_eq()
1273 mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, in sis630_set_eq()
1276 mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, in sis630_set_eq()
1292 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_timer() local
1293 struct mii_phy *mii_phy = sis_priv->mii; in sis900_timer()
1297 if (!sis_priv->autong_complete){ in sis900_timer()
1303 sis630_set_eq(net_dev, sis_priv->chipset_rev); in sis900_timer()
1307 sis_priv->timer.expires = jiffies + HZ; in sis900_timer()
1308 add_timer(&sis_priv->timer); in sis900_timer()
1312 status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); in sis900_timer()
1313 status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); in sis900_timer()
1320 mii_phy = sis_priv->mii; in sis900_timer()
1330 if(netif_msg_link(sis_priv)) in sis900_timer()
1336 sis900_reset_phy(net_dev, sis_priv->cur_phy); in sis900_timer()
1338 sis630_set_eq(net_dev, sis_priv->chipset_rev); in sis900_timer()
1344 sis_priv->timer.expires = jiffies + next_tick; in sis900_timer()
1345 add_timer(&sis_priv->timer); in sis900_timer()
1362 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_check_mode() local
1369 sis900_auto_negotiate(net_dev, sis_priv->cur_phy); in sis900_check_mode()
1375 sis_priv->autong_complete = 1; in sis900_check_mode()
1441 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_auto_negotiate() local
1449 if(netif_msg_link(sis_priv)) in sis900_auto_negotiate()
1451 sis_priv->autong_complete = 1; in sis900_auto_negotiate()
1459 sis_priv->autong_complete = 0; in sis900_auto_negotiate()
1476 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_read_mode() local
1477 struct mii_phy *phy = sis_priv->mii; in sis900_read_mode()
1478 int phy_addr = sis_priv->cur_phy; in sis900_read_mode()
1502 sis_priv->autong_complete = 1; in sis900_read_mode()
1512 if(netif_msg_link(sis_priv)) in sis900_read_mode()
1531 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_tx_timeout() local
1536 if(netif_msg_tx_err(sis_priv)) in sis900_tx_timeout()
1544 spin_lock_irqsave(&sis_priv->lock, flags); in sis900_tx_timeout()
1547 sis_priv->dirty_tx = sis_priv->cur_tx = 0; in sis900_tx_timeout()
1549 struct sk_buff *skb = sis_priv->tx_skbuff[i]; in sis900_tx_timeout()
1552 pci_unmap_single(sis_priv->pci_dev, in sis900_tx_timeout()
1553 sis_priv->tx_ring[i].bufptr, skb->len, in sis900_tx_timeout()
1556 sis_priv->tx_skbuff[i] = NULL; in sis900_tx_timeout()
1557 sis_priv->tx_ring[i].cmdsts = 0; in sis900_tx_timeout()
1558 sis_priv->tx_ring[i].bufptr = 0; in sis900_tx_timeout()
1562 sis_priv->tx_full = 0; in sis900_tx_timeout()
1565 spin_unlock_irqrestore(&sis_priv->lock, flags); in sis900_tx_timeout()
1570 outl(sis_priv->tx_ring_dma, ioaddr + txdp); in sis900_tx_timeout()
1589 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_start_xmit() local
1597 if(!sis_priv->autong_complete){ in sis900_start_xmit()
1602 spin_lock_irqsave(&sis_priv->lock, flags); in sis900_start_xmit()
1605 entry = sis_priv->cur_tx % NUM_TX_DESC; in sis900_start_xmit()
1606 sis_priv->tx_skbuff[entry] = skb; in sis900_start_xmit()
1609 sis_priv->tx_ring[entry].bufptr = pci_map_single(sis_priv->pci_dev, in sis900_start_xmit()
1611 sis_priv->tx_ring[entry].cmdsts = (OWN | skb->len); in sis900_start_xmit()
1614 sis_priv->cur_tx ++; in sis900_start_xmit()
1615 index_cur_tx = sis_priv->cur_tx; in sis900_start_xmit()
1616 index_dirty_tx = sis_priv->dirty_tx; in sis900_start_xmit()
1623 sis_priv->tx_full = 1; in sis900_start_xmit()
1630 sis_priv->tx_full = 1; in sis900_start_xmit()
1634 spin_unlock_irqrestore(&sis_priv->lock, flags); in sis900_start_xmit()
1636 if (netif_msg_tx_queued(sis_priv)) in sis900_start_xmit()
1656 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_interrupt() local
1662 spin_lock (&sis_priv->lock); in sis900_interrupt()
1683 if(netif_msg_intr(sis_priv)) in sis900_interrupt()
1689 if(netif_msg_intr(sis_priv)) in sis900_interrupt()
1697 if(netif_msg_intr(sis_priv)) in sis900_interrupt()
1702 spin_unlock (&sis_priv->lock); in sis900_interrupt()
1718 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_rx() local
1720 unsigned int entry = sis_priv->cur_rx % NUM_RX_DESC; in sis900_rx()
1721 u32 rx_status = sis_priv->rx_ring[entry].cmdsts; in sis900_rx()
1724 if (netif_msg_rx_status(sis_priv)) in sis900_rx()
1727 sis_priv->cur_rx, sis_priv->dirty_rx, rx_status); in sis900_rx()
1728 rx_work_limit = sis_priv->dirty_rx + NUM_RX_DESC - sis_priv->cur_rx; in sis900_rx()
1748 if (netif_msg_rx_err(sis_priv)) in sis900_rx()
1762 sis_priv->rx_ring[entry].cmdsts = RX_BUF_SIZE; in sis900_rx()
1767 pci_unmap_single(sis_priv->pci_dev, in sis900_rx()
1768 sis_priv->rx_ring[entry].bufptr, RX_BUF_SIZE, in sis900_rx()
1780 skb = sis_priv->rx_skbuff[entry]; in sis900_rx()
1788 if (sis_priv->rx_skbuff[entry] == NULL) { in sis900_rx()
1789 if (netif_msg_rx_err(sis_priv)) in sis900_rx()
1793 net_dev->name, sis_priv->cur_rx, in sis900_rx()
1794 sis_priv->dirty_rx); in sis900_rx()
1800 rx_skb = sis_priv->rx_skbuff[entry]; in sis900_rx()
1810 sis_priv->dirty_rx++; in sis900_rx()
1812 sis_priv->rx_skbuff[entry] = skb; in sis900_rx()
1813 sis_priv->rx_ring[entry].cmdsts = RX_BUF_SIZE; in sis900_rx()
1814 sis_priv->rx_ring[entry].bufptr = in sis900_rx()
1815 pci_map_single(sis_priv->pci_dev, skb->data, in sis900_rx()
1818 sis_priv->cur_rx++; in sis900_rx()
1819 entry = sis_priv->cur_rx % NUM_RX_DESC; in sis900_rx()
1820 rx_status = sis_priv->rx_ring[entry].cmdsts; in sis900_rx()
1825 for (; sis_priv->cur_rx != sis_priv->dirty_rx; sis_priv->dirty_rx++) { in sis900_rx()
1828 entry = sis_priv->dirty_rx % NUM_RX_DESC; in sis900_rx()
1830 if (sis_priv->rx_skbuff[entry] == NULL) { in sis900_rx()
1836 if (netif_msg_rx_err(sis_priv)) in sis900_rx()
1843 sis_priv->rx_skbuff[entry] = skb; in sis900_rx()
1844 sis_priv->rx_ring[entry].cmdsts = RX_BUF_SIZE; in sis900_rx()
1845 sis_priv->rx_ring[entry].bufptr = in sis900_rx()
1846 pci_map_single(sis_priv->pci_dev, skb->data, in sis900_rx()
1868 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_finish_xmit() local
1870 for (; sis_priv->dirty_tx != sis_priv->cur_tx; sis_priv->dirty_tx++) { in sis900_finish_xmit()
1875 entry = sis_priv->dirty_tx % NUM_TX_DESC; in sis900_finish_xmit()
1876 tx_status = sis_priv->tx_ring[entry].cmdsts; in sis900_finish_xmit()
1887 if (netif_msg_tx_err(sis_priv)) in sis900_finish_xmit()
1907 skb = sis_priv->tx_skbuff[entry]; in sis900_finish_xmit()
1908 pci_unmap_single(sis_priv->pci_dev, in sis900_finish_xmit()
1909 sis_priv->tx_ring[entry].bufptr, skb->len, in sis900_finish_xmit()
1912 sis_priv->tx_skbuff[entry] = NULL; in sis900_finish_xmit()
1913 sis_priv->tx_ring[entry].bufptr = 0; in sis900_finish_xmit()
1914 sis_priv->tx_ring[entry].cmdsts = 0; in sis900_finish_xmit()
1917 if (sis_priv->tx_full && netif_queue_stopped(net_dev) && in sis900_finish_xmit()
1918 sis_priv->cur_tx - sis_priv->dirty_tx < NUM_TX_DESC - 4) { in sis900_finish_xmit()
1921 sis_priv->tx_full = 0; in sis900_finish_xmit()
1937 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_close() local
1950 del_timer(&sis_priv->timer); in sis900_close()
1956 skb = sis_priv->rx_skbuff[i]; in sis900_close()
1958 pci_unmap_single(sis_priv->pci_dev, in sis900_close()
1959 sis_priv->rx_ring[i].bufptr, in sis900_close()
1962 sis_priv->rx_skbuff[i] = NULL; in sis900_close()
1966 skb = sis_priv->tx_skbuff[i]; in sis900_close()
1968 pci_unmap_single(sis_priv->pci_dev, in sis900_close()
1969 sis_priv->tx_ring[i].bufptr, skb->len, in sis900_close()
1972 sis_priv->tx_skbuff[i] = NULL; in sis900_close()
1992 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_get_drvinfo() local
1996 strcpy (info->bus_info, pci_name(sis_priv->pci_dev)); in sis900_get_drvinfo()
2001 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_get_msglevel() local
2002 return sis_priv->msg_enable; in sis900_get_msglevel()
2007 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_set_msglevel() local
2008 sis_priv->msg_enable = value; in sis900_set_msglevel()
2013 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_get_link() local
2014 return mii_link_ok(&sis_priv->mii_info); in sis900_get_link()
2020 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_get_settings() local
2021 spin_lock_irq(&sis_priv->lock); in sis900_get_settings()
2022 mii_ethtool_gset(&sis_priv->mii_info, cmd); in sis900_get_settings()
2023 spin_unlock_irq(&sis_priv->lock); in sis900_get_settings()
2030 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_set_settings() local
2032 spin_lock_irq(&sis_priv->lock); in sis900_set_settings()
2033 rt = mii_ethtool_sset(&sis_priv->mii_info, cmd); in sis900_set_settings()
2034 spin_unlock_irq(&sis_priv->lock); in sis900_set_settings()
2040 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_nway_reset() local
2041 return mii_nway_restart(&sis_priv->mii_info); in sis900_nway_reset()
2057 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_set_wol() local
2062 pci_read_config_dword(sis_priv->pci_dev, CFGPMCSR, &cfgpmcsr); in sis900_set_wol()
2064 pci_write_config_dword(sis_priv->pci_dev, CFGPMCSR, cfgpmcsr); in sis900_set_wol()
2066 if (netif_msg_wol(sis_priv)) in sis900_set_wol()
2082 pci_read_config_dword(sis_priv->pci_dev, CFGPMCSR, &cfgpmcsr); in sis900_set_wol()
2084 pci_write_config_dword(sis_priv->pci_dev, CFGPMCSR, cfgpmcsr); in sis900_set_wol()
2085 if (netif_msg_wol(sis_priv)) in sis900_set_wol()
2128 struct sis900_private *sis_priv = netdev_priv(net_dev); in mii_ioctl() local
2133 data->phy_id = sis_priv->mii->phy_addr; in mii_ioctl()
2160 struct sis900_private *sis_priv = netdev_priv(dev); in sis900_set_config() local
2161 struct mii_phy *mii_phy = sis_priv->mii; in sis900_set_config()
2283 struct sis900_private *sis_priv = netdev_priv(net_dev); in set_rx_mode() local
2289 if((sis_priv->chipset_rev >= SIS635A_900_REV) || in set_rx_mode()
2290 (sis_priv->chipset_rev == SIS900B_900_REV)) in set_rx_mode()
2317 sis_priv->chipset_rev); in set_rx_mode()
2357 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_reset() local
2373 if( (sis_priv->chipset_rev >= SIS635A_900_REV) || in sis900_reset()
2374 (sis_priv->chipset_rev == SIS900B_900_REV) ) in sis900_reset()
2390 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_remove() local
2393 while (sis_priv->first_mii) { in sis900_remove()
2394 phy = sis_priv->first_mii; in sis900_remove()
2395 sis_priv->first_mii = phy->next; in sis900_remove()
2399 pci_free_consistent(pci_dev, RX_TOTAL_SIZE, sis_priv->rx_ring, in sis900_remove()
2400 sis_priv->rx_ring_dma); in sis900_remove()
2401 pci_free_consistent(pci_dev, TX_TOTAL_SIZE, sis_priv->tx_ring, in sis900_remove()
2402 sis_priv->tx_ring_dma); in sis900_remove()
2434 struct sis900_private *sis_priv = netdev_priv(net_dev); in sis900_resume() local
2460 sis900_check_mode(net_dev, sis_priv->mii); in sis900_resume()