blob: 34fd14cbfc49d3def304caae9edde9366c59a689 [file] [log] [blame]
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -07001/*
matt mooney756d6722011-06-19 22:44:47 -07002 * 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 Hirofuchi0945b4f2011-05-14 03:55:07 -070017 */
18
matt mooney756d6722011-06-19 22:44:47 -070019#ifndef __USBIP_HOST_DRIVER_H
20#define __USBIP_HOST_DRIVER_H
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070021
matt mooney099f79f2011-06-19 22:44:37 -070022#include <stdint.h>
23#include "usbip_common.h"
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070024
matt mooney756d6722011-06-19 22:44:47 -070025struct usbip_host_driver {
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070026 int ndevs;
27 struct sysfs_driver *sysfs_driver;
matt mooney756d6722011-06-19 22:44:47 -070028 /* list of exported device */
29 struct dlist *edev_list;
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070030};
31
32struct usbip_exported_device {
33 struct sysfs_device *sudev;
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070034 int32_t status;
matt mooney756d6722011-06-19 22:44:47 -070035 struct usbip_usb_device udev;
matt mooney35dd0c22011-05-27 01:44:14 -070036 struct usbip_usb_interface uinf[];
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070037};
38
matt mooney756d6722011-06-19 22:44:47 -070039extern struct usbip_host_driver *host_driver;
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070040
matt mooney756d6722011-06-19 22:44:47 -070041int usbip_host_driver_open(void);
42void usbip_host_driver_close(void);
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070043
matt mooney756d6722011-06-19 22:44:47 -070044int usbip_host_refresh_device_list(void);
45int usbip_host_export_device(struct usbip_exported_device *edev, int sockfd);
46struct usbip_exported_device *usbip_host_get_device(int num);
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070047
matt mooney756d6722011-06-19 22:44:47 -070048#endif /* __USBIP_HOST_DRIVER_H */