GitHub/MotorolaMobilityLLC/kernel-slsi.git
14 years agoStaging: comedi: adv_pci1710: Remove unneeded chanlist_len check
Ian Abbott [Wed, 20 Jan 2010 13:04:48 +0000 (13:04 +0000)]
Staging: comedi: adv_pci1710: Remove unneeded chanlist_len check

For AI command testing, the driver does not need to range-check
the length of the channel list as the comedi core has already
checked it.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: comedi: adv_pci1710: Correct AI scan count and channel checks
Ian Abbott [Wed, 20 Jan 2010 13:04:47 +0000 (13:04 +0000)]
Staging: comedi: adv_pci1710: Correct AI scan count and channel checks

For AI commands, the internal channel list used to check incoming
data was only set up partially if the channel list contained
repeats.  Set it up fully.  Also the current scan position was not
updated properly when moving a block of data from the FIFO unless
a whole number of scans was moved.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: comedi: pcl818: Correct AI scan counting and channel checks
Ian Abbott [Wed, 20 Jan 2010 13:04:46 +0000 (13:04 +0000)]
Staging: comedi: pcl818: Correct AI scan counting and channel checks

For AI commands, the scan counter should be updated after every
scan.  It was being updated after every sample except for DMA mode
where it was being updated after every repeated segment of the
channel list.

Also AI commands with multiple channels were being terminated with
an error prematurely except in DMA mode.  This was because the
driver was comparing channel numbers received from the hardware
(combined with the sample value) with the expected channel numbers
to check for a "channel dropout".  This test was failing
incorrectly because the driver was not keeping the current position
within the (repeated segment of the) channel list up to date.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: comedi: pcl816: Correct AI scan counting
Ian Abbott [Wed, 20 Jan 2010 13:04:45 +0000 (13:04 +0000)]
Staging: comedi: pcl816: Correct AI scan counting

For AI commands, the scan counter should be updated after every
scan.  In DMA mode, it was being updated after every repeated
segment of the channel list.  In non-DMA mode, it was being updated
after every sample.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: comedi: pcl812: Correct AI scan counting
Ian Abbott [Wed, 20 Jan 2010 13:04:44 +0000 (13:04 +0000)]
Staging: comedi: pcl812: Correct AI scan counting

The AI scan counter should be updated after every completed scan,
not after every channel.  Keep track of current channel.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: Comedi: G1-3 status registers not read in ni_gpct_to_660x_register()
Roel Kluin [Tue, 19 Jan 2010 20:46:48 +0000 (21:46 +0100)]
Staging: Comedi: G1-3 status registers not read in ni_gpct_to_660x_register()

Read from the right status register

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: comedi: pcl730: Checkpatch cleanups
Benjamin Adolphi [Mon, 18 Jan 2010 21:32:07 +0000 (22:32 +0100)]
Staging: comedi: pcl730: Checkpatch cleanups

This fixes all checkpatch issues in the pcl730 comedi driver.

Signed-off-by: Benjamin Adolphi <b.adolphi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: comedi: pcl725: Checkpatch cleanups
Benjamin Adolphi [Mon, 18 Jan 2010 11:57:42 +0000 (12:57 +0100)]
Staging: comedi: pcl725: Checkpatch cleanups

This fixes all checkpatch issues in the pcl725 comedi driver.

Signed-off-by: Benjamin Adolphi <b.adolphi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: comedi: pcl724: Checkpatch cleanups
Benjamin Adolphi [Mon, 18 Jan 2010 11:48:16 +0000 (12:48 +0100)]
Staging: comedi: pcl724: Checkpatch cleanups

This fixes all checkpatch issues in the pcl724 comedi driver.

Signed-off-by: Benjamin Adolphi <b.adolphi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: comedi: pcl711: Checkpatch cleanups
Benjamin Adolphi [Sat, 16 Jan 2010 17:58:58 +0000 (18:58 +0100)]
Staging: comedi: pcl711: Checkpatch cleanups

This fixes some checkpatch issues in the pcl711 comedi driver.

Signed-off-by: Benjamin Adolphi <b.adolphi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: go7007: Eliminate useless code
Julia Lawall [Sat, 16 Jan 2010 15:59:22 +0000 (16:59 +0100)]
Staging: go7007: Eliminate useless code

The variable s is initialized twice to the same (side effect-free)
expression.  Drop one initialization.

A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)

// <smpl>
@forall@
idexpression *x;
identifier f!=ERR_PTR;
@@

