Commit Graph

42 Commits

Author SHA1 Message Date
Auke Kok 3bf319a787 e1000e: remove unused read value in ASPM disable code.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-24 00:07:52 -05:00
Auke Kok 489815ce22 e1000e: fix spelling errors in comments
Fix some spelling errors and inconsistencies in comment blocks.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-24 00:07:50 -05:00
Jesse Brandeburg de92d84ec2 e1000e: fix flow control denial of service possibility
this patch avoids a denial of service from an evildoer sending a
continuous stream of flow control at our adapter that is plugged
into a non-flow control enabled switch.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-24 00:07:49 -05:00
Jesse Brandeburg 4a5694e664 e1000e: fix flow control when using ethtool overrides
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-24 00:07:47 -05:00
Jesse Brandeburg 03ae221fe9 e1000e: fix link up message to show ethX:
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-24 00:07:47 -05:00
Auke Kok 31f8c4fe5d e1000e: 82573 can use eerd method to read eeprom
This simplifies the 82571/2/3 family initialization a bit
and removes an initialization table no longer needed.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-24 00:07:45 -05:00
David Graham e8ef7f295b e1000e: PCIe devices do not need to unset MANC_ARP_ENA
Users reported that ARP's were lost with e1000e. The problem
is fixed by not enabling this manageability configuration
bit.

None of the release_manageability code is actually needed as the
normal device reset during a shutdown returns everthing to
the right condition automatically.

Signed-off-by: David Graham <david.graham@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-15 10:52:14 -05:00
Auke Kok 5918bd88ef e1000e: Fix CRC stripping in hardware context bug
CRC stripping was only correctly enabled for packet split recieves
which is used when receiving jumbo frames. Correctly enable SECRC
also for normal buffer packet receives.

Tested by Andy Gospodarek and Johan Andersson, see bugzilla #9940.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-15 10:52:01 -05:00
Auke Kok 23b66e2bc2 e1000e: Fix logic reversal keeping link active
A logic mishap caused the adapter to keep link while we can
disable it due to WoL not being active, and vice versa.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-11 14:51:40 -05:00
Andy Gospodarek 9b71c5e070 e1000e: tweak irq allocation messages
There's too much noise on systems that don't support MSI.  Let's get rid
of a few and make the real error message more specific.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:28:08 -08:00
Adrian Bunk 5cfe33d66c e1000e: make a function static
This patch makes the needlessly global reg_pattern_test_array() static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:27:56 -08:00
Mitch Williams efb90e43ff e1000e: add new wakeup cababilities
Ethtool supports wake-on-ARP and wake-on-link, and so does the hardware
supported by e1000e.  This patch just introduces the two.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:26:27 -08:00
Al Viro a39fe742e7 e1000e endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:11 -08:00
Joe Perches 2a88719197 [E1000E]: convert register test macros to functions
Add functions for reg_pattern_test and reg_set_and check
Changed macros to use these functions

Compiled x86, untested

Size decreased ~2K

old:

$ size drivers/net/e1000e/ethtool.o
   text    data     bss     dec     hex filename
  14461       0       0   14461    387d drivers/net/e1000e/ethtool.o

new:

$ size drivers/net/e1000e/ethtool.o
   text    data     bss     dec     hex filename
  12498       0       0   12498    30d2 drivers/net/e1000e/ethtool.o

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:03:51 -08:00
Auke Kok 4198869277 [E1000E]: update netstats traffic counters realtime
formerly e1000/e1000e only updated traffic counters once every
2 seconds with the register values of bytes/packets. With newer
code however in the interrupt and polling code we can real-time
fill in these values in the netstats struct for users to see.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:03:49 -08:00
Auke Kok 040babf9d8 e1000/e1000e: Move PCI-Express device IDs over to e1000e
e1000e will from now on support the PCI-Express adapters that
previously were supported by e1000. This support means better
performance and easier debugging from now on for both the old
PCI-X/PCI hardware and PCI-Express adapters.

This patch also moves 3 recently merged device IDs over to e1000e
that are identical to quad-port versions of already existing
dual port versions. With this last bit every former e1000 pci-e
device should work now with e1000e.

Here is a brief list of which gigabit driver to use with which
adapter:

  e1000:
	82540 -> 82547

  e1000e:
	82571 -> 82573
	ich8, ich9       (82562 or 82566)
	es2lan           (80003eslan)

  igb: (not yet merged, only available from e1000.sf.net)
	82575

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:03:43 -08:00
Auke Kok 1eae4eb2a1 e1000e: Disable L1 ASPM power savings for 82573 mobile variants
L1 ASPM link (pci-e link power savings) has significant benefits
(~1W savings when link is active) but unfortunately does not work
correctly on any of the chipsets that have 82573 on mobile platforms
which causes various nuisances:
 - eeprom reads return garbage information leading to bad eeprom
   checksums
 - long ping times (up to 2 seconds)
 - complete system hangs (freeze/lockup)

