GitHub/exynos8895/android_kernel_samsung_universal8895.git
15 years agowimax/i2400m: fix reboot echo/ack barker deadlock
Inaky Perez-Gonzalez [Fri, 4 Sep 2009 21:50:59 +0000 (14:50 -0700)]
wimax/i2400m: fix reboot echo/ack barker deadlock

The i2400m based devices can get in a sort of a deadlock some times;
when they boot, they send a reboot "barker" (a magic number) and then
the driver has to echo that same barker to ack reception
(echo/ack). Then the device does a final ack by sending an ACK barker.

The first time this happens, we don't know ahead of time with barker
the device is going to send, as different device models and SKUs will
send different barker depending on the EEPROM programming.

If the device has sent the barker before the driver has been able to
read it, the driver looses, as it doesn't know which barker it has to
echo/ack back. With older devices, we tried a couple of combinations
and that always worked; but now, with adding support for more, in
which we have an unlimited number of new barkers, that is not an
option.

So we rework said case so that when the device gets stuck, we just
cycle through all the known types until one forces the device to send
an ack. Otherwise, the driver gives up and aborts.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: retry loading firmware files in sequence
Inaky Perez-Gonzalez [Thu, 3 Sep 2009 22:53:30 +0000 (15:53 -0700)]
wimax/i2400m: retry loading firmware files in sequence

The i2400m firmware loader is given a list of firmware files to try to
load by the probe() function (which can be different based on the
device's model / generation).

Current code didn't attempt to load, check and try to boot with each
file, but just to try to load if off disk. This is limiting in some
cases, where we might want to try to load a firmware and if it fails
to load onto the device, just fall back to another one.

This changes the behaviour so all files are tried for being loaded
from disk, checked and uploaded to the device until one suceeds in
bringing the device up.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: rework bootrom initialization to be more flexible
Inaky Perez-Gonzalez [Thu, 3 Sep 2009 22:14:29 +0000 (15:14 -0700)]
wimax/i2400m: rework bootrom initialization to be more flexible

This modifies the bootrom initialization code of the i2400m driver so
it can more easily support upcoming hardware.

Currently, the code detects two types of barkers (magic numbers) sent
by the device to indicate the types of firmware it would take (signed
vs non-signed).

This schema is extended so that multiple reboot barkers are
recognized; upcoming hw will expose more types barkers which will have
to match a header in the firmware image before we can load it.

For that, a barker database is introduced; the first time the device
sends a barker, it is matched in the database. That gives the driver
the information needed to decide how to upload the firmware and which
types of firmware to use. The database can be populated from module
parameters.

The execution flow is not altered; a new function
(i2400m_is_boot_barker) is introduced to determine in the RX path if
the device has sent a boot barker. This function is becoming heavier,
so it is put away from the hot reception path [this is why there is
some reorganization in sdio-rx.c:i2400ms_rx and
usb-notifc.c:i2400mu_notification_grok()].

The documentation on the process has also been updated.

All these modifications are heavily based on previous work by Dirk
Brandewie <dirk.brandewie@intel.com>.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: decide properly if using signed vs non-signed firmware loading
Inaky Perez-Gonzalez [Thu, 3 Sep 2009 22:56:40 +0000 (15:56 -0700)]
wimax/i2400m: decide properly if using signed vs non-signed firmware loading

The i2400m based devices can boot two main types of firmware images:
signed and non-signed. Signed images have signature data included that
must match that of a certificate stored in the device.

Currently the code is making the decission on what type of firmware
load (signed vs non-signed) is going to be loaded based on a hardcoded
decission in __i2400m_ack_verify(), based on the barker the device
sent upon boot.

This is not flexible enough as future hardware will emit more barkers;
thus the bit has to be set in a place where there is better knowledge
of what is going on. This will be done in follow-up commits -- however
this patch paves the way for it.

So the querying of the mode is packed into i2400m_boot_is_signed();
the main changes are just using i2400m_boot_is_signed() to determine
the method to follow and setting i2400m->sboot in
i2400m_is_boot_barker(). The modifications in i2400m_dnload_init() and
i2400m_dnload_finalize() are just reorganizing the order of the if
blocks and thus look larger than they really are.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: workaround not-so-working %zd printf format
Inaky Perez-Gonzalez [Wed, 2 Sep 2009 22:41:23 +0000 (15:41 -0700)]
wimax/i2400m: workaround not-so-working %zd printf format

The kernel's %zd modifier does not really work. Use %ld (has to cast
ssize_t to long).

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax: allow specifying debug levels as command line option
Inaky Perez-Gonzalez [Wed, 2 Sep 2009 22:36:05 +0000 (15:36 -0700)]
wimax: allow specifying debug levels as command line option

