aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/tg3.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2011-12-08tg3: Update version to 3.122Matt Carlson1-2/+2
This patch updates the tg3 version to 3.122. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-08tg3: Return flowctrl config through ethtoolMatt Carlson1-2/+2
This patch changes the driver to return the flow control configuration rather than the flow control status through the ETHTOOL_GPAUSEPARAM ioctl. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-08tg3: Track LP advertisingMatt Carlson1-3/+37
This patch adds code to track the autonegotiation advertisements of the link partner and report them through ethtool. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-08tg3: Integrate flowctrl check into AN adv checkMatt Carlson1-56/+25
This patch integrates tg3_adv_1000T_flowctrl_ok() into tg3_copper_is_advertising_all() and renames the function tg3_phy_copper_an_config_ok(). Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-08tg3: Save stats across chip resetsMatt Carlson1-9/+17
Tg3 has a place to store stats, but doesn't really use it. This patch modifies the driver so that stats are saved across chip resets and gets cleared across close / open calls. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-08tg3: Remove ethtool stats member from dev structMatt Carlson1-7/+7
This patch removes the ethtool stats member from the tg3 device structure. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-29tg3: Support for byte queue limitsTom Herbert1-0/+8
Changes to tg3 to use byte queue limits. Signed-off-by: Tom Herbert <therbert@google.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-28tg3: Scale back code that modifies MRRSMatt Carlson1-17/+10
Tg3 normally gets a performance boost by increasing the PCI Maximum Read Request Size (MRRS) to 4k. Unfortunately, this is causing some problems on particular hardware platforms. This patch removes all code that modifies the MRRS except for one case. As part of a solution to fix an internal FIFO problem on the 5719, the driver artificially capped the MRRS to 2k for the entire 5719, and later 5720, ASIC revs. This was overly aggressive and only really needed to be done for the 5719 A0. In the spirit of the rest of this patch, the driver will only reprogram the MRRS for this device if the value exceeds the 2k cap. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-28tg3: Fix TSO CAP for 5704 devs w / ASF enabledMatt Carlson1-2/+12
On the earliest TSO capable devices, TSO was accomplished through firmware. The TSO cannot coexist with ASF management firmware though. The tg3 driver determines whether or not ASF is enabled by calling tg3_get_eeprom_hw_cfg(), which checks a particular bit of NIC memory. Commit dabc5c670d3f86d15ee4f42ab38ec5bd2682487d, entitled "tg3: Move TSO_CAPABLE assignment", accidentally moved the code that determines TSO capabilities earlier than the call to tg3_get_eeprom_hw_cfg(). As a consequence, the driver was attempting to determine TSO capabilities before it had all the data it needed to make the decision. This patch fixes the problem by revisiting and reevaluating the decision after tg3_get_eeprom_hw_cfg() is called. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-22tg3: Add MDI-X reportingMatt Carlson1-1/+23
This patch adds MDI-X state reporting. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-22tg3: Restrict large prod ring cap devicesMatt Carlson1-5/+4
Future devices may or may not be capable of supporting larger rx producer rings. This patch changes the code so that this flag is set on an ASIC rev to ASIC rev basis. Also, this patch changes a place where the LRG_PROD_RING_CAP flag was not controlling how the rx standard producer ring size was set. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-22tg3: Adjust BD replenish thresholdsMatt Carlson1-5/+3
The BD replenish thresholds for the 57765 and newer ASIC revs are a little strict. They were tuned for a mode that is currently unused. This patch relaxes the thresholds so that they are set to values more inline with the resources available. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-22tg3: Make 1000Base-X FC resolution look like 1000TMatt Carlson1-12/+6
This patch changes tg3's 1000Base-X flow control resolution to look like the 1000Base-T flow control resolution code. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-22tg3: Fix advertisement handlingHiroaki SHIMODA1-4/+3
Commit 28011cf19b (net: Add ethtool to mii advertisment conversion helpers) added a helper function ethtool_adv_to_mii_100bt() and tg3_copper_is_advertising_all(), tg3_phy_autoneg_cfg() were modified to use this. Before that commit, ethtool to mii advertisement conversion was done wrt speed, but now pause operation is also taken account. So, in tg3_copper_is_advertising_all(), below condition becomes true and this makes link up fails. if ((adv_reg & ADVERTISE_ALL) != all_mask) return 0; To fix this add ADVERTISE_ALL bit and operation to cap speed, and change default advertisement not including ADVERTISED_Pause. Reported-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-21tg3: switch to build_skb() infrastructureEric Dumazet1-54/+61
This is very similar to bnx2x conversion, but simpler since no special alignement is required, so goal was not to reduce skb truesize. Using build_skb() reduces cache line misses in the driver, since we use cache hot skb instead of cold ones. Number of in-flight sk_buff structures is lower, they are more likely recycled in SLUB caches while still hot. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> CC: Matt Carlson <mcarlson@broadcom.com> CC: Michael Chan <mchan@broadcom.com> CC: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-21net: Change mii to ethtool advertisement function namesMatt Carlson1-5/+5
This patch implements advice by Ben Hutchings to change the mii side of the function names to look more like the register whose values they convert. New LPA translation functions have been added as well. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-16net: Add ethtool to mii advertisment conversion helpersMatt Carlson1-40/+13
Translating between ethtool advertisement settings and MII advertisements are common operations for ethernet drivers. This patch adds a set of helper functions that implements the conversion. The patch then modifies a couple of the drivers to use the new functions. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-16net: introduce and use netdev_features_t for device features setsMichał Mirosław1-5/+6
v2: add couple missing conversions in drivers split unexporting netdev_fix_features() implemented %pNF convert sock::sk_route_(no?)caps Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-08sweep the floors and convert some .get_drvinfo routines to strlcpyRick Jones1-4/+4
Per the mention made by Ben Hutchings that strlcpy is now the preferred string copy routine for a .get_drvinfo routine, do a bit of floor sweeping and convert some of the as-yet unconverted ethernet drivers to it. Signed-off-by: Rick Jones <rick.jones2@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-04tg3: Update version to 3.121Matt Carlson1-2/+2
This patch updates the tg3 version to 3.121. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-04tg3: Eliminate timer race with reset_taskMatt Carlson1-12/+2
During shutdown, it is impossible to reliably disable the timer and reset_task threads. Each thread can schedule the other, which leads to shutdown code that chases its tail. To fix the problem, this patch removes the ability of tg3_reset_task to schedule a new timer thread. To support this change, tg3_timer no longer terminates itself, but rather goes into a polling mode. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-04tg3: Schedule at most one tg3_reset_task runMatt Carlson1-9/+24
It is possible for multiple threads in the tg3 driver to each attempt to schedule a run of tg3_reset_task(). The multiple tg3_reset_task executions could all wind up on the same queue (and execute serially) or wind up on the queues of another processor (which could execute in parallel). Either scenario is not what was truly desired. This patch adds a new flag, TG3_FLAG_RESET_TASK_PENDING, and uses it to determine whether or not to schedule another run of tg3_reset_task(). With the new flag comes two new functions to facilitate scheduling and descheduling of tg3_reset_task(). Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-04tg3: Obtain PCI function number from deviceMatt Carlson1-6/+24
This patch adds code to attempt to obtain the PCI function number from the device rather than accept the number handed by the kernel. In pass-through scenarios, the function number handed by the kernel may not reflect the true function of the device. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-04tg3: Fix irq alloc error cleanup pathMatt Carlson1-5/+4
This patch fixes a bug where the irq error cleanup path did not free all the resources it allocated. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Ben Li <benli@broadcom.com> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-04tg3: Fix 4k skb error recovery pathMatt Carlson1-8/+8
On the error recovery resource unwind path, it is possible for the driver to attempt to unmap a fragment that hadn't been mapped. This patch fixes the problem by correcting the "last" parameter supplied. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-04tg3: Fix 4k tx bd segmentation codeMatt Carlson1-23/+24
The new 4k tx bd segmentation code had a bug in the error cleanup path. If the driver did not map all the physical fragments, the abort path would wind up advancing the producer index beyond the point where the setup code stopped. This would ultimately turn into a tx recovery error where the driver would expect the skb pointer to be set when it isn't. This patch fixes the problem, and then makes the code a little easier to understand. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-04tg3: Fix APE mutex init and useMatt Carlson1-21/+23
APE mutex register blocks are shared by all ports of multiport devices. For some mutexing purposes, each function is assigned their own register. For other cases, each function is assigned its own request and grant bits of a single register. For the latter cases, the tg3 driver is incorrectly allowing each function to use the same set of grant / request bits. This patch fixes the code so that each function uses the appropriate bitset. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-24|PATCH net-next] tg3: add tx_dropped counterEric Dumazet1-12/+11
If a frame cant be transmitted, it is silently discarded. Add a counter to report these errors to user. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-24Merge branch 'master' of ra.kernel.org:/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-5/+5
2011-10-19net: add skb frag size accessorsEric Dumazet1-4/+4
To ease skb->truesize sanitization, its better to be able to localize all references to skb frags size. Define accessors : skb_frag_size() to fetch frag size, and skb_frag_size_{set|add|sub}() to manipulate it. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-07net: Remove unnecessary driver assignments of ethtool_ringparam fields to zeroRick Jones1-2/+0
Per comments from Ben Hutchings on a previous patch, sweep the floors a little removing unnecessary assignments of zero to fields of struct ethtool_ringparam in driver code supporting ethtool -g. Signed-off-by: Rick Jones <rick.jones2@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-06net: use DMA_x_DEVICE and dma_mapping_error with skb_frag_dma_mapIan Campbell1-2/+2
When I converted some drivers from pci_map_page to skb_frag_dma_map I neglected to convert PCI_DMA_xDEVICE into DMA_x_DEVICE and pci_dma_mapping_error into dma_mapping_error. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-22Merge branch 'master' of github.com:davem330/netDavid S. Miller1-2/+0
Conflicts: MAINTAINERS drivers/net/Kconfig drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c drivers/net/ethernet/broadcom/tg3.c drivers/net/wireless/iwlwifi/iwl-pci.c drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c drivers/net/wireless/rt2x00/rt2800usb.c drivers/net/wireless/wl12xx/main.c
2011-09-15tg3: Code movementMatt Carlson1-8/+9
This patch just moves some code around for better organization. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-15tg3: Eliminate tg3_halt_cpu() prototypeMatt Carlson1-221/+222
This patch moves the implementatino of tg3_halt_cpu() earlier in the file to eliminate its prototype. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-15tg3: Eliminate tg3_write_sig_post_reset() prototypeMatt Carlson1-230/+228
This patch moves the implementation of tg3_write_sig_post_reset() earlier to eliminate its prototype. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-15tg3: Eliminate tg3_stop_fw() prototypeMatt Carlson1-18/+16
This patch moves tg3_stop_fw() earlier in the file to eliminate its prototype. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-15tg3: Add ability to turn off 1shot MSIMatt Carlson1-2/+6
In older devices, 1-shot MSI mode had to be enabled by the code. In newer devices however, 1-shot MSI mode is enabled by default; code would be needed to disable it. Disabling 1-shot MSI mode is useful when debugging. This patch changes the code so that the TG3_FLAG_1SHOT_MSI accurately reflects (and controls) the state of 1-shot MSI mode. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-15tg3: Remove tp->rx_offset term when unneededMatt Carlson1-2/+8
This patch removes the tp->rx_offset term if NET_IP_ALIGN is defined to zero. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-15tg3: Fix missed MSI workaroundMatt Carlson1-3/+2
This patch fixes a minor counter initialization bug and makes the MSI workaround slightly more efficient by attempting to service pending interrupts before applying the workaround. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-15tg3: Check all adv bits when checking configMatt Carlson1-2/+4
This patch makes sure the driver checks all advertisement bits when checking the current hw advertisements. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-26tg3: convert to SKB paged frag API.Ian Campbell1-4/+2
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Matt Carlson <mcarlson@broadcom.com> Cc: Michael Chan <mchan@broadcom.com> Cc: netdev@vger.kernel.org Cc: devicetree-discuss@lists.ozlabs.org Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-20tg3: Update version to 3.120Matt Carlson1-2/+2
This patch updates the tg3 version to 3.120. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-20tg3: Add external loopback support to selftestMatt Carlson1-10/+87
This patch adds external loopback support to tg3's ethtool selftest. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-20tg3: Restructure tg3_test_loopbackMatt Carlson1-40/+40
The tg3_test_loopback() function is starting to get more complicated as more loopback tests are added. This patch cleans up the code. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-20tg3: Pull phy int lpbk setup into separate funcMatt Carlson1-59/+90
This patch pulls out the internal phy loopback setup code into a separate function. This cleans up the loopback test code and makes it available for NETIF_F_LOOPBACK support later. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-20tg3: Consilidate MAC loopback codeMatt Carlson1-40/+51
The driver puts the device into MAC loopback in two places in the driver. This patch consolidates the code into a single routine. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-20tg3: Remove dead codeMatt Carlson1-34/+1
Now that CPMU devices don't do MAC loopback, all the CPMU power saving mode adjustments are unneeded. This patch removes the dead code. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-17net: remove use of ndo_set_multicast_list in driversJiri Pirko1-1/+1
replace it by ndo_set_rx_mode Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-10broadcom: Move the Broadcom driversJeff Kirsher1-0/+15862
Moves the drivers for Broadcom devices into drivers/net/ethernet/broadcom/ and the necessary Kconfig and Makefile changes. CC: Eilon Greenstein <eilong@broadcom.com> CC: Michael Chan <mchan@broadcom.com> CC: Matt Carlson <mcarlson@broadcom.com> CC: Gary Zambrano <zambrano@broadcom.com> CC: "Maciej W. Rozycki" <macro@linux-mips.org> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>