]> pilppa.com Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
15 years agoStaging: at76_usb: update drivers/staging/at76_usb w/ mac80211 port
John W. Linville [Fri, 24 Oct 2008 19:48:59 +0000 (15:48 -0400)]
Staging: at76_usb: update drivers/staging/at76_usb w/ mac80211 port

This updates drivers/staging/at76_usb to correspond with the latest
version previously available in wireless-testing.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: skb_p80211_to_ether() - payload_length is unsigned, check before...
Roel Kluin [Tue, 2 Dec 2008 23:06:39 +0000 (00:06 +0100)]
Staging: wlan-ng: skb_p80211_to_ether() - payload_length is unsigned, check before subtraction

payload_length is unsigned, check before subtraction

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
15 years agoStaging: wlan-ng: fix compiler warnings
Greg Kroah-Hartman [Thu, 13 Nov 2008 23:37:47 +0000 (15:37 -0800)]
Staging: wlan-ng: fix compiler warnings

This fixes some compiler warnings in teh wlan-ng driver.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: p80211wext.c: use ARRAY_SIZE
Julia Lawall [Sun, 9 Nov 2008 16:56:34 +0000 (17:56 +0100)]
Staging: wlan-ng: p80211wext.c: use ARRAY_SIZE

ARRAY_SIZE is more concise to use when the size of an array is divided by
the size of its type or the size of its first element.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@i@
@@

#include <linux/kernel.h>

@depends on i using "paren.iso"@
type T;
T[] E;
@@

- (sizeof(E)/sizeof(E[...]))
+ ARRAY_SIZE(E)

@depends on i using "paren.iso"@
type T;
T[] E;
@@

- (sizeof(E)/sizeof(T))
+ ARRAY_SIZE(E)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: remove unused #include <version.h>
Huang Weiyi [Fri, 31 Oct 2008 14:49:56 +0000 (22:49 +0800)]
Staging: wlan-ng: remove unused #include <version.h>

The file(s) below do not use LINUX_VERSION_CODE nor KERNEL_VERSION.
  drivers/staging/wlan-ng/p80211conv.c
  drivers/staging/wlan-ng/p80211req.c
  drivers/staging/wlan-ng/p80211wext.c
  drivers/staging/wlan-ng/prism2mgmt.c

This patch removes the said #include <version.h>.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: p80211conv.c copy code from wlan-ng-devel branch to not drop packets
Richard Kennedy [Mon, 3 Nov 2008 11:24:54 +0000 (11:24 +0000)]
Staging: wlan-ng: p80211conv.c copy code from wlan-ng-devel branch to not drop packets

allow card to correctly receive network packets,
without this change all incoming packets are dropped.
code copied from the latest wlan-ng-devel tree.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: hfa384x_usbin_callback: check for hardware removed
Richard Kennedy [Mon, 3 Nov 2008 11:22:43 +0000 (11:22 +0000)]
Staging: wlan-ng: hfa384x_usbin_callback: check for hardware removed

hfa384x_usbin_callback: check for hardware removed

copied from latest wlan-ng-devel version

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: p80211wext don't set default key id twice
Richard Kennedy [Mon, 3 Nov 2008 11:21:30 +0000 (11:21 +0000)]
Staging: wlan-ng: p80211wext don't set default key id twice

p80211wext don't set default key id twice

another change from wlan-ng-devel

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: p80211wext.c add latest changes & remove extra nulls from wext_handlers
Richard Kennedy [Mon, 3 Nov 2008 11:20:04 +0000 (11:20 +0000)]
Staging: wlan-ng: p80211wext.c add latest changes & remove extra nulls from wext_handlers

add the latest changes from wlan-ng-devel
remove 2 stray nulls from the wext_handler table introduced
by the tidy up patch.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: hfa384x_usb.c use newest version of 384x_drvr_start
Richard Kennedy [Mon, 3 Nov 2008 11:16:09 +0000 (11:16 +0000)]
Staging: wlan-ng: hfa384x_usb.c use newest version of 384x_drvr_start

include the needed fixes from Karl Relton
<karllinuxtest.relton@ntlworld.com>

see thread on linux-wlan-devel mailing list
"Possible cause of those pesky hfa384x_usbctlx_complete_sync errors"

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Cc: Karl Relton <karllinuxtest.relton@ntlworld.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: prism2_usb.c always enable the card in probe_usb
Richard Kennedy [Mon, 3 Nov 2008 11:13:48 +0000 (11:13 +0000)]
Staging: wlan-ng: prism2_usb.c always enable the card in probe_usb