Add "debug" module options to all the wimax modules (including
drivers) so that the debug levels can be set upon kernel boot or
module load time.

This is needed as currently there was a limitation where the debug
levels could only be set when a device was succesfully
enumerated. This made it difficult to debug issues that made a device
not probe properly.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: add missing debug submodule definition
Inaky Perez-Gonzalez [Wed, 2 Sep 2009 22:31:48 +0000 (15:31 -0700)]
wimax/i2400m: add missing debug submodule definition

The i2400m driver was missing the definition for the sysfs debug
level, which is declared in debug-levels.h.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: during probe, call sdio_disable at most once
Inaky Perez-Gonzalez [Tue, 1 Sep 2009 00:57:56 +0000 (17:57 -0700)]
wimax/i2400m: during probe, call sdio_disable at most once

In the Intel Wireless Multicomm 3200, the initialization is
orchestrated by a component called Top. This component also monitors
how many times a function is reset (via sdio_disable) to detect
possible issues and will reset the whole multifunction device if any
function triggers a maximum reset level.

During WiMAX's probe, the driver needs to wait for Top to come up
before it can enable the WiMAX function. If it cannot, it will return
-ENODEV and the Top driver will rescan the SDIO bus once done
loading.

Currently, the WiMAX SDIO probe routine was trying a few times before
returning -ENODEV, and this was triggering Top's too-many-resets
detector. This is, in any case, unnecessary because the Top driver will
force the bus rescan when the functions can be probed successfully.

Added then a maxtries argument to i2400ms_enable_func() and set it to
1 when calling from probe. We want to reuse this function instead of
flat calling out sdio_enable_func() to take advantage of hardware
quirk workarounds.

Reported-by: Cindy H Kao <cindy.h.kao@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: don't write to memory allocated by request_firmware()
Cindy H Kao [Wed, 19 Aug 2009 02:27:18 +0000 (19:27 -0700)]
wimax/i2400m: don't write to memory allocated by request_firmware()

In kernel 2.6.31, the firmware requested to ram could be marked
with read only attribute, and we can't write any thing directly
to the memory when setting up the last JUMP brh cmd.

Changed so that the scratch buffer is used.

Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: be smarter about copying command buffer to bm_cmd_buf
Inaky Perez-Gonzalez [Tue, 1 Sep 2009 00:15:49 +0000 (17:15 -0700)]
wimax/i2400m: be smarter about copying command buffer to bm_cmd_buf

Because some underlying bus APIs (like USB) don't like data buffers in
the stack or vmalloced areas, the i2400m driver provides a scratch
buffer (i2400m->bm_cmd_buf) for said low-level drivers to copy command
data to before passing it to said API. This is only used during boot
mode.

However, at some the code was copying the buffer even when the command
was already specified in said buffer. This is ok, but it needs to be
more careful. As thus, change so that:

(a) the copy happens only if command buffer is not the scratch buffer

(b) use memmove() in case there is overlapping

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m/sdio: clear the INTR status bit after reading size
Cindy H Kao [Tue, 11 Aug 2009 01:36:15 +0000 (18:36 -0700)]
wimax/i2400m/sdio: clear the INTR status bit after reading size

In order to avoid issues during high-load traffic, the interrupt
status register has to be cleared ONLY after the RX size is read.

Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: USB driver uses a configurable endpoint map
Dirk Brandewie [Wed, 12 Aug 2009 18:29:46 +0000 (11:29 -0700)]
wimax/i2400m: USB driver uses a configurable endpoint map

Newer generations of the i2400m USB WiMAX device use a different
endpoint map; in order to make it easy to support it, we make the
endpoint-to-function mapeable instead of static.

Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/iwmc3200: increase wait time before enable retry
Cindy H Kao [Tue, 18 Aug 2009 02:39:12 +0000 (19:39 -0700)]
wimax/iwmc3200: increase wait time before enable retry

When trying to enable the iwmc3200 WiMAX SDIO function, we loop
waiting for the top controller to be up and running (at which point we
can succesfully enable the function). Between each try we wait for
I2400MS_INIT_SLEEP_INTERVAL ms.

Integration tests have found the current value of 10ms to be too
short; it was upped to 100ms to give more time to the top controller
to be ready.

Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/iwmc3200: don't disable the SDIO function if enable fails
Cindy H Kao [Tue, 18 Aug 2009 02:39:12 +0000 (19:39 -0700)]
wimax/iwmc3200: don't disable the SDIO function if enable fails

In the iwmc3200, disabling the WiMAX SDIO function when enable fails
would possibly result in a device reset triggered by the iwmc3200's
top controller since it monitors the bus reset activities from each
SDIO function. In any case, the disable makes no sense; if the enable
fails, it should not be disabled.

