pandora-kernel.git
15 years agodrivers/net: fix sparse warnings: make symbols static
Hannes Eder [Fri, 26 Dec 2008 07:56:45 +0000 (23:56 -0800)]
drivers/net: fix sparse warnings: make symbols static

Fix this sparse warnings:

  drivers/net/3c523.c:350:6: warning: symbol 'alloc586' was not declared. Should it be static?
  drivers/net/cs89x0.c:1029:14: warning: symbol 'reset_chip' was not declared. Should it be static?
  drivers/net/eepro.c:1399:1: warning: symbol 'read_eeprom' was not declared. Should it be static?
  drivers/net/plip.c:1020:5: warning: symbol 'plip_hard_header_cache' was not declared. Should it be static?
  drivers/net/s2io.c:5116:6: warning: symbol 'do_s2io_store_unicast_mc' was not declared. Should it be static?
  drivers/net/smc9194.c:767:12: warning: symbol 'smc_findirq' was not declared. Should it be static?

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net: fix sparse warning: returning void-valued expression
Hannes Eder [Fri, 26 Dec 2008 07:56:04 +0000 (23:56 -0800)]
drivers/net: fix sparse warning: returning void-valued expression

Fix this sparse warning:

  drivers/net/niu.c:8850:2: warning: returning void-valued expression

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net: fix sparse warnings: make do-while a compound statement
Hannes Eder [Fri, 26 Dec 2008 07:55:35 +0000 (23:55 -0800)]
drivers/net: fix sparse warnings: make do-while a compound statement

While at it insert some extra curly braces and fix formatting.

Fix this sparse warnings:

  drivers/net/atp.c:811:8: warning: do-while statement is not a compound statement
  drivers/net/atp.c:813:8: warning: do-while statement is not a compound statement
  drivers/net/atp.c:815:11: warning: do-while statement is not a compound statement
  drivers/net/atp.c:817:11: warning: do-while statement is not a compound statement
  drivers/net/plip.c:642:4: warning: do-while statement is not a compound statement
  drivers/net/plip.c:647:4: warning: do-while statement is not a compound statement
  drivers/net/plip.c:820:4: warning: do-while statement is not a compound statement
  drivers/net/plip.c:825:4: warning: do-while statement is not a compound statement
  drivers/net/starfire.c:886:3: warning: do-while statement is not a compound statement

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net: fix sparse warning: use ANSI-style function declaration
Hannes Eder [Fri, 26 Dec 2008 07:52:57 +0000 (23:52 -0800)]
drivers/net: fix sparse warning: use ANSI-style function declaration

Fix this sparse warning:

  drivers/net/ne.c:932:24: warning: non-ANSI function declaration of function 'init_module'

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoehea: use get_zeroed_page for alignment-sensitive allocation
Nathan Lynch [Mon, 22 Dec 2008 08:42:11 +0000 (08:42 +0000)]
ehea: use get_zeroed_page for alignment-sensitive allocation

With slub debug enabled, I see the following errors and crash with
2.6.28-rc9:

IBM eHEA ethernet device driver (Release EHEA_0095)
ehea: Error in ehea_h_register_rpage_mr: not on pageboundary
ehea: Error in ehea_reg_mr_section: register_rpage_mr failed
ehea: Error in ehea_reg_kernel_mr: registering mr failed
ehea: Error in ehea_setup_ports: creating MR failed
ehea 23c00100.lhea: setup_ports failed
Unable to handle kernel paging request for data at address 0x6b6b6b6b6b6bbdcb
Faulting instruction address: 0xd000000000064a24
cpu 0x0: Vector: 300 (Data Access) at [c0000000740e7190]
    pc: d000000000064a24: .ehea_update_firmware_handles+0x84/0x47c [ehea]
    lr: d00000000006df34: .ehea_probe_adapter+0x35c/0x39c [ehea]
    sp: c0000000740e7410
   msr: 8000000000009032
   dar: 6b6b6b6b6b6bbdcb
 dsisr: 40000000
  current = 0xc000000074233780
  paca    = 0xc0000000008a3300
    pid   = 2046, comm = modprobe
