lkml.org 
[lkml]   [2018]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 3.16 157/410] usbip: list: don't list devices attached to vhci_hcd
    3.16.57-rc1 review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Shuah Khan <shuahkh@osg.samsung.com>

    commit ef824501f50846589f02173d73ce3fe6021a9d2a upstream.

    usbip host lists devices attached to vhci_hcd on the same server
    when user does attach over localhost or specifies the server as the
    remote.

    usbip attach -r localhost -b busid
    or
    usbip attach -r servername (or server IP)

    Fix it to check and not list devices that are attached to vhci_hcd.

    Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    [bwh: Backported to 3.16: adjust filename]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    drivers/staging/usbip/userspace/src/usbip_list.c | 9 +++++++++
    1 file changed, 9 insertions(+)

    --- a/drivers/staging/usbip/userspace/src/usbip_list.c
    +++ b/drivers/staging/usbip/userspace/src/usbip_list.c
    @@ -180,6 +180,7 @@ static int list_devices(bool parsable)
    const char *busid;
    char product_name[128];
    int ret = -1;
    + const char *devpath;

    /* Create libudev context. */
    udev = udev_new();
    @@ -202,6 +203,14 @@ static int list_devices(bool parsable)
    path = udev_list_entry_get_name(dev_list_entry);
    dev = udev_device_new_from_syspath(udev, path);

    + /* Ignore devices attached to vhci_hcd */
    + devpath = udev_device_get_devpath(dev);
    + if (strstr(devpath, USBIP_VHCI_DRV_NAME)) {
    + dbg("Skip the device %s already attached to %s\n",
    + devpath, USBIP_VHCI_DRV_NAME);
    + continue;
    + }
    +
    /* Get device information. */
    idVendor = udev_device_get_sysattr_value(dev, "idVendor");
    idProduct = udev_device_get_sysattr_value(dev, "idProduct");
    \
     
     \ /
      Last update: 2018-06-07 17:59    [W:3.888 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site