~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/usb/usbip/libsrc/usbip_host_driver.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-or-later
  2 /*
  3  * Copyright (C) 2011 matt mooney <mfm@muteddisk.com>
  4  *               2005-2007 Takahiro Hirofuchi
  5  * Copyright (C) 2015-2016 Samsung Electronics
  6  *               Igor Kotrasinski <i.kotrasinsk@samsung.com>
  7  *               Krzysztof Opasiak <k.opasiak@samsung.com>
  8  */
  9 
 10 #include <unistd.h>
 11 #include <libudev.h>
 12 
 13 #include "usbip_host_common.h"
 14 #include "usbip_host_driver.h"
 15 
 16 #undef  PROGNAME
 17 #define PROGNAME "libusbip"
 18 
 19 static int is_my_device(struct udev_device *dev)
 20 {
 21         const char *driver;
 22 
 23         driver = udev_device_get_driver(dev);
 24         return driver != NULL && !strcmp(driver, USBIP_HOST_DRV_NAME);
 25 }
 26 
 27 static int usbip_host_driver_open(struct usbip_host_driver *hdriver)
 28 {
 29         int ret;
 30 
 31         hdriver->ndevs = 0;
 32         INIT_LIST_HEAD(&hdriver->edev_list);
 33 
 34         ret = usbip_generic_driver_open(hdriver);
 35         if (ret)
 36                 err("please load " USBIP_CORE_MOD_NAME ".ko and "
 37                     USBIP_HOST_DRV_NAME ".ko!");
 38         return ret;
 39 }
 40 
 41 struct usbip_host_driver host_driver = {
 42         .edev_list = LIST_HEAD_INIT(host_driver.edev_list),
 43         .udev_subsystem = "usb",
 44         .ops = {
 45                 .open = usbip_host_driver_open,
 46                 .close = usbip_generic_driver_close,
 47                 .refresh_device_list = usbip_generic_refresh_device_list,
 48                 .get_device = usbip_generic_get_device,
 49                 .read_device = read_usb_device,
 50                 .read_interface = read_usb_interface,
 51                 .is_my_device = is_my_device,
 52         },
 53 };
 54 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php