Thus we remove the unecessary sdio_disable_func() in
i2400ms_enable_function().

Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/iwmc3200: overwrite SDIO IOR timeout value to avoid platform hang
Cindy H Kao [Tue, 18 Aug 2009 02:17:58 +0000 (19:17 -0700)]
wimax/iwmc3200: overwrite SDIO IOR timeout value to avoid platform hang

The default SDIO IOE wait timeout returned from iwmc3200-wimax's CCCR
is not efficient. This inefficiency will actually cause problems on
Moorestown platforms (system hang).

This is a sillicon bug that requires a software patch to by
overwritting func->enable_timeout. The new value I2400MS_IOR_TIMEOUT
is recommended and verified from the system integration results.

Future sillicon releases will have this default value corrected in the
future.

Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: Make boot retries a BUS-specific parameter
Dirk Brandewie [Thu, 13 Aug 2009 20:48:29 +0000 (13:48 -0700)]
wimax/i2400m: Make boot retries a BUS-specific parameter

In i2400m-based devices, the driver's bootloader will retry to load
the firmware when things go wrong. The driver currently has a constant
(I2400M_BOOT_RETRIES) which governs the max number of tries.

However, different SKUs of the same hardware may admit or require
different numbers of retries due to it's particulars, so it is made a
BUS specific parameter and different values are assigned for 5x50
devices versus the 3200 ones.

Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: Ensure boot mode cmd and ack buffers are alloc'd before first message
Dirk Brandewie [Tue, 18 Aug 2009 15:51:52 +0000 (08:51 -0700)]
wimax/i2400m: Ensure boot mode cmd and ack buffers are alloc'd before first message

The change to the SDIO boot mode RX chain could try to use the cmd and
ack buffers befor they were allocated.  USB does not have the problem
but both were changed for consistency's sake.

Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: Update comments to talk about SDIO reset and not USB.
Dirk Brandewie [Fri, 24 Jul 2009 16:04:33 +0000 (09:04 -0700)]
wimax/i2400m: Update comments to talk about SDIO reset and not USB.

Fixing comments from original cut and paste error

Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agoi2400m: minimal ethtool support
Dan Williams [Thu, 17 Sep 2009 20:06:14 +0000 (13:06 -0700)]
i2400m: minimal ethtool support

Add minimal ethtool support for carrier detection.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax: misplaced parenthesis
Roel Kluin [Sun, 12 Jul 2009 22:59:53 +0000 (00:59 +0200)]
wimax: misplaced parenthesis

Fix misplaced parenthesis

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agoi2400m: keep index within ms_to_errno[]
Roel Kluin [Sun, 12 Jul 2009 23:48:42 +0000 (01:48 +0200)]
i2400m: keep index within ms_to_errno[]

