summaryrefslogtreecommitdiff
path: root/drivers/staging/usbip
AgeCommit message (Collapse)Author
2014-02-14staging: usbip: prevent possible buffer overflow reading port recordsMark Asselstine
To avoid buffer overflow while reading a corrupted or possibly modified port file we validate the length of each part of the port record to ensure it doesn't exceed the length of the destination buffer. https://bugzilla.kernel.org/show_bug.cgi?id=69931 Signed-off-by: Mark Asselstine <asselsm@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-08Merge branch 'staging-linus' into staging-workGreg Kroah-Hartman
This is to pull in the lustre fixes so that others can continue to work on updating the lustre codebase, as well as resolve some merge issues with the ion and ocproto drivers to keep linux-next happy. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07usbip/userspace/libsrc/names.c: memory leakHeinrich Schuchardt
revised patch p is freed if NULL. p is leaked if second calloc fails. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07staging/usbip: userspace to use linux header for usb_device_speed enum, ↵Shuah Khan
missing speeds to speed_strings array Remove usb_device_speed enum define from usbip_common.h and change it to include linux/usb/ch9.h instead. Add speed strings for usb wireless and 3.0 to speed_strings array. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07staging/usbip: simplify usbip_dump_usb_device() udev->speed handlingShuah Khan
Change usbip_dump_usb_device() to use usb_speed_string() and remove the code that does switch on udev->speed and builds custom speed strings. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07staging: usbip: convert usbip-host driver to usb_device_driverValentina Manea
This driver was previously an interface driver. Since USB/IP exports a whole device, not just an interface, it would make sense to be a device driver. This patch also modifies the way userspace sees and uses a shared device: * the usbip_status file is no longer created for interface 0, but for the whole device (such as /sys/devices/pci0000:00/0000:00:01.2/usb1/1-1/usbip_status). * per interface information, such as interface class or protocol, is no longer sent/received; only device specific information is transmitted. * since the driver was moved one level below in the USB architecture, there is no need to bind/unbind each interface, just the device as a whole. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07staging/usbip: Change vhci_hcd store_attach() device information message to ↵Shuah Khan
include speed string Change vhci_hcd store_attach() routine to include speed string in its device information message. The current call to dev_info() prints out speed number which is the enum number. Change to call usb_speed_string() to print speed string in addition to the number. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07staging/usbip: remove vhci_hcd vhci_hub_status change messageShuah Khan
When vhci_hcd is enabled, the following message floods the dmesg buffer. This message doesn't provide any useful information other than cluttering the dmesg buffer. Fix it by removing the message. There is another debug message in this routine that dumps detailed port status change information. [ 4062.716662] vhci_hcd: changed 0 Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07staging/usbip: Fix vhci_hcd attach failure error message to be informativeShuah Khan
When attach fails due to unsupported and/or invalid bus speed, the message vhci_hcd prints out doesn't include any useful information as to what caused the failure. Change the message to be informative and use usb_speed_string() to get the right speed string from usb common. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-23Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree updates from Jiri Kosina: "Usual rocket science stuff from trivial.git" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits) neighbour.h: fix comment sched: Fix warning on make htmldocs caused by wait.h slab: struct kmem_cache is protected by slab_mutex doc: Fix typo in USB Gadget Documentation of/Kconfig: Spelling s/one/once/ mkregtable: Fix sscanf handling lp5523, lp8501: comment improvements thermal: rcar: comment spelling treewide: fix comments and printk msgs IXP4xx: remove '1 &&' from a condition check in ixp4xx_restart() Documentation: update /proc/uptime field description Documentation: Fix size parameter for snprintf arm: fix comment header and macro name asm-generic: uaccess: Spelling s/a ny/any/ mtd: onenand: fix comment header doc: driver-model/platform.txt: fix a typo drivers: fix typo in DEVTMPFS_MOUNT Kconfig help text doc: Fix typo (acces_process_vm -> access_process_vm) treewide: Fix typos in printk drivers/gpu/drm/qxl/Kconfig: reformat the help text ...
2014-01-09staging: usbip: userspace: add support for viewing imported devicesValentina Manea
As of Matt Mooney's major refactoring in 2011, usbip port option was left out. Add support for this option in a manner similar to the old implementation. Sample output: Imported USB devices ==================== Port 00: <Port in Use> at Full Speed(12Mbps) unknown vendor : unknown product (1687:6211) 2-1 -> usbip://192.168.122.152:3240/1-1 -> remote bus/dev 001/002 Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Reviewed-by: Ilija Hadzic <ihadzic@research.bell-labs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-19Merge branch 'master' into for-nextJiri Kosina
Sync with Linus' tree to be able to apply fixes on top of newer things in tree (efi-stub). Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-12-18usbip: Fix sscanf handlingAlan
Scan only to the length permitted by the buffer One of a set of sscanf problems noted by Jackie Chang Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-16staging: usbip: Remove double initialization of msg_namelen variableSankha Narayan Guria
This removes the double initialization of the msg_namelen variable. Signed-off-by: Sankha Narayan Guria <sankha93@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-12-03Staging: usbip: vhci_hcd.c: removed a spaceAldo Iljazi
Line 921: Removed the space before the semicolon. Signed-off-by: Aldo Iljazi <mail@aldo.io> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-19staging: usbip: Remove superfluous name castGeert Uytterhoeven
platform_device.name is "const char *" Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-19staging: Remove superfluous name castsGeert Uytterhoeven
device_driver.name is "const char *" Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10staging: usbip: fix sparse warnings regarding endiannessTeodora Baluta
The wHubCharacteristics field in usb_hub_descriptor structure is __le16 so there is no need for cast. The cpu_to_le16 returns a __le16 type for a u16 type. Used cpu_to_le16 to silence last sparse error. drivers/staging/usbip/vhci_hcd.c:223:35: warning: incorrect type in assignment (different base types) drivers/staging/usbip/vhci_hcd.c:223:35: expected restricted __le16 [usertype] wHubCharacteristics drivers/staging/usbip/vhci_hcd.c:223:35: got unsigned short [unsigned] [usertype] <noident> drivers/staging/usbip/vhci_hcd.c:351:34: warning: incorrect type in assignment (different base types) drivers/staging/usbip/vhci_hcd.c:351:34: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/usbip/vhci_hcd.c:351:34: got restricted __le16 [usertype] <noident> drivers/staging/usbip/vhci_hcd.c:352:34: warning: incorrect type in assignment (different base types) drivers/staging/usbip/vhci_hcd.c:352:34: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/usbip/vhci_hcd.c:352:34: got restricted __le16 [usertype] <noident> drivers/staging/usbip/vhci_hcd.c:540:36: warning: restricted __le16 degrades to integer Signed-off-by: Teodora Baluta <teobaluta@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10staging:usbip:usbip_common.c: Join quoted string split accross linesHimangi Saraogi
This patch removes the checkpatch.pl warnings "quoted string split accross lines" in usbip_common.c. Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10staging:usbip:stub_rx.c: Remove warning quoted string split across linesHimangi Saraogi
This patch removes the checkpatch.pl warnings "quoted string split across lines" in stub_rx.c by merging the quoted strings and the ensuring that the lines are not more than 80 characters long. Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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>