safe/jmp/linux-2.6
14 years agotcp: reduce SYN-ACK retrans for TCP_DEFER_ACCEPT
Julian Anastasov [Mon, 19 Oct 2009 10:03:58 +0000 (10:03 +0000)]
tcp: reduce SYN-ACK retrans for TCP_DEFER_ACCEPT

Change SYN-ACK retransmitting code for the TCP_DEFER_ACCEPT
users to not retransmit SYN-ACKs during the deferring period if
ACK from client was received. The goal is to reduce traffic
during the deferring period. When the period is finished
we continue with sending SYN-ACKs (at least one) but this time
any traffic from client will change the request to established
socket allowing application to terminate it properly.
Also, do not drop acked request if sending of SYN-ACK fails.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotcp: accept socket after TCP_DEFER_ACCEPT period
Julian Anastasov [Mon, 19 Oct 2009 10:01:56 +0000 (10:01 +0000)]
tcp: accept socket after TCP_DEFER_ACCEPT period

Willy Tarreau and many other folks in recent years
were concerned what happens when the TCP_DEFER_ACCEPT period
expires for clients which sent ACK packet. They prefer clients
that actively resend ACK on our SYN-ACK retransmissions to be
converted from open requests to sockets and queued to the
listener for accepting after the deferring period is finished.
Then application server can decide to wait longer for data
or to properly terminate the connection with FIN if read()
returns EAGAIN which is an indication for accepting after
the deferring period. This change still can have side effects
for applications that expect always to see data on the accepted
socket. Others can be prepared to work in both modes (with or
without TCP_DEFER_ACCEPT period) and their data processing can
ignore the read=EAGAIN notification and to allocate resources for
clients which proved to have no data to send during the deferring
period. OTOH, servers that use TCP_DEFER_ACCEPT=1 as flag (not
as a timeout) to wait for data will notice clients that didn't
send data for 3 seconds but that still resend ACKs.
Thanks to Willy Tarreau for the initial idea and to
Eric Dumazet for the review and testing the change.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRevert "tcp: fix tcp_defer_accept to consider the timeout"
David S. Miller [Tue, 20 Oct 2009 02:12:36 +0000 (19:12 -0700)]
Revert "tcp: fix tcp_defer_accept to consider the timeout"

This reverts commit 6d01a026b7d3009a418326bdcf313503a314f1ea.

Julian Anastasov, Willy Tarreau and Eric Dumazet have come up
with a more correct way to deal with this.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoAF_UNIX: Fix deadlock on connecting to shutdown socket
Tomoki Sekiyama [Mon, 19 Oct 2009 06:17:37 +0000 (23:17 -0700)]
AF_UNIX: Fix deadlock on connecting to shutdown socket

I found a deadlock bug in UNIX domain socket, which makes able to DoS
attack against the local machine by non-root users.

How to reproduce:
1. Make a listening AF_UNIX/SOCK_STREAM socket with an abstruct
    namespace(*), and shutdown(2) it.
 2. Repeat connect(2)ing to the listening socket from the other sockets
    until the connection backlog is full-filled.
 3. connect(2) takes the CPU forever. If every core is taken, the
    system hangs.

PoC code: (Run as many times as cores on SMP machines.)

int main(void)
{
int ret;
int csd;
int lsd;
struct sockaddr_un sun;

/* make an abstruct name address (*) */
memset(&sun, 0, sizeof(sun));
sun.sun_family = PF_UNIX;
sprintf(&sun.sun_path[1], "%d", getpid());

/* create the listening socket and shutdown */
lsd = socket(AF_UNIX, SOCK_STREAM, 0);
bind(lsd, (struct sockaddr *)&sun, sizeof(sun));
listen(lsd, 1);
shutdown(lsd, SHUT_RDWR);

/* connect loop */
alarm(15); /* forcely exit the loop after 15 sec */
for (;;) {
csd = socket(AF_UNIX, SOCK_STREAM, 0);
ret = connect(csd, (struct sockaddr *)&sun, sizeof(sun));
if (-1 == ret) {
perror("connect()");
break;
}
puts("Connection OK");
}
return 0;
}

(*) Make sun_path[0] = 0 to use the abstruct namespace.
    If a file-based socket is used, the system doesn't deadlock because
    of context switches in the file system layer.

Why this happens:
 Error checks between unix_socket_connect() and unix_wait_for_peer() are
 inconsistent. The former calls the latter to wait until the backlog is
 processed. Despite the latter returns without doing anything when the
 socket is shutdown, the former doesn't check the shutdown state and
 just retries calling the latter forever.

Patch:
 The patch below adds shutdown check into unix_socket_connect(), so
 connect(2) to the shutdown socket will return -ECONREFUSED.

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama.qu@hitachi.com>
Signed-off-by: Masanori Yoshida <masanori.yoshida.tv@hitachi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoethoc: clear only pending irqs
Thomas Chou [Wed, 7 Oct 2009 14:16:43 +0000 (14:16 +0000)]
ethoc: clear only pending irqs

This patch fixed the problem of dropped packets due to lost of
interrupt requests. We should only clear what was pending at the
moment we read the irq source reg.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoethoc: inline regs access
Thomas Chou [Wed, 7 Oct 2009 14:16:42 +0000 (14:16 +0000)]
ethoc: inline regs access

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovmxnet3: use dev_dbg, fix build for CONFIG_BLOCK=n
Randy Dunlap [Sat, 17 Oct 2009 00:54:34 +0000 (17:54 -0700)]
vmxnet3: use dev_dbg, fix build for CONFIG_BLOCK=n

vmxnet3 was using dprintk() for debugging output.  This was
defined in <linux/dst.h> and was the only thing that was
used from that header file.  This caused compile errors
when CONFIG_BLOCK was not enabled due to bio* and BIO*
uses in the header file, so change this driver to use
dev_dbg() for debugging output.

include/linux/dst.h:520: error: dereferencing pointer to incomplete type
include/linux/dst.h:520: error: 'BIO_POOL_BITS' undeclared (first use in this function)
include/linux/dst.h:521: error: dereferencing pointer to incomplete type
include/linux/dst.h:522: error: dereferencing pointer to incomplete type
include/linux/dst.h:525: error: dereferencing pointer to incomplete type
make[4]: *** [drivers/net/vmxnet3/vmxnet3_drv.o] Error 1

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Bhavesh Davda <bhavesh@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovirtio_net: use dev_kfree_skb_any() in free_old_xmit_skbs()
Eric Dumazet [Wed, 14 Oct 2009 14:36:43 +0000 (14:36 +0000)]
virtio_net: use dev_kfree_skb_any() in free_old_xmit_skbs()

