Commit graph

299 commits

Author SHA1 Message Date
Bart Westgeest 737912e11b staging: usbip: fix to prevent potentially using uninitialized spinlock
The stub_probe function can be called as soon as the stub_driver is
registered. This can lead to the busid_table_lock being used before it
is initialized. Moved calling the init_busid_table function (which
initalizes this spinlock) to be called earlier in the init function to
prevent this from happening.

Signed-off-by: Bart Westgeest <bart@elbrys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 14:14:15 -08:00
Bart Westgeest 75fe8c8b90 staging: usbip: removed unused definitions from header
Removed remnants of old function definitions which have since been
removed in earlier cleanup work.

Signed-off-by: Bart Westgeest <bart@elbrys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-22 13:40:03 -08:00
Bart Westgeest 5a08c5267e staging: usbip: removed dead code from receive function
The usbip_xmit function supported sending and receiving data, however
the sending part of the function was never used/executed. Renamed the
function to usbip_recv, and removed the unused code.

Signed-off-by: Bart Westgeest <bart@elbrys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-22 13:40:03 -08:00
Bart Westgeest 438957f8d4 staging: usbip: bugfix for deadlock
Interrupts must be disabled prior to calling usb_hcd_unlink_urb_from_ep.
If interrupts are not disabled, it can potentially lead to a deadlock.
The deadlock is readily reproduceable on a slower (ARM based) device
such as the TI Pandaboard.

