Lines Matching refs:tp

273 static void tulip_set_power_state (struct tulip_private *tp,  in tulip_set_power_state()  argument
276 if (tp->flags & HAS_ACPI) { in tulip_set_power_state()
278 pci_read_config_dword (tp->pdev, CFDD, &tmp); in tulip_set_power_state()
285 pci_write_config_dword (tp->pdev, CFDD, newtmp); in tulip_set_power_state()
293 struct tulip_private *tp = (struct tulip_private *)dev->priv; in tulip_up() local
299 tulip_set_power_state (tp, 0, 0); in tulip_up()
302 if (tp->mii_cnt || (tp->mtable && tp->mtable->has_mii)) in tulip_up()
312 outl(tp->csr0, ioaddr + CSR0); in tulip_up()
318 outl(tp->rx_ring_dma, ioaddr + CSR3); in tulip_up()
319 outl(tp->tx_ring_dma, ioaddr + CSR4); in tulip_up()
320 tp->cur_rx = tp->cur_tx = 0; in tulip_up()
321 tp->dirty_rx = tp->dirty_tx = 0; in tulip_up()
323 if (tp->flags & MC_HASH_ONLY) { in tulip_up()
326 if (tp->chip_id == AX88140) { in tulip_up()
331 } else if (tp->flags & COMET_MAC_ADDR) { in tulip_up()
340 u16 *setup_frm = &tp->setup_frame[15*6]; in tulip_up()
344 memset(tp->setup_frame, 0xff, sizeof(tp->setup_frame)); in tulip_up()
350 mapping = pci_map_single(tp->pdev, tp->setup_frame, in tulip_up()
351 sizeof(tp->setup_frame), in tulip_up()
353 tp->tx_buffers[tp->cur_tx].skb = NULL; in tulip_up()
354 tp->tx_buffers[tp->cur_tx].mapping = mapping; in tulip_up()
357 tp->tx_ring[tp->cur_tx].length = cpu_to_le32(0x08000000 | 192); in tulip_up()
358 tp->tx_ring[tp->cur_tx].buffer1 = cpu_to_le32(mapping); in tulip_up()
359 tp->tx_ring[tp->cur_tx].status = cpu_to_le32(DescOwned); in tulip_up()
361 tp->cur_tx++; in tulip_up()
364 tp->saved_if_port = dev->if_port; in tulip_up()
366 dev->if_port = tp->default_port; in tulip_up()
370 if (tp->mtable == NULL) in tulip_up()
375 for (i = 0; i < tp->mtable->leafcount; i++) in tulip_up()
376 if (tp->mtable->mleaf[i].media == looking_for) { in tulip_up()
382 if ((tp->mtable->defaultmedia & 0x0800) == 0) { in tulip_up()
383 int looking_for = tp->mtable->defaultmedia & MEDIA_MASK; in tulip_up()
384 for (i = 0; i < tp->mtable->leafcount; i++) in tulip_up()
385 if (tp->mtable->mleaf[i].media == looking_for) { in tulip_up()
392 for (i = tp->mtable->leafcount - 1; in tulip_up()
393 (tulip_media_cap[tp->mtable->mleaf[i].media] & MediaAlwaysFD) && i > 0; i--) in tulip_up()
397 tp->csr6 = 0; in tulip_up()
398 tp->cur_index = i; in tulip_up()
399 tp->nwayset = 0; in tulip_up()
402 if (tp->chip_id == DC21143 && in tulip_up()
410 } else if (tp->chip_id == DC21041) { in tulip_up()
412 tp->nway = tp->mediasense = 1; in tulip_up()
413 tp->nwayset = tp->lpar = 0; in tulip_up()
417 tp->csr6 = 0x80020000; in tulip_up()
418 if (tp->sym_advertise & 0x0040) in tulip_up()
419 tp->csr6 |= FullDuplex; in tulip_up()
420 outl(tp->csr6, ioaddr + CSR6); in tulip_up()
423 } else if (tp->chip_id == DC21142) { in tulip_up()
424 if (tp->mii_cnt) { in tulip_up()
429 dev->name, tp->phys[0], tulip_mdio_read(dev, tp->phys[0], 1)); in tulip_up()
431 tp->csr6 = csr6_mask_hdcap; in tulip_up()
437 } else if (tp->chip_id == PNIC2) { in tulip_up()
439 tp->sym_advertise = 0x01E0; in tulip_up()
444 } else if (tp->chip_id == LC82C168 && ! tp->medialock) { in tulip_up()
445 if (tp->mii_cnt) { in tulip_up()
447 tp->csr6 = 0x814C0000 | (tp->full_duplex ? 0x0200 : 0); in tulip_up()
454 tp->csr6 = 0x00420000; in tulip_up()
459 } else if ((tp->chip_id == MX98713 || tp->chip_id == COMPEX9881) in tulip_up()
460 && ! tp->medialock) { in tulip_up()
462 tp->csr6 = 0x01880000 | (tp->full_duplex ? 0x0200 : 0); in tulip_up()
464 } else if (tp->chip_id == MX98715 || tp->chip_id == MX98725) { in tulip_up()
467 tp->csr6 = 0x01a80200; in tulip_up()
470 } else if (tp->chip_id == COMET || tp->chip_id == CONEXANT) { in tulip_up()
473 dev->if_port = tp->mii_cnt ? 11 : 0; in tulip_up()
474 tp->csr6 = 0x00040000; in tulip_up()
475 } else if (tp->chip_id == AX88140) { in tulip_up()
476 tp->csr6 = tp->mii_cnt ? 0x00040100 : 0x00000100; in tulip_up()
481 tulip_stop_rxtx(tp); in tulip_up()
484 outl(tp->csr6 | TxOn, ioaddr + CSR6); in tulip_up()
487 outl(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR5); in tulip_up()
488 outl(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR7); in tulip_up()
489 tulip_start_rxtx(tp); in tulip_up()
500 tp->timer.expires = RUN_AT(next_tick); in tulip_up()
501 add_timer(&tp->timer); in tulip_up()
508 struct tulip_private *tp = (struct tulip_private *)dev->priv; in tulip_xon() local
510 clear_bit(tp->fc_bit, &netdev_fc_xoff); in tulip_xon()
514 outl(tulip_tbl[tp->chip_id].valid_intrs, dev->base_addr+CSR7); in tulip_xon()
523 struct tulip_private *tp = (struct tulip_private *)dev->priv; in tulip_open() local
538 tp->fc_bit = netdev_register_fc(dev, tulip_xon); in tulip_open()
549 struct tulip_private *tp = (struct tulip_private *)dev->priv; in tulip_tx_timeout() local
553 spin_lock_irqsave (&tp->lock, flags); in tulip_tx_timeout()
560 } else if (tp->chip_id == DC21040) { in tulip_tx_timeout()
561 if ( !tp->medialock && inl(ioaddr + CSR12) & 0x0002) { in tulip_tx_timeout()
569 } else if (tp->chip_id == DC21041) { in tulip_tx_timeout()
576 tp->mediasense = 1; in tulip_tx_timeout()
577 if ( ! tp->medialock) { in tulip_tx_timeout()
587 } else if (tp->chip_id == DC21140 || tp->chip_id == DC21142 in tulip_tx_timeout()
588 || tp->chip_id == MX98713 || tp->chip_id == COMPEX9881 in tulip_tx_timeout()
589 || tp->chip_id == DM910X) { in tulip_tx_timeout()
594 if ( ! tp->medialock && tp->mtable) { in tulip_tx_timeout()
596 --tp->cur_index; in tulip_tx_timeout()
597 while (tp->cur_index >= 0 in tulip_tx_timeout()
598 && (tulip_media_cap[tp->mtable->mleaf[tp->cur_index].media] in tulip_tx_timeout()
600 if (--tp->cur_index < 0) { in tulip_tx_timeout()
602 tp->cur_index = tp->mtable->leafcount - 1; in tulip_tx_timeout()
608 } else if (tp->chip_id == PNIC2) { in tulip_tx_timeout()
624 u8 *buf = (u8 *)(tp->rx_ring[i].buffer1); in tulip_tx_timeout()
628 i, (unsigned int)tp->rx_ring[i].status, in tulip_tx_timeout()
629 (unsigned int)tp->rx_ring[i].length, in tulip_tx_timeout()
630 (unsigned int)tp->rx_ring[i].buffer1, in tulip_tx_timeout()
631 (unsigned int)tp->rx_ring[i].buffer2, in tulip_tx_timeout()
637 printk(KERN_DEBUG " Rx ring %8.8x: ", (int)tp->rx_ring); in tulip_tx_timeout()
639 printk(" %8.8x", (unsigned int)tp->rx_ring[i].status); in tulip_tx_timeout()
640 printk("\n" KERN_DEBUG " Tx ring %8.8x: ", (int)tp->tx_ring); in tulip_tx_timeout()
642 printk(" %8.8x", (unsigned int)tp->tx_ring[i].status); in tulip_tx_timeout()
649 if (tp->fc_bit && test_bit(tp->fc_bit,&netdev_fc_xoff)) in tulip_tx_timeout()
652 tulip_restart_rxtx(tp); in tulip_tx_timeout()
656 tp->stats.tx_errors++; in tulip_tx_timeout()
659 spin_unlock_irqrestore (&tp->lock, flags); in tulip_tx_timeout()
668 struct tulip_private *tp = (struct tulip_private *)dev->priv; in tulip_init_ring() local
671 tp->susp_rx = 0; in tulip_init_ring()
672 tp->ttimer = 0; in tulip_init_ring()
673 tp->nir = 0; in tulip_init_ring()
676 tp->rx_ring[i].status = 0x00000000; in tulip_init_ring()
677 tp->rx_ring[i].length = cpu_to_le32(PKT_BUF_SZ); in tulip_init_ring()
678 tp->rx_ring[i].buffer2 = cpu_to_le32(tp->rx_ring_dma + sizeof(struct tulip_rx_desc) * (i + 1)); in tulip_init_ring()
679 tp->rx_buffers[i].skb = NULL; in tulip_init_ring()
680 tp->rx_buffers[i].mapping = 0; in tulip_init_ring()
683 tp->rx_ring[i-1].length = cpu_to_le32(PKT_BUF_SZ | DESC_RING_WRAP); in tulip_init_ring()
684 tp->rx_ring[i-1].buffer2 = cpu_to_le32(tp->rx_ring_dma); in tulip_init_ring()
693 tp->rx_buffers[i].skb = skb; in tulip_init_ring()
696 mapping = pci_map_single(tp->pdev, skb->tail, in tulip_init_ring()
698 tp->rx_buffers[i].mapping = mapping; in tulip_init_ring()
700 tp->rx_ring[i].status = cpu_to_le32(DescOwned); /* Owned by Tulip chip */ in tulip_init_ring()
701 tp->rx_ring[i].buffer1 = cpu_to_le32(mapping); in tulip_init_ring()
703 tp->dirty_rx = (unsigned int)(i - RX_RING_SIZE); in tulip_init_ring()
708 tp->tx_buffers[i].skb = NULL; in tulip_init_ring()
709 tp->tx_buffers[i].mapping = 0; in tulip_init_ring()
710 tp->tx_ring[i].status = 0x00000000; in tulip_init_ring()
711 tp->tx_ring[i].buffer2 = cpu_to_le32(tp->tx_ring_dma + sizeof(struct tulip_tx_desc) * (i + 1)); in tulip_init_ring()
713 tp->tx_ring[i-1].buffer2 = cpu_to_le32(tp->tx_ring_dma); in tulip_init_ring()
719 struct tulip_private *tp = (struct tulip_private *)dev->priv; in tulip_start_xmit() local
725 spin_lock_irqsave(&tp->lock, eflags); in tulip_start_xmit()
728 entry = tp->cur_tx % TX_RING_SIZE; in tulip_start_xmit()
730 tp->tx_buffers[entry].skb = skb; in tulip_start_xmit()
731 mapping = pci_map_single(tp->pdev, skb->data, in tulip_start_xmit()
733 tp->tx_buffers[entry].mapping = mapping; in tulip_start_xmit()
734 tp->tx_ring[entry].buffer1 = cpu_to_le32(mapping); in tulip_start_xmit()
736 if (tp->cur_tx - tp->dirty_tx < TX_RING_SIZE/2) {/* Typical path */ in tulip_start_xmit()
738 } else if (tp->cur_tx - tp->dirty_tx == TX_RING_SIZE/2) { in tulip_start_xmit()
740 } else if (tp->cur_tx - tp->dirty_tx < TX_RING_SIZE - 2) { in tulip_start_xmit()
749 tp->tx_ring[entry].length = cpu_to_le32(skb->len | flag); in tulip_start_xmit()
752 tp->tx_ring[entry].status = cpu_to_le32(DescOwned); in tulip_start_xmit()
755 tp->cur_tx++; in tulip_start_xmit()
760 spin_unlock_irqrestore(&tp->lock, eflags); in tulip_start_xmit()
767 static void tulip_clean_tx_ring(struct tulip_private *tp) in tulip_clean_tx_ring() argument
771 for (dirty_tx = tp->dirty_tx ; tp->cur_tx - dirty_tx > 0; in tulip_clean_tx_ring()
774 int status = le32_to_cpu(tp->tx_ring[entry].status); in tulip_clean_tx_ring()
777 tp->stats.tx_errors++; /* It wasn't Txed */ in tulip_clean_tx_ring()
778 tp->tx_ring[entry].status = 0; in tulip_clean_tx_ring()
782 if (tp->tx_buffers[entry].skb == NULL) { in tulip_clean_tx_ring()
784 if (tp->tx_buffers[entry].mapping) in tulip_clean_tx_ring()
785 pci_unmap_single(tp->pdev, in tulip_clean_tx_ring()
786 tp->tx_buffers[entry].mapping, in tulip_clean_tx_ring()
787 sizeof(tp->setup_frame), in tulip_clean_tx_ring()
792 pci_unmap_single(tp->pdev, tp->tx_buffers[entry].mapping, in tulip_clean_tx_ring()
793 tp->tx_buffers[entry].skb->len, in tulip_clean_tx_ring()
797 dev_kfree_skb_irq(tp->tx_buffers[entry].skb); in tulip_clean_tx_ring()
798 tp->tx_buffers[entry].skb = NULL; in tulip_clean_tx_ring()
799 tp->tx_buffers[entry].mapping = 0; in tulip_clean_tx_ring()
806 struct tulip_private *tp = (struct tulip_private *) dev->priv; in tulip_down() local
809 del_timer_sync (&tp->timer); in tulip_down()
811 spin_lock_irqsave (&tp->lock, flags); in tulip_down()
817 tulip_stop_rxtx(tp); in tulip_down()
823 tulip_clean_tx_ring(tp); in tulip_down()
826 if (tp->chip_id == DC21040) in tulip_down()
830 tp->stats.rx_missed_errors += inl (ioaddr + CSR8) & 0xffff; in tulip_down()
832 spin_unlock_irqrestore (&tp->lock, flags); in tulip_down()
834 init_timer(&tp->timer); in tulip_down()
835 tp->timer.data = (unsigned long)dev; in tulip_down()
836 tp->timer.function = tulip_tbl[tp->chip_id].media_timer; in tulip_down()
838 dev->if_port = tp->saved_if_port; in tulip_down()
841 tulip_set_power_state (tp, 0, 1); in tulip_down()
848 struct tulip_private *tp = (struct tulip_private *) dev->priv; in tulip_close() local
854 if (tp->fc_bit) { in tulip_close()
855 int bit = tp->fc_bit; in tulip_close()
856 tp->fc_bit = 0; in tulip_close()
870 struct sk_buff *skb = tp->rx_buffers[i].skb; in tulip_close()
871 dma_addr_t mapping = tp->rx_buffers[i].mapping; in tulip_close()
873 tp->rx_buffers[i].skb = NULL; in tulip_close()
874 tp->rx_buffers[i].mapping = 0; in tulip_close()
876 tp->rx_ring[i].status = 0; /* Not owned by Tulip chip. */ in tulip_close()
877 tp->rx_ring[i].length = 0; in tulip_close()
878 tp->rx_ring[i].buffer1 = 0xBADF00D0; /* An invalid address. */ in tulip_close()
880 pci_unmap_single(tp->pdev, mapping, PKT_BUF_SZ, in tulip_close()
886 struct sk_buff *skb = tp->tx_buffers[i].skb; in tulip_close()
889 pci_unmap_single(tp->pdev, tp->tx_buffers[i].mapping, in tulip_close()
893 tp->tx_buffers[i].skb = NULL; in tulip_close()
894 tp->tx_buffers[i].mapping = 0; in tulip_close()
904 struct tulip_private *tp = (struct tulip_private *)dev->priv; in tulip_get_stats() local
910 spin_lock_irqsave (&tp->lock, flags); in tulip_get_stats()
912 tp->stats.rx_missed_errors += inl(ioaddr + CSR8) & 0xffff; in tulip_get_stats()
914 spin_unlock_irqrestore(&tp->lock, flags); in tulip_get_stats()
917 return &tp->stats; in tulip_get_stats()
948 struct tulip_private *tp = dev->priv; in private_ioctl() local
952 int phy = tp->phys[phy_idx] & 0x1f; in private_ioctl()
961 if (tp->mii_cnt) in private_ioctl()
963 else if (tp->flags & HAS_NWAY) in private_ioctl()
965 else if (tp->chip_id == COMET) in private_ioctl()
972 if (data->phy_id == 32 && (tp->flags & HAS_NWAY)) { in private_ioctl()
978 (dev->if_port == 5 && tp->nwayset)) in private_ioctl()
989 if (tp->chip_id != DC21041) in private_ioctl()
997 if (tp->chip_id != DC21041) in private_ioctl()
1000 case 5: data->val_out = tp->lpar; break; in private_ioctl()
1018 tp->full_duplex_lock = (value & 0x9000) ? 0 : 1; in private_ioctl()
1019 if (tp->full_duplex_lock) in private_ioctl()
1020 tp->full_duplex = (value & 0x0100) ? 1 : 0; in private_ioctl()
1023 tp->advertising[phy_idx] = in private_ioctl()
1024 tp->mii_advertise = data->val_in; in private_ioctl()
1028 if (data->phy_id == 32 && (tp->flags & HAS_NWAY)) { in private_ioctl()
1032 if (tp->chip_id == PNIC2) { in private_ioctl()
1039 tp->sym_advertise = value; in private_ioctl()
1062 struct tulip_private *tp = (struct tulip_private *)dev->priv; in build_setup_frame_hash() local
1082 setup_frm = &tp->setup_frame[13*6]; in build_setup_frame_hash()
1093 struct tulip_private *tp = (struct tulip_private *)dev->priv; in build_setup_frame_perfect() local
1109 setup_frm = &tp->setup_frame[15*6]; in build_setup_frame_perfect()
1121 struct tulip_private *tp = (struct tulip_private *)dev->priv; in set_rx_mode() local
1127 tp->csr6 &= ~0x00D5; in set_rx_mode()
1129 tp->csr6 |= AcceptAllMulticast | AcceptAllPhys; in set_rx_mode()
1135 tp->csr6 |= AcceptAllMulticast; in set_rx_mode()
1137 } else if (tp->flags & MC_HASH_ONLY) { in set_rx_mode()
1143 tp->csr6 |= AcceptAllMulticast; in set_rx_mode()
1150 if (tp->flags & COMET_MAC_ADDR) in set_rx_mode()
1165 if (mc_filter[0] == tp->mc_filter[0] && in set_rx_mode()
1166 mc_filter[1] == tp->mc_filter[1]) in set_rx_mode()
1168 else if (tp->flags & IS_ASIX) { in set_rx_mode()
1173 } else if (tp->flags & COMET_MAC_ADDR) { in set_rx_mode()
1177 tp->mc_filter[0] = mc_filter[0]; in set_rx_mode()
1178 tp->mc_filter[1] = mc_filter[1]; in set_rx_mode()
1187 build_setup_frame_hash(tp->setup_frame, dev); in set_rx_mode()
1190 build_setup_frame_perfect(tp->setup_frame, dev); in set_rx_mode()
1193 spin_lock_irqsave(&tp->lock, flags); in set_rx_mode()
1195 if (tp->cur_tx - tp->dirty_tx > TX_RING_SIZE - 2) { in set_rx_mode()
1203 entry = tp->cur_tx++ % TX_RING_SIZE; in set_rx_mode()
1207 tp->tx_buffers[entry].skb = NULL; in set_rx_mode()
1208 tp->tx_buffers[entry].mapping = 0; in set_rx_mode()
1209 tp->tx_ring[entry].length = in set_rx_mode()
1211 tp->tx_ring[entry].buffer1 = 0; in set_rx_mode()
1214 entry = tp->cur_tx++ % TX_RING_SIZE; in set_rx_mode()
1217 tp->tx_buffers[entry].skb = NULL; in set_rx_mode()
1218 tp->tx_buffers[entry].mapping = in set_rx_mode()
1219 pci_map_single(tp->pdev, tp->setup_frame, in set_rx_mode()
1220 sizeof(tp->setup_frame), in set_rx_mode()
1225 tp->tx_ring[entry].length = cpu_to_le32(tx_flags); in set_rx_mode()
1226 tp->tx_ring[entry].buffer1 = in set_rx_mode()
1227 cpu_to_le32(tp->tx_buffers[entry].mapping); in set_rx_mode()
1228 tp->tx_ring[entry].status = cpu_to_le32(DescOwned); in set_rx_mode()
1230 tp->tx_ring[dummy].status = cpu_to_le32(DescOwned); in set_rx_mode()
1231 if (tp->cur_tx - tp->dirty_tx >= TX_RING_SIZE - 2) in set_rx_mode()
1238 spin_unlock_irqrestore(&tp->lock, flags); in set_rx_mode()
1248 struct tulip_private *tp = dev->priv; in tulip_mwi_config() local
1256 tp->csr0 = csr0 = 0; in tulip_mwi_config()
1262 if (!(tp->chip_id == DC21143 && tp->revision == 65)) in tulip_mwi_config()
1319 tp->csr0 = csr0; in tulip_mwi_config()
1329 struct tulip_private *tp; in tulip_init_one() local
1438 dev = alloc_etherdev (sizeof (*tp)); in tulip_init_one()
1470 tp = dev->priv; in tulip_init_one()
1472 tp->rx_ring = pci_alloc_consistent(pdev, in tulip_init_one()
1475 &tp->rx_ring_dma); in tulip_init_one()
1476 if (!tp->rx_ring) in tulip_init_one()
1478 tp->tx_ring = (struct tulip_tx_desc *)(tp->rx_ring + RX_RING_SIZE); in tulip_init_one()
1479 tp->tx_ring_dma = tp->rx_ring_dma + sizeof(struct tulip_rx_desc) * RX_RING_SIZE; in tulip_init_one()
1481 tp->chip_id = chip_idx; in tulip_init_one()
1482 tp->flags = tulip_tbl[chip_idx].flags; in tulip_init_one()
1483 tp->pdev = pdev; in tulip_init_one()
1484 tp->base_addr = ioaddr; in tulip_init_one()
1485 tp->revision = chip_rev; in tulip_init_one()
1486 tp->csr0 = csr0; in tulip_init_one()
1487 spin_lock_init(&tp->lock); in tulip_init_one()
1488 spin_lock_init(&tp->mii_lock); in tulip_init_one()
1489 init_timer(&tp->timer); in tulip_init_one()
1490 tp->timer.data = (unsigned long)dev; in tulip_init_one()
1491 tp->timer.function = tulip_tbl[tp->chip_id].media_timer; in tulip_init_one()
1496 if (!force_csr0 && (tp->flags & HAS_PCI_MWI)) in tulip_init_one()
1501 tp->csr0 &= ~MWI; in tulip_init_one()
1505 tulip_stop_rxtx(tp); in tulip_init_one()
1582 tp->flags &= ~HAS_MEDIA_TABLE; in tulip_init_one()
1590 tp->flags &= ~HAS_MEDIA_TABLE; in tulip_init_one()
1600 tp->flags &= ~HAS_MEDIA_TABLE; in tulip_init_one()
1671 tp->default_port = options[board_idx] & MEDIA_MASK; in tulip_init_one()
1673 tp->full_duplex = 1; in tulip_init_one()
1678 tp->default_port = dev->mem_start & MEDIA_MASK; in tulip_init_one()
1679 if (tp->default_port) { in tulip_init_one()
1681 board_idx, medianame[tp->default_port & MEDIA_MASK]); in tulip_init_one()
1682 tp->medialock = 1; in tulip_init_one()
1683 if (tulip_media_cap[tp->default_port] & MediaAlwaysFD) in tulip_init_one()
1684 tp->full_duplex = 1; in tulip_init_one()
1686 if (tp->full_duplex) in tulip_init_one()
1687 tp->full_duplex_lock = 1; in tulip_init_one()
1689 if (tulip_media_cap[tp->default_port] & MediaIsMII) { in tulip_init_one()
1691 tp->mii_advertise = media2advert[tp->default_port - 9]; in tulip_init_one()
1692 tp->mii_advertise |= (tp->flags & HAS_8023X); /* Matching bits! */ in tulip_init_one()
1695 if (tp->flags & HAS_MEDIA_TABLE) { in tulip_init_one()
1696 memcpy(tp->eeprom, ee_data, sizeof(tp->eeprom)); in tulip_init_one()
1703 if ((tp->flags & ALWAYS_CHECK_MII) || in tulip_init_one()
1704 (tp->mtable && tp->mtable->has_mii) || in tulip_init_one()
1705 ( ! tp->mtable && (tp->flags & HAS_MII))) { in tulip_init_one()
1706 if (tp->mtable && tp->mtable->has_mii) { in tulip_init_one()
1707 for (i = 0; i < tp->mtable->leafcount; i++) in tulip_init_one()
1708 if (tp->mtable->mleaf[i].media == 11) { in tulip_init_one()
1709 tp->cur_index = i; in tulip_init_one()
1710 tp->saved_if_port = dev->if_port; in tulip_init_one()
1712 dev->if_port = tp->saved_if_port; in tulip_init_one()
1750 if (tp->chip_id == PNIC2) in tulip_init_one()
1751 tp->link_change = pnic2_lnk_change; in tulip_init_one()
1752 else if ((tp->flags & HAS_NWAY) || tp->chip_id == DC21041) in tulip_init_one()
1753 tp->link_change = t21142_lnk_change; in tulip_init_one()
1754 else if (tp->flags & HAS_PNICNWAY) in tulip_init_one()
1755 tp->link_change = pnic_lnk_change; in tulip_init_one()
1760 if (tp->sym_advertise == 0) in tulip_init_one()
1761 tp->sym_advertise = 0x0061; in tulip_init_one()
1775 if (tp->mtable) in tulip_init_one()
1776 outl(tp->mtable->csr12dir | 0x100, ioaddr + CSR12); in tulip_init_one()
1779 if (tp->mii_cnt || tulip_media_cap[dev->if_port] & MediaIsMII) { in tulip_init_one()
1793 if ( ! tp->mii_cnt) { in tulip_init_one()
1794 tp->nway = 1; in tulip_init_one()
1795 tp->nwayset = 0; in tulip_init_one()
1820 tulip_set_power_state (tp, 0, 1); in tulip_init_one()
1828 tp->rx_ring, tp->rx_ring_dma); in tulip_init_one()
1831 if (tp->mtable) in tulip_init_one()
1832 kfree (tp->mtable); in tulip_init_one()
1882 struct tulip_private *tp; in tulip_remove_one() local
1887 tp = dev->priv; in tulip_remove_one()
1892 tp->rx_ring, tp->rx_ring_dma); in tulip_remove_one()
1893 if (tp->mtable) in tulip_remove_one()
1894 kfree (tp->mtable); in tulip_remove_one()