Because netpoll can call netdevice start_xmit() method with
irqs disabled, drivers should not call kfree_skb() from
their start_xmit(), but use dev_kfree_skb_any() instead.

Oct  8 11:16:52 172.30.1.31 [113074.791813] ------------[ cut here ]------------
Oct  8 11:16:52 172.30.1.31 [113074.791813] WARNING: at net/core/skbuff.c:398 \
                skb_release_head_state+0x64/0xc8()
Oct  8 11:16:52 172.30.1.31 [113074.791813] Hardware name:
Oct  8 11:16:52 172.30.1.31 [113074.791813] Modules linked in: netconsole ocfs2 jbd2 quota_tree \
ocfs2_dlmfs ocfs2_stack_o2cb ocfs2_dlm ocfs2_nodemanager ocfs2_stackglue configfs crc32c drbd cn loop \
serio_raw psmouse snd_pcm snd_timer snd soundcore snd_page_alloc virtio_net pcspkr parport_pc parport \
i2c_piix4 i2c_core button processor evdev ext3 jbd mbcache dm_mirror dm_region_hash dm_log dm_snapshot \
dm_mod ide_cd_mod cdrom ata_generic ata_piix virtio_blk libata scsi_mod piix ide_pci_generic ide_core \
                virtio_pci virtio_ring virtio floppy thermal fan thermal_sys [last unloaded: netconsole]
Oct  8 11:16:52 172.30.1.31 [113074.791813] Pid: 11132, comm: php5-cgi Tainted: G        W  \
                2.6.31.2-vserver #1
Oct  8 11:16:52 172.30.1.31 [113074.791813] Call Trace:
Oct  8 11:16:52 172.30.1.31 [113074.791813] <IRQ>  [<ffffffff81253cd5>] ? \
                skb_release_head_state+0x64/0xc8
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81253cd5>] ? skb_release_head_state+0x64/0xc8
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81049ae1>] ? warn_slowpath_common+0x77/0xa3
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81253cd5>] ? skb_release_head_state+0x64/0xc8
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81253a1a>] ? __kfree_skb+0x9/0x7d
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffffa01cb139>] ? free_old_xmit_skbs+0x51/0x6e \
                [virtio_net]
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffffa01cbc85>] ? start_xmit+0x26/0xf2 [virtio_net]
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8126934f>] ? netpoll_send_skb+0xd2/0x205
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffffa0429216>] ? write_msg+0x90/0xeb [netconsole]
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81049f06>] ? __call_console_drivers+0x5e/0x6f
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8102b49d>] ? kvm_clock_read+0x4d/0x52
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8104a082>] ? release_console_sem+0x115/0x1ba
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8104a632>] ? vprintk+0x2f2/0x34b
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8106b142>] ? vx_update_load+0x18/0x13e
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81308309>] ? printk+0x4e/0x5d
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8102b49d>] ? kvm_clock_read+0x4d/0x52
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81070b62>] ? getnstimeofday+0x55/0xaf
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81062683>] ? ktime_get_ts+0x21/0x49
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff810626b7>] ? ktime_get+0xc/0x41
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81062788>] ? hrtimer_interrupt+0x9c/0x146
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81024a4b>] ? smp_apic_timer_interrupt+0x80/0x93
Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81011663>] ? apic_timer_interrupt+0x13/0x20
Oct  8 11:16:52 172.30.1.31 [113074.791813] <EOI>  [<ffffffff8130a9eb>] ? _spin_unlock_irq+0xd/0x31

Reported-and-tested-by: Massimo Cetra <mcetra@navynet.it>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Bug-Entry: http://bugzilla.kernel.org/show_bug.cgi?id=14378
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: fix support for PCI hot plug
Sathya Perla [Wed, 14 Oct 2009 20:21:17 +0000 (20:21 +0000)]
be2net: fix support for PCI hot plug

Before issuing any cmds to the FW, the driver must first wait
till the fW becomes ready. This is needed for PCI hot plug when
the driver can be probed while the card fw is being initialized.

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: fix promiscuous and multicast promiscuous modes being enabled always
Sathya Perla [Wed, 14 Oct 2009 20:20:42 +0000 (20:20 +0000)]
be2net: fix promiscuous and multicast promiscuous modes being enabled always

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovmxnet: fix 2 build problems
Randy Dunlap [Thu, 15 Oct 2009 03:38:58 +0000 (20:38 -0700)]
vmxnet: fix 2 build problems

vmxnet3 uses in_dev* interfaces so it should depend on INET.
Also fix so that the driver builds when CONFIG_PCI_MSI is disabled.

vmxnet3_drv.c:(.text+0x2a88cb): undefined reference to `in_dev_finish_destroy'

drivers/net/vmxnet3/vmxnet3_drv.c:1335: error: 'struct vmxnet3_intr' has no member named 'msix_entries'
drivers/net/vmxnet3/vmxnet3_drv.c:1384: error: 'struct vmxnet3_intr' has no member named 'msix_entries'
drivers/net/vmxnet3/vmxnet3_drv.c:2137: error: 'struct vmxnet3_intr' has no member named 'msix_entries'
drivers/net/vmxnet3/vmxnet3_drv.c:2138: error: 'struct vmxnet3_intr' has no member named 'msix_entries'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Bhavesh davda <bhavesh@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: add support for STMicroelectronics Ethernet controllers.
Giuseppe Cavallaro [Wed, 14 Oct 2009 22:13:45 +0000 (15:13 -0700)]
net: add support for STMicroelectronics Ethernet controllers.

This is the driver for the ST MAC 10/100/1000 on-chip Ethernet
controllers (Synopsys IP blocks).

Driver documentation:
 o http://stlinux.com/drupal/kernel/network/stmmac
Revisions:
 o http://stlinux.com/drupal/kernel/network/stmmac-driver-revisions
Performances:
 o http://stlinux.com/drupal/benchmarks/networking/stmmac

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: ks8851_mll uses mii interfaces
Randy Dunlap [Wed, 14 Oct 2009 22:10:58 +0000 (15:10 -0700)]
net: ks8851_mll uses mii interfaces

From: Randy Dunlap <randy.dunlap@oracle.com>

ks8851_mll uses mii interfaces so it needs to select MII.

ks8851_mll.c:(.text+0xf95ac): undefined reference to `generic_mii_ioctl'
ks8851_mll.c:(.text+0xf96a0): undefined reference to `mii_ethtool_gset'
ks8851_mll.c:(.text+0xf96fa): undefined reference to `mii_ethtool_sset'
ks8851_mll.c:(.text+0xf9754): undefined reference to `mii_link_ok'
ks8851_mll.c:(.text+0xf97ae): undefined reference to `mii_nway_restart'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/fec_mpc52xx: Fix kernel panic on FEC error
John Bonesio [Wed, 14 Oct 2009 22:10:19 +0000 (15:10 -0700)]
net/fec_mpc52xx: Fix kernel panic on FEC error

