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 .-----------------------------------------------------------------
862 return -EBUSY; in smc_probe()
864 dev->irq = irq; in smc_probe()
865 dev->if_port = ifport; in smc_probe()
870 retval = -ENODEV; in smc_probe()
878 retval = -ENODEV; in smc_probe()
892 retval = -ENODEV; in smc_probe()
906 retval = -ENODEV; in smc_probe()
917 dev->base_addr = ioaddr; in smc_probe()
920 . Get the MAC address ( bank 1, regs 4 - 9 ) in smc_probe()
927 dev->dev_addr[ i + 1] = address >> 8; in smc_probe()
928 dev->dev_addr[ i ] = address & 0xFF; in smc_probe()
949 retval = -ENODEV; in smc_probe()
954 if ( dev->if_port == 0 ) { in smc_probe()
958 dev->if_port = 2; in smc_probe()
960 dev->if_port = 1; in smc_probe()
962 if_string = interfaces[ dev->if_port - 1 ]; in smc_probe()
968 . If dev->irq is 0, then the device has to be banged on to see in smc_probe()
976 . because the card that I have uses a non-standard method of accessing in smc_probe()
983 if ( dev->irq < 2 ) { in smc_probe()
987 while ( trials-- ) { in smc_probe()
988 dev->irq = smc_findirq( ioaddr ); in smc_probe()
989 if ( dev->irq ) in smc_probe()
995 if (dev->irq == 0 ) { in smc_probe()
997 retval = -ENODEV; in smc_probe()
1004 version_string, revision_register & 0xF, ioaddr, dev->irq, in smc_probe()
1009 netdev_info(dev, "ADDR: %pM\n", dev->dev_addr); in smc_probe()
1012 retval = request_irq(dev->irq, smc_interrupt, 0, DRV_NAME, dev); in smc_probe()
1015 DRV_NAME, dev->irq, retval); in smc_probe()
1019 dev->netdev_ops = &smc_netdev_ops; in smc_probe()
1020 dev->watchdog_timeo = HZ/20; in smc_probe()
1048 int ioaddr = dev->base_addr; in smc_open()
1063 if ( dev->if_port == 1 ) { in smc_open()
1067 else if ( dev->if_port == 2 ) { in smc_open()
1081 address = dev->dev_addr[ i + 1 ] << 8 ; in smc_open()
1082 address |= dev->dev_addr[ i ]; in smc_open()
1090 /*--------------------------------------------------------
1094 .--------------------------------------------------------
1104 smc_reset( dev->base_addr ); in smc_timeout()
1105 smc_enable( dev->base_addr ); in smc_timeout()
1108 ((struct smc_local *)netdev_priv(dev))->saved_skb = NULL; in smc_timeout()
1112 /*-------------------------------------------------------------
1114 . smc_rcv - receive a packet from the card
1117 . chip-memory.
1122 --------------------------------------------------------------
1126 int ioaddr = dev->base_addr; in smc_rcv()
1156 packet_length -= 6; in smc_rcv()
1169 dev->stats.multicast++; in smc_rcv()
1173 dev->stats.rx_dropped++; in smc_rcv()
1182 skb_reserve( skb, 2 ); /* 16 bit alignment */ in smc_rcv()
1210 skb->protocol = eth_type_trans(skb, dev ); in smc_rcv()
1212 dev->stats.rx_packets++; in smc_rcv()
1213 dev->stats.rx_bytes += packet_length; in smc_rcv()
1216 dev->stats.rx_errors++; in smc_rcv()
1218 if ( status & RS_ALGNERR ) dev->stats.rx_frame_errors++; in smc_rcv()
1220 dev->stats.rx_length_errors++; in smc_rcv()
1221 if ( status & RS_BADCRC) dev->stats.rx_crc_errors++; in smc_rcv()
1247 int ioaddr = dev->base_addr; in smc_tx()
1269 dev->stats.tx_errors++; in smc_tx()
1270 if ( tx_status & TS_LOSTCAR ) dev->stats.tx_carrier_errors++; in smc_tx()
1273 dev->stats.tx_window_errors++; in smc_tx()
1282 /* re-enable transmit */ in smc_tx()
1291 lp->packets_waiting--; in smc_tx()
1296 /*--------------------------------------------------------------------
1307 ---------------------------------------------------------------------*/
1312 int ioaddr = dev->base_addr; in smc_interrupt()
1367 dev->stats.collisions += card_stats & 0xF; in smc_interrupt()
1370 dev->stats.collisions += card_stats & 0xF; in smc_interrupt()
1379 dev->stats.tx_packets += lp->packets_waiting; in smc_interrupt()
1380 lp->packets_waiting = 0; in smc_interrupt()
1398 dev->stats.rx_errors++; in smc_interrupt()
1399 dev->stats.rx_fifo_errors++; in smc_interrupt()
1407 } while ( timeout -- ); in smc_interrupt()
1424 /*----------------------------------------------------
1431 -----------------------------------------------------*/
1436 smc_shutdown( dev->base_addr ); in smc_close()
1442 /*-----------------------------------------------------------
1452 short ioaddr = dev->base_addr; in smc_set_multicast_list()
1455 if ( dev->flags & IFF_PROMISC ) in smc_set_multicast_list()
1467 else if (dev->flags & IFF_ALLMULTI) in smc_set_multicast_list()
1509 MODULE_PARM_DESC(ifport, "SMC 99194 interface port (0-default, 1-TP, 2-AUI)");
1515 CARDNAME": You shouldn't use auto-probing with insmod!\n" ); in init_module()
1518 devSMC9194 = smc_init(-1); in init_module()
1525 free_irq(devSMC9194->irq, devSMC9194); in cleanup_module()
1526 release_region(devSMC9194->base_addr, SMC_IO_EXTENT); in cleanup_module()