10945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi/*
2756d6726f855b07413540031a210286c42d937bdmatt mooney * Copyright (C) 2011 matt mooney <mfm@muteddisk.com>
3756d6726f855b07413540031a210286c42d937bdmatt mooney *               2005-2007 Takahiro Hirofuchi
4756d6726f855b07413540031a210286c42d937bdmatt mooney *
5756d6726f855b07413540031a210286c42d937bdmatt mooney * This program is free software: you can redistribute it and/or modify
6756d6726f855b07413540031a210286c42d937bdmatt mooney * it under the terms of the GNU General Public License as published by
7756d6726f855b07413540031a210286c42d937bdmatt mooney * the Free Software Foundation, either version 2 of the License, or
8756d6726f855b07413540031a210286c42d937bdmatt mooney * (at your option) any later version.
9756d6726f855b07413540031a210286c42d937bdmatt mooney *
10756d6726f855b07413540031a210286c42d937bdmatt mooney * This program is distributed in the hope that it will be useful,
11756d6726f855b07413540031a210286c42d937bdmatt mooney * but WITHOUT ANY WARRANTY; without even the implied warranty of
12756d6726f855b07413540031a210286c42d937bdmatt mooney * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13756d6726f855b07413540031a210286c42d937bdmatt mooney * GNU General Public License for more details.
14756d6726f855b07413540031a210286c42d937bdmatt mooney *
15756d6726f855b07413540031a210286c42d937bdmatt mooney * You should have received a copy of the GNU General Public License
16756d6726f855b07413540031a210286c42d937bdmatt mooney * along with this program. If not, see <http://www.gnu.org/licenses/>.
170945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi */
180945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi
19756d6726f855b07413540031a210286c42d937bdmatt mooney#ifndef __USBIP_HOST_DRIVER_H
20756d6726f855b07413540031a210286c42d937bdmatt mooney#define __USBIP_HOST_DRIVER_H
210945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi
22099f79fa5a02c909ca1a621768fe454b664a7efamatt mooney#include <stdint.h>
23099f79fa5a02c909ca1a621768fe454b664a7efamatt mooney#include "usbip_common.h"
240945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi
25756d6726f855b07413540031a210286c42d937bdmatt mooneystruct usbip_host_driver {
260945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi	int ndevs;
270945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi	struct sysfs_driver *sysfs_driver;
28756d6726f855b07413540031a210286c42d937bdmatt mooney	/* list of exported device */
29756d6726f855b07413540031a210286c42d937bdmatt mooney	struct dlist *edev_list;
300945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi};
310945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi
320945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchistruct usbip_exported_device {
330945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi	struct sysfs_device *sudev;
340945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi	int32_t status;
35756d6726f855b07413540031a210286c42d937bdmatt mooney	struct usbip_usb_device udev;
3635dd0c2da61a584678a4a8425c174c7dbdd36e2bmatt mooney	struct usbip_usb_interface uinf[];
370945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi};
380945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi
39756d6726f855b07413540031a210286c42d937bdmatt mooneyextern struct usbip_host_driver *host_driver;
400945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi
41756d6726f855b07413540031a210286c42d937bdmatt mooneyint usbip_host_driver_open(void);
42756d6726f855b07413540031a210286c42d937bdmatt mooneyvoid usbip_host_driver_close(void);
430945b4fe3f016900f1f68255e24920b28624a9aaTakahiro Hirofuchi
44756d6726f855b07413540031a210286c42d937bdmatt mooneyint usbip_host_refresh_device_list(void);
45756d6726f855b07413540031a210286c42d937bdmatt mooneyint usbip_host_export_device(struct usbip_exported_device *edev, int sockfd);
46756d6726f855b07413540031a210286c42d937bdmatt mooneystruct usbip_exported_device *usbip_host_get_device(int num);
47099f79fa5a02c909ca1a621768fe454b664a7efamatt mooney
48756d6726f855b07413540031a210286c42d937bdmatt mooney#endif /* __USBIP_HOST_DRIVER_H */
49