Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/drivers/net/ethernet/alteon/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 84 kB image not shown  

Quelle  acenic.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * 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/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#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>

#ifdef SIOCETHTOOL
#include <linux/ethtool.h>
#endif

#include <net/sock.h>
#include <net/ip.h>

#include <asm/io.h>
#include <asm/irq.h>
#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(ap) MAX_TX_RING_ENTRIES
#else
#define ACE_IS_TIGON_I(ap) (ap->version == 1)
#define ACE_TX_RING_ENTRIES(ap) ap->tx_ring_entries
#endif

#ifndef PCI_VENDOR_ID_ALTEON
#define PCI_VENDOR_ID_ALTEON  0x12ae
#endif
#ifndef PCI_DEVICE_ID_ALTEON_ACENIC_FIBRE
#define PCI_DEVICE_ID_ALTEON_ACENIC_FIBRE  0x0001
#define PCI_DEVICE_ID_ALTEON_ACENIC_COPPER 0x0002
#endif
#ifndef PCI_DEVICE_ID_3COM_3C985
#define PCI_DEVICE_ID_3COM_3C985 0x0001
#endif
#ifndef PCI_VENDOR_ID_NETGEAR
#define PCI_VENDOR_ID_NETGEAR  0x1385
#define PCI_DEVICE_ID_NETGEAR_GA620 0x620a
#endif
#ifndef PCI_DEVICE_ID_NETGEAR_GA620T
#define PCI_DEVICE_ID_NETGEAR_GA620T 0x630a
#endif


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

#ifndef PCI_DEVICE_ID_FARALLON_PN9000SX
#define PCI_DEVICE_ID_FARALLON_PN9000SX 0x1a
#endif
#ifndef PCI_DEVICE_ID_FARALLON_PN9100T
#define PCI_DEVICE_ID_FARALLON_PN9100T  0xfa
#endif
#ifndef PCI_VENDOR_ID_SGI
#define PCI_VENDOR_ID_SGI  0x10a9
#endif
#ifndef PCI_DEVICE_ID_SGI_ACENIC
#define PCI_DEVICE_ID_SGI_ACENIC 0x0009
#endif

static const struct pci_device_id acenic_pci_tbl[] = {
 { PCI_VENDOR_ID_ALTEON, PCI_DEVICE_ID_ALTEON_ACENIC_FIBRE,
   PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, },
 { PCI_VENDOR_ID_ALTEON, PCI_DEVICE_ID_ALTEON_ACENIC_COPPER,
   PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, },
 { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C985,
   PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, },
 { PCI_VENDOR_ID_NETGEAR, PCI_DEVICE_ID_NETGEAR_GA620,
   PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, },
 { PCI_VENDOR_ID_NETGEAR, PCI_DEVICE_ID_NETGEAR_GA620T,
   PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, },
 /*
 * Farallon used the DEC vendor ID on their cards incorrectly,
 * then later Alteon's ID.
 */

 { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_FARALLON_PN9000SX,
   PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, },
 { PCI_VENDOR_ID_ALTEON, PCI_DEVICE_ID_FARALLON_PN9100T,
   PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, },
 { PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_ACENIC,
   PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, },
 { }
};
MODULE_DEVICE_TABLE(pci, acenic_pci_tbl);

#define ace_sync_irq(irq) synchronize_irq(irq)

#ifndef offset_in_page
#define offset_in_page(ptr) ((unsigned long)(ptr) & ~PAGE_MASK)
#endif

#define ACE_MAX_MOD_PARMS 8
#define BOARD_IDX_STATIC 0
#define BOARD_IDX_OVERFLOW -1

#include   structsk_buff* = ap-skb-rx_mini_skbuffi].skb

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

#define MAX_TEXT_LEN 96*1024
#define MAX_RODATA_LEN 8*1024  dma_addr_t;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

#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  4ap- = dma_alloc_coherent(ap-pdev-, size

