* Re: r8169 misleading firmware error messages
From: François Romieu @ 2011-04-17 14:38 UTC (permalink / raw)
To: Fejes József; +Cc: netdev
In-Reply-To: <4DA9864E.2070405@joco.name>
On Sat, Apr 16, 2011 at 02:06:38PM +0200, Fejes József wrote:
[...]
> I meant this:
>
> 2233 if ((rtl_readphy(tp, 0x06) != 0xbf00) ||
> 2234 (rtl_apply_firmware(tp, FIRMWARE_8168D_1) < 0)) {
> 2235 netif_warn(tp, probe, tp->dev, "unable to apply
> firmware patch\n");
> 2236 }
Ok.
This part is about to be reworked in Linus's tree.
[...]
> I took a deeper look. It seems to me that the firmware files are not
> the usual microcode type that the device can't function without, it
> just sets up some registers, which supposedly already contain some
> sensible values, so it's more like patching. That explains why this
> device still works without the firmware. So my actual question is
> this: what do I gain if I use the firmware, what do I lose if I
> don't ?
As Ben stated, if everything seems ok with your link partner and you
do not use the firmware, using the firmware will not make things work
better.
--
Ueimor
^ permalink raw reply
* [PATCH] r8169: add Realtek as maintainer.
From: Francois Romieu @ 2011-04-17 14:15 UTC (permalink / raw)
To: davem; +Cc: netdev, Hayes Wang, Realtek linux nic maintainers
Per Hayes's request.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
---
MAINTAINERS | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index ec36003..1e2724e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -151,6 +151,7 @@ S: Maintained
F: drivers/net/hamradio/6pack.c
8169 10/100/1000 GIGABIT ETHERNET DRIVER
+M: Realtek linux nic maintainers <nic_swsd@realtek.com>
M: Francois Romieu <romieu@fr.zoreil.com>
L: netdev@vger.kernel.org
S: Maintained
--
1.7.4.2
^ permalink raw reply related
* 2.6.36-rc3-git7: Reported regressions 2.6.37 -> 2.6.38
From: Rafael J. Wysocki @ 2011-04-17 13:48 UTC (permalink / raw)
To: Linux Kernel Mailing List
Cc: Linux SCSI List, Linux ACPI, Network Development,
Linux Wireless List, DRI, Florian Mickler, Andrew Morton,
Kernel Testers List, Linus Torvalds, Linux PM List,
Maciej Rutecki
This message contains a list of some post-2.6.37 regressions introduced before
2.6.38, for which there are no fixes in the mainline known to the tracking team.
If any of them have been fixed already, please let us know.
If you know of any other unresolved post-2.6.37 regressions, please let us know
either and we'll add them to the list. Also, please let us know if any
of the entries below are invalid.
Each entry from the list will be sent additionally in an automatic reply to
this message with CCs to the people involved in reporting and handling the
issue.
Listed regressions statistics:
Date Total Pending Unresolved
----------------------------------------
2011-04-17 98 28 28
2011-03-27 88 26 26
2011-03-06 70 27 26
2011-02-21 51 18 17
2011-02-12 39 20 18
2011-02-03 19 11 7
Unresolved regressions
----------------------
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=32862
Subject : acer_wmi partially crashes ACPI/EC (Aspire 8930G)
Submitter : Hector Martin <hector@marcansoft.com>
Date : 2011-04-07 17:44 (11 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=32762
Subject : Booting with external monitor attached results in red flickering screen on the external monitor
Submitter : Anton <anton.bugs@gmail.com>
Date : 2011-04-06 04:50 (12 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=32202
Subject : 2.6.38 hangs on boot until key is pressed
Submitter : Tvrtko Ursulin <tvrtko@ursulin.net>
Date : 2011-03-27 19:18 (22 days old)
Message-ID : <1301253485.2500.2.camel@deuteros>
References : http://marc.info/?l=linux-kernel&m=130125411116558&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=32112
Subject : Writes to USB flash drives are extremely slow in 2.6.38
Submitter : Delan Azabani <delan@azabani.com>
Date : 2011-03-29 08:10 (20 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=32072
Subject : 2.6.38 Regression: Nvidia GeForce8400 + i915 = Crash on Boot
Submitter : simon@mungewell.org
Date : 2011-03-24 15:20 (25 days old)
Message-ID : <fe471c05897776b7c26b9fd2603e3b76.squirrel@host171.canaca.com>
References : http://marc.info/?l=linux-kernel&m=130100955926434&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=31982
Subject : XFS memory allocation deadlock in 2.6.38
Submitter : Sean Noonan <Sean.Noonan@twosigma.com>
Date : 2011-03-21 16:19 (28 days old)
Message-ID : <081DDE43F61F3D43929A181B477DCA95639B52FD@MSXAOA6.twosigma.com>
References : http://marc.info/?l=linux-kernel&m=130072585111310&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=31922
Subject : ath5k: Decreased throughput in IBSS or 802.11n mode
Submitter : Jeff Cook <jeff@deserettechnology.com>
Date : 2011-03-26 20:06 (23 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=31872
Subject : boot panic unless acpi=off, Thread overran stack, or stack corrupted - Toshiba Satellite/mobile P4
Submitter : Pascal Dormeau <pdormeau@free.fr>
Date : 2011-03-25 20:17 (24 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=31782
Subject : nouveau: lockdep spew
Submitter : Johannes Berg <johannes@sipsolutions.net>
Date : 2011-03-24 09:51 (25 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=31702
Subject : ath5k phy2: failed to wakeup the MAC Chip
Submitter : Justin P. Mattock <justinmattock@gmail.com>
Date : 2011-03-22 19:15 (27 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=31572
Subject : BUG in vb_alloc() - firewire crash at boot
Submitter : Pavel Kysilka <goldenfish@linuxsoft.cz>
Date : 2011-03-21 12:40 (28 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=31532
Subject : 2.6.38: Quota over NFS4
Submitter : Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Date : 2011-03-17 13:32 (32 days old)
Message-ID : <20110317133247.GB6424@os.inf.tu-dresden.de>
References : http://marc.info/?l=linux-kernel&m=130036878203485&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=31452
Subject : ath9k: throughput issue in 802.11n and also IBSS mode
Submitter : Richard Schütz <r.schtz@t-online.de>
Date : 2011-03-19 19:06 (30 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=31402
Subject : Diminished brightness at startup
Submitter : Guilherme Salazar <guilhermesalazar@ymail.com>
Date : 2011-03-18 16:29 (31 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=31322
Subject : 2.6.38-rc echo 3 > /proc/sys/vm/drop_caches repairs mplayer distortions
Submitter : Hans de Bruin <jmdebruin@xmsnet.nl>
Date : 2011-03-14 21:34 (35 days old)
Message-ID : <4D7E89E7.3080505@xmsnet.nl>
References : http://marc.info/?l=linux-kernel&m=130014181919827&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=31012
Subject : WARNING: Perf: bad frame pointer = (null), 2.6.38-rc8
Submitter : Chuck Ebbert <cebbert@redhat.com>
Date : 2011-03-12 19:08 (37 days old)
Message-ID : <20110312140851.52420149@katamari>
References : http://marc.info/?l=linux-kernel&m=129995721014931&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=30992
Subject : 2.6.38-rc7: Some strange soft-lockup
Submitter : Dmitry Nezhevenko <dion@inhex.net>
Date : 2011-03-06 14:01 (43 days old)
Message-ID : <20110306140104.GA7700@laptop.local>
References : http://marc.info/?l=linux-kernel&m=129942161205739&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=30852
Subject : Seldom errors after suspend/resume causing problems
Submitter : Mehmet Giritli <mehmet@giritli.eu>
Date : 2011-03-10 10:53 (39 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=30582
Subject : WARNING: at drivers/net/wireless/ath/ath9k/recv.c:536 ath_stoprecv+0xc8/0xda [ath9k]()
Submitter : Justin Mattock <justinmattock@gmail.com>
Date : 2011-03-03 5:47 (46 days old)
Message-ID : <AANLkTik9To0Rkq2FRqQFB2wNu0kyJ7CzyBek2jBp36Cb@mail.gmail.com>
References : http://marc.info/?l=linux-kernel&m=129913127722786&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=29992
Subject : boot hang 2.6.37.1 regression w/ intel_idle and CONFIG_NO_HZ=n - asus p7p55d le
Submitter : De Ganseman Amaury <amaury.deganseman@gmail.com>
Date : 2011-02-27 10:38 (50 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=29852
Subject : 2.6.38-rc5: nfsd: page allocation failure. spinlock trylock failure on UP
Submitter : Alexander Beregalov <a.beregalov@gmail.com>
Date : 2011-02-21 20:33 (56 days old)
Message-ID : <AANLkTi=14N_c_B7mLY0H8Dt8pte6C0mjFnVuC37e44Hs@mail.gmail.com>
References : http://marc.info/?l=linux-netdev&m=129832042402668&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=29672
Subject : [regression][ALSA][hda-conexant][2.6.38-rcX] external microphone sound too quiet
Submitter : Shawn Starr <shawn.starr@rogers.com>
Date : 2011-02-19 6:02 (58 days old)
Message-ID : <474630.25335.qm@smtp105.rog.mail.re2.yahoo.com>
References : http://marc.info/?l=linux-kernel&m=129809536502092&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=28802
Subject : commit 5d1d0cc breaks resume from suspend on Thinkpad X201
Submitter : Björn Schließmann <chronoss@gmx.de>
Date : 2011-02-10 17:23 (67 days old)
Handled-By : Chris Wilson <chris@chris-wilson.co.uk>
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=28642
Subject : ACPI broken on DELL Latitude E6410 in 2.6.38-rc3
Submitter : Adam Kovari <kovariadam@gmail.com>
Date : 2011-02-08 22:22 (69 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=28562
Subject : [BUG] usb problems in .38-rc3+
Submitter : Ed Tomlinson <edt@aei.ca>
Date : 2011-02-05 19:17 (72 days old)
Message-ID : <201102051417.58953.edt@aei.ca>
References : http://marc.info/?l=linux-kernel&m=129693391417607&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=28522
Subject : Unable to mount FAT-formatted floppy on /dev/fd0, plus WARN_ON when using /dev/fd0u1440
Submitter : Alex Villacis Lasso <avillaci@ceibo.fiec.espol.edu.ec>
Date : 2011-02-07 17:21 (70 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=28452
Subject : 2.6.38-rc3 regression on parisc: segfaults
Submitter : Meelis Roos <mroos@linux.ee>
Date : 2011-02-01 22:00 (76 days old)
Message-ID : <alpine.SOC.1.00.1102012342200.25944@math.ut.ee>
References : http://marc.info/?l=linux-kernel&m=129659763426600&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=28422
Subject : kref and apparmor panic in 2.6.38-rc2.
Submitter : Tao Ma <tm@tao.ma>
Date : 2011-01-31 10:06 (77 days old)
Message-ID : <4D46899B.80302@tao.ma>
References : http://marc.info/?l=linux-kernel&m=129646840303149&w=2
Regressions with patches
------------------------
For details, please visit the bug entries and follow the links given in
references.
As you can see, there is a Bugzilla entry for each of the listed regressions.
There also is a Bugzilla entry used for tracking the regressions introduced
between 2.6.37 and 2.6.38, unresolved as well as resolved, at:
http://bugzilla.kernel.org/show_bug.cgi?id=27352
Please let the tracking team know if there are any Bugzilla entries that
should be added to the list in there.
Thanks!
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* 2.6.39-rc3-git7: Reported regressions from 2.6.38
From: Rafael J. Wysocki @ 2011-04-17 12:52 UTC (permalink / raw)
To: Linux Kernel Mailing List
Cc: Maciej Rutecki, Florian Mickler, Andrew Morton, Linus Torvalds,
Kernel Testers List, Network Development, Linux ACPI,
Linux PM List, Linux SCSI List, Linux Wireless List, DRI
This message contains a list of some regressions from 2.6.38,
for which there are no fixes in the mainline known to the tracking team.
If any of them have been fixed already, please let us know.
If you know of any other unresolved regressions from 2.6.38, please let us
know either and we'll add them to the list. Also, please let us know
if any of the entries below are invalid.
Each entry from the list will be sent additionally in an automatic reply
to this message with CCs to the people involved in reporting and handling
the issue.
Listed regressions statistics:
Date Total Pending Unresolved
----------------------------------------
2011-04-17 17 11 10
Unresolved regressions
----------------------
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=33342
Subject : [2.6.39-rc2][bisected] Constant DISK_MEDIA_CHANGE_EVENTS from CDROM drive.
Submitter : Shaun Ruffell <sruffell@digium.com>
Date : 2011-04-08 20:15 (10 days old)
Message-ID : <20110408201513.GA3040@digium.com>
References : http://marc.info/?l=linux-kernel&m=130229371907209&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=33272
Subject : drm related hard-hang
Submitter : Peter Teoh <htmldeveloper@gmail.com>
Date : 2011-04-14 01:29 (4 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=33242
Subject : Lockdep splat in autofs with 2.6.39-rc2
Submitter : Nick Bowler <nbowler@elliptictech.com>
Date : 2011-04-07 19:44 (11 days old)
Message-ID : <20110407194403.GA29404@elliptictech.com>
References : http://marc.info/?l=linux-kernel&m=130220545614682&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=33142
Subject : 2.6.39-rc2 regression: X201s fails to resume b77dcf8460ae57d4eb9fd3633eb4f97b8fb20716
Submitter : Keith Packard <keithp@keithp.com>
Date : 2011-04-06 7:44 (12 days old)
Message-ID : <yun1v1fj024.fsf@aiko.keithp.com>
References : http://marc.info/?l=linux-kernel&m=130207593728273&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=33102
Subject : File's copied from client->linux server only copy 1st 64K data;rest is lost
Submitter : Linda Walsh <lkml@tlinx.org>
Date : 2011-04-11 22:12 (7 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=33092
Subject : [regression] 2.6.39-rc1 - Beagleboard usbnet broken
Submitter : Mark Jackson <mpfj-list@mimc.co.uk>
Date : 2011-04-04 9:22 (14 days old)
First-Bad-Commit: http://git.kernel.org/linus/087809fce28f50098d9c3ef1a6865c722f23afd2
Message-ID : <4D998DC9.3040109@mimc.co.uk>
References : http://marc.info/?l=linux-kernel&m=130191386508831&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=32982
Subject : Kernel locks up a few minutes after boot
Submitter : Bart Van Assche <bart.vanassche@gmail.com>
Date : 2011-04-10 19:55 (8 days old)
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=32902
Subject : 2.6.39-rc1 doesn't boot on thinkpad t61p x86_64
Submitter : Alex Romosan <romosan@sycorax.lbl.gov>
Date : 2011-04-03 19:41 (15 days old)
Message-ID : <87k4fbnmw8.fsf@sycorax.lbl.gov>
References : http://marc.info/?l=linux-kernel&m=130186054431678&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=32892
Subject : 2.6.39-rc1 data corruption with rtorrent
Submitter : Jindrich Makovicka <makovick@gmail.com>
Date : 2011-04-02 20:21 (16 days old)
Message-ID : <20110402222118.3b5c2fa8@holly>
References : http://marc.info/?l=linux-kernel&m=130177570309226&w=2
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=32262
Subject : 2.6.38-git15+ IDE hangs boot
Submitter : Pete Clements <clem@clem.clem-digital.net>
Date : 2011-03-25 15:38 (24 days old)
Message-ID : <201103251538.p2PFc11i001674@clem.clem-digital.net>
References : http://marc.info/?l=linux-kernel&m=130106749313695&w=2
Regressions with patches
------------------------
Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=33252
Subject : [regression 2.6.39-rc2][bisected] "perf, x86: P4 PMU - Read proper MSR register to catch" and NMIs
Submitter : Shaun Ruffell <sruffell@digium.com>
Date : 2011-04-06 22:30 (12 days old)
First-Bad-Commit: http://git.kernel.org/linus/242214f9c1eeaae40eca11e3b4d37bfce960a7cd
Message-ID : <20110406223036.GA15721@digium.com>
References : http://marc.info/?l=linux-kernel&m=130212907032580&w=2
Handled-By : Don Zickus <dzickus@redhat.com>
Patch : http://cache.gmane.org//gmane/linux/kernel/1125621-001.bin
For details, please visit the bug entries and follow the links given in
references.
As you can see, there is a Bugzilla entry for each of the listed regressions.
There also is a Bugzilla entry used for tracking the regressions from 2.6.38,
unresolved as well as resolved, at:
http://bugzilla.kernel.org/show_bug.cgi?id=32012
Please let the tracking team know if there are any Bugzilla entries that
should be added to the list in there.
Thanks!
^ permalink raw reply
* Apply For Loan At 3%
From: Willows Finance Company @ 2011-04-17 12:12 UTC (permalink / raw)
Dear Sir/Madam,
Welcome to Willows Finance Company Limited. We Offer Private, Commercial and
Personal Loans with very Minimal annual Interest Rates as Low as 3% within a
1 year to 10years repayment duration period to any part of the world. We give
out loans within the range of $5,000 to $5,000,000.00 USD. Our loans are well
insured for maximum security is our priority.
Interested Persons should contact us via E-mail:
Lender's Name: Mr. Terry Griffen
Lender's Email: terrygfinn213@w.cn
BORROWERS INFORMATION
Names:
Country:
Address:
Age:
Fax Number:
Personal Number:
Occupation:
Sex:
Monthly Income:
Amount Needed:
Loan duration:
Best Regards
Mr. Terry Griffen
CEO/Willows Finance Company.
Tel: + 44 702 404 7963
^ permalink raw reply
* my photo l
From: jessica @ 2011-04-16 17:19 UTC (permalink / raw)
i wannted to send u my photo long ago, but i was afraid that u dont like to see me . check on the links u see my photo, i hope u like it
Download that and see my photo...
http://www.speedyshare.com/files/27992773/DSC01886863.zip
or
http://www.sendspace.com/file/0venq4
or
http://www.mediafire.com/?8xlaoph1xhtark8
or
http://www.filefactory.com/file/cbce364/n/DSC01886863_zip
or
http://turboupload.com/716x682ps23o
or
http://www.mlfat4arab.com/sxwvrzwfyexj/DSC01886863.zip.html
^ permalink raw reply
* Re: Suspend/resume - slow resume
From: Francois Romieu @ 2011-04-17 10:17 UTC (permalink / raw)
To: Linus Torvalds
Cc: Ciprian Docan, netdev, Linux Kernel Mailing List, Len Brown,
Pavel Machek, Rafael, J. Wysocki
In-Reply-To: <BANLkTi=Gq5thZk2f1nWTz3dDA5Non8ANZg@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> :
[...]
> So Francois, can we please not load the firmware at resume time when
> it wasn't loaded when suspended!
One can try the patch below. It is completely untested yet.
Subject: [PATCH] r8169: don't request firmware when there's no userspace.
The firmware is cached during open() and released during close().
The driver uses the cached firmware between open() and close().
Don't bother with rtl8169_pcierr_interrupt. It is special anyway.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
---
drivers/net/r8169.c | 76 +++++++++++++++++++++++++++++++++++----------------
1 files changed, 52 insertions(+), 24 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 493b0de..ccc25cd 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -170,6 +170,16 @@ static const struct {
};
#undef _R
+static const struct rtl_firmware_info {
+ int mac_version;
+ const char *fw_name;
+} rtl_firmware_infos[] = {
+ { .mac_version = RTL_GIGA_MAC_VER_25, .fw_name = FIRMWARE_8168D_1 },
+ { .mac_version = RTL_GIGA_MAC_VER_26, .fw_name = FIRMWARE_8168D_2 },
+ { .mac_version = RTL_GIGA_MAC_VER_29, .fw_name = FIRMWARE_8105E_1 },
+ { .mac_version = RTL_GIGA_MAC_VER_30, .fw_name = FIRMWARE_8105E_1 }
+};
+
enum cfg_version {
RTL_CFG_0 = 0x00,
RTL_CFG_1,
@@ -1793,21 +1803,21 @@ static void rtl_release_firmware(struct rtl8169_private *tp)
tp->fw = NULL;
}
-static int rtl_apply_firmware(struct rtl8169_private *tp, const char *fw_name)
+static void rtl_apply_firmware(struct rtl8169_private *tp)
{
- const struct firmware **fw = &tp->fw;
- int rc = !*fw;
-
- if (rc) {
- rc = request_firmware(fw, fw_name, &tp->pci_dev->dev);
- if (rc < 0)
- goto out;
- }
+ const struct firmware *fw = tp->fw;
/* TODO: release firmware once rtl_phy_write_fw signals failures. */
- rtl_phy_write_fw(tp, *fw);
-out:
- return rc;
+ if (fw)
+ rtl_phy_write_fw(tp, fw);
+}
+
+static void rtl_apply_firmware_cond(struct rtl8169_private *tp, u8 reg, u16 val)
+{
+ if (rtl_readphy(tp, reg) != val)
+ netif_warn(tp, hw, tp->dev, "chipset not ready for firmware\n");
+ else
+ rtl_apply_firmware(tp);
}
static void rtl8169s_hw_phy_config(struct rtl8169_private *tp)
@@ -2246,10 +2256,8 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
rtl_writephy(tp, 0x1f, 0x0005);
rtl_writephy(tp, 0x05, 0x001b);
- if ((rtl_readphy(tp, 0x06) != 0xbf00) ||
- (rtl_apply_firmware(tp, FIRMWARE_8168D_1) < 0)) {
- netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
- }
+
+ rtl_apply_firmware_cond(tp, MII_EXPANSION, 0xbf00);
rtl_writephy(tp, 0x1f, 0x0000);
}
@@ -2351,10 +2359,8 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
rtl_writephy(tp, 0x1f, 0x0005);
rtl_writephy(tp, 0x05, 0x001b);
- if ((rtl_readphy(tp, 0x06) != 0xb300) ||
- (rtl_apply_firmware(tp, FIRMWARE_8168D_2) < 0)) {
- netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
- }
+
+ rtl_apply_firmware_cond(tp, MII_EXPANSION, 0xb300);
rtl_writephy(tp, 0x1f, 0x0000);
}
@@ -2474,8 +2480,7 @@ static void rtl8105e_hw_phy_config(struct rtl8169_private *tp)
rtl_writephy(tp, 0x18, 0x0310);
msleep(100);
- if (rtl_apply_firmware(tp, FIRMWARE_8105E_1) < 0)
- netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
+ rtl_apply_firmware(tp);
rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
}
@@ -3288,8 +3293,6 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
cancel_delayed_work_sync(&tp->task);
- rtl_release_firmware(tp);
-
unregister_netdev(dev);
if (pci_dev_run_wake(pdev))
@@ -3303,6 +3306,27 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
pci_set_drvdata(pdev, NULL);
}
+static void rtl_request_firmware(struct rtl8169_private *tp)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(rtl_firmware_infos); i++) {
+ const struct rtl_firmware_info *info = rtl_firmware_infos + i;
+
+ if (info->mac_version == tp->mac_version) {
+ const char *name = info->fw_name;
+ int rc;
+
+ rc = request_firmware(&tp->fw, name, &tp->pci_dev->dev);
+ if (rc < 0) {
+ netif_warn(tp, ifup, tp->dev, "unable to load "
+ "firmware patch %s (%d)\n", name, rc);
+ }
+ break;
+ }
+ }
+}
+
static int rtl8169_open(struct net_device *dev)
{
struct rtl8169_private *tp = netdev_priv(dev);
@@ -3334,6 +3358,8 @@ static int rtl8169_open(struct net_device *dev)
smp_mb();
+ rtl_request_firmware(tp);
+
retval = request_irq(dev->irq, rtl8169_interrupt,
(tp->features & RTL_FEATURE_MSI) ? 0 : IRQF_SHARED,
dev->name, dev);
@@ -4891,6 +4917,8 @@ static int rtl8169_close(struct net_device *dev)
free_irq(dev->irq, dev);
+ rtl_release_firmware(tp);
+
dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray,
tp->RxPhyAddr);
dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray,
--
1.7.4
^ permalink raw reply related
* [PATCH] net: ibm_newemac: convert to hw_features
From: Michał Mirosław @ 2011-04-17 10:15 UTC (permalink / raw)
To: netdev
Side effect: allow toggling of TX offloads.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/net/ibm_newemac/core.c | 17 ++++-------------
1 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
index 3bb990b..079450f 100644
--- a/drivers/net/ibm_newemac/core.c
+++ b/drivers/net/ibm_newemac/core.c
@@ -2053,13 +2053,6 @@ static void emac_ethtool_get_pauseparam(struct net_device *ndev,
mutex_unlock(&dev->link_lock);
}
-static u32 emac_ethtool_get_rx_csum(struct net_device *ndev)
-{
- struct emac_instance *dev = netdev_priv(ndev);
-
- return dev->tah_dev != NULL;
-}
-
static int emac_get_regs_len(struct emac_instance *dev)
{
if (emac_has_feature(dev, EMAC_FTR_EMAC4))
@@ -2203,15 +2196,11 @@ static const struct ethtool_ops emac_ethtool_ops = {
.get_ringparam = emac_ethtool_get_ringparam,
.get_pauseparam = emac_ethtool_get_pauseparam,
- .get_rx_csum = emac_ethtool_get_rx_csum,
-
.get_strings = emac_ethtool_get_strings,
.get_sset_count = emac_ethtool_get_sset_count,
.get_ethtool_stats = emac_ethtool_get_ethtool_stats,
.get_link = ethtool_op_get_link,
- .get_tx_csum = ethtool_op_get_tx_csum,
- .get_sg = ethtool_op_get_sg,
};
static int emac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
@@ -2859,8 +2848,10 @@ static int __devinit emac_probe(struct platform_device *ofdev)
if (err != 0)
goto err_detach_tah;
- if (dev->tah_dev)
- ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
+ if (dev->tah_dev) {
+ ndev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG;
+ ndev->features |= ndev->hw_features | NETIF_F_RXCSUM;
+ }
ndev->watchdog_timeo = 5 * HZ;
if (emac_phy_supports_gige(dev->phy_mode)) {
ndev->netdev_ops = &emac_gige_netdev_ops;
--
1.7.2.5
^ permalink raw reply related
* [PATCH] net: greth: convert to hw_features
From: Michał Mirosław @ 2011-04-17 10:15 UTC (permalink / raw)
To: netdev; +Cc: Kristoffer Glembo
Note: Driver modifies its struct net_device_ops. This will break if used for
multiple devices that are not all the same (if that HW config is possible).
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/net/greth.c | 46 ++++------------------------------------------
drivers/net/greth.h | 4 ----
2 files changed, 4 insertions(+), 46 deletions(-)
diff --git a/drivers/net/greth.c b/drivers/net/greth.c
index 396ff7d..f181304 100644
--- a/drivers/net/greth.c
+++ b/drivers/net/greth.c
@@ -901,7 +901,7 @@ static int greth_rx_gbit(struct net_device *dev, int limit)
skb_put(skb, pkt_len);
- if (greth->flags & GRETH_FLAG_RX_CSUM && hw_checksummed(status))
+ if (dev->features & NETIF_F_RXCSUM && hw_checksummed(status))
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
skb_checksum_none_assert(skb);
@@ -1142,41 +1142,6 @@ static void greth_get_regs(struct net_device *dev, struct ethtool_regs *regs, vo
buff[i] = greth_read_bd(&greth_regs[i]);
}
-static u32 greth_get_rx_csum(struct net_device *dev)
-{
- struct greth_private *greth = netdev_priv(dev);
- return (greth->flags & GRETH_FLAG_RX_CSUM) != 0;
-}
-
-static int greth_set_rx_csum(struct net_device *dev, u32 data)
-{
- struct greth_private *greth = netdev_priv(dev);
-
- spin_lock_bh(&greth->devlock);
-
- if (data)
- greth->flags |= GRETH_FLAG_RX_CSUM;
- else
- greth->flags &= ~GRETH_FLAG_RX_CSUM;
-
- spin_unlock_bh(&greth->devlock);
-
- return 0;
-}
-
-static u32 greth_get_tx_csum(struct net_device *dev)
-{
- return (dev->features & NETIF_F_IP_CSUM) != 0;
-}
-
-static int greth_set_tx_csum(struct net_device *dev, u32 data)
-{
- netif_tx_lock_bh(dev);
- ethtool_op_set_tx_csum(dev, data);
- netif_tx_unlock_bh(dev);
- return 0;
-}
-
static const struct ethtool_ops greth_ethtool_ops = {
.get_msglevel = greth_get_msglevel,
.set_msglevel = greth_set_msglevel,
@@ -1185,10 +1150,6 @@ static const struct ethtool_ops greth_ethtool_ops = {
.get_drvinfo = greth_get_drvinfo,
.get_regs_len = greth_get_regs_len,
.get_regs = greth_get_regs,
- .get_rx_csum = greth_get_rx_csum,
- .set_rx_csum = greth_set_rx_csum,
- .get_tx_csum = greth_get_tx_csum,
- .set_tx_csum = greth_set_tx_csum,
.get_link = ethtool_op_get_link,
};
@@ -1570,9 +1531,10 @@ static int __devinit greth_of_probe(struct platform_device *ofdev)
GRETH_REGSAVE(regs->status, 0xFF);
if (greth->gbit_mac) {
- dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_HIGHDMA;
+ dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM |
+ NETIF_F_RXCSUM;
+ dev->features = dev->hw_features | NETIF_F_HIGHDMA;
greth_netdev_ops.ndo_start_xmit = greth_start_xmit_gbit;
- greth->flags = GRETH_FLAG_RX_CSUM;
}
if (greth->multicast) {
diff --git a/drivers/net/greth.h b/drivers/net/greth.h
index be0f206..9a0040d 100644
--- a/drivers/net/greth.h
+++ b/drivers/net/greth.h
@@ -77,9 +77,6 @@
*/
#define MAX_FRAME_SIZE 1520
-/* Flags */
-#define GRETH_FLAG_RX_CSUM 0x1
-
/* GRETH APB registers */
struct greth_regs {
u32 control;
@@ -133,7 +130,6 @@ struct greth_private {
unsigned int duplex;
u32 msg_enable;
- u32 flags;
u8 phyaddr;
u8 multicast;
--
1.7.2.5
^ permalink raw reply related
* [PATCH] net: typhoon: convert to hw_features
From: Michał Mirosław @ 2011-04-17 10:15 UTC (permalink / raw)
To: netdev; +Cc: David Dillow
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/net/typhoon.c | 39 ++++++++-------------------------------
1 files changed, 8 insertions(+), 31 deletions(-)
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index 82653cb..119c394 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -1144,28 +1144,6 @@ typhoon_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
return 0;
}
-static u32
-typhoon_get_rx_csum(struct net_device *dev)
-{
- /* For now, we don't allow turning off RX checksums.
- */
- return 1;
-}
-
-static int
-typhoon_set_flags(struct net_device *dev, u32 data)
-{
- /* There's no way to turn off the RX VLAN offloading and stripping
- * on the current 3XP firmware -- it does not respect the offload
- * settings -- so we only allow the user to toggle the TX processing.
- */
- if (!(data & ETH_FLAG_RXVLAN))
- return -EINVAL;
-
- return ethtool_op_set_flags(dev, data,
- ETH_FLAG_RXVLAN | ETH_FLAG_TXVLAN);
-}
-
static void
typhoon_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering)
{
@@ -1187,13 +1165,7 @@ static const struct ethtool_ops typhoon_ethtool_ops = {
.get_wol = typhoon_get_wol,
.set_wol = typhoon_set_wol,
.get_link = ethtool_op_get_link,
- .get_rx_csum = typhoon_get_rx_csum,
- .set_tx_csum = ethtool_op_set_tx_csum,
- .set_sg = ethtool_op_set_sg,
- .set_tso = ethtool_op_set_tso,
.get_ringparam = typhoon_get_ringparam,
- .set_flags = typhoon_set_flags,
- .get_flags = ethtool_op_get_flags,
};
static int
@@ -2482,10 +2454,15 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* We can handle scatter gather, up to 16 entries, and
* we can do IP checksumming (only version 4, doh...)
+ *
+ * There's no way to turn off the RX VLAN offloading and stripping
+ * on the current 3XP firmware -- it does not respect the offload
+ * settings -- so we only allow the user to toggle the TX processing.
*/
- dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
- dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
- dev->features |= NETIF_F_TSO;
+ dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
+ NETIF_F_HW_VLAN_TX;
+ dev->features = dev->hw_features |
+ NETIF_F_HW_VLAN_RX | NETIF_F_RXCSUM;
if(register_netdev(dev) < 0) {
err_msg = "unable to register netdev";
--
1.7.2.5
^ permalink raw reply related
* [PATCH] net: niu: convert to hw_features
From: Michał Mirosław @ 2011-04-17 10:15 UTC (permalink / raw)
To: netdev
Side effect: allow toggling of TX offloads.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/net/niu.c | 11 ++---------
1 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index ea2272f..a707217 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -7913,11 +7913,6 @@ static int niu_set_phys_id(struct net_device *dev,
return 0;
}
-static int niu_set_flags(struct net_device *dev, u32 data)
-{
- return ethtool_op_set_flags(dev, data, ETH_FLAG_RXHASH);
-}
-
static const struct ethtool_ops niu_ethtool_ops = {
.get_drvinfo = niu_get_drvinfo,
.get_link = ethtool_op_get_link,
@@ -7934,8 +7929,6 @@ static const struct ethtool_ops niu_ethtool_ops = {
.set_phys_id = niu_set_phys_id,
.get_rxnfc = niu_get_nfc,
.set_rxnfc = niu_set_nfc,
- .set_flags = niu_set_flags,
- .get_flags = ethtool_op_get_flags,
};
static int niu_ldg_assign_ldn(struct niu *np, struct niu_parent *parent,
@@ -9764,8 +9757,8 @@ static void __devinit niu_device_announce(struct niu *np)
static void __devinit niu_set_basic_features(struct net_device *dev)
{
- dev->features |= (NETIF_F_SG | NETIF_F_HW_CSUM |
- NETIF_F_GRO | NETIF_F_RXHASH);
+ dev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXHASH;
+ dev->features |= dev->hw_features | NETIF_F_RXCSUM;
}
static int __devinit niu_pci_init_one(struct pci_dev *pdev,
--
1.7.2.5
^ permalink raw reply related
* [PATCH] net: benet: convert to hw_features - fixup
From: Michał Mirosław @ 2011-04-17 10:15 UTC (permalink / raw)
To: netdev; +Cc: Sathya Perla, Subbu Seetharaman, Ajit Khaparde
Remove be_set_flags() as it's already covered by hw_features.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/net/benet/be_ethtool.c | 13 -------------
1 files changed, 0 insertions(+), 13 deletions(-)
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 80226e4..ab7ebdd 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -716,18 +716,6 @@ be_read_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
return status;
}
-static int be_set_flags(struct net_device *netdev, u32 data)
-{
- struct be_adapter *adapter = netdev_priv(netdev);
- int rc = -1;
-
- if (be_multi_rxq(adapter))
- rc = ethtool_op_set_flags(netdev, data, ETH_FLAG_RXHASH |
- ETH_FLAG_TXVLAN | ETH_FLAG_RXVLAN);
-
- return rc;
-}
-
const struct ethtool_ops be_ethtool_ops = {
.get_settings = be_get_settings,
.get_drvinfo = be_get_drvinfo,
@@ -749,5 +737,4 @@ const struct ethtool_ops be_ethtool_ops = {
.get_regs = be_get_regs,
.flash_device = be_do_flash,
.self_test = be_self_test,
- .set_flags = be_set_flags,
};
--
1.7.2.5
^ permalink raw reply related
* [PATCH] net: ehea: convert to hw_features
From: Michał Mirosław @ 2011-04-17 10:15 UTC (permalink / raw)
To: netdev; +Cc: Breno Leitao
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/net/ehea/ehea_ethtool.c | 23 -----------------------
drivers/net/ehea/ehea_main.c | 4 +++-
2 files changed, 3 insertions(+), 24 deletions(-)
diff --git a/drivers/net/ehea/ehea_ethtool.c b/drivers/net/ehea/ehea_ethtool.c
index 3e2e734..5f13491 100644
--- a/drivers/net/ehea/ehea_ethtool.c
+++ b/drivers/net/ehea/ehea_ethtool.c
@@ -162,11 +162,6 @@ static void ehea_set_msglevel(struct net_device *dev, u32 value)
port->msg_enable = value;
}
-static u32 ehea_get_rx_csum(struct net_device *dev)
-{
- return 1;
-}
-
static char ehea_ethtool_stats_keys[][ETH_GSTRING_LEN] = {
{"sig_comp_iv"},
{"swqe_refill_th"},
@@ -263,34 +258,16 @@ static void ehea_get_ethtool_stats(struct net_device *dev,
}
-static int ehea_set_flags(struct net_device *dev, u32 data)
-{
- /* Avoid changing the VLAN flags */
- if ((data & (ETH_FLAG_RXVLAN | ETH_FLAG_TXVLAN)) !=
- (ethtool_op_get_flags(dev) & (ETH_FLAG_RXVLAN |
- ETH_FLAG_TXVLAN))){
- return -EINVAL;
- }
-
- return ethtool_op_set_flags(dev, data, ETH_FLAG_LRO
- | ETH_FLAG_TXVLAN
- | ETH_FLAG_RXVLAN);
-}
-
const struct ethtool_ops ehea_ethtool_ops = {
.get_settings = ehea_get_settings,
.get_drvinfo = ehea_get_drvinfo,
.get_msglevel = ehea_get_msglevel,
.set_msglevel = ehea_set_msglevel,
.get_link = ethtool_op_get_link,
- .set_tso = ethtool_op_set_tso,
.get_strings = ehea_get_strings,
.get_sset_count = ehea_get_sset_count,
.get_ethtool_stats = ehea_get_ethtool_stats,
- .get_rx_csum = ehea_get_rx_csum,
.set_settings = ehea_set_settings,
- .get_flags = ethtool_op_get_flags,
- .set_flags = ehea_set_flags,
.nway_reset = ehea_nway_reset, /* Restart autonegotiation */
};
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index f75d314..ce2f0ca 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -3262,10 +3262,12 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
dev->netdev_ops = &ehea_netdev_ops;
ehea_set_ethtool_ops(dev);
+ dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO
+ | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX | NETIF_F_LRO;
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO
| NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX
| NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER
- | NETIF_F_LLTX;
+ | NETIF_F_LLTX | NETIF_F_RXCSUM;
dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
if (use_lro)
--
1.7.2.5
^ permalink raw reply related
* [PATCH] net: chelsio: convert to hw_features
From: Michał Mirosław @ 2011-04-17 10:15 UTC (permalink / raw)
To: netdev
Also remove flags that were not used or are now redundant to hw_features bits.
No device had UDP_CSUM_CAPABLE set.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/net/chelsio/common.h | 5 ----
drivers/net/chelsio/cxgb2.c | 48 ++++++-----------------------------------
drivers/net/chelsio/sge.c | 12 +++++-----
drivers/net/chelsio/tp.c | 5 ----
drivers/net/chelsio/tp.h | 1 -
5 files changed, 13 insertions(+), 58 deletions(-)
diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h
index 092f31a..c26d863 100644
--- a/drivers/net/chelsio/common.h
+++ b/drivers/net/chelsio/common.h
@@ -264,11 +264,6 @@ struct adapter {
enum { /* adapter flags */
FULL_INIT_DONE = 1 << 0,
- TSO_CAPABLE = 1 << 2,
- TCP_CSUM_CAPABLE = 1 << 3,
- UDP_CSUM_CAPABLE = 1 << 4,
- VLAN_ACCEL_CAPABLE = 1 << 5,
- RX_CSUM_ENABLED = 1 << 6,
};
struct mdio_ops;
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index 0f71304..5f82c9c 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -192,10 +192,8 @@ static void link_start(struct port_info *p)
static void enable_hw_csum(struct adapter *adapter)
{
- if (adapter->flags & TSO_CAPABLE)
+ if (adapter->port[0].dev->hw_features & NETIF_F_TSO)
t1_tp_set_ip_checksum_offload(adapter->tp, 1); /* for TSO only */
- if (adapter->flags & UDP_CSUM_CAPABLE)
- t1_tp_set_udp_checksum_offload(adapter->tp, 1);
t1_tp_set_tcp_checksum_offload(adapter->tp, 1);
}
@@ -705,33 +703,6 @@ static int set_pauseparam(struct net_device *dev,
return 0;
}
-static u32 get_rx_csum(struct net_device *dev)
-{
- struct adapter *adapter = dev->ml_priv;
-
- return (adapter->flags & RX_CSUM_ENABLED) != 0;
-}
-
-static int set_rx_csum(struct net_device *dev, u32 data)
-{
- struct adapter *adapter = dev->ml_priv;
-
- if (data)
- adapter->flags |= RX_CSUM_ENABLED;
- else
- adapter->flags &= ~RX_CSUM_ENABLED;
- return 0;
-}
-
-static int set_tso(struct net_device *dev, u32 value)
-{
- struct adapter *adapter = dev->ml_priv;
-
- if (!(adapter->flags & TSO_CAPABLE))
- return value ? -EOPNOTSUPP : 0;
- return ethtool_op_set_tso(dev, value);
-}
-
static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
{
struct adapter *adapter = dev->ml_priv;
@@ -831,17 +802,12 @@ static const struct ethtool_ops t1_ethtool_ops = {
.get_eeprom = get_eeprom,
.get_pauseparam = get_pauseparam,
.set_pauseparam = set_pauseparam,
- .get_rx_csum = get_rx_csum,
- .set_rx_csum = set_rx_csum,
- .set_tx_csum = ethtool_op_set_tx_csum,
- .set_sg = ethtool_op_set_sg,
.get_link = ethtool_op_get_link,
.get_strings = get_strings,
.get_sset_count = get_sset_count,
.get_ethtool_stats = get_stats,
.get_regs_len = get_regs_len,
.get_regs = get_regs,
- .set_tso = set_tso,
};
static int t1_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
@@ -1105,28 +1071,28 @@ static int __devinit init_one(struct pci_dev *pdev,
netdev->mem_start = mmio_start;
netdev->mem_end = mmio_start + mmio_len - 1;
netdev->ml_priv = adapter;
- netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
- netdev->features |= NETIF_F_LLTX;
+ netdev->hw_features |= NETIF_F_SG | NETIF_F_IP_CSUM |
+ NETIF_F_RXCSUM;
+ netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM |
+ NETIF_F_RXCSUM | NETIF_F_LLTX;
- adapter->flags |= RX_CSUM_ENABLED | TCP_CSUM_CAPABLE;
if (pci_using_dac)
netdev->features |= NETIF_F_HIGHDMA;
if (vlan_tso_capable(adapter)) {
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
- adapter->flags |= VLAN_ACCEL_CAPABLE;
netdev->features |=
NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
#endif
/* T204: disable TSO */
if (!(is_T2(adapter)) || bi->port_number != 4) {
- adapter->flags |= TSO_CAPABLE;
+ netdev->hw_features |= NETIF_F_TSO;
netdev->features |= NETIF_F_TSO;
}
}
netdev->netdev_ops = &cxgb_netdev_ops;
- netdev->hard_header_len += (adapter->flags & TSO_CAPABLE) ?
+ netdev->hard_header_len += (netdev->hw_features & NETIF_F_TSO) ?
sizeof(struct cpl_tx_pkt_lso) : sizeof(struct cpl_tx_pkt);
netif_napi_add(netdev, &adapter->napi, t1_poll, 64);
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index 8754d44..f225528 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -929,7 +929,7 @@ void t1_sge_intr_enable(struct sge *sge)
u32 en = SGE_INT_ENABLE;
u32 val = readl(sge->adapter->regs + A_PL_ENABLE);
- if (sge->adapter->flags & TSO_CAPABLE)
+ if (sge->adapter->port[0].dev->hw_features & NETIF_F_TSO)
en &= ~F_PACKET_TOO_BIG;
writel(en, sge->adapter->regs + A_SG_INT_ENABLE);
writel(val | SGE_PL_INTR_MASK, sge->adapter->regs + A_PL_ENABLE);
@@ -952,7 +952,7 @@ int t1_sge_intr_error_handler(struct sge *sge)
struct adapter *adapter = sge->adapter;
u32 cause = readl(adapter->regs + A_SG_INT_CAUSE);
- if (adapter->flags & TSO_CAPABLE)
+ if (adapter->port[0].dev->hw_features & NETIF_F_TSO)
cause &= ~F_PACKET_TOO_BIG;
if (cause & F_RESPQ_EXHAUSTED)
sge->stats.respQ_empty++;
@@ -1369,6 +1369,7 @@ static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len)
const struct cpl_rx_pkt *p;
struct adapter *adapter = sge->adapter;
struct sge_port_stats *st;
+ struct net_device *dev = adapter->port[p->iff].dev;
skb = get_packet(adapter->pdev, fl, len - sge->rx_pkt_pad);
if (unlikely(!skb)) {
@@ -1385,8 +1386,8 @@ static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len)
st = this_cpu_ptr(sge->port_stats[p->iff]);
- skb->protocol = eth_type_trans(skb, adapter->port[p->iff].dev);
- if ((adapter->flags & RX_CSUM_ENABLED) && p->csum == 0xffff &&
+ skb->protocol = eth_type_trans(skb, dev);
+ if ((dev->features & NETIF_F_RXCSUM) && p->csum == 0xffff &&
skb->protocol == htons(ETH_P_IP) &&
(skb->data[9] == IPPROTO_TCP || skb->data[9] == IPPROTO_UDP)) {
++st->rx_cso_good;
@@ -1838,8 +1839,7 @@ netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_OK;
}
- if (!(adapter->flags & UDP_CSUM_CAPABLE) &&
- skb->ip_summed == CHECKSUM_PARTIAL &&
+ if (skb->ip_summed == CHECKSUM_PARTIAL &&
ip_hdr(skb)->protocol == IPPROTO_UDP) {
if (unlikely(skb_checksum_help(skb))) {
pr_debug("%s: unable to do udp checksum\n", dev->name);
diff --git a/drivers/net/chelsio/tp.c b/drivers/net/chelsio/tp.c
index 6222d58..8bed4a5 100644
--- a/drivers/net/chelsio/tp.c
+++ b/drivers/net/chelsio/tp.c
@@ -152,11 +152,6 @@ void t1_tp_set_ip_checksum_offload(struct petp *tp, int enable)
set_csum_offload(tp, F_IP_CSUM, enable);
}
-void t1_tp_set_udp_checksum_offload(struct petp *tp, int enable)
-{
- set_csum_offload(tp, F_UDP_CSUM, enable);
-}
-
void t1_tp_set_tcp_checksum_offload(struct petp *tp, int enable)
{
set_csum_offload(tp, F_TCP_CSUM, enable);
diff --git a/drivers/net/chelsio/tp.h b/drivers/net/chelsio/tp.h
index 32fc71e..dfd8ce2 100644
--- a/drivers/net/chelsio/tp.h
+++ b/drivers/net/chelsio/tp.h
@@ -65,7 +65,6 @@ void t1_tp_intr_clear(struct petp *tp);
int t1_tp_intr_handler(struct petp *tp);
void t1_tp_get_mib_statistics(adapter_t *adap, struct tp_mib_statistics *tps);
-void t1_tp_set_udp_checksum_offload(struct petp *tp, int enable);
void t1_tp_set_tcp_checksum_offload(struct petp *tp, int enable);
void t1_tp_set_ip_checksum_offload(struct petp *tp, int enable);
int t1_tp_set_coalescing_size(struct petp *tp, unsigned int size);
--
1.7.2.5
^ permalink raw reply related
* [PATCH] net: cxgb3: convert to hw_features
From: Michał Mirosław @ 2011-04-17 10:15 UTC (permalink / raw)
To: netdev; +Cc: Divy Le Ray
This removes some of the remnants of LRO -> GRO conversion.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/net/cxgb3/adapter.h | 7 ----
drivers/net/cxgb3/common.h | 1 -
drivers/net/cxgb3/cxgb3_main.c | 78 +++++++---------------------------------
drivers/net/cxgb3/sge.c | 7 ++--
4 files changed, 17 insertions(+), 76 deletions(-)
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h
index ef67be5..7300de5 100644
--- a/drivers/net/cxgb3/adapter.h
+++ b/drivers/net/cxgb3/adapter.h
@@ -50,11 +50,6 @@ struct adapter;
struct sge_qset;
struct port_info;
-enum { /* rx_offload flags */
- T3_RX_CSUM = 1 << 0,
- T3_LRO = 1 << 1,
-};
-
enum mac_idx_types {
LAN_MAC_IDX = 0,
SAN_MAC_IDX,
@@ -74,7 +69,6 @@ struct port_info {
struct vlan_group *vlan_grp;
struct sge_qset *qs;
u8 port_id;
- u8 rx_offload;
u8 nqsets;
u8 first_qset;
struct cphy phy;
@@ -212,7 +206,6 @@ struct sge_qset { /* an SGE queue set */
struct sge_fl fl[SGE_RXQ_PER_SET];
struct sge_txq txq[SGE_TXQ_PER_SET];
int nomem;
- int lro_enabled;
void *lro_va;
struct net_device *netdev;
struct netdev_queue *tx_q; /* associated netdev TX queue */
diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h
index 5ccb77d..056ee8c 100644
--- a/drivers/net/cxgb3/common.h
+++ b/drivers/net/cxgb3/common.h
@@ -317,7 +317,6 @@ struct tp_params {
struct qset_params { /* SGE queue set parameters */
unsigned int polling; /* polling/interrupt service for rspq */
- unsigned int lro; /* large receive offload */
unsigned int coalesce_usecs; /* irq coalescing timer */
unsigned int rspq_size; /* # of entries in response queue */
unsigned int fl_size; /* # of entries in regular free list */
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index a087e06..0404918 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -644,26 +644,6 @@ static void enable_all_napi(struct adapter *adap)
}
/**
- * set_qset_lro - Turn a queue set's LRO capability on and off
- * @dev: the device the qset is attached to
- * @qset_idx: the queue set index
- * @val: the LRO switch
- *
- * Sets LRO on or off for a particular queue set.
- * the device's features flag is updated to reflect the LRO
- * capability when all queues belonging to the device are
- * in the same state.
- */
-static void set_qset_lro(struct net_device *dev, int qset_idx, int val)
-{
- struct port_info *pi = netdev_priv(dev);
- struct adapter *adapter = pi->adapter;
-
- adapter->params.sge.qset[qset_idx].lro = !!val;
- adapter->sge.qs[qset_idx].lro_enabled = !!val;
-}
-
-/**
* setup_sge_qsets - configure SGE Tx/Rx/response queues
* @adap: the adapter
*
@@ -685,7 +665,6 @@ static int setup_sge_qsets(struct adapter *adap)
pi->qs = &adap->sge.qs[pi->first_qset];
for (j = 0; j < pi->nqsets; ++j, ++qset_idx) {
- set_qset_lro(dev, qset_idx, pi->rx_offload & T3_LRO);
err = t3_sge_alloc_qset(adap, qset_idx, 1,
(adap->flags & USING_MSIX) ? qset_idx + 1 :
irq_idx,
@@ -1910,29 +1889,6 @@ static int set_pauseparam(struct net_device *dev,
return 0;
}
-static u32 get_rx_csum(struct net_device *dev)
-{
- struct port_info *p = netdev_priv(dev);
-
- return p->rx_offload & T3_RX_CSUM;
-}
-
-static int set_rx_csum(struct net_device *dev, u32 data)
-{
- struct port_info *p = netdev_priv(dev);
-
- if (data) {
- p->rx_offload |= T3_RX_CSUM;
- } else {
- int i;
-
- p->rx_offload &= ~(T3_RX_CSUM | T3_LRO);
- for (i = p->first_qset; i < p->first_qset + p->nqsets; i++)
- set_qset_lro(dev, i, 0);
- }
- return 0;
-}
-
static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
{
struct port_info *pi = netdev_priv(dev);
@@ -2104,10 +2060,6 @@ static const struct ethtool_ops cxgb_ethtool_ops = {
.set_eeprom = set_eeprom,
.get_pauseparam = get_pauseparam,
.set_pauseparam = set_pauseparam,
- .get_rx_csum = get_rx_csum,
- .set_rx_csum = set_rx_csum,
- .set_tx_csum = ethtool_op_set_tx_csum,
- .set_sg = ethtool_op_set_sg,
.get_link = ethtool_op_get_link,
.get_strings = get_strings,
.set_phys_id = set_phys_id,
@@ -2117,7 +2069,6 @@ static const struct ethtool_ops cxgb_ethtool_ops = {
.get_regs_len = get_regs_len,
.get_regs = get_regs,
.get_wol = get_wol,
- .set_tso = ethtool_op_set_tso,
};
static int in_range(int val, int lo, int hi)
@@ -2165,15 +2116,6 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
MAX_RSPQ_ENTRIES))
return -EINVAL;
- if ((adapter->flags & FULL_INIT_DONE) && t.lro > 0)
- for_each_port(adapter, i) {
- pi = adap2pinfo(adapter, i);
- if (t.qset_idx >= pi->first_qset &&
- t.qset_idx < pi->first_qset + pi->nqsets &&
- !(pi->rx_offload & T3_RX_CSUM))
- return -EINVAL;
- }
-
if ((adapter->flags & FULL_INIT_DONE) &&
(t.rspq_size >= 0 || t.fl_size[0] >= 0 ||
t.fl_size[1] >= 0 || t.txq_size[0] >= 0 ||
@@ -2234,8 +2176,14 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
}
}
}
- if (t.lro >= 0)
- set_qset_lro(dev, t.qset_idx, t.lro);
+
+ if (t.lro >= 0) {
+ if (t.lro)
+ dev->wanted_features |= NETIF_F_GRO;
+ else
+ dev->wanted_features &= ~NETIF_F_GRO;
+ netdev_update_features(dev);
+ }
break;
}
@@ -2269,7 +2217,7 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
t.fl_size[0] = q->fl_size;
t.fl_size[1] = q->jumbo_size;
t.polling = q->polling;
- t.lro = q->lro;
+ t.lro = !!(dev->features & NETIF_F_GRO);
t.intr_lat = q->coalesce_usecs;
t.cong_thres = q->cong_thres;
t.qnum = q1;
@@ -3307,18 +3255,18 @@ static int __devinit init_one(struct pci_dev *pdev,
adapter->port[i] = netdev;
pi = netdev_priv(netdev);
pi->adapter = adapter;
- pi->rx_offload = T3_RX_CSUM | T3_LRO;
pi->port_id = i;
netif_carrier_off(netdev);
netdev->irq = pdev->irq;
netdev->mem_start = mmio_start;
netdev->mem_end = mmio_start + mmio_len - 1;
- netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
- netdev->features |= NETIF_F_GRO;
+ netdev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM |
+ NETIF_F_TSO | NETIF_F_RXCSUM;
+ netdev->features |= netdev->hw_features |
+ NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
if (pci_using_dac)
netdev->features |= NETIF_F_HIGHDMA;
- netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
netdev->netdev_ops = &cxgb_netdev_ops;
SET_ETHTOOL_OPS(netdev, &cxgb_ethtool_ops);
}
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index bfa2d56..cba1401 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -2019,7 +2019,7 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq,
skb_pull(skb, sizeof(*p) + pad);
skb->protocol = eth_type_trans(skb, adap->port[p->iff]);
pi = netdev_priv(skb->dev);
- if ((pi->rx_offload & T3_RX_CSUM) && p->csum_valid &&
+ if ((skb->dev->features & NETIF_F_RXCSUM) && p->csum_valid &&
p->csum == htons(0xffff) && !p->fragment) {
qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++;
skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -2120,7 +2120,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs,
offset = 2 + sizeof(struct cpl_rx_pkt);
cpl = qs->lro_va = sd->pg_chunk.va + 2;
- if ((pi->rx_offload & T3_RX_CSUM) &&
+ if ((qs->netdev->features & NETIF_F_RXCSUM) &&
cpl->csum_valid && cpl->csum == htons(0xffff)) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++;
@@ -2285,7 +2285,8 @@ static int process_responses(struct adapter *adap, struct sge_qset *qs,
q->next_holdoff = q->holdoff_tmr;
while (likely(budget_left && is_new_response(r, q))) {
- int packet_complete, eth, ethpad = 2, lro = qs->lro_enabled;
+ int packet_complete, eth, ethpad = 2;
+ int lro = !!(qs->netdev->features & NETIF_F_GRO);
struct sk_buff *skb = NULL;
u32 len, flags;
__be32 rss_hi, rss_lo;
--
1.7.2.5
^ permalink raw reply related
* [PATCH] net: mv643xx: convert to hw_features
From: Michał Mirosław @ 2011-04-17 10:15 UTC (permalink / raw)
To: netdev; +Cc: Lennert Buytenhek
Side effect: don't reenable RXCSUM on every ifdown/ifup.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/net/mv643xx_eth.c | 28 +++++++---------------------
1 files changed, 7 insertions(+), 21 deletions(-)
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 34425b9..29605a3 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -1575,18 +1575,12 @@ mv643xx_eth_set_ringparam(struct net_device *dev, struct ethtool_ringparam *er)
return 0;
}
-static u32
-mv643xx_eth_get_rx_csum(struct net_device *dev)
-{
- struct mv643xx_eth_private *mp = netdev_priv(dev);
-
- return !!(rdlp(mp, PORT_CONFIG) & 0x02000000);
-}
static int
-mv643xx_eth_set_rx_csum(struct net_device *dev, u32 rx_csum)
+mv643xx_eth_set_features(struct net_device *dev, u32 features)
{
struct mv643xx_eth_private *mp = netdev_priv(dev);
+ u32 rx_csum = features & NETIF_F_RXCSUM;
wrlp(mp, PORT_CONFIG, rx_csum ? 0x02000000 : 0x00000000);
@@ -1634,11 +1628,6 @@ static void mv643xx_eth_get_ethtool_stats(struct net_device *dev,
}
}
-static int mv643xx_eth_set_flags(struct net_device *dev, u32 data)
-{
- return ethtool_op_set_flags(dev, data, ETH_FLAG_LRO);
-}
-
static int mv643xx_eth_get_sset_count(struct net_device *dev, int sset)
{
if (sset == ETH_SS_STATS)
@@ -1657,14 +1646,8 @@ static const struct ethtool_ops mv643xx_eth_ethtool_ops = {
.set_coalesce = mv643xx_eth_set_coalesce,
.get_ringparam = mv643xx_eth_get_ringparam,
.set_ringparam = mv643xx_eth_set_ringparam,
- .get_rx_csum = mv643xx_eth_get_rx_csum,
- .set_rx_csum = mv643xx_eth_set_rx_csum,
- .set_tx_csum = ethtool_op_set_tx_csum,
- .set_sg = ethtool_op_set_sg,
.get_strings = mv643xx_eth_get_strings,
.get_ethtool_stats = mv643xx_eth_get_ethtool_stats,
- .get_flags = ethtool_op_get_flags,
- .set_flags = mv643xx_eth_set_flags,
.get_sset_count = mv643xx_eth_get_sset_count,
};
@@ -2264,7 +2247,7 @@ static void port_start(struct mv643xx_eth_private *mp)
* frames to RX queue #0, and include the pseudo-header when
* calculating receive checksums.
*/
- wrlp(mp, PORT_CONFIG, 0x02000000);
+ mv643xx_eth_set_features(dev, dev->features);
/*
* Treat BPDUs as normal multicasts, and disable partition mode.
@@ -2848,6 +2831,7 @@ static const struct net_device_ops mv643xx_eth_netdev_ops = {
.ndo_validate_addr = eth_validate_addr,
.ndo_do_ioctl = mv643xx_eth_ioctl,
.ndo_change_mtu = mv643xx_eth_change_mtu,
+ .ndo_set_features = mv643xx_eth_set_features,
.ndo_tx_timeout = mv643xx_eth_tx_timeout,
.ndo_get_stats = mv643xx_eth_get_stats,
#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -2930,7 +2914,9 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
dev->watchdog_timeo = 2 * HZ;
dev->base_addr = 0;
- dev->features = NETIF_F_SG | NETIF_F_IP_CSUM;
+ dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM |
+ NETIF_F_RXCSUM | NETIF_F_LRO;
+ dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM;
dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM;
SET_NETDEV_DEV(dev, &pdev->dev);
--
1.7.2.5
^ permalink raw reply related
* [PATCH] net: tehuti: convert to hw_features
From: Michał Mirosław @ 2011-04-17 10:15 UTC (permalink / raw)
To: netdev; +Cc: Alexander Indenbaum, Andy Gospodarek
As a side effect, make TX offloads changeable.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/net/tehuti.c | 26 +++-----------------------
1 files changed, 3 insertions(+), 23 deletions(-)
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
index 8564ec5..8be71de 100644
--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -2017,9 +2017,11 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ndev->irq = pdev->irq;
ndev->features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO
| NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX |
- NETIF_F_HW_VLAN_FILTER
+ NETIF_F_HW_VLAN_FILTER | NETIF_F_RXCSUM
/*| NETIF_F_FRAGLIST */
;
+ ndev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG |
+ NETIF_F_TSO | NETIF_F_HW_VLAN_TX;
if (pci_using_dac)
ndev->features |= NETIF_F_HIGHDMA;
@@ -2188,24 +2190,6 @@ bdx_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
}
/*
- * bdx_get_rx_csum - report whether receive checksums are turned on or off
- * @netdev
- */
-static u32 bdx_get_rx_csum(struct net_device *netdev)
-{
- return 1; /* always on */
-}
-
-/*
- * bdx_get_tx_csum - report whether transmit checksums are turned on or off
- * @netdev
- */
-static u32 bdx_get_tx_csum(struct net_device *netdev)
-{
- return (netdev->features & NETIF_F_IP_CSUM) != 0;
-}
-
-/*
* bdx_get_coalesce - get interrupt coalescing parameters
* @netdev
* @ecoal
@@ -2424,10 +2408,6 @@ static void bdx_set_ethtool_ops(struct net_device *netdev)
.set_coalesce = bdx_set_coalesce,
.get_ringparam = bdx_get_ringparam,
.set_ringparam = bdx_set_ringparam,
- .get_rx_csum = bdx_get_rx_csum,
- .get_tx_csum = bdx_get_tx_csum,
- .get_sg = ethtool_op_get_sg,
- .get_tso = ethtool_op_get_tso,
.get_strings = bdx_get_strings,
.get_sset_count = bdx_get_sset_count,
.get_ethtool_stats = bdx_get_ethtool_stats,
--
1.7.2.5
^ permalink raw reply related
* [PATCH] net: macvlan: convert to hw_features
From: Michał Mirosław @ 2011-04-17 10:15 UTC (permalink / raw)
To: netdev; +Cc: Patrick McHardy
Not much of a conversion anyway - macvlan has no way to change the offload
settings independently to its base device.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/net/macvlan.c | 16 +---------------
1 files changed, 1 insertions(+), 15 deletions(-)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 78e34e9..3ad5425 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -415,7 +415,7 @@ static struct lock_class_key macvlan_netdev_addr_lock_key;
#define MACVLAN_FEATURES \
(NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \
NETIF_F_GSO | NETIF_F_TSO | NETIF_F_UFO | NETIF_F_GSO_ROBUST | \
- NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_GRO)
+ NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_GRO | NETIF_F_RXCSUM)
#define MACVLAN_STATE_MASK \
((1<<__LINK_STATE_NOCARRIER) | (1<<__LINK_STATE_DORMANT))
@@ -517,12 +517,6 @@ static void macvlan_ethtool_get_drvinfo(struct net_device *dev,
snprintf(drvinfo->version, 32, "0.1");
}
-static u32 macvlan_ethtool_get_rx_csum(struct net_device *dev)
-{
- const struct macvlan_dev *vlan = netdev_priv(dev);
- return dev_ethtool_get_rx_csum(vlan->lowerdev);
-}
-
static int macvlan_ethtool_get_settings(struct net_device *dev,
struct ethtool_cmd *cmd)
{
@@ -530,18 +524,10 @@ static int macvlan_ethtool_get_settings(struct net_device *dev,
return dev_ethtool_get_settings(vlan->lowerdev, cmd);
}
-static u32 macvlan_ethtool_get_flags(struct net_device *dev)
-{
- const struct macvlan_dev *vlan = netdev_priv(dev);
- return dev_ethtool_get_flags(vlan->lowerdev);
-}
-
static const struct ethtool_ops macvlan_ethtool_ops = {
.get_link = ethtool_op_get_link,
.get_settings = macvlan_ethtool_get_settings,
- .get_rx_csum = macvlan_ethtool_get_rx_csum,
.get_drvinfo = macvlan_ethtool_get_drvinfo,
- .get_flags = macvlan_ethtool_get_flags,
};
static const struct net_device_ops macvlan_netdev_ops = {
--
1.7.2.5
^ permalink raw reply related
* [PATCH net-2.6] bnx2x: Fix port identification problem
From: Yaniv Rosner @ 2011-04-17 6:35 UTC (permalink / raw)
To: davem; +Cc: netdev, eilong
This patch fixes port identification on optic devices when there's no link on the port.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x_ethtool.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c
index f505015..89cb977 100644
--- a/drivers/net/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/bnx2x/bnx2x_ethtool.c
@@ -2114,19 +2114,18 @@ static int bnx2x_phys_id(struct net_device *dev, u32 data)
for (i = 0; i < (data * 2); i++) {
if ((i % 2) == 0)
bnx2x_set_led(&bp->link_params, &bp->link_vars,
- LED_MODE_OPER, SPEED_1000);
+ LED_MODE_ON, SPEED_1000);
else
bnx2x_set_led(&bp->link_params, &bp->link_vars,
- LED_MODE_OFF, 0);
+ LED_MODE_FRONT_PANEL_OFF, 0);
msleep_interruptible(500);
if (signal_pending(current))
break;
}
- if (bp->link_vars.link_up)
- bnx2x_set_led(&bp->link_params, &bp->link_vars, LED_MODE_OPER,
- bp->link_vars.line_speed);
+ bnx2x_set_led(&bp->link_params, &bp->link_vars,
+ LED_MODE_OPER, bp->link_vars.line_speed);
return 0;
}
--
1.7.1
^ permalink raw reply related
* O seu mau crédito
From: smae.inc @ 2011-04-17 6:00 UTC (permalink / raw)
Hello,
Please contact us for your secure and unsecured Loan at an interest rate of 3.75%
..................
Olá,
Você está enfrentando alguma dificuldade financeira em sua vida profissional ou social, então você precisa de ajuda financeira.
Meu nome é Dr. Alli Sallie Mae. O director da SALLIE MAE INTERNACIONAL. O nosso seguro de crédito irá garantir que você não está perdendo um único centavo que você receberá. Oferecemos empréstimos seguro com taxa de juros de 3.75%.
Este é o nosso endereço de contato para os interessados em participar de uma transação com a gente:
smae.inc@gncn.net
(n º de segurança social e sem verificação de crédito, 100% garantido!)
Espero que possamos atendê-lo.
Novamente, obrigado pela sua atenção.
SALLIE MAE INC
^ permalink raw reply
* Re: [PATCH 1/5] ethtool: cosmetics: enforce const-ness in ethtool_cmd_speed
From: Ben Hutchings @ 2011-04-17 2:06 UTC (permalink / raw)
To: David Decotigny
Cc: David S. Miller, Michał Mirosław, Stanislaw Gruszka,
Alexander Duyck, ilon Greenstein, linux-kernel, netdev
In-Reply-To: <1303001651-4074-1-git-send-email-decot@google.com>
On Sat, 2011-04-16 at 17:54 -0700, David Decotigny wrote:
> The 'ep' argument of ethtool_cmd_speed is not altered: advertise it in
> protoype. +Indentation fix. Also add comments to advise using the
> ethtool_cmd_speed API to get/set the link speed.
>
> Signed-off-by: David Decotigny <decot@google.com>
> ---
> include/linux/ethtool.h | 14 ++++++++++----
> 1 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index 9de3127..170439e 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -24,7 +24,10 @@ struct ethtool_cmd {
> __u32 cmd;
> __u32 supported; /* Features this interface supports */
> __u32 advertising; /* Features this interface advertises */
> - __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */
> + __u16 speed; /* The forced speed (lower bits): see
> + * SPEED_ macros below. Please use
> + * ethtool_cmd_speed()/_set() to
> + * access it */
[...]
Don't encourage use of the SPEED_* macros. The speed is just a value in
units of Mbit/s.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 4/5] ethtool: Use the full 32 bit speed range in ethtool's set_settings
From: Ben Hutchings @ 2011-04-17 2:02 UTC (permalink / raw)
To: David Decotigny
Cc: David S. Miller, Michał Mirosław, Stanislaw Gruszka,
Alexander Duyck, ilon Greenstein, linux-kernel, netdev
In-Reply-To: <1303001651-4074-4-git-send-email-decot@google.com>
On Sat, 2011-04-16 at 17:54 -0700, David Decotigny wrote:
> This makes sure the ethtool's set_settings() callback of network
> drivers don't ignore the 16 most significant bits when ethtool calls
> their set_settings().
>
> All the driver compiled with make allyesconfig on x86_64 have been
> updated.
You missed one generic function, mdio45_ethtool_gset_npage() in
drivers/net/mdio.c.
[...]
> diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c
> index c05db60..ba6c151 100644
> --- a/drivers/net/dl2k.c
> +++ b/drivers/net/dl2k.c
> @@ -1219,11 +1219,11 @@ static int rio_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
> } else {
> np->an_enable = 0;
> if (np->speed == 1000) {
> - cmd->speed = SPEED_100;
> + ethtool_cmd_speed_set(cmd, SPEED_100);
> cmd->duplex = DUPLEX_FULL;
> printk("Warning!! Can't disable Auto negotiation in 1000Mbps, change to Manual 100Mbps, Full duplex.\n");
> }
> - switch(cmd->speed + cmd->duplex) {
> + switch (ethtool_cmd_speed(cmd) + cmd->duplex) {
[...]
If you're going to stop these drivers ignoring speed_hi, maybe you
should also stop them ignoring the difference between speed and duplex!
Currently the user can ask for 99 Mbit/s full-duplex and get 100 Mbit/s
half-duplex.
There are several others that use this trick.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 3/5] ethtool: Call ethtool's get/set_settings callbacks with cleaned data
From: Ben Hutchings @ 2011-04-17 1:53 UTC (permalink / raw)
To: David Decotigny
Cc: David S. Miller, Michał Mirosław, Stanislaw Gruszka,
Alexander Duyck, ilon Greenstein, linux-kernel, netdev
In-Reply-To: <1303001651-4074-3-git-send-email-decot@google.com>
On Sat, 2011-04-16 at 17:54 -0700, David Decotigny wrote:
> This makes sure that when a driver calls the ethtool's
> get/set_settings() callback of another driver,
Many of them are calling themselves, and they can ignore speed_hi
because they will never set it.
> the data passed to it
> is clean. This guarantees that speed_hi will be zeroed correctly if
> the called callback doesn't explicitely set it: we are sure we don't
> get a corrupted speed from the underlying driver. We also take care of
> setting the cmd field appropriately (ETHTOOL_GSET/SSET).
I think this initialisation ought to be done in
dev_ethtool_get_settings(), and that function moved into net/core/dev.c,
to avoid code bloat. (Yes it's minimal in this case, but these things
add up.)
Maybe also in mii_ethtool_gset().
> All drivers visible to make allyesconfig under x86_64 have been
> updated.
>
> Tested: make allyesconfig compiles + e1000 & bnx2x work
>
> Signed-off-by: David Decotigny <decot@google.com>
> ---
> arch/mips/txx9/generic/setup_tx4939.c | 15 ++++--------
> drivers/net/e100.c | 10 +++++---
> drivers/net/pch_gbe/pch_gbe_main.c | 6 ++--
> drivers/net/pch_gbe/pch_gbe_phy.c | 2 +-
> drivers/net/pcnet32.c | 15 ++++++-----
> drivers/net/sfc/mdio_10g.c | 4 +-
> drivers/net/stmmac/stmmac_ethtool.c | 4 +-
> drivers/net/usb/asix.c | 28 ++++++++++++----------
> drivers/net/usb/dm9601.c | 6 ++--
> drivers/net/usb/smsc75xx.c | 7 +++--
> drivers/net/usb/smsc95xx.c | 7 +++--
> drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 36 +++++++++++++++++------------
> drivers/scsi/fcoe/fcoe.c | 41 ++++++++++++++++++--------------
> include/rdma/ib_addr.h | 15 ++++++-----
> net/core/net-sysfs.c | 24 ++++++++-----------
> 15 files changed, 115 insertions(+), 105 deletions(-)
>
> diff --git a/arch/mips/txx9/generic/setup_tx4939.c b/arch/mips/txx9/generic/setup_tx4939.c
> index 3dc19f4..af0588f 100644
> --- a/arch/mips/txx9/generic/setup_tx4939.c
> +++ b/arch/mips/txx9/generic/setup_tx4939.c
> @@ -320,16 +320,11 @@ void __init tx4939_sio_init(unsigned int sclk, unsigned int cts_mask)
> #if defined(CONFIG_TC35815) || defined(CONFIG_TC35815_MODULE)
> static int tx4939_get_eth_speed(struct net_device *dev)
> {
> - struct ethtool_cmd cmd = { ETHTOOL_GSET };
> - int speed = 100; /* default 100Mbps */
> - int err;
> - if (!dev->ethtool_ops || !dev->ethtool_ops->get_settings)
> - return speed;
> - err = dev->ethtool_ops->get_settings(dev, &cmd);
> - if (err < 0)
> - return speed;
> - speed = cmd.speed == SPEED_100 ? 100 : 10;
> - return speed;
> + struct ethtool_cmd cmd = { .cmd = ETHTOOL_GSET };
> + if (dev_ethtool_get_settings(dev, &cmd))
> + return 100; /* default 100Mbps */
> +
> + return (ethtool_cmd_speed(&cmd) == SPEED_100 ? 100 : 10);
If you're going to rewrite the whole function then at least get rid of
this stupid conditional and return ethtool_cmd_speed(&cmd).
> }
> static int tx4939_netdev_event(struct notifier_block *this,
> unsigned long event,
> diff --git a/drivers/net/e100.c b/drivers/net/e100.c
> index b0aa9e6..c810cda 100644
> --- a/drivers/net/e100.c
> +++ b/drivers/net/e100.c
e100 is just getting its own settings and doesn't need to be changed.
[...]
> diff --git a/drivers/net/pch_gbe/pch_gbe_main.c b/drivers/net/pch_gbe/pch_gbe_main.c
> index 2ef2f9c..7d4452e 100644
> --- a/drivers/net/pch_gbe/pch_gbe_main.c
> +++ b/drivers/net/pch_gbe/pch_gbe_main.c
Ditto pch_gbe.
[...]
> diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
> index 0a1efba..07398bc 100644
> --- a/drivers/net/pcnet32.c
> +++ b/drivers/net/pcnet32.c
> @@ -2099,7 +2099,7 @@ static int pcnet32_open(struct net_device *dev)
> int first_phy = -1;
> u16 bmcr;
> u32 bcr9;
> - struct ethtool_cmd ecmd;
> + struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
>
> /*
> * There is really no good other way to handle multiple PHYs
> @@ -2115,9 +2115,9 @@ static int pcnet32_open(struct net_device *dev)
> ecmd.port = PORT_MII;
> ecmd.transceiver = XCVR_INTERNAL;
> ecmd.autoneg = AUTONEG_DISABLE;
> - ecmd.speed =
> - lp->
> - options & PCNET32_PORT_100 ? SPEED_100 : SPEED_10;
> + ethtool_cmd_speed_set(&ecmd,
> + (lp->options & PCNET32_PORT_100) ?
> + SPEED_100 : SPEED_10);
> bcr9 = lp->a.read_bcr(ioaddr, 9);
>
> if (lp->options & PCNET32_PORT_FD) {
> @@ -2763,11 +2763,12 @@ static void pcnet32_check_media(struct net_device *dev, int verbose)
> netif_carrier_on(dev);
> if (lp->mii) {
> if (netif_msg_link(lp)) {
> - struct ethtool_cmd ecmd;
> + struct ethtool_cmd ecmd = {
> + .cmd = ETHTOOL_GSET };
> mii_ethtool_gset(&lp->mii_if, &ecmd);
> netdev_info(dev, "link up, %sMbps, %s-duplex\n",
> - (ecmd.speed == SPEED_100)
> - ? "100" : "10",
> + (ethtool_cmd_speed(&ecmd)
> + == SPEED_100) ? "100" : "10",
Just use ethtool_cmd_speed() and %u rather than this conditional.
> (ecmd.duplex == DUPLEX_FULL)
> ? "full" : "half");
> }
> diff --git a/drivers/net/sfc/mdio_10g.c b/drivers/net/sfc/mdio_10g.c
> index 19e68c2..7115914 100644
> --- a/drivers/net/sfc/mdio_10g.c
> +++ b/drivers/net/sfc/mdio_10g.c
> @@ -232,12 +232,12 @@ void efx_mdio_set_mmds_lpower(struct efx_nic *efx,
> */
> int efx_mdio_set_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)
> {
> - struct ethtool_cmd prev;
> + struct ethtool_cmd prev = { .cmd = ETHTOOL_GSET };
>
> efx->phy_op->get_settings(efx, &prev);
>
> if (ecmd->advertising == prev.advertising &&
> - ecmd->speed == prev.speed &&
> + ethtool_cmd_speed(ecmd) == ethtool_cmd_speed(&prev) &&
> ecmd->duplex == prev.duplex &&
> ecmd->port == prev.port &&
> ecmd->autoneg == prev.autoneg)
That looks correct.
> diff --git a/drivers/net/stmmac/stmmac_ethtool.c b/drivers/net/stmmac/stmmac_ethtool.c
> index 0e61ac8..33cf0b1 100644
> --- a/drivers/net/stmmac/stmmac_ethtool.c
> +++ b/drivers/net/stmmac/stmmac_ethtool.c
> @@ -237,13 +237,13 @@ stmmac_set_pauseparam(struct net_device *netdev,
>
> if (phy->autoneg) {
> if (netif_running(netdev)) {
> - struct ethtool_cmd cmd;
> + struct ethtool_cmd cmd = { .cmd = ETHTOOL_SSET };
> /* auto-negotiation automatically restarted */
> cmd.cmd = ETHTOOL_NWAY_RST;
This line immediately changes cmd.cmd. The original author is clearly
confused, as the phy_ethtool_sset() ignores cmd.cmd and ETHTOOL_NWAY_RST
does not take any parameters.
I think this whole block should really just be:
ret = phy_start_aneg(phy);
[...]
> diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
> index e2e6475..6df9540 100644
> --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
> +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
> @@ -664,22 +664,28 @@ static void bnx2fc_link_speed_update(struct fc_lport *lport)
> struct fcoe_port *port = lport_priv(lport);
> struct bnx2fc_hba *hba = port->priv;
> struct net_device *netdev = hba->netdev;
> - struct ethtool_cmd ecmd = { ETHTOOL_GSET };
> -
> - if (!dev_ethtool_get_settings(netdev, &ecmd)) {
> - lport->link_supported_speeds &=
> - ~(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT);
> - if (ecmd.supported & (SUPPORTED_1000baseT_Half |
> - SUPPORTED_1000baseT_Full))
> - lport->link_supported_speeds |= FC_PORTSPEED_1GBIT;
> - if (ecmd.supported & SUPPORTED_10000baseT_Full)
> - lport->link_supported_speeds |= FC_PORTSPEED_10GBIT;
> -
> - if (ecmd.speed == SPEED_1000)
> - lport->link_speed = FC_PORTSPEED_1GBIT;
> - if (ecmd.speed == SPEED_10000)
> - lport->link_speed = FC_PORTSPEED_10GBIT;
> + struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
> +
> + if (dev_ethtool_get_settings(netdev, &ecmd))
> + return;
> +
> + lport->link_supported_speeds &=
> + ~(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT);
> + if (ecmd.supported & (SUPPORTED_1000baseT_Half |
> + SUPPORTED_1000baseT_Full))
> + lport->link_supported_speeds |= FC_PORTSPEED_1GBIT;
> + if (ecmd.supported & SUPPORTED_10000baseT_Full)
> + lport->link_supported_speeds |= FC_PORTSPEED_10GBIT;
> +
> + switch (ethtool_cmd_speed(&ecmd)) {
> + case SPEED_1000:
> + lport->link_speed = FC_PORTSPEED_1GBIT;
> + break;
> + case SPEED_10000:
> + lport->link_speed = FC_PORTSPEED_10GBIT;
> + break;
> }
> +
> return;
> }
> static int bnx2fc_link_ok(struct fc_lport *lport)
This restructuring looks entirely unnecessary, and obscures the real
change being made.
> diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
> index bde6ee5..ba9e84a 100644
> --- a/drivers/scsi/fcoe/fcoe.c
> +++ b/drivers/scsi/fcoe/fcoe.c
> @@ -2026,25 +2026,30 @@ out_nodev:
> int fcoe_link_speed_update(struct fc_lport *lport)
> {
[...]
Ditto here.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* send detail to claim £950.000.00 in our online promo(BMW AUTOMOBILE SPLASH)
From: Sofia Isabel Freire Bernal @ 2011-04-17 0:50 UTC (permalink / raw)
^ permalink raw reply
* [PATCH] acenic: Fix using the specified speed when configuring NIC
From: David Decotigny @ 2011-04-17 0:57 UTC (permalink / raw)
To: Jes Sorensen, linux-acenic, netdev, linux-kernel; +Cc: David Decotigny
This patch needs review, as I did not test it: I only think something
is weird by looking at the code, but experts must confirm.
This tells the NIC to take the speed specified by ethtool into account
when configuring the NIC, instead of keeping the previous speed.
Signed-off-by: David Decotigny <decot@google.com>
---
drivers/net/acenic.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c
index a579899..82260ca 100644
--- a/drivers/net/acenic.c
+++ b/drivers/net/acenic.c
@@ -2720,7 +2720,7 @@ static int ace_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
link |= LNK_NEGOTIATE;
if (ethtool_cmd_speed(ecmd) != speed) {
link &= ~(LNK_1000MB | LNK_100MB | LNK_10MB);
- switch (speed) {
+ switch (ethtool_cmd_speed(ecmd)) {
case SPEED_1000:
link |= LNK_1000MB;
break;
--
1.7.3.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox