summaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
Commit message (Collapse)AuthorAgeFilesLines
* [SPARC64]: Convert sparc64 PCI layer to in-kernel device tree.David S. Miller2006-06-231-4/+6
| | | | | | | | One thing this change pointed out was that we really should pull the "get 'local-mac-address' property" logic into a helper function all the network drivers can call. Signed-off-by: David S. Miller <davem@davemloft.net>
* [NET]: Merge TSO/UFO fields in sk_buffHerbert Xu2006-06-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Having separate fields in sk_buff for TSO/UFO (tso_size/ufo_size) is not going to scale if we add any more segmentation methods (e.g., DCCP). So let's merge them. They were used to tell the protocol of a packet. This function has been subsumed by the new gso_type field. This is essentially a set of netdev feature bits (shifted by 16 bits) that are required to process a specific skb. As such it's easy to tell whether a given device can process a GSO skb: you just have to and the gso_type field and the netdev's features field. I've made gso_type a conjunction. The idea is that you have a base type (e.g., SKB_GSO_TCPV4) that can be modified further to support new features. For example, if we add a hardware TSO type that supports ECN, they would declare NETIF_F_TSO | NETIF_F_TSO_ECN. All TSO packets with CWR set would have a gso_type of SKB_GSO_TCPV4 | SKB_GSO_TCPV4_ECN while all other TSO packets would be SKB_GSO_TCPV4. This means that only the CWR packets need to be emulated in software. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Convert to non-LLTXMichael Chan2006-06-171-17/+10
| | | | | | | | | | | | | | | | | | Herbert Xu pointed out that it is unsafe to call netif_tx_disable() from LLTX drivers because it uses dev->xmit_lock to synchronize whereas LLTX drivers use private locks. Convert tg3 to non-LLTX to fix this issue. tg3 is a lockless driver where hard_start_xmit and tx completion handling can run concurrently under normal conditions. A tx_lock is only needed to prevent netif_stop_queue and netif_wake_queue race condtions when the queue is full. So whether we use LLTX or non-LLTX, it makes practically no difference. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Remove unnecessary tx_lockMichael Chan2006-06-171-4/+0
| | | | | | | | | | Remove tx_lock where it is unnecessary. tg3 runs lockless and so it requires interrupts to be disabled and sync'ed, netif_queue and NAPI poll to be stopped before the device can be reconfigured. After stopping everything, it is no longer necessary to get the tx_lock. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: update version and reldateMichael Chan2006-06-171-2/+2
| | | | | | | Update version to 3.60. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Add recovery logic when MMIOs are re-orderedMichael Chan2006-06-171-5/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add recovery logic when we suspect that the system is re-ordering MMIOs. Re-ordered MMIOs to the send mailbox can cause bogus tx completions and hit BUG_ON() in the tx completion path. tg3 already has logic to handle re-ordered MMIOs by flushing the MMIOs that must be strictly ordered (such as the send mailbox). Determining when to enable the flush is currently a manual process of adding known chipsets to a list. The new code replaces the BUG_ON() in the tx completion path with the call to tg3_tx_recover(). It will set the TG3_FLAG_MBOX_WRITE_REORDER flag and reset the chip later in the workqueue to recover and start flushing MMIOs to the mailbox. A message to report the problem will be printed. We will then decide whether or not to add the host bridge to the list of chipsets that do re-ordering. We may add some additional code later to print the host bridge's ID so that the user can report it more easily. The assumption that re-ordering can only happen on x86 systems is also removed. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Add 5786 PCI IDMichael Chan2006-06-171-0/+2
| | | | | | | Add PCI ID for BCM5786 which is a variant of 5787. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Handle Sun onboard tg3 chips more correctly.David S. Miller2006-06-091-96/+48
| | | | | | | | | | | | | | | | | | | | | Get rid of all the SUN_570X logic and instead: 1) Make sure MEMARB_ENABLE is set when we probe the SRAM for config information. If that is off we will get timeouts. 2) Always try to sync with the firmware, if there is no firmware running do not treat it as an error and instead just report it the first time we notice this condition. 3) If there is no valid SRAM signature, assume the device is onboard by setting TG3_FLAG_EEPROM_WRITE_PROT. Update driver version and release date. With help from Michael Chan and Fabio Massimo Di Nitto. Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Add some missing rx error countersMichael Chan2006-05-221-2/+6
| | | | | | | | | Add some missing rx error counters for 5705 and newer chips. Update version to 3.58. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: ethtool always report port is TP.Karsten Keil2006-05-121-3/+5
| | | | | | | | | Even with fiber cards ethtool reports that the connected port is TP, the patch fix this. Signed-off-by: Karsten Keil <kkeil@suse.de> Acked-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Fix possible NULL deref in tg3_run_loopback().Jesper Juhl2006-05-091-0/+3
| | | | | | | | | | | | tg3_run_loopback doesn't check that dev_alloc_skb() returns anything useful. Even if dev_alloc_skb() fails to return an skb to us we'll happily go on and assume it did, so we risk dereferencing a NULL pointer. Much better to fail gracefully by returning -ENOMEM than crashing here. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Update version and reldateMichael Chan2006-04-291-2/+2
| | | | | | | Update version to 3.57. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Fix bug in nvram writeMichael Chan2006-04-291-1/+1
| | | | | | | | | | | Fix bug in nvram write function. If the starting nvram address offset happens to be the last dword of the page, the NVRAM_CMD_LAST bit will not get set in the existing code. This patch fixes the bug by changing the "else if" to "if" so that the last dword condition always gets checked. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Add reset_phy parameter to chip reset functionsGary Zambrano2006-04-291-17/+17
| | | | | | | | | | | | Add a reset_phy parameter to tg3_reset_hw() and tg3_init_hw(). With the full chip reset during MAC address change, the automatic PHY reset during chip reset will cause a link down and bonding will not work properly as a result. With this reset_phy parameter, we can do a chip reset without link down when changing MAC address or MTU. Signed-off-by: Gary Zambrano <zambrano@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Reset chip when changing MAC addressMichael Chan2006-04-291-3/+17
| | | | | | | | | | | Do the full chip reset when changing MAC address if ASF is enabled. ASF sometimes uses a different MAC address than the driver. Without the reset, the ASF MAC address may be overwritten when the driver's MAC address is changed. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Add phy workaroundMichael Chan2006-04-291-4/+13
| | | | | | | Add some PHY workaround code to reduce jitter on some PHYs. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Call netif_carrier_off() during phy resetMichael Chan2006-04-291-0/+7
| | | | | | | | | | Add netif_carrier_off() call during tg3_phy_reset(). This is needed to properly track the netif_carrier state in cases where we do a PHY reset with interrupts disabled. The SerDes code will not run properly if the netif_carrier state is wrong. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Speed up SRAM access (2nd version)Michael Chan2006-04-091-27/+42
| | | | | | | | | | | | | | | | | | | | | | | | Speed up SRAM read and write functions if possible by using MMIO instead of config. cycles. With this change, the post reset signature done at the end of D3 power change must now be moved before the D3 power change. IBM reported a problem on powerpc blades during ethtool self test that was caused by the memory test taking excessively long. Config. cycles are very slow on powerpc and the memory test can take more than 10 seconds to complete using config. cycles. David Miller informed me that an earlier version of the patch caused problems on sparc64 systems with built-in tg3 chips. This version fixes the problem by excluding all SUN built-in tg3 chips from doing MMIO SRAM access. TG3_FLAG_EEPROM_WRITE_PROT is also set unconditionally when TG3_FLG2_SUN_570X is set. This should be sane as all SUN chips are built-in and do not require Vaux switching. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Kill some less useful flagsMichael Chan2006-04-091-13/+8
| | | | | | | | Kill the TG3_FLAG_NO_{TX|RX}_PSEUDO_CSUM flags because they are not very useful. This will free up some bits for new flags. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Fix a memory leak.Adrian Bunk2006-04-091-3/+7
| | | | | | | | This patch fixes a memory leak (buf wasn't freed) spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivialLinus Torvalds2006-04-021-10/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (48 commits) Documentation: fix minor kernel-doc warnings BUG_ON() Conversion in drivers/net/ BUG_ON() Conversion in drivers/s390/net/lcs.c BUG_ON() Conversion in mm/slab.c BUG_ON() Conversion in mm/highmem.c BUG_ON() Conversion in kernel/signal.c BUG_ON() Conversion in kernel/signal.c BUG_ON() Conversion in kernel/ptrace.c BUG_ON() Conversion in ipc/shm.c BUG_ON() Conversion in fs/freevxfs/ BUG_ON() Conversion in fs/udf/ BUG_ON() Conversion in fs/sysv/ BUG_ON() Conversion in fs/inode.c BUG_ON() Conversion in fs/fcntl.c BUG_ON() Conversion in fs/dquot.c BUG_ON() Conversion in md/raid10.c BUG_ON() Conversion in md/raid6main.c BUG_ON() Conversion in md/raid5.c Fix minor documentation typo BFP->BPF in Documentation/networking/tuntap.txt ...
| * BUG_ON() Conversion in drivers/net/Eric Sesterhenn2006-04-021-10/+5
| | | | | | | | | | | | | | | | this changes if() BUG(); constructs to BUG_ON() which is cleaner, contains unlikely() and can better optimized away. Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
* | [TG3]: Update driver version and reldate.David S. Miller2006-04-011-2/+2
| | | | | | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* | [TG3]: Revert "Speed up SRAM access"David S. Miller2006-04-011-30/+23
|/ | | | | | | | | | | Undo commit 100c4673307f5806788791b9b886877c806afd96 MMIOs timeout more quickly that PCI config cycles and some of these SRAM accesses can take a very long time, triggering the MMIO limits on some sparc64 PCI controllers and thus resulting in bus timeouts and bus errors. Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Update version and reldateMichael Chan2006-03-281-2/+2
| | | | | | | Update version to 3.55. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Skip timer code during full lockMichael Chan2006-03-281-0/+4
| | | | | | | | Skip the main timer code if interrupts are disabled in the full lock state. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Speed up SRAM accessMichael Chan2006-03-281-23/+30
| | | | | | | | | | | | | | | | | Speed up SRAM read and write functions if possible by using MMIO instead of config. cycles. With this change, the post reset signature done at the end of D3 power change must now be moved before the D3 power change. IBM reported a problem on powerpc blades during ethtool self test that was caused by the memory test taking excessively long. Config. cycles are very slow on powerpc and the memory test can take more than 10 seconds to complete using config. cycles. As a result, NETDEV WATCHDOG can be triggered during self test and the chip can end up in a funny state. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Fix PHY loopback on 5700Michael Chan2006-03-281-1/+4
| | | | | | | Fix PHY loopback failure on some 5700 devices. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Fix bug in 40-bit DMA workaround codeMichael Chan2006-03-281-1/+1
| | | | | | | | Need to check the TG3_FLAG_40BIT_DMA_BUG flag in the workaround code path instead of device flags. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Fix probe failure due to invalid MAC addressMichael Chan2006-03-281-22/+28
| | | | | | | | | | | | | Some older bootcode in some devices may report 0 MAC address in SRAM when booting up from low power state. This patch fixes the problem by checking for a valid MAC address in SRAM and falling back to NVRAM if necessary. Thanks to walt <wa1ter@myrealbox.com> for reporting the problem and helping to debug it. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Update driver version and reldate.David S. Miller2006-03-231-2/+2
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Add 5755 nvram supportMichael Chan2006-03-231-0/+43
| | | | | | | Add 5755 nvram support. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Add 5755 supportMichael Chan2006-03-231-6/+31
| | | | | | | Add support for new chip 5755 which is very similar to 5787. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Bump driver version and reldate.David S. Miller2006-03-221-2/+2
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Skip phy power down on some devicesMichael Chan2006-03-221-2/+14
| | | | | | | | Some PHYs should not be powered down in tg3_set_power_state() because of bugs or other hardware limitations. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Fix SRAM access during tg3_init_one()Michael Chan2006-03-221-3/+9
| | | | | | | | | | | 5700 and 5701 will not return correct SRAM data when the chip is in D3hot power state. tg3_get_eeprom_hw_cfg() must first put the device in D0 before reading SRAM. Thanks to Thomas Chenault at Dell for noticing this problem. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Don't mark tg3_test_registers() as returning const.David S. Miller2006-03-201-1/+1
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: make drivers/net/tg3.c:tg3_request_irq() staticAdrian Bunk2006-03-201-1/+1
| | | | | | | | This patch makes the needlessly global function tg3_request_irq() static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: netif_carrier_off runs too early; could still be queued when init failsJeff Mahoney2006-03-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | Move the netif_carrier_off() call from tg3_init_one()-> tg3_init_link_config() to tg3_open() as is the convention for most other network drivers. I was getting a panic after a tg3 device failed to initialize due to DMA failure. The oops pointed to the link watch queue with spinlock debugging enabled. Without spinlock debugging, the Oops didn't occur. I suspect that the link event was getting queued but not executed until after the DMA test had failed and the device was freed. The link event was then operating on freed memory, which could contain anything. With this patch applied, the Oops no longer occurs. [ Based upon feedback from Michael Chan, we move netif_carrier_off() to the end of tg3_init_one() instead of moving it to tg3_open() -DaveM ] Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: update version and reldateMichael Chan2006-03-201-2/+2
| | | | | | | Update version to 3.52. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Add firmware version infoMichael Chan2006-03-201-0/+56
| | | | | | | Add fw_version information to ethtool -i. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: nvram cleanupMichael Chan2006-03-201-27/+35
| | | | | | | | | | | | | Some nvram related cleanup: 1. Add a tg3_nvram_read_swab() since swabing the data is frequently done. 2. Add a function to convert nvram address to physical address instead of doing it in 2 separate places. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Fixup memory test for 5787Michael Chan2006-03-201-3/+13
| | | | | | | Ethtool memory test on 5787 requires a new memory table. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Add new one-shot MSI handlerMichael Chan2006-03-201-31/+54
| | | | | | | | | | | Support one-shot MSI on 5787. This one-shot MSI idea is credited to David Miller. In this mode, MSI disables itself automatically after it is generated, saving the driver a register access to disable it for NAPI. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Add ipv6 checksum supportMichael Chan2006-03-201-4/+8
| | | | | | | Support ipv6 tx csum on 5787 by setting NETIF_F_HW_CSUM. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Add new hard_start_xmitMichael Chan2006-03-201-4/+139
| | | | | | | | | | | | | Support 5787 hardware TSO using a new flag TG3_FLG2_HW_TSO_2. Since the TSO interface is slightly different and these chips have finally fixed the 4GB DMA problem and do not have the 40-bit DMA problem, a new hard_start_xmit is used for these chips. All previous chips will use the old hard_start_xmit that is now renamed tg3_start_xmit_dma_bug(). Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Add 5787 nvram supportMichael Chan2006-03-201-20/+123
| | | | | | | Support additional nvrams and new nvram format for 5787 and 5754. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Add 5787 and 5754 basic supportMichael Chan2006-03-201-2/+25
| | | | | | | Add basic support for 2 new chips 5787 and 5754. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Fix tg3_get_ringparam()Michael Chan2006-03-201-4/+13
| | | | | | | | | | | | | | Fix-up tg3_get_ringparam() to return the correct parameters. Set the jumbo rx ring parameter only if it is supported by the chip and currently in use. Add missing value for tx_max_pending, noticed by Rick Jones. Update version to 3.51. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [TG3]: Add some missing netif_running() checksMichael Chan2006-03-201-0/+6
| | | | | | | | | Add missing netif_running() checks in tg3's dev->set_multicast_list() and dev->set_mac_address(). If not netif_running(), these 2 calls can simply return 0 after storing the new settings if required. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
OpenPOWER on IntegriCloud