Lines Matching refs:i
30 #define MAKE_CHECKBYTE(cdev,stream,i) \ argument
31 (stream << 1) | (~(i / (cdev->n_streams * BYTES_PER_SAMPLE_USB)) & 1)
82 int i; in all_substreams_zero() local
83 for (i = 0; i < MAX_STREAMS; i++) in all_substreams_zero()
84 if (subs[i] != NULL) in all_substreams_zero()
91 int i, ret; in stream_start() local
107 for (i = 0; i < N_URBS; i++) { in stream_start()
108 ret = usb_submit_urb(cdev->data_urbs_in[i], GFP_ATOMIC); in stream_start()
111 i, ret); in stream_start()
122 int i; in stream_stop() local
131 for (i = 0; i < N_URBS; i++) { in stream_stop()
132 usb_kill_urb(cdev->data_urbs_in[i]); in stream_stop()
134 if (test_bit(i, &cdev->outurb_active_mask)) in stream_stop()
135 usb_kill_urb(cdev->data_urbs_out[i]); in stream_stop()
194 int bytes_per_sample, bpp, ret, i; in snd_usb_caiaq_pcm_prepare() local
243 for (i=0; i < ARRAY_SIZE(rates); i++) in snd_usb_caiaq_pcm_prepare()
244 if (runtime->rate == rates[i]) in snd_usb_caiaq_pcm_prepare()
245 cdev->pcm_info.rates = 1 << i; in snd_usb_caiaq_pcm_prepare()
369 int stream, i; in read_in_urb_mode0() local
374 for (i = 0; i < iso->actual_length;) { in read_in_urb_mode0()
375 for (stream = 0; stream < cdev->n_streams; stream++, i++) { in read_in_urb_mode0()
382 = usb_buf[i]; in read_in_urb_mode0()
398 int stream, i; in read_in_urb_mode2() local
400 for (i = 0; i < iso->actual_length;) { in read_in_urb_mode2()
401 if (i % (cdev->n_streams * BYTES_PER_SAMPLE_USB) == 0) { in read_in_urb_mode2()
404 stream++, i++) { in read_in_urb_mode2()
408 check_byte = MAKE_CHECKBYTE(cdev, stream, i); in read_in_urb_mode2()
410 if ((usb_buf[i] & 0x3f) != check_byte) in read_in_urb_mode2()
413 if (usb_buf[i] & 0x80) in read_in_urb_mode2()
419 for (stream = 0; stream < cdev->n_streams; stream++, i++) { in read_in_urb_mode2()
422 usb_buf[i] = 0; in read_in_urb_mode2()
429 usb_buf[i]; in read_in_urb_mode2()
444 int stream, i; in read_in_urb_mode3() local
450 for (i = 0; i < iso->actual_length;) { in read_in_urb_mode3()
466 audio_buf[cdev->audio_in_buf_pos[stream]++] = usb_buf[i+n]; in read_in_urb_mode3()
475 i += BYTES_PER_SAMPLE; in read_in_urb_mode3()
477 if (usb_buf[i] != ((stream << 1) | c) && in read_in_urb_mode3()
481 ((stream << 1) | c), usb_buf[i], c, stream, i); in read_in_urb_mode3()
485 i++; in read_in_urb_mode3()
532 int stream, i; in fill_out_urb_mode_0() local
534 for (i = 0; i < iso->length;) { in fill_out_urb_mode_0()
535 for (stream = 0; stream < cdev->n_streams; stream++, i++) { in fill_out_urb_mode_0()
541 usb_buf[i] = in fill_out_urb_mode_0()
548 usb_buf[i] = 0; in fill_out_urb_mode_0()
553 i % (cdev->n_streams * BYTES_PER_SAMPLE_USB) == in fill_out_urb_mode_0()
555 for (stream = 0; stream < cdev->n_streams; stream++, i++) in fill_out_urb_mode_0()
556 usb_buf[i] = MAKE_CHECKBYTE(cdev, stream, i); in fill_out_urb_mode_0()
565 int stream, i; in fill_out_urb_mode_3() local
567 for (i = 0; i < iso->length;) { in fill_out_urb_mode_3()
582 usb_buf[i+n] = audio_buf[cdev->audio_out_buf_pos[stream]++]; in fill_out_urb_mode_3()
587 usb_buf[i+n] = 0; in fill_out_urb_mode_3()
594 i += BYTES_PER_SAMPLE; in fill_out_urb_mode_3()
597 usb_buf[i++] = (stream << 1) | c; in fill_out_urb_mode_3()
624 int i, frame, len, send_it = 0, outframe = 0; in read_completed() local
638 for (i = 0; i < N_URBS; i++) in read_completed()
639 if (test_and_set_bit(i, &cdev->outurb_active_mask) == 0) { in read_completed()
640 out = cdev->data_urbs_out[i]; in read_completed()
709 int i, frame; in alloc_urbs() local
724 for (i = 0; i < N_URBS; i++) { in alloc_urbs()
725 urbs[i] = usb_alloc_urb(FRAMES_PER_URB, GFP_KERNEL); in alloc_urbs()
726 if (!urbs[i]) { in alloc_urbs()
731 urbs[i]->transfer_buffer = in alloc_urbs()
734 if (!urbs[i]->transfer_buffer) { in alloc_urbs()
741 &urbs[i]->iso_frame_desc[frame]; in alloc_urbs()
747 urbs[i]->dev = usb_dev; in alloc_urbs()
748 urbs[i]->pipe = pipe; in alloc_urbs()
749 urbs[i]->transfer_buffer_length = FRAMES_PER_URB in alloc_urbs()
751 urbs[i]->context = &cdev->data_cb_info[i]; in alloc_urbs()
752 urbs[i]->interval = 1; in alloc_urbs()
753 urbs[i]->number_of_packets = FRAMES_PER_URB; in alloc_urbs()
754 urbs[i]->complete = (dir == SNDRV_PCM_STREAM_CAPTURE) ? in alloc_urbs()
764 int i; in free_urbs() local
769 for (i = 0; i < N_URBS; i++) { in free_urbs()
770 if (!urbs[i]) in free_urbs()
773 usb_kill_urb(urbs[i]); in free_urbs()
774 kfree(urbs[i]->transfer_buffer); in free_urbs()
775 usb_free_urb(urbs[i]); in free_urbs()
783 int i, ret; in snd_usb_caiaq_audio_init() local
857 for (i = 0; i < N_URBS; i++) { in snd_usb_caiaq_audio_init()
858 cdev->data_cb_info[i].cdev = cdev; in snd_usb_caiaq_audio_init()
859 cdev->data_cb_info[i].index = i; in snd_usb_caiaq_audio_init()