summaryrefslogtreecommitdiff
path: root/drivers/staging/usbip/userspace/src
AgeCommit message (Collapse)AuthorFilesLines
2014-08-25usbip: move usbip userspace code out of stagingValentina Manea14-2542/+0
At this point, USB/IP userspace code is fully functional and can be moved out of staging. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23staging: usbip: Fix bad fuction definitions in usbipPawel Lebioda2-3/+3
Fix bad function definitions in all files from drivers/staging/usbip directory Signed-off-by: Pawel Lebioda <pawel.lebioda89@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23Staging: usbip: missing a blank lines after declarationsPawel Lebioda2-1/+6
Fix "Missing a blank line after declaration" style problems for all files in drivers/staging/usbip. Signed-off-by: Pawel Lebioda <pawel.lebioda89@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-09staging: usbip: trigger driver probing after unbinding from usbip-hostValentina Manea1-2/+15
A sysfs attribute is used to announce kernel space that a new driver probing session should be triggered for the just unbinded device. In order to have the address of struct device associated to this USB device, a new member has been added to struct bus_id_priv. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-09staging: usbip: userspace: migrate usbip_host_driver to libudevValentina Manea1-6/+8
This patch modifies usbip_host_driver to use libudev. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Reviewed-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-09staging: usbip: userspace: move sysfs_utils to libsrcValentina Manea3-42/+1
Since it offers a API to both usbip tools and libusbip, it is more appropriate to be place in the library. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-09staging: usbip: userspace: re-add interface information listingValentina Manea2-2/+34
This was deleted in the driver conversion patch. It didn't need to be deleted; showing more information is ok. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Reviewed-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-09staging: usbip: userspace: migrate usbip_list to libudevValentina Manea1-83/+50
This patch modifies usbip_list to use libudev. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-09staging: usbip: userspace: migrate usbip_unbind to libudevValentina Manea1-64/+29
This patch modifies usbip_unbind to use libudev. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Reviewed-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-09staging: usbip: userspace: remove useless libsysfs includesValentina Manea3-4/+0
This patch removes useless libsysfs.h includes in various userspace files. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-09staging: usbip: userspace: migrate usbip_bind to libudevValentina Manea5-127/+112
This patch adds autoconf check for libudev and migrates usbip_bind to the new library. libsysfs will still be used until all userspace is modified. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Reviewed-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 Manea4-157/+70
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-01-09staging: usbip: userspace: add support for viewing imported devicesValentina Manea4-1/+65
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-09-26staging: usbip: Fix IPv6 support in usbipdDominik Paulus3-18/+64
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-26staging: usbip: Fix build on Debian ppcTobias Polzer1-0/+4
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-08-23staging: usbip: fix up alignment in long options listAnthony Foiani2-10/+10
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 Foiani1-1/+1
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 Foiani6-12/+55
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 Foiani1-1/+39
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 Iida1-1/+1
Correct spelling typo in comments Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-24staging: usbip: improve error reportingAnthony Foiani1-6/+22
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-24staging: usbip: use local variable while setting up socketAnthony Foiani1-15/+12
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-24staging: usbip: clean up checkpatch warnings in usbipd.cAnthony Foiani1-15/+16
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-04-06staging: usbip: userspace: show product name in `list -l' commandKurt Kanzenbach1-0/+12
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-06staging: usbip: userspace: unified command line argumentsKurt Kanzenbach1-6/+6
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-06staging: usbip: userspace: removed unnecessary codeKurt Kanzenbach1-4/+0
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-06staging: usbip: userspace: avoid memory leaksStefan Reif2-3/+8
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-03-11staging: usbip: userspace: fix whitespace errorsStefan Reif4-6/+6
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-01-08staging: usbip: userspace: suppress a bogus errorIlija Hadzic1-2/+13
If mkdir() of VHCI_STATE_PATH fails because the directory already exists, that's not an error. This patch fixes annoying "record connection" errors that would typically come up on attach. Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com> Acked-by: David Chang <dchang@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-08staging: usbip: userspace: eliminate glib dependencyIlija Hadzic2-43/+57
USBIP daemon relies on functions available in glib2 library to spawn handler code for incoming connection. This makes the whole program dependent on glib2 library, which is a GNOME library that on systems that don't have GNOME results in pulling more dependency, only to be able to run a relatively trivial socket-based program. While this may not seem to be a problem on full-blown desktops that already have the necessary libraries, it is a big issue on small embedded systems (think USB hub with an Ethernet port) that only have bare essentials in their file systems. This patch eliminates glib2 dependency by reworking the code to use lower level system calls to dispatch connection handler. Instead of using glib2-style event loop and dispatching mechanism, just do a ppoll(2) system call in our own loop and call accept(2) followed by fork(2) on the socket that has incoming connection. Stevens' books taught us that more than twenty years ago. No need for anything smarter in a simple server, such as usbipd. Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-16usb: usbip: userspace: remove the port state file when detaching port.Harvey Yang1-0/+9
with the last detached port state file remaining, usbip reports error on attaching. So clean up the state files on detaching. Signed-off-by: Harvey Yang <harvey.huawei.yang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-11staging: usbip: userspace: include headers in release tarballsNatanael Copa1-2/+3
The header files should be included in generated tarballs for archives. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-08-24Merge git://git.kernel.org/pub/scm/linux/kernel/git/lwfinger/r8192E into ↵Greg Kroah-Hartman1-0/+1
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-24staging: usbip: userspace: Check return value for mkdir()Tobias Klauser1-1/+3
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-01Merge branch 'master' of ↵Larry Finger1-25/+0
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-07-27Merge branch 'master' of ↵Larry Finger1-0/+26
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-09staging: usbip: userspace: usbip: modify `list' help messagematt mooney2-2/+2
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-09staging: usbip: userspace: usbip_list.c: modify exportable device outputmatt mooney1-4/+4
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-09staging: usbip: userspace: fix header installation bugmatt mooney1-3/+3
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-09staging: usbip: userspace: add new prefix for usbip network codematt mooney5-89/+92
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-09staging: usbip: userspace: usbipd: major cleanup of daemonmatt mooney1-347/+344
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-06staging: usbip: userspace: usbipd.c: fix userspace build errorDavid Chang1-8/+8
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-06staging: usbip: userspace: usbip_network.c: coding style cleanupmatt mooney1-31/+42
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-06staging: usbip: userspace: usbip list: move output headermatt mooney1-6/+11
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-06staging: usbip: userspace: usbip list: edit output messagesmatt mooney1-24/+34
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-06staging: usbip: userspace: usbip_unbind.c: implement using libsysfsmatt mooney1-16/+107
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-06staging: usbip: userspace: usbip_bind.c: major rewrite of the implementationmatt mooney1-145/+158
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-06staging: usbip: userspace: utils.c: rewrite modify_match_busidmatt mooney1-28/+40
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-06staging: usbip: userspace: utils: remove libsysfs circumventionmatt mooney2-263/+18
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-06staging: usbip: userspace: usbip: modify command failurematt mooney1-5/+8
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>