The MDIO bus cannot be accessed at interrupt context, but on an FEC
error, the fec_mpc52xx driver reset function also tries to reset the
PHY.  Since the error is detected at IRQ context, and the PHY functions
try to sleep, the kernel ends up panicking.

Resetting the PHY on an FEC error isn't even necessary.  This patch
solves the problem by removing the PHY reset entirely.

Signed-off-by: John Bonesio <bones@secretlab.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Fix OF platform drivers coldplug/hotplug when compiled as modules
Anton Vorontsov [Wed, 14 Oct 2009 21:54:52 +0000 (14:54 -0700)]
net: Fix OF platform drivers coldplug/hotplug when compiled as modules

Some OF platform drivers are missing module device tables, so they won't
load automatically on boot. This patch fixes the issue by adding proper
MODULE_DEVICE_TABLE() macros to the drivers.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoTI DaVinci EMAC: Clear statistics register properly.
Sriram [Wed, 7 Oct 2009 02:44:30 +0000 (02:44 +0000)]
TI DaVinci EMAC: Clear statistics register properly.

The mechanism to clear the statistics register is dependent
on the status of GMIIEN bit in MAC control register. If the
GMIIEN bit is set, the stats registers are write to decrement.
If the GMIIEN bit is cleared, the stats registers are plain
read/write registers. The stats register clearing operation
must take into account the current state of GMIIEN as it
can be cleared when the interface is brought down.

With existing implementation logic, querying for interface stats
when the interface is down, can corrupt the statistics counters.
This patch examines the GMIIEN bit status in MAC_CONTROL
register before choosing an appropriate mask for clearing stats
registers.

Signed-off-by: Sriramakrishnan <srk@ti.com>
Acked-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agor8169: partial support and phy init for the 8168d
françois romieu [Wed, 7 Oct 2009 12:44:20 +0000 (12:44 +0000)]
r8169: partial support and phy init for the 8168d

Extracted from Realtek's 8.012.00 r8168 driver.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Tested-by: Simon Farnsworth <simon.farnsworth@onelan.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Tue, 13 Oct 2009 18:41:34 +0000 (11:41 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

14 years agoirda/sa1100_ir: check return value of startup hook
Dmitry Artamonow [Tue, 13 Oct 2009 10:17:37 +0000 (03:17 -0700)]
irda/sa1100_ir: check return value of startup hook

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoudp: Fix udp_poll() and ioctl()
Eric Dumazet [Fri, 9 Oct 2009 04:43:40 +0000 (04:43 +0000)]
udp: Fix udp_poll() and ioctl()

udp_poll() can in some circumstances drop frames with incorrect checksums.

Problem is we now have to lock the socket while dropping frames, or risk
sk_forward corruption.

This bug is present since commit 95766fff6b9a78d1
([UDP]: Add memory accounting.)

While we are at it, we can correct ioctl(SIOCINQ) to also drop bad frames.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoWAN: fix Cisco HDLC handshaking.
Krzysztof Halasa [Fri, 9 Oct 2009 06:16:10 +0000 (06:16 +0000)]
WAN: fix Cisco HDLC handshaking.

Cisco HDLC uses keepalive packets and sequence numbers to determine link
state. In rare cases both ends could transmit keepalive packets at the same
time, causing the received sequence numbers to be treated as incorrect.
Now we accept our current sequence number as well as the previous one.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotcp: fix tcp_defer_accept to consider the timeout
Willy Tarreau [Tue, 13 Oct 2009 07:27:40 +0000 (00:27 -0700)]
tcp: fix tcp_defer_accept to consider the timeout

I was trying to use TCP_DEFER_ACCEPT and noticed that if the
client does not talk, the connection is never accepted and
remains in SYN_RECV state until the retransmits expire, where
it finally is deleted. This is bad when some firewall such as
netfilter sits between the client and the server because the
firewall sees the connection in ESTABLISHED state while the
server will finally silently drop it without sending an RST.

This behaviour contradicts the man page which says it should
wait only for some time :

       TCP_DEFER_ACCEPT (since Linux 2.4)
          Allows a listener to be awakened only when data arrives
          on the socket.  Takes an integer value  (seconds), this
          can  bound  the  maximum  number  of attempts TCP will
          make to complete the connection. This option should not
          be used in code intended to be portable.

Also, looking at ipv4/tcp.c, a retransmit counter is correctly
computed :

        case TCP_DEFER_ACCEPT:
                icsk->icsk_accept_queue.rskq_defer_accept = 0;
                if (val > 0) {
                        /* Translate value in seconds to number of
                         * retransmits */
                        while (icsk->icsk_accept_queue.rskq_defer_accept < 32 &&
                               val > ((TCP_TIMEOUT_INIT / HZ) <<
                                       icsk->icsk_accept_queue.rskq_defer_accept))
                                icsk->icsk_accept_queue.rskq_defer_accept++;
                        icsk->icsk_accept_queue.rskq_defer_accept++;
                }
                break;

==> rskq_defer_accept is used as a counter of retransmits.

But in tcp_minisocks.c, this counter is only checked. And in
fact, I have found no location which updates it. So I think
that what was intended was to decrease it in tcp_minisocks
whenever it is checked, which the trivial patch below does.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years ago3c574_cs: spin_lock the set_multicast_list function
Ken Kawasaki [Tue, 13 Oct 2009 07:32:55 +0000 (00:32 -0700)]
3c574_cs: spin_lock the set_multicast_list function

3c574_cs:
 spin_lock the set_multicast_list function.

Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Teach pegasus driver to ignore bluetoother adapters with clashing Vendor:Product IDs
Chris Rankin [Tue, 13 Oct 2009 07:32:02 +0000 (00:32 -0700)]
net: Teach pegasus driver to ignore bluetoother adapters with clashing Vendor:Product IDs

