summaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c
Commit message (Collapse)AuthorAgeFilesLines
* [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>
* [BNX2]: Update version and reldateMichael Chan2006-06-171-2/+2
| | | | | | | Update driver version to 1.4.42. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Use CPU native page sizeMichael Chan2006-06-171-0/+1
| | | | | | | | | | | | | Use CPU native page size to determine various ring sizes. This allows order-0 memory allocations on all systems. Added check to limit the page size to 16K since that's the maximum rx ring size that will be used. This will prevent using unnecessarily large page sizes on some architectures with large page sizes. [Suggested by David Miller] Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Add firmware decompressionMichael Chan2006-06-171-12/+147
| | | | | | | | | | | Add functions to decompress firmware before loading to the internal CPUs. Compressing the firmware reduces the driver size significantly. Added file name length sanity check in the gzip header to prevent going past the end of buffer [suggested by DaveM]. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Allow WoL settings on new 5708 chipsMichael Chan2006-06-171-1/+3
| | | | | | | | Allow WOL settings on 5708 B2 and newer chips that have the problem fixed. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Add an rx drop counterMichael Chan2006-06-171-3/+11
| | | | | | | Add a counter for packets dropped by firmware. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Endian fixes.Alexey Dobriyan2006-06-171-2/+2
| | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NET]: Add netif_tx_lockHerbert Xu2006-06-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various drivers use xmit_lock internally to synchronise with their transmission routines. They do so without setting xmit_lock_owner. This is fine as long as netpoll is not in use. With netpoll it is possible for deadlocks to occur if xmit_lock_owner isn't set. This is because if a printk occurs while xmit_lock is held and xmit_lock_owner is not set can cause netpoll to attempt to take xmit_lock recursively. While it is possible to resolve this by getting netpoll to use trylock, it is suboptimal because netpoll's sole objective is to maximise the chance of getting the printk out on the wire. So delaying or dropping the message is to be avoided as much as possible. So the only alternative is to always set xmit_lock_owner. The following patch does this by introducing the netif_tx_lock family of functions that take care of setting/unsetting xmit_lock_owner. I renamed xmit_lock to _xmit_lock to indicate that it should not be used directly. I didn't provide irq versions of the netif_tx_lock functions since xmit_lock is meant to be a BH-disabling lock. This is pretty much a straight text substitution except for a small bug fix in winbond. It currently uses netif_stop_queue/spin_unlock_wait to stop transmission. This is unsafe as an IRQ can potentially wake up the queue. So it is safer to use netif_tx_disable. The hamradio bits used spin_lock_irq but it is unnecessary as xmit_lock must never be taken in an IRQ handler. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Use kmalloc instead of arrayMichael Chan2006-05-221-4/+14
| | | | | | | | Use kmalloc() instead of a local array in bnx2_nvram_write(). Update version to 1.4.40. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Fix bug in bnx2_nvram_write()Michael Chan2006-05-221-1/+1
| | | | | | | Fix a bug in bnx2_nvram_write() caused by a counter variable not correctly incremented by 4. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [PATCH] net drivers: fix section attributes for gccRandy Dunlap2006-04-121-1/+1
| | | | | | | | | | | | | | | If CONFIG_HOTPLUG=n, gcc doesn't like some __initdata to be const (rodata) and other __initdata not const, so make the non-const __initdata const. gcc errors: drivers/net/bnx2.c:66: error: version causes a section type conflict drivers/net/starfire.c:338: error: version causes a section type conflict drivers/net/typhoon.c:137: error: version causes a section type conflict drivers/net/natsemi.c:241: error: version causes a section type conflict Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [BNX2]: Update version and reldateMichael Chan2006-03-231-2/+2
| | | | | | | Update version to 1.4.39. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Separate tx producer and consumer fieldsMichael Chan2006-03-231-0/+1
| | | | | | | | Put the tx producer and consumer fields in separate cache lines in the device structure, similar to the VJ net channel queue structure. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Move .h files to bnx2.cMichael Chan2006-03-231-0/+40
| | | | | | | Move all #include <> from bnx2.h to bnx2.c. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Combine small mem allocationsMichael Chan2006-03-231-19/+15
| | | | | | | | | | | | Combine two small (56 byte and 320 byte) pci consistent memory allocations into one allocation. Jeff Garzik suggested to store the combined size in the bp structure for later use when freeing the memory. Use kzalloc() instead of kmalloc() + memset(). Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Fix link change handlingMichael Chan2006-03-231-12/+17
| | | | | | | | | | | Fix some link-related problems by doing a coalesce_now after link change interrupt to flush out the transient link status. To facilitate this, the host coalesce cmd register value is cached in the device structure. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: include <linux/vmalloc.h>Michael Chan2006-03-201-2/+2
| | | | | | | | | Include <linux/vmalloc.h> so that it compiles properly on all archs. Update version to 1.4.38. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Update versionMichael Chan2006-03-201-2/+3
| | | | | | | | | | Update version to 1.4.37. Add missing flush_scheduled_work() in bnx2_suspend as noted by Jeff Garzik. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Support larger rx ring sizes (part 2)Michael Chan2006-03-201-2/+2
| | | | | | | Support bigger rx ring sizes (up to 1020) in the rx fast path. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Support larger rx ring sizes (part 1)Michael Chan2006-03-201-32/+85
| | | | | | | | | | | | | | | | | | | | Increase maximum receive ring size from 255 to 1020 by supporting up to 4 linked pages of receive descriptors. To accomodate the higher memory usage, each physical descriptor page is allocated separately and the software ring that keeps track of the SKBs and the DMA addresses is allocated using vmalloc. Some of the receive-related fields in the bp structure are re- organized a bit for better locality of reference. The max. was reduced to 1020 from 4080 after discussion with David Miller. This patch contains ring init code changes only. This next patch contains rx data path code changes. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Fix bug when rx ring is fullMichael Chan2006-03-201-16/+25
| | | | | | | | | | | Fix the rx code path that does not handle the full rx ring correctly. When the rx ring is set to the max. size (i.e. 255), the consumer and producer indices will be the same when completing an rx packet. Fix the rx code to handle this condition properly. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Add ethtool -d supportMichael Chan2006-03-201-0/+60
| | | | | | | Add ETHTOOL_GREGS support. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Reduce register test sizeMichael Chan2006-03-201-254/+0
| | | | | | | | Eliminate some of the registers in ethtool register test to reduce driver size. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Massive net driver const-ification.Arjan van de Ven2006-03-031-5/+5
|
* [BNX2]: Update version and copyright yearMichael Chan2006-01-231-6/+5
| | | | | | | | | Update version to 1.4.31 and add 2006 copyright. Skip the last digit when reporting the firmware version. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Add PHY loopback testMichael Chan2006-01-231-22/+79
| | | | | | | Enhance the ethtool loopback test with PHY loopback test. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Use netdev_priv()Michael Chan2006-01-231-40/+40
| | | | | | | Replace dev->priv with netdev_priv(dev) Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Fix nvram sizingMichael Chan2006-01-231-3/+10
| | | | | | | Add code to correctly determine nvram size. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Workaround hw interrupt bugMichael Chan2006-01-231-2/+17
| | | | | | | | | Add workaround for a hardware interrupt issue. When using INTA, unmasking of the interrupt and the tag update should be done separately to avoid some spurious interrupts, Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Fix UDP checksum verificationMichael Chan2006-01-231-7/+5
| | | | | | | | | | | | Fix TCP/UDP checksum verification. Use status bits in the buffer descriptor instead of the checksum value to verify rx checksum. Using the checksum value will be incorrect if the UDP packet has zero in the UDP checksum field. Firmware update required for this fix. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Misc. fixesMichael Chan2006-01-231-6/+14
| | | | | | | Some misc. fixes for WoL, 5708 B1, and a typo '=' instead of '=='. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Improve handshake with firmwareMichael Chan2006-01-231-21/+23
| | | | | | | | | | | Improve handshake with bootcode with the following changes: 1. Increase timeout to 100msec and use msleep instead of udelay. 2. Add more error checking for timeouts and errors. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Fix VLAN on ASFMichael Chan2006-01-231-3/+7
| | | | | | | | | Always set up the device to strip incoming VLAN tags when ASF is enabled. ASF firmware will not parse packets correctly if VLAN tags are not stripped. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: simplify parameter checks in bnx2_{get,set}_eepromJohn W. Linville2005-11-101-10/+2
| | | | | | | | Remove the superfluous parameter checking in bnx2_{get,set}_eeprom. The parameters are already validated in ethtool_{get,set}_eeprom. Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: check return of dev_alloc_skb in bnx2_test_loopbackJohn W. Linville2005-11-101-0/+2
| | | | | | | | Check return of dev_alloc_skb in bnx2_test_loopback, and handle appropriately. Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: output driver name as prefix in error messageJohn W. Linville2005-11-101-1/+1
| | | | | | | Output driver name as prefix to "Unknown flash/EEPROM type." message. Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [PATCH] bnx2: update version and minor fixesMichael Chan2005-11-051-4/+4
| | | | | | | Some book keeping and a style fix. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* [PATCH] bnx2: refine bnx2_pollMichael Chan2005-11-051-15/+40
| | | | | | | | | | | | | | | Refine bnx2_poll() logic to write back the most up-to-date status tag when all work has been processed. This eliminates some occasional extra interrupts when a older status tag is written even though all work has been processed. The idea is to read the status tag just before exiting bnx2_poll() and then check again for any new work. If no new work is pending, the status tag written back will not generate any extra interrupt. This logic is similar to the changes David Miller did to tg3_poll(). Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* [PATCH] bnx2: update firmware handshake for 5708Michael Chan2005-11-051-15/+79
| | | | | | | | | | | | Dynamically determine the shared memory location where eeprom parameters are stored instead of using a fixed location. Add speed reporting to management firmware. This allows management firmware to know the current speed without contending for MII registers. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* [PATCH] bnx2: update nvram code for 5708Michael Chan2005-11-051-22/+78
| | | | | | | Update bnx2 nvram code with support for 5708. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* [PATCH] bnx2: add 5708 supportMichael Chan2005-11-051-25/+192
| | | | | | | | Add 5708 copper and serdes basic support, including 2.5 Gbps support on 5708 serdes. SPEED_2500 is also added to ethtool.h Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* drivers/net: Remove pointless checks for NULL prior to calling kfree()Jesper Juhl2005-10-281-8/+4
|
* [BNX2]: Add support for ETHTOOL_GPERMADDR.John W. Linville2005-09-121-0/+2
| | | | | Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Fix bug in irq handler and add prefetchMichael Chan2005-09-081-3/+4
| | | | | | | | | | | | | | | | Fix bug in bnx2_interrupt() that caused an unnecessary register read. The BNX2_PCICFG_MISC_STATUS should only be read when the status tag has not changed. Add prefetch of the status block in bnx2_msi() similar to tg3_msi(). The status block is not touched in bnx2_msi() and prefetching it will speed up bnx2_poll() that will run on the same CPU that received the MSI. Update version. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [PATCH] swsusp: fix remaining u32 vs. pm_message_t confusionPavel Machek2005-09-051-9/+9
| | | | | | | | | | Fix remaining bits of u32 vs. pm_message confusion. Should not break anything. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [BNX2]: update version and minor fixesMichael Chan2005-08-291-17/+15
| | | | | | | | | | | | | | Update version and add 4 minor fixes, the last 2 were suggested by Jeff Garzik: 1. check for a valid ethernet address before setting it 2. zero out bp->regview if init_one encounters an error and unmaps the IO address. This prevents remove_one from unmapping again. 3. use netif_rx_schedule() instead of hand coding the same. 4. use IRQ_HANDLED and IRQ_NONE. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: change irq locks to bh locksMichael Chan2005-08-291-32/+24
| | | | | | | | Change all locks from spin_lock_irqsave() to spin_lock_bh(). All places that require spinlocks are in BH context. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: remove atomics in txMichael Chan2005-08-291-18/+17
| | | | | | | | | | | | | Remove atomic operations in the fast tx path. Expensive atomic operations were used to keep track of the number of available tx descriptors. The new code uses the difference between the consumer and producer index to determine the number of free tx descriptors. As suggested by Jeff Garzik, the name of the inline function is changed to all lower case. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: speedup serdes linkupMichael Chan2005-08-291-12/+40
| | | | | | | | | | | | | | | | | | | | | | This speeds up link-up time on 5706 SerDes if the link partner does not autoneg, a rather common scenario in blade servers. Some blade servers use IPMI for keyboard input and it's important to minimize link disruptions. The speedup is achieved by shortening the timer to (HZ / 3) during the transient period right after initiating a SerDes autoneg. If autoneg does not complete, parallel detect can be done sooner. After the transient period is over, the timer goes back to its normal HZ interval. As suggested by Jeff Garzik, the timer initialization is moved to bnx2_init_board() from bnx2_open(). An eeprom bit is also added to allow default forced SerDes speed for even faster link-up time. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [BNX2]: Fix rtnl deadlock in bnx2_closeMichael Chan2005-08-291-1/+14
| | | | | | | | | | | | | | | | | | This fixes an rtnl deadlock problem when flush_scheduled_work() is called from bnx2_close(). In rare cases, linkwatch_event() may be on the workqueue from a previous close of a different device and it will try to get the rtnl lock which is already held by dev_close(). The fix is to set a flag if we are in the reset task which is run from the workqueue. bnx2_close() will loop until the flag is cleared. As suggested by Jeff Garzik, the loop is changed to call msleep(1) instead of yield() in the original patch. flush_scheduled_work() is also moved to bnx2_remove_one() before the netdev is freed. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
OpenPOWER on IntegriCloud