Ensure that index `status' remains within ms_to_errno[]

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax: indicate initial SW rfkill state is "blocked"
Inaky Perez-Gonzalez [Fri, 28 Aug 2009 00:54:53 +0000 (17:54 -0700)]
wimax: indicate initial SW rfkill state is "blocked"

The WiMAX stack assumes that all WiMAX devices are SW OFF when they
are initialized. The recent changes in the RFKILL stack thus cause an
initial call after rfkill_register(), because by default, rfkill
considers devices to be SW ON upon registration.

So call rfkill_init_sw_state() to set it to SW OFF so
rfkill_register() doesn't do that unnecessary step.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: fix the bootmode RX deadlock in SDIO driver
Cindy H Kao [Thu, 27 Aug 2009 22:25:12 +0000 (15:25 -0700)]
wimax/i2400m: fix the bootmode RX deadlock in SDIO driver

i2400ms_bus_bm_wait_for_ack() causes a race condition. It happens
because this function clears i2400ms->bm_ack_size before waiting for
an interrupt, which is set by the interrupt service routine i2400ms_rx()
to indicate reception and size of received data; thus, if the interrupt
came right before the clearing/waiting, it is lost.

The fix is clear the bm_ack_size to -EINPROGRESS before we are enabling
the RX interrupt configuration in i2400ms_rx_setup(). Then everytime
when the interrupt service routine i2400ms_rx() is invoked during bootmode,
bm_ack_size is updated with the actual rx_size and it is cleared to
-EINPROGRESS again after the RX data is handled.

Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m/usb: remove unnecessary power management primitive in i2400m
Oliver Neukum [Wed, 19 Aug 2009 19:50:45 +0000 (13:50 -0600)]
wimax/i2400m/usb: remove unnecessary power management primitive in i2400m

This patch removes an unneeded power management primitive.
Power management is automatically enabled as probe ends.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agoxfrm: remove skb_icv_walk
Steffen Klassert [Wed, 7 Oct 2009 22:50:40 +0000 (22:50 +0000)]
xfrm: remove skb_icv_walk

The last users of skb_icv_walk are converted to ahash now,
so skb_icv_walk is unused and can be removed.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoah: Remove obsolete code
Steffen Klassert [Wed, 7 Oct 2009 22:49:57 +0000 (22:49 +0000)]
ah: Remove obsolete code

ah4 and ah6 are converted to ahash now, so we can remove the
code for the obsolete hash algorithm.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoah6: convert to ahash
Steffen Klassert [Wed, 7 Oct 2009 22:49:01 +0000 (22:49 +0000)]
ah6: convert to ahash

This patch converts ah6 to the new ahash interface.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoah4: convert to ahash
Steffen Klassert [Wed, 7 Oct 2009 22:48:17 +0000 (22:48 +0000)]
ah4: convert to ahash

This patch converts ah4 to the new ahash interface.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoah: Add struct crypto_ahash to ah_data
Steffen Klassert [Wed, 7 Oct 2009 22:47:16 +0000 (22:47 +0000)]
ah: Add struct crypto_ahash to ah_data

To support for ahash algorithms, we add a pointer to a
crypto_ahash to ah_data.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocosa: Kill off the use of the old ioctl path
Alan Cox [Wed, 14 Oct 2009 05:22:24 +0000 (05:22 +0000)]
cosa: Kill off the use of the old ioctl path

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: sk_drops consolidation part 2
Eric Dumazet [Thu, 15 Oct 2009 00:12:40 +0000 (00:12 +0000)]
net: sk_drops consolidation part 2

- skb_kill_datagram() can increment sk->sk_drops itself, not callers.

- UDP on IPV4 & IPV6 dropped frames (because of bad checksum or policy checks) increment sk_drops

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoinet: rename some inet_sock fields
Eric Dumazet [Thu, 15 Oct 2009 06:30:45 +0000 (06:30 +0000)]
inet: rename some inet_sock fields

In order to have better cache layouts of struct sock (separate zones
for rx/tx paths), we need this preliminary patch.

Goal is to transfert fields used at lookup time in the first
read-mostly cache line (inside struct sock_common) and move sk_refcnt
to a separate cache line (only written by rx path)

This patch adds inet_ prefix to daddr, rcv_saddr, dport, num, saddr,
sport and id fields. This allows a future patch to define these
fields as macros, like sk_refcnt, without name clashes.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogenetlink: Optimize and one bug fix in genl_generate_id()
Krishna Kumar [Wed, 14 Oct 2009 19:55:07 +0000 (19:55 +0000)]
genetlink: Optimize and one bug fix in genl_generate_id()

1. GENL_MIN_ID is a valid id -> no need to start at
   GENL_MIN_ID + 1.
2. Avoid going through the ids two times: If we start at
   GENL_MIN_ID+1 (*or bigger*) and all ids are over!, the
   code iterates through the list twice (*or lesser*).
3. Simplify code - no need to start at idx=0 which gets
   reset to GENL_MIN_ID.

Patch on net-next-2.6. Reboot test shows that first id
passed to genl_register_family was 16, next two were
GENL_ID_GENERATE and genl_generate_id returned 17 & 18
(user level testing of same code shows expected values
across entire range of MIN/MAX).

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogenetlink: Optimize genl_register_family()
Krishna Kumar [Wed, 14 Oct 2009 19:54:53 +0000 (19:54 +0000)]
genetlink: Optimize genl_register_family()

genl_register_family() doesn't need to call genl_family_find_byid
when GENL_ID_GENERATE is passed during register.

Patch on net-next-2.6, compile and reboot testing only.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocxgb3: No need to wake queue in xmit handler
Krishna Kumar [Wed, 14 Oct 2009 19:54:19 +0000 (19:54 +0000)]
cxgb3: No need to wake queue in xmit handler

The xmit handler doesn't need to wake the queue after stopping
it temporarily (some other drivers are doing the same).

Patch on net-next-2.6, multiple netperf sessions tested.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Acked-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoctcm rollback in case of errors
Einar Lueck [Wed, 14 Oct 2009 22:54:59 +0000 (22:54 +0000)]
ctcm rollback in case of errors

Group device now cleanly reacts to failures during channel start and
implements a clean rollback.

Signed-off-by: Einar Lueck <elelueck@de.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agolcs: Recognize return codes of ccw_device_set_online().
Klaus-Dieter Wacker [Wed, 14 Oct 2009 22:54:58 +0000 (22:54 +0000)]
lcs: Recognize return codes of ccw_device_set_online().

The creation of a new lcs device requires a call to the function
ccw_device_set_online() for the read and the write channel. Failure
of either call should terminate the lcs device creation immediately
with return code -ENODEV.

Signed-off-by: Klaus-Dieter Wacker <kdwacker@de.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agolcs: ODEBUG: object is on stack, but not annotated.
Klaus-Dieter Wacker [Wed, 14 Oct 2009 22:54:57 +0000 (22:54 +0000)]
lcs: ODEBUG: object is on stack, but not annotated.

Timer_list structure in lcs_send_lancmd() is allocated on stack.
Initialization with init_timer() leads to above ODEBUG message.
Instead use init_timer_on_stack() which prevents above msg.

Signed-off-by: Klaus-Dieter Wacker <kdwacker@de.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoaf_iucv: remove duplicate sock_set_flag
Ursula Braun [Wed, 14 Oct 2009 22:54:56 +0000 (22:54 +0000)]
af_iucv: remove duplicate sock_set_flag

Remove duplicate sock_set_flag(sk, SOCK_ZAPPED) in iucv_sock_close,
which has been overlooked in September-commit
7514bab04e567c9408fe0facbde4277f09d5eb74.

Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoaf_iucv: use sk functions to modify sk->sk_ack_backlog
Hendrik Brueckner [Wed, 14 Oct 2009 22:54:55 +0000 (22:54 +0000)]
af_iucv: use sk functions to modify sk->sk_ack_backlog

Instead of modifying sk->sk_ack_backlog directly, use respective
socket functions.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen; update version to 4.0.62
Dhananjay Phadke [Fri, 16 Oct 2009 15:50:12 +0000 (15:50 +0000)]
netxen; update version to 4.0.62

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: sysfs control for auto firmware recovery
Narender Kumar [Fri, 16 Oct 2009 15:50:11 +0000 (15:50 +0000)]
netxen: sysfs control for auto firmware recovery

Firmware hang detection and recovery (reset) need to
be disabled for diagnostic tools, which can run
some disruptive tests.

This adds a driver level control to turn off this
feature by diag tools.

Signed-off-by: Narender Kumar <narender.kumar@qlogic.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: fix error codes in for tools access
Dhananjay Phadke [Fri, 16 Oct 2009 15:50:10 +0000 (15:50 +0000)]
netxen: fix error codes in for tools access

Use -EIO or -EINVAL as error codes, these can get passed up
to applications (tools).

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: onchip memory access change
Amit Kumar Salecha [Fri, 16 Oct 2009 15:50:09 +0000 (15:50 +0000)]
netxen: onchip memory access change

Add support for different windowing scheme for on chip
memory in future chip revisions. This is required by
diagnostic tools.

Signed-off-by: Amit Kumar Salecha <amit@netxen.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: reset sequence changes
Amit Kumar Salecha [Fri, 16 Oct 2009 15:50:08 +0000 (15:50 +0000)]
netxen: reset sequence changes

Future revisions need different chip reset sequence
and firmware initialization.

Also clean up some never used debug code.

Signed-off-by: Amit Kumar Salecha <amit@netxen.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: 128 memory controller support
Amit Kumar Salecha [Fri, 16 Oct 2009 15:50:07 +0000 (15:50 +0000)]
netxen: 128 memory controller support

Future revisions of the chip have 128 bit memory
transactions. Require drivers to implement rmw
in case of sub-128 bit accesses by driver. This
is mostly used by diagnostic tools.

Signed-off-by: Amit Kumar Salecha <amit@netxen.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: defines for next revision
Amit Kumar Salecha [Fri, 16 Oct 2009 15:50:06 +0000 (15:50 +0000)]
netxen: defines for next revision

Signed-off-by: Amit Kumar Salecha <amit@netxen.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: Add support for next generation of BladeEngine device.
Ajit Khaparde [Sat, 17 Oct 2009 01:02:12 +0000 (18:02 -0700)]
be2net: Add support for next generation of BladeEngine device.

Add new PCI ids to support next generation of BladeEngine device.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoPhonet: hold socket before giving it to sk_deliver_skb()
Rémi Denis-Courmont [Thu, 15 Oct 2009 19:29:14 +0000 (12:29 -0700)]
Phonet: hold socket before giving it to sk_deliver_skb()

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: Update to version 1.52.1-1
Eilon Greenstein [Thu, 15 Oct 2009 07:19:31 +0000 (00:19 -0700)]
bnx2x: Update to version 1.52.1-1

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: Report the maximal available BW as link speed
Eilon Greenstein [Thu, 15 Oct 2009 07:19:05 +0000 (00:19 -0700)]
bnx2x: Report the maximal available BW as link speed

The device is limited to the maximal BW allocation, so it should be displayed as
the link speed to notify the user.

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: Do not call load/unload functionality from DCC
Eilon Greenstein [Thu, 15 Oct 2009 07:18:47 +0000 (00:18 -0700)]
bnx2x: Do not call load/unload functionality from DCC

There is really no need to clear the MAC or the FW filtering rules - it was
added for completion, but caused race conditions with load/unload. Removing this
redundant code

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: Adding FW mailbox mutex
Eilon Greenstein [Thu, 15 Oct 2009 07:18:27 +0000 (00:18 -0700)]
bnx2x: Adding FW mailbox mutex

DCC commands are not protected with the RTNL lock, so a mutex should be added

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: Changing the Disabled state to a flag
Eilon Greenstein [Thu, 15 Oct 2009 07:18:08 +0000 (00:18 -0700)]
bnx2x: Changing the Disabled state to a flag

When working with DCC, a function can be disabled or enabled (virtual link down
or up). Using the function state introduced some race conditions with the
load/unload flow.
Using a separate flag to indicate that the function is disabled.

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: Remove old FW files
Eilon Greenstein [Thu, 15 Oct 2009 07:17:45 +0000 (00:17 -0700)]
bnx2x: Remove old FW files

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: Allowing 0 as initial fairness value
Eilon Greenstein [Thu, 15 Oct 2009 07:17:20 +0000 (00:17 -0700)]
bnx2x: Allowing 0 as initial fairness value

Value of zero was used to disable the fairness mechanism. Though the code
(driver and FW) allowed changing the value at run time, it did not allow to do
that if the mechanism was disabled to begin with.
Fixed the FW to allow turning on and off the mechanism at run time. Fixed the
code to read the value from the chip at the right sequence.
Without this fix, if the initial value was set to zero, traffic could not run on
the interface.

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: Add FW 5.2.7
Eilon Greenstein [Thu, 15 Oct 2009 07:16:27 +0000 (00:16 -0700)]
bnx2x: Add FW 5.2.7

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: Add missing __NR_recvmmsg define.
David S. Miller [Thu, 15 Oct 2009 04:32:43 +0000 (21:32 -0700)]
sparc: Add missing __NR_recvmmsg define.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: sk_drops consolidation
Eric Dumazet [Thu, 15 Oct 2009 03:40:11 +0000 (20:40 -0700)]
net: sk_drops consolidation

sock_queue_rcv_skb() can update sk_drops itself, removing need for
callers to take care of it. This is more consistent since
sock_queue_rcv_skb() also reads sk_drops when queueing a skb.

This adds sk_drops managment to many protocols that not cared yet.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agohamradio: Fix bit test correctly.
Thomas Sailer [Wed, 14 Oct 2009 22:15:24 +0000 (15:15 -0700)]
hamradio: Fix bit test correctly.

Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoPhonet: forward incoming packets
Rémi Denis-Courmont [Wed, 14 Oct 2009 00:48:31 +0000 (00:48 +0000)]
Phonet: forward incoming packets

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoPhonet: route outgoing packets
Rémi Denis-Courmont [Wed, 14 Oct 2009 00:48:30 +0000 (00:48 +0000)]
Phonet: route outgoing packets

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoPhonet: routing table Netlink interface
Rémi Denis-Courmont [Wed, 14 Oct 2009 00:48:29 +0000 (00:48 +0000)]
Phonet: routing table Netlink interface

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoPhonet: routing table backend
Rémi Denis-Courmont [Wed, 14 Oct 2009 00:48:28 +0000 (00:48 +0000)]
Phonet: routing table backend

The Phonet "universe" only has 64 addresses, so we keep a trivial flat
routing table.

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoPhonet: deliver broadcast packets to broadcast sockets
Rémi Denis-Courmont [Wed, 14 Oct 2009 00:48:27 +0000 (00:48 +0000)]
Phonet: deliver broadcast packets to broadcast sockets

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoia64: Fix up the syscall table for recvmmsg
Arnaldo Carvalho de Melo [Wed, 14 Oct 2009 20:11:30 +0000 (13:11 -0700)]
ia64: Fix up the syscall table for recvmmsg

Reported-by: "Tony Luck" <tony.luck@intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Remove BKL from tun
Thomas Gleixner [Wed, 14 Oct 2009 08:19:46 +0000 (01:19 -0700)]
net: Remove BKL from tun

The lock_kernel/unlock_kernel() in cycle_kernel_lock() which is called
in tun_chr_open() is not serializing against anything and safe to
remove.

tun_chr_fasync() is serialized by get/put_tun() and fasync_helper()
has no dependency on BKL. The modification of tun->flags is racy with
and without the BKL so removing it does not make it worse.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
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 [Tue, 13 Oct 2009 19:55:20 +0000 (12:55 -0700)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

15 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>
15 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>
15 years agonet: smsc911x: allow platform_data to specify mac address
Manuel Lauss [Tue, 13 Oct 2009 07:25:49 +0000 (07:25 +0000)]
net: smsc911x: allow platform_data to specify mac address

Extend the driver to accept a MAC address specified in platform_data.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: enable smsc911x on MIPS
Manuel Lauss [Tue, 13 Oct 2009 07:25:48 +0000 (07:25 +0000)]
net: enable smsc911x on MIPS

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgb: Fix erroneous display of stats by ethtool -S
Ajit Khaparde [Tue, 13 Oct 2009 01:46:56 +0000 (01:46 +0000)]
ixgb: Fix erroneous display of stats by ethtool -S

Commit 5675f221 overlooked the way offsets for netdev stats were considered.
Because of this some of the stats shown by ethtool -S were wrong.
This patch fixes it.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: Fix erroneous display of stats by ethtool -S
Ajit Khaparde [Tue, 13 Oct 2009 01:46:29 +0000 (01:46 +0000)]
igb: Fix erroneous display of stats by ethtool -S

Commit 337e067d overlooked the way offsets for netdev stats were considered.
Because of this some of the stats shown by ethtool -S were wrong.
This patch fixes it.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe1000: Fix erroneous display of stats by ethtool -S
Ajit Khaparde [Tue, 13 Oct 2009 01:45:48 +0000 (01:45 +0000)]
e1000: Fix erroneous display of stats by ethtool -S

Commit 23d26497 overlooked the way offsets for netdev stats were considered.
Because of this some of the stats shown by ethtool -S were wrong.
This patch fixes it.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe1000e: Fix erroneous display of stats by ethtool -S
Ajit Khaparde [Tue, 13 Oct 2009 01:45:09 +0000 (01:45 +0000)]
e1000e: Fix erroneous display of stats by ethtool -S

Commit fd8235bb overlooked the way offsets for netdev stats were considered.
Because of this some of the stats shown by ethtool -S were wrong.
This patch fixes it.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Fix erroneous display of stats by ethtool -S
Ajit Khaparde [Tue, 13 Oct 2009 01:47:33 +0000 (01:47 +0000)]
ixgbe: Fix erroneous display of stats by ethtool -S

Commit 59aa3cc4 overlooked the way offsets for netdev stats were considered.
Because of this some of the stats shown by ethtool -S were wrong.
This patch fixes it.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: add sysfs entries for diag tools
Dhananjay Phadke [Tue, 13 Oct 2009 05:31:45 +0000 (05:31 +0000)]
netxen: add sysfs entries for diag tools

Add sysfs entries to enable register and memory access
for diagnostic tools.

Signed-off-by: Narender Kumar <narender.kumar@qlogic.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: separate register and memory access lock
Dhananjay Phadke [Tue, 13 Oct 2009 05:31:44 +0000 (05:31 +0000)]
netxen: separate register and memory access lock

Since register and onboard memory access has separate
window registers, they need not be kept under same lock.

Also, memory is always accessed from process context
(mostly for firmware init and diagnostic tools).

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: annotate register windowing code
Dhananjay Phadke [Tue, 13 Oct 2009 05:31:43 +0000 (05:31 +0000)]
netxen: annotate register windowing code

Use common variables crb_win, ocm_win for all revisions of chip.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: add access to on chip memory for tools
Dhananjay Phadke [Tue, 13 Oct 2009 05:31:42 +0000 (05:31 +0000)]
netxen: add access to on chip memory for tools

Add access to on chip memory, this is used by
debug and diagnostic tools only.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: remove sub 64-bit mem accesses
Amit Kumar Salecha [Tue, 13 Oct 2009 05:31:41 +0000 (05:31 +0000)]
netxen: remove sub 64-bit mem accesses

Sub 64-bit / unaligned access to oncard memory was only used
by old diagnostic tools, causes some intermittent issues when
memory controller agent is used.  The new access method was
added by commit ea6828b8aa3a8ebae8d7740f32f212ba1d2f0742
("netxen: improve pci memory access").  Firmware init anyway
uses 8-byte strides.

This also fixes address/offset calculation for NX2031 context
memory (SIU). For NX3031, SIU uses same register offsets
as packet memory (MIU).

Signed-off-by: Amit Kumar Salecha <amit@netxen.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Use netdev_alloc_skb_ip_align()
Eric Dumazet [Tue, 13 Oct 2009 05:34:20 +0000 (05:34 +0000)]
net: Use netdev_alloc_skb_ip_align()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.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 [Tue, 13 Oct 2009 18:41:34 +0000 (11:41 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

15 years agosb1250-mac: duplicate setting of bit V_MAC_RX_PL_THRSH(4) in sbmac_channel_start()
roel kluin [Tue, 6 Oct 2009 10:07:15 +0000 (10:07 +0000)]
sb1250-mac: duplicate setting of bit V_MAC_RX_PL_THRSH(4) in sbmac_channel_start()

The bit V_MAC_RX_PL_THRSH(4) was already set a few lines higher.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet/hamradio: fix test in receive()
roel kluin [Tue, 6 Oct 2009 01:20:08 +0000 (01:20 +0000)]
net/hamradio: fix test in receive()

The negation makes it a bool before the comparison and hence it
will never evaluate to true.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agox25: bit and/or confusion in x25_ioctl()?
roel kluin [Wed, 7 Oct 2009 00:59:42 +0000 (00:59 +0000)]
x25: bit and/or confusion in x25_ioctl()?

Looking at commit ebc3f64b864f it appears that this was intended
and not the original, equivalent to `if (facilities.reverse & ~0x81)'.