Signed-off-by: Bart Westgeest <bart@elbrys.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:37:38 -08:00
Paul Gortmaker 452962366c staging: Add module.h to more drivers implicitly using it.
This 2nd batch of implicit module.h users only appeared when we
removed the unnecessary module.h from include/linux/miscdevice.h
[The 1st batch is already present in Greg's staging tree.]

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:32:10 -04:00
Paul Gortmaker 8e336a722b staging: Add export.h for THIS_MODULE/EXPORT_SYMBOL to drivers/staging users.
Lots of drivers have in the past expected the presence of basic things
like THIS_MODULE and EXPORT_SYMBOL.  With the header cleanup, they wont
have these.  Call out the include explicitly.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:32:08 -04:00
Alexander Thomas 7518b9b8fc staging: usbip: fix up api changes that broke windows clients
Revert changes in definitions that were submitted on May 11 2011 and
committed on June 7 2011. No reason for the change in these values was
given in the patch comment, it broke compatibility with older
versions, and was difficult to detect by the simultaneous move of the
lines of code.

Signed-off-by: Alexander Thomas <alexander.thomas@esaturnus.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-19 10:45:03 -07:00
Paul Gortmaker 99c978529a staging: Add module.h to drivers/staging users
Lots of people expect module.h to just "be there" without
any #include effort.  But we are crushing that.  So fix those
files in staging relying on implicit module.h presence.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-25 17:01:20 -07:00
Greg Kroah-Hartman a813833df8 Merge git://git.kernel.org/pub/scm/linux/kernel/git/lwfinger/r8192E into staging-next
* git://git.kernel.org/pub/scm/linux/kernel/git/lwfinger/r8192E: (61 commits)
  staging: rtl8192e: Fix compilation warnings
  staging: rtl8192e: Fix unload/reload problem
  staging: rtl8192e: Remove dead code associated with CONFIG_RTL_RFKILL
  staging: rtl8192e: Remove conditional code associated with EEPROM_OLD_FORMAT_SUPPORT
  staging: rtl8192e: Remove dead code associated with EFUSE_REPG_WORKAROUND
  staging: rtl8192e: Remove LOOP_TEST as parameter
  staging: rtl8192e: Remove dead code associated with CONFIG_FW_SETCHAN
  staging: rtl8192e: Remove dead code associated with CONFIG_RTLWIFI_DEBUGFS
  staging: rtl8192e: Remove dead code associated with _RTL8192_EXT_PATCH_
  staging: rtl8192e: Remove ifdefs for CONFIG_RTLLIB_DEBUG
  staging: rtl8192e: Remove dead code associated with RTL819x_DEBUG
  staging: rtl8192e: Remove dead code associated with _ENABLE_SW_BEACON
  staging: rtl8192e: Remove dead code associated with CONFIG_CRYPTO_HMAC
  staging: rtl8192e: Remove dead code associated with CONFIG_BT_30
  staging: rtl8192e: Remove dead code associated with ENABLE_NULL_PT_DEBUG
  staging: rtl8192e: Remove dead code associated with CONFIG_64BIT_DMA
  staging: rtl8192e: Remove dead code associated with CONFIG_RTLLIB_CRYPT_TKIP
  staging: rtl8192e: Remove dead code associated with IRQF_SHARED
  staging: rtl8192e: Remove dead code associated with CONFIG_CFG_80211
  staging: rtl8192e: Remove dead code associated with BUILT_IN_CRYPTO
  ...
2011-08-23 21:17:36 -07:00
Julia Lawall 9358354858 drivers/staging/usbip/userspace/libsrc/vhci_driver.c: test the just-initialized value
Test the just-initialized value rather than some other one.

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

// <smpl>
@r@
identifier x,y,f!={PTR_ERR,ERR_PTR,ERR_CAST};
statement S;
@@

x = f(...);
(
if (\(x == NULL\|IS_ERR(x)\)) S
|
*if (\(y == NULL\|IS_ERR(y)\))
 { ... when != x
   return ...; }
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: David Chang <dchang@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 14:42:34 -07:00
Tobias Klauser 306dac699e staging: usbip: Add header guards to stub.h and vhci.h
stub.h and vhci.h are missing proper #ifndef/#define header guards, so
add them.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 14:42:34 -07:00
Márton Németh c8742cf07d staging: usbip: add a usbip protocol document
Initial version of USBIP protocol document.

Signed-off-by: David Chang <dchang@suse.com>
Acked-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 14:42:34 -07:00
Tobias Klauser 549fb10097 staging: usbip: userspace: Check return value for mkdir()
mkdir() could fail, so we should check its return value.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 14:42:33 -07:00
Akshay Joshi 97c451ca10 Staging: usbip: Fix braces and spaces to match coding style.
Fix brace positioning and spaces at the start of lines in order to
comply with the kernel coding style.

Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
Acked-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 14:42:33 -07:00
Akshay Joshi 553a1a5065 Staging: usbip: Remove trailing spaces.
Remove trailing spaces to comply with the kernel coding style.

Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
Acked-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 14:42:33 -07:00
Larry Finger 275d38585c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
Conflicts:
	Documentation/feature-removal-schedule.txt
	drivers/staging/bcm/headers.h
	drivers/staging/brcm80211/brcmfmac/dhd_linux.c
	drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
	drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
	drivers/staging/et131x/et131x_netdev.c
	drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
	drivers/staging/rtl8192e/r8192E.h
	drivers/staging/usbip/userspace/src/utils.h
2011-08-01 12:33:12 -05:00
Larry Finger 48d67fe035 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
Conflicts:
	Documentation/feature-removal-schedule.txt
	drivers/staging/bcm/headers.h
	drivers/staging/brcm80211/brcmfmac/dhd_linux.c
	drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
	drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
	drivers/staging/brcm80211/brcmfmac/wl_iw.c
	drivers/staging/et131x/et131x_netdev.c
	drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
	drivers/staging/rtl8192e/r8192E.h
	drivers/staging/usbip/userspace/src/utils.h
2011-07-26 15:52:24 -05:00
matt mooney 0aee588945 staging: usbip: userspace: usbip-utils 1.1.1
Bump package revision number!

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:01:18 -07:00
matt mooney 45dd9a98f7 staging: usbip: userspace: README: update example output
Change a missed reference to the `list' command, and update the output
from `usbip bind ...' and `usbip list -r ...'

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:01:17 -07:00
matt mooney 2435ab147b staging: usbip: userspace: usbip: modify `list' help message
The remote devices listed are, technically, exportable and not
necessarily exported.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:01:17 -07:00
matt mooney fcedd169be staging: usbip: userspace: usbip_list.c: modify exportable device output
Change spacing to provide better indentation for readability.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:01:16 -07:00
matt mooney dffb9649d3 staging: usbip: userspace: fix header installation bug
A bug that I created due to using simply expanding variables in the
makefiles. Although only unexpanded paths are at issue here, I decided
to use recursively expanding variables on all of the parameterized
values.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:01:16 -07:00
matt mooney 3c6e9e8f35 staging: usbip: userspace: add new prefix for usbip network code
Change and add new usbip_net_ prefix to every function in the network
code for easier identification.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:01:15 -07:00
matt mooney e2ec6b4e39 staging: usbip: userspace: usbipd: major cleanup of daemon
Reorganize, rename [for clarity and to remove stub_driver
references], modify output messages, and cleanup coding style;
nevertheless, the actual implementation is pretty much untouched.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:01:15 -07:00
Randy Dunlap 6394c5a037 staging: fix usbip printk format warning
Fix usbip printk format warning for size_t:

drivers/staging/usbip/stub_tx.c:236: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'size_t'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 13:59:55 -07:00
David Chang 7104b5df5b staging: usbip: userspace: usbipd.c: fix userspace build error
When build userspace code, got the following error message:
make[2]: Entering directory `/usr/src/staging-2.6/drivers/staging/usbip/userspace/src'
  CC     usbip.o
...
  CCLD   usbip
  CC     usbipd.o
usbipd.c:30:25: fatal error: stub_driver.h: No such file or directory
compilation terminated.
make[2]: *** [usbipd.o] Error 1
make[2]: Leaving directory `/usr/src/staging-2.6/drivers/staging/usbip/userspace/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/staging-2.6/drivers/staging/usbip/userspace'
make: *** [all] Error 2

Due to commit 756d6726 and a16941ae, stub_driver had been changed
into host_driver, so update header filename and functions name to
fix these build errors

Signed-off-by: David Chang <dchang@novell.com>
CC: Joe Perches <joe@perches.com>
Cc: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-06 08:22:48 -07:00
Arjan Mels 1aee199cad drivers/staging/usbip: bugfix prevent driver unbind regression in linux-next
Fix regression problem in linux-next: post_reset and pre_reset are no longer
included in linux-next while they are in linux-3.0rc5.

Signed-off-by: Arjan Mels <arjan.mels@gmx.net>
Cc: usbip-devel <usbip-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:14:10 -07:00
Tobias Klauser 8547d4cc2b Staging: usbip: vhci-hcd: Do not kill already dead RX/TX kthread
When unbinding a device on the host which was still attached on the
client, I got a NULL pointer dereference on the client. This turned out
to be due to kthread_stop() being called on an already dead kthread.

Here is how I was able to reproduce the problem:

 server:# usbip bind -b 1-2
                                client:# usbip attach -h server -b 1-2
 server:# usbip unbind -b 1-2

This patch fixes the problem by checking the kthread before attempting
to kill it, as it is done on the opposite side in
stub_shutdown_connection().

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:14:10 -07:00
matt mooney c88f9906c3 staging: usbip: userspace: configure.ac: change package data
Change package name to usbip-utils, email address to linux-usb, and
bump minor version number.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:12:17 -07:00
matt mooney fb5ca8131c staging: usbip: userspace: usbip_network.c: coding style cleanup
Change messges to debug, and fix a few coding style issues.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:12:12 -07:00
matt mooney 756d6726f8 staging: usbip: userspace: usbip_host: update function and variable names
Officially change stub_driver to usbip_host_driver. And, reorganize
usbip_host_driver.c while also cleaning up coding style.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:35 -07:00
matt mooney a16941aef1 staging: usbip: userspace: rename stub driver files
Rename stub_driver.? to usbip_host_driver.?

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:35 -07:00
matt mooney b9d65b1dd3 staging: usbip: userspace: usbip list: move output header
Delay the printing of the output header until the list is received
from the remote host. This allows notification that the host does not
have any exportable devices.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:35 -07:00
matt mooney 622dde8105 staging: usbip: userspace: usbip list: edit output messages
Edit dbg and normal output messages for consistency and better
feedback.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:34 -07:00
matt mooney 9cda570411 staging: usbip: userspace: usbip_unbind.c: implement using libsysfs
Modify unbind to use libsysfs, and include a check to verify that the
device is actually using usbip-host before proceeding. The output
messages have been changed to be consistent with `usbip bind'.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:34 -07:00
matt mooney 06c465f5d2 staging: usbip: userspace: usbip_bind.c: major rewrite of the implementation
Rewrite functions in terms of libsysfs, which eliminates a lot of
helper functions simplifying the file layout. Now, the two processes
taking place here, an unbind of the old driver and a bind of
usbip-host, are single functions and have been renamed along with the
controlling function. A check to see if the device is already bound to
usbip-host is now included.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:34 -07:00
matt mooney 30f0554659 staging: usbip: userspace: utils.c: rewrite modify_match_busid
Rewrite the function to use libsysfs.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:34 -07:00
matt mooney 42685d577f staging: usbip: userspace: utils: remove libsysfs circumvention
Removes all of the helper functions that used a lot of hard-coded
values intead of libsysfs. Most of these functions were unused
anyway.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:34 -07:00
matt mooney 4737d7e332 staging: usbip: userspace: usbip: modify command failure
When a bad option is given, display a message stating such and output
usage. When a bad command is given, output command help.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:34 -07:00
matt mooney 25567a3979 staging: usbip: userspace: libsrc: change all output messages to debug
The library should not be displaying random messages intermixed with
those from the programs that use them. So, instead, change all of the
output from the library to debug only, and allow the programs to
decide what to tell the user. This also changes the messages to use
the same form, which makes understanding them easier.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:33 -07:00
matt mooney 099f79fa5a staging: usbip: userspace: libsrc: remove usbip.h
Remove the library version of usbip.h because its sole purpose was to
include other headers, which is bad practice. Also modify include
guards for consistency.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:33 -07:00
matt mooney c93be5b178 staging: usbip: userspace: usbip.c: add log option
Add option for logging with syslog, and default to use stderr for
error and info messages.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:33 -07:00
matt mooney f2fb62b371 staging: usbip: userspace: libsrc: set program name for logging
Set the program name to "libusbip" to identify that the message is
from the library code.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:33 -07:00
matt mooney 4fd83e84d5 staging: usbip: userspace: usbip_common.h: fixup header includes
Remove unnecessary headers from the file, and add the now missing
headers into the files that actually need them.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:33 -07:00
matt mooney 93e18e0ece staging: usbip: userspace: usbip_common.h: move enums
Relocate enums to follow logging macros.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:33 -07:00
matt mooney 213fd4adce staging: usbip: userspace: usbip_common.h: cleanup log macros
Provide better abstraction for easier modification, and align the
macros for readability. Remove notice() because it is not used.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:32 -07:00
matt mooney 9a20542fd2 staging: usbip: userspace: update cleanup.sh
Modify $FILES to account for the new directory layout. Also, sort the
list of files within the variable to make it human-readable.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:11:32 -07:00
matt mooney 89415218ad staging: usbip: userspace: cleanup README
Update examples to correspond with the new usbip-utils; edit grammar;
and cleanup format for consistency.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 19:59:48 -07:00
matt mooney e8323b834d staging: usbip: userspace: add name to AUTHORS
Add myself to the AUTHORS file.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 19:59:47 -07:00
matt mooney 7ddf1a0c48 staging: usbip: userspace: remove usb.ids file
Inclusion of the usb.ids file is redundant. USBIDS_DIR is set in
configure.ac to a default of /usr/share/hwdata/. This can be
overridden using `./configure --with-usbids-dir=<dir>'.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 19:59:47 -07:00
Márton Németh 6f480bf9c3 usbip: simplify port status saving
Use memcpy() function to save port status instead of
a handwritten for loop.

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 19:59:19 -07:00
Márton Németh 4a3ca2bebe usbip: dump the port status difference
At the beginning of vhci_hub_control() function the port
status is saved to show what are the differences between the
previous and the new status. Change the dump function to
really show the differences in the status bit changes: put
a '+' sign before the symbolic name of a bit where a bit
was set, a '-' sign where the bit was cleared and a SPACE
where the bit was not changed. This is similar to the way
"diff -u" shows the changes and easy to understand.

Signed-off-by: Márton Németh <nm127@freemail.hu>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 19:59:19 -07:00
Márton Németh bfb4ce2070 usbip: only dump valid port status
The wIndex parameter of vhci_hub_control() is always zero when the
request type is GetHubDescriptor, see drivers/usb/core/hub.c::get_hub_descriptor()
and Universal Serial Bus Specification revision 2.0 (April 27, 2000) Section
11.24.2.5 "Get Hub Descriptor". This means the variable rhport will not contain
any useful index. Only use valid rhport values.

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 19:59:18 -07:00
Tobias Klauser 981aabb148 Staging: usbip: Fix out-of-tree build for userspace
This fixes out-of-tree builds ($builddir != $srcdir). In such cases,
libusbip.la cannot be found because it is generated in the build
directory and not the source directory.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 10:22:50 -07:00
Joe Perches ceeb6fec70 staging: Fix recieve/receive typos
Just spelling fixes.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:54:17 -07:00
Vitaliy Ivanov e44ba033c5 treewide: remove duplicate includes
Many stupid corrections of duplicated includes based on the output of
scripts/checkincludes.pl.

Signed-off-by: Vitaliy Ivanov <vitalivanov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-20 16:08:19 +02:00
Greg Kroah-Hartman dc5a18941b Merge Linus's tree into staging-next
This was done to resolve the conflicts that were in a number of files
due to changes done upstream with others done in the staging-next
branch.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-09 13:49:02 -07:00
Akshay Joshi 5ad7b85b90 USBIP: Remove unnecessary whitespace before newline characters.
In this file, in certain places, newline characters in pr_debug() calls had
whitespace before them. This patch removes this extraneous whitespace.

Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:34:31 -07:00
Márton Németh cf77acfca3 usbip: change dev_attr_group to constant
The dev_attr_group variable is never changed and it is only passed
to the second parameter of sysfs_create_group() and sysfs_remove_group() functions.
These functions are defined in linux/sysfs.h: the second parameter is a pointer to
const in both cases.

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:29:56 -07:00
matt mooney 0a186be359 staging: usbip: stub_main.c: simplify busid_table initialization
Set the whole structure to zero instead of individually setting each
member, which simplifies the for loop.

This was suggested by walter harms <wharms@bfs.de>.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:29:16 -07:00
matt mooney 1109566469 staging: usbip: userspace: usbip_list.c: cleanup exported device functions
Rename functions and cleanup coding style.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:26:19 -07:00
matt mooney 35dd0c2da6 staging: usbip: userspace: rename usbip device and interface
Add prefix of usbip_ to internal usb device and interface to avoid
confusion with the kernel types. This also identifies the types as
being part of the usbip library.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:26:18 -07:00
matt mooney 74ce259c67 staging: usbip: userspace: usbip_list.c: refactor local USB device listing
Combines the different list display types for local devices into one
function. Removes dependence on utils.h, which only exists as a way to
circumvent libsysfs and will be removed. The devices are now sorted as
an added benefit of this refactor.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:26:17 -07:00
matt mooney 3e4fda9f95 staging: usbip: change the busid size
Change busid size to correspond with SYSFS_BUS_ID_SIZE, which was
already being used in most cases. This eliminates the need to define
BUS_ID_SIZE in the userspace code.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:26:17 -07:00
matt mooney 4cbab52d18 staging: usbip: userspace: move header includes out utils.h
The includes have been moved out of utils.h to their respective source
files where they are suppose to be. An include guard is also added to
utils.h

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:26:17 -07:00
matt mooney 950a4cd8fc staging: usbip: userspace: use memset instead of bzero
bzero is and has been deprecated since POSIX.1-2001.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:26:16 -07:00
Márton Németh a6d81814a5 usbip: remove extra whitespace
Only one whitespace is enough after "return".

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:08:52 -07:00
Greg Kroah-Hartman acf51ab8ce Staging: usbip: vhci.h: remove FSF address
Remove the FSF address from the comment header.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:08:52 -07:00
Greg Kroah-Hartman 69c685c7f5 staging: usbip: README: we need to document the protocol
Document the protocol.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:08:51 -07:00
matt mooney 1e35d87d63 staging: usbip: userspace: usbip_network: rename and cleanup function
Rename tcp_connection to usbip_net_tcp_connection, which alludes to a
usbip network library that will eventually follow. The implementation
of this function has also been cleaned up.

Headers had to be adjusted due to the elimination of the old usbip.h.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:56:13 -07:00
matt mooney d2c15e2580 staging: usbip: userspace: usbipd.c: add header into source file
The old usbip.h header that was only used to masked what each source
file needed has been changed. So some headers this file needed had to
be added.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:56:12 -07:00
matt mooney e9837bbb3e staging: usbip: userspace tools v1.0.0
The new and improved (well somewhat, with a ways to go) userspace utility.

    mfm:pts/8[~/tmp/userspace]
    May26 05:18:31 % ./src/usbip help
    usage: usbip [--debug] [version]
                 [help] <command> <args>

      attach     Attach a remote USB device
      detach     Detach a remote USB device
      list       List exported or local USB devices
      bind       Bind device to usbip-host.ko
      unbind     Unbind device from usbip-host.ko

This first commit of the userspace `usbip' utility uses to same
implementation as the old tools, `usbip' and  `usbip_bind_driver'.
Nothing significant has changed so compatibility with windows has
_not_ been broken. However, the tools remain broken in many ways
due to the old implementation.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:56:12 -07:00
matt mooney 58058422f8 staging: usbip: userspace: vhci_driver: parameterize path names
Define a macro for the bus type and use libsysfs for class path.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:56:12 -07:00
matt mooney 7e485ee7f5 staging: usbip: userspace: change struct class_device to usbip_class_device
Rename class_device struct to avoid confusion and change member names.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:56:11 -07:00
matt mooney 5a285cf523 staging: usbip: userspace: set kernel module names in one place
Move kernel module name setting to usbip_common.h so that macros can
be used instead of hard coding the names in multiple places.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:56:11 -07:00
Márton Németh 988e752081 usbip: remove check for negative values for an unsigned value
The parameter rhport is unsigned so there is no need checking for
negative values.

This will remove the following warning message when compiling with "make W=1 ...":
  drivers/staging/usbip/vhci_sysfs.c: In function ‘valid_args’:
  drivers/staging/usbip/vhci_sysfs.c:138: warning: comparison of unsigned expression < 0 is always false

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:54:19 -07:00
Márton Németh 9ba422b346 usbip: simplify lock handling in valid_request()
The function calls spin_lock() and spin_unlock() should be in pair. This patch makes
this pairing more clear for the reader of the code.

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:53:24 -07:00
matt mooney 0392bbb6f6 staging: usbip: vhci_hcd.c: rename init and exit functions
Change the prefix of the __init and __exit functions to vhci_hcd_ to
correspond with the modules name. And change the suffix of the __exit
function to exit instead of cleanup.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:26 -07:00
matt mooney 3028d0ae6c staging: usbip: usbip_common.c: rename init and exit functions
Change the prefix of the __init and __exit functions to usbip_core_ to
correspond with the modules name.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:26 -07:00
matt mooney 4b93bb37bb staging: usbip: userspace: bind_driver.c: update kernel module name
Change kernel module name to usbip-host.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:26 -07:00
matt mooney d012c2a5ac staging: usbip: stub_dev.c: move stub_driver definition and update driver name
Move the stub_driver definition to the end of file and, therefore,
remove foward declarations. Update driver name to usbip-host.

A few comments were slightly edited too.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:25 -07:00
matt mooney b7d27eadf8 staging: usbip: usbip_common.h: reorganize and document request headers
Document the request header structures; move #defines out of the
structures; organize function declarations by source file; and move
inline functions to the end of file.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:25 -07:00
matt mooney 2282e1fb6b staging: usbip: usbip_common.c: fix misspelled function name
Change pakcet to packet in usbip_iso_packet_correct_endian().

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:25 -07:00
matt mooney 7d4de89f19 staging: usbip: stub_main.c: use KMEM_CACHE macro
Change kmem_cache_create() to the KMEM_CACHE() macro.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:24 -07:00
matt mooney 27ed5da0b6 staging: usbip: stub_main.c: rename init and exit functions
Change the prefix of the __init and __exit functions to usbip_host_ to
correspond with the modules name.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:23 -07:00
matt mooney 41e02f0116 staging: usbip: stub_main.c: code cleanup
Remove match_find() and replace with get_busid_idx(); change
get_busid_priv(), add_match_busid(), and del_match_busid() to use
get_busid_idx(); and cleanup code in the other functions.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:23 -07:00
matt mooney efad25e9a3 staging: usbip: stub_main.c: reorder functions
Reorder functions so sysfs_ops, show() and store(), are adjacent, and
init_busid_table() is at the beginning of the file.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:22 -07:00
matt mooney 8735276017 staging: usbip: remove unnecessary lines and extra return statements
Also, fix a few alignment issues that were originally missed.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:22 -07:00
Arjan Mels d3ac077880 staging: usbip: bugfix prevent driver unbind
Implemented pre_reset and post_reset methods of the driver to prevent the
driver from being unbound upon a device reset. Because of this also the
asynchronous reset introduced to prevent a race condition is no longer necessary
(and sometimes causes problems, because it comes later then expected).

Signed-off-by: Arjan Mels <arjan.mels@gmx.net>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Takahiro Hirofuchi <hirofuchi@users.sourceforge.net>
Cc: Max Vozeler <max@vozeler.com>
Cc: usbip-devel <usbip-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 12:28:41 -07:00
Linus Torvalds 1f3a8e093f Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (970 commits)
  staging: usbip: replace usbip_u{dbg,err,info} and printk with dev_ and pr_
  staging:iio: Trivial kconfig reorganization and uniformity improvements.
  staging:iio:documenation partial update.
  staging:iio: use pollfunc allocation helpers in remaining drivers.
  staging:iio:max1363 misc cleanups and use of for_each_bit_set to simplify event code spitting out.
  staging:iio: implement an iio_info structure to take some of the constant elements out of iio_dev.
  staging:iio:meter:ade7758: Use private data space from iio_allocate_device
  staging:iio:accel:lis3l02dq make write_reg_8 take value not a pointer to value.
  staging:iio: ring core cleanups + check if read_last available in lis3l02dq
  staging:iio:core cleanup: squash tiny wrappers and use dev_set_name to handle creation of event interface name.
  staging:iio: poll func allocation clean up.
  staging:iio:ad7780 trivial unused header cleanup.
  staging:iio:adc: AD7780: Use private data space from iio_allocate_device + trivial fixes
  staging:iio:adc:AD7780: Convert to new channel registration method
  staging:iio:adc: AD7606: Drop dev_data in favour of iio_priv()
  staging:iio:adc: AD7606: Consitently use indio_dev
  staging:iio: Rip out helper for software rings.
  staging:iio:adc:AD7298: Use private data space from iio_allocate_device
  staging:iio: rationalization of different buffer implementation hooks.
  staging:iio:imu:adis16400 avoid allocating rx, tx, and state separately from iio_dev.
  ...

Fix up trivial conflicts in
 - drivers/staging/intel_sst/intelmid.c: patches applied in both branches
 - drivers/staging/rt2860/common/cmm_data_{pci,usb}.c: removed vs spelling
 - drivers/staging/usbip/vhci_sysfs.c: trivial header file inclusion
2011-05-23 12:49:28 -07:00
matt mooney 1a4b6f6628 staging: usbip: replace usbip_u{dbg,err,info} and printk with dev_ and pr_
This switches all of the usbip_u{dbg,err,info} and printk statements to
dev_<level>, if possible, or pr_<level> macros. And removes a few
unnecessary debug statements.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:57:30 -07:00
matt mooney 3fadc1212a staging: usbip: userspace: bind-driver.c: mark remote_host as unused
Use __attribute__((unused)) to suppress error until it can be determined
that remote_host is not needed.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 15:34:10 -07:00
matt mooney 2006d35d61 staging: usbip: userspace: stub_driver.c: update kernel module name
Change kernel module name to usbip-host.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 15:34:09 -07:00
matt mooney 1c6e79d992 staging: usbip: userspace: modify project gcc flags
Add -Werror, remove -Wstrict-prototypes, and change -W to -Wextra.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 13:26:29 -07:00
matt mooney be0d54ae39 staging: usbip: userspace: move common cflags to configure.ac
There are a standard set of cflags that are used in each makefile so
let's set those in EXTRA_CFLAGS and enforce them for the entire project.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 13:26:29 -07:00
matt mooney 968c6595e7 staging: usbip: userspace: remove gcc warnings
The warnings were for unused parameters, so __attribute__((unused))
has been added until it can be determined they are truly unneeded.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 13:26:28 -07:00
matt mooney 88d6f40839 staging: usbip: userspace: remove revision $Id$
This is git not CVS!

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 13:26:28 -07:00
matt mooney d762f5e10c staging: usbip: userspace: set libusbip version in configure.ac
Move libusbip version setting to configure.ac so that version
numbers can be found in a single location.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 13:26:27 -07:00
matt mooney cd62e07e87 staging: usbip: userspace: cleanup makefiles
Remove unneeded comments; change deprecated flag INCLUDE to
AM_CPPFLAGS and put -D option in *_CPPFLAGS; and use "simply
expanded variables" in assignments.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 13:26:27 -07:00
matt mooney af8bab0639 staging: usbip: userspace: configure.ac: major overhaul
All parameters have been quoted; and autoscan was rerun so new
headers, types, and functions were added. The deprecated macros
AM_CONFIG_HEADER and AM_PROG_LIBTOOL were changed to
AC_CONFIG_HEADERS and LT_INIT, respectively. The AS_HELP_STRING
macro is used to avoid arbitrary spacing for proper help menu
alignment, and AS_CASE to avoid quoting issues. And finally, the
macros were realigned to allow mere mortals the ability to read them.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 13:26:27 -07:00
matt mooney 220973dd23 staging: usbip: userspace: update module name references
Change all references to the kernel modules to correspond with the new
names.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 13:26:26 -07:00
matt mooney 9abec45232 staging: usbip: userspace: whitespace cleanup
Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 13:26:26 -07:00
matt mooney 33df2286f7 staging: usbip: userspace: remove unused files
Remove ChangeLog and NEWS.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 13:26:25 -07:00
matt mooney f9b90071e0 staging: usbip: userspace: rename source directories
Rename cmd/ to src/ and lib/ to libsrc/.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 13:26:25 -07:00
matt mooney 7f27b19911 staging: usbip: userspace: move manpages to separate directory
Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 13:26:24 -07:00
Takahiro Hirofuchi 0945b4fe3f staging: usbip: add userspace code
Add userspace code from svn trunk revision 175. Located at
https://usbip.svn.sourceforge.net/svnroot/usbip/linux/trunk/src.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 13:23:42 -07:00
David Chang cacd18a847 staging: usbip: fix wrong endian conversion
Fix number_of_packets wrong endian conversion in function
correct_endian_ret_submit()

Signed-off-by: David Chang <dchang@novell.com>
Acked-by: Arjan Mels <arjan.mels@gmx.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 11:37:13 -07:00
matt mooney 64e62426f4 staging: usbip: edit Kconfig and rename CONFIG options
Change modules usbip_common_mod to usbip-core and usbip to usbip-host;
edit configuration option help text; rename CONFIG options to use a
USBIP prefix and change COMMON to CORE in both the Kconfig and
Makefiles; edit the menu entries; and edit the driver descriptions.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-12 09:17:57 -07:00
matt mooney 7aaacb43ed staging: usbip: fix header includes
Modify header directives to include what is needed by each file and
not already included in its own header.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-12 09:17:56 -07:00
matt mooney fc184a35d9 staging: usbip: vhci.h: reorganize
Split function declarations by source file.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-11 14:11:14 -07:00
matt mooney 499aaae000 staging: usbip: stub.h: reorganize
Move a few functions around for better organization and add missing
parameter names in function declarations.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-11 14:11:14 -07:00
matt mooney 6973c6f24e staging: usbip: use single version for all modules
Having separate versions in this situation makes little sense, so
USBIP_VERSION will be used by all modules.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-11 14:06:52 -07:00
matt mooney 981f30cc9b staging: usbip: change debug configuration option
Change CONFIG_USB_IP_DEBUG_ENABLE to CONFIG_USB_IP_DEBUG, and move
ccflags- to the head of the makefile.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-11 14:06:51 -07:00
matt mooney 4ce0a41f10 staging: usbip: fixup MODULE_ macros
Modify description and email address for usbip_common_mod; export
module version number; and modify __init messages slightly.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:16 -07:00
matt mooney 6a298401fc staging: usbip: remove section dividers
Also, removes the one-line comments that were associated with some of
the dividers because they provided no additional information.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:15 -07:00
matt mooney 49aecefcde staging: usbip: add break to default case in switch statements
For consistency, a break statement is added to all default cases that
do not jump to a label.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:15 -07:00
matt mooney 5c6499d8bf staging: usbip: vhci_tx.c: coding style cleanup
Fix a few alignment issues and remove extraneous lines.
Use ternary operator for pdup->base.direction assignment.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:15 -07:00
matt mooney bd608f6ceb staging: usbip: vhci_sysfs.c: coding style cleanup
Fix a few alignment issues and remove extraneous lines.
Add braces to else clause.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:14 -07:00
matt mooney 5ef6aceb12 staging: usbip: vhci_rx.c: coding style cleanup
Fix alignment for consistency and remove extraneous lines.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:14 -07:00
matt mooney 071d1d4704 staging: usbip: vhci_hcd.c: coding style cleanup
Fix alignment for consistency and remove extraneous lines.
Move MODULE_ macros to the end of file.
Make bit_desc[] an array of const pointers.
Add KERN_ level to a couple of printks.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:14 -07:00
matt mooney ddbc9bc9e9 staging: usbip: vhci.h: coding style cleanup
Fix a few alignment issues and remove extraneous lines.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:14 -07:00
matt mooney 09e0650b25 staging: usbip: stub.h: coding style cleanup
Remove extraneous lines.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:13 -07:00
matt mooney 0f79847ce0 staging: usbip: usbip_event.c: coding style cleanup
Fix a few alignment issues and remove extraneous lines.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:13 -07:00
matt mooney f9eacc9846 staging: usbip: usbip_common.c: coding style cleanup
Fix alignment for consistency, checkpatch.pl warning of line over
80 characters, and remove extraneous lines.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:13 -07:00
matt mooney 4980d9682f staging: usbip: usbip_common.h: coding style cleanup
Use the compiler macro __packed, fix a few alignment issues, and
remove extraneous lines.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:13 -07:00
matt mooney c6956c97ec staging: usbip: stub_tx.c: coding style cleanup
Fix alignment for consistency, checkpatch.pl warnings for lines
over 80 characters, remove extraneous lines, and change conversion
specifier within a format string to remove warning.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:12 -07:00
matt mooney 64f338edbd staging: usbip: stub_rx.c: coding style cleanup
Fix alignment for consistency and remove extraneous lines.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:12 -07:00
matt mooney 6c033b46ce staging: usbip: stub_main.c: coding style cleanup
Fix alignment for consistency and remove extraneous lines.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:12 -07:00
matt mooney b744a45f45 staging: usbip: stub_dev.c: coding style cleanup
Fix alignment for consistency and remove extraneous lines.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 14:26:11 -07:00
Linus Torvalds 5895198c56 Merge branch 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6:
  staging: Remove a warning for drivers/staging/wlan-ng/cfg80211.c
  staging: intel_sst: intelmid needs delay.h
  staging: solo6x10: add select SND_PCM to fix build error
  staging: usbip: vhci: fix oops on subsequent attach
  staging: ft1000: Remove unnecessary EXPORT_SYMBOLs
  staging: rts_pstor: use #ifdef instead of #if
  staging: rts_pstor: Add <linux/vmalloc.h>
  staging: gma500: Depend on X86
  staging: olpc: Add <linux/delay.h>
2011-05-04 14:23:41 -07:00
Alan Stern cee6a26255 USB: fix regression in usbip by setting has_tt flag
This patch (as1460) fixes a regression in the usbip driver caused by
the new check for Transaction Translators in USB-2 hubs.  The root hub
registered by vhci_hcd needs to have the has_tt flag set, because it
can connect to low- and full-speed devices as well as high-speed
devices.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
CC: <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-02 17:07:50 -07:00
Max Vozeler d1b2e95ab0 staging: usbip: vhci: fix oops on subsequent attach
vhci_rx/vhci_tx threads are created once but stopped each
time the vdev is shut down. On subsequent attach wake_up_process()
oopses trying to access the stopped threads.

This patch does as before the kthread conversion which is to
create the threads each time a device is attached and stop the
threads when the device is shut down.

Signed-off-by: Max Vozeler <max@hinterhof.net>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Takahiro Hirofuchi <hirofuchi@users.sourceforge.net>
Cc: Arjan Mels <arjan.mels@gmx.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:09:51 -07:00
Linus Torvalds df9b29d13e Merge branch 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (28 commits)
  staging: usbip: bugfix for isochronous packets and optimization
  staging: usbip: bugfix add number of packets for isochronous frames
  staging: usbip: bugfixes related to kthread conversion
  staging: usbip: fix shutdown problems.
  staging: hv: Fix GARP not sent after Quick Migration
  staging: IIO: IMU: ADIS16400: Avoid using printk facility directly
  staging: IIO: IMU: ADIS16400: Fix product ID check, skip embedded revision number
  staging: IIO: IMU: ADIS16400: Make sure only enabled scan_elements are pushed into the ring
  staging: IIO: IMU: ADIS16400: Fix addresses of GYRO and ACCEL calibration offset
  staging: IIO: IMU: ADIS16400: Add delay after self test
  staging: IIO: IMU: ADIS16400: Fix up SPI messages cs_change behavior
  staging/rtl81*: build as loadable modules only
  staging: brcm80211: removed 'is_amsdu causing toss' log spam
  staging: brcm80211: fix for 'Short CCK' log spam
  staging: brcm80211: fix for 'AC_BE txop..' logs spammed problem
  staging: memrar: remove driver from tree
  staging: sep: remove last memrar remnants
  staging: fix hv_mouse build, needs delay.h
  staging: fix olpc_dcon build errors
  staging: sm7xx: fixed defines
  ...

Fix up trivial conflict in drivers/staging/memrar/memrar_handler.c
(deleted vs trivial spelling fixes)
2011-04-07 11:36:44 -07:00
Arjan Mels 28276a28d8 staging: usbip: bugfix for isochronous packets and optimization
For isochronous packets the actual_length is the sum of the actual
length of each of the packets, however between the packets might be
padding, so it is not sufficient to just send the first actual_length
bytes of the buffer. To fix this and simultanesouly optimize the
bandwidth the content of the isochronous packets are send without the
padding, the padding is restored on the receiving end.

Signed-off-by: Arjan Mels <arjan.mels@gmx.net>
Cc: Takahiro Hirofuchi <hirofuchi@users.sourceforge.net>
Cc: Max Vozeler <max@vozeler.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-06 15:51:14 -07:00
Arjan Mels 1325f85fa4 staging: usbip: bugfix add number of packets for isochronous frames
The number_of_packets was not transmitted for RET_SUBMIT packets. The
linux client used the stored number_of_packet from the submitted
request. The windows userland client does not do this however and needs
to know the number_of_packets to determine the size of the transmission.

Signed-off-by: Arjan Mels <arjan.mels@gmx.net>
Cc: Takahiro Hirofuchi <hirofuchi@users.sourceforge.net>
Cc: Max Vozeler <max@vozeler.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-06 15:51:14 -07:00
Arjan Mels d2dd0b07c3 staging: usbip: bugfixes related to kthread conversion
When doing a usb port reset do a queued reset instead to prevent a
deadlock: the reset will cause the driver to unbind, causing the
usb_driver_lock_for_reset to stall.

Signed-off-by: Arjan Mels <arjan.mels@gmx.net>
Cc: Takahiro Hirofuchi <hirofuchi@users.sourceforge.net>
Cc: Max Vozeler <max@vozeler.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-06 15:51:13 -07:00
Arjan Mels 2f8c4c5494 staging: usbip: fix shutdown problems.
When shuting down the tcp_rx and tcp_tx threads first check if they are
not closed already (maybe because an error caused them to return).

Signed-off-by: Arjan Mels <arjan.mels@gmx.net>
Cc: Takahiro Hirofuchi <hirofuchi@users.sourceforge.net>
Cc: Max Vozeler <max@vozeler.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-06 15:51:13 -07:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Linus Torvalds 6445ced867 Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (961 commits)
  staging: hv: fix memory leaks
  staging: hv: Remove NULL check before kfree
  Staging: hv: Get rid of vmbus_child_dev_add()
  Staging: hv: Change the signature for vmbus_child_device_register()
  Staging: hv: Get rid of vmbus_cleanup() function
  Staging: hv: Get rid of vmbus_dev_rm() function
  Staging: hv: Change the signature for vmbus_on_isr()
  Staging: hv: Eliminate vmbus_event_dpc()
  Staging: hv: Get rid of the function vmbus_msg_dpc()
  Staging: hv: Change the signature for vmbus_cleanup()
  Staging: hv: Simplify root device management
  staging: rtl8192e: Don't copy dev pointer to skb
  staging: rtl8192e: Pass priv to cmdpkt functions
  staging: rtl8192e: Pass priv to firmware download functions
  staging: rtl8192e: Pass priv to rtl8192_interrupt
  staging: rtl8192e: Pass rtl8192_priv to dm functions
  staging: rtl8192e: Pass ieee80211_device to callbacks
  staging: rtl8192e: Pass ieee80211_device to callbacks
  staging: rtl8192e: Pass ieee80211_device to callbacks
  staging: rtl8192e: Pass ieee80211_device to callbacks
  ...
2011-03-16 15:19:35 -07:00
Ilia Mirkin 06dde50620 staging: usbip: Remove NULL check before kfree
This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);

@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14 11:57:37 -07:00
John Youn dbe79bbe9d USB 3.0 Hub Changes
Update the USB core to deal with USB 3.0 hubs.  These hubs have a slightly
different hub descriptor than USB 2.0 hubs, with a fixed (rather than
variable length) size.  Change the USB core's hub descriptor to have a
union for the last fields that differ.  Change the host controller drivers
that access those last fields (DeviceRemovable and PortPowerCtrlMask) to
use the union.

Translate the new version of the hub port status field into the old
version that khubd understands.  (Note: we need to fix it to translate the
roothub's port status once we stop converting it to USB 2.0 hub status
internally.)

Add new code to handle link state change status.  Send out new control
messages that are needed for USB 3.0 hubs, like Set Hub Depth.

This patch is a modified version of the original patch submitted by John
Youn.  It's updated to reflect the removal of the "bitmap" #define, and
change the hub descriptor accesses of a couple new host controller
drivers.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Cc: Tony Olech <tony.olech@elandigitalsystems.com>
Cc: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: Max Vozeler <mvz@vozeler.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: Rodolfo Giometti <giometti@linux.it>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Anton Vorontsov <avorontsov@mvista.com>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Lothar Wassmann <LW@KARO-electronics.de>
Cc: Olav Kongas <ok@artecdesign.ee>
Cc: Martin Fuzzey <mfuzzey@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <dbrownell@users.sourceforge.net>
2011-03-13 18:07:11 -07:00
Sarah Sharp da13051cc7 USB: Remove bitmap #define from hcd.h
Using a #define to redefine a common variable name is a bad thing,
especially when the #define is in a header.  include/linux/usb/hcd.h
redefined bitmap to DeviceRemovable to avoid typing a long field in the
hub descriptor.  This has unintended side effects for files like
drivers/usb/core/devio.c that include that file, since another header
included after hcd.h has different variables named bitmap.

Remove the bitmap #define and replace instances of it in the host
controller code.  Cleanup the spaces around function calls and square
brackets while we're at it.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Cc: Tony Olech <tony.olech@elandigitalsystems.com>
Cc: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: Max Vozeler <mvz@vozeler.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: Rodolfo Giometti <giometti@linux.it>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Anton Vorontsov <avorontsov@mvista.com>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Lothar Wassmann <LW@KARO-electronics.de>
Cc: Olav Kongas <ok@artecdesign.ee>
Cc: Martin Fuzzey <mfuzzey@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <dbrownell@users.sourceforge.net>
2011-03-13 18:07:07 -07:00
Arnd Bergmann 9720b4bc76 staging/usbip: convert to kthread
usbip has its own infrastructure for managing kernel
threads, similar to kthread. By changing it to use
the standard functions, we can simplify the code
and get rid of one of the last BKL users at the
same time.

Includes changes suggested by Max Vozeler.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Takahiro Hirofuchi <hirofuchi@users.sourceforge.net>
Cc: Max Vozeler <max@vozeler.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-02 16:03:59 -05:00
Max Vozeler 01446ef5af staging: usbip: vhci: use urb->dev->portnum to find port
The access to pending_port was racy when two devices
were being attached at the same time.

Signed-off-by: Max Vozeler <max@vozeler.com>
Tested-by: Mark Wehby <MWehby@luxotticaRetail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-20 16:01:50 -08:00
Max Vozeler bd65f6233f staging: usbip: vhci: handle EAGAIN from SO_RCVTIMEO
If there is a receive timeout without any active
requests, we can tell the connection was idle and
ignore the timeout.

If there are active requests for which we expect
to receive a reply we close the connection.

This makes it possible to set an upper bound on
the time a usbip device may be unresponsive.

This is a workaround for the lack of heart-beat
messages in the USBIP protocol.

Extending the protocol would break compatibility
with all previous stub versions, so this seems like
the lesser evil.

Signed-off-by: Max Vozeler <max@vozeler.com>
Tested-by: Mark Wehby <MWehby@luxotticaRetail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-20 16:01:49 -08:00
Max Vozeler 7e249c8b07 staging: usbip: vhci: friendly log messages for connection errors
Also changes the event on connection close to be
VDEV_EVENT_DOWN - no functional change.

Signed-off-by: Max Vozeler <max@vozeler.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-20 16:01:49 -08:00
Max Vozeler 6d212153a8 staging: usbip: vhci: refuse to enqueue for dead connections
There can be requests to enqueue URBs while we are shutting
down a connection.

Signed-off-by: Max Vozeler <max@vozeler.com>
Tested-by: Mark Wehby <MWehby@luxotticaRetail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-20 16:01:49 -08:00
Max Vozeler b92a5e2373 staging: usbip: vhci: give back URBs from in-flight unlink requests
If we never received a RET_UNLINK because the TCP
connection broke the pending URBs still need to be
unlinked and given back.

Previously processes would be stuck trying to kill
the URB even after the device was detached.

Signed-off-by: Max Vozeler <max@vozeler.com>
Tested-by: Mark Wehby <MWehby@luxotticaRetail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-20 16:01:49 -08:00
Max Vozeler 7606ee8aa3 staging: usbip: vhci: update reference count for usb_device
This fixes an oops observed when reading status during
removal of a device:

[ 1706.648285] general protection fault: 0000 [#1] SMP
[ 1706.648294] last sysfs file: /sys/devices/platform/vhci_hcd/status
[ 1706.648297] CPU 1
[ 1706.648300] Modules linked in: binfmt_misc microcode fuse loop vhci_hcd(N) usbip(N) usbcore usbip_common_mod(N) rtc_core rtc_lib joydev dm_mirror dm_region_hash dm_log linear dm_snapshot xennet dm_mod ext3 mbcache jbd processor thermal_sys hwmon xenblk cdrom
[ 1706.648324] Supported: Yes
[ 1706.648327] Pid: 10422, comm: usbip Tainted: G          N  2.6.32.12-0.7-xen #1
[ 1706.648330] RIP: e030:[<ffffffff801b10d5>]  [<ffffffff801b10d5>] strnlen+0x5/0x40
[ 1706.648340] RSP: e02b:ffff8800a994dd30  EFLAGS: 00010286
[ 1706.648343] RAX: ffffffff80481ec1 RBX: 0000000000000000 RCX: 0000000000000002
[ 1706.648347] RDX: 00200d1d4f1c001c RSI: ffffffffffffffff RDI: 00200d1d4f1c001c
[ 1706.648350] RBP: ffff880129a1c0aa R08: ffffffffa01901c4 R09: 0000000000000006
[ 1706.648353] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8800a9a1c0ab
[ 1706.648357] R13: 00200d1d4f1c001c R14: 00000000ffffffff R15: ffff880129a1c0aa
[ 1706.648363] FS:  00007f2f2e9ca700(0000) GS:ffff880001018000(0000) knlGS:0000000000000000
[ 1706.648367] CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1706.648370] CR2: 000000000071b048 CR3: 00000000b4b68000 CR4: 0000000000002660
[ 1706.648374] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1706.648378] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 1706.648381] Process usbip (pid: 10422, threadinfo ffff8800a994c000, task ffff88007b170200)
[ 1706.648385] Stack:
[ 1706.648387]  ffffffff801b28c9 0000000000000002 ffffffffa01901c4 ffff8800a9a1c0ab
[ 1706.648391] <0> ffffffffa01901c6 ffff8800a994de08 ffffffff801b339b 0000000000000004
[ 1706.648397] <0> 0000000affffffff ffffffffffffffff 00000000000067c0 0000000000000000
[ 1706.648404] Call Trace:
[ 1706.648413]  [<ffffffff801b28c9>] string+0x39/0xe0
[ 1706.648419]  [<ffffffff801b339b>] vsnprintf+0x1eb/0x620
[ 1706.648423]  [<ffffffff801b3813>] sprintf+0x43/0x50
[ 1706.648429]  [<ffffffffa018d719>] show_status+0x1b9/0x220 [vhci_hcd]
[ 1706.648438]  [<ffffffff8024a2b7>] dev_attr_show+0x27/0x60
[ 1706.648445]  [<ffffffff80144821>] sysfs_read_file+0x101/0x1d0
[ 1706.648451]  [<ffffffff800da4a7>] vfs_read+0xc7/0x130
[ 1706.648457]  [<ffffffff800da613>] sys_read+0x53/0xa0
[ 1706.648462]  [<ffffffff80007458>] system_call_fastpath+0x16/0x1b
[ 1706.648468]  [<00007f2f2de40f30>] 0x7f2f2de40f30
[ 1706.648470] Code: 66 0f 1f 44 00 00 48 83 c2 01 80 3a 00 75 f7 48 89 d0 48 29 f8 f3 c3 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 48 85 f6 74 29 <80> 3f 00 74 24 48 8d 56 ff 48 89 f8 eb 0e 0f 1f 44 00 00 48 83
[ 1706.648507] RIP  [<ffffffff801b10d5>] strnlen+0x5/0x40
[ 1706.648511]  RSP <ffff8800a994dd30>
[ 1706.649575] ---[ end trace b4eb72bf2e149593 ]---