#define RX_PANIC_STD_THRES 16
defineRX_PANIC_STD_REFILL 3*X_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 (3*RX_PANIC_JUMBO_THRES)/2
defineRX_LOW_JUMBO_THRES(*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  10

#define >rx_mini_ring >rx_jumbo_ring + RX_JUMBO_RING_ENTRIES
defineACE_STD_BUFSIZE(ACE_STD_MTU+ETH_HLEN4
#define ACE_JUMBO_BUFSIZE (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

/*
 * 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 */
#defineDEF_TX_MAX_DESC6  *was0*java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
#define DEF_RX_COAL 
#define DEF_RX_MAX_DESC  25
#define DEF_TX_RATIO  21 /* 24 */

#define DEF_JUMBO_TX_COAL 20
#define DEF_JUMBO_TX_MAX_DESC 60
#define DEF_JUMBO_RX_COAL 30
#define DEF_JUMBO_RX_MAX_DESC 6
#define DEF_JUMBO_TX_RATIO 21

#if tigon2FwReleaseLocal  if!(ap) {
/*
 * 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 1
#endif

#define DEF_TRACE  0
#define DEF_STAT  (2 * TICKS_PER_SEC)


static int link_state[ACE_MAX_MOD_PARMS];
  f ap- == NULL
static int tx_coal_tick[ACE_MAX_MOD_PARMS  goto;
static 
static int max_tx_desc[ACE_MAX_MOD_PARMS];
static int max_rx_desc[ ap->vt_prd =dma_alloc_coherentap-pdev-dev, (u32),
>evt_prd_dma GFP_KERNEL
static int dis_pci_mem_inval[ACE_MAX_MOD_PARMS] = {1, 1,  (ap-evt_prd NULL)

MODULE_AUTHOR("Jes java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MODULE_LICENSEGPL";
MODULE_DESCRIPTION("AceNIC/3C985/GA620 Gigabit Ethernet driver");
#fndefCONFIG_ACENIC_OMIT_TIGON_I
MODULE_FIRMWARE("acenic/tg1.bin");
#ndif
MODULE_FIRMWARE("acenic/tg2.bin");

module_param_array_named(link, link_state
module_param_array(trace,  >tx_csmdma_alloc_coherent&>pdev-dev sizeof(u32,
module_param_array(tx_coal_tick, int, NULL, 0);
module_param_array(max_tx_desc, int, NULL, 0);
module_param_array(rx_coal_tick, int   &ap->tx_csm_dma GFP_KERNEL);
module_param_array(max_rx_desc ifap-tx_csm = )
module_param_array(tx_ratiogoto;
MODULE_PARM_DESC(link, "AceNIC/failjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
MODULE_PARM_DESC(trace"AceNIC/395/NetGear firmware trace level");
MODULE_PARM_DESC(tx_coal_tick 1;
MODULE_PARM_DESC(max_tx_desc}
MODULE_PARM_DESC(rx_coal_tickjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MODULE_PARM_DESC(max_rx_desc, "AceNIC/3C985 * Generic cleanup handling data allocated during init. Used when the
MODULE_PARM_DESC(tx_ratio, "AceNIC/3C985/ * module is unloaded or if an error occurs during initialization


static const char version */java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  "acenic.c: v0.92 08/05/2002 Jes Sorensen, linux-acenic@SunSITE.dk\n"
  " ace_private *ap;

static int ace_get_link_ksettings(struct  ap netdev_priv(dev
      struct ethtool_link_ksettings *);
static int ace_set_link_ksettings(struct net_device *,
       if (>info
static void  dma_free_coherent(>pdev-, sizeofstruct ace_info

static const struct ethtool_ops  kfree(ap-)java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 .get_drvinfo= ace_get_drvinfo,
 .get_link_ksettings = ace_get_link_ksettings,
 .set_link_ksettings = ace_set_link_ksettings,
};

static void ace_watchdog(struct net_device *dev, unsigned int txqueue);

static const struct free_irqdev-irqdev;
 .ndo_open  = ace_open,
 .ndo_stop  = ace_close,
 .ndo_tx_timeout  = ace_watchdog,
 .ndo_get_stats  = ace_get_stats,
 .ndo_start_xmit  = ace_start_xmit,
 .ndo_set_rx_mode = ace_set_multicast_list,
 .ndo_validate_addr = eth_validate_addr,
 .ndo_set_mac_address = ace_set_mac_addr,
 .ndo_change_mtu  = ace_change_mtu
}

static int acenic_probe_oneto be slow.
        */
{
 struct net_device*dev
 struct ace_private *{
 static int boards_found;

 dev (&>CmdPrd
w( *cmd, &>CmdRng];
 return -NOMEM;

 SET_NETDEV_DEV(dev, &pdev-(idx, regs-);

 ap=netdev_privdev;
 ap->ndev = dev;
 ap-> int(struct d)
 ap-name (pdev

 dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
=NETIF_F_HW_VLAN_CTAG_TX;

 dev->watchdog_timeo = 5*HZ;
 dev->min_mtu = 0;
 dev-max_mtuACE_JUMBO_MTU

 dev->netdev_ops tmp_ptr
 dev->  tig_vermac1, , ;

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

 if (pci_enable_device(pdev ;
 [];

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

 pci_set_master(pdev/*

pci_read_config_word(pdev, PCI_COMMAND, &ap->pci_command);

/* OpenFirmware on Mac's does not set this - DOH.. */

 if (!(  * to any crashes involving the NIC
 printk "s MemoryMapped "
         (&>HostCtrl * PCI write posting */
         ap->namejava.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 0
  ap->pci_command = ap->pci_command | PCI_COMMAND_MEMORY;
  pci_write_config_word(ap->pdev, PCI_COMMAND,
          ap->pci_commandwritel | | (WORD_SWAP ) < 4)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
  wmb();
 }

 pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &ap->pci_latency);
 if (ap->pci_latency <= endif
  ap-pci_latency  x40
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 }

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 into spacethis abuseof
  * dev->base_addr sincereadlregs-CpuCtrl); /* PCI write posting */
  * addresses but who gives a damn writel, regs-Mb0Lo);
  */
 dev-> tig_ver = readl&>HostCtrl >> 2;
 ap->regs = ioremap(dev->java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
 if (!ap->regsCONFIG_ACENIC_OMIT_TIGON_I
  printk
  (KERN_INFO" I(.%i,Firmware:%.i.i ,
         ap->name, boards_found);
  goto fail_free_netdev;
 }

 switch( writel&>LocalCtrl
 case PCI_VENDOR_ID_ALTEON>version= ;
  if (pdev->device == PCI_DEVICE_ID_FARALLON_PN9100T) {
   printk(KERN_INFO "%s: Farallon PN9100-T ",
         >);
  } else;
 printk "s AceNIC "
          ap- 6java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
  }
  break; ap-);
 case PCI_VENDOR_ID_3COMwritel(&>CpuBCtrl|, regs-);
printk "s 33C985 ,ap-name;
  break;
 case PCI_VENDOR_ID_NETGEAR/*
printk(KERN_INFO "%s: NetGear GA620 ", ap->name);
break;
case PCI_VENDOR_ID_DEC:
if (pdev->device == PCI_DEVICE_ID_FARALLON_PN9000SX) {
printk(KERN_INFO "%s: Farallon PN9000-SX ",
       ap->name);
break;
}
fallthrough;
case PCI_VENDOR_ID_SGI:
printk(KERN_INFO "%s: SGI AceNIC ", ap->name);
break;
default:
printk(KERN_INFO "%s: Unknown AceNIC ", ap->name);
break;
}

printk("Gigabit Ethernet at 0x%08lx, ", dev->base_addr);
printk("irq %d\n", pdev->irq);

#ifdef CONFIG_ACENIC_OMIT_TIGON_I
if ((readl(&ap->regs->HostCtrl) >> 28) == 4) {
printk(KERN_ERR "%s: Driver compiled without Tigon I"
       " support - NIC disabled\n", dev->name);
goto fail_uninit;
}
#endif

if (ace_allocate_descriptors(dev))
goto fail_free_netdev;

#ifdef MODULE
if (boards_found >= ACE_MAX_MOD_PARMS)
ap->board_idx = BOARD_IDX_OVERFLOW;
else
ap->board_idx = boards_found;
#else
ap->board_idx = BOARD_IDX_STATIC;
#endif

if (ace_init(dev))
goto fail_free_netdev;

if (register_netdev(dev)) {
printk(KERN_ERR "acenic: device registration failed\n");
goto fail_uninit;
}
ap->name = dev->name;

dev->features |= NETIF_F_HIGHDMA;

pci_set_drvdata(pdev, dev);

boards_found++;
return 0;

 fail_uninit:
ace_init_cleanup(dev);
 fail_free_netdev:
free_netdev(dev);
return -ENODEV;
}

static void acenic_remove_one(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
struct ace_private *ap = netdev_priv(dev);
struct ace_regs __iomem *regs = ap->regs;
short i;

unregister_netdev(dev);

writel(readl(®s->CpuCtrl) | CPU_HALT, ®s->CpuCtrl);
if (ap->version >= 2)
writel(readl(®s->CpuBCtrl) | CPU_HALT, ®s->CpuBCtrl);

/*
 * This clears any pending interrupts
 */

 writeljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 readl(®s-  =-;

 /*
 * 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(i  4   ;+){

 for (i = 0; i < RX_STD_RING_ENTRIES; i++) {
  struct sk_buff *skb = ap->skb->rx_std_skbuff[i].skb;

   (skb){
   struct ring_info
   dma_addr_t mac2 mac2< 8;

   ringp = &ap->skb->rx_std_skbuff[i];
   mapping = dma_unmap_addr(ringp  = read_eeprom_byte, x8ci)
 dma_unmap_page&ap-pdev->, ,
           ACE_STD_BUFSIZE   =-IO

   ap-> = 0)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
 ap->rx_std_skbuffi.kb  ;
   dev_kfree_skb(skb);
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Range [2, 3) out of bounds for length 2

 >= 2 java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
  for eth_hw_addr_set,);
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

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

    ringp  * Looks like this is necessary to deal with on all architectures,
    * Ie. having two NICs in the machine, one  * line set at boot time, the other will not.
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            ACE_MINI_BUFSIZE,
    DMA_FROM_DEVICE

   >rx_mini_ring[]size0;
   f cache_size ) {
  (KERN_INFO    line  "
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  }
 }

for  ;i<RX_JUMBO_RING_ENTRIESi+ java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  struct sk_buff *skb = ap->  ("correctingto%i\" SMP_CACHE_BYTES
  if(skb{
   struct ring_info *ringp;
   dma_addr_t mapping;

   ringp = &ap->skb->rx_jumbo_skbuff[i];
  = dma_unmap_addr, mapping;
   dma_unmap_page(  }
           ACE_JUMBO_BUFSIZE, DMA_FROM_DEVICE);

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

 ace_init_cleanup(dev);
 free_netdev(dev);
}

static       ": %i clks\n",
 .name  = "acenic",
 .id_table         (pci_state&PCI_32BIT ?32:6,
.  = acenic_probe_onejava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 .remove  = acenic_remove_one,
};

static void ace_free_descriptors(struct net_device *dev)
{
 struct ace_private *ap = netdev_priv  * set. However for systems enabling PCI write and  * DMA writes must be set to the L1 cache line size to get
 int size;

 if (ap->rx_std_ring != NULL java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  sizeif (p- >=2 {
   (RX_STD_RING_ENTRIES +
 +
    RX_MINI_RING_ENTRIES +
    * Tuning parameters only supported for 8 cards
  ma_free_coherentap->devsize ap-,
    ap-rx_ring_base_dma
  ap->rx_std_ring =   ap- &=~PCI_COMMAND_INVALIDATE
   pci_write_config_word(, PCI_COMMAND
  ap->rx_mini_ring = NULL)java.lang.StringIndexOutOfBoundsException: Range [29, 30) out of bounds for length 29
 ap-rx_return_ring NULL
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
ifap-> !=NULL
  size = (sizeof(struct event) printk(KERN_INFO "  PCI memo write  \);
  dma_free_coherent(&ap->pdev->  (SMP_CACHE_BYTES
      ap-   6
  ap- =DMA_WRITE_MAX_16java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 }
 if (ap->tx_ring != NULL  4java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
  size = (sizeofcase18java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  dma_free_coherent(&ap->pdev-
   ap-);
 }
 ap- =NULL

i (> ! NULL{
  dma_free_coherent(&ap->pdev->dev, sizeof  "\,SMP_CACHE_BYTES)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
   ( *ap-, ap-);
  ap->evt_prd = NULL        >);
 }
 if (ap->rx_ret_prd != NULL) {
  dma_free_coherent(&ap->pdev->dev, sizeof(u32ifdef_sparc__
   (void*ap-,ap-);
  ap->  * On this platform, we know what the best dma settings
 }
 if (ap->tx_csm != NULL) {
  dma_free_coherent(&ap->pdev->dev, sizeof(u32),
      (void *)  *
  ap->tx_csm = NULL;
 }
}


static int ace_allocate_descriptors(struct net_device *dev)
{
 struct ace_private *ap = netdev_priv(dev tmp& ~DMA_READ_WRITE_MASK;
 ntsize

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

a>rx_std_ring(&>pdev-, ,
          MA_READ_WRITE_MASK
if>rx_std_ring=NULL
/java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

 ap-
ap-rx_mini_ring > +;
 ap->rx_return_ring = ap-

 size = (sizeof

 ap->evt_ring = dma_alloc_coherent(&ap->pdev->dev, size  * If all devices on that PCI bus support  * can enable FBB support in the Host   * the PCI-PCI bridge if that applies).
      * I have received reports from people having problems when this

  (p-> = NULL)
  goto fail;

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

 if (!ACE_IS_TIGON_I(ap)) {
 ap- |= PCI_COMMAND_FAST_BACK

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

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

 ap->evt_prd = dma_alloc_coherent(&ap->pdev->devjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      &ap->evt_prd_dma, GFP_KERNEL);
 if (ap-> goto init_error
  goto fail;

 ap->rx_ret_prd = dma_alloc_coherent  * Initialize the generic info block and the command+event rings
         &ap->rx_ret_prd_dma,  * as they need to be setup once and for all.
  (>rx_ret_prd=)
  goto fail;

 ap->tx_csm =  =-AGAIN;
     &  init_error
 if (ap->tx_csm
  goto fail;

 return

fail:
 /* Clean up. */
 ace_init_cleanup(dev);
 return;
}


/*
 * Generic cleanup handling data allocated during init. Used when the
 * module is unloaded or if an error occurs during initialization
 */

static void ace_init_cleanup(struct net_device *dev
{
 struct ace_private *ap;

 ap = netdev_priv(dev);

 ace_free_descriptors(dev);

 if (ap->info)
  dma_free_coherent(&ap->pdev- if(code
 printk "s:Requested IRQ %d busy\"
 kfree(ap->skb);
 kfree(ap->trace_buf);

 if (dev->irq)
  free_irq(dev->irq dev-irqpdev->rq

 iounmap(ap->regs);
}


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

static  voidace_issue_cmd ace_regs
{
 u32 idx;

 idx  (&>);

 writel(*(u32 *)(  init_error
 idx

 writel(idx, ®s->CmdPrd
}


static int ace_init(struct net_device *dev)
{
 struct ace_private *ap;
 struct _iomem;
 struct ace_info *info
structpci_dev
  ;
 u64 tmp_ptr;
 u32*>evt_prd)=0java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  board_idxecode  0
 short i;
 unsigned char cache_size;
 addr];

 ap (dev
 regs = ap->regs;

 board_idx = ap->board_idx;

 /*
 * 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 writel,&>CmdRng];
 readl(®s->HostCtrl);  /* PCI write posting */
 udelay(5);

 /*
 * Don't access any other registers before this point!
 */

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

 writel((WORD_SWAP | CLR_INT | ((WORD_SWAP | CLR_INTset_aceaddri>stats2_ptr() tmp_ptr
        ®s->HostCtrl)set_aceaddrinfo-.rngptr>rx_ring_base_dma)java.lang.StringIndexOutOfBoundsException: Range [62, 63) out of bounds for length 62
#else
 writel((
regs-
#endif
readl>); /* PCI write posting */

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

 writel(readl(®s- >rx_std_ringi.lagsBD_FLG_TCP_UDP_SUM
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 writel(0, ®s-> set_aceaddr(&info->rx_ju.ngptrjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41

 tig_ver=readlregs->) >2;

info->.max_len;
#ifndef  >.flags
 caseRCB_FLG_TCP_UDP_SUMRCB_FLG_NO_PSEUDO_HDRRCB_FLG_VLAN_ASSIST
 case 5:
  printk(KERN_INFO m(ap->x_jumbo_ring0
         tig_ver, ap->firmware_major, ap-       RX_JUMBO_RING_ENTRIES *sizeof(struct rx_desc;
         ap->firmware_fix);
 writel, &>LocalCtrl)
  ap->version  >rx_jumbo_ringi. BD_FLG_TCP_UDP_SUM;
  ap-> >rx_jumbo_skbprd=0;
  break;
#endif
 case 6:
  printk(KERN_INFO " Tigon II (Rev. %atomic_set&ap-cur_jumbo_bufs,0);
         tig_ver, ap->firmware_major, ap->firmware_minor, memset>rx_mini_ring 0
         ap-firmware_fix);
  writel(readl(®s->CpuBCtrl) | CPU_HALT, ®s->CpuBCtrl);
  readl(®s->CpuBCtrl);  /* PCI write posting */
  /*
 * 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, &>MiscCfg
    (>rx_ring_base_dma
       sizeof rx_descjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  break;
d:
  printk(KERN_WARNING " Unsupported info->rx_mini_ctrl.flags=
        (%i)n",tig_ver);
  ecode = -ENODEVjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
 goto;
 }

 /*B | ;
 * 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 | ACE_WARN | ACE_FATAL |  info-rx_mini_ctrlflagsRCB_FLG_RNG_DISABLEjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
ACE_WORD_SWAP_BD,&>);
#else
set_aceaddr>.,
        ACE_WORD_SWAP_BDap- +
#endif
 readl&egs->ModeStat /

 mac1 = 0;
 for       RX_STD_RING_ENTRIES
  int        RX_JUMBO_RING_ENTRIES

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

  mac2
   (dev x8c);
  if (t < 0) {
   ecode = -EIO;
    init_error
  } else
   |=t  0xff)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
 java.lang.StringIndexOutOfBoundsException: Range [2, 3) out of bounds for length 2

 writel(mac1, ®s->MacAddrHi);
 writel(mac2, ®s->MacAddrLo);

 addr[0] = (mac1
 addr[1] = mac1 & 0xff;
 addr[2] = (mac2 >> 24) & 0xff;
 addr[3] = (mac2 >> 16) & 0xff;
 addr[4] = (mac2 >> 8) & 0xff;
 addr[5] = mac2 & 0xff;
 eth_hw_addr_set(dev, addr);

 printk("endif

 /*
 * Looks like this is necessary to deal with on all architectures,
 * even this %$#%$# N440BX Intel based thing doesn't get it right.
 * Ie. having two NICs in the machine, one will have the cache
 * line set at boot time, the other will not.
 */

 pdev = ap->pdev;
 pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &cache_size);
 cache_size <<= 2;
 if (cache_size != SMP_CACHE_BYTES) { printk " than% detected,
 printk   PCI  linesize incorrectly
         "(%i bytes) by BIOS/FW, ", cache_size);
  if (cache_size > SMP_CACHE_BYTES)
   printk("expecting %i\n", SMP_CACHE_BYTES (x_coal_tick])
  else{
   printk("correcting to %i\n", SMP_CACHE_BYTES);
           >TuneTxCoalTicks)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
    ifrx_coal_tick])
  }
}

 pci_state = readl(®s->PciState);
 printk(KERN_INFO " PCI bus width: %i bits, speed: %iMHz, "
        "latency: %i clks\n",
  ( & PCI_32BIT ?32:6,
  (pci_state &   (max_rx_desc],&>TuneMaxRxDesc;
  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 = READ_CMD_MEM | WRITE_CMD_MEM;
 if (ap->version >= 2) {
  tmp | tmp= LNK_ENABLE| LNK_FULL_DUPLEX LNK_1000MB|LNK_100MB |
    |  |   LNK_NEGOTIATE
  if>version=2)
   */
  if (board_idx ==java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      dis_pci_mem_inval[board_idx f(board_idxhalfn,
         >)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  > & PCI_COMMAND_INVALIDATE
    pci_write_config_word(pdev,  tmp LNK_NEGOTIATE
            ap->pci_command);
    printk(KERN_INFO " Disabling PCI memory "
           "write and invalidate\n");
   }
  } else if (ap->pci_command &   tmp |=LNK_100MB
    if( & 0x40
        " by BIOS,enabling counter \n";

   switch(SMP_CACHE_BYTES) {
   case 16:
    tmp |= DMA_WRITE_MAX_16;
  ;
   case 32" negotiationn,ap- "forcing auto negotiation\n", ap->name
  |DMA_WRITE_MAX_32
    break;
   case6:
    tmp java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
   break;
   case *   Aman Singla: Nasty race *                with 'testing the tx_ret_csm and setting tx_full'
   =DMA_WRITE_MAX_128
    break;
   default
   *   Matt Domsch <Matt_Domsch@ *                                       java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 21
 *                                       memory mapped IO is enabled to
     *                                       where the driver would disable
    ap->pci_command *                                       write and invalidate.
    pci_write_config_word( *   Val Henson <vhenson@esscom.com>: *                                       rx producer index when
            ap- *                                       driver init path.
   }
  }
 }

_java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 /*
 * 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.
 */

 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
 tmp#   #definePCI_DEVICE_ID_ALTEON_ACENIC_COPPER >java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
  *  the  IDsize(( *to *java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
#endif
#ifdef __lpha__
 tmp& ~DMA_READ_WRITE_MASK
 tmp |= DMA_READ_MAX_128 if (ap->evt_ring == NULL)
 /*
 * All the docs say MUST NOT. Well, I did.
 * Nothing terrible happens, if we load wrong size.
 * Bit w&i still works better!
 */

 tmp |= DMA_WRITE_MAX_128;
#endif
writel, regs-);

#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
 */

/*  failjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
 * I have received reports from people having problems when this
 * bit is enabled.
 */

 if  
  printk }
   if (ap->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  pci_write_config_wordjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  /* Clean up. */
#endif

 /*
 * Configure DMA attributes.
 */

 if (dma_set_mask(&pdev->dev, DMA_BIT_MASK  Generichandling allocated init Used the
   = -;
  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.
 */

 if (!(info =  * interface number and if(ap-  *
     & * of module parameters  * aman@sgi.com - account for badly behaving firmware/NIC:
ecode = -EAGAIN;
goto init_error;
}
ap->info = info;

/*
 * Get the memory for the skb rings.
 */

),GFP_KERNEL) {
  ecode = -EAGAIN;
   init_error *         0x0001 - Force half duplex link *         0
 }

 ecode = request_irq(pdev-/*
    DRV_NAME, dev);
if (ecode) {
printk(KERN_WARNING "%s: Requested IRQ %d is busy\n",
       DRV_NAME, pdev->irq);
goto init_error;
} else
dev->irq = pdev->irq;

#ifdef INDEX_DEBUG
spin_lock_init(&ap->debug_lock);
ap->last_tx = ACE_TX_RING_ENTRIES(ap) - 1;
ap->last_std_rx = 0;
ap->last_mini_rx = 0;
#endif

ecode = ace_load_firmware(dev);
if (ecode)
goto init_error;

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 ;-(
 */

 if (
  tmp |= RCB_FLG_TX_HOST_RING;
#if TX_COAL_INTS_ONLY
 tmp |java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#endif
info-tx_ctrl  java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19

 set_aceaddr(&info->tx_csm_ptr, ap->tx_csm_dma);

 /*
 * Potential item for tuning parameter
 */

#if 0 /* NO */
 writel(DMA_THRESH_16W, ®s->   cur_size(ap-java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
 writel}
#else
ritel,&>)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
 writel(DMA_THRESH_8W, ®s->DmaWriteCfg);
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6

 writel(0, ®s->MaskInt);
 writel(1, ®s->IfIdx);
#f0
 /*
 * McKinley boxes do not like us fiddling with AssistState
 * this early
 */

 writel *even(" bufferscurrent%\,
# *Iehaving  in machine will the

 writel(DEF_STAT, ®s->pdev ap->;
w(DEF_TRACE&>TuneTrace

 ace_set_rxtx_parms(dev, 0);

  board_idx= BOARD_IDX_OVERFLOW {
  printk(KERN_WARNING "%s: more than % !test_and_set_bit(0, &ap->jumbo_refill_busy)) {
         "ignoring module parameters!\n",
         ap-> printk("expecting\" );
 } else("correctingto %\" );
 iftx_coal_tick])
  writel[board_idx]
          ®s->TuneTxCoalTicks);
  if (max_tx_desc[
   writel[board_idx,&>TuneMaxTxDesc

  if (rx_coal_tick[board_idx])
   writel(rx_coal_tick[board_idx],
  ®s-);
 if (max_rx_descboard_idx])
   writel(max_rx_desc[board_idx], ®s->TuneMaxRxDesc        (pci_state&PCI_32BIT:64java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43

 if ([   Set max  .Seemsforsystems
 ([], >);

  ([board_idx .However systemsenabling write ,
   writel(tx_ratio[board_idx], ®s->     performance.
 }

  =}
  Default parameters
  */
 tmp = LNK_ENABLE | LNK_FULL_DUPLEX | LNK_1000MB | LNK_100MB |
  LNK_10MB/
 if(ap-> * Load the standard rx ring.
  tmp |= LNK_TX_FLOW_CTL_Y;

 define 1
  * Override link default parameters
  */
 if (#RX_PANIC_MINI_THRES1
  if(>static void ace_load_std_rx_ringstruct java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 30

 *   TCP

 ifoption01 java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
   printk(KERN_INFO#define ACE_STD_BUFS     if(>pci_command&PCI_COMMAND_INVALIDATEjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
          ap->name);
  
  } *
  if (option |   whether  thejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  &    <r_bufs+
 if( & 0)
   |  =DMA_WRITE_MAX_64
 i &20
   tmp |java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ifoption0#DEF_JUMBO_RX_MAX_DESC
  :
  if ((option * Standard firmware and early (KERN_INFO    %  
 printks*time    .
          " "\n,SMP_CACHE_BYTES
   tmp |=java.lang.NullPointerException
0MB        >)
         (skb-),
 offset_in_pagejava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
   tmp   ( *TICKS_PER_SEC)
  else
   printk(KERN_INFO "%s: Disabling flow control "
          "negotiation\n", ap->name);
   (  020java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
   |= LNK_RX_FLOW_CTL_Yjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
intmax_tx_desc
   printk(KERN_INFOstaticint[ACE_MAX_MOD_PARMS;
   static [;
   1,1 java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 34
  }
MO("/3/ idx = (idx + 1) % RX_STD_RING_ENTRIES;

 ap->endif
 writel(tmp
 if (ap->version >= 2)
  writel(tmp, ®s->module_param_array(tx_coal_tick /*

writel(ap->firmware_start, ®s->Pc);

writel(0, ®s->Mb0Lo);

/*
 * 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->cur_rx = 0;
 ap->tx_prd = *(ap->tx_csm) = ap->tx_ret_csm = 0;

 wmb();
 ace_set_txprd(regs, ap,
 writel(0, ®s->RxRetCsm);

 /*
 * 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.
 */

        "standard receive buffers\n"
 goto get_drvinfo p,PCI_COMMANDap-;
 /*
 * Start the NIC CPU
 */

 java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 3
 readl(®s-.  ,

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

 myjif = jiffies }
,)  *
cpu_relax();

if (!ap->fw_running) {
printk(KERN_ERR "%s: Firmware NOT running!\n", ap->name);

ace_dump_trace(ap);
writel(readl(®s->CpuCtrl) | CPU_HALT, ®s->CpuCtrl);
readl(®s->CpuCtrl);

/* 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 (
   writel java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  writel(0, ®s->Mb0Lo) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  readl(& printk(KERN_ %s:   dev->irq=pdev->irq;

  ecode = -EBUSY;
  gotojava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0


 * 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
 *
 else
  printk(KERN_ERR "%s: Someone isg (&>evt_ctrl.ngptr,ap->)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
         ap- ;
 if (ap- writel(0, ®s- i java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if ( if(>device= >cmd_ctrl =  = ap-;
   ace_load_mini_rx_ring(dev, RX_MINI_SIZE);
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 printk%  ap-
 " ringn,ap-info-,())java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
}
 return 0;

 init_error memset(ap->  (KERN_INFO%   ,
 ace_init_cleanup(dev  ;
  fallthrough;
}


static void ace_set_rxtx_parms(
{
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 struct ace_regs __iomem *regs = ap- info-
 ap-;

ifboard_idx =) {
   (!jumbojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 if!])
  ( regs-);
   if (!max_tx_desc[board_idx idx java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 if(rx_coal_tick]
   >board_idx  (!java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
   if (!max_rx_desc
    writel    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
  if (tx_ratio])
    writel(DEF_TX_RATIO,ifjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
  } else {
   if (!}
      info->rx_mini_ctrl.max_len = 0;
           ®s-
   if (!
    writel  0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
           ®s- java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 out
  writeljava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
           ®s-ace_private =(dev
   if (!max_rx_desc[board_idx])
    writeljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   if (!tx_ratio[board_idx])
    if (ACE_IS_TIGON_I(ap))  writel(& out
  }
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}


static void ace_watchdog
{
 struct net_device *dev
 struct ace_private *ap = netdev_priv(dev   * =>>[.;
 struct ace_regs __iomem *regs = ap->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*> ! >tx_ret_csm
printk%}
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  i    (;
  ;
   :java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         dev->nameif0
#if 0
  netif_wake_queue(dev);
#endif
}
}


 void

1egs-
 struct net_device *dev = ap-
  cur_size

cur_size LNK_FULL_DUPLEX":java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 51
 if ((cur_size  =(ringp)
!(0 ap-))java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  printk
endif
  ace_load_std_rx_ring(  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 if (ap- probe,
 =atomic_read} if>0{
  cur_size) &
      !java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
#ifdef DEBUG
 printkrefillingbuffersi)n,
 
#endif
   ace_load_mini_rx_ring(dev, RX_MINI_SIZE - cur_size);
  }
 }

 cur_size = atomic_read;
 if (ap- :
      > ifprintks   java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
#ifdef ap- =;
  printk("refilling i ap-> ! NULL) java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
#
  (devRX_JUMBO_SIZE cur_size   parameters
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
> 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1


/*  * Override link default parameters
 * Copy the contents of the NIC's trace buffer to kernel memory.
 */

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


/*
 * 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  &x40
{
   ;
 struct tmpjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
 short i,  }


 prefetchw(&ap->cur_rx_bufs);

idxrx_std_skbprd>evt_ring(&>>dev,

i)
  struct sk_buff *skb 
 s rx_descrd
  dma_addr_t;

  skb = netdev_alloc_skb_ip_align(    = ((structtx_desc*;
  !)
   break;

  mapping =  if (ap->tx_ring)
           virt_to_page(skb-writel regs-TuneLinkjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
           offset_in_page(skb- (tmpregs-)
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ap->skb->rx_std_skbuff[idx].skb = skb;
/java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
       mapping     >rx_ret_prd_dma)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42

  &rx_std_ring
  set_aceaddr(
  rd-
fail
  idx  (>)
 }

 if (* Generic cleanup handling data  *;
  goto error_out;

 atomic_add(i, is sooner
 ap-

 if (ACE_IS_TIGON_I  dma_free_coherent(&ap- (1, &>AssistState  * DMA*java.lang.StringIndexOutOfBoundsException: Range [49, 50) out of bounds for length 49
  struct cmd cmd;
  cmd.evt>,dev
  cmd.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  cmd.  &>rx_return_ring  are 
 ace_issue_cmd,&;   struct_*  *java.lang.StringIndexOutOfBoundsException: Range [81, 80) out of bounds for length 80
   {
  writel(idx, ®s- =( + )%CMD_RING_ENTRIES
  wmb();
 }

 out
  struct  *
 return;

 error_out:
 printk(KERN_INFO "Out of memory when allocating "
        "standard * - have observed that the NIC may continue to generate
  ap-rx_std_skbuffkbidx
}


static    ap (dev
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 struct  = @sgi-    a resetto
short;

prefetchw>cur_mini_bufs

 idx = ap->rx_mini_skbprd;
 for (i 
  struct sk_buff *skb;
  default:
  dma_addr_t mapping

else
  if (!skb)
   break;

  mapping >) /
           virt_to_page
offset_in_page>data
           ACE_MINI_BUFSIZE, DMA_FROM_DEVICE);
  >skb- iftest_and_set_bitskb>size
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       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.
 */

  (  if Theresets  same
{
  *
ace_regs * = if[)
 short ;

   if ![board_idx

 for (i = 0; i   (!()ACE_WORD_SWAP_BDACE_NO_JUMBO_FRAG>   ![])
 
   *;
         >;

  skb = netdev_alloc_skb_ip_align(dev,   (<)java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  if (!skb)
   break;

  mapping = dma_map_page(&ap->java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 8
           virt_to_page(staticvoid(structnet_device, unsigned  = rxretprd
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        ,)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
  ap->skb->rx_jumbo_skbuff[idx[] mac22 xfface_private=(dev
  dma_unmap_addr_set(&ap->skb->rx_jumbo_skbuff[idx],
    skb

  rd = &ap->rx_jumbo_ring[idx];
  set_aceaddr(&rd->addr
 > =;
 *  %%#N440BX based doesn dev- unsigned*Ie. having NICsinmachinewillthe
  idx } else
 }

if!java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
 goto

}
>  ;

 if (ACE_IS_TIGON_I(ap)) {
  structstaticvoidjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  cmdlatency\,
  md = 0java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  cmd.idx = ap->  cur_size
  ace_issue_cmd(regs, &cmd);
 } info-skb;
  writel(idx, ®s->  }
 (;
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

:
clear_bit ap-);
 return;
error_out
 if (net_ratelimit())
  printk(KERN_INFO "Out java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
   /* So... tx_ret_csm is advanced _after_ check for device wakeup.
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.
 */

    ,java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  ap

 ap = netdev_priv(dev);

 (evtcsm evtprd
  switch (ap->evt_ring[evtcsm | ;
c _:
 !(0 &>) java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
 )
   ap-java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
   wmb *mark, java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
;
:
   break;
  case E_LNK_STATE
  {
   u16 code  * a 64byte boundary   /
  switchcode
   case
   {
    u32 state
 {
             | DMA_READ_MAX_64 struct * =(  )java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
           ap->name,
  |/*
       state & LNK_TX_FLOW_CTL_Y ? "TX " : "",
       state & LNK_RX_FLOW_CTL_Y ? "RX" : "");
break;
}
case E_C_LINK_DOWN:
printk(KERN_WARNING "%s: Optical link DOWN\n",
       ap->name);
break;
case E_C_LINK_10_100:
printk(KERN_WARNING "%s: 10/100BaseT link "
       "UP\n", ap->name);
break;
default:
printk(KERN_ERR "%s: Unknown optical link "
       "state %02x\n", ap->name, code);
}
break;
}
case E_ERROR:
switch(ap->evt_ring[evtcsm].code) {
case E_C_ERR_INVAL_CMD:
printk(KERN_ERR "%s: invalid command error\n",
       ap->name);
break;
case E_C_ERR_UNIMP_CMD:
printk(KERN_ERR "%s: unimplemented command "
       "error\n", ap->name);
break;
case E_C_ERR_BAD_CFG:
printk(KERN_ERR "%s: bad config error\n",
       ap->name);
break;
default:
printk(KERN_ERR "%s: unknown error %02x\n",
       ap->name, ap->evt_ring[evtcsm].code);
}
break;
case E_RESET_JUMBO_RNG:
{
int i;
for (i = 0; i < RX_JUMBO_RING_ENTRIES; i++) {
if (ap->skb->rx_jumbo_skbuff[i].skb) {
ap->rx_jumbo_ring[i].size = 0;
set_aceaddr(&ap->rx_jumbo_ring[i].addr, 0);
dev_kfree_skb(ap->skb->rx_jumbo_skbuff[i].skb);
ap->skb->rx_jumbo_skbuff[i].skb = NULL;
}
}

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

ap->jumbo = 0;
ap->rx_jumbo_skbprd = 0;
printk(KERN_INFO "%s: Jumbo ring flushed\n",
       ap->name);
clear_bit(0, &ap->jumbo_refill_busy);
break;
}
default:
printk(KERN_ERR "%s: Unhandled event 0x%02x\n",
       ap->name, ap->evt_ring[evtcsm].evt);
}
evtcsm = (evtcsm + 1) % EVT_RING_ENTRIES;
}

return evtcsm;
}


static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)
{
struct ace_private *ap = netdev_priv(dev);
u32 idx;
int mini_count = 0, std_count = 0;

idx = rxretcsm;

prefetchw(&ap->cur_rx_bufs);
prefetchw(&ap->cur_mini_bufs);

while (idx != rxretprd) {
struct ring_info *rip;
struct sk_buff *skb;
struct rx_desc *retdesc;
u32 skbidx;
int bd_flags, desc_type, mapsize;
u16 csum;


/* make sure the rx descriptor isn't read before rxretprd */

  if (idx == rxretcsm)
 rmb;

retdescrx_return_ring;
  skbidx = retdesc->idx;
  bd_flags  set_aceaddr&>rx_jumbo_ctrl,
  desc_type = bd_flags & (BD_FLG_JUMBO if (!i)

 (desc_type
  /java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    framesnot flags
 (low \"
    * java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
    (dev
    * atomic(" memorywhen java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    */
  case}
   rip = &ap->skb->}
   /*
   std_count+    RCB_FLG_TCP_UDP_SUM|RCB_FLG_NO_PSEUDO_HDR|RCB_FLG_VLAN_ASSIST;
   break;
  case BD_FLG_JUMBO *
  rip=&>skb-}else {
  mapsize= ACE_JUMBO_BUFSIZE
   atomic_dec(&ap->cur_jumbo_bufs);
   break }
 caseBD_FLG_MINI:
 atomic_set(&ap->cur_mini_bufs,DEBUG
   mapsize = ACE_MINI_BUFSIZE;
   mini_count++;
   break;
  default:
  (KERN_INFO":unknown type (x%2x "
          "returned "returned bymax_len = RX_RETURN_RING_ENTRIES;
          retdesc->flags);
           dma_addr_t;
  }

  skb = rip->skb;
  rip->skb writel(TX_RING_BASE f(skb
  dma_unmap_page   break
          mapsize, DMA_FROM_DEVICE);
skb_put(,     *sizeof tx_desc) /sizeof(3);i+java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50

  /*
 * Fly baby, fly!
 */

  csum 

  skb->protocol = eth_type_trans(skb, dev);

 /
   * Instead of forcing the  
  *pseudo  rd-idx idx
   */
  ( & ) {
   skb->csumjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 8
   skb->ip_summed = CHECKSUM_COMPLETE;
  } else { et_aceaddratomic_addi ap-);
   skb_checksum_none_assert(skb);
  }

  /* send it up */
  if ((bd_flags & BD_FLG_VLAN_TAG))
   cmd.idx else
  netif_rx(skb);

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

  idx = (idx + 1) % RX_RETURN_RING_ENTRIES;
 }

 atomic_sub(std_count, &ap->cur_rx_bufs if (net_ratelimit())
 if (!ACE_IS_TIGON_I(ap)) .evt=C_HOST_STATE
  atomic_sub(mini_count  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 out:
 /*
 * According to the documentation RxRetCsm is obsolete with
 * the 12.3.x Firmware - my Tigon I NICs seem to disagree!
 */

 if (ACE_IS_TIGON_I(ap)) {
  writel if( == BOARD_IDX_OVERFLOW)  u32ace_handle_event net_device *, ace_load_jumbo_rx_ring,RX_JUMBO_SIZE
 }
rx = idx;

return
 error:
 idx = rxretprd;
 goto  E_FW_RUNNING
}


static inline void ace_tx_int(struct net_device   (rx_coal_tick]
         u32 txcsm, u32 idx)
{
 struct ace_private *apjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 9

 do{
  struct sk_buff *skb;
  tx_ring_infoinfo

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

  if (dma_unmap_len(infotmpLNK_ENABLELNK_FULL_DUPLEX  | 
 (> >2
 {
           dma_unmap_len(info, maplen),
           DMA_TO_DEVICE);
(info maplen, 0;
  }         (%sDuplex

if() foptionx01
 dev-         java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 51
   dev->stats.tx_bytes += skb-> ( &0)
  }
   info-> = WN
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  idx = (idx +  (KERN_WARNING%:1/0BaseT
  option =java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

 ((dev
dev

(java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
ap-

 /* So... tx_ret_csm is advanced _after_ check for device wakeup.
 *
 * 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
 */

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


 irqreturn_tint dev_id
{
struct * =  * Wait for the firmware to spinmax.
 struct ace_private   +3 ;
 struct ace_regs  (ap-,&);
  idx
, ;
 u32 evtcsm (ap

 /*
 * 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 ( (0 ap-)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  return IRQ_NONE   * :

 /*name,ap-evt_ring  f ap-version>2java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 * 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  * firmwarestruct * = (dev
 readl(®s->Mb0Lo mini_count, = ;

 *
 * 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_prdjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
rxretcsm>cur_rxjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23

 if (rxretprd intbd_flags java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ace_rx_int(dev, rxretprd, rxretcsm)}

 txcsm = *ap->tx_csm;
idx>tx_ret_csm

 if (txcsm()java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
/
   jumbo
   * to identity, because new space has just   desc_type =   writel, &egs-
   * But if skbs are   /*
 * 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);
 }

evtcsmreadl&>java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 9
evtprdap-;

 if (evtcsm != evtprd)    writel,
  evtcsm   >kb-[];
     =;
  ++;

 /*
 * This has to go last in the interrupt handler and run with
 * the spin lock released ... what lock?
 */

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  int cur_size;
  int  *

  cur_size = atomic_read(&ap->cur_rx_bufs  = >tcp_udp_csum
  if (cur_size <  >protocoleth_type_transa(&>))java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
  ( < RX_PANIC_STD_THRES)    of the tigoncpucalculate
       !test_and_set_bit(0, &ap->std_refill_busyifbd_flags netif_wake_queue;
#ifdef DEBUG
  }
#endif
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
           RX_RING_SIZE - cur_size);
 } if(&BD_FLG_VLAN_TAG
    run_bh_work = 1;
  }

 if!(ap){
   cur_size = atomic_read(&ap->cur_mini_bufs);ifdef
   if  dev-.rx_bytes >size
    if (   = ( + 1)%java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 2
        !test_and_set_bit(0 if(  std_count>;
         ap-mini_refill_busy){
#ifdef DEBUG
     printk("low on mini buffers %i\n",
           );
#endif
   ace_load_mini_rx_ring,
   */
    } else java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   = ;
   }
  }

  if (ap->jumbo) {
     cmd.code = 0;
   if (cur_size }
    if
  
            &ap->jumbo_refill_busy
ifdef
 printklow jumbobuffersin" } else {
           );
#endif
  ifdef
          java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
   x
  ,  E_C_ERR_UNIMP_CMD
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  }
  if *                to wait for more packets to arive in the transmit *                before interrupting the host, after transmitting the
   ap->bh_work_pending = 1;
   queue_work(system_bh_wq, &ap->ace_bh_work);
  }
 }

 return IRQ_HANDLED * netif_start_queue(dev          ap->name, ap->evt_ring[evtcsm].evt *                this on my systems. Set <val>=0 if youjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

staticint(struct net_device *dev}
{
 struct ace_private *ap = netdev_priv(dev);
 struct ace_regs __iomem *
 structcmd;

 if (!(ap->fw_running)) {
 (KERN_WARNING"
  return -EBUSY;
 * Note that running the skb reallocation in a prefetchw(&ap- * another can of races which needs to be handled properly * particular it can struct cmd cmd;

writel*  rip

 *
 cmd  int bd_flags,  */*
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
 */

 INIT_WORK(&ap-  = &ap->rx_mini_skbuff];
 return 0;
}


static int ace_close(struct net_device *dev)
{
 struct ace_private MODULE_PARM_DESC(rx_coal_tick, "AceNIC/3C985/GA620 max clock ticks to wait from first rxMODULE_PARM_DESC(max_rx_desc, "AceNIC/3C985/GA620 max number of receive MODULE_PARM_DESC(tx_ratio, "AceNIC/3C985/GA620 ratio of NIC memory used for "returned
static int ace_get_link_ksettings(struct net_device      struct ethtool_link_ksettings *);
 struct cmd cmd;
 unsigned long flags .get_drvinfo = ace_get_drvinfo,
 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.
 */

 netif_stop_queue(dev)  return -ENOMEM


 if (ap- dev- dev-max_mtuACE_JUMBO_MTU
  cmd.evt  if (!boards_found)
cmd =C_C_PROMISC_DISABLE
  cmd.idx  * Enable
  java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
promisc
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

. ;
 cmd.code/* send it up */
 cmd =0
 ace_issue_cmd(regs, &cmd);

 cancel_work_sync(&ap->ace_bh_work  * addresses but who gives 

/
--> --------------------

--> maximum size reached

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

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

¤ 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.0.58Bemerkung:  ¤

*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.