always enable card in probe_usb
& update register_wlandev to match latest wlan-ng-dev tree.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: p80211netdev.c fix netdev alloc to prevent oops on device start
Richard Kennedy [Mon, 3 Nov 2008 11:09:34 +0000 (11:09 +0000)]
Staging: wlan-ng: p80211netdev.c fix netdev alloc to prevent oops on device start

a version of this patch is in the wlan-ng_devel tree

initializes netdev correctly to prevent an oops on device start.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Purge all MIBs not used internally.
Solomon Peachy [Wed, 29 Oct 2008 14:43:00 +0000 (10:43 -0400)]
Staging: wlan-ng: Purge all MIBs not used internally.

The next step is to bypass the MIB calling mechanism altogether and just
invoke the hardware directly where needed, but at least now the list has
been paired down considerably.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Consolidate wlan-ng into a single module.
Solomon Peachy [Wed, 29 Oct 2008 14:42:59 +0000 (10:42 -0400)]
Staging: wlan-ng: Consolidate wlan-ng into a single module.

There's no point in having a separate 'p80211' module, as nobody else is
ever going to use it.  Push everyting into a single module, and get rid
of all exports.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Delete a pile of unused mibs. And fix WEXT SET_TXPOWER.
Solomon Peachy [Wed, 29 Oct 2008 14:42:58 +0000 (10:42 -0400)]
Staging: wlan-ng: Delete a pile of unused mibs. And fix WEXT SET_TXPOWER.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Delete a large pile of now-unused code.
Solomon Peachy [Wed, 29 Oct 2008 14:42:57 +0000 (10:42 -0400)]
Staging: wlan-ng: Delete a large pile of now-unused code.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: use WIRELESS_EXT, not CONFIG_WIRELESS_EXT
Solomon Peachy [Wed, 29 Oct 2008 14:42:56 +0000 (10:42 -0400)]
Staging: wlan-ng: use WIRELESS_EXT, not CONFIG_WIRELESS_EXT

Kconfig doesn't work with variables starting with CONFIG_

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Wireless Extension support is mandatory.
Solomon Peachy [Wed, 29 Oct 2008 14:42:55 +0000 (10:42 -0400)]
Staging: wlan-ng: Wireless Extension support is mandatory.

So take away the option to disable it.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Eliminate all backwards-compatible kernel code.
Solomon Peachy [Wed, 29 Oct 2008 14:42:54 +0000 (10:42 -0400)]
Staging: wlan-ng: Eliminate all backwards-compatible kernel code.

It's not needed at all anymore now that we are in the kernel tree.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Use standard kernel integer (u32/s32/etc) types.
Solomon Peachy [Wed, 29 Oct 2008 14:42:53 +0000 (10:42 -0400)]
Staging: wlan-ng: Use standard kernel integer (u32/s32/etc) types.

wlan-ng needed to interact with userspace, and support very old kernels,
so it used to define its own types for integers to ensure consistency.

It's all rather irrelevant now.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Eliminate usage of procfs.
Solomon Peachy [Mon, 27 Oct 2008 15:14:06 +0000 (11:14 -0400)]
Staging: wlan-ng: Eliminate usage of procfs.

These files are not needed to work properly, and don't belong in procfs

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Eliminate local 'version.h'
Solomon Peachy [Mon, 27 Oct 2008 15:14:05 +0000 (11:14 -0400)]
Staging: wlan-ng: Eliminate local 'version.h'

The kernel provides us with the proper version of this file.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Eliminate one more rx mtu test.
Solomon Peachy [Mon, 27 Oct 2008 15:14:04 +0000 (11:14 -0400)]
Staging: wlan-ng: Eliminate one more rx mtu test.

It also isn't needed.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Get rid of the MTU tests in the rx conversion path.
Solomon Peachy [Mon, 27 Oct 2008 15:14:03 +0000 (11:14 -0400)]
Staging: wlan-ng: Get rid of the MTU tests in the rx conversion path.

They are not needed.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Remove AP-only code from MLME functions.
Solomon Peachy [Mon, 27 Oct 2008 15:14:02 +0000 (11:14 -0400)]
Staging: wlan-ng: Remove AP-only code from MLME functions.

