Commit graph

250 commits

Author SHA1 Message Date
Stephen Hemminger fc99fe0618 sky2: Add PCI device specfic register 4 & 5
Need to setup more PCI control control registers are on Yukon EX.
Some of these also exist on Yukon EC-U as well.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-08 22:16:42 -04:00
Stephen Hemminger 3ead5db7bc sky2: avoid reserved regions on ethtool reg dump
On Yukon EX reading some of the undocumented places in the
memory space will cause a hang. Since they don't provide useful
information, just skip the reserved areas.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-08 22:16:42 -04:00
Stephen Hemminger 3d4e66f5cd sky2: Fix VLAN unregistration
Fix sky2 disabling VLAN completely when the first vid is unregistered.

sky2 disables VLAN completely when the first VID is unregistered. It
should instead disable VLAN when the group is unregistered by calling
sky2_vlan_rx_register with grp = NULL.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

 drivers/net/sky2.c |   25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-06-03 11:44:19 -04:00
Stephen Hemminger 34dd962b74 sky2: program proper register for fiber PHY
Driver was reading value from one register, setting bit and then
writing the wrong register.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-30 09:52:48 -04:00
Stephen Hemminger 56069c0fdd sky2: checksum offload plus vlan bug
Driver was not correctly setting up transmit descriptor when doing
VLAN tag insertion with checksum offload.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-30 09:52:47 -04:00
Stephen Hemminger b4ed372b29 sky2: dont set bogus bit in PHY register
This code inherited from the sk98lin driver is incorrect on the Yukon2.
The GPHY_CTRL register values are specific to the internal PHY of the chip
and the values used were leftovers.
Driver was setting bit 13 which is now the INT polarity for the PHY!

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-30 09:52:47 -04:00
Stephen Hemminger 50432cb534 sky2: memory barriers change
Do some memory barrier changes for safety/perfomance:
Don't need read after update to index, mmiowb() followed by read at end
of irq is sufficient.

Signed-off-by: Stephn Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-17 20:43:14 -04:00
Stephen Hemminger 84787e3fc3 sky2: remove dual port workaround
This workaround was added to deal with NAPI core and how
it affected dual port shared polling. It turned out not to
be necessary. Stopping device 0 only doesn't stop NAPI from
working completely after that.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-17 20:43:14 -04:00
Stephen Hemminger a3caeada94 sky2: MIB counter overflow handling
Make sure that if we ever get a MIB counter overflow interrupt (normally
masked off), that the IRQ is cleared.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-17 20:43:14 -04:00
Stephen Hemminger 3225b91903 sky2: keep track of receive alloc failures
When driver can't allocate receive buffer it drops incoming
packet. Keep a counter.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-17 20:43:13 -04:00
Stephen Hemminger 53419c6851 sky2: PHY register settings
Align the PHY setup of the sky2 driver with the vendor sk98lin (10.0.4.3)
driver. The PHY register settings are mostly black magic, even with access
to the documentation it isn't clear what the right values are. The changes
are mostly comments, the code change only affects the Yukon FE (100 mbit only)
version.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-17 20:43:13 -04:00
Stephen Hemminger abc368a17c sky2: remove Gigabyte 88e8056 restriction
The problems with Gigabyte motherboards are system configuration dependent.
Since it works fine for some users, it doesn't make sense to deprive
them.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-17 20:43:13 -04:00
Stephen Hemminger f30cac6fbf sky2: only disable 88e8056 on some boards
Use DMI to add a blacklist of broken boards (so far only one).
Hopefully, the problems will be solved later, and the the whole
blacklist can disappear.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-11 17:53:41 -04:00
Stephen Hemminger 78f0b62d4c sky2: 88e8071 support not ready
The driver is not ready to support 88e8071 chip.
If this chip is present, system will hang on boot.

So remove it from PCI device id's for now.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-11 17:53:39 -04:00
Stephen Hemminger 549a68c3fe sky2: fix oops on shutdown
If the device is fails during module startup for some reason like
unsupported chip version then the driver would crash dereferencing a
null pointer, on shutdown or suspend/resume.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-11 17:53:33 -04:00
Stephen Hemminger 44a1d2e5c5 sky2: re-enable 88E8056 for most motherboards
This fixes the regression in 2.6.21 for users with 88e8056 on motherboard.
Allow all but the Gigabyte motherboard has some unresolved bus problems.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-08 01:23:09 -04:00
Arnaldo Carvalho de Melo d626f62b11 [SK_BUFF]: Introduce skb_copy_from_linear_data{_offset}
To clearly state the intent of copying from linear sk_buffs, _offset being a
overly long variant but interesting for the sake of saving some bytes.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2007-04-25 22:28:23 -07:00
Arnaldo Carvalho de Melo ab6a5bb6b2 [TCP]: Introduce tcp_hdrlen() and tcp_optlen()
The ip_hdrlen() buddy, created to reduce the number of skb->h.th-> uses and to
avoid the longer, open coded equivalent.

