Lines Matching +full:bit +full:- +full:banged
1 /*------------------------------------------------------------------------
33 . 01/03/96 Erik Stahlman worked out some bugs, actually usable!!! :-)
37 . 2. got rid of post-decrementing bug -- UGH.
55 ----------------------------------------------------------------------------*/
82 /*------------------------------------------------------------------------
86 -------------------------------------------------------------------------*/
89 . Do you want to use 32 bit xfers? This should work on all chips, as
165 /*------------------------------------------------------------------------
171 -------------------------------------------------------------------------*/
193 /*-----------------------------------------------------------------
197 .------------------------------------------------------------------ */
235 /*---------------------------------------------------------------
239 ----------------------------------------------------------------*/
257 ------------------------------------------------------------
261 ------------------------------------------------------------
410 . address are the offset into the table. If that bit is 1, then the
414 . number of the 8 bit register, while the low 3 bits are the bit within
436 position = ether_crc_le(6, ha->addr) & 0x3f; in smc_setmulticast()
438 /* do some messy swapping to put the bit in the right spot */ in smc_setmulticast()
454 . Attempt to allocate memory for a packet, if chip-memory is not
471 unsigned int ioaddr = dev->base_addr; in smc_wait_to_send_packet()
480 if ( lp->saved_skb) { in smc_wait_to_send_packet()
482 dev->stats.tx_aborted_errors++; in smc_wait_to_send_packet()
483 printk(CARDNAME": Bad Craziness - sent packet while busy.\n" ); in smc_wait_to_send_packet()
486 lp->saved_skb = skb; in smc_wait_to_send_packet()
488 length = skb->len; in smc_wait_to_send_packet()
512 lp->saved_skb = NULL; in smc_wait_to_send_packet()
518 lp->packets_waiting++; in smc_wait_to_send_packet()
545 } while ( -- time_out ); in smc_wait_to_send_packet()
582 struct sk_buff * skb = lp->saved_skb; in smc_hardware_send_packet()
587 ioaddr = dev->base_addr; in smc_hardware_send_packet()
593 length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; in smc_hardware_send_packet()
594 buf = skb->data; in smc_hardware_send_packet()
602 lp->saved_skb = NULL; in smc_hardware_send_packet()
651 outb( buf[length -1 ], ioaddr + DATA_1 ); in smc_hardware_send_packet()
663 lp->saved_skb = NULL; in smc_hardware_send_packet()
672 /*-------------------------------------------------------------------------
676 | dev->base_addr == 0, try to find all possible locations
677 | dev->base_addr == 1, return failure code
678 | dev->base_addr == 2, always allocate space, and return success
679 | dev->base_addr == <anything else> this is the address to check
684 ---------------------------------------------------------------------------
697 return ERR_PTR(-ENODEV); in smc_init()
700 sprintf(dev->name, "eth%d", unit); in smc_init()
702 io = dev->base_addr; in smc_init()
703 irq = dev->irq; in smc_init()
709 err = -ENXIO; in smc_init()
711 for (;smcdev->port; smcdev++) { in smc_init()
712 if (smc_probe(dev, smcdev->port) == 0) in smc_init()
715 if (!smcdev->port) in smc_init()
716 err = -ENODEV; in smc_init()
725 free_irq(dev->irq, dev); in smc_init()
726 release_region(dev->base_addr, SMC_IO_EXTENT); in smc_init()
732 /*----------------------------------------------------------------------
735 . This routine has a simple purpose -- make the SMC chip generate an
736 . interrupt, so an auto-detect routine can detect it, and find the IRQ,
737 ------------------------------------------------------------------------
775 timeout--; in smc_findirq()
798 for (smcdev = smc_devlist; smcdev->port; smcdev++) { in smc_findirq()
799 if (smcdev->port == ioaddr) in smc_findirq()
800 return smcdev->irq; in smc_findirq()
816 /*----------------------------------------------------------------------
828 .---------------------------------------------------------------------
831 /*---------------------------------------------------------------
843 .-----------------------------------------------------------------
863 return -EBUSY; in smc_probe()
865 dev->irq = irq; in smc_probe()
866 dev->if_port = ifport; in smc_probe()
871 retval = -ENODEV; in smc_probe()
879 retval = -ENODEV; in smc_probe()
893 retval = -ENODEV; in smc_probe()
907 retval = -ENODEV; in smc_probe()
918 dev->base_addr = ioaddr; in smc_probe()
921 . Get the MAC address ( bank 1, regs 4 - 9 ) in smc_probe()
951 retval = -ENODEV; in smc_probe()
956 if ( dev->if_port == 0 ) { in smc_probe()
960 dev->if_port = 2; in smc_probe()
962 dev->if_port = 1; in smc_probe()
964 if_string = interfaces[ dev->if_port - 1 ]; in smc_probe()
970 . If dev->irq is 0, then the device has to be banged on to see in smc_probe()
978 . because the card that I have uses a non-standard method of accessing in smc_probe()
985 if ( dev->irq < 2 ) { in smc_probe()
989 while ( trials-- ) { in smc_probe()
990 dev->irq = smc_findirq( ioaddr ); in smc_probe()
991 if ( dev->irq ) in smc_probe()
997 if (dev->irq == 0 ) { in smc_probe()
999 retval = -ENODEV; in smc_probe()
1006 version_string, revision_register & 0xF, ioaddr, dev->irq, in smc_probe()
1011 netdev_info(dev, "ADDR: %pM\n", dev->dev_addr); in smc_probe()
1014 retval = request_irq(dev->irq, smc_interrupt, 0, DRV_NAME, dev); in smc_probe()
1017 DRV_NAME, dev->irq, retval); in smc_probe()
1021 dev->netdev_ops = &smc_netdev_ops; in smc_probe()
1022 dev->watchdog_timeo = HZ/20; in smc_probe()
1050 int ioaddr = dev->base_addr; in smc_open()
1065 if ( dev->if_port == 1 ) { in smc_open()
1069 else if ( dev->if_port == 2 ) { in smc_open()
1083 address = dev->dev_addr[ i + 1 ] << 8 ; in smc_open()
1084 address |= dev->dev_addr[ i ]; in smc_open()
1092 /*--------------------------------------------------------
1096 .--------------------------------------------------------
1106 smc_reset( dev->base_addr ); in smc_timeout()
1107 smc_enable( dev->base_addr ); in smc_timeout()
1110 ((struct smc_local *)netdev_priv(dev))->saved_skb = NULL; in smc_timeout()
1114 /*-------------------------------------------------------------
1116 . smc_rcv - receive a packet from the card
1119 . chip-memory.
1124 --------------------------------------------------------------
1128 int ioaddr = dev->base_addr; in smc_rcv()
1158 packet_length -= 6; in smc_rcv()
1171 dev->stats.multicast++; in smc_rcv()
1175 dev->stats.rx_dropped++; in smc_rcv()
1184 skb_reserve( skb, 2 ); /* 16 bit alignment */ in smc_rcv()
1212 skb->protocol = eth_type_trans(skb, dev ); in smc_rcv()
1214 dev->stats.rx_packets++; in smc_rcv()
1215 dev->stats.rx_bytes += packet_length; in smc_rcv()
1218 dev->stats.rx_errors++; in smc_rcv()
1220 if ( status & RS_ALGNERR ) dev->stats.rx_frame_errors++; in smc_rcv()
1222 dev->stats.rx_length_errors++; in smc_rcv()
1223 if ( status & RS_BADCRC) dev->stats.rx_crc_errors++; in smc_rcv()
1249 int ioaddr = dev->base_addr; in smc_tx()
1271 dev->stats.tx_errors++; in smc_tx()
1272 if ( tx_status & TS_LOSTCAR ) dev->stats.tx_carrier_errors++; in smc_tx()
1275 dev->stats.tx_window_errors++; in smc_tx()
1284 /* re-enable transmit */ in smc_tx()
1293 lp->packets_waiting--; in smc_tx()
1298 /*--------------------------------------------------------------------
1309 ---------------------------------------------------------------------*/
1314 int ioaddr = dev->base_addr; in smc_interrupt()
1369 dev->stats.collisions += card_stats & 0xF; in smc_interrupt()
1372 dev->stats.collisions += card_stats & 0xF; in smc_interrupt()
1381 dev->stats.tx_packets += lp->packets_waiting; in smc_interrupt()
1382 lp->packets_waiting = 0; in smc_interrupt()
1400 dev->stats.rx_errors++; in smc_interrupt()
1401 dev->stats.rx_fifo_errors++; in smc_interrupt()
1409 } while ( timeout -- ); in smc_interrupt()
1426 /*----------------------------------------------------
1433 -----------------------------------------------------*/
1438 smc_shutdown( dev->base_addr ); in smc_close()
1444 /*-----------------------------------------------------------
1454 short ioaddr = dev->base_addr; in smc_set_multicast_list()
1457 if ( dev->flags & IFF_PROMISC ) in smc_set_multicast_list()
1469 else if (dev->flags & IFF_ALLMULTI) in smc_set_multicast_list()
1511 MODULE_PARM_DESC(ifport, "SMC 99194 interface port (0-default, 1-TP, 2-AUI)");
1517 CARDNAME": You shouldn't use auto-probing with insmod!\n" ); in smc_init_module()
1520 devSMC9194 = smc_init(-1); in smc_init_module()
1528 free_irq(devSMC9194->irq, devSMC9194); in smc_cleanup_module()
1529 release_region(devSMC9194->base_addr, SMC_IO_EXTENT); in smc_cleanup_module()