From aa5873e96271611ae55586f65e49ea1fab90cb88 Mon Sep 17 00:00:00 2001 From: Endre Kollar Date: Tue, 27 Jul 2010 12:39:30 +0200 Subject: Staging: usbip: fix multiple interfaces The stub_probe function instantiates an stub_dev object for all interfaces. Wich causes a problem. The stub_dev object belongs to their own interfaces. This patch creates the sdev object at the first stub_probe call, the other calls associate the interfaces to this. Signed-off-by: Endre Kollar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/usbip/stub.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'drivers/staging/usbip/stub.h') diff --git a/drivers/staging/usbip/stub.h b/drivers/staging/usbip/stub.h index 022d0649ac5..30dbfb6d16f 100644 --- a/drivers/staging/usbip/stub.h +++ b/drivers/staging/usbip/stub.h @@ -25,6 +25,11 @@ #include #include +#define STUB_BUSID_OTHER 0 +#define STUB_BUSID_REMOV 1 +#define STUB_BUSID_ADDED 2 +#define STUB_BUSID_ALLOC 3 + struct stub_device { struct usb_interface *interface; struct list_head list; @@ -72,6 +77,14 @@ struct stub_unlink { __u32 status; }; +#define BUSID_SIZE 20 +struct bus_id_priv { + char name[BUSID_SIZE]; + char status; + int interf_count; + struct stub_device *sdev; + char shutdown_busid; +}; extern struct kmem_cache *stub_priv_cache; @@ -91,5 +104,7 @@ void stub_rx_loop(struct usbip_task *); void stub_enqueue_ret_unlink(struct stub_device *, __u32, __u32); /* stub_main.c */ -int match_busid(const char *busid); +struct bus_id_priv *get_busid_priv(const char *busid); +int del_match_busid(char *busid); + void stub_device_cleanup_urbs(struct stub_device *sdev); -- cgit v1.2.3