// 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.
*/
/* * Farallon used the DEC vendor ID by mistake and they seem not * to care - stinky!
*/ #ifndef PCI_DEVICE_ID_FARALLON_PN9000SXjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #define PCI_DEVICE_ID_FARALLON_PN9000SX 0x1a
=; #ifndef java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
ap- #endif #ifndef * All the docs say MUST NOT. Well, I did. #define PCI_VENDOR_ID_SGI 0x10a9 # */ #ifndef PCI_DEVICE_ID_SGI_ACENIC #define PCI_DEVICE_ID_SGI_ACENIC java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 27 #endif
staticconst, &rRxRetCsm>
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
PCI_ANY_ID, PCI_ANY_ID,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ * If all devices on that PCI if (ap- goto }
{ PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C985,
PCI_ANY_ID,&>AssistState; *
{ if (ap->evt_prd == NULL)
PCI_ANY_ID /* goto; { 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_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);
/* * These must be defined before the firmware is included.
*/ #define MAX_TEXT_LEN 96*1024 #define MAX_RODATA_LEN8*02java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
define 2*
#ifndef tigon2FwReleaseLocal #definetigon2FwReleaseLocalcleanupdata . when
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
/* * 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 7writelKERN_INFOTigonRev # tig_ver (>version )java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
8 sizeofrx_desc java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
RX_PANIC_STD_THRES #define RX_PANIC_STD_REFILL (3*java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 36 #define RX_LOW_STD_THRES (3*RX_RING_SIZE)/4 #efine RX_PANIC_MINI_THRES 2
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #define RX_LOW_MINI_THRES (3*RX_MINI_SIZE)/4 #defineRX_PANIC_JUMBO_THRES #define RX_PANIC_JUMBO_REFILL (3*RX_PANIC_JUMBO_THRES)/2 #define RX_LOW_JUMBO_THRES (3*> & ~;
/* * Size of the mini ring entries, basically these just should be big * enough to take TCP ACKs
*/ #define ACE_MINI_SIZEjava.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 */ #define DEF_TX_MAX_DESC tmp= for 0i ;+ #defineif optionx10 #define DEF_RX_MAX_DESC tmp | ; #define DEF_TX_RATIO 21 /* 24 */ skbifoption0)
#if tigon2FwReleaseLocaldefault /* * 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 */
java.lang.NullPointerException /* * With modified firmware, this is not necessary, but still useful.
*/ #define java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 35 #endif
staticint * On this platform, we know what the best dma settings staticint trace[static int trace[ACE_MAX_MOD_PARMSskb staticintdma_unmap_addr_set&if&00java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 staticint rx_coal_tick[ACE_MAX_MOD_PARMS];
tatic [java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 static max_rx_desc]java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 staticinttx_ratio]java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 staticintdis_pci_mem_invalACE_MAX_MOD_PARMS 1, , 1,1 ,1java.lang.StringIndexOutOfBoundsException: Range [74, 34) out of bounds for length 34
module_param_array_named(link, link_state, int (!i)
module_param_array(trace, int, NULL, 0);
, int,/
module_param_array(max_tx_desc, int, NULL, 0);
module_param_array(rx_coal_tick, int, NULL, 0);
(ap->firmware_start,®s->Pc);
module_param_array(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MODULE_PARM_DESC * wi still
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MODULE_PARM_DESC(tx_coal_tick, "AceNIC/3C985/GA620
MODULE_PARM_DESC ( (, &>);
MODULE_PARM_DESC(rx_coal_tick,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MODULE_PARM_DESC(max_rx_desc, " * The Host PCI bus controller cmd.evt = java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 4
ace_issue_cmd * the java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
static java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0 "acenic.c: v0.92java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 " out:
staticint ace_get_link_ksettings( clear_bit(0 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct ethtool_link_ksettings *); staticintace_set_link_ksettings net_device *
error_out: staticvoidace_get_drvinfo( net_device *,struct (KERN_INFO Out ofmemory allocatingjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
tic net_device_opsvoid(struct *evjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
n =ace_open
.do_stop = ace_close
.ndo_tx_timeout = ace_watchdog,
. =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
.ndo_start_xmit =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
. = ace_set_multicast_list(&ap-);
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = ace_set_mac_addr,
.ndo_change_mtu = ace_change_mtu,
};
staticint for (i = 0; i < nr_bufs; s myjif/ const cpu_relax struct sk_buff *skb;
{ struct net_device *dev; struct ace_private *ap; dma_addr_t mapping; static if (!(i =&>pdev-, (struct)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dev= ; if (dev == NULL)
ENOMEM
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/* we only display this string ONCE */ if (!boards_found)
rd->size = ACE_MINI_BUFSIZE}
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_set_master);
pci_read_config_word,PCI_COMMANDap-);
/* OpenFirmware on Mac's does not set this - DOH.. */
(!java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
INFO": Enablingjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ap-name;
ap->pci_command = ap->pci_command
pci_write_config_word init_error;
ap-);
wmb();
}
pci_read_config_byte, , &>pci_latency if (ap->pci_latency <= 0x40) {
ap->pci_latency = 0x40;
pci_write_config_byte(pdev, PCI_LATENCY_TIMER, ap->pci_latency); = (dev "mini receive buffers\java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* * 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 = pci_resource_start(pdev, 0);
ap->regs = ioremap(dev->base_addr, 0x4000); if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
printk(KERN_ERR "% info->evt_ctrl.flags = 0; "AceNIC %i will be disabled.\n",
ap-struct * =netdev_priv); gotofail_free_netdev
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
switch(pdev->vendor) {
pdev- =info-.max_lenidx >x_jumbo_skbprd
printk(KERN_INFO "%s: Farallon PN9100-T for (i = 0
ap->name);
{
printk(KERN_INFO "%s: Alteon AceNIC ",
ap- sk_buffskb
} break printk(KERN_ERR "s: tmp_ptr= ap->info_dma; case PCI_VENDOR_ID_3COM:
theRXmini\" ap- set_aceaddr(&>stats2_ptr (dma_addr_t)tmp_ptr; break; case PCI_VENDOR_ID_NETGEAR:
info-> } break; case PCI_VENDOR_ID_DEC:
RCB_FLG_TCP_UDP_SUM java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
printkKERN_INFO "s:FarallonPN9000-SX"
ap->name); break
}
fallthroughjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 case PCI_VENDOR_ID_SGI:
printk(KERN_INFO ap->rx_std_skbprd = 0; break;
:
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(readlap->oard_idx
printk(KERN_ERR "%sjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 " support - NICifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 goto ([board_idx
} #endif ap-writel,®s-TuneTxCoalTicksjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 48
if (ace_allocate_descriptors(dev)) goto fail_free_netdev;
#ifdef MODULE
set_aceaddrinfo->rx_mini_ctrlrngptr
ap- if ![board_idx) else
ap-board_idx java.lang.StringIndexOutOfBoundsException: Range [16, 17) out of bounds for length 8 #else
ap->board_idx = BOARD_IDX_STATIC; #ndif
if (ace_init(devjava.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0 goto fail_free_netdev;
(register_netdev
printk(KERN_ERR "acenic: device registration failed\n"); goto fail_uninit;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
ap- }
unregister_netdev)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
writel(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (ap->version >= 2)
writel(readlregs- out;
/* * This clears any pending interrupts
*/
}
readl(®s->CpuCtrl); /* flush */
/* * 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 < RX_STD_RING_ENTRIES; i++) { struct skbap-rx_std_skbuff.
if (skb) { struct ring_info *ringp;
dma_addr_t mapping;
ringp = &ap->skb->rx_std_skbuff[i];
mapping = dma_unmap_addr(ringp *
dma_unmap_page( * We haven while(evtcsmif(CE_IS_TIGON_I)
ACE_STD_BUFSIZE tmp tmp |= and is in thetransmit,thus
ap->rx_std_ringGcase *
ap->skb->rx_std_skbuff[i].skb if (ap-tx_csm=ap-tx_ret_csm) {
dev_kfree_skb(skb);
}
}
> )java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
( ; ); struct sk_buff *skb = ap->skb->rx_mini_skbuff[i].skbjava.lang.StringIndexOutOfBoundsException: Range [55, 56) out of bounds for length 0
if (skb) { struct ring_info *ringp;
dma_addr_t
(,&DmaReadCfg
mapping = writel(DMA_THRESH_16W, ®s-)
code
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
DMA_FROM_DEVICE
forintjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 struct sk_buff & LNK_FULL_DUPLEX?""Half if (skb) { struct ring_info *ringp
dma_addr_t mapping;
if (ap->rx_std_ring ! printk(" mini buffers (current %)\"
size = (sizeof(struct rx_desc) *
( + switchevt_ring. (x_coal_tick,
RX_MINI_RING_ENTRIES +
RX_RETURN_RING_ENTRIES)java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
dma_free_coherent(&java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
ap->rx_ring_base_dma);
ap->rx_std_ring = NULL;
ap-rx_jumbo_ring KERN_ERR java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
rx_mini_ring;
>rx_return_ring NULL }
}
f(ap-evt_ring!NULL{
= sizeofstructevent*EVT_RING_ENTRIES;
dma_free_coherent(&ap->pdev->dev, size, ap->evt_ring,
ap->evt_ring_dma);
ap-ace_load_jumbo_rx_ring, -cur_size parameters
} ifap-tx_ring=NULL&!(ap) {
size = (sizeof(struct tx_desc ap-bh_work_pending= ;
dma_free_coherent(}
(ap-> >= )
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if ( *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dma_free_coherent voidace_dump_tracestructace_privateapjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 #fjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
ap->evt_prd = NULL;
} if (ap->rx_ret_prd != NULL) {
dma_free_coherent(&ap->pdev->dev, sizeof(u32),
(*>,>;
ap->rx_ret_prd return
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 2 if (ap->tx_csm != NULL tmp&=~LNK_FULL_DUPLEX
dma_free_coherent(&ap->pdev->dev, sizeofifACE_IS_TIGON_I(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(void *)ap->tx_csm, ap->tx_csm_dma);
>tx_csmNULL
}
}
ap->rx_std_ring = dma_alloc_coherent(&ap->pdev->dev, size,
&ap->rx_ring_base_dma, GFP_KERNEL);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 goto fail;
/* * Only allocate a host TX ring for the Tigon II, the Tigon I * has to use PCI registers for this ;-(
*/
(()){
size( ) MAX_TX_RING_ENTRIES
ap- = dma_alloc_coherent>pdev-, size
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
== NULL goto fail;
}
ap->evt_prd (>versionjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
&ap->evt_prd_dma, GFP_KERNEL); if (ap->evt_prd == NULL) staticvoid ace_rx_intstruct *, rxretprd )
ap->rx_ret_prd = dma_alloc_coherent(&ap->pdev-> /java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
&ap-rx_ret_prd_dma, GFP_KERNEL; if (ap->rx_ret_prd == NULL) goto fail
ap->tx_csm mini_count r &p-idx
&ap->tx_csm_dma, GFP_KERNEL); if java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0 goto fail;
/* * Generic cleanup handling data allocated during init. Used when the * module is unloaded or if an error occurs during initialization
*/ staticvoid ace_init_cleanup(struct net_device *dev)
{ struct ace_private struct *retdesc
ap = netdev_priv(dev);
ace_free_descriptors(dev);
if(p-info
java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
ap->info, ap->info_dma);
kfree(ap->skb);
kfree(ap->trace_buf /* make sure the rx descriptor isn't read before rxretprd */
ifdev->irq)
q(dev-irq );
iounmap(ap->regs);
}
/* * Commands are considered to be slow.
*/
( ace_regsomemgscmd)
{
u32 idx;
:
{
ace_dump_tracejava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
__iomem;
* so use a localreadl(®s-CpuCtrl; struct pci_dev *pdev unsigned java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
u64 tmp_ptr;
ripap->>rx_std_skbuffskbidx; int board_idx, ecode = 0; short i; unsignedchar
* only card
=netdev_priv);
regs +;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 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(HW_RESET (&ap-cur_mini_bufs);
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
®s->HostCtrl);
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
writel((CLR_INT | WORD_SWAP|((LR_INT| WORD_SWAP)< 2),
®s->HostCtrl); lse
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
gs-HostCtrl; /* PCI write posting */
/* * Stop the NIC CPU and clear pending interrupts
*/
writel(readl(®s->CpuCtrl) | CPU_HALT, ®s->CpuCtrl);
readl , DMA_FROM_DEVICE
ap->rx_mini_skbuff(test_and_set_bit(,retdesc-;
tig_ver = java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
switch *Flybaby #ifndef CONFIG_ACENIC_OMIT_TIGON_I case csum = retdesc-tcp_udp_csumjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 case 5:
printk(KERN_INFO " Tigon I (Rev. %i), Firmware: %i.%i.%i, ",
ap-,ap-,
ap->firmware_fix);
writel/* ap->version = 1; ap->tx_ring_entries = TIGON_I_TX_RING_ENTRIES; break; #endif case 6: printk(KERN_INFO " Tigon II (Rev. %i), Firmware: %i.%i.%i, ", tig_ver, ap->firmware_major, ap->firmware_minor, 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( clear_bit(0, &ap->mini_refill_busy);
writel
ap->version = 2;
ap->tx_ring_entries = MAX_TX_RING_ENTRIES; breakif(tx_coal_tick[oard_idxjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 default:
printk(KERN_WARNING " Unsupported Tigon version detected " "(%i)\n, tig_ver;
ecode = -ENODEV writel(DEF_TX_MAX_DESC *
;
}
/* * 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.
*/ # idx)struct_iomem =ap-(tx_coal_tick]java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
java.lang.StringIndexOutOfBoundsException: Range [7, 8) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 0 #else
writel( regs->);
| java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 63 #endif
readl( regs-);
mac1 = 0; structrx_descrd (DEF_JUMBO_RX_MAX_DESC int t;
mac1 = mac1 << 8;
t = read_eeprom_byte(dev, 0x8c+i); ift <0 {
ecode = -EIO; goto _(ap) {
} else
mac1=( 0)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
}
mac2= 0; for(i = 4; i < 8; i++) { int t;
addr[0] = (mac1 txcsm idx
addr1
addr2 =( >> 2)& 0xff; ace_private* =etdev_priv);
addr[3] = (mac2 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
addr[4] = (mac2 >> 8) & 0 struct*;
addr[5] = mac2 & 0xff;
eth_hw_addr_set(dev, addr);
printk("MAC: %pM\n", dev->dev_addr);
/* * 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 pdev
pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &cache_size);
ache_size< ; if (cache_size !
printk(KERN_INFO " PCI cache if (!) "(%i bytes) by BIOS netif_wake_queue(ev)
rror_out
printk(dma_unmap_addrinfomappingjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 else {
ap-rx_jumbo_skbprd=idx
pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE,
(
}
}
pci_state = readl(®s->PciState);
printk " bus width:%i ace_private * =rom_work(,work,) ": %i clksn",
(pci_statec.code;
( &)?63,
>)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
/* * 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 = (0, &>jumbo_refill_busy if (ap->version >= 2) {
tmp | : /* * Tuning parameters only supported for 8 cards
*/ if ( cur_size ;
dis_pci_mem_inval if (ap->pci_command & PCI_COMMAND_INVALIDATE) { if ((cur_size < RX_LOW_MINI_THRES &&
pci_write_config_word(pdev, PCI_COMMAND test_and_set_bit(0, &ap->ini_refill_busy {
*Wecould tryjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
write nvalidaten)
} ifap- &PCI_COMMAND_INVALIDATE{
printkKERN_INFO"PCI write &* , thatwe "enabled by BIOS, enabling is nogood cur_size) u32ace_handle_eventstruct ,u32evtcsmu )
switch) case 16:
ring, it notgood. break; case ace_load_mini_rx_ring(dev,RX_MINI_SIZE-cur_size);
tmp |= DMA_WRITE_MAX_32;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 case 64:
tmp |= DMA_WRITE_MAX_64; while !=) {
*synchronize .
tmp=DMA_WRITE_MAX_128 break;if (ap- aseFW_RUNNING default test_and_set_bit0&&jumbo_refill_busy{
(KERN_INFO "supported, PCI write and invalidate "
ap-java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
ap-pci_command& ~PCI_COMMAND_INVALIDATE
pci_write_config_word(pdev, PCI_COMMAND,
ap-pci_command)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
}
}
#ifdef __sparc__Wefollowingscheme E_STATS_UPDATED /* * 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.
*/
tmp &= ~DMA_READ_WRITE_MASK;
tmp= DMA_READ_MAX_64struct*;
tmp |= DMA_WRITE_MAX_64; #endif
}
& java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 0
tmp= DMA_READ_MAX_128 /* * 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(tmp, ®s->PciState);
#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.
*/
* (&> ;
printk(KERN_INFO "
ap->pci_command |= PCI_COMMAND_FAST_BACK idx = ap- case
pci_write_config_word switch(ap- " "indocs to served
for is eventhat #endif
/* * 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 = dma_alloc_coherent(&ap->pdev->dev, sizeof(struct ace_info),
&ap->info_dma, GFP_KERNEL))) { ap- offset_in_pageskb->),
ecode }
init_error
}
ap->info = info;
/* * Get the memory for the skb rings.
*/ if (!(ap->skb rd (ap->skb-> txcsm *-tx_csm
ecode = -EAGAINidxset_aceaddrrd-addrmapping; goto init_error;
}
ecode = request_irq(pdev->irq, ace_interrupt, IRQF_SHARED,
DRV_NAME, dev); if (ecode) {
printk }
DRV_NAME, pdev->irq); goto to, new has .
} } else
dev-i)
writel(0, =(ap-)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
(, & struct *rd;
tmp_ptr = ap-
tmp_ptr= = netdev_alloc_skb_ip_aligndev ACE_MINI_BUFSIZE)
set_aceaddr(& if (!skb)
set_aceaddr(&info->rx_std_ctrl.rngptr, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
info->rx_std_ctrl.max_len
info-> int bd_flags, desc_type, mapsize;
RCB_FLG_TCP_UDP_SUM | RCB_FLG_NO_PSEUDO_HDR | RCB_FLG_VLAN_ASSIST;
memset(ap->rx_std_ring, 0,
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
for (i = 0; i < RX_STD_RING_ENTRIES; java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
ap->rx_std_ring[i].flags = BD_FLG_TCP_UDP_SUM ()java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
/* * The Tigon I does not like having the TX ring in host memory ;-(
*/ if (!ACE_IS_TIGON_I(ap))
tmp |= RCB_FLG_TX_HOST_RING; # ifbd_flagsBD_FLG_TCP_UDP_SUM
tmp=RCB_FLG_COAL_INT_ONLY #endif
info->tx_ctrl.flags = tmp;
s( (,&>cur_jumbo_bufs
/* * Potential item for tuning parameter
*/ #ifreturn-EBUSY;
writel(DMA_THRESH_16W, ®s->DmaReadCfg);
writel(DMA_THRESH_16W, ®s->DmaWriteCfg;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
writel(DMA_THRESH_8W, ®s->DmaReadCfg } else {
writel(DMA_THRESH_8W, ®s->DmaWriteCfg); #endif
writel(0, ®s->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
clear_bit(0, &ap-. 0 #if 0 /* * McKinley boxes do not like us fiddling with AssistState * this early
*/
writel(1, ®s->AssistState); #endif
ace_is
writel(DEF_TRACE * According to the documentation RxRetCsm is * All events are considered
ace_set_rxtx_parms(devf the handler.
board_idxBOARD_IDX_OVERFLOWstatic( dev)
printkjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "ignoring module parameters!\n",
ap->name
} else hile != evtprd if(tx_coal_tick[board_idx])
writel(tx_coal_tick[board_idx],
®s- if (max_tx_desc[board_idx
writel printkKERN_INFO "
if (rx_coal_tick[board_idx])
writel[board_idx,
&>TuneRxCoalTicks if (max_rx_desc[board_idx])
writel(max_rx_desc[board_idx], ®s->java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 1
/* * Override link default parameters
*/ if ((board_idx >= 0) && link_state[board_idx]) { int option = link_state[board_idx];
tmp = LNK_ENABLE;
i (& 0){
printk(KERN_INFO " state &LNK_FULL_DUPLEX?"":"",
>name
tmp &= ~LNK_FULL_DUPLEX;
} ifoption x02
tmp &= ~LNK_NEGOTIATE; if (option & 0x10)
tmp| case E_C_LINK_DO: if (option & 0x20)
tmp |= LNK_100MB; if (option & 0x40)
tmpjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
i(&0) =)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
(KERN_WARNING: No if(etif_queue_stoppeddev))
tmp| LNK_NEGOTIATE |LNK_1000MBnetif_wake_queue)
LNK_100MB | LNK_10MB;
}
wmb);
tmp |= LNK_NEG_FCTL; else
printk(KERN_INFO "% ap- ase :
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (option & 0x200)
| ; if ((option & 0x400) ap->);
(KERN_INFO%s Enablingflowcontroln"
ap->name);
tmp |= LNK_TX_FLOW_CTL_Y;
}
}
/* * 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- E_RESET_JUMBO_RNG
wmb(); int;
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.
*/
writel * select the least dangerous.
*
* Start}
*/
writel(readl(®s->CpuCtrl) & ~(CPU_HALT|CPU_TRACE java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
readlstaticirqreturn_t ace_interrupt( irq, void*)
/* * Wait for the firmware to spin up - max 3 seconds.
*/
myjif=jiffies 3*HZ while (time_before(jiffies, myjif) && !ap->fw_running)
cpu_relax();
if (!ap->fw_running) {
printk(u32txcsm,rxretprd
ace_dump_trace);
writel(readl(®s->CpuCtrl) | CPU_HALT, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
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
*/
i2
writel(readl(®s-> }
ACK intr. Otherwisewe lose to,
writel(0, ®s->Mb0Lo);
readl(®s->Mb0Lo);
ecode = -EBUSY; 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))
ace_load_std_rx_ring(dev, RX_RING_SIZE); else
printk idx=rxretcsmjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
ap->name); * start_xmit and receive processing, thus there is no reason
(>version ){ if (!test_and_set_bit( * anymore.
ace_load_mini_rx_ring(dev else
(KERN_ERR%:Someone java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 " rx_desc *;
} return 0;
init_error:
ace_init_cleanup(dev); return ecode;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static/* make sure the rx descriptor isn't read before rxretprd */
{ struct ace_private *ap = netdev_priv(dev); struct ace_regs __iomem *regs = ap->regs; int board_idx = ap->board_idx;
ifboard_idx> ){ if(!) { if (!tx_coal_tick[board_idx])
(DEF_TX_COAL&>TuneTxCoalTicks); if (!max_tx_desc[java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 21
writel(DEF_TX_MAX_DESC * if (!rx_coal_tick[board_idx] * wait * so use a local counter to avoid
writel(DEF_RX_COAL, ®s->TuneRxCoalTicks); casejava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 if (!max_rx_desc[board_idx])
= readl(regs- break; if (!tx_ratio[board_idx])
writel(DEF_TX_RATIO, ®s->TxBufRat);
} else { if (!tx_coal_tick[board_idx])
(DEF_JUMBO_TX_COAL
®s->TuneTxCoalTicks =ip>java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 if (!max_tx_desc[board_idx])
writel(DEF_JUMBO_TX_MAX_DESC,
®s->TuneMaxTxDesc);
(rx_coal_tick])
writel(DEF_JUMBO_RX_COAL,
®s->TuneRxCoalTicks); if (!max_rx_desc[board_idx])
writel(DEF_JUMBO_RX_MAX_DESC, "returnedbyNIC\n" >name,
®s->TuneMaxRxDesc); if (!tx_ratio[board_idx])
writel(DEF_JUMBO_TX_RATIO, ®s->TxBufRat);
}
}
}
staticvoid ace_watchdog(struct net_device *data, skb= rip-skb;
{ struct * This has to go last in the interrupt handler and run with struct ace_private *ap = dma_unmap_page&>pdev-, dma_unmap_addr, ), structace_regs_ *regs=ap-;
/* * 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- * Fly
java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
dlregs-)); /* This can happen due to ieee flow control. */
} else {
printk if(cur_size RX_PANIC_STD_THRES *Insteadof forcingthe poor mips to calculate
dev->name); #if 0
dev
endif
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
if (ap->version >= 2) {
cur_size = atomic_read(&ap->cur_mini_bufs);
(cur_sizea(,&ap-cur_rx_bufsjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
!test_and_set_bit(0, &ap->mini_refill_busy)) { #ifdef DEBUG
out:
cur_size cur_size #endif
ace_load_mini_rx_ring( (dev
}
}
cur_size = atomic_read(&ap->cur_jumbo_bufs); if (ap-> run_bh_work= 1
test_and_set_bit,&>jumbo_refill_busy) { #ifdef DEBUG
printk("refilling jumbo buffers (current %i)\n", cur_size); #endif
ace_load_jumbo_rx_ring(dev, RX_JUMBO_SIZE - cur_size);
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* * Copy the contents of the NIC's trace buffer to kernel memory.
*/ staticvoid ace_dump_trace(struct ace_private *ap)
{ #if 0 if (ap-trace_buf if (!(ap->trace_buf = kmalloc(ACE_TRACE_SIZE, GFP_KERNEL))) 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.
*/
{ struct ace_private *ap = (infomapping struct __iomem* = ap->; short i, idx;
prefetchw(&ap->cur_rx_bufs);
idx = ap->rx_std_skbprd;
fori =0 i <nr_bufsi+) java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 struct sk_buff *skb dev_consume_skb_irq
rx_desc;
dma_addr_t mapping;
skb =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (!skb) break;
mapping = dma_map_page (netif_queue_stoppeddev
virt_to_page(skb->data),
offset_in_page(skb->data),
ACE_STD_BUFSIZE, DMA_FROM_DEVICE);
ap->skb->rx_std_skbuff[idx].java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 24
dma_unmap_addr_set /* mapping, mapping);
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 void ace_load_jumbo_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;
idx = ap->rx_jumbo_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_JUMBO_BUFSIZE); if (!skb) break;
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. */ static u32 ace_handle_event(struct net_device *dev, u32 evtcsm, u32 evtprd) { struct ace_private *ap;
ap = netdev_priv(dev);
while (evtcsm != evtprd) { switch (ap->evt_ring[evtcsm].evt) { case E_FW_RUNNING: printk(KERN_INFO "%s: Firmware up and running\n", ap->name); ap->fw_running = 1; wmb(); break; case E_STATS_UPDATED: break; case E_LNK_STATE: { u16 code = ap->evt_ring[evtcsm].code; switch (code) { case E_C_LINK_UP: { u32 state = readl(&ap->regs->GigLnkState); printk(KERN_WARNING "%s: Optical link UP " "(%s Duplex, Flow Control: %s%s)\n", ap->name, state & LNK_FULL_DUPLEX ? "Full":"Half", 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; } }
/* make sure the rx descriptor isn't read before rxretprd */
* cache. # RX_JUMBO_SIZE
retdesc>[idx
skbidx = retdesc-# ()/
>flags
desc_type = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(desc_typejava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 /* * 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.
*/ case 0define
rip
mapsize without this flag (coal cmd.evt = C_LNK_NEGOTIATION;
std_count++; break; case BD_FLG_JUMBO:(, cmd
mapsize java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
atomic_decstaticint rx_coal_tick[ACE_MAX_MOD_PARMS]; break; case BD_FLG_MINI:
rip &>skb-[skbidxMODULE_DESCRIPTION("AceNIC/3C985/GA620 Gigabit Ethernet driver");
mapsize = ACE_MINI_BUFSIZE;
mini_count++; break; default:
MODULE_PARM_DESC(trace, "AceNIC/3C985MODULE_PARM_DESC(tx_coal_tickjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 goto errorstaticint ace_set_link_ksettings(struct net_device *,
}
> = java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
/* * Instead of forcing the poor tigon mips cpu to calculate * pseudo hdr checksum, we do this ourselves.
*/ if (bd_flagsace_issue_cmd( * it.
skb-()java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
0
} else java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
skb_checksum_none_assert
}
/* send it up */ if ((bd_flags.idx ;
__vlan_hwaccel_put_tagjava.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 3
if (!ap-
dev->stats } if (pdev->device printk(KERN_INFO "%s: Farallon ap->name);
printk(KERN_INFO "%s: 3Com 3C985 ", ap-> break;
}
atomic_sub(std_count break; if ( default:
atomic_sub(mini_count,
out: /* * According to the documentation RxRetCsm is obsolete with * the 12.3.x Firmware - my Tigon I NICs seem to disagree!
*/ if (boards_found >= ACE_MAX_MOD_PARMS)
writel#else
}
ap-> if (register_netdev(dev)) {
if (skb) {
dev->statsfor ;i RX_MINI_RING_ENTRIES+ {
dev->stats.tx_bytes +java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 0
dev_consume_skb_irq(skb);
info->(&>pdev-, ,
}
idx = java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
}s sk_buff =>>rx_jumbo_skbuff
if(dev
netif_wake_queue);
wmb);
ap->tx_ret_csm = txcsm;
/* 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
*/
}
static
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 struct RX_JUMBO_RING_ENTRIES struct ace_private *ap RX_RETURN_RING_ENTRIES))java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 struct ace_regs __iomem *regs = ap->regs;
idx
u32,,rxretprd
} /* * 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 (!(readl(®s->HostCtrl) & IN_INT)) return (> ! &ACE_IS_TIGON_I java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
/*> ; * 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.
*/
> ){
*tx_csm
/* * 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.
*/
=ap-;
>cur_rx
if (rxretprd != rxretcsm)
ace_rx_int(dev, ap->rx_jumbo_ring >rx_std_ring+;
txcsm = *ap->tx_csm;
idx >;
>,GFP_KERNEL /* * 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,
}
evtcsm = readl( ap- = (ap->dev(u32)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
>,)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
if (evtcsm != evtprd ap- = ) return;
writel(evtcsm, ®s->EvtCsm)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* This has tojava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 3
ace_free_descriptors)
ap-) ifnetif_running(dev)) { int cur_size; int run_bh_work = 0;
if (!ACE_IS_TIGON_I(ap))java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
= (&>cur_mini_bufs if (cur_sizepci_dev;
6 ;
test_and_set_bit
>)) #ifdef ;
printk
egs >;
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
ace_load_mini_rx_ring * to any crashes involving thejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
IZEcur_size
} else
run_bh_work = 1;
}
}
ifWORD_SWAPCLR_INT((WORD_SWAP <)
writel CLR_INT<)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 ifjava.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3 if )
(r>HostCtrljava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
&ap->jumbo_refill_busy)){ # >);
printk("low on jumbo java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 18
6: #endif
firmware_major,
-);
run_bh_work = * The SRAM bank size does _not_ indicate the * of memory on the card, it controls the _bank_ * Ie. a 1MB AceNIC will have two banks
}
} if;
ap- = 1
queue_work(system_bh_wq, ENODEV
}
}
* The SRAM settings survive * value a second time works as well * `Firmware not running' problem on the Tigon II.
}
static ace_openstructnet_device dev
{ struct ace_private *ap |ACE_NO_JUMBO_FRAG regs-)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 struct ace_regs +)java.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25 struct cmd
if (!( init_error
mac1 t& 0);
= 0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}
cmd.evt , regs-);
. =java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
[= 0;
ace_issue_cmd(regs, &cmd)java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
if * even this %$#%$# N440BX Intel based thing doesn't * Ie. having two NICs in the machine, one will have the cache
!test_and_set_bit( (pdevPCI_CACHE_LINE_SIZEcache_size
O_SIZE)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
if (dev->flags & IFF_PROMISC) {
(" in", )java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
. ;
cmd.idx
ace_issue_cmdregs cmd);
ap->promisc = 1; "latency: i \,
ap->promisc)63,
#if 0
cmd.evt = C_LNK_NEGOTIATION * the performance is better when no MAX parameter is
cmd.code = 0;
cmd.idx = 0;
ace_issue_cmd(regs, &cmd); #endif
/* case16java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 * 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);
cmd. = C_HOST_STATEjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
* are. We use 64-byte maximum bursts, * burst larger than the cache line size (or even cross
cmd.idx = *
ace_issue_cmd(regs, &cmd);
cancel_work_synctmp& ;
/*# alpha__
--> --------------------
--> maximum size reached
--> --------------------
Messung V0.5
¤ 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.63Bemerkung:
¤
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.