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
82 @@ -55,10 +55,7 @@ static ssize_t show_flag(struct device *
83 static ssize_t store_flag(struct device *dev, struct device_attribute *attr,
84 const char *buf, size_t count)
88 - sscanf(buf, "%lx", &flag);
89 - usbip_debug_flag = flag;
90 + sscanf(buf, "%lx", &usbip_debug_flag);
94 @@ -390,7 +387,7 @@ int usbip_thread(void *param)
97 /* srv.rb must wait for rx_thread starting */
98 - complete(&ut->thread_done);
99 + complete(&ut->thread_started);
101 /* start of while loop */
103 @@ -403,15 +400,21 @@ int usbip_thread(void *param)
105 void usbip_start_threads(struct usbip_device *ud)
109 * threads are invoked per one device (per one connection).
111 + INIT_COMPLETION(ud->tcp_rx.thread_started);
112 + INIT_COMPLETION(ud->tcp_tx.thread_started);
113 + INIT_COMPLETION(ud->tcp_rx.thread_done);
114 + INIT_COMPLETION(ud->tcp_tx.thread_done);
116 kernel_thread((int(*)(void *))usbip_thread, (void *)&ud->tcp_rx, 0);
117 kernel_thread((int(*)(void *))usbip_thread, (void *)&ud->tcp_tx, 0);
119 /* confirm threads are starting */
120 - wait_for_completion(&ud->tcp_rx.thread_done);
121 - wait_for_completion(&ud->tcp_tx.thread_done);
122 + wait_for_completion(&ud->tcp_rx.thread_started);
123 + wait_for_completion(&ud->tcp_tx.thread_started);
125 EXPORT_SYMBOL(usbip_start_threads);
127 @@ -436,6 +439,7 @@ void usbip_task_init(struct usbip_task *
128 void (*loop_ops)(struct usbip_task *))
131 + init_completion(&ut->thread_started);
132 init_completion(&ut->thread_done);
134 ut->loop_ops = loop_ops;
135 --- a/drivers/head/usbip_event.c
136 +++ b/drivers/head/usbip_event.c
137 @@ -38,7 +38,7 @@ void usbip_start_eh(struct usbip_device
139 kernel_thread((int(*)(void *)) usbip_thread, (void *) eh, 0);
141 - wait_for_completion(&eh->thread_done);
142 + wait_for_completion(&eh->thread_started);
144 EXPORT_SYMBOL(usbip_start_eh);
146 --- a/drivers/head/vhci_hcd.c
147 +++ b/drivers/head/vhci_hcd.c
148 @@ -58,7 +58,7 @@ static void vhci_stop(struct usb_hcd *hc
149 static int vhci_get_frame_number(struct usb_hcd *hcd);
151 static const char driver_name[] = "vhci_hcd";
152 -static const char driver_desc[] = "USB/IP Virtual Host Contoroller";
153 +static const char driver_desc[] = "USB/IP Virtual Host Controller";
157 @@ -416,14 +416,6 @@ static int vhci_hub_control(struct usb_h
158 case USB_PORT_FEAT_SUSPEND:
159 dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_SUSPEND\n");
162 - dum->port_status[rhport] |= (1 << USB_PORT_FEAT_SUSPEND);
163 - if (dum->driver->suspend) {
164 - spin_unlock (&dum->lock);
165 - dum->driver->suspend (&dum->gadget);
166 - spin_lock (&dum->lock);
170 case USB_PORT_FEAT_RESET:
171 dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_RESET\n");
172 @@ -432,12 +424,6 @@ static int vhci_hub_control(struct usb_h
173 dum->port_status[rhport] &= ~(USB_PORT_STAT_ENABLE
174 | USB_PORT_STAT_LOW_SPEED
175 | USB_PORT_STAT_HIGH_SPEED);
178 - dev_dbg (hardware, "disconnect\n");
179 - stop_activity (dum, dum->driver);
183 /* FIXME test that code path! */
185 @@ -1060,7 +1046,7 @@ static int vhci_hcd_probe(struct platfor
189 - uinfo("proving...\n");
190 + uinfo("probing...\n");
192 dbg_vhci_hc("name %s id %d\n", pdev->name, pdev->id);
194 @@ -1076,7 +1062,11 @@ static int vhci_hcd_probe(struct platfor
195 * Allocate and initialize hcd.
196 * Our private data is also allocated automatically.
198 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
199 hcd = usb_create_hcd(&vhci_hc_driver, &pdev->dev, pdev->dev.bus_id);
201 + hcd = usb_create_hcd(&vhci_hc_driver, &pdev->dev, dev_name(&pdev->dev));
204 uerr("create hcd failed\n");
206 --- a/drivers/head/vhci_sysfs.c
207 +++ b/drivers/head/vhci_sysfs.c
208 @@ -123,7 +123,11 @@ static ssize_t show_status(struct device
209 out += sprintf(out, "%03u %08x ",
210 vdev->speed, vdev->devid);
211 out += sprintf(out, "%16p ", vdev->ud.tcp_socket);
212 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
213 out += sprintf(out, "%s", vdev->udev->dev.bus_id);
215 + out += sprintf(out, "%s", dev_name(&vdev->udev->dev));
219 out += sprintf(out, "000 000 000 0000000000000000 0-0");
220 --- a/drivers/head/usbip_common.h
221 +++ b/drivers/head/usbip_common.h
222 @@ -300,6 +300,7 @@ struct usbip_device;
225 struct task_struct *thread;
226 + struct completion thread_started;
227 struct completion thread_done;
229 void (*loop_ops)(struct usbip_task *);