summaryrefslogtreecommitdiff
path: root/drivers/staging/usbip
AgeCommit message (Collapse)Author
2014-04-07Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12Scott Wood
2013-09-25staging: usbip: Fix man-pages for usbip userspace utilitiesTobias Polzer
The usbip userspace utilities contained some half-documented (only in --help, not in man) options. They were added to the man-pages of usbip and usbipd. Also a typo in the usbip headline was fixed. Signed-off-by: Tobias Polzer <tobias.polzer@fau.de> Signed-off-by: Dominik Paulus <dominik.paulus@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25staging: usbip: Fix IPv6 support in usbipdDominik Paulus
getaddrinfo() leaves the order of the returned addrinfo structs unspecified. On systems with bindv6only disabled (this is the default), PF_INET6 sockets bind to IPv4, too. Thus, IPv6 support in usbipd was broken when getaddrinfo returned first IPv4 and then IPv6 addrinfos, as the IPv6 bind failed with EADDRINUSE. This patch uses seperate sockets for IPv4 and IPv6 and sets IPV6_V6ONLY on all IPv6 sockets. Two command line arguments, -4 and -6 were added to manually select the socket family. Signed-off-by: Tobias Polzer <tobias.polzer@fau.de> Signed-off-by: Dominik Paulus <dominik.paulus@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25staging: usbip: Fix build on Debian ppcTobias Polzer
One missing include was added. Signed-off-by: Dominik Paulus <dominik.paulus@fau.de> Signed-off-by: Tobias Polzer <tobias.polzer@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25staging: usbip: Fix build with --with-tcp-wrappersDominik Paulus
With --with-tcp-wrappers=no specified, the build system reset LIBS to the empty string and thus fails to link against libsysfs. Signed-off-by: Dominik Paulus <dominik.paulus@fau.de> Signed-off-by: Tobias Polzer <tobias.polzer@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25Staging: usbip: stub_dev: Fixed checkpatch warningsElad Wexler
Coding style issues Signed-off-by: Elad Wexler <eladwexler77@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25staging: usbip: vhci_hcd: remove check for dmanavin patidar
vhci_hcd is a virtual usb host controller, so no need to check for dma. Signed-off-by: navin patidar <navinp@cdac.in> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25staging: usbip: vhci_hcd: correctly handle return valuenavin patidar
ret == 0 means success, anything else is failure. Signed-off-by: navin patidar <navinp@cdac.in> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25staging: usbip: stub_main: correctly handle return valuenavin patidar
ret == 0 means success, anything else is failure. Signed-off-by: navin patidar <navinp@cdac.in> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26staging: usbip: use DEVICE_ATTR_RO/RW for sysfs attributesGreg Kroah-Hartman
It's easier to audit the sysfs files if they use the RO/RW macros, so convert the usbip code to them. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23staging: usbip: fix up alignment in long options listAnthony Foiani
Re-align the option lists. Signed-off-by: Anthony Foiani <anthony.foiani@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23staging: usbip: properly handle "-l" / "--log" optionAnthony Foiani
This option is in the long options list, and it's handled in the option processing loop, but the optstring didn't include it. Signed-off-by: Anthony Foiani <anthony.foiani@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23staging: usbip: set usbipd server port via "-t" / "--tcp-port" option.Anthony Foiani
Add an option "-t" / "--tcp-port" to specify the TCP port to listen on. Downcase associated variables as they're no longer constants. Signed-off-by: Anthony Foiani <anthony.foiani@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23staging: usbip: add "-P" / "--pid" option to save usbipd process idAnthony Foiani
Introduce option "-P" / "--pid" to request that usbipd save its PID to a file while running. Signed-off-by: Anthony Foiani <anthony.foiani@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-21staging: usbip: Fix typo in comments within usbipMasanari Iida
Correct spelling typo in comments Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: usbip: improve error reportingAnthony Foiani
Give useful error messages when we can't create server sockets. Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: usbip: use local variable while setting up socketAnthony Foiani
Using a simple integer makes the code easier to read and removes the need to blank out array elements in case of errors. Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: usbip: clean up checkpatch warnings in usbipd.cAnthony Foiani
A few whitespace changes allows the file to pass checkpatch --strict (other than ignoring the CamelCase derived from the USB standard.) Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13staging: usbip: Renaming pr_warning functionLisa Nguyen
Eliminated the following warning "WARNING: Prefer pr_warn(... to pr_warning(...)" by renaming the pr_warning function to pr_warn in usbip_event.c file. Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: userspace: show product name in `list -l' commandKurt Kanzenbach
The `usbip list -l' command shows your local usb-devices. Example: $ usbip list -l $ Local USB devices $ ================= $ - busid 1-1 (13fe:1d00) $ 1-1:1.0 -> usb-storage $ $ - busid 1-2 (0409:55aa) $ 1-2:1.0 -> hub However this list command doesn't show which device is connected to this busid. Therefore you have to use another tool e.g. lsusb to determine that. This patches adds the possibility to see which device that is. Example: $ usbip list -l $ Local USB devices $ ================= $ - busid 1-1 (13fe:1d00) $ Kingston Technology Company Inc. : DataTraveler 2.0 1GB/4GB Flash Drive / Patriot Xporter 4GB Flash $ 1-1:1.0 -> usb-storage $ $ - busid 1-2 (0409:55aa) $ NEC Corp. : Hub (0409:55aa) $ 1-2:1.0 -> hub If parsable is specified the info will be not printed. Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: userspace: unified command line argumentsKurt Kanzenbach
The command `usbip attach' uses --host for specifing the remote host, while `usbip list' uses --remote. This is confusing and this patch adapts this. In Addition changed the manpage and README accordingly. Before: $ usbip attach --host <host> -b <busid> $ usbip list --remote <host> Now: $ usbip attach --remote <host> -b <busid> $ usbip list --remote <host> Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: userspace: libsrc: cleanup parsingKurt Kanzenbach
Since the names.c/names.h are taken from another project, some functions which names.c provides aren't used by usbipd. This patch fixes: - removed useless comments - unified debug/error messages by using the macros provided by usbip_common.h - removed unnused code The code cleanup includes: - remove unused data structures - remove code to create them - remove code to access them The file names.c is used to parse the `usb.ids' file. The parser stores a lot of information about usb devices that is never used. The `usb.ids' file has several sections. Some variables (like `lasthut') store the ID of the current section, and those variables are used to decide which section is currently being parsed (i.e. in which data structure the current line will be stored). We removed the code to read those IDs because they are never used anyway. We replaced them by the pseudo-ID `1' (instead of reading the ID from the file) to indicate that the parser is in a section that can be ignored. If the parser is in such a section, the current line (which contains sub-items for this section) is discarded. Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: userspace: removed unnecessary codeKurt Kanzenbach
Since no usbip_name function is used in usbipd, it's not necessary to parse "usb.ids" file at startup. Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: userspace: avoid memory leaksStefan Reif
Call freeaddrinfo when connect/listen fails. Call usbip_host_driver_close on error. Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: simplified cleanup functionKurt Kanzenbach
This patch simplified "stub_device_free" cleanup function: - changed return type to void, since the return value is not checked anywhere - kfree is NULL-safe, so removed if statement - deleted debug-message Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: removed unnecessary for loopKurt Kanzenbach
This for loop is not needed, since STUB_BUSID_OTHER is defined as 0. In Addition added a comment if STUB_BUSID_OTHER changes sometime. Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: removed unnecessary if-else-statementsKurt Kanzenbach
In each if-else case "return" is called. This is why these if-else-statements are useless. Removing them improves understanding and readability. Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: simplified errorhandlingKurt Kanzenbach
In each errorcase spin_unlock_irq is called and -EINVAL is returned. To simplify that I created a label called "err" doing that. On Success count will be returned. Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: simple indent fixStefan Reif
Fix an indent. Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: remove unnused, broken macroStefan Reif
Remove broken preprocessor macro "hardware". It is unused and it references an element (pdev in vhci_hcd) that does not exist. Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: removed enumeration of commentsKurt Kanzenbach
Enumerations for one comment makes no sense. This is why this should be removed. Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: reformat function pickup_urb_and_free_privStefan Reif
re-indent funtion "pickup_urb_and_free_priv" to improve readability. Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: reformat function stub_recv_cmd_unlink()Kurt Kanzenbach
Reformat function stub_recv_cmd_unlink() to improve readability. Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: usbip: userspace: libsrc: replace numbers by asciiStefan Reif
replace numbers in code by ascii text constants as suggested by Dan Carpenter: http://driverdev.linuxdriverproject.org/pipermail/devel/2013-February/035907.html Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: usbip: removed lines over 80 charactersKurt Kanzenbach
This patch fixes the following checkpatch warning: -WARNING: line over 80 characters Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: usbip: userspace: fix whitespace errorsStefan Reif
This patch fixes the following checkpatch errors: -ERROR: space required after that ',' -ERROR: spaces required around that '=' -ERROR: space prohibited before that close parenthesis -WARNING: please, no space before tabs Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: usbip: remove unnecessary bracesStefan Reif
This patch fixes the following checkpatch warning: -WARNING: braces {} are not necessary for any arm of this statement Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de> Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: usbip: userspace: libsrc: added missing spaceKurt Kanzenbach
This patch fixes the following checkpatch warning: -WARNING: missing space after enum definition Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: usbip: userspace: libsrc: removed assignments in if conditionsKurt Kanzenbach
This patch fixes the following checkpatch error: -ERROR: do not use assignment in if condition Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: usbip: userspace: libsrc: replaced lines over 80 charactersKurt Kanzenbach
This patch fixes some of the following checkpatch warnings: -WARNING: line over 80 characters We did not split format strings for readability. Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: usbip: userspace: libsrc: (foo*) should be (foo *)Kurt Kanzenbach
This patch fixes the following checkpatch error: -ERROR: "(foo*)" should be "(foo *)" Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: usbip: userspace: libsrc: spaces required around that '='Kurt Kanzenbach
This patch fixes the following checkpatch error: -ERROR: spaces required around that '=' Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: usbip: userspace: libsrc: do not init static/globals to 0Kurt Kanzenbach
This patch fixes the following checkpatch errors: -ERROR: do not initialise statics to 0 or NULL -ERROR: do not initialise globals to 0 or NULL Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: usbip: userspace: libsrc: fix indentionKurt Kanzenbach
This patch fixes the following checkpatch warning: -ERROR: code indent should use tabs where possible -WARNING: suspect code indent for conditional statements Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-27Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs pile (part one) from Al Viro: "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent locking violations, etc. The most visible changes here are death of FS_REVAL_DOT (replaced with "has ->d_weak_revalidate()") and a new helper getting from struct file to inode. Some bits of preparation to xattr method interface changes. Misc patches by various people sent this cycle *and* ocfs2 fixes from several cycles ago that should've been upstream right then. PS: the next vfs pile will be xattr stuff." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits) saner proc_get_inode() calling conventions proc: avoid extra pde_put() in proc_fill_super() fs: change return values from -EACCES to -EPERM fs/exec.c: make bprm_mm_init() static ocfs2/dlm: use GFP_ATOMIC inside a spin_lock ocfs2: fix possible use-after-free with AIO ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero target: writev() on single-element vector is pointless export kernel_write(), convert open-coded instances fs: encode_fh: return FILEID_INVALID if invalid fid_type kill f_vfsmnt vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op nfsd: handle vfs_getattr errors in acl protocol switch vfs_getattr() to struct path default SET_PERSONALITY() in linux/elf.h ceph: prepopulate inodes only when request is aborted d_hash_and_lookup(): export, switch open-coded instances 9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate() 9p: split dropping the acls from v9fs_set_create_acl() ...
2013-02-23new helper: file_inode(file)Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-02-15staging/usbip: Mark local functions as static (fix sparse warnings)Peter Huewe
sparse complains about these functions: usbip/stub_dev.c:529:5: warning: symbol 'stub_pre_reset' was not declared. Should it be static? usbip/stub_dev.c:535:5: warning: symbol 'stub_post_reset' was not declared. Should it be static? -> add static keyword to silence the warning and make sparse happy. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-11staging: Remove unnecessary OOM messagesJoe Perches
alloc failures already get standardized OOM messages and a dump_stack. For the affected mallocs around these OOM messages: Converted kzallocs with multiplies to kcalloc. Converted kmallocs with multiplies to kmalloc_array. Converted a kmalloc/strlen/strncpy to kstrdup. Moved a spin_lock below a removed OOM message and removed a now unnecessary spin_unlock. Neatened alignment and whitespace. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-22staging: usbip: replace the interrupt safe spinlocks with common ones.Harvey Yang
On the client side, we have a virtual hcd driver, there actually no hardware interrupts, so we do not need worry about race conditions caused by irq with spinlock held. Turning off irq is not good for system performance after all. Just replace them with a non interrupt safe version. Signed-off-by: Harvey Yang <harvey.huawei.yang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-22staging: usbip: use interrupt safe spinlock to avoid potential deadlock.Harvey Yang
The function 'usbip_event_add()' may be called in interrupt context on the stub side: 'stub_complete'->'stub_enqueue_ret_unlink'->'usbip_event_add'. In this function it tries to get the lock 'ud->lock', so we should disable irq when we get this lock in process context. Signed-off-by: Harvey Yang <harvey.huawei.yang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>