Lines Matching refs:nic
618 struct nic *nic, in smc9000_transmit() argument
645 SMC_SELECT_BANK(nic->ioaddr, 2); in smc9000_transmit()
646 _outw(MC_ALLOC | numPages, nic->ioaddr + MMU_CMD); in smc9000_transmit()
651 status = inb(nic->ioaddr + INTERRUPT); in smc9000_transmit()
654 _outb(IM_ALLOC_INT, nic->ioaddr + INTERRUPT); in smc9000_transmit()
664 _outw(MC_RESET, nic->ioaddr + MMU_CMD); in smc9000_transmit()
669 packet_no = inb(nic->ioaddr + PNR_ARR + 1); in smc9000_transmit()
677 _outb(packet_no, nic->ioaddr + PNR_ARR); in smc9000_transmit()
680 _outw(PTR_AUTOINC, nic->ioaddr + POINTER); in smc9000_transmit()
688 _outw(0, nic->ioaddr + DATA_1 ); in smc9000_transmit()
691 _outb((length+6) & 0xFF, nic->ioaddr + DATA_1); in smc9000_transmit()
692 _outb((length+6) >> 8 , nic->ioaddr + DATA_1); in smc9000_transmit()
697 outsw(nic->ioaddr + DATA_1, d, ETH_ALEN >> 1); in smc9000_transmit()
698 outsw(nic->ioaddr + DATA_1, nic->node_addr, ETH_ALEN >> 1); in smc9000_transmit()
699 _outw(htons(t), nic->ioaddr + DATA_1); in smc9000_transmit()
702 outsw(nic->ioaddr + DATA_1 , p, s >> 1); in smc9000_transmit()
706 _outw(0, nic->ioaddr + DATA_1); in smc9000_transmit()
708 _outb(p[s-1], nic->ioaddr + DATA_1); in smc9000_transmit()
709 _outb(0x20, nic->ioaddr + DATA_1); in smc9000_transmit()
713 _outw(MC_ENQUEUE , nic->ioaddr + MMU_CMD); in smc9000_transmit()
717 status = inb(nic->ioaddr + INTERRUPT); in smc9000_transmit()
723 _outb(IM_TX_INT, nic->ioaddr + INTERRUPT); in smc9000_transmit()
725 packet_no = inw(nic->ioaddr + FIFO_PORTS); in smc9000_transmit()
729 _outb( packet_no, nic->ioaddr + PNR_ARR ); in smc9000_transmit()
732 _outw( PTR_AUTOINC | PTR_READ, nic->ioaddr + POINTER ); in smc9000_transmit()
734 tx_status = inw( nic->ioaddr + DATA_1 ); in smc9000_transmit()
739 SMC_SELECT_BANK(nic->ioaddr, 0); in smc9000_transmit()
740 _outw(inw(nic->ioaddr + TCR ) | TCR_ENABLE, nic->ioaddr + TCR ); in smc9000_transmit()
744 SMC_SELECT_BANK(nic->ioaddr, 2); in smc9000_transmit()
745 _outw(MC_FREEPKT, nic->ioaddr + MMU_CMD); in smc9000_transmit()
752 smc_reset(nic->ioaddr); in smc9000_transmit()
759 static int smc9000_poll(struct nic *nic, int retrieve) in smc9000_poll() argument
761 SMC_SELECT_BANK(nic->ioaddr, 2); in smc9000_poll()
762 if (inw(nic->ioaddr + FIFO_PORTS) & FP_RXEMPTY) in smc9000_poll()
768 _outw(PTR_READ | PTR_RCV | PTR_AUTOINC, nic->ioaddr + POINTER); in smc9000_poll()
771 if (!(inw(nic->ioaddr + DATA_1) & RS_ERRORS)) { in smc9000_poll()
773 nic->packetlen = (inw(nic->ioaddr + DATA_1) & 0x07ff); in smc9000_poll()
776 nic->packetlen -= 6; in smc9000_poll()
779 (nic->packetlen >> 1), nic->packetlen & 1); in smc9000_poll()
782 insw(nic->ioaddr + DATA_1, nic->packet, (nic->packetlen+2) >> 1); in smc9000_poll()
784 if (nic->packet[nic->packetlen+1] & 0x20) in smc9000_poll()
785 nic->packetlen++; in smc9000_poll()
788 _outw(MC_RELEASE, nic->ioaddr + MMU_CMD); in smc9000_poll()
794 _outw(MC_RELEASE, nic->ioaddr + MMU_CMD); in smc9000_poll()
798 static void smc9000_disable ( struct nic *nic, struct isa_device *isa __unused ) { in smc9000_disable() argument
800 smc_reset(nic->ioaddr); in smc9000_disable()
803 SMC_SELECT_BANK(nic->ioaddr, 2); in smc9000_disable()
804 _outb( 0, nic->ioaddr + INT_MASK); in smc9000_disable()
807 SMC_SELECT_BANK(nic->ioaddr, 0); in smc9000_disable()
808 _outb( RCR_CLEAR, nic->ioaddr + RCR ); in smc9000_disable()
809 _outb( TCR_CLEAR, nic->ioaddr + TCR ); in smc9000_disable()
812 static void smc9000_irq(struct nic *nic __unused, irq_action_t action __unused) in smc9000_irq()
836 static int smc9000_probe ( struct nic *nic, struct isa_device *isa ) { in smc9000_probe() argument
845 nic->irqno = 0; in smc9000_probe()
846 nic->ioaddr = isa->ioaddr; in smc9000_probe()
851 SMC_SELECT_BANK(nic->ioaddr, 1); in smc9000_probe()
855 address = inw(nic->ioaddr + ADDR0 + i); in smc9000_probe()
856 nic->node_addr[i+1] = address >> 8; in smc9000_probe()
857 nic->node_addr[i] = address & 0xFF; in smc9000_probe()
861 SMC_SELECT_BANK(nic->ioaddr, 0); in smc9000_probe()
862 memory = ( inw(nic->ioaddr + MCR) >> 9 ) & 0x7; /* multiplier */ in smc9000_probe()
863 memory *= 256 * (inw(nic->ioaddr + MIR) & 0xFF); in smc9000_probe()
870 SMC_SELECT_BANK(nic->ioaddr, 3); in smc9000_probe()
871 revision = inw(nic->ioaddr + REVISION); in smc9000_probe()
887 SMC_SELECT_BANK(nic->ioaddr, 1); in smc9000_probe()
888 if (inw(nic->ioaddr + CONFIG) & CFG_AUI_SELECT) in smc9000_probe()
896 smc_reset(nic->ioaddr); in smc9000_probe()
904 nic->ioaddr, if_string, memory ); in smc9000_probe()
906 DBG ( "Ethernet MAC address: %s\n", eth_ntoa ( nic->node_addr ) ); in smc9000_probe()
908 SMC_SELECT_BANK(nic->ioaddr, 0); in smc9000_probe()
911 _outw(TCR_NORMAL, nic->ioaddr + TCR); in smc9000_probe()
912 _outw(RCR_NORMAL, nic->ioaddr + RCR); in smc9000_probe()
915 SMC_SELECT_BANK(nic->ioaddr, 1); in smc9000_probe()
917 _outw( inw( nic->ioaddr + CONFIG ) & ~CFG_AUI_SELECT, in smc9000_probe()
918 nic->ioaddr + CONFIG ); in smc9000_probe()
921 _outw( inw( nic->ioaddr + CONFIG ) | CFG_AUI_SELECT, in smc9000_probe()
922 nic->ioaddr + CONFIG ); in smc9000_probe()
925 smc_phy_configure(nic->ioaddr); in smc9000_probe()
927 nic->nic_op = &smc9000_operations; in smc9000_probe()