- the register is defined for the 8169 chipset only and there is
no 8169 beyond RTL_GIGA_MAC_VER_06.
- only the lower 3 bytes of the register are valid
tulip: Fix dead 21041 ethernet after ifconfig down
The de2104x did a pci_disable_device() in it's close function, but
the open function never does a pci_enable_device() and assumes that
the device is already enabled. Considering that downing the interface
is just a temporary thing the pci_disable_device() isn't a pretty good
idea and removing it from the close function just fixes the bug.
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Acked-by: Grant Grundler <grundler@parisc-linux.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
David S. Miller [Wed, 24 Sep 2008 03:47:22 +0000 (20:47 -0700)]
aoe: Fix OOPS after SKB queue changes.
Reported by Thomas Graf.
If we don't unlink the SKB from the queue when we send it
out in aoenet_xmit(), dev_hard_start_xmit() will see skb->next
as non-NULL and interpret this to mean the SKB is part of a
GSO segment list.
Add __skb_unlink() call to fix that.
Signed-off-by: David S. Miller <davem@davemloft.net>
pkt_sched: Remove the tx queue state check in qdisc_run()
The current check wrongly uses the state of one (currently the first)
tx queue for all tx queues in case of non-default qdiscs. This check
mainly prevented requeuing loop with __netif_schedule(), but now it's
controlled inside __qdisc_run(), while dequeuing. The wrongness of
this check was first noticed by Herbert Xu.
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
pkt_sched: Check the state of tx_queue in dequeue_skb()
Check in dequeue_skb() the state of tx_queue for requeued skb to save
on locking and re-requeuing, and possibly remove the current check in
qdisc_run(). Based on the idea of Alexander Duyck.
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This patch add support for keeping an additional character alias
associated with an network interface. This is useful for maintaining
the SNMP ifAlias value which is a user defined value. Routers use this
to hold information like which circuit or line it is connected to. It
is just an arbitrary text label on the network device.
There are two exposed interfaces with this patch, the value can be
read/written either via netlink or sysfs.
This could be maintained just by the snmp daemon, but it is more
generally useful for other management tools, and the kernel is good
place to act as an agreed upon interface to store it.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Phonet endpoints are bound to individual ports.
This provides a /proc/sys/net/phonet (or sysctl) interface for
selecting the range of automatically allocated ports (much like the
ip_local_port_range with IPv4).
Signed-off-by: Remi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Herbert Xu [Tue, 23 Sep 2008 02:48:19 +0000 (19:48 -0700)]
ipsec: Fix xfrm_state_walk race
As discovered by Timo Teräs, the currently xfrm_state_walk scheme
is racy because if a second dump finishes before the first, we
may free xfrm states that the first dump would walk over later.
This patch fixes this by storing the dumps in a list in order
to calculate the correct completion counter which cures this
problem.
I've expanded netlink_cb in order to accomodate the extra state
related to this. It shouldn't be a big deal since netlink_cb
is kmalloced for each dump and we're just increasing it by 4 or
8 bytes.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Firmware blob looks like this...
__le16 load_address
unsigned char data[]
[akpm@linux-foundation.org: include vmalloc.h] Signed-off-by: Jaswinder Singh <jaswinder@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Julia Lawall [Tue, 23 Sep 2008 02:24:45 +0000 (19:24 -0700)]
net/atm/lec.c: drop code after return
The break after the return serves no purpose.
Signed-off-by: Julia Lawall <julia@diku.dk> Reviewed-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Julia Lawall [Tue, 23 Sep 2008 02:22:58 +0000 (19:22 -0700)]
drivers/atm: Use DIV_ROUND_UP
The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
(d)) but is perhaps more readable.
In the case of the file drivers/atm/eni.c, I am a little bit suspicious of
the -1 at the end of the affected expression. Please check that that is
what is wanted.
An extract of the semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@haskernel@
@@
#include <linux/kernel.h>
@depends on haskernel@
expression n,d;
@@
(
- (n + d - 1) / d
+ DIV_ROUND_UP(n,d)
|
- (n + (d - 1)) / d
+ DIV_ROUND_UP(n,d)
)
Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Ming Lei [Tue, 23 Sep 2008 02:21:51 +0000 (19:21 -0700)]
hci_usb: replace mb with smp_mb
smp_mb is enough for ordering memory operations among processors,and mb is
more expensive than smp_mb for UP machine, so replace it with smp_mb().
Signed-off-by: Ming Lei <tom.leiming@gmail.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Harvey Harrison [Tue, 23 Sep 2008 02:20:51 +0000 (19:20 -0700)]
net: em_cmp.c use unaligned access helpers
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Use "[%04x:%04x]" for PCI vendor/device IDs to follow the format used by
lspci(8).
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
- Remove noop VFS stubs. The VFS does that on a NULL pointer anyways.
- Fix timer handler prototype to be correct
- Comment ugly SMP race I didn't fix.
Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Harvey Harrison [Tue, 23 Sep 2008 02:16:51 +0000 (19:16 -0700)]
mISDN: annotate iomem pointer and add statics
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Harvey Harrison [Tue, 23 Sep 2008 02:16:20 +0000 (19:16 -0700)]
mISDN: endian annotations for struct zt
Found two possible bugs where the z1 value was used directly without
byteswapping.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
After calling capi_ctr_get, error handling code should call capi_ctr_put.
The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@r@
expression x,E;
statement S;
position p1,p2,p3;
@@
(
if ((x = capi_ctr_get@p1(...)) == NULL || ...) S
|
x = capi_ctr_get@p1(...)
... when != x
if (x == NULL || ...) S
)
<...
if@p3 (...) { ... when != capi_ctr_put(x)
when != if (x) { ... capi_ctr_put(x); ...}
return@p2 ...;
}
...>
(
return x;
|
return 0;
|
x = E
|
E = x
|
capi_ctr_put(x)
)
@exists@
position r.p1,r.p2,r.p3;
expression x;
int ret != 0;
statement S;
@@
* x = capi_ctr_get@p1(...)
<...
* if@p3 (...)
S
...>
* return@p2 \(NULL\|ret\);
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Kaihui Luo [Tue, 23 Sep 2008 02:02:36 +0000 (19:02 -0700)]
netfilter: xt_time gives a wrong monthday in a leap year
The function localtime_3 in xt_time.c gives a wrong monthday in a leap
year after 28th 2. calculating monthday should use the array
days_since_leapyear[] not days_since_year[] in a leap year.
Signed-off-by: Kaihui Luo <kaih.luo@gmail.com> Acked-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Quetchenbach [Sun, 21 Sep 2008 07:21:51 +0000 (00:21 -0700)]
tcp: advertise MSS requested by user
I'm trying to use the TCP_MAXSEG option to setsockopt() to set the MSS
for both sides of a bidirectional connection.
man tcp says: "If this option is set before connection establishment, it
also changes the MSS value announced to the other end in the initial
packet."
However, the kernel only uses the MTU/route cache to set the advertised
MSS. That means if I set the MSS to, say, 500 before calling connect(),
I will send at most 500-byte packets, but I will still receive 1500-byte
packets in reply.
This is a bug, either in the kernel or the documentation.
This patch (applies to latest net-2.6) reduces the advertised value to
that requested by the user as long as setsockopt() is called before
connect() or accept(). This seems like the behavior that one would
expect as well as that which is documented.
I've tried to make sure that things that depend on the advertised MSS
are set correctly.
Signed-off-by: Tom Quetchenbach <virtualphtn@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Duyck [Sun, 21 Sep 2008 05:07:34 +0000 (22:07 -0700)]
multiq: requeue should rewind the current_band
Currently dequeueing a packet and requeueing the same packet will cause a
different packet to be pulled on the next dequeue. This change forces
requeue to rewind the current_band.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ilpo Järvinen [Sun, 21 Sep 2008 04:26:22 +0000 (21:26 -0700)]
tcp: back retransmit_high when it over-estimated
If lost skb is sacked, we might have nothing to retransmit
as high as the retransmit_high is pointing to, so place
it lower to avoid unnecessary walking.
This is mainly for the case where high L'ed skbs gets sacked.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Ilpo Järvinen [Sun, 21 Sep 2008 04:25:52 +0000 (21:25 -0700)]
tcp: don't clear lost_skb_hint when not necessary
Most importantly avoid doing it with cumulative ACK. However,
since we have lost_cnt_hint in the picture as well needing
adjustments, it's not as trivial as dealing with
retransmit_skb_hint (and cannot be done in the all place we
could trivially leave retransmit_skb_hint untouched).
With the previous patch, this should mostly remove O(n^2)
behavior while cumulative ACKs start flowing once rexmit
after a lossy round-trip made it through.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Ilpo Järvinen [Sun, 21 Sep 2008 04:24:49 +0000 (21:24 -0700)]
tcp: remove retransmit_skb_hint clearing from failure
This doesn't much sense here afaict, probably never has. Since
fragmenting and collapsing deal the hints by themselves, there
should be very little reason for the rexmit loop to do that.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Ilpo Järvinen [Sun, 21 Sep 2008 04:21:16 +0000 (21:21 -0700)]
tcp: No need to clear retransmit_skb_hint when SACKing
Because lost counter no longer requires tuning, this is
trivial to remove (the tuning wouldn't have been too
hard either) because no "new" retransmittable skb appeared
below retransmit_skb_hint when SACKing for sure.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Ilpo Järvinen [Sun, 21 Sep 2008 04:20:20 +0000 (21:20 -0700)]
tcp: convert retransmit_cnt_hint to seqno
Main benefit in this is that we can then freely point
the retransmit_skb_hint to anywhere we want to because
there's no longer need to know what would be the count
changes involve, and since this is really used only as a
terminator, unnecessary work is one time walk at most,
and if some retransmissions are necessary after that
point later on, the walk is not full waste of time
anyway.
Since retransmit_high must be kept valid, all lost
markers must ensure that.
Now I also have learned how those "holes" in the
rexmittable skbs can appear, mtu probe does them. So
I removed the misleading comment as well.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 19 Sep 2008 23:13:05 +0000 (16:13 -0700)]
qlge: Fix warnings in debugging code.
drivers/net/qlge/qlge_dbg.c: In function ‘ql_dump_qdev’:
drivers/net/qlge/qlge_dbg.c:369: warning: cast to pointer from integer of different size
drivers/net/qlge/qlge_dbg.c:373: warning: cast to pointer from integer of different size
drivers/net/qlge/qlge_dbg.c: In function ‘ql_dump_tx_ring’:
drivers/net/qlge/qlge_dbg.c:457: warning: format ‘%llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘long unsigned int’
drivers/net/qlge/qlge_dbg.c:461: warning: format ‘%llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘long unsigned int’
drivers/net/qlge/qlge_dbg.c: In function ‘ql_dump_rx_ring’:
drivers/net/qlge/qlge_dbg.c:557: warning: format ‘%llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘long unsigned int’
drivers/net/qlge/qlge_dbg.c:565: warning: format ‘%llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘long unsigned int’
drivers/net/qlge/qlge_dbg.c:575: warning: format ‘%llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘long unsigned int’
drivers/net/qlge/qlge_dbg.c:579: warning: format ‘%llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘long unsigned int’
drivers/net/qlge/qlge_dbg.c:598: warning: format ‘%llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘long unsigned int’
drivers/net/qlge/qlge_dbg.c:602: warning: format ‘%llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘long unsigned int’
Signed-off-by: David S. Miller <davem@davemloft.net>
Benjamin Li [Thu, 18 Sep 2008 23:40:49 +0000 (16:40 -0700)]
bnx2: Remove timer_interval field from the bnx2 structure
The timer_interval field is only assigned once, and never reassigned.
We can safely replace all instances of the timer_interval with a
constant value.
Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Benjamin Li [Thu, 18 Sep 2008 23:40:03 +0000 (16:40 -0700)]
bnx2: Remove name field from bnx2 structure
The name of the board is only used during the initialization of
the adapter. We can save the space of a pointer by not storing
this information.
Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Benjamin Li [Thu, 18 Sep 2008 23:39:16 +0000 (16:39 -0700)]
bnx2: Update MODULE_DESCRIPTION to include the 5716
Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Benjamin Li [Thu, 18 Sep 2008 23:38:24 +0000 (16:38 -0700)]
bnx2: In bnx2_set_mac_link() return void rather then int
bnx2_set_mac_link() doesn't need to return any error codes. And
all the callers don't check the return code. It is safe to
change the return type to a void.
Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
John W. Linville [Mon, 15 Sep 2008 21:25:54 +0000 (17:25 -0400)]
libertas: correct "limited range of data type" warning
CC [M] drivers/net/wireless/libertas/wext.o
drivers/net/wireless/libertas/wext.c: In function ‘lbs_get_rts’:
drivers/net/wireless/libertas/wext.c:307: warning: comparison is always
false due to limited range of data type
Signed-off-by: John W. Linville <linville@tuxdriver.com>
mac80211 : Fix mode change hard_start_xmit function
When monitor mode is changed to BSS or IBSS, data trasnfer can not happen
because proper transmit function is not assigend for BSS ,IBSS mode.
This patch fixes this problem by assigning the ieee80211_subif_start_xmit
to device's hard_start_xmit function.
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Acked-by: Zhu Yi <yi.zhu@intel.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 12 Sep 2008 13:22:53 +0000 (15:22 +0200)]
mac80211: remove debug frame dumping
You can just pull up a monitor interface to get much more
detailed information, or, when debugging a driver, insert
dump code into the driver (which usually you will have to
do anyway to dump the driver-specific information). Hence
this option is useless.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 12 Sep 2008 09:05:39 +0000 (11:05 +0200)]
mac80211: remove beacon counters
The beacon counters mac80211 keeps are only used for debugfs,
unfortunately, they are incorrect for many hardware designs,
namely any design that has a beacon template. Hence, remove the
counters so we don't create the impression they are usable.
This also allows removing the beacon MESH #ifdef again.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 12 Sep 2008 08:18:44 +0000 (10:18 +0200)]
mac80211: clean up kdoc
A few errors sneaked in over time, some functions no longer exist,
for some alternatives exist. This changes the docbook template to
include the right things.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 12 Sep 2008 07:53:27 +0000 (09:53 +0200)]
mac80211: fix sta_info kernel-doc warning
Sorry, forgot to run kernel-doc and just got the output from the nightly
run by email, this fixes a warning which I introduced when doing the
first RC API cleanups.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>