Lines 367-373
Link Here
|
367 |
{ |
367 |
{ |
368 |
if (ep->urb) { |
368 |
if (ep->urb) { |
369 |
if (ep->urb->transfer_buffer) { |
369 |
if (ep->urb->transfer_buffer) { |
370 |
usb_buffer_free(ep->umidi->chip->dev, |
370 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
|
|
371 |
usb_free_coherent( |
372 |
#else |
373 |
usb_buffer_free( |
374 |
#endif |
375 |
ep->umidi->chip->dev, |
371 |
ep->urb->transfer_buffer_length, |
376 |
ep->urb->transfer_buffer_length, |
372 |
ep->urb->transfer_buffer, |
377 |
ep->urb->transfer_buffer, |
373 |
ep->urb->transfer_dma); |
378 |
ep->urb->transfer_dma); |
Lines 503-509
Link Here
|
503 |
pipe = usb_rcvbulkpipe(umidi->chip->dev, ep_info->in_ep); |
508 |
pipe = usb_rcvbulkpipe(umidi->chip->dev, ep_info->in_ep); |
504 |
} |
509 |
} |
505 |
length = usb_maxpacket(umidi->chip->dev, pipe, 0); |
510 |
length = usb_maxpacket(umidi->chip->dev, pipe, 0); |
506 |
buffer = usb_buffer_alloc(umidi->chip->dev, length, GFP_KERNEL, |
511 |
buffer = |
|
|
512 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
513 |
usb_alloc_coherent( |
514 |
#else |
515 |
usb_buffer_alloc( |
516 |
#endif |
517 |
umidi->chip->dev, length, GFP_KERNEL, |
507 |
&ep->urb->transfer_dma); |
518 |
&ep->urb->transfer_dma); |
508 |
if (!buffer) { |
519 |
if (!buffer) { |
509 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc failed\n",__FUNCTION__); |
520 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc failed\n",__FUNCTION__); |
Lines 536-542
Link Here
|
536 |
#endif |
547 |
#endif |
537 |
if (ep->urb) { |
548 |
if (ep->urb) { |
538 |
if (ep->urb->transfer_buffer) { |
549 |
if (ep->urb->transfer_buffer) { |
539 |
usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, |
550 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
|
|
551 |
usb_free_coherent( |
552 |
#else |
553 |
usb_buffer_free( |
554 |
#endif |
555 |
ep->umidi->chip->dev, ep->max_transfer, |
540 |
ep->urb->transfer_buffer, |
556 |
ep->urb->transfer_buffer, |
541 |
ep->urb->transfer_dma); |
557 |
ep->urb->transfer_dma); |
542 |
} |
558 |
} |
Lines 544-570
Link Here
|
544 |
} |
560 |
} |
545 |
if (ep->urb_led) { |
561 |
if (ep->urb_led) { |
546 |
if (ep->urb_led->transfer_buffer) { |
562 |
if (ep->urb_led->transfer_buffer) { |
547 |
usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, |
563 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
|
|
564 |
usb_free_coherent( |
565 |
#else |
566 |
usb_buffer_free( |
567 |
#endif |
568 |
ep->umidi->chip->dev, ep->max_transfer, |
548 |
ep->urb_led->transfer_buffer, |
569 |
ep->urb_led->transfer_buffer, |
549 |
ep->urb_led->transfer_dma); |
570 |
ep->urb_led->transfer_dma); |
550 |
} |
571 |
} |
551 |
usb_free_urb(ep->urb_led); |
572 |
usb_free_urb(ep->urb_led); |
552 |
} |
573 |
} |
553 |
if (ep->ctrl_req_led) { |
574 |
if (ep->ctrl_req_led) { |
554 |
usb_buffer_free(ep->umidi->chip->dev, sizeof(*(ep->ctrl_req_led)), |
575 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
|
|
576 |
usb_free_coherent( |
577 |
#else |
578 |
usb_buffer_free( |
579 |
#endif |
580 |
ep->umidi->chip->dev, sizeof(*(ep->ctrl_req_led)), |
555 |
ep->ctrl_req_led, ep->ctrl_req_led_dma); |
581 |
ep->ctrl_req_led, ep->ctrl_req_led_dma); |
556 |
} |
582 |
} |
557 |
if (ep->controller_state) { |
583 |
if (ep->controller_state) { |
558 |
if (ep->controller_state->output_control_ctl_urb && |
584 |
if (ep->controller_state->output_control_ctl_urb && |
559 |
ep->controller_state->output_control_ctl_urb->transfer_buffer && |
585 |
ep->controller_state->output_control_ctl_urb->transfer_buffer && |
560 |
ep->controller_state->output_control_ctl_urb->transfer_dma) { |
586 |
ep->controller_state->output_control_ctl_urb->transfer_dma) { |
561 |
usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, |
587 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
|
|
588 |
usb_free_coherent( |
589 |
#else |
590 |
usb_buffer_free( |
591 |
#endif |
592 |
ep->umidi->chip->dev, ep->max_transfer, |
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) { |
567 |
usb_buffer_free(ep->umidi->chip->dev, |
598 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
|
|
599 |
usb_free_coherent( |
600 |
#else |
601 |
usb_buffer_free( |
602 |
#endif |
603 |
ep->umidi->chip->dev, |
568 |
sizeof(*(ep->controller_state->output_control_ctl_req)), |
604 |
sizeof(*(ep->controller_state->output_control_ctl_req)), |
569 |
ep->controller_state->output_control_ctl_req, |
605 |
ep->controller_state->output_control_ctl_req, |
570 |
ep->controller_state->output_control_ctl_dma); |
606 |
ep->controller_state->output_control_ctl_dma); |
Lines 573-579
Link Here
|
573 |
usb_free_urb(ep->controller_state->output_control_ctl_urb); |
609 |
usb_free_urb(ep->controller_state->output_control_ctl_urb); |
574 |
} |
610 |
} |
575 |
if (ep->controller_state->ctl_req) { |
611 |
if (ep->controller_state->ctl_req) { |
576 |
usb_buffer_free(ep->umidi->chip->dev, |
612 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
|
|
613 |
usb_free_coherent( |
614 |
#else |
615 |
usb_buffer_free( |
616 |
#endif |
617 |
ep->umidi->chip->dev, |
577 |
sizeof(*(ep->controller_state->ctl_req)), |
618 |
sizeof(*(ep->controller_state->ctl_req)), |
578 |
ep->controller_state->ctl_req, |
619 |
ep->controller_state->ctl_req, |
579 |
ep->controller_state->ctl_req_dma); |
620 |
ep->controller_state->ctl_req_dma); |
Lines 584-597
Link Here
|
584 |
} |
625 |
} |
585 |
if (ep->controller_state->urb_kt) { |
626 |
if (ep->controller_state->urb_kt) { |
586 |
if (ep->controller_state->urb_kt->transfer_buffer) { |
627 |
if (ep->controller_state->urb_kt->transfer_buffer) { |
587 |
usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, |
628 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
|
|
629 |
usb_free_coherent( |
630 |
#else |
631 |
usb_buffer_free( |
632 |
#endif |
633 |
ep->umidi->chip->dev, ep->max_transfer, |
588 |
ep->controller_state->urb_kt->transfer_buffer, |
634 |
ep->controller_state->urb_kt->transfer_buffer, |
589 |
ep->controller_state->urb_kt->transfer_dma); |
635 |
ep->controller_state->urb_kt->transfer_dma); |
590 |
} |
636 |
} |
591 |
usb_free_urb(ep->controller_state->urb_kt); |
637 |
usb_free_urb(ep->controller_state->urb_kt); |
592 |
} |
638 |
} |
593 |
if (ep->controller_state->ctl_req_kt) { |
639 |
if (ep->controller_state->ctl_req_kt) { |
594 |
usb_buffer_free(ep->umidi->chip->dev, |
640 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
|
|
641 |
usb_free_coherent( |
642 |
#else |
643 |
usb_buffer_free( |
644 |
#endif |
645 |
ep->umidi->chip->dev, |
595 |
sizeof(*(ep->controller_state->ctl_req_kt)), |
646 |
sizeof(*(ep->controller_state->ctl_req_kt)), |
596 |
ep->controller_state->ctl_req_kt, |
647 |
ep->controller_state->ctl_req_kt, |
597 |
ep->controller_state->ctl_req_dma_kt); |
648 |
ep->controller_state->ctl_req_dma_kt); |
Lines 666-672
Link Here
|
666 |
controller_state->is_weltrend = is_mp3_weltrend(ep->umidi->chip->usb_id); |
717 |
controller_state->is_weltrend = is_mp3_weltrend(ep->umidi->chip->usb_id); |
667 |
} |
718 |
} |
668 |
|
719 |
|
669 |
controller_state->ctl_req = usb_buffer_alloc(ep->umidi->chip->dev, |
720 |
controller_state->ctl_req = |
|
|
721 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
722 |
usb_alloc_coherent( |
723 |
#else |
724 |
usb_buffer_alloc( |
725 |
#endif |
726 |
ep->umidi->chip->dev, |
670 |
sizeof(*(controller_state->ctl_req)), |
727 |
sizeof(*(controller_state->ctl_req)), |
671 |
GFP_KERNEL, |
728 |
GFP_KERNEL, |
672 |
&controller_state->ctl_req_dma); |
729 |
&controller_state->ctl_req_dma); |
Lines 679-685
Link Here
|
679 |
* mouse setting or setting LEDs */ |
736 |
* mouse setting or setting LEDs */ |
680 |
init_MUTEX(&controller_state->output_control_ctl_mutex); |
737 |
init_MUTEX(&controller_state->output_control_ctl_mutex); |
681 |
init_completion(&controller_state->output_control_ctl_completion); |
738 |
init_completion(&controller_state->output_control_ctl_completion); |
682 |
controller_state->output_control_ctl_req = usb_buffer_alloc(ep->umidi->chip->dev, |
739 |
controller_state->output_control_ctl_req = |
|
|
740 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
741 |
usb_alloc_coherent( |
742 |
#else |
743 |
usb_buffer_alloc( |
744 |
#endif |
745 |
ep->umidi->chip->dev, |
683 |
sizeof(*(controller_state->output_control_ctl_req)), |
746 |
sizeof(*(controller_state->output_control_ctl_req)), |
684 |
GFP_KERNEL, |
747 |
GFP_KERNEL, |
685 |
&controller_state->output_control_ctl_dma); |
748 |
&controller_state->output_control_ctl_dma); |
Lines 700-706
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 |
|
703 |
buffer = usb_buffer_alloc(ep->umidi->chip->dev, max_transfer, |
766 |
buffer = |
|
|
767 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
768 |
usb_alloc_coherent( |
769 |
#else |
770 |
usb_buffer_alloc( |
771 |
#endif |
772 |
ep->umidi->chip->dev, max_transfer, |
704 |
GFP_KERNEL, &controller_state->output_control_ctl_urb->transfer_dma); |
773 |
GFP_KERNEL, &controller_state->output_control_ctl_urb->transfer_dma); |
705 |
if (buffer==NULL) { |
774 |
if (buffer==NULL) { |
706 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc failed (general URB buffer)\n", |
775 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc failed (general URB buffer)\n", |
Lines 727-733
Link Here
|
727 |
controller_state->output_control_ctl_req->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN); |
796 |
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; |
797 |
controller_state->output_control_ctl_urb->setup_dma = controller_state->output_control_ctl_dma; |
729 |
/* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */ |
798 |
/* 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; |
799 |
controller_state->output_control_ctl_urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; |
731 |
|
800 |
|
732 |
return 0; |
801 |
return 0; |
733 |
} |
802 |
} |
Lines 772-778
Link Here
|
772 |
} |
841 |
} |
773 |
|
842 |
|
774 |
if (ep->umidi->chip->caps.leds_hid_controlled) { |
843 |
if (ep->umidi->chip->caps.leds_hid_controlled) { |
775 |
ep->ctrl_req_led = usb_buffer_alloc(ep->umidi->chip->dev, |
844 |
ep->ctrl_req_led = |
|
|
845 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
846 |
usb_alloc_coherent( |
847 |
#else |
848 |
usb_buffer_alloc( |
849 |
#endif |
850 |
ep->umidi->chip->dev, |
776 |
sizeof(*(ep->ctrl_req_led)), |
851 |
sizeof(*(ep->ctrl_req_led)), |
777 |
GFP_KERNEL, |
852 |
GFP_KERNEL, |
778 |
&ep->ctrl_req_led_dma); |
853 |
&ep->ctrl_req_led_dma); |
Lines 806-812
Link Here
|
806 |
pipe = usb_sndctrlpipe(umidi->chip->dev, 0); |
881 |
pipe = usb_sndctrlpipe(umidi->chip->dev, 0); |
807 |
} |
882 |
} |
808 |
ep->max_transfer = usb_maxpacket(umidi->chip->dev, pipe, 1); |
883 |
ep->max_transfer = usb_maxpacket(umidi->chip->dev, pipe, 1); |
809 |
buffer = usb_buffer_alloc(umidi->chip->dev, ep->max_transfer, |
884 |
buffer = |
|
|
885 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
886 |
usb_alloc_coherent( |
887 |
#else |
888 |
usb_buffer_alloc( |
889 |
#endif |
890 |
umidi->chip->dev, ep->max_transfer, |
810 |
GFP_KERNEL, &ep->urb->transfer_dma); |
891 |
GFP_KERNEL, &ep->urb->transfer_dma); |
811 |
if (!buffer) { |
892 |
if (!buffer) { |
812 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed\n",__FUNCTION__); |
893 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed\n",__FUNCTION__); |
Lines 814-820
Link Here
|
814 |
return -ENOMEM; |
895 |
return -ENOMEM; |
815 |
} |
896 |
} |
816 |
|
897 |
|
817 |
buffer_led = usb_buffer_alloc(umidi->chip->dev, ep->max_transfer, |
898 |
buffer_led = |
|
|
899 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
900 |
usb_alloc_coherent( |
901 |
#else |
902 |
usb_buffer_alloc( |
903 |
#endif |
904 |
umidi->chip->dev, ep->max_transfer, |
818 |
GFP_KERNEL, &ep->urb_led->transfer_dma); |
905 |
GFP_KERNEL, &ep->urb_led->transfer_dma); |
819 |
if (!buffer_led) { |
906 |
if (!buffer_led) { |
820 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for LED buffer\n", |
907 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for LED buffer\n", |
Lines 854-860
Link Here
|
854 |
ep->controller_state->ctl_req->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN); |
941 |
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; |
942 |
ep->urb->setup_dma = ep->controller_state->ctl_req_dma; |
856 |
/* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */ |
943 |
/* 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; |
944 |
ep->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; |
858 |
} |
945 |
} |
859 |
|
946 |
|
860 |
if (ep->umidi->chip->caps.leds_hid_controlled) { |
947 |
if (ep->umidi->chip->caps.leds_hid_controlled) { |
Lines 875-881
Link Here
|
875 |
ep->ctrl_req_led->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN); |
962 |
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; |
963 |
ep->urb_led->setup_dma = ep->ctrl_req_led_dma; |
877 |
/* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */ |
964 |
/* 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; |
965 |
ep->urb_led->transfer_flags = URB_NO_TRANSFER_DMA_MAP; |
879 |
} |
966 |
} |
880 |
|
967 |
|
881 |
if (ep->umidi->chip->caps.leds_bulk_controlled) { |
968 |
if (ep->umidi->chip->caps.leds_bulk_controlled) { |
Lines 913-919
Link Here
|
913 |
return -ENOMEM; |
1000 |
return -ENOMEM; |
914 |
} |
1001 |
} |
915 |
|
1002 |
|
916 |
buffer = usb_buffer_alloc(umidi->chip->dev, ep->max_transfer, |
1003 |
buffer = |
|
|
1004 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
1005 |
usb_alloc_coherent( |
1006 |
#else |
1007 |
usb_buffer_alloc( |
1008 |
#endif |
1009 |
umidi->chip->dev, ep->max_transfer, |
917 |
GFP_KERNEL, &ep->controller_state->urb_kt->transfer_dma); |
1010 |
GFP_KERNEL, &ep->controller_state->urb_kt->transfer_dma); |
918 |
if (!buffer) { |
1011 |
if (!buffer) { |
919 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() for wq failed\n",__FUNCTION__); |
1012 |
snd_printk(KERN_WARNING"%s() usb_buffer_alloc() for wq failed\n",__FUNCTION__); |
Lines 921-927
Link Here
|
921 |
return -ENOMEM; |
1014 |
return -ENOMEM; |
922 |
} |
1015 |
} |
923 |
|
1016 |
|
924 |
ep->controller_state->ctl_req_kt = usb_buffer_alloc(umidi->chip->dev, |
1017 |
ep->controller_state->ctl_req_kt = |
|
|
1018 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) |
1019 |
usb_alloc_coherent( |
1020 |
#else |
1021 |
usb_buffer_alloc( |
1022 |
#endif |
1023 |
umidi->chip->dev, |
925 |
sizeof(*(ep->controller_state->ctl_req_kt)), |
1024 |
sizeof(*(ep->controller_state->ctl_req_kt)), |
926 |
GFP_KERNEL, |
1025 |
GFP_KERNEL, |
927 |
&ep->controller_state->ctl_req_dma_kt); |
1026 |
&ep->controller_state->ctl_req_dma_kt); |
Lines 947-953
Link Here
|
947 |
ep->controller_state->ctl_req_kt->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN); |
1046 |
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; |
1047 |
ep->controller_state->urb_kt->setup_dma = ep->controller_state->ctl_req_dma_kt; |
949 |
/* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */ |
1048 |
/* 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; |
1049 |
ep->controller_state->urb_kt->transfer_flags = URB_NO_TRANSFER_DMA_MAP; |
951 |
|
1050 |
|
952 |
init_completion(&ep->controller_state->ctl_req_completion_kt); |
1051 |
init_completion(&ep->controller_state->ctl_req_completion_kt); |
953 |
init_completion(&ep->controller_state->mp3w_kthread_started); |
1052 |
init_completion(&ep->controller_state->mp3w_kthread_started); |