In x25_parse_facilities() that patch changed how facilities->reverse
was set. No other bits were set than 0x80 and/or 0x01.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocxgb3: Added private MAC address and provisioning packet handler for iSCSI
Karen Xie [Thu, 8 Oct 2009 09:11:05 +0000 (09:11 +0000)]
cxgb3: Added private MAC address and provisioning packet handler for iSCSI

This patch added support of private MAC address per port and provisioning
packet handler for iSCSI traffic only.

The above changes are isolated to the cxgb3 driver, independent of any scsi or iscsi driver changes.

Acked-by: Karen Xie <kxie@chelsio.com>
Acked-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Rakesh Ranjan <rakesh@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: add Runtime PM to the sh_eth driver
Magnus Damm [Fri, 9 Oct 2009 00:20:04 +0000 (00:20 +0000)]
net: add Runtime PM to the sh_eth driver

Add Runtime PM support to the sh_eth driver.

The clock to the ethernet hardware block will be
enabled as long as the network device is up.

Signed-off-by: Magnus Damm <damm@opensource.se>
Tested-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: allow sh_eth to get mac address through platform data
Magnus Damm [Fri, 9 Oct 2009 00:17:14 +0000 (00:17 +0000)]
net: allow sh_eth to get mac address through platform data

Extend the sh_eth driver to allow passing the mac address
using the platform data structure. This to simplify board
setup code.

