aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2008-06-19bnx2: Update driver version to 1.7.7.Michael Chan1-3/+3
And update module description. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-06-19bnx2: Cleanup error handling in bnx2_open().Michael Chan1-23/+14
All error handling in bnx2_open() can be consolidated. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-06-19bnx2: Turn on multi rx rings.Michael Chan1-16/+55
Enable multiple rx rings if MSI-X vectors are available. We enable up to 7 rx rings. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-06-19bnx2: Use one handler for all MSI-X vectors.Michael Chan1-59/+40
Use the same MSI-X handler to schedule NAPI. Change the dev_instance void pointer to the bnx2_napi struct instead so we can have the proper context for each MSI-X vector. Add a new bnx2_poll_msix() that is optimized for handling MSI-X NAPI polling of rx/tx work only. Remove the old bnx2_tx_poll() that is no longer needed. Each MSI-X vector handles 1 tx and 1 rx ring. The first vector handles link events as well. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-06-19bnx2: Optimize fast-path tx and rx work.Michael Chan1-41/+66
Add hw_tx_cons_ptr and hw_rx_cons_ptr to speed up the retreival of the tx and rx consumer index, since the MSI-X and default status blocks have different structures. Combine status_blk and status_blk_msix into a union. We'll only use one type of status block for each vector. Separate the code to detect more rx and tx work from the code to detect link related work. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-06-19bnx2: Put rx ring variables in a separate struct.Michael Chan1-155/+235
In preparation for multi-ring support, rx ring variables are now put in a separate bnx2_rx_ring_info struct. With MSI-X, we can support multiple rx rings. The functions to allocate/free rx memory and to initialize rx rings are now modified to handle multiple rings. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-06-19bnx2: Put tx ring variables in a separate struct.Michael Chan1-113/+181
In preparation for multi-ring support, tx ring variables are now put in a separate bnx2_tx_ring_info struct. Multi tx ring will not be enabled until it is fully supported by the stack. Only 1 tx ring will be used at the moment. The functions to allocate/free tx memory and to initialize tx rings are now modified to handle multiple rings. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-06-13Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-8/+1
Conflicts: drivers/net/smc911x.c
2008-06-12net: Eliminate flush_scheduled_work() calls while RTNL is held.David S. Miller1-8/+1
If the RTNL is held when we invoke flush_scheduled_work() we could deadlock. One such case is linkwatch, it is a work struct which tries to grab the RTNL semaphore. The most common case are net driver ->stop() methods. The simplest conversion is to instead use cancel_{delayed_}work_sync() explicitly on the various work struct the driver uses. This is an OK transformation because these work structs are doing things like resetting the chip, restarting link negotiation, and so forth. And if we're bringing down the device, we're about to turn the chip off and reset it anways. So if we cancel a pending work event, that's fine here. Some drivers were working around this deadlock by using a msleep() polling loop of some sort, and those cases are converted to instead use cancel_{delayed_}work_sync() as well. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-16bnx2: Update version to 1.7.6.Michael Chan1-2/+2
Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-16bnx2: Pre-initialize struct cpu_reg.Benjamin Li1-72/+6
Instead of assigning values for the struct cpu_reg's at runtime, we already know these values at compile time. Therefore, we can use designated initializers, to initialize these structures and not have to incur this assignment cost at run-time. Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-16bnx2: Rename RX_COPY_THRESH to BNX2_RX_COPY_THRESH.Benjamin Li1-4/+5
To make the bnx2 code more consistent, all instances of RX_COPY_THRESH have been changed to BNX2_RX_COPY_THRESH. Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-16bnx2: Remove the rx_offset field from the bnx2 structure.Benjamin Li1-10/+9
The rx_offset field is set to a constant value and initialized only once. By replacing all references to the rx_offset field, we can eliminate rx_offset from the bnx2 structure. This will save 4 bytes for every bnx2 instance. [Added parentheses to the definition of BNX2_RX_OFFSET, as noted by Ben Hutchings.] Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-16bnx2: Add EEH PCI recovery.Wendy Xiong1-0/+88
Add PCI recovery functions to the driver. The initial pci state is also saved so the the MSI state can be restored during PCI recovery. Signed-off-by: Wendy Xiong <wendyx@us.ibm.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-16bnx2: Allow phy reset to be skipped during chip reset.Michael Chan1-23/+27
Andy Gospodarek <andy@greyhouse.net> found that netconsole would panic when resetting bnx2 devices. >From Andy: "The issue is the bnx2_set_link in bnx2_init_nic will print a link-status message before we are fully initialized and ready to start polling. Polling is currently disabled in this state, but since the __LINK_STATE_RX_SCHED is overloaded to not only try and disable polling but also to make the system aware there is something waiting to be polled, we really have to fix this in drivers. The problematic call is the one to netif_rx_complete as it tries to remove an entry from the poll_list when there isn't one." While this netconsole problem should be fixed separately, we really should not reset the PHY when changing ring sizes, MTU, or other similar settings. The PHY reset causes several seconds of unnecessary link disruptions. Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-02bnx2: Update version to 1.7.5.Michael Chan1-2/+2
Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-02bnx2: Update RV2P firmware for 5709.Michael Chan1-0/+6
The new RV2P firmware fixes 2 issues: 1. The jumbo rx buffer page size is now configurable and set to the proper PAGE_SIZE. Before, it was assumed to be always 4K. 2. Driver sometimes would crash when receiving jumbo packets mixed with firmware management packets. This was caused by the old firmware DMA'ing to the wrong address. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-02bnx2: Zero out context memory for 5709.Michael Chan1-0/+5
We should zero out the context memory for 5709 before each reset. When we resume after suspend for example, the memory may not be zero and the chip may not function correctly. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-02bnx2: Fix register test on 5709.Michael Chan1-1/+1
The register BNX2_CTX_STATUS (0x1004) should be skipped on 5709 as it contains reserved bits. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-02bnx2: Fix remote PHY initial link state.Michael Chan1-7/+2
On some remote PHY blade systems, the driver receives no initial link interrupt. As a result, the GMII/MII MAC mode does not get setup properly. To fix this problem, we add an initial poll of the link state after chip reset. With this change, the setting of the initial carrier state in the init code can be eliminated. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-02bnx2: Refine remote PHY locking.Michael Chan1-6/+5
bnx2_set_remote_link() should be called under bp->phy_lock to protect against concurrent polling and interrupt calls. This change is needed by the next patch which will add one initial poll of the remote PHY link status. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-01net: fix returning void-valued expression warningsHarvey Harrison1-2/+4
drivers/net/8390.c:37:2: warning: returning void-valued expression drivers/net/bnx2.c:1635:3: warning: returning void-valued expression drivers/net/xen-netfront.c:1806:2: warning: returning void-valued expression net/ipv4/tcp_hybla.c:105:3: warning: returning void-valued expression net/ipv4/tcp_vegas.c:171:3: warning: returning void-valued expression net/ipv4/tcp_veno.c:123:3: warning: returning void-valued expression net/sysctl_net.c:85:2: warning: returning void-valued expression Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-23[BNX2]: Update version to 1.7.4.Michael Chan1-2/+2
Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-23[BNX2]: Disable parallel detect on an HP blade.Michael Chan1-1/+13
Because of some board issues, we need to disable parallel detect on an HP blade. Without this patch, the link state can become stuck when it goes into parallel detect mode. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-23[BNX2]: More 5706S link down workaround.Michael Chan1-15/+17
The previous patches to workaround the 5706S on an HP blade were not sufficient. The link state still does not change properly in some cases. This patch adds polling to make it completely reliable. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-09bnx2: section fixAndrew Morton1-2/+2
gcc-3.4.4 on powerpc: drivers/net/bnx2.c:67: error: version causes a section type conflict Cc: Jeff Garzik <jeff@garzik.org> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-31[BNX2]: Fix ASYM PAUSE advertisement for remote PHY.Michael Chan1-1/+1
We were checking for the ASYM_PAUSE bit for 1000Base-X twice instead checking for both the 1000Base-X bit and the 10/100/1000Base-T bit. The purpose of the logic is to tell the firmware that ASYM_PAUSE is set on either the Serdes or Copper interface. Problem was discovered by Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-31[BNX2]: Update version to 1.7.3.Michael Chan1-2/+2
Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-31[BNX2]: Fine-tune flow control on 5709.Michael Chan1-5/+46
Make use of the programmable high/low water marks in 5709 for 802.3 flow control. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-31[BNX2]: Remove CTX_WR macro.Michael Chan1-13/+14
The CTX_WR macro is unnecessary and obfuscates the code. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-31[BNX2]: Remove REG_WR_IND/REG_RD_IND macros.Michael Chan1-55/+65
The REG_WR_IND/REG_RD_IND macros are unnecessary and obfuscate the code. Many callers to these macros read and write shared memory from the bp->shmem_base, so we add 2 similar functions that automatically add the shared memory base. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-31[BNX2]: Refine tx coalescing setup.Michael Chan1-3/+6
Make the tx coalescing setup code independent of the MSIX vector. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-31[BNX2]: Fix 5706 serdes link down bug.Michael Chan1-1/+1
1. Correct the MII expansion serdes control register definition. 2. Check an additional RUDI_INVALID bit when determining 5706S link. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28bnx2 annotationsAl Viro1-12/+10
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28[BNX2]: Fix driver phy_flags name space.Michael Chan1-72/+74
Prefix "bp->phy_flags" names with BNX2_PHY_FLAG_* for consistency. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[BNX2]: Fix driver software flag namespace.David S. Miller1-46/+46
Prefix "bnx2->flags" names with BNX2_* for consistency. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[BNX2] Update version to 1.7.2.Michael Chan1-3/+3
Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[BNX2]: Add link-down workaround on 5706 serdes.Michael Chan1-16/+80
In some blade systems using the 5706 serdes, the hardware sometimes does not properly generate link down interrupts. We add a workaround in the driver's timer to force a link-down when some PHY registers report loss of SYNC. The parallel detect logic is cleaned up slightly to better integrate the workaround. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[BNX2]: Fix minor bug in bnx2_has_work().Michael Chan1-2/+1
It is more correct to get the status block from the bnx2_napi struct instead of the bnx2 struct. It happens that they are the same in this case because we are using the first MSIX vector. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[BNX2]: Disable jumbo rx paging on 5709 Ax.Michael Chan1-1/+3
The chip has problem running in this mode and needs to be disabled. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28NULL noise in drivers/netAl Viro1-2/+2
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>
2008-01-28[BNX2]: Fix compiler warning.Michael Chan1-1/+1
Change bnx2_init_napi() to void. Warning was noted by DaveM. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[BNX2]: Update version to 1.7.1.Michael Chan1-2/+2
Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[BNX2]: Enable new tx ring.Michael Chan1-7/+80
Enable new tx ring and add new MSIX handler and NAPI poll function for the new tx ring. Enable MSIX when the hardware supports it. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[BNX2]: Add support for a new tx ring.Michael Chan1-18/+60
To separate TX IRQs into a different MSIX vector, we need to support a new tx ring. The original tx ring will still be used when not using MSIX. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[BNX2]: Support multiple MSIX IRQs.Michael Chan1-36/+125
Change bnx2_napi struct into an array and add code to manage multiple IRQs. MSIX hardware structures and new registers are also added. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[BNX2]: Move rx indexes into bnx2_napi struct.Michael Chan1-49/+56
Rx related fields used in NAPI polling are moved from the main bnx2 struct to the bnx2_napi struct. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[BNX2]: Move tx indexes into bnx2_napi struct.Michael Chan1-14/+17
Tx related fields used in NAPI polling are moved from the main bnx2 struct to the bnx2_napi struct. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[BNX2]: Introduce new bnx2_napi structure.Michael Chan1-57/+89
Introduce a bnx2_napi structure that will hold a napi_struct and other fields to handle NAPI polling for the napi_struct. Various tx and rx indexes and status block pointers will be moved from the main bnx2 structure to this bnx2_napi structure. Most NAPI path functions are modified to be passed this bnx2_napi struct pointer. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28[BNX2]: Restructure IRQ datastructures.Michael Chan1-22/+33
Add a table to keep track of multiple IRQs and restructure the IRQ request and free functions so that they can be easily expanded to handle multiple IRQs. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>