x = f(...)
... when != x
(
x = f(...,<+...x...+>,...)
|
* x = f(...)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: comedi: rti800: Checkpatch cleanups
Benjamin Adolphi [Fri, 15 Jan 2010 17:03:35 +0000 (18:03 +0100)]
Staging: comedi: rti800: Checkpatch cleanups

This fixes some checkpatch issues in the rti800 comedi driver.

Signed-off-by: Benjamin Adolphi <b.adolphi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: comedi: c6xdigio: Checkpatch cleanups
Benjamin Adolphi [Fri, 15 Jan 2010 16:37:47 +0000 (17:37 +0100)]
Staging: comedi: c6xdigio: Checkpatch cleanups

This fixes some checkpatch issues and some
spelling mistakes in the c6xdigio comedi driver.

Signed-off-by: Benjamin Adolphi <b.adolphi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: comedi: adq12b: Checkpatch cleanups
Benjamin Adolphi [Fri, 15 Jan 2010 11:08:01 +0000 (12:08 +0100)]
Staging: comedi: adq12b: Checkpatch cleanups

This fixes some checkpatch issues in the adq12b comedi driver.

Signed-off-by: Benjamin Adolphi <b.adolphi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: rtl8192u: ieee80211: CurrentMPDUDensity assigned to itself in HTUseDefaultSe...
Roel Kluin [Thu, 14 Jan 2010 20:25:56 +0000 (21:25 +0100)]
Staging: rtl8192u: ieee80211: CurrentMPDUDensity assigned to itself in HTUseDefaultSetting()

CurrentMPDUDensity was designed to itself.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: sm7xx: remove the buggy 2D acceleration support
Wu Zhangjin [Wed, 6 Jan 2010 08:33:10 +0000 (16:33 +0800)]
staging: sm7xx: remove the buggy 2D acceleration support

When scrolling the screen on the console with the 2D acceleration
support, the whole system may hang. for example, when copying some files
from another machine to YeeLoong netbook with the sm7xx video driver via
scp and when the screen output is enabled, the system may hang.

Before the bug is fixed, remove the 2D acceleration!

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: fix typos "couter" -> "counter"
Uwe Kleine-König [Tue, 12 Jan 2010 14:57:59 +0000 (15:57 +0100)]
staging: fix typos "couter" -> "counter"

This patch was generated by

        git grep -l 'couter' drivers/staging | xargs -r perl -p -i -e 's/couter/counter/'

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: fix typos "aquire" -> "acquire"
Uwe Kleine-König [Tue, 12 Jan 2010 14:57:58 +0000 (15:57 +0100)]
staging: fix typos "aquire" -> "acquire"

This patch was generated by

    git grep -E -i -l '[Aa]quire' drivers/staging | xargs -r perl -p -i -e 's/([Aa])quire/$1cquire/'

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: fix typos "selct" -> "select"
Uwe Kleine-König [Tue, 12 Jan 2010 14:57:57 +0000 (15:57 +0100)]
staging: fix typos "selct" -> "select"

This patch was generated by

git grep -E -i -l 's(le|el)ct' drivers/staging | xargs -r perl -p -i -e 's/([Ss])(le|el)ct/$1elect/'

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: fix typos "enalbe" -> "enable"
Uwe Kleine-König [Tue, 12 Jan 2010 14:57:56 +0000 (15:57 +0100)]
staging: fix typos "enalbe" -> "enable"

This patch was generated by

git grep -E -l 'enalbe' drivers/staging | xargs -r perl -p -i -e 's/enalbe/enable/g'

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: wlags49: don't use custom implementation of atoi()
Andy Shevchenko [Thu, 14 Jan 2010 13:07:23 +0000 (15:07 +0200)]
staging: wlags49: don't use custom implementation of atoi()

Kernel has its own method called simple_strtoul() to do such things.

Here we are using simple_strtoul(value, NULL, 0) because in original function
the recognized base is 10 or 16 and input data is assumed to be unsigned.

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: sep: declare MODULE_FIRMWARE
Ben Hutchings [Wed, 13 Jan 2010 23:36:46 +0000 (23:36 +0000)]
Staging: sep: declare MODULE_FIRMWARE

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: sep: include driver name in firmware filenames
Ben Hutchings [Wed, 13 Jan 2010 23:36:27 +0000 (23:36 +0000)]
Staging: sep: include driver name in firmware filenames

The current names "cache.image.bin" and "resident.image.bin" are far
too generic.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: declare MODULE_FIRMWARE in various drivers
Ben Hutchings [Wed, 13 Jan 2010 23:36:09 +0000 (23:36 +0000)]
staging: declare MODULE_FIRMWARE in various drivers

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: dream: HTC Dream camera, not need sizeof
Pavel Vasilyev [Mon, 11 Jan 2010 18:08:02 +0000 (21:08 +0300)]
Staging: dream: HTC Dream camera, not need sizeof

http://bugzilla.kernel.org/show_bug.cgi?id=14825

sizeof(extlen), always will be sizeof( unit32_t) or 4
It seems that something is wrong?!?!

Signed-off-by: Pavel Vasilyev <pavel@pavlinux.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: vme/tsi148: Depend on VIRT_TO_BUS
Jeff Mahoney [Mon, 11 Jan 2010 15:54:31 +0000 (10:54 -0500)]
Staging: vme/tsi148: Depend on VIRT_TO_BUS

This driver depends on virt_to_bus working correctly, but it doesn't
exist on ppc64 (and probably other arches).

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: otus: fix assignment makes integer from pointer without a cast warnings
Jeff Mahoney [Mon, 11 Jan 2010 15:54:30 +0000 (10:54 -0500)]
Staging: otus: fix assignment makes integer from pointer without a cast warnings

This patch fixes some %x pointer printing to %p.

It also uses the skb_tail_pointer and skb_mac_header macros for accessing
thos members.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: rtl8192u: dont use -mhard-float
Jeff Mahoney [Mon, 11 Jan 2010 15:54:29 +0000 (10:54 -0500)]
Staging: rtl8192u: dont use -mhard-float

rtl8192u uses -mhard-float, which doesn't exist on ia64. Since in-kernel
floating-point isn't allowed, this is implied anyway.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: rtl8192e: Use skb_tail_pointer
Jeff Mahoney [Mon, 11 Jan 2010 15:54:27 +0000 (10:54 -0500)]
Staging: rtl8192e: Use skb_tail_pointer

rtl8192e uses skb->tail directly. This patch uses the tail pointer macros
instead.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: rt2860: Use skb_tail_pointer
Jeff Mahoney [Mon, 11 Jan 2010 15:54:25 +0000 (10:54 -0500)]
Staging: rt2860: Use skb_tail_pointer

rt2860 uses skb->tail directly. This patch uses the tail pointer macros
instead.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: ramzswap: Free memory when create_device is failed
Minchan Kim [Mon, 11 Jan 2010 07:15:53 +0000 (16:15 +0900)]
Staging: ramzswap: Free memory when create_device is failed

If create_device is failed, it can't free gendisk and request_queue of
preceding devices. It cause memory leak.

This patch fixes it.

Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: make i2c device id constant
Németh Márton [Sat, 9 Jan 2010 23:18:41 +0000 (00:18 +0100)]
staging: make i2c device id constant

The id_table field of the struct i2c_driver is constant in <linux/i2c.h>
so it is worth to make the initialization data also constant.

The semantic match that finds this kind of pattern is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
disable decl_init,const_decl_init;
identifier I1, I2, x;
@@
struct I1 {
  ...
  const struct I2 *x;
  ...
};
@s@
identifier r.I1, y;
identifier r.x, E;
@@
struct I1 y = {
  .x = E,
};
@c@
identifier r.I2;
identifier s.E;
@@
const struct I2 E[] = ... ;
@depends on !c@
identifier r.I2;
identifier s.E;
@@
+ const
struct I2 E[] = ...;
// </smpl>

Signed-off-by: Németh Márton <nm127@freemail.hu>
Cc: Julia Lawall <julia@diku.dk>
Cc: cocci@diku.dk
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: make USB device id constant
Németh Márton [Sat, 9 Jan 2010 23:18:34 +0000 (00:18 +0100)]
staging: make USB device id constant

The id_table field of the struct usb_device_id is constant in <linux/usb.h>
so it is worth to make the initialization data also constant.

The semantic match that finds this kind of pattern is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
disable decl_init,const_decl_init;
identifier I1, I2, x;
@@
struct I1 {
  ...
  const struct I2 *x;
  ...
};
@s@
identifier r.I1, y;
identifier r.x, E;
@@
struct I1 y = {
  .x = E,
};
@c@
identifier r.I2;
identifier s.E;
@@
const struct I2 E[] = ... ;
@depends on !c@
identifier r.I2;
identifier s.E;
@@
+ const
struct I2 E[] = ...;
// </smpl>

Signed-off-by: Németh Márton <nm127@freemail.hu>
Cc: Julia Lawall <julia@diku.dk>
Cc: cocci@diku.dk
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: make PCI device id constant
Németh Márton [Sat, 9 Jan 2010 23:18:26 +0000 (00:18 +0100)]
staging: make PCI device id constant

The id_table field of the struct pci_driver is constant in <linux/pci.h>
so it is worth to make the initialization data also constant.

The semantic match that finds this kind of pattern is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
disable decl_init,const_decl_init;
identifier I1, I2, x;
@@
struct I1 {
  ...
  const struct I2 *x;
  ...
};
@s@
identifier r.I1, y;
identifier r.x, E;
@@
struct I1 y = {
  .x = E,
};
@c@
identifier r.I2;
identifier s.E;
@@
const struct I2 E[] = ... ;
@depends on !c@
identifier r.I2;
identifier s.E;
@@
+ const
struct I2 E[] = ...;
// </smpl>

Signed-off-by: Németh Márton <nm127@freemail.hu>
Cc: Julia Lawall <julia@diku.dk>
Cc: cocci@diku.dk
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: iio: Fix incorrect existence check for a shared event pointer.
Jonathan Cameron [Sat, 9 Jan 2010 17:01:33 +0000 (17:01 +0000)]
staging: iio: Fix incorrect existence check for a shared event pointer.

A second smatch detected error. First part fixes in a typo
in the comment directly above that I noticed whilst trying
to remember what this code actually does. Second part is
the actual fix.  I'm fairly amazed this one never caused
trouble in testing as it is in one of the most common paths.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: iio: Ensure mutex is correctly unlocked in __iio_push_event
Jonathan Cameron [Sat, 9 Jan 2010 16:57:34 +0000 (16:57 +0000)]
staging: iio: Ensure mutex is correctly unlocked in __iio_push_event

This error was picked up by running the smatch static
checker over all the IIO subsytem.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: otus: zfTkipInit(): increment another pointer
Simon Horman [Tue, 12 Jan 2010 00:50:09 +0000 (11:50 +1100)]
Staging: otus: zfTkipInit(): increment another pointer

Increment the pointer rather than its value.
These appear to be logic errors.

Thanks to Dan Carpenter for the first hunk of this change.

Cc: Dan Carpenter <error27@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: otus: Fix ZM_SEQ_DEBUG macro for no-debug case
horms@vergenet.net [Fri, 8 Jan 2010 07:57:52 +0000 (18:57 +1100)]
Staging: otus: Fix ZM_SEQ_DEBUG macro for no-debug case

tcp_seq is only initialised in case where ZM_ENABLE_PERFORMANCE_EVALUATION
is defined. So move the call to ZM_SEQ_DEBUG() and the decleration of
tcp_seq in there too.  This allows ZM_SEQ_DEBUG() to be removed from the
non-ZM_ENABLE_PERFORMANCE_EVALUATION case in the header file.

This resolves several compile warnings for the
non-ZM_ENABLE_PERFORMANCE_EVALUATION case.
However, the ZM_ENABLE_PERFORMANCE_EVALUATION
case seems to be completely broken.

$ gcc (Debian 4.4.2-8) 4.4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ make
...
drivers/staging/otus/80211core/cagg.c: In function 'zfAggRxEnabled':
drivers/staging/otus/80211core/cagg.c:1872: warning: left-hand operand of
comma expression has no effect
drivers/staging/otus/80211core/cagg.c:1872: warning: left-hand operand of
comma expression has no effect
drivers/staging/otus/80211core/cagg.c:1872: warning: statement with no
effect
...

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: otus: remove unused constants
horms@vergenet.net [Fri, 8 Jan 2010 07:57:51 +0000 (18:57 +1100)]
Staging: otus: remove unused constants

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: otus: remove unused variables
horms@vergenet.net [Fri, 8 Jan 2010 07:57:50 +0000 (18:57 +1100)]
Staging: otus: remove unused variables

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: otus: dont mix declarations and code
horms@vergenet.net [Fri, 8 Jan 2010 07:57:49 +0000 (18:57 +1100)]
Staging: otus: dont mix declarations and code

$ gcc (Debian 4.4.2-8) 4.4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ make
...
drivers/staging/otus/ioctl.c: In function 'usbdrv_wpa_ioctl':
drivers/staging/otus/ioctl.c:2253: warning: ISO C90 forbids mixed declarations and code
...

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: crystalhd: trim register defines
Jarod Wilson [Thu, 7 Jan 2010 23:37:36 +0000 (18:37 -0500)]
staging: crystalhd: trim register defines

We don't actually need most of the register defines to build,
and most of the ones we don't need aren't currently interesting.

We'll leave a full copy of all of them in libcrystalhd's source,
and only include what we need and/or think might be interesting
in the driver.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: crystalhd: add missing fixes for userspace lib build
Jarod Wilson [Thu, 7 Jan 2010 23:35:58 +0000 (18:35 -0500)]
staging: crystalhd: add missing fixes for userspace lib build

I somehow managed to not actually include these two fixes in the submission
that was committed to the staging tree. libcrystalhd should eventually be
built against the kernel-provided header, and needs the stdint.h include. The
VOID bit is to keep things in sync with the Mac OS X driver and library that
Scott Davilla is also working on.

Signed-off-by: Scott Davilla <davilla@4pi.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: wlan-ng: Add select WEXT_PRIV to Kconfig to prevent build failure
Peter Huewe [Thu, 7 Jan 2010 20:21:35 +0000 (21:21 +0100)]
Staging: wlan-ng: Add select WEXT_PRIV to Kconfig to prevent build failure

Without WEXT_PRIV set the p80211wext.c fails to build due to unknown fields in
the iw_handler_def struct.
Those fields are enclosed in WEXT_PRIV conditionals in the prototype
of iw_handler_def in include/net/iw_handler.h

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Simon Horman <horms@verge.net.au>
Cc: stable <stable@kernel.org> [2.6.33 only]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: rtl8192u: Add select WEXT_PRIV to Kconfig to prevent build failure
Peter Huewe [Fri, 8 Jan 2010 08:10:13 +0000 (09:10 +0100)]
Staging: rtl8192u: Add select WEXT_PRIV to Kconfig to prevent build failure

Without WEXT_PRIV set the driver fails to build due to unknown fields in
the iw_handler_def struct.
Those fields are enclosed in WEXT_PRIV conditionals in the prototype
of iw_handler_def in include/net/iw_handler.h

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: otus: Add select WEXT_PRIV to Kconfig to prevent build failure
Peter Huewe [Fri, 8 Jan 2010 08:09:12 +0000 (09:09 +0100)]
Staging: otus: Add select WEXT_PRIV to Kconfig to prevent build failure

Without WEXT_PRIV set the driver fails to build due to unknown fields in
the iw_handler_def struct.
Those fields are enclosed in WEXT_PRIV conditionals in the prototype
of iw_handler_def in include/net/iw_handler.h

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: asus_oled: Add NULL test for kmalloc
Peter Huewe [Thu, 7 Jan 2010 18:57:36 +0000 (19:57 +0100)]
Staging: asus_oled: Add NULL test for kmalloc

This patch adds a NULL test to check wether kmalloc was successful or
not.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agostaging: cx25821: avoid NULL pointer dereference
Alexander Beregalov [Thu, 7 Jan 2010 00:21:48 +0000 (03:21 +0300)]
staging: cx25821: avoid NULL pointer dereference

Assign dev only if fh is not NULL.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: v56655: add missing parentheses (in comment)
Roel Kluin [Wed, 6 Jan 2010 22:27:47 +0000 (23:27 +0100)]
Staging: v56655: add missing parentheses (in comment)

`!' has a higher precedence than `&' so parentheses are required.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: batman-adv: Update the README for mainline usage.
Andrew Lunn [Wed, 6 Jan 2010 06:30:48 +0000 (07:30 +0100)]
Staging: batman-adv: Update the README for mainline usage.

The module now only compiles inside mainline, so remove the comments
about different versions of the kernel it can be used with. Also
update comments about building with debug enabled and how to use the
VIS data now that it no longer natively outputs dot or JSON.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: Fixed pohmelfs regression because of per-bdi writeback.
Evgeniy Polyakov [Tue, 2 Feb 2010 22:04:30 +0000 (01:04 +0300)]
Staging: Fixed pohmelfs regression because of per-bdi writeback.

Since pohmelfs isn't tied to a single block device, it needs to setup a
backing dev like nfs/btrfs/etc do.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: pohmelfs: avoid null dereference
Dan Carpenter [Fri, 8 Jan 2010 11:51:50 +0000 (14:51 +0300)]
Staging: pohmelfs: avoid null dereference

err_out_put is for when the netfs_trans_alloc() succeeded.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: pohmelfs: Remove uses of NIPQUAD, use %pI4
Joe Perches [Wed, 6 Jan 2010 01:20:14 +0000 (17:20 -0800)]
Staging: pohmelfs: Remove uses of NIPQUAD, use %pI4

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: sep: Fix use of legacy ioctl fop
Alan Cox [Mon, 4 Jan 2010 16:25:02 +0000 (16:25 +0000)]
Staging: sep: Fix use of legacy ioctl fop

SEP doesn't need lock_kernel.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: sep: Fix build problems from header changes
Alan Cox [Mon, 4 Jan 2010 16:24:47 +0000 (16:24 +0000)]
Staging: sep: Fix build problems from header changes

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: otus: 80211core: Fix &&/|| confusion
Roel Kluin [Thu, 31 Dec 2009 12:28:32 +0000 (13:28 +0100)]
Staging: otus: 80211core: Fix &&/|| confusion

This always evaluates to true.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: rar: Fix all coding style issues.
Benjamin Adolphi [Thu, 31 Dec 2009 08:54:46 +0000 (21:54 +1300)]
Staging: rar: Fix all coding style issues.

This fixes all coding style issues and some spelling mistakes.

Signed-off-by: Benjamin Adolphi <b.adolphi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: rtl8192su: buffer overflow in r8192U_core.c
Dan Carpenter [Wed, 30 Dec 2009 16:10:18 +0000 (18:10 +0200)]
Staging: rtl8192su: buffer overflow in r8192U_core.c

There was a buffer overflow in the original code.  rf_path was 2 and it should
have been only 0 or 1.

I don't have the hardware for this, so I can't test it.

Looking at the code, there are two almost identical sections for updating the
hal variables.  The first one was clearly wrong and had the array overflow as
well.  The second one looked correct.  I decided to use the second section as
is except for whitespace changes.

The differences between the two original sections:
1)  The second one had more debug output.
2)  The second one looped over rf_path instead of corrupting data.
3)  The second one had these additional assigments.
                      if (rf_path == 0) {
                              priv->TxPowerLevelOFDM24G[i] = priv->RfTxPwrLevelOfdm1T[rf_path][i] ;
                              priv->TxPowerLevelCCK[i] = priv->RfTxPwrLevelCck[rf_path][i];
                      }

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: Jerry chuang <wlanfae@realtek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: vt6655/device_main.c: use %pM to shown MAC address
H Hartley Sweeten [Tue, 29 Dec 2009 00:38:22 +0000 (19:38 -0500)]
Staging: vt6655/device_main.c: use %pM to shown MAC address

