Commit graph

177 commits

Author SHA1 Message Date
Stephen Hemminger 709c6e7bb0 sky2: fiber pause bits
The advertisement bits for flow control are located in
different location on fiber (1000baseX)

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-10-17 10:24:04 -07:00
Stephen Hemminger ebc646f681 sky2: phy irq on shutdown
When PHY is turned off on shutdown, it causes the IRQ to get stuck on.
Make sure and disable the IRQ first, and if IRQ occurs when device
is not running, don't access PHY because that will hang.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-10-17 10:23:56 -07:00
Stephen Hemminger e561a83be5 sky2: turn of workaround timer
The workaround timer is not needed in most systems with proper IRQ
routing and by perodically waking up it adds to laptop power consumption.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-10-17 10:20:51 -07:00
Stephen Hemminger 2bffc23a01 sky2: MSI test is only a warning
Some motherboards don't implement MSI correctly. The driver handles this
but the warning is too verbose and overly cautious.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-10-17 10:17:18 -07:00
Stephen Hemminger 6e532cfe49 [PATCH] sky2: set lower pause threshold to prevent overrun
Adjust the pause threshold on slower systems to keep from getting overrun.
Since FIFO is 2K bytes, don't send XON pause until there is space for a full
frame.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-10-11 04:07:45 -04:00
Stephen Hemminger 7bd656d121 [PATCH] sky2: revert pci express extensions
The pci express error handling extensions don't work unless PCI access is via
mmconfig. Otherwise, all accesses to pci config registers greater than 256 fail.
Since the sky2 driver has other ways of getting to PCI config space, it works
around this short coming, but the pci_find_ext_capablity doesn't work.

This backs out commit 91aeb3edbc
Go back to hardcoding, since we know where the error registers are anyway.
Fixes  http://bugzilla.kernel.org/show_bug.cgi?id=7222

