aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/tg3.c
AgeCommit message (Collapse)Author
2009-08-29tg3: Clarify rx buffer relationshipsMatt Carlson
This patch attempts to document the various rx buffer sizes used by the driver and how they relate to each other. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29tg3: Move the JUMBO_CAPABLE and SUPPORT_MSI flagsMatt Carlson
This patch moves where the jumbo capable and msi support flags are located. This is prep work for the addition of msix support flags. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29tg3: Break out mini producer ring handlingMatt Carlson
This patch separates the code that sets up the mini producer ring from the code that sets up the jumbo producer rings. The 5717 asic rev devices do not have a mini ring, but do have a jumbo frame implementation similar to the 5704 and previous devices. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29tg3: Reformat NVRAM case statementsMatt Carlson
This patch fixes up the NVRAM detection switch statements to conform to the kernel coding style. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29tg3: Add new 5785 10/100 only device IDMatt Carlson
This patch adds a new device ID for those 5785 devices that will only use 10/100 phys. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29tg3: Delay mdio bus init until fw finishesMatt Carlson
The device firmware uses the MDIO bus during early setup. If the driver modifies the MDIO bus configuration while it is in use by the firmware, any number of bad things can happen. This patch delays MDIO setup until after the firmware posts its magic signature, signifying initialization is complete. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-26tg3: Update version to 3.100Matt Carlson
This patch updates the tg3 version to 3.100. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-26tg3: Convert code to use PHY_IS_FETMatt Carlson
This patch converts the code to use the PHY_IS_FET flag rather than the ASIC revision to decide whether or not to use FET paths. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-26tg3: Create MII_TG3_FET namespaceMatt Carlson
Broadcom's phys come in two distinctly different register layouts. For the lack of an official term to distinguish between the two formats, we can loosely categorize them by their fast ethernet or gigabit ethernet transceiver description. This patch creates the (driver-internal) Fast Ethernet Transceiver (FET) namespace and converts the 5906 EPHY definitions over. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-26tg3: Tune 5785 clock switchingMatt Carlson
This patch tunes the timeouts the CPMU uses to decide when to switch from the clocks output by the PHY to internal clock sources. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-26tg3: Add 57788, remove 57720Matt Carlson
This patch adds support for the 57788 and removes support for the 57720 which was never released. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-26tg3: Preserve PCIe MPS setting for new devsMatt Carlson
Most older tg3 devices only supported a PCIe maximum payload size of 128 bytes. More recent devices bump this limit up to 256 bytes though. This patch modifies the code so that the MPS limit is only enforced on those devices that only allow the 128 byte setting. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-26tg3: Fix TSO test against wrong flags varMatt Carlson
Julia Lawall discovered that the TG3_FLG2_TSO_CAPABLE flag was being compared against the wrong flags device member. This patch implements the fix. Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-26tg3: Prevent tx BD corruptionMatt Carlson
This patch prevents a tx BD corruption bug by preventing the device from powering down the PLL from L1 if the link speed is 10Mbps or 100Mbps. The same bits are also used to prevent a system hang during chip reset resulting from a complicated set of events that ultimately leads to PCIe block register corruption. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-26tg3: Fix 57780 asic rev PCIe link receiver errorsMatt Carlson
This patch fixes some PCIe link receiver errors by decreasing the internal electrical idle timeout. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-08net: skb_shared_info optimizationEric Dumazet
skb_dma_unmap() is quite expensive for small packets, because we use two different cache lines from skb_shared_info. One to access nr_frags, one to access dma_maps[0] Instead of dma_maps being an array of MAX_SKB_FRAGS + 1 elements, let dma_head alone in a new dma_head field, close to nr_frags, to reduce cache lines misses. Tested on my dev machine (bnx2 & tg3 adapters), nice speedup ! Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-29net: dont update dev->trans_startEric Dumazet
Second round of drivers for Gb cards (and NIU one I forgot in the 10GB round) Now that core network takes care of trans_start updates, dont do it in drivers themselves, if possible. Drivers can avoid one cache miss (on dev->trans_start) in their start_xmit() handler. Exceptions are NETIF_F_LLTX drivers Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-21tg3: Update version to 3.99Matt Carlson
This patch updates the tg3 version to 3.99. 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>
2009-04-21tg3: Restore LAA sooner in shutdown sequenceMatt Carlson
After a shutdown reset, the LAA needs to be restored before posting the post-reset signature in shared memory. If the LAA is not restored before then, the bootcode will assume the factory default MAC address and WOL will not work with the LAA. 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>
2009-04-21tg3: Limit CLKREQ fix to A[01] of 57780 asic revMatt Carlson
This patch restricts the CLKREQ bugfix to the A0 and A1 revisions of 57780 ASIC rev chips. 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>
2009-04-21tg3: Allow 5761 WOL and LED fixes to 5761S tooMatt Carlson
The 5761 WOL and LED fixes used the PCI device ID to as the activation key. The 5761S requires the same process. 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>
2009-04-21tg3: Prevent send BD corruptionMatt Carlson
On rare occasions, send BD corruptions can occur. This patch fixes the problem by increasing the L1 entry threshold to 4 milliseconds. 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>
2009-04-21tg3: Handle NVRAM absent casesMatt Carlson
Some 57780 ASIC revision parts do not have NVRAM. Code the driver so that it is tolerant of this configuration. 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>
2009-04-21tg3: Allow screaming interrupt detectionMatt Carlson
The tg3 driver's ISR is coded to accept interrupts as its own if the status block tag does not equal the last tag the driver has seen. The last_tag field is updated from tg3_poll. In a screaming interrupt situation from another device sharing tg3's IRQ, tg3_poll does not get a chance to be called, so the last_tag will always be out of sync with the status block tag. Consequently, the driver will continually declare the screaming interrupts as its own, thus thwarting the screaming interrupt detection logic. This patch solves the problem by creating a new last_irq_tag member and recording the status block tag in the ISR. The ISR then checks the last_irq_tag for interrupt ownership. Many thanks to John Marvin for the detailed bug report and analysis and Michael Chan for the bugfix. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Tested-by: John Marvin <jsm@fc.hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-20tg3: Fix SEEPROM accessesMatt Carlson
The recent NVRAM patches sanitized how the driver deals with NVRAM data, but they failed to bring the SEEPROM interfaces inline with the new strategy. This patch brings the SEEPROM interfaces up to date. This patch also reverts commit 0d489ffb76de0fe804cf06a9d4d11fa7342d74b9 ("tg3: fix big endian MAC address collection failure"). Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Tested-by: Robin Holt <holt@sgi.com> Tested-by: James Bottomley <james.bottomley@HansenPartnership.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-13tg3: fix big endian MAC address collection failureJames Bottomley
We noticed on parisc that our broadcoms all swapped MAC addresses going from 2.6.29 to 2.6.30-rc1: Apr 11 07:48:24 ion kernel: eth0: Tigon3 [partno(BCM95700A6) rev 0105] (PCI:66MHz:64-bit) MAC address 00:30:6e:4b:15:59 Apr 13 07:34:34 ion kernel: eth0: Tigon3 [partno(BCM95700A6) rev 0105] (PCI:66MHz:64-bit) MAC address 00:00:59:15:4b:6e The problem patch is: commit 6d348f2c1e0bb1cf7a494b51fc921095ead3f6ae Author: Matt Carlson <mcarlson@broadcom.com> Date: Wed Feb 25 14:25:52 2009 +0000 tg3: Eliminate tg3_nvram_read_swab() With the root cause being the use of memcpy to set the mac address: memcpy(&dev->dev_addr[0], ((char *)&hi) + 2, 2); memcpy(&dev->dev_addr[2], (char *)&lo, sizeof(lo)); This might work on little endian machines, but it can't on big endian ones. You have to use the original setting mechanism to be correct on all architectures. The attached patch fixes parisc. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-07dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)Yang Hongyang
Replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-07dma-mapping: replace all DMA_40BIT_MASK macro with DMA_BIT_MASK(40)Yang Hongyang
Replace all DMA_40BIT_MASK macro with DMA_BIT_MASK(40) Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-07dma-mapping: replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64)Yang Hongyang
Replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64) Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-03Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (28 commits) trivial: Update my email address trivial: NULL noise: drivers/mtd/tests/mtd_*test.c trivial: NULL noise: drivers/media/dvb/frontends/drx397xD_fw.h trivial: Fix misspelling of "Celsius". trivial: remove unused variable 'path' in alloc_file() trivial: fix a pdlfush -> pdflush typo in comment trivial: jbd header comment typo fix for JBD_PARANOID_IOFAIL trivial: wusb: Storage class should be before const qualifier trivial: drivers/char/bsr.c: Storage class should be before const qualifier trivial: h8300: Storage class should be before const qualifier trivial: fix where cgroup documentation is not correctly referred to trivial: Give the right path in Documentation example trivial: MTD: remove EOL from MODULE_DESCRIPTION trivial: Fix typo in bio_split()'s documentation trivial: PWM: fix of #endif comment trivial: fix typos/grammar errors in Kconfig texts trivial: Fix misspelling of firmware trivial: cgroups: documentation typo and spelling corrections trivial: Update contact info for Jochen Hein trivial: fix typo "resgister" -> "register" ...
2009-03-30trivial: Fix misspelling of firmwareNick Andrew
Fix misspelling of firmware. Signed-off-by: Nick Andrew <nick@nick-andrew.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-29tg3: Add GRO support.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-26tg3: Update copyright and versionMatt Carlson
This patch updates the copyright to 2009 and updates the version number to 3.98. 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>
2009-02-26tg3: Add version reporting for hardware selfbootMatt Carlson
This patch adds version reporting for hardware selfboot. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> 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>
2009-02-26tg3: Add DASH firmware version reportingMatt Carlson
This patch adds code to report the DASH firmware version. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> 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>
2009-02-26tg3: Add legacy bootcode version decodingMatt Carlson
This patch adds code to obtain the bootcode version for versions of bootcode that do not use the new method. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> 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>
2009-02-26tg3: Refactor firmware version routinesMatt Carlson
This patch reorganizes the firmware version routines in preparation for the following patches. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> 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>
2009-02-26tg3: Eliminate tg3_nvram_read_swab()Matt Carlson
The remaining uses of tg3_nvram_read_swab() either intended to read the data from NVRAM exactly as tg3_nvram_read_be32() did or hide deeper interpretations of the data. For the former case, a direct replacement of tg3_nvram_read_swab() with tg3_nvram_read_be32() is in order. For the latter case, we remove tg3_nvram_read_swab() and document what the code is really doing. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> 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>
2009-02-26tg3: Correct NVRAM stream endian notationsMatt Carlson
Any software requesting NVRAM data as it exists on NVRAM is necessarily requesting that the results be returned as a bytestream. A bytestream data read in from the device can also be thought to be in big endian format. Therefore, all the LE notations in the driver are mislabeled. This patch converts all LE notations to BE notations, carefully evaluating the surrounding code in the process. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> 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>
2009-02-26tg3: Invert nvram_read() and nvram_read_swab()Matt Carlson
This patch removes the blind byteswap of NVRAM data as it is read in. To preserve the logic at the call sites, this patch also inverts every call to tg3_nvram_read() and tg3_nvram_read_swab(). The call swap gets confusing within tg3_nvram_read_le() (LE is a misnomer), but the reader should be able to convince himself / herself that the resulting behavior is still unchanged. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> 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>
2009-02-26tg3: Eliminate nvram routine forward declarationsMatt Carlson
This patch moves all NVRAM routines earlier in the source file to eliminate forward declarations. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> 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>
2009-02-26tg3: Refine tg3_vlan_rx_register()Matt Carlson
tg3_vlan_rx_register() touches the hardware if netif_running() returns false. This patch fixes the problem. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> 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>
2009-02-26tg3: Update ethtool set_settings error checksMatt Carlson
The ethtool interface has acquired some new enumerations since the tg3 driver's tg3_set_settings() error checking code was written. The error checking code is no longer complete. This patch rewrites the error checking so that it is future-proofed. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> 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>
2009-02-26tg3: Drop non-VLAN rx pkts larger than the MTUMatt Carlson
The hardware's MTU is configured so that it will accept packets whose VLAN tag is left inline. This means that the hardware will also accept other packets larger than the desired MTU size. This patch checks for and discards packets that are larger than the requested MTU but are not VLAN tagged frames. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> 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>
2009-02-26tg3: Fix 5906 link problemsMatt Carlson
Commit 6833c043f9fc03696fde623914c4a0277df2a0bc introduced the phy auto-powerdown capability. While the APD feature only works for 5761 and 5784 asic revisions, the (harmless portion of the) code was applied to all 5705 and newer devices. However, the 5906 phy departs from the usual design. This commit was interfering with the 5906's ability to negotiate link against some switches. This patch corrects the problem. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> 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>
2009-02-24Merge branch 'master' of /home/davem/src/GIT/linux-2.6/David S. Miller
2009-02-18TG3: &&/|| confusionRoel Kluin
phyid Can't be both TG3_PHY_OUI_1 and TG3_PHY_OUI_2 and TG3_PHY_OUI_3. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-14Merge branch 'master' of /home/davem/src/GIT/linux-2.6/David S. Miller
Conflicts: drivers/net/wireless/iwlwifi/iwl-agn.c drivers/net/wireless/iwlwifi/iwl3945-base.c
2009-02-12TG3: limit reaches -1Roel Kluin
With while (limit--) { ... } limit reaches -1, so 0 means success. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21tg3: remove extra castingFrancois Romieu
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: David S. Miller <davem@davemloft.net>