aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-04-27Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-0/+1
Conflicts: drivers/net/e100.c drivers/net/e1000e/netdev.c
2010-04-26tg3: Fix INTx fallback when MSI failsAndre Detsch1-0/+1
tg3: Fix INTx fallback when MSI fails MSI setup changes the value of irq_vec in struct tg3 *tp. This attribute must be taken into account and restored before we try to do a new request_irq for INTx fallback. In powerpc, the original code was leading to an EINVAL return within request_irq, because the driver was trying to use the disabled MSI virtual irq number instead of tp->pdev->irq. Signed-off-by: Andre Detsch <adetsch@br.ibm.com> Acked-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-20tg3: Enable GRO by default.David S. Miller1-0/+1
This was merely an oversight when I added the *_gro_receive() calls. Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-13tg3: use the DMA state API instead of the pci equivalentsFUJITA Tomonori1-21/+21
This replace the PCI DMA state API (include/linux/pci-dma.h) with the DMA equivalents since the PCI DMA state API will be obsolete. No functional change. For further information about the background: http://marc.info/?l=linux-netdev&m=127037540020276&w=2 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Matt Carlson <mcarlson@broadcom.com> Cc: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-13tg3: Update version to 3.110Matt Carlson1-2/+2
This patch updates the tg3 version to 3.110. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-13tg3: Remove function errors flagged by checkpatchMatt Carlson1-9/+9
This patch removes the following checkpatch errors: * return is not a function, parentheses are not required * space prohibited between function name and open parenthesis '(' Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-13tg3: Unify max pkt size preprocessor constantsMatt Carlson1-2/+2
The maximum packet size that gets programmed into the standard producer ring control block is directly related to the packet size used to allocate packet buffers. This patch removes the redundant preprocessor constant. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-13tg3: Re-inline VLAN tags when appropriateMatt Carlson1-11/+33
The tg3 driver is written so that VLAN tagged packets can be accepted, even if CONFIG_VLAN_8021Q or CONFIG_VLAN_8021Q_MODULE is not defined. (Think raw interfaces.) If the device has ASF support enabled, the firmware requires the driver to enable VLAN tag stripping. If VLAN tagging is not explicitly supported by the kernel and ASF is enabled, the driver will have to reinject the VLAN tag back into the packet stream. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-13tg3: Optimize rx double copy testMatt Carlson1-7/+25
On a PCIX bus, the 5701 has a bug which requires the driver to double copy all rx packets. The rx code uses the rx_offset device member as a flag to determine if this workaround should take effect. The following patch will modify the rx_offset member such that this test will become less clear. The patch starts by integrating the workaround check into the packet length check. It rounds out the implementation by relaxing the workaround restrictions if the platform has efficient unaligned accesses. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-13tg3: Reduce 57765 core clock when link at 10MbpsMatt Carlson1-0/+5
This patch reduces the core clock to 6.25MHz when operating at 10Mbps link speed. This is needed to prevent a bug that will ultimately cause transmits to cease. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-13tg3: Set card 57765 card reader MRRS to 1024BMatt Carlson1-0/+2
This patch sets the Maximum Read Request Size for the card reader function to 1024 bytes to prevent an SD controller lockup. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-13tg3: Disable CLKREQ in L2Matt Carlson1-0/+14
This patch disables CLKREQ in L2 to workaround a chipset bug. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-06tg3: Update version to 3.109Matt Carlson1-2/+2
This patch updates the tg3 version to 3.109. 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>
2010-04-06tg3: Remove tg3_dump_state()Matt Carlson1-233/+0
The tg3_dump_state() function is commented out and doesn't get used much when debugging efforts are underway. The chip architecture has also changed enough that any debugging effort that might use it would have to tailor it to the capabilities of the hardware. This patch just removes the function entirely. 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>
2010-04-06tg3: Cleanup if codestyleMatt Carlson1-44/+31
This patch cleans up the code style as it pertains to if statements. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-06tg3: The case of switchesMatt Carlson1-40/+40
This patch fixes checkpatch errors related to switch statements. 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>
2010-04-06tg3: Whitespace, constant, and comment updatesMatt Carlson1-35/+37
This patch fixes whitespace errors, preprocessor definition placement oddities and updates comments. 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>
2010-04-06tg3: Use VPD fw version when presentMatt Carlson1-4/+30
This patch extracts the firmware version from the VPD area and changes the code to prefer that version version over the manually extracted version. 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>
2010-04-06tg3: Prepare FW version code for VPD versioningMatt Carlson1-16/+23
The code that extracts the firmware version from the device's NVRAM assumes the firmware version member is a clean slate. The following patch will add code to extract the firmware version from the VPD area of NVRAM, so this assumption will no longer be true. This patch adjusts the versioning code to respect the VPD version if it exists. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-06tg3: Fix message 80 char violationsMatt Carlson1-22/+38
Commit 05dbe005386e7521153dce6c5ad95c98b73b80c7, "Use (pr|netdev)_<level> macro helpers" extended some of the message lines longer than 80 chars. This patch reels the line lengths back in. 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>
2010-04-06tg3: netdev_err() => dev_err()Matt Carlson1-13/+19
Some uses of netdev_err() happen before the device has been registered. This will cause the messages to be prepended with "(unregistered net_device)" strings. We can clean up the message by using dev_err() instead. 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>
2010-04-06tg3: Replace pr_err with sensible alternativesMatt Carlson1-20/+26
All the instances of pr_err() in the tg3 driver have better alternatives. This patch replaces all pr_err() calls. 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>
2010-04-06tg3: Restore likely() check in tg3_poll_msix()Matt Carlson1-2/+2
When creating the new tg3_poll_msix() function, the likely() compiler hint was dropped. This patch reintroduces it. 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>
2010-04-03net: convert multicast list to list_headJiri Pirko1-3/+3
Converts the list and the core manipulating with it to be the same as uc_list. +uses two functions for adding/removing mc address (normal and "global" variant) instead of a function parameter. +removes dev_mcast.c completely. +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for manipulation with lists on a sandbox (used in bonding and 80211 drivers) Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-13drivers/net/tg3.c: change the field used with the TG3_FLAG_10_100_ONLY constantJulia Lawall1-1/+1
The constant TG3_FLAG_10_100_ONLY should be used with the tg3_flags field, not the tg3_flags2 field, as done elsewhere in the same file. Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-10tg3: Fix tg3_poll_controller() passing wrong pointer to tg3_interrupt()Louis Rilling1-1/+1
Commit 09943a1819a240ff4a72f924d0038818fcdd0a90 Author: Matt Carlson <mcarlson@broadcom.com> Date: Fri Aug 28 14:01:57 2009 +0000 tg3: Convert ISR parameter to tnapi forgot to update tg3_poll_controller(), leading to intermittent crashes with netpoll. Fix this. Signed-off-by: Louis Rilling <louis.rilling@kerlabs.com> Cc: stable@kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-28tg3: Remove now useless VPD codeMatt Carlson1-29/+23
Now that the VPD searching code is abstracted away, the outer loop used to detect the read-only large resource data type section is useless. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-28pci: Add helper to search for VPD keywordsMatt Carlson1-19/+13
This patch adds the pci_vpd_find_info_keyword() helper function to find information field keywords within read-only and read-write large resource data type sections. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-28pci: Add VPD information field helper functionsMatt Carlson1-3/+4
This patch adds a preprocessor constant to describe the PCI VPD information field header size and an inline function to extract the size of the information field itself. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-28pci: Add helper to find a VPD resource data typeMatt Carlson1-21/+5
This patch adds the pci_vpd_find_tag() helper function to find VPD resource data types in a buffer. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-28pci: Add large and small resource data type codeMatt Carlson1-6/+17
This patch introduces more VPD preprocessor definitions to identify some small and large resource data type item names. The patch then continues to correct how the tg3 and bnx2 drivers search for the "read-only data" large resource data type. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-28pci: Add PCI LRDT tag size and section sizeMatt Carlson1-7/+6
This patch adds a preprocessor constant to describe the PCI VPD large resource data type tag size and an inline function to extract the large resource section size from the large resource data type tag. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-26net: convert multiple drivers to use netdev_for_each_mc_addr, part6Jiri Pirko1-4/+1
Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-18drivers/net/tg3.c: Use (pr|netdev)_<level> macro helpersJoe Perches1-161/+109
Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt Remove #define PFX Use pr_<level> Use netdev_<level> Remove periods from most formats Coalesce long formats Use printk_once Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-17tg3: Update version to 3.108Matt Carlson1-2/+2
This patch updates the tg3 version to 3.108. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-17tg3: Push phylib definitions to phylibMatt Carlson1-16/+16
This patch pushes phylib definitions out to phylib headers. For phy IDs, this removes some code duplication. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-17tg3: Rename tg3 phy ID preprocessor definitionsMatt Carlson1-61/+61
The phylib presents the phy ID in a different format than the one tg3 has traditionally used. To highlight the distinction, this patch prepends the tg3 native phy ID format with TG3. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-17tg3: Reformat SSID to phy ID tableMatt Carlson1-29/+55
This patch reformats the SSID to phy ID table, replacing constants with preprocessor definitions. This patch is also prep work for the following patch, which will push line lengths beyond 80 chars. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-17tg3: Discover phy address onceMatt Carlson1-11/+11
The phy address will not change after it has been identified. Move the discovery code to a location that only gets executed once. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-17tg3: Reduce indent level of tg3_rx_prodring_allocMatt Carlson1-24/+24
This patch adds an inverted "jumbo ring enable" test and jumps to the exit if it succeeds. The change reduces the indent level of the remaining code making it more readable. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-17tg3: Rename TG3_FLG3_RGMII_STD_IBND_DISABLEMatt Carlson1-6/+6
The STD part of this preprocessor definition is a bit of a misnomer. This flag is a coarse control of the RGMII inband status facilities. This patch renames the definition to be more accurate. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-17tg3: Add more partno entries for fallback pathMatt Carlson1-1/+17
This patch adds 57765 asic partno entries for the path executed if VPD is not present in NVRAM. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-17tg3: Allow phylib flowctrl changes anytimeMatt Carlson1-42/+52
This patch loosens the restriction that the phylib interface must be up and running to change the flow control parameters. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-17tg3: Add support for 2 new selfboot formatsMatt Carlson1-0/+6
This patch adds new offsets to the bootcode version extraction code to support NVRAM format versions 4 and 5. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-17tg3: Make 57791 and 57795 10/100 onlyMatt Carlson1-0/+2
This patch adds the 57791 and 57795 to the list of devices that only support 10 and 100 Mbps speeds. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-17tg3: Enforce DMA mapping / skb assignment orderingMatt Carlson1-2/+7
Michael Chan noted that there is nothing in the code that would prevent the compiler from delaying the access of the "mapping" member of the newly arrived packet until much later. If this happened after the skb = NULL assignment, it is possible for the driver to pass a bad dma_addr value to pci_unmap_single(). To enforce this ordering, we need a write memory barrier. The pairing read memory barrier already exists in tg3_rx_prodring_xfer() under the comments starting with "Ensure that updates to the...". 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>
2010-02-12tg3: Update driver version to 3.107Matt Carlson1-2/+2
This patch updates the tg3 version to 3.107. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-12tg3: Fix AC131 loopback test errors for 5785Matt Carlson1-2/+6
The AC131 does not enable the forced transmit clock settings immediately. The workaround is to read the register again to get the setting to take effect. 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>
2010-02-12tg3: Fix napi assignments in loopback testMatt Carlson1-4/+4
The 57765 lacks TSS support. This renders the napi assignments incorrect in the loopback test function. This patch fixes the problem. 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>
2010-02-12tg3: Reset phy during bringup when using phylibMatt Carlson1-2/+1
The driver puts the phy into low-power mode when it releases the device. If the device were to be reacquired, the phy needs a reset to bring it back to full powered operation. This patch allows phylib-enabled devices to reset the phy. 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>