Trivial, use the %pM kernel extension to display the MAC address.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agor8192U_core.c: use %pM to shown MAC address
H Hartley Sweeten [Tue, 29 Dec 2009 00:33:17 +0000 (19:33 -0500)]
r8192U_core.c: use %pM to shown MAC address

Trivial, use the %pM kernel extension to display the MAC address.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: r8192E_core.c: use %pM to shown MAC address
H Hartley Sweeten [Tue, 29 Dec 2009 00:28:11 +0000 (19:28 -0500)]
Staging: r8192E_core.c: use %pM to shown MAC address

Trivial, use the %pM kernel extension to display the MAC address.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: et131x_netdev.c: use %pM to shown MAC address
H Hartley Sweeten [Tue, 29 Dec 2009 00:21:34 +0000 (19:21 -0500)]
Staging: et131x_netdev.c: use %pM to shown MAC address

Trivial, use the %pM kernel extension to display the MAC address.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Olaf Hartmann <o.hartmann@telovital.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: otus: off by one in usbdrvwext_siwessid()
Dan Carpenter [Mon, 28 Dec 2009 17:01:34 +0000 (19:01 +0200)]
Staging: otus: off by one in usbdrvwext_siwessid()

A 33 char ESSID is too long and it could cause a buffer overflow
a couple lines below when we put a NULL terminator on the end.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: cx25821: off by one in cx25821_enum_input()
Dan Carpenter [Mon, 28 Dec 2009 17:00:24 +0000 (19:00 +0200)]
Staging: cx25821: off by one in cx25821_enum_input()