Ditched a no-op in bnx2 in the process.

I wonder if we should have a BUG_ON(skb->h.th->doff < 5) in tcp_optlen()...

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:24 -07:00
Arnaldo Carvalho de Melo ea2ae17d64 [SK_BUFF]: Introduce skb_transport_offset()
For the quite common 'skb->h.raw - skb->data' sequence.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:16 -07:00
Arnaldo Carvalho de Melo eddc9ec53b [SK_BUFF]: Introduce ip_hdr(), remove skb->nh.iph
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:10 -07:00
Arnaldo Carvalho de Melo c9bdd4b525 [IP]: Introduce ip_hdrlen()
For the common sequence "skb->nh.iph->ihl * 4", removing a good number of open
coded skb->nh.iph uses, now to go after the rest...

Just out of curiosity, here are the idioms found to get the same result:

skb->nh.iph->ihl << 2
skb->nh.iph->ihl<<2
skb->nh.iph->ihl * 4
skb->nh.iph->ihl*4
(skb->nh.iph)->ihl * sizeof(u32)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:07 -07:00
Stephen Hemminger 93cd791e02 sky2: version 1.14
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:17 -04:00
Stephen Hemminger d2adf4f65a sky2: no jumbo on Yukon FE
The Yukon FE (100mbit only) chips do not support large packets.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:17 -04:00
Stephen Hemminger b628ed986d sky2: EC-U performance and jumbo support
The Yukon EC Ultra chips have transmit settings for store and
forward and PCI buffering. By setting these appropriately, normal
performance goes from 750Mbytes/sec to 940Mbytes/sec (non-jumbo).

It is also possible to do Jumbo mode, but it means turning off
TSO and checksum offload so the performance gets worse. There isn't
enough buffering for checksum offload to work.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:17 -04:00
Stephen Hemminger 4f44d8ba09 sky2: disable ASF on all chip types
Need to make sure and disable ASF on all chip types. Otherwise, there may be
random reboots.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:17 -04:00
Stephen Hemminger 40b01727a5 sky2: handle descriptor errors
There should never be descriptor error unless hardware or driver is buggy.
But if an error occurs, print useful information, clear irq, and recover.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:17 -04:00
Stephen Hemminger 0a17e4c252 sky2: disable support for 88E8056
This device is having all sorts of problems that lead to data corruption
and system instability.  It gets receive status and data out of order,
it generates descriptor and TSO errors, etc.

Until the problems are resolved, it should not be used by anyone
who cares about there system.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:17 -04:00
Stephen Hemminger 9467a8fc89 sky2: phy workarounds for Yukon EC-U A1
The workaround Yukon EC-U wasn't comparing with correct
version and wasn't doing correct setup. Without it, 88e8056
throws all sorts of errors.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-11 11:54:43 -04:00
Stephen Hemminger 1ad5b4a5c2 sky2: turn on clocks when doing resume
Some of these chips are disabled until clock is enabled.
This fixes:
     http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=404107

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-11 11:54:43 -04:00
Stephen Hemminger 9a87240c67 sky2: turn carrier off when down
Driver needs to turn off carrier when down.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-11 11:54:42 -04:00
Stephen Hemminger 874183072d sky2: turn off Rx checksum on bad hardware
On Yukon FE, occasional hardware receive checksum errors are seen.
An early indication of the problem is single bit differences in the two
checksum engines.  Use this as a detection mechanism to turn off Rx
checksumming.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-09 11:51:32 -05:00
Dan Aloni 5c15bdec5c [VLAN]: Avoid a 4-order allocation.
This patch splits the vlan_group struct into a multi-allocated struct. On
x86_64, the size of the original struct is a little more than 32KB, causing
a 4-order allocation, which is prune to problems caused by buddy-system
external fragmentation conditions.

I couldn't just use vmalloc() because vfree() cannot be called in the
softirq context of the RCU callback.

