Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 272100 | Differences between
and this patch

Collapse All | Expand All

(-)hdjmod-1.28.old/bulk.c (-10 / +53 lines)
Lines 462-468 Link Here
462
462
463
	chip->ctrl_urb->setup_dma = chip->ctl_req_dma;
463
	chip->ctrl_urb->setup_dma = chip->ctl_req_dma;
464
	/* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */
464
	/* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */
465
	chip->ctrl_urb->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP;
465
	chip->ctrl_urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
466
466
467
	ret = hdjbulk_submit_urb(chip, chip->ctrl_urb, GFP_KERNEL);
467
	ret = hdjbulk_submit_urb(chip, chip->ctrl_urb, GFP_KERNEL);
468
	if (ret!=0) {
468
	if (ret!=0) {
Lines 553-559 Link Here
553
				output_control_callback,
553
				output_control_callback,
554
				&ubulk->output_control_completion);
554
				&ubulk->output_control_completion);
555
	ubulk->output_control_urb->setup_dma = ubulk->output_control_dma;
555
	ubulk->output_control_urb->setup_dma = ubulk->output_control_dma;
556
	ubulk->output_control_urb->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP;
556
	ubulk->output_control_urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
557
	if ((rc =  hdjbulk_submit_urb(ubulk->chip,ubulk->output_control_urb, GFP_KERNEL))!=0) {
557
	if ((rc =  hdjbulk_submit_urb(ubulk->chip,ubulk->output_control_urb, GFP_KERNEL))!=0) {
558
		printk(KERN_WARNING"%s hdjbulk_submit_urb() failed, rc:%d\n",__FUNCTION__,rc);
558
		printk(KERN_WARNING"%s hdjbulk_submit_urb() failed, rc:%d\n",__FUNCTION__,rc);
559
	} else {
559
	} else {
Lines 2675-2681 Link Here
2675
{
2675
{
2676
	if (ubulk->chip->product_code!=DJCONTROLSTEEL_PRODUCT_CODE) {
2676
	if (ubulk->chip->product_code!=DJCONTROLSTEEL_PRODUCT_CODE) {
2677
		if (ubulk->output_control_ctl_req!=NULL && ubulk->control_interface!=NULL) {
2677
		if (ubulk->output_control_ctl_req!=NULL && ubulk->control_interface!=NULL) {
2678
			usb_buffer_free(interface_to_usbdev(ubulk->control_interface),
2678
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) )
2679
		usb_free_coherent(
2680
#else
2681
		usb_buffer_free(
2682
#endif
2683
					interface_to_usbdev(ubulk->control_interface),
2679
					sizeof(*(ubulk->output_control_ctl_req)),
2684
					sizeof(*(ubulk->output_control_ctl_req)),
2680
					ubulk->output_control_ctl_req,
2685
					ubulk->output_control_ctl_req,
2681
					ubulk->output_control_dma);
2686
					ubulk->output_control_dma);
Lines 2684-2690 Link Here
2684
2689
2685
		if (ubulk->output_control_buffer!=NULL && ubulk->control_interface!=NULL &&
2690
		if (ubulk->output_control_buffer!=NULL && ubulk->control_interface!=NULL &&
2686
		    ubulk->output_control_urb!=NULL) {
2691
		    ubulk->output_control_urb!=NULL) {
2687
			usb_buffer_free(interface_to_usbdev(ubulk->control_interface),
2692
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) )
2693
		usb_free_coherent(
2694
#else
2695
		usb_buffer_free(
2696
#endif
2697
					interface_to_usbdev(ubulk->control_interface),
2688
					ubulk->output_control_urb->transfer_buffer_length,
2698
					ubulk->output_control_urb->transfer_buffer_length,
2689
					ubulk->output_control_buffer,
2699
					ubulk->output_control_buffer,
2690
					ubulk->output_control_urb->transfer_dma);
2700
					ubulk->output_control_urb->transfer_dma);
Lines 2712-2718 Link Here
2712
		usb_kill_urb(ubulk->bulk_out_urb);
2722
		usb_kill_urb(ubulk->bulk_out_urb);
2713
		if (free_urbs!=0) {
2723
		if (free_urbs!=0) {
2714
			if (ubulk->bulk_out_buffer!=NULL) {
2724
			if (ubulk->bulk_out_buffer!=NULL) {
2715
				usb_buffer_free(ubulk->chip->dev, ubulk->bulk_out_size,
2725
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) )
2726
		usb_free_coherent(
2727
#else
2728
		usb_buffer_free(
2729
#endif
2730
						ubulk->chip->dev, ubulk->bulk_out_size,
2716
						ubulk->bulk_out_urb->transfer_buffer,
2731
						ubulk->bulk_out_urb->transfer_buffer,
2717
						ubulk->bulk_out_urb->transfer_dma);
2732
						ubulk->bulk_out_urb->transfer_dma);
2718
				ubulk->bulk_out_buffer = NULL;
2733
				ubulk->bulk_out_buffer = NULL;
Lines 3065-3071 Link Here
3065
	init_MUTEX(&ubulk->bulk_out_buffer_mutex);
3080
	init_MUTEX(&ubulk->bulk_out_buffer_mutex);
3066
	
3081
	
3067
	ubulk->bulk_out_buffer =
3082
	ubulk->bulk_out_buffer =
3068
		usb_buffer_alloc(ubulk->chip->dev, ubulk->bulk_out_size,
3083
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) )
3084
		usb_alloc_coherent(
3085
#else
3086
		usb_buffer_alloc(
3087
#endif
3088
			ubulk->chip->dev, ubulk->bulk_out_size,
3069
			GFP_KERNEL, &ubulk->bulk_out_urb->transfer_dma);
3089
			GFP_KERNEL, &ubulk->bulk_out_urb->transfer_dma);
3070
3090
3071
	if (ubulk->bulk_out_buffer==NULL) {
3091
	if (ubulk->bulk_out_buffer==NULL) {
Lines 3609-3615 Link Here
3609
	 *  control state */
3629
	 *  control state */
3610
	if (ubulk->chip->product_code != DJCONTROLSTEEL_PRODUCT_CODE) {	
3630
	if (ubulk->chip->product_code != DJCONTROLSTEEL_PRODUCT_CODE) {	
3611
		/* allocate memory for setup packet for our control requests */
3631
		/* allocate memory for setup packet for our control requests */
3612
		ubulk->output_control_ctl_req = usb_buffer_alloc(interface_to_usbdev(ubulk->control_interface), 
3632
		ubulk->output_control_ctl_req = 
3633
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) )
3634
		usb_alloc_coherent(
3635
#else
3636
		usb_buffer_alloc(
3637
#endif
3638
								interface_to_usbdev(ubulk->control_interface), 
3613
						 		sizeof(*(ubulk->output_control_ctl_req)),
3639
						 		sizeof(*(ubulk->output_control_ctl_req)),
3614
						 		GFP_KERNEL, 
3640
						 		GFP_KERNEL, 
3615
								 &ubulk->output_control_dma);
3641
								 &ubulk->output_control_dma);
Lines 3628-3634 Link Here
3628
			goto hdjbulk_init_output_control_state_error;
3654
			goto hdjbulk_init_output_control_state_error;
3629
		}
3655
		}
3630
3656
3631
		ubulk->output_control_buffer = usb_buffer_alloc(interface_to_usbdev(ubulk->control_interface),
3657
		ubulk->output_control_buffer = 
3658
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) )
3659
		usb_alloc_coherent(
3660
#else
3661
		usb_buffer_alloc(
3662
#endif
3663
								interface_to_usbdev(ubulk->control_interface),
3632
								ubulk->output_control_buffer_size, 
3664
								ubulk->output_control_buffer_size, 
3633
								GFP_KERNEL,
3665
								GFP_KERNEL,
3634
								&ubulk->output_control_urb->transfer_dma);
3666
								&ubulk->output_control_urb->transfer_dma);
Lines 3773-3779 Link Here
3773
		}
3805
		}
3774
3806
3775
		ep[i]->max_transfer = ubulk->continuous_reader_packet_size;
3807
		ep[i]->max_transfer = ubulk->continuous_reader_packet_size;
3776
		buffer = usb_buffer_alloc(ubulk->chip->dev, ep[i]->max_transfer,
3808
		buffer = 
3809
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) )
3810
		usb_alloc_coherent(
3811
#else
3812
		usb_buffer_alloc(
3813
#endif
3814
					ubulk->chip->dev, ep[i]->max_transfer,
3777
					GFP_KERNEL, &ep[i]->urb->transfer_dma);
3815
					GFP_KERNEL, &ep[i]->urb->transfer_dma);
3778
		if (!buffer) {
3816
		if (!buffer) {
3779
			printk(KERN_WARNING"%s() usb_buffer_alloc() failed\n",__FUNCTION__);
3817
			printk(KERN_WARNING"%s() usb_buffer_alloc() failed\n",__FUNCTION__);
Lines 4250-4256 Link Here
4250
{
4288
{
4251
	if (ep->urb) {
4289
	if (ep->urb) {
4252
		if (ep->urb->transfer_buffer) {
4290
		if (ep->urb->transfer_buffer) {
4253
			usb_buffer_free(ep->ubulk->chip->dev, ep->max_transfer,
4291
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) )
4292
		usb_free_coherent(
4293
#else
4294
		usb_buffer_free(
4295
#endif
4296
					ep->ubulk->chip->dev, ep->max_transfer,
4254
					ep->urb->transfer_buffer,
4297
					ep->urb->transfer_buffer,
4255
					ep->urb->transfer_dma);
4298
					ep->urb->transfer_dma);
4256
		}
4299
		}
(-)hdjmod-1.28.old/device.c (-4 / +26 lines)
Lines 1559-1565 Link Here
1559
1559
1560
	if(chip->ctrl_req_buffer != NULL)
1560
	if(chip->ctrl_req_buffer != NULL)
1561
	{
1561
	{
1562
		usb_buffer_free(chip->dev,
1562
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) )
1563
		usb_free_coherent(
1564
#else
1565
		usb_buffer_free(
1566
#endif
1567
				chip->dev,
1563
				chip->ctrl_urb->transfer_buffer_length,
1568
				chip->ctrl_urb->transfer_buffer_length,
1564
				chip->ctrl_req_buffer,
1569
				chip->ctrl_req_buffer,
1565
				chip->ctrl_urb->transfer_dma);
1570
				chip->ctrl_urb->transfer_dma);
Lines 1575-1581 Link Here
1575
	
1580
	
1576
	if(chip->ctl_req != NULL)
1581
	if(chip->ctl_req != NULL)
1577
	{
1582
	{
1578
		usb_buffer_free(chip->dev,
1583
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) )
1584
		usb_free_coherent(
1585
#else
1586
		usb_buffer_free(
1587
#endif
1588
			chip->dev,
1579
			sizeof(*(chip->ctl_req)),
1589
			sizeof(*(chip->ctl_req)),
1580
			chip->ctl_req,
1590
			chip->ctl_req,
1581
			chip->ctl_req_dma);
1591
			chip->ctl_req_dma);
Lines 1728-1734 Link Here
1728
	}
1738
	}
1729
1739
1730
	/* allocate memory for setup packet for our control requests */
1740
	/* allocate memory for setup packet for our control requests */
1731
	chip->ctl_req = usb_buffer_alloc(chip->dev, 
1741
	chip->ctl_req =
1742
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) )
1743
		usb_alloc_coherent(
1744
#else
1745
		usb_buffer_alloc(
1746
#endif
1747
					 chip->dev, 
1732
					 sizeof(*(chip->ctl_req)),
1748
					 sizeof(*(chip->ctl_req)),
1733
					 GFP_KERNEL, 
1749
					 GFP_KERNEL, 
1734
					 &chip->ctl_req_dma);
1750
					 &chip->ctl_req_dma);
Lines 1743-1749 Link Here
1743
1759
1744
	chip->ctrl_req_buffer_len =  sizeof(u16);
1760
	chip->ctrl_req_buffer_len =  sizeof(u16);
1745
	chip->ctrl_urb->transfer_buffer_length = chip->ctrl_req_buffer_len;
1761
	chip->ctrl_urb->transfer_buffer_length = chip->ctrl_req_buffer_len;
1746
	chip->ctrl_req_buffer = usb_buffer_alloc(chip->dev, 
1762
	chip->ctrl_req_buffer = 
1763
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) )
1764
		usb_alloc_coherent(
1765
#else
1766
		usb_buffer_alloc(
1767
#endif
1768
						 chip->dev, 
1747
						 chip->ctrl_urb->transfer_buffer_length,
1769
						 chip->ctrl_urb->transfer_buffer_length,
1748
						 GFP_KERNEL, 
1770
						 GFP_KERNEL, 
1749
						 &chip->ctrl_urb->transfer_dma);
1771
						 &chip->ctrl_urb->transfer_dma);
(-)hdjmod-1.28.old/midi.c (-22 / +121 lines)
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);

Return to bug 272100