The INPUT(n) macro indexes an array of size 2.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: cx25821: fix double unlock in medusa_video_init()
Dan Carpenter [Mon, 28 Dec 2009 16:59:46 +0000 (18:59 +0200)]
Staging: cx25821: fix double unlock in medusa_video_init()

medusa_set_videostandard() takes the lock but it always drops it before
returning.

This was found with a static checker and compile tested only.  :/

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: comedi: reorder check in pcmmio_attach()
Dan Carpenter [Mon, 28 Dec 2009 16:59:01 +0000 (18:59 +0200)]
Staging: comedi: reorder check in pcmmio_attach()

The check for dio_num_asics is used to determine if there is more than 1 irq.
If it is false then irq[1] is past the end of the array.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: comedi: off by one in doDevConfig()
Dan Carpenter [Mon, 28 Dec 2009 16:57:51 +0000 (18:57 +0200)]
Staging: comedi: off by one in doDevConfig()

Changed > to >= to avoid array overflow.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: ramzswap: Minor spelling fixes
C yp [Wed, 6 Jan 2010 12:42:00 +0000 (13:42 +0100)]
Staging: ramzswap: Minor spelling fixes

Also removed an extra semicolon.

Signed-off-by: Cyp <cyp561@gmail.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: dt3155: remove compat code
Simon Horman [Thu, 24 Dec 2009 11:42:31 +0000 (22:42 +1100)]
Staging: dt3155: remove compat code

