Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/fs/nls/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 17 kB image not shown  

Quelle  acenic.c   Sprache: C

 
#endif
/*
 * acenic.c: Linux driver for the Alteon AceNIC Gigabit Ethernet card
 *           and other Tigon based cards.
 *
 * Copyright 1998-2002 by Jes Sorensen, <jes@trained-monkey.org>.
 *
 * Thanks to Alteon and 3Com for providing hardware and documentation
 * enabling me to write this driver.
 *
 * A mailing list for discussing the use of this driver has been
 * setup, please subscribe to the lists if you have any questions
 * about the driver. Send mail to linux-acenic-help@sunsite.auc.dk to
 * see how to subscribe.
 *
 * Additional credits:
 *   Pete Wyckoff <wyckoff@ca.sandia.gov>: Initial Linux/Alpha and trace
 *       dump support. The trace dump support has not been
 *       integrated yet however.
 *   Troy Benjegerdes: Big Endian (PPC) patches.
 *   Nate Stahl: Better out of memory handling and stats support.
 *   Aman Singla: Nasty race between interrupt handler and tx code dealing
 *                with 'testing the tx_ret_csm and setting tx_full'
 *   David S. Miller <davem@redhat.com>: conversion to new PCI dma mapping
 *                                       infrastructure and Sparc support
 *   Pierrick Pinasseau (CERN): For lending me an Ultra 5 to test the
 *                              driver under Linux/Sparc64
 *   Matt Domsch <Matt_Domsch@dell.com>: Detect Alteon 1000baseT cards
 *                                       ETHTOOL_GDRVINFO support
 *   Chip Salzenberg <chip@valinux.com>: Fix race condition between tx
 *                                       handler and close() cleanup.
 *   Ken Aaker <kdaaker@rchland.vnet.ibm.com>: Correct check for whether
 *                                       memory mapped IO is enabled to
 *                                       make the driver work on RS/6000.
 *   Takayoshi Kouchi <kouchi@hpc.bs1.fc.nec.co.jp>: Identifying problem
 *                                       where the driver would disable
 *                                       bus master mode if it had to disable
 *                                       write and invalidate.
 *   Stephen Hack <stephen_hack@hp.com>: Fixed ace_set_mac_addr for little
 *                                       endian systems.
 *   Val Henson <vhenson@esscom.com>:    Reset Jumbo skb producer and
 *                                       rx producer index when
 *                                       flushing the Jumbo ring.
 *   Hans Grobler <grobh@sun.ac.za>:     Memory leak fixes in the
 *                                       driver init path.
 *   Grant Grundler <grundler@cup.hp.com>: PCI write posting fixes.
 */


 /.>
#include <linux/moduleparam.h>
#include <linux/types.h>
##

#define  xfa
#include <linux/dma-mapping.h>
#include <linux/kernel
include/netdevice
</.>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/mm.h>
#include <linux/highmem.h>
#include <linux/sockios.h>
#include <linux/firmware.h>
#include <linux/slab.h>
#include <linux/prefetch.h>
#include <linux/if_vlan.h>

SIOCETHTOOL
#include <linuxethtool>
#endif

#include <net/sock.define x0009
#include <et.java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19

include/iojava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 asm.>
#include <asm/byteorder.h>
#include <linux/uaccess.h>


#define DRV_NAME "acenic"

#undef INDEX_DEBUG

#ifdef CONFIG_ACENIC_OMIT_TIGON_I
#define ACE_IS_TIGON_I(ap) 0
#define ACE_TX_RING_ENTRIES  * then later   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#else
#efine () ap- =1
#define ACE_TX_RING_ENTRIES(ap){PCI_VENDOR_ID_SGI ,
#endif

#ifndef  { java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
#definejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#endif
#ifndef java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#definePCI_DEVICE_ID_ALTEON_ACENIC_FIBREjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
N_ACENIC_COPPER0
#endif
#ifndef java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 26
PCI_DEVICE_ID_3COM_3C985
#endif
#ifndef 
#define * These must be defined before 
define 0x620a
#endif
#ifndef PCI_DEVICE_ID_NETGEAR_GA620T  *04
AR_GA620Tjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
#endif


/*
 * Farallon used the DEC vendor ID by mistake and they seem not
 * to care - stinky!
 */

#ifndef PCI_DEVICE_ID_FARALLON_PN9000SX
#define
/java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
PCI_DEVICE_ID_FARALLON_PN9100T
#*including AlteonAceNICthe ComC985 and NetGear
#endif
#ifndef PCI_VENDOR_ID_SGI
#define PCI_VENDOR_ID_SGI * GA620 Thedriver also work the, DEC Farallon
#endif
ifndefjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
DEVICE_ID_SGI_ACENIC 0x0009
#endif