It is not needed in this driver.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Eliminate a boatload of tertiaryAP-only code.
Solomon Peachy [Mon, 27 Oct 2008 15:14:01 +0000 (11:14 -0400)]
Staging: wlan-ng: Eliminate a boatload of tertiaryAP-only code.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Eliminate all backwards-compatibility for <2.6.13 kernels.
Solomon Peachy [Mon, 27 Oct 2008 15:14:00 +0000 (11:14 -0400)]
Staging: wlan-ng: Eliminate all backwards-compatibility for <2.6.13 kernels.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Eliminate more <2.6 kernel support.
Solomon Peachy [Mon, 27 Oct 2008 15:13:59 +0000 (11:13 -0400)]
Staging: wlan-ng: Eliminate more <2.6 kernel support.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Make wlan-ng use WEXT mode by default.
Solomon Peachy [Mon, 27 Oct 2008 15:13:58 +0000 (11:13 -0400)]
Staging: wlan-ng: Make wlan-ng use WEXT mode by default.

As this is the kernel default mode.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Delete PCI/PLX/PCMCIA-specific code.
Solomon Peachy [Mon, 27 Oct 2008 15:13:57 +0000 (11:13 -0400)]
Staging: wlan-ng: Delete PCI/PLX/PCMCIA-specific code.

Also delete a large pile of code that existed to support <2.6 kernels.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Update Help text to mention prism3 devices.
Solomon Peachy [Mon, 27 Oct 2008 15:13:56 +0000 (11:13 -0400)]
Staging: wlan-ng: Update Help text to mention prism3 devices.

The driver also supports prism3 devices

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: wlan-ng: Remove PCI/PLX/PCMCIA files.
Solomon Peachy [Mon, 27 Oct 2008 15:13:55 +0000 (11:13 -0400)]
Staging: wlan-ng: Remove PCI/PLX/PCMCIA files.

This portion of the driver is not needed at all, so remove it.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: fix config build warnings
Greg Kroah-Hartman [Mon, 5 Jan 2009 18:46:00 +0000 (10:46 -0800)]
Staging: w35und: fix config build warnings

the wireless config function has changed with commit
e8975581f63870be42ff4662b293d1b0c8c21350 so fix up the wbusb driver to
work properly with that change.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: fix Kconfig
Pavel Machek [Mon, 24 Nov 2008 09:18:29 +0000 (10:18 +0100)]
Staging: w35und: fix Kconfig

4KSTACK dependency was needed when driver carried its own softmac
layer. That layer is gone, and functions have reasonably small stack
footprint -> dependency can be removed.

Add better description of hardware this driver is targetted at (now
with fixed whitespace)

Signed-off-by: Pavel Machek <pavel@suse.cz>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove rxisr.c as dead code
Pekka Enberg [Thu, 30 Oct 2008 17:04:56 +0000 (19:04 +0200)]
Staging: w35und: remove rxisr.c as dead code

The vRxTimerStart() function is never called nor does the timer do anything
useful so remove the code.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove dead code from wbhal.c
Pekka Enberg [Thu, 30 Oct 2008 17:04:55 +0000 (19:04 +0200)]
Staging: w35und: remove dead code from wbhal.c

Remove tons of unused code from wbhal.c.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: make functions local to wb35tx.c static
Pekka Enberg [Thu, 30 Oct 2008 17:04:54 +0000 (19:04 +0200)]
Staging: w35und: make functions local to wb35tx.c static

While there are no functional changes, the diff is quite large because we need
to shuffle code around to avoid forward declarations.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: make functions local to wb35rx.c static
Pekka Enberg [Thu, 30 Oct 2008 17:04:53 +0000 (19:04 +0200)]
Staging: w35und: make functions local to wb35rx.c static

While there are no functional changes, the diff is quite large because we need
to shuffle code around to avoid forward declarations.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove dead code from mto.c
Pekka Enberg [Thu, 30 Oct 2008 17:04:52 +0000 (19:04 +0200)]
Staging: w35und: remove dead code from mto.c

Remove lots of code that's never used.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: make functions local to mlmetxrx.c static
Pekka Enberg [Thu, 30 Oct 2008 17:04:51 +0000 (19:04 +0200)]
Staging: w35und: make functions local to mlmetxrx.c static

Convert functions that don't have external references to static and remove the
ones that are not used at all.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: make functions local to mds.c static
Pekka Enberg [Thu, 30 Oct 2008 17:04:50 +0000 (19:04 +0200)]
Staging: w35und: make functions local to mds.c static

