Lines Matching refs:midi
403 } midi; member
1414 if (s->midi.icnt < MIDIINBUF) { in cm_handle_midi()
1415 s->midi.ibuf[s->midi.iwr] = ch; in cm_handle_midi()
1416 s->midi.iwr = (s->midi.iwr + 1) % MIDIINBUF; in cm_handle_midi()
1417 s->midi.icnt++; in cm_handle_midi()
1422 wake_up(&s->midi.iwait); in cm_handle_midi()
1424 while (!(inb(s->iomidi+1) & 0x40) && s->midi.ocnt > 0) { in cm_handle_midi()
1425 outb(s->midi.obuf[s->midi.ord], s->iomidi); in cm_handle_midi()
1426 s->midi.ord = (s->midi.ord + 1) % MIDIOUTBUF; in cm_handle_midi()
1427 s->midi.ocnt--; in cm_handle_midi()
1428 if (s->midi.ocnt < MIDIOUTBUF-16) in cm_handle_midi()
1432 wake_up(&s->midi.owait); in cm_handle_midi()
1471 s->midi.timer.expires = jiffies+1; in cm_midi_timer()
1472 add_timer(&s->midi.timer); in cm_midi_timer()
2729 add_wait_queue(&s->midi.iwait, &wait); in cm_midi_read()
2732 ptr = s->midi.ird; in cm_midi_read()
2734 if (s->midi.icnt < cnt) in cm_midi_read()
2735 cnt = s->midi.icnt; in cm_midi_read()
2757 if (copy_to_user(buffer, s->midi.ibuf + ptr, cnt)) in cm_midi_read()
2765 s->midi.ird = ptr; in cm_midi_read()
2766 s->midi.icnt -= cnt; in cm_midi_read()
2774 remove_wait_queue(&s->midi.iwait, &wait); in cm_midi_read()
2795 add_wait_queue(&s->midi.owait, &wait); in cm_midi_write()
2798 ptr = s->midi.owr; in cm_midi_write()
2800 if (s->midi.ocnt + cnt > MIDIOUTBUF) in cm_midi_write()
2801 cnt = MIDIOUTBUF - s->midi.ocnt; in cm_midi_write()
2824 if (copy_from_user(s->midi.obuf + ptr, buffer, cnt)) in cm_midi_write()
2832 s->midi.owr = ptr; in cm_midi_write()
2833 s->midi.ocnt += cnt; in cm_midi_write()
2843 remove_wait_queue(&s->midi.owait, &wait); in cm_midi_write()
2855 poll_wait(file, &s->midi.owait, wait); in cm_midi_poll()
2857 poll_wait(file, &s->midi.iwait, wait); in cm_midi_poll()
2860 if (s->midi.icnt > 0) in cm_midi_poll()
2864 if (s->midi.ocnt < MIDIOUTBUF) in cm_midi_poll()
2907 s->midi.ird = s->midi.iwr = s->midi.icnt = 0; in cm_midi_open()
2908 s->midi.ord = s->midi.owr = s->midi.ocnt = 0; in cm_midi_open()
2917 s->midi.ird = s->midi.iwr = s->midi.icnt = 0; in cm_midi_open()
2918 init_timer(&s->midi.timer); in cm_midi_open()
2919 s->midi.timer.expires = jiffies+1; in cm_midi_open()
2920 s->midi.timer.data = (unsigned long)s; in cm_midi_open()
2921 s->midi.timer.function = cm_midi_timer; in cm_midi_open()
2922 add_timer(&s->midi.timer); in cm_midi_open()
2925 s->midi.ird = s->midi.iwr = s->midi.icnt = 0; in cm_midi_open()
2928 s->midi.ord = s->midi.owr = s->midi.ocnt = 0; in cm_midi_open()
2949 add_wait_queue(&s->midi.owait, &wait); in cm_midi_release()
2952 count = s->midi.ocnt; in cm_midi_release()
2959 remove_wait_queue(&s->midi.owait, &wait); in cm_midi_release()
2968 remove_wait_queue(&s->midi.owait, &wait); in cm_midi_release()
2975 del_timer(&s->midi.timer); in cm_midi_release()
3341 init_waitqueue_head(&s->midi.iwait); in cm_probe()
3342 init_waitqueue_head(&s->midi.owait); in cm_probe()