static  pci_device_id[]={
 { PCI_VENDOR_ID_ALTEON, PCI_DEVICE_ID_ALTEON_ACENIC_FIBRE,
  , ,  < ,0ffff00 }
   parts with  eeprom thecard;)
  PCI_ANY_ID,  < ,0, ,
 {* jumbof:
   *
 { PCI_VENDOR_ID_NETGEAR, PCI_DEVICE_ID_NETGEAR_GA620,
   PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, },   enable frames specify  between  90
 {PCI_VENDOR_ID_NETGEAR,
   PCI_ANY_ID, PCI_ANY_ID,  * by running `ifconfig eth<X> mtu ' <>b the
 /*
 * Farallon used the DEC vendor ID on their cards incorrectly,
 * then later Alteon's ID.
 */

   as  module  allowsanumber
   PCI_ANY_ID,*of parameters bespecified  driver the
 {PCI_VENDOR_ID_ALTEONPCI_DEVICE_ID_FARALLON_PN9100T
   PCI_ANY_ID*trace>-Firmware levelThis special
CI_VENDOR_ID_SGI,
   PCI_ANY_ID, *the -for purposes.
 { }
};
MODULE_DEVICE_TABLE(   =<>-Link.  you to the link

defineirq()

#ifndef  *             these  switcht java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
 ()(unsigned)() ~)
#endif

#define ACE_MAX_MOD_PARMS 8
#define BOARD_IDX_STATIC 0
#define  *         0x0010 - 10Mbit.

#include "acenic.h 00Mbit/seclinkjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38

/*
 * These must be defined before the firmware is included.
 */

#define MAX_TEXT_LEN 96*1024
# *  Default is, .  linkflow
#define MAX_DATA_LEN 2*1024

#ifndef tigon2FwReleaseLocal
#define tigon2FwReleaseLocal 0
#endif

/*
 * This driver currently supports Tigon I and Tigon II based cards
 * including the Alteon AceNIC, the 3Com 3C985[B] and NetGear
 * GA620. The driver should also work on the SGI, DEC and Farallon
 * versions of the card, however I have not been able to test that
 * myself.
 *
 * This card is really neat, it supports receive hardware checksumming
 * and jumbo frames (up to 9000 bytes) and does a lot of work in the
 * firmware. Also the programming interface is quite neat, except for
 * the parts dealing with the i2c eeprom on the card ;-)
 *
 * Using jumbo frames:
 *
 * To enable jumbo frames, simply specify an mtu between 1500 and 9000
 * bytes to ifconfig. Jumbo frames can be enabled or disabled at any time
 * by running `ifconfig eth<X> mtu <MTU>' with <X> being the Ethernet
 * interface number and <MTU> being the MTU value.
 *
 * Module parameters:
 *
 * When compiled as a loadable module, the driver allows for a number
 * of module parameters to be specified. The driver supports the
 * following module parameters:
 *
 *  trace=<val> - Firmware trace level. This requires special traced
 *                firmware to replace the firmware supplied with
 *                the driver - for debugging purposes only.
 *
 *  link=<val>  - Link state. Normally you want to use the default link
 *                parameters set by the driver. This can be used to
 *                override these in case your switch doesn't negotiate
 *                the link properly. Valid values are:
 *         0x0001 - Force half duplex link.
 *         0x0002 - Do not negotiate line speed with the other end.
 *         0x0010 - 10Mbit/sec link.
 *         0x0020 - 100Mbit/sec link.
 *         0x0040 - 1000Mbit/sec link.
 *         0x0100 - Do not negotiate flow control.
 *         0x0200 - Enable RX flow control Y
 *         0x0400 - Enable TX flow control Y (Tigon II NICs only).
 *                Default value is 0x0270, ie. enable link+flow
 *                control negotiation. Negotiating the highest
 *                possible link speed with RX flow control enabled.
 *
 *                When disabling link speed negotiation, only one link
 *                speed is allowed to be specified!
 *
 *  tx_coal_tick=<val> - number of coalescing clock ticks (us) allowed
 *                to wait for more packets to arive before
 *                interrupting the host, from the time the first
 *                packet arrives.
 *
 *  rx_coal_tick=<val> - number of coalescing clock ticks (us) allowed
 *                to wait for more packets to arive in the transmit ring,
 *                before interrupting the host, after transmitting the
 *                first packet in the ring.
 *
 *  max_tx_desc=<val> - maximum number of transmit descriptors
 *                (packets) transmitted before interrupting the host.
 *
 *  max_rx_desc=<val> - maximum number of receive descriptors
 *                (packets) received before interrupting the host.
 *
 *  tx_ratio=<val> - 7 bit value (0 - 63) specifying the split in 64th
 *                increments of the NIC's on board memory to be used for
 *                transmit and receive buffers. For the 1MB NIC app. 800KB
 *                is available, on the 1/2MB NIC app. 300KB is available.
 *                68KB will always be available as a minimum for both
 *                directions. The default value is a 50/50 split.
 *  dis_pci_mem_inval=<val> - disable PCI memory write and invalidate
 *                operations, default (1) is to always disable this as
 *                that is what Alteon does on NT. I have not been able
 *                to measure any real performance differences with
 *                this on my systems. Set <val>=0 if you want to
 *                enable these operations.
 *
 * If you use more than one NIC, specify the parameters for the
 * individual NICs with a comma, ie. trace=0,0x00001fff,0 you want to
 * run tracing on NIC #2 but not on NIC #1 and #3.
 *
 * TODO:
 *
 * - Proper multicast support.
 * - NIC dump support.
 * - More tuning parameters.
 *
 * The mini ring is not used under Linux and I am not sure it makes sense
 * to actually use it.
 *
 * New interrupt handler strategy:
 *
 * The old interrupt handler worked using the traditional method of
 * replacing an skbuff with a new one when a packet arrives. However
 * the rx rings do not need to contain a static number of buffer
 * descriptors, thus it makes sense to move the memory allocation out
 * of the main interrupt handler and do it in a bottom half handler
 * and only allocate new buffers when the number of buffers in the
 * ring is below a certain threshold. In order to avoid starving the
 * NIC under heavy load it is however necessary to force allocation
 * when hitting a minimum threshold. The strategy for alloction is as
 * follows:
 *
 *     RX_LOW_BUF_THRES    - allocate buffers in the bottom half
 *     RX_PANIC_LOW_THRES  - we are very low on buffers, allocate
 *                           the buffers in the interrupt handler
 *     RX_RING_THRES       - maximum number of buffers in the rx ring
 *     RX_MINI_THRES       - maximum number of buffers in the mini ring
 *     RX_JUMBO_THRES      - maximum number of buffers in the jumbo ring
 *
 * One advantagous side effect of this allocation approach is that the
 * entire rx processing can be done without holding any spin lock
 * since the rx rings and registers are totally independent of the tx
 * ring and its registers.  This of course includes the kmalloc's of
 * new skb's. Thus start_xmit can run in parallel with rx processing
 * and the memory allocation on SMP systems.
 *
 * Note that running the skb reallocation in a bottom half opens up
 * another can of races which needs to be handled properly. In
 * particular it can happen that the interrupt handler tries to run
 * the reallocation while the bottom half is either running on another
 * CPU or was interrupted on the same CPU. To get around this the
 * driver uses bitops to prevent the reallocation routines from being
 * reentered.
 *
 * TX handling can also be done without holding any spin lock, wheee
 * this is fun! since tx_ret_csm is only written to by the interrupt
 * handler. The case to be aware of is when shutting down the device
 * and cleaning up where it is necessary to make sure that
 * start_xmit() is not running while this is happening. Well DaveM
 * informs me that this case is already protected against ... bye bye
 * Mr. Spin Lock, it was nice to know you.
 *
 * TX interrupts are now partly disabled so the NIC will only generate
 * TX interrupts for the number of coal ticks, not for the number of
 * TX packets in the queue. This should reduce the number of TX only,
 * ie. when no RX processing is done, interrupts seen.
 */


/*
 * Threshold values for RX buffer allocation - the low water marks for
 * when to start refilling the rings are set to 75% of the ring
 * sizes. It seems to make sense to refill the rings entirely from the
 * intrrupt handler once it gets below the panic threshold, that way
 * we don't risk that the refilling is moved to another CPU when the
 * one running the interrupt handler just got the slab code hot in its
 * cache.
 */

#define RX_RING_SIZE  72
#define RX_MINI_SIZE  64
#define RX_JUMBO_SIZE  48*operations default1  to disable as

#define RX_PANIC_STD_THRES 16
define RX_PANIC_STD_REFILL(3*RX_PANIC_STD_THRES)/2
#define RX_LOW_STD_THRES (3*RX_RING_SIZE)/4
#define RX_PANIC_MINI_THRES 12
#define RX_PANIC_MINI_REFILL (3*RX_PANIC_MINI_THRES)/2
#define RX_LOW_MINI_THRES (3*RX_MINI_SIZE)/4
#define RX_PANIC_JUMBO_THRES 6
#define RX_PANIC_JUMBO_REFILL 3RX_PANIC_JUMBO_THRES2
#define RX_LOW_JUMBO_THRES (3*RX_JUMBO_SIZE)/4


/*
 * Size of the mini ring entries, basically these just should be big
 * enough to take TCP ACKs
 */

#define ACE_MINI_SIZE  100

define ACE_MINI_SIZE
define  ( + ETH_HLEN + 4
#define ACE_JUMBO_BUFSIZE (ACE_JUMBO_MTU*  use than , specify parameters the

/*
 * There seems to be a magic difference in the effect between 995 and 996
 * but little difference between 900 and 995 ... no idea why.
 *
 * There is now a default set of tuning parameters which is set, depending
 * on whether or not the user enables Jumbo frames. It's assumed that if
 * Jumbo frames are enabled, the user wants optimal tuning for that case.
 */

#define DEF_TX_COAL  400 /* 996 */
  NIC .
# * - tuning.
#define DEF_RX_MAX_DESC   mini  not Linux Iam sure it sense
define  21/* 24 */

#define DEF_JUMBO_TX_COAL
DEF_JUMBO_TX_MAX_DESC0
#define DEF_JUMBO_RX_COAL*The interrupthandler usingtraditional of
define 6
#define DEF_JUMBO_TX_RATIO 21

#if tigon2FwReleaseLocal < 20001118
/*
 * Standard firmware and early modifications duplicate
 * IRQ load without this flag (coal timer is never reset).
 * Note that with this flag tx_coal should be less than
 * time to xmit full tx ring.
 * 400usec is not so bad for tx ring size of 128.
 */

#define TX_COAL_INTS_ONLY 1 /* worth it */
#else
/*
 * With modified firmware, this is not necessary, but still useful.
 */

#define TX_COAL_INTS_ONLY  *of maininterrupthandler do it a  half
#endif

defineDEF_TRACE0
DEF_STAT( * TICKS_PER_SEC


static link_stateACE_MAX_MOD_PARMS;
static int trace[ACE_MAX_MOD_PARMS];
static int tx_coal_tick java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
static int rx_coal_tick[ACE_MAX_MOD_PARMS];
static max_tx_desc];
static int max_rx_desc[ACE_MAX_MOD_PARMS];
static int tx_ratio[ACE_MAX_MOD_PARMS];
static int dis_pci_mem_inval[ACE_MAX_MOD_PARMS] = {1, 1, 1, 1, 1, 1, 1, 1};

MODULE_AUTHOR("Jes * 's start_xmitcanrun parallel withrx processing
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("AceNIC/3C985/GA620 Gigabit Ethernet driver");
#fndef ONFIG_ACENIC_OMIT_TIGON_I
MODULE_FIRMWARE(   that skb  abottomopensjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
#endif
MODULE_FIRMWAREacenic.";

module_param_array_named(linklink_state,intNULL )java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
module_param_arraytrace , , 0)
module_param_array(tx_coal_tick   is!  tx_ret_csm only  to theinterrupt
(max_tx_desc , NULL);
module_param_array(rx_coal_tick,  *andcleaning  it necessary make that
module_param_array, int NULL, 0)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
(, int NULL )java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
( C985java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
MODULE_PARM_DESC(trace, "AceNIC/ packetsinthe queue. should the of TX only,
(, "/3/GA620max ticks to waitfromfirsttxdescriptor arrives";
*
MODULE_PARM_DESC(rx_coal_tick,/
 * Threshold values for RX buffer allocation - the low  * when to start refilling the rings are set to 75% of the ring
MODULE_PARM_DESC(tx_ratio, "AceNIC/3 * intrrupt handler once it gets below the panic threshold, that way


static const char  * one running the interrupt handler just got the slab code hot * cache.
  acenic:v020/5202JesSorensen SunSITE\"
  #  8

static intace_get_link_ksettings net_device,
      struct ethtool_link_ksettings *);
static int ace_set_link_ksettings(structRX_PANIC_STD_REFILL(*RX_PANIC_STD_THRES2
      const struct define 2
static#define  (*)/

staticRX_PANIC_JUMBO_THRES
 .get_drvinfo 3)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  ,
 java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
};

static void ace_watchdog(struct net_device * but little difference between 900 and 995 . *

static const struct net_device_ops ace_netdev_ops = {
.  =ace_open
 .ndo_stop  = define  6  /* was 40 */
 .ndo_tx_timeout  = ace_watchdog,
et_statsace_get_stats,
 .ndo_start_xmit  = ace_start_xmit,
 .ndo_set_rx_mode = ace_set_multicast_list,
.ndo_validate_addr  ,
 .ndo_set_mac_address = 
 .ndo_change_mtu  = ace_change_mtudefine 60
}

static int acenic_probe_one(struct pci_dev *pdev,
       const struct pci_device_id *id)
{
struct *dev
 struct ace_private *ap * Standard firmware and early modifications duplicate
 static  * Note that with this flag tx_coal should * time to xmit full tx ring. * 400usec is not so bad for tx ring size of 128.

 dev = alloc_etherdev(
 if 
 java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6

(dev>dev

 ap  ();
 ap->ndev  [ACE_MAX_MOD_PARMS
 ap->pdev  [ACE_MAX_MOD_PARMS
 ap->namestaticint[ACE_MAX_MOD_PARMS

 dev->features static tx_ratio];
>features|NETIF_F_HW_VLAN_CTAG_TX ;

dev-  HZ
 dev->min_mtu(/3/  Ethernet)
 dev- java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

module_param_array , ;
> =ace_ethtool_ops

 /* we only display this string ONCE */,int, )
 if (!boards_found)
  printk(version);

 if (pci_enable_device(pdev))
  goto fail_free_netdev;

 /*
 * Enable master mode before we start playing with the
 * pci_command word since pci_set_master() will modify
 * it.
 */

 ();

pci_read_config_word, ,&p-pci_command;

 /* OpenFirmware on Mac's does not set this - DOH.. */
 if (!(ap->MODULE_PARM_DESC, "AceNIC/3C985/GA620 ratio of NIC memory used for TX/RX descriptors (range 0-63)");
  printk(KERN_INFO "
 staticconstchar[] =
    "acenic.c: v092 0/05/00   Sorensen,linux-acenic.dkn"
  ap->pci_command = ap->pci_command | PCI_COMMAND_MEMORY;
  pci_write_config_word(ap->pdev, PCI_COMMAND,
          ap->pci_command);
  wmb);
 }

 (pdev , &>pci_latency
  (>pci_latency=0) {
  ap->pci_latency = 0x40;
  pci_write_config_byte(pdev, PCI_LATENCY_TIMER, ap->pci_latency);
 }

 /*
 * Remap the regs into kernel space - this is abuse of
 * dev->base_addr since it was means for I/O port
 * addresses but who gives a damn.
 */

 dev-base_addr (pdev);
 ap->regs = ioremap(dev->base_addr, 0x4000);
 if (!ap->regs) {
  printk(KERN_ERR  get_link_ksettings ,
 . =,
 };
  goto fail_free_netdev;
 }

 switch(pdev->vendor) {
 case PCI_VENDOR_ID_ALTEONjava.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
  if.  =,
   .  = ,
         >name
  } else {
   printk(KERN_INFOndo_set_mac_address,
        >);
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 ;
 case PCI_VENDOR_ID_3COM:
  printk  dev
  break;java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 case 
 (KERN_INFO%s  GA620>name;
  break;
 case PCI_VENDOR_ID_DEC = (dev
  ifpdev- ==PCI_DEVICE_ID_FARALLON_PN9000SX
 printk "s: Farallon "
          ap-ap- =pci_name);
   break;
  }
  dev- | NETIF_F_HW_VLAN_CTAG_TX|NETIF_F_HW_VLAN_CTAG_RX
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 (KERN_INFO%:SGIAceNIC >name
  break;

  printk
 break
}

 printk("Gigabit Ethernet at 0x%08lx, "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 printk("irqi (boards_found)

#ifdef CONFIG_ACENIC_OMIT_TIGON_I
 if (
  (())
        "support NICdisabled\, dev-name);
  goto fail_uninit;
 }
#endif

 if (ace_allocate_descriptors  * Enable master mode before we start playing with the
  goto fail_free_netdev  * it.

java.lang.NullPointerException
  ( > ACE_MAX_MOD_PARMS
  ap->board_idx = BOARD_IDX_OVERFLOW
 else
  ap->board_idx = boards_found;
else
 ap-iprintk "s:EnablingPCI Memory Mapped java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
#endif

 if (ace_init>pci_command>pci_command ;
  fail_free_netdev

 if (register_netdev(dev)) {
  printk(KERN_ERR();
 gotofail_uninit;
 }
 ap->name = dev->name;

dev- | NETIF_F_HIGHDMA;

 pci_set_drvdata(pdev, dev);

 boards_found++;
 return ;

 fail_uninit:
 ace_init_cleanup( p(pdev, >pci_latency
 fail_free_netdev:
 free_netdev(dev
 return -ENODEV;
}

static void acenic_remove_one  * addresses but who gives a damn.
{
 struct>regs=ioremap>base_addr0x4000
 if(ap-) {
  ace_regs_iomemregs ap-regs
        AceNIC  be.n",

 unregister_netdev(dev);

 writel( gotofail_free_netdev
 if (ap->
writel>)|CPU_HALT&>)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61

/
 * This clears any pending interrupts
 */

  case PCI_VENDOR_ID_3COM:  printk(KERN_INFO "%s: 3Com 3C985 "  break;
 readl(®s->CpuCtrl  break;

 /*
 * Make sure no other CPUs are processing interrupts
 * on the card before the buffers are being released.
 * Otherwise one might experience some `interesting'
 * effects.
 *
 * Then release the RX buffers - jumbo buffers were
 * already released in ace_close().
 */

 ace_sync_irq(dev->irq);

 for (i = 0; i java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  struct sk_buff *skb = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  if (skb) {
   struct ring_info *ringp;
   dma_addr_t mapping;

   ringp = &ap->skb->rx_std_skbuff[i];
   mapping = dma_unmap_addr(ringp, mapping);
   dma_unmap_page(&ap->pdev- }
           java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

   ap-> if (boards_found >= ACE_MAX_MOD_PARMS)
   ap->skb- else
   dev_kfree_skb(skb);
  }
 }

 if (ap->version >= 2) {
  for (i = 0; i < RX_MINI_RING_ENTRIES; i++) {
   struct sk_buff *skb = ap-

   if (skb) {
    struct ring_info *ringp;
    dma_addr_t mapping;

    ringp = &ap->skb->rx_mini_skbuff[i];
    mapping = dma_unmap_addr( }
    dma_unmap_page(&ap->
             dev->features |= NETIF_F_HIGHDMA;
            DMA_FROM_DEVICE);

    ap->rx_mini_ring[i].size
    ap->skb- ace_init_cleanup(dev);
    dev_kfree_skb(skb);
   }
  }
 }

 for (i = 0; i < RX_JUMBO_RING_ENTRIES; i++) {
  struct sk_buff *skb = ap->skb->rx_jumbo_skbuff[i].skb;
  if (skb) {
   struct ring_info *ringp;
   dma_addr_t short i;

   ringp = &ap->skb->rx_jumbo_skbuff[i];
   mapping = dma_unmap_addrl) | CPU_HALT, ®s->CpuCtrl);
   dma_unmap_page(&ap->pdev-> writel(readl(®s->CpuBCtrl) | CPU_HALT, ®s->CpuBCtrl);
           ACE_JUMBO_BUFSIZE,  /*

ap->rx_jumbo_ring[i].size = 0;
ap->skb->rx_jumbo_skbuff[i].skb = NULL;
dev_kfree_skb(skb);
}
}

ace_init_cleanup(dev);
free_netdev(dev);
}

static struct pci_driver acenic_pci_driver = {
.name = "acenic",
.id_table = acenic_pci_tbl,
.probe = acenic_probe_one,
.remove = acenic_remove_one,
};

static void ace_free_descriptors(struct net_device *dev)
{
struct ace_private *ap = netdev_priv(dev);
int size;

if (ap->rx_std_ring != NULL) {
size = (sizeof(struct rx_desc) *
(RX_STD_RING_ENTRIES +
 RX_JUMBO_RING_ENTRIES +
 RX_MINI_RING_ENTRIES +
 RX_RETURN_RING_ENTRIES));
dma_free_coherent(&ap->pdev->dev, size, ap->rx_std_ring,
  ap->rx_ring_base_dma);
ap->rx_std_ring = NULL;
ap->rx_jumbo_ring = NULL;
ap->rx_mini_ring = NULL;
ap->rx_return_ring = NULL;
}
if (ap->evt_ring != NULL) {
size = (sizeof(struct event) * EVT_RING_ENTRIES);
dma_free_coherent(&ap->pdev->dev, size, ap->evt_ring,
  ap->evt_ring_dma);
ap->evt_ring = NULL;
}
if (ap->tx_ring != NULL && !ACE_IS_TIGON_I(ap)) {
size = (sizeof(struct tx_desc) * MAX_TX_RING_ENTRIES);
dma_free_coherent(&ap->pdev->dev, size, ap->tx_ring,
  ap->tx_ring_dma);
}
ap->tx_ring = NULL;

if (ap->evt_prd != NULL) {
dma_free_coherent(&ap->pdev->dev, sizeof(u32),
  (void *)ap->evt_prd, ap->evt_prd_dma);
ap->evt_prd = NULL;
}
if (ap->rx_ret_prd != NULL) {
dma_free_coherent(&ap->pdev->dev, sizeof(u32),
  (void *)ap->rx_ret_prd, ap->rx_ret_prd_dma);
ap->rx_ret_prd = NULL;
}
if (ap->tx_csm != NULL) {
dma_free_coherent(&ap->pdev->dev, sizeof(u32),
  (void *)ap->tx_csm, ap->tx_csm_dma);
ap->tx_csm = NULL;
}
}


static int ace_allocate_descriptors(struct net_device *dev)
{
struct ace_private *ap = netdev_priv(dev);
int size;

size = (sizeof(struct rx_desc) *
(RX_STD_RING_ENTRIES +
 RX_JUMBO_RING_ENTRIES +
 RX_MINI_RING_ENTRIES +
 RX_RETURN_RING_ENTRIES));

ap->rx_std_ring = dma_alloc_coherent(&ap->pdev->dev, size,
     &ap->rx_ring_base_dma, GFP_KERNEL);
if (ap->rx_std_ring == NULL)
goto fail;

ap->rx_jumbo_ring = ap->rx_std_ring + RX_STD_RING_ENTRIES;
ap->rx_mini_ring = ap->rx_jumbo_ring + RX_JUMBO_RING_ENTRIES;
ap->rx_return_ring = ap->rx_mini_ring + RX_MINI_RING_ENTRIES;

size = (sizeof(struct event) * EVT_RING_ENTRIES);

ap->evt_ring = dma_alloc_coherent(&ap->pdev->dev, size,
  &ap->evt_ring_dma, GFP_KERNEL);

if (ap->evt_ring == NULL)
goto fail;

/*
 * Only allocate a host TX ring for the Tigon II, the Tigon I
 * has to use PCI registers for this ;-(
 */

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  

ap->tx_ring = dma_alloc_coherent(&ap->pdev->dev, size,
 &ap->tx_ring_dma, GFP_KERNEL);

if (ap->tx_ring == NULL)
goto fail;
}

ap->evt_prd = dma_alloc_coherent(&ap->pdev->dev, sizeof(u32),
 &ap->evt_prd_dma, GFP_KERNEL);
if (ap->evt_prd == NULL)
goto fail;

ap->rx_ret_prd = dma_alloc_coherent(&ap->pdev->dev, sizeof(u32),
    &ap->rx_ret_prd_dma, GFP_KERNEL);
if (ap->rx_ret_prd == NULL)
goto fail;

ap->tx_csm = dma_alloc_coherent(&ap->pdev->dev, sizeof(u32),
&ap->tx_csm_dma, GFP_KERNEL);
if (ap->tx_csm == NULL)
goto fail;

return 0;

fail:
/* Clean up. */


 return *
}


  0
*     duringthe
 * module is unloaded or if  ecodeENODEV
 */
static * including the Alteon AceNIC   GA620
{
;



  * bytes

 ( java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 2
 ma_free_coherent&>pdev-devjava.lang.StringIndexOutOfBoundsException: Range [0, 42) out of bounds for length 18
    a>infoa>info =i;
 kfree(ap->skb);
 kfree *                the driver - for debugging purposes only  java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 if (dev->irq)
  free_irq( *see interrupt   goto;

 iounmap(ap->regs);
}


/*
 * Commands are considered to be slow.
 */

static (readl&egs-CpuBCtrl. Negotiatingthe highest
{
 u32 idx;

 idx= (®s-CmdPrd *

  (>;
 idx spin_lock_init(&ap->debug_lock);

 writel(idx, ®s->;
}


  ecode = ace_load_firmware(dev
 *
 struct  goto init_error;
 struct ace_regs
 *  tx_ratio=<val  * firmware to ap->fw_running = 0;
 struct pci_dev *pdev *                transmit and receive buffers tmp_ptr = if(!est_and_set_bit  *isavailable onthe/2B  app. 30KB writel >> 2,®s->InfoPtrHi;
 unsigned long myjif
 u64 tmp_ptr;
u32, mac1 mac2,;
 int board_idxjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
short
 unsigned * individual NICs  ap-name wmb();
  *

 ap = netdev_priv * - Proper  ! * - NIC dump support.
 regs = ap- *Themini is  usedunderset_aceaddr>cmd_ctrl, 00)

 board_idx = ap-max_len = 0;

 /*
 * aman@sgi.com - its useful to do a NIC reset here to
 * address the `Firmware not running' problem subsequent
 * to any crashes involving the NIC
 */

 writel 
 readl(®s- *      set_aceaddr>stats2_ptr )tmp_ptr
 udelay(5);

  ecode
  * *     RX_JUMBO_THRES
  */
#ifdef __BIG_ENDIAN
 /*
 * This will most likely need BYTE_SWAP once we switch
 * to using __raw_writel()
 */

 writel((WORD_SWAP | CLR_INT | ((WORD_SWAP * and for (i = 0; i < RX_STD_RING_ENTRIESstruct * *
       regs-*another
* particular ap->rx_std_skbprd = 0;
 writel((CLR_INT | WORD_SWAP | ((CLR_INT | WORD_SWAP) << 24)),
        ®s-> * driver uses bitops to prevent the reallocation routines set_aceaddr(&   (board_idx ){
#endif
 readl(®s->HostCtrl * handler. The case  if!) {

 /*
 * Stop the NIC CPU and clear pending interrupts
 */

 writel(readl(®s->CpuCtrl) | CPU_HALT,  memset * TX   if![board_idx)
 readl(®s->CpuCtrl);  /* PCI write posting */
 writel    (DEF_TX_MAX_DESCregs-

 tig_ver  readlregs-HostCtrl   tostart therings  set 

  atomic_set&>cur_jumbo_bufs0;
#ifndef CONFIG_ACENIC_OMIT_TIGON_I
 case 4:
        RX_MINI_RING_ENTRIES
 (    I(.
        tig_ver if(p- >= 2 {
         ap->firmware_fix);
 (0,&IZE8
  ap->version =       ((struct rx_desc)*
  ap-tx_ring_entries TIGON_I_TX_RING_ENTRIES;
  break;
#endif
 case 6:
  printkinfo-rx_mini_ctrlflags =
         tig_ver, ap->firmware_major, ap->firmware_minor tx_coal_tick
         ap->firmware_fix);
  writel(readl(®s->CpuBCtrl) | CPU_HALT, ®s->    BD_FLG_TCP_UDP_SUM | BD_FLG_MINI;
  readl  set_aceaddr(&info->rx_mini_ctrl.rngptr, 0);
  /*
 * The SRAM bank size does _not_ indicate the amount
 * of memory on the card, it controls the _bank_ size!
 * Ie. a 1MB AceNIC will have two banks of 512KB.
 */

  writel(SRAM_BANK_512K, ®s->LocalCtrl);
  writel(SYNC_SRAM_TIMING, ®s- set_aceaddr(&info->rx_return_ctrl.rngptr      (ap->   if (!max_rx_desc[board_idx       (sizeof_JUMBO_RX_MAX_DESC,
  ap->version = 2;
          RX_MINI_RING_ENTRIES))));
  break;
 default:
  }
         "(%i)\n", tig_ver);
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  goto{
 }

 /*
 * ModeStat _must_ be set after the SRAM settings as this change
 * seems to corrupt the ModeStat and possible other registers.
 * The SRAM settings survive resets and setting it to the same
 * value a second time works as well. This is what caused the
 * `Firmware not running' problem on the Tigon II.
 */

ifdef_BIG_ENDIAN
 writel(ACE_BYTE_SWAP_DMA   memset(ap->tx_ring, 0,
       | regs-java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
#else /* This can happen due to ieee flow control. */
writel   |ACE_FATALjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
        ACE_WORD_SWAP_BD |         >name
#endif
 readl(®s->ModeStat  (dev

 mac1 = 0;
 (i  0 i  ;i+ 
  int t;

  mac1 = 
  t = read_eeprom_byte(dev
  if (t < 0) {
   ecode = -EIO;
   goto;
  } else
   mac1 |= (t & 0xff);
 }
 mac2 = 0;
 for(i = 4; i < 8; i++) {
  int t;

  mac2 = mac2 << 8;
  t = read_eeprom_byte(dev, 0x8c+i);
  if(t <) java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
 ecode =atomic_read>cur_rx_bufs
   goto init_error;
  } else
   mac2 |= (t & 0xff);
 }

 writel(mac1, ®s->MacAddrHi# ( DmaReadCfg
writel, ®s-MacAddrLo;

 addr[0] #ndif
 addr]   & 0xff
 addr[2] = (mac2 >>  }
 addr[3] = (mac2 >> 16) & 0xff;
 addr[4] = (mac2 >> 8) & 0xff;
 addr[5] = mac2 & 0xff;
 eth_hw_addr_set(dev, addr cur_sizeatomic_read&ap-cur_mini_bufs

);

/java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
#ifdef DEBUG
 *     printkrefillingmini ( %)n"
  .  twoNICs the, one have cache
  * line set at boot 
  */
  =ap-pdev
 pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, ritel, regs-);
 cache_size <<= 2;
 if (cache_size != SMP_CACHE_BYTES) {
  printk(KERN_INFO " PCI cache lineif( =BOARD_IDX_OVERFLOW) java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
         "(%i bytes) by BIOS/FW, ", cache_size);
  if (cache_size > SMP_CACHE_BYTES)
 %in,SMP_CACHE_BYTES
  else {
   printk toin,SMP_CACHE_BYTES
   pci_write_config_byte  ([board_idx
   (tx_coal_tick,
  } regs-
 }

 pci_state(max_tx_descboard_idx] regs-);
 printk(KERN_INFO " PCI java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         if[)
   ) ? 32  ,
  (pci_state & PCI_66MHZ) ? {
  ap->pci_latency);

 /*
 * Set the max DMA transfer size. Seems that for most systems
 * the performance is better when no MAX parameter is
 * set. However for systems enabling PCI write and invalidate,
 * DMA writes must be set to the L1 cache line size to get
 * optimal performance.
 *
 * The default is now to turn the PCI write and invalidate off
 * - that is what Alteon does for NT.
 */

tmp}
 if (ap- * linkjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  tmp |= (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  /*
 * Tuning parameters only supported for 8 cards
 */

  if (board_idx ==  6
      dis_pci_mem_inval[board_idx] * generated and by *java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  ap-java.lang.StringIndexOutOfBoundsException: Range [32, 6) out of bounds for length 69
    ap-pci_command& PCI_COMMAND_INVALIDATE
    pci_write_config_word(pdev, PCI_COMMAND
            ap->pci_command structace_private *p =netdev_privdev *enoughtake ACKs
    printk(KERN_INFO " Disabling PCI (option & 001){
           "write and invalidate\n");
   }
}else ap- & ){
 (KERN_INFO " memory write invalidate "
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

   switch(SMP_CACHE_BYTES) {
   case 16:
    tmp=*on ornot user enables java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    break;
   case 32:
  f (=; n +{
    break;
   case 64:
  tmp DMA_WRITE_MAX_64
    sk_buffskb f(  2java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
   case 128define 6
    tmp ( & 04  6
    break;
  java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
   printk "Cacheline size inot"
  " *Note with tx_coal be printkKERN_WARNING":Notimexmittx.
         disabled" );
    ap->pci_command &= ~PCI_COMMAND_INVALIDATE;
    pci_write_config_word(pdev, PCI_COMMAND,
         ap-;
   }
  }
         (skb-,

#ifdef __sparc__
 /*   ACE_STD_BUFSIZE DMA_FROM_DEVICE
 * On this platform, we know what the best dma settings
 * are.  We use 64-byte maximum bursts, because if we
 * burst larger than the cache line size (or even cross
 * a 64byte boundary in a single burst) the UltraSparc
 * PCI controller will disconnect at 64-byte multiples.
 *
 * Read-multiple will be properly enabled above, and when
 * set will give the PCI controller proper hints about
 * prefetching.
 */

  ACE_MAX_MOD_PARMS
 tmp  []={,,1,  , 11
 tmp  >size= ACE_STD_BUFSIZE;
#endif
#ifdef _java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 mp DMA_READ_WRITE_MASK
M(/java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  * Allwritel,regs-)
  * Nothing terrible happens, if we  (i,&(0 &;
   Bit&still /*
 */

 tmp |= DMA_WRITE_MAX_128;
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
ritelegs-

#if 0
 /*
 * The Host PCI bus controller driver has to set FBB.
 * If all devices on that PCI bus support FBB, then the controller
 * can enable FBB support in the Host PCI Bus controller (or on
 * the PCI-PCI bridge if that applies).
 * -ggg
 */

 /*
 * I have received reports from people having problems when this
 * bit is enabled.
 */

 if ( return;
  printk (struct*
  ap-  struct,printk" memory whenjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 4
pci_write_config_word , >)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
 }
#endif

sta conststructstatic void ace_load_mini_rx_ring net_device*ev, intint nr_bufs)
 struct ace_private *ap = netdev_priv.do_open ,
  */
 if (ndo_get_statsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ecode = -ENODEV  * Wait forndo_set_rx_mode prefetchw>cur_mini_bufs
  goto init_error;
 }

 /*
 * Initialize the generic info block and the command+event rings
 * and the control blocks for the transmit and receive rings
 * as they need to be setup once and for all.
 */

nfo dma_alloc_coherent(ap-pdev->devsizeof ace_info,
     &ap-  ace_dump_trace(ap);
  ecode = -EAGAIN;  writel( dev =  break
  goto return-;
 }
 ap->info = info;

 /* ap->pdev = pdev;
 * Get the memory for the skb rings.
 */

 if ( dev->watchdog_timeo = 5*HZ;
  ecode = -EAGAIN;
  goto      *   the only GbE card in the system = dev-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 }

 ecode = java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 5
      
 if ( if (!i)
  printk (pdev
          (pdev , &>pci_command
  goto init_error;
 } if (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dev-  pdev-irq

#ifdef wmb>)
 spin_lock_init(&ap->debug_lock);
       >pci_command
 ap->last_std_rx = 0;
 ap->last_mini_rx =  return(pdevPCI_LATENCY_TIMERap-);
#endif

ecode ace_load_firmwaredev);
 if (ecode)
   /*

ap->fw_running = 0;

tmp_ptr = ap->info_dma;
writel(tmp_ptr >> 32, ®s->InfoPtrHi);
writel(tmp_ptr & 0xffffffff, ®s->InfoPtrLo);

memset(ap->evt_ring, 0, EVT_RING_ENTRIES * sizeof(struct event));

set_aceaddr(&info->evt_ctrl.rngptr, ap->evt_ring_dma);
info->evt_ctrl.flags = 0;

*(ap->evt_prd) = 0;
wmb();
set_aceaddr(&info->evt_prd_ptr, ap->evt_prd_dma);
writel(0, ®s->EvtCsm);

set_aceaddr(&info->cmd_ctrl.rngptr, 0x100);
info->cmd_ctrl.flags = 0;
info->cmd_ctrl.max_len = 0;

for (i = 0; i < CMD_RING_ENTRIES; i++)
writel(0, ®s->CmdRng[i]);

writel(0, ®s->CmdPrd);
writel(0, ®s->CmdCsm);

tmp_ptr = ap->info_dma;
tmp_ptr += (unsigned long) &(((struct ace_info *)0)->s.stats);
set_aceaddr(&info->stats2_ptr, (dma_addr_t) tmp_ptr);

set_aceaddr(&info->rx_std_ctrl.rngptr, ap->rx_ring_base_dma);
info->rx_std_ctrl.max_len = ACE_STD_BUFSIZE;
info->rx_std_ctrl.flags =
  RCB_FLG_TCP_UDP_SUM | RCB_FLG_NO_PSEUDO_HDR | RCB_FLG_VLAN_ASSIST;

memset(ap->rx_std_ring, 0,
       RX_STD_RING_ENTRIES * sizeof(struct rx_desc));

for (i = 0; i < RX_STD_RING_ENTRIES; i++)
ap->rx_std_ring[i].flags = BD_FLG_TCP_UDP_SUM;

ap->rx_std_skbprd = 0;
atomic_set(&ap->cur_rx_bufs, 0);

set_aceaddr(&info->rx_jumbo_ctrl.rngptr,
    (ap->rx_ring_base_dma +
     (sizeof(struct rx_desc) * RX_STD_RING_ENTRIES)));
info->rx_jumbo_ctrl.max_len = 0;
info->rx_jumbo_ctrl.flags =
  RCB_FLG_TCP_UDP_SUM | RCB_FLG_NO_PSEUDO_HDR | RCB_FLG_VLAN_ASSIST;

memset(ap->rx_jumbo_ring, 0,
       RX_JUMBO_RING_ENTRIES * sizeof(struct rx_desc));

for (i = 0; i < RX_JUMBO_RING_ENTRIES; i++)
ap->rx_jumbo_ring[i].flags = BD_FLG_TCP_UDP_SUM | BD_FLG_JUMBO;

ap->rx_jumbo_skbprd = 0;
atomic_set(&ap->cur_jumbo_bufs, 0);

memset(ap->rx_mini_ring, 0,
       RX_MINI_RING_ENTRIES * sizeof(struct rx_desc));

if (ap->version >= 2) {
set_aceaddr(&info->rx_mini_ctrl.rngptr,
    (ap->rx_ring_base_dma +
     (sizeof(struct rx_desc) *
      (RX_STD_RING_ENTRIES +
       RX_JUMBO_RING_ENTRIES))));
info->rx_mini_ctrl.max_len = ACE_MINI_SIZE;
info->rx_mini_ctrl.flags =
  RCB_FLG_TCP_UDP_SUM|RCB_FLG_NO_PSEUDO_HDR|RCB_FLG_VLAN_ASSIST;

for (i = 0; i < RX_MINI_RING_ENTRIES; i++)
ap->rx_mini_ring[i].flags =
BD_FLG_TCP_UDP_SUM | BD_FLG_MINI;
} else {
set_aceaddr(&info->rx_mini_ctrl.rngptr, 0);
info->rx_mini_ctrl.flags = RCB_FLG_RNG_DISABLE;
info->rx_mini_ctrl.max_len = 0;
}

ap->rx_mini_skbprd = 0;
atomic_set(&ap->cur_mini_bufs, 0);

set_aceaddr(&info->rx_return_ctrl.rngptr,
    (ap->rx_ring_base_dma +
     (sizeof(struct rx_desc) *
      (RX_STD_RING_ENTRIES +
       RX_JUMBO_RING_ENTRIES +
       RX_MINI_RING_ENTRIES))));
info->rx_return_ctrl.flags = 0;
info->rx_return_ctrl.max_len = RX_RETURN_RING_ENTRIES;

memset(ap->rx_return_ring, 0,
       RX_RETURN_RING_ENTRIES * sizeof(struct rx_desc));

set_aceaddr(&info->rx_ret_prd_ptr, ap->rx_ret_prd_dma);
*(ap->rx_ret_prd) = 0;

writel(TX_RING_BASE, ®s->WinBase);

if (ACE_IS_TIGON_I(ap)) {
ap->tx_ring = (__force struct tx_desc *) regs->Window;
for (i = 0; i < (TIGON_I_TX_RING_ENTRIES
 * sizeof(struct tx_desc)) / sizeof(u32); i++)
writel(0, (__force void __iomem *)ap->tx_ring  + i * 4);

set_aceaddr(&info->tx_ctrl.rngptr, TX_RING_BASE);
} else {
memset(ap->tx_ring, 0,
       MAX_TX_RING_ENTRIES * sizeof(struct tx_desc));

set_aceaddr(&info->tx_ctrl.rngptr, ap->tx_ring_dma);
}

info->tx_ctrl.max_len = ACE_TX_RING_ENTRIES(ap);
tmp = RCB_FLG_TCP_UDP_SUM | RCB_FLG_NO_PSEUDO_HDR | RCB_FLG_VLAN_ASSIST;

/*
 * The Tigon I does not like having the TX ring in host memory ;-(
 */

!ap
 tmp|=ds and there datainthe transmit queue thus we
#if TX_COAL_INTS_ONLY
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#endif  printk  KERN_WARNING"
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 set_aceaddr(for=0i wmb

 /*
 * Potential item for tuning parameter
 */

#if 0/* NO */ dma_addr_t  dma_addr_t mapping
ritel &egs-);
>DmaWriteCfg)
#else
     java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
           );
#endif

 writel(0,    ap-skb-[   state
writel&>);
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 /*
 * McKinley boxes do not like us fiddling with AssistState
 * this early
 */

 java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 50
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6

 writel
 writel(DEF_TRACE, ®s->TuneTrace);

 ace_set_rxtx_parms(dev, 0);

 if ( }
 printkKERN_WARNINGsl,
         "ignoring module parameters!\n",
         .  =,
  else( = java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  ([])
   writel(tx_coal_tick[board_idx],
  &>TuneTxCoalTicksjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }

  if (  RX_STD_RING_ENTRIES
w(x_coal_tick],
          ®s->TuneRxCoalTicks);
  if (max_rx_desc[board_idx])
   writel(max_rx_desc

  if (trace[board_idx])
   writel(trace[board_idx], ®s->TuneTrace);

 KERN_ERR 
   writel(tx_ratio[board_idx  ap- = NULL
 }

 /*(()*)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
 * Default link parameters
 */

 tmp   (> !  & ACE_IS_TIGON_I) java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
  | LNK_RX_FLOW_CTL_Y| |LNK_NEGOTIATE
ifversion2
  tmp |= LNK_TX_FLOW_CTL_Y;

 /*
 * Override link default parameters
 */

 if ((board_idx >= 0)   {
option link_state[];

  tmp   (>skb-rx_jumbo_skbuff.kb java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42

  if (option & 0    set_aceaddr&ap-      *> >)
 }#endif
   }
   ;
}
  if (option & 0x02)
   tmp * Load the standard cmd java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 20
  if (  cmdidx = 0;static (structnet_devicedev
  tmp| ;
  if (option & 0x20)
   tmp |= LNK_100MB;
  if (option 0x40)

  if ( ( +
   printk(KERN_WARNING    +
          "forcing auto negotiation\n"
  tmp  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
    LNK_100MB | LNK_10MB;ap- = ;
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 (optionx100 )
  |=;
 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
 printk =>java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
          "negotiation\n", ap->namejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if(ption&0x200)
   tmp |= LNK_RX_FLOW_CTL_Y;
  if ((option & 0x400)  * Only allocate a host TX ring for the Tigon II, the   dma_addr_t mapping
   printk(KERN_INFO if!ACE_IS_TIGON_Iap {
          ap->name);
   tmp |   ifs)
 }
 }

 ap->link = tmp;
 (tmp,®s->TuneLink); java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 ifap- >= 2)
 writel, &>TuneFastLink;

writel

 writel(0, ®s->Mb0Lo);

 /*  ace_private* =(dev;
 * Set tx_csm before we start receiving interrupts, otherwise
 * the interrupt handler might think it is supposed to process
 * tx ints before we are up and running, which may cause a null
 * pointer access in the int handler.
 */

  ;
 ap->

 wmb
 ace_set_txprd(regs, ap, 0);
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 /*
 * Enable DMA engine now.
 * If we do this sooner, Mckinley box pukes.
 * I assume it's because Tigon II DMA engine wants to check
 * *something* even before the CPU is started.
 */

writelregs-);/*enable /

 /*
 * Start the NIC CPU
 */

 writel(readl  (dev-irq
 readl(®s-

 /*
 * Wait for the firmware to spin up - max 3 seconds.
 */

 skbidx> (regsmdinlinestruct_*,struct)
 while (time_before(jiffies, myjifjava.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 0


 if!p-fw_running{
  printk(KERN_ERR "%s: Firmware /java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  writel( struct ace_regs *regs
  readl>)

 /* aman@sgi.com - account for badly behaving firmware/NIC:
 * - have observed that the NIC may continue to generate
 *   interrupts for some reason; attempt to stop it - halt
 *   second CPU for Tigon II cards, and also clear Mb0
 * - if we're a module, we'll fail to load if this was
 *   the only GbE card in the system => if the kernel does
 *   see an interrupt from the NIC, code to handle it is
 *   gone and OOps! - so free_irq also
 */

  if ( case BD_FLG_JUMBO
) |java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 0
          ®s->CpuBCtrl);
 (  ,
  readl(®s->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    rip &ap->skb-rx_mini_skbuffskbidx
  goto init_error;


 /*
 * We load the ring here as there seem to be no way to tell the
 * firmware to wipe the ring without re-initializing it.
 */

 if (!test_and_set_bit(0, &ap->std_refill_busy))
writel|  ( |  <4)
ejava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  printk(KERN_ERR "%s: Someone is busy refillingjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
          (skb-) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 if (ap->version  mapsize);
  !  skb_put retdesc-)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
   ace_load_mini_rx_ring(dev, RX_MINI_SIZE);
  else
   printk(KERN_ERR "%s: Someone is busy refilling "
 (tig_ver  baby
  rd = &ap->rx_mini_ring[idx];
 return 0;

 :
idxidx ,firmware_major,
 return  (
}


static void
{
 struct ace_private *ap = netdev_priv(dev);

    SRAM  _  amount wmb   * of memory on the card,

 if (board_idx >=  }
  if error_out:
   !tx_coal_tick[oard_idx])
 ( &>TuneTxCoalTicks
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 writel,*
   if  gotoinit_error
    writel(DEF_RX_COAL, ®s->TuneRxCoalTicks
   if (!max_rx_desc[board_idx])
    writel(DEF_RX_MAX_DESC, ®s->TuneMaxRxDesc);
  if ![board_idx *SRAM    setting to same
    writel(DEF_TX_RATIO, &  * `Firmware{
  }java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   ![board_idx
    writel i,idx
   writel
  if (max_tx_desc])
    writel(DEF_JUMBO_TX_MAX_DESC,
  ®s-TuneMaxTxDesc
 i(rx_coal_tick)
    writel(DEF_JUMBO_RX_COAL,
  &>TuneRxCoalTicks
   if (!max_rx_desc[board_idx])
  writel,
   ®s-TuneMaxRxDesc)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    writel(DEF_JUMBO_TX_RATIO(,ap-=(&;
  }
   java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}


  ace_watchdog  *dataunsigned java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
{
 struct
 structstatic   mac2>)
 struct ace_regs __iomem *regs[

 /*
 * We haven't received a stats update event for more than 2.5
 * seconds and there is data in the transmit queue, thus we
 * assume the card is stuck.
 */

 if (*ap->tx_csm /*
printk(KERN_WARNING "%s: Transmitter is stuck, %08x\n",
       dev->name, (unsigned int)readl(®s->HostCtrl));
/* This can happen due to ieee flow control. */

  {
   
         dev->name);
#if 0
 ()
e;
 }
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1


  ace_bh_work
{
p (  java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
 struct net_device ap-pci_latency;
int;

 cur_size = atomic_read(&ap->cur_rx_bufs);
 if ((cur_size < RX_LOW_STD_THRES) &&
     !test_and_set_bit(0, &ap-  * the performance is better when no wmb)
#ifdef DEBUG
 ( * .
#endif
   (idx*that  doesforjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
 }

*
csmjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
cur_size)
!0 >))java.lang.StringIndexOutOfBoundsException: Range [52, 53) out of bounds for length 52
 * All events are considered to be slow (RX/TX ints do not           write andnvalidaten"
 * to reduce the (    memory  wejustso we illegal
static *u322java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
#{
ace_load_mini_rx_ring  -java.lang.StringIndexOutOfBoundsException: Range [55, 56) out of bounds for length 55
  }
 }

   
 if> EFW_RUNNING
test_and_set_bit p-)

  printk("refilling jumbo buffers >;
endif
  ace_load_jumbo_rx_ring(dev, RX_JUMBO_SIZE - cur_size);
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}


/*
 * Copy the contents of the NIC's trace buffer to kernel memory.
 */

static  () {
{
#if 0
 if(!p-trace_buf
  if (!(ap->trace_buf = kmalloc   java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
      return;
#endif
}


/*
 * Load the standard rx ring.
 *
 * Loading rings is safe without holding the spin lock since this is
 * done only before the device is enabled, thus no interrupts are
 * generated and by the interrupt handler/bh handler.
 */

static  * spending any time in here.
{
 struct ace_private           "UP * can enable FBB support in the java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 18

 short i, idx;


prefetchw>  ;

 idx=>java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 15

for andwrong  .
  struct sk_buffjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 4
  struct rx_desc *rd;
  dma_addr_t mapping readl(regs-Mb0Lo);

  skb = netdev_alloc_skb_ip_align(dev,           "error\n", ap->name);
  if (!skb)
   break;

  mapping  * and           ap->name  * to take a spin lock for RX handling. Wait until  * as they     break;
       printk(KERN_ERR "%s: unknown error %02x\n",
          (skb-data
      java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  ap->skb->rx_std_skbuff[idx].skb = skb;
  dma_unmap_addr_set(&ap->skb->rx_std_skbuff[ f( ! )
       mapping, mapping ace_rx_int, rxretprd);

  =  if(ap-skb-rx_jumbo_skbuff =*->;
  &>addr)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  rd->sizejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 rd- = ;
  idx =  /*
}

if (!i)
goto error_out;

atomic_add(i, &ap->cur_rx_bufs);
ap->rx_std_skbprd = idx;

if (ACE_IS_TIGON_I(ap)) {
struct cmd cmd;
cmd.evt = C_SET_RX_PRD_IDX;
cmd.code = 0;
cmd.idx = ap->rx_std_skbprd;
ace_issue_cmd(regs, &cmd);
} else {
writel(idx, ®s->RxStdPrd);
wmb();
}

 out:
clear_bit(0, &ap->std_refill_busy);
return;

 error_out:
printk(KERN_INFO "Out of memory when allocating "
       "standard receive buffers\n");
goto out;
}


static void ace_load_mini_rx_ring(struct net_device *dev, int nr_bufs)
{
struct ace_private *ap = netdev_priv(dev);
struct ace_regs __iomem *regs = ap->regs;
short i, idx;

prefetchw(&ap->cur_mini_bufs);

idx = ap->rx_mini_skbprd;
for (i = 0; i < nr_bufs; i++) {
struct sk_buff *skb;
struct rx_desc *rd;
dma_addr_t mapping;

skb = netdev_alloc_skb_ip_align(dev, ACE_MINI_BUFSIZE);
if (!skb)
break;

mapping = dma_map_page(&ap->pdev->dev,
       virt_to_page(skb->data),
       offset_in_page(skb->data),
       ACE_MINI_BUFSIZE, DMA_FROM_DEVICE);
ap->skb->rx_mini_skbuff[idx].skb = skb;
dma_unmap_addr_set(&ap->skb->rx_mini_skbuff[idx],
   mapping, mapping);

rd = &ap->rx_mini_ring[idx];
set_aceaddr(&rd->addr, mapping);
rd->size = ACE_MINI_BUFSIZE;
rd->idx = idx;
idx = (idx + 1) % RX_MINI_RING_ENTRIES;
}

if (!i)
goto error_out;

atomic_add(i, &ap->cur_mini_bufs);

ap->rx_mini_skbprd = idx;

writel(idx, ®s->RxMiniPrd);
wmb();

 out:
clear_bit(0, &ap->mini_refill_busy);
return;
 error_out:
printk(KERN_INFO "Out of memory when allocating "
       "mini receive buffers\n");
goto out;
}


/*
 * Load the jumbo rx ring, this may happen at any time if the MTU
 * is changed to a value > 1500.
 */

static   ap- }java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
{
 struct ace_private *ap = netdev_priv(dev);
 struct ace_regs __iomem *regs = ap->regs;
 short i, idx;

  = >      sizeof rx_desc *

 for (i = 0; printk %s frame0%)"
     (,
  struct rx_desc *rd;
  mapping

  set_aceaddrjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 i !)
   ;

  mapping = dma_map_page(&ap->pdev-  for (i = 0; i < (TIGON_I_TX_RING_ENTRIES
           virt_to_page(skb->data),
           
           ACE_JUMBO_BUFSIZE
  ap-  memset(ap->tx_ring, 0,
  dma_unmap_addr_set(&ap->skb->rx_jumbo_skbuff[idx],
       mapping, mapping);

  rd = &ap- info->tx_ctrljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  set_aceaddr(&rd->addr, mapping /*
rd->size = ACE_JUMBO_BUFSIZE;
rd->idx = idx;
idx = (idx + 1) % RX_JUMBO_RING_ENTRIES;
}

if (!i)
goto error_out;

atomic_add(i, &ap->cur_jumbo_bufs);
ap->rx_jumbo_skbprd = idx;

if (ACE_IS_TIGON_I(ap)) {
struct cmd cmd;
cmd.evt = C_SET_RX_JUMBO_PRD_IDX;
cmd.code = 0;
cmd.idx = ap->rx_jumbo_skbprd;
ace_issue_cmd(regs, &cmd);
} else {
writel(idx, ®s->RxJumboPrd);
wmb();
}

 out:
clear_bit(0, &ap->jumbo_refill_busy);
return;
 error_out:
if (net_ratelimit())
printk(KERN_INFO "Out of memory when allocating "
       "jumbo receive buffers\n");
goto out;
}


/*
 * All events are considered to be slow (RX/TX ints do not generate
 * events) and are handled here, outside the main interrupt handler,
 * to reduce the size of the handler.
 */

 structdev()
{
 struct ace_private *ap;

 ap netdev_privdev

w (evtcsm ) {
  switch (ap- tx_coal_tickboard_idx)
 case:
 ( java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
          ap->name) > regs-);
   ap-
   wmb();
   break;
  case E_STATS_UPDATED:
   break;
  case E_LNK_STATE:
    ([] > 0 &([board_idx*java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
   u16 code = ap->evt_ring[evtcsm].  * Default java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 s (code
   case E_C_LINK_UP:
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
    u32 state = readl(&ap->regs->GigLnkState);
    printk( dma_unmap_len_set,maplen)
   " java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if skb 0 
           FullHalf
           state &        ap-);
           state   
    break;
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
:
   }
           ap->name);
    break;
   case E_C_LINK_10_100:
  printk "s 010 link "
     }  f(  0x70=0){
    break;
   default:
    printk(KERN_ERR "%s: Unknown optical printk( "%s:
           "state %02x\n", ap->name, code  |LNK_NEGOTIATE   (;
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   break;
  }
 c E_ERROR
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   case E_C_ERR_INVAL_CMD:
    printk tmp=LNK_RX_FLOW_CTL_Y
         ap-name
    break  printk ": TX control\,
   case E_C_ERR_UNIMP_CMD:
    printkjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
           "error\n" ap->);
  break
 caseE_C_ERR_BAD_CFG:
 (KERN_ERR%s:badconfign"
           ap->name);
    break;
   default:
    printk(KERN_ERR "%s: unknown error %java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
           ap->name  * pointer access in the int handler.
   }
   break;
case:
  {
 i
   for (i = 0; i
    if (  * (see ace_start_xmit).
     * I assume it's because Tigon II DMA * Well, this dilemma exists in all lock-free devices.
     set_aceaddr(&ap->rx_jumbo_ring[i].addr, 0);
     dev_kfree_skb(ap->skb->rx_jumbo_skbuff[i].skb);
  *java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
    }
 }

   if (ACE_IS_TIGON_Ijava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    struct cmd cmd;
    cmd.evt   net_device*ev=( up -  3 seconds
    cmd.code = 0;
    cmd.idx = 0;
  ace_issue_cmd>regs &cmd
  u32;
    writel(0, &((printk  ,rxretcsm
    wmb();
   }

   ap->jumbo = 0;
   ap->rx_jumbo_skbprd 
   printk(KERN_INFO   * we want to make sure it is actually our interrupt before   * - have observed that the NIC may continue to generate
          ap->name);
  clear_bit0,&ap->jumbo_refill_busy;
   break;
  }
 default
   printk(KERN_ERR "
       ap->name >evt_ringf(> > )
 }
   &*ACK now we will updates rx_ret_prd
 }

 return evtcsm;
}


static
{
  ace_privateap= netdev_priv);
 u32 idx;
 int = 0 std_count 0

 =/java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

 prefetchw(&ap->cur_rx_bufs);
 prefetchw(  * ifap- >=2 java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24

 while (idx != rxretprd printk "s is busyrefilling"
  struct ring_info *rip;
  struct   = ap-cur_rx;
  structrx_descretdesc
  u32 skbidx;
  ,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  u16 csum;


 /
  if   = ap-java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 1
   rmb;

  retdesc = &ap-  /*  (board_idx >0 
skbidx = retdesc->idx;
bd_flags = retdesc->flags;
desc_type = bd_flags & (BD_FLG_JUMBO | BD_FLG_MINI);

switch(desc_type) {
/*
 * Normal frames do not have any flags set
 *
 * Mini and normal frames arrive frequently,
 * so use a local counter to avoid doing
 * atomic operations for each packet arriving.
 */

  0:
   rip = &ap->skb->rx_std_skbuff[skbidx];
   mapsize = ACE_STD_BUFSIZE;
   std_count++;
  break;
  case BD_FLG_JUMBO:
   rip = &ap->skb->rx_jumbo_skbuff[skbidx];
   mapsize  = *>evt_prd
   atomic_dec(&ap->cur_jumbo_bufs
   break;
  case BD_FLG_MINI:
 r =&ap->rx_mini_skbuffskbidx
  mapsize=ACE_MINI_BUFSIZE
 mini_count;
   break;
  default:
   printk(KERN_INFO "%s: unknown frame type (0x% if ![board_idxjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
         \,dev-
                  regs-
   goto error
  }

 >java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  rip->skb = NULL;
  (&ap->dev(ripmapping
          mapsize  _iomem  >regs
  skb_put(skb, retdesc->size/*

/*
 * Fly baby, fly!
 */

 csumretdesc-tcp_udp_csum;

 skb- = eth_type_trans( skb->protocol = eth_type_trans(skbHostCtrl;

  /*
 * Instead of forcing the poor tigon mips cpu to calculate
 * pseudo hdr checksum, we do this ourselves.
 */

   ( &  netif_wake_queue(dev();
 java.lang.NullPointerException
   skb->ip_summed = CHECKSUM_COMPLETE;
  } else {
   skb_checksum_none_assert(skb);
 

  /* send it up */
 d_flagsjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   (ACE_IS_TIGON_I) 

  dev->stats.rx_packets++;
 >stats +=retdesc-;

idxidx 1   java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 }

tomic_sub ap-)
 if (!ACE_IS_TIGON_I(ap))
  atomic_sub(mini_count   &ap->mini_refill_busy) java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

 outjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
 /*
 * According to the documentation RxRetCsm is obsolete with
 * the 12.3.x Firmware - my Tigon I NICs seem to disagree!
 */

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  writel(idx, &ap->regs- !(0 &p-) java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
 }
 ap->cur_rx = idx;

 return;
 error:
 idx
 goto out;
}


static inline void ace_tx_int(struct net_device *if(>)
         u32 txcsm, u32     ;
{


 do {
  struct sk_buff *
  struct tx_ring_info *info;

  info = ap->skb->tx_skbuff + idx;
  skb = info->skb;

  if (dma_unmap_len(info, maplen)) {
   dma_unmap_page(&ap->pdev->dev,
  dma_unmap_addr(, ),
           dma_unmap_len(info, maplen ace_regs *egsap-regs
           DMA_TO_DEVICE);
   dma_unmap_len_set(infojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }

  if (skb (  ;i<; +){
   dev->stats.tx_packets++;
   dev->stats.tx_bytes += skb->len;
  (skb);
   info->skb = NULL  struct *rd
  }

  idx = (idx + 1) % ACE_TX_RING_ENTRIES(ap);
 cmdcode =0

 if())
  netif_wake_queue(dev);

 wmb();
 ap->tx_ret_csm = txcsm;

 /* So... tx_ret_csm is advanced _after_ check for device wakeup.       mapping, mapping);
 *
 * We could try to make it before. In this case we would get
 * the following race condition: hard_start_xmit on other cpu
 * enters after we advanced tx_ret_csm and fills space,
 * which we have just freed, so that we make illegal device wakeup.
 * There is no good way to workaround this (at entry
 * to ace_start_xmit detects this condition and prevents
 * ring corruption, but it is not a good workaround.)
 *
 * When tx_ret_csm is advanced after, we wake up device _only_
 * if we really have some space in ring (though the core doing
 * hard_start_xmit can see full ring for some period and has to
 * synchronize.) Superb.
 * BUT! We get another subtle race condition. hard_start_xmit
 * may think that ring is full between wakeup and advancing
 * tx_ret_csm and will stop device instantly! It is not so bad.
 * We are guaranteed that there is something in ring, so that
 * the next irq will resume transmission. To speedup this we could
 * mark descriptor, which closes ring with BD_FLG_COAL_NOW
 * (see ace_start_xmit).
 *
 * Well, this dilemma exists in all lock-free devices.
 * We, following scheme used in drivers by Donald Becker,
 * select the least dangerous.
 * --ANK
 */

}


   struct *rd;
{
 struct net_device *dev = (struct net_device *)dev_id;
 struct ace_private   break;
 struct ace_regs __iomem *  mapping = dma_map_page(&ap->pdev->dev,
 u32 idx;
 u32 txcsm, rxretcsm, rxretprd;
 u32 evtcsm, evtprd;

 /*
 * In case of PCI shared interrupts or spurious interrupts,
 * we want to make sure it is actually our interrupt before
 * spending any time in here.
 */

if!(®s-) &IN_INT }
 returnIRQ_NONE;

 /*
 * ACK intr now. Otherwise we will lose updates to rx_ret_prd,
 * which happened _after_ rxretprd = *ap->rx_ret_prd; but before
 * writel(0, ®s->Mb0Lo).
 *
 * "IRQ avoidance" recommended in docs applies to IRQs served
 * threads and it is wrong even for that case.
 */
writel(0, ®s->Mb0Lo);
readl(®s->Mb0Lo);

/*
 * There is no conflict between transmit handling in
 * start_xmit and receive processing, thus there is no reason
 * to take a spin lock for RX handling. Wait until we start
 * working on the other stuff - hey we don't need a spin lock
 * anymore.
 */
rxretprd = *ap->rx_ret_prd;
rxretcsm = ap->cur_rx;

if (rxretprd != rxretcsm)
ace_rx_int(dev, rxretprd, rxretcsm);

txcsm = *ap->tx_csm;
idx = ap->tx_ret_csm;

if (txcsm != idx) {
/*
 * If each skb takes only one descriptor this check degenerates
 * to identity, because new space has just been opened.
 * But if skbs are fragmented we must check that this index
 * update releases enough of space, otherwise we just
 * wait for device to make more work.
 */
if (!tx_ring_full(ap, txcsm, ap->tx_prd))
ace_tx_int(dev, txcsm, idx);
}

evtcsm = readl(®s->EvtCsm);
evtprd = *ap->evt_prd;

if (evtcsm != evtprd) {
evtcsm = ace_handle_event(dev, evtcsm, evtprd);
writel(evtcsm, ®s->EvtCsm);
}

/*
 * This has to go last in the interrupt handler and run with
 * the spin lock released ... what lock?
 */
if (netif_running(dev)) {
int cur_size;
int run_bh_work = 0;

cur_size = atomic_read(&ap->cur_rx_bufs);
if (cur_size < RX_LOW_STD_THRES) {
if ((cur_size < RX_PANIC_STD_THRES) &&
    !test_and_set_bit(0, &ap->std_refill_busy)) {
#ifdef DEBUG
printk("low on std buffers %i\n", cur_size);
#endif
ace_load_std_rx_ring(dev,
     RX_RING_SIZE - cur_size);
} else
run_bh_work = 1;
}

if (!ACE_IS_TIGON_I(ap)) {
cur_size = atomic_read(&ap->cur_mini_bufs);
if (cur_size < RX_LOW_MINI_THRES) {
if ((cur_size < RX_PANIC_MINI_THRES) &&
    !test_and_set_bit(0,
      &ap->mini_refill_busy)) {
#ifdef DEBUG
printk("low on mini buffers %i\n",
       cur_size);
#endif
ace_load_mini_rx_ring(dev,
      RX_MINI_SIZE - cur_size);
} else
run_bh_work = 1;
}
}

if (ap->jumbo) {
cur_size = atomic_read(&ap->cur_jumbo_bufs);
if (cur_size < RX_LOW_JUMBO_THRES) {
if ((cur_size < RX_PANIC_JUMBO_THRES) &&
    !test_and_set_bit(0,
      &ap->jumbo_refill_busy)){
#ifdef DEBUG
printk("low on jumbo buffers %i\n",
       cur_size);
#endif
ace_load_jumbo_rx_ring(dev,
       RX_JUMBO_SIZE - cur_size);
} else
run_bh_work = 1;
}
}
if (run_bh_work && !ap->bh_work_pending) {
ap->bh_work_pending = 1;
queue_work(system_bh_wq, &ap->ace_bh_work);
}
}

return IRQ_HANDLED;
}

static int ace_open(struct net_device *dev)
{
struct ace_private *ap = netdev_priv(dev);
struct ace_regs __iomem *regs = ap->regs;
struct cmd cmd;

if (!(ap->fw_running)) {
printk(KERN_WARNING "%s: Firmware not running!\n", dev->name);
return -EBUSY;
}

writel(dev->mtu + ETH_HLEN + 4, ®s->IfMtu);

cmd.evt = C_CLEAR_STATS;
cmd.code = 0;
cmd.idx = 0;
ace_issue_cmd(regs, &cmd);

cmd.evt = C_HOST_STATE;
cmd.code = C_C_STACK_UP;
cmd.idx = 0;
ace_issue_cmd(regs, &cmd);

if (ap->jumbo &&
    !test_and_set_bit(0, &ap->jumbo_refill_busy))
ace_load_jumbo_rx_ring(dev, RX_JUMBO_SIZE);

if (dev->flags & IFF_PROMISC) {
cmd.evt = C_SET_PROMISC_MODE;
cmd.code = C_C_PROMISC_ENABLE;
cmd.idx = 0;
ace_issue_cmd(regs, &cmd);

ap->promisc = 1;
}else
ap->promisc = 0;
ap->mcast_all = 0;

#if 0
cmd.evt = C_LNK_NEGOTIATION;
cmd.code = 0;
cmd.idx = 0;
ace_issue_cmd(regs, &cmd);
#endif

netif_start_queue(dev);

/*
 * Setup the bottom half rx ring refill handler
 */

 *
 return  ace_opennet_devicedev
}


static int ace_close(struct  cmd
{
 struct ace_private *ap =  printk %
 struct ace_regs _ * and
cmd prefetchw(&ap- * the reallocation while the bottom half is either running * CPU or was interrupted on
 unsigned long flags * this is fun! since tx_ret_csm is (dev->  structring_info*;
 short i;

/*
 * Without (or before) releasing irq and stopping hardware, this
 * is an absolute non-sense, by the way. It will be reset instantly
 * by the first irq.
 */

 (dev


java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 .desc_type
  cmd    *
  ace_issue_cmd(regs,  * Jumbo frames    * Mini  
  ap->    * atomic5
#0

 cmd
 cmd.code * Note that with this flag tx_coal should be * time to xmit full tx ring.
 cmd.idx = 0;
 ce_issue_cmdregs&cmd

 cancel_work_sync(&ap-   = ACE_JUMBO_BUFSIZEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
--> --------------------

--> maximum size reached

--> --------------------

Messung V0.5
C=98 H=79 G=88

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.58Angebot  ¤

*Bot Zugriff






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.