Lines Matching refs:ioaddr
171 #define EL3WINDOW(win_num) outw(SelectWindow + (win_num), ioaddr + EL3_CMD)
363 static int corkscrew_setup(struct net_device *dev, int ioaddr,
435 static int check_device(unsigned ioaddr) in check_device() argument
439 if (!request_region(ioaddr, CORKSCREW_TOTAL_SIZE, "3c515")) in check_device()
442 if ((inw(ioaddr + 0x2002) & 0x1f0) != (ioaddr & 0x1f0)) { in check_device()
443 release_region(ioaddr, CORKSCREW_TOTAL_SIZE); in check_device()
447 outw(EEPROM_Read + 7, ioaddr + Wn0EepromCmd); in check_device()
451 if ((inw(ioaddr + Wn0EepromCmd) & 0x0200) == 0) in check_device()
454 if (inw(ioaddr + Wn0EepromData) != 0x6d50) { in check_device()
455 release_region(ioaddr, CORKSCREW_TOTAL_SIZE); in check_device()
477 static int ioaddr; in corkscrew_scan() local
515 ioaddr = pnp_port_start(idev, 0); in corkscrew_scan()
517 if (!check_device(ioaddr)) { in corkscrew_scan()
523 (char*) corkscrew_isapnp_adapters[i].driver_data, ioaddr, irq); in corkscrew_scan()
525 inl(ioaddr + 0x2002), inw(ioaddr + 0x2000)); in corkscrew_scan()
529 err = corkscrew_setup(dev, ioaddr, idev, cards_found++); in corkscrew_scan()
539 for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x20) { in corkscrew_scan()
540 if (!check_device(ioaddr)) in corkscrew_scan()
544 inl(ioaddr + 0x2002), inw(ioaddr + 0x2000)); in corkscrew_scan()
545 err = corkscrew_setup(dev, ioaddr, NULL, cards_found++); in corkscrew_scan()
567 static int corkscrew_setup(struct net_device *dev, int ioaddr, in corkscrew_setup() argument
581 irq = inw(ioaddr + 0x2002) & 15; in corkscrew_setup()
584 irq = inw(ioaddr + 0x2002) & 15; in corkscrew_setup()
587 dev->base_addr = ioaddr; in corkscrew_setup()
589 dev->dma = inw(ioaddr + 0x2000) & 7; in corkscrew_setup()
616 pr_info("%s: 3Com %s at %#3x,", dev->name, vp->product_name, ioaddr); in corkscrew_setup()
626 outw(EEPROM_Read + i, ioaddr + Wn0EepromCmd); in corkscrew_setup()
630 if ((inw(ioaddr + Wn0EepromCmd) & 0x0200) == 0) in corkscrew_setup()
633 eeprom[i] = inw(ioaddr + Wn0EepromData); in corkscrew_setup()
661 vp->available_media = inw(ioaddr + Wn3_Options); in corkscrew_setup()
662 config = inl(ioaddr + Wn3_Config); in corkscrew_setup()
665 config, inw(ioaddr + Wn3_Options)); in corkscrew_setup()
700 int ioaddr = dev->base_addr; in corkscrew_open() local
709 outb(0x20, ioaddr + Wn3_MAC_Ctrl); /* Set the full-duplex bit. */ in corkscrew_open()
710 config = inl(ioaddr + Wn3_Config); in corkscrew_open()
732 outl(config, ioaddr + Wn3_Config); in corkscrew_open()
739 outw(TxReset, ioaddr + EL3_CMD); in corkscrew_open()
741 if (!(inw(ioaddr + EL3_STATUS) & CmdInProgress)) in corkscrew_open()
744 outw(RxReset, ioaddr + EL3_CMD); in corkscrew_open()
747 if (!(inw(ioaddr + EL3_STATUS) & CmdInProgress)) in corkscrew_open()
750 outw(SetStatusEnb | 0x00, ioaddr + EL3_CMD); in corkscrew_open()
773 dev->name, dev->irq, inw(ioaddr + Wn4_Media)); in corkscrew_open()
779 outb(dev->dev_addr[i], ioaddr + i); in corkscrew_open()
781 outw(0, ioaddr + i); in corkscrew_open()
785 outw(StartCoax, ioaddr + EL3_CMD); in corkscrew_open()
787 outw((inw(ioaddr + Wn4_Media) & ~(Media_10TP | Media_SQE)) | in corkscrew_open()
788 media_tbl[dev->if_port].media_bits, ioaddr + Wn4_Media); in corkscrew_open()
791 outw(StatsDisable, ioaddr + EL3_CMD); in corkscrew_open()
794 inb(ioaddr + i); in corkscrew_open()
795 inw(ioaddr + 10); in corkscrew_open()
796 inw(ioaddr + 12); in corkscrew_open()
799 inb(ioaddr + 12); in corkscrew_open()
801 outw(0x0040, ioaddr + Wn4_NetDiag); in corkscrew_open()
829 outl(isa_virt_to_bus(&vp->rx_ring[0]), ioaddr + UpListPtr); in corkscrew_open()
833 outb(PKT_BUF_SZ >> 8, ioaddr + TxFreeThreshold); /* Room for a packet. */ in corkscrew_open()
837 outl(0, ioaddr + DownListPtr); in corkscrew_open()
841 outw(StatsEnable, ioaddr + EL3_CMD); /* Turn on statistics. */ in corkscrew_open()
845 outw(RxEnable, ioaddr + EL3_CMD); /* Enable the receiver. */ in corkscrew_open()
846 outw(TxEnable, ioaddr + EL3_CMD); /* Enable transmitter. */ in corkscrew_open()
851 (vp->bus_master ? DMADone : 0), ioaddr + EL3_CMD); in corkscrew_open()
854 ioaddr + EL3_CMD); in corkscrew_open()
857 ioaddr + EL3_CMD); in corkscrew_open()
867 int ioaddr = dev->base_addr; in corkscrew_timer() local
878 int old_window = inw(ioaddr + EL3_CMD) >> 13; in corkscrew_timer()
881 media_status = inw(ioaddr + Wn4_Media); in corkscrew_timer()
933 ioaddr + Wn4_Media); in corkscrew_timer()
936 config = inl(ioaddr + Wn3_Config); in corkscrew_timer()
938 outl(config, ioaddr + Wn3_Config); in corkscrew_timer()
941 ioaddr + EL3_CMD); in corkscrew_timer()
958 int ioaddr = dev->base_addr; in corkscrew_timeout() local
961 dev->name, inb(ioaddr + TxStatus), in corkscrew_timeout()
962 inw(ioaddr + EL3_STATUS)); in corkscrew_timeout()
964 if ((inb(ioaddr + TxStatus) & 0x88) == 0x88) in corkscrew_timeout()
971 pr_debug(" Down list %8.8x vs. %p.\n", inl(ioaddr + DownListPtr), in corkscrew_timeout()
980 outw(TxReset, ioaddr + EL3_CMD); in corkscrew_timeout()
982 if (!(inw(ioaddr + EL3_STATUS) & CmdInProgress)) in corkscrew_timeout()
984 outw(TxEnable, ioaddr + EL3_CMD); in corkscrew_timeout()
995 int ioaddr = dev->base_addr; in corkscrew_start_xmit() local
1025 outw(DownStall, ioaddr + EL3_CMD); in corkscrew_start_xmit()
1028 if ((inw(ioaddr + EL3_STATUS) & CmdInProgress) == 0) in corkscrew_start_xmit()
1032 if (inl(ioaddr + DownListPtr) == 0) { in corkscrew_start_xmit()
1034 ioaddr + DownListPtr); in corkscrew_start_xmit()
1037 outw(DownUnstall, ioaddr + EL3_CMD); in corkscrew_start_xmit()
1051 outl(skb->len, ioaddr + TX_FIFO); in corkscrew_start_xmit()
1056 outl(isa_virt_to_bus(skb->data), ioaddr + Wn7_MasterAddr); in corkscrew_start_xmit()
1057 outw((skb->len + 3) & ~3, ioaddr + Wn7_MasterLen); in corkscrew_start_xmit()
1059 outw(StartDMADown, ioaddr + EL3_CMD); in corkscrew_start_xmit()
1063 outsl(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2); in corkscrew_start_xmit()
1065 if (inw(ioaddr + TxFree) > 1536) { in corkscrew_start_xmit()
1070 ioaddr + EL3_CMD); in corkscrew_start_xmit()
1074 outsl(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2); in corkscrew_start_xmit()
1076 if (inw(ioaddr + TxFree) > 1536) { in corkscrew_start_xmit()
1080 outw(SetTxThreshold + (1536 >> 2), ioaddr + EL3_CMD); in corkscrew_start_xmit()
1089 while (--i > 0 && (tx_status = inb(ioaddr + TxStatus)) > 0) { in corkscrew_start_xmit()
1100 outw(TxReset, ioaddr + EL3_CMD); in corkscrew_start_xmit()
1102 if (!(inw(ioaddr + EL3_STATUS) & CmdInProgress)) in corkscrew_start_xmit()
1105 outw(TxEnable, ioaddr + EL3_CMD); in corkscrew_start_xmit()
1107 outb(0x00, ioaddr + TxStatus); /* Pop the status stack. */ in corkscrew_start_xmit()
1121 int ioaddr, status; in corkscrew_interrupt() local
1125 ioaddr = dev->base_addr; in corkscrew_interrupt()
1126 latency = inb(ioaddr + Timer); in corkscrew_interrupt()
1130 status = inw(ioaddr + EL3_STATUS); in corkscrew_interrupt()
1159 outw(AckIntr | TxAvailable, ioaddr + EL3_CMD); in corkscrew_interrupt()
1167 if (inl(ioaddr + DownListPtr) == isa_virt_to_bus(&lp->tx_ring[entry])) in corkscrew_interrupt()
1176 outw(AckIntr | DownComplete, ioaddr + EL3_CMD); in corkscrew_interrupt()
1184 outw(0x1000, ioaddr + Wn7_MasterStatus); /* Ack the event. */ in corkscrew_interrupt()
1191 outw(AckIntr | UpComplete, ioaddr + EL3_CMD); in corkscrew_interrupt()
1197 outw(AckIntr | RxEarly, ioaddr + EL3_CMD); in corkscrew_interrupt()
1203 update_stats(ioaddr, dev); in corkscrew_interrupt()
1206 if (DoneDidThat == 0 && inw(ioaddr + EL3_STATUS) & StatsFull) { in corkscrew_interrupt()
1214 pr_cont(" %2.2x", inb(ioaddr + reg)); in corkscrew_interrupt()
1221 TxComplete, ioaddr + EL3_CMD); in corkscrew_interrupt()
1227 outw(RxReset, ioaddr + EL3_CMD); in corkscrew_interrupt()
1230 outw(RxEnable, ioaddr + EL3_CMD); /* Re-enable the receiver. */ in corkscrew_interrupt()
1232 ioaddr + EL3_CMD); in corkscrew_interrupt()
1240 outw(SetStatusEnb | ((~status) & 0x7FE), ioaddr + EL3_CMD); in corkscrew_interrupt()
1241 outw(AckIntr | 0x7FF, ioaddr + EL3_CMD); in corkscrew_interrupt()
1245 outw(AckIntr | IntReq | IntLatch, ioaddr + EL3_CMD); in corkscrew_interrupt()
1247 } while ((status = inw(ioaddr + EL3_STATUS)) & (IntLatch | RxComplete)); in corkscrew_interrupt()
1258 int ioaddr = dev->base_addr; in corkscrew_rx() local
1264 inw(ioaddr + EL3_STATUS), inw(ioaddr + RxStatus)); in corkscrew_rx()
1265 while ((rx_status = inw(ioaddr + RxStatus)) > 0) { in corkscrew_rx()
1267 unsigned char rx_error = inb(ioaddr + RxErrors); in corkscrew_rx()
1294 insl(ioaddr + RX_FIFO, in corkscrew_rx()
1297 outw(RxDiscard, ioaddr + EL3_CMD); /* Pop top Rx packet. */ in corkscrew_rx()
1304 if (! (inw(ioaddr + EL3_STATUS) & CmdInProgress)) in corkscrew_rx()
1310 outw(RxDiscard, ioaddr + EL3_CMD); in corkscrew_rx()
1314 if (!(inw(ioaddr + EL3_STATUS) & CmdInProgress)) in corkscrew_rx()
1324 int ioaddr = dev->base_addr; in boomerang_rx() local
1329 inw(ioaddr + EL3_STATUS), inw(ioaddr + RxStatus)); in boomerang_rx()
1407 int ioaddr = dev->base_addr; in corkscrew_close() local
1414 dev->name, inw(ioaddr + EL3_STATUS), in corkscrew_close()
1415 inb(ioaddr + TxStatus)); in corkscrew_close()
1423 outw(StatsDisable, ioaddr + EL3_CMD); in corkscrew_close()
1426 outw(RxDisable, ioaddr + EL3_CMD); in corkscrew_close()
1427 outw(TxDisable, ioaddr + EL3_CMD); in corkscrew_close()
1431 outw(StopCoax, ioaddr + EL3_CMD); in corkscrew_close()
1435 outw(SetIntrEnb | 0x0000, ioaddr + EL3_CMD); in corkscrew_close()
1437 update_stats(ioaddr, dev); in corkscrew_close()
1439 outl(0, ioaddr + UpListPtr); in corkscrew_close()
1447 outl(0, ioaddr + DownListPtr); in corkscrew_close()
1478 static void update_stats(int ioaddr, struct net_device *dev) in update_stats() argument
1483 dev->stats.tx_carrier_errors += inb(ioaddr + 0); in update_stats()
1484 dev->stats.tx_heartbeat_errors += inb(ioaddr + 1); in update_stats()
1485 /* Multiple collisions. */ inb(ioaddr + 2); in update_stats()
1486 dev->stats.collisions += inb(ioaddr + 3); in update_stats()
1487 dev->stats.tx_window_errors += inb(ioaddr + 4); in update_stats()
1488 dev->stats.rx_fifo_errors += inb(ioaddr + 5); in update_stats()
1489 dev->stats.tx_packets += inb(ioaddr + 6); in update_stats()
1490 dev->stats.tx_packets += (inb(ioaddr + 9) & 0x30) << 4; in update_stats()
1491 /* Rx packets */ inb(ioaddr + 7); in update_stats()
1493 /* Tx deferrals */ inb(ioaddr + 8); in update_stats()
1497 inw(ioaddr + 10); /* Total Rx and Tx octets. */ in update_stats()
1498 inw(ioaddr + 12); in update_stats()
1501 inb(ioaddr + 12); in update_stats()
1513 int ioaddr = dev->base_addr; in set_rx_mode() local
1526 outw(new_mode, ioaddr + EL3_CMD); in set_rx_mode()