* [net-next.git 8/8] stmmac: update the driver version to Sept_2012
From: Giuseppe CAVALLARO @ 2012-09-10 7:38 UTC (permalink / raw)
To: netdev; +Cc: bhutchings, davem, Giuseppe Cavallaro
In-Reply-To: <1347262689-21251-1-git-send-email-peppe.cavallaro@st.com>
Many new feauture have been introduced in the driver:
sysFS, Rx HW watchdog... so this patch updates the
driver's version.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index ad4f6b9..38662e1 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -24,7 +24,7 @@
#define __STMMAC_H__
#define STMMAC_RESOURCE_NAME "stmmaceth"
-#define DRV_MODULE_VERSION "March_2012"
+#define DRV_MODULE_VERSION "Sept_2012"
#include <linux/clk.h>
#include <linux/stmmac.h>
--
1.7.4.4
^ permalink raw reply related
* [net-next.git 7/8] stmmac: update the doc with new IRQ mitigation
From: Giuseppe CAVALLARO @ 2012-09-10 7:38 UTC (permalink / raw)
To: netdev; +Cc: bhutchings, davem, Giuseppe Cavallaro
In-Reply-To: <1347262689-21251-1-git-send-email-peppe.cavallaro@st.com>
This patch updates the stmmac.txt adding some information
about the new rx/tx mitigation schema adopted in the driver.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
Documentation/networking/stmmac.txt | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/Documentation/networking/stmmac.txt b/Documentation/networking/stmmac.txt
index ef9ee71..f9fa6db 100644
--- a/Documentation/networking/stmmac.txt
+++ b/Documentation/networking/stmmac.txt
@@ -29,11 +29,9 @@ The kernel configuration option is STMMAC_ETH:
dma_txsize: DMA tx ring size;
buf_sz: DMA buffer size;
tc: control the HW FIFO threshold;
- tx_coe: Enable/Disable Tx Checksum Offload engine;
watchdog: transmit timeout (in milliseconds);
flow_ctrl: Flow control ability [on/off];
pause: Flow Control Pause Time;
- tmrate: timer period (only if timer optimisation is configured).
3) Command line options
Driver parameters can be also passed in command line by using:
@@ -60,17 +58,19 @@ Then the poll method will be scheduled at some future point.
The incoming packets are stored, by the DMA, in a list of pre-allocated socket
buffers in order to avoid the memcpy (Zero-copy).
-4.3) Timer-Driver Interrupt
-Instead of having the device that asynchronously notifies the frame receptions,
-the driver configures a timer to generate an interrupt at regular intervals.
-Based on the granularity of the timer, the frames that are received by the
-device will experience different levels of latency. Some NICs have dedicated
-timer device to perform this task. STMMAC can use either the RTC device or the
-TMU channel 2 on STLinux platforms.
-The timers frequency can be passed to the driver as parameter; when change it,
-take care of both hardware capability and network stability/performance impact.
-Several performance tests on STM platforms showed this optimisation allows to
-spare the CPU while having the maximum throughput.
+4.3) Interrupt Mitigation
+The driver is able to mitigate the number of its DMA interrupts
+using NAPI for the reception on chips older than the 3.50.
+New chips have an HW RX-Watchdog used for this mitigation.
+
+On Tx-side, the mitigation schema is based on a SW timer that calls the
+tx function (stmmac_tx) to reclaim the resource after transmitting the
+frames.
+Also there is another parameter (like a threshold) used to program
+the descriptors avoiding to set the interrupt on completion bit in
+when the frame is sent (xmit).
+
+Mitigation parameters can be tuned by ethtool.
4.4) WOL
Wake up on Lan feature through Magic and Unicast frames are supported for the
@@ -121,6 +121,7 @@ struct plat_stmmacenet_data {
int bugged_jumbo;
int pmt;
int force_sf_dma_mode;
+ int riwt_off;
void (*fix_mac_speed)(void *priv, unsigned int speed);
void (*bus_setup)(void __iomem *ioaddr);
int (*init)(struct platform_device *pdev);
@@ -156,6 +157,7 @@ Where:
o pmt: core has the embedded power module (optional).
o force_sf_dma_mode: force DMA to use the Store and Forward mode
instead of the Threshold.
+ o riwt_off: force to disable the RX watchdog feature and switch to NAPI mode.
o fix_mac_speed: this callback is used for modifying some syscfg registers
(on ST SoCs) according to the link speed negotiated by the
physical layer .
--
1.7.4.4
^ permalink raw reply related
* Re: netlink: hide struct module parameter in netlink_kernel_create
From: Pablo Neira Ayuso @ 2012-09-10 7:45 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: David S. Miller, netdev
In-Reply-To: <20120910093712.18e5718b605f84aa4e76f7d9@canb.auug.org.au>
On Mon, Sep 10, 2012 at 09:37:12AM +1000, Stephen Rothwell wrote:
> Hi all,
>
> I didn't see the original patch until it reached linux-enxt this morning,
> but just a comment:
>
> THIS_MODULE is defined in linux/export.h, so that should be included in
> linux/netlink.h instead of linux/module.h as it is much smaller.
I'll send a follow-up patch for this to David, thanks Stephen.
^ permalink raw reply
* Re: Who maintains and handles patches for drivers/net/phy/ ?
From: David Miller @ 2012-09-10 8:02 UTC (permalink / raw)
To: christophe.leroy; +Cc: netdev
In-Reply-To: <504D94AB.7070404@c-s.fr>
From: leroy christophe <christophe.leroy@c-s.fr>
Date: Mon, 10 Sep 2012 09:20:11 +0200
> The MAINTAINER file doesn't include any maintainer for
> drivers/net/phy/
> Section NETWORKING DRIVERS doesn't refer to anyone.
>
> I have a patch for the Intel LXT phy driver. I submitted it to the
> list a few weeks ago but didn't get any feedback at all.
> Who shall I contact to get my patch taken into account ?
Your comments were not formatted correctly so I tossed your patch
from the queue. FOrmat comments:
/* Like
* this.
*/
not:
/* Like
* this. */
and not:
/* Like
this. */
Thanks.
^ permalink raw reply
* Re: Regression associated with commit c8628155ece3 - "tcp: reduce out_of_order memory use"
From: Eric Dumazet @ 2012-09-10 8:39 UTC (permalink / raw)
To: Larry Finger
Cc: linville-2XuSBdqkA4R54TAoqtyWWQ,
linux-wireless-u79uwXL29TY76Z2rM5mHXA, netdev
In-Reply-To: <503BB49C.5010402-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
On Mon, 2012-08-27 at 12:55 -0500, Larry Finger wrote:
> I have prepared a patch to fix all the unchecked allocations.
>
> Over the weekend I made some progress. To test the latest vendor driver, I
> installed a 32-bit system. Their driver is not compatible with a 64-bit system.
> I found that not only did the vendor driver work with secure sites, but so did
> the in-kernel version. I now have tcpdump output for the 32-bit case that works,
> and the 64-bit case that fails. It seems likely that I missed some 32/64 bit
> incompatibility when I did the conversion.
>
> Thanks for all your help in trying to resolve this issue.
>
> Larry
>
>
Hi Larry
It appears I have a D-Link N300 (DWA-131) nano USB adapter, using
staging/rtl8712 driver.
I tried many kernel versions (including 3.3) and none seems to work
reliably.
Sometime, I have some traffic but only for about 50 frames...
It might be because my access point is a netgear wndr3800, because I
have following warning a bit before the freezes :
r8712u: [r8712_got_addbareq_event_callback] mac = 20:4e:7f:5a:cd:30, sea = 80, tid = 0
Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* net/ipv4/route.c:645 suspicious rcu_dereference_check() usage!
From: chris @ 2012-09-10 8:44 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
I've not seen this reported yet, so here's a warning that happens
occasionally:
[192979.475833]
[192979.475840] ===============================
[192979.475841] [ INFO: suspicious RCU usage. ]
[192979.475844] 3.6.0-rc2+ #33 Not tainted
[192979.475846] -------------------------------
[192979.475848] net/ipv4/route.c:645 suspicious rcu_dereference_check() usage!
[192979.475850]
[192979.475850] other info that might help us debug this:
[192979.475850]
[192979.475853]
[192979.475853] rcu_scheduler_active = 1, debug_locks = 0
[192979.475856] 2 locks held by firefox-bin/4634:
[192979.475858] #0: (slock-AF_INET){+.-...}, at: [<ffffffff814261b4>] release_sock+0x34/0x1e0
[192979.475870] #1: (fnhe_lock){+.-...}, at: [<ffffffff81461c94>] update_or_create_fnhe.isra.30+0x44/0x480
[192979.475878]
[192979.475878] stack backtrace:
[192979.475881] Pid: 4634, comm: firefox-bin Not tainted 3.6.0-rc2+ #33
[192979.475883] Call Trace:
[192979.475891] [<ffffffff810903cd>] lockdep_rcu_suspicious+0xfd/0x130
[192979.475895] [<ffffffff81461e8e>] update_or_create_fnhe.isra.30+0x23e/0x480
[192979.475899] [<ffffffff814624ba>] __ip_rt_update_pmtu.isra.31+0x6a/0xb0
[192979.475903] [<ffffffff81465038>] ip_rt_update_pmtu+0x48/0xd0
[192979.475907] [<ffffffff814759b1>] inet_csk_update_pmtu+0x31/0x80
[192979.475912] [<ffffffff8148b663>] tcp_v4_mtu_reduced+0x33/0xd0
[192979.475915] [<ffffffff814888be>] tcp_release_cb+0x5e/0xb0
[192979.475919] [<ffffffff81426289>] release_sock+0x109/0x1e0
[192979.475922] [<ffffffff81479037>] tcp_sendmsg+0x527/0x1030
[192979.475927] [<ffffffff814a4d9d>] inet_sendmsg+0xed/0x240
[192979.475931] [<ffffffff814a4cb0>] ? inet_autobind+0x70/0x70
[192979.475934] [<ffffffff81424e8a>] ? sock_update_classid+0xaa/0x370
[192979.475937] [<ffffffff81424eb8>] ? sock_update_classid+0xd8/0x370
[192979.475941] [<ffffffff8141ee1b>] sock_sendmsg+0xab/0xe0
[192979.475946] [<ffffffff814222be>] sys_sendto+0x11e/0x160
[192979.475951] [<ffffffff8153e547>] ? sysret_check+0x1b/0x56
[192979.475956] [<ffffffff8125849e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[192979.475960] [<ffffffff8153e522>] system_call_fastpath+0x16/0x1b
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply
* RE: [tcpdump-workers] Modular arithmetic
From: David Laight @ 2012-09-10 8:41 UTC (permalink / raw)
To: Andi Kleen, George Bakos, tcpdump-workers; +Cc: Jay Schulist, netdev
In-Reply-To: <20120908030311.GM17289@tassilo.jf.intel.com>
> On Fri, Sep 07, 2012 at 07:49:10AM +0000, George Bakos wrote:
> > Gents,
> > Any fundamental reason why the following (, etc.) shouldn't be
> > included in net/core/filter.c?
> >
> > case BPF_S_ALU_MOD_X:
> > if (X == 0)
> > return 0;
> > A %= X;
> > continue;
>
> Copying netdev.
>
> In principle no reason against it, but you may need to update
> the various BPF JITs too that Linux now has too.
What about the other OS - eg all the BSDs?
I had a vague idea that BPF was supposed to be reasonable portable.
David (dsl@netbsd.org)
^ permalink raw reply
* [PATCH net] ixp4xx_hss: fix build failure after logging conversion
From: Florian Fainelli @ 2012-09-10 8:43 UTC (permalink / raw)
To: netdev; +Cc: khc, joe, David Miller, Florian Fainelli, stable
Commit c75bb2c6f0cf455c23e60f14d780e841dd47f801 (ixp4xx_hss: Update to
current logging forms) converted the ixp4xx_hss module to use the current
logging macros, but forgot to include linux/module.h, leading to the
following build failures:
CC [M] drivers/net/wan/ixp4xx_hss.o
drivers/net/wan/ixp4xx_hss.c:1412:20: error: expected ';', ',' or ')'
before string constant
drivers/net/wan/ixp4xx_hss.c:1413:25: error: expected ';', ',' or ')'
before string constant
drivers/net/wan/ixp4xx_hss.c:1414:21: error: expected ';', ',' or ')'
before string constant
drivers/net/wan/ixp4xx_hss.c:1415:19: error: expected ';', ',' or ')'
before string constant
make[8]: *** [drivers/net/wan/ixp4xx_hss.o] Error 1
CC: stable@vger.kernel.org
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
[stable: 3.1+]
drivers/net/wan/ixp4xx_hss.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
index aaaca9a..3f575af 100644
--- a/drivers/net/wan/ixp4xx_hss.c
+++ b/drivers/net/wan/ixp4xx_hss.c
@@ -10,6 +10,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#include <linux/module.h>
#include <linux/bitops.h>
#include <linux/cdev.h>
#include <linux/dma-mapping.h>
--
1.7.9.5
^ permalink raw reply related
* Failure to send fragmented IP packet in case of missing ARP entry
From: Andrei Dolnikov @ 2012-09-10 8:59 UTC (permalink / raw)
To: netdev
Hello all,
The following issue is observed on most Linux distributions:
Transmission of fragmented IP packets in case of missing ARP entry for
destination IP fails.
Actually ARP request is sent, and, once ARP response is received, only
few queued fragments are transmitted. Remaining fragments are lost.
It can be easily reproduced as follows:
# arp -d <dst IP>
# ping -s 65000 -c 1 <dst IP>
Ping result is: "1 packets transmitted, 0 received, 100% packet loss,
time 0ms".
The latest kernel version I tried was 3.5.0-1 x86_64, but I also was
able to reproduce it with 3.2.x, 3.0.x and 2.6.32.
It doesn't depend on hardware: was able to reproduce with VMWare Player,
Intel based laptop, Intel Atom and ARM based custom boards.
As I'm not a networking standards expert I'm not sure if it's a real bug
or acceptable behaviour, but decided to raise the issue here as I can't
reproduce this anomaly with the Windows 7 PC.
Thanks,
Andrei.
^ permalink raw reply
* Re: [PATCH net] ixp4xx_hss: fix build failure after logging conversion
From: Joe Perches @ 2012-09-10 9:04 UTC (permalink / raw)
To: Florian Fainelli; +Cc: netdev, khc, David Miller, stable
In-Reply-To: <1347266590-884-1-git-send-email-florian@openwrt.org>
On Mon, 2012-09-10 at 10:43 +0200, Florian Fainelli wrote:
> Commit c75bb2c6f0cf455c23e60f14d780e841dd47f801 (ixp4xx_hss: Update to
> current logging forms) converted the ixp4xx_hss module to use the current
> logging macros, but forgot to include linux/module.h, leading to the
> following build failures:
Bad explanation.
This commit had nothing to do with any missing module.h.
^ permalink raw reply
* Re: ndo_get_stats and rtnl_netlink
From: Eric Dumazet @ 2012-09-10 9:09 UTC (permalink / raw)
To: Shlomo Pongartz; +Cc: netdev
In-Reply-To: <504CB464.6010207@mellanox.com>
On Sun, 2012-09-09 at 18:23 +0300, Shlomo Pongartz wrote:
> Hi,
>
> Just realized that dev_get_stats which calls into a netdevice
> ndo_get_stats64/ndo_get_stats can be
> called with or without RTNL lock protection. If called from
> rtnl_fill_ifinfo e.g as of invocation of
> "ip link show <interface>, there IS locking, however if called from
> dev_seq_printf_stats e.g as of
> invocation of reading the /sys/class/net/<interface>/statistics/
> entries, etc more cases -- no locking.
>
> This turned to be problematic when implementing the ethtool
> "set_channels" directive which
> changes the number of **rings**, since we stepped on a bug where the
> rings data structure was
> changed by the ethtool flow in the same time a statistics call was done
> into the driver, etc.
>
> What would be the way to continue here, per driver lock sounds non
> generic...
RTNL locking is not needed to fetch stats, and would be overkill.
Each driver has its own way to protect/gather its stats.
^ permalink raw reply
* RE: [tcpdump-workers] Modular arithmetic
From: Eric Dumazet @ 2012-09-10 9:25 UTC (permalink / raw)
To: David Laight
Cc: Andi Kleen, George Bakos, tcpdump-workers, Jay Schulist, netdev
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B6FE4@saturn3.aculab.com>
On Mon, 2012-09-10 at 09:41 +0100, David Laight wrote:
> > On Fri, Sep 07, 2012 at 07:49:10AM +0000, George Bakos wrote:
> > > Gents,
> > > Any fundamental reason why the following (, etc.) shouldn't be
> > > included in net/core/filter.c?
> > >
> > > case BPF_S_ALU_MOD_X:
> > > if (X == 0)
> > > return 0;
> > > A %= X;
> > > continue;
> >
> > Copying netdev.
> >
> > In principle no reason against it, but you may need to update
> > the various BPF JITs too that Linux now has too.
>
> What about the other OS - eg all the BSDs?
> I had a vague idea that BPF was supposed to be reasonable portable.
Yes, does it mean BPF is frozen ?
Or is BSD so hard to update these days ?
modulus can be implemented using fallback to div and sub, I am not sure
libpcap should sense kernel support or not.
George, make sure libpcap optimizer correctly replaces MOD X by AND (X
- 1) if X is a power of two.
^ permalink raw reply
* Re: [PATCH] net, cgroup: Fix boot failure due to iteration of uninitialized list
From: Srivatsa S. Bhat @ 2012-09-10 9:29 UTC (permalink / raw)
To: Neil Horman
Cc: Gao feng, eric.dumazet, davem, linux-kernel, netdev,
mark.d.rustad, john.r.fastabend, lizefan
In-Reply-To: <20120723114057.GA16518@hmsreliant.think-freely.org>
On 07/23/2012 05:10 PM, Neil Horman wrote:
> On Mon, Jul 23, 2012 at 09:15:05AM +0800, Gao feng wrote:
>> 于 2012年07月20日 00:27, Srivatsa S. Bhat 写道:
>>> After commit ef209f15 (net: cgroup: fix access the unallocated memory in
>>> netprio cgroup), boot fails with the following NULL pointer dereference:
>>>
[...]
>>> Call Trace:
>>> [<ffffffff81b1cb78>] cgroup_init_subsys+0x83/0x169
>>> [<ffffffff81b1ce13>] cgroup_init+0x36/0x119
>>> [<ffffffff81affef7>] start_kernel+0x3ba/0x3ef
>>> [<ffffffff81aff95b>] ? kernel_init+0x27b/0x27b
>>> [<ffffffff81aff356>] x86_64_start_reservations+0x131/0x136
>>> [<ffffffff81aff45e>] x86_64_start_kernel+0x103/0x112
>>> RIP [<ffffffff8145e8d6>] cgrp_create+0xf6/0x190
>>> RSP <ffffffff81a01ea8>
>>> CR2: 0000000000000698
>>> ---[ end trace a7919e7f17c0a725 ]---
>>> Kernel panic - not syncing: Attempted to kill the idle task!
>>>
>>> The code corresponds to:
>>>
>>> update_netdev_tables():
>>> for_each_netdev(&init_net, dev) {
>>> map = rtnl_dereference(dev->priomap); <---- HERE
>>>
>>>
>>> The list head is initialized in netdev_init(), which is called much
>>> later than cgrp_create(). So the problem is that we are calling
>>> update_netdev_tables() way too early (in cgrp_create()), which will
>>> end up traversing the not-yet-circular linked list. So at some point,
>>> the dev pointer will become NULL and hence dev->priomap becomes an
>>> invalid access.
>>>
>>> To fix this, just remove the update_netdev_tables() function entirely,
>>> since it appears that write_update_netdev_table() will handle things
>>> just fine.
>>
>> The reason I add update_netdev_tables in cgrp_create is to avoid additional
>> bound checkings when we accessing the dev->priomap.priomap.
>>
>> Eric,can we revert this commit 91c68ce2b26319248a32d7baa1226f819d283758 now?
>> I think it's safe enough to access priomap without bound check.
>>
>
> I think its probably safe, yes, but lets leave it there for just a bit. Its not
> hurting anything, and I'd like to look into getting Srivatsa' patch in first.
Hi Neil,
Did you get around to look into this again?
Regards,
Srivatsa S. Bhat
^ permalink raw reply
* Re: [PATCH net] ixp4xx_hss: fix build failure after logging conversion
From: Florian Fainelli @ 2012-09-10 9:35 UTC (permalink / raw)
To: Joe Perches; +Cc: netdev, khc, David Miller, stable
In-Reply-To: <1347267855.6069.2.camel@joe2Laptop>
On Monday 10 September 2012 02:04:15 Joe Perches wrote:
> On Mon, 2012-09-10 at 10:43 +0200, Florian Fainelli wrote:
> > Commit c75bb2c6f0cf455c23e60f14d780e841dd47f801 (ixp4xx_hss: Update to
> > current logging forms) converted the ixp4xx_hss module to use the current
> > logging macros, but forgot to include linux/module.h, leading to the
> > following build failures:
>
> Bad explanation.
> This commit had nothing to do with any missing module.h.
You are right, this issue dates back from day one when this driver got merged,
I will repost a v2 with the proper commit.
--
Florian
^ permalink raw reply
* Re: Failure to send fragmented IP packet in case of missing ARP entry
From: Eric Dumazet @ 2012-09-10 9:42 UTC (permalink / raw)
To: Andrei Dolnikov; +Cc: netdev
In-Reply-To: <504DAC02.8040808@cogentembedded.com>
On Mon, 2012-09-10 at 12:59 +0400, Andrei Dolnikov wrote:
> Hello all,
>
> The following issue is observed on most Linux distributions:
> Transmission of fragmented IP packets in case of missing ARP entry for
> destination IP fails.
> Actually ARP request is sent, and, once ARP response is received, only
> few queued fragments are transmitted. Remaining fragments are lost.
> It can be easily reproduced as follows:
> # arp -d <dst IP>
> # ping -s 65000 -c 1 <dst IP>
> Ping result is: "1 packets transmitted, 0 received, 100% packet loss,
> time 0ms".
>
> The latest kernel version I tried was 3.5.0-1 x86_64, but I also was
> able to reproduce it with 3.2.x, 3.0.x and 2.6.32.
> It doesn't depend on hardware: was able to reproduce with VMWare Player,
> Intel based laptop, Intel Atom and ARM based custom boards.
> As I'm not a networking standards expert I'm not sure if it's a real bug
> or acceptable behaviour, but decided to raise the issue here as I can't
> reproduce this anomaly with the Windows 7 PC.
>
> Thanks,
> Andrei.
> --
Its a bit better with linux-3.3, with commit
8b5c171bb3dc0686b2647a84e990199c5faa9ef8
(neigh: new unresolved queue limits)
+neigh/default/unres_qlen_bytes - INTEGER
+ The maximum number of bytes which may be used by packets
+ queued for each unresolved address by other network layers.
+ (added in linux 3.3)
+
+neigh/default/unres_qlen - INTEGER
+ The maximum number of packets which may be queued for each
+ unresolved address by other network layers.
+ (deprecated in linux 3.3) : use unres_qlen_bytes instead.
Problem is : unres_qlen_bytes default value is 65536, so its a bit too
small once you take into account truesize overhead
I guess following patch would be needed :
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 4780045..3395bb6 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -171,7 +171,7 @@ struct neigh_table arp_tbl = {
.gc_staletime = 60 * HZ,
.reachable_time = 30 * HZ,
.delay_probe_time = 5 * HZ,
- .queue_len_bytes = 64*1024,
+ .queue_len_bytes = 64 * SKB_TRUESIZE(1024),
.ucast_probes = 3,
.mcast_probes = 3,
.anycast_delay = 1 * HZ,
^ permalink raw reply related
* Re: net/ipv4/route.c:645 suspicious rcu_dereference_check() usage!
From: Eric Dumazet @ 2012-09-10 9:46 UTC (permalink / raw)
To: chris; +Cc: netdev, linux-kernel
In-Reply-To: <84c8a8$5m6f27@orsmga001.jf.intel.com>
On Mon, 2012-09-10 at 09:44 +0100, chris@chris-wilson.co.uk wrote:
> I've not seen this reported yet, so here's a warning that happens
> occasionally:
>
> [192979.475833]
> [192979.475840] ===============================
> [192979.475841] [ INFO: suspicious RCU usage. ]
> [192979.475844] 3.6.0-rc2+ #33 Not tainted
> [192979.475846] -------------------------------
> [192979.475848] net/ipv4/route.c:645 suspicious rcu_dereference_check() usage!
> [192979.475850]
> [192979.475850] other info that might help us debug this:
> [192979.475850]
> [192979.475853]
> [192979.475853] rcu_scheduler_active = 1, debug_locks = 0
> [192979.475856] 2 locks held by firefox-bin/4634:
> [192979.475858] #0: (slock-AF_INET){+.-...}, at: [<ffffffff814261b4>] release_sock+0x34/0x1e0
> [192979.475870] #1: (fnhe_lock){+.-...}, at: [<ffffffff81461c94>] update_or_create_fnhe.isra.30+0x44/0x480
> [192979.475878]
> [192979.475878] stack backtrace:
> [192979.475881] Pid: 4634, comm: firefox-bin Not tainted 3.6.0-rc2+ #33
> [192979.475883] Call Trace:
> [192979.475891] [<ffffffff810903cd>] lockdep_rcu_suspicious+0xfd/0x130
> [192979.475895] [<ffffffff81461e8e>] update_or_create_fnhe.isra.30+0x23e/0x480
> [192979.475899] [<ffffffff814624ba>] __ip_rt_update_pmtu.isra.31+0x6a/0xb0
> [192979.475903] [<ffffffff81465038>] ip_rt_update_pmtu+0x48/0xd0
> [192979.475907] [<ffffffff814759b1>] inet_csk_update_pmtu+0x31/0x80
> [192979.475912] [<ffffffff8148b663>] tcp_v4_mtu_reduced+0x33/0xd0
> [192979.475915] [<ffffffff814888be>] tcp_release_cb+0x5e/0xb0
> [192979.475919] [<ffffffff81426289>] release_sock+0x109/0x1e0
> [192979.475922] [<ffffffff81479037>] tcp_sendmsg+0x527/0x1030
> [192979.475927] [<ffffffff814a4d9d>] inet_sendmsg+0xed/0x240
> [192979.475931] [<ffffffff814a4cb0>] ? inet_autobind+0x70/0x70
> [192979.475934] [<ffffffff81424e8a>] ? sock_update_classid+0xaa/0x370
> [192979.475937] [<ffffffff81424eb8>] ? sock_update_classid+0xd8/0x370
> [192979.475941] [<ffffffff8141ee1b>] sock_sendmsg+0xab/0xe0
> [192979.475946] [<ffffffff814222be>] sys_sendto+0x11e/0x160
> [192979.475951] [<ffffffff8153e547>] ? sysret_check+0x1b/0x56
> [192979.475956] [<ffffffff8125849e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
> [192979.475960] [<ffffffff8153e522>] system_call_fastpath+0x16/0x1b
>
Probably already fixed in commit c5ae7d41927d (ipv4: must use rcu
protection while calling fib_lookup)
3.6.0-rc2 is quite old for a dev kernel ;)
Thanks
^ permalink raw reply
* Re: Failure to send fragmented IP packet in case of missing ARP entry
From: Eric Dumazet @ 2012-09-10 9:53 UTC (permalink / raw)
To: Andrei Dolnikov; +Cc: netdev
In-Reply-To: <1347270171.1234.1353.camel@edumazet-glaptop>
On Mon, 2012-09-10 at 11:42 +0200, Eric Dumazet wrote:
> On Mon, 2012-09-10 at 12:59 +0400, Andrei Dolnikov wrote:
> > Hello all,
> >
> > The following issue is observed on most Linux distributions:
> > Transmission of fragmented IP packets in case of missing ARP entry for
> > destination IP fails.
> > Actually ARP request is sent, and, once ARP response is received, only
> > few queued fragments are transmitted. Remaining fragments are lost.
> > It can be easily reproduced as follows:
> > # arp -d <dst IP>
> > # ping -s 65000 -c 1 <dst IP>
> > Ping result is: "1 packets transmitted, 0 received, 100% packet loss,
> > time 0ms".
> >
> > The latest kernel version I tried was 3.5.0-1 x86_64, but I also was
> > able to reproduce it with 3.2.x, 3.0.x and 2.6.32.
> > It doesn't depend on hardware: was able to reproduce with VMWare Player,
> > Intel based laptop, Intel Atom and ARM based custom boards.
> > As I'm not a networking standards expert I'm not sure if it's a real bug
> > or acceptable behaviour, but decided to raise the issue here as I can't
> > reproduce this anomaly with the Windows 7 PC.
> >
> > Thanks,
> > Andrei.
> > --
>
> Its a bit better with linux-3.3, with commit
> 8b5c171bb3dc0686b2647a84e990199c5faa9ef8
> (neigh: new unresolved queue limits)
>
> +neigh/default/unres_qlen_bytes - INTEGER
> + The maximum number of bytes which may be used by packets
> + queued for each unresolved address by other network layers.
> + (added in linux 3.3)
> +
> +neigh/default/unres_qlen - INTEGER
> + The maximum number of packets which may be queued for each
> + unresolved address by other network layers.
> + (deprecated in linux 3.3) : use unres_qlen_bytes instead.
>
>
> Problem is : unres_qlen_bytes default value is 65536, so its a bit too
> small once you take into account truesize overhead
>
> I guess following patch would be needed :
>
> diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
> index 4780045..3395bb6 100644
> --- a/net/ipv4/arp.c
> +++ b/net/ipv4/arp.c
> @@ -171,7 +171,7 @@ struct neigh_table arp_tbl = {
> .gc_staletime = 60 * HZ,
> .reachable_time = 30 * HZ,
> .delay_probe_time = 5 * HZ,
> - .queue_len_bytes = 64*1024,
> + .queue_len_bytes = 64 * SKB_TRUESIZE(1024),
> .ucast_probes = 3,
> .mcast_probes = 3,
> .anycast_delay = 1 * HZ,
In the mean time, you can also do
echo 50 >/proc/sys/net/ipv4/neigh/eth0/unres_qlen
(change eth0 by the name of your interface)
^ permalink raw reply
* hi!:) I am Dannielle:)
From: Dannielle Kearney @ 2012-09-10 10:15 UTC (permalink / raw)
To: latinboy12345@yahoo.com
My name is Dannielle by the way.
It's exciting, isn't it?))))
^ permalink raw reply
* Re: [PATCH -next v1] wireless: ath9k-htc: only load firmware in need
From: Mohammed Shafi @ 2012-09-10 10:23 UTC (permalink / raw)
To: Ming Lei
Cc: linux-wireless, netdev, ath9k-devel, Luis R. Rodriguez,
Jouni Malinen, Vasanthakumar Thiagarajan, Senthil Balasubramanian,
John W. Linville
In-Reply-To: <CACVXFVPX1NB5uJ6yXkNbDWoX4OVdYfRU_=tsWC529-tH+3WfDA@mail.gmail.com>
Hi,
On Sat, Sep 1, 2012 at 10:41 AM, Ming Lei <ming.lei@canonical.com> wrote:
> On Tue, Aug 21, 2012 at 4:04 PM, Ming Lei <ming.lei@canonical.com> wrote:
>> It is not necessary to hold the firmware memory during the whole
>> driver lifetime, and obviously it does waste memory. Suppose there
>> are 4 ath9k-htc usb dongles working, kernel has to consume about
>> 4*50KBytes RAM to cache firmware for all dongles. After applying the
>> patch, kernel only caches one single firmware image in RAM for
>> all ath9k-htc devices just during system suspend/resume cycle.
>>
>> When system is ready for loading firmware, ath9k-htc can request
>> the loading from usersapce. During system resume, ath9k-htc still
>> can load the firmware which was cached in kernel memory before
>> system suspend.
>>
>> Cc: ath9k-devel@lists.ath9k.org
>> Cc: "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>
>> Cc: Jouni Malinen <jouni@qca.qualcomm.com>
>> Cc: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
>> Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
>> Cc: "John W. Linville" <linville@tuxdriver.com>
>> Signed-off-by: Ming Lei <ming.lei@canonical.com>
>> ---
>> v1:
>> fix double free of firmware in failue path of
>> ath9k_hif_usb_firmware_cb
>
> Gentle ping, :-)
this patch is now in wireless-testing :-)
>
>
> Thanks,
> --
> Ming Lei
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
thanks,
shafi
^ permalink raw reply
* Re: kernel 3.5.2/amd64: iwlwifi 0000:03:00.0: failed to allocate pci memory
From: Johannes Berg @ 2012-09-10 10:24 UTC (permalink / raw)
To: Marc MERLIN
Cc: wey-yi.w.guy-ral2JQCrhuEAvxtiuMwx3w, ilw-VuQAYsv1563Yd54FQh9/CA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-q7rQbLoQdy39qxiX1TGQuw
In-Reply-To: <1347130641.11167.0.camel-8Nb76shvtaUJvtFkdXX2HixXY32XiHfO@public.gmane.org>
On Sat, 2012-09-08 at 20:57 +0200, Johannes Berg wrote:
> > [856806.497959] [<ffffffff810cf54c>] warn_alloc_failed+0x117/0x12c
> > [856806.497963] [<ffffffff810d23af>] __alloc_pages_nodemask+0x6e3/0x792
> > [856806.497969] [<ffffffff812b7f41>] ? pfn_to_dma_pte+0x116/0x15e
> > [856806.497976] [<ffffffff810ff58b>] alloc_pages_current+0xcd/0xee
> > [856806.497979] [<ffffffff810cecca>] __get_free_pages+0x9/0x45
> > [856806.497982] [<ffffffff812ba67d>] intel_alloc_coherent+0x84/0xe7
> > [856806.497986] [<ffffffff81085cf8>] ? arch_local_irq_save+0x15/0x1b
> > [856806.497999] [<ffffffffa0b84afc>] iwl_ucode_callback+0xa49/0xc0d [iwlwifi]
>
> Yes, unfortunately we need a whole bunch of contiguous memory to load
> the firmware.
>
> > Any ideas?
>
> Nothing we can do from the driver side, I'm afraid.
Turns out I was wrong. Here's a patch you can test. Note that we still
need a lot of DMA-coherent memory for other things, but at least for the
firmware image we don't.
http://p.sipsolutions.net/11ea33b376a5bac5.txt
johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: Modular arithmetic
From: David Laight @ 2012-09-10 10:41 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, Jay Schulist, Andi Kleen, tcpdump-workers
In-Reply-To: <1347269124.1234.1326.camel@edumazet-glaptop>
> > What about the other OS - eg all the BSDs?
> > I had a vague idea that BPF was supposed to be reasonable portable.
>
> Yes, does it mean BPF is frozen ?
>
> Or is BSD so hard to update these days ?
Not really - but it some other places that need updating in order
to make this useful for cross-platform tools (like tcpdump).
The 'real fun (tm)' happens when NetBSD tries to run Linux binaries
that include the Linux libpcap.
David
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers
^ permalink raw reply
* Re: [PATCHv4] virtio-spec: virtio network device multiqueue support
From: Jason Wang @ 2012-09-10 11:00 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: rick.jones2, kvm, netdev, virtualization, levinsasha928, pbonzini,
Tom Herbert
In-Reply-To: <20120910063346.GA17338@redhat.com>
On 09/10/2012 02:33 PM, Michael S. Tsirkin wrote:
> On Mon, Sep 10, 2012 at 09:27:38AM +0300, Michael S. Tsirkin wrote:
>> On Mon, Sep 10, 2012 at 09:16:29AM +0300, Michael S. Tsirkin wrote:
>>> On Mon, Sep 10, 2012 at 11:42:25AM +0930, Rusty Russell wrote:
>>>> OK, I read the spec (pasted below for easy of reading), but I'm still
>>>> confused over how this will work.
>>>>
>>>> I thought normal net drivers have the hardware provide an rxhash for
>>>> each packet, and we map that to CPU to queue the packet on[1]. We hope
>>>> that the receiving process migrates to that CPU, so xmit queue
>>>> matches.
>>> This ony works sometimes. For example it's common to pin netperf to a
>>> cpu to get consistent performance. Proper hardware must obey what
>>> applications want it to do, not the other way around.
>>>
>>>> For virtio this would mean a new per-packet rxhash value, right?
>>>>
>>>> Why are we doing something different? What am I missing?
>>>>
>>>> Thanks,
>>>> Rusty.
>>>> [1] Everything I Know About Networking I Learned From LWN:
>>>> https://lwn.net/Articles/362339/
>>> I think you missed this:
>>>
>>> Some network interfaces can help with the distribution of incoming
>>> packets; they have multiple receive queues and multiple interrupt lines.
>>> Others, though, are equipped with a single queue, meaning that the
>>> driver for that hardware must deal with all incoming packets in a
>>> single, serialized stream. Parallelizing such a stream requires some
>>> intelligence on the part of the host operating system.
>>>
>>> In other words RPS is a hack to speed up networking on cheapo
>>> hardware, this is one of the reasons it is off by default.
>>> Good hardware has multiple receive queues.
>>> We can implement a good one so we do not need RPS.
>>>
>>> Also not all guest OS-es support RPS.
>>>
>>> Does this clarify?
>> I would like to add that on many processors, sending
>> IPCs between guest CPUs requires exits on sending *and*
>> receiving path, making it very expensive.
> A final addition: what you suggest above would be
> "TX follows RX", right?
> It is in anticipation of something like that, that I made
> steering programming so generic.
> I think TX follows RX is more immediately useful for reasons above
> but we can add both to spec and let drivers and devices
> decide what they want to support.
> Pls let me know.
AFAIK, ixgbe does "rx follows tx". The only differences between ixgbe
and virtio-net is that ixgbe driver programs the flow director during
packet transmission but we suggest to do it silently in the device for
simplicity. Even with this, more co-operation is still needed for the
driver ( e.g ixgbe try to use per-cpu queue by setting affinity hint and
using cpuid to choose the txq which could be reused in virtio-net driver).
>
>>>> ---
>>>> Transmit Packet Steering
>>>>
>>>> When VIRTIO_NET_F_MULTIQUEUE feature bit is negotiated, guest can use any of multiple configured transmit queues to transmit a given packet. To avoid packet reordering by device (which generally leads to performance degradation) driver should attempt to utilize the same transmit virtqueue for all packets of a given transmit flow. For bi-directional protocols (in practice, TCP), a given network connection can utilize both transmit and receive queues. For best performance, packets from a single connection should utilize the paired transmit and receive queues from the same virtqueue pair; for example both transmitqN and receiveqN. This rule makes it possible to optimize processing on the device side, but this is not a hard requirement: devices should function correctly even when this rul
e is not followed.
>>>>
>>>> Driver selects an active steering rule using VIRTIO_NET_CTRL_STEERING command (this controls both which virtqueue is selected for a given packet for receive and notifies the device which virtqueues are about to be used for transmit).
>>>>
>>>> This command accepts a single out argument in the following format:
>>>>
>>>> #define VIRTIO_NET_CTRL_STEERING 4
>>>>
>>>> The field rule specifies the function used to select transmit virtqueue for a given packet; the field param makes it possible to pass an extra parameter if appropriate. When rule is set to VIRTIO_NET_CTRL_STEERING_SINGLE (this is the default) all packets are steered to the default virtqueue transmitq (1); param is unused; this is the default. With any other rule, When rule is set to VIRTIO_NET_CTRL_STEERING_RX_FOLLOWS_TX packets are steered by driver to the first N=(param+1) multiqueue virtqueues transmitq1...transmitqN; the default transmitq is unused. Driver must have configured all these (param+1) virtqueues beforehand.
>>>>
>>>> Supported steering rules can be added and removed in the future. Driver should check that the request to change the steering rule was successful by checking ack values of the command. As selecting a specific steering is an optimization feature, drivers should avoid hard failure and fall back on using a supported steering rule if this command fails. The default steering rule is VIRTIO_NET_CTRL_STEERING_SINGLE. It will not be removed.
>>>>
>>>> When the steering rule is modified, some packets can still be outstanding in one or more of the transmit virtqueues. Since drivers might choose to modify the current steering rule at a high rate (e.g. adaptively in response to changes in the workload) to avoid reordering packets, device is recommended to complete processing of the transmit queue(s) utilized by the original steering before processing any packets delivered by the modified steering rule.
>>>>
>>>> For debugging, the current steering rule can also be read from the configuration space.
>>>>
>>>> Receive Packet Steering
>>>>
>>>> When VIRTIO_NET_F_MULTIQUEUE feature bit is negotiated, device can use any of multiple configured receive queues to pass a given packet to driver. Driver controls which virtqueue is selected in practice by configuring packet steering rule using VIRTIO_NET_CTRL_STEERING command, as described above[sub:Transmit-Packet-Steering].
>>>>
>>>> The field rule specifies the function used to select receive virtqueue for a given packet; the field param makes it possible to pass an extra parameter if appropriate. When rule is set to VIRTIO_NET_CTRL_STEERING_SINGLE all packets are steered to the default virtqueue receiveq (0); param is unused; this is the default. When rule is set to VIRTIO_NET_CTRL_STEERING_RX_FOLLOWS_TX packets are steered by host to the first N=(param+1) multiqueue virtqueues receiveq1...receiveqN; the default receiveq is unused. Driver must have configured all these (param+1) virtqueues beforehand. For best performance for bi-directional flows (such as TCP) device should detect the flow to virtqueue pair mapping on transmit and select the receive virtqueue from the same virtqueue pair. For uni-directional flo
ws, or when this mapping information is missing, a device-specific steering function is used.
>>>>
>>>> Supported steering rules can be added and removed in the future. Driver should probe for supported rules by checking ack values of the command.
>>>>
>>>> When the steering rule is modified, some packets can still be outstanding in one or more of the virtqueues. Device is not required to wait for these packets to be consumed before delivering packets using the new streering rule. Drivers modifying the steering rule at a high rate (e.g. adaptively in response to changes in the workload) are recommended to complete processing of the receive queue(s) utilized by the original steering before processing any packets delivered by the modified steering rule.
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] Generalise "auto-negotiation done" function, move generic PHY code to phy_device.c
From: Alexander Sverdlin @ 2012-09-10 11:30 UTC (permalink / raw)
To: netdev, Andy Fleming; +Cc: Alexander Sverdlin
From: Alexander Sverdlin <alexander.sverdlin@sysgo.com>
Generalise "auto-negotiation done" function, move generic PHY code to phy_device.c
Not all devices have "auto-negotiation done" bit at the place, as expected by
phy_aneg_done() in phy.c. Example of such device is Marvell 88E61xx Ethernet
switch which could be controlled by Linux PHY layer, if struct phy_driver had
abstraction for above function. So move hardware-dependent implementation details
for "generic" PHY to phy_device.c, and modify all PHY drivers to use new field.
Now phy.c contains only high-level state-machine functionality, leaving
hardware-layer to different drivers.
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@sysgo.com>
---
diff -uprN linux-3.6-rc4.orig/Documentation/networking/phy.txt linux-3.6-rc4/Documentation/networking/phy.txt
--- linux-3.6-rc4.orig/Documentation/networking/phy.txt 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/Documentation/networking/phy.txt 2012-09-10 10:54:52.000000000 +0200
@@ -1,7 +1,7 @@
-------
PHY Abstraction Layer
-(Updated 2008-04-08)
+(Updated 2012-09-06)
Purpose
@@ -257,15 +257,16 @@ Writing a PHY driver
probe: Does any setup needed by the driver
suspend/resume: power management
config_aneg: Changes the speed/duplex/negotiation settings
+ aneg_done: Reads current auto-negotiation state
read_status: Reads the current speed/duplex/negotiation settings
ack_interrupt: Clear a pending interrupt
config_intr: Enable or disable interrupts
remove: Does any driver take-down
- Of these, only config_aneg and read_status are required to be
+ Of these, only config_aneg, aneg_done and read_status are required to be
assigned by the driver code. The rest are optional. Also, it is
- preferred to use the generic phy driver's versions of these two
- functions if at all possible: genphy_read_status and
+ preferred to use the generic phy driver's versions of these three
+ functions if at all possible: genphy_read_status, genphy_aneg_done and
genphy_config_aneg. If this is not possible, it is likely that
you only need to perform some actions before and after invoking
these functions, and so your functions will wrap the generic
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/amd.c linux-3.6-rc4/drivers/net/phy/amd.c
--- linux-3.6-rc4.orig/drivers/net/phy/amd.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/amd.c 2012-09-10 11:04:35.000000000 +0200
@@ -69,6 +69,7 @@ static struct phy_driver am79c_driver =
.flags = PHY_HAS_INTERRUPT,
.config_init = am79c_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = am79c_ack_interrupt,
.config_intr = am79c_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/bcm63xx.c linux-3.6-rc4/drivers/net/phy/bcm63xx.c
--- linux-3.6-rc4.orig/drivers/net/phy/bcm63xx.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/bcm63xx.c 2012-09-10 11:10:04.000000000 +0200
@@ -81,6 +81,7 @@ static struct phy_driver bcm63xx_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = bcm63xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm63xx_ack_interrupt,
.config_intr = bcm63xx_config_intr,
@@ -94,6 +95,7 @@ static struct phy_driver bcm63xx_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = bcm63xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm63xx_ack_interrupt,
.config_intr = bcm63xx_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/bcm87xx.c linux-3.6-rc4/drivers/net/phy/bcm87xx.c
--- linux-3.6-rc4.orig/drivers/net/phy/bcm87xx.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/bcm87xx.c 2012-09-10 11:10:59.000000000 +0200
@@ -195,6 +195,7 @@ static struct phy_driver bcm87xx_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = bcm87xx_config_init,
.config_aneg = bcm87xx_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = bcm87xx_read_status,
.ack_interrupt = bcm87xx_ack_interrupt,
.config_intr = bcm87xx_config_intr,
@@ -208,6 +209,7 @@ static struct phy_driver bcm87xx_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = bcm87xx_config_init,
.config_aneg = bcm87xx_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = bcm87xx_read_status,
.ack_interrupt = bcm87xx_ack_interrupt,
.config_intr = bcm87xx_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/broadcom.c linux-3.6-rc4/drivers/net/phy/broadcom.c
--- linux-3.6-rc4.orig/drivers/net/phy/broadcom.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/broadcom.c 2012-09-10 11:09:49.000000000 +0200
@@ -692,6 +692,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -705,6 +706,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -718,6 +720,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -731,6 +734,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -744,6 +748,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = bcm5481_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -757,6 +762,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm5482_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = bcm5482_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -770,6 +776,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -783,6 +790,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -796,6 +804,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -809,6 +818,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = brcm_fet_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = brcm_fet_ack_interrupt,
.config_intr = brcm_fet_config_intr,
@@ -822,6 +832,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = brcm_fet_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = brcm_fet_ack_interrupt,
.config_intr = brcm_fet_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/cicada.c linux-3.6-rc4/drivers/net/phy/cicada.c
--- linux-3.6-rc4.orig/drivers/net/phy/cicada.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/cicada.c 2012-09-10 11:06:41.000000000 +0200
@@ -111,6 +111,7 @@ static struct phy_driver cis820x_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = &cis820x_config_init,
.config_aneg = &genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &cis820x_ack_interrupt,
.config_intr = &cis820x_config_intr,
@@ -123,6 +124,7 @@ static struct phy_driver cis820x_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = &cis820x_config_init,
.config_aneg = &genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &cis820x_ack_interrupt,
.config_intr = &cis820x_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/davicom.c linux-3.6-rc4/drivers/net/phy/davicom.c
--- linux-3.6-rc4.orig/drivers/net/phy/davicom.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/davicom.c 2012-09-10 11:05:54.000000000 +0200
@@ -152,6 +152,7 @@ static struct phy_driver dm91xx_driver[]
.features = PHY_BASIC_FEATURES,
.config_init = dm9161_config_init,
.config_aneg = dm9161_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.driver = { .owner = THIS_MODULE,},
}, {
@@ -161,6 +162,7 @@ static struct phy_driver dm91xx_driver[]
.features = PHY_BASIC_FEATURES,
.config_init = dm9161_config_init,
.config_aneg = dm9161_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.driver = { .owner = THIS_MODULE,},
}, {
@@ -170,6 +172,7 @@ static struct phy_driver dm91xx_driver[]
.features = PHY_BASIC_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = dm9161_ack_interrupt,
.config_intr = dm9161_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/dp83640.c linux-3.6-rc4/drivers/net/phy/dp83640.c
--- linux-3.6-rc4.orig/drivers/net/phy/dp83640.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/dp83640.c 2012-09-10 11:10:16.000000000 +0200
@@ -1257,6 +1257,7 @@ static struct phy_driver dp83640_driver
.probe = dp83640_probe,
.remove = dp83640_remove,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ts_info = dp83640_ts_info,
.hwtstamp = dp83640_hwtstamp,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/et1011c.c linux-3.6-rc4/drivers/net/phy/et1011c.c
--- linux-3.6-rc4.orig/drivers/net/phy/et1011c.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/et1011c.c 2012-09-10 11:04:08.000000000 +0200
@@ -94,6 +94,7 @@ static struct phy_driver et1011c_driver
.features = (PHY_BASIC_FEATURES | SUPPORTED_1000baseT_Full),
.flags = PHY_POLL,
.config_aneg = et1011c_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = et1011c_read_status,
.driver = { .owner = THIS_MODULE,},
};
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/icplus.c linux-3.6-rc4/drivers/net/phy/icplus.c
--- linux-3.6-rc4.orig/drivers/net/phy/icplus.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/icplus.c 2012-09-10 11:05:27.000000000 +0200
@@ -210,6 +210,7 @@ static struct phy_driver icplus_driver[]
.features = PHY_BASIC_FEATURES,
.config_init = &ip175c_config_init,
.config_aneg = &ip175c_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &ip175c_read_status,
.suspend = genphy_suspend,
.resume = genphy_resume,
@@ -222,6 +223,7 @@ static struct phy_driver icplus_driver[]
SUPPORTED_Asym_Pause,
.config_init = &ip1001_config_init,
.config_aneg = &genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.suspend = genphy_suspend,
.resume = genphy_resume,
@@ -236,6 +238,7 @@ static struct phy_driver icplus_driver[]
.ack_interrupt = ip101a_g_ack_interrupt,
.config_init = &ip101a_g_config_init,
.config_aneg = &genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.suspend = genphy_suspend,
.resume = genphy_resume,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/lxt.c linux-3.6-rc4/drivers/net/phy/lxt.c
--- linux-3.6-rc4.orig/drivers/net/phy/lxt.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/lxt.c 2012-09-10 11:06:12.000000000 +0200
@@ -158,6 +158,7 @@ static struct phy_driver lxt97x_driver[]
.flags = PHY_HAS_INTERRUPT,
.config_init = lxt970_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = lxt970_ack_interrupt,
.config_intr = lxt970_config_intr,
@@ -169,6 +170,7 @@ static struct phy_driver lxt97x_driver[]
.features = PHY_BASIC_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = lxt971_ack_interrupt,
.config_intr = lxt971_config_intr,
@@ -181,6 +183,7 @@ static struct phy_driver lxt97x_driver[]
.flags = 0,
.probe = lxt973_probe,
.config_aneg = lxt973_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.driver = { .owner = THIS_MODULE,},
} };
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/marvell.c linux-3.6-rc4/drivers/net/phy/marvell.c
--- linux-3.6-rc4.orig/drivers/net/phy/marvell.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/marvell.c 2012-09-10 11:07:30.000000000 +0200
@@ -713,6 +713,7 @@ static struct phy_driver marvell_drivers
.features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_aneg = &marvell_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -726,6 +727,7 @@ static struct phy_driver marvell_drivers
.flags = PHY_HAS_INTERRUPT,
.config_init = &m88e1111_config_init,
.config_aneg = &marvell_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -739,6 +741,7 @@ static struct phy_driver marvell_drivers
.flags = PHY_HAS_INTERRUPT,
.config_init = &m88e1111_config_init,
.config_aneg = &marvell_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &marvell_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -752,6 +755,7 @@ static struct phy_driver marvell_drivers
.flags = PHY_HAS_INTERRUPT,
.config_init = &m88e1118_config_init,
.config_aneg = &m88e1118_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -764,6 +768,7 @@ static struct phy_driver marvell_drivers
.features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_aneg = &m88e1121_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &marvell_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -777,6 +782,7 @@ static struct phy_driver marvell_drivers
.features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_aneg = &m88e1318_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &marvell_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -791,6 +797,7 @@ static struct phy_driver marvell_drivers
.flags = PHY_HAS_INTERRUPT,
.config_init = &m88e1145_config_init,
.config_aneg = &marvell_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -804,6 +811,7 @@ static struct phy_driver marvell_drivers
.flags = PHY_HAS_INTERRUPT,
.config_init = &m88e1149_config_init,
.config_aneg = &m88e1118_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -817,6 +825,7 @@ static struct phy_driver marvell_drivers
.flags = PHY_HAS_INTERRUPT,
.config_init = &m88e1111_config_init,
.config_aneg = &marvell_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/micrel.c linux-3.6-rc4/drivers/net/phy/micrel.c
--- linux-3.6-rc4.orig/drivers/net/phy/micrel.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/micrel.c 2012-09-10 11:07:55.000000000 +0200
@@ -123,6 +123,7 @@ static struct phy_driver ksphy_driver[]
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = kszphy_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
.config_intr = ks8737_config_intr,
@@ -136,6 +137,7 @@ static struct phy_driver ksphy_driver[]
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = kszphy_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
.config_intr = kszphy_config_intr,
@@ -149,6 +151,7 @@ static struct phy_driver ksphy_driver[]
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = ks8051_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
.config_intr = kszphy_config_intr,
@@ -161,6 +164,7 @@ static struct phy_driver ksphy_driver[]
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = kszphy_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
.config_intr = kszphy_config_intr,
@@ -174,6 +178,7 @@ static struct phy_driver ksphy_driver[]
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = kszphy_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
.config_intr = ksz9021_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/national.c linux-3.6-rc4/drivers/net/phy/national.c
--- linux-3.6-rc4.orig/drivers/net/phy/national.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/national.c 2012-09-10 11:08:27.000000000 +0200
@@ -137,6 +137,7 @@ static struct phy_driver dp83865_driver
.flags = PHY_HAS_INTERRUPT,
.config_init = ns_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = ns_ack_interrupt,
.config_intr = ns_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/phy.c linux-3.6-rc4/drivers/net/phy/phy.c
--- linux-3.6-rc4.orig/drivers/net/phy/phy.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/phy.c 2012-09-10 11:24:18.000000000 +0200
@@ -95,24 +95,6 @@ static int phy_config_interrupt(struct p
return err;
}
-
-/**
- * phy_aneg_done - return auto-negotiation status
- * @phydev: target phy_device struct
- *
- * Description: Reads the status register and returns 0 either if
- * auto-negotiation is incomplete, or if there was an error.
- * Returns BMSR_ANEGCOMPLETE if auto-negotiation is done.
- */
-static inline int phy_aneg_done(struct phy_device *phydev)
-{
- int retval;
-
- retval = phy_read(phydev, MII_BMSR);
-
- return (retval < 0) ? retval : (retval & BMSR_ANEGCOMPLETE);
-}
-
/* A structure for mapping a particular speed and duplex
* combination to a particular SUPPORTED and ADVERTISED value */
struct phy_setting {
@@ -807,7 +789,7 @@ void phy_state_machine(struct work_struc
/* Check if negotiation is done. Break
* if there's an error */
- err = phy_aneg_done(phydev);
+ err = phydev->drv->aneg_done(phydev);
if (err < 0)
break;
@@ -921,7 +903,7 @@ void phy_state_machine(struct work_struc
break;
if (AUTONEG_ENABLE == phydev->autoneg) {
- err = phy_aneg_done(phydev);
+ err = phydev->drv->aneg_done(phydev);
if (err < 0)
break;
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/phy_device.c linux-3.6-rc4/drivers/net/phy/phy_device.c
--- linux-3.6-rc4.orig/drivers/net/phy/phy_device.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/phy_device.c 2012-09-06 15:00:32.000000000 +0200
@@ -785,6 +785,23 @@ int genphy_config_aneg(struct phy_device
EXPORT_SYMBOL(genphy_config_aneg);
/**
+ * genphy_aneg_done - return auto-negotiation status
+ * @phydev: target phy_device struct
+ *
+ * Description: Reads the status register and returns positive value if
+ * auto-negotiation is complete, 0 if incomplete and negative on failure.
+ */
+int genphy_aneg_done(struct phy_device *phydev)
+{
+ int retval;
+
+ retval = phy_read(phydev, MII_BMSR);
+
+ return (retval < 0) ? retval : (retval & BMSR_ANEGCOMPLETE);
+}
+EXPORT_SYMBOL(genphy_aneg_done);
+
+/**
* genphy_update_link - update link status in @phydev
* @phydev: target phy_device struct
*
@@ -1117,6 +1134,7 @@ static struct phy_driver genphy_driver =
.config_init = genphy_config_init,
.features = 0,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.suspend = genphy_suspend,
.resume = genphy_resume,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/qsemi.c linux-3.6-rc4/drivers/net/phy/qsemi.c
--- linux-3.6-rc4.orig/drivers/net/phy/qsemi.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/qsemi.c 2012-09-10 11:11:08.000000000 +0200
@@ -119,6 +119,7 @@ static struct phy_driver qs6612_driver =
.flags = PHY_HAS_INTERRUPT,
.config_init = qs6612_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = qs6612_ack_interrupt,
.config_intr = qs6612_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/realtek.c linux-3.6-rc4/drivers/net/phy/realtek.c
--- linux-3.6-rc4.orig/drivers/net/phy/realtek.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/realtek.c 2012-09-10 11:11:49.000000000 +0200
@@ -57,6 +57,7 @@ static struct phy_driver rtl821x_driver
.features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_aneg = &genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &rtl821x_ack_interrupt,
.config_intr = &rtl821x_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/smsc.c linux-3.6-rc4/drivers/net/phy/smsc.c
--- linux-3.6-rc4.orig/drivers/net/phy/smsc.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/smsc.c 2012-09-10 11:11:35.000000000 +0200
@@ -73,6 +73,7 @@ static struct phy_driver smsc_phy_driver
/* basic functions */
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.config_init = smsc_phy_config_init,
@@ -95,6 +96,7 @@ static struct phy_driver smsc_phy_driver
/* basic functions */
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.config_init = smsc_phy_config_init,
@@ -117,6 +119,7 @@ static struct phy_driver smsc_phy_driver
/* basic functions */
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.config_init = smsc_phy_config_init,
@@ -139,6 +142,7 @@ static struct phy_driver smsc_phy_driver
/* basic functions */
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.config_init = lan911x_config_init,
@@ -161,6 +165,7 @@ static struct phy_driver smsc_phy_driver
/* basic functions */
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.config_init = smsc_phy_config_init,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/ste10Xp.c linux-3.6-rc4/drivers/net/phy/ste10Xp.c
--- linux-3.6-rc4.orig/drivers/net/phy/ste10Xp.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/ste10Xp.c 2012-09-10 11:10:37.000000000 +0200
@@ -90,6 +90,7 @@ static struct phy_driver ste10xp_pdriver
.flags = PHY_HAS_INTERRUPT,
.config_init = ste10Xp_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = ste10Xp_ack_interrupt,
.config_intr = ste10Xp_config_intr,
@@ -104,6 +105,7 @@ static struct phy_driver ste10xp_pdriver
.flags = PHY_HAS_INTERRUPT,
.config_init = ste10Xp_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = ste10Xp_ack_interrupt,
.config_intr = ste10Xp_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/vitesse.c linux-3.6-rc4/drivers/net/phy/vitesse.c
--- linux-3.6-rc4.orig/drivers/net/phy/vitesse.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/vitesse.c 2012-09-10 11:06:28.000000000 +0200
@@ -160,6 +160,7 @@ static struct phy_driver vsc82xx_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = &vsc824x_config_init,
.config_aneg = &genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &vsc824x_ack_interrupt,
.config_intr = &vsc82xx_config_intr,
@@ -173,6 +174,7 @@ static struct phy_driver vsc82xx_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = &vsc8221_config_init,
.config_aneg = &genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &vsc824x_ack_interrupt,
.config_intr = &vsc82xx_config_intr,
diff -uprN linux-3.6-rc4.orig/include/linux/phy.h linux-3.6-rc4/include/linux/phy.h
--- linux-3.6-rc4.orig/include/linux/phy.h 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/include/linux/phy.h 2012-09-06 15:06:40.000000000 +0200
@@ -369,8 +369,8 @@ struct phy_device {
* flags: A bitfield defining certain other features this PHY
* supports (like interrupts)
*
- * The drivers must implement config_aneg and read_status. All
- * other functions are optional. Note that none of these
+ * The drivers must implement config_aneg, aneg_done and read_status.
+ * All other functions are optional. Note that none of these
* functions should be called from interrupt time. The goal is
* for the bus read/write functions to be able to block when the
* bus transaction is happening, and be freed up by an interrupt
@@ -408,6 +408,13 @@ struct phy_driver {
*/
int (*config_aneg)(struct phy_device *phydev);
+ /*
+ * Reads auto-negotiation status. Returns positive value if
+ * auto-negotiation is complete, 0 if incomplete and negative
+ * value on error
+ */
+ int (*aneg_done)(struct phy_device *phydev);
+
/* Determines the negotiated speed and duplex */
int (*read_status)(struct phy_device *phydev);
@@ -528,6 +535,7 @@ static inline int phy_read_status(struct
int genphy_restart_aneg(struct phy_device *phydev);
int genphy_config_aneg(struct phy_device *phydev);
+int genphy_aneg_done(struct phy_device *phydev);
int genphy_update_link(struct phy_device *phydev);
int genphy_read_status(struct phy_device *phydev);
int genphy_suspend(struct phy_device *phydev);
--
Best regards,
Alexander Sverdlin.
^ permalink raw reply
* Re: [tcpdump-workers] Modular arithmetic
From: Daniel Borkmann @ 2012-09-10 11:49 UTC (permalink / raw)
To: David Laight
Cc: Eric Dumazet, Andi Kleen, George Bakos, tcpdump-workers,
Jay Schulist, netdev
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B6FE5@saturn3.aculab.com>
On Mon, Sep 10, 2012 at 12:41 PM, David Laight <David.Laight@aculab.com> wrote:
>> > What about the other OS - eg all the BSDs?
>> > I had a vague idea that BPF was supposed to be reasonable portable.
>>
>> Yes, does it mean BPF is frozen ?
>>
>> Or is BSD so hard to update these days ?
>
> Not really - but it some other places that need updating in order
> to make this useful for cross-platform tools (like tcpdump).
>
> The 'real fun (tm)' happens when NetBSD tries to run Linux binaries
> that include the Linux libpcap.
Correct me if I'm wrong, but if you want to run the _Linux_ version of
libpcap, then you would also need PF_PACKET's RX_RING API in NetBSD.
Otherwise, it doesn't run either. Probably then this BPF instruction
is the smaller problem for NetBSD.
^ permalink raw reply
* [PATCH] Generalise "auto-negotiation done" function, move generic PHY code to phy_device.c
From: Alexander Sverdlin @ 2012-09-10 11:22 UTC (permalink / raw)
To: netdev, Andy Fleming; +Cc: Alexander Sverdlin
From: Alexander Sverdlin <alexander.sverdlin@sysgo.com>
Generalise "auto-negotiation done" function, move generic PHY code to phy_device.c
Not all devices have "auto-negotiation done" bit at the place, as expected by
phy_aneg_done() in phy.c. Example of such device is Marvell 88E61xx Ethernet
switch which could be controlled by Linux PHY layer, if struct phy_driver had
abstraction for above function. So move hardware-dependent implementation details
for "generic" PHY to phy_device.c, and modify all PHY drivers to use new field.
Now phy.c contains only high-level state-machine functionality, leaving
hardware-layer to different drivers.
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@sysgo.com>
---
diff -uprN linux-3.6-rc4.orig/Documentation/networking/phy.txt linux-3.6-rc4/Documentation/networking/phy.txt
--- linux-3.6-rc4.orig/Documentation/networking/phy.txt 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/Documentation/networking/phy.txt 2012-09-10 10:54:52.000000000 +0200
@@ -1,7 +1,7 @@
-------
PHY Abstraction Layer
-(Updated 2008-04-08)
+(Updated 2012-09-06)
Purpose
@@ -257,15 +257,16 @@ Writing a PHY driver
probe: Does any setup needed by the driver
suspend/resume: power management
config_aneg: Changes the speed/duplex/negotiation settings
+ aneg_done: Reads current auto-negotiation state
read_status: Reads the current speed/duplex/negotiation settings
ack_interrupt: Clear a pending interrupt
config_intr: Enable or disable interrupts
remove: Does any driver take-down
- Of these, only config_aneg and read_status are required to be
+ Of these, only config_aneg, aneg_done and read_status are required to be
assigned by the driver code. The rest are optional. Also, it is
- preferred to use the generic phy driver's versions of these two
- functions if at all possible: genphy_read_status and
+ preferred to use the generic phy driver's versions of these three
+ functions if at all possible: genphy_read_status, genphy_aneg_done and
genphy_config_aneg. If this is not possible, it is likely that
you only need to perform some actions before and after invoking
these functions, and so your functions will wrap the generic
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/amd.c linux-3.6-rc4/drivers/net/phy/amd.c
--- linux-3.6-rc4.orig/drivers/net/phy/amd.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/amd.c 2012-09-10 11:04:35.000000000 +0200
@@ -69,6 +69,7 @@ static struct phy_driver am79c_driver =
.flags = PHY_HAS_INTERRUPT,
.config_init = am79c_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = am79c_ack_interrupt,
.config_intr = am79c_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/bcm63xx.c linux-3.6-rc4/drivers/net/phy/bcm63xx.c
--- linux-3.6-rc4.orig/drivers/net/phy/bcm63xx.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/bcm63xx.c 2012-09-10 11:10:04.000000000 +0200
@@ -81,6 +81,7 @@ static struct phy_driver bcm63xx_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = bcm63xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm63xx_ack_interrupt,
.config_intr = bcm63xx_config_intr,
@@ -94,6 +95,7 @@ static struct phy_driver bcm63xx_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = bcm63xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm63xx_ack_interrupt,
.config_intr = bcm63xx_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/bcm87xx.c linux-3.6-rc4/drivers/net/phy/bcm87xx.c
--- linux-3.6-rc4.orig/drivers/net/phy/bcm87xx.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/bcm87xx.c 2012-09-10 11:10:59.000000000 +0200
@@ -195,6 +195,7 @@ static struct phy_driver bcm87xx_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = bcm87xx_config_init,
.config_aneg = bcm87xx_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = bcm87xx_read_status,
.ack_interrupt = bcm87xx_ack_interrupt,
.config_intr = bcm87xx_config_intr,
@@ -208,6 +209,7 @@ static struct phy_driver bcm87xx_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = bcm87xx_config_init,
.config_aneg = bcm87xx_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = bcm87xx_read_status,
.ack_interrupt = bcm87xx_ack_interrupt,
.config_intr = bcm87xx_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/broadcom.c linux-3.6-rc4/drivers/net/phy/broadcom.c
--- linux-3.6-rc4.orig/drivers/net/phy/broadcom.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/broadcom.c 2012-09-10 11:09:49.000000000 +0200
@@ -692,6 +692,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -705,6 +706,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -718,6 +720,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -731,6 +734,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -744,6 +748,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = bcm5481_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -757,6 +762,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm5482_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = bcm5482_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -770,6 +776,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -783,6 +790,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -796,6 +804,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = bcm54xx_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = bcm54xx_ack_interrupt,
.config_intr = bcm54xx_config_intr,
@@ -809,6 +818,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = brcm_fet_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = brcm_fet_ack_interrupt,
.config_intr = brcm_fet_config_intr,
@@ -822,6 +832,7 @@ static struct phy_driver broadcom_driver
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = brcm_fet_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = brcm_fet_ack_interrupt,
.config_intr = brcm_fet_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/cicada.c linux-3.6-rc4/drivers/net/phy/cicada.c
--- linux-3.6-rc4.orig/drivers/net/phy/cicada.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/cicada.c 2012-09-10 11:06:41.000000000 +0200
@@ -111,6 +111,7 @@ static struct phy_driver cis820x_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = &cis820x_config_init,
.config_aneg = &genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &cis820x_ack_interrupt,
.config_intr = &cis820x_config_intr,
@@ -123,6 +124,7 @@ static struct phy_driver cis820x_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = &cis820x_config_init,
.config_aneg = &genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &cis820x_ack_interrupt,
.config_intr = &cis820x_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/davicom.c linux-3.6-rc4/drivers/net/phy/davicom.c
--- linux-3.6-rc4.orig/drivers/net/phy/davicom.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/davicom.c 2012-09-10 11:05:54.000000000 +0200
@@ -152,6 +152,7 @@ static struct phy_driver dm91xx_driver[]
.features = PHY_BASIC_FEATURES,
.config_init = dm9161_config_init,
.config_aneg = dm9161_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.driver = { .owner = THIS_MODULE,},
}, {
@@ -161,6 +162,7 @@ static struct phy_driver dm91xx_driver[]
.features = PHY_BASIC_FEATURES,
.config_init = dm9161_config_init,
.config_aneg = dm9161_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.driver = { .owner = THIS_MODULE,},
}, {
@@ -170,6 +172,7 @@ static struct phy_driver dm91xx_driver[]
.features = PHY_BASIC_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = dm9161_ack_interrupt,
.config_intr = dm9161_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/dp83640.c linux-3.6-rc4/drivers/net/phy/dp83640.c
--- linux-3.6-rc4.orig/drivers/net/phy/dp83640.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/dp83640.c 2012-09-10 11:10:16.000000000 +0200
@@ -1257,6 +1257,7 @@ static struct phy_driver dp83640_driver
.probe = dp83640_probe,
.remove = dp83640_remove,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ts_info = dp83640_ts_info,
.hwtstamp = dp83640_hwtstamp,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/et1011c.c linux-3.6-rc4/drivers/net/phy/et1011c.c
--- linux-3.6-rc4.orig/drivers/net/phy/et1011c.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/et1011c.c 2012-09-10 11:04:08.000000000 +0200
@@ -94,6 +94,7 @@ static struct phy_driver et1011c_driver
.features = (PHY_BASIC_FEATURES | SUPPORTED_1000baseT_Full),
.flags = PHY_POLL,
.config_aneg = et1011c_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = et1011c_read_status,
.driver = { .owner = THIS_MODULE,},
};
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/icplus.c linux-3.6-rc4/drivers/net/phy/icplus.c
--- linux-3.6-rc4.orig/drivers/net/phy/icplus.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/icplus.c 2012-09-10 11:05:27.000000000 +0200
@@ -210,6 +210,7 @@ static struct phy_driver icplus_driver[]
.features = PHY_BASIC_FEATURES,
.config_init = &ip175c_config_init,
.config_aneg = &ip175c_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &ip175c_read_status,
.suspend = genphy_suspend,
.resume = genphy_resume,
@@ -222,6 +223,7 @@ static struct phy_driver icplus_driver[]
SUPPORTED_Asym_Pause,
.config_init = &ip1001_config_init,
.config_aneg = &genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.suspend = genphy_suspend,
.resume = genphy_resume,
@@ -236,6 +238,7 @@ static struct phy_driver icplus_driver[]
.ack_interrupt = ip101a_g_ack_interrupt,
.config_init = &ip101a_g_config_init,
.config_aneg = &genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.suspend = genphy_suspend,
.resume = genphy_resume,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/lxt.c linux-3.6-rc4/drivers/net/phy/lxt.c
--- linux-3.6-rc4.orig/drivers/net/phy/lxt.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/lxt.c 2012-09-10 11:06:12.000000000 +0200
@@ -158,6 +158,7 @@ static struct phy_driver lxt97x_driver[]
.flags = PHY_HAS_INTERRUPT,
.config_init = lxt970_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = lxt970_ack_interrupt,
.config_intr = lxt970_config_intr,
@@ -169,6 +170,7 @@ static struct phy_driver lxt97x_driver[]
.features = PHY_BASIC_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = lxt971_ack_interrupt,
.config_intr = lxt971_config_intr,
@@ -181,6 +183,7 @@ static struct phy_driver lxt97x_driver[]
.flags = 0,
.probe = lxt973_probe,
.config_aneg = lxt973_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.driver = { .owner = THIS_MODULE,},
} };
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/marvell.c linux-3.6-rc4/drivers/net/phy/marvell.c
--- linux-3.6-rc4.orig/drivers/net/phy/marvell.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/marvell.c 2012-09-10 11:07:30.000000000 +0200
@@ -713,6 +713,7 @@ static struct phy_driver marvell_drivers
.features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_aneg = &marvell_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -726,6 +727,7 @@ static struct phy_driver marvell_drivers
.flags = PHY_HAS_INTERRUPT,
.config_init = &m88e1111_config_init,
.config_aneg = &marvell_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -739,6 +741,7 @@ static struct phy_driver marvell_drivers
.flags = PHY_HAS_INTERRUPT,
.config_init = &m88e1111_config_init,
.config_aneg = &marvell_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &marvell_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -752,6 +755,7 @@ static struct phy_driver marvell_drivers
.flags = PHY_HAS_INTERRUPT,
.config_init = &m88e1118_config_init,
.config_aneg = &m88e1118_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -764,6 +768,7 @@ static struct phy_driver marvell_drivers
.features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_aneg = &m88e1121_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &marvell_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -777,6 +782,7 @@ static struct phy_driver marvell_drivers
.features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_aneg = &m88e1318_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &marvell_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -791,6 +797,7 @@ static struct phy_driver marvell_drivers
.flags = PHY_HAS_INTERRUPT,
.config_init = &m88e1145_config_init,
.config_aneg = &marvell_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -804,6 +811,7 @@ static struct phy_driver marvell_drivers
.flags = PHY_HAS_INTERRUPT,
.config_init = &m88e1149_config_init,
.config_aneg = &m88e1118_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
@@ -817,6 +825,7 @@ static struct phy_driver marvell_drivers
.flags = PHY_HAS_INTERRUPT,
.config_init = &m88e1111_config_init,
.config_aneg = &marvell_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/micrel.c linux-3.6-rc4/drivers/net/phy/micrel.c
--- linux-3.6-rc4.orig/drivers/net/phy/micrel.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/micrel.c 2012-09-10 11:07:55.000000000 +0200
@@ -123,6 +123,7 @@ static struct phy_driver ksphy_driver[]
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = kszphy_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
.config_intr = ks8737_config_intr,
@@ -136,6 +137,7 @@ static struct phy_driver ksphy_driver[]
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = kszphy_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
.config_intr = kszphy_config_intr,
@@ -149,6 +151,7 @@ static struct phy_driver ksphy_driver[]
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = ks8051_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
.config_intr = kszphy_config_intr,
@@ -161,6 +164,7 @@ static struct phy_driver ksphy_driver[]
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = kszphy_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
.config_intr = kszphy_config_intr,
@@ -174,6 +178,7 @@ static struct phy_driver ksphy_driver[]
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = kszphy_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
.config_intr = ksz9021_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/national.c linux-3.6-rc4/drivers/net/phy/national.c
--- linux-3.6-rc4.orig/drivers/net/phy/national.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/national.c 2012-09-10 11:08:27.000000000 +0200
@@ -137,6 +137,7 @@ static struct phy_driver dp83865_driver
.flags = PHY_HAS_INTERRUPT,
.config_init = ns_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = ns_ack_interrupt,
.config_intr = ns_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/phy.c linux-3.6-rc4/drivers/net/phy/phy.c
--- linux-3.6-rc4.orig/drivers/net/phy/phy.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/phy.c 2012-09-10 11:24:18.000000000 +0200
@@ -95,24 +95,6 @@ static int phy_config_interrupt(struct p
return err;
}
-
-/**
- * phy_aneg_done - return auto-negotiation status
- * @phydev: target phy_device struct
- *
- * Description: Reads the status register and returns 0 either if
- * auto-negotiation is incomplete, or if there was an error.
- * Returns BMSR_ANEGCOMPLETE if auto-negotiation is done.
- */
-static inline int phy_aneg_done(struct phy_device *phydev)
-{
- int retval;
-
- retval = phy_read(phydev, MII_BMSR);
-
- return (retval < 0) ? retval : (retval & BMSR_ANEGCOMPLETE);
-}
-
/* A structure for mapping a particular speed and duplex
* combination to a particular SUPPORTED and ADVERTISED value */
struct phy_setting {
@@ -807,7 +789,7 @@ void phy_state_machine(struct work_struc
/* Check if negotiation is done. Break
* if there's an error */
- err = phy_aneg_done(phydev);
+ err = phydev->drv->aneg_done(phydev);
if (err < 0)
break;
@@ -921,7 +903,7 @@ void phy_state_machine(struct work_struc
break;
if (AUTONEG_ENABLE == phydev->autoneg) {
- err = phy_aneg_done(phydev);
+ err = phydev->drv->aneg_done(phydev);
if (err < 0)
break;
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/phy_device.c linux-3.6-rc4/drivers/net/phy/phy_device.c
--- linux-3.6-rc4.orig/drivers/net/phy/phy_device.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/phy_device.c 2012-09-06 15:00:32.000000000 +0200
@@ -785,6 +785,23 @@ int genphy_config_aneg(struct phy_device
EXPORT_SYMBOL(genphy_config_aneg);
/**
+ * genphy_aneg_done - return auto-negotiation status
+ * @phydev: target phy_device struct
+ *
+ * Description: Reads the status register and returns positive value if
+ * auto-negotiation is complete, 0 if incomplete and negative on failure.
+ */
+int genphy_aneg_done(struct phy_device *phydev)
+{
+ int retval;
+
+ retval = phy_read(phydev, MII_BMSR);
+
+ return (retval < 0) ? retval : (retval & BMSR_ANEGCOMPLETE);
+}
+EXPORT_SYMBOL(genphy_aneg_done);
+
+/**
* genphy_update_link - update link status in @phydev
* @phydev: target phy_device struct
*
@@ -1117,6 +1134,7 @@ static struct phy_driver genphy_driver =
.config_init = genphy_config_init,
.features = 0,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.suspend = genphy_suspend,
.resume = genphy_resume,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/qsemi.c linux-3.6-rc4/drivers/net/phy/qsemi.c
--- linux-3.6-rc4.orig/drivers/net/phy/qsemi.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/qsemi.c 2012-09-10 11:11:08.000000000 +0200
@@ -119,6 +119,7 @@ static struct phy_driver qs6612_driver =
.flags = PHY_HAS_INTERRUPT,
.config_init = qs6612_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = qs6612_ack_interrupt,
.config_intr = qs6612_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/realtek.c linux-3.6-rc4/drivers/net/phy/realtek.c
--- linux-3.6-rc4.orig/drivers/net/phy/realtek.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/realtek.c 2012-09-10 11:11:49.000000000 +0200
@@ -57,6 +57,7 @@ static struct phy_driver rtl821x_driver
.features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_aneg = &genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &rtl821x_ack_interrupt,
.config_intr = &rtl821x_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/smsc.c linux-3.6-rc4/drivers/net/phy/smsc.c
--- linux-3.6-rc4.orig/drivers/net/phy/smsc.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/smsc.c 2012-09-10 11:11:35.000000000 +0200
@@ -73,6 +73,7 @@ static struct phy_driver smsc_phy_driver
/* basic functions */
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.config_init = smsc_phy_config_init,
@@ -95,6 +96,7 @@ static struct phy_driver smsc_phy_driver
/* basic functions */
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.config_init = smsc_phy_config_init,
@@ -117,6 +119,7 @@ static struct phy_driver smsc_phy_driver
/* basic functions */
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.config_init = smsc_phy_config_init,
@@ -139,6 +142,7 @@ static struct phy_driver smsc_phy_driver
/* basic functions */
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.config_init = lan911x_config_init,
@@ -161,6 +165,7 @@ static struct phy_driver smsc_phy_driver
/* basic functions */
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.config_init = smsc_phy_config_init,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/ste10Xp.c linux-3.6-rc4/drivers/net/phy/ste10Xp.c
--- linux-3.6-rc4.orig/drivers/net/phy/ste10Xp.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/ste10Xp.c 2012-09-10 11:10:37.000000000 +0200
@@ -90,6 +90,7 @@ static struct phy_driver ste10xp_pdriver
.flags = PHY_HAS_INTERRUPT,
.config_init = ste10Xp_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = ste10Xp_ack_interrupt,
.config_intr = ste10Xp_config_intr,
@@ -104,6 +105,7 @@ static struct phy_driver ste10xp_pdriver
.flags = PHY_HAS_INTERRUPT,
.config_init = ste10Xp_config_init,
.config_aneg = genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,
.ack_interrupt = ste10Xp_ack_interrupt,
.config_intr = ste10Xp_config_intr,
diff -uprN linux-3.6-rc4.orig/drivers/net/phy/vitesse.c linux-3.6-rc4/drivers/net/phy/vitesse.c
--- linux-3.6-rc4.orig/drivers/net/phy/vitesse.c 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/drivers/net/phy/vitesse.c 2012-09-10 11:06:28.000000000 +0200
@@ -160,6 +160,7 @@ static struct phy_driver vsc82xx_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = &vsc824x_config_init,
.config_aneg = &genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &vsc824x_ack_interrupt,
.config_intr = &vsc82xx_config_intr,
@@ -173,6 +174,7 @@ static struct phy_driver vsc82xx_driver[
.flags = PHY_HAS_INTERRUPT,
.config_init = &vsc8221_config_init,
.config_aneg = &genphy_config_aneg,
+ .aneg_done = genphy_aneg_done,
.read_status = &genphy_read_status,
.ack_interrupt = &vsc824x_ack_interrupt,
.config_intr = &vsc82xx_config_intr,
diff -uprN linux-3.6-rc4.orig/include/linux/phy.h linux-3.6-rc4/include/linux/phy.h
--- linux-3.6-rc4.orig/include/linux/phy.h 2012-09-01 19:39:58.000000000 +0200
+++ linux-3.6-rc4/include/linux/phy.h 2012-09-06 15:06:40.000000000 +0200
@@ -369,8 +369,8 @@ struct phy_device {
* flags: A bitfield defining certain other features this PHY
* supports (like interrupts)
*
- * The drivers must implement config_aneg and read_status. All
- * other functions are optional. Note that none of these
+ * The drivers must implement config_aneg, aneg_done and read_status.
+ * All other functions are optional. Note that none of these
* functions should be called from interrupt time. The goal is
* for the bus read/write functions to be able to block when the
* bus transaction is happening, and be freed up by an interrupt
@@ -408,6 +408,13 @@ struct phy_driver {
*/
int (*config_aneg)(struct phy_device *phydev);
+ /*
+ * Reads auto-negotiation status. Returns positive value if
+ * auto-negotiation is complete, 0 if incomplete and negative
+ * value on error
+ */
+ int (*aneg_done)(struct phy_device *phydev);
+
/* Determines the negotiated speed and duplex */
int (*read_status)(struct phy_device *phydev);
@@ -528,6 +535,7 @@ static inline int phy_read_status(struct
int genphy_restart_aneg(struct phy_device *phydev);
int genphy_config_aneg(struct phy_device *phydev);
+int genphy_aneg_done(struct phy_device *phydev);
int genphy_update_link(struct phy_device *phydev);
int genphy_read_status(struct phy_device *phydev);
int genphy_suspend(struct phy_device *phydev);
^ permalink raw reply
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