diff options
author | matt mooney <mfm@muteddisk.com> | 2011-05-19 19:47:32 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-19 19:57:30 -0400 |
commit | 1a4b6f66285785ddccef049e6b45be4e7c7a2189 (patch) | |
tree | fe745a2467162a9ab23ca37ce7872532a69f136d | |
parent | db60697a086cdf4bbe6deedcefc2ff81e2a9efd2 (diff) |
staging: usbip: replace usbip_u{dbg,err,info} and printk with dev_ and pr_
This switches all of the usbip_u{dbg,err,info} and printk statements to
dev_<level>, if possible, or pr_<level> macros. And removes a few
unnecessary debug statements.
Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/usbip/stub_dev.c | 44 | ||||
-rw-r--r-- | drivers/staging/usbip/stub_main.c | 19 | ||||
-rw-r--r-- | drivers/staging/usbip/stub_rx.c | 23 | ||||
-rw-r--r-- | drivers/staging/usbip/stub_tx.c | 17 | ||||
-rw-r--r-- | drivers/staging/usbip/usbip_common.c | 230 | ||||
-rw-r--r-- | drivers/staging/usbip/usbip_common.h | 46 | ||||
-rw-r--r-- | drivers/staging/usbip/usbip_event.c | 3 | ||||
-rw-r--r-- | drivers/staging/usbip/vhci_hcd.c | 89 | ||||
-rw-r--r-- | drivers/staging/usbip/vhci_rx.c | 33 | ||||
-rw-r--r-- | drivers/staging/usbip/vhci_sysfs.c | 14 | ||||
-rw-r--r-- | drivers/staging/usbip/vhci_tx.c | 8 |
11 files changed, 220 insertions, 306 deletions
diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c index c71d0a302a89..6e99ec87fee0 100644 --- a/drivers/staging/usbip/stub_dev.c +++ b/drivers/staging/usbip/stub_dev.c | |||
@@ -196,7 +196,8 @@ static void stub_shutdown_connection(struct usbip_device *ud) | |||
196 | * step 1? | 196 | * step 1? |
197 | */ | 197 | */ |
198 | if (ud->tcp_socket) { | 198 | if (ud->tcp_socket) { |
199 | usbip_udbg("shutdown tcp_socket %p\n", ud->tcp_socket); | 199 | dev_dbg(&sdev->udev->dev, "shutdown tcp_socket %p\n", |
200 | ud->tcp_socket); | ||
200 | kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR); | 201 | kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR); |
201 | } | 202 | } |
202 | 203 | ||
@@ -244,12 +245,11 @@ static void stub_device_reset(struct usbip_device *ud) | |||
244 | struct usb_device *udev = sdev->udev; | 245 | struct usb_device *udev = sdev->udev; |
245 | int ret; | 246 | int ret; |
246 | 247 | ||
247 | usbip_udbg("device reset"); | 248 | dev_dbg(&udev->dev, "device reset"); |
248 | 249 | ||
249 | ret = usb_lock_device_for_reset(udev, sdev->interface); | 250 | ret = usb_lock_device_for_reset(udev, sdev->interface); |
250 | if (ret < 0) { | 251 | if (ret < 0) { |
251 | dev_err(&udev->dev, "lock for reset\n"); | 252 | dev_err(&udev->dev, "lock for reset\n"); |
252 | |||
253 | spin_lock(&ud->lock); | 253 | spin_lock(&ud->lock); |
254 | ud->status = SDEV_ST_ERROR; | 254 | ud->status = SDEV_ST_ERROR; |
255 | spin_unlock(&ud->lock); | 255 | spin_unlock(&ud->lock); |
@@ -336,7 +336,8 @@ static struct stub_device *stub_device_alloc(struct usb_device *udev, | |||
336 | 336 | ||
337 | usbip_start_eh(&sdev->ud); | 337 | usbip_start_eh(&sdev->ud); |
338 | 338 | ||
339 | usbip_udbg("register new interface\n"); | 339 | dev_dbg(&interface->dev, "register new interface\n"); |
340 | |||
340 | return sdev; | 341 | return sdev; |
341 | } | 342 | } |
342 | 343 | ||
@@ -346,7 +347,7 @@ static int stub_device_free(struct stub_device *sdev) | |||
346 | return -EINVAL; | 347 | return -EINVAL; |
347 | 348 | ||
348 | kfree(sdev); | 349 | kfree(sdev); |
349 | usbip_udbg("kfree udev ok\n"); | 350 | pr_debug("kfree udev ok\n"); |
350 | 351 | ||
351 | return 0; | 352 | return 0; |
352 | } | 353 | } |
@@ -376,9 +377,8 @@ static int stub_probe(struct usb_interface *interface, | |||
376 | busid_priv = get_busid_priv(udev_busid); | 377 | busid_priv = get_busid_priv(udev_busid); |
377 | if (!busid_priv || (busid_priv->status == STUB_BUSID_REMOV) || | 378 | if (!busid_priv || (busid_priv->status == STUB_BUSID_REMOV) || |
378 | (busid_priv->status == STUB_BUSID_OTHER)) { | 379 | (busid_priv->status == STUB_BUSID_OTHER)) { |
379 | dev_info(&interface->dev, | 380 | dev_info(&interface->dev, "%s is not in match_busid table... " |
380 | "this device %s is not in match_busid table. skip!\n", | 381 | "skip!\n", udev_busid); |
381 | udev_busid); | ||
382 | 382 | ||
383 | /* | 383 | /* |
384 | * Return value should be ENODEV or ENOXIO to continue trying | 384 | * Return value should be ENODEV or ENOXIO to continue trying |
@@ -388,15 +388,15 @@ static int stub_probe(struct usb_interface *interface, | |||
388 | return -ENODEV; | 388 | return -ENODEV; |
389 | } | 389 | } |
390 | 390 | ||
391 | if (udev->descriptor.bDeviceClass == USB_CLASS_HUB) { | 391 | if (udev->descriptor.bDeviceClass == USB_CLASS_HUB) { |
392 | usbip_udbg("this device %s is a usb hub device. skip!\n", | 392 | dev_dbg(&udev->dev, "%s is a usb hub device... skip!\n", |
393 | udev_busid); | 393 | udev_busid); |
394 | return -ENODEV; | 394 | return -ENODEV; |
395 | } | 395 | } |
396 | 396 | ||
397 | if (!strcmp(udev->bus->bus_name, "vhci_hcd")) { | 397 | if (!strcmp(udev->bus->bus_name, "vhci_hcd")) { |
398 | usbip_udbg("this device %s is attached on vhci_hcd. skip!\n", | 398 | dev_dbg(&udev->dev, "%s is attached on vhci_hcd... skip!\n", |
399 | udev_busid); | 399 | udev_busid); |
400 | return -ENODEV; | 400 | return -ENODEV; |
401 | } | 401 | } |
402 | 402 | ||
@@ -406,8 +406,7 @@ static int stub_probe(struct usb_interface *interface, | |||
406 | return -ENODEV; | 406 | return -ENODEV; |
407 | 407 | ||
408 | busid_priv->interf_count++; | 408 | busid_priv->interf_count++; |
409 | dev_info(&interface->dev, | 409 | dev_info(&interface->dev, "usbip-host: register new interface " |
410 | "USB/IP Stub: register a new interface " | ||
411 | "(bus %u dev %u ifn %u)\n", | 410 | "(bus %u dev %u ifn %u)\n", |
412 | udev->bus->busnum, udev->devnum, | 411 | udev->bus->busnum, udev->devnum, |
413 | interface->cur_altsetting->desc.bInterfaceNumber); | 412 | interface->cur_altsetting->desc.bInterfaceNumber); |
@@ -417,7 +416,7 @@ static int stub_probe(struct usb_interface *interface, | |||
417 | 416 | ||
418 | err = stub_add_files(&interface->dev); | 417 | err = stub_add_files(&interface->dev); |
419 | if (err) { | 418 | if (err) { |
420 | dev_err(&interface->dev, "create sysfs files for %s\n", | 419 | dev_err(&interface->dev, "stub_add_files for %s\n", |
421 | udev_busid); | 420 | udev_busid); |
422 | usb_set_intfdata(interface, NULL); | 421 | usb_set_intfdata(interface, NULL); |
423 | busid_priv->interf_count--; | 422 | busid_priv->interf_count--; |
@@ -434,7 +433,7 @@ static int stub_probe(struct usb_interface *interface, | |||
434 | if (!sdev) | 433 | if (!sdev) |
435 | return -ENOMEM; | 434 | return -ENOMEM; |
436 | 435 | ||
437 | dev_info(&interface->dev, "USB/IP Stub: register a new device " | 436 | dev_info(&interface->dev, "usbip-host: register new device " |
438 | "(bus %u dev %u ifn %u)\n", udev->bus->busnum, udev->devnum, | 437 | "(bus %u dev %u ifn %u)\n", udev->bus->busnum, udev->devnum, |
439 | interface->cur_altsetting->desc.bInterfaceNumber); | 438 | interface->cur_altsetting->desc.bInterfaceNumber); |
440 | 439 | ||
@@ -449,8 +448,7 @@ static int stub_probe(struct usb_interface *interface, | |||
449 | 448 | ||
450 | err = stub_add_files(&interface->dev); | 449 | err = stub_add_files(&interface->dev); |
451 | if (err) { | 450 | if (err) { |
452 | dev_err(&interface->dev, "create sysfs files for %s\n", | 451 | dev_err(&interface->dev, "stub_add_files for %s\n", udev_busid); |
453 | udev_busid); | ||
454 | usb_set_intfdata(interface, NULL); | 452 | usb_set_intfdata(interface, NULL); |
455 | usb_put_intf(interface); | 453 | usb_put_intf(interface); |
456 | 454 | ||
@@ -486,10 +484,9 @@ static void stub_disconnect(struct usb_interface *interface) | |||
486 | const char *udev_busid = dev_name(interface->dev.parent); | 484 | const char *udev_busid = dev_name(interface->dev.parent); |
487 | struct bus_id_priv *busid_priv; | 485 | struct bus_id_priv *busid_priv; |
488 | 486 | ||
489 | busid_priv = get_busid_priv(udev_busid); | 487 | dev_dbg(&interface->dev, "Enter\n"); |
490 | |||
491 | usbip_udbg("Enter\n"); | ||
492 | 488 | ||
489 | busid_priv = get_busid_priv(udev_busid); | ||
493 | if (!busid_priv) { | 490 | if (!busid_priv) { |
494 | BUG(); | 491 | BUG(); |
495 | return; | 492 | return; |
@@ -499,7 +496,7 @@ static void stub_disconnect(struct usb_interface *interface) | |||
499 | 496 | ||
500 | /* get stub_device */ | 497 | /* get stub_device */ |
501 | if (!sdev) { | 498 | if (!sdev) { |
502 | err(" could not get device from inteface data"); | 499 | dev_err(&interface->dev, "could not get device"); |
503 | /* BUG(); */ | 500 | /* BUG(); */ |
504 | return; | 501 | return; |
505 | } | 502 | } |
@@ -543,5 +540,4 @@ static void stub_disconnect(struct usb_interface *interface) | |||
543 | busid_priv->status = STUB_BUSID_OTHER; | 540 | busid_priv->status = STUB_BUSID_OTHER; |
544 | del_match_busid((char *)udev_busid); | 541 | del_match_busid((char *)udev_busid); |
545 | } | 542 | } |
546 | usbip_udbg("bye\n"); | ||
547 | } | 543 | } |
diff --git a/drivers/staging/usbip/stub_main.c b/drivers/staging/usbip/stub_main.c index 5568110c2bec..e9085d663945 100644 --- a/drivers/staging/usbip/stub_main.c +++ b/drivers/staging/usbip/stub_main.c | |||
@@ -178,14 +178,14 @@ static ssize_t store_match_busid(struct device_driver *dev, const char *buf, | |||
178 | if (add_match_busid(busid) < 0) | 178 | if (add_match_busid(busid) < 0) |
179 | return -ENOMEM; | 179 | return -ENOMEM; |
180 | else { | 180 | else { |
181 | usbip_udbg("add busid %s\n", busid); | 181 | pr_debug("add busid %s\n", busid); |
182 | return count; | 182 | return count; |
183 | } | 183 | } |
184 | } else if (!strncmp(buf, "del ", 4)) { | 184 | } else if (!strncmp(buf, "del ", 4)) { |
185 | if (del_match_busid(busid) < 0) | 185 | if (del_match_busid(busid) < 0) |
186 | return -ENODEV; | 186 | return -ENODEV; |
187 | else { | 187 | else { |
188 | usbip_udbg("del busid %s\n", busid); | 188 | pr_debug("del busid %s\n", busid); |
189 | return count; | 189 | return count; |
190 | } | 190 | } |
191 | } else | 191 | } else |
@@ -239,12 +239,12 @@ void stub_device_cleanup_urbs(struct stub_device *sdev) | |||
239 | { | 239 | { |
240 | struct stub_priv *priv; | 240 | struct stub_priv *priv; |
241 | 241 | ||
242 | usbip_udbg("free sdev %p\n", sdev); | 242 | dev_dbg(&sdev->udev->dev, "free sdev %p\n", sdev); |
243 | 243 | ||
244 | while ((priv = stub_priv_pop(sdev))) { | 244 | while ((priv = stub_priv_pop(sdev))) { |
245 | struct urb *urb = priv->urb; | 245 | struct urb *urb = priv->urb; |
246 | 246 | ||
247 | usbip_udbg(" free urb %p\n", urb); | 247 | dev_dbg(&sdev->udev->dev, "free urb %p\n", urb); |
248 | usb_kill_urb(urb); | 248 | usb_kill_urb(urb); |
249 | 249 | ||
250 | kmem_cache_free(stub_priv_cache, priv); | 250 | kmem_cache_free(stub_priv_cache, priv); |
@@ -265,20 +265,17 @@ static int __init usb_stub_init(void) | |||
265 | SLAB_HWCACHE_ALIGN, NULL); | 265 | SLAB_HWCACHE_ALIGN, NULL); |
266 | 266 | ||
267 | if (!stub_priv_cache) { | 267 | if (!stub_priv_cache) { |
268 | printk(KERN_ERR KBUILD_MODNAME | 268 | pr_err("create stub_priv_cache error\n"); |
269 | ": create stub_priv_cache error\n"); | ||
270 | return -ENOMEM; | 269 | return -ENOMEM; |
271 | } | 270 | } |
272 | 271 | ||
273 | ret = usb_register(&stub_driver); | 272 | ret = usb_register(&stub_driver); |
274 | if (ret) { | 273 | if (ret) { |
275 | printk(KERN_ERR KBUILD_MODNAME ": usb_register failed %d\n", | 274 | pr_err("usb_register failed %d\n", ret); |
276 | ret); | ||
277 | goto error_usb_register; | 275 | goto error_usb_register; |
278 | } | 276 | } |
279 | 277 | ||
280 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC " " USBIP_VERSION | 278 | pr_info(DRIVER_DESC " " USBIP_VERSION "\n"); |
281 | "\n"); | ||
282 | 279 | ||
283 | init_busid_table(); | 280 | init_busid_table(); |
284 | 281 | ||
@@ -286,7 +283,7 @@ static int __init usb_stub_init(void) | |||
286 | &driver_attr_match_busid); | 283 | &driver_attr_match_busid); |
287 | 284 | ||
288 | if (ret) { | 285 | if (ret) { |
289 | printk(KERN_ERR KBUILD_MODNAME ": create driver sysfs\n"); | 286 | pr_err("create driver sysfs\n"); |
290 | goto error_create_file; | 287 | goto error_create_file; |
291 | } | 288 | } |
292 | 289 | ||
diff --git a/drivers/staging/usbip/stub_rx.c b/drivers/staging/usbip/stub_rx.c index e24560929a88..a5c1fa1f0430 100644 --- a/drivers/staging/usbip/stub_rx.c +++ b/drivers/staging/usbip/stub_rx.c | |||
@@ -102,11 +102,11 @@ static int tweak_clear_halt_cmd(struct urb *urb) | |||
102 | 102 | ||
103 | ret = usb_clear_halt(urb->dev, target_pipe); | 103 | ret = usb_clear_halt(urb->dev, target_pipe); |
104 | if (ret < 0) | 104 | if (ret < 0) |
105 | usbip_uinfo("clear_halt error: devnum %d endp %d, %d\n", | 105 | dev_err(&urb->dev->dev, "usb_clear_halt error: devnum %d endp " |
106 | urb->dev->devnum, target_endp, ret); | 106 | "%d ret %d\n", urb->dev->devnum, target_endp, ret); |
107 | else | 107 | else |
108 | usbip_uinfo("clear_halt done: devnum %d endp %d\n", | 108 | dev_info(&urb->dev->dev, "usb_clear_halt done: devnum %d endp " |
109 | urb->dev->devnum, target_endp); | 109 | "%d\n", urb->dev->devnum, target_endp); |
110 | 110 | ||
111 | return ret; | 111 | return ret; |
112 | } | 112 | } |
@@ -127,11 +127,11 @@ static int tweak_set_interface_cmd(struct urb *urb) | |||
127 | 127 | ||
128 | ret = usb_set_interface(urb->dev, interface, alternate); | 128 | ret = usb_set_interface(urb->dev, interface, alternate); |
129 | if (ret < 0) | 129 | if (ret < 0) |
130 | usbip_uinfo("set_interface error: inf %u alt %u, %d\n", | 130 | dev_err(&urb->dev->dev, "usb_set_interface error: inf %u alt " |
131 | interface, alternate, ret); | 131 | "%u ret %d\n", interface, alternate, ret); |
132 | else | 132 | else |
133 | usbip_uinfo("set_interface done: inf %u alt %u\n", | 133 | dev_info(&urb->dev->dev, "usb_set_interface done: inf %u alt " |
134 | interface, alternate); | 134 | "%u\n", interface, alternate); |
135 | 135 | ||
136 | return ret; | 136 | return ret; |
137 | } | 137 | } |
@@ -160,9 +160,8 @@ static int tweak_set_configuration_cmd(struct urb *urb) | |||
160 | * A user may need to set a special configuration value before | 160 | * A user may need to set a special configuration value before |
161 | * exporting the device. | 161 | * exporting the device. |
162 | */ | 162 | */ |
163 | usbip_uinfo("set_configuration %d to %s\n", | 163 | dev_info(&urb->dev->dev, "usb_set_configuration %d to %s... skip!\n", |
164 | config, dev_name(&urb->dev->dev)); | 164 | config, dev_name(&urb->dev->dev)); |
165 | usbip_uinfo("but, skip!\n"); | ||
166 | 165 | ||
167 | return 0; | 166 | return 0; |
168 | /* return usb_driver_set_configuration(urb->dev, config); */ | 167 | /* return usb_driver_set_configuration(urb->dev, config); */ |
@@ -173,7 +172,7 @@ static int tweak_reset_device_cmd(struct urb *urb) | |||
173 | struct stub_priv *priv = (struct stub_priv *) urb->context; | 172 | struct stub_priv *priv = (struct stub_priv *) urb->context; |
174 | struct stub_device *sdev = priv->sdev; | 173 | struct stub_device *sdev = priv->sdev; |
175 | 174 | ||
176 | usbip_uinfo("reset_device %s\n", dev_name(&urb->dev->dev)); | 175 | dev_info(&urb->dev->dev, "usb_queue_reset_device\n"); |
177 | 176 | ||
178 | /* | 177 | /* |
179 | * usb_lock_device_for_reset caused a deadlock: it causes the driver | 178 | * usb_lock_device_for_reset caused a deadlock: it causes the driver |
diff --git a/drivers/staging/usbip/stub_tx.c b/drivers/staging/usbip/stub_tx.c index 3c332c2dfd8b..fda2bc95e859 100644 --- a/drivers/staging/usbip/stub_tx.c +++ b/drivers/staging/usbip/stub_tx.c | |||
@@ -75,22 +75,23 @@ void stub_complete(struct urb *urb) | |||
75 | /* OK */ | 75 | /* OK */ |
76 | break; | 76 | break; |
77 | case -ENOENT: | 77 | case -ENOENT: |
78 | usbip_uinfo("stopped by a call of usb_kill_urb() because of" | 78 | dev_info(&urb->dev->dev, "stopped by a call to usb_kill_urb() " |
79 | "cleaning up a virtual connection\n"); | 79 | "because of cleaning up a virtual connection\n"); |
80 | return; | 80 | return; |
81 | case -ECONNRESET: | 81 | case -ECONNRESET: |
82 | usbip_uinfo("unlinked by a call of usb_unlink_urb()\n"); | 82 | dev_info(&urb->dev->dev, "unlinked by a call to " |
83 | "usb_unlink_urb()\n"); | ||
83 | break; | 84 | break; |
84 | case -EPIPE: | 85 | case -EPIPE: |
85 | usbip_uinfo("endpoint %d is stalled\n", | 86 | dev_info(&urb->dev->dev, "endpoint %d is stalled\n", |
86 | usb_pipeendpoint(urb->pipe)); | 87 | usb_pipeendpoint(urb->pipe)); |
87 | break; | 88 | break; |
88 | case -ESHUTDOWN: | 89 | case -ESHUTDOWN: |
89 | usbip_uinfo("device removed?\n"); | 90 | dev_info(&urb->dev->dev, "device removed?\n"); |
90 | break; | 91 | break; |
91 | default: | 92 | default: |
92 | usbip_uinfo("urb completion with non-zero status %d\n", | 93 | dev_info(&urb->dev->dev, "urb completion with non-zero status " |
93 | urb->status); | 94 | "%d\n", urb->status); |
94 | break; | 95 | break; |
95 | } | 96 | } |
96 | 97 | ||
diff --git a/drivers/staging/usbip/usbip_common.c b/drivers/staging/usbip/usbip_common.c index 68f51068abf1..433a3b6207d6 100644 --- a/drivers/staging/usbip/usbip_common.c +++ b/drivers/staging/usbip/usbip_common.c | |||
@@ -56,7 +56,7 @@ DEVICE_ATTR(usbip_debug, (S_IRUGO | S_IWUSR), show_flag, store_flag); | |||
56 | 56 | ||
57 | static void usbip_dump_buffer(char *buff, int bufflen) | 57 | static void usbip_dump_buffer(char *buff, int bufflen) |
58 | { | 58 | { |
59 | print_hex_dump(KERN_DEBUG, "usb-ip", DUMP_PREFIX_OFFSET, 16, 4, | 59 | print_hex_dump(KERN_DEBUG, "usbip-core", DUMP_PREFIX_OFFSET, 16, 4, |
60 | buff, bufflen, false); | 60 | buff, bufflen, false); |
61 | } | 61 | } |
62 | 62 | ||
@@ -67,30 +67,25 @@ static void usbip_dump_pipe(unsigned int p) | |||
67 | unsigned char dev = usb_pipedevice(p); | 67 | unsigned char dev = usb_pipedevice(p); |
68 | unsigned char dir = usb_pipein(p); | 68 | unsigned char dir = usb_pipein(p); |
69 | 69 | ||
70 | printk(KERN_DEBUG "dev(%d) ", dev); | 70 | pr_debug("dev(%d) ep(%d) [%s] ", dev, ep, dir ? "IN" : "OUT"); |
71 | printk(KERN_DEBUG "ep(%d) ", ep); | ||
72 | printk(KERN_DEBUG "%s ", dir ? "IN" : "OUT"); | ||
73 | 71 | ||
74 | switch (type) { | 72 | switch (type) { |
75 | case PIPE_ISOCHRONOUS: | 73 | case PIPE_ISOCHRONOUS: |
76 | printk(KERN_DEBUG "%s ", "ISO"); | 74 | pr_debug("ISO\n"); |
77 | break; | 75 | break; |
78 | case PIPE_INTERRUPT: | 76 | case PIPE_INTERRUPT: |
79 | printk(KERN_DEBUG "%s ", "INT"); | 77 | pr_debug("INT\n"); |
80 | break; | 78 | break; |
81 | case PIPE_CONTROL: | 79 | case PIPE_CONTROL: |
82 | printk(KERN_DEBUG "%s ", "CTL"); | 80 | pr_debug("CTRL\n"); |
83 | break; | 81 | break; |
84 | case PIPE_BULK: | 82 | case PIPE_BULK: |
85 | printk(KERN_DEBUG "%s ", "BLK"); | 83 | pr_debug("BULK\n"); |
86 | break; | 84 | break; |
87 | default: | 85 | default: |
88 | printk(KERN_DEBUG "ERR"); | 86 | pr_debug("ERR\n"); |
89 | break; | 87 | break; |
90 | } | 88 | } |
91 | |||
92 | printk(KERN_DEBUG "\n"); | ||
93 | |||
94 | } | 89 | } |
95 | 90 | ||
96 | static void usbip_dump_usb_device(struct usb_device *udev) | 91 | static void usbip_dump_usb_device(struct usb_device *udev) |
@@ -98,61 +93,59 @@ static void usbip_dump_usb_device(struct usb_device *udev) | |||
98 | struct device *dev = &udev->dev; | 93 | struct device *dev = &udev->dev; |
99 | int i; | 94 | int i; |
100 | 95 | ||
101 | dev_dbg(dev, " devnum(%d) devpath(%s)", | 96 | dev_dbg(dev, " devnum(%d) devpath(%s) ", |
102 | udev->devnum, udev->devpath); | 97 | udev->devnum, udev->devpath); |
103 | 98 | ||
104 | switch (udev->speed) { | 99 | switch (udev->speed) { |
105 | case USB_SPEED_HIGH: | 100 | case USB_SPEED_HIGH: |
106 | printk(KERN_DEBUG " SPD_HIGH"); | 101 | pr_debug("SPD_HIGH "); |
107 | break; | 102 | break; |
108 | case USB_SPEED_FULL: | 103 | case USB_SPEED_FULL: |
109 | printk(KERN_DEBUG " SPD_FULL"); | 104 | pr_debug("SPD_FULL "); |
110 | break; | 105 | break; |
111 | case USB_SPEED_LOW: | 106 | case USB_SPEED_LOW: |
112 | printk(KERN_DEBUG " SPD_LOW"); | 107 | pr_debug("SPD_LOW "); |
113 | break; | 108 | break; |
114 | case USB_SPEED_UNKNOWN: | 109 | case USB_SPEED_UNKNOWN: |
115 | printk(KERN_DEBUG " SPD_UNKNOWN"); | 110 | pr_debug("SPD_UNKNOWN "); |
116 | break; | 111 | break; |
117 | default: | 112 | default: |
118 | printk(KERN_DEBUG " SPD_ERROR"); | 113 | pr_debug("SPD_ERROR "); |
119 | break; | 114 | break; |
120 | } | 115 | } |
121 | 116 | ||
122 | printk(KERN_DEBUG " tt %p, ttport %d", udev->tt, udev->ttport); | 117 | pr_debug("tt %p, ttport %d\n", udev->tt, udev->ttport); |
123 | printk(KERN_DEBUG "\n"); | ||
124 | 118 | ||
125 | dev_dbg(dev, " "); | 119 | dev_dbg(dev, " "); |
126 | for (i = 0; i < 16; i++) | 120 | for (i = 0; i < 16; i++) |
127 | printk(KERN_DEBUG " %2u", i); | 121 | pr_debug(" %2u", i); |
128 | printk(KERN_DEBUG "\n"); | 122 | pr_debug("\n"); |
129 | 123 | ||
130 | dev_dbg(dev, " toggle0(IN) :"); | 124 | dev_dbg(dev, " toggle0(IN) :"); |
131 | for (i = 0; i < 16; i++) | 125 | for (i = 0; i < 16; i++) |
132 | printk(KERN_DEBUG " %2u", (udev->toggle[0] & (1 << i)) ? 1 : 0); | 126 | pr_debug(" %2u", (udev->toggle[0] & (1 << i)) ? 1 : 0); |
133 | printk(KERN_DEBUG "\n"); | 127 | pr_debug("\n"); |
134 | 128 | ||
135 | dev_dbg(dev, " toggle1(OUT):"); | 129 | dev_dbg(dev, " toggle1(OUT):"); |
136 | for (i = 0; i < 16; i++) | 130 | for (i = 0; i < 16; i++) |
137 | printk(KERN_DEBUG " %2u", (udev->toggle[1] & (1 << i)) ? 1 : 0); | 131 | pr_debug(" %2u", (udev->toggle[1] & (1 << i)) ? 1 : 0); |
138 | printk(KERN_DEBUG "\n"); | 132 | pr_debug("\n"); |
139 | |||
140 | 133 | ||
141 | dev_dbg(dev, " epmaxp_in :"); | 134 | dev_dbg(dev, " epmaxp_in :"); |
142 | for (i = 0; i < 16; i++) { | 135 | for (i = 0; i < 16; i++) { |
143 | if (udev->ep_in[i]) | 136 | if (udev->ep_in[i]) |
144 | printk(KERN_DEBUG " %2u", | 137 | pr_debug(" %2u", |
145 | le16_to_cpu(udev->ep_in[i]->desc.wMaxPacketSize)); | 138 | le16_to_cpu(udev->ep_in[i]->desc.wMaxPacketSize)); |
146 | } | 139 | } |
147 | printk(KERN_DEBUG "\n"); | 140 | pr_debug("\n"); |
148 | 141 | ||
149 | dev_dbg(dev, " epmaxp_out :"); | 142 | dev_dbg(dev, " epmaxp_out :"); |
150 | for (i = 0; i < 16; i++) { | 143 | for (i = 0; i < 16; i++) { |
151 | if (udev->ep_out[i]) | 144 | if (udev->ep_out[i]) |
152 | printk(KERN_DEBUG " %2u", | 145 | pr_debug(" %2u", |
153 | le16_to_cpu(udev->ep_out[i]->desc.wMaxPacketSize)); | 146 | le16_to_cpu(udev->ep_out[i]->desc.wMaxPacketSize)); |
154 | } | 147 | } |
155 | printk(KERN_DEBUG "\n"); | 148 | pr_debug("\n"); |
156 | 149 | ||
157 | dev_dbg(dev, "parent %p, bus %p\n", udev->parent, udev->bus); | 150 | dev_dbg(dev, "parent %p, bus %p\n", udev->parent, udev->bus); |
158 | 151 | ||
@@ -171,19 +164,19 @@ static void usbip_dump_request_type(__u8 rt) | |||
171 | { | 164 | { |
172 | switch (rt & USB_RECIP_MASK) { | 165 | switch (rt & USB_RECIP_MASK) { |
173 | case USB_RECIP_DEVICE: | 166 | case USB_RECIP_DEVICE: |
174 | printk(KERN_DEBUG "DEVICE"); | 167 | pr_debug("DEVICE"); |
175 | break; | 168 | break; |
176 | case USB_RECIP_INTERFACE: | 169 | case USB_RECIP_INTERFACE: |
177 | printk(KERN_DEBUG "INTERF"); | 170 | pr_debug("INTERF"); |
178 | break; | 171 | break; |
179 | case USB_RECIP_ENDPOINT: | 172 | case USB_RECIP_ENDPOINT: |
180 | printk(KERN_DEBUG "ENDPOI"); | 173 | pr_debug("ENDPOI"); |
181 | break; | 174 | break; |
182 | case USB_RECIP_OTHER: | 175 | case USB_RECIP_OTHER: |
183 | printk(KERN_DEBUG "OTHER "); | 176 | pr_debug("OTHER "); |
184 | break; | 177 | break; |
185 | default: | 178 | default: |
186 | printk(KERN_DEBUG "------"); | 179 | pr_debug("------"); |
187 | break; | 180 | break; |
188 | } | 181 | } |
189 | } | 182 | } |
@@ -191,73 +184,64 @@ static void usbip_dump_request_type(__u8 rt) | |||
191 | static void usbip_dump_usb_ctrlrequest(struct usb_ctrlrequest *cmd) | 184 | static void usbip_dump_usb_ctrlrequest(struct usb_ctrlrequest *cmd) |
192 | { | 185 | { |
193 | if (!cmd) { | 186 | if (!cmd) { |
194 | printk(KERN_DEBUG " %s : null pointer\n", __func__); | 187 | pr_debug(" : null pointer\n"); |
195 | return; | 188 | return; |
196 | } | 189 | } |
197 | 190 | ||
198 | printk(KERN_DEBUG " "); | 191 | pr_debug(" "); |
199 | printk(KERN_DEBUG "bRequestType(%02X) ", cmd->bRequestType); | 192 | pr_debug("bRequestType(%02X) bRequest(%02X) wValue(%04X) wIndex(%04X) " |
200 | printk(KERN_DEBUG "bRequest(%02X) " , cmd->bRequest); | 193 | "wLength(%04X) ", cmd->bRequestType, cmd->bRequest, |
201 | printk(KERN_DEBUG "wValue(%04X) ", cmd->wValue); | 194 | cmd->wValue, cmd->wIndex, cmd->wLength); |
202 | printk(KERN_DEBUG "wIndex(%04X) ", cmd->wIndex); | 195 | pr_debug("\n "); |
203 | printk(KERN_DEBUG "wLength(%04X) ", cmd->wLength); | ||
204 | |||
205 | printk(KERN_DEBUG "\n "); | ||
206 | 196 | ||
207 | if ((cmd->bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD) { | 197 | if ((cmd->bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD) { |
208 | printk(KERN_DEBUG "STANDARD "); | 198 | pr_debug("STANDARD "); |
209 | switch (cmd->bRequest) { | 199 | switch (cmd->bRequest) { |
210 | case USB_REQ_GET_STATUS: | 200 | case USB_REQ_GET_STATUS: |
211 | printk(KERN_DEBUG "GET_STATUS"); | 201 | pr_debug("GET_STATUS\n"); |
212 | break; | 202 | break; |
213 | case USB_REQ_CLEAR_FEATURE: | 203 | case USB_REQ_CLEAR_FEATURE: |
214 | printk(KERN_DEBUG "CLEAR_FEAT"); | 204 | pr_debug("CLEAR_FEAT\n"); |
215 | break; | 205 | break; |
216 | case USB_REQ_SET_FEATURE: | 206 | case USB_REQ_SET_FEATURE: |
217 | printk(KERN_DEBUG "SET_FEAT "); | 207 | pr_debug("SET_FEAT \n"); |
218 | break; | 208 | break; |
219 | case USB_REQ_SET_ADDRESS: | 209 | case USB_REQ_SET_ADDRESS: |
220 | printk(KERN_DEBUG "SET_ADDRRS"); | 210 | pr_debug("SET_ADDRRS\n"); |
221 | break; | 211 | break; |
222 | case USB_REQ_GET_DESCRIPTOR: | 212 | case USB_REQ_GET_DESCRIPTOR: |
223 | printk(KERN_DEBUG "GET_DESCRI"); | 213 | pr_debug("GET_DESCRI\n"); |
224 | break; | 214 | break; |
225 | case USB_REQ_SET_DESCRIPTOR: | 215 | case USB_REQ_SET_DESCRIPTOR: |
226 | printk(KERN_DEBUG "SET_DESCRI"); | 216 | pr_debug("SET_DESCRI\n"); |
227 | break; | 217 | break; |
228 | case USB_REQ_GET_CONFIGURATION: | 218 | case USB_REQ_GET_CONFIGURATION: |
229 | printk(KERN_DEBUG "GET_CONFIG"); | 219 | pr_debug("GET_CONFIG\n"); |
230 | break; | 220 | break; |
231 | case USB_REQ_SET_CONFIGURATION: | 221 | case USB_REQ_SET_CONFIGURATION: |
232 | printk(KERN_DEBUG "SET_CONFIG"); | 222 | pr_debug("SET_CONFIG\n"); |
233 | break; | 223 | break; |
234 | case USB_REQ_GET_INTERFACE: | 224 | case USB_REQ_GET_INTERFACE: |
235 | printk(KERN_DEBUG "GET_INTERF"); | 225 | pr_debug("GET_INTERF\n"); |
236 | break; | 226 | break; |
237 | case USB_REQ_SET_INTERFACE: | 227 | case USB_REQ_SET_INTERFACE: |
238 | printk(KERN_DEBUG "SET_INTERF"); | 228 | pr_debug("SET_INTERF\n"); |
239 | break; | 229 | break; |
240 | case USB_REQ_SYNCH_FRAME: | 230 | case USB_REQ_SYNCH_FRAME: |
241 | printk(KERN_DEBUG "SYNC_FRAME"); | 231 | pr_debug("SYNC_FRAME\n"); |
242 | break; | 232 | break; |
243 | default: | 233 | default: |
244 | printk(KERN_DEBUG "REQ(%02X) ", cmd->bRequest); | 234 | pr_debug("REQ(%02X) \n", cmd->bRequest); |
245 | break; | 235 | break; |
246 | } | 236 | } |
247 | |||
248 | printk(KERN_DEBUG " "); | ||
249 | usbip_dump_request_type(cmd->bRequestType); | 237 | usbip_dump_request_type(cmd->bRequestType); |
250 | 238 | } else if ((cmd->bRequestType & USB_TYPE_MASK) == USB_TYPE_CLASS) { | |
251 | } else if ((cmd->bRequestType & USB_TYPE_MASK) == USB_TYPE_CLASS) | 239 | pr_debug("CLASS \n"); |
252 | printk(KERN_DEBUG "CLASS "); | 240 | } else if ((cmd->bRequestType & USB_TYPE_MASK) == USB_TYPE_VENDOR) { |
253 | 241 | pr_debug("VENDOR \n"); | |
254 | else if ((cmd->bRequestType & USB_TYPE_MASK) == USB_TYPE_VENDOR) | 242 | } else if ((cmd->bRequestType & USB_TYPE_MASK) == USB_TYPE_RESERVED) { |
255 | printk(KERN_DEBUG "VENDOR "); | 243 | pr_debug("RESERVED\n"); |
256 | 244 | } | |
257 | else if ((cmd->bRequestType & USB_TYPE_MASK) == USB_TYPE_RESERVED) | ||
258 | printk(KERN_DEBUG "RESERVED"); | ||
259 | |||
260 | printk(KERN_DEBUG "\n"); | ||
261 | } | 245 | } |
262 | 246 | ||
263 | void usbip_dump_urb(struct urb *urb) | 247 | void usbip_dump_urb(struct urb *urb) |
@@ -265,16 +249,15 @@ void usbip_dump_urb(struct urb *urb) | |||
265 | struct device *dev; | 249 | struct device *dev; |
266 | 250 | ||
267 | if (!urb) { | 251 | if (!urb) { |
268 | printk(KERN_DEBUG KBUILD_MODNAME | 252 | pr_debug("urb: null pointer!!\n"); |
269 | ":%s: urb: null pointer!!\n", __func__); | ||
270 | return; | 253 | return; |
271 | } | 254 | } |
272 | 255 | ||
273 | if (!urb->dev) { | 256 | if (!urb->dev) { |
274 | printk(KERN_DEBUG KBUILD_MODNAME | 257 | pr_debug("urb->dev: null pointer!!\n"); |
275 | ":%s: urb->dev: null pointer!!\n", __func__); | ||
276 | return; | 258 | return; |
277 | } | 259 | } |
260 | |||
278 | dev = &urb->dev->dev; | 261 | dev = &urb->dev->dev; |
279 | 262 | ||
280 | dev_dbg(dev, " urb :%p\n", urb); | 263 | dev_dbg(dev, " urb :%p\n", urb); |
@@ -309,39 +292,42 @@ EXPORT_SYMBOL_GPL(usbip_dump_urb); | |||
309 | 292 | ||
310 | void usbip_dump_header(struct usbip_header *pdu) | 293 | void usbip_dump_header(struct usbip_header *pdu) |
311 | { | 294 | { |
312 | usbip_udbg("BASE: cmd %u seq %u devid %u dir %u ep %u\n", | 295 | pr_debug("BASE: cmd %u seq %u devid %u dir %u ep %u\n", |
313 | pdu->base.command, | 296 | pdu->base.command, |
314 | pdu->base.seqnum, | 297 | pdu->base.seqnum, |
315 | pdu->base.devid, | 298 | pdu->base.devid, |
316 | pdu->base.direction, | 299 | pdu->base.direction, |
317 | pdu->base.ep); | 300 | pdu->base.ep); |
318 | 301 | ||
319 | switch (pdu->base.command) { | 302 | switch (pdu->base.command) { |
320 | case USBIP_CMD_SUBMIT: | 303 | case USBIP_CMD_SUBMIT: |
321 | usbip_udbg("CMD_SUBMIT: " | 304 | pr_debug("USBIP_CMD_SUBMIT: " |
322 | "x_flags %u x_len %u sf %u #p %u iv %u\n", | 305 | "x_flags %u x_len %u sf %u #p %d iv %d\n", |
323 | pdu->u.cmd_submit.transfer_flags, | 306 | pdu->u.cmd_submit.transfer_flags, |
324 | pdu->u.cmd_submit.transfer_buffer_length, | 307 | pdu->u.cmd_submit.transfer_buffer_length, |
325 | pdu->u.cmd_submit.start_frame, | 308 | pdu->u.cmd_submit.start_frame, |
326 | pdu->u.cmd_submit.number_of_packets, | 309 | pdu->u.cmd_submit.number_of_packets, |
327 | pdu->u.cmd_submit.interval); | 310 | pdu->u.cmd_submit.interval); |
328 | break; | 311 | break; |
329 | case USBIP_CMD_UNLINK: | 312 | case USBIP_CMD_UNLINK: |
330 | usbip_udbg("CMD_UNLINK: seq %u\n", pdu->u.cmd_unlink.seqnum); | 313 | pr_debug("USBIP_CMD_UNLINK: seq %u\n", |
314 | pdu->u.cmd_unlink.seqnum); | ||
331 | break; | 315 | break; |
332 | case USBIP_RET_SUBMIT: | 316 | case USBIP_RET_SUBMIT: |
333 | usbip_udbg("RET_SUBMIT: st %d al %u sf %d #p %d ec %d\n", | 317 | pr_debug("USBIP_RET_SUBMIT: st %d al %u sf %d #p %d ec %d\n", |
334 | pdu->u.ret_submit.status, | 318 | pdu->u.ret_submit.status, |
335 | pdu->u.ret_submit.actual_length, | 319 | pdu->u.ret_submit.actual_length, |
336 | pdu->u.ret_submit.start_frame, | 320 | pdu->u.ret_submit.start_frame, |
337 | pdu->u.ret_submit.number_of_packets, | 321 | pdu->u.ret_submit.number_of_packets, |
338 | pdu->u.ret_submit.error_count); | 322 | pdu->u.ret_submit.error_count); |
323 | break; | ||
339 | case USBIP_RET_UNLINK: | 324 | case USBIP_RET_UNLINK: |
340 | usbip_udbg("RET_UNLINK: status %d\n", pdu->u.ret_unlink.status); | 325 | pr_debug("USBIP_RET_UNLINK: status %d\n", |
326 | pdu->u.ret_unlink.status); | ||
341 | break; | 327 | break; |
342 | default: | 328 | default: |
343 | /* NOT REACHED */ | 329 | /* NOT REACHED */ |
344 | usbip_udbg("unknown command\n"); | 330 | pr_err("unknown command\n"); |
345 | break; | 331 | break; |
346 | } | 332 | } |
347 | } | 333 | } |
@@ -363,21 +349,20 @@ int usbip_xmit(int send, struct socket *sock, char *buf, | |||
363 | usbip_dbg_xmit("enter\n"); | 349 | usbip_dbg_xmit("enter\n"); |
364 | 350 | ||
365 | if (!sock || !buf || !size) { | 351 | if (!sock || !buf || !size) { |
366 | printk(KERN_ERR "%s: invalid arg, sock %p buff %p size %d\n", | 352 | pr_err("invalid arg, sock %p buff %p size %d\n", sock, buf, |
367 | __func__, sock, buf, size); | 353 | size); |
368 | return -EINVAL; | 354 | return -EINVAL; |
369 | } | 355 | } |
370 | 356 | ||
371 | if (usbip_dbg_flag_xmit) { | 357 | if (usbip_dbg_flag_xmit) { |
372 | if (send) { | 358 | if (send) { |
373 | if (!in_interrupt()) | 359 | if (!in_interrupt()) |
374 | printk(KERN_DEBUG "%-10s:", current->comm); | 360 | pr_debug("%-10s:", current->comm); |
375 | else | 361 | else |
376 | printk(KERN_DEBUG "interrupt :"); | 362 | pr_debug("interrupt :"); |
377 | 363 | ||
378 | printk(KERN_DEBUG "%s: sending... , sock %p, buf %p, " | 364 | pr_debug("sending... , sock %p, buf %p, size %d, " |
379 | "size %d, msg_flags %d\n", __func__, | 365 | "msg_flags %d\n", sock, buf, size, msg_flags); |
380 | sock, buf, size, msg_flags); | ||
381 | usbip_dump_buffer(buf, size); | 366 | usbip_dump_buffer(buf, size); |
382 | } | 367 | } |
383 | } | 368 | } |
@@ -400,9 +385,9 @@ int usbip_xmit(int send, struct socket *sock, char *buf, | |||
400 | MSG_WAITALL); | 385 | MSG_WAITALL); |
401 | 386 | ||
402 | if (result <= 0) { | 387 | if (result <= 0) { |
403 | usbip_udbg("usbip_xmit: %s sock %p buf %p size %u ret " | 388 | pr_debug("%s sock %p buf %p size %u ret %d total %d\n", |
404 | "%d total %d\n", send ? "send" : "receive", | 389 | send ? "send" : "receive", sock, buf, size, |
405 | sock, buf, size, result, total); | 390 | result, total); |
406 | goto err; | 391 | goto err; |
407 | } | 392 | } |
408 | 393 | ||
@@ -415,20 +400,18 @@ int usbip_xmit(int send, struct socket *sock, char *buf, | |||
415 | if (usbip_dbg_flag_xmit) { | 400 | if (usbip_dbg_flag_xmit) { |
416 | if (!send) { | 401 | if (!send) { |
417 | if (!in_interrupt()) | 402 | if (!in_interrupt()) |
418 | printk(KERN_DEBUG "%-10s:", current->comm); | 403 | pr_debug("%-10s:", current->comm); |
419 | else | 404 | else |
420 | printk(KERN_DEBUG "interrupt :"); | 405 | pr_debug("interrupt :"); |
421 | 406 | ||
422 | printk(KERN_DEBUG "usbip_xmit: receiving....\n"); | 407 | pr_debug("receiving....\n"); |
423 | usbip_dump_buffer(bp, osize); | 408 | usbip_dump_buffer(bp, osize); |
424 | printk(KERN_DEBUG "usbip_xmit: received, osize %d ret " | 409 | pr_debug("received, osize %d ret %d size %d total %d\n", |
425 | "%d size %d total %d\n", osize, result, size, | 410 | osize, result, size, total); |
426 | total); | ||
427 | } | 411 | } |
428 | 412 | ||
429 | if (send) | 413 | if (send) |
430 | printk(KERN_DEBUG "usbip_xmit: send, total %d\n", | 414 | pr_debug("send, total %d\n", total); |
431 | total); | ||
432 | } | 415 | } |
433 | 416 | ||
434 | return total; | 417 | return total; |
@@ -446,7 +429,7 @@ struct socket *sockfd_to_socket(unsigned int sockfd) | |||
446 | 429 | ||
447 | file = fget(sockfd); | 430 | file = fget(sockfd); |
448 | if (!file) { | 431 | if (!file) { |
449 | printk(KERN_ERR "%s: invalid sockfd\n", __func__); | 432 | pr_err("invalid sockfd\n"); |
450 | return NULL; | 433 | return NULL; |
451 | } | 434 | } |
452 | 435 | ||
@@ -532,8 +515,7 @@ void usbip_pack_pdu(struct usbip_header *pdu, struct urb *urb, int cmd, | |||
532 | break; | 515 | break; |
533 | default: | 516 | default: |
534 | /* NOT REACHED */ | 517 | /* NOT REACHED */ |
535 | err("unknown command"); | 518 | pr_err("unknown command\n"); |
536 | /* BUG(); */ | ||
537 | break; | 519 | break; |
538 | } | 520 | } |
539 | } | 521 | } |
@@ -639,8 +621,7 @@ void usbip_header_correct_endian(struct usbip_header *pdu, int send) | |||
639 | break; | 621 | break; |
640 | default: | 622 | default: |
641 | /* NOT REACHED */ | 623 | /* NOT REACHED */ |
642 | err("unknown command in pdu header: %d", cmd); | 624 | pr_err("unknown command\n"); |
643 | /* BUG(); */ | ||
644 | break; | 625 | break; |
645 | } | 626 | } |
646 | } | 627 | } |
@@ -722,7 +703,7 @@ int usbip_recv_iso(struct usbip_device *ud, struct urb *urb) | |||
722 | 703 | ||
723 | /* my Bluetooth dongle gets ISO URBs which are np = 0 */ | 704 | /* my Bluetooth dongle gets ISO URBs which are np = 0 */ |
724 | if (np == 0) { | 705 | if (np == 0) { |
725 | /* usbip_uinfo("iso np == 0\n"); */ | 706 | /* pr_info("iso np == 0\n"); */ |
726 | /* usbip_dump_urb(urb); */ | 707 | /* usbip_dump_urb(urb); */ |
727 | return 0; | 708 | return 0; |
728 | } | 709 | } |
@@ -860,8 +841,7 @@ EXPORT_SYMBOL_GPL(usbip_recv_xbuff); | |||
860 | 841 | ||
861 | static int __init usbip_common_init(void) | 842 | static int __init usbip_common_init(void) |
862 | { | 843 | { |
863 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC " " USBIP_VERSION | 844 | pr_info(DRIVER_DESC " v" USBIP_VERSION "\n"); |
864 | "\n"); | ||
865 | return 0; | 845 | return 0; |
866 | } | 846 | } |
867 | 847 | ||
diff --git a/drivers/staging/usbip/usbip_common.h b/drivers/staging/usbip/usbip_common.h index fd84ab2f9c2c..4a641c552b78 100644 --- a/drivers/staging/usbip/usbip_common.h +++ b/drivers/staging/usbip/usbip_common.h | |||
@@ -32,25 +32,13 @@ | |||
32 | 32 | ||
33 | #define USBIP_VERSION "1.0.0" | 33 | #define USBIP_VERSION "1.0.0" |
34 | 34 | ||
35 | /** | 35 | #undef pr_fmt |
36 | * usbip_udbg - print debug messages if CONFIG_USB_IP_DEBUG is defined | ||
37 | * @fmt: | ||
38 | * @args: | ||
39 | */ | ||
40 | #ifdef CONFIG_USB_IP_DEBUG | ||
41 | |||
42 | #define usbip_udbg(fmt, args...) \ | ||
43 | do { \ | ||
44 | printk(KERN_DEBUG "%-10s:(%s,%d) %s: " fmt, \ | ||
45 | (in_interrupt() ? "interrupt" : (current)->comm),\ | ||
46 | __FILE__, __LINE__, __func__, ##args); \ | ||
47 | } while (0) | ||
48 | 36 | ||
37 | #ifdef DEBUG | ||
38 | #define pr_fmt(fmt) KBUILD_MODNAME ": %s:%d: " fmt, __func__, __LINE__ | ||
49 | #else | 39 | #else |
50 | 40 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | |
51 | #define usbip_udbg(fmt, args...) do { } while (0) | 41 | #endif |
52 | |||
53 | #endif /* CONFIG_USB_IP_DEBUG */ | ||
54 | 42 | ||
55 | enum { | 43 | enum { |
56 | usbip_debug_xmit = (1 << 0), | 44 | usbip_debug_xmit = (1 << 0), |
@@ -85,7 +73,7 @@ extern struct device_attribute dev_attr_usbip_debug; | |||
85 | #define usbip_dbg_with_flag(flag, fmt, args...) \ | 73 | #define usbip_dbg_with_flag(flag, fmt, args...) \ |
86 | do { \ | 74 | do { \ |
87 | if (flag & usbip_debug_flag) \ | 75 | if (flag & usbip_debug_flag) \ |
88 | usbip_udbg(fmt , ##args); \ | 76 | pr_debug(fmt, ##args); \ |
89 | } while (0) | 77 | } while (0) |
90 | 78 | ||
91 | #define usbip_dbg_sysfs(fmt, args...) \ | 79 | #define usbip_dbg_sysfs(fmt, args...) \ |
@@ -115,28 +103,6 @@ extern struct device_attribute dev_attr_usbip_debug; | |||
115 | #define usbip_dbg_stub_tx(fmt, args...) \ | 103 | #define usbip_dbg_stub_tx(fmt, args...) \ |
116 | usbip_dbg_with_flag(usbip_debug_stub_tx, fmt , ##args) | 104 | usbip_dbg_with_flag(usbip_debug_stub_tx, fmt , ##args) |
117 | 105 | ||
118 | /** | ||
119 | * usbip_uerr - print error messages | ||
120 | * @fmt: | ||
121 | * @args: | ||
122 | */ | ||
123 | #define usbip_uerr(fmt, args...) \ | ||
124 | do { \ | ||
125 | printk(KERN_ERR "%-10s: ***ERROR*** (%s,%d) %s: " fmt, \ | ||
126 | (in_interrupt() ? "interrupt" : (current)->comm),\ | ||
127 | __FILE__, __LINE__, __func__, ##args); \ | ||
128 | } while (0) | ||
129 | |||
130 | /** | ||
131 | * usbip_uinfo - print information messages | ||
132 | * @fmt: | ||
133 | * @args: | ||
134 | */ | ||
135 | #define usbip_uinfo(fmt, args...) \ | ||
136 | do { \ | ||
137 | printk(KERN_INFO "usbip: " fmt , ## args); \ | ||
138 | } while (0) | ||
139 | |||
140 | /* | 106 | /* |
141 | * USB/IP request headers. | 107 | * USB/IP request headers. |
142 | * Currently, we define 4 request types: | 108 | * Currently, we define 4 request types: |
diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c index da6074daf1fe..ecd1862539cd 100644 --- a/drivers/staging/usbip/usbip_event.c +++ b/drivers/staging/usbip/usbip_event.c | |||
@@ -84,8 +84,7 @@ int usbip_start_eh(struct usbip_device *ud) | |||
84 | 84 | ||
85 | ud->eh = kthread_run(event_handler_loop, ud, "usbip_eh"); | 85 | ud->eh = kthread_run(event_handler_loop, ud, "usbip_eh"); |
86 | if (IS_ERR(ud->eh)) { | 86 | if (IS_ERR(ud->eh)) { |
87 | printk(KERN_WARNING | 87 | pr_warning("Unable to start control thread\n"); |
88 | "Unable to start control thread\n"); | ||
89 | return PTR_ERR(ud->eh); | 88 | return PTR_ERR(ud->eh); |
90 | } | 89 | } |
91 | 90 | ||
diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c index fad10c5a8b1d..598f31180e96 100644 --- a/drivers/staging/usbip/vhci_hcd.c +++ b/drivers/staging/usbip/vhci_hcd.c | |||
@@ -96,12 +96,12 @@ static void dump_port_status(u32 status) | |||
96 | { | 96 | { |
97 | int i = 0; | 97 | int i = 0; |
98 | 98 | ||
99 | printk(KERN_DEBUG "status %08x:", status); | 99 | pr_debug("status %08x:", status); |
100 | for (i = 0; i < 32; i++) { | 100 | for (i = 0; i < 32; i++) { |
101 | if (status & (1 << i)) | 101 | if (status & (1 << i)) |
102 | printk(KERN_DEBUG " %s", bit_desc[i]); | 102 | pr_debug(" %s", bit_desc[i]); |
103 | } | 103 | } |
104 | printk(KERN_DEBUG "\n"); | 104 | pr_debug("\n"); |
105 | } | 105 | } |
106 | 106 | ||
107 | void rh_port_connect(int rhport, enum usb_device_speed speed) | 107 | void rh_port_connect(int rhport, enum usb_device_speed speed) |
@@ -216,7 +216,7 @@ static int vhci_hub_status(struct usb_hcd *hcd, char *buf) | |||
216 | } | 216 | } |
217 | } | 217 | } |
218 | 218 | ||
219 | usbip_uinfo("changed %d\n", changed); | 219 | pr_info("changed %d\n", changed); |
220 | 220 | ||
221 | if (hcd->state == HC_STATE_SUSPENDED) | 221 | if (hcd->state == HC_STATE_SUSPENDED) |
222 | usb_hcd_resume_root_hub(hcd); | 222 | usb_hcd_resume_root_hub(hcd); |
@@ -264,8 +264,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
264 | usbip_dbg_vhci_rh("typeReq %x wValue %x wIndex %x\n", typeReq, wValue, | 264 | usbip_dbg_vhci_rh("typeReq %x wValue %x wIndex %x\n", typeReq, wValue, |
265 | wIndex); | 265 | wIndex); |
266 | if (wIndex > VHCI_NPORTS) | 266 | if (wIndex > VHCI_NPORTS) |
267 | printk(KERN_ERR "%s: invalid port number %d\n", __func__, | 267 | pr_err("invalid port number %d\n", wIndex); |
268 | wIndex); | ||
269 | rhport = ((__u8)(wIndex & 0x00ff)) - 1; | 268 | rhport = ((__u8)(wIndex & 0x00ff)) - 1; |
270 | 269 | ||
271 | dum = hcd_to_vhci(hcd); | 270 | dum = hcd_to_vhci(hcd); |
@@ -334,8 +333,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
334 | case GetPortStatus: | 333 | case GetPortStatus: |
335 | usbip_dbg_vhci_rh(" GetPortStatus port %x\n", wIndex); | 334 | usbip_dbg_vhci_rh(" GetPortStatus port %x\n", wIndex); |
336 | if (wIndex > VHCI_NPORTS || wIndex < 1) { | 335 | if (wIndex > VHCI_NPORTS || wIndex < 1) { |
337 | printk(KERN_ERR "%s: invalid port number %d\n", | 336 | pr_err("invalid port number %d\n", wIndex); |
338 | __func__, wIndex); | ||
339 | retval = -EPIPE; | 337 | retval = -EPIPE; |
340 | } | 338 | } |
341 | 339 | ||
@@ -345,7 +343,6 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
345 | * complete it!! | 343 | * complete it!! |
346 | * */ | 344 | * */ |
347 | if (dum->resuming && time_after(jiffies, dum->re_timeout)) { | 345 | if (dum->resuming && time_after(jiffies, dum->re_timeout)) { |
348 | printk(KERN_ERR "%s: not yet\n", __func__); | ||
349 | dum->port_status[rhport] |= | 346 | dum->port_status[rhport] |= |
350 | (1 << USB_PORT_FEAT_C_SUSPEND); | 347 | (1 << USB_PORT_FEAT_C_SUSPEND); |
351 | dum->port_status[rhport] &= | 348 | dum->port_status[rhport] &= |
@@ -415,7 +412,6 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
415 | case USB_PORT_FEAT_SUSPEND: | 412 | case USB_PORT_FEAT_SUSPEND: |
416 | usbip_dbg_vhci_rh(" SetPortFeature: " | 413 | usbip_dbg_vhci_rh(" SetPortFeature: " |
417 | "USB_PORT_FEAT_SUSPEND\n"); | 414 | "USB_PORT_FEAT_SUSPEND\n"); |
418 | printk(KERN_ERR "%s: not yet\n", __func__); | ||
419 | #if 0 | 415 | #if 0 |
420 | dum->port_status[rhport] |= | 416 | dum->port_status[rhport] |= |
421 | (1 << USB_PORT_FEAT_SUSPEND); | 417 | (1 << USB_PORT_FEAT_SUSPEND); |
@@ -457,7 +453,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
457 | break; | 453 | break; |
458 | 454 | ||
459 | default: | 455 | default: |
460 | printk(KERN_ERR "%s: default: no such request\n", __func__); | 456 | pr_err("default: no such request\n"); |
461 | /* dev_dbg (hardware, | 457 | /* dev_dbg (hardware, |
462 | * "hub control req%04x v%04x i%04x l%d\n", | 458 | * "hub control req%04x v%04x i%04x l%d\n", |
463 | * typeReq, wValue, wIndex, wLength); */ | 459 | * typeReq, wValue, wIndex, wLength); */ |
@@ -467,7 +463,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
467 | } | 463 | } |
468 | 464 | ||
469 | if (usbip_dbg_flag_vhci_rh) { | 465 | if (usbip_dbg_flag_vhci_rh) { |
470 | printk(KERN_DEBUG "port %d\n", rhport); | 466 | pr_debug("port %d\n", rhport); |
471 | dump_port_status(prev_port_status[rhport]); | 467 | dump_port_status(prev_port_status[rhport]); |
472 | dump_port_status(dum->port_status[rhport]); | 468 | dump_port_status(dum->port_status[rhport]); |
473 | } | 469 | } |
@@ -499,7 +495,7 @@ static void vhci_tx_urb(struct urb *urb) | |||
499 | unsigned long flag; | 495 | unsigned long flag; |
500 | 496 | ||
501 | if (!vdev) { | 497 | if (!vdev) { |
502 | err("could not get virtual device"); | 498 | pr_err("could not get virtual device"); |
503 | /* BUG(); */ | 499 | /* BUG(); */ |
504 | return; | 500 | return; |
505 | } | 501 | } |
@@ -517,7 +513,7 @@ static void vhci_tx_urb(struct urb *urb) | |||
517 | 513 | ||
518 | priv->seqnum = atomic_inc_return(&the_controller->seqnum); | 514 | priv->seqnum = atomic_inc_return(&the_controller->seqnum); |
519 | if (priv->seqnum == 0xffff) | 515 | if (priv->seqnum == 0xffff) |
520 | usbip_uinfo("seqnum max\n"); | 516 | dev_info(&urb->dev->dev, "seqnum max\n"); |
521 | 517 | ||
522 | priv->vdev = vdev; | 518 | priv->vdev = vdev; |
523 | priv->urb = urb; | 519 | priv->urb = urb; |
@@ -558,7 +554,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
558 | spin_lock(&vdev->ud.lock); | 554 | spin_lock(&vdev->ud.lock); |
559 | if (vdev->ud.status == VDEV_ST_NULL || | 555 | if (vdev->ud.status == VDEV_ST_NULL || |
560 | vdev->ud.status == VDEV_ST_ERROR) { | 556 | vdev->ud.status == VDEV_ST_ERROR) { |
561 | usbip_uerr("enqueue for inactive port %d\n", vdev->rhport); | 557 | dev_err(dev, "enqueue for inactive port %d\n", vdev->rhport); |
562 | spin_unlock(&vdev->ud.lock); | 558 | spin_unlock(&vdev->ud.lock); |
563 | spin_unlock_irqrestore(&the_controller->lock, flags); | 559 | spin_unlock_irqrestore(&the_controller->lock, flags); |
564 | return -ENODEV; | 560 | return -ENODEV; |
@@ -701,7 +697,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) | |||
701 | struct vhci_priv *priv; | 697 | struct vhci_priv *priv; |
702 | struct vhci_device *vdev; | 698 | struct vhci_device *vdev; |
703 | 699 | ||
704 | usbip_uinfo("vhci_hcd: dequeue a urb %p\n", urb); | 700 | pr_info("dequeue a urb %p\n", urb); |
705 | 701 | ||
706 | spin_lock_irqsave(&the_controller->lock, flags); | 702 | spin_lock_irqsave(&the_controller->lock, flags); |
707 | 703 | ||
@@ -731,8 +727,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) | |||
731 | 727 | ||
732 | spin_lock_irqsave(&vdev->priv_lock, flags2); | 728 | spin_lock_irqsave(&vdev->priv_lock, flags2); |
733 | 729 | ||
734 | usbip_uinfo("vhci_hcd: device %p seems to be disconnected\n", | 730 | pr_info("device %p seems to be disconnected\n", vdev); |
735 | vdev); | ||
736 | list_del(&priv->list); | 731 | list_del(&priv->list); |
737 | kfree(priv); | 732 | kfree(priv); |
738 | urb->hcpriv = NULL; | 733 | urb->hcpriv = NULL; |
@@ -744,8 +739,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) | |||
744 | * vhci_rx will receive RET_UNLINK and give back the URB. | 739 | * vhci_rx will receive RET_UNLINK and give back the URB. |
745 | * Otherwise, we give back it here. | 740 | * Otherwise, we give back it here. |
746 | */ | 741 | */ |
747 | usbip_uinfo("vhci_hcd: vhci_urb_dequeue() gives back urb %p\n", | 742 | pr_info("gives back urb %p\n", urb); |
748 | urb); | ||
749 | 743 | ||
750 | usb_hcd_unlink_urb_from_ep(hcd, urb); | 744 | usb_hcd_unlink_urb_from_ep(hcd, urb); |
751 | 745 | ||
@@ -764,7 +758,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) | |||
764 | /* setup CMD_UNLINK pdu */ | 758 | /* setup CMD_UNLINK pdu */ |
765 | unlink = kzalloc(sizeof(struct vhci_unlink), GFP_ATOMIC); | 759 | unlink = kzalloc(sizeof(struct vhci_unlink), GFP_ATOMIC); |
766 | if (!unlink) { | 760 | if (!unlink) { |
767 | usbip_uerr("malloc vhci_unlink\n"); | 761 | pr_err("malloc vhci_unlink\n"); |
768 | spin_unlock_irqrestore(&vdev->priv_lock, flags2); | 762 | spin_unlock_irqrestore(&vdev->priv_lock, flags2); |
769 | spin_unlock_irqrestore(&the_controller->lock, flags); | 763 | spin_unlock_irqrestore(&the_controller->lock, flags); |
770 | usbip_event_add(&vdev->ud, VDEV_EVENT_ERROR_MALLOC); | 764 | usbip_event_add(&vdev->ud, VDEV_EVENT_ERROR_MALLOC); |
@@ -773,12 +767,11 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) | |||
773 | 767 | ||
774 | unlink->seqnum = atomic_inc_return(&the_controller->seqnum); | 768 | unlink->seqnum = atomic_inc_return(&the_controller->seqnum); |
775 | if (unlink->seqnum == 0xffff) | 769 | if (unlink->seqnum == 0xffff) |
776 | usbip_uinfo("seqnum max\n"); | 770 | pr_info("seqnum max\n"); |
777 | 771 | ||
778 | unlink->unlink_seqnum = priv->seqnum; | 772 | unlink->unlink_seqnum = priv->seqnum; |
779 | 773 | ||
780 | usbip_uinfo("vhci_hcd: device %p seems to be still connected\n", | 774 | pr_info("device %p seems to be still connected\n", vdev); |
781 | vdev); | ||
782 | 775 | ||
783 | /* send cmd_unlink and try to cancel the pending URB in the | 776 | /* send cmd_unlink and try to cancel the pending URB in the |
784 | * peer */ | 777 | * peer */ |
@@ -801,7 +794,7 @@ static void vhci_device_unlink_cleanup(struct vhci_device *vdev) | |||
801 | spin_lock(&vdev->priv_lock); | 794 | spin_lock(&vdev->priv_lock); |
802 | 795 | ||
803 | list_for_each_entry_safe(unlink, tmp, &vdev->unlink_tx, list) { | 796 | list_for_each_entry_safe(unlink, tmp, &vdev->unlink_tx, list) { |
804 | usbip_uinfo("unlink cleanup tx %lu\n", unlink->unlink_seqnum); | 797 | pr_info("unlink cleanup tx %lu\n", unlink->unlink_seqnum); |
805 | list_del(&unlink->list); | 798 | list_del(&unlink->list); |
806 | kfree(unlink); | 799 | kfree(unlink); |
807 | } | 800 | } |
@@ -810,12 +803,12 @@ static void vhci_device_unlink_cleanup(struct vhci_device *vdev) | |||
810 | struct urb *urb; | 803 | struct urb *urb; |
811 | 804 | ||
812 | /* give back URB of unanswered unlink request */ | 805 | /* give back URB of unanswered unlink request */ |
813 | usbip_uinfo("unlink cleanup rx %lu\n", unlink->unlink_seqnum); | 806 | pr_info("unlink cleanup rx %lu\n", unlink->unlink_seqnum); |
814 | 807 | ||
815 | urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum); | 808 | urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum); |
816 | if (!urb) { | 809 | if (!urb) { |
817 | usbip_uinfo("the urb (seqnum %lu) was already given " | 810 | pr_info("the urb (seqnum %lu) was already given back\n", |
818 | "back\n", unlink->unlink_seqnum); | 811 | unlink->unlink_seqnum); |
819 | list_del(&unlink->list); | 812 | list_del(&unlink->list); |
820 | kfree(unlink); | 813 | kfree(unlink); |
821 | continue; | 814 | continue; |
@@ -848,7 +841,7 @@ static void vhci_shutdown_connection(struct usbip_device *ud) | |||
848 | 841 | ||
849 | /* need this? see stub_dev.c */ | 842 | /* need this? see stub_dev.c */ |
850 | if (ud->tcp_socket) { | 843 | if (ud->tcp_socket) { |
851 | usbip_udbg("shutdown tcp_socket %p\n", ud->tcp_socket); | 844 | pr_debug("shutdown tcp_socket %p\n", ud->tcp_socket); |
852 | kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR); | 845 | kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR); |
853 | } | 846 | } |
854 | 847 | ||
@@ -856,14 +849,14 @@ static void vhci_shutdown_connection(struct usbip_device *ud) | |||
856 | kthread_stop(vdev->ud.tcp_rx); | 849 | kthread_stop(vdev->ud.tcp_rx); |
857 | kthread_stop(vdev->ud.tcp_tx); | 850 | kthread_stop(vdev->ud.tcp_tx); |
858 | 851 | ||
859 | usbip_uinfo("stop threads\n"); | 852 | pr_info("stop threads\n"); |
860 | 853 | ||
861 | /* active connection is closed */ | 854 | /* active connection is closed */ |
862 | if (vdev->ud.tcp_socket != NULL) { | 855 | if (vdev->ud.tcp_socket != NULL) { |
863 | sock_release(vdev->ud.tcp_socket); | 856 | sock_release(vdev->ud.tcp_socket); |
864 | vdev->ud.tcp_socket = NULL; | 857 | vdev->ud.tcp_socket = NULL; |
865 | } | 858 | } |
866 | usbip_uinfo("release socket\n"); | 859 | pr_info("release socket\n"); |
867 | 860 | ||
868 | vhci_device_unlink_cleanup(vdev); | 861 | vhci_device_unlink_cleanup(vdev); |
869 | 862 | ||
@@ -889,7 +882,7 @@ static void vhci_shutdown_connection(struct usbip_device *ud) | |||
889 | */ | 882 | */ |
890 | rh_port_disconnect(vdev->rhport); | 883 | rh_port_disconnect(vdev->rhport); |
891 | 884 | ||
892 | usbip_uinfo("disconnect device\n"); | 885 | pr_info("disconnect device\n"); |
893 | } | 886 | } |
894 | 887 | ||
895 | 888 | ||
@@ -973,7 +966,7 @@ static int vhci_start(struct usb_hcd *hcd) | |||
973 | /* vhci_hcd is now ready to be controlled through sysfs */ | 966 | /* vhci_hcd is now ready to be controlled through sysfs */ |
974 | err = sysfs_create_group(&vhci_dev(vhci)->kobj, &dev_attr_group); | 967 | err = sysfs_create_group(&vhci_dev(vhci)->kobj, &dev_attr_group); |
975 | if (err) { | 968 | if (err) { |
976 | usbip_uerr("create sysfs files\n"); | 969 | pr_err("create sysfs files\n"); |
977 | return err; | 970 | return err; |
978 | } | 971 | } |
979 | 972 | ||
@@ -997,13 +990,11 @@ static void vhci_stop(struct usb_hcd *hcd) | |||
997 | usbip_event_add(&vdev->ud, VDEV_EVENT_REMOVED); | 990 | usbip_event_add(&vdev->ud, VDEV_EVENT_REMOVED); |
998 | usbip_stop_eh(&vdev->ud); | 991 | usbip_stop_eh(&vdev->ud); |
999 | } | 992 | } |
1000 | |||
1001 | usbip_uinfo("vhci_stop done\n"); | ||
1002 | } | 993 | } |
1003 | 994 | ||
1004 | static int vhci_get_frame_number(struct usb_hcd *hcd) | 995 | static int vhci_get_frame_number(struct usb_hcd *hcd) |
1005 | { | 996 | { |
1006 | usbip_uerr("Not yet implemented\n"); | 997 | pr_err("Not yet implemented\n"); |
1007 | return 0; | 998 | return 0; |
1008 | } | 999 | } |
1009 | 1000 | ||
@@ -1080,8 +1071,6 @@ static int vhci_hcd_probe(struct platform_device *pdev) | |||
1080 | struct usb_hcd *hcd; | 1071 | struct usb_hcd *hcd; |
1081 | int ret; | 1072 | int ret; |
1082 | 1073 | ||
1083 | usbip_uinfo("proving...\n"); | ||
1084 | |||
1085 | usbip_dbg_vhci_hc("name %s id %d\n", pdev->name, pdev->id); | 1074 | usbip_dbg_vhci_hc("name %s id %d\n", pdev->name, pdev->id); |
1086 | 1075 | ||
1087 | /* will be removed */ | 1076 | /* will be removed */ |
@@ -1096,7 +1085,7 @@ static int vhci_hcd_probe(struct platform_device *pdev) | |||
1096 | */ | 1085 | */ |
1097 | hcd = usb_create_hcd(&vhci_hc_driver, &pdev->dev, dev_name(&pdev->dev)); | 1086 | hcd = usb_create_hcd(&vhci_hc_driver, &pdev->dev, dev_name(&pdev->dev)); |
1098 | if (!hcd) { | 1087 | if (!hcd) { |
1099 | usbip_uerr("create hcd failed\n"); | 1088 | pr_err("create hcd failed\n"); |
1100 | return -ENOMEM; | 1089 | return -ENOMEM; |
1101 | } | 1090 | } |
1102 | 1091 | ||
@@ -1110,7 +1099,7 @@ static int vhci_hcd_probe(struct platform_device *pdev) | |||
1110 | */ | 1099 | */ |
1111 | ret = usb_add_hcd(hcd, 0, 0); | 1100 | ret = usb_add_hcd(hcd, 0, 0); |
1112 | if (ret != 0) { | 1101 | if (ret != 0) { |
1113 | usbip_uerr("usb_add_hcd failed %d\n", ret); | 1102 | pr_err("usb_add_hcd failed %d\n", ret); |
1114 | usb_put_hcd(hcd); | 1103 | usb_put_hcd(hcd); |
1115 | the_controller = NULL; | 1104 | the_controller = NULL; |
1116 | return ret; | 1105 | return ret; |
@@ -1150,8 +1139,6 @@ static int vhci_hcd_suspend(struct platform_device *pdev, pm_message_t state) | |||
1150 | int connected = 0; | 1139 | int connected = 0; |
1151 | int ret = 0; | 1140 | int ret = 0; |
1152 | 1141 | ||
1153 | dev_dbg(&pdev->dev, "%s\n", __func__); | ||
1154 | |||
1155 | hcd = platform_get_drvdata(pdev); | 1142 | hcd = platform_get_drvdata(pdev); |
1156 | 1143 | ||
1157 | spin_lock(&the_controller->lock); | 1144 | spin_lock(&the_controller->lock); |
@@ -1164,11 +1151,11 @@ static int vhci_hcd_suspend(struct platform_device *pdev, pm_message_t state) | |||
1164 | spin_unlock(&the_controller->lock); | 1151 | spin_unlock(&the_controller->lock); |
1165 | 1152 | ||
1166 | if (connected > 0) { | 1153 | if (connected > 0) { |
1167 | usbip_uinfo("We have %d active connection%s. Do not suspend.\n", | 1154 | dev_info(&pdev->dev, "We have %d active connection%s. Do not " |
1168 | connected, (connected == 1 ? "" : "s")); | 1155 | "suspend.\n", connected, (connected == 1 ? "" : "s")); |
1169 | ret = -EBUSY; | 1156 | ret = -EBUSY; |
1170 | } else { | 1157 | } else { |
1171 | usbip_uinfo("suspend vhci_hcd"); | 1158 | dev_info(&pdev->dev, "suspend vhci_hcd"); |
1172 | clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); | 1159 | clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); |
1173 | } | 1160 | } |
1174 | 1161 | ||
@@ -1230,13 +1217,9 @@ static int __init vhci_init(void) | |||
1230 | { | 1217 | { |
1231 | int ret; | 1218 | int ret; |
1232 | 1219 | ||
1233 | usbip_dbg_vhci_hc("enter\n"); | ||
1234 | if (usb_disabled()) | 1220 | if (usb_disabled()) |
1235 | return -ENODEV; | 1221 | return -ENODEV; |
1236 | 1222 | ||
1237 | printk(KERN_INFO KBUILD_MODNAME ": %s, %s\n", driver_name, | ||
1238 | USBIP_VERSION); | ||
1239 | |||
1240 | ret = platform_driver_register(&vhci_driver); | 1223 | ret = platform_driver_register(&vhci_driver); |
1241 | if (ret < 0) | 1224 | if (ret < 0) |
1242 | goto err_driver_register; | 1225 | goto err_driver_register; |
@@ -1245,25 +1228,19 @@ static int __init vhci_init(void) | |||
1245 | if (ret < 0) | 1228 | if (ret < 0) |
1246 | goto err_platform_device_register; | 1229 | goto err_platform_device_register; |
1247 | 1230 | ||
1248 | usbip_dbg_vhci_hc("bye\n"); | 1231 | pr_info(DRIVER_DESC " v" USBIP_VERSION "\n"); |
1249 | return ret; | 1232 | return ret; |
1250 | 1233 | ||
1251 | /* error occurred */ | ||
1252 | err_platform_device_register: | 1234 | err_platform_device_register: |
1253 | platform_driver_unregister(&vhci_driver); | 1235 | platform_driver_unregister(&vhci_driver); |
1254 | err_driver_register: | 1236 | err_driver_register: |
1255 | usbip_dbg_vhci_hc("bye\n"); | ||
1256 | return ret; | 1237 | return ret; |
1257 | } | 1238 | } |
1258 | 1239 | ||
1259 | static void __exit vhci_cleanup(void) | 1240 | static void __exit vhci_cleanup(void) |
1260 | { | 1241 | { |
1261 | usbip_dbg_vhci_hc("enter\n"); | ||
1262 | |||
1263 | platform_device_unregister(&the_pdev); | 1242 | platform_device_unregister(&the_pdev); |
1264 | platform_driver_unregister(&vhci_driver); | 1243 | platform_driver_unregister(&vhci_driver); |
1265 | |||
1266 | usbip_dbg_vhci_hc("bye\n"); | ||
1267 | } | 1244 | } |
1268 | 1245 | ||
1269 | module_init(vhci_init); | 1246 | module_init(vhci_init); |
diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c index 2fe6cbf6202f..e42ce9dab7ac 100644 --- a/drivers/staging/usbip/vhci_rx.c +++ b/drivers/staging/usbip/vhci_rx.c | |||
@@ -74,10 +74,9 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev, | |||
74 | spin_unlock(&vdev->priv_lock); | 74 | spin_unlock(&vdev->priv_lock); |
75 | 75 | ||
76 | if (!urb) { | 76 | if (!urb) { |
77 | usbip_uerr("cannot find a urb of seqnum %u\n", | 77 | pr_err("cannot find a urb of seqnum %u\n", pdu->base.seqnum); |
78 | pdu->base.seqnum); | 78 | pr_info("max seqnum %d\n", |
79 | usbip_uinfo("max seqnum %d\n", | 79 | atomic_read(&the_controller->seqnum)); |
80 | atomic_read(&the_controller->seqnum)); | ||
81 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); | 80 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); |
82 | return; | 81 | return; |
83 | } | 82 | } |
@@ -121,7 +120,7 @@ static struct vhci_unlink *dequeue_pending_unlink(struct vhci_device *vdev, | |||
121 | spin_lock(&vdev->priv_lock); | 120 | spin_lock(&vdev->priv_lock); |
122 | 121 | ||
123 | list_for_each_entry_safe(unlink, tmp, &vdev->unlink_rx, list) { | 122 | list_for_each_entry_safe(unlink, tmp, &vdev->unlink_rx, list) { |
124 | usbip_uinfo("unlink->seqnum %lu\n", unlink->seqnum); | 123 | pr_info("unlink->seqnum %lu\n", unlink->seqnum); |
125 | if (unlink->seqnum == pdu->base.seqnum) { | 124 | if (unlink->seqnum == pdu->base.seqnum) { |
126 | usbip_dbg_vhci_rx("found pending unlink, %lu\n", | 125 | usbip_dbg_vhci_rx("found pending unlink, %lu\n", |
127 | unlink->seqnum); | 126 | unlink->seqnum); |
@@ -147,8 +146,8 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev, | |||
147 | 146 | ||
148 | unlink = dequeue_pending_unlink(vdev, pdu); | 147 | unlink = dequeue_pending_unlink(vdev, pdu); |
149 | if (!unlink) { | 148 | if (!unlink) { |
150 | usbip_uinfo("cannot find the pending unlink %u\n", | 149 | pr_info("cannot find the pending unlink %u\n", |
151 | pdu->base.seqnum); | 150 | pdu->base.seqnum); |
152 | return; | 151 | return; |
153 | } | 152 | } |
154 | 153 | ||
@@ -162,14 +161,14 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev, | |||
162 | * already received the result of its submit result and gave | 161 | * already received the result of its submit result and gave |
163 | * back the URB. | 162 | * back the URB. |
164 | */ | 163 | */ |
165 | usbip_uinfo("the urb (seqnum %d) was already given backed\n", | 164 | pr_info("the urb (seqnum %d) was already given backed\n", |
166 | pdu->base.seqnum); | 165 | pdu->base.seqnum); |
167 | } else { | 166 | } else { |
168 | usbip_dbg_vhci_rx("now giveback urb %p\n", urb); | 167 | usbip_dbg_vhci_rx("now giveback urb %p\n", urb); |
169 | 168 | ||
170 | /* If unlink is succeed, status is -ECONNRESET */ | 169 | /* If unlink is succeed, status is -ECONNRESET */ |
171 | urb->status = pdu->u.ret_unlink.status; | 170 | urb->status = pdu->u.ret_unlink.status; |
172 | usbip_uinfo("%d\n", urb->status); | 171 | pr_info("urb->status %d\n", urb->status); |
173 | 172 | ||
174 | spin_lock(&the_controller->lock); | 173 | spin_lock(&the_controller->lock); |
175 | usb_hcd_unlink_urb_from_ep(vhci_to_hcd(the_controller), urb); | 174 | usb_hcd_unlink_urb_from_ep(vhci_to_hcd(the_controller), urb); |
@@ -210,26 +209,26 @@ static void vhci_rx_pdu(struct usbip_device *ud) | |||
210 | ret = usbip_xmit(0, ud->tcp_socket, (char *) &pdu, sizeof(pdu), 0); | 209 | ret = usbip_xmit(0, ud->tcp_socket, (char *) &pdu, sizeof(pdu), 0); |
211 | if (ret < 0) { | 210 | if (ret < 0) { |
212 | if (ret == -ECONNRESET) | 211 | if (ret == -ECONNRESET) |
213 | usbip_uinfo("connection reset by peer\n"); | 212 | pr_info("connection reset by peer\n"); |
214 | else if (ret == -EAGAIN) { | 213 | else if (ret == -EAGAIN) { |
215 | /* ignore if connection was idle */ | 214 | /* ignore if connection was idle */ |
216 | if (vhci_priv_tx_empty(vdev)) | 215 | if (vhci_priv_tx_empty(vdev)) |
217 | return; | 216 | return; |
218 | usbip_uinfo("connection timed out with pending urbs\n"); | 217 | pr_info("connection timed out with pending urbs\n"); |
219 | } else if (ret != -ERESTARTSYS) | 218 | } else if (ret != -ERESTARTSYS) |
220 | usbip_uinfo("xmit failed %d\n", ret); | 219 | pr_info("xmit failed %d\n", ret); |
221 | 220 | ||
222 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); | 221 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); |
223 | return; | 222 | return; |
224 | } | 223 | } |
225 | if (ret == 0) { | 224 | if (ret == 0) { |
226 | usbip_uinfo("connection closed"); | 225 | pr_info("connection closed"); |
227 | usbip_event_add(ud, VDEV_EVENT_DOWN); | 226 | usbip_event_add(ud, VDEV_EVENT_DOWN); |
228 | return; | 227 | return; |
229 | } | 228 | } |
230 | if (ret != sizeof(pdu)) { | 229 | if (ret != sizeof(pdu)) { |
231 | usbip_uerr("received pdu size is %d, should be %d\n", | 230 | pr_err("received pdu size is %d, should be %d\n", ret, |
232 | ret, (unsigned int)sizeof(pdu)); | 231 | (unsigned int)sizeof(pdu)); |
233 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); | 232 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); |
234 | return; | 233 | return; |
235 | } | 234 | } |
@@ -248,7 +247,7 @@ static void vhci_rx_pdu(struct usbip_device *ud) | |||
248 | break; | 247 | break; |
249 | default: | 248 | default: |
250 | /* NOT REACHED */ | 249 | /* NOT REACHED */ |
251 | usbip_uerr("unknown pdu %u\n", pdu.base.command); | 250 | pr_err("unknown pdu %u\n", pdu.base.command); |
252 | usbip_dump_header(&pdu); | 251 | usbip_dump_header(&pdu); |
253 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); | 252 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); |
254 | break; | 253 | break; |
diff --git a/drivers/staging/usbip/vhci_sysfs.c b/drivers/staging/usbip/vhci_sysfs.c index a684f225844d..68c7f0aae6e7 100644 --- a/drivers/staging/usbip/vhci_sysfs.c +++ b/drivers/staging/usbip/vhci_sysfs.c | |||
@@ -89,7 +89,7 @@ static int vhci_port_disconnect(__u32 rhport) | |||
89 | 89 | ||
90 | spin_lock(&vdev->ud.lock); | 90 | spin_lock(&vdev->ud.lock); |
91 | if (vdev->ud.status == VDEV_ST_NULL) { | 91 | if (vdev->ud.status == VDEV_ST_NULL) { |
92 | usbip_uerr("not connected %d\n", vdev->ud.status); | 92 | pr_err("not connected %d\n", vdev->ud.status); |
93 | 93 | ||
94 | /* unlock */ | 94 | /* unlock */ |
95 | spin_unlock(&vdev->ud.lock); | 95 | spin_unlock(&vdev->ud.lock); |
@@ -117,7 +117,7 @@ static ssize_t store_detach(struct device *dev, struct device_attribute *attr, | |||
117 | 117 | ||
118 | /* check rhport */ | 118 | /* check rhport */ |
119 | if (rhport >= VHCI_NPORTS) { | 119 | if (rhport >= VHCI_NPORTS) { |
120 | usbip_uerr("invalid port %u\n", rhport); | 120 | dev_err(dev, "invalid port %u\n", rhport); |
121 | return -EINVAL; | 121 | return -EINVAL; |
122 | } | 122 | } |
123 | 123 | ||
@@ -136,7 +136,7 @@ static int valid_args(__u32 rhport, enum usb_device_speed speed) | |||
136 | { | 136 | { |
137 | /* check rhport */ | 137 | /* check rhport */ |
138 | if ((rhport < 0) || (rhport >= VHCI_NPORTS)) { | 138 | if ((rhport < 0) || (rhport >= VHCI_NPORTS)) { |
139 | usbip_uerr("port %u\n", rhport); | 139 | pr_err("port %u\n", rhport); |
140 | return -EINVAL; | 140 | return -EINVAL; |
141 | } | 141 | } |
142 | 142 | ||
@@ -148,7 +148,7 @@ static int valid_args(__u32 rhport, enum usb_device_speed speed) | |||
148 | case USB_SPEED_WIRELESS: | 148 | case USB_SPEED_WIRELESS: |
149 | break; | 149 | break; |
150 | default: | 150 | default: |
151 | usbip_uerr("speed %d\n", speed); | 151 | pr_err("speed %d\n", speed); |
152 | return -EINVAL; | 152 | return -EINVAL; |
153 | } | 153 | } |
154 | 154 | ||
@@ -206,12 +206,12 @@ static ssize_t store_attach(struct device *dev, struct device_attribute *attr, | |||
206 | spin_unlock(&vdev->ud.lock); | 206 | spin_unlock(&vdev->ud.lock); |
207 | spin_unlock(&the_controller->lock); | 207 | spin_unlock(&the_controller->lock); |
208 | 208 | ||
209 | usbip_uerr("port %d already used\n", rhport); | 209 | dev_err(dev, "port %d already used\n", rhport); |
210 | return -EINVAL; | 210 | return -EINVAL; |
211 | } | 211 | } |
212 | 212 | ||
213 | usbip_uinfo("rhport(%u) sockfd(%d) devid(%u) speed(%u)\n", | 213 | dev_info(dev, "rhport(%u) sockfd(%d) devid(%u) speed(%u)\n", |
214 | rhport, sockfd, devid, speed); | 214 | rhport, sockfd, devid, speed); |
215 | 215 | ||
216 | vdev->devid = devid; | 216 | vdev->devid = devid; |
217 | vdev->speed = speed; | 217 | vdev->speed = speed; |
diff --git a/drivers/staging/usbip/vhci_tx.c b/drivers/staging/usbip/vhci_tx.c index c1aa03bf246d..9b437e7ef1a7 100644 --- a/drivers/staging/usbip/vhci_tx.c +++ b/drivers/staging/usbip/vhci_tx.c | |||
@@ -118,8 +118,8 @@ static int vhci_send_cmd_submit(struct vhci_device *vdev) | |||
118 | 118 | ||
119 | ret = kernel_sendmsg(vdev->ud.tcp_socket, &msg, iov, 3, txsize); | 119 | ret = kernel_sendmsg(vdev->ud.tcp_socket, &msg, iov, 3, txsize); |
120 | if (ret != txsize) { | 120 | if (ret != txsize) { |
121 | usbip_uerr("sendmsg failed!, retval %d for %zd\n", ret, | 121 | pr_err("sendmsg failed!, ret=%d for %zd\n", ret, |
122 | txsize); | 122 | txsize); |
123 | kfree(iso_buffer); | 123 | kfree(iso_buffer); |
124 | usbip_event_add(&vdev->ud, VDEV_EVENT_ERROR_TCP); | 124 | usbip_event_add(&vdev->ud, VDEV_EVENT_ERROR_TCP); |
125 | return -1; | 125 | return -1; |
@@ -188,8 +188,8 @@ static int vhci_send_cmd_unlink(struct vhci_device *vdev) | |||
188 | 188 | ||
189 | ret = kernel_sendmsg(vdev->ud.tcp_socket, &msg, iov, 1, txsize); | 189 | ret = kernel_sendmsg(vdev->ud.tcp_socket, &msg, iov, 1, txsize); |
190 | if (ret != txsize) { | 190 | if (ret != txsize) { |
191 | usbip_uerr("sendmsg failed!, retval %d for %zd\n", ret, | 191 | pr_err("sendmsg failed!, ret=%d for %zd\n", ret, |
192 | txsize); | 192 | txsize); |
193 | usbip_event_add(&vdev->ud, VDEV_EVENT_ERROR_TCP); | 193 | usbip_event_add(&vdev->ud, VDEV_EVENT_ERROR_TCP); |
194 | return -1; | 194 | return -1; |
195 | } | 195 | } |