1 // SPDX-License-Identifier: GPL-2.0-or-later
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>
13 #include "usbip_host_common.h"
14 #include "usbip_host_driver.h"
17 #define PROGNAME "libusbip"
19 static int is_my_device(struct udev_device
*dev
)
23 driver
= udev_device_get_driver(dev
);
24 return driver
!= NULL
&& !strcmp(driver
, USBIP_HOST_DRV_NAME
);
27 static int usbip_host_driver_open(struct usbip_host_driver
*hdriver
)
32 INIT_LIST_HEAD(&hdriver
->edev_list
);
34 ret
= usbip_generic_driver_open(hdriver
);
36 err("please load " USBIP_CORE_MOD_NAME
".ko and "
37 USBIP_HOST_DRV_NAME
".ko!");
41 struct usbip_host_driver host_driver
= {
42 .edev_list
= LIST_HEAD_INIT(host_driver
.edev_list
),
43 .udev_subsystem
= "usb",
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
,