* Re: [PATCH] r8169: offical fix for CVE-2009-4537 (overlength frame DMAs)
From: Ben Hutchings @ 2010-03-29 22:21 UTC (permalink / raw)
To: David Miller
Cc: nhorman, linux-kernel, netdev, michael.s.gilbert, davem, romieu,
eric.dumazet
In-Reply-To: <20100329.150924.144366212.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]
On Mon, 2010-03-29 at 15:09 -0700, David Miller wrote:
> From: Ben Hutchings <ben@decadent.org.uk>
> Date: Mon, 29 Mar 2010 23:01:45 +0100
>
> > It also sucks that the secure but low-performance behaviour is enabled
> > for all variants, while AIUI only some suffer from the bug. I realise
> > you probably don't have access to every variant (and neither does
> > Francois) but perhaps you could come up with a test case that could be
> > used to start whitelisting common variants that don't have the bug?
>
> As far as we know all chip variants seem to have the problem.
That's not what I understood from the discussion of the early
back-and-forth changes to receive buffer size.
> Furthermore, this issue has been known about and investigated for
> about 3 months. In that time no better options for handling this
> issue reliably have been discovered and implemented.
>
> Feel free to code up (and test) something better yourself if you don't
> like the fix as it exists currently. :-)
I would have had a go already, if I actually had some of this hardware
to hand. Luckily I have managed to avoid buying any so far. But if
anyone is prepared to loan me a NIC then I promise to have a go at it.
Ben.
--
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: [PATCH RFC] inetpeer: Support ipv6 addresses.
From: David Miller @ 2010-03-29 22:15 UTC (permalink / raw)
To: herbert; +Cc: netdev
In-Reply-To: <20100328143235.GA16694@gondor.apana.org.au>
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Sun, 28 Mar 2010 22:32:35 +0800
> Instead of placing the metrics into the inetpeer, we create a new
> global cache for them (let's call it the metrics cache for now).
> However, we don't actually populate this cache every time we create
> an rt object. Instead, we only create an entry in this cache
> when an event requires it, e.g., when we receive a PMTU message.
>
> In order for this to then propagate to the rt objects, we increment
> a genid in the inetpeer cache for the corresponding host. This
> genid is then checked by the rt object every time. When it is
> out of step, the rt object can perform a lookup in the metrics cache
> to get the latest data.
>
> Of course once an rt object has a pointer to an entry in the metrics
> cache it doesn't need to check the genid anymore, until the metrics
> data expires at which point this process can be repeated.
Interesting idea, but there is the issue of how to fill in
new metrics cache entries when these requests come in later.
We'd have to retain a pointer to the routing table fib entry.
This is because the fib entry states what the initial metric
values need to be for cached routes.
So we'd need a pointer to the fib_info in the routing cache entry, and
this pointer would need to grab a reference to the fib_info. And this
subsequently leads to the question of what to do for route changes
(f.e. hold the fib_info around until all the route cache entries drop
their references and have a dead state in the fib_info struct that can
be checked, and if we find it dead what can we even do as the route
we're working with might be cached in a socket or similar)
The other option is to relookup the FIB, but we'd then have to
validate that the route cache entry we're working with matches
precisely still, and also this lookup alone going to have non-trivial
cost :-)
It's really depressing how hard it is to untangle the way we have
things currently setup, isn't it. :-)
^ permalink raw reply
* Re: [PATCH] r8169: offical fix for CVE-2009-4537 (overlength frame DMAs)
From: David Miller @ 2010-03-29 22:09 UTC (permalink / raw)
To: ben
Cc: nhorman, linux-kernel, netdev, michael.s.gilbert, davem, romieu,
eric.dumazet
In-Reply-To: <1269900105.8653.389.camel@localhost>
From: Ben Hutchings <ben@decadent.org.uk>
Date: Mon, 29 Mar 2010 23:01:45 +0100
> It also sucks that the secure but low-performance behaviour is enabled
> for all variants, while AIUI only some suffer from the bug. I realise
> you probably don't have access to every variant (and neither does
> Francois) but perhaps you could come up with a test case that could be
> used to start whitelisting common variants that don't have the bug?
As far as we know all chip variants seem to have the problem.
Furthermore, this issue has been known about and investigated for
about 3 months. In that time no better options for handling this
issue reliably have been discovered and implemented.
Feel free to code up (and test) something better yourself if you don't
like the fix as it exists currently. :-)
^ permalink raw reply
* Re: [PATCH] r8169: offical fix for CVE-2009-4537 (overlength frame DMAs)
From: Ben Hutchings @ 2010-03-29 22:01 UTC (permalink / raw)
To: Neil Horman
Cc: linux-kernel, netdev, michael.s.gilbert, davem, romieu,
eric.dumazet
In-Reply-To: <20100329160356.GC22733@hmsreliant.think-freely.org>
[-- Attachment #1: Type: text/plain, Size: 1480 bytes --]
On Mon, 2010-03-29 at 12:03 -0400, Neil Horman wrote:
> Official patch to fix the r8169 frame length check error.
>
> Based on this initial thread:
> http://marc.info/?l=linux-netdev&m=126202972828626&w=1
> This is the official patch to fix the frame length problems in the r8169
> driver. As noted in the previous thread, while this patch incurs a performance
> hit on the driver, its possible to improve performance dynamically by updating
> the mtu and rx_copybreak values at runtime to return performance to what it was
> for those NICS which are unaffected by the ideosyncracy (if there are any).
[...]
I have to say that this compromise behaviour is highly non-obvious.
Further, there is now no way to set a non-standard MTU without enabling
the insecure behaviour. (This is in part a flaw in the driver
interface, of course. We should have an interface to get and set MRU
rather than making drivers decide an MRU based on the MTU,
inconsistently and without any visibility to the administrator.)
It also sucks that the secure but low-performance behaviour is enabled
for all variants, while AIUI only some suffer from the bug. I realise
you probably don't have access to every variant (and neither does
Francois) but perhaps you could come up with a test case that could be
used to start whitelisting common variants that don't have the bug?
Ben.
--
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: Add PGM protocol support to the IP stack
From: Andi Kleen @ 2010-03-29 21:43 UTC (permalink / raw)
To: Christoph Lameter; +Cc: Andi Kleen, David Miller, netdev, linux-kernel
In-Reply-To: <alpine.DEB.2.00.1003290952410.14606@router.home>
On Mon, Mar 29, 2010 at 10:00:57AM -0500, Christoph Lameter wrote:
> On Sat, 27 Mar 2010, Andi Kleen wrote:
>
> > On Fri, Mar 26, 2010 at 12:33:07PM -0500, Christoph Lameter wrote:
> > > Here is a pgm.7 manpage describing how the socket API could look like for
> > > a PGM implementation.
> > >
> > > I dumped the RM_* based socket options from the other OS since most of the
> > > options were unusable.
> >
> > I did a quick read and the manpage/interface seem reasonable to me.
>
> Thanks. I will then proceed to get a patch out that implements the
> network environment. Then we can plug the openpgm logic in there.
You might still need some reviewing from network maintainers.
>
> > You changed the parameter struct fields to lower case. While
> > that looks definitely more Linuxy than before does it mean programs
> > have to #ifdef this? It might be good idea to have at least some
> > optional compat header that #defines.
>
> The socket API will be completely different. The basic handling of the
> sockets is the same (binding, listening, connecting). There is no way of
> mapping M$ socket options to Linux socket options with the approach that
> I proposed in the manpage. The stats structure is different too since some
> key elements were missing.
Ok.
>
> What users are there of the M$ api? I have seen vendors supplying their
> own pgm implementation (guess due to bit rot in the old M$
> implementation).
I don't know, it was just a general consideration.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply
* Re: UDP path MTU discovery
From: Eric Dumazet @ 2010-03-29 21:29 UTC (permalink / raw)
To: Rick Jones; +Cc: Edgar E. Iglesias, Andi Kleen, Glen Turner, netdev
In-Reply-To: <4BB11510.9000302@hp.com>
Le lundi 29 mars 2010 à 14:01 -0700, Rick Jones a écrit :
> I would get the alphabet soup completely garbled, but the DNS folks are talking
> about EDNS (?) message sizes upwards of 4096 bytes - encryption/authentication
> and other angels being asked to dance on the head of the DNS pin are asking for
> more and more space in the messages.
>
> So, someone will have to blink somewhere - either DNS will have to go TCP and
> *possibly* take RTT hits there depending on various patch streams, or the IEEE
> will have to sanction jumbo frames and people deploy them widely, or it will
> have to become feasible to actually do the occasional IPv6 datagram
> fragmentation and get a timely retransmission out of a UDP application on a PMTU
> hit.
>
1) 4096 bytes UDP messages... well...
2) Using regular TCP for DNS servers... well...
I believe some guys were pushing TCPCT (Cookie Transactions) for this
case ( http://tools.ietf.org/html/draft-simpson-tcpct-00.html )
(That is, using an enhanced TCP for long DNS queries... but not only for
DNS...)
^ permalink raw reply
* Re: [ANNOUNCEMENT] NET: usb: sierra_net.c driver
From: Elina Pasheva @ 2010-03-29 21:18 UTC (permalink / raw)
To: David Miller
Cc: marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org,
sclark46-ihVZJaRskl1bRRN4PJnoQQ@public.gmane.org,
dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
Rory Filer, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20100329.134144.57458224.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On Mon, 2010-03-29 at 13:41 -0700, David Miller wrote:
> From: Marcel Holtmann <marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
> Date: Mon, 29 Mar 2010 13:29:53 -0700
>
> > because they are not NIC cards. They just use Ethernet emulation. And
> > they also require a management interface to setup APN and activate them
> > first.
> >
> > It is important that we tell userspace about the type of a network
> > interface. We do the same for WiMAX and WiFi btw.
>
> I completely agree with Marcel on this, please fix the device
> type.
>
Thank you all for reviewing the sierra_net driver and for your comments.
We fixed the device type, re-tested and re-submitted the driver patch.
Regards,
Elina
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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: [PATCH] r8169: fix broken register writes
From: François Romieu @ 2010-03-29 21:11 UTC (permalink / raw)
To: Al Viro; +Cc: Ben Hutchings, David Miller, timo.teras, ivecera, netdev
In-Reply-To: <20100328221924.GG30031@ZenIV.linux.org.uk>
Al Viro <viro@ZenIV.linux.org.uk> :
[...]
> FWIW, XID18000000 here (J7F4) loses MAC4 on shutdown; hadn't tested the patch
> yet. 2.6.26 (on that box) and 2.6.31 (on identical mb) work, 2.6.33 doesn't.
> I suspect that bisect would lead to commit cc098dc70 (i.e. the place where we
> started to set address on shutdown). One more data point: ifconfig hw ether
> done under 2.6.26 did restore the address. And that's the same function,
> isn't it?
You are right.
> Another interesting bit: unlike the older kernel, grep for eth0 in .33 dmesg
>
> eth0: RTL8169sc/8110sc at 0xf87fc000, 00:30:18:a4:65:89, XID 18000000 IRQ 18
> r8169: eth0: link down
> ADDRCONF(NETDEV_UP): eth0: link is not ready
> r8169: eth0: link up
> ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Remove rtl8169scd_hw_phy_config ?
[...]
> Same for .31 on another box, modulo different address there...
No, keep it.
At first sight it looks like rtl8169_open::rtl8169_check_link_status and
a LinkChg interrupt (order eventually reversed) while 2.6.26 did not
notice the interrupt.
--
Ueimor
^ permalink raw reply
* Re [RFC PATCH 1/2] iproute2: Add libnl support.
From: Stephen Hemminger @ 2010-03-29 21:06 UTC (permalink / raw)
To: James Chapman; +Cc: netdev
> This patch links the ip utility with libnl, which must be separately
> installed. This lets new functionality use libnl to implement its
> netlink interfaces.
>
> Package developers will need to add libnl to the iproute2 package
> dependencies.
> ---
> Makefile | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
No. I don't want to make iproute2 dependent on libnl.
It doesn't make sense to have dependency without major need for new
functionality. There are already netlink library routines in iproute2
^ permalink raw reply
* Re: UDP path MTU discovery
From: Rick Jones @ 2010-03-29 21:01 UTC (permalink / raw)
To: Edgar E. Iglesias; +Cc: Andi Kleen, Glen Turner, netdev
In-Reply-To: <20100329205035.GA32656@laped.iglesias.mooo.com>
> Are things really that bad?
>
> These "transactional" IPv6 apps all have the option to stick to 1280
> sized datagrams to avoid the problem. If throughput is an issue these
> apps will surely benefit from proper PMTUD anyway or?
I would get the alphabet soup completely garbled, but the DNS folks are talking
about EDNS (?) message sizes upwards of 4096 bytes - encryption/authentication
and other angels being asked to dance on the head of the DNS pin are asking for
more and more space in the messages.
So, someone will have to blink somewhere - either DNS will have to go TCP and
*possibly* take RTT hits there depending on various patch streams, or the IEEE
will have to sanction jumbo frames and people deploy them widely, or it will
have to become feasible to actually do the occasional IPv6 datagram
fragmentation and get a timely retransmission out of a UDP application on a PMTU
hit.
rick jones
^ permalink raw reply
* Re: pull request: wireless-next-2.6 2010-03-29
From: David Miller @ 2010-03-29 21:00 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev
In-Reply-To: <20100329201319.GJ4984@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Mon, 29 Mar 2010 16:13:19 -0400
> Dave,
>
> Another dump of stuff intended for 2.6.35...nothing too unusual, mostly
> driver updates and some random cleanups.
>
> Please let me know if there are problems!
Pulled, thanks John!
^ permalink raw reply
* Re: UDP path MTU discovery
From: Edgar E. Iglesias @ 2010-03-29 20:50 UTC (permalink / raw)
To: Andi Kleen; +Cc: Rick Jones, Glen Turner, netdev
In-Reply-To: <20100329201431.GH20695@one.firstfloor.org>
On Mon, Mar 29, 2010 at 10:14:31PM +0200, Andi Kleen wrote:
> On Mon, Mar 29, 2010 at 10:01:42AM -0700, Rick Jones wrote:
> > >In theory one could probably add some hack in the the kernel UDP code
> > >to hold one packet and retransmit it immediately with fragments when
> > >the ICMP comes in. However that would be quite far in behaviour from
> > >traditional UDP and be considered very ugly. It could also mess up
> > >congestion avoidance schemes done by the application.
> > >
> > >Still might be preferable over rewriting zillions of applications?
> >
> > But which of the last N datagrams sent by the application should be
> > retained for retransmission? It could be scores if not hundreds of
> > datagrams depending on the behaviour of the application and the latency to
> > the narrow part of the network.
>
> Yes, if there's a large window you lose. I guess it would make protocols
> like DHCP work at least ("transactional UDP" as the original poster called it)
>
> I don't know if it would fix enough applications to be worth
> implementing. The only way to find out would be to try I guess.
> I don't have any better ideas.
>
> > That the IPv6 specification was heavily "influenced" by "the router guys"
> > seems increasingly clear...
>
> Yes it sounds like the IETF didn't completely think that through.
Are things really that bad?
These "transactional" IPv6 apps all have the option to stick to 1280
sized datagrams to avoid the problem. If throughput is an issue these
apps will surely benefit from proper PMTUD anyway or?
Cheers
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2010-03-29 20:45 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
1) Intel drivers change tx_queue_len on link speed change and
this can very seriously screw configs up on people, particularly
wrt. packet scheduler setups. From Emil Tantilov.
2) In IXGBE, if FIP negotatiation frames don't get steered to the FCoE
queues, drops can happen because FCoE frames going through the
switches can send packets larger than the standard MTU and we must
accept them. Fix from Chris Leech.
3) The long overdue fix for the r8169 CVE length check issue.
Should have merged this over a month ago but it slipped
through the cracks. From Neil Horman.
4) We tried to enable 64-bit DMA by default in the r8169 driver
but some people are hitting regressions due to this and
analyzing this will take some time, so revert.
5) If dev_alloc_skb() fails in Tulip's uli526x_rx_packet, we honk
on a NULL pointer. Fix from Kyle McMartin.
6) Fix bug in ipv4/ipv6 netlink address dumping, if we got interrupted
at the very end of a hash chain we wouldn't restart at the right
spot. From Patrick McHardy.
7) When we bump the generation count and rebuild the ipv4 routing
cache after finding abnormally long hash chains, we proceed to
accidently add a new entry with the old generation count which
will never subsequently match. Fix from Pavel Emelyanov.
8) The new recvmmsg() system call is significantly less useful
then intended because there is no way to say "well, if you get
at least one packet, return just that if nothing else is
pending." This adds the MSG_WAITFORONE flag for this purpose.
From Brandon L. Black
9) benet driver is missing "ULL" marker in 64-bit constants.
Fix from Zhitong Wang.
10) Because of the way we mark unresolved IP multicast routing
cache entries, we can end up accidently accessing past the
end of the vif_table[] array. Fix from Nicolas Dichtel.
11) Multicast in round-robin mode of the bonding driver is broken
because we don't handle properly the cases where the link
that sends out the IGMP join goes down. Fix from
Andy Gospodarek.
12) New ID for pcnet_cs PCMCIA driver, from Ken Kawasaki.
13) Attempt to fix r8169 MAC address writes that end up with the
registers showing zero later. From Francois Romieu.
This will need some more tweaks because Al Viro showed
a case yesterday where this fix is not completely sufficient
for a card he has.
14) In ipv4 we fixed a case where a socket giving negative advice
on a route inadvertantly purged an entry created by an icmp
redirect, even if it hadn't expired yet. This is the ipv6
side of that fix, from YOSHFUJI Hideaki.
15) NetXEN bug fixes via Amit Kumar Salecha:
a) BIOS fw image version checks use wrong shifts.
b) Status consumer I/O address calculation is wrong for
some chip variants.
c) PCI ioremap calls not checked for failure at all.
16) IXGBEVF driver checks unsigned value for negative. Fix from
Greg Rose.
17) IXGBE chips in SR-IOV mode need a delay on bringup to handle
delayed response to PF indications. This is not the most
desirable fix in the long term, but good enough to fix the
problem for the time being. From Greg Rose.
18) In the IXGBE driver we need to clear all of the per-VF
->clear_to_send flags before we invoke ixgbe_ping_all_vfs().
Fix from Greg Rose.
19) Max TX queue calculations in IXGBE are slightly busted, fix from
John Fastabend.
20) In IXGBE, properly enforce a limit of 255 for the FCOE DDP user
buffer count, otherwise we program garbage into registers. Fix
from Robert Love.
21) Gianfar's RX recycling code can corrupt SKBs because it can
accidently double skb_reserve() on a packet before using it. Fix
from Ben Machaca.
22) IGB checks wrong bits in MANC register to see if managability
is enabled. Fix from Alexander Duyck.
23) Elide some diagnostic checks when VFs are online otherwise they
will be confused by home some of these checks take the PF
offline momentarily. Fix from Greg Rose.
Please pull, thanks a lot!
The following changes since commit b72c40949b0f04728f2993a1434598d3bad094ea:
Linus Torvalds (1):
Merge branch 'for-linus' of git://git.kernel.org/.../jbarnes/pci-2.6
are available in the git repository at:
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git master
Alexander Duyck (1):
igb: use correct bits to identify if managability is enabled
Amit Kumar Salecha (4):
netxen: fix bios version calculation
netxen: fix warning in ioaddr for NX3031 chip
netxen: added sanity check for pci map
netxen: update version to 4.0.73
Andy Gospodarek (1):
bonding: fix broken multicast with round-robin mode
Ben Menchaca (1):
gianfar: fix undo of reserve()
Brandon L Black (1):
net: Add MSG_WAITFORONE flag to recvmmsg
Chris Leech (1):
ixgbe: filter FIP frames into the FCoE offload queues
David S. Miller (3):
isdn: Add netdev to lists in MAINTAINERS entry.
Revert "r8169: enable 64-bit DMA by default for PCI Express devices (v2)"
tulip: Add missing parens.
Emil Tantilov (3):
igbvf: do not modify tx_queue_len on link speed change
e1000e: do not modify tx_queue_len on link speed change
e1000: do not modify tx_queue_len on link speed change
Francois Romieu (1):
r8169: fix broken register writes
Greg Rose (4):
ixgbevf: Fix signed/unsigned int error
ixgbe: In SR-IOV mode insert delay before bring the adapter up
ixgbe: Change where clear_to_send_flag is reset to zero.
ixgbe: Do not run all Diagnostic offline tests when VFs are active
Joe Perches (1):
drivers/net: Fix continuation lines
John Fastabend (1):
ixgbe: cleanup maximum number of tx queues
Ken Kawasaki (1):
pcnet_cs: add new id
Kyle McMartin (1):
tulip: Fix null dereference in uli526x_rx_packet()
Neil Horman (1):
r8169: offical fix for CVE-2009-4537 (overlength frame DMAs)
Nicolas Dichtel (1):
net: ipmr/ip6mr: prevent out-of-bounds vif_table access
Patrick McHardy (1):
net: fix netlink address dumping in IPv4/IPv6
Pavel Emelyanov (2):
ipv4: Cleanup struct net dereference in rt_intern_hash
ipv4: Restart rt_intern_hash after emergency rebuild (v2)
Robert Love (2):
ixgbe: Don't allow user buffer count to exceed 256
ixgbe: Priority tag FIP frames
YOSHIFUJI Hideaki / 吉藤英明 (1):
ipv6: Don't drop cache route entry unless timer actually expired.
wzt wzt (1):
benet: Fix compile warnnings in drivers/net/benet/be_ethtool.c
MAINTAINERS | 1 +
drivers/net/atlx/atl1.c | 2 +-
drivers/net/benet/be_ethtool.c | 2 +-
drivers/net/bonding/bond_main.c | 40 ++++++++++++++++++++-----
drivers/net/e1000/e1000.h | 1 -
drivers/net/e1000/e1000_main.c | 9 +-----
drivers/net/e1000e/e1000.h | 1 -
drivers/net/e1000e/netdev.c | 11 +------
drivers/net/gianfar.c | 5 ++-
drivers/net/gianfar.h | 6 ++++
drivers/net/igb/e1000_mac.c | 6 ++--
drivers/net/igbvf/igbvf.h | 1 -
drivers/net/igbvf/netdev.c | 11 +------
drivers/net/ixgbe/ixgbe.h | 7 +++-
drivers/net/ixgbe/ixgbe_ethtool.c | 21 +++++++++++++
drivers/net/ixgbe/ixgbe_fcoe.c | 33 +++++++++++++++-----
drivers/net/ixgbe/ixgbe_main.c | 43 +++++++++++++++++++--------
drivers/net/ixgbe/ixgbe_type.h | 1 +
drivers/net/ixgbevf/ixgbevf_main.c | 3 +-
drivers/net/netxen/netxen_nic.h | 4 +-
drivers/net/netxen/netxen_nic_ctx.c | 14 +++++----
drivers/net/netxen/netxen_nic_init.c | 2 +-
drivers/net/netxen/netxen_nic_main.c | 45 +++++++++++++++++-----------
drivers/net/pcmcia/pcnet_cs.c | 3 +-
drivers/net/r8169.c | 54 ++++++++++++++++++++-------------
drivers/net/tulip/uli526x.c | 8 +++--
drivers/serial/serial_cs.c | 1 +
include/linux/socket.h | 1 +
net/ipv4/devinet.c | 2 +-
net/ipv4/ipmr.c | 11 ++++--
net/ipv4/route.c | 21 ++++++++-----
net/ipv6/addrconf.c | 2 +-
net/ipv6/ip6mr.c | 11 ++++--
net/ipv6/route.c | 13 +++++--
net/socket.c | 4 ++
35 files changed, 256 insertions(+), 144 deletions(-)
^ permalink raw reply
* [PATCH 1/1] fix net/core/dst.c coding style error and warnings
From: chavey @ 2010-03-29 20:41 UTC (permalink / raw)
To: davem; +Cc: netdev, therbert
Fix coding style errors and warnings output while running checkpatch.pl
on the file net/core/dst.c.
Signed-off-by: chavey <chavey@google.com>
---
net/core/dst.c | 41 ++++++++++++++++++++---------------------
1 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/net/core/dst.c b/net/core/dst.c
index cb1b348..2076d84 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -43,7 +43,7 @@ static atomic_t dst_total = ATOMIC_INIT(0);
*/
static struct {
spinlock_t lock;
- struct dst_entry *list;
+ struct dst_entry *list;
unsigned long timer_inc;
unsigned long timer_expires;
} dst_garbage = {
@@ -51,7 +51,7 @@ static struct {
.timer_inc = DST_GC_MAX,
};
static void dst_gc_task(struct work_struct *work);
-static void ___dst_free(struct dst_entry * dst);
+static void ___dst_free(struct dst_entry *dst);
static DECLARE_DELAYED_WORK(dst_gc_work, dst_gc_task);
@@ -135,8 +135,8 @@ loop:
}
expires = dst_garbage.timer_expires;
/*
- * if the next desired timer is more than 4 seconds in the future
- * then round the timer to whole seconds
+ * if the next desired timer is more than 4 seconds in the
+ * future then round the timer to whole seconds
*/
if (expires > 4*HZ)
expires = round_jiffies_relative(expires);
@@ -151,7 +151,8 @@ loop:
" expires: %lu elapsed: %lu us\n",
atomic_read(&dst_total), delayed, work_performed,
expires,
- elapsed.tv_sec * USEC_PER_SEC + elapsed.tv_nsec / NSEC_PER_USEC);
+ elapsed.tv_sec * USEC_PER_SEC +
+ elapsed.tv_nsec / NSEC_PER_USEC);
#endif
}
@@ -162,9 +163,9 @@ int dst_discard(struct sk_buff *skb)
}
EXPORT_SYMBOL(dst_discard);
-void * dst_alloc(struct dst_ops * ops)
+void *dst_alloc(struct dst_ops *ops)
{
- struct dst_entry * dst;
+ struct dst_entry *dst;
if (ops->gc && atomic_read(&ops->entries) > ops->gc_thresh) {
if (ops->gc(ops))
@@ -184,19 +185,20 @@ void * dst_alloc(struct dst_ops * ops)
atomic_inc(&ops->entries);
return dst;
}
+EXPORT_SYMBOL(dst_alloc);
-static void ___dst_free(struct dst_entry * dst)
+static void ___dst_free(struct dst_entry *dst)
{
/* The first case (dev==NULL) is required, when
protocol module is unloaded.
*/
- if (dst->dev == NULL || !(dst->dev->flags&IFF_UP)) {
+ if (dst->dev == NULL || !(dst->dev->flags&IFF_UP))
dst->input = dst->output = dst_discard;
- }
dst->obsolete = 2;
}
+EXPORT_SYMBOL(__dst_free);
-void __dst_free(struct dst_entry * dst)
+void __dst_free(struct dst_entry *dst)
{
spin_lock_bh(&dst_garbage.lock);
___dst_free(dst);
@@ -261,15 +263,16 @@ again:
}
return NULL;
}
+EXPORT_SYMBOL(dst_destroy);
void dst_release(struct dst_entry *dst)
{
if (dst) {
- int newrefcnt;
+ int newrefcnt;
smp_mb__before_atomic_dec();
- newrefcnt = atomic_dec_return(&dst->__refcnt);
- WARN_ON(newrefcnt < 0);
+ newrefcnt = atomic_dec_return(&dst->__refcnt);
+ WARN_ON(newrefcnt < 0);
}
}
EXPORT_SYMBOL(dst_release);
@@ -305,7 +308,8 @@ static inline void dst_ifdown(struct dst_entry *dst, struct net_device *dev,
}
}
-static int dst_dev_event(struct notifier_block *this, unsigned long event, void *ptr)
+static int dst_dev_event(struct notifier_block *this, unsigned long event,
+ void *ptr)
{
struct net_device *dev = ptr;
struct dst_entry *dst, *last = NULL;
@@ -328,9 +332,8 @@ static int dst_dev_event(struct notifier_block *this, unsigned long event, void
last->next = dst;
else
dst_busy_list = dst;
- for (; dst; dst = dst->next) {
+ for (; dst; dst = dst->next)
dst_ifdown(dst, dev, event != NETDEV_DOWN);
- }
mutex_unlock(&dst_gc_mutex);
break;
}
@@ -345,7 +348,3 @@ void __init dst_init(void)
{
register_netdevice_notifier(&dst_dev_notifier);
}
-
-EXPORT_SYMBOL(__dst_free);
-EXPORT_SYMBOL(dst_alloc);
-EXPORT_SYMBOL(dst_destroy);
--
1.7.0.1
^ permalink raw reply related
* Re: [ANNOUNCEMENT] NET: usb: sierra_net.c driver
From: David Miller @ 2010-03-29 20:41 UTC (permalink / raw)
To: marcel; +Cc: sclark46, epasheva, dbrownell, rfiler, netdev, linux-usb
In-Reply-To: <1269894593.11714.215.camel@localhost.localdomain>
From: Marcel Holtmann <marcel@holtmann.org>
Date: Mon, 29 Mar 2010 13:29:53 -0700
> because they are not NIC cards. They just use Ethernet emulation. And
> they also require a management interface to setup APN and activate them
> first.
>
> It is important that we tell userspace about the type of a network
> interface. We do the same for WiMAX and WiFi btw.
I completely agree with Marcel on this, please fix the device
type.
^ permalink raw reply
* [PATCH] Net: wireless: ath: fix macros coding style issue in hw.c
From: Luis de Bethencourt @ 2010-03-29 20:34 UTC (permalink / raw)
To: linville, lrodriguez
Cc: linux-wireless, netdev, linux-kernel, Luis de Bethencourt,
Luis de Bethencourt
In-Reply-To: <ath/hw.c>
From: Luis de Bethencourt <luisbg@openshine.com>
This is a patch to the ath/hw.c file that fixes up a warning about
macros found by the checkpatch.pl tool, that said that complex values
should be enclosed in parenthesis.
Signed-off-by: Luis de Bethencourt <luisbg@ubuntu.com>
---
drivers/net/wireless/ath/hw.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/hw.c b/drivers/net/wireless/ath/hw.c
index ecc9eb0..a8f81ea 100644
--- a/drivers/net/wireless/ath/hw.c
+++ b/drivers/net/wireless/ath/hw.c
@@ -19,8 +19,8 @@
#include "ath.h"
#include "reg.h"
-#define REG_READ common->ops->read
-#define REG_WRITE common->ops->write
+#define REG_READ (common->ops->read)
+#define REG_WRITE (common->ops->write)
/**
* ath_hw_set_bssid_mask - filter out bssids we listen
--
1.6.3.3
^ permalink raw reply related
* Re: [ANNOUNCEMENT] NET: usb: sierra_net.c driver
From: Marcel Holtmann @ 2010-03-29 20:29 UTC (permalink / raw)
To: sclark46-ihVZJaRskl1bRRN4PJnoQQ
Cc: Elina Pasheva, David Brownell, Rory Filer,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb
In-Reply-To: <4BAFAA2C.8060604-ihVZJaRskl1bRRN4PJnoQQ@public.gmane.org>
Hi Stephen,
> >> +static const struct driver_info sierra_net_info_68A3 = {
> >> + .description = "Sierra Wireless USB-Ethernet Modem",
> >> + .flags = FLAG_ETHER | FLAG_SEND_ZLP,
> >> + .bind = sierra_net_bind,
> >> + .unbind = sierra_net_unbind,
> >> + .status = sierra_net_status,
> >> + .rx_fixup = sierra_net_rx_fixup,
> >> + .tx_fixup = sierra_net_tx_fixup,
> >> + .data = (unsigned long)&sierra_net_info_data_68A3,
> >> +};
> >
> > the FLAG_ETHER is wrong here. Please use FLAG_WWAN to clearly mark these
> > interfaces.
> >
> > Otherwise we have wrong DEVTYPE uevent assignments and userspace will
> > treat them as real Ethernet cards. And that should not happen. As a nice
> Why shouldn't that happen if they look like NIC cards?
because they are not NIC cards. They just use Ethernet emulation. And
they also require a management interface to setup APN and activate them
first.
It is important that we tell userspace about the type of a network
interface. We do the same for WiMAX and WiFi btw.
Regards
Marcel
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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: UDP path MTU discovery
From: Rick Jones @ 2010-03-29 20:25 UTC (permalink / raw)
To: Andi Kleen; +Cc: Glen Turner, netdev
In-Reply-To: <20100329201431.GH20695@one.firstfloor.org>
Andi Kleen wrote:
> On Mon, Mar 29, 2010 at 10:01:42AM -0700, Rick Jones wrote:
>>But which of the last N datagrams sent by the application should be
>>retained for retransmission? It could be scores if not hundreds of
>>datagrams depending on the behaviour of the application and the latency to
>>the narrow part of the network.
>
>
> Yes, if there's a large window you lose. I guess it would make protocols
> like DHCP work at least ("transactional UDP" as the original poster called it)
>
> I don't know if it would fix enough applications to be worth
> implementing. The only way to find out would be to try I guess.
> I don't have any better ideas.
I don't think there are any good solutions that do not require either
application involvement, or a modification to IPv6.
How about allowing an application to request that (copies of) ICMP(v6) messages
be made available through the socket? In that way, the application, which
ostensibly already has to be keeping track of its sends for its own nefarious
retransmission porpoises can receive the "signal" just like TCP does and perhaps
there will be enough in the ICMPv6 message for the application to know which
message(s) need to be retransmitted.
rick jones
^ permalink raw reply
* Re: [PATCH] NETLABEL: Fix an RCU warning
From: Eric Dumazet @ 2010-03-29 20:19 UTC (permalink / raw)
To: Paul Moore; +Cc: paulmck, David Howells, netdev
In-Reply-To: <201003291605.48605.paul.moore@hp.com>
Le lundi 29 mars 2010 à 16:05 -0400, Paul Moore a écrit :
> Okay, is there a recommended approach towards accessing RCU-protected pointers
> both under a RCU read lock and under only a spinlock (or similar lock
> construct)? I know I could do something based on querying the state of the
> RCU/etc. locks but that seems like a hack and could interfere with some of the
> logic used to detect coding problems.
>
Say you use a common function func1(), that use RCU protection, from a
pure reader, and from a pure writer.
pure_reader()
{
rcu_read_lock();
res = func1();
rcu_read_unlock();
}
pure_writer()
{
spin_lock(&some_lock);
res = func1();
spin_unlock(&some_lock);
}
then, func1 could use
func1()
{
..... ptr = rcu_dereference_check(xxx->ptr,
rcu_read_lock_held() ||
lockdep_is_held(&some_lock));
...
}
They are numerous examples in tree.
If some iterators use implicit rcu_dereference(), you'll probably need
to define new iterators, so that full condition can be tested.
rcu_dereference() is a shorthand for
rcu_dereference_check(p, rcu_read_lock_held())
This only deals for pure readers, not potential pure writer :)
^ permalink raw reply
* Re: [PATCH NEXT 0/5]netxen: fw file validation and fixes
From: David Miller @ 2010-03-29 20:18 UTC (permalink / raw)
To: amit.salecha; +Cc: netdev, ameen.rahman
In-Reply-To: <1269866625-26151-1-git-send-email-amit.salecha@qlogic.com>
From: Amit Kumar Salecha <amit.salecha@qlogic.com>
Date: Mon, 29 Mar 2010 05:43:40 -0700
> Hi
> Series of 5 patches to validate unified rom image and bug fixes.
> Please apply them on net-next-2.6 branch.
All applied, thank you.
^ permalink raw reply
* Re: [PATCH] r8169: offical fix for CVE-2009-4537 (overlength frame DMAs)
From: David Miller @ 2010-03-29 20:17 UTC (permalink / raw)
To: nhorman; +Cc: linux-kernel, netdev, michael.s.gilbert, romieu, eric.dumazet
In-Reply-To: <20100329160356.GC22733@hmsreliant.think-freely.org>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Mon, 29 Mar 2010 12:03:56 -0400
> Official patch to fix the r8169 frame length check error.
...
> Signed-off-by: Neil Horman <nhorman@redhat.com>
Applied, thanks a lot Neil.
^ permalink raw reply
* Re: UDP path MTU discovery
From: Andi Kleen @ 2010-03-29 20:14 UTC (permalink / raw)
To: Rick Jones; +Cc: Andi Kleen, Glen Turner, netdev
In-Reply-To: <4BB0DCF6.9020401@hp.com>
On Mon, Mar 29, 2010 at 10:01:42AM -0700, Rick Jones wrote:
> >In theory one could probably add some hack in the the kernel UDP code
> >to hold one packet and retransmit it immediately with fragments when
> >the ICMP comes in. However that would be quite far in behaviour from
> >traditional UDP and be considered very ugly. It could also mess up
> >congestion avoidance schemes done by the application.
> >
> >Still might be preferable over rewriting zillions of applications?
>
> But which of the last N datagrams sent by the application should be
> retained for retransmission? It could be scores if not hundreds of
> datagrams depending on the behaviour of the application and the latency to
> the narrow part of the network.
Yes, if there's a large window you lose. I guess it would make protocols
like DHCP work at least ("transactional UDP" as the original poster called it)
I don't know if it would fix enough applications to be worth
implementing. The only way to find out would be to try I guess.
I don't have any better ideas.
> That the IPv6 specification was heavily "influenced" by "the router guys"
> seems increasingly clear...
Yes it sounds like the IETF didn't completely think that through.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply
* pull request: wireless-next-2.6 2010-03-29
From: John W. Linville @ 2010-03-29 20:13 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
Dave,
Another dump of stuff intended for 2.6.35...nothing too unusual, mostly
driver updates and some random cleanups.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit 30bde1f5076a9b6bd4b6a168523930ce242c7449:
Stephen Rothwell (1):
rps: fix net-sysfs build for !CONFIG_RPS
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6.git master
Amitkumar Karwar (1):
libertas: add auto auth mode feature
Ben M Cahill (1):
iwlagn: Add Flow-handler (FH) register dump for 4965.
Dan Carpenter (1):
mac80211: remove unneed variable from ieee80211_tx_pending()
Daniel Ngu (1):
drivers/net/wireless/b43/main.c:4351: Fixed coding style
Joe Perches (8):
include/linux/wireless.h: Add IW_HANDLER macro to initialize array entry
wireless.h: Use SIOCIWFIRST not SIOCSIWCOMMIT for range check
net/wireless/wext_core.c: Use IW_IOCTL_IDX macro
net/wireless/wext-core.c: Use IW_EVENT_IDX macro
drivers/net/wireless: Use IW_HANDLER macro
drivers/net: Remove local #define IW_IOCTL, use IW_HANDLER
orinoco/wext.c: Remove local #define STD_IW_HANDLER
drivers/net/wireless/ray_cs.c: Use iw_handler function prototypes
Johannes Berg (1):
iwlwifi: sta_id cannot be invalid in rs_initialize_lq
John W. Linville (2):
Merge branch 'wireless-next-2.6' of git://git.kernel.org/.../iwlwifi/iwlwifi-2.6
iwlwifi: fix build error for CONFIG_IWLAGN=n
Juuso Oikarinen (14):
wl1271: Fix configuration of the TX opportunity value
wl1271: Fix SG configuration message structures
wl1271: Add proper WLAN-BT co-ex configuration, and enable co-ex.
wl1271: Move platform device registration from _spi to _main
wl1271: Add sysfs file to control BT co-ex state
wl1271: Fix MAC address handling
wl1271: Remove deprecated interface config function
wl1271: Update filters properly
wl1271: Don't generate null func template for ad-hoc
wl1271: Remove circular interlocking related to the inetaddr notifier chain
mac80211: Add support for connection monitor in hardware
cfg80211: Add connection quality monitoring support to nl80211
mac80211: Add support for connection quality monitoring
cfg80211: Improve connection quality maintenance docs in nl80211.h
Kalle Valo (6):
wl1271: enable WMM
wl1271: get pspoll and nullfunc templates from mac80211
wl1271: get probe request template from mac80211
wl1271: create qos nullfunc template
wl1271: fix ps scheme in wl1271_op_conf_tx()
wl1271: enable U-APSD
Ming Lei (1):
ath9k: decrease size of ath9k.ko
Reinette Chatre (2):
iwlwifi: only add broadcast station once
iwlwifi: implement new mac80211 station add/remove calls
Shanyu Zhao (1):
iwlwifi: clean up driver names for 1000/5000/6000
Sujith (13):
ath9k_hw: update initialization values for AR9271
ath9k_hw: add GPIO setup code for AR9271
ath9k_hw: skip chip tests for AR9271
ath9k_hw: fix TX descriptor setup for AR9271
ath9k_hw: Fix full sleep setup for AR9271
ath9k_hw: fix noisefloor history buffer usage on AR9271
ath9k_hw: restrict valid nf readings for AR9271 to -114
ath9k_hw: use the skip count for PA calibration on AR9271
ath9k_hw: always set the core clock for AR9271
ath9k_hw: add HTC init hardware call for special resets for AR9271
ath9k_hw: fix hardware deinit
ath9k_htc: Support for AR9271 chipset.
ath9k_htc: Fix symbol collision with ath9k
Teemu Paasikivi (5):
wl1271: Cleaned up wlan power on/off functions
wl1271: Changed SDIO MMC host claiming
wl1271: Added DEBUG_SDIO flag
wl1271: Removed duplicate code from module remove function.
wl1271: Changed platform_device to be dynamically allocated
Wey-Yi Guy (4):
iwlwifi: Recover TX flow stall due to stuck queue
iwlwifi: move plcp check to separated function
iwlwifi: Recover TX flow failure
iwlwifi: code cleanup for connectivity recovery
drivers/net/ps3_gelic_wireless.c | 35 +-
drivers/net/wireless/ath/Kconfig | 2 +-
drivers/net/wireless/ath/ath9k/Kconfig | 21 +
drivers/net/wireless/ath/ath9k/Makefile | 10 +
drivers/net/wireless/ath/ath9k/calib.c | 25 +-
drivers/net/wireless/ath/ath9k/common.c | 421 ++++++
drivers/net/wireless/ath/ath9k/common.h | 17 +
drivers/net/wireless/ath/ath9k/hif_usb.c | 993 ++++++++++++++
drivers/net/wireless/ath/ath9k/hif_usb.h | 105 ++
drivers/net/wireless/ath/ath9k/htc.h | 441 ++++++
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 260 ++++
drivers/net/wireless/ath/ath9k/htc_drv_init.c | 713 ++++++++++
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 1626 +++++++++++++++++++++++
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 604 +++++++++
drivers/net/wireless/ath/ath9k/htc_hst.c | 463 +++++++
drivers/net/wireless/ath/ath9k/htc_hst.h | 246 ++++
drivers/net/wireless/ath/ath9k/hw.c | 134 +-
drivers/net/wireless/ath/ath9k/hw.h | 8 +
drivers/net/wireless/ath/ath9k/init.c | 3 +
drivers/net/wireless/ath/ath9k/initvals.h | 141 ++-
drivers/net/wireless/ath/ath9k/mac.c | 2 +-
drivers/net/wireless/ath/ath9k/mac.h | 26 +
drivers/net/wireless/ath/ath9k/rc.h | 4 +-
drivers/net/wireless/ath/ath9k/reg.h | 3 +
drivers/net/wireless/ath/ath9k/wmi.c | 319 +++++
drivers/net/wireless/ath/ath9k/wmi.h | 126 ++
drivers/net/wireless/ath/debug.h | 1 +
drivers/net/wireless/b43/main.c | 5 +-
drivers/net/wireless/ipw2x00/ipw2200.c | 83 +-
drivers/net/wireless/iwlwifi/iwl-1000.c | 9 +-
drivers/net/wireless/iwlwifi/iwl-3945-rs.c | 83 +-
drivers/net/wireless/iwlwifi/iwl-3945.c | 22 +-
drivers/net/wireless/iwlwifi/iwl-3945.h | 1 -
drivers/net/wireless/iwlwifi/iwl-4965.c | 5 +-
drivers/net/wireless/iwlwifi/iwl-5000.c | 28 +-
drivers/net/wireless/iwlwifi/iwl-6000.c | 24 +-
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 124 +-
drivers/net/wireless/iwlwifi/iwl-agn-rs.h | 7 +-
drivers/net/wireless/iwlwifi/iwl-agn.c | 154 ++-
drivers/net/wireless/iwlwifi/iwl-core.c | 102 ++-
drivers/net/wireless/iwlwifi/iwl-core.h | 19 +-
drivers/net/wireless/iwlwifi/iwl-dev.h | 23 +-
drivers/net/wireless/iwlwifi/iwl-rx.c | 155 ++-
drivers/net/wireless/iwlwifi/iwl-sta.c | 630 ++++++----
drivers/net/wireless/iwlwifi/iwl-sta.h | 20 +-
drivers/net/wireless/iwlwifi/iwl-tx.c | 2 +
drivers/net/wireless/iwlwifi/iwl3945-base.c | 72 +-
drivers/net/wireless/libertas/assoc.c | 22 +-
drivers/net/wireless/libertas/dev.h | 1 +
drivers/net/wireless/libertas/main.c | 1 +
drivers/net/wireless/libertas/wext.c | 4 +
drivers/net/wireless/orinoco/wext.c | 94 +-
drivers/net/wireless/ray_cs.c | 212 ++--
drivers/net/wireless/wl12xx/wl1271.h | 7 +
drivers/net/wireless/wl12xx/wl1271_acx.c | 25 +-
drivers/net/wireless/wl12xx/wl1271_acx.h | 68 +-
drivers/net/wireless/wl12xx/wl1271_boot.c | 8 +
drivers/net/wireless/wl12xx/wl1271_cmd.c | 218 ++--
drivers/net/wireless/wl12xx/wl1271_cmd.h | 12 +-
drivers/net/wireless/wl12xx/wl1271_conf.h | 330 ++++-
drivers/net/wireless/wl12xx/wl1271_debugfs.c | 12 +-
drivers/net/wireless/wl12xx/wl1271_event.c | 2 +
drivers/net/wireless/wl12xx/wl1271_init.c | 4 +-
drivers/net/wireless/wl12xx/wl1271_io.h | 13 +
drivers/net/wireless/wl12xx/wl1271_main.c | 496 +++++---
drivers/net/wireless/wl12xx/wl1271_sdio.c | 74 +-
drivers/net/wireless/wl12xx/wl1271_spi.c | 35 +-
drivers/net/wireless/wl12xx/wl1271_tx.h | 3 -
drivers/net/wireless/wl3501_cs.c | 52 +-
include/linux/nl80211.h | 50 +
include/linux/wireless.h | 4 +-
include/net/cfg80211.h | 19 +
include/net/mac80211.h | 54 +-
net/mac80211/cfg.c | 27 +
net/mac80211/ieee80211_i.h | 4 +-
net/mac80211/iface.c | 2 +-
net/mac80211/mlme.c | 79 +-
net/mac80211/tx.c | 2 -
net/wireless/mlme.c | 13 +
net/wireless/nl80211.c | 131 ++
net/wireless/nl80211.h | 6 +
net/wireless/wext-core.c | 134 +-
82 files changed, 9032 insertions(+), 1503 deletions(-)
create mode 100644 drivers/net/wireless/ath/ath9k/hif_usb.c
create mode 100644 drivers/net/wireless/ath/ath9k/hif_usb.h
create mode 100644 drivers/net/wireless/ath/ath9k/htc.h
create mode 100644 drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
create mode 100644 drivers/net/wireless/ath/ath9k/htc_drv_init.c
create mode 100644 drivers/net/wireless/ath/ath9k/htc_drv_main.c
create mode 100644 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
create mode 100644 drivers/net/wireless/ath/ath9k/htc_hst.c
create mode 100644 drivers/net/wireless/ath/ath9k/htc_hst.h
create mode 100644 drivers/net/wireless/ath/ath9k/wmi.c
create mode 100644 drivers/net/wireless/ath/ath9k/wmi.h
Omnibus patch available here:
http://www.kernel.org/pub/linux/kernel/people/linville/wireless-next-2.6-2010-03-29.patch.bz2
--
John W. Linville Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org might be all we have. Be ready.
--
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-submit2 [ANNOUNCEMENT] NET: usb: sierra_net.c driver
From: Elina Pasheva @ 2010-03-29 20:13 UTC (permalink / raw)
To: David Brownell; +Cc: epasheva, Rory Filer, linux-usb, netdev
Subject: re-submit2 [ANNOUNCEMENT] NET: usb: sierra_net.c driver
From: Elina Pasheva <epasheva@sierrawireless.com>
re-submit2:
Consolidated diffstat output.
Re-submitting based on comments from netdev community.
Summary of the changes:
1. Replaced flag FLAG_ETHER with FLAG_WWAN.
2. Fixed the e-mail address for Rory Filer.
The following is a new Linux driver which exposes certain models of Sierra
Wireless modems to the operating system as Network Interface Cards (NICs).
This driver requires a version of the sierra.c driver which supports
blacklisting to work properly. The blacklist in sierra.c rejects the interfaces
claimed by sierra_net.c. Likewise, the sierra_net.c driver only accepts
(i.e. whitelists) the interface(s) used for Direct IP traffic.
The term "Direct IP" is used within Sierra Wireless to refer to these alternate
data interfaces. The version of sierra.c which supports blacklisting is
available from the sierra wireless knowledge base page for older kernels. It is
also available in Linux kernel starting from version 2.6.31.
This driver works with all Sierra Wireless devices configured with PID=68A3
like USB305, USB306 provided the corresponding firmware version is I2.0
(for USB305) or M3.0 (for USB306) and later.
This driver will not work with earlier firmware versions than the ones shown
above. In this case the driver will issue an error message indicating
incompatibility and will not serve the device's DirectIP interface.
Sierra_net.c sits atop a pre-existing Linux driver called usbnet.c.
A series of hook functions are provided in sierra_net.c which are called by
usbnet.c in response to a particular condition such as receipt or transmission
of a data packet. As such, usbnet.c does most of the work of making
a modem appear to the system as a network device and for properly exchanging
traffic between the USB subsystem and the Network card interface.
Sierra_net.c is concerned with managing the data exchanged between the
so-called Direct-IP interface and the upper layers of the operating system.
The version number of sierra_net.c driver is set to 2.0.
This patch has been tested on the latest stable kernel-2.6.33.1.
Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com>
Signed-off-by: Rory Filer <rfiler@sierrawireless.com>
---
drivers/net/usb/Kconfig | 10
drivers/net/usb/Makefile | 2
drivers/net/usb/sierra_net.c | 968 +++++++++++++++++++++++++++++++++
3 files changed, 980 insertions(+)
--- a/drivers/net/usb/Kconfig 2010-03-25 12:46:33.000000000 -0700
+++ b/drivers/net/usb/Kconfig 2010-03-25 15:56:29.000000000 -0700
@@ -377,4 +377,14 @@ config USB_CDC_PHONET
cellular modem, as found on most Nokia handsets with the
"PC suite" USB profile.
+config USB_SIERRA_NET
+ tristate "DirectIP Driver for Sierra Wireless modems"
+ depends on USB_USBNET
+
+ help
+ Choose this option if you have a Sierra Wireless DirectIP device.
+
+ To compile this driver as a module, choose M here: the
+ module will be called sierra_net.
+
endmenu
--- a/drivers/net/usb/Makefile 2010-03-25 12:46:56.000000000 -0700
+++ b/drivers/net/usb/Makefile 2010-03-25 12:48:27.000000000 -0700
@@ -22,4 +22,6 @@ obj-$(CONFIG_USB_NET_MCS7830) += mcs7830
obj-$(CONFIG_USB_USBNET) += usbnet.o
obj-$(CONFIG_USB_NET_INT51X1) += int51x1.o
obj-$(CONFIG_USB_CDC_PHONET) += cdc-phonet.o
+obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o
+
--- a/drivers/net/usb/sierra_net.c 2010-03-23 00:33:20.000000000 -0700
+++ b/drivers/net/usb/sierra_net.c 2010-03-25 15:54:47.000000000 -0700
@@ -1 +1,969 @@
+/*
+ * DirectIP Driver for Sierra Wireless modems
+ *
+ * Copyright (C) 2008, 2009, 2010 Paxton Smith, Matthew Safar, Rory Filer
+ * <linux@sierrawireless.com>
+ *
+ * Portions of this based on the cdc_ether driver by David Brownell (2003-2005)
+ * and Ole Andre Vadla Ravnas (ActiveSync) (2006).
+ *
+ * IMPORTANT DISCLAIMER: This driver is not commercially supported by
+ * Sierra Wireless. Use at your own risk.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#define DRIVER_VERSION "v.2.0"
+#define DRIVER_AUTHOR "Paxton Smith, Matthew Safar, Rory Filer"
+#define DRIVER_DESC "DirectIP Driver for Sierra Wireless modems"
+static const char driver_name[] = "sierra_net";
+
+/* if defined debug messages enabled */
+/*#define DEBUG*/
+/* more debug messages */
+/*#define VERBOSE*/
+
+#include <linux/module.h>
+#include <linux/etherdevice.h>
+#include <linux/ethtool.h>
+#include <linux/mii.h>
+#include <linux/sched.h>
+#include <linux/timer.h>
+#include <linux/usb.h>
+#include <linux/usb/cdc.h>
+#include <net/ip.h>
+#include <net/udp.h>
+#include <asm/unaligned.h>
+#include <linux/usb/usbnet.h>
+
+#define SWI_USB_REQUEST_GET_FW_ATTR 0x06
+#define SWI_GET_FW_ATTR_MASK 0x08
+
+/* atomic counter partially included in MAC address to make sure 2 devices
+ * do not end up with the same MAC - concept breaks in case of > 255 ifaces
+ */
+static atomic_t iface_counter = ATOMIC_INIT(0);
+
+/*
+ * SYNC Timer Delay definition used to set the expiry time
+ */
+#define SIERRA_NET_SYNCDELAY (2*HZ)
+
+/* Max. MTU supported. The modem buffers are limited to 1500 */
+#define SIERRA_NET_MAX_SUPPORTED_MTU 1500
+
+/* The SIERRA_NET_USBCTL_BUF_LEN defines a buffer size allocated for control
+ * message reception ... and thus the max. received packet.
+ * (May be the cause for parse_hip returning -3)
+ */
+#define SIERRA_NET_USBCTL_BUF_LEN 1024
+
+/* list of interface numbers - used for constructing interface lists */
+struct sierra_net_iface_info {
+ const u32 infolen; /* number of interface numbers on list */
+ const u8 *ifaceinfo; /* pointer to the array holding the numbers */
+};
+
+struct sierra_net_info_data {
+ u16 rx_urb_size;
+ struct sierra_net_iface_info whitelist;
+};
+
+/* Private data structure */
+struct sierra_net_data {
+
+ u8 ethr_hdr_tmpl[ETH_HLEN]; /* ethernet header template for rx'd pkts */
+
+ u16 link_up; /* air link up or down */
+ u8 tx_hdr_template[4]; /* part of HIP hdr for tx'd packets */
+
+ u8 sync_msg[4]; /* SYNC message */
+ u8 shdwn_msg[4]; /* Shutdown message */
+
+ /* Backpointer to the container */
+ struct usbnet *usbnet;
+
+ u8 ifnum; /* interface number */
+
+/* Bit masks, must be a power of 2 */
+#define SIERRA_NET_EVENT_RESP_AVAIL 0x01
+#define SIERRA_NET_TIMER_EXPIRY 0x02
+ unsigned long kevent_flags;
+ struct work_struct sierra_net_kevent;
+ struct timer_list sync_timer; /* For retrying SYNC sequence */
+};
+
+struct param {
+ int is_present;
+ union {
+ void *ptr;
+ u32 dword;
+ u16 word;
+ u8 byte;
+ };
+};
+
+/* HIP message type */
+#define SIERRA_NET_HIP_EXTENDEDID 0x7F
+#define SIERRA_NET_HIP_HSYNC_ID 0x60 /* Modem -> host */
+#define SIERRA_NET_HIP_RESTART_ID 0x62 /* Modem -> host */
+#define SIERRA_NET_HIP_MSYNC_ID 0x20 /* Host -> modem */
+#define SIERRA_NET_HIP_SHUTD_ID 0x26 /* Host -> modem */
+
+#define SIERRA_NET_HIP_EXT_IP_IN_ID 0x0202
+#define SIERRA_NET_HIP_EXT_IP_OUT_ID 0x0002
+
+/* 3G UMTS Link Sense Indication definitions */
+#define SIERRA_NET_HIP_LSI_UMTSID 0x78
+
+/* Reverse Channel Grant Indication HIP message */
+#define SIERRA_NET_HIP_RCGI 0x64
+
+/* LSI Protocol types */
+#define SIERRA_NET_PROTOCOL_UMTS 0x01
+/* LSI Coverage */
+#define SIERRA_NET_COVERAGE_NONE 0x00
+#define SIERRA_NET_COVERAGE_NOPACKET 0x01
+
+/* LSI Session */
+#define SIERRA_NET_SESSION_IDLE 0x00
+/* LSI Link types */
+#define SIERRA_NET_AS_LINK_TYPE_IPv4 0x00
+
+typedef struct s_lsi_umts {
+ u8 protocol;
+ u8 unused1;
+ __be16 length;
+ /* eventually use a union for the rest - assume umts for now */
+ u8 coverage;
+ u8 unused2[41];
+ u8 session_state;
+ u8 unused3[33];
+ u8 link_type;
+ u8 pdp_addr_len; /* NW-supplied PDP address len */
+ u8 pdp_addr[16]; /* NW-supplied PDP address (bigendian)) */
+ u8 unused4[23];
+ u8 dns1_addr_len; /* NW-supplied 1st DNS address len (bigendian) */
+ u8 dns1_addr[16]; /* NW-supplied 1st DNS address */
+ u8 dns2_addr_len; /* NW-supplied 2nd DNS address len */
+ u8 dns2_addr[16]; /* NW-supplied 2nd DNS address (bigendian)*/
+ u8 wins1_addr_len; /* NW-supplied 1st Wins address len */
+ u8 wins1_addr[16]; /* NW-supplied 1st Wins address (bigendian)*/
+ u8 wins2_addr_len; /* NW-supplied 2nd Wins address len */
+ u8 wins2_addr[16]; /* NW-supplied 2nd Wins address (bigendian) */
+ u8 unused5[4];
+ u8 gw_addr_len; /* NW-supplied GW address len */
+ u8 gw_addr[16]; /* NW-supplied GW address (bigendian) */
+ u8 reserved[8];
+} __attribute__ ((packed)) lsi_umts_t;
+
+#define SIERRA_NET_LSI_COMMON_LEN 4
+#define SIERRA_NET_LSI_UMTS_LEN (sizeof(lsi_umts_t))
+#define SIERRA_NET_LSI_UMTS_STATUS_LEN \
+ (SIERRA_NET_LSI_UMTS_LEN - SIERRA_NET_LSI_COMMON_LEN)
+
+/* Forward definitions */
+extern void sierra_sync_timer(unsigned long syncdata);
+static int sierra_net_change_mtu(struct net_device *net, int new_mtu);
+
+/* Our own net device operations structure */
+static const struct net_device_ops sierra_net_device_ops = {
+ .ndo_open = usbnet_open,
+ .ndo_stop = usbnet_stop,
+ .ndo_start_xmit = usbnet_start_xmit,
+ .ndo_tx_timeout = usbnet_tx_timeout,
+ .ndo_change_mtu = sierra_net_change_mtu,
+ .ndo_set_mac_address = eth_mac_addr,
+ .ndo_validate_addr = eth_validate_addr,
+};
+
+/* get private data associated with passed in usbnet device */
+static inline struct sierra_net_data *sierra_net_get_private(struct usbnet *dev)
+{
+ return (struct sierra_net_data *)dev->data[0];
+}
+
+/* set private data associated with passed in usbnet device */
+static inline void sierra_net_set_private(struct usbnet *dev,
+ struct sierra_net_data *priv)
+{
+ dev->data[0] = (unsigned long)priv;
+}
+
+/* is packet IPv4 */
+static inline int is_ip(struct sk_buff *skb)
+{
+ return (skb->protocol == cpu_to_be16(ETH_P_IP));
+}
+
+/*
+ * check passed in packet and make sure that:
+ * - it is linear (no scatter/gather)
+ * - it is ethernet (mac_header properly set)
+ */
+static int check_ethip_packet(struct sk_buff *skb, struct usbnet *dev)
+{
+ skb_reset_mac_header(skb); /* ethernet header */
+
+ if (skb_is_nonlinear(skb)) {
+ deverr(dev, "Non linear buffer-dropping");
+ return 0;
+ }
+
+ if (!pskb_may_pull(skb, ETH_HLEN))
+ return 0;
+ skb->protocol = eth_hdr(skb)->h_proto;
+
+ return 1;
+}
+
+static const u8 *save16bit(struct param *p, const u8 *datap)
+{
+ p->is_present = 1;
+ p->word = get_unaligned_be16(datap);
+ return datap + sizeof(p->word);
+}
+
+static const u8 *save8bit(struct param *p, const u8 *datap)
+{
+ p->is_present = 1;
+ p->byte = *datap;
+ return datap + sizeof(p->byte);
+}
+
+/*----------------------------------------------------------------------------*
+ * BEGIN HIP *
+ *----------------------------------------------------------------------------*/
+/* HIP header */
+#define SIERRA_NET_HIP_HDR_LEN 4
+/* Extended HIP header */
+#define SIERRA_NET_HIP_EXT_HDR_LEN 6
+
+struct hip_hdr {
+ int hdrlen;
+ struct param payload_len;
+ struct param msgid;
+ struct param msgspecific;
+ struct param extmsgid;
+};
+
+static int parse_hip(const u8 *buf, const u32 buflen, struct hip_hdr *hh)
+{
+ const u8 *curp = buf;
+ int padded;
+
+ if (buflen < SIERRA_NET_HIP_HDR_LEN)
+ return -1;
+
+ curp = save16bit(&hh->payload_len, curp);
+ curp = save8bit(&hh->msgid, curp);
+ curp = save8bit(&hh->msgspecific, curp);
+
+ padded = hh->msgid.byte & 0x80;
+ hh->msgid.byte &= 0x7F; /* 7 bits */
+
+ hh->extmsgid.is_present = (hh->msgid.byte == SIERRA_NET_HIP_EXTENDEDID);
+ if (hh->extmsgid.is_present) {
+ if (buflen < SIERRA_NET_HIP_EXT_HDR_LEN)
+ return -2;
+
+ hh->payload_len.word &= 0x3FFF; /* 14 bits */
+
+ curp = save16bit(&hh->extmsgid, curp);
+ hh->extmsgid.word &= 0x03FF; /* 10 bits */
+
+ hh->hdrlen = SIERRA_NET_HIP_EXT_HDR_LEN;
+ } else {
+ hh->payload_len.word &= 0x07FF; /* 11 bits */
+ hh->hdrlen = SIERRA_NET_HIP_HDR_LEN;
+ }
+
+ if (padded) {
+ hh->hdrlen++;
+ hh->payload_len.word--;
+ }
+
+ /* if real packet shorter than the claimed length */
+ if (buflen < (hh->hdrlen + hh->payload_len.word))
+ return -3;
+
+ return 0;
+}
+
+static void build_hip(u8 *buf, const u16 payloadlen,
+ struct sierra_net_data *priv)
+{
+ /* the following doesn't have the full functionality. We
+ * currently build only one kind of header, so it is faster this way
+ */
+ put_unaligned_be16(payloadlen, buf);
+ memcpy(buf+2, priv->tx_hdr_template, sizeof(priv->tx_hdr_template));
+}
+/*----------------------------------------------------------------------------*
+ * END HIP *
+ *----------------------------------------------------------------------------*/
+
+static void sierra_net_send_cmd(struct usbnet *dev,
+ u8 *cmd, int cmdlen, const char * cmd_name)
+{
+ struct sierra_net_data *priv = sierra_net_get_private(dev);
+ int status;
+
+ status = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0),
+ USB_CDC_SEND_ENCAPSULATED_COMMAND,
+ USB_DIR_OUT|USB_TYPE_CLASS|USB_RECIP_INTERFACE, 0,
+ priv->ifnum, cmd, cmdlen, 0);
+
+ if (status != cmdlen && status != -ENODEV)
+ deverr(dev, "Submit %s failed %d", cmd_name, status);
+}
+
+static void sierra_net_send_sync(struct usbnet *dev)
+{
+ struct sierra_net_data *priv = sierra_net_get_private(dev);
+
+ dev_dbg(&dev->udev->dev, "%s", __func__);
+
+ sierra_net_send_cmd(dev, priv->sync_msg,
+ sizeof(priv->sync_msg), "SYNC");
+}
+
+static void sierra_net_send_shutdown(struct usbnet *dev)
+{
+ struct sierra_net_data *priv = sierra_net_get_private(dev);
+
+ dev_dbg(&dev->udev->dev, "%s", __func__);
+
+ sierra_net_send_cmd(dev, priv->shdwn_msg,
+ sizeof(priv->shdwn_msg), "Shutdown");
+}
+
+static void sierra_net_set_ctx_index(struct sierra_net_data *priv, u8 ctx_ix)
+{
+ dev_dbg(&(priv->usbnet->udev->dev), "%s %d", __func__, ctx_ix);
+ priv->tx_hdr_template[0] = 0x3F;
+ priv->tx_hdr_template[1] = ctx_ix;
+ *((u16 *)&priv->tx_hdr_template[2]) =
+ cpu_to_be16(SIERRA_NET_HIP_EXT_IP_OUT_ID);
+}
+
+static inline int sierra_net_is_valid_addrlen(u8 len)
+{
+ return (len == sizeof(struct in_addr));
+}
+
+static int sierra_net_parse_lsi(struct usbnet *dev, char *data, int datalen)
+{
+ lsi_umts_t *lsi = (lsi_umts_t *)data;
+
+ if (lsi->length != cpu_to_be16(SIERRA_NET_LSI_UMTS_STATUS_LEN)) {
+ deverr(dev, "%s: LSI_UMTS_STATUS_LEN %d, expected %u",
+ __func__, be16_to_cpu(lsi->length),
+ (u32)SIERRA_NET_LSI_UMTS_STATUS_LEN);
+ return -1;
+ }
+
+ /* Validate the protocol - only support UMTS for now */
+ if (lsi->protocol != SIERRA_NET_PROTOCOL_UMTS) {
+ deverr(dev, "Protocol unsupported, 0x%02x", lsi->protocol);
+ return -1;
+ }
+
+ /* Validate the link type */
+ if (lsi->link_type != SIERRA_NET_AS_LINK_TYPE_IPv4) {
+ deverr(dev, "Link type unsupported: 0x%02x", lsi->link_type);
+ return -1;
+ }
+
+ /* Validate the coverage */
+ if (lsi->coverage == SIERRA_NET_COVERAGE_NONE
+ || lsi->coverage == SIERRA_NET_COVERAGE_NOPACKET) {
+ deverr(dev, "No coverage, 0x%02x", lsi->coverage);
+ return 0;
+ }
+
+ /* Validate the session state */
+ if (lsi->session_state == SIERRA_NET_SESSION_IDLE) {
+ deverr(dev, "Session idle, 0x%02x", lsi->session_state);
+ return 0;
+ }
+
+ /* Set link_sense true */
+ return 1;
+}
+
+static void sierra_net_handle_lsi(struct usbnet *dev, char *data,
+ struct hip_hdr *hh)
+{
+ struct sierra_net_data *priv = sierra_net_get_private(dev);
+ int link_up;
+
+ link_up = sierra_net_parse_lsi(dev, data + hh->hdrlen,
+ hh->payload_len.word);
+ if (link_up < 0) {
+ deverr(dev, "Invalid LSI");
+ return;
+ }
+ if (link_up) {
+ sierra_net_set_ctx_index(priv, hh->msgspecific.byte);
+ priv->link_up = 1;
+ netif_carrier_on(dev->net);
+ } else {
+ priv->link_up = 0;
+ netif_carrier_off(dev->net);
+ }
+}
+
+static void sierra_net_dosync(struct usbnet *dev)
+{
+ struct sierra_net_data *priv = sierra_net_get_private(dev);
+
+ dev_dbg(&dev->udev->dev, "%s", __func__);
+
+ /* tell modem we are ready */
+ sierra_net_send_sync(dev);
+ sierra_net_send_sync(dev);
+
+ /* Now, start a timer and make sure we get the Restart Indication */
+ priv->sync_timer.function = sierra_sync_timer;
+ priv->sync_timer.data = (unsigned long) dev;
+ priv->sync_timer.expires = jiffies + SIERRA_NET_SYNCDELAY;
+ add_timer(&priv->sync_timer);
+}
+
+static void sierra_net_kevent(struct work_struct *work)
+{
+ struct sierra_net_data *priv =
+ container_of(work, struct sierra_net_data, sierra_net_kevent);
+ struct usbnet *dev = priv->usbnet;
+ int len;
+ int err;
+ u8 *buf;
+ u8 ifnum;
+
+ if (test_bit(SIERRA_NET_EVENT_RESP_AVAIL, &priv->kevent_flags)) {
+ clear_bit(SIERRA_NET_EVENT_RESP_AVAIL, &priv->kevent_flags);
+
+ /* Query the modem for the LSI message */
+ buf = kzalloc(SIERRA_NET_USBCTL_BUF_LEN, GFP_KERNEL);
+ if (!buf) {
+ deverr(dev, "failed to allocate buf for LS msg");
+ return;
+ }
+ ifnum = priv->ifnum;
+ len = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),
+ USB_CDC_GET_ENCAPSULATED_RESPONSE,
+ USB_DIR_IN|USB_TYPE_CLASS|USB_RECIP_INTERFACE,
+ 0, ifnum, buf, SIERRA_NET_USBCTL_BUF_LEN, 0);
+
+ if (unlikely(len < 0)) {
+ deverr(dev,
+ "usb_control_msg failed, status %d", len);
+ } else {
+ struct hip_hdr hh;
+
+ dev_dbg(&dev->udev->dev, "%s: Received status message,"
+ " %04x bytes", __func__, len);
+
+ err = parse_hip(buf, len, &hh);
+ if (err) {
+ deverr(dev, "%s: Bad packet, parse result %d",
+ __func__, err);
+ kfree(buf);
+ return;
+ }
+
+ /* Validate packet length */
+ if (len != hh.hdrlen + hh.payload_len.word) {
+ deverr(dev, "%s: Bad packet, received %d,"
+ " expected %d", __func__, len,
+ hh.hdrlen + hh.payload_len.word);
+ kfree(buf);
+ return;
+ }
+
+ /* Switch on received message types */
+ switch (hh.msgid.byte) {
+ case SIERRA_NET_HIP_LSI_UMTSID:
+ dev_dbg(&dev->udev->dev, "LSI for ctx:%d",
+ hh.msgspecific.byte);
+ sierra_net_handle_lsi(dev, buf, &hh);
+ break;
+ case SIERRA_NET_HIP_RESTART_ID:
+ dev_dbg(&dev->udev->dev, "Restart reported: %d,"
+ " stopping sync timer",
+ hh.msgspecific.byte);
+ /* Got sync resp - stop timer & clear mask */
+ del_timer_sync(&priv->sync_timer);
+ clear_bit(SIERRA_NET_TIMER_EXPIRY,
+ &priv->kevent_flags);
+ break;
+ case SIERRA_NET_HIP_HSYNC_ID:
+ dev_dbg(&dev->udev->dev, "SYNC received");
+ sierra_net_send_sync(dev);
+ break;
+ case SIERRA_NET_HIP_EXTENDEDID:
+ deverr(dev, "Unrecognized HIP msg, "
+ "extmsgid 0x%04x", hh.extmsgid.word);
+ break;
+ case SIERRA_NET_HIP_RCGI:
+ /* Ignored */
+ break;
+ default:
+ deverr(dev, "Unrecognized HIP msg, "
+ "msgid 0x%02x", hh.msgid.byte);
+ break;
+ }
+ }
+ kfree(buf);
+ }
+ /* The sync timer bit might be set */
+ if (test_bit(SIERRA_NET_TIMER_EXPIRY, &priv->kevent_flags)) {
+ clear_bit(SIERRA_NET_TIMER_EXPIRY, &priv->kevent_flags);
+ dev_dbg(&dev->udev->dev, "Deferred sync timer expiry");
+ sierra_net_dosync(priv->usbnet);
+ }
+
+ if (priv->kevent_flags)
+ dev_dbg(&dev->udev->dev, "sierra_net_kevent done, "
+ "kevent_flags = 0x%lx", priv->kevent_flags);
+}
+
+static void sierra_net_defer_kevent(struct usbnet *dev, int work)
+{
+ struct sierra_net_data *priv = sierra_net_get_private(dev);
+
+ set_bit(work, &priv->kevent_flags);
+ schedule_work(&priv->sierra_net_kevent);
+}
+
+/*
+ * Sync Retransmit Timer Handler. On expiry, kick the work queue
+ */
+void sierra_sync_timer(unsigned long syncdata)
+{
+ struct usbnet *dev = (struct usbnet *)syncdata;
+
+ dev_dbg(&dev->udev->dev, "%s", __func__);
+ /* Kick the tasklet */
+ sierra_net_defer_kevent(dev, SIERRA_NET_TIMER_EXPIRY);
+}
+
+static void sierra_net_status(struct usbnet *dev, struct urb *urb)
+{
+ struct usb_cdc_notification *event;
+
+ dev_dbg(&dev->udev->dev, "%s", __func__);
+
+ if (urb->actual_length < sizeof *event)
+ return;
+
+ /* Add cases to handle other standard notifications. */
+ event = urb->transfer_buffer;
+ switch (event->bNotificationType) {
+ case USB_CDC_NOTIFY_NETWORK_CONNECTION:
+ case USB_CDC_NOTIFY_SPEED_CHANGE:
+ /* USB 305 sends those */
+ break;
+ case USB_CDC_NOTIFY_RESPONSE_AVAILABLE:
+ sierra_net_defer_kevent(dev, SIERRA_NET_EVENT_RESP_AVAIL);
+ break;
+ default:
+ deverr(dev, ": unexpected notification %02x!",
+ event->bNotificationType);
+ break;
+ }
+}
+
+static void sierra_net_get_drvinfo(struct net_device *net,
+ struct ethtool_drvinfo *info)
+{
+ /* Inherit standard device info */
+ usbnet_get_drvinfo(net, info);
+ strncpy(info->driver, driver_name, sizeof info->driver);
+ strncpy(info->version, DRIVER_VERSION, sizeof info->version);
+}
+
+static u32 sierra_net_get_link(struct net_device *net)
+{
+ struct usbnet *dev = netdev_priv(net);
+ /* Report link is down whenever the interface is down */
+ return sierra_net_get_private(dev)->link_up && netif_running(net);
+}
+
+static struct ethtool_ops sierra_net_ethtool_ops = {
+ .get_drvinfo = sierra_net_get_drvinfo,
+ .get_link = sierra_net_get_link,
+ .get_msglevel = usbnet_get_msglevel,
+ .set_msglevel = usbnet_set_msglevel,
+ .get_settings = usbnet_get_settings,
+ .set_settings = usbnet_set_settings,
+ .nway_reset = usbnet_nway_reset,
+};
+
+/* MTU can not be more than 1500 bytes, enforce it. */
+static int sierra_net_change_mtu(struct net_device *net, int new_mtu)
+{
+ if (new_mtu > SIERRA_NET_MAX_SUPPORTED_MTU)
+ return -EINVAL;
+
+ return usbnet_change_mtu(net, new_mtu);
+}
+
+static int is_whitelisted(const u8 ifnum,
+ const struct sierra_net_iface_info *whitelist)
+{
+ if (whitelist) {
+ const u8 *list = whitelist->ifaceinfo;
+ int i;
+
+ for (i = 0; i < whitelist->infolen; i++) {
+ if (list[i] == ifnum)
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static int sierra_net_get_fw_attr(struct usbnet *dev, u16 *datap)
+{
+ int result = 0;
+ u16 *attrdata;
+
+ attrdata = kmalloc(sizeof(*attrdata), GFP_KERNEL);
+ if (!attrdata)
+ return -ENOMEM;
+
+ result = usb_control_msg(
+ dev->udev,
+ usb_rcvctrlpipe(dev->udev, 0),
+ /* _u8 vendor specific request */
+ SWI_USB_REQUEST_GET_FW_ATTR,
+ USB_DIR_IN | USB_TYPE_VENDOR, /* __u8 request type */
+ 0x0000, /* __u16 value not used */
+ 0x0000, /* __u16 index not used */
+ attrdata, /* char *data */
+ sizeof(*attrdata), /* __u16 size */
+ USB_CTRL_SET_TIMEOUT); /* int timeout */
+
+ if (result < 0) {
+ kfree(attrdata);
+ return -EIO;
+ }
+
+ *datap = *attrdata;
+
+ kfree(attrdata);
+ return result;
+}
+
+/*
+ * collects the bulk endpoints, the status endpoint.
+ */
+static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
+{
+ u8 ifacenum;
+ u8 numendpoints;
+ u16 fwattr = 0;
+ int status;
+ struct ethhdr *eth;
+ struct sierra_net_data *priv;
+ static const u8 sync_tmplate[sizeof(priv->sync_msg)] = {
+ 0x00, 0x00, SIERRA_NET_HIP_MSYNC_ID, 0x00};
+ static const u8 shdwn_tmplate[sizeof(priv->shdwn_msg)] = {
+ 0x00, 0x00, SIERRA_NET_HIP_SHUTD_ID, 0x00};
+
+ struct sierra_net_info_data *data =
+ (struct sierra_net_info_data *)dev->driver_info->data;
+
+ dev_dbg(&dev->udev->dev, "%s", __func__);
+
+ ifacenum = intf->cur_altsetting->desc.bInterfaceNumber;
+ /* We only accept certain interfaces */
+ if (!is_whitelisted(ifacenum, &data->whitelist)) {
+ dev_dbg(&dev->udev->dev, "Ignoring interface: %d", ifacenum);
+ return -ENODEV;
+ }
+
+ numendpoints = intf->cur_altsetting->desc.bNumEndpoints;
+ /* We have three endpoints, bulk in and out, and a status */
+ if (numendpoints != 3) {
+ deverr(dev, "Expected 3 endpoints, found: %d", numendpoints);
+ return -ENODEV;
+ }
+
+ /* Status endpoint set in usbnet_get_endpoints() */
+ dev->status = NULL;
+ status = usbnet_get_endpoints(dev, intf);
+ if (status < 0) {
+ deverr(dev, "Error in usbnet_get_endpoints (%d)",
+ status);
+ return -ENODEV;
+ }
+
+ /* Initialize sierra private data */
+ priv = kzalloc(sizeof *priv, GFP_KERNEL);
+ if (!priv) {
+ deverr(dev, "No memory");
+ return -ENOMEM;
+ }
+
+ priv->usbnet = dev;
+ priv->ifnum = ifacenum;
+ dev->net->netdev_ops = &sierra_net_device_ops;
+
+ /* change MAC addr to include, ifacenum, and to be unique */
+ dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return(&iface_counter);
+ dev->net->dev_addr[ETH_ALEN-1] = ifacenum;
+
+ /* we will have to manufacture ethernet headers, prepare template */
+ eth = (struct ethhdr *)priv->ethr_hdr_tmpl;
+ memcpy(ð->h_dest, dev->net->dev_addr, ETH_ALEN);
+ eth->h_proto = cpu_to_be16(ETH_P_IP);
+
+ /* prepare shutdown message template */
+ memcpy(priv->shdwn_msg, shdwn_tmplate, sizeof(priv->shdwn_msg));
+ /* set context index initially to 0 - prepares tx hdr template */
+ sierra_net_set_ctx_index(priv, 0);
+
+ /* decrease the rx_urb_size and max_tx_size to 4k on USB 1.1 */
+ dev->rx_urb_size = data->rx_urb_size;
+ if (dev->udev->speed != USB_SPEED_HIGH)
+ dev->rx_urb_size = min_t(size_t, 4096, data->rx_urb_size);
+
+ dev->net->hard_header_len += SIERRA_NET_HIP_EXT_HDR_LEN;
+ dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
+
+ /* Set up the netdev */
+ dev->net->flags |= IFF_NOARP;
+ dev->net->ethtool_ops = &sierra_net_ethtool_ops;
+ netif_carrier_off(dev->net);
+
+ sierra_net_set_private(dev, priv);
+
+ priv->kevent_flags = 0;
+
+ /* Use the shared workqueue */
+ INIT_WORK(&priv->sierra_net_kevent, sierra_net_kevent);
+
+ /* Only need to do this once */
+ init_timer(&priv->sync_timer);
+
+ /* verify fw attributes */
+ status = sierra_net_get_fw_attr(dev, &fwattr);
+ dev_dbg(&dev->udev->dev, "Fw attr: %x\n", fwattr);
+
+ /* test whether firmware supports DHCP */
+ if (!(status == sizeof(fwattr) && (fwattr & SWI_GET_FW_ATTR_MASK))) {
+ /* found incompatible firmware version */
+ deverr(dev, "Incompatible driver and firmware"
+ " versions\n");
+ return -ENODEV;
+ }
+ /* prepare sync message from template */
+ memcpy(priv->sync_msg, sync_tmplate, sizeof(priv->sync_msg));
+
+ /* initiate the sync sequence */
+ sierra_net_dosync(dev);
+
+ return 0;
+}
+
+static void sierra_net_unbind(struct usbnet *dev, struct usb_interface *intf)
+{
+ struct sierra_net_data *priv = sierra_net_get_private(dev);
+
+ dev_dbg(&dev->udev->dev, "%s", __func__);
+
+ /* Kill the timer then flush the work queue */
+ del_timer_sync(&priv->sync_timer);
+
+ flush_scheduled_work();
+
+ /* tell modem we are going away */
+ sierra_net_send_shutdown(dev);
+
+ sierra_net_set_private(dev, NULL);
+
+ kfree(priv);
+}
+
+static struct sk_buff *sierra_net_skb_clone(struct usbnet *dev,
+ struct sk_buff *skb, int len)
+{
+ struct sk_buff *new_skb;
+
+ /* clone skb */
+ new_skb = skb_clone(skb, GFP_ATOMIC);
+
+ /* remove len bytes from original */
+ skb_pull(skb, len);
+
+ /* trim next packet to it's length */
+ if (new_skb) {
+ skb_trim(new_skb, len);
+ } else {
+ if (netif_msg_rx_err(dev))
+ deverr(dev, "failed to get skb");
+ dev->net->stats.rx_dropped++;
+ }
+
+ return new_skb;
+}
+
+/* ---------------------------- Receive data path ----------------------*/
+static int sierra_net_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
+{
+ int err;
+ struct hip_hdr hh;
+ struct sk_buff *new_skb;
+
+ dev_dbg(&dev->udev->dev, "%s", __func__);
+
+ /* could contain multiple packets */
+ while (likely(skb->len)) {
+ err = parse_hip(skb->data, skb->len, &hh);
+ if (err) {
+ if (netif_msg_rx_err(dev))
+ deverr(dev, "Invalid HIP header %d", err);
+ /* dev->net->stats.rx_errors incremented by caller */
+ dev->net->stats.rx_length_errors++;
+ return 0;
+ }
+
+ /* Validate Extended HIP header */
+ if (!hh.extmsgid.is_present
+ || hh.extmsgid.word != SIERRA_NET_HIP_EXT_IP_IN_ID) {
+ if (netif_msg_rx_err(dev))
+ deverr(dev, "HIP/ETH: Invalid packet");
+
+ dev->net->stats.rx_frame_errors++;
+ /* dev->net->stats.rx_errors incremented by caller */;
+ return 0;
+ }
+
+ skb_pull(skb, hh.hdrlen);
+
+ /* We are going to accept this packet, prepare it */
+ memcpy(skb->data, sierra_net_get_private(dev)->ethr_hdr_tmpl,
+ ETH_HLEN);
+
+ /* Last packet in batch handled by usbnet */
+ if (hh.payload_len.word == skb->len)
+ return 1;
+
+ new_skb = sierra_net_skb_clone(dev, skb, hh.payload_len.word);
+ if (new_skb)
+ usbnet_skb_return(dev, new_skb);
+
+ } /* while */
+
+ return 0;
+}
+
+/* ---------------------------- Transmit data path ----------------------*/
+struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
+ gfp_t flags)
+{
+ struct sierra_net_data *priv = sierra_net_get_private(dev);
+ u16 len;
+
+ dev_dbg(&dev->udev->dev, "%s", __func__);
+ if (priv->link_up && check_ethip_packet(skb, dev) && is_ip(skb)) {
+ /* enough head room as is? */
+ if (SIERRA_NET_HIP_EXT_HDR_LEN <= skb_headroom(skb)) {
+ /* Save the Eth/IP length and set up HIP hdr */
+ len = skb->len;
+ skb_push(skb, SIERRA_NET_HIP_EXT_HDR_LEN);
+ build_hip(skb->data, len, priv);
+ return skb;
+ } else {
+ /*
+ * compensate in the future if necessary
+ */
+ deverr(dev, "tx_fixup: no room for HIP");
+ } /* headroom */
+ }
+
+ if (!priv->link_up)
+ dev->net->stats.tx_carrier_errors++;
+
+ /* tx_dropped incremented by usbnet */
+
+ /* filter the packet out, release it */
+ dev_kfree_skb_any(skb);
+ return NULL;
+}
+
+static const u8 sierra_net_ifnum_list[] = { 7, 10, 11 };
+static const struct sierra_net_info_data sierra_net_info_data_68A3 = {
+ .rx_urb_size = 8 * 1024,
+ .whitelist = {
+ .infolen = ARRAY_SIZE(sierra_net_ifnum_list),
+ .ifaceinfo = sierra_net_ifnum_list
+ }
+};
+
+static const struct driver_info sierra_net_info_68A3 = {
+ .description = "Sierra Wireless USB-Ethernet Modem",
+ .flags = FLAG_WWAN | FLAG_SEND_ZLP,
+ .bind = sierra_net_bind,
+ .unbind = sierra_net_unbind,
+ .status = sierra_net_status,
+ .rx_fixup = sierra_net_rx_fixup,
+ .tx_fixup = sierra_net_tx_fixup,
+ .data = (unsigned long)&sierra_net_info_data_68A3,
+};
+
+static const struct usb_device_id products[] = {
+ {USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modem */
+ .driver_info = (unsigned long) &sierra_net_info_68A3},
+
+ {}, /* last item */
+};
+MODULE_DEVICE_TABLE(usb, products);
+
+/* We are based on usbnet, so let it handle the USB driver specifics */
+static struct usb_driver sierra_net_driver = {
+ .name = "sierra_net",
+ .id_table = products,
+ .probe = usbnet_probe,
+ .disconnect = usbnet_disconnect,
+ .suspend = usbnet_suspend,
+ .resume = usbnet_resume,
+ .no_dynamic_id = 1,
+};
+
+static int __init sierra_net_init(void)
+{
+ BUILD_BUG_ON(FIELD_SIZEOF(struct usbnet, data)
+ < sizeof(struct cdc_state));
+
+ return usb_register(&sierra_net_driver);
+}
+
+static void __exit sierra_net_exit(void)
+{
+ usb_deregister(&sierra_net_driver);
+}
+
+module_exit(sierra_net_exit);
+module_init(sierra_net_init);
+
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_VERSION(DRIVER_VERSION);
+MODULE_LICENSE("GPL");
^ permalink raw reply
* Re: Network performance - iperf
From: Eric Dumazet @ 2010-03-29 20:07 UTC (permalink / raw)
To: michal.simek
Cc: LKML, John Williams, netdev, Grant Likely, John Linn,
Steven J. Magnani, Arnd Bergmann, akpm
In-Reply-To: <4BB09021.6020202@petalogix.com>
Le lundi 29 mars 2010 à 13:33 +0200, Michal Simek a écrit :
> Hi All,
>
> I am doing several network benchmarks on Microblaze cpu with MMU.
> I am seeing one issue which is weird and I would like know where the
> problem is.
> I am using the same hw design and the same Linux kernel. I have done
> only change in memory size (in DTS).
>
> 32MB: 18.3Mb/s
> 64MB: 15.2Mb/s
> 128MB: 10.6Mb/s
> 256MB: 3.8Mb/s
>
> There is huge difference between systems with 32MB and 256MB ram.
>
> I am running iperf TCP tests with these commands.
> On x86: iperf -c 192.168.0.105 -i 5 -t 50
> On microblaze: iperf -s
>
> I look at pte misses which are the same on all configurations which
> means that the number of do_page_fault exceptions is the same on all
> configurations.
> I added some hooks to low level kernel code to be able to see number of
> tlb misses. There is big differences between number of misses on system
> with 256MB and 32MB. I measured two kernel settings. First column is
> kernel with asm optimized memcpy/memmove function and the second is
> without optimization. (Kernel with asm optimized lib functions is 30%
> faster than system without optimization)
>
> 32MB: 12703 13641
> 64MB: 1021750 655644
> 128MB: 1031644 531879
> 256MB: 1011322 430027
>
> Most of them are data tlb misses. Microblaze MMU doesn't use any LRU
> mechanism to find TLB victim that's why we there is naive TLB
> replacement strategy based on incrementing counter. We using 2 tlbs for
> kernel itself which are not updated that's why we can use "only" 62 TLBs
> from 64.
>
This probably has nothing to do with tcp stack, but trashing tlb on some
pathological cases (you have 62 entries, thats good for working size up
to 248 Kbytes, all included (program stack, program static & dynamic
data), given microblaze 4Kbytes page size.
You could try :
echo "4096 8192 32768" >/proc/sys/net/ipv4/tcp_rmem
to reduce memory footprint of iperf (or use iperf parameters)
Of course, I suppose kernel memory is 32 MB max, if you use only two
tlbs (16 Mbytes each) for kernel...
^ 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