Remove compatibility code as this is not an older version of the kernel.

Signed-off-by: Simon Horman <horms@verge.net.au>
Cc: Scott Smedley <ss@aao.gov.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: rtl8192su, rtl8192u: use min_t() in store_debug_level()
Simon Horman [Wed, 23 Dec 2009 08:54:54 +0000 (19:54 +1100)]
Staging: rtl8192su, rtl8192u: use min_t() in store_debug_level()

sizeof() returns a size_t but the other types involved
are unsigned long, so using min() results in a warning.

As sizeof() is called on an 11 character buffer defined
immediately above unsigned long is obviously wide enough
for the result.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: rtl8192e: remove some functions from the __exit section
Simon Horman [Wed, 23 Dec 2009 08:54:53 +0000 (19:54 +1100)]
Staging: rtl8192e: remove some functions from the __exit section

ieee80211_crypto_tkip_exit(), ieee80211_crypto_deinit() and
ieee80211_crypto_ccmp_exit() are called by ieee80211_rtl_init()
which are in section __init, so they can't be in section __exit.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: rtl8192e: print the elements of tx_pn and rx_pn not the arrays themselves
Simon Horman [Wed, 23 Dec 2009 08:54:52 +0000 (19:54 +1100)]
Staging: rtl8192e: print the elements of tx_pn and rx_pn not the arrays themselves

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: rt2870: Remove unnecessary forward declarations
Simon Horman [Wed, 23 Dec 2009 08:54:51 +0000 (19:54 +1100)]
Staging: rt2870: Remove unnecessary forward declarations

