aboutsummaryrefslogtreecommitdiffstats
path: root/include
Commit message (Expand)AuthorAge
* [PATCH] ARM: 2701/1: free up ixp2000 timer 4 for the watchdogLennert Buytenhek2005-06-20
* [PATCH] ARM: 2693/1: Add PCI support for Versatile/PBCatalin Marinas2005-06-20
* [PATCH] ARM: 2686/2: AAEC-2000 Core supportBellido Nicolas2005-06-20
* [PATCH] ARM: Add iomap support for ARMRussell King2005-06-20
* [PATCH] ARM: Add common CACHE_COLOUR macroRussell King2005-06-20
* Merge master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds2005-06-19
|\
| * Merge with ../linux-2.6-smpRussell King2005-06-19
| |\
| | * [PATCH] ARM SMP: Add missed files from Integrator/CP platformRussell King2005-06-19
| | * [PATCH] ARM SMP: Add support for startup of secondary processorsRussell King2005-06-18
| * | [PATCH] ARM SMP: Fix PXA/SA11x0 suspend resume crashRussell King2005-06-19
* | | [PKT_SCHED]: Generic queue management interface for qdiscs using internal skb...Thomas Graf2005-06-19
* | | [IPSEC]: Add XFRMA_SA/XFRMA_POLICY for delete notificationHerbert Xu2005-06-19
* | | [NETLINK]: Introduce NLMSG_NEW macro to better handle netlink flagsThomas Graf2005-06-19
* | | [RTNETLINK]: Add RTA_(PUT|GET) shortcuts for u8, u16, and flagThomas Graf2005-06-19
* | | [NETLINK]: Fix RTA_NEST_CANCEL().Thomas Graf2005-06-19
* | | [NEIGHBOUR]: Remove unused fields in struct neigh_parms and neigh_tableThomas Graf2005-06-19
* | | [NETLINK]: Neighbour table configuration and statistics via rtnetlinkThomas Graf2005-06-19
* | | [NETLINK] Routing attribute related shortcutsThomas Graf2005-06-19
* | | [NETLINK]: New message building macrosThomas Graf2005-06-19
* | | [NET]: Move sysctl_max_syn_backlog into request_sock.cDavid S. Miller2005-06-19
* | | [NET] rename struct tcp_listen_opt to struct listen_sockArnaldo Carvalho de Melo2005-06-19
* | | [NET] Generalise tcp_listen_optArnaldo Carvalho de Melo2005-06-19
* | | [NET] Rename open_request to request_sockArnaldo Carvalho de Melo2005-06-19
* | | [NET] Generalise TCP's struct open_request minisock infrastructureArnaldo Carvalho de Melo2005-06-19
* | | [SLAB] Introduce kmem_cache_nameArnaldo Carvalho de Melo2005-06-19
* | | [IPSEC] Use XFRM_MSG_* instead of XFRM_SAP_*Herbert Xu2005-06-19
* | | [IPSEC] Turn km_event.data into a unionHerbert Xu2005-06-19
* | | [IPSEC] Kill spurious hard expire messagesHerbert Xu2005-06-19
* | | [IPSEC] Add complete xfrm event notificationJamal Hadi Salim2005-06-19
|/ /
* | Merge master.kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6Linus Torvalds2005-06-18
|\ \
| * | Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitDavid Woodhouse2005-06-18
| |\|
| * | Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitDavid Woodhouse2005-06-02
| |\ \
| * | | AUDIT: Record working directory when syscall arguments are pathnamesDavid Woodhouse2005-05-27
| * | | AUDIT: Assign serial number to non-syscall messagesDavid Woodhouse2005-05-21
| * | | AUDIT: Avoid sleeping function in SElinux AVC audit.Stephen Smalley2005-05-20
| * | | Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitDavid Woodhouse2005-05-19
| |\ \ \
| * | | | AUDIT: Treat all user messages identically.David Woodhouse2005-05-18
| * | | | AUDIT: Capture sys_socketcall arguments and sockaddrs David Woodhouse2005-05-17
| * | | | Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitDavid Woodhouse2005-05-17
| |\ \ \ \
| * | | | | AUDIT: Fix some spelling errorsSteve Grubb2005-05-13
| * | | | | AUDIT: Add message types to audit recordsSteve Grubb2005-05-13
| * | | | | Add missing asm-ppc/seccomp.h. Must learn to use git properly.David Woodhouse2005-05-11
| * | | | | Add audit_log_typeChris Wright2005-05-11
| * | | | | Move ifdef CONFIG_AUDITSYSCALL to headerChris Wright2005-05-11
| * | | | | Add CONFIG_AUDITSC and CONFIG_SECCOMP support for ppc32David Woodhouse2005-05-08
| * | | | | Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitDavid Woodhouse2005-05-08
| |\ \ \ \ \
| * | | | | | The attached patch addresses the problem with getting the audit daemon Steve Grubb2005-05-06
* | | | | | | Merge 'upstream-2.6.13' branch of rsync://rsync.kernel.org/pub/scm/linux/kern...Linus Torvalds2005-06-18
|\ \ \ \ \ \ \
| * \ \ \ \ \ \ Merge /spare/repo/linux-2.6/Jeff Garzik2005-06-18
| |\ \ \ \ \ \ \ | | | |_|_|_|_|/ | | |/| | | | |
| * | | | | | | Automatic merge of /spare/repo/linux-2.6/.git branch HEAD2005-06-03
| |\ \ \ \ \ \ \
idi_in_buf[dev], data); wake_up(&input_sleeper[dev]); } } static void midi_output_intr(int dev) { /* * Currently NOP */ } static void midi_poll(unsigned long dummy) { unsigned long flags; int dev; spin_lock_irqsave(&lock, flags); if (open_devs) { for (dev = 0; dev < num_midis; dev++) if (midi_devs[dev] != NULL && midi_out_buf[dev] != NULL) { int ok = 1; while (DATA_AVAIL(midi_out_buf[dev]) && ok) { int c = midi_out_buf[dev]->queue[midi_out_buf[dev]->head]; spin_unlock_irqrestore(&lock,flags);/* Give some time to others */ ok = midi_devs[dev]->outputc(dev, c); spin_lock_irqsave(&lock, flags); midi_out_buf[dev]->head = (midi_out_buf[dev]->head + 1) % MAX_QUEUE_SIZE; midi_out_buf[dev]->len--; } if (DATA_AVAIL(midi_out_buf[dev]) < 100) wake_up(&midi_sleeper[dev]); } poll_timer.expires = (1) + jiffies; add_timer(&poll_timer); /* * Come back later */ } spin_unlock_irqrestore(&lock, flags); } int MIDIbuf_open(int dev, struct file *file) { int mode, err; dev = dev >> 4; mode = translate_mode(file); if (num_midis > MAX_MIDI_DEV) { printk(KERN_ERR "midi: Too many midi interfaces\n"); num_midis = MAX_MIDI_DEV; } if (dev < 0 || dev >= num_midis || midi_devs[dev] == NULL) return -ENXIO; /* * Interrupts disabled. Be careful */ module_put(midi_devs[dev]->owner); if ((err = midi_devs[dev]->open(dev, mode, midi_input_intr, midi_output_intr)) < 0) return err; parms[dev].prech_timeout = MAX_SCHEDULE_TIMEOUT; midi_in_buf[dev] = (struct midi_buf *) vmalloc(sizeof(struct midi_buf)); if (midi_in_buf[dev] == NULL) { printk(KERN_WARNING "midi: Can't allocate buffer\n"); midi_devs[dev]->close(dev); return -EIO; } midi_in_buf[dev]->len = midi_in_buf[dev]->head = midi_in_buf[dev]->tail = 0; midi_out_buf[dev] = (struct midi_buf *) vmalloc(sizeof(struct midi_buf)); if (midi_out_buf[dev] == NULL) { printk(KERN_WARNING "midi: Can't allocate buffer\n"); midi_devs[dev]->close(dev); vfree(midi_in_buf[dev]); midi_in_buf[dev] = NULL; return -EIO; } midi_out_buf[dev]->len = midi_out_buf[dev]->head = midi_out_buf[dev]->tail = 0; open_devs++; init_waitqueue_head(&midi_sleeper[dev]); init_waitqueue_head(&input_sleeper[dev]); if (open_devs < 2) /* This was first open */ { poll_timer.expires = 1 + jiffies; add_timer(&poll_timer); /* Start polling */ } return err; } void MIDIbuf_release(int dev, struct file *file) { int mode; dev = dev >> 4; mode = translate_mode(file); if (dev < 0 || dev >= num_midis || midi_devs[dev] == NULL) return; /* * Wait until the queue is empty */ if (mode != OPEN_READ) { midi_devs[dev]->outputc(dev, 0xfe); /* * Active sensing to shut the * devices */ while (!signal_pending(current) && DATA_AVAIL(midi_out_buf[dev])) interruptible_sleep_on(&midi_sleeper[dev]); /* * Sync */ drain_midi_queue(dev); /* * Ensure the output queues are empty */ } midi_devs[dev]->close(dev); open_devs--; if (open_devs == 0) del_timer_sync(&poll_timer); vfree(midi_in_buf[dev]); vfree(midi_out_buf[dev]); midi_in_buf[dev] = NULL; midi_out_buf[dev] = NULL; module_put(midi_devs[dev]->owner); } int MIDIbuf_write(int dev, struct file *file, const char __user *buf, int count) { int c, n, i; unsigned char tmp_data; dev = dev >> 4; if (!count) return 0; c = 0; while (c < count) { n = SPACE_AVAIL(midi_out_buf[dev]); if (n == 0) { /* * No space just now. */ if (file->f_flags & O_NONBLOCK) { c = -EAGAIN; goto out; } interruptible_sleep_on(&midi_sleeper[dev]); if (signal_pending(current)) { c = -EINTR; goto out; } n = SPACE_AVAIL(midi_out_buf[dev]); } if (n > (count - c)) n = count - c; for (i = 0; i < n; i++) { /* BROKE BROKE BROKE - CANT DO THIS WITH CLI !! */ /* yes, think the same, so I removed the cli() brackets QUEUE_BYTE is protected against interrupts */ if (copy_from_user((char *) &tmp_data, &(buf)[c], 1)) { c = -EFAULT; goto out; } QUEUE_BYTE(midi_out_buf[dev], tmp_data); c++; } } out: return c; } int MIDIbuf_read(int dev, struct file *file, char __user *buf, int count) { int n, c = 0; unsigned char tmp_data; dev = dev >> 4; if (!DATA_AVAIL(midi_in_buf[dev])) { /* * No data yet, wait */ if (file->f_flags & O_NONBLOCK) { c = -EAGAIN; goto out; } interruptible_sleep_on_timeout(&input_sleeper[dev], parms[dev].prech_timeout); if (signal_pending(current)) c = -EINTR; /* The user is getting restless */ } if (c == 0 && DATA_AVAIL(midi_in_buf[dev])) /* * Got some bytes */ { n = DATA_AVAIL(midi_in_buf[dev]); if (n > count) n = count; c = 0; while (c < n) { char *fixit; REMOVE_BYTE(midi_in_buf[dev], tmp_data); fixit = (char *) &tmp_data; /* BROKE BROKE BROKE */ /* yes removed the cli() brackets again should q->len,tail&head be atomic_t? */ if (copy_to_user(&(buf)[c], fixit, 1)) { c = -EFAULT; goto out; } c++; } } out: return c; } int MIDIbuf_ioctl(int dev, struct file *file, unsigned int cmd, void __user *arg) { int val; dev = dev >> 4; if (((cmd >> 8) & 0xff) == 'C') { if (midi_devs[dev]->coproc) /* Coprocessor ioctl */ return midi_devs[dev]->coproc->ioctl(midi_devs[dev]->coproc->devc, cmd, arg, 0); /* printk("/dev/midi%d: No coprocessor for this device\n", dev);*/ return -ENXIO; } else { switch (cmd) { case SNDCTL_MIDI_PRETIME: if (get_user(val, (int __user *)arg)) return -EFAULT; if (val < 0) val = 0; val = (HZ * val) / 10; parms[dev].prech_timeout = val; return put_user(val, (int __user *)arg); default: if (!midi_devs[dev]->ioctl) return -EINVAL; return midi_devs[dev]->ioctl(dev, cmd, arg); } } } /* No kernel lock - fine */ unsigned int MIDIbuf_poll(int dev, struct file *file, poll_table * wait) { unsigned int mask = 0; dev = dev >> 4; /* input */ poll_wait(file, &input_sleeper[dev], wait); if (DATA_AVAIL(midi_in_buf[dev])) mask |= POLLIN | POLLRDNORM; /* output */ poll_wait(file, &midi_sleeper[dev], wait); if (!SPACE_AVAIL(midi_out_buf[dev])) mask |= POLLOUT | POLLWRNORM; return mask; } void MIDIbuf_init(void) { /* drag in midi_syms.o */ { extern char midi_syms_symbol; midi_syms_symbol = 0; } } int MIDIbuf_avail(int dev) { if (midi_in_buf[dev]) return DATA_AVAIL (midi_in_buf[dev]); return 0; }