Lines Matching refs:count
96 size_t count) in snd_rawmidi_ready_append() argument
100 (!substream->append || runtime->avail >= count); in snd_rawmidi_ready_append()
894 const unsigned char *buffer, int count) in snd_rawmidi_receive() argument
908 if (count == 1) { /* special case, faster code */ in snd_rawmidi_receive()
919 substream->bytes += count; in snd_rawmidi_receive()
921 if (count1 > count) in snd_rawmidi_receive()
922 count1 = count; in snd_rawmidi_receive()
929 count -= count1; in snd_rawmidi_receive()
931 if (count > 0) { in snd_rawmidi_receive()
933 count1 = count; in snd_rawmidi_receive()
936 runtime->xruns += count - count1; in snd_rawmidi_receive()
959 unsigned char *kernelbuf, long count) in snd_rawmidi_kernel_read1() argument
967 while (count > 0 && runtime->avail) { in snd_rawmidi_kernel_read1()
969 if (count1 > count) in snd_rawmidi_kernel_read1()
970 count1 = count; in snd_rawmidi_kernel_read1()
991 count -= count1; in snd_rawmidi_kernel_read1()
998 unsigned char *buf, long count) in snd_rawmidi_kernel_read() argument
1001 return snd_rawmidi_kernel_read1(substream, NULL/*userbuf*/, buf, count); in snd_rawmidi_kernel_read()
1005 static ssize_t snd_rawmidi_read(struct file *file, char __user *buf, size_t count, in snd_rawmidi_read() argument
1021 while (count > 0) { in snd_rawmidi_read()
1047 count); in snd_rawmidi_read()
1052 count -= count1; in snd_rawmidi_read()
1090 unsigned char *buffer, int count) in __snd_rawmidi_transmit_peek() argument
1105 if (count == 1) { /* special case, faster code */ in __snd_rawmidi_transmit_peek()
1110 if (count1 > count) in __snd_rawmidi_transmit_peek()
1111 count1 = count; in __snd_rawmidi_transmit_peek()
1115 count -= count1; in __snd_rawmidi_transmit_peek()
1117 if (count > 0) { in __snd_rawmidi_transmit_peek()
1118 if (count > (int)(runtime->buffer_size - runtime->avail - count1)) in __snd_rawmidi_transmit_peek()
1119 count = runtime->buffer_size - runtime->avail - count1; in __snd_rawmidi_transmit_peek()
1120 memcpy(buffer + count1, runtime->buffer, count); in __snd_rawmidi_transmit_peek()
1121 result += count; in __snd_rawmidi_transmit_peek()
1144 unsigned char *buffer, int count) in snd_rawmidi_transmit_peek() argument
1151 result = __snd_rawmidi_transmit_peek(substream, buffer, count); in snd_rawmidi_transmit_peek()
1164 int __snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count) in __snd_rawmidi_transmit_ack() argument
1173 snd_BUG_ON(runtime->avail + count > runtime->buffer_size); in __snd_rawmidi_transmit_ack()
1174 runtime->hw_ptr += count; in __snd_rawmidi_transmit_ack()
1176 runtime->avail += count; in __snd_rawmidi_transmit_ack()
1177 substream->bytes += count; in __snd_rawmidi_transmit_ack()
1178 if (count > 0) { in __snd_rawmidi_transmit_ack()
1182 return count; in __snd_rawmidi_transmit_ack()
1197 int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count) in snd_rawmidi_transmit_ack() argument
1204 result = __snd_rawmidi_transmit_ack(substream, count); in snd_rawmidi_transmit_ack()
1221 unsigned char *buffer, int count) in snd_rawmidi_transmit() argument
1231 count = __snd_rawmidi_transmit_peek(substream, buffer, count); in snd_rawmidi_transmit()
1232 if (count <= 0) in snd_rawmidi_transmit()
1233 result = count; in snd_rawmidi_transmit()
1235 result = __snd_rawmidi_transmit_ack(substream, count); in snd_rawmidi_transmit()
1245 long count) in snd_rawmidi_kernel_write1() argument
1260 if ((long)runtime->avail < count) { in snd_rawmidi_kernel_write1()
1265 while (count > 0 && runtime->avail > 0) { in snd_rawmidi_kernel_write1()
1267 if (count1 > count) in snd_rawmidi_kernel_write1()
1268 count1 = count; in snd_rawmidi_kernel_write1()
1292 count -= count1; in snd_rawmidi_kernel_write1()
1303 const unsigned char *buf, long count) in snd_rawmidi_kernel_write() argument
1305 return snd_rawmidi_kernel_write1(substream, NULL, buf, count); in snd_rawmidi_kernel_write()
1310 size_t count, loff_t *offset) in snd_rawmidi_write() argument
1322 if (substream->append && count > runtime->buffer_size) in snd_rawmidi_write()
1325 while (count > 0) { in snd_rawmidi_write()
1327 while (!snd_rawmidi_ready_append(substream, count)) { in snd_rawmidi_write()
1348 count1 = snd_rawmidi_kernel_write1(substream, buf, NULL, count); in snd_rawmidi_write()
1353 if ((size_t)count1 < count && (file->f_flags & O_NONBLOCK)) in snd_rawmidi_write()
1355 count -= count1; in snd_rawmidi_write()
1500 int count) in snd_rawmidi_alloc_substreams() argument
1505 for (idx = 0; idx < count; idx++) { in snd_rawmidi_alloc_substreams()