Remove unnecessary forward declaration of rtusb_probe() and rtusb_disconnect()

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: rt2870: rtusb_probe() should be in section __devinit
Simon Horman [Wed, 23 Dec 2009 08:54:50 +0000 (19:54 +1100)]
Staging: rt2870: rtusb_probe() should be in section __devinit

$ make CONFIG_DEBUG_SECTION_MISMATCH=y
WARNING: drivers/staging/rt2870/rt2870sta.o(.text+0x2f4c5): Section
mismatch in reference from the function rtusb_probe() to the function .devinit.text:rt2870_probe()
The function rtusb_probe() references
the function __devinit rt2870_probe().
This is often because rtusb_probe lacks a __devinit
annotation or the annotation of rt2870_probe is wrong.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: DT3155: Use pci_get_device()
Simon Horman [Thu, 24 Dec 2009 11:41:13 +0000 (22:41 +1100)]
Staging: DT3155: Use pci_get_device()

The use of pci_find_device() is deprecated.

Signed-off-by: Simon Horman <horms@verge.net.au>
Cc: Scott Smedley <ss@aao.gov.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: hv: match on DMI values to know if we should run.
Greg Kroah-Hartman [Fri, 26 Feb 2010 00:43:15 +0000 (16:43 -0800)]
Staging: hv: match on DMI values to know if we should run.

The HV core mucks around with specific irqs and other low-level stuff
and takes forever to determine that it really shouldn't be running on a
machine.  So instead, trigger off of the DMI system information and
error out much sooner.  This also allows the module loading tools to
recognize that this code should be loaded on this type of system.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: hv: add a pci device table
Greg Kroah-Hartman [Fri, 26 Feb 2010 00:42:10 +0000 (16:42 -0800)]
Staging: hv: add a pci device table

This allows the HV core to be properly found and autoloaded
by the system tools.

It uses the Microsoft virtual VGA device to trigger this.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: hv: fix brace coding style issue in Channel.c
Chris Nicholson [Sat, 20 Feb 2010 20:36:23 +0000 (20:36 +0000)]
Staging: hv: fix brace coding style issue in Channel.c

This is a patch to the Channel.c file that fixes up a brace
warning found by checkpatch.pl

