summaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_main.c
Commit message (Collapse)AuthorAgeFilesLines
* [netdrvr] netxen: fix netxen_pci_tbl[] breakageAl Viro2008-06-271-7/+11
| | | | | | | | | | PCI_DEVICE_CLASS sets .device and .vendor to PCI_ANY_DEV, which overrides the effect of preceding PCI_DEVICE() and makes all elements of netxen_pci_tbl[] identical. Introduced in the commit dcd56fdbaeae1008044687b973c4a3e852e8a726. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* netxen: download firmware in pci probeDhananjay Phadke2008-06-171-55/+10
| | | | | | | | | | Downloading firmware in pci probe allows recovery in case of firmware failure by reloading the driver. Also reduced delays in firmware load. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* netxen: cleanup debug messagesDhananjay Phadke2008-06-171-35/+25
| | | | | | | | | o Remove unnecessary debug prints and functions. o Explicitly specify pci class (0x020000) to avoid enabling management function. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* netxen: remove global physical_port arrayDhananjay Phadke2008-06-171-3/+1
| | | | | | | Store physical port number in netxen_adapter structure. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* netxen: fix portnum for hp mezz cardsDhananjay Phadke2008-06-171-2/+8
| | | | | | | | This fixes a the issue where logical port number is set incorrectly for HP blade mezz cards. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* make netxen_workq staticAdrian Bunk2008-04-161-1/+18
| | | | | | | netxen_workq can now become static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* netxen, phy/marvell, skge: minor checkpatch fixesJeff Garzik2008-03-251-2/+1
| | | | Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* netxen: remove low level tx lockDhananjay Phadke2008-03-251-73/+22
| | | | | | | | | | | | | | | | o eliminate tx lock in netxen adapter struct, instead pound on netdev tx lock appropriately. o remove old "concurrent transmit" code that unnecessarily drops and reacquires tx lock in hard_xmit_frame(), this is already serialized the netdev xmit lock. o reduce scope of tx lock in tx cleanup. tx cleanup operates on different section of the ring than transmitting cpus and is guarded by producer and consumer indices. This fixes a race caused by rx softirq preemption on realtime kernels. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Tested-by: Vernon Mauery <mauery@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* netxen: napi and irq cleanupDhananjay Phadke2008-03-251-74/+39
| | | | | | | | | | | | | | | | o separate and simpler irq handler for msi interrupts, avoids few checks than legacy mode. o avoid redudant tx_has_work() and rx_has_work() checks in interrupt and napi, which can uncork irq based on racy (lockless) access to tx and rx ring indices. If we get interrupt, there's sufficient reason to schedule napi. o replenish rx ring more often, remove self-imposed threshold rcv_free that prevents posting rx desc to card. This improves performance in low memory. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Tested-by: Vernon Mauery <mauery@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* netxen: improve msi supportDhananjay Phadke2008-03-251-33/+23
| | | | | | | | | | | | Recent netxen firmware has new scheme of generating MSI interrupts, it raises interrupt and blocks itself, waiting for driver to unmask. This reduces chance of spurious interrupts. The driver will be able to deal with older firmware as well. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Tested-by: Vernon Mauery <mauery@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* annotate netxenAl Viro2008-01-281-1/+1
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* NULL noise in drivers/netAl Viro2008-01-281-3/+3
| | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* [netdrvr] netxen: checkpatch fixes (98% trim trailing whitespace)Jeff Garzik2008-01-281-10/+10
| | | | Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* drivers/net/netxen: Add missing "space"Joe Perches2008-01-281-3/+3
| | | | | Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* drivers/net/netxen/: cleanupsAdrian Bunk2008-01-281-5/+4
| | | | | | | | | | This patch contains the following cleanups: - static functions in .c files shouldn't be marked inline - make needlessly global code static - #if 0 unused code Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* netxen: fix byte-swapping in tx and rxDhananjay Phadke2008-01-121-9/+1
| | | | | | | | | | | | | | | Here's the reworked patch. This cleans up some unnecessary byte-swapping while setting up tx and interpreting rx desc. The 64 bit rx status data should be converted to host endian format only once and the macros just need to extract bitfields. This saves a spate of interrupts on pseries blades caused by buggy (non) processing rx status ring. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* netxen: optimize tx handlingdhananjay@netxen.com2008-01-121-31/+21
| | | | | | | | | | | | | netxen driver allows limited number of threads simultaneously posting skb's in tx ring. If transmit slot is unavailable, driver calls schedule() or loops in xmit_frame(). This patch returns TX_BUSY and lets the stack reschedule the packet if transmit slot is unavailable. Also removes unnecessary check for tx timeout in the driver itself, the network stack does that anyway. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* netxen: stop second phy correctlydhananjay@netxen.com2008-01-121-5/+3
| | | | | | | | | This patch fixes bug that doesn't quiesce second port when interface is brought down, which could lead to unwarranted interrupt during rmmod / ifdown. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [NETXEN]: Fix ->poll() done logic.David S. Miller2008-01-081-1/+1
| | | | | | | If work_done >= budget we should always elide the NAPI completion. Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETDRVR] lib82596, netxen: delete pointless tests from irq handlerJeff Garzik2007-10-231-9/+2
| | | | | | | | Remove always-false tests in irq handler. Also a few other minor cleanups. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* unify DMA_..BIT_MASK definitions: v3.1Borislav Petkov2007-10-181-3/+0
| | | | | | | | | | | | | | | | Remove redundant DMA_..BIT_MASK definitions across two drivers. The computation of the majority of the bitmasks is done by the compiler. The initial split of the patch touching each a different file got removed due to possible git bisect breakage. Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Muli Ben-Yehuda <muli@il.ibm.com> Cc: Jeff Garzik <jeff@garzik.org> Cc: James Bottomley <James.Bottomley@steeleye.com> Reviewed-by: Satyam Sharma <satyam@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* netxen: ethtool fixesDhananjay Phadke2007-10-101-0/+1
| | | | | | | | | | | Resubmitting the patch. This patch improves ethtool support for printing correct ring statistics, segmentation offload status, etc. Signed-off by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()Joe Perches2007-10-101-9/+4
| | | | | | | This is nicer than the MAC_FMT stuff. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NET]: Nuke SET_MODULE_OWNER macro.Ralf Baechle2007-10-101-1/+0
| | | | | | | | | | | | It's been a useless no-op for long enough in 2.6 so I figured it's time to remove it. The number of people that could object because they're maintaining unified 2.4 and 2.6 drivers is probably rather small. [ Handled drivers added by netdev tree and some missed IRDA cases... -DaveM ] Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* [PATCH] drivers/net: remove superfluous memsetMariusz Kozlowski2007-10-101-1/+0
| | | | | | | | | | | | | | | | | | This patch covers something like this: dev = alloc_*dev(... ... priv = netdev_priv(dev); memset(priv, 0, sizeof(*priv)); The memset() here is superfluous. alloc_netdev() uses kzalloc() to allocate needed memory so there is no need to zero the priv region twice. Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* Clean up duplicate includes in drivers/net/Jesper Juhl2007-10-101-1/+0
| | | | | | | | | | This patch cleans up duplicate includes in drivers/net/ Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: "John W. Linville" <linville@tuxdriver.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [NET]: Make NAPI polling independent of struct net_device objects.Stephen Hemminger2007-10-101-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several devices have multiple independant RX queues per net device, and some have a single interrupt doorbell for several queues. In either case, it's easier to support layouts like that if the structure representing the poll is independant from the net device itself. The signature of the ->poll() call back goes from: int foo_poll(struct net_device *dev, int *budget) to int foo_poll(struct napi_struct *napi, int budget) The caller is returned the number of RX packets processed (or the number of "NAPI credits" consumed if you want to get abstract). The callee no longer messes around bumping dev->quota, *budget, etc. because that is all handled in the caller upon return. The napi_struct is to be embedded in the device driver private data structures. Furthermore, it is the driver's responsibility to disable all NAPI instances in it's ->stop() device close handler. Since the napi_struct is privatized into the driver's private data structures, only the driver knows how to get at all of the napi_struct instances it may have per-device. With lots of help and suggestions from Rusty Russell, Roland Dreier, Michael Chan, Jeff Garzik, and Jamal Hadi Salim. Bug fixes from Thomas Graf, Roland Dreier, Peter Zijlstra, Joseph Fannin, Scott Wood, Hans J. Koch, and Michael Chan. [ Ported to current tree and all drivers converted. Integrated Stephen's follow-on kerneldoc additions, and restored poll_list handling to the old style to fix mutual exclusion issues. -DaveM ] Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: fix crashes during module unloaddhananjay@netxen.com2007-08-311-8/+7
| | | | | | | | | | | This patch fixes two problems during driver unload. The pci_disable_device() call is before firmware reload, causing reads and writes across PCI bus after disabling device. Second problem is the register window was wrong during firmware reload Signed-off by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* netxen: Avoid firmware load in PCI probedhananjay@netxen.com2007-08-311-4/+0
| | | | | | | | | | | Loading firmware during PCI probe can lead to incorrect initialization, rendering the card unusable until next reboot. This was introduced a while ago as a workaround for firmware bug, a better workaround was submitted for this a while ago. So removing original hack that loads firmware during probe. Signed-off by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* netxen: drop redudant spinlockDhananjay Phadke2007-07-301-4/+0
| | | | | | | | | | Some leftover code that makes use of adapter->lock in tx_timeout function, which resets the interface under this lock. In close() when the workqueue is flushed, prints the warning about sleeping with interrupts disabled (when spinlock debug is enabled). The lock was required with private netxen IOCTLs, which were removed a while ago. Signed-off-by: Jeff Garzik <jeff@garzik.org>
* netxen: Fix interrupt handling for multiport adaptersdhananjay@netxen.com2007-07-301-17/+19
| | | | | | | | | This patch fixes masking of interrupts on multiport adapters. Also disables interrupts upon ifdown interface. The wrong mask could result in interrupt flood after interface is down. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* netxen: re-init station address after h/w initdhananjay@netxen.com2007-07-301-2/+2
| | | | | | | | | This is a workaround for firmware bug with 2nd port of multiport adapter, where MAC address is reset. Driver just needs to overwrite it with the value read from PROM. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* netxen: Load firmware during probe, dma watchdog fix.dhananjay@netxen.com2007-07-241-24/+24
| | | | | | | | | | | | | The firmware should be loaded after resetting hardware during PCI probe, besides module unload. This fixes issue with 2nd port of multiport adapter on powerpc blades. This patch also fixes a bug that PCI resources are not freed if dma watchdog shutdown failed. The dma watchdog poll messages during module unload are also suppressed. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Milan Bag <mbag@netxen.com> Signed-off-by: Wen Xiong <wenxiong@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* PCI: Change all drivers to use pci_device->revisionAuke Kok2007-07-111-5/+2
| | | | | | | | | | | | | | | | | | | | Instead of all drivers reading pci config space to get the revision ID, they can now use the pci_device->revision member. This exposes some issues where drivers where reading a word or a dword for the revision number, and adding useless error-handling around the read. Some drivers even just read it for no purpose of all. In devices where the revision ID is being copied over and used in what appears to be the equivalent of hotpath, I have left the copy code and the cached copy as not to influence the driver's performance. Compile tested with make all{yes,mod}config on x86_64 and i386. Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com> Acked-by: Dave Jones <davej@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* netxen: deinline and sparse fixStephen Hemminger2007-07-101-0/+97
| | | | | | | | | | | Get rid of dubious casts to (void *) which causes a sparse warning. And move largeish function from inline to the one file that uses the code, the compiler can then decide to inline it. Compile tested only. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* RESEND [PATCH 3/3] NetXen: Graceful teardown of interface and hardware upon ↵Dhananjay Phadke2007-07-021-42/+86
| | | | | | | | | | | | | | | module unload Resending patch 3/3 only. These changes allow driver close routine to be called during module unload, to clean-up buffers and other software resources, flush queues etc. Also, hardware is reset to pristine state. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Milan Bag <mbag@netxen.com> Signed-off-by: Wen Xiong <wenxiong@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* RESEND [PATCH 2/3] NetXen: Support per PCI-function interrupt mask registersdhananjay.phadke@gmail.com2007-07-021-13/+17
| | | | | | | | | | | | This patch updates the various access routines to access different control and status settings present in different register locations. This will fix problems related to working of different ports in multi Port card. Signed-off by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off by: Milan Bag <mbag@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* RESEND [PATCH 1/3] NetXen: Fix issue of MSI not working correctlydhananjay.phadke@gmail.com2007-07-021-16/+13
| | | | | | | | | | | NetXen driver uses PCI function 0 to provide the functionality of MSI. The patch makes driver check the bus master bit for function 0 and enable it after the card initialization. Signed-off-by: Dhananjay Phadke<dhananjay@netxen.com> Signed-off-by: Milan Bag <mbag@netxen.com> Signed-off-by: Wen Xiong <wenxiong@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* NetXen: Fix ping issue after reboot on Blades with 3.4.19 firmwareMithlesh Thukral2007-06-091-0/+7
| | | | | | | | | | | | | | | | | | NetXen: Fix initialization and subsequent ping issue on 3.4.19 firmware This patch fixes the ping problem seen X/PBlades after the adapter's firmware was moved to 3.4.19. After configured interface up, ping failed. NetXen adapter couldn't accept ARP broadcast packet. Manual addition of MAC address in the ARP table, made ping work. NetXen adapter should finish initilization after system boot. But looks NetXen adapter didn't initilization correctly after system boot up. So have to re-load the firmware again in probe routine. Also re-initilization netxen_config_0 and netxen_config_1 registers. Signed-off by: Wen Xiong <wenxiong@us.ibm.com> Signed-off by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* NetXen: Removal of extra free_irq callMithlesh Thukral2007-06-031-2/+0
| | | | | | | | | | NetXen: Removal of redundant free_irq This patch removes a redundant free_irq() call from remove() routine. This will also eliminate a warning during unload of driver. Signed-by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* netxen_nic_main don't use deprecated irq flagsAndrew Morton2007-05-111-1/+1
| | | | | | | | | | drivers/net/netxen/netxen_nic_main.c: In function 'netxen_nic_open': drivers/net/netxen/netxen_nic_main.c:738: warning: 'deprecated_irq_flag' is deprecated (declared at include/linux/interrupt.h:66) drivers/net/netxen/netxen_nic_main.c:738: warning: 'deprecated_irq_flag' is deprecated (declared at include/linux/interrupt.h:66) Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* NetXen: Port swap feature for multi port cardsMithlesh Thukral2007-04-281-118/+188
| | | | | | | | | | | | NetXen: Port Swap feature This patch will allow a port numbers on the card to be swapped in host driver. This feature is applicable to cards having more than 1 port. Signed-off by: Milan Bag <mbag@netxen.com> Signed-off by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* NetXen: Multi PCI support for Quad cardsMithlesh Thukral2007-04-281-29/+32
| | | | | | | | | | NetXen: Fix the multi PCI function for cards with more than 2 ports. This patch fixes the working of multi PCI capable driver on cards with more than 2 ports by adding the addresses for their rings and sizes. Signed-off by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* NetXen: Removal of redundant argument passingMithlesh Thukral2007-04-281-10/+22
| | | | | | | | | NetXen: Removal of redundant function call parameters and bug fixes. This patch will remove the redundant paramters which were being passed to many functions since now adapter->portnum can be used. Signed-off-by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* NetXen: Use multiple PCI functionsMithlesh Thukral2007-04-281-257/+269
| | | | | | | | | | | | NetXen: Make driver use multiple PCI functions. This patch will make NetXen driver work with multiple PCI functions. This will make the usage of memory resources as well as interrupts more independent among different functions which results in better throughput. This change has been done after the multiport support is added in firmware. Signed-off by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [SK_BUFF]: Introduce skb_copy_from_linear_data{_offset}Arnaldo Carvalho de Melo2007-04-251-2/+4
| | | | | | | To clearly state the intent of copying from linear sk_buffs, _offset being a overly long variant but interesting for the sake of saving some bytes. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* [TCP]: Introduce tcp_hdrlen() and tcp_optlen()Arnaldo Carvalho de Melo2007-04-251-1/+1
| | | | | | | | | | | | The ip_hdrlen() buddy, created to reduce the number of skb->h.th-> uses and to avoid the longer, open coded equivalent. Ditched a no-op in bnx2 in the process. I wonder if we should have a BUG_ON(skb->h.th->doff < 5) in tcp_optlen()... Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [IP]: Introduce ip_hdrlen()Arnaldo Carvalho de Melo2007-04-251-3/+3
| | | | | | | | | | | | | | | | For the common sequence "skb->nh.iph->ihl * 4", removing a good number of open coded skb->nh.iph uses, now to go after the rest... Just out of curiosity, here are the idioms found to get the same result: skb->nh.iph->ihl << 2 skb->nh.iph->ihl<<2 skb->nh.iph->ihl * 4 skb->nh.iph->ihl*4 (skb->nh.iph)->ihl * sizeof(u32) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* NetXen: Fix second rmmod failure observed on PowerPC machines.Linsys Contractor Mithlesh Thukral2007-03-021-5/+4
| | | | | | Signed-off by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* NetXen: Updates, removal of unsupported features and minor bug fixes.Linsys Contractor Mithlesh Thukral2007-03-021-2/+2
| | | | | Signed-off-by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>