Signed-off-by: Stephen Hemminger <shemmminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-10-11 04:07:45 -04:00
Jeff Garzik 24fcbacedb Merge branch 'master' into upstream-fixes 2006-10-11 03:56:12 -04:00
David Howells 7d12e780e0 IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around.  On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable.  On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions.  Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller.  A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs.  Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

	struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

	set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

	-	update_process_times(user_mode(regs));
	-	profile_tick(CPU_PROFILING, regs);
	+	update_process_times(user_mode(get_irq_regs()));
	+	profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

 (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
     the input_dev struct.

 (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
     something different depending on whether it's been supplied with a regs
     pointer or not.

 (*) Various IRQ handler function pointers have been moved to type
     irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-10-05 15:10:12 +01:00
Stephen Hemminger 489b10c1f6 [PATCH] sky2: incorrect length on receive packets
The previous change to do fragmented receive (post 2.6.18) introduced a bug
where packets are passed up with size set to the size of the receive buffer
not the actual received data.  IP silently trims this so it didn't show up
right away.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-10-05 06:43:23 -04:00
Stephen Hemminger c73a29da23 [PATCH] sky2: version 1.9
Version 1.9 is for 2.6.19.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-09-27 17:56:32 -04:00
Stephen Hemminger 14d0263fea [PATCH] sky2: fragmented receive for large MTU
Use hardware support for chained receive to break up large frames
into multiple pages. This avoids having to do a mult-page allocation
that can fail on a busy system due to fragmented memory.

For normal size MTU, this code behaves the same.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-09-27 17:56:31 -04:00
Stephen Hemminger 2bb8c26242 [PATCH] sky2: use netif_tx_lock instead of LLTX
Use the netdevice transmit lock via netif_tx_lock rather than putting
lock in device specific code and using lockless transmit.  The code is
cleaner using netif_tx_lock, and the performance is same.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-09-27 17:56:31 -04:00
Stephen Hemminger 291ea6142b [PATCH] sky2: incremental transmit completion
Since a transmit can take several control blocks, the old code waited
until the last control block was marked as done. This code processes
the return values incrementally. This makes slots in the tx ring available
and less chance of getting stuck.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-09-27 17:56:31 -04:00
Stephen Hemminger 9fa1b1f33c [PATCH] sky2: name irq after eth for irqbalance
Use the ethernet device name when requesting the irq because the
irqbalance daemon looks for the name when deciding policy.
Better to play along with this dubious heuristic.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-09-27 17:56:31 -04:00
Stephen Hemminger c2716fb407 [PATCH] sky2: workarounds for some 88e806x chips
Workarounds for 88e806x chips from the vendor driver.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-09-27 17:56:31 -04:00
Stephen Hemminger 91aeb3edbc [PATCH] sky2: use standard pci register capabilties for error register
Use the standard pci capability mechanism to access PCI express error
registers, rather than hard coding the offset. Mask off the PCI express
error from ever occuring on non-PCI express systems.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-09-27 17:56:31 -04:00
Stephen Hemminger e0ed545903 [PATCH] sky2: gigabit full duplex negotiation
Look at the registers correctly, when doing gigabit full duplex.
Need to look for link partner result.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-09-27 17:56:31 -04:00
Linus Torvalds a319a2773a Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (217 commits)
  net/ieee80211: fix more crypto-related build breakage
  [PATCH] Spidernet: add ethtool -S (show statistics)
  [NET] GT96100: Delete bitrotting ethernet driver
  [PATCH] mv643xx_eth: restrict to 32-bit PPC_MULTIPLATFORM
  [PATCH] Cirrus Logic ep93xx ethernet driver
  r8169: the MMIO region of the 8167 stands behin BAR#1
  e1000, ixgb: Remove pointless wrappers
  [PATCH] Remove powerpc specific parts of 3c509 driver
  [PATCH] s2io: Switch to pci_get_device
  [PATCH] gt96100: move to pci_get_device API
  [PATCH] ehea: bugfix for register access functions
  [PATCH] e1000 disable device on PCI error
  drivers/net/phy/fixed: #if 0 some incomplete code
  drivers/net: const-ify ethtool_ops declarations
  [PATCH] ethtool: allow const ethtool_ops
  [PATCH] sky2: big endian
  [PATCH] sky2: fiber support
  [PATCH] sky2: tx pause bug fix
  drivers/net: Trim trailing whitespace
  [PATCH] ehea: IBM eHEA Ethernet Device Driver
  ...

Manually resolved conflicts in drivers/net/ixgb/ixgb_main.c and
drivers/net/sky2.c related to CHECKSUM_HW/CHECKSUM_PARTIAL changes by
commit 84fa7933a3 that just happened to be
next to unrelated changes in this update.
2006-09-24 10:15:13 -07:00
Patrick McHardy 84fa7933a3 [NET]: Replace CHECKSUM_HW by CHECKSUM_PARTIAL/CHECKSUM_COMPLETE
Replace CHECKSUM_HW by CHECKSUM_PARTIAL (for outgoing packets, whose
checksum still needs to be completed) and CHECKSUM_COMPLETE (for
incoming packets, device supplied full checksum).

Patch originally from Herbert Xu, updated by myself for 2.6.18-rc3.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-09-22 14:53:53 -07:00
Jeff Garzik 7282d491ec drivers/net: const-ify ethtool_ops declarations
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-09-13 14:30:00 -04:00
Stephen Hemminger f65b138ca9 [PATCH] sky2: big endian
Fix support for big endian platforms like PPC.
Still not sure about VLAN acceleration (does it need swapping)?

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-09-13 13:27:44 -04:00
Stephen Hemminger b89165f2b7 [PATCH] sky2: fiber support
Fix the support for fiber connected gigabit boards.
Allow half duplex gigabit to be configured.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-09-13 13:27:44 -04:00
Stephen Hemminger 2eaba1a280 [PATCH] sky2: tx pause bug fix
Fix problems with transmit pause frames. The driver was telling the
GMAC to flush (not process) pause frames. Manually disabling pause wasn't
working because of problems in the setup.

This maybe the cause of the lockup under load.
	http://bugzilla.kernel.org/show_bug.cgi?id=6839

Patch against netdev-2.6 git tree

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-09-13 13:27:44 -04:00
Stephen Hemminger 2f4a66ad49 [PATCH] sky2: more pci device id's
Some more Marvell device id's, these are from the latest SysKonnect
vendor driver version of sk98lin (8.36).

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-09-06 11:10:50 -04:00
shemminger@osdl.org e981d47b9f [PATCH] sky2: version 1.7
Change version number for this bundle.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-08-29 17:18:30 -04:00
shemminger@osdl.org 98232f85ff [PATCH] sky2: pci post bug
Make sure that PCI write occurs before the delay.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-08-29 17:18:30 -04:00
shemminger@osdl.org d3bcfbeb27 [PATCH] sky2: power down PHY when not up
To save power, don't enable power to the PHY until device is brought up.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-08-29 17:18:30 -04:00
shemminger@osdl.org 1d179332f8 [PATCH] sky2: optimize checksum offload information
Since many packets have the same checksum starting offset and insertion
location; the driver can save the last information and only tell hardware
when it changes.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-08-29 17:18:30 -04:00
shemminger@osdl.org e07560cd4f [PATCH] sky2: TSO mss optimization
The MSS in the transmit engine only has to change if TSO mtu changes. This
means less commands to the chip when mixing TSO and regular data.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-08-29 17:18:30 -04:00
shemminger@osdl.org bb507fe11f [PATCH] sky2: MSI test timing
The test for MSI IRQ could have timing issues. The PCI write needs to be
pushed out before waiting, and the wait queue should be initialized before
the IRQ.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-08-29 17:18:30 -04:00
shemminger@osdl.org 97bda706b4 [PATCH] sky2: dont use force status bit
Don't use force status bit. It was never implemented on all chips, or has
no impact.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-08-29 17:18:29 -04:00
shemminger@osdl.org 497d7c8681 [PATCH] sky2: use netdev_alloc_skb
Use netdev_alloc_skb for buffer allocation to allow for headroom.
This prevents bugs in code paths that assume extra space at the
front and makes sky2 behave like other drivers.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-08-29 17:18:29 -04:00
shemminger@osdl.org fba5008cda [PATCH] sky2: remove cloned/pskb_expand_head check
The code to handle cloned skb overwriting is unnecessary in the
sky2 driver and is buggy. The bug is that pskb_expand_head can change the
skb but the driver has already mapped in the header.

Since the sky2 hardware doesn't need to overwrite memory, the buggy
code can just be removed; it was mistakenly copied from the tg3
driver.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-08-29 17:18:29 -04:00
Jeff Garzik f5c7db1c91 Merge branch 'upstream-fixes' into upstream 2006-08-10 08:31:03 -04:00
Stephen Hemminger 8d3d35b4e2 [PATCH] sky2: phy power problems on 88e805X chips
On the 88E805X chipsets (used in laptops), the PHY was not getting powered
out of shutdown properly. The variable reg1 was getting reused incorrectly.
This is probably the cause of the bug.
	http://bugzilla.kernel.org/show_bug.cgi?id=6471

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-08-10 08:30:48 -04:00
Stephen Hemminger fe2a24dfc5 [PATCH] sky2: status interrupt handling improvement
More changes to prevent losing status and causing hangs.
The hardware is smarter than I gave it credit for.
Clearing the status IRQ causes the status state machine to
toggle an IRQ if needed and post any more transmits.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-08-03 17:36:39 -04:00
Stephen Hemminger 57fa442c1e [PATCH] sky2: more pci device ids
Recent vendor driver and customer reports show more devices.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-08-03 17:31:56 -04:00
Stephen Hemminger 5f5d83fdbf [PATCH] sky2: add another PCI ID
Yet another PCI ID for 88E8056

Signed-off-by: Stephen Hemminger <sch@sch-laptop.localdomain>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-07-19 13:49:04 -04:00
Stephen Hemminger caa0371e8b [PATCH] sky2: NAPI poll fix
When sky2 driver gets lots of received packets at once, it can get stuck.
The NAPI poll routine gets called back to keep going, but since no IRQ bits
are set it doesn't make progress.

Increase version, since this is serious enough problem that I want to be
able to tell new from old problems.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-07-17 13:27:46 -04:00
Stephen Hemminger 22e1170310 [PATCH] sky2: optimize receive restart
When the driver handles multiple packets per NAPI poll, it is
better to reload the receive ring, then tell the hardware. Otherwise,
under packet storm with flow control, the driver/hardware will degrade
down to one packet getting through per pause-exchange.

Likewise on transmit, don't wakeup until a little more than minimum
ring space is available.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-07-12 18:39:22 -04:00
Stephen Hemminger afa195da45 [PATCH] sky2: PHY power on delays
The documentation says we need to wait after turning on the PHY.
Also, don't enable WOL by default.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-07-12 18:39:21 -04:00
Stephen Hemminger 6a5706b99c [PATCH] sky2: NAPI suspend/resume of dual port cards
The changes to handle suspend/resume didn't handle the case where
a dual port card has the first port down, but the second is running.
In this driver, all NAPI polling is done on the primary port.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-07-12 18:39:21 -04:00
Stephen Hemminger 59139528c8 [PATCH] sky2: sky2_reset section mismatch
Since sky2_reset gets call from sky2_resume it shouldn't be tagged
with devinit.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-07-12 18:39:21 -04:00
Herbert Xu 89114afd43 [NET] gso: Add skb_is_gso
This patch adds the wrapper function skb_is_gso which can be used instead
of directly testing skb_shinfo(skb)->gso_size.  This makes things a little
nicer and allows us to change the primary key for indicating whether an skb
is GSO (if we ever want to do that).

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-07-08 13:34:32 -07:00
Thomas Gleixner 1fb9df5d30 [PATCH] irq-flags: drivers/net: Use the new IRQF_ constants
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-02 13:58:51 -07:00
Jörn Engel 6ab3d5624e Remove obsolete #include <linux/config.h>
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-06-30 19:25:36 +02:00
Greg Kroah-Hartman 7c7459d1f9 [PATCH] 64bit resource: fix up printks for resources in networks drivers
This is needed if we wish to change the size of the resource structures.

Based on an original patch from Vivek Goyal <vgoyal@in.ibm.com>

Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-27 09:23:58 -07:00
Herbert Xu 7967168cef [NET]: Merge TSO/UFO fields in sk_buff
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>
2006-06-23 02:07:29 -07:00
Stephen Hemminger 88d113601c [PATCH] sky2: netconsole suspend/resume interaction
A couple of fixes that should prevent crashes when using netconsole and
suspend/resume. First, netconsole poll routine shouldn't run unless the
device is up; second, the NAPI poll should be disabled during suspend.

This is only an issue on sky2, because it has to have one NAPI poll
routine for both ports on dual port boards. Normal drivers use
netif_rx_schedule_prep and that checks for netif_running.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-17 10:52:12 -07:00
Stephen Hemminger eb35cf60e4 [PATCH] sky2: stop/start hardware idle timer on suspend/resume
The resume bug was caused not by an early interrupt but because the idle
timeout was not being stopped on suspend.  Also disable hardware IRQ's
on suspend.  Will need to revisit this with hotplug?

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-13 13:16:41 -07:00