Signed-off-by: Chris Nicholson <chris.nicholson@cnick.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: hv: Rename struct device_context and re-arrange the fields inside
Haiyang Zhang [Wed, 17 Feb 2010 20:58:47 +0000 (20:58 +0000)]
Staging: hv: Rename struct device_context and re-arrange the fields inside

Rename struct device_context and re-arrange the fields inside.

Rename struct device_context to struct vm_device, and move struct device
field to the end according to Document/driver-model standard.

Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: hv: Add proper versioning to HV drivers
Hank Janssen [Thu, 11 Feb 2010 23:02:42 +0000 (23:02 +0000)]
Staging: hv: Add proper versioning to HV drivers

Provide proper versioning information for all HV drivers.

With removal of build time/date/and Minor number as requested by Greg KH

Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyang@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: hv: fix various coding style issues in RingBuffer.c
C. Bartlett [Wed, 3 Feb 2010 15:34:27 +0000 (15:34 +0000)]
Staging: hv: fix various coding style issues in RingBuffer.c

This is a patch to the RingBuffer.c file that corrects various coding style
warnings and errors found by checkpatch.pl

[ The real solution here is to get rid of this file entirely, and use the
kernel's internal ring buffer api, but until then, make these changes so as to
make checkpatch.pl happy, and keep others from continuously sending this type
of patch. - gkh]

Signed-off-by: Craig Bartlett <c-bartlett@hotmail.co.uk>
Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Nicolas Palix <npalix@diku.dk>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: hv: Remove xen legacy code and check for Hyper-V
Hank Janssen [Fri, 22 Jan 2010 19:17:50 +0000 (19:17 +0000)]
Staging: hv: Remove xen legacy code and check for Hyper-V

Removed legacy XEN layer from hypervisor setup, and made sure only
Hyper-V is Is a valid hypervisor to run on.

Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: hv: remove unneeded OnClose callback
Greg Kroah-Hartman [Fri, 8 Jan 2010 18:25:01 +0000 (10:25 -0800)]
Staging: hv: remove unneeded OnClose callback

This callback only calls one function, so just call the function
instead, no need for indirection at all.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: hv: remove unneeded OnOpen callback
Greg Kroah-Hartman [Fri, 8 Jan 2010 18:24:42 +0000 (10:24 -0800)]
Staging: hv: remove unneeded OnOpen callback

This callback only calls one function, so just call the function
instead, no need for indirection at all.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: hv: remove unneeded OnHostReset callback
Greg Kroah-Hartman [Fri, 8 Jan 2010 18:24:26 +0000 (10:24 -0800)]
Staging: hv: remove unneeded OnHostReset callback

This callback only calls one function, so just call the function
instead, no need for indirection at all.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: hv: storvsc_drv: move unused functions
Greg Kroah-Hartman [Fri, 8 Jan 2010 18:21:58 +0000 (10:21 -0800)]
Staging: hv: storvsc_drv: move unused functions

Now that the callback pointer was removed, we can remove
the code itself, as it is never used.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: hv: remove unneeded OnHostRescan callback
Greg Kroah-Hartman [Fri, 8 Jan 2010 18:20:27 +0000 (10:20 -0800)]
Staging: hv: remove unneeded OnHostRescan callback

This callback was never called, so delete the thing.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: batman-adv: Dont deactivate aggregation on wrong input
Linus Lüssing [Sat, 2 Jan 2010 10:30:52 +0000 (11:30 +0100)]
Staging: batman-adv: Dont deactivate aggregation on wrong input

A non-integer changes the aggregation mode. Therefore this patch changes
the behaviour to explicitly check strict_strtoul()'s return code.

Signed-off-by: Linus Lüssing <linus.luessing@web.de>
Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: batman-adv: Remove compat.h
Simon Wunderlich [Sat, 2 Jan 2010 10:30:51 +0000 (11:30 +0100)]
Staging: batman-adv: Remove compat.h

Since we are now part of mainline, we don't need compat.h to allow
building of the module with old versions of the kernel.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: batman-adv: Use printk(%pM) for MAC addresses
Andrew Lunn [Sat, 2 Jan 2010 10:30:50 +0000 (11:30 +0100)]
Staging: batman-adv: Use printk(%pM) for MAC addresses

printk() since kernel version 2.6.29 has supported printing MAC
addresses directly, as an extension to the %p processing. This patch
makes use of this for printk() and bat_dbg(). This will remove the
overhead of using addr_to_string() which is normally never actually
output.

Fixed a typo found by Gus Wirth.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: batman-adv: Allow the MAC address to be set
Andrew Lunn [Sat, 2 Jan 2010 10:30:49 +0000 (11:30 +0100)]
Staging: batman-adv: Allow the MAC address to be set

Some embedded devices have very limited sources of entropy for the
random number generator. It has been observed that the random MAC
address on the interface bat0 is not always random. When testing with
a collection of identical hardware, sometimes the bat0 device the same
MAC address on multiple devices, causing mayhem. This patch allows the
MAC address to be set by the user.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: batman-adv: receive packets directly using skbs
Simon Wunderlich [Sat, 2 Jan 2010 10:30:48 +0000 (11:30 +0100)]
Staging: batman-adv: receive packets directly using skbs