The functions have no external references so make them static after shuffling
the code around a bit to avoid forward declarations.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
15 years agoStaging: w35und: remove ->shutdown from struct wbsoft_priv
Pekka Enberg [Thu, 30 Oct 2008 16:12:07 +0000 (18:12 +0200)]
Staging: w35und: remove ->shutdown from struct wbsoft_priv

It's not actually used for anything, so remove it.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove ->skb_array from struct wbsoft_priv
Pekka Enberg [Thu, 30 Oct 2008 16:12:06 +0000 (18:12 +0200)]
Staging: w35und: remove ->skb_array from struct wbsoft_priv

It's not actually used for anything, so remove it.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: move packet_came() to wb35rx.c
Pekka Enberg [Thu, 30 Oct 2008 16:12:05 +0000 (18:12 +0200)]
Staging: w35und: move packet_came() to wb35rx.c

The function no longer has dependencies to wbusb.c so we can move it to
wb35rx.c and make it static now.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: move global wbsoft_enabled to struct wbsoft_priv
Pekka Enberg [Thu, 30 Oct 2008 16:12:04 +0000 (18:12 +0200)]
Staging: w35und: move global wbsoft_enabled to struct wbsoft_priv

This is a preparational step for moving packet_came() to wb35rx.c().

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove unused ->ShutDowned member from struct LOCAL_PARA
Pekka Enberg [Thu, 30 Oct 2008 16:12:03 +0000 (18:12 +0200)]
Staging: w35und: remove unused ->ShutDowned member from struct LOCAL_PARA

It's not actually read by anyone so we might as well remove it.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: clean up wblinux.c a bit
Pekka Enberg [Thu, 30 Oct 2008 16:12:02 +0000 (18:12 +0200)]
Staging: w35und: clean up wblinux.c a bit

This patch removes wrapper functions from wblinux.c and moves the hardware init
and halt functions to wbusb.c which has the only callers of them.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: inline DRIVER_AUTHOR and DRIVER_DESC macros
Pekka Enberg [Thu, 30 Oct 2008 16:12:01 +0000 (18:12 +0200)]
Staging: w35und: inline DRIVER_AUTHOR and DRIVER_DESC macros

They're used in one place so we can inline them.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove global struct ieee80211_hw
Pekka Enberg [Thu, 30 Oct 2008 14:14:39 +0000 (16:14 +0200)]
Staging: w35und: remove global struct ieee80211_hw

Remove the my_dev global variable from wbusb.c by passing a pointer to struct
ieee80211_hw around so that packet_came() gets it.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: merge struct wb35_adapter to struct wbsoft_priv
Pekka Enberg [Thu, 30 Oct 2008 14:14:38 +0000 (16:14 +0200)]
Staging: w35und: merge struct wb35_adapter to struct wbsoft_priv

This patch merges struct wb35_adapter to struct wbsoft_priv. Now we can finally
start passing a pointer to struct ieee80211_hw around where necessary.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: clean up adapter.h a bit
Pekka Enberg [Thu, 30 Oct 2008 14:14:37 +0000 (16:14 +0200)]
Staging: w35und: clean up adapter.h a bit

This patch cleans up adapter.h a bit in preparation for merging struct
wb35_adapter to struct wbsoft_priv.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove ->adapter from struct _HW_DATA_T
Pekka Enberg [Thu, 30 Oct 2008 14:14:36 +0000 (16:14 +0200)]
Staging: w35und: remove ->adapter from struct _HW_DATA_T

Eventually we want to pass a pointer to struct ieee80211_hw around in the
driver, so remove the bidirectional link between struct wb35_adapter and struct
_HW_DATA_T to simplify the code.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: move struct wbsoft_priv to core.h and use it
Pekka Enberg [Thu, 30 Oct 2008 14:14:35 +0000 (16:14 +0200)]
Staging: w35und: move struct wbsoft_priv to core.h and use it

This patch removes my_adapter global variable from wbusb.c by adding a
->adapter member to struct wbsoft_priv.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: move source files to one directory
Pekka Enberg [Thu, 30 Oct 2008 11:05:42 +0000 (13:05 +0200)]
Staging: w35und: move source files to one directory

As we're trying to get rid of the "compatability layer" in the driver, move
everything under one directory. Keeping some of the files under
drivers/staging/winbond/linux is a major pain in the ass whenever you're
cleaning up the driver.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove some dead code
Pekka Enberg [Thu, 30 Oct 2008 11:04:58 +0000 (13:04 +0200)]
Staging: w35und: remove some dead code

