extern struct kmem_cache *stub_priv_cache;
-/*-------------------------------------------------------------------------*/
-/* prototype declarations */
-
/* stub_tx.c */
void stub_complete(struct urb *);
int stub_tx_loop(void *data);
.id_table = stub_table,
};
-/*-------------------------------------------------------------------------*/
-
-/* Define sysfs entries for a usbip-bound device */
-
-
/*
* usbip_status shows status of usbip as long as this driver is bound to the
* target device.
device_remove_file(dev, &dev_attr_usbip_debug);
}
-/*-------------------------------------------------------------------------*/
-
-/* Event handler functions called by an event handler thread */
-
static void stub_shutdown_connection(struct usbip_device *ud)
{
struct stub_device *sdev = container_of(ud, struct stub_device, ud);
spin_unlock(&ud->lock);
}
-/*-------------------------------------------------------------------------*/
-
/**
* stub_device_alloc - allocate a new stub_device struct
* @interface: usb_interface of a new device
return 0;
}
-/*-------------------------------------------------------------------------*/
-
/*
* If a usb device has multiple active interfaces, this driver is bound to all
* the active interfaces. However, usbip exports *a* usb device (i.e., not *an*
/* stub_priv is allocated from stub_priv_cache */
struct kmem_cache *stub_priv_cache;
-/*-------------------------------------------------------------------------*/
-
-/* Define sysfs entries for the usbip driver */
-
/*
* busid_tables defines matching busids that usbip can grab. A user can change
* dynamically what device is locally used and what device is exported to a
static DRIVER_ATTR(match_busid, S_IRUSR|S_IWUSR, show_match_busid,
store_match_busid);
-/*-------------------------------------------------------------------------*/
-
-/* Cleanup functions used to free private data */
-
static struct stub_priv *stub_priv_pop_from_listhead(struct list_head *listhead)
{
struct stub_priv *priv, *tmp;
}
}
-/*-------------------------------------------------------------------------*/
-
static int __init usb_stub_init(void)
{
int ret;
wake_up(&sdev->tx_waitq);
}
-/*-------------------------------------------------------------------------*/
-/* fill PDU */
-
static inline void setup_base_pdu(struct usbip_header_basic *base,
__u32 command, __u32 seqnum)
{
rpdu->u.ret_unlink.status = unlink->status;
}
-/*-------------------------------------------------------------------------*/
-/* send RET_SUBMIT */
-
static struct stub_priv *dequeue_from_priv_tx(struct stub_device *sdev)
{
unsigned long flags;
return total_size;
}
-/*-------------------------------------------------------------------------*/
-/* send RET_UNLINK */
-
static struct stub_unlink *dequeue_from_unlink_tx(struct stub_device *sdev)
{
unsigned long flags;
return total_size;
}
-/*-------------------------------------------------------------------------*/
-
int stub_tx_loop(void *data)
{
struct usbip_device *ud = data;
"Takahiro Hirofuchi <hirofuchi _at_ users.sourceforge.net>"
#define DRIVER_DESC "usbip common driver"
-/*-------------------------------------------------------------------------*/
-/* debug routines */
-
#ifdef CONFIG_USB_IP_DEBUG_ENABLE
unsigned long usbip_debug_flag = 0xffffffff;
#else
}
EXPORT_SYMBOL_GPL(usbip_dump_header);
-/*-------------------------------------------------------------------------*/
-/* socket routines */
-
/* Send/receive messages over TCP/IP. I refer drivers/block/nbd.c */
int usbip_xmit(int send, struct socket *sock, char *buf,
int size, int msg_flags)
}
EXPORT_SYMBOL_GPL(sockfd_to_socket);
-/*-------------------------------------------------------------------------*/
-/* pdu routines */
-
/* there may be more cases to tweak the flags. */
static unsigned int tweak_transfer_flags(unsigned int flags)
{
}
EXPORT_SYMBOL_GPL(usbip_recv_xbuff);
-/*-------------------------------------------------------------------------*/
-
static int __init usbip_common_init(void)
{
printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "" DRIVER_VERSION);
#include <asm/byteorder.h>
#include <net/sock.h>
-/*-------------------------------------------------------------------------*/
-
-/*
- * define macros to print messages
- */
-
/**
* usbip_udbg - print debug messages if CONFIG_USB_IP_DEBUG_ENABLE is defined
* @fmt:
printk(KERN_INFO "usbip: " fmt , ## args); \
} while (0)
-/*-------------------------------------------------------------------------*/
-
/*
* USB/IP request headers.
* Currently, we define 4 request types:
} u;
} __packed;
-/*-------------------------------------------------------------------------*/
-
int usbip_xmit(int, struct socket *, char *, int, int);
int usbip_sendmsg(struct socket *, struct msghdr *, int);
extern struct vhci_hcd *the_controller;
extern struct attribute_group dev_attr_group;
-/*-------------------------------------------------------------------------*/
-/* prototype declaration */
-
/* vhci_hcd.c */
void rh_port_connect(int rhport, enum usb_device_speed speed);
void rh_port_disconnect(int rhport);
usb_hcd_poll_rh_status(vhci_to_hcd(the_controller));
}
-/*----------------------------------------------------------------------*/
-
#define PORT_C_MASK \
((USB_PORT_STAT_C_CONNECTION \
| USB_PORT_STAT_C_ENABLE \
return retval;
}
-
-
-/*----------------------------------------------------------------------*/
-
static struct vhci_device *get_vdev(struct usb_device *udev)
{
int i;
usbip_start_eh(&vdev->ud);
}
-
-/*----------------------------------------------------------------------*/
-
static int vhci_start(struct usb_hcd *hcd)
{
struct vhci_hcd *vhci = hcd_to_vhci(hcd);
usbip_uinfo("vhci_stop done\n");
}
-/*----------------------------------------------------------------------*/
-
static int vhci_get_frame_number(struct usb_hcd *hcd)
{
usbip_uerr("Not yet implemented\n");
},
};
-/*----------------------------------------------------------------------*/
-
/*
* The VHCI 'device' is 'virtual'; not a real plug&play hardware.
* We need to add this virtual device as a platform device arbitrarily:
}
}
-/*-------------------------------------------------------------------------*/
-
int vhci_rx_loop(void *data)
{
struct usbip_device *ud = data;
return total_size;
}
-/*-------------------------------------------------------------------------*/
-
static struct vhci_unlink *dequeue_from_unlink_tx(struct vhci_device *vdev)
{
unsigned long flags;
return total_size;
}
-/*-------------------------------------------------------------------------*/
-
int vhci_tx_loop(void *data)
{
struct usbip_device *ud = data;