This patch removes the (ugly and racy) packet receiving thread and the
kernel socket usage. Instead, packets are received directly by registering
the ethernet type and handling skbs instead of self-allocated buffers.

Some consequences and comments:

 * we don't copy the payload data when forwarding/sending/receiving data
   anymore. This should boost performance.
 * packets from/to different interfaces can be (theoretically) processed
   simultaneously. Only the big originator hash lock might be in the way.
 * no more polling or sleeping/wakeup/scheduling issues when receiving
   packets
 * this might introduce new race conditions.
 * aggregation and vis code still use packet buffers and are not (yet)
   converted.
 * all spinlocks were converted to irqsave/restore versions to solve
   some lifelock issues when preempted. This might be overkill, some
   of these locks might be reverted later.
 * skb copies are only done if neccesary to avoid overhead

performance differences:

 * we made some "benchmarks" with intel laptops.
 * bandwidth on Gigabit Ethernet increased from ~500 MBit/s to ~920 MBit/s
 * ping latency decresed from ~2ms to ~0.2 ms

I did some tests on my 9 node qemu environment and could confirm that
usual sending/receiving, forwarding, vis, batctl ping etc works.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Acked-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Acked-by: Marek Lindner <lindner_marek@yahoo.de>
Acked-by: Linus Lüssing <linus.luessing@web.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: batman-adv: check all kmalloc()s
Simon Wunderlich [Sat, 2 Jan 2010 10:30:47 +0000 (11:30 +0100)]
Staging: batman-adv: check all kmalloc()s

there are some kmallocs left which are not checked whether they succeeds or
not, which might lead to corrupted data structures if the system memory is
full. This patch should clean up the remaining unchecked kmalloc()s.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: batman-adv: splitting /proc vis file into vis_server and vis_data
Marek Lindner [Sat, 2 Jan 2010 10:30:46 +0000 (11:30 +0100)]
Staging: batman-adv: splitting /proc vis file into vis_server and vis_data

The /proc vis file was used to enable/disable the vis server and to output
the vis data at the same time. This behaviour was confusing and lacked a
proper method to display the current vis server status.
This patch seperates the 2 functionalities:
* use vis_server to enable/disable the vis server and to retrieve its status
* use vis_data to retrieve the vis raw data (if the server is enabled)

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: batman-adv: remove obsoleted vis_format /proc file
Linus Luessing [Sat, 2 Jan 2010 10:30:45 +0000 (11:30 +0100)]
Staging: batman-adv: remove obsoleted vis_format /proc file

batman-adv used to export the vis data using different formats that were
switchable via /proc/net/batman-adv/vis_format. The various formats moved
to user space and rendered this configuration switch useless.

Signed-off-by: Linus Luessing <linus.luessing@web.de>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: batman-adv: moving vis output formats out of the kernel
Andrew Lunn [Sat, 2 Jan 2010 10:30:44 +0000 (11:30 +0100)]
Staging: batman-adv: moving vis output formats out of the kernel

The batman-adv kernel module is able to output visualization data using the
dot draw or JSON format. This patch transforms the output into a generic
format (called vis raw). User space tool may convert the raw data to support
a variety of formats without the need of modifying the kernel module.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: batman-adv: fix minor orig table layout bug
Marek Lindner [Sat, 2 Jan 2010 10:30:43 +0000 (11:30 +0100)]
Staging: batman-adv: fix minor orig table layout bug

The originator table contained a TAB instead of a space which broke
the layout as well as the batctl parser.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: batman-adv: Fixes rounding issues in vis.c
Linus Lüssing [Sat, 2 Jan 2010 10:30:42 +0000 (11:30 +0100)]
Staging: batman-adv: Fixes rounding issues in vis.c

This patches fixes two rounding issues in vis.c for sending and
purging vis packets. Before, the timers and timeouts always got
rounded down to seconds, though we want a precision in
milliseconds.

This also fixes a kernel panic that occures when lowering the
timer for sending vis packets (vis_interval) to less than 1000ms
in main.c manually.

Signed-off-by: Linus Lüssing <linus.luessing@web.de>
Acked-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: batman-adv: Use forw_bcast_list_lock always with disabled interrupts
Sven Eckelmann [Sat, 2 Jan 2010 10:30:41 +0000 (11:30 +0100)]
Staging: batman-adv: Use forw_bcast_list_lock always with disabled interrupts

forw_bcast_list_lock is spin_locked in both process and softirq context.
SoftIRQ calls the spinlock with disabled IRQ and normal process context
with enabled IRQs.

When process context is inside an spin_locked area protected by
forw_bcast_list_lock and gets interrupted by an IRQ, it could happen
that something tries to lock forw_bcast_list_lock again in SoftIRQ
context. It cannot proceed further since the lock is already taken
somewhere else, but no reschedule will happen inside the SoftIRQ
context. This leads to an complete kernel hang without any chance of
resurrection.

All functions called in process context must disable IRQs when they try
to get get that lock to to prevent any reschedule due to IRQs.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Acked-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoStaging: batman-adv: consistent spelling of "neighbors"
Simon Wunderlich [Sat, 2 Jan 2010 10:30:40 +0000 (11:30 +0100)]
Staging: batman-adv: consistent spelling of "neighbors"

we have written "neighbors", "neighbours" and bad spelled versions of this
word, this patch should make it consistent.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>