A lot of T60 owners have been plagued by this, but other mobile
solutions also suffer from these symptoms.

Disabling L1 ASPM before we activate the PCI-E link fixes all of
these issues at the cost of some power consumption.

Remove a workaround RDTR adjustment that is no longer needed with
this new one.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:03:43 -08:00
Bill Hayes 93ca161027 e1000e: alternate MAC address support
Port alternate MAC address support from the sourceforge
e1000 driver to the upstream e1000e driver.

Signed-off-by: Bill Hayes <bill.hayes@hp.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:03:42 -08:00
Alejandro Martinez Ruiz c00acf46de netdev: ARRAY_SIZE() cleanups
Convert array size calculations to use ARRAY_SIZE().

Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:03:37 -08:00
Alejandro Martinez Ruiz 4c3616cdda netdev: use ARRAY_SIZE() instead of sizeof(array) / ETH_GSTRING_LEN
Using ARRAY_SIZE() on arrays of the form array[][K] makes it unnecessary
to know the value of K when checking its size.

Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:03:36 -08:00
David S. Miller 49d85c502e [NET]: Fix interrupt semaphore corruption in Intel drivers.
Several of the Intel ethernet drivers keep an atomic counter used to
manage when to actually hit the hardware with a disable or an enable.

The way the net_rx_work() breakout logic works during a pending
napi_disable() is that it simply unschedules the poll even if it
still has work.

This can potentially leave interrupts disabled, but that is OK
because all of the drivers are about to disable interrupts
anyways in all such code paths that do a napi_disable().

Unfortunately, this trips up the semaphore used here in the Intel
drivers.  If you hit this case, when you try to bring the interface
back up it won't enable interrupts.  A reload of the driver module
fixes it of course.

So what we do is make sure all the sequences now go:

	napi_disable();
	atomic_set(&adapter->irq_sem, 0);
	*_irq_disable();

which makes sure the counter is always in the correct state.