Signed-off-by: Dan Aloni <da-x@monatomic.org>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-03-02 20:44:51 -08:00
Stephen Hemminger 62ba7e6cfd sky2: v1.13
New version.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-17 15:30:47 -05:00
Stephen Hemminger a79abdc6ee sky2: receive error handling improvements
Don't drop oversize frame it might be a VLAN (untagged).
Use different counter for fifo overrun vs fifo error.
Print error on fifo overrrun.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-17 15:30:47 -05:00
Stephen Hemminger 819067916d sky2: transmit timeout
The transmit timeout code could hang, and it would not clear out
problems if the hardware was stuck.  Change the code to effectively do
a device down/up similar to the suspend/resume code.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-17 15:30:47 -05:00
Stephen Hemminger da4c1ff475 sky2: flow control negotiation for Yukon-FE
The Yukon-FE chip doesn't do gigabit and has a differen PHY internally.
On this chip, phy status register doesn't properly reflect the result
of flow control negotiation. To workaround the problem and avoid having
to have so much chip dependent code; compute the result of flow control
by looking at the local and remote advertised bits.

Signed-off-by: Stephen Hemmminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-17 15:30:47 -05:00
Stephen Hemminger 7a7b518151 sky2: no need to reset pause bits on shutdown
Resetting the pause bits on shutdown is not necessary.
The code was inherited from the vendor driver, and it is currently #ifdef'd
out there as well.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-17 15:30:47 -05:00
Stephen Hemminger 683349a3fa sky2: version 1.12
Updated version for WOL and new id's

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-07 18:50:50 -05:00
Stephen Hemminger f1a0b6f56e sky2: add new chip ids
More new chip id's from vendor driver version 10.0.4.3

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-07 18:50:48 -05:00
Stephen Hemminger 9374549428 sky2: Yukon Extreme support
This is basic support for the new Yukon Extreme
chip, extracted from the new vendor driver 10.0.4.3.

Since this is untested hardware, it has a big fat warning for now.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-07 18:50:46 -05:00
Stephen Hemminger 62335ab013 sky2: safer transmit timeout
Rather than trying to be "smart" about possible transmit timeout
causes. Just clear all pending frames and reset the PHY.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-07 18:50:44 -05:00
Stephen Hemminger 4a50a876ac sky2: TSO support for EC_U
The Yukon EC_U chipset apparently supports TSO but only for non-Jumbo
frame sizes because it lacks a Ram buffer.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-07 18:50:42 -05:00
Stephen Hemminger b02a92586d sky2: use dev_err for error reports
Use the standard dev_xxx functions instead of printk directly for
error reports. Fix a bug where the initialization would return 0
if allocation of network device failed.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-07 18:50:40 -05:00
Stephen Hemminger e3173832d7 sky2: add Wake On Lan support
Adds basic magic packet wake on lan support to the sky2 driver.
Note: initial WOL value is based on BIOS settings.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-07 18:49:59 -05:00
shemminger@linux-foundation.org 7f60c64bd0 sky2: handle network device allocation failure
If alloc_etherdev() failed, then sky2_init_netdev will return NULL,
and sky2_probe would end up returning 0 instead of -ENOMEM.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-05 16:58:49 -05:00
shemminger@linux-foundation.org 2bf56fe25c sky2: software rx/tx stats
Maintain packet statistics in software rather than hardware.
This is slightly slower, but allows easier debugging of problems
where packets are still being received by PHY but not being handled
by hardware.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-05 16:58:49 -05:00
shemminger@linux-foundation.org 285e6ddd01 sky2: version 1.11.1
Version update to 1.11.1.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-05 16:58:49 -05:00
Stephen Hemminger ae306cca3a sky2: better power state management
Improve power management and error handling by using pci_set_power_state(),
instead of driver doing PCI PM register changes in the driver.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-05 16:58:45 -05:00
Stephen Hemminger 4cbf2aa35e [PATCH] sky2: revert IRQ dance on suspend/resume
Let's just backout the IRQ hack, and for those crap machines (like some
Sony VAIO's) can just disable MSI with the module parameter.

This reverts 44ade17824.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frédéric Riss <frederic.riss@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-01-29 17:50:14 -08:00
Stephen Hemminger 65ebe63420 [PATCH] email change for shemminger@osdl.org
Change my email address to reflect OSDL merger.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
[ The irony. Somebody still has his sign-off message hardcoded
  in a script or his brainstem ;^]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-01-23 14:18:49 -08:00