This patch removes the WBLinux_ReceivePacket(), WBLINUX_GetNextPacket(),
WBLINUX_GetNextPacketCompleted, and sme_get_rssi() functions, which execute
BUG() unconditionally, and related dead code.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: #include cleanup
Pekka Enberg [Thu, 30 Oct 2008 11:04:29 +0000 (13:04 +0200)]
Staging: w35und: #include cleanup

This patch moves #includes from sysdef.h and common.h to the files which
actually need them. This makes the dependencies less complex and allows us to
move code around much easily.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
15 years agoStaging: w35und: remove unused link status code
Pekka Enberg [Wed, 29 Oct 2008 18:12:08 +0000 (20:12 +0200)]
Staging: w35und: remove unused link status code

The WBLINUX_ConnectStatus() and related code is not used anywhere so remove
them from the driver.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove unused macros from common.h
Pekka Enberg [Wed, 29 Oct 2008 18:11:49 +0000 (20:11 +0200)]
Staging: w35und: remove unused macros from common.h

The macros are not used anywhere so remove them from driver code.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove abs() and BIT() macros
Pekka Enberg [Wed, 29 Oct 2008 18:11:13 +0000 (20:11 +0200)]
Staging: w35und: remove abs() and BIT() macros

We can use the kernel built-in abs() and BIT() macros the just fine.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove memcpy/memcmp wrappers
Pekka Enberg [Wed, 29 Oct 2008 18:10:55 +0000 (20:10 +0200)]
Staging: w35und: remove memcpy/memcmp wrappers

The OS_MEMORY_CLEAR macro is not used so remove it. Also convert the one
call-site that uses OS_MEMORY_COMPARE to use memcmp() directly and remove the
wrapper macro.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove atomic op wrappers
Pekka Enberg [Wed, 29 Oct 2008 18:10:32 +0000 (20:10 +0200)]
Staging: w35und: remove atomic op wrappers

Use the kernel provided atomic op functions and remove the OS_ATOMIC and
related wrapper macros.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove timer wrappers
Pekka Enberg [Wed, 29 Oct 2008 18:10:10 +0000 (20:10 +0200)]
Staging: w35und: remove timer wrappers

This patch removes the OS_TIMER and related wrappers from driver code. The
patch also changes the code to use msecs_to_jiffies() for setting up
timer->expires.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: move supported band initialization out of wb35_probe()
Pekka Enberg [Mon, 27 Oct 2008 22:20:03 +0000 (00:20 +0200)]
Staging: w35und: move supported band initialization out of wb35_probe()

This patch moves the static struct ieee80211_supported_band initialization out
of w35_probe() because it's really global read-only configuration data.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: plug memory leak in wbsoft_tx()
Pekka Enberg [Mon, 27 Oct 2008 22:14:38 +0000 (00:14 +0200)]
Staging: w35und: plug memory leak in wbsoft_tx()

There's no reason to duplicate the skb in wbsoft_tx() and leak GFP_ATOMIC
memory as the contents are copied to ->TxBuffer in MdxTx() anyway before
MLMESendFrame() returns.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove macro magic from MLME_GetNextPacket()
Pekka Enberg [Mon, 27 Oct 2008 22:14:14 +0000 (00:14 +0200)]
Staging: w35und: remove macro magic from MLME_GetNextPacket()

This removes the macro magic from MLME_GetNextPacket() to de-obfuscate the
code.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: usb_put_dev() is missing from wb35_disconnect()
Pekka Enberg [Mon, 27 Oct 2008 21:29:31 +0000 (23:29 +0200)]
Staging: w35und: usb_put_dev() is missing from wb35_disconnect()

The wb35_probe() function does usb_get_dev() so add a missing usb_put_dev() to
the wb35_disconnect() function. Also fix error handling paths in wb35_probe()
to call usb_put_dev() as well.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: OS_MEMORY_ALLOC wrapper removal
Pekka Enberg [Mon, 27 Oct 2008 20:47:12 +0000 (22:47 +0200)]
Staging: w35und: OS_MEMORY_ALLOC wrapper removal

This patch removes the rather scary OS_MEMORY_ALLOC macro.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove true/false boolean macros
Pekka Enberg [Mon, 27 Oct 2008 20:46:39 +0000 (22:46 +0200)]
Staging: w35und: remove true/false boolean macros

Use the kernel built-in true and false boolean values instead of duplicating
them in the driver code.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agow35und: remove dead code from wbusb_f.h
Pekka Enberg [Mon, 27 Oct 2008 20:44:19 +0000 (22:44 +0200)]
w35und: remove dead code from wbusb_f.h