The Belkin F8T012xx1 bluetooth adaptor has the same vendor and product
IDs as the Belkin F5D5050, so we need to teach the pegasus driver to
ignore adaptors belonging to the "Wireless" class 0xE0. For this one
case anyway, seeing as pegasus is a driver for "Wired" adaptors.

Signed-off-by: Chris Rankin <rankincj@yahoo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: fix pci bar mapping
Dhananjay Phadke [Tue, 13 Oct 2009 07:26:04 +0000 (00:26 -0700)]
netxen: fix pci bar mapping

Use resource_size_t for PCI resource remapping instead
of unsigned long. Physical addresses can exceed range of
long data type (e.g with PAE).

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoethoc: fix warning from 32bit build
Alan Cox [Mon, 12 Oct 2009 05:27:55 +0000 (05:27 +0000)]
ethoc: fix warning from 32bit build

drivers/net/ethoc.c: In function ‘ethoc_open’:
drivers/net/ethoc.c:667: warning: comparison of distinct pointer types
lacks a cast

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agolibertas: fix build
Alan Cox [Mon, 12 Oct 2009 05:27:48 +0000 (05:27 +0000)]
libertas: fix build

drivers/net/wireless/libertas/cmdresp.c: In function ‘lbs_process_event’:
drivers/net/wireless/libertas/cmdresp.c:519: error: ‘TASK_INTERRUPTIBLE’
undeclared (first use in this function)
drivers/net/wireless/libertas/cmdresp.c:519: error: (Each undeclared
identifier is reported only once
drivers/net/wireless/libertas/cmdresp.c:519: error: for each function it
appears in.)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: VMware virtual Ethernet NIC driver: vmxnet3
Shreyas Bhatewara [Tue, 13 Oct 2009 07:15:51 +0000 (00:15 -0700)]
net: VMware virtual Ethernet NIC driver: vmxnet3

Ethernet NIC driver for VMware's vmxnet3

From: Shreyas Bhatewara <sbhatewara@vmware.com>

This patch adds driver support for VMware's virtual Ethernet NIC: vmxnet3
Guests running on VMware hypervisors supporting vmxnet3 device will thus have
access to improved network functionalities and performance.

Signed-off-by: Shreyas Bhatewara <sbhatewara@vmware.com>
Signed-off-by: Bhavesh Davda <bhavesh@vmware.com>
Signed-off-by: Ronghua Zhang <ronghua@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Fix IXP 2000 network driver building.
Vincent Sanders [Tue, 13 Oct 2009 07:03:11 +0000 (00:03 -0700)]
net: Fix IXP 2000 network driver building.

The IXP 2000 network driver was failing to build as it has its own
statistics gathering which was not compatible with the recent network
device operations changes. This patch fixes the driver in the obvious
way and has been compile tested. I have been unable to get the ixp2000
maintainer to comment or test this fix.

Signed-off-by: Vincent Sanders <vince@simtec.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agolibertas: fix build
Alan Cox [Mon, 12 Oct 2009 15:27:48 +0000 (16:27 +0100)]
libertas: fix build

drivers/net/wireless/libertas/cmdresp.c: In function ‘lbs_process_event’:
drivers/net/wireless/libertas/cmdresp.c:519: error: ‘TASK_INTERRUPTIBLE’
undeclared (first use in this function)
drivers/net/wireless/libertas/cmdresp.c:519: error: (Each undeclared
identifier is reported only once
drivers/net/wireless/libertas/cmdresp.c:519: error: for each function it
appears in.)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: document ieee80211_rx() context requirement
Johannes Berg [Sun, 11 Oct 2009 13:10:40 +0000 (15:10 +0200)]
mac80211: document ieee80211_rx() context requirement

ieee80211_rx() must be called with softirqs disabled
since the networking stack requires this for netif_rx()
and some code in mac80211 can assume that it can not
be processing its own tasklet and this call at the same
time.

It may be possible to remove this requirement after a
careful audit of mac80211 and doing any needed locking
improvements in it along with disabling softirqs around
netif_rx(). An alternative might be to push all packet
processing to process context in mac80211, instead of
to the tasklet, and add other synchronisation.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: fix ieee80211_rx() context
Johannes Berg [Sun, 11 Oct 2009 10:19:21 +0000 (12:19 +0200)]
b43: fix ieee80211_rx() context

Due to the way it interacts with the networking
stack and other parts of mac80211, ieee80211_rx()
must be called with disabled softirqs.

[1] http://thread.gmane.org/gmane.linux.kernel.wireless.general/39440/focus=40266

Reported-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: fix ibss race
Johannes Berg [Sun, 11 Oct 2009 09:47:57 +0000 (11:47 +0200)]
mac80211: fix ibss race

When a scan completes, we call ieee80211_sta_find_ibss(),
which is also called from other places. When the scan was
done in software, there's no problem as both run from the
single-threaded mac80211 workqueue and are thus serialised
against each other, but with hardware scan the completion
can be in a different context and race against callers of
this function from the workqueue (e.g. due to beacon RX).
So instead of calling ieee80211_sta_find_ibss() directly,
just arm the timer and have it fire, scheduling the work,
which will invoke ieee80211_sta_find_ibss() (if that is
appropriate in the current state).

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: fix logic error ibss merge bssid check
Felix Fietkau [Sun, 11 Oct 2009 03:21:10 +0000 (05:21 +0200)]
mac80211: fix logic error ibss merge bssid check

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: change the order of freeing memory
Wey-Yi Guy [Fri, 9 Oct 2009 20:20:17 +0000 (13:20 -0700)]
iwlwifi: change the order of freeing memory

Need to free the dynamic allocated memory before ieee80211_free_hw();
once call ieee80211_free_hw(), should not reference to "priv" data
structure.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoacenic: Pass up error code from ace_load_firmware()
Ben Hutchings [Mon, 12 Oct 2009 11:18:48 +0000 (04:18 -0700)]
acenic: Pass up error code from ace_load_firmware()

If ace_load_firmware() fails, ace_init() cleans up but still returns
0, leading to an oops as seen in <http://bugs.debian.org/521383>.
It should pass the error code up.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Fix struct sock bitfield annotation
Eric Dumazet [Thu, 8 Oct 2009 22:50:25 +0000 (22:50 +0000)]
net: Fix struct sock bitfield annotation