Signed-off-by: Magnus Damm <damm@opensource.se>
Tested-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocan: make the number of echo skb's configurable
Wolfgang Grandegger [Thu, 8 Oct 2009 22:17:11 +0000 (22:17 +0000)]
can: make the number of echo skb's configurable

This patch allows the CAN controller driver to define the number of echo
skb's used for the local loopback (echo), as suggested by Kurt Van
Dijck, with the function:

  struct net_device *alloc_candev(int sizeof_priv,
                                  unsigned int echo_skb_max);

The CAN drivers have been adapted accordingly. For the ems_usb driver,
as suggested by Sebastian Haas, the number of echo skb's has been
increased to 10, which improves the transmission performance a lot.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Add netdev_alloc_skb_ip_align() helper
Eric Dumazet [Wed, 7 Oct 2009 17:11:23 +0000 (17:11 +0000)]
net: Add netdev_alloc_skb_ip_align() helper

Instead of hardcoding NET_IP_ALIGN stuff in various network drivers,
we can add a helper around netdev_alloc_skb()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotcp: replace ehash_size by ehash_mask
Eric Dumazet [Fri, 9 Oct 2009 00:16:19 +0000 (00:16 +0000)]
tcp: replace ehash_size by ehash_mask

Storing the mask (size - 1) instead of the size allows fast path to be
a bit faster.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv6: fix devconf after adding force_tllao option
Cosmin Ratiu [Fri, 9 Oct 2009 03:11:14 +0000 (03:11 +0000)]
ipv6: fix devconf after adding force_tllao option

Signed-off-by: Cosmin Ratiu <cratiu@ixiacom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 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>
15 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>
15 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>
15 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>
15 years agobonding: change bond_create_proc_entry() to return void
Nicolas de Pesloüan [Tue, 13 Oct 2009 07:45:06 +0000 (00:45 -0700)]
bonding: change bond_create_proc_entry() to return void

The function bond_create_proc_entry is currently of type int.

Two versions of this function exist:

The one in the ifdef CONFIG_PROC_FS branch always return 0.
The one in the else branch (which is empty) return nothing.

When CONFIG_PROC_FS is undef, this cause the following warning:

drivers/net/bonding/bond_main.c: In function `bond_create_proc_entry':
drivers/net/bonding/bond_main.c:3393: warning: control reaches end of
non-void function

No caller of this function use the returned value.

So change the returned type from int to void and remove the
useless return 0; .

Signed-off-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
Reported-by: Rakib Mullick <rakib.mullick@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 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>