Remove dead code from wbusb_f.h and move the WbWLanInitialize() definition to
wblinux_f.h where it arguably belongs to. As the wbusb_f.h is now empty, we can
remove it completely.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove usb_alloc_urb wrapper function
Greg Kroah-Hartman [Mon, 27 Oct 2008 21:21:24 +0000 (14:21 -0700)]
Staging: w35und: remove usb_alloc_urb wrapper function

No need for a simple wrapper here.

Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove usb_submit_urb wrapper function
Greg Kroah-Hartman [Mon, 27 Oct 2008 21:21:24 +0000 (14:21 -0700)]
Staging: w35und: remove usb_submit_urb wrapper function

No need for a simple wrapper here.

Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: wb35_probe() cleanup
Pekka Enberg [Wed, 22 Oct 2008 08:04:23 +0000 (11:04 +0300)]
Staging: w35und: wb35_probe() cleanup

Fix error handling in wb35_probe() function and clean it up a bit.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: merge wblinux struct to adapter
Pekka Enberg [Wed, 22 Oct 2008 08:03:54 +0000 (11:03 +0300)]
Staging: w35und: merge wblinux struct to adapter

Zaps another compatability layer from the driver code.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: padapter struct typedef removal
Pekka Enberg [Wed, 22 Oct 2008 08:03:19 +0000 (11:03 +0300)]
Staging: w35und: padapter struct typedef removal

Remove the PADAPTER typedef and its strange variants. Also fix up variable
names that use the type while we're at it.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: wb35reg struct typedef removal
Pekka Enberg [Wed, 22 Oct 2008 08:02:37 +0000 (11:02 +0300)]
Staging: w35und: wb35reg struct typedef removal

This patch removes the WB35REG struct typedefs and fixes up variable names that
use the type.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: reg queue struct typedef removal
Pekka Enberg [Wed, 22 Oct 2008 08:01:47 +0000 (11:01 +0300)]
Staging: w35und: reg queue struct typedef removal

This patch removes the struct typedefs for reg queues.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: purb typedef removal
Pekka Enberg [Wed, 22 Oct 2008 08:01:16 +0000 (11:01 +0300)]
Staging: w35und: purb typedef removal

This patch removes the struct urb pointer typedef from the driver code and
fixes up variable names that use the typedef while we're at it.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove the no-op pa_stall_execution macro
Pekka Enberg [Wed, 22 Oct 2008 16:07:26 +0000 (19:07 +0300)]
Staging: w35und: remove the no-op pa_stall_execution macro

The pa_stall_execution() macro doesn't do anything so remove it from driver
code.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: use msleep() and udelay()
Pekka Enberg [Wed, 22 Oct 2008 16:07:03 +0000 (19:07 +0300)]
Staging: w35und: use msleep() and udelay()

This patch removes the OS_SLEEP() wrapper and changes the call-sites to use
msleep() and udelay() where appropriate.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: remove unused wb35_open() and wb35_close() functions
Pekka Enberg [Wed, 22 Oct 2008 16:06:13 +0000 (19:06 +0300)]
Staging: w35und: remove unused wb35_open() and wb35_close() functions

The functions are not used anywhere so remove them.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: w35und: make wb35_probe() and wb35_disconnect() funtions static
Pekka Enberg [Wed, 22 Oct 2008 16:05:54 +0000 (19:05 +0300)]
Staging: w35und: make wb35_probe() and wb35_disconnect() funtions static

The wb35_probe() and wb35_disconnect() functions are only used in wbusb.c so
make them static and remove them from a header file.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agostaging: correct dubious use of !x & y
Harvey Harrison [Wed, 22 Oct 2008 03:27:16 +0000 (20:27 -0700)]
staging: correct dubious use of !x & y

Noticed by sparse:
drivers/staging/me4000/me4000.c:1213:43: warning: dubious: !x & y
drivers/staging/wlan-ng/p80211wext.c:1583:21: warning: dubious: !x & y

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: Kconfig for ARCH=arm,8300, cris
F. Duncan M. Haldane [Fri, 7 Nov 2008 23:17:51 +0000 (18:17 -0500)]
Staging: Kconfig for ARCH=arm,8300, cris

The new Kconfig option to build "staging" drivers (code in
drivers/staging/) is seen in all except three architectures (arm, h8300,
cris), because in these cases arch/$ARCH/Kconfig does NOT source
drivers/Kconfig.

