Takahiro Hirofuchi | 0945b4f | 2011-05-14 03:55:07 -0700 | [diff] [blame] | 1 | /* |
matt mooney | 756d672 | 2011-06-19 22:44:47 -0700 | [diff] [blame] | 2 | * Copyright (C) 2011 matt mooney <mfm@muteddisk.com> |
| 3 | * 2005-2007 Takahiro Hirofuchi |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
Takahiro Hirofuchi | 0945b4f | 2011-05-14 03:55:07 -0700 | [diff] [blame] | 17 | */ |
| 18 | |
matt mooney | 756d672 | 2011-06-19 22:44:47 -0700 | [diff] [blame] | 19 | #ifndef __USBIP_HOST_DRIVER_H |
| 20 | #define __USBIP_HOST_DRIVER_H |
Takahiro Hirofuchi | 0945b4f | 2011-05-14 03:55:07 -0700 | [diff] [blame] | 21 | |
matt mooney | 099f79f | 2011-06-19 22:44:37 -0700 | [diff] [blame] | 22 | #include <stdint.h> |
| 23 | #include "usbip_common.h" |
Valentina Manea | 021aed8 | 2014-03-08 14:53:26 +0200 | [diff] [blame] | 24 | #include "list.h" |
Takahiro Hirofuchi | 0945b4f | 2011-05-14 03:55:07 -0700 | [diff] [blame] | 25 | |
matt mooney | 756d672 | 2011-06-19 22:44:47 -0700 | [diff] [blame] | 26 | struct usbip_host_driver { |
Takahiro Hirofuchi | 0945b4f | 2011-05-14 03:55:07 -0700 | [diff] [blame] | 27 | int ndevs; |
matt mooney | 756d672 | 2011-06-19 22:44:47 -0700 | [diff] [blame] | 28 | /* list of exported device */ |
Valentina Manea | 021aed8 | 2014-03-08 14:53:26 +0200 | [diff] [blame] | 29 | struct list_head edev_list; |
Takahiro Hirofuchi | 0945b4f | 2011-05-14 03:55:07 -0700 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | struct usbip_exported_device { |
Valentina Manea | 021aed8 | 2014-03-08 14:53:26 +0200 | [diff] [blame] | 33 | struct udev_device *sudev; |
Takahiro Hirofuchi | 0945b4f | 2011-05-14 03:55:07 -0700 | [diff] [blame] | 34 | int32_t status; |
matt mooney | 756d672 | 2011-06-19 22:44:47 -0700 | [diff] [blame] | 35 | struct usbip_usb_device udev; |
Valentina Manea | 021aed8 | 2014-03-08 14:53:26 +0200 | [diff] [blame] | 36 | struct list_head node; |
matt mooney | 35dd0c2 | 2011-05-27 01:44:14 -0700 | [diff] [blame] | 37 | struct usbip_usb_interface uinf[]; |
Takahiro Hirofuchi | 0945b4f | 2011-05-14 03:55:07 -0700 | [diff] [blame] | 38 | }; |
| 39 | |
matt mooney | 756d672 | 2011-06-19 22:44:47 -0700 | [diff] [blame] | 40 | extern struct usbip_host_driver *host_driver; |
Takahiro Hirofuchi | 0945b4f | 2011-05-14 03:55:07 -0700 | [diff] [blame] | 41 | |
matt mooney | 756d672 | 2011-06-19 22:44:47 -0700 | [diff] [blame] | 42 | int usbip_host_driver_open(void); |
| 43 | void usbip_host_driver_close(void); |
Takahiro Hirofuchi | 0945b4f | 2011-05-14 03:55:07 -0700 | [diff] [blame] | 44 | |
matt mooney | 756d672 | 2011-06-19 22:44:47 -0700 | [diff] [blame] | 45 | int usbip_host_refresh_device_list(void); |
| 46 | int usbip_host_export_device(struct usbip_exported_device *edev, int sockfd); |
| 47 | struct usbip_exported_device *usbip_host_get_device(int num); |
Takahiro Hirofuchi | 0945b4f | 2011-05-14 03:55:07 -0700 | [diff] [blame] | 48 | |
matt mooney | 756d672 | 2011-06-19 22:44:47 -0700 | [diff] [blame] | 49 | #endif /* __USBIP_HOST_DRIVER_H */ |