Lines 34-39
Link Here
|
34 |
#include <linux/module.h> |
34 |
#include <linux/module.h> |
35 |
#include <linux/usb.h> |
35 |
#include <linux/usb.h> |
36 |
#include <linux/kthread.h> |
36 |
#include <linux/kthread.h> |
|
|
37 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
38 |
#include <linux/slab.h> |
39 |
#endif |
37 |
#include <asm/byteorder.h> |
40 |
#include <asm/byteorder.h> |
38 |
#include <asm/atomic.h> |
41 |
#include <asm/atomic.h> |
39 |
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) ) |
42 |
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) ) |
Lines 367-373
Link Here
|
367 |
{ |
370 |
{ |
368 |
if (ep->urb) { |
371 |
if (ep->urb) { |
369 |
if (ep->urb->transfer_buffer) { |
372 |
if (ep->urb->transfer_buffer) { |
|
|
373 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
374 |
usb_free_coherent(ep->umidi->chip->dev, |
375 |
#else |
370 |
usb_buffer_free(ep->umidi->chip->dev, |
376 |
usb_buffer_free(ep->umidi->chip->dev, |
|
|
377 |
#endif |
371 |
ep->urb->transfer_buffer_length, |
378 |
ep->urb->transfer_buffer_length, |
372 |
ep->urb->transfer_buffer, |
379 |
ep->urb->transfer_buffer, |
373 |
ep->urb->transfer_dma); |
380 |
ep->urb->transfer_dma); |
Lines 503-512
Link Here
|
503 |
pipe = usb_rcvbulkpipe(umidi->chip->dev, ep_info->in_ep); |
510 |
pipe = usb_rcvbulkpipe(umidi->chip->dev, ep_info->in_ep); |
504 |
} |
511 |
} |
505 |
length = usb_maxpacket(umidi->chip->dev, pipe, 0); |
512 |
length = usb_maxpacket(umidi->chip->dev, pipe, 0); |
|
|
513 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
514 |
buffer = usb_alloc_coherent(umidi->chip->dev, length, GFP_KERNEL, |
515 |
#else |
506 |
buffer = usb_buffer_alloc(umidi->chip->dev, length, GFP_KERNEL, |
516 |
buffer = usb_buffer_alloc(umidi->chip->dev, length, GFP_KERNEL, |
|
|
517 |
#endif |
507 |
&ep->urb->transfer_dma); |
518 |
&ep->urb->transfer_dma); |
508 |
if (!buffer) { |
519 |
if (!buffer) { |
|
|
520 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
521 |
snd_printk(KERN_WARNING"%s() usb_alloc_coherent failed\n",__FUNCTION__); |
522 |
#else |
509 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc failed\n",__FUNCTION__); |
523 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc failed\n",__FUNCTION__); |
|
|
524 |
#endif |
510 |
snd_hdjmidi_in_endpoint_delete(ep); |
525 |
snd_hdjmidi_in_endpoint_delete(ep); |
511 |
return -ENOMEM; |
526 |
return -ENOMEM; |
512 |
} |
527 |
} |
Lines 536-542
Link Here
|
536 |
#endif |
551 |
#endif |
537 |
if (ep->urb) { |
552 |
if (ep->urb) { |
538 |
if (ep->urb->transfer_buffer) { |
553 |
if (ep->urb->transfer_buffer) { |
|
|
554 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
555 |
usb_free_coherent(ep->umidi->chip->dev, ep->max_transfer, |
556 |
#else |
539 |
usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, |
557 |
usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, |
|
|
558 |
#endif |
540 |
ep->urb->transfer_buffer, |
559 |
ep->urb->transfer_buffer, |
541 |
ep->urb->transfer_dma); |
560 |
ep->urb->transfer_dma); |
542 |
} |
561 |
} |
Lines 544-570
Link Here
|
544 |
} |
563 |
} |
545 |
if (ep->urb_led) { |
564 |
if (ep->urb_led) { |
546 |
if (ep->urb_led->transfer_buffer) { |
565 |
if (ep->urb_led->transfer_buffer) { |
|
|
566 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
567 |
usb_free_coherent(ep->umidi->chip->dev, ep->max_transfer, |
568 |
#else |
547 |
usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, |
569 |
usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, |
|
|
570 |
#endif |
548 |
ep->urb_led->transfer_buffer, |
571 |
ep->urb_led->transfer_buffer, |
549 |
ep->urb_led->transfer_dma); |
572 |
ep->urb_led->transfer_dma); |
550 |
} |
573 |
} |
551 |
usb_free_urb(ep->urb_led); |
574 |
usb_free_urb(ep->urb_led); |
552 |
} |
575 |
} |
553 |
if (ep->ctrl_req_led) { |
576 |
if (ep->ctrl_req_led) { |
|
|
577 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
578 |
usb_free_coherent(ep->umidi->chip->dev, sizeof(*(ep->ctrl_req_led)), |
579 |
#else |
554 |
usb_buffer_free(ep->umidi->chip->dev, sizeof(*(ep->ctrl_req_led)), |
580 |
usb_buffer_free(ep->umidi->chip->dev, sizeof(*(ep->ctrl_req_led)), |
|
|
581 |
#endif |
555 |
ep->ctrl_req_led, ep->ctrl_req_led_dma); |
582 |
ep->ctrl_req_led, ep->ctrl_req_led_dma); |
556 |
} |
583 |
} |
557 |
if (ep->controller_state) { |
584 |
if (ep->controller_state) { |
558 |
if (ep->controller_state->output_control_ctl_urb && |
585 |
if (ep->controller_state->output_control_ctl_urb && |
559 |
ep->controller_state->output_control_ctl_urb->transfer_buffer && |
586 |
ep->controller_state->output_control_ctl_urb->transfer_buffer && |
560 |
ep->controller_state->output_control_ctl_urb->transfer_dma) { |
587 |
ep->controller_state->output_control_ctl_urb->transfer_dma) { |
|
|
588 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
589 |
usb_free_coherent(ep->umidi->chip->dev, ep->max_transfer, |
590 |
#else |
561 |
usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, |
591 |
usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, |
|
|
592 |
#endif |
562 |
ep->controller_state->output_control_ctl_urb->transfer_buffer, |
593 |
ep->controller_state->output_control_ctl_urb->transfer_buffer, |
563 |
ep->controller_state->output_control_ctl_urb->transfer_dma); |
594 |
ep->controller_state->output_control_ctl_urb->transfer_dma); |
564 |
} |
595 |
} |
565 |
if (ep->controller_state->output_control_ctl_req && |
596 |
if (ep->controller_state->output_control_ctl_req && |
566 |
ep->controller_state->output_control_ctl_dma) { |
597 |
ep->controller_state->output_control_ctl_dma) { |
|
|
598 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
599 |
usb_free_coherent(ep->umidi->chip->dev, |
600 |
#else |
567 |
usb_buffer_free(ep->umidi->chip->dev, |
601 |
usb_buffer_free(ep->umidi->chip->dev, |
|
|
602 |
#endif |
568 |
sizeof(*(ep->controller_state->output_control_ctl_req)), |
603 |
sizeof(*(ep->controller_state->output_control_ctl_req)), |
569 |
ep->controller_state->output_control_ctl_req, |
604 |
ep->controller_state->output_control_ctl_req, |
570 |
ep->controller_state->output_control_ctl_dma); |
605 |
ep->controller_state->output_control_ctl_dma); |
Lines 573-579
Link Here
|
573 |
usb_free_urb(ep->controller_state->output_control_ctl_urb); |
608 |
usb_free_urb(ep->controller_state->output_control_ctl_urb); |
574 |
} |
609 |
} |
575 |
if (ep->controller_state->ctl_req) { |
610 |
if (ep->controller_state->ctl_req) { |
|
|
611 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
612 |
usb_free_coherent(ep->umidi->chip->dev, |
613 |
#else |
576 |
usb_buffer_free(ep->umidi->chip->dev, |
614 |
usb_buffer_free(ep->umidi->chip->dev, |
|
|
615 |
#endif |
577 |
sizeof(*(ep->controller_state->ctl_req)), |
616 |
sizeof(*(ep->controller_state->ctl_req)), |
578 |
ep->controller_state->ctl_req, |
617 |
ep->controller_state->ctl_req, |
579 |
ep->controller_state->ctl_req_dma); |
618 |
ep->controller_state->ctl_req_dma); |
Lines 584-597
Link Here
|
584 |
} |
623 |
} |
585 |
if (ep->controller_state->urb_kt) { |
624 |
if (ep->controller_state->urb_kt) { |
586 |
if (ep->controller_state->urb_kt->transfer_buffer) { |
625 |
if (ep->controller_state->urb_kt->transfer_buffer) { |
|
|
626 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
627 |
usb_free_coherent(ep->umidi->chip->dev, ep->max_transfer, |
628 |
#else |
587 |
usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, |
629 |
usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, |
|
|
630 |
#endif |
588 |
ep->controller_state->urb_kt->transfer_buffer, |
631 |
ep->controller_state->urb_kt->transfer_buffer, |
589 |
ep->controller_state->urb_kt->transfer_dma); |
632 |
ep->controller_state->urb_kt->transfer_dma); |
590 |
} |
633 |
} |
591 |
usb_free_urb(ep->controller_state->urb_kt); |
634 |
usb_free_urb(ep->controller_state->urb_kt); |
592 |
} |
635 |
} |
593 |
if (ep->controller_state->ctl_req_kt) { |
636 |
if (ep->controller_state->ctl_req_kt) { |
|
|
637 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
638 |
usb_free_coherent(ep->umidi->chip->dev, |
639 |
#else |
594 |
usb_buffer_free(ep->umidi->chip->dev, |
640 |
usb_buffer_free(ep->umidi->chip->dev, |
|
|
641 |
#endif |
595 |
sizeof(*(ep->controller_state->ctl_req_kt)), |
642 |
sizeof(*(ep->controller_state->ctl_req_kt)), |
596 |
ep->controller_state->ctl_req_kt, |
643 |
ep->controller_state->ctl_req_kt, |
597 |
ep->controller_state->ctl_req_dma_kt); |
644 |
ep->controller_state->ctl_req_dma_kt); |
Lines 666-677
Link Here
|
666 |
controller_state->is_weltrend = is_mp3_weltrend(ep->umidi->chip->usb_id); |
713 |
controller_state->is_weltrend = is_mp3_weltrend(ep->umidi->chip->usb_id); |
667 |
} |
714 |
} |
668 |
|
715 |
|
|
|
716 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
717 |
controller_state->ctl_req = usb_alloc_coherent(ep->umidi->chip->dev, |
718 |
#else |
669 |
controller_state->ctl_req = usb_buffer_alloc(ep->umidi->chip->dev, |
719 |
controller_state->ctl_req = usb_buffer_alloc(ep->umidi->chip->dev, |
|
|
720 |
#endif |
670 |
sizeof(*(controller_state->ctl_req)), |
721 |
sizeof(*(controller_state->ctl_req)), |
671 |
GFP_KERNEL, |
722 |
GFP_KERNEL, |
672 |
&controller_state->ctl_req_dma); |
723 |
&controller_state->ctl_req_dma); |
673 |
if (controller_state->ctl_req==NULL) { |
724 |
if (controller_state->ctl_req==NULL) { |
|
|
725 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
726 |
snd_printk(KERN_WARNING"%s() usb_alloc_coherent() failed for setup DMA\n",__FUNCTION__); |
727 |
#else |
674 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for setup DMA\n",__FUNCTION__); |
728 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for setup DMA\n",__FUNCTION__); |
|
|
729 |
#endif |
675 |
return -ENOMEM; |
730 |
return -ENOMEM; |
676 |
} |
731 |
} |
677 |
|
732 |
|
Lines 679-690
Link Here
|
679 |
* mouse setting or setting LEDs */ |
734 |
* mouse setting or setting LEDs */ |
680 |
init_MUTEX(&controller_state->output_control_ctl_mutex); |
735 |
init_MUTEX(&controller_state->output_control_ctl_mutex); |
681 |
init_completion(&controller_state->output_control_ctl_completion); |
736 |
init_completion(&controller_state->output_control_ctl_completion); |
|
|
737 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
738 |
controller_state->output_control_ctl_req = usb_alloc_coherent(ep->umidi->chip->dev, |
739 |
#else |
682 |
controller_state->output_control_ctl_req = usb_buffer_alloc(ep->umidi->chip->dev, |
740 |
controller_state->output_control_ctl_req = usb_buffer_alloc(ep->umidi->chip->dev, |
|
|
741 |
#endif |
683 |
sizeof(*(controller_state->output_control_ctl_req)), |
742 |
sizeof(*(controller_state->output_control_ctl_req)), |
684 |
GFP_KERNEL, |
743 |
GFP_KERNEL, |
685 |
&controller_state->output_control_ctl_dma); |
744 |
&controller_state->output_control_ctl_dma); |
686 |
if (controller_state->output_control_ctl_req==NULL) { |
745 |
if (controller_state->output_control_ctl_req==NULL) { |
|
|
746 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
747 |
snd_printk(KERN_WARNING"%s() usb_alloc_coherent() failed for general setup DMA\n", |
748 |
#else |
687 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for general setup DMA\n", |
749 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for general setup DMA\n", |
|
|
750 |
#endif |
688 |
__FUNCTION__); |
751 |
__FUNCTION__); |
689 |
return -ENOMEM; |
752 |
return -ENOMEM; |
690 |
} |
753 |
} |
Lines 700-709
Link Here
|
700 |
max_transfer = usb_maxpacket(ep->umidi->chip->dev, |
763 |
max_transfer = usb_maxpacket(ep->umidi->chip->dev, |
701 |
controller_state->output_control_ctl_pipe, 1); |
764 |
controller_state->output_control_ctl_pipe, 1); |
702 |
|
765 |
|
|
|
766 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
767 |
buffer = usb_alloc_coherent(ep->umidi->chip->dev, max_transfer, |
768 |
#else |
703 |
buffer = usb_buffer_alloc(ep->umidi->chip->dev, max_transfer, |
769 |
buffer = usb_buffer_alloc(ep->umidi->chip->dev, max_transfer, |
|
|
770 |
#endif |
704 |
GFP_KERNEL, &controller_state->output_control_ctl_urb->transfer_dma); |
771 |
GFP_KERNEL, &controller_state->output_control_ctl_urb->transfer_dma); |
705 |
if (buffer==NULL) { |
772 |
if (buffer==NULL) { |
|
|
773 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
774 |
snd_printk(KERN_WARNING"%s() usb_alloc_coherent failed (general URB buffer)\n", |
775 |
#else |
706 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc failed (general URB buffer)\n", |
776 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc failed (general URB buffer)\n", |
|
|
777 |
#endif |
707 |
__FUNCTION__); |
778 |
__FUNCTION__); |
708 |
return -ENOMEM; |
779 |
return -ENOMEM; |
709 |
} |
780 |
} |
Lines 726-733
Link Here
|
726 |
controller_state->output_control_ctl_req->wIndex = cpu_to_le16(ep->umidi->iface->cur_altsetting->desc.bInterfaceNumber); |
797 |
controller_state->output_control_ctl_req->wIndex = cpu_to_le16(ep->umidi->iface->cur_altsetting->desc.bInterfaceNumber); |
727 |
controller_state->output_control_ctl_req->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN); |
798 |
controller_state->output_control_ctl_req->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN); |
728 |
controller_state->output_control_ctl_urb->setup_dma = controller_state->output_control_ctl_dma; |
799 |
controller_state->output_control_ctl_urb->setup_dma = controller_state->output_control_ctl_dma; |
|
|
800 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
801 |
/* NOTE: transfer_dma setup above in call to usb_alloc_coherent() */ |
802 |
controller_state->output_control_ctl_urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; |
803 |
#else |
729 |
/* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */ |
804 |
/* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */ |
730 |
controller_state->output_control_ctl_urb->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP; |
805 |
controller_state->output_control_ctl_urb->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP; |
|
|
806 |
#endif |
731 |
|
807 |
|
732 |
return 0; |
808 |
return 0; |
733 |
} |
809 |
} |
Lines 772-783
Link Here
|
772 |
} |
848 |
} |
773 |
|
849 |
|
774 |
if (ep->umidi->chip->caps.leds_hid_controlled) { |
850 |
if (ep->umidi->chip->caps.leds_hid_controlled) { |
|
|
851 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
852 |
ep->ctrl_req_led = usb_alloc_coherent(ep->umidi->chip->dev, |
853 |
#else |
775 |
ep->ctrl_req_led = usb_buffer_alloc(ep->umidi->chip->dev, |
854 |
ep->ctrl_req_led = usb_buffer_alloc(ep->umidi->chip->dev, |
|
|
855 |
#endif |
776 |
sizeof(*(ep->ctrl_req_led)), |
856 |
sizeof(*(ep->ctrl_req_led)), |
777 |
GFP_KERNEL, |
857 |
GFP_KERNEL, |
778 |
&ep->ctrl_req_led_dma); |
858 |
&ep->ctrl_req_led_dma); |
779 |
if (ep->ctrl_req_led==NULL) { |
859 |
if (ep->ctrl_req_led==NULL) { |
|
|
860 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
861 |
snd_printk(KERN_WARNING"%s() usb_alloc_coherent() failed for setup DMA\n",__FUNCTION__); |
862 |
#else |
780 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for setup DMA\n",__FUNCTION__); |
863 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for setup DMA\n",__FUNCTION__); |
|
|
864 |
#endif |
781 |
return -ENOMEM; |
865 |
return -ENOMEM; |
782 |
} |
866 |
} |
783 |
} |
867 |
} |
Lines 806-823
Link Here
|
806 |
pipe = usb_sndctrlpipe(umidi->chip->dev, 0); |
890 |
pipe = usb_sndctrlpipe(umidi->chip->dev, 0); |
807 |
} |
891 |
} |
808 |
ep->max_transfer = usb_maxpacket(umidi->chip->dev, pipe, 1); |
892 |
ep->max_transfer = usb_maxpacket(umidi->chip->dev, pipe, 1); |
|
|
893 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
894 |
buffer = usb_alloc_coherent(umidi->chip->dev, ep->max_transfer, |
895 |
#else |
809 |
buffer = usb_buffer_alloc(umidi->chip->dev, ep->max_transfer, |
896 |
buffer = usb_buffer_alloc(umidi->chip->dev, ep->max_transfer, |
|
|
897 |
#endif |
810 |
GFP_KERNEL, &ep->urb->transfer_dma); |
898 |
GFP_KERNEL, &ep->urb->transfer_dma); |
811 |
if (!buffer) { |
899 |
if (!buffer) { |
|
|
900 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
901 |
snd_printk(KERN_WARNING"%s() usb_alloc_coherent() failed\n",__FUNCTION__); |
902 |
#else |
812 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed\n",__FUNCTION__); |
903 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed\n",__FUNCTION__); |
|
|
904 |
#endif |
813 |
snd_hdjmidi_out_endpoint_delete(ep); |
905 |
snd_hdjmidi_out_endpoint_delete(ep); |
814 |
return -ENOMEM; |
906 |
return -ENOMEM; |
815 |
} |
907 |
} |
816 |
|
908 |
|
|
|
909 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
910 |
buffer_led = usb_alloc_coherent(umidi->chip->dev, ep->max_transfer, |
911 |
#else |
817 |
buffer_led = usb_buffer_alloc(umidi->chip->dev, ep->max_transfer, |
912 |
buffer_led = usb_buffer_alloc(umidi->chip->dev, ep->max_transfer, |
|
|
913 |
#endif |
818 |
GFP_KERNEL, &ep->urb_led->transfer_dma); |
914 |
GFP_KERNEL, &ep->urb_led->transfer_dma); |
819 |
if (!buffer_led) { |
915 |
if (!buffer_led) { |
|
|
916 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
917 |
snd_printk(KERN_WARNING"%s() usb_alloc_coherent() failed for LED buffer\n", |
918 |
#else |
820 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for LED buffer\n", |
919 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for LED buffer\n", |
|
|
920 |
#endif |
821 |
__FUNCTION__); |
921 |
__FUNCTION__); |
822 |
snd_hdjmidi_out_endpoint_delete(ep); |
922 |
snd_hdjmidi_out_endpoint_delete(ep); |
823 |
return -ENOMEM; |
923 |
return -ENOMEM; |
Lines 853-860
Link Here
|
853 |
ep->controller_state->ctl_req->wIndex = cpu_to_le16(umidi->iface->cur_altsetting->desc.bInterfaceNumber); |
953 |
ep->controller_state->ctl_req->wIndex = cpu_to_le16(umidi->iface->cur_altsetting->desc.bInterfaceNumber); |
854 |
ep->controller_state->ctl_req->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN); |
954 |
ep->controller_state->ctl_req->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN); |
855 |
ep->urb->setup_dma = ep->controller_state->ctl_req_dma; |
955 |
ep->urb->setup_dma = ep->controller_state->ctl_req_dma; |
|
|
956 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
957 |
/* NOTE: transfer_dma setup above in call to usb_alloc_coherent() */ |
958 |
ep->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; |
959 |
#else |
856 |
/* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */ |
960 |
/* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */ |
857 |
ep->urb->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP; |
961 |
ep->urb->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP; |
|
|
962 |
#endif |
858 |
} |
963 |
} |
859 |
|
964 |
|
860 |
if (ep->umidi->chip->caps.leds_hid_controlled) { |
965 |
if (ep->umidi->chip->caps.leds_hid_controlled) { |
Lines 874-881
Link Here
|
874 |
ep->ctrl_req_led->wIndex = cpu_to_le16(umidi->iface->cur_altsetting->desc.bInterfaceNumber); |
979 |
ep->ctrl_req_led->wIndex = cpu_to_le16(umidi->iface->cur_altsetting->desc.bInterfaceNumber); |
875 |
ep->ctrl_req_led->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN); |
980 |
ep->ctrl_req_led->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN); |
876 |
ep->urb_led->setup_dma = ep->ctrl_req_led_dma; |
981 |
ep->urb_led->setup_dma = ep->ctrl_req_led_dma; |
|
|
982 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
983 |
/* NOTE: transfer_dma setup above in call to usb_alloc_coherent() */ |
984 |
ep->urb_led->transfer_flags = URB_NO_TRANSFER_DMA_MAP; |
985 |
#else |
877 |
/* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */ |
986 |
/* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */ |
878 |
ep->urb_led->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP; |
987 |
ep->urb_led->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP; |
|
|
988 |
#endif |
879 |
} |
989 |
} |
880 |
|
990 |
|
881 |
if (ep->umidi->chip->caps.leds_bulk_controlled) { |
991 |
if (ep->umidi->chip->caps.leds_bulk_controlled) { |
Lines 913-932
Link Here
|
913 |
return -ENOMEM; |
1023 |
return -ENOMEM; |
914 |
} |
1024 |
} |
915 |
|
1025 |
|
|
|
1026 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
1027 |
buffer = usb_alloc_coherent(umidi->chip->dev, ep->max_transfer, |
1028 |
#else |
916 |
buffer = usb_buffer_alloc(umidi->chip->dev, ep->max_transfer, |
1029 |
buffer = usb_buffer_alloc(umidi->chip->dev, ep->max_transfer, |
|
|
1030 |
#endif |
917 |
GFP_KERNEL, &ep->controller_state->urb_kt->transfer_dma); |
1031 |
GFP_KERNEL, &ep->controller_state->urb_kt->transfer_dma); |
918 |
if (!buffer) { |
1032 |
if (!buffer) { |
|
|
1033 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
1034 |
snd_printk(KERN_WARNING"%s() usb_alloc_coherent() for wq failed\n",__FUNCTION__); |
1035 |
#else |
919 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() for wq failed\n",__FUNCTION__); |
1036 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() for wq failed\n",__FUNCTION__); |
|
|
1037 |
#endif |
920 |
snd_hdjmidi_out_endpoint_delete(ep); |
1038 |
snd_hdjmidi_out_endpoint_delete(ep); |
921 |
return -ENOMEM; |
1039 |
return -ENOMEM; |
922 |
} |
1040 |
} |
923 |
|
1041 |
|
|
|
1042 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
1043 |
ep->controller_state->ctl_req_kt = usb_alloc_coherent(umidi->chip->dev, |
1044 |
#else |
924 |
ep->controller_state->ctl_req_kt = usb_buffer_alloc(umidi->chip->dev, |
1045 |
ep->controller_state->ctl_req_kt = usb_buffer_alloc(umidi->chip->dev, |
|
|
1046 |
#endif |
925 |
sizeof(*(ep->controller_state->ctl_req_kt)), |
1047 |
sizeof(*(ep->controller_state->ctl_req_kt)), |
926 |
GFP_KERNEL, |
1048 |
GFP_KERNEL, |
927 |
&ep->controller_state->ctl_req_dma_kt); |
1049 |
&ep->controller_state->ctl_req_dma_kt); |
928 |
if (!ep->controller_state->ctl_req_kt) { |
1050 |
if (!ep->controller_state->ctl_req_kt) { |
|
|
1051 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
1052 |
snd_printk(KERN_WARNING"%s() usb_alloc_coherent() failed for setup DMA for wq\n",__FUNCTION__); |
1053 |
#else |
929 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for setup DMA for wq\n",__FUNCTION__); |
1054 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for setup DMA for wq\n",__FUNCTION__); |
|
|
1055 |
#endif |
930 |
snd_hdjmidi_out_endpoint_delete(ep); |
1056 |
snd_hdjmidi_out_endpoint_delete(ep); |
931 |
return -ENOMEM; |
1057 |
return -ENOMEM; |
932 |
} |
1058 |
} |
Lines 946-953
Link Here
|
946 |
ep->controller_state->ctl_req_kt->wIndex = cpu_to_le16(umidi->iface->cur_altsetting->desc.bInterfaceNumber); |
1072 |
ep->controller_state->ctl_req_kt->wIndex = cpu_to_le16(umidi->iface->cur_altsetting->desc.bInterfaceNumber); |
947 |
ep->controller_state->ctl_req_kt->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN); |
1073 |
ep->controller_state->ctl_req_kt->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN); |
948 |
ep->controller_state->urb_kt->setup_dma = ep->controller_state->ctl_req_dma_kt; |
1074 |
ep->controller_state->urb_kt->setup_dma = ep->controller_state->ctl_req_dma_kt; |
|
|
1075 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
1076 |
/* NOTE: transfer_dma setup above in call to usb_alloc_coherent() */ |
1077 |
ep->controller_state->urb_kt->transfer_flags = URB_NO_TRANSFER_DMA_MAP; |
1078 |
#else |
949 |
/* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */ |
1079 |
/* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */ |
950 |
ep->controller_state->urb_kt->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP; |
1080 |
ep->controller_state->urb_kt->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP; |
|
|
1081 |
#endif |
951 |
|
1082 |
|
952 |
init_completion(&ep->controller_state->ctl_req_completion_kt); |
1083 |
init_completion(&ep->controller_state->ctl_req_completion_kt); |
953 |
init_completion(&ep->controller_state->mp3w_kthread_started); |
1084 |
init_completion(&ep->controller_state->mp3w_kthread_started); |