Lines Matching refs:sdc

301 static struct sundance_private *sdc;  variable
317 int mii_lpa = mdio_read(nic, sdc->phys[0], MII_LPA); in check_duplex()
318 int negotiated = mii_lpa & sdc->mii_if.advertising; in check_duplex()
322 if (!sdc->an_enable || mii_lpa == 0xffff) { in check_duplex()
323 if (sdc->mii_if.full_duplex) in check_duplex()
331 if (sdc->mii_if.full_duplex != duplex) { in check_duplex()
332 sdc->mii_if.full_duplex = duplex; in check_duplex()
334 "negotiated capability %4.4x.\n", sdc->nic_name, in check_duplex()
335 duplex ? "full" : "half", sdc->phys[0], in check_duplex()
350 sdc->cur_rx = 0; in init_ring()
410 outw(sdc->mtu + 14, BASE + MaxFrameSize); in sundance_reset()
411 if (sdc->mtu > 2047) /* this will never happen with default options */ in sundance_reset()
421 if (sdc->pci_rev_id >= 0x14) in sundance_reset()
440 sdc->nic_name, (int) inl(BASE + RxStatus), in sundance_reset()
473 int entry = sdc->cur_rx % RX_RING_SIZE; in sundance_poll()
499 (sdc->cur_rx * PKT_BUF_SZ), nic->packetlen); in sundance_poll()
506 sdc->cur_rx = entry % RX_RING_SIZE; in sundance_poll()
619 sdc = &sdx; in sundance_probe()
621 sdc->nic_name = pci->name; in sundance_probe()
622 sdc->mtu = mtu; in sundance_probe()
624 pci_read_config_byte(pci, PCI_REVISION_ID, &sdc->pci_rev_id); in sundance_probe()
625 dprintf(("Device revision id: %hx\n", sdc->pci_rev_id)); in sundance_probe()
628 sdc->mii_preamble_required = 0; in sundance_probe()
631 sdc->phys[0] = 1; /* Default Setting */ in sundance_probe()
632 sdc->mii_preamble_required++; in sundance_probe()
636 sdc->phys[phy_idx++] = phy; in sundance_probe()
637 sdc->mii_if.advertising = in sundance_probe()
640 sdc->mii_preamble_required++; in sundance_probe()
642 …PHY found at address %d, status " "%hX advertising %hX\n", sdc->nic_name, phy, mii_status, sdc->mi… in sundance_probe()
645 sdc->mii_preamble_required--; in sundance_probe()
648 sdc->nic_name); in sundance_probe()
649 sdc->mii_if.phy_id = sdc->phys[0]; in sundance_probe()
653 sdc->an_enable = 1; in sundance_probe()
655 sdc->an_enable = 0; in sundance_probe()
658 sdc->speed = 100; in sundance_probe()
659 sdc->mii_if.full_duplex = 1; in sundance_probe()
662 sdc->speed = 100; in sundance_probe()
663 sdc->mii_if.full_duplex = 0; in sundance_probe()
666 sdc->speed = 10; in sundance_probe()
667 sdc->mii_if.full_duplex = 1; in sundance_probe()
670 sdc->speed = 10; in sundance_probe()
671 sdc->mii_if.full_duplex = 0; in sundance_probe()
673 sdc->an_enable = 1; in sundance_probe()
677 sdc->flowctrl = 1; in sundance_probe()
682 if (sdc->an_enable) { in sundance_probe()
683 sdc->speed = 100; in sundance_probe()
684 sdc->mii_if.full_duplex = 1; in sundance_probe()
685 sdc->an_enable = 0; in sundance_probe()
694 if (!sdc->an_enable) { in sundance_probe()
696 mii_ctl |= (sdc->speed == 100) ? BMCR_SPEED100 : 0; in sundance_probe()
697 mii_ctl |= (sdc->mii_if.full_duplex) ? BMCR_FULLDPLX : 0; in sundance_probe()
698 mdio_write(nic, sdc->phys[0], MII_BMCR, mii_ctl); in sundance_probe()
700 sdc->speed, in sundance_probe()
701 sdc->mii_if.full_duplex ? "Full" : "Half"); in sundance_probe()
710 if (sdc->an_enable) { in sundance_probe()
713 mdio_read(nic, sdc->phys[0], MII_ADVERTISE); in sundance_probe()
714 mii_lpa = mdio_read(nic, sdc->phys[0], MII_LPA); in sundance_probe()
717 sdc->speed = 100; in sundance_probe()
719 sdc->speed = 100; in sundance_probe()
721 sdc->speed = 10; in sundance_probe()
723 sdc->speed = 10; in sundance_probe()
725 mii_ctl = mdio_read(nic, sdc->phys[0], MII_BMCR); in sundance_probe()
727 sdc->speed = speed; in sundance_probe()
728 printf("%s: Link changed: %dMbps ,", sdc->nic_name, speed); in sundance_probe()
733 if (sdc->flowctrl && sdc->mii_if.full_duplex) { in sundance_probe()
738 printf("%dMbps, %s-Duplex\n", sdc->speed, in sundance_probe()
739 sdc->mii_if.full_duplex ? "Full" : "Half"); in sundance_probe()
811 if (sdc->mii_preamble_required) in mdio_read()
845 if (sdc->mii_preamble_required) in mdio_write()
876 if (sdc->mii_if.full_duplex && sdc->flowctrl) in set_rx_mode()