Since commit a98b65a3 (net: annotate struct sock bitfield), we lost
8 bytes in struct sock on 64bit arches because of
kmemcheck_bitfield_end(flags) misplacement.

Fix this by putting together sk_shutdown, sk_no_check, sk_userlocks,
sk_protocol and sk_type in the 'flags' 32bits bitfield

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopkt_sched: pedit use proper struct
jamal [Sun, 11 Oct 2009 04:21:38 +0000 (04:21 +0000)]
pkt_sched: pedit use proper struct

This probably deserves to go into -stable.

Pedit will reject a policy that is large because it
uses the wrong structure in the policy validation.
This fixes it.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Add patchwork URL to MAINTAINERS
Eric Dumazet [Sat, 10 Oct 2009 21:40:54 +0000 (21:40 +0000)]
net: Add patchwork URL to MAINTAINERS

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Link in PHY drivers before others.
David S. Miller [Fri, 9 Oct 2009 21:24:36 +0000 (14:24 -0700)]
net: Link in PHY drivers before others.

We need PHY drivers to initialize in a static kernel before
the MAC drivers that use them.  So link them in first.

Based upon a report by Felix Radensky.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoibm_newemac: Added 16K Tx FIFO size support for EMAC4
Dave Mitchell [Thu, 8 Oct 2009 06:32:21 +0000 (06:32 +0000)]
ibm_newemac: Added 16K Tx FIFO size support for EMAC4

Some of the EMAC V4 implementations support 16K Tx FIFOs. This
patch adds support for this functionality and fixes typos in the
Tx FIFO size error messages.

Signed-off-by: Dave Mitchell <dmitchell@appliedmicro.com>
Acked-by: Prodyut Hazarika <phazarika@appliedmicro.com>
Acked-by: Victor Gallardo <vgallardo@appliedmicro.com>
Acked-by: Loc Ho <lho@appliedmicro.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Add disable/enable firmare irqs to handler.
Ron Mercer [Thu, 8 Oct 2009 09:54:43 +0000 (09:54 +0000)]
qlge: Add disable/enable firmare irqs to handler.

This was accidentally omitted from one of the previous patches for firmware event
handling.  The handler needs to the enable firmware irq mask when it's done
processing or it may not get any more events interrupts.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Restore rx mode after internal reset.
Ron Mercer [Thu, 8 Oct 2009 09:54:42 +0000 (09:54 +0000)]
qlge: Restore rx mode after internal reset.

Call set_multi API after reset recovery.  This was exposed by tripping
tx_timeout.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Fix chip reset process.
Ron Mercer [Thu, 8 Oct 2009 09:54:41 +0000 (09:54 +0000)]
qlge: Fix chip reset process.

Add wait for NIC fifo and MGMNT fifo to empty before applying reset.
Otherwise broken frames can be processed by management processor and
cause it to hang.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Fix RX multicast filter settings.
Ron Mercer [Thu, 8 Oct 2009 09:54:40 +0000 (09:54 +0000)]
qlge: Fix RX multicast filter settings.

The addresses were being added to the filter properly, but were not
being enabled.  This adds enable bit to filter write.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Fix frame routing for multicast frames.
Ron Mercer [Thu, 8 Oct 2009 09:54:39 +0000 (09:54 +0000)]
qlge: Fix frame routing for multicast frames.

Broadcast/multicast should always be routed to the default (zeroeth) rx
ring.  Broadcast frames are already routed correctly.  This fixes
routing for multicast frames.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Fix frame routing issue related to bonding.
Ron Mercer [Thu, 8 Oct 2009 09:54:38 +0000 (09:54 +0000)]
qlge: Fix frame routing issue related to bonding.

Currently frames are routed based on their type and MAC address. This
patch adds the port number on which the frame arrived to the routing.
This prevents problems in the case where both interfaces have the same MAC address in
a routing configuration.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Fix RSS hashing values.
Ron Mercer [Thu, 8 Oct 2009 09:54:37 +0000 (09:54 +0000)]
qlge: Fix RSS hashing values.

