diff options
author | Steve French <sfrench@us.ibm.com> | 2011-12-16 01:39:20 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-12-16 01:39:20 -0500 |
commit | aaf015890754d58dcb71a4aa44ed246bb082bcf6 (patch) | |
tree | 17b51ff707fd1b3efec3a3ab872f0d7a7416aca5 /drivers/usb/renesas_usbhs | |
parent | 9c32c63bb70b2fafc3b18bee29959c3bf245ceba (diff) | |
parent | 8def5f51b012efb00e77ba2d04696cc0aadd0609 (diff) |
Merge branch 'master' of git+ssh://git.samba.org/data/git/sfrench/cifs-2.6
Diffstat (limited to 'drivers/usb/renesas_usbhs')
-rw-r--r-- | drivers/usb/renesas_usbhs/common.c | 2 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/fifo.c | 4 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/mod.h | 8 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/mod_gadget.c | 51 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/mod_host.c | 63 |
5 files changed, 68 insertions, 60 deletions
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index d2e2efaba658..08c679c0dde5 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c | |||
@@ -405,7 +405,7 @@ int usbhsc_drvcllbck_notify_hotplug(struct platform_device *pdev) | |||
405 | /* | 405 | /* |
406 | * platform functions | 406 | * platform functions |
407 | */ | 407 | */ |
408 | static int __devinit usbhs_probe(struct platform_device *pdev) | 408 | static int usbhs_probe(struct platform_device *pdev) |
409 | { | 409 | { |
410 | struct renesas_usbhs_platform_info *info = pdev->dev.platform_data; | 410 | struct renesas_usbhs_platform_info *info = pdev->dev.platform_data; |
411 | struct renesas_usbhs_driver_callback *dfunc; | 411 | struct renesas_usbhs_driver_callback *dfunc; |
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index 8da685e796d1..ffdf5d15085e 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c | |||
@@ -820,7 +820,7 @@ static int usbhsf_dma_prepare_push(struct usbhs_pkt *pkt, int *is_done) | |||
820 | if (len % 4) /* 32bit alignment */ | 820 | if (len % 4) /* 32bit alignment */ |
821 | goto usbhsf_pio_prepare_push; | 821 | goto usbhsf_pio_prepare_push; |
822 | 822 | ||
823 | if ((*(u32 *) pkt->buf + pkt->actual) & 0x7) /* 8byte alignment */ | 823 | if ((uintptr_t)(pkt->buf + pkt->actual) & 0x7) /* 8byte alignment */ |
824 | goto usbhsf_pio_prepare_push; | 824 | goto usbhsf_pio_prepare_push; |
825 | 825 | ||
826 | /* get enable DMA fifo */ | 826 | /* get enable DMA fifo */ |
@@ -897,7 +897,7 @@ static int usbhsf_dma_try_pop(struct usbhs_pkt *pkt, int *is_done) | |||
897 | if (!fifo) | 897 | if (!fifo) |
898 | goto usbhsf_pio_prepare_pop; | 898 | goto usbhsf_pio_prepare_pop; |
899 | 899 | ||
900 | if ((*(u32 *) pkt->buf + pkt->actual) & 0x7) /* 8byte alignment */ | 900 | if ((uintptr_t)(pkt->buf + pkt->actual) & 0x7) /* 8byte alignment */ |
901 | goto usbhsf_pio_prepare_pop; | 901 | goto usbhsf_pio_prepare_pop; |
902 | 902 | ||
903 | ret = usbhsf_fifo_select(pipe, fifo, 0); | 903 | ret = usbhsf_fifo_select(pipe, fifo, 0); |
diff --git a/drivers/usb/renesas_usbhs/mod.h b/drivers/usb/renesas_usbhs/mod.h index 8ae3733031cd..6c6875533f01 100644 --- a/drivers/usb/renesas_usbhs/mod.h +++ b/drivers/usb/renesas_usbhs/mod.h | |||
@@ -143,8 +143,8 @@ void usbhs_irq_callback_update(struct usbhs_priv *priv, struct usbhs_mod *mod); | |||
143 | */ | 143 | */ |
144 | #if defined(CONFIG_USB_RENESAS_USBHS_HCD) || \ | 144 | #if defined(CONFIG_USB_RENESAS_USBHS_HCD) || \ |
145 | defined(CONFIG_USB_RENESAS_USBHS_HCD_MODULE) | 145 | defined(CONFIG_USB_RENESAS_USBHS_HCD_MODULE) |
146 | extern int __devinit usbhs_mod_host_probe(struct usbhs_priv *priv); | 146 | extern int usbhs_mod_host_probe(struct usbhs_priv *priv); |
147 | extern int __devexit usbhs_mod_host_remove(struct usbhs_priv *priv); | 147 | extern int usbhs_mod_host_remove(struct usbhs_priv *priv); |
148 | #else | 148 | #else |
149 | static inline int usbhs_mod_host_probe(struct usbhs_priv *priv) | 149 | static inline int usbhs_mod_host_probe(struct usbhs_priv *priv) |
150 | { | 150 | { |
@@ -157,8 +157,8 @@ static inline void usbhs_mod_host_remove(struct usbhs_priv *priv) | |||
157 | 157 | ||
158 | #if defined(CONFIG_USB_RENESAS_USBHS_UDC) || \ | 158 | #if defined(CONFIG_USB_RENESAS_USBHS_UDC) || \ |
159 | defined(CONFIG_USB_RENESAS_USBHS_UDC_MODULE) | 159 | defined(CONFIG_USB_RENESAS_USBHS_UDC_MODULE) |
160 | extern int __devinit usbhs_mod_gadget_probe(struct usbhs_priv *priv); | 160 | extern int usbhs_mod_gadget_probe(struct usbhs_priv *priv); |
161 | extern void __devexit usbhs_mod_gadget_remove(struct usbhs_priv *priv); | 161 | extern void usbhs_mod_gadget_remove(struct usbhs_priv *priv); |
162 | #else | 162 | #else |
163 | static inline int usbhs_mod_gadget_probe(struct usbhs_priv *priv) | 163 | static inline int usbhs_mod_gadget_probe(struct usbhs_priv *priv) |
164 | { | 164 | { |
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index 4cc7ee0babc6..7f4e80338570 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c | |||
@@ -751,53 +751,32 @@ static int usbhsg_gadget_start(struct usb_gadget *gadget, | |||
751 | struct usb_gadget_driver *driver) | 751 | struct usb_gadget_driver *driver) |
752 | { | 752 | { |
753 | struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); | 753 | struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); |
754 | struct usbhs_priv *priv; | 754 | struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); |
755 | struct device *dev; | ||
756 | int ret; | ||
757 | 755 | ||
758 | if (!driver || | 756 | if (!driver || |
759 | !driver->setup || | 757 | !driver->setup || |
760 | driver->speed != USB_SPEED_HIGH) | 758 | driver->speed < USB_SPEED_FULL) |
761 | return -EINVAL; | 759 | return -EINVAL; |
762 | 760 | ||
763 | dev = usbhsg_gpriv_to_dev(gpriv); | ||
764 | priv = usbhsg_gpriv_to_priv(gpriv); | ||
765 | |||
766 | /* first hook up the driver ... */ | 761 | /* first hook up the driver ... */ |
767 | gpriv->driver = driver; | 762 | gpriv->driver = driver; |
768 | gpriv->gadget.dev.driver = &driver->driver; | 763 | gpriv->gadget.dev.driver = &driver->driver; |
769 | 764 | ||
770 | ret = device_add(&gpriv->gadget.dev); | ||
771 | if (ret) { | ||
772 | dev_err(dev, "device_add error %d\n", ret); | ||
773 | goto add_fail; | ||
774 | } | ||
775 | |||
776 | return usbhsg_try_start(priv, USBHSG_STATUS_REGISTERD); | 765 | return usbhsg_try_start(priv, USBHSG_STATUS_REGISTERD); |
777 | |||
778 | add_fail: | ||
779 | gpriv->driver = NULL; | ||
780 | gpriv->gadget.dev.driver = NULL; | ||
781 | |||
782 | return ret; | ||
783 | } | 766 | } |
784 | 767 | ||
785 | static int usbhsg_gadget_stop(struct usb_gadget *gadget, | 768 | static int usbhsg_gadget_stop(struct usb_gadget *gadget, |
786 | struct usb_gadget_driver *driver) | 769 | struct usb_gadget_driver *driver) |
787 | { | 770 | { |
788 | struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); | 771 | struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); |
789 | struct usbhs_priv *priv; | 772 | struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); |
790 | struct device *dev; | ||
791 | 773 | ||
792 | if (!driver || | 774 | if (!driver || |
793 | !driver->unbind) | 775 | !driver->unbind) |
794 | return -EINVAL; | 776 | return -EINVAL; |
795 | 777 | ||
796 | dev = usbhsg_gpriv_to_dev(gpriv); | ||
797 | priv = usbhsg_gpriv_to_priv(gpriv); | ||
798 | |||
799 | usbhsg_try_stop(priv, USBHSG_STATUS_REGISTERD); | 778 | usbhsg_try_stop(priv, USBHSG_STATUS_REGISTERD); |
800 | device_del(&gpriv->gadget.dev); | 779 | gpriv->gadget.dev.driver = NULL; |
801 | gpriv->driver = NULL; | 780 | gpriv->driver = NULL; |
802 | 781 | ||
803 | return 0; | 782 | return 0; |
@@ -827,10 +806,17 @@ static int usbhsg_start(struct usbhs_priv *priv) | |||
827 | 806 | ||
828 | static int usbhsg_stop(struct usbhs_priv *priv) | 807 | static int usbhsg_stop(struct usbhs_priv *priv) |
829 | { | 808 | { |
809 | struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); | ||
810 | |||
811 | /* cable disconnect */ | ||
812 | if (gpriv->driver && | ||
813 | gpriv->driver->disconnect) | ||
814 | gpriv->driver->disconnect(&gpriv->gadget); | ||
815 | |||
830 | return usbhsg_try_stop(priv, USBHSG_STATUS_STARTED); | 816 | return usbhsg_try_stop(priv, USBHSG_STATUS_STARTED); |
831 | } | 817 | } |
832 | 818 | ||
833 | int __devinit usbhs_mod_gadget_probe(struct usbhs_priv *priv) | 819 | int usbhs_mod_gadget_probe(struct usbhs_priv *priv) |
834 | { | 820 | { |
835 | struct usbhsg_gpriv *gpriv; | 821 | struct usbhsg_gpriv *gpriv; |
836 | struct usbhsg_uep *uep; | 822 | struct usbhsg_uep *uep; |
@@ -876,12 +862,14 @@ int __devinit usbhs_mod_gadget_probe(struct usbhs_priv *priv) | |||
876 | /* | 862 | /* |
877 | * init gadget | 863 | * init gadget |
878 | */ | 864 | */ |
879 | device_initialize(&gpriv->gadget.dev); | ||
880 | dev_set_name(&gpriv->gadget.dev, "gadget"); | 865 | dev_set_name(&gpriv->gadget.dev, "gadget"); |
881 | gpriv->gadget.dev.parent = dev; | 866 | gpriv->gadget.dev.parent = dev; |
882 | gpriv->gadget.name = "renesas_usbhs_udc"; | 867 | gpriv->gadget.name = "renesas_usbhs_udc"; |
883 | gpriv->gadget.ops = &usbhsg_gadget_ops; | 868 | gpriv->gadget.ops = &usbhsg_gadget_ops; |
884 | gpriv->gadget.is_dualspeed = 1; | 869 | gpriv->gadget.is_dualspeed = 1; |
870 | ret = device_register(&gpriv->gadget.dev); | ||
871 | if (ret < 0) | ||
872 | goto err_add_udc; | ||
885 | 873 | ||
886 | INIT_LIST_HEAD(&gpriv->gadget.ep_list); | 874 | INIT_LIST_HEAD(&gpriv->gadget.ep_list); |
887 | 875 | ||
@@ -912,12 +900,15 @@ int __devinit usbhs_mod_gadget_probe(struct usbhs_priv *priv) | |||
912 | 900 | ||
913 | ret = usb_add_gadget_udc(dev, &gpriv->gadget); | 901 | ret = usb_add_gadget_udc(dev, &gpriv->gadget); |
914 | if (ret) | 902 | if (ret) |
915 | goto err_add_udc; | 903 | goto err_register; |
916 | 904 | ||
917 | 905 | ||
918 | dev_info(dev, "gadget probed\n"); | 906 | dev_info(dev, "gadget probed\n"); |
919 | 907 | ||
920 | return 0; | 908 | return 0; |
909 | |||
910 | err_register: | ||
911 | device_unregister(&gpriv->gadget.dev); | ||
921 | err_add_udc: | 912 | err_add_udc: |
922 | kfree(gpriv->uep); | 913 | kfree(gpriv->uep); |
923 | 914 | ||
@@ -927,12 +918,14 @@ usbhs_mod_gadget_probe_err_gpriv: | |||
927 | return ret; | 918 | return ret; |
928 | } | 919 | } |
929 | 920 | ||
930 | void __devexit usbhs_mod_gadget_remove(struct usbhs_priv *priv) | 921 | void usbhs_mod_gadget_remove(struct usbhs_priv *priv) |
931 | { | 922 | { |
932 | struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); | 923 | struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); |
933 | 924 | ||
934 | usb_del_gadget_udc(&gpriv->gadget); | 925 | usb_del_gadget_udc(&gpriv->gadget); |
935 | 926 | ||
927 | device_unregister(&gpriv->gadget.dev); | ||
928 | |||
936 | usbhsg_controller_unregister(gpriv); | 929 | usbhsg_controller_unregister(gpriv); |
937 | 930 | ||
938 | kfree(gpriv->uep); | 931 | kfree(gpriv->uep); |
diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c index 1a7208a50afc..bade761a1e52 100644 --- a/drivers/usb/renesas_usbhs/mod_host.c +++ b/drivers/usb/renesas_usbhs/mod_host.c | |||
@@ -103,7 +103,7 @@ struct usbhsh_hpriv { | |||
103 | 103 | ||
104 | u32 port_stat; /* USB_PORT_STAT_xxx */ | 104 | u32 port_stat; /* USB_PORT_STAT_xxx */ |
105 | 105 | ||
106 | struct completion *done; | 106 | struct completion setup_ack_done; |
107 | 107 | ||
108 | /* see usbhsh_req_alloc/free */ | 108 | /* see usbhsh_req_alloc/free */ |
109 | struct list_head ureq_link_active; | 109 | struct list_head ureq_link_active; |
@@ -355,6 +355,7 @@ static void usbhsh_device_free(struct usbhsh_hpriv *hpriv, | |||
355 | struct usbhsh_ep *usbhsh_endpoint_alloc(struct usbhsh_hpriv *hpriv, | 355 | struct usbhsh_ep *usbhsh_endpoint_alloc(struct usbhsh_hpriv *hpriv, |
356 | struct usbhsh_device *udev, | 356 | struct usbhsh_device *udev, |
357 | struct usb_host_endpoint *ep, | 357 | struct usb_host_endpoint *ep, |
358 | int dir_in_req, | ||
358 | gfp_t mem_flags) | 359 | gfp_t mem_flags) |
359 | { | 360 | { |
360 | struct usbhs_priv *priv = usbhsh_hpriv_to_priv(hpriv); | 361 | struct usbhs_priv *priv = usbhsh_hpriv_to_priv(hpriv); |
@@ -364,27 +365,38 @@ struct usbhsh_ep *usbhsh_endpoint_alloc(struct usbhsh_hpriv *hpriv, | |||
364 | struct usbhs_pipe *pipe, *best_pipe; | 365 | struct usbhs_pipe *pipe, *best_pipe; |
365 | struct device *dev = usbhsh_hcd_to_dev(hcd); | 366 | struct device *dev = usbhsh_hcd_to_dev(hcd); |
366 | struct usb_endpoint_descriptor *desc = &ep->desc; | 367 | struct usb_endpoint_descriptor *desc = &ep->desc; |
367 | int type, i; | 368 | int type, i, dir_in; |
368 | unsigned int min_usr; | 369 | unsigned int min_usr; |
369 | 370 | ||
371 | dir_in_req = !!dir_in_req; | ||
372 | |||
370 | uep = kzalloc(sizeof(struct usbhsh_ep), mem_flags); | 373 | uep = kzalloc(sizeof(struct usbhsh_ep), mem_flags); |
371 | if (!uep) { | 374 | if (!uep) { |
372 | dev_err(dev, "usbhsh_ep alloc fail\n"); | 375 | dev_err(dev, "usbhsh_ep alloc fail\n"); |
373 | return NULL; | 376 | return NULL; |
374 | } | 377 | } |
375 | type = usb_endpoint_type(desc); | 378 | |
379 | if (usb_endpoint_xfer_control(desc)) { | ||
380 | best_pipe = usbhsh_hpriv_to_dcp(hpriv); | ||
381 | goto usbhsh_endpoint_alloc_find_pipe; | ||
382 | } | ||
376 | 383 | ||
377 | /* | 384 | /* |
378 | * find best pipe for endpoint | 385 | * find best pipe for endpoint |
379 | * see | 386 | * see |
380 | * HARDWARE LIMITATION | 387 | * HARDWARE LIMITATION |
381 | */ | 388 | */ |
389 | type = usb_endpoint_type(desc); | ||
382 | min_usr = ~0; | 390 | min_usr = ~0; |
383 | best_pipe = NULL; | 391 | best_pipe = NULL; |
384 | usbhs_for_each_pipe_with_dcp(pipe, priv, i) { | 392 | usbhs_for_each_pipe(pipe, priv, i) { |
385 | if (!usbhs_pipe_type_is(pipe, type)) | 393 | if (!usbhs_pipe_type_is(pipe, type)) |
386 | continue; | 394 | continue; |
387 | 395 | ||
396 | dir_in = !!usbhs_pipe_is_dir_in(pipe); | ||
397 | if (0 != (dir_in - dir_in_req)) | ||
398 | continue; | ||
399 | |||
388 | info = usbhsh_pipe_info(pipe); | 400 | info = usbhsh_pipe_info(pipe); |
389 | 401 | ||
390 | if (min_usr > info->usr_cnt) { | 402 | if (min_usr > info->usr_cnt) { |
@@ -398,7 +410,7 @@ struct usbhsh_ep *usbhsh_endpoint_alloc(struct usbhsh_hpriv *hpriv, | |||
398 | kfree(uep); | 410 | kfree(uep); |
399 | return NULL; | 411 | return NULL; |
400 | } | 412 | } |
401 | 413 | usbhsh_endpoint_alloc_find_pipe: | |
402 | /* | 414 | /* |
403 | * init uep | 415 | * init uep |
404 | */ | 416 | */ |
@@ -423,6 +435,7 @@ struct usbhsh_ep *usbhsh_endpoint_alloc(struct usbhsh_hpriv *hpriv, | |||
423 | * see | 435 | * see |
424 | * DCPMAXP/PIPEMAXP | 436 | * DCPMAXP/PIPEMAXP |
425 | */ | 437 | */ |
438 | usbhs_pipe_sequence_data0(uep->pipe); | ||
426 | usbhs_pipe_config_update(uep->pipe, | 439 | usbhs_pipe_config_update(uep->pipe, |
427 | usbhsh_device_number(hpriv, udev), | 440 | usbhsh_device_number(hpriv, udev), |
428 | usb_endpoint_num(desc), | 441 | usb_endpoint_num(desc), |
@@ -430,7 +443,7 @@ struct usbhsh_ep *usbhsh_endpoint_alloc(struct usbhsh_hpriv *hpriv, | |||
430 | 443 | ||
431 | dev_dbg(dev, "%s [%d-%s](%p)\n", __func__, | 444 | dev_dbg(dev, "%s [%d-%s](%p)\n", __func__, |
432 | usbhsh_device_number(hpriv, udev), | 445 | usbhsh_device_number(hpriv, udev), |
433 | usbhs_pipe_name(pipe), uep); | 446 | usbhs_pipe_name(uep->pipe), uep); |
434 | 447 | ||
435 | return uep; | 448 | return uep; |
436 | } | 449 | } |
@@ -549,8 +562,7 @@ static void usbhsh_setup_stage_packet_push(struct usbhsh_hpriv *hpriv, | |||
549 | * usbhsh_irq_setup_ack() | 562 | * usbhsh_irq_setup_ack() |
550 | * usbhsh_irq_setup_err() | 563 | * usbhsh_irq_setup_err() |
551 | */ | 564 | */ |
552 | DECLARE_COMPLETION(done); | 565 | init_completion(&hpriv->setup_ack_done); |
553 | hpriv->done = &done; | ||
554 | 566 | ||
555 | /* copy original request */ | 567 | /* copy original request */ |
556 | memcpy(&req, urb->setup_packet, sizeof(struct usb_ctrlrequest)); | 568 | memcpy(&req, urb->setup_packet, sizeof(struct usb_ctrlrequest)); |
@@ -572,8 +584,7 @@ static void usbhsh_setup_stage_packet_push(struct usbhsh_hpriv *hpriv, | |||
572 | /* | 584 | /* |
573 | * wait setup packet ACK | 585 | * wait setup packet ACK |
574 | */ | 586 | */ |
575 | wait_for_completion(&done); | 587 | wait_for_completion(&hpriv->setup_ack_done); |
576 | hpriv->done = NULL; | ||
577 | 588 | ||
578 | dev_dbg(dev, "%s done\n", __func__); | 589 | dev_dbg(dev, "%s done\n", __func__); |
579 | } | 590 | } |
@@ -724,11 +735,11 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd, | |||
724 | struct usbhsh_device *udev, *new_udev = NULL; | 735 | struct usbhsh_device *udev, *new_udev = NULL; |
725 | struct usbhs_pipe *pipe; | 736 | struct usbhs_pipe *pipe; |
726 | struct usbhsh_ep *uep; | 737 | struct usbhsh_ep *uep; |
738 | int is_dir_in = usb_pipein(urb->pipe); | ||
727 | 739 | ||
728 | int ret; | 740 | int ret; |
729 | 741 | ||
730 | dev_dbg(dev, "%s (%s)\n", | 742 | dev_dbg(dev, "%s (%s)\n", __func__, is_dir_in ? "in" : "out"); |
731 | __func__, usb_pipein(urb->pipe) ? "in" : "out"); | ||
732 | 743 | ||
733 | ret = usb_hcd_link_urb_to_ep(hcd, urb); | 744 | ret = usb_hcd_link_urb_to_ep(hcd, urb); |
734 | if (ret) | 745 | if (ret) |
@@ -751,7 +762,8 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd, | |||
751 | */ | 762 | */ |
752 | uep = usbhsh_ep_to_uep(ep); | 763 | uep = usbhsh_ep_to_uep(ep); |
753 | if (!uep) { | 764 | if (!uep) { |
754 | uep = usbhsh_endpoint_alloc(hpriv, udev, ep, mem_flags); | 765 | uep = usbhsh_endpoint_alloc(hpriv, udev, ep, |
766 | is_dir_in, mem_flags); | ||
755 | if (!uep) | 767 | if (!uep) |
756 | goto usbhsh_urb_enqueue_error_free_device; | 768 | goto usbhsh_urb_enqueue_error_free_device; |
757 | } | 769 | } |
@@ -1095,10 +1107,7 @@ static int usbhsh_irq_setup_ack(struct usbhs_priv *priv, | |||
1095 | 1107 | ||
1096 | dev_dbg(dev, "setup packet OK\n"); | 1108 | dev_dbg(dev, "setup packet OK\n"); |
1097 | 1109 | ||
1098 | if (unlikely(!hpriv->done)) | 1110 | complete(&hpriv->setup_ack_done); /* see usbhsh_urb_enqueue() */ |
1099 | dev_err(dev, "setup ack happen without necessary data\n"); | ||
1100 | else | ||
1101 | complete(hpriv->done); /* see usbhsh_urb_enqueue() */ | ||
1102 | 1111 | ||
1103 | return 0; | 1112 | return 0; |
1104 | } | 1113 | } |
@@ -1111,10 +1120,7 @@ static int usbhsh_irq_setup_err(struct usbhs_priv *priv, | |||
1111 | 1120 | ||
1112 | dev_dbg(dev, "setup packet Err\n"); | 1121 | dev_dbg(dev, "setup packet Err\n"); |
1113 | 1122 | ||
1114 | if (unlikely(!hpriv->done)) | 1123 | complete(&hpriv->setup_ack_done); /* see usbhsh_urb_enqueue() */ |
1115 | dev_err(dev, "setup err happen without necessary data\n"); | ||
1116 | else | ||
1117 | complete(hpriv->done); /* see usbhsh_urb_enqueue() */ | ||
1118 | 1124 | ||
1119 | return 0; | 1125 | return 0; |
1120 | } | 1126 | } |
@@ -1221,8 +1227,18 @@ static int usbhsh_stop(struct usbhs_priv *priv) | |||
1221 | { | 1227 | { |
1222 | struct usbhsh_hpriv *hpriv = usbhsh_priv_to_hpriv(priv); | 1228 | struct usbhsh_hpriv *hpriv = usbhsh_priv_to_hpriv(priv); |
1223 | struct usb_hcd *hcd = usbhsh_hpriv_to_hcd(hpriv); | 1229 | struct usb_hcd *hcd = usbhsh_hpriv_to_hcd(hpriv); |
1230 | struct usbhs_mod *mod = usbhs_mod_get_current(priv); | ||
1224 | struct device *dev = usbhs_priv_to_dev(priv); | 1231 | struct device *dev = usbhs_priv_to_dev(priv); |
1225 | 1232 | ||
1233 | /* | ||
1234 | * disable irq callback | ||
1235 | */ | ||
1236 | mod->irq_attch = NULL; | ||
1237 | mod->irq_dtch = NULL; | ||
1238 | mod->irq_sack = NULL; | ||
1239 | mod->irq_sign = NULL; | ||
1240 | usbhs_irq_callback_update(priv, mod); | ||
1241 | |||
1226 | usb_remove_hcd(hcd); | 1242 | usb_remove_hcd(hcd); |
1227 | 1243 | ||
1228 | /* disable sys */ | 1244 | /* disable sys */ |
@@ -1235,7 +1251,7 @@ static int usbhsh_stop(struct usbhs_priv *priv) | |||
1235 | return 0; | 1251 | return 0; |
1236 | } | 1252 | } |
1237 | 1253 | ||
1238 | int __devinit usbhs_mod_host_probe(struct usbhs_priv *priv) | 1254 | int usbhs_mod_host_probe(struct usbhs_priv *priv) |
1239 | { | 1255 | { |
1240 | struct usbhsh_hpriv *hpriv; | 1256 | struct usbhsh_hpriv *hpriv; |
1241 | struct usb_hcd *hcd; | 1257 | struct usb_hcd *hcd; |
@@ -1279,7 +1295,6 @@ int __devinit usbhs_mod_host_probe(struct usbhs_priv *priv) | |||
1279 | hpriv->mod.stop = usbhsh_stop; | 1295 | hpriv->mod.stop = usbhsh_stop; |
1280 | hpriv->pipe_info = pipe_info; | 1296 | hpriv->pipe_info = pipe_info; |
1281 | hpriv->pipe_size = pipe_size; | 1297 | hpriv->pipe_size = pipe_size; |
1282 | hpriv->done = NULL; | ||
1283 | usbhsh_req_list_init(hpriv); | 1298 | usbhsh_req_list_init(hpriv); |
1284 | usbhsh_port_stat_init(hpriv); | 1299 | usbhsh_port_stat_init(hpriv); |
1285 | 1300 | ||
@@ -1299,7 +1314,7 @@ usbhs_mod_host_probe_err: | |||
1299 | return -ENOMEM; | 1314 | return -ENOMEM; |
1300 | } | 1315 | } |
1301 | 1316 | ||
1302 | int __devexit usbhs_mod_host_remove(struct usbhs_priv *priv) | 1317 | int usbhs_mod_host_remove(struct usbhs_priv *priv) |
1303 | { | 1318 | { |
1304 | struct usbhsh_hpriv *hpriv = usbhsh_priv_to_hpriv(priv); | 1319 | struct usbhsh_hpriv *hpriv = usbhsh_priv_to_hpriv(priv); |
1305 | struct usb_hcd *hcd = usbhsh_hpriv_to_hcd(hpriv); | 1320 | struct usb_hcd *hcd = usbhsh_hpriv_to_hcd(hpriv); |