Lines Matching refs:lp

250 static void hp100_clear_stats(struct hp100_private *lp, int ioaddr);
285 struct hp100_private *lp = netdev_priv(dev); in virt_to_whatever() local
286 return ((u_long) ptr) + lp->whatever_offset; in virt_to_whatever()
289 static inline u_int pdl_map_data(struct hp100_private *lp, void *data) in pdl_map_data() argument
291 return pci_map_single(lp->pci_dev, data, in pdl_map_data()
463 struct hp100_private *lp; in hp100_probe1() local
661 lp = netdev_priv(dev); in hp100_probe1()
663 spin_lock_init(&lp->lock); in hp100_probe1()
664 strlcpy(lp->id, eid, HP100_SIG_LEN); in hp100_probe1()
665 lp->chip = chip; in hp100_probe1()
666 lp->mode = local_mode; in hp100_probe1()
667 lp->bus = bus; in hp100_probe1()
668 lp->pci_dev = pci_dev; in hp100_probe1()
669 lp->priority_tx = hp100_priority_tx; in hp100_probe1()
670 lp->rx_ratio = hp100_rx_ratio; in hp100_probe1()
671 lp->mem_ptr_phys = mem_ptr_phys; in hp100_probe1()
672 lp->mem_ptr_virt = mem_ptr_virt; in hp100_probe1()
674 lp->soft_model = hp100_inb(SOFT_MODEL); in hp100_probe1()
675 lp->mac1_mode = HP100_MAC1MODE3; in hp100_probe1()
676 lp->mac2_mode = HP100_MAC2MODE3; in hp100_probe1()
677 memset(&lp->hash_bytes, 0x00, 8); in hp100_probe1()
681 lp->memory_size = memory_size; in hp100_probe1()
682 lp->virt_memory_size = virt_memory_size; in hp100_probe1()
683 lp->rx_ratio = hp100_rx_ratio; /* can be conf'd with insmod */ in hp100_probe1()
685 if (lp->mode == 1) /* busmaster */ in hp100_probe1()
700 if (lp->mode == 1) /* busmaster */ in hp100_probe1()
709 hp100_clear_stats(lp, ioaddr); in hp100_probe1()
720 if (lp->mode == 1) { /* busmaster */ in hp100_probe1()
726 lp->page_vaddr_algn = pci_alloc_consistent(lp->pci_dev, MAX_RINGSIZE, &page_baddr); in hp100_probe1()
727 if (!lp->page_vaddr_algn) { in hp100_probe1()
731 lp->whatever_offset = ((u_long) page_baddr) - ((u_long) lp->page_vaddr_algn); in hp100_probe1()
734 …Reserved DMA memory from 0x%x to 0x%x\n", dev->name, (u_int) lp->page_vaddr_algn, (u_int) lp->page… in hp100_probe1()
736 lp->rxrcommit = lp->txrcommit = 0; in hp100_probe1()
737 lp->rxrhead = lp->rxrtail = &(lp->rxring[0]); in hp100_probe1()
738 lp->txrhead = lp->txrtail = &(lp->txring[0]); in hp100_probe1()
749 lp->lan_type = hp100_sense_lan(dev); in hp100_probe1()
764 printk(" bus, %dk SRAM (rx/tx %d%%).\n", lp->memory_size >> 10, lp->rx_ratio); in hp100_probe1()
766 if (lp->mode == 2) { /* memory mapped */ in hp100_probe1()
768 (mem_ptr_phys + (mem_ptr_phys > 0x100000 ? (u_long) lp->memory_size : 16 * 1024)) - 1); in hp100_probe1()
775 dev->mem_end = mem_ptr_phys + lp->memory_size; in hp100_probe1()
779 if (lp->lan_type != HP100_LAN_ERR) in hp100_probe1()
781 switch (lp->lan_type) { in hp100_probe1()
802 pci_free_consistent(lp->pci_dev, MAX_RINGSIZE + 0x0f, in hp100_probe1()
803 lp->page_vaddr_algn, in hp100_probe1()
804 virt_to_whatever(dev, lp->page_vaddr_algn)); in hp100_probe1()
818 struct hp100_private *lp = netdev_priv(dev); in hp100_hwinit() local
835 if (lp->mode == 1) { in hp100_hwinit()
899 if ((lp->lan_type == HP100_LAN_100) || (lp->lan_type == HP100_LAN_ERR)) in hp100_hwinit()
912 struct hp100_private *lp = netdev_priv(dev); in hp100_mmuinit() local
948 if (lp->mode == 1) { /* busmaster */ in hp100_mmuinit()
952 } else if (lp->mode == 2) { /* memory mapped */ in hp100_mmuinit()
958 } else if (lp->mode == 3) { /* i/o mapped mode */ in hp100_mmuinit()
970 if (lp->mode == 1) { /* busmaster */ in hp100_mmuinit()
983 if ((lp->chip == HP100_CHIPID_RAINIER) || (lp->chip == HP100_CHIPID_SHASTA)) in hp100_mmuinit()
996 if (lp->mode == 1) { /* only needed for Busmaster */ in hp100_mmuinit()
999 if ((lp->chip == HP100_CHIPID_RAINIER) || in hp100_mmuinit()
1000 (lp->chip == HP100_CHIPID_SHASTA)) { in hp100_mmuinit()
1010 pdl_stop = lp->memory_size; in hp100_mmuinit()
1012 recv_stop = (xmit_stop * (lp->rx_ratio) / 100) & ~(0x03ff); in hp100_mmuinit()
1019 xmit_stop = (lp->memory_size) - 1; in hp100_mmuinit()
1020 recv_stop = ((lp->memory_size * lp->rx_ratio) / 100) & ~(0x03ff); in hp100_mmuinit()
1031 hp100_outw((((lp->memory_size * lp->rx_ratio) / 100) >> 4), RX_MEM_STOP); in hp100_mmuinit()
1032 hp100_outw(((lp->memory_size - 1) >> 4), TX_MEM_STOP); in hp100_mmuinit()
1066 if (lp->priority_tx) in hp100_mmuinit()
1075 if (lp->mode == 1) in hp100_mmuinit()
1090 struct hp100_private *lp = netdev_priv(dev); in hp100_open() local
1102 lp->bus == HP100_BUS_PCI || lp->bus == in hp100_open()
1112 lp->lan_type = hp100_sense_lan(dev); in hp100_open()
1113 lp->mac1_mode = HP100_MAC1MODE3; in hp100_open()
1114 lp->mac2_mode = HP100_MAC2MODE3; in hp100_open()
1115 memset(&lp->hash_bytes, 0x00, 8); in hp100_open()
1130 struct hp100_private *lp = netdev_priv(dev); in hp100_close() local
1142 if (lp->lan_type == HP100_LAN_100) in hp100_close()
1143 lp->hub_status = hp100_login_to_vg_hub(dev, 0); in hp100_close()
1163 struct hp100_private *lp = netdev_priv(dev); in hp100_init_pdls() local
1177 if (!lp->page_vaddr_algn) in hp100_init_pdls()
1184 memset(lp->page_vaddr_algn, 0, MAX_RINGSIZE); /* Zero Rx/Tx ring page */ in hp100_init_pdls()
1185 pageptr = lp->page_vaddr_algn; in hp100_init_pdls()
1187 lp->rxrcommit = 0; in hp100_init_pdls()
1188 ringptr = lp->rxrhead = lp->rxrtail = &(lp->rxring[0]); in hp100_init_pdls()
1192 lp->rxring[i].next = ringptr; in hp100_init_pdls()
1193 ringptr = &(lp->rxring[i]); in hp100_init_pdls()
1198 lp->txrcommit = 0; in hp100_init_pdls()
1199 ringptr = lp->txrhead = lp->txrtail = &(lp->txring[0]); in hp100_init_pdls()
1201 lp->txring[i].next = ringptr; in hp100_init_pdls()
1202 ringptr = &(lp->txring[i]); in hp100_init_pdls()
1347 struct hp100_private *lp = netdev_priv(dev); in hp100_rxfill() local
1357 while (lp->rxrcommit < MAX_RX_PDL) { in hp100_rxfill()
1361 ringptr = lp->rxrtail; in hp100_rxfill()
1370 dev->name, lp->rxrcommit, (u_int) ringptr->pdl, in hp100_rxfill()
1376 lp->rxrcommit += 1; in hp100_rxfill()
1377 lp->rxrtail = ringptr->next; in hp100_rxfill()
1388 struct hp100_private *lp = netdev_priv(dev); in hp100_BM_shutdown() local
1419 if (lp->chip == HP100_CHIPID_LASSEN) { /* ETR shutdown/reset */ in hp100_BM_shutdown()
1469 struct hp100_private *lp = netdev_priv(dev); in hp100_check_lan() local
1471 if (lp->lan_type < 0) { /* no LAN type detected yet? */ in hp100_check_lan()
1473 if ((lp->lan_type = hp100_sense_lan(dev)) < 0) { in hp100_check_lan()
1478 if (lp->lan_type == HP100_LAN_100) in hp100_check_lan()
1479 lp->hub_status = hp100_login_to_vg_hub(dev, 0); /* relogin */ in hp100_check_lan()
1496 struct hp100_private *lp = netdev_priv(dev); in hp100_start_xmit_bm() local
1506 if (lp->chip == HP100_CHIPID_SHASTA && skb_padto(skb, ETH_ZLEN)) in hp100_start_xmit_bm()
1510 if (lp->txrtail->next == lp->txrhead) { in hp100_start_xmit_bm()
1522 if (lp->lan_type == HP100_LAN_100 && lp->hub_status < 0) { in hp100_start_xmit_bm()
1526 lp->hub_status = hp100_login_to_vg_hub(dev, 0); in hp100_start_xmit_bm()
1529 spin_lock_irqsave(&lp->lock, flags); in hp100_start_xmit_bm()
1533 spin_unlock_irqrestore(&lp->lock, flags); in hp100_start_xmit_bm()
1536 else if (lp->lan_type != i) { /* cable change! */ in hp100_start_xmit_bm()
1539 lp->lan_type = i; in hp100_start_xmit_bm()
1541 if (lp->lan_type == HP100_LAN_100) in hp100_start_xmit_bm()
1542 lp->hub_status = hp100_login_to_vg_hub(dev, 0); in hp100_start_xmit_bm()
1547 if (lp->lan_type == HP100_LAN_100) in hp100_start_xmit_bm()
1548 lp->hub_status = hp100_login_to_vg_hub(dev, 0); in hp100_start_xmit_bm()
1560 spin_lock_irqsave(&lp->lock, flags); in hp100_start_xmit_bm()
1561 ringptr = lp->txrtail; in hp100_start_xmit_bm()
1562 lp->txrtail = ringptr->next; in hp100_start_xmit_bm()
1570 if (lp->chip == HP100_CHIPID_SHASTA) { in hp100_start_xmit_bm()
1579 …ringptr->pdl[1] = ((u32) pci_map_single(lp->pci_dev, skb->data, ringptr->pdl[2], PCI_DMA_TODEVICE)… in hp100_start_xmit_bm()
1584 lp->txrcommit++; in hp100_start_xmit_bm()
1589 spin_unlock_irqrestore(&lp->lock, flags); in hp100_start_xmit_bm()
1608 struct hp100_private *lp = netdev_priv(dev); in hp100_clean_txring() local
1618 donecount = (lp->txrcommit) - hp100_inb(TX_PDL); in hp100_clean_txring()
1628 dev->name, (u_int) lp->txrhead->skb->data, in hp100_clean_txring()
1629 lp->txrcommit, hp100_inb(TX_PDL), donecount); in hp100_clean_txring()
1632 …pci_unmap_single(lp->pci_dev, (dma_addr_t) lp->txrhead->pdl[1], lp->txrhead->pdl[2], PCI_DMA_TODEV… in hp100_clean_txring()
1633 dev_consume_skb_any(lp->txrhead->skb); in hp100_clean_txring()
1634 lp->txrhead->skb = NULL; in hp100_clean_txring()
1635 lp->txrhead = lp->txrhead->next; in hp100_clean_txring()
1636 lp->txrcommit--; in hp100_clean_txring()
1648 struct hp100_private *lp = netdev_priv(dev); in hp100_start_xmit() local
1674 if (lp->lan_type == HP100_LAN_100 && lp->hub_status < 0) { in hp100_start_xmit()
1678 lp->hub_status = hp100_login_to_vg_hub(dev, 0); in hp100_start_xmit()
1681 spin_lock_irqsave(&lp->lock, flags); in hp100_start_xmit()
1685 spin_unlock_irqrestore(&lp->lock, flags); in hp100_start_xmit()
1688 else if (lp->lan_type != i) { /* cable change! */ in hp100_start_xmit()
1691 lp->lan_type = i; in hp100_start_xmit()
1693 if (lp->lan_type == HP100_LAN_100) in hp100_start_xmit()
1694 lp->hub_status = hp100_login_to_vg_hub(dev, 0); in hp100_start_xmit()
1699 if (lp->lan_type == HP100_LAN_100) in hp100_start_xmit()
1700 lp->hub_status = hp100_login_to_vg_hub(dev, 0); in hp100_start_xmit()
1714 spin_lock_irqsave(&lp->lock, flags); in hp100_start_xmit()
1731 if (lp->mode == 2) { /* memory mapped */ in hp100_start_xmit()
1733 memcpy_toio(lp->mem_ptr_virt, skb->data, (skb->len + 3) & ~3); in hp100_start_xmit()
1735 memset_io(lp->mem_ptr_virt, 0, HP100_MIN_PACKET_SIZE - skb->len); in hp100_start_xmit()
1749 spin_unlock_irqrestore(&lp->lock, flags); in hp100_start_xmit()
1779 struct hp100_private *lp = netdev_priv(dev); in hp100_rx() local
1808 if (lp->mode == 2) { /* memory mapped mode */ in hp100_rx()
1809 header = readl(lp->mem_ptr_virt); in hp100_rx()
1840 if (lp->mode == 2) in hp100_rx()
1841 memcpy_fromio(ptr, lp->mem_ptr_virt,pkt_len); in hp100_rx()
1879 struct hp100_private *lp = netdev_priv(dev); in hp100_rx_bm() local
1890 if (0 == lp->rxrcommit) { in hp100_rx_bm()
1896 if ((hp100_inw(RX_PKT_CNT) & 0x00ff) >= lp->rxrcommit) { in hp100_rx_bm()
1899 lp->rxrcommit); in hp100_rx_bm()
1904 while ((lp->rxrcommit > hp100_inb(RX_PDL))) { in hp100_rx_bm()
1913 ptr = lp->rxrhead; in hp100_rx_bm()
1919 pci_unmap_single(lp->pci_dev, (dma_addr_t) ptr->pdl[3], MAX_ETHER_SIZE, PCI_DMA_FROMDEVICE); in hp100_rx_bm()
1963 lp->rxrhead = lp->rxrhead->next; in hp100_rx_bm()
1966 if (0 == hp100_build_rx_pdl(lp->rxrtail, dev)) { in hp100_rx_bm()
1973 hp100_outl((u32) lp->rxrtail->pdl_paddr, RX_PDA); in hp100_rx_bm()
1974 lp->rxrtail = lp->rxrtail->next; in hp100_rx_bm()
1987 struct hp100_private *lp = netdev_priv(dev); in hp100_get_stats() local
1993 spin_lock_irqsave(&lp->lock, flags); in hp100_get_stats()
1997 spin_unlock_irqrestore(&lp->lock, flags); in hp100_get_stats()
2042 static void hp100_clear_stats(struct hp100_private *lp, int ioaddr) in hp100_clear_stats() argument
2051 spin_lock_irqsave(&lp->lock, flags); in hp100_clear_stats()
2057 spin_unlock_irqrestore(&lp->lock, flags); in hp100_clear_stats()
2073 struct hp100_private *lp = netdev_priv(dev); in hp100_set_multicast_list() local
2080 spin_lock_irqsave(&lp->lock, flags); in hp100_set_multicast_list()
2086 lp->mac2_mode = HP100_MAC2MODE6; /* promiscuous mode = get all good */ in hp100_set_multicast_list()
2087 lp->mac1_mode = HP100_MAC1MODE6; /* packets on the net */ in hp100_set_multicast_list()
2088 memset(&lp->hash_bytes, 0xff, 8); in hp100_set_multicast_list()
2090 lp->mac2_mode = HP100_MAC2MODE5; /* multicast mode = get packets for */ in hp100_set_multicast_list()
2091 lp->mac1_mode = HP100_MAC1MODE5; /* me, broadcasts and all multicasts */ in hp100_set_multicast_list()
2095 memset(&lp->hash_bytes, 0xff, 8); in hp100_set_multicast_list()
2101 memset(&lp->hash_bytes, 0x00, 8); in hp100_set_multicast_list()
2119 lp->hash_bytes[idx >> 3] |= (1 << (idx & 7)); in hp100_set_multicast_list()
2123 memset(&lp->hash_bytes, 0xff, 8); in hp100_set_multicast_list()
2126 lp->mac2_mode = HP100_MAC2MODE3; /* normal mode = get packets for me */ in hp100_set_multicast_list()
2127 lp->mac1_mode = HP100_MAC1MODE3; /* and broadcasts */ in hp100_set_multicast_list()
2128 memset(&lp->hash_bytes, 0x00, 8); in hp100_set_multicast_list()
2131 if (((hp100_inb(MAC_CFG_1) & 0x0f) != lp->mac1_mode) || in hp100_set_multicast_list()
2132 (hp100_inb(MAC_CFG_2) != lp->mac2_mode)) { in hp100_set_multicast_list()
2135 hp100_outb(lp->mac2_mode, MAC_CFG_2); in hp100_set_multicast_list()
2137 hp100_orb(lp->mac1_mode, MAC_CFG_1); /* and set the new mode */ in hp100_set_multicast_list()
2141 hp100_outb(lp->hash_bytes[i], HASH_BYTE0 + i); in hp100_set_multicast_list()
2144 dev->name, lp->mac1_mode, lp->mac2_mode, in hp100_set_multicast_list()
2145 lp->hash_bytes[0], lp->hash_bytes[1], in hp100_set_multicast_list()
2146 lp->hash_bytes[2], lp->hash_bytes[3], in hp100_set_multicast_list()
2147 lp->hash_bytes[4], lp->hash_bytes[5], in hp100_set_multicast_list()
2148 lp->hash_bytes[6], lp->hash_bytes[7]); in hp100_set_multicast_list()
2151 if (lp->lan_type == HP100_LAN_100) { in hp100_set_multicast_list()
2155 lp->hub_status = hp100_login_to_vg_hub(dev, 1); /* force a relogin to the hub */ in hp100_set_multicast_list()
2164 if (memcmp(old_hash_bytes, &lp->hash_bytes, 8)) { in hp100_set_multicast_list()
2166 hp100_outb(lp->hash_bytes[i], HASH_BYTE0 + i); in hp100_set_multicast_list()
2169 dev->name, lp->hash_bytes[0], in hp100_set_multicast_list()
2170 lp->hash_bytes[1], lp->hash_bytes[2], in hp100_set_multicast_list()
2171 lp->hash_bytes[3], lp->hash_bytes[4], in hp100_set_multicast_list()
2172 lp->hash_bytes[5], lp->hash_bytes[6], in hp100_set_multicast_list()
2173 lp->hash_bytes[7]); in hp100_set_multicast_list()
2176 if (lp->lan_type == HP100_LAN_100) { in hp100_set_multicast_list()
2180 lp->hub_status = hp100_login_to_vg_hub(dev, 1); /* force a relogin to the hub */ in hp100_set_multicast_list()
2191 spin_unlock_irqrestore(&lp->lock, flags); in hp100_set_multicast_list()
2201 struct hp100_private *lp = netdev_priv(dev); in hp100_interrupt() local
2210 spin_lock(&lp->lock); in hp100_interrupt()
2222 dev->name, lp->mode, (u_int) val, hp100_inb(RX_PKT_CNT), in hp100_interrupt()
2227 spin_unlock(&lp->lock); in hp100_interrupt()
2240 if (lp->mode == 1) in hp100_interrupt()
2256 if (lp->mode != 1) /* non busmaster */ in hp100_interrupt()
2283 if (lp->mode == 1) { in hp100_interrupt()
2292 if ((lp->mode == 1) && (val & (HP100_RX_PDA_ZERO))) in hp100_interrupt()
2299 if ((lp->mode == 1) && (val & (HP100_TX_COMPLETE))) in hp100_interrupt()
2312 if (lp->mode == 1) { in hp100_interrupt()
2319 spin_unlock(&lp->lock); in hp100_interrupt()
2332 struct hp100_private *lp = netdev_priv(dev); in hp100_start_interface() local
2339 spin_lock_irqsave(&lp->lock, flags); in hp100_start_interface()
2351 if (lp->mode == 1) { in hp100_start_interface()
2356 } else if (lp->mode == 2) { in hp100_start_interface()
2366 if (lp->mode == 1) { /* busmaster mode */ in hp100_start_interface()
2383 spin_unlock_irqrestore(&lp->lock, flags); in hp100_start_interface()
2391 struct hp100_private *lp = netdev_priv(dev); in hp100_stop_interface() local
2400 if (lp->mode == 1) in hp100_stop_interface()
2452 struct hp100_private *lp = netdev_priv(dev); in hp100_sense_lan() local
2484 if ( !strcmp(lp->id, "HWP1920") || in hp100_sense_lan()
2485 (lp->pci_dev && in hp100_sense_lan()
2486 lp->pci_dev->vendor == PCI_VENDOR_ID && in hp100_sense_lan()
2487 (lp->pci_dev->device == PCI_DEVICE_ID_HP_J2970A || in hp100_sense_lan()
2488 lp->pci_dev->device == PCI_DEVICE_ID_HP_J2973A))) in hp100_sense_lan()
2498 struct hp100_private *lp = netdev_priv(dev); in hp100_down_vg_link() local
2542 if (lp->chip == HP100_CHIPID_LASSEN) { in hp100_down_vg_link()
2556 if (lp->chip == HP100_CHIPID_LASSEN) { in hp100_down_vg_link()
2604 struct hp100_private *lp = netdev_priv(dev); in hp100_login_to_vg_hub() local
2630 if ((lp->chip == HP100_CHIPID_LASSEN) && (startst & HP100_LINK_CABLE_ST)) in hp100_login_to_vg_hub()
2652 if (lp->chip == HP100_CHIPID_LASSEN) in hp100_login_to_vg_hub()
2659 if (lp->chip == HP100_CHIPID_LASSEN) { in hp100_login_to_vg_hub()
2665 if (lp->chip == HP100_CHIPID_LASSEN) in hp100_login_to_vg_hub()
2714 if (lp->chip == HP100_CHIPID_LASSEN) { in hp100_login_to_vg_hub()
2725 if (lp->chip == HP100_CHIPID_LASSEN) { in hp100_login_to_vg_hub()
2743 if ((lp->chip == HP100_CHIPID_LASSEN) && (startst & HP100_LINK_CABLE_ST)) { in hp100_login_to_vg_hub()
2769 struct hp100_private *lp = netdev_priv(dev); in hp100_cascade_reset() local
2778 if (lp->chip == HP100_CHIPID_LASSEN) { in hp100_cascade_reset()