Reported by Robert Olsson.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-20 20:31:39 -08:00
David S. Miller d2c7ddd626 [NET]: Fix TX timeout regression in Intel drivers.
This fixes a regression added by changeset
53e52c729c ("[NET]: Make ->poll()
breakout consistent in Intel ethernet drivers.")

As pointed out by Jesse Brandeburg, for three of the drivers edited
above there is breakout logic in the *_clean_tx_irq() code to prevent
running TX reclaim forever.  If this occurs, we have to elide NAPI
poll completion or else those TX events will never be serviced.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
2008-01-17 01:49:29 -08:00
David S. Miller 53e52c729c [NET]: Make ->poll() breakout consistent in Intel ethernet drivers.
This makes the ->poll() routines of the E100, E1000, E1000E, IXGB, and
IXGBE drivers complete ->poll() consistently.

Now they will all break out when the amount of RX work done is less
than 'budget'.

At a later time, we may want put back code to include the TX work as
well (as at least one other NAPI driver does, but by in large NAPI
drivers do not do this).  But if so, it should be done consistently
across the board to all of these drivers.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Auke Kok <auke-jan.h.kok@intel.com>
2008-01-08 23:30:14 -08:00
David S. Miller 4ec2411980 [NET]: Do not check netif_running() and carrier state in ->poll()
Drivers do this to try to break out of the ->poll()'ing loop
when the device is being brought administratively down.

Now that we have a napi_disable() "pending" state we are going
to solve that problem generically.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-08 23:30:09 -08:00
Roel Kluin c32bc6e9b0 e1000: fix memcpy in e1000_get_strings
drivers/net/e1000/e1000_ethtool.c:113:
#define E1000_TEST_LEN sizeof(e1000_gstrings_test) / ETH_GSTRING_LEN

drivers/net/e1000e/ethtool.c:106:
#define E1000_TEST_LEN sizeof(e1000_gstrings_test) / ETH_GSTRING_LEN

E1000_TEST_LEN*ETH_GSTRING_LEN will expand to
sizeof(e1000_gstrings_test) / (ETH_GSTRING_LEN * ETH_GSTRING_LEN)

A lack of parentheses around defines causes unexpected results due to
operator precedences.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-12-07 15:01:43 -05:00
Roel Kluin 6e4ca80d27 e1000e: Fix typo ! &
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-30 14:32:17 -04:00
Stephen Hemminger 5a9147bb29 e1000e: fix sparse warnings
Fix sparse warnings from e1000e driver in net-2.6.24.

Added a sparse fix for module param arrays which can have int values
but only the array index needs to be unsigned. --Auke

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-30 14:32:16 -04:00
Auke Kok f920c186be e1000e: Remove legacy jumbo frame receive code
The legacy jumbo frame receive code is no longer needed since all
hardware can do packet split and we're no longer offering a bypass
kernel config option to disable packet split. Remove the unused code.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-29 05:47:08 -04:00
Auke Kok 140a748028 e1000e: Re-enable SECRC - crc stripping
This workaround code performed software stripping instead of the
hardware which can do it much faster. None of the e1000e target
hardware has issues with this feature and should work fine. This
gives us some performance back on receive, and removes some
kludging stripping the 4 bytes.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-29 05:47:08 -04:00
Auke Kok df762464ad e1000e: Fix PBA calculation for jumbo frame packets
Upon inspection the rx FIFO size calculation code was found to have
2 significant flaws: A superfluous minus sign resulting in the
wrong size to be used for jumbo frames on 82573 and ich9, as well
as that this code rewrote the read-only adapter->pba variable
resulting in different values at each run.

Without this patch jumbo's will work but performance will be
awkward since the TX size is not adequate for two whole frames.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-29 05:47:08 -04:00
Auke Kok 47f44e40a3 e1000e: Fix jumbo frame receive code.
Fix allocation and freeing of jumbo frames where several bugs
were recently introduced by cleanups after we forked this code
from e1000. This moves ps_pages to buffer_info where it really
belongs and makes it a dynamically allocated array. The penalty
is not that high since it's allocated outside of the buffer_info
struct anyway.

Without this patch all jumbo frames are completely broken and the
driver panics.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-29 05:47:08 -04:00
Auke Kok 369d742def e1000e: don't poke PHY registers to retreive link status
Apparently poking the link status registers when autonegotiation
is running on the PHY might botch the PHY link on 80003es2lan
devices. While this is a very rare condition we can completely
avoid it alltogether by just using the MAC link bits to provide
the proper information to ethtool.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-16 21:10:27 -04:00
Adrian Bunk e265522ca7 e1000e: fix error checks
Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-16 21:10:27 -04:00
Auke Kok 121244a7bf e1000e: Fix debug printk macro
Spotted by Joe Perches.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-16 21:10:27 -04:00
Auke Kok 309af40b5f e1000e: restore flow control settings properly
After a cable unplug the forced flow control settings were lost
accidentally and the flow control settings fell back to the default
EEPROM determined values. This breaks for people who want to
run without fc enabled - after a cable reset the driver would
refuse to run with fc disabled.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-10 16:55:25 -07:00
Auke Kok 4e6c709c5a e1000e: Simple optimizations in e1000_xmit_frame
After an e1000 patch from Krishna Kumar <krkumar2@in.ibm.com>.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-10 16:55:25 -07:00
Auke Kok 8658251dc3 e1000e: Fix ethtool register test code
A merge/cleanup code accidentally dropped 8254x code in and removed
8257x code here. Undo this mistake and use the pci-e relevant register
test similar as to what is in e1000.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-10 16:54:43 -07:00
Auke Kok 589c085f27 e1000e: fix debugging printout code
A small bug crawled in the -DDEBUG enabled code. Fix this to
properly call the backreference device name.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-10 16:54:42 -07:00
Krishna Kumar 7b5dfe1aa9 e1000e: Do not allow requeue of freed skb
Returning BUSY will make qdisc_restart enqueue the skb which was already
freed. The bad skb was correctly freed and we should return NETDEV_TX_OK.

First spotted by Jeff Garzik on 08/13/07.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-10 16:53:46 -07:00
Jeff Garzik b9f2c0440d [netdrvr] Stop using legacy hooks ->self_test_count, ->get_stats_count
These have been superceded by the new ->get_sset_count() hook.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10 16:51:45 -07:00
Ralf Baechle 10d024c1b2 [NET]: Nuke SET_MODULE_OWNER macro.
It's been a useless no-op for long enough in 2.6 so I figured it's time to
remove it.  The number of people that could object because they're
maintaining unified 2.4 and 2.6 drivers is probably rather small.

[ Handled drivers added by netdev tree and some missed IRDA cases... -DaveM ]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10 16:51:13 -07:00
Auke Kok bc7f75fa97 [E1000E]: New pci-express e1000 driver (currently for ICH9 devices only)
This driver implements support for the ICH9 on-board LAN ethernet
device. The device is similar to ICH8.

The driver encompasses code to support 82571/2/3, es2lan and ICH8
devices as well, but those device IDs are disabled and will be
"lifted" from the e1000 driver over one at a time once this driver
receives some more live time.

Changes to the last snapshot posted are exclusively in the internal
hardware API organization. Many thanks to Jeff Garzik for jumping in
and getting this organized with a keen eye on the future layout.

[ Integrated napi_struct patch from Auke as well... -DaveM ]

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10 16:50:40 -07:00