Lines Matching refs:smc

304     struct smc_private *smc;  in smc91c92_probe()  local
313 smc = netdev_priv(dev); in smc91c92_probe()
314 smc->p_dev = link; in smc91c92_probe()
317 spin_lock_init(&smc->lock); in smc91c92_probe()
324 smc->mii_if.dev = dev; in smc91c92_probe()
325 smc->mii_if.mdio_read = mdio_read; in smc91c92_probe()
326 smc->mii_if.mdio_write = mdio_write; in smc91c92_probe()
327 smc->mii_if.phy_id_mask = 0x1f; in smc91c92_probe()
328 smc->mii_if.reg_num_mask = 0x1f; in smc91c92_probe()
383 struct smc_private *smc = netdev_priv(dev); in mhz_3288_power() local
387 readb(smc->base+MEGAHERTZ_ISR); in mhz_3288_power()
389 readb(smc->base+MEGAHERTZ_ISR); in mhz_3288_power()
395 tmp = readb(smc->base + link->config_base + CISREG_COR); in mhz_3288_power()
397 writeb(tmp, smc->base + link->config_base + CISREG_COR); in mhz_3288_power()
426 struct smc_private *smc = netdev_priv(dev); in mhz_mfc_config() local
447 smc->base = ioremap(link->resource[2]->start, in mhz_mfc_config()
449 offset = (smc->manfid == MANFID_MOTOROLA) ? link->config_base : 0; in mhz_mfc_config()
452 (smc->manfid == MANFID_MEGAHERTZ) && in mhz_mfc_config()
453 (smc->cardid == PRODID_MEGAHERTZ_EM3288)) in mhz_mfc_config()
521 struct smc_private *smc = netdev_priv(dev); in mot_config() local
526 writeb(iouart & 0xff, smc->base + MOT_UART + CISREG_IOBASE_0); in mot_config()
527 writeb((iouart >> 8) & 0xff, smc->base + MOT_UART + CISREG_IOBASE_1); in mot_config()
528 writeb(MOT_NORMAL, smc->base + MOT_UART + CISREG_COR); in mot_config()
531 writeb(ioaddr & 0xff, smc->base + MOT_LAN + CISREG_IOBASE_0); in mot_config()
532 writeb((ioaddr >> 8) & 0xff, smc->base + MOT_LAN + CISREG_IOBASE_1); in mot_config()
533 writeb(MOT_NORMAL, smc->base + MOT_LAN + CISREG_COR); in mot_config()
725 struct smc_private *smc = netdev_priv(dev); in smc91c92_resume() local
728 if ((smc->manfid == MANFID_MEGAHERTZ) && in smc91c92_resume()
729 (smc->cardid == PRODID_MEGAHERTZ_EM3288)) in smc91c92_resume()
731 if (smc->manfid == MANFID_MOTOROLA) in smc91c92_resume()
733 if ((smc->manfid == MANFID_OSITECH) && in smc91c92_resume()
734 (smc->cardid != PRODID_OSITECH_SEVEN)) { in smc91c92_resume()
739 if (((smc->manfid == MANFID_OSITECH) && in smc91c92_resume()
740 (smc->cardid == PRODID_OSITECH_SEVEN)) || in smc91c92_resume()
741 ((smc->manfid == MANFID_PSION) && in smc91c92_resume()
742 (smc->cardid == PRODID_PSION_NET100))) { in smc91c92_resume()
811 struct smc_private *smc = netdev_priv(dev); in smc91c92_config() local
819 smc->manfid = link->manf_id; in smc91c92_config()
820 smc->cardid = link->card_id; in smc91c92_config()
822 if ((smc->manfid == MANFID_OSITECH) && in smc91c92_config()
823 (smc->cardid != PRODID_OSITECH_SEVEN)) { in smc91c92_config()
825 } else if ((smc->manfid == MANFID_MOTOROLA) || in smc91c92_config()
826 ((smc->manfid == MANFID_MEGAHERTZ) && in smc91c92_config()
827 ((smc->cardid == PRODID_MEGAHERTZ_VARIOUS) || in smc91c92_config()
828 (smc->cardid == PRODID_MEGAHERTZ_EM3288)))) { in smc91c92_config()
843 if (smc->manfid == MANFID_MOTOROLA) in smc91c92_config()
853 switch (smc->manfid) { in smc91c92_config()
856 i = osi_setup(link, smc->manfid, smc->cardid); break; in smc91c92_config()
873 smc->duplex = 0; in smc91c92_config()
874 smc->rx_ovrn = 0; in smc91c92_config()
898 smc->cfg = inw(ioaddr + CONFIG) & ~CFG_AUI_SELECT; in smc91c92_config()
899 smc->cfg |= CFG_NO_WAIT | CFG_16BIT | CFG_STATIC; in smc91c92_config()
900 if (smc->manfid == MANFID_OSITECH) in smc91c92_config()
901 smc->cfg |= CFG_IRQ_SEL_1 | CFG_IRQ_SEL_0; in smc91c92_config()
903 smc->cfg |= CFG_MII_SELECT; in smc91c92_config()
907 if (smc->cfg & CFG_MII_SELECT) { in smc91c92_config()
914 smc->mii_if.phy_id = (i < 32) ? i : -1; in smc91c92_config()
935 (smc->cfg & CFG_MII_SELECT) ? "MII" : if_names[dev->if_port]); in smc91c92_config()
938 if (smc->cfg & CFG_MII_SELECT) { in smc91c92_config()
939 if (smc->mii_if.phy_id != -1) { in smc91c92_config()
941 smc->mii_if.phy_id, j); in smc91c92_config()
961 struct smc_private *smc = netdev_priv(dev); in smc91c92_release() local
962 iounmap(smc->base); in smc91c92_release()
1052 struct smc_private *smc = netdev_priv(dev); in smc_open() local
1053 struct pcmcia_device *link = smc->p_dev; in smc_open()
1072 smc->saved_skb = NULL; in smc_open()
1073 smc->packets_waiting = 0; in smc_open()
1076 timer_setup(&smc->media, media_check, 0); in smc_open()
1077 mod_timer(&smc->media, jiffies + HZ); in smc_open()
1086 struct smc_private *smc = netdev_priv(dev); in smc_close() local
1087 struct pcmcia_device *link = smc->p_dev; in smc_close()
1108 del_timer_sync(&smc->media); in smc_close()
1123 struct smc_private *smc = netdev_priv(dev); in smc_hardware_send_packet() local
1124 struct sk_buff *skb = smc->saved_skb; in smc_hardware_send_packet()
1140 smc->saved_skb = NULL; in smc_hardware_send_packet()
1176 smc->saved_skb = NULL; in smc_hardware_send_packet()
1186 struct smc_private *smc = netdev_priv(dev); in smc_tx_timeout() local
1194 smc->saved_skb = NULL; in smc_tx_timeout()
1201 struct smc_private *smc = netdev_priv(dev); in smc_start_xmit() local
1212 if (smc->saved_skb) { in smc_start_xmit()
1218 smc->saved_skb = skb; in smc_start_xmit()
1225 smc->saved_skb = NULL; in smc_start_xmit()
1230 smc->packets_waiting++; in smc_start_xmit()
1232 spin_lock_irqsave(&smc->lock, flags); in smc_start_xmit()
1236 if (smc->rx_ovrn) { in smc_start_xmit()
1238 smc->rx_ovrn = 0; in smc_start_xmit()
1249 spin_unlock_irqrestore(&smc->lock, flags); in smc_start_xmit()
1257 spin_unlock_irqrestore(&smc->lock, flags); in smc_start_xmit()
1270 struct smc_private *smc = netdev_priv(dev); in smc_tx_err() local
1289 smc->tx_err++; in smc_tx_err()
1297 outw(inw(ioaddr + TCR) | TCR_ENABLE | smc->duplex, ioaddr + TCR); in smc_tx_err()
1303 smc->packets_waiting--; in smc_tx_err()
1312 struct smc_private *smc = netdev_priv(dev); in smc_eph_irq() local
1332 outw(inw(ioaddr + TCR) | TCR_ENABLE | smc->duplex, ioaddr + TCR); in smc_eph_irq()
1347 struct smc_private *smc = netdev_priv(dev); in smc_interrupt() local
1361 spin_lock(&smc->lock); in smc_interrupt()
1362 smc->watchdog = 0; in smc_interrupt()
1400 dev->stats.tx_packets += smc->packets_waiting; in smc_interrupt()
1401 smc->packets_waiting = 0; in smc_interrupt()
1418 if (smc->duplex) in smc_interrupt()
1419 smc->rx_ovrn = 1; /* need MC_RESET outside smc_interrupt */ in smc_interrupt()
1438 if ((smc->manfid == MANFID_OSITECH) && in smc_interrupt()
1439 (smc->cardid != PRODID_OSITECH_SEVEN)) { in smc_interrupt()
1444 if (smc->manfid == MANFID_MOTOROLA) { in smc_interrupt()
1446 cor = readb(smc->base + MOT_UART + CISREG_COR); in smc_interrupt()
1447 writeb(cor & ~COR_IREQ_ENA, smc->base + MOT_UART + CISREG_COR); in smc_interrupt()
1448 writeb(cor, smc->base + MOT_UART + CISREG_COR); in smc_interrupt()
1449 cor = readb(smc->base + MOT_LAN + CISREG_COR); in smc_interrupt()
1450 writeb(cor & ~COR_IREQ_ENA, smc->base + MOT_LAN + CISREG_COR); in smc_interrupt()
1451 writeb(cor, smc->base + MOT_LAN + CISREG_COR); in smc_interrupt()
1454 if ((smc->base != NULL) && /* Megahertz MFC's */ in smc_interrupt()
1455 (smc->manfid == MANFID_MEGAHERTZ) && in smc_interrupt()
1456 (smc->cardid == PRODID_MEGAHERTZ_EM3288)) { in smc_interrupt()
1459 tmp = readb(smc->base+MEGAHERTZ_ISR); in smc_interrupt()
1460 tmp = readb(smc->base+MEGAHERTZ_ISR); in smc_interrupt()
1463 writeb(tmp, smc->base + MEGAHERTZ_ISR); in smc_interrupt()
1464 writeb(tmp, smc->base + MEGAHERTZ_ISR); in smc_interrupt()
1467 spin_unlock(&smc->lock); in smc_interrupt()
1498 struct smc_private *smc = netdev_priv(dev); in smc_rx() local
1517 smc->last_rx = jiffies; in smc_rx()
1549 struct smc_private *smc = netdev_priv(dev); in set_rx_mode() local
1574 spin_lock_irqsave(&smc->lock, flags); in set_rx_mode()
1581 spin_unlock_irqrestore(&smc->lock, flags); in set_rx_mode()
1592 struct smc_private *smc = netdev_priv(dev); in s9k_config() local
1594 if (smc->cfg & CFG_MII_SELECT) in s9k_config()
1617 struct smc_private *smc = netdev_priv(dev); in smc_set_xcvr() local
1624 outw(smc->cfg | CFG_AUI_SELECT, ioaddr + CONFIG); in smc_set_xcvr()
1625 if ((smc->manfid == MANFID_OSITECH) && in smc_set_xcvr()
1626 (smc->cardid != PRODID_OSITECH_SEVEN)) in smc_set_xcvr()
1628 smc->media_status = ((dev->if_port == 0) ? 0x0001 : 0x0002); in smc_set_xcvr()
1630 outw(smc->cfg, ioaddr + CONFIG); in smc_set_xcvr()
1631 if ((smc->manfid == MANFID_OSITECH) && in smc_set_xcvr()
1632 (smc->cardid != PRODID_OSITECH_SEVEN)) in smc_set_xcvr()
1634 smc->media_status = ((dev->if_port == 0) ? 0x0012 : 0x4001); in smc_set_xcvr()
1642 struct smc_private *smc = netdev_priv(dev); in smc_reset() local
1666 if ((smc->manfid == MANFID_OSITECH) && in smc_reset()
1667 (smc->cardid != PRODID_OSITECH_SEVEN)) in smc_reset()
1684 outw(((smc->cfg & CFG_MII_SELECT) ? 0 : TCR_MONCSN) | in smc_reset()
1685 TCR_ENABLE | TCR_PAD_EN | smc->duplex, ioaddr + TCR); in smc_reset()
1688 if (smc->cfg & CFG_MII_SELECT) { in smc_reset()
1692 mdio_write(dev, smc->mii_if.phy_id, 0, 0x8000); in smc_reset()
1695 mdio_write(dev, smc->mii_if.phy_id, 4, 0x01e1); in smc_reset()
1698 mdio_write(dev, smc->mii_if.phy_id, 0, 0x0000); in smc_reset()
1699 mdio_write(dev, smc->mii_if.phy_id, 0, 0x1200); in smc_reset()
1716 struct smc_private *smc = from_timer(smc, t, media); in media_check() local
1717 struct net_device *dev = smc->mii_if.dev; in media_check()
1723 spin_lock_irqsave(&smc->lock, flags); in media_check()
1733 if (smc->rx_ovrn) { in media_check()
1735 smc->rx_ovrn = 0; in media_check()
1744 spin_unlock_irqrestore(&smc->lock, flags); in media_check()
1748 if (smc->watchdog++ && ((i>>8) & i)) { in media_check()
1749 if (!smc->fast_poll) in media_check()
1754 smc->fast_poll = HZ; in media_check()
1756 if (smc->fast_poll) { in media_check()
1757 smc->fast_poll--; in media_check()
1758 smc->media.expires = jiffies + HZ/100; in media_check()
1759 add_timer(&smc->media); in media_check()
1763 spin_lock_irqsave(&smc->lock, flags); in media_check()
1767 if (smc->cfg & CFG_MII_SELECT) { in media_check()
1768 if (smc->mii_if.phy_id < 0) in media_check()
1772 link = mdio_read(dev, smc->mii_if.phy_id, 1); in media_check()
1775 smc->mii_if.phy_id = -1; in media_check()
1780 if (link != smc->link_status) { in media_check()
1781 u_short p = mdio_read(dev, smc->mii_if.phy_id, 5); in media_check()
1783 smc->duplex = (((p & 0x0100) || ((p & 0x1c0) == 0x40)) in media_check()
1788 (p & 0x0180) ? 100 : 10, smc->duplex ? 'F' : 'H'); in media_check()
1791 outw(inw(ioaddr + TCR) | smc->duplex, ioaddr + TCR); in media_check()
1792 smc->link_status = link; in media_check()
1798 if (time_after(jiffies, smc->last_rx + HZ)) { in media_check()
1799 if (smc->tx_err || (smc->media_status & EPH_16COL)) in media_check()
1802 smc->tx_err = 0; in media_check()
1804 if (media != smc->media_status) { in media_check()
1805 if ((media & smc->media_status & 1) && in media_check()
1806 ((smc->media_status ^ media) & EPH_LINK_OK)) in media_check()
1808 smc->media_status & EPH_LINK_OK ? "lost" : "found"); in media_check()
1809 else if ((media & smc->media_status & 2) && in media_check()
1810 ((smc->media_status ^ media) & EPH_16COL)) in media_check()
1826 smc->media_status = media; in media_check()
1830 smc->media.expires = jiffies + HZ; in media_check()
1831 add_timer(&smc->media); in media_check()
1833 spin_unlock_irqrestore(&smc->lock, flags); in media_check()
1839 struct smc_private *smc = netdev_priv(dev); in smc_link_ok() local
1841 if (smc->cfg & CFG_MII_SELECT) { in smc_link_ok()
1842 return mii_link_ok(&smc->mii_if); in smc_link_ok()
1919 struct smc_private *smc = netdev_priv(dev); in smc_get_link_ksettings() local
1924 spin_lock_irqsave(&smc->lock, flags); in smc_get_link_ksettings()
1926 if (smc->cfg & CFG_MII_SELECT) in smc_get_link_ksettings()
1927 mii_ethtool_get_link_ksettings(&smc->mii_if, ecmd); in smc_get_link_ksettings()
1931 spin_unlock_irqrestore(&smc->lock, flags); in smc_get_link_ksettings()
1938 struct smc_private *smc = netdev_priv(dev); in smc_set_link_ksettings() local
1944 spin_lock_irqsave(&smc->lock, flags); in smc_set_link_ksettings()
1946 if (smc->cfg & CFG_MII_SELECT) in smc_set_link_ksettings()
1947 ret = mii_ethtool_set_link_ksettings(&smc->mii_if, ecmd); in smc_set_link_ksettings()
1951 spin_unlock_irqrestore(&smc->lock, flags); in smc_set_link_ksettings()
1957 struct smc_private *smc = netdev_priv(dev); in smc_get_link() local
1963 spin_lock_irqsave(&smc->lock, flags); in smc_get_link()
1967 spin_unlock_irqrestore(&smc->lock, flags); in smc_get_link()
1973 struct smc_private *smc = netdev_priv(dev); in smc_nway_reset() local
1974 if (smc->cfg & CFG_MII_SELECT) { in smc_nway_reset()
1980 res = mii_nway_restart(&smc->mii_if); in smc_nway_reset()
1999 struct smc_private *smc = netdev_priv(dev); in smc_ioctl() local
2009 spin_lock_irqsave(&smc->lock, flags); in smc_ioctl()
2012 rc = generic_mii_ioctl(&smc->mii_if, mii, cmd, NULL); in smc_ioctl()
2014 spin_unlock_irqrestore(&smc->lock, flags); in smc_ioctl()