25 #include <linux/module.h>
26 #include <linux/kernel.h>
28 #include <linux/types.h>
35 #include <asm/uaccess.h>
40 #define LOGNAME "msnd"
42 #define MSND_MAX_DEVS 4
55 if (i == MSND_MAX_DEVS)
71 if (i == MSND_MAX_DEVS) {
123 while ((count < len) && (f->
len != f->
n)) {
128 nwritten = len -
count;
129 if (nwritten > f->
n - f->
tail)
130 nwritten = f->
n - f->
tail;
134 if (nwritten > len - count)
135 nwritten = len -
count;
154 while ((count < len) && (f->
len != f->
n)) {
159 nwritten = len -
count;
160 if (nwritten > f->
n - f->
tail)
161 nwritten = f->
n - f->
tail;
165 if (nwritten > len - count)
166 nwritten = len -
count;
185 while ((count < len) && (f->
len > 0)) {
191 if (nread > f->
n - f->
head)
192 nread = f->
n - f->
head;
196 if (nread > len - count)
216 while ((count < len) && (f->
len > 0)) {
222 if (nread > f->
n - f->
head)
223 nread = f->
n - f->
head;
227 if (nread > len - count)
245 register unsigned int io = dev->
io;
257 register unsigned int io = dev->
io;
258 register int timeout = 1000;
272 if (msnd_wait_HC0(dev) == 0) {
274 spin_unlock_irqrestore(&dev->
lock, flags);
277 spin_unlock_irqrestore(&dev->
lock, flags);
285 unsigned char mid,
unsigned char low)
287 register unsigned int io = dev->
io;
289 if (msnd_wait_TXDE(dev) == 0) {
310 for (i = 0; i < len; i += 3)
330 if (msnd_wait_TXDE(dev) == 0) {
332 if (dev->
type == msndClassic)
338 spin_unlock_irqrestore(&dev->
lock, flags);
341 spin_unlock_irqrestore(&dev->
lock, flags);
361 if (msnd_wait_TXDE(dev) == 0) {
363 if (dev->
type == msndClassic)
366 spin_unlock_irqrestore(&dev->
lock, flags);
369 spin_unlock_irqrestore(&dev->
lock, flags);