enter ? for help
[c0000000740e74f0d00000000006df34 .ehea_probe_adapter+0x35c/0x39c [ehea]
[c0000000740e75a0c00000000041d5a4 .of_platform_device_probe+0x78/0xb0
[c0000000740e7630c0000000002d8b38 .driver_probe_device+0x13c/0x200
[c0000000740e76c0c0000000002d8c90 .__driver_attach+0x94/0xd8
[c0000000740e7750c0000000002d7d64 .bus_for_each_dev+0x80/0xd8
[c0000000740e7800c0000000002d889c .driver_attach+0x28/0x40
[c0000000740e7880c0000000002d8340 .bus_add_driver+0xd4/0x284
[c0000000740e7920c0000000002d90a0 .driver_register+0xc4/0x198
[c0000000740e79d0c00000000041d45c .of_register_driver+0x4c/0x60
[c0000000740e7a50c000000000020ef8 .ibmebus_register_driver+0x30/0x4c
[c0000000740e7ae0d00000000006e108 .ehea_module_init+0x194/0x208c [ehea]
[c0000000740e7b90c000000000009028 .do_one_initcall+0x90/0x1ac
[c0000000740e7d90c00000000008619c .sys_init_module+0xc4/0x200
[c0000000740e7e30c0000000000084ac syscall_exit+0x0/0x40

(When slub debug is disabled it works fine.)

PAGE_SIZE allocations via slab are not guaranteed to be page-aligned;
use get_zeroed_page for the 'pt' buffer (I don't really know what this
is, only that it is passed to firmware and that the first error
message complains about its alignment).  This allows the system to
boot.

Signed-off-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomlx4_en: Remove pauses module parameters.
Yevgeny Petrilin [Fri, 26 Dec 2008 02:20:13 +0000 (18:20 -0800)]
mlx4_en: Remove pauses module parameters.

They are controlled through Ethtool interface.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomlx4_en: Removed Interrupt moderation module parameters
Yevgeny Petrilin [Fri, 26 Dec 2008 02:19:47 +0000 (18:19 -0800)]
mlx4_en: Removed Interrupt moderation module parameters

They are controlled through Ethtool interface, no need to have two
ways to modify them.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomlx4_en: Removed redundant cq->armed flag
Yevgeny Petrilin [Fri, 26 Dec 2008 02:14:04 +0000 (18:14 -0800)]
mlx4_en: Removed redundant cq->armed flag

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomlx4_en: Removed TX locking when polling TX cq
Yevgeny Petrilin [Fri, 26 Dec 2008 02:13:45 +0000 (18:13 -0800)]
mlx4_en: Removed TX locking when polling TX cq

There is no need to synchronize the polling with the transmit
function. The only place to synchronize is when we process
the cq from the transmit function. Also removed spin_lock_irq,
and using spin_trylock, if somebody else is already processing the cq,
no need to wait for it to finish.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomlx4_en: Memory leak on completion queue free
Yevgeny Petrilin [Fri, 26 Dec 2008 02:13:20 +0000 (18:13 -0800)]
mlx4_en: Memory leak on completion queue free

If port is being destroyed without being activated before,
CQ resources are not freed.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'for-david' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6
David S. Miller [Fri, 26 Dec 2008 02:10:12 +0000 (18:10 -0800)]
Merge branch 'for-david' of git://git./linux/kernel/git/chris/linux-2.6

15 years agomyri10ge: update driver version to 1.4.4-1.395
Brice Goglin [Fri, 26 Dec 2008 02:09:16 +0000 (18:09 -0800)]
myri10ge: update driver version to 1.4.4-1.395

Update myri10ge driver version to 1.4.4-1.395.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomyri10ge: update firmware headers to 1.4.37
Brice Goglin [Fri, 26 Dec 2008 02:08:59 +0000 (18:08 -0800)]
myri10ge: update firmware headers to 1.4.37

Update myri10ge firmware headers to 1.4.37:
* Make each member of the error/cmd enum an initialized one, so there
  is a convenient numerical reference to look for reverse conversion.
* Add new MXGEFW_CMD_RELAX_RXBUFFER_ALIGNMENT command.
* Add new "features" field to mcp_header.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoforcedeth: don't poll NV event 36
Johannes Berg [Fri, 26 Dec 2008 02:07:50 +0000 (18:07 -0800)]
forcedeth: don't poll NV event 36

Polling doesn't seem to be necessary on my hardware, at
least I haven't seen any bad effects testing it a while.
Remove the polling so the CPU doesn't have to wake up a
hundred times per second.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet/appletalk: Remove redundant test
Julia Lawall [Fri, 26 Dec 2008 02:04:51 +0000 (18:04 -0800)]
net/appletalk: Remove redundant test

atif is tested for being NULL twice, with the same effect in each case.  I
have kept the second test, as it seems to fit well with the comment above it.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net/wan: Remove redundant test
Julia Lawall [Fri, 26 Dec 2008 02:03:44 +0000 (18:03 -0800)]
drivers/net/wan: Remove redundant test

arg is checked not to be NULL a few lines before.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net: Remove redundant test
Julia Lawall [Fri, 26 Dec 2008 02:03:28 +0000 (18:03 -0800)]
drivers/net: Remove redundant test

In each case, ap is checked not to be NULL a few lines before.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net/ehea: Remove redundant test
Julia Lawall [Fri, 26 Dec 2008 02:03:09 +0000 (18:03 -0800)]
drivers/net/ehea: Remove redundant test

In each case, vpage is checked not to be NULL just after it is initialized
at the beginning of each loop iteration.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net/au1000_eth.c: Remove redundant test
Julia Lawall [Fri, 26 Dec 2008 02:02:49 +0000 (18:02 -0800)]
drivers/net/au1000_eth.c: Remove redundant test

phydev is checked to be not NULL a few lines above.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: ql_adapter_down() typo
Roel Kluin [Fri, 26 Dec 2008 01:23:50 +0000 (17:23 -0800)]
qlge: ql_adapter_down() typo

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetlink: fix (theoretical) overrun in message iteration
Vegard Nossum [Fri, 26 Dec 2008 01:21:17 +0000 (17:21 -0800)]
netlink: fix (theoretical) overrun in message iteration

See commit 1045b03e07d85f3545118510a587035536030c1c ("netlink: fix
overrun in attribute iteration") for a detailed explanation of why
this patch is necessary.

In short, nlmsg_next() can make "remaining" go negative, and the
remaining >= sizeof(...) comparison will promote "remaining" to an
unsigned type, which means that the expression will evaluate to
true for negative numbers, even though it was not intended.

I put "theoretical" in the title because I have no evidence that
this can actually happen, but I suspect that a crafted netlink
packet can trigger some badness.

Note that the last test, which seemingly has the exact same
problem (also true for nla_ok()), is perfectly OK, since we
already know that remaining is positive.

Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotcp: Always set urgent pointer if it's beyond snd_nxt
Herbert Xu [Fri, 26 Dec 2008 01:12:58 +0000 (17:12 -0800)]
tcp: Always set urgent pointer if it's beyond snd_nxt

Our TCP stack does not set the urgent flag if the urgent pointer
does not fit in 16 bits, i.e., if it is more than 64K from the
sequence number of a packet.

This behaviour is different from the BSDs, and clearly contradicts
the purpose of urgent mode, which is to send the notification
(though not necessarily the associated data) as soon as possible.
Our current behaviour may in fact delay the urgent notification
indefinitely if the receiver window does not open up.

Simply matching BSD however may break legacy applications which
incorrectly rely on the out-of-band delivery of urgent data, and
conversely the in-band delivery of non-urgent data.

Alexey Kuznetsov suggested a safe solution of following BSD only
if the urgent pointer itself has not yet been transmitted.  This
way we guarantee that when the remote end sees the packet with
non-urgent data marked as urgent due to wrap-around we would have
advanced the urgent pointer beyond, either to the actual urgent
data or to an as-yet untransmitted packet.

The only potential downside is that applications on the remote
end may see multiple SIGURG notifications.  However, this would
occur anyway with other TCP stacks.  More importantly, the outcome
of such a duplicate notification is likely to be harmless since
the signal itself does not carry any information other than the
fact that we're in urgent mode.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: Add validity check for SCTP_PARTIAL_DELIVERY_POINT socket option
Wei Yongjun [Fri, 26 Dec 2008 00:59:03 +0000 (16:59 -0800)]
sctp: Add validity check for SCTP_PARTIAL_DELIVERY_POINT socket option

The latest ietf socket extensions API draft said:

  8.1.21.  Set or Get the SCTP Partial Delivery Point

    Note also that the call will fail if the user attempts to set
    this value larger than the socket receive buffer size.

This patch add this validity check for SCTP_PARTIAL_DELIVERY_POINT
socket option.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: Avoid memory overflow while FWD-TSN chunk is received with bad stream ID
Wei Yongjun [Fri, 26 Dec 2008 00:58:11 +0000 (16:58 -0800)]
sctp: Avoid memory overflow while FWD-TSN chunk is received with bad stream ID

If FWD-TSN chunk is received with bad stream ID, the sctp will not do the
validity check, this may cause memory overflow when overwrite the TSN of
the stream ID.

The FORWARD-TSN chunk is like this:

FORWARD-TSN chunk
  Type                       = 192
  Flags                      = 0
  Length                     = 172
  NewTSN                     = 99
  Stream                     = 10000
  StreamSequence             = 0xFFFF

This patch fix this problem by discard the chunk if stream ID is not
less than MIS.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: Implement socket option SCTP_GET_ASSOC_NUMBER
Wei Yongjun [Fri, 26 Dec 2008 00:57:24 +0000 (16:57 -0800)]
sctp: Implement socket option SCTP_GET_ASSOC_NUMBER

Implement socket option SCTP_GET_ASSOC_NUMBER of the latest ietf socket
extensions API draft.

  8.2.5.  Get the Current Number of Associations (SCTP_GET_ASSOC_NUMBER)

   This option gets the current number of associations that are attached
   to a one-to-many style socket.  The option value is an uint32_t.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: Fix a typo in socket.c
Wei Yongjun [Fri, 26 Dec 2008 00:56:45 +0000 (16:56 -0800)]
sctp: Fix a typo in socket.c

Just fix a typo in socket.c.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: Bring SCTP_MAXSEG socket option into ietf API extension compliance
Wei Yongjun [Fri, 26 Dec 2008 00:54:58 +0000 (16:54 -0800)]
sctp: Bring SCTP_MAXSEG socket option into ietf API extension compliance

Brings maxseg socket option set/get into line with the latest ietf socket
extensions API draft, while maintaining backwards compatibility.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: PHYLIB mdio fixes #2
Krzysztof Halasa [Fri, 26 Dec 2008 00:50:41 +0000 (16:50 -0800)]
net: PHYLIB mdio fixes #2

The PHYLIB mdio code has more problems in error paths:
- mdiobus_release can be called before bus->state is set to
  MDIOBUS_REGISTERED
- mdiobus_scan allocates resources which need to be freed
- the comment is wrong, the resistors used are actually pull-ups.

Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovlan: fix convertion to net_device_ops
Eric Dumazet [Fri, 26 Dec 2008 00:45:19 +0000 (16:45 -0800)]
vlan: fix convertion to net_device_ops

commit 656299f706e52e0409733d704c2761f1b12d6954
(vlan: convert to net_device_ops) added a net_device_ops
with a NULL ndo_start_xmit field.

This gives a crash in dev_hard_start_xmit()

Fix it using two net_device_ops structures, one for hwaccel vlan,
one for non hwaccel vlan.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmsc911x: fix platform resource call during module unload
Steve Glendinning [Fri, 26 Dec 2008 00:44:01 +0000 (16:44 -0800)]
smsc911x: fix platform resource call during module unload

This patch fixes a typo, the platform_get_resource calls in
smsc911x_drv_remove are supposed to look the same as those in
smsc911x_drv_probe.

Reported and fixed by dfoley@telus.net.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmsc911x: don't clobber driver_data
Steve Glendinning [Fri, 26 Dec 2008 00:43:34 +0000 (16:43 -0800)]
smsc911x: don't clobber driver_data

smsc911x uses driver_data to store our net_device, don't overwrite this
with the mii_bus.

Reported and fixed by dfoley@telus.net.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetns: igmp: make /proc/net/{igmp,mcfilter} per netns
Alexey Dobriyan [Fri, 26 Dec 2008 00:42:51 +0000 (16:42 -0800)]
netns: igmp: make /proc/net/{igmp,mcfilter} per netns

This patch makes the followinf proc entries per-netns:
/proc/net/igmp
/proc/net/mcfilter

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Acked-by: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetns: igmp: allow IPPROTO_IGMP sockets in netns
Alexey Dobriyan [Fri, 26 Dec 2008 00:42:23 +0000 (16:42 -0800)]
netns: igmp: allow IPPROTO_IGMP sockets in netns

Looks like everything is already ready.

Required for ebtables(8) for one thing.

Also, required for ipmr per-netns (coming soon). (Benjamin)

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmsc911x: make smsc911x_ethtool_ops constant
Steve Glendinning [Fri, 26 Dec 2008 00:41:09 +0000 (16:41 -0800)]
smsc911x: make smsc911x_ethtool_ops constant

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmsc911x: convert driver to use net_device_ops
Steve Glendinning [Fri, 26 Dec 2008 00:40:47 +0000 (16:40 -0800)]
smsc911x: convert driver to use net_device_ops

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmsc911x: fix BUG if module is removed while interface is up
Steve Glendinning [Fri, 26 Dec 2008 00:40:19 +0000 (16:40 -0800)]
smsc911x: fix BUG if module is removed while interface is up

If the module is removed while its interface is up, smsc911x_stop is not
called until after smsc911x_drv_remove has disposed of phy_dev.  This
patch changes the stop method to handle this situation.

This is a different problem to the one reported by dfoley@telus.net.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Wed, 24 Dec 2008 01:56:23 +0000 (17:56 -0800)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

Conflicts:

drivers/net/ppp_generic.c

15 years agonet: Remove unused netdev arg from some NAPI interfaces.
Neil Horman [Tue, 23 Dec 2008 04:43:12 +0000 (20:43 -0800)]
net: Remove unused netdev arg from some NAPI interfaces.

When the napi api was changed to separate its 1:1 binding to the net_device
struct, the netif_rx_[prep|schedule|complete] api failed to remove the now
vestigual net_device structure parameter.  This patch cleans up that api by
properly removing it..

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: startup race in hso driver
Oliver Neukum [Thu, 18 Dec 2008 03:57:35 +0000 (03:57 +0000)]
net: startup race in hso driver

The flag marking a device running must be set before the URBs for
recption are submitted or they may complete too early and fail to resubmit.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopkt_sched: Remove smp_wmb() in qdisc_watchdog()
Jarek Poplawski [Tue, 23 Dec 2008 03:44:13 +0000 (19:44 -0800)]
pkt_sched: Remove smp_wmb() in qdisc_watchdog()

While implementing a TCQ_F_THROTTLED flag there was used an smp_wmb()
in qdisc_watchdog(), but since this flag is practically used only in
sch_netem(), and since it's not even clear what reordering is avoided
here (TCQ_F_THROTTLED vs. __QDISC_STATE_SCHED?) it seems the barrier
could be safely removed.

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agor6040: bump release number to 0.19
Florian Fainelli [Tue, 23 Dec 2008 03:40:38 +0000 (19:40 -0800)]
r6040: bump release number to 0.19

This patch bumps the release number of the driver.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agor6040: save and restore MIER correctly in the interrupt routine
Joe Chou [Tue, 23 Dec 2008 03:40:02 +0000 (19:40 -0800)]
r6040: save and restore MIER correctly in the interrupt routine

This patch saves the MIER register contents before treating
interrupts, then restores them correcty at the end of the
interrupt routine.

Signed-off-by: Joe Chou <Joe.Chou@rdc.com.tw>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agor6040: fix wrong logic in mdio code
Joe Chou [Tue, 23 Dec 2008 03:38:17 +0000 (19:38 -0800)]
r6040: fix wrong logic in mdio code

This patch fixes a reverse logic in the MDIO code.

Signed-off-by: Joe Chou <Joe.Chou@rdc.com.tw>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Fix oops in dev_ifsioc()
Jarek Poplawski [Tue, 23 Dec 2008 03:35:28 +0000 (19:35 -0800)]
net: Fix oops in dev_ifsioc()

A command like this: "brctl addif br1 eth1" issued as a user gave me
an oops when bridge module wasn't loaded. It's caused by using a dev
pointer before checking for NULL.

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotg3: Update version to 3.97
Matt Carlson [Mon, 22 Dec 2008 04:21:52 +0000 (20:21 -0800)]
tg3: Update version to 3.97

This patch updates the version number to 3.97.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotg3: tg3.h cleanups
Matt Carlson [Mon, 22 Dec 2008 04:21:18 +0000 (20:21 -0800)]
tg3: tg3.h cleanups

This patch cleans up the tg3 header file by removing the preprocessor
definitions for standard PCI configuration space registers.  The driver
should be using the standard definitions when needed.  The patch
continues by removing redundant PHY related definitions and reorganizes
some of the remaining entries.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotg3: Remove unused cfgspc device members
Matt Carlson [Mon, 22 Dec 2008 04:19:57 +0000 (20:19 -0800)]
tg3: Remove unused cfgspc device members

This patch removes the pci_bist and pci_hdr_type members from the
device structure and removes the code that references them.  They are
not really used.

The patch rounds out the changes by moving the pci_cmd member to plug
a structure hole that would have been created.  On 32-bit systems, this
movement removes a subsequent structure hole later in the structure. On
64-bit systems though, the movement merely consolidates two holes into
one larger hole.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotg3: Cleanup IPV6 LSO
Matt Carlson [Mon, 22 Dec 2008 04:19:30 +0000 (20:19 -0800)]
tg3: Cleanup IPV6 LSO

This patch attempts to make the relationship between IPV6 checksum
offload and IPV6 LSO more obvious.  The patch also toggles a bit
needed for IPV6 LSO on 5785 and 57780 devices.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotg3: WOL fixes
Matt Carlson [Mon, 22 Dec 2008 04:18:56 +0000 (20:18 -0800)]
tg3: WOL fixes

The first hunk of this patch inverts a flag that was accidentally
toggled as part of commit 0a459aac9d151c2e36ec65723b9b845b24c5cbc3
("tg3: Allow WOL for phylib controlled Broadcom phys").

The second hunk of the patch removes the call to
device_may_wakeup() in the 5906 config detection path.  At the
point of the call, the driver shouldn't be querying for WOL
capability.  It should be detecting and setting it.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopkt_sched: Annotate uninitialized var in sfq_enqueue()
Jarek Poplawski [Mon, 22 Dec 2008 04:14:48 +0000 (20:14 -0800)]
pkt_sched: Annotate uninitialized var in sfq_enqueue()

Some gcc versions warn that ret may be used uninitialized in
sfq_enqueue(). It's a false positive, so let's annotate this.

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: fix the display of DCB control stats in ethtool
Don Skidmore [Mon, 22 Dec 2008 04:11:04 +0000 (20:11 -0800)]
ixgbe: fix the display of DCB control stats in ethtool

Priority flow contol statistics for Data Center Bridging (DCB) weren't
included in ethtool.  This patch adds them.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Eric W Multanen <eric.w.multanen@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: add DCNA attribute to the BCN interface for DCB
Don Skidmore [Mon, 22 Dec 2008 04:10:29 +0000 (20:10 -0800)]
net: add DCNA attribute to the BCN interface for DCB

Adds the Backward Congestion Notification Address (BCNA) attribute to the
Backward Congestion Notification (BCN) interface for Data Center Bridging
(DCB), which was missing.  Receive the BCNA attribute in the ixgbe driver.
The BCNA attribute is for a switch to inform the endstation about the physical
port identification in order to support BCN on aggregated links.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Eric W Multanen <eric.w.multanen@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
15 years agonet: fix DCB setstate to return success/failure
Don Skidmore [Mon, 22 Dec 2008 04:09:50 +0000 (20:09 -0800)]
net: fix DCB setstate to return success/failure

Data Center Bridging (DCB) had no way to know if setstate had failed in the
driver.  This patch enables dcb netlink code to handle the status for the DCB
setstate interface.  Likewise it allows the driver to return a failed status
if MSI-X isn't enabled.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Eric W Multanen <eric.w.multanen@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Mon, 22 Dec 2008 03:57:10 +0000 (19:57 -0800)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-next-2.6

15 years agoConvert ixp4xx_eth driver to use net_device_ops.
Krzysztof Hałasa [Mon, 22 Dec 2008 01:00:17 +0000 (02:00 +0100)]
Convert ixp4xx_eth driver to use net_device_ops.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
15 years agodrivers/net/wan: Remove redundant test
Julia Lawall [Sun, 21 Dec 2008 15:39:15 +0000 (16:39 +0100)]
drivers/net/wan: Remove redundant test

arg is checked not to be NULL a few lines before.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
15 years agoHDLC_PPP: Fix Configure-Ack to return original options as required by the standard.
Krzysztof Hałasa [Wed, 26 Nov 2008 22:06:57 +0000 (23:06 +0100)]
HDLC_PPP: Fix Configure-Ack to return original options as required by the standard.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
15 years agoIXP4xx: move common debugging from network drivers to QMGR module.
Krzysztof Hałasa [Sun, 21 Dec 2008 23:26:38 +0000 (00:26 +0100)]
IXP4xx: move common debugging from network drivers to QMGR module.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
15 years agoUpdate MAINTAINERS entries for IXP4xx and WAN network drivers.
Krzysztof Hałasa [Sun, 21 Dec 2008 22:52:36 +0000 (23:52 +0100)]
Update MAINTAINERS entries for IXP4xx and WAN network drivers.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
15 years agoWAN: Add IXP4xx HSS HDLC driver.
Krzysztof Hałasa [Sun, 21 Dec 2008 22:52:18 +0000 (23:52 +0100)]
WAN: Add IXP4xx HSS HDLC driver.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
15 years agoIXP4xx: Add ethtool support to Ethernet driver.
Krzysztof Hałasa [Sat, 20 Dec 2008 23:02:34 +0000 (00:02 +0100)]
IXP4xx: Add ethtool support to Ethernet driver.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
15 years agoIXP4xx: Add PHYLIB MII ioctl to the Ethernet driver.
Krzysztof Hałasa [Sat, 20 Dec 2008 17:57:23 +0000 (18:57 +0100)]
IXP4xx: Add PHYLIB MII ioctl to the Ethernet driver.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
15 years agoIXP4xx: Add PHYLIB support to Ethernet driver.
Krzysztof Hałasa [Sat, 20 Dec 2008 00:53:08 +0000 (01:53 +0100)]
IXP4xx: Add PHYLIB support to Ethernet driver.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
15 years agoIXP4xx: Make the Ethernet driver use built-in netdev stats.
Krzysztof Hałasa [Sat, 20 Dec 2008 00:58:59 +0000 (01:58 +0100)]
IXP4xx: Make the Ethernet driver use built-in netdev stats.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
15 years agoIXP4xx: Silence section mismatch warning in Ethernet driver.
Krzysztof Hałasa [Wed, 26 Nov 2008 21:59:18 +0000 (22:59 +0100)]
IXP4xx: Silence section mismatch warning in Ethernet driver.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
15 years agoIXP4xx: clear IRQ stat in qmgr_disable_irq().
Krzysztof Hałasa [Fri, 9 May 2008 00:14:09 +0000 (02:14 +0200)]
IXP4xx: clear IRQ stat in qmgr_disable_irq().

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
15 years agoIXP4xx: check for queue being empty in qmgr_release_queue().
Krzysztof Hałasa [Thu, 8 May 2008 21:18:31 +0000 (23:18 +0200)]
IXP4xx: check for queue being empty in qmgr_release_queue().

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
15 years agob43: Add key memory dumping
Michael Buesch [Fri, 19 Dec 2008 19:24:30 +0000 (20:24 +0100)]
b43: Add key memory dumping

This adds an option to dump all crypto related memory to
the kernel log.
Obviously, it should not be enabled on productive systems. ;)

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agob43: Suspend MAC while killing the radio
Michael Buesch [Fri, 19 Dec 2008 17:40:00 +0000 (18:40 +0100)]
b43: Suspend MAC while killing the radio

We should suspend the MAC, before we kill the radio. This gives
the MAC a chance to leave any TX/RX state and it avoids races on
the PHY/RADIO registers.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: correct packet length in tx descriptors
Bob Copeland [Fri, 19 Dec 2008 04:23:05 +0000 (23:23 -0500)]
ath5k: correct packet length in tx descriptors

Packet length calculation (which includes frame check sequence)
should take into account whether we add a pad field or not.
Extract the calculation into a helper and use it in both places.

Changes to desc.c
Changes-licensed-under: ISC

Changes to ath5k.h, base.c
Changes-licensed-under: 3-Clause-BSD

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: implement dynamic power save
Kalle Valo [Thu, 18 Dec 2008 21:35:27 +0000 (23:35 +0200)]
mac80211: implement dynamic power save

This patch implements dynamic power save for mac80211. Basically it
means enabling power save mode after an idle period. Implementing it
dynamically gives a good compromise of low power consumption and low
latency. Some hardware have support for this in firmware, but some
require the host to do it.

The dynamic power save is implemented by adding an timeout to
ieee80211_subif_start_xmit(). The timeout can be enabled from userspace
with Wireless Extensions. For example, the command below enables the
dynamic power save and sets the time timeout to 500 ms:

iwconfig wlan0 power timeout 500m

Power save now only works with devices which handle power save in firmware.
It's also disabled by default and the heuristics when and how to enable is
considered as a policy decision and will be left for the userspace to handle.
In case the firmware has support for this, drivers can disable this feature
with IEEE80211_HW_NO_STACK_DYNAMIC_PS.

Big thanks to Johannes Berg for the help with the design and code.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: track master queue status
Kalle Valo [Thu, 18 Dec 2008 21:35:20 +0000 (23:35 +0200)]
mac80211: track master queue status

This is a preparation for the dynamic power save support. In future there are
two paths to stop the master queues and we need to track this properly to
avoid starting queues incorrectly. Implement this by adding a status
array for each queue.

The original idea and design is from Johannes Berg, I just did
the implementation based on his notes. All the bugs are mine, of course.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: enable IEEE80211_CONF_PS only when associated
Kalle Valo [Thu, 18 Dec 2008 21:35:13 +0000 (23:35 +0200)]
mac80211: enable IEEE80211_CONF_PS only when associated

Also disable power save when disassociated. It makes no sense to have
power save enabled while disassociated.

iwlwifi seems to have this check in the driver, but it's better to do this
in mac80211 instead.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agob43: Fix some MAC locking
Michael Buesch [Thu, 18 Dec 2008 21:13:39 +0000 (22:13 +0100)]
b43: Fix some MAC locking

This fixes some locking w.r.t. the lower MAC (firmware).
It also removes a lot of ancient IRQ-locking that's not needed anymore.
We simply suspend the MAC. That's easier and causes less trouble.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: iwl-tx.c cleanup (remove unused parameter and unused local variable).
Rami Rosen [Thu, 18 Dec 2008 16:04:51 +0000 (18:04 +0200)]
iwlwifi: iwl-tx.c cleanup (remove unused parameter and unused local variable).

This patch removes unused parameter and unused local variable in
methods in iwl-tx.c:

- Remove a parameter (is_unicast) from iwl_tx_cmd_build_basic().

- Remove an unused variable name unicast from iwl_tx_skb().

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fixed RX decryption status reporting
Jouni Malinen [Thu, 18 Dec 2008 12:33:00 +0000 (14:33 +0200)]
ath9k: Fixed RX decryption status reporting

The RX code in ath9k uses sc_keymap to figure out whether a default
key was used. However, the default key entries in sc_keymap were
always set and as such, frames could have been claimed to be decrypted
by hardware when they were not. This can cause problems especially
with TKIP since mac80211 is validating the Michael MIC in the frame
and this will result in MIC failure and potentially TKIP
countermeasures if the frame was not decrypted correctly.

Change key cache slot allocation to mark only the keys that really
have been used in sc_keymap to avoid the issue. The key cache slot
selection routines are now internally avoiding the slots that may be
needed for TKIP group keys.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fix key cache slot selection for splitmic
Jouni Malinen [Thu, 18 Dec 2008 12:31:10 +0000 (14:31 +0200)]
ath9k: Fix key cache slot selection for splitmic

ath_reserve_key_cache_slot() was obviously supposed to return an index
to a free slot, not reserved one. This could have caused problems with
hardware revisions that use splitmic.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Protect config() callback with a mutex
Sujith [Thu, 18 Dec 2008 06:10:16 +0000 (11:40 +0530)]
ath9k: Protect config() callback with a mutex

This should fix the timeout issues seen when using wpa_supplicant.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: Print unknown packet type in tasklet_handler
Larry Finger [Wed, 17 Dec 2008 20:26:59 +0000 (14:26 -0600)]
mac80211: Print unknown packet type in tasklet_handler

In stress testing p54usb, the WARN_ON() in ieee80211_tasklet_handler() was
triggered; however, there is no logging of the received value for packet
type. Adding that feature will improve the warning.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54usb: bring first generation devices back to life
Christian Lamparter [Wed, 17 Dec 2008 11:04:43 +0000 (12:04 +0100)]
p54usb: bring first generation devices back to life

This patch fixes a serious regression (introduced by:
"p54: fix memory management")
that affected isl3886+net2280 usb devices operation.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Tested-by: Artur Skawina <art.08.09@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Key cache allocation for AP mode
Jouni Malinen [Wed, 17 Dec 2008 11:32:17 +0000 (13:32 +0200)]
ath9k: Key cache allocation for AP mode

Enhance allocation of key cache entries to support multiple pairwise
keys to fix AP mode with more than one associated STA.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fix a NULL pointer dereference in ath_rate_get
Jouni Malinen [Wed, 17 Dec 2008 11:30:31 +0000 (13:30 +0200)]
ath9k: Fix a NULL pointer dereference in ath_rate_get

It looks like mac80211 may try to send unicast frames to a STA that
does not have a STA entry. We need to make sure that that is caught in
the rate control code before dereferencing STA data.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: indicate txpower is off in sysfs
Jay Sternberg [Wed, 17 Dec 2008 08:52:34 +0000 (16:52 +0800)]
iwlwifi: indicate txpower is off in sysfs

The patch checks if the radio is disabled before displaying the tx power
level. Previously when the txpower was set off show_tx_power still
returned the prior power level. Now it will indicate the power has been
turned off.

Signed-off-by: Jay Sternberg <jay.e.sternberg@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: use GFP_KERNEL to allocate Rx SKB memory
Zhu Yi [Wed, 17 Dec 2008 08:52:33 +0000 (16:52 +0800)]
iwlwifi: use GFP_KERNEL to allocate Rx SKB memory

Previously we allocate Rx SKB with GFP_ATOMIC flag. This is because we need
to hold a spinlock to protect the two rx_used and rx_free lists operation
in the rxq.

spin_lock();
...
element = rxq->rx_used.next;
element->skb = alloc_skb(..., GFP_ATOMIC);
list_del(element);
list_add_tail(&element->list, &rxq->rx_free);
...
spin_unlock();

After spliting the rx_used delete and rx_free insert into two operations,
we don't require the skb allocation in an atomic context any more (the
function itself is scheduled in a workqueue).

spin_lock();
...
element = rxq->rx_used.next;
list_del(element);
...
spin_unlock();
...
element->skb = alloc_skb(..., GFP_KERNEL);
...
spin_lock()
...
list_add_tail(&element->list, &rxq->rx_free);
...
spin_unlock();

This patch should fix the "iwlagn: Can not allocate SKB buffers" warning
we see recently.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: use meaningful vars in _iwl_poll_bit()
Wu, Fengguang [Wed, 17 Dec 2008 08:52:32 +0000 (16:52 +0800)]
iwlwifi: use meaningful vars in _iwl_poll_bit()

Rename vars in _iwl_poll_bit() to better reflect the truth.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: remove useless goto
Wu Fengguang [Wed, 17 Dec 2008 08:52:31 +0000 (16:52 +0800)]
iwlwifi: remove useless goto

The patch removes some useless goto in code cleanup.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: use type uint for module param debug
Wu, Fengguang [Wed, 17 Dec 2008 08:52:30 +0000 (16:52 +0800)]
iwlwifi: use type uint for module param debug

This enables one to change the debug level at bit 31.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: update comments on the debug interface
Wu, Fengguang [Wed, 17 Dec 2008 08:52:29 +0000 (16:52 +0800)]
iwlwifi: update comments on the debug interface

Bring up-to-date some comments on the location of debug files.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: add line feed to printk
Wu, Fengguang [Wed, 17 Dec 2008 08:52:28 +0000 (16:52 +0800)]
iwlwifi: add line feed to printk

This adds line feed to printk.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: cleanup iwl-dev.h
Winkler, Tomas [Wed, 17 Dec 2008 08:52:27 +0000 (16:52 +0800)]
iwlwifi: cleanup iwl-dev.h

The patch removes unused definition and moves code to proper places.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: fix a typo in ieee80211_send_assoc() method.
Rami Rosen [Tue, 16 Dec 2008 20:38:29 +0000 (22:38 +0200)]
mac80211: fix a typo in ieee80211_send_assoc() method.

This patch fixes a typo in ieee80211_send_assoc(), net/mac80211/mlme.c.

The error is usage of a wrong member when building
the ie80211 management frame (it should be assoc_req, and not reassoc_req).

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: remove a parameter (dest) from *_fill_beacon_frame() methods.
Rami Rosen [Tue, 16 Dec 2008 07:37:07 +0000 (09:37 +0200)]
iwlwifi: remove a parameter (dest) from *_fill_beacon_frame() methods.

This patch removes a parameter (dest) from iwl_fill_beacon_frame() (iwl-agn.c)
 and from iwl3945_fill_beacon_frame(). (iwl-3945.c,iwl-3945.h)

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Move rate control alg register/unregister to appropriate place
Vasanthakumar Thiagarajan [Tue, 16 Dec 2008 07:07:38 +0000 (12:37 +0530)]
ath9k: Move rate control alg register/unregister to appropriate place

This patch makes sure the rate control alg is registered/unregistered
only once for this module.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Synchronize DMA transfer with CPU at right place
Vasanthakumar Thiagarajan [Mon, 15 Dec 2008 15:10:46 +0000 (20:40 +0530)]
ath9k: Synchronize DMA transfer with CPU at right place

This patch does pci_dma_sync_single_for_cpu() before accessing
the header of the frame and queueing the same buffer into h/w.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Remove MAC header pad before reporting TX status
Jouni Malinen [Mon, 15 Dec 2008 14:02:04 +0000 (16:02 +0200)]
ath9k: Remove MAC header pad before reporting TX status

Remove the possible MAC header pad before reporting TX status to
mac80211. This pad is hardware specific operation and should not be
exposed outside the driver. This fixes the frame body in monitor
interfaces that could be used to check on TX status for transmitted
frames.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fix TX status reporting for retries and MCS index
Jouni Malinen [Mon, 15 Dec 2008 13:44:53 +0000 (15:44 +0200)]
ath9k: Fix TX status reporting for retries and MCS index

The count field in struct ieee80211_tx_rate does not include the final
successful attempt, so only report retries here.

Fix the struct ieee80211_tx_rate::idx field when MCS was used. It is
supposed to be the MCS index, not an internal index to the rate
control algorithm table.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: Remove radiotap rate-present flag for HT
Jouni Malinen [Mon, 15 Dec 2008 08:37:50 +0000 (10:37 +0200)]
mac80211: Remove radiotap rate-present flag for HT

Since we do not currently report HT rates (MCS index) in radiotap
header for HT rates, we should not claim the rate is present. The rate
octet itself is used as padding in this case, so only the it_present
flag needs to be removed in case of HT rates.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agortl8187: Fix crash on unload when using SLUB debug
Herton Ronaldo Krzesinski [Sun, 14 Dec 2008 18:18:09 +0000 (12:18 -0600)]
rtl8187: Fix crash on unload when using SLUB debug

Reported-by: Hin-Tak Leung <htl10@users.sourceforge.net>
After the code was modified to use urb anchors ("rtl8187: Use usb anchor
facilities to manage urbs"), rtl8187 began generating an intermittent GPF
on shutdown when using SLUB with debugging enabled. Furthermore, rebooting
the system with a ping running caused a GPF every time. There are two problems:
(1) incorrect locking in the rtl8187_rx_cb() routine, a pre-existing bug that
apparently had not been triggered before, and (2) duplicate freeing of receive
skbs that was probably introduced with the change to anchors.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Tested-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: remove free_on_tx parameter
Christian Lamparter [Sun, 14 Dec 2008 14:05:42 +0000 (15:05 +0100)]
p54: remove free_on_tx parameter

This patch simplifies the tx code a bit and will be necessary for
the upcoming stlc45xx<->p54 port.

In detail: we no longer have to tell all back-end drivers directly,
if we want to free a frame right after it was send to the firmware,
or if we do it in the library callback later.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: more accurate rssi to dBm conversion
Christian Lamparter [Sun, 14 Dec 2008 13:45:30 +0000 (14:45 +0100)]
p54: more accurate rssi to dBm conversion

This patch replaces the static rssi auto calibration data
with more precise values out of the device's eeprom.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>