1 --- a/drivers/head/stub_dev.c
2 +++ b/drivers/head/stub_dev.c
3 @@ -398,7 +398,11 @@ static int stub_probe(struct usb_interfa
5 struct usb_device *udev = interface_to_usbdev(interface);
6 struct stub_device *sdev = NULL;
7 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
8 char *udev_busid = interface->dev.parent->bus_id;
10 + char *udev_busid = dev_name(interface->dev.parent);
15 --- a/drivers/head/stub_main.c
16 +++ b/drivers/head/stub_main.c
17 @@ -252,18 +252,17 @@ static int __init usb_stub_init(void)
21 + info(DRIVER_DESC "" DRIVER_VERSION);
23 + memset(busid_table, 0, sizeof(busid_table));
24 + spin_lock_init(&busid_table_lock);
26 ret = usb_register(&stub_driver);
28 uerr("usb_register failed %d\n", ret);
33 - info(DRIVER_DESC "" DRIVER_VERSION);
35 - memset(busid_table, 0, sizeof(busid_table));
36 - spin_lock_init(&busid_table_lock);
38 ret = driver_create_file(&stub_driver.drvwrap.driver, &driver_attr_match_busid);
41 --- a/drivers/head/stub_rx.c
42 +++ b/drivers/head/stub_rx.c
43 @@ -159,7 +159,11 @@ static int tweak_set_configuration_cmd(s
44 * A user may need to set a special configuration value before
45 * exporting the device.
47 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
48 uinfo("set_configuration (%d) to %s\n", config, urb->dev->dev.bus_id);
50 + uinfo("set_configuration (%d) to %s\n", config, dev_name(&urb->dev->dev));
52 uinfo("but, skip!\n");
55 @@ -177,7 +181,11 @@ static int tweak_reset_device_cmd(struct
56 value = le16_to_cpu(req->wValue);
57 index = le16_to_cpu(req->wIndex);
59 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
60 uinfo("reset_device (port %d) to %s\n", index, urb->dev->dev.bus_id);
62 + uinfo("reset_device (port %d) to %s\n", index, dev_name(&urb->dev->dev));
65 /* all interfaces should be owned by usbip driver, so just reset it. */
66 ret = usb_lock_device_for_reset(urb->dev, NULL);
67 @@ -187,7 +195,11 @@ static int tweak_reset_device_cmd(struct
70 /* try to reset the device */
71 - ret = usb_reset_composite_device(urb->dev, NULL);
72 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
73 + ret = usb_reset_composite_device(urb->dev, NULL);
75 + ret = usb_reset_device(urb->dev);
78 uerr("device reset\n");
80 --- a/drivers/head/usbip_common.c
81 +++ b/drivers/head/usbip_common.c
83 #include "usbip_common.h"
85 /* version information */
86 -#define DRIVER_VERSION "$Id: usbip_common.c 66 2008-04-20 13:19:42Z hirofuchi $"
87 +#define DRIVER_VERSION "$Id$"
88 #define DRIVER_AUTHOR "Takahiro Hirofuchi <hirofuchi _at_ users.sourceforge.net>"
89 #define DRIVER_DESC "usbip common driver"
91 @@ -55,10 +55,7 @@ static ssize_t show_flag(struct device *
92 static ssize_t store_flag(struct device *dev, struct device_attribute *attr,
93 const char *buf, size_t count)
97 - sscanf(buf, "%lx", &flag);
98 - usbip_debug_flag = flag;
99 + sscanf(buf, "%lx", &usbip_debug_flag);
103 @@ -390,7 +387,7 @@ int usbip_thread(void *param)
106 /* srv.rb must wait for rx_thread starting */
107 - complete(&ut->thread_done);
108 + complete(&ut->thread_started);
110 /* start of while loop */
112 @@ -403,15 +400,21 @@ int usbip_thread(void *param)
114 void usbip_start_threads(struct usbip_device *ud)
118 * threads are invoked per one device (per one connection).
120 + INIT_COMPLETION(ud->tcp_rx.thread_started);
121 + INIT_COMPLETION(ud->tcp_tx.thread_started);
122 + INIT_COMPLETION(ud->tcp_rx.thread_done);
123 + INIT_COMPLETION(ud->tcp_tx.thread_done);
125 kernel_thread((int(*)(void *))usbip_thread, (void *)&ud->tcp_rx, 0);
126 kernel_thread((int(*)(void *))usbip_thread, (void *)&ud->tcp_tx, 0);
128 /* confirm threads are starting */
129 - wait_for_completion(&ud->tcp_rx.thread_done);
130 - wait_for_completion(&ud->tcp_tx.thread_done);
131 + wait_for_completion(&ud->tcp_rx.thread_started);
132 + wait_for_completion(&ud->tcp_tx.thread_started);
134 EXPORT_SYMBOL(usbip_start_threads);
136 @@ -436,6 +439,7 @@ void usbip_task_init(struct usbip_task *
137 void (*loop_ops)(struct usbip_task *))
140 + init_completion(&ut->thread_started);
141 init_completion(&ut->thread_done);
143 ut->loop_ops = loop_ops;
144 --- a/drivers/head/usbip_event.c
145 +++ b/drivers/head/usbip_event.c
146 @@ -38,7 +38,7 @@ void usbip_start_eh(struct usbip_device
148 kernel_thread((int(*)(void *)) usbip_thread, (void *) eh, 0);
150 - wait_for_completion(&eh->thread_done);
151 + wait_for_completion(&eh->thread_started);
153 EXPORT_SYMBOL(usbip_start_eh);
155 --- a/drivers/head/vhci_hcd.c
156 +++ b/drivers/head/vhci_hcd.c
158 #include "usbip_common.h"
161 -#define DRIVER_VERSION " $Id: vhci_hcd.c 66 2008-04-20 13:19:42Z hirofuchi $ "
162 +#define DRIVER_VERSION " $Id$ "
163 #define DRIVER_AUTHOR "Takahiro Hirofuchi"
164 #define DRIVER_DESC "Virtual Host Controller Interface Driver for USB/IP"
165 #define DRIVER_LICENCE "GPL"
166 @@ -58,7 +58,7 @@ static void vhci_stop(struct usb_hcd *hc
167 static int vhci_get_frame_number(struct usb_hcd *hcd);
169 static const char driver_name[] = "vhci_hcd";
170 -static const char driver_desc[] = "USB/IP Virtual Host Contoroller";
171 +static const char driver_desc[] = "USB/IP Virtual Host Controller";
175 @@ -416,14 +416,6 @@ static int vhci_hub_control(struct usb_h
176 case USB_PORT_FEAT_SUSPEND:
177 dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_SUSPEND\n");
180 - dum->port_status[rhport] |= (1 << USB_PORT_FEAT_SUSPEND);
181 - if (dum->driver->suspend) {
182 - spin_unlock (&dum->lock);
183 - dum->driver->suspend (&dum->gadget);
184 - spin_lock (&dum->lock);
188 case USB_PORT_FEAT_RESET:
189 dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_RESET\n");
190 @@ -432,12 +424,6 @@ static int vhci_hub_control(struct usb_h
191 dum->port_status[rhport] &= ~(USB_PORT_STAT_ENABLE
192 | USB_PORT_STAT_LOW_SPEED
193 | USB_PORT_STAT_HIGH_SPEED);
196 - dev_dbg (hardware, "disconnect\n");
197 - stop_activity (dum, dum->driver);
201 /* FIXME test that code path! */
203 @@ -1060,7 +1046,7 @@ static int vhci_hcd_probe(struct platfor
207 - uinfo("proving...\n");
208 + uinfo("probing...\n");
210 dbg_vhci_hc("name %s id %d\n", pdev->name, pdev->id);
212 @@ -1076,7 +1062,11 @@ static int vhci_hcd_probe(struct platfor
213 * Allocate and initialize hcd.
214 * Our private data is also allocated automatically.
216 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
217 hcd = usb_create_hcd(&vhci_hc_driver, &pdev->dev, pdev->dev.bus_id);
219 + hcd = usb_create_hcd(&vhci_hc_driver, &pdev->dev, dev_name(&pdev->dev));
222 uerr("create hcd failed\n");
224 --- a/drivers/head/vhci_sysfs.c
225 +++ b/drivers/head/vhci_sysfs.c
226 @@ -123,7 +123,11 @@ static ssize_t show_status(struct device
227 out += sprintf(out, "%03u %08x ",
228 vdev->speed, vdev->devid);
229 out += sprintf(out, "%16p ", vdev->ud.tcp_socket);
230 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
231 out += sprintf(out, "%s", vdev->udev->dev.bus_id);
233 + out += sprintf(out, "%s", dev_name(&vdev->udev->dev));
237 out += sprintf(out, "000 000 000 0000000000000000 0-0");
238 --- a/drivers/head/usbip_common.h
239 +++ b/drivers/head/usbip_common.h
240 @@ -300,6 +300,7 @@ struct usbip_device;
243 struct task_struct *thread;
244 + struct completion thread_started;
245 struct completion thread_done;
247 void (*loop_ops)(struct usbip_task *);