This patch adds the source "drivers/staging/Kconfig" to
arch/$ARCH/Kconfig for these three exceptional cases.

Signed-off-by: Duncan Haldane <duncan_h@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: go7007: fixes due v4l2_file_operations api change
Greg Kroah-Hartman [Mon, 5 Jan 2009 18:21:08 +0000 (10:21 -0800)]
Staging: go7007: fixes due v4l2_file_operations api change

v4l2_file_operations was introduced, so use it to fix up
the build errors in the go7007 driver.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: go7007: fixes due to video_usercopy api change
Greg Kroah-Hartman [Mon, 5 Jan 2009 18:21:08 +0000 (10:21 -0800)]
Staging: go7007: fixes due to video_usercopy api change

video_usercopy() just changed its arguments, so fix up the go7007 driver
to properly build.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
Linus Torvalds [Tue, 6 Jan 2009 03:20:59 +0000 (19:20 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm

* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm:
  dm snapshot: extend exception store functions
  dm snapshot: split out exception store implementations
  dm snapshot: rename struct exception_store
  dm snapshot: separate out exception store interface
  dm mpath: move trigger_event to system workqueue
  dm: add name and uuid to sysfs
  dm table: rework reference counting
  dm: support barriers on simple devices
  dm request: extend target interface
  dm request: add caches
  dm ioctl: allow dm_copy_name_and_uuid to return only one field
  dm log: ensure log bitmap fits on log device
  dm log: move region_size validation
  dm log: avoid reinitialising io_req on every operation
  dm: consolidate target deregistration error handling
  dm raid1: fix error count
  dm log: fix dm_io_client leak on error paths
  dm snapshot: change yield to msleep
  dm table: drop reference at unbind

15 years agodm snapshot: extend exception store functions
Jonathan Brassow [Tue, 6 Jan 2009 03:05:19 +0000 (03:05 +0000)]
dm snapshot: extend exception store functions

Supply dm_add_exception as a callback to the read_metadata function.
Add a status function ready for a later patch and name the functions
consistently.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm snapshot: split out exception store implementations
Alasdair G Kergon [Tue, 6 Jan 2009 03:05:17 +0000 (03:05 +0000)]
dm snapshot: split out exception store implementations

Move the existing snapshot exception store implementations out into
separate files.  Later patches will place these behind a new
interface in preparation for alternative implementations.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm snapshot: rename struct exception_store
Jonathan Brassow [Tue, 6 Jan 2009 03:05:16 +0000 (03:05 +0000)]
dm snapshot: rename struct exception_store

Rename struct exception_store to dm_exception_store.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm snapshot: separate out exception store interface
Jonathan Brassow [Tue, 6 Jan 2009 03:05:15 +0000 (03:05 +0000)]
dm snapshot: separate out exception store interface

Pull structures that bridge the gap between snapshot and
exception store out of dm-snap.h and put them in a new
.h file - dm-exception-store.h.  This file will define the
API for new exception stores.

Ultimately, dm-snap.h is unnecessary, since only dm-snap.c
should be using it.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm mpath: move trigger_event to system workqueue
Alasdair G Kergon [Tue, 6 Jan 2009 03:05:13 +0000 (03:05 +0000)]
dm mpath: move trigger_event to system workqueue

The same workqueue is used both for sending uevents and processing queued I/O.
Deadlock has been reported in RHEL5 when sending a uevent was blocked waiting
for the queued I/O to be processed.  Use scheduled_work() for the asynchronous
uevents instead.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm: add name and uuid to sysfs
Milan Broz [Tue, 6 Jan 2009 03:05:12 +0000 (03:05 +0000)]
dm: add name and uuid to sysfs

Implement simple read-only sysfs entry for device-mapper block device.

This patch adds a simple sysfs directory named "dm" under block device
properties and implements
- name attribute (string containing mapped device name)
- uuid attribute (string containing UUID, or empty string if not set)

The kobject is embedded in mapped_device struct, so no additional
memory allocation is needed for initializing sysfs entry.

During the processing of sysfs attribute we need to lock mapped device
which is done by a new function dm_get_from_kobj, which returns the md
associated with kobject and increases the usage count.

Each 'show attribute' function is responsible for its own locking.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm table: rework reference counting
Mikulas Patocka [Tue, 6 Jan 2009 03:05:10 +0000 (03:05 +0000)]
dm table: rework reference counting

Rework table reference counting.

The existing code uses a reference counter. When the last reference is
dropped and the counter reaches zero, the table destructor is called.
Table reference counters are acquired/released from upcalls from other
kernel code (dm_any_congested, dm_merge_bvec, dm_unplug_all).
If the reference counter reaches zero in one of the upcalls, the table
destructor is called from almost random kernel code.

This leads to various problems:
* dm_any_congested being called under a spinlock, which calls the
  destructor, which calls some sleeping function.
* the destructor attempting to take a lock that is already taken by the
  same process.
* stale reference from some other kernel code keeps the table
  constructed, which keeps some devices open, even after successful
  return from "dmsetup remove". This can confuse lvm and prevent closing
  of underlying devices or reusing device minor numbers.

The patch changes reference counting so that the table destructor can be
called only at predetermined places.

The table has always exactly one reference from either mapped_device->map
or hash_cell->new_map. After this patch, this reference is not counted
in table->holders.  A pair of dm_create_table/dm_destroy_table functions
is used for table creation/destruction.

Temporary references from the other code increase table->holders. A pair
of dm_table_get/dm_table_put functions is used to manipulate it.

When the table is about to be destroyed, we wait for table->holders to
reach 0. Then, we call the table destructor.  We use active waiting with
msleep(1), because the situation happens rarely (to one user in 5 years)
and removing the device isn't performance-critical task: the user doesn't
care if it takes one tick more or not.

This way, the destructor is called only at specific points
(dm_table_destroy function) and the above problems associated with lazy
destruction can't happen.

Finally remove the temporary protection added to dm_any_congested().

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm: support barriers on simple devices
Andi Kleen [Tue, 6 Jan 2009 03:05:09 +0000 (03:05 +0000)]
dm: support barriers on simple devices

Implement barrier support for single device DM devices

This patch implements barrier support in DM for the common case of dm linear
just remapping a single underlying device. In this case we can safely
pass the barrier through because there can be no reordering between
devices.

 NB. Any DM device might cease to support barriers if it gets
     reconfigured so code must continue to allow for a possible
     -EOPNOTSUPP on every barrier bio submitted.  - agk

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm request: extend target interface
Kiyoshi Ueda [Tue, 6 Jan 2009 03:05:07 +0000 (03:05 +0000)]
dm request: extend target interface

This patch adds the following target interfaces for request-based dm.

  map_rq    : for mapping a request

  rq_end_io : for finishing a request

  busy      : for avoiding performance regression from bio-based dm.
              Target can tell dm core not to map requests now, and
              that may help requests in the block layer queue to be
              bigger by I/O merging.
              In bio-based dm, this behavior is done by device
              drivers managing the block layer queue.
              But in request-based dm, dm core has to do that
              since dm core manages the block layer queue.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm request: add caches
Kiyoshi Ueda [Tue, 6 Jan 2009 03:05:06 +0000 (03:05 +0000)]
dm request: add caches

This patch prepares some kmem_caches for request-based dm.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm ioctl: allow dm_copy_name_and_uuid to return only one field
Milan Broz [Tue, 6 Jan 2009 03:05:04 +0000 (03:05 +0000)]
dm ioctl: allow dm_copy_name_and_uuid to return only one field

Allow NULL buffer in dm_copy_name_and_uuid if you only want to return one of
the fields.

(Required by a following patch that adds these fields to sysfs.)

Signed-off-by: Milan Broz <mbroz@redhat.com>
Reviewed-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm log: ensure log bitmap fits on log device
Milan Broz [Tue, 6 Jan 2009 03:05:02 +0000 (03:05 +0000)]
dm log: ensure log bitmap fits on log device

Check that the log bitmap will fit within the log device.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm log: move region_size validation
Milan Broz [Tue, 6 Jan 2009 03:05:01 +0000 (03:05 +0000)]
dm log: move region_size validation

Move log size validation from mirror target to log constructor.

Removed PAGE_SIZE restriction we no longer think necessary.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
15 years agodm log: avoid reinitialising io_req on every operation
Takahiro Yasui [Tue, 6 Jan 2009 03:04:59 +0000 (03:04 +0000)]
dm log: avoid reinitialising io_req on every operation

rw_header function updates three members of io_req data every time
when I/O is processed. bi_rw and notify.fn are never modified once
they get initialized, and so they can be set in advance.

header_to_disk() can also be pulled out of write_header() since only one
caller needs it and write_header() can be replaced by rw_header()
directly.

Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>