Fix RX queue table size and change from random to default hash values.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Thu, 8 Oct 2009 22:55:21 +0000 (15:55 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

14 years agocfg80211: fix netns error unwinding bug
Johannes Berg [Thu, 8 Oct 2009 19:02:02 +0000 (21:02 +0200)]
cfg80211: fix netns error unwinding bug

The error unwinding code in set_netns has a bug
that will make it run into a BUG_ON if passed a
bad wiphy index, fix by not trying to unlock a
wiphy that doesn't exist.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agonetlink: fix typo in initialization
Jiri Pirko [Thu, 8 Oct 2009 08:21:46 +0000 (01:21 -0700)]
netlink: fix typo in initialization

Commit 9ef1d4c7c7aca1cd436612b6ca785b726ffb8ed8 ("[NETLINK]: Missing
initializations in dumped data") introduced a typo in
initialization. This patch fixes this.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoznet: Don't claim DMA lock around free_dma() calls.
David S. Miller [Thu, 8 Oct 2009 05:15:23 +0000 (22:15 -0700)]
znet: Don't claim DMA lock around free_dma() calls.

It's not necessary and it's illegal too.

Reported-by: Alexander Strakh <strakh@ispras.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoinclude/linux/netdevice.h: fix nanodoc mismatch
Wolfram Sang [Wed, 7 Oct 2009 20:53:11 +0000 (13:53 -0700)]
include/linux/netdevice.h: fix nanodoc mismatch

nanodoc was missing an ndo_-prefix.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agob43: do not stack-allocate pio rx/tx header and tail buffers
Albert Herranz [Tue, 6 Oct 2009 22:07:44 +0000 (00:07 +0200)]
b43: do not stack-allocate pio rx/tx header and tail buffers

The DMA-API debugging facility complains about b43 mapping memory from
stack for SDIO-based cards.

Indeed, b43 currently allocates the PIO RX/TX header and tail buffers
from stack. The solution here is to use heap-allocated buffers instead.

Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: Fix PPC crash in rfkill polling on unload
Larry Finger [Fri, 2 Oct 2009 17:54:34 +0000 (12:54 -0500)]
b43: Fix PPC crash in rfkill polling on unload

In Bugzilla No. 14181, a PowerMac G4 crashes on ifdown or
module unload because the rfkill polling has not been stopped.
For the x86 architectures, the attempt to reach a now unmapped
register is not fatal as it is on PPC.

(Includes "b43: Fix locking problem when stopping rfkill polling". -- JWL)

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: use kfree_skb() to free struct sk_buff pointers
Roel Kluin [Tue, 6 Oct 2009 13:52:35 +0000 (15:52 +0200)]
mac80211: use kfree_skb() to free struct sk_buff pointers

kfree_skb() should be used to free struct sk_buff pointers.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: fix ADM8211_SYNCTL_RFtype define
Roel Kluin [Tue, 6 Oct 2009 12:33:14 +0000 (14:33 +0200)]
mac80211: fix ADM8211_SYNCTL_RFtype define

A logical of shifts to the left doesn't make sense.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: use %pM for formatted MAC addresses
Bjorn Helgaas [Mon, 5 Oct 2009 17:37:01 +0000 (11:37 -0600)]
iwlwifi: use %pM for formatted MAC addresses

User-visible messages should use formatted MAC addresses ("00:01:...")
rather than raw ("0001...") so they match other parts of the system.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: ilw@linux.intel.com
CC: linux-wireless@vger.kernel.org
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: Protect sanity check against physical device removal
Michael Buesch [Fri, 2 Oct 2009 22:57:58 +0000 (00:57 +0200)]
b43: Protect sanity check against physical device removal

Fix IRQ mask sanity check for physically pulled device.

Tested-by: Andrew Price <andy@andrewprice.me.uk>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlagn: fix compile warning in iwl5000_gain_computation
Reinette Chatre [Fri, 2 Oct 2009 20:44:07 +0000 (13:44 -0700)]
iwlagn: fix compile warning in iwl5000_gain_computation

The return type of abs() was recently changed from int to long. With
min()'s type checking we thus need to make sure that values of the same
type are compared.

This fixes:

    CC [M]  drivers/net/wireless/iwlwifi/iwl-5000.o
drivers/net/wireless/iwlwifi/iwl-5000.c: In function ‘iwl5000_gain_computation’:
drivers/net/wireless/iwlwifi/iwl-5000.c:320: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Reported-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: fix compile warning
Reinette Chatre [Fri, 2 Oct 2009 20:43:57 +0000 (13:43 -0700)]
iwlwifi: fix compile warning

Fixes following on big endian systems:
  CC [M]  drivers/net/wireless/iwlwifi/iwl-rx.o
  drivers/net/wireless/iwlwifi/iwl-rx.c: In function ‘iwl_rx_reply_rx’:
  drivers/net/wireless/iwlwifi/iwl-rx.c:1029: warning: integer overflow in
  expression

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Reported-by: Marcel Holtmann <marcel@holtmann.org>
Tested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: fix EEPROM enhance tx power offset
Wey-Yi Guy [Fri, 2 Oct 2009 20:43:56 +0000 (13:43 -0700)]
iwlwifi: fix EEPROM enhance tx power offset

Set the correct EEPROM offset for enhance tx power for 6000 series

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: incorrect method used for finding valid OTP blocks
Jay Sternberg [Fri, 2 Oct 2009 20:43:55 +0000 (13:43 -0700)]
iwlwifi: incorrect method used for finding valid OTP blocks

The address stored in the next link address is a word address but when
reading the OTP blocks, a byte address is used. Also if the blocks are
full and the last link pointer is not zero, then none of the blocks are
valid so return an error.

The algorithm is simply valid blocks have a next address and that
address's contents is zero.

Using the wrong address for the next link address gets arbitrary data,
obviously. In cases seen, the first block is considered valid when it is not.

If the block has in fact been invalidated there may be old data or
there may be no data, bad data, or partial data, there is no way of
telling. Without this patch it is possible that a device with valid OTP data
is unable to work.

Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
CC: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: fix vlan and optimise RX
Johannes Berg [Thu, 1 Oct 2009 20:06:29 +0000 (22:06 +0200)]
mac80211: fix vlan and optimise RX

When receiving data frames, we can send them only to
the interface they belong to based on transmitting
station (this doesn't work for probe requests). Also,
don't try to handle other frames for AP_VLAN at all
since those interface should only receive data.

Additionally, the transmit side must check that the
station we're sending a frame to is actually on the
interface we're transmitting on, and not transmit
packets to functions that live on other interfaces,
so validate that as well.

Another bug fix is needed in sta_info.c where in the
VLAN case when adding/removing stations we overwrite
the sdata variable we still need.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: Don't use struct wldev after detach.
Michael Buesch [Thu, 1 Oct 2009 13:54:32 +0000 (15:54 +0200)]
b43: Don't use struct wldev after detach.

Don't use struct wldev after detach. This fixes an oops on access.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoethoc: limit the number of buffers to 128
Thomas Chou [Tue, 6 Oct 2009 03:25:25 +0000 (03:25 +0000)]
ethoc: limit the number of buffers to 128

Only 128 buffer descriptors are supported in the core. Limit the
number in case we have more memory.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoethoc: use system memory as buffer
Thomas Chou [Sun, 4 Oct 2009 23:33:20 +0000 (23:33 +0000)]
ethoc: use system memory as buffer

This patch enabled the ethoc to allocate system memory as buffer
when there is no dedicated buffer memory.

Some hardware designs may not have dedicated buffer memory such as
on chip or off chip SRAM. In this case, only one memory resource is
supplied in the platform data instead of two. Then a DMA buffer can
be allocated from system memory and used for the transfer.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoethoc: align received packet to make IP header at word boundary
Thomas Chou [Sun, 4 Oct 2009 23:33:19 +0000 (23:33 +0000)]
ethoc: align received packet to make IP header at word boundary

The packet buffer is allocated at 4 bytes boundary, but the IP header
length and version bits is located at byte 14. These bit fields access
as 32 bits word and caused exception on processors that do not support
unaligned access.

The patch adds 2 bytes offset to make the bit fields word aligned.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoethoc: fix buffer address mapping
Thomas Chou [Sun, 4 Oct 2009 23:33:18 +0000 (23:33 +0000)]
ethoc: fix buffer address mapping

The pointer address in buffer descriptors is physical address. The
pointer that processor used to access packet is virtual address.

Though the higher bits of pointer address used by the MAC may be
truncated to zero in special case, it is not always true in larger
designs.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoethoc: fix typo to compute number of tx descriptors
Thomas Chou [Sun, 4 Oct 2009 23:33:17 +0000 (23:33 +0000)]
ethoc: fix typo to compute number of tx descriptors

It should be max() instead of min(). Use 1/4 of available
descriptors for tx, and there should be at least 2 tx
descriptors.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoau1000_eth: Duplicate test of RX_OVERLEN bit in update_rx_stats()
roel kluin [Tue, 6 Oct 2009 09:54:18 +0000 (09:54 +0000)]
au1000_eth: Duplicate test of RX_OVERLEN bit in update_rx_stats()

in update_rx_stats() the RX_OVERLEN bit is set twice, replace it by RX_RUNT.
in au1000_rx() the RX_MISSED_FRAME bit was tested a few lines earlier already

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: Fix Unlikely(x) > y
Roel Kluin [Tue, 6 Oct 2009 19:34:39 +0000 (19:34 +0000)]
netxen: Fix Unlikely(x) > y

The closing parenthesis was not on the right location.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopasemi_mac: ethtool get settings fix
Valentine Barshak [Mon, 5 Oct 2009 03:27:56 +0000 (03:27 +0000)]
pasemi_mac: ethtool get settings fix

Not all pasemi mac interfaces can have a phy attached.
For example, XAUI has no phy and phydev is NULL for it.
In this case ethtool get settings causes kernel crash.
Fix it by returning -EOPNOTSUPP if there's no PHY attached.

Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoadd maintainer for network drop monitor kernel service
Neil Horman [Mon, 5 Oct 2009 03:56:55 +0000 (03:56 +0000)]
add maintainer for network drop monitor kernel service

I was getting ribbed about this earlier, so I figured I'd make it
official.  Add myself as the maintainer of the drop monitor bits, so
people don't just gripe at Dave when it breaks (I'm sure it will never
break, but just in case :) ).

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Fix phylib locking strategy
Matt Carlson [Mon, 5 Oct 2009 17:55:29 +0000 (17:55 +0000)]
tg3: Fix phylib locking strategy

Felix Radensky noted that chip resets were generating stack trace dumps.
This is because the driver is attempting to acquire the mdio bus mutex
while holding the tp->lock spinlock.  The fix is to change the code such
that every phy access takes the tp->lock spinlock instead.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agorndis_host: support ETHTOOL_GPERMADDR
John W. Linville [Tue, 6 Oct 2009 11:05:42 +0000 (11:05 +0000)]
rndis_host: support ETHTOOL_GPERMADDR

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv4: arp_notify address list bug
Stephen Hemminger [Wed, 7 Oct 2009 10:18:17 +0000 (03:18 -0700)]
ipv4: arp_notify address list bug

This fixes a bug with arp_notify.

If arp_notify is enabled, kernel will crash if address is changed
and no IP address is assigned.
  http://bugzilla.kernel.org/show_bug.cgi?id=14330

Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogigaset: add kerneldoc comments
Tilman Schmidt [Tue, 6 Oct 2009 12:19:01 +0000 (12:19 +0000)]
gigaset: add kerneldoc comments

Add kerneldoc comments to some functions in the Gigaset driver.

Impact: documentation
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogigaset: correct debugging output selection
Tilman Schmidt [Tue, 6 Oct 2009 12:18:56 +0000 (12:18 +0000)]
gigaset: correct debugging output selection

Dump payload data consistently only when DEBUG_STREAM_DUMP debug bit
is set.

Impact: debugging aid
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogigaset: improve error recovery
Tilman Schmidt [Tue, 6 Oct 2009 12:18:51 +0000 (12:18 +0000)]
gigaset: improve error recovery

When the Gigaset base stops responding, try resetting the USB
connection to recover.

Impact: error handling improvement
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogigaset: fix device ERROR response handling
Tilman Schmidt [Tue, 6 Oct 2009 12:18:46 +0000 (12:18 +0000)]
gigaset: fix device ERROR response handling

Clear out pending command that got rejected with 'ERROR' response.
This fixes the bug where unloading the driver module would hang
with the message: "gigaset: not searching scheduled commands: busy"
after a device communication error.

Impact: error handling bugfix
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogigaset: announce if built with debugging
Tilman Schmidt [Tue, 6 Oct 2009 12:18:41 +0000 (12:18 +0000)]
gigaset: announce if built with debugging

Mention in the driver load announcement whether the driver was built
with debugging messages enabled, to facilitate support.

Impact: informational message
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogigaset: handle isoc frame errors more gracefully
Tilman Schmidt [Tue, 6 Oct 2009 12:18:36 +0000 (12:18 +0000)]
gigaset: handle isoc frame errors more gracefully

Don't drop the remainder of an URB if an isochronous frame has an error.

Impact: error handling improvement
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogigaset: linearize skb
Tilman Schmidt [Tue, 6 Oct 2009 12:18:31 +0000 (12:18 +0000)]
gigaset: linearize skb

The code of the Gigaset driver assumes that sk_buff-s coming
from the ISDN4Linux subsystem are always linear. Explicitly
calling skb_linearize() is cheap if they are, but much more
robust in case they ever aren't.

Impact: robustness improvement
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogigaset: fix reject/hangup handling
Tilman Schmidt [Tue, 6 Oct 2009 12:18:26 +0000 (12:18 +0000)]
gigaset: fix reject/hangup handling

Signal D channel disconnect in a few cases where it was missed,
including when an incoming call is disconnected before it was
accepted.

Impact: error handling improvement
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoisdn: make capidrv module parameter "debugmode" writeable
Tilman Schmidt [Tue, 6 Oct 2009 12:18:15 +0000 (12:18 +0000)]
isdn: make capidrv module parameter "debugmode" writeable

Being able to change the debugmode module parameter of capidrv on the
fly is quite useful for debugging and doesn't do any harm.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoisdn: avoid races in capidrv
Tilman Schmidt [Tue, 6 Oct 2009 12:18:10 +0000 (12:18 +0000)]
isdn: avoid races in capidrv

In several places, capidrv sends a CAPI message to the ISDN
device and then updates its internal state accordingly.
If the response message from the device arrives before the
state is updated, it may be rejected or processed incorrectly.
Avoid these races by updating the state before emitting the
message.

Impact: bugfix
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Acked-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoisdn: accept CAPI Informational Info values as success
Tilman Schmidt [Tue, 6 Oct 2009 12:18:05 +0000 (12:18 +0000)]
isdn: accept CAPI Informational Info values as success

Info values in the 0x00xx range are defined in the CAPI standard
as "Informational, message processed successfully". Therefore a
CONNECT_B3_CONF message with an Info value in that range should
open an NCCI just as with Info==0.

Impact: minor bugfix
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Acked-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoDocumentation: expand isdn/INTERFACE.CAPI document
Tilman Schmidt [Tue, 6 Oct 2009 12:18:00 +0000 (12:18 +0000)]
Documentation: expand isdn/INTERFACE.CAPI document

- Note that send_message() may be called in interrupt context.
- Describe the storage of CAPI messages and payload data in SKBs.
- Add more details to the description of the _cmsg structure.
- Describe kernelcapi debugging output.

Impact: documentation
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: Bug fix to properly update ethtool tx-checksumming after ethtool -K <ifname...
Ajit Khaparde [Mon, 5 Oct 2009 02:22:19 +0000 (02:22 +0000)]
be2net: Bug fix to properly update ethtool tx-checksumming after ethtool -K <ifname> tx off

This is a fix for a bug which was a result of wrong use of checksum offload flag.
The status of tx-checksumming was not changed from on to off
after a 'ethtool -K <ifname> tx off' operation.
Use the proper checksum offload flag NETIF_F_HW_CSUM instead of
NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM.
Patch is against net-2.6 tree.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: Fix a typo in be_cmds.h
Ajit Khaparde [Mon, 5 Oct 2009 02:22:05 +0000 (02:22 +0000)]
be2net: Fix a typo in be_cmds.h

MCC_STATUS_NOT_SUPPORTED should be decimal 66 not hex 66.
This patch fixes this typo. Patch against net-2.6 tree.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: Bug Fix while accounting of multicast frames during netdev stats update
Ajit Khaparde [Mon, 5 Oct 2009 02:21:51 +0000 (02:21 +0000)]
be2net: Bug Fix while accounting of multicast frames during netdev stats update

While updating the statistics to be passed via the get_stats,
tx multicast frames were being accounted instead of rx multicast frames.
This patch fixes the bug. This patch is against the net-2.6 tree.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Fix lock/mutex warnings.
Ron Mercer [Mon, 5 Oct 2009 11:46:49 +0000 (11:46 +0000)]
qlge: Fix lock/mutex warnings.

Get rid of spinlock and private mutex usage for exclusive access to the
HW semaphore register.  rtnl_lock already creates exclusive access to
this register in all driver API.
Add rtnl to firmware worker threads that also use the HW semaphore register.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Fix queueing of firmware handler in ISR.
Ron Mercer [Mon, 5 Oct 2009 11:46:48 +0000 (11:46 +0000)]
qlge: Fix queueing of firmware handler in ISR.

Check that we are not already polling firmware events before we queue the
firmware event worker, then disable firmware interrupts.
Otherwise we can queue the same event multiple times.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Fix some bit definitions for reset register.
Ron Mercer [Mon, 5 Oct 2009 11:46:47 +0000 (11:46 +0000)]
qlge: Fix some bit definitions for reset register.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoconnector: Fix incompatible pointer type warning
Stephen Boyd [Tue, 6 Oct 2009 08:39:51 +0000 (01:39 -0700)]
connector: Fix incompatible pointer type warning

Commit 7069331 (connector: Provide the sender's credentials to the
callback, 2009-10-02) changed callbacks to take two arguments but missed
this one.

drivers/connector/cn_proc.c: In function ‘cn_proc_init’:
drivers/connector/cn_proc.c:263: warning: passing argument 3 of
‘cn_add_callback’ from incompatible pointer type

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agowext: let get_wireless_stats() sleep
Johannes Berg [Mon, 5 Oct 2009 09:22:23 +0000 (02:22 -0700)]
wext: let get_wireless_stats() sleep

A number of drivers (recently including cfg80211-based ones)
assume that all wireless handlers, including statistics, can
sleep and they often also implicitly assume that the rtnl is
held around their invocation. This is almost always true now
except when reading from sysfs:

  BUG: sleeping function called from invalid context at kernel/mutex.c:280
  in_atomic(): 1, irqs_disabled(): 0, pid: 10450, name: head
  2 locks held by head/10450:
   #0:  (&buffer->mutex){+.+.+.}, at: [<c10ceb99>] sysfs_read_file+0x24/0xf4
   #1:  (dev_base_lock){++.?..}, at: [<c12844ee>] wireless_show+0x1a/0x4c
  Pid: 10450, comm: head Not tainted 2.6.32-rc3 #1
  Call Trace:
   [<c102301c>] __might_sleep+0xf0/0xf7
   [<c1324355>] mutex_lock_nested+0x1a/0x33
   [<f8cea53b>] wdev_lock+0xd/0xf [cfg80211]
   [<f8cea58f>] cfg80211_wireless_stats+0x45/0x12d [cfg80211]
   [<c13118d6>] get_wireless_stats+0x16/0x1c
   [<c12844fe>] wireless_show+0x2a/0x4c

Fix this by using the rtnl instead of dev_base_lock.

Reported-by: Miles Lane <miles.lane@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: Fix a bug in preparation of mcc wrb which was causing flash operation to...
Ajit Khaparde [Mon, 5 Oct 2009 09:09:40 +0000 (02:09 -0700)]
be2net: Fix a bug in preparation of mcc wrb which was causing flash operation to fail

This patch fixes a bug that got introduced in commit 76998bc7.
During preparation of mcc wrb, req was being wrongly overwritten
and the flash operation was failing.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopcnet_cs: add cis of National Semicondoctor's multifunction pcmcia card
Ken Kawasaki [Mon, 5 Oct 2009 07:40:03 +0000 (00:40 -0700)]
pcnet_cs: add cis of National Semicondoctor's multifunction pcmcia card

pcnet_cs,serial_cs:

add cis of National Semicondoctor's lan&modem mulitifunction pcmcia card,
NE2K, tamarack ethernet card,
and some serial card(COMpad2, COMpad4).

Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Support inclusion of <linux/socket.h> before <sys/socket.h>
Ben Hutchings [Mon, 5 Oct 2009 07:24:36 +0000 (00:24 -0700)]
net: Support inclusion of <linux/socket.h> before <sys/socket.h>

The following user-space program fails to compile:

    #include <linux/socket.h>
    #include <sys/socket.h>
    int main() { return 0; }

The reason is that <linux/socket.h> tests __GLIBC__ to decide whether it
should define various structures and macros that are now defined for
user-space by <sys/socket.h>, but __GLIBC__ is not defined if no libc
headers have yet been included.

It seems safe to drop support for libc 5 now.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Bastian Blank <waldi@debian.org>
Signed-off-by: David S. Miller <davem@davemloft.net>