Signed-off-by: Max Vozeler <max@vozeler.com>
Tested-by: Mark Wehby <MWehby@luxotticaRetail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-20 16:01:48 -08:00
Max Vozeler 2d8f4595d1 staging: usbip: stub: update refcounts for devices and interfaces
The stub driver expects to access the usb interface
and usb device structures even if the device has been
disconnected in the meantime.

This change gets a reference to them in the stub probe
function using usb_get_intf()/usb_get_dev() and drops them
in the disconnect function.

This fixes an oops observed with a Logic Controls Line
display (0fa8:a030) which disconnects itself when it is
reset:

[ 1348.562274] BUG: unable to handle kernel paging request at 5f7433e5
[ 1348.562327] IP: [<c0393b02>] usb_lock_device_for_reset+0x22/0xd0
[ 1348.562374] *pde = 00000000
[ 1348.562397] Oops: 0000 [#1]
[ 1348.562418] last sysfs file: /sys/devices/pci0000:00/0000:00:10.2/usb4/4-1/bConfigurationValue
[ 1348.562454] Modules linked in: usbip vhci_hcd usbip_common_mod fbcon tileblit font bitblit softcursor serio_raw uvesafb pcspkr via_rng snd_via82xx gameport snd_ac97_codec ac97_bus snd_pcm_oss snd_mixer_oss snd_pcm snd_page_alloc snd_mpu401_uart snd_rawmidi snd_seq_oss snd_seq_midi_event snd_seq snd_timer snd_seq_device snd usbhid hid via_rhine soundcore mii igel_flash aufs pata_via
[ 1348.562649]
[ 1348.562670] Pid: 2855, comm: usbip_eh Not tainted (2.6.32 #23.37-ud-r113) M300C
[ 1348.562704] EIP: 0060:[<c0393b02>] EFLAGS: 00010216 CPU: 0
[ 1348.562734] EIP is at usb_lock_device_for_reset+0x22/0xd0
[ 1348.562762] EAX: 5f7433cd EBX: 5f7433cd ECX: de293a5c EDX: dd326a00
[ 1348.562793] ESI: 5f7433cd EDI: 000400f6 EBP: cf43ff48 ESP: cf43ff38
[ 1348.562824]  DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
[ 1348.562854] Process usbip_eh (pid: 2855, ti=cf43e000 task=d2c7f230 task.ti=cf43e000)
[ 1348.562884] Stack:
[ 1348.562900]  d6ec9960 de2939cc 5f7433cd 5f743431 cf43ff70 df8fd32f de2939cc d2c7f230
[ 1348.562940] <0> cf43ff70 00000282 00000282 de2939cc d2c7f230 d2c7f230 cf43ffa8 df84416d
[ 1348.562987] <0> cf43ff88 d2c7f230 de293a24 d2c7f230 00000000 d2c7f230 c014e760 cf43ff94
[ 1348.563042] Call Trace:
[ 1348.563073]  [<df8fd32f>] ? stub_device_reset+0x3f/0x110 [usbip]
[ 1348.563114]  [<df84416d>] ? event_handler_loop+0xcd/0xe8 [usbip_common_mod]
[ 1348.563156]  [<c014e760>] ? autoremove_wake_function+0x0/0x50
[ 1348.563193]  [<df843d80>] ? usbip_thread+0x0/0x60 [usbip_common_mod]
[ 1348.563230]  [<df843dd1>] ? usbip_thread+0x51/0x60 [usbip_common_mod]
[ 1348.563265]  [<c014e374>] ? kthread+0x74/0x80
[ 1348.563294]  [<c014e300>] ? kthread+0x0/0x80
[ 1348.563326]  [<c0103c47>] ? kernel_thread_helper+0x7/0x10
[ 1348.563351] Code: 00 e8 73 4d 00 00 5d c3 90 55 89 e5 83 ec 10 89 5d f4 89 75 f8 89 7d fc 0f 1f 44 00 00 8b 3d c0 2e 67 c0 81 c7 fa 00 00 00 89 c3 <8b> 40 18 89 d6 85 c0 75 15 b8 ed ff ff ff 8b 5d f4 8b 75 f8 8b
[ 1348.563528] EIP: [<c0393b02>] usb_lock_device_for_reset+0x22/0xd0 SS:ESP 0068:cf43ff38
[ 1348.563570] CR2: 000000005f7433e5
[ 1348.563593] ---[ end trace 9c3f1e3a2e5299d9 ]---

Signed-off-by: Max Vozeler <max@vozeler.com>
Tested-by: Mark Wehby <MWehby@luxotticaRetail.com>
Tested-by: Steven Harms <sharms@luxotticaRetail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-20 16:01:48 -08:00