Commit 1a92894a authored by Linus Torvalds's avatar Linus Torvalds

- Revert TCP delayed ACK fix, and fix correctly.

  We should not send an ack if we don't have any pending
  (in which case the DACK timer will be set)     (Dave Miller)
parent a054f123
...@@ -148,7 +148,7 @@ in some standard tools. Check in /proc/net/rt_local to verify their ...@@ -148,7 +148,7 @@ in some standard tools. Check in /proc/net/rt_local to verify their
presence. presence.
To turn on IP forwarding, issue the following command: echo 1 > To turn on IP forwarding, issue the following command: echo 1 >
/proc/sys/net/ipv4/ip_forwarding /proc/sys/net/ipv4/ip_forward
To run bootpd, you'll need to issue the following command: echo 1 To run bootpd, you'll need to issue the following command: echo 1
>/proc/sys/net/ipv4/ip_boot_agent >/proc/sys/net/ipv4/ip_boot_agent
......
...@@ -6571,12 +6571,6 @@ CONFIG_JOYSTICK ...@@ -6571,12 +6571,6 @@ CONFIG_JOYSTICK
be called joystick.o. If you want to compile it as a module, say M be called joystick.o. If you want to compile it as a module, say M
here and read Documentation/modules.txt. here and read Documentation/modules.txt.
ARC console time
CONFIG_RTC_ARC
If you boot your Alpha using the ARC firmware, say Y here. This option
adjusts the RTC clock to take into account the different starting epoch
used by ARC.
Sound card support Sound card support
CONFIG_SOUND CONFIG_SOUND
If you have a Sound Card in your Computer, i.e. if it can say more If you have a Sound Card in your Computer, i.e. if it can say more
...@@ -6612,6 +6606,16 @@ CONFIG_SB ...@@ -6612,6 +6606,16 @@ CONFIG_SB
an unknown card you may answer Y if the card claims to be an unknown card you may answer Y if the card claims to be
SoundBlaster compatible. SoundBlaster compatible.
Are you using the IBM Mwave "emulation" of SB ?
CONFIG_SB_MWAVE
The IBM Mwave can do whats loosely describable as emulation of an 8bit
soundblaster if you load the right firmware from DOS warm boot and pray
and your machine happens to like you. Say Y if you are doing this as the
IRQ test normally fails on the mwave emulation. If you'd like real MWAVE
support phone IBM (425-556-8822) and ask them why they still haven't
released any documentation.
[http://204.200.238.31/cgi-bin/link.pl?co=i&cl=/ts/ibm/contact.html]
Generic OPL2/OPL3 FM synthesizer support Generic OPL2/OPL3 FM synthesizer support
CONFIG_ADLIB CONFIG_ADLIB
Answer Y if your card has a FM chip made by Yamaha (OPL2/OPL3/OPL4). Answer Y if your card has a FM chip made by Yamaha (OPL2/OPL3/OPL4).
......
...@@ -16,6 +16,7 @@ usage. ...@@ -16,6 +16,7 @@ usage.
Currently, these files are in /proc/sys/vm: Currently, these files are in /proc/sys/vm:
- bdflush - bdflush
- buffermem
- freepages - freepages
- overcommit_memory - overcommit_memory
- swapctl - swapctl
...@@ -88,11 +89,27 @@ number of jiffies per second is 100, except on Alpha machines ...@@ -88,11 +89,27 @@ number of jiffies per second is 100, except on Alpha machines
age_super is for filesystem metadata. age_super is for filesystem metadata.
============================================================== ==============================================================
buffermem:
The three values in this file correspond to the values in
the struct buffer_mem. It controls how much memory should
be used for buffer and cache memory. Note that memorymapped
files are also counted as cache memory...
The values are:
min_percent -- this is the minumum percentage of memory
that should be spent on buffer + page cache
borrow_percent -- when Linux is short on memory, and buffer
and cache use more than this percentage of
memory, free pages are stolen from them
max_percent -- this is the maximum amount of memory that
can be used for buffer and cache memory
==============================================================
freepages: freepages:
This file contains three values: min_free_pages, free_pages_low This file contains the values in the struct freepages. That
and free_pages_high in order. struct contains three members: min, low and high.
These numbers are used by the VM subsystem to keep a reasonable These numbers are used by the VM subsystem to keep a reasonable
number of pages on the free page list, so that programs can number of pages on the free page list, so that programs can
...@@ -100,25 +117,23 @@ allocate new pages without having to wait for the system to ...@@ -100,25 +117,23 @@ allocate new pages without having to wait for the system to
free used pages first. The actual freeing of pages is done free used pages first. The actual freeing of pages is done
by kswapd, a kernel daemon. by kswapd, a kernel daemon.
min_free_pages -- when the number of free pages reaches this min -- when the number of free pages reaches this
level, only the kernel can allocate memory level, only the kernel can allocate memory
for _critical_ tasks only for _critical_ tasks only
free_pages_low -- when the number of free pages drops below low -- when the number of free pages drops below
this level, kswapd is woken up immediately this level, kswapd is woken up immediately
free_pages_high -- this is kswapd's target, when more than high -- this is kswapd's target, when more than <high>
free_pages_high pages are free, kswapd will pages are free, kswapd will stop swapping.
stop swapping.
When the number of free pages is between free_pages_low and When the number of free pages is between low and high,
free_pages_high, and kswapd hasn't run for swapout_interval and kswapd hasn't run for swapout_interval jiffies, then
jiffies, then kswapd is woken up too. See swapout_interval kswapd is woken up too. See swapout_interval for more info.
for more info.
When free memory is always low on your system, and kswapd has When free memory is always low on your system, and kswapd has
trouble keeping up with allocations, you might want to trouble keeping up with allocations, you might want to
increase these values, especially free_pages_high and perhaps increase these values, especially high and perhaps low.
free_pages_low. I've found that a 1:2:4 relation for these I've found that a 1:2:4 relation for these values tend to work
values tend to work rather well in a heavily loaded system. rather well in a heavily loaded system.
============================================================== ==============================================================
...@@ -163,9 +178,7 @@ static inline int vm_enough_memory(long pages) ...@@ -163,9 +178,7 @@ static inline int vm_enough_memory(long pages)
swapctl: swapctl:
This file contains no less than 16 variables, of which about This file contains no less than 8 variables.
half is actually used :-) In the listing below, the unused
variables are marked as such.
All of these values are used by kswapd, and the usage can be All of these values are used by kswapd, and the usage can be
found in linux/mm/vmscan.c. found in linux/mm/vmscan.c.
...@@ -177,18 +190,10 @@ typedef struct swap_control_v5 ...@@ -177,18 +190,10 @@ typedef struct swap_control_v5
unsigned int sc_page_advance; unsigned int sc_page_advance;
unsigned int sc_page_decline; unsigned int sc_page_decline;
unsigned int sc_page_initial_age; unsigned int sc_page_initial_age;
unsigned int sc_max_buff_age; /* unused */
unsigned int sc_buff_advance; /* unused */
unsigned int sc_buff_decline; /* unused */
unsigned int sc_buff_initial_age; /* unused */
unsigned int sc_age_cluster_fract; unsigned int sc_age_cluster_fract;
unsigned int sc_age_cluster_min; unsigned int sc_age_cluster_min;
unsigned int sc_pageout_weight; unsigned int sc_pageout_weight;
unsigned int sc_bufferout_weight; unsigned int sc_bufferout_weight;
unsigned int sc_buffer_grace; /* unused */
unsigned int sc_nr_buffs_to_free; /* unused */
unsigned int sc_nr_pages_to_free; /* unused */
enum RCL_POLICY sc_policy; /* RCL_PERSIST hardcoded */
} swap_control_v5; } swap_control_v5;
-------------------------------------------------------------- --------------------------------------------------------------
...@@ -207,9 +212,8 @@ is adjusted according to the following scheme: ...@@ -207,9 +212,8 @@ is adjusted according to the following scheme:
(default 1) (default 1)
And when a page reaches age 0, it's ready to be swapped out. And when a page reaches age 0, it's ready to be swapped out.
The variables sc_age_cluster_fract till sc_bufferout_weight The next four variables can be used to control kswapd's
have to do with the amount of scanning kswapd is doing on agressiveness in swapping out pages.
each call to try_to_swap_out().
sc_age_cluster_fract is used to calculate how many pages from sc_age_cluster_fract is used to calculate how many pages from
a process are to be scanned by kswapd. The formula used is a process are to be scanned by kswapd. The formula used is
...@@ -221,9 +225,12 @@ also scan small processes. ...@@ -221,9 +225,12 @@ also scan small processes.
The values of sc_pageout_weight and sc_bufferout_weight are The values of sc_pageout_weight and sc_bufferout_weight are
used to control the how many tries kswapd will do in order used to control the how many tries kswapd will do in order
to swapout one page / buffer. As with sc_age_cluster_fract, to swapout one page / buffer. These values can be used to
the actual value is calculated by several more or less complex finetune the ratio between user pages and buffer/cache memory.
formulae and the default value is good for every purpose. When you find that your Linux system is swapping out too much
process pages in order to satisfy buffer memory demands, you
might want to either increase sc_bufferout_weight, or decrease
the value of sc_pageout_weight.
============================================================== ==============================================================
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
*/ */
.text .text
#include <linux/config.h>
#include <linux/tasks.h> #include <linux/tasks.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/segment.h> #include <asm/segment.h>
......
...@@ -513,7 +513,7 @@ void print_IO_APIC (void) ...@@ -513,7 +513,7 @@ void print_IO_APIC (void)
return; return;
} }
void init_sym_mode (void) static void init_sym_mode (void)
{ {
printk("enabling Symmetric IO mode ... "); printk("enabling Symmetric IO mode ... ");
outb (0x70, 0x22); outb (0x70, 0x22);
...@@ -521,6 +521,14 @@ void init_sym_mode (void) ...@@ -521,6 +521,14 @@ void init_sym_mode (void)
printk("...done.\n"); printk("...done.\n");
} }
void init_pic_mode (void)
{
printk("disabling Symmetric IO mode ... ");
outb (0x70, 0x22);
outb (0x00, 0x23);
printk("...done.\n");
}
char ioapic_OEM_ID [16]; char ioapic_OEM_ID [16];
char ioapic_Product_ID [16]; char ioapic_Product_ID [16];
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/stddef.h>
/* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */ /* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */
static void set_bitmap(unsigned long *bitmap, short base, short extent, int new_value) static void set_bitmap(unsigned long *bitmap, short base, short extent, int new_value)
...@@ -53,12 +54,25 @@ static void set_bitmap(unsigned long *bitmap, short base, short extent, int new_ ...@@ -53,12 +54,25 @@ static void set_bitmap(unsigned long *bitmap, short base, short extent, int new_
*/ */
asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int turn_on) asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int turn_on)
{ {
struct thread_struct * t = &current->tss;
if ((from + num <= from) || (from + num > IO_BITMAP_SIZE*32)) if ((from + num <= from) || (from + num > IO_BITMAP_SIZE*32))
return -EINVAL; return -EINVAL;
if (!suser()) if (!suser())
return -EPERM; return -EPERM;
/*
* If it's the first ioperm() call in this thread's lifetime, set the
* IO bitmap up. ioperm() is much less timing critical than clone(),
* this is why we delay this operation until now:
*/
#define IO_BITMAP_OFFSET offsetof(struct thread_struct,io_bitmap)
if (t->bitmap != IO_BITMAP_OFFSET) {
t->bitmap = IO_BITMAP_OFFSET;
memset(t->io_bitmap,0xff,(IO_BITMAP_SIZE+1)*4);
}
set_bitmap((unsigned long *)current->tss.io_bitmap, from, num, !turn_on); set_bitmap((unsigned long *)t->io_bitmap, from, num, !turn_on);
return 0; return 0;
} }
......
#ifndef __irq_h #ifndef __irq_h
#define __irq_h #define __irq_h
#include <linux/config.h>
/* /*
* Various low-level irq details needed by irq.c and smp.c * Various low-level irq details needed by irq.c, process.c,
* time.c, io_apic.c and smp.c
* *
* Interrupt entry/exit code at both C and assembly level * Interrupt entry/exit code at both C and assembly level
*/ */
...@@ -20,6 +19,7 @@ void init_IO_APIC_traps(void); ...@@ -20,6 +19,7 @@ void init_IO_APIC_traps(void);
int IO_APIC_get_PCI_irq_vector (int bus, int slot, int fn); int IO_APIC_get_PCI_irq_vector (int bus, int slot, int fn);
void make_8259A_irq (unsigned int irq); void make_8259A_irq (unsigned int irq);
void send_IPI (int dest, int vector); void send_IPI (int dest, int vector);
void init_pic_mode (void);
extern unsigned int io_apic_irqs; extern unsigned int io_apic_irqs;
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#ifdef CONFIG_MATH_EMULATION #ifdef CONFIG_MATH_EMULATION
#include <asm/math_emu.h> #include <asm/math_emu.h>
#endif #endif
#include "irq.h"
#ifdef __SMP__ #ifdef __SMP__
asmlinkage void ret_from_smpfork(void) __asm__("ret_from_smpfork"); asmlinkage void ret_from_smpfork(void) __asm__("ret_from_smpfork");
...@@ -280,6 +281,12 @@ static inline void kb_wait(void) ...@@ -280,6 +281,12 @@ static inline void kb_wait(void)
void machine_restart(char * __unused) void machine_restart(char * __unused)
{ {
#if __SMP__
/*
* turn off the IO-APIC, so we can do a clean reboot
*/
init_pic_mode();
#endif
if(!reboot_thru_bios) { if(!reboot_thru_bios) {
/* rebooting needs to touch the page at absolute addr 0 */ /* rebooting needs to touch the page at absolute addr 0 */
...@@ -510,9 +517,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp, ...@@ -510,9 +517,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
set_ldt_desc(gdt+(nr<<1)+FIRST_LDT_ENTRY,p->ldt, 512); set_ldt_desc(gdt+(nr<<1)+FIRST_LDT_ENTRY,p->ldt, 512);
else else
set_ldt_desc(gdt+(nr<<1)+FIRST_LDT_ENTRY,&default_ldt, 1); set_ldt_desc(gdt+(nr<<1)+FIRST_LDT_ENTRY,&default_ldt, 1);
p->tss.bitmap = offsetof(struct thread_struct,io_bitmap); /*
for (i = 0; i < IO_BITMAP_SIZE+1 ; i++) /* IO bitmap is actually SIZE+1 */ * a bitmap offset pointing outside of the TSS limit causes a nicely
p->tss.io_bitmap[i] = ~0; * controllable SIGSEGV. The first sys_ioperm() call sets up the
* bitmap properly.
*/
p->tss.bitmap = sizeof(struct thread_struct);
if (last_task_used_math == current) if (last_task_used_math == current)
__asm__("clts ; fnsave %0 ; frstor %0":"=m" (p->tss.i387)); __asm__("clts ; fnsave %0 ; frstor %0":"=m" (p->tss.i387));
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
* entries except for the gdt one.. * entries except for the gdt one..
*/ */
#include <linux/config.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/page.h> #include <asm/page.h>
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/mman.h> #include <linux/mman.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/swap.h> #include <linux/swap.h>
#include <linux/swapctl.h>
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
#include <linux/blk.h> #include <linux/blk.h>
#endif #endif
...@@ -172,9 +173,6 @@ paging_init(unsigned long start_mem, unsigned long end_mem)) ...@@ -172,9 +173,6 @@ paging_init(unsigned long start_mem, unsigned long end_mem))
struct cache_palias *sparc_aliases; struct cache_palias *sparc_aliases;
extern int min_free_pages;
extern int free_pages_low;
extern int free_pages_high;
extern void srmmu_frob_mem_map(unsigned long); extern void srmmu_frob_mem_map(unsigned long);
int physmem_mapped_contig = 1; int physmem_mapped_contig = 1;
...@@ -265,11 +263,11 @@ __initfunc(void mem_init(unsigned long start_mem, unsigned long end_mem)) ...@@ -265,11 +263,11 @@ __initfunc(void mem_init(unsigned long start_mem, unsigned long end_mem))
initpages << (PAGE_SHIFT-10), initpages << (PAGE_SHIFT-10),
PAGE_OFFSET, end_mem); PAGE_OFFSET, end_mem);
min_free_pages = nr_free_pages >> 7; freepages.min = nr_free_pages >> 7;
if(min_free_pages < 16) if(freepages.min < 16)
min_free_pages = 16; freepages.min = 16;
free_pages_low = min_free_pages + (min_free_pages >> 1); freepages.low = freepages.min + (freepages.min >> 1);
free_pages_high = min_free_pages + min_free_pages; freepages.high = freepages.min + freepages.min;
} }
void free_initmem (void) void free_initmem (void)
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/fpumacro.h> #include <asm/fpumacro.h>
#include <asm/lsu.h> #include <asm/lsu.h>
#ifdef CONFIG_KERNELD #ifdef CONFIG_KMOD
#include <linux/kerneld.h> #include <linux/kmod.h>
#endif #endif
/* #define SYSCALL_TRACING */ /* #define SYSCALL_TRACING */
...@@ -327,7 +327,7 @@ void do_fpother(struct pt_regs *regs) ...@@ -327,7 +327,7 @@ void do_fpother(struct pt_regs *regs)
case (2 << 14): /* unfinished_FPop */ case (2 << 14): /* unfinished_FPop */
case (3 << 14): /* unimplemented_FPop */ case (3 << 14): /* unimplemented_FPop */
#ifdef CONFIG_MATHEMU_MODULE #ifdef CONFIG_MATHEMU_MODULE
#ifdef CONFIG_KERNELD #ifdef CONFIG_KMOD
if (!handle_mathemu) if (!handle_mathemu)
request_module("math-emu"); request_module("math-emu");
#endif #endif
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/blk.h> #include <linux/blk.h>
#include <linux/swap.h> #include <linux/swap.h>
#include <linux/swapctl.h>
#include <asm/head.h> #include <asm/head.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -864,10 +865,6 @@ paging_init(unsigned long start_mem, unsigned long end_mem)) ...@@ -864,10 +865,6 @@ paging_init(unsigned long start_mem, unsigned long end_mem))
return device_scan (PAGE_ALIGN (start_mem)); return device_scan (PAGE_ALIGN (start_mem));
} }
extern int min_free_pages;
extern int free_pages_low;
extern int free_pages_high;
__initfunc(static void taint_real_pages(unsigned long start_mem, unsigned long end_mem)) __initfunc(static void taint_real_pages(unsigned long start_mem, unsigned long end_mem))
{ {
unsigned long addr, tmp2 = 0; unsigned long addr, tmp2 = 0;
...@@ -946,11 +943,11 @@ __initfunc(void mem_init(unsigned long start_mem, unsigned long end_mem)) ...@@ -946,11 +943,11 @@ __initfunc(void mem_init(unsigned long start_mem, unsigned long end_mem))
initpages << (PAGE_SHIFT-10), initpages << (PAGE_SHIFT-10),
PAGE_OFFSET, end_mem); PAGE_OFFSET, end_mem);
min_free_pages = nr_free_pages >> 7; freepages.low = nr_free_pages >> 7;
if(min_free_pages < 16) if(freepages.low < 16)
min_free_pages = 16; freepages.low = 16;
free_pages_low = min_free_pages + (min_free_pages >> 1); freepages.low = freepages.low + (freepages.low >> 1);
free_pages_high = min_free_pages + min_free_pages; freepages.high = freepages.low + freepages.low;
} }
void free_initmem (void) void free_initmem (void)
......
...@@ -840,7 +840,7 @@ static void add_stripe_bh (struct stripe_head *sh, struct buffer_head *bh, int d ...@@ -840,7 +840,7 @@ static void add_stripe_bh (struct stripe_head *sh, struct buffer_head *bh, int d
if (sh->bh_new[dd_idx]) { if (sh->bh_new[dd_idx]) {
printk("raid5: bug: stripe->bh_new[%d], sector %lu exists\n", dd_idx, sh->sector); printk("raid5: bug: stripe->bh_new[%d], sector %lu exists\n", dd_idx, sh->sector);
printk("forcing oops.\n"); printk("forcing oops.\n");
*(int*)=0; *(int*)0=0;
} }
set_bit(BH_Lock, &bh->b_state); set_bit(BH_Lock, &bh->b_state);
......
...@@ -106,11 +106,6 @@ if [ "$CONFIG_WATCHDOG" != "n" ]; then ...@@ -106,11 +106,6 @@ if [ "$CONFIG_WATCHDOG" != "n" ]; then
tristate ' Acquire SBC Watchdog Timer' CONFIG_ACQUIRE_WDT tristate ' Acquire SBC Watchdog Timer' CONFIG_ACQUIRE_WDT
fi fi
bool 'Enhanced Real Time Clock Support' CONFIG_RTC bool 'Enhanced Real Time Clock Support' CONFIG_RTC
if [ "$CONFIG_RTC" = "y" ]; then
if [ "$ARCH" = "alpha" ]; then
bool ' ARC console time' CONFIG_RTC_ARC y
fi
fi
if [ "$CONFIG_ALPHA_BOOK1" = "y" ]; then if [ "$CONFIG_ALPHA_BOOK1" = "y" ]; then
bool 'Tadpole ANA H8 Support' CONFIG_H8 bool 'Tadpole ANA H8 Support' CONFIG_H8
fi fi
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
* for the QIC-117 floppy-tape driver for Linux. * for the QIC-117 floppy-tape driver for Linux.
*/ */
#include <linux/config.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/mm.h> #include <linux/mm.h>
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
* for the QIC-117 floppy-tape driver for Linux. * for the QIC-117 floppy-tape driver for Linux.
*/ */
#include <linux/config.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/mm.h> #include <linux/mm.h>
......
...@@ -63,13 +63,6 @@ ...@@ -63,13 +63,6 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/system.h> #include <asm/system.h>
/* Adjust starting epoch if ARC console time is being used */
#ifdef CONFIG_RTC_ARC
#define ARCFUDGE 20
#else
#define ARCFUDGE 0
#endif
/* /*
* We sponge a minor off of the misc major. No need slurping * We sponge a minor off of the misc major. No need slurping
* up another valuable major dev number for this. If you add * up another valuable major dev number for this. If you add
...@@ -126,12 +119,8 @@ unsigned char days_in_mo[] = ...@@ -126,12 +119,8 @@ unsigned char days_in_mo[] =
* so that there is no possibility of conflicting with the * so that there is no possibility of conflicting with the
* set_rtc_mmss() call that happens during some timer interrupts. * set_rtc_mmss() call that happens during some timer interrupts.
* (See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.) * (See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.)
*
* On Alpha we won't get any interrupts anyway, as they all end up
* in the system timer code.
*/ */
#ifndef __alpha__
static void rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) static void rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
/* /*
...@@ -152,11 +141,9 @@ static void rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -152,11 +141,9 @@ static void rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
add_timer(&rtc_irq_timer); add_timer(&rtc_irq_timer);
} }
} }
#endif
/* /*
* Now all the various file operations that we export. * Now all the various file operations that we export.
* They are all useless on Alpha... *sigh*.
*/ */
static long long rtc_llseek(struct file *file, loff_t offset, int origin) static long long rtc_llseek(struct file *file, loff_t offset, int origin)
...@@ -167,9 +154,6 @@ static long long rtc_llseek(struct file *file, loff_t offset, int origin) ...@@ -167,9 +154,6 @@ static long long rtc_llseek(struct file *file, loff_t offset, int origin)
static ssize_t rtc_read(struct file *file, char *buf, static ssize_t rtc_read(struct file *file, char *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
#ifdef __alpha__
return -EIO;
#else
struct wait_queue wait = { current, NULL }; struct wait_queue wait = { current, NULL };
unsigned long data; unsigned long data;
ssize_t retval; ssize_t retval;
...@@ -201,7 +185,6 @@ static ssize_t rtc_read(struct file *file, char *buf, ...@@ -201,7 +185,6 @@ static ssize_t rtc_read(struct file *file, char *buf,
remove_wait_queue(&rtc_wait, &wait); remove_wait_queue(&rtc_wait, &wait);
return retval; return retval;
#endif
} }
static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
...@@ -212,7 +195,6 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -212,7 +195,6 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
struct rtc_time wtime; struct rtc_time wtime;
switch (cmd) { switch (cmd) {
#ifndef __alpha__
case RTC_AIE_OFF: /* Mask alarm int. enab. bit */ case RTC_AIE_OFF: /* Mask alarm int. enab. bit */
{ {
mask_rtc_irq_bit(RTC_AIE); mask_rtc_irq_bit(RTC_AIE);
...@@ -260,7 +242,6 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -260,7 +242,6 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
set_rtc_irq_bit(RTC_UIE); set_rtc_irq_bit(RTC_UIE);
return 0; return 0;
} }
#endif
case RTC_ALM_READ: /* Read the present alarm time */ case RTC_ALM_READ: /* Read the present alarm time */
{ {
/* /*
...@@ -335,7 +316,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -335,7 +316,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
sizeof(struct rtc_time))) sizeof(struct rtc_time)))
return -EFAULT; return -EFAULT;
yrs = rtc_tm.tm_year + 1900 + ARCFUDGE; yrs = rtc_tm.tm_year + 1900;
mon = rtc_tm.tm_mon + 1; /* tm_mon starts at zero */ mon = rtc_tm.tm_mon + 1; /* tm_mon starts at zero */
day = rtc_tm.tm_mday; day = rtc_tm.tm_mday;
hrs = rtc_tm.tm_hour; hrs = rtc_tm.tm_hour;
...@@ -400,7 +381,6 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -400,7 +381,6 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
{ {
return put_user(rtc_freq, (unsigned long *)arg); return put_user(rtc_freq, (unsigned long *)arg);
} }
#ifndef __alpha__
case RTC_IRQP_SET: /* Set periodic IRQ rate. */ case RTC_IRQP_SET: /* Set periodic IRQ rate. */
{ {
int tmp = 0; int tmp = 0;
...@@ -437,7 +417,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -437,7 +417,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
restore_flags(flags); restore_flags(flags);
return 0; return 0;
} }
#else /* __alpha__ */ #ifdef __alpha__
case RTC_EPOCH_READ: /* Read the epoch. */ case RTC_EPOCH_READ: /* Read the epoch. */
{ {
return put_user (epoch, (unsigned long *)arg); return put_user (epoch, (unsigned long *)arg);
...@@ -467,18 +447,15 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -467,18 +447,15 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
* We enforce only one user at a time here with the open/close. * We enforce only one user at a time here with the open/close.
* Also clear the previous interrupt data on an open, and clean * Also clear the previous interrupt data on an open, and clean
* up things on a close. * up things on a close.
* On Alpha we just open, for we don't mess with interrups anyway.
*/ */
static int rtc_open(struct inode *inode, struct file *file) static int rtc_open(struct inode *inode, struct file *file)
{ {
#ifndef __alpha__
if(rtc_status & RTC_IS_OPEN) if(rtc_status & RTC_IS_OPEN)
return -EBUSY; return -EBUSY;
rtc_status |= RTC_IS_OPEN; rtc_status |= RTC_IS_OPEN;
rtc_irq_data = 0; rtc_irq_data = 0;
#endif
return 0; return 0;
} }
...@@ -489,7 +466,6 @@ static int rtc_release(struct inode *inode, struct file *file) ...@@ -489,7 +466,6 @@ static int rtc_release(struct inode *inode, struct file *file)
* in use, and clear the data. * in use, and clear the data.
*/ */
#ifndef __alpha__
unsigned char tmp; unsigned char tmp;
unsigned long flags; unsigned long flags;
...@@ -510,11 +486,9 @@ static int rtc_release(struct inode *inode, struct file *file) ...@@ -510,11 +486,9 @@ static int rtc_release(struct inode *inode, struct file *file)
rtc_irq_data = 0; rtc_irq_data = 0;
rtc_status &= ~RTC_IS_OPEN; rtc_status &= ~RTC_IS_OPEN;
#endif
return 0; return 0;
} }
#ifndef __alpha__
static unsigned int rtc_poll(struct file *file, poll_table *wait) static unsigned int rtc_poll(struct file *file, poll_table *wait)
{ {
poll_wait(file, &rtc_wait, wait); poll_wait(file, &rtc_wait, wait);
...@@ -522,7 +496,6 @@ static unsigned int rtc_poll(struct file *file, poll_table *wait) ...@@ -522,7 +496,6 @@ static unsigned int rtc_poll(struct file *file, poll_table *wait)
return POLLIN | POLLRDNORM; return POLLIN | POLLRDNORM;
return 0; return 0;
} }
#endif
/* /*
* The various file operations we support. * The various file operations we support.
...@@ -533,11 +506,7 @@ static struct file_operations rtc_fops = { ...@@ -533,11 +506,7 @@ static struct file_operations rtc_fops = {
rtc_read, rtc_read,
NULL, /* No write */ NULL, /* No write */
NULL, /* No readdir */ NULL, /* No readdir */
#ifdef __alpha__
NULL, /* No select on Alpha */
#else
rtc_poll, rtc_poll,
#endif
rtc_ioctl, rtc_ioctl,
NULL, /* No mmap */ NULL, /* No mmap */
rtc_open, rtc_open,
...@@ -560,14 +529,12 @@ __initfunc(int rtc_init(void)) ...@@ -560,14 +529,12 @@ __initfunc(int rtc_init(void))
char *guess = NULL; char *guess = NULL;
#endif #endif
printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION); printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION);
#ifndef __alpha__
if(request_irq(RTC_IRQ, rtc_interrupt, SA_INTERRUPT, "rtc", NULL)) if(request_irq(RTC_IRQ, rtc_interrupt, SA_INTERRUPT, "rtc", NULL))
{ {
/* Yeah right, seeing as irq 8 doesn't even hit the bus. */ /* Yeah right, seeing as irq 8 doesn't even hit the bus. */
printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ); printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ);
return -EIO; return -EIO;
} }
#endif
misc_register(&rtc_dev); misc_register(&rtc_dev);
/* Check region? Naaah! Just snarf it up. */ /* Check region? Naaah! Just snarf it up. */
request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc"); request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc");
...@@ -599,8 +566,8 @@ __initfunc(int rtc_init(void)) ...@@ -599,8 +566,8 @@ __initfunc(int rtc_init(void))
guess = "Digital UNIX"; guess = "Digital UNIX";
} }
if (guess) if (guess)
printk("rtc: %s epoch (%ld) detected\n", guess, epoch); printk("rtc: %s epoch (%lu) detected\n", guess, epoch);
#else #endif
init_timer(&rtc_irq_timer); init_timer(&rtc_irq_timer);
rtc_irq_timer.function = rtc_dropped_irq; rtc_irq_timer.function = rtc_dropped_irq;
rtc_wait = NULL; rtc_wait = NULL;
...@@ -610,7 +577,6 @@ __initfunc(int rtc_init(void)) ...@@ -610,7 +577,6 @@ __initfunc(int rtc_init(void))
CMOS_WRITE(((CMOS_READ(RTC_FREQ_SELECT) & 0xF0) | 0x06), RTC_FREQ_SELECT); CMOS_WRITE(((CMOS_READ(RTC_FREQ_SELECT) & 0xF0) | 0x06), RTC_FREQ_SELECT);
restore_flags(flags); restore_flags(flags);
rtc_freq = 1024; rtc_freq = 1024;
#endif
return 0; return 0;
} }
...@@ -626,7 +592,6 @@ __initfunc(int rtc_init(void)) ...@@ -626,7 +592,6 @@ __initfunc(int rtc_init(void))
* for something that requires a steady > 1KHz signal anyways.) * for something that requires a steady > 1KHz signal anyways.)
*/ */
#ifndef __alpha__
void rtc_dropped_irq(unsigned long data) void rtc_dropped_irq(unsigned long data)
{ {
unsigned long flags; unsigned long flags;
...@@ -643,7 +608,6 @@ void rtc_dropped_irq(unsigned long data) ...@@ -643,7 +608,6 @@ void rtc_dropped_irq(unsigned long data)
rtc_irq_data |= (CMOS_READ(RTC_INTR_FLAGS) & 0xF0); /* restart */ rtc_irq_data |= (CMOS_READ(RTC_INTR_FLAGS) & 0xF0); /* restart */
restore_flags(flags); restore_flags(flags);
} }
#endif
/* /*
* Info exported via "/proc/rtc". * Info exported via "/proc/rtc".
...@@ -672,9 +636,10 @@ int get_rtc_status(char *buf) ...@@ -672,9 +636,10 @@ int get_rtc_status(char *buf)
*/ */
p += sprintf(p, p += sprintf(p,
"rtc_time\t: %02d:%02d:%02d\n" "rtc_time\t: %02d:%02d:%02d\n"
"rtc_date\t: %04d-%02d-%02d\n", "rtc_date\t: %04d-%02d-%02d\n"
"rtc_epoch\t: %04lu\n",
tm.tm_hour, tm.tm_min, tm.tm_sec, tm.tm_hour, tm.tm_min, tm.tm_sec,
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday); tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, epoch);
get_rtc_alm_time(&tm); get_rtc_alm_time(&tm);
...@@ -788,12 +753,9 @@ void get_rtc_time(struct rtc_time *rtc_tm) ...@@ -788,12 +753,9 @@ void get_rtc_time(struct rtc_time *rtc_tm)
* Account for differences between how the RTC uses the values * Account for differences between how the RTC uses the values
* and how they are defined in a struct rtc_time; * and how they are defined in a struct rtc_time;
*/ */
if ((rtc_tm->tm_year += epoch - 1900) <= 69) if ((rtc_tm->tm_year += (epoch - 1900)) <= 69)
rtc_tm->tm_year += 100; rtc_tm->tm_year += 100;
/* if ARCFUDGE == 0, the optimizer should do away with this */
rtc_tm->tm_year -= ARCFUDGE;
rtc_tm->tm_mon--; rtc_tm->tm_mon--;
} }
...@@ -832,7 +794,6 @@ void get_rtc_alm_time(struct rtc_time *alm_tm) ...@@ -832,7 +794,6 @@ void get_rtc_alm_time(struct rtc_time *alm_tm)
* meddles with the interrupt enable/disable bits. * meddles with the interrupt enable/disable bits.
*/ */
#ifndef __alpha__
void mask_rtc_irq_bit(unsigned char bit) void mask_rtc_irq_bit(unsigned char bit)
{ {
unsigned char val; unsigned char val;
...@@ -862,4 +823,3 @@ void set_rtc_irq_bit(unsigned char bit) ...@@ -862,4 +823,3 @@ void set_rtc_irq_bit(unsigned char bit)
rtc_irq_data = 0; rtc_irq_data = 0;
restore_flags(flags); restore_flags(flags);
} }
#endif
...@@ -83,9 +83,6 @@ static unsigned int ipddp_debug = IPDDP_DEBUG; ...@@ -83,9 +83,6 @@ static unsigned int ipddp_debug = IPDDP_DEBUG;
/* Index to functions, as function prototypes. */ /* Index to functions, as function prototypes. */
static int ipddp_xmit(struct sk_buff *skb, struct device *dev); static int ipddp_xmit(struct sk_buff *skb, struct device *dev);
static struct net_device_stats *ipddp_get_stats(struct device *dev); static struct net_device_stats *ipddp_get_stats(struct device *dev);
static int ipddp_rebuild_header(struct sk_buff *skb);
static int ipddp_hard_header(struct sk_buff *skb, struct device *dev,
unsigned short type, void *daddr, void *saddr, unsigned len);
static int ipddp_create(struct ipddp_route *new_rt); static int ipddp_create(struct ipddp_route *new_rt);
static int ipddp_delete(struct ipddp_route *rt); static int ipddp_delete(struct ipddp_route *rt);
static struct ipddp_route* ipddp_find_route(struct ipddp_route *rt); static struct ipddp_route* ipddp_find_route(struct ipddp_route *rt);
...@@ -119,10 +116,10 @@ int ipddp_init(struct device *dev) ...@@ -119,10 +116,10 @@ int ipddp_init(struct device *dev)
/* Let the user now what mode we are in */ /* Let the user now what mode we are in */
if(ipddp_mode == IPDDP_ENCAP) if(ipddp_mode == IPDDP_ENCAP)
printk("%s: Appletalk-IP Encapsulation mode by Bradford W. Johnson <johns393@maroon.tc.umn.edu>\n", printk("%s: Appletalk-IP Encap. mode by Bradford W. Johnson <johns393@maroon.tc.umn.edu>\n",
dev->name); dev->name);
if(ipddp_mode == IPDDP_DECAP) if(ipddp_mode == IPDDP_DECAP)
printk("%s: Appletalk-IP Decapsulation mode by Jay Schulist <Jay.Schulist@spacs.k12.wi.us>\n", printk("%s: Appletalk-IP Decap. mode by Jay Schulist <Jay.Schulist@spacs.k12.wi.us>\n",
dev->name); dev->name);
/* Fill in the device structure with ethernet-generic values. */ /* Fill in the device structure with ethernet-generic values. */
...@@ -140,8 +137,6 @@ int ipddp_init(struct device *dev) ...@@ -140,8 +137,6 @@ int ipddp_init(struct device *dev)
dev->stop = ipddp_close; dev->stop = ipddp_close;
dev->get_stats = ipddp_get_stats; dev->get_stats = ipddp_get_stats;
dev->do_ioctl = ipddp_ioctl; dev->do_ioctl = ipddp_ioctl;
dev->hard_header = ipddp_hard_header; /* see ip_output.c */
dev->rebuild_header = ipddp_rebuild_header;
dev->type = ARPHRD_IPDDP; /* IP over DDP tunnel */ dev->type = ARPHRD_IPDDP; /* IP over DDP tunnel */
dev->mtu = 585; dev->mtu = 585;
...@@ -157,24 +152,6 @@ int ipddp_init(struct device *dev) ...@@ -157,24 +152,6 @@ int ipddp_init(struct device *dev)
return 0; return 0;
} }
/*
* Transmit LLAP/ELAP frame using aarp_send_ddp.
*/
static int ipddp_xmit(struct sk_buff *skb, struct device *dev)
{
/* Retrieve the saved address hint */
struct at_addr *at = (struct at_addr *)skb->data;
skb_pull(skb,4);
((struct net_device_stats *) dev->priv)->tx_packets++;
((struct net_device_stats *) dev->priv)->tx_bytes+=skb->len;
if(aarp_send_ddp(skb->dev, skb, at, NULL) < 0)
dev_kfree_skb(skb);
return 0;
}
/* /*
* Get the current statistics. This may be called with the card open or closed. * Get the current statistics. This may be called with the card open or closed.
*/ */
...@@ -184,19 +161,15 @@ static struct net_device_stats *ipddp_get_stats(struct device *dev) ...@@ -184,19 +161,15 @@ static struct net_device_stats *ipddp_get_stats(struct device *dev)
} }
/* /*
* Now the packet really wants to go out. On entry skb->data points to the * Transmit LLAP/ELAP frame using aarp_send_ddp.
* ddpehdr we reserved earlier. skb->h.raw will be the higher level header.
*/ */
static int ipddp_rebuild_header(struct sk_buff *skb) static int ipddp_xmit(struct sk_buff *skb, struct device *dev)
{ {
u32 paddr = ((struct rtable*)skb->dst)->rt_gateway; u32 paddr = ((struct rtable*)skb->dst)->rt_gateway;
struct ddpehdr *ddp; struct ddpehdr *ddp;
struct at_addr at;
struct ipddp_route *rt; struct ipddp_route *rt;
struct at_addr *our_addr; struct at_addr *our_addr;
/* Wow! I'll eat my hat if this routine is really called. --ANK */
/* /*
* Find appropriate route to use, based only on IP number. * Find appropriate route to use, based only on IP number.
*/ */
...@@ -205,25 +178,21 @@ static int ipddp_rebuild_header(struct sk_buff *skb) ...@@ -205,25 +178,21 @@ static int ipddp_rebuild_header(struct sk_buff *skb)
if(rt->ip == paddr) if(rt->ip == paddr)
break; break;
} }
if(rt == NULL) if(rt == NULL)
{ return 0;
printk("%s: unreachable dst %s\n", cardname, in_ntoa(paddr));
return -ENETUNREACH;
}
our_addr = atalk_find_dev_addr(rt->dev); our_addr = atalk_find_dev_addr(rt->dev);
if(ipddp_mode == IPDDP_DECAP) if(ipddp_mode == IPDDP_DECAP)
/* /*
* Pull off the excess room that should not be there. * Pull off the excess room that should not be there.
* This is the case for Localtalk, this may not hold * This is due to a hard-header problem. This is the
* true for Ethertalk, etc. * quick fix for now though, till it breaks.
*/ */
skb_pull(skb, 31-(sizeof(struct ddpehdr)+1)); skb_pull(skb, 35-(sizeof(struct ddpehdr)+1));
/* Create the Extended DDP header */ /* Create the Extended DDP header */
ddp = (struct ddpehdr *) (skb->data+4); ddp = (struct ddpehdr *)skb->data;
ddp->deh_len = skb->len; ddp->deh_len = skb->len;
ddp->deh_hops = 1; ddp->deh_hops = 1;
ddp->deh_pad = 0; ddp->deh_pad = 0;
...@@ -231,7 +200,7 @@ static int ipddp_rebuild_header(struct sk_buff *skb) ...@@ -231,7 +200,7 @@ static int ipddp_rebuild_header(struct sk_buff *skb)
/* /*
* For Localtalk we need aarp_send_ddp to strip the * For Localtalk we need aarp_send_ddp to strip the
* Ext DDP header and place a Shrt DDP header on it. * long DDP header and place a shot DDP header on it.
*/ */
if(rt->dev->type == ARPHRD_LOCALTLK) if(rt->dev->type == ARPHRD_LOCALTLK)
{ {
...@@ -248,24 +217,16 @@ static int ipddp_rebuild_header(struct sk_buff *skb) ...@@ -248,24 +217,16 @@ static int ipddp_rebuild_header(struct sk_buff *skb)
ddp->deh_dport = 72; ddp->deh_dport = 72;
ddp->deh_sport = 72; ddp->deh_sport = 72;
*((__u8 *)(ddp+1)) = 22; /* ddp type = IP */ *((__u8 *)(ddp+1)) = 22; /* ddp type = IP */
*((__u16 *)ddp)=ntohs(*((__u16 *)ddp)); /* fix up length field */ *((__u16 *)ddp)=ntohs(*((__u16 *)ddp)); /* fix up length field */
/* Hide it at the start of the buffer, we pull it out in ipddp_xmit */
at = rt->at;
memcpy(skb->data,(void *)&at,sizeof(at));
skb->dev = rt->dev; /* set skb->dev to appropriate device */
skb->protocol = htons(ETH_P_ATALK); /* Protocol has changed */ skb->protocol = htons(ETH_P_ATALK); /* Protocol has changed */
return 0; ((struct net_device_stats *) dev->priv)->tx_packets++;
} ((struct net_device_stats *) dev->priv)->tx_bytes+=skb->len;
static int ipddp_hard_header(struct sk_buff *skb, struct device *dev, if(aarp_send_ddp(rt->dev, skb, &rt->at, NULL) < 0)
unsigned short type, void *daddr, void *saddr, unsigned len) dev_kfree_skb(skb);
{
/* Push down the header space and the type byte */
skb_push(skb, sizeof(struct ddpehdr)+1+4);
return 0; return 0;
} }
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#define SIOCADDIPDDPRT (SIOCDEVPRIVATE) #define SIOCADDIPDDPRT (SIOCDEVPRIVATE)
#define SIOCDELIPDDPRT (SIOCDEVPRIVATE+1) #define SIOCDELIPDDPRT (SIOCDEVPRIVATE+1)
#define SIOCFINDIPDDPRT (SIOCDEVPRIVATE+2) #define SIOCFINDIPDDPRT (SIOCDEVPRIVATE+2)
#define SIOCPRINTIPDDPRT (SIOCDEVPRIVATE+3)
struct ipddp_route struct ipddp_route
{ {
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
/* $Id: ppp.c,v 1.14 1997/11/27 06:04:45 paulus Exp $ */ /* $Id: ppp.c,v 1.14 1997/11/27 06:04:45 paulus Exp $ */
#include <linux/config.h> /* for CONFIG_KERNELD */ #include <linux/config.h> /* for CONFIG_KMOD */
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
* *
*/ */
#include <linux/config.h>
#define __NO_VERSION__ #define __NO_VERSION__
#include <linux/module.h> #include <linux/module.h>
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
* driver uses the new code this *ENTIRE* file will be nuked. * driver uses the new code this *ENTIRE* file will be nuked.
*/ */
#include <linux/config.h> /* for CONFIG_KERNELD */
#define __NO_VERSION__ #define __NO_VERSION__
#include <linux/module.h> #include <linux/module.h>
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
* we attempt to remove commands from the queue and retry them. * we attempt to remove commands from the queue and retry them.
*/ */
#include <linux/config.h>
#define __NO_VERSION__ #define __NO_VERSION__
#include <linux/module.h> #include <linux/module.h>
......
...@@ -6,6 +6,8 @@ fi ...@@ -6,6 +6,8 @@ fi
dep_tristate '100% Sound Blaster compatibles (SB16/32/64, ESS, Jazz16) support' CONFIG_SB $CONFIG_SOUND dep_tristate '100% Sound Blaster compatibles (SB16/32/64, ESS, Jazz16) support' CONFIG_SB $CONFIG_SOUND
if [ "$CONFIG_SB" = "y" ]; then if [ "$CONFIG_SB" = "y" ]; then
bool 'Is the card a Soundman Games ?' CONFIG_SM_GAMES
bool 'Are you using the IBM Mwave "emulation" of SB ?' CONFIG_SB_MWAVE
hex 'I/O base for SB Check from manual of the card' CONFIG_SB_BASE 220 hex 'I/O base for SB Check from manual of the card' CONFIG_SB_BASE 220
int 'Sound Blaster IRQ Check from manual of the card' CONFIG_SB_IRQ 7 int 'Sound Blaster IRQ Check from manual of the card' CONFIG_SB_IRQ 7
int 'Sound Blaster DMA 0, 1 or 3' CONFIG_SB_DMA 1 int 'Sound Blaster DMA 0, 1 or 3' CONFIG_SB_DMA 1
......
...@@ -117,22 +117,6 @@ else ...@@ -117,22 +117,6 @@ else
endif endif
endif endif
ifeq ($(CONFIG_MPU401),y)
LX_OBJS += mpu401.o
else
ifeq ($(CONFIG_MPU401),m)
MX_OBJS += mpu401.o
else
ifeq ($(CONFIG_MPU_EMU),y)
LX_OBJS += mpu401.o
else
ifeq ($(CONFIG_MPU_EMU),m)
MX_OBJS += mpu401.o
endif
endif
endif
endif
ifeq ($(CONFIG_UART401),y) ifeq ($(CONFIG_UART401),y)
LX_OBJS += uart401.o LX_OBJS += uart401.o
else else
...@@ -159,9 +143,31 @@ endif ...@@ -159,9 +143,31 @@ endif
ifeq ($(CONFIG_SSCAPE),y) ifeq ($(CONFIG_SSCAPE),y)
L_OBJS += sscape.o L_OBJS += sscape.o
LX_OBJS += ad1848.o
CONFIG_MPU401 = y
else else
ifeq ($(CONFIG_SSCAPE),m) ifeq ($(CONFIG_SSCAPE),m)
M_OBJS += sscape.o M_OBJS += sscape.o
MX_OBJS += ad1848.o
ifneq ($(CONFIG_MPU401),y)
CONFIG_MPU401 = m
endif
endif
endif
ifeq ($(CONFIG_MPU401),y)
LX_OBJS += mpu401.o
else
ifeq ($(CONFIG_MPU401),m)
MX_OBJS += mpu401.o
else
ifeq ($(CONFIG_MPU_EMU),y)
LX_OBJS += mpu401.o
else
ifeq ($(CONFIG_MPU_EMU),m)
MX_OBJS += mpu401.o
endif
endif
endif endif
endif endif
...@@ -265,7 +271,7 @@ CONFIG_MAUI_BOOT_FILE := $(patsubst "%", %, $(CONFIG_MAUI_BOOT_FILE)) ...@@ -265,7 +271,7 @@ CONFIG_MAUI_BOOT_FILE := $(patsubst "%", %, $(CONFIG_MAUI_BOOT_FILE))
maui.o: maui_boot.h maui.o: maui_boot.h
maui_boot.h: $(CONFIG_MAUI_BOOT_FILE) bin2hex maui_boot.h: $(CONFIG_MAUI_BOOT_FILE) bin2hex
bin2hex maui_os < "$(CONFIG_MAUI_BOOT_FILE)" > $@ bin2hex -i maui_os < "$(CONFIG_MAUI_BOOT_FILE)" > $@
@ ( \ @ ( \
echo 'ifeq ($(strip $(CONFIG_MAUI_BOOT_FILE)),$$(strip $$(CONFIG_MAUI_BOOT_FILE)))'; \ echo 'ifeq ($(strip $(CONFIG_MAUI_BOOT_FILE)),$$(strip $$(CONFIG_MAUI_BOOT_FILE)))'; \
echo 'FILES_BOOT_UP_TO_DATE += $@'; \ echo 'FILES_BOOT_UP_TO_DATE += $@'; \
...@@ -297,7 +303,7 @@ CONFIG_TRIX_BOOT_FILE := $(patsubst "%", %, $(CONFIG_TRIX_BOOT_FILE)) ...@@ -297,7 +303,7 @@ CONFIG_TRIX_BOOT_FILE := $(patsubst "%", %, $(CONFIG_TRIX_BOOT_FILE))
trix.o: trix_boot.h trix.o: trix_boot.h
trix_boot.h: $(CONFIG_TRIX_BOOT_FILE) hex2hex trix_boot.h: $(CONFIG_TRIX_BOOT_FILE) hex2hex
hex2hex trix_boot < "$(CONFIG_TRIX_BOOT_FILE)" > $@ hex2hex -i trix_boot < "$(CONFIG_TRIX_BOOT_FILE)" > $@
@ ( \ @ ( \
echo 'ifeq ($(strip $(CONFIG_TRIX_BOOT_FILE)),$$(strip $$(CONFIG_TRIX_BOOT_FILE)))'; \ echo 'ifeq ($(strip $(CONFIG_TRIX_BOOT_FILE)),$$(strip $$(CONFIG_TRIX_BOOT_FILE)))'; \
echo 'FILES_BOOT_UP_TO_DATE += $@'; \ echo 'FILES_BOOT_UP_TO_DATE += $@'; \
......
...@@ -23,6 +23,12 @@ ...@@ -23,6 +23,12 @@
*/ */
/* /*
* Thomas Sailer : ioctl code reworked (vmalloc/vfree removed) * Thomas Sailer : ioctl code reworked (vmalloc/vfree removed)
* general sleep/wakeup clean up.
* Alan Cox : reformatted. Fixed SMP bugs. Moved to kernel alloc/free
* of irqs. Use dev_id.
*
* Status:
* Tested. Believed fully functional.
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -144,9 +150,9 @@ static void ad1848_tmr_reprogram(int dev); ...@@ -144,9 +150,9 @@ static void ad1848_tmr_reprogram(int dev);
static int ad_read(ad1848_info * devc, int reg) static int ad_read(ad1848_info * devc, int reg)
{ {
unsigned long flags; unsigned long flags;
int x; int x;
int timeout = 900000; int timeout = 900000;
while (timeout > 0 && inb(devc->base) == 0x80) /*Are we initializing */ while (timeout > 0 && inb(devc->base) == 0x80) /*Are we initializing */
timeout--; timeout--;
...@@ -163,11 +169,10 @@ static int ad_read(ad1848_info * devc, int reg) ...@@ -163,11 +169,10 @@ static int ad_read(ad1848_info * devc, int reg)
static void ad_write(ad1848_info * devc, int reg, int data) static void ad_write(ad1848_info * devc, int reg, int data)
{ {
unsigned long flags; unsigned long flags;
int timeout = 900000; int timeout = 900000;
while (timeout > 0 && while (timeout > 0 && inb(devc->base) == 0x80) /* Are we initializing */
inb(devc->base) == 0x80) /*Are we initializing */
timeout--; timeout--;
save_flags(flags); save_flags(flags);
...@@ -180,7 +185,7 @@ static void ad_write(ad1848_info * devc, int reg, int data) ...@@ -180,7 +185,7 @@ static void ad_write(ad1848_info * devc, int reg, int data)
static void wait_for_calibration(ad1848_info * devc) static void wait_for_calibration(ad1848_info * devc)
{ {
int timeout = 0; int timeout = 0;
/* /*
* Wait until the auto calibration process has finished. * Wait until the auto calibration process has finished.
...@@ -1751,7 +1756,11 @@ int ad1848_init(char *name, int io_base, int irq, int dma_playback, int dma_capt ...@@ -1751,7 +1756,11 @@ int ad1848_init(char *name, int io_base, int irq, int dma_playback, int dma_capt
else else
devc->audio_flags |= DMA_DUPLEX; devc->audio_flags |= DMA_DUPLEX;
} }
portc = (ad1848_port_info *) kmalloc(sizeof(ad1848_port_info), GFP_KERNEL);
if(portc==NULL)
return -1;
if ((my_dev = sound_install_audiodrv(AUDIO_DRIVER_VERSION, if ((my_dev = sound_install_audiodrv(AUDIO_DRIVER_VERSION,
dev_name, dev_name,
&ad1848_audio_driver, &ad1848_audio_driver,
...@@ -1762,12 +1771,11 @@ int ad1848_init(char *name, int io_base, int irq, int dma_playback, int dma_capt ...@@ -1762,12 +1771,11 @@ int ad1848_init(char *name, int io_base, int irq, int dma_playback, int dma_capt
dma_playback, dma_playback,
dma_capture)) < 0) dma_capture)) < 0)
{ {
kfree(portc);
portc=NULL;
return -1; return -1;
} }
portc = (ad1848_port_info *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(ad1848_port_info)));
sound_mem_sizes[sound_nblocks] = sizeof(ad1848_port_info);
if (sound_nblocks < 1024)
sound_nblocks++;;
audio_devs[my_dev]->portc = portc; audio_devs[my_dev]->portc = portc;
memset((char *) portc, 0, sizeof(*portc)); memset((char *) portc, 0, sizeof(*portc));
...@@ -1777,23 +1785,21 @@ int ad1848_init(char *name, int io_base, int irq, int dma_playback, int dma_capt ...@@ -1777,23 +1785,21 @@ int ad1848_init(char *name, int io_base, int irq, int dma_playback, int dma_capt
if (irq > 0) if (irq > 0)
{ {
irq2dev[irq] = devc->dev_no = my_dev; devc->dev_no = my_dev;
if (snd_set_irq_handler(devc->irq, adintr, if (request_irq(devc->irq, adintr, 0, devc->name, (void *)my_dev) < 0)
devc->name,
NULL) < 0)
{ {
printk(KERN_WARNING "ad1848: IRQ in use\n"); printk(KERN_WARNING "ad1848: Unable to allocate IRQ\n");
} }
if (devc->model != MD_1848 && devc->model != MD_C930) if (devc->model != MD_1848 && devc->model != MD_C930)
{ {
int x; int x;
unsigned char tmp = ad_read(devc, 16); unsigned char tmp = ad_read(devc, 16);
devc->timer_ticks = 0; devc->timer_ticks = 0;
ad_write(devc, 21, 0x00); /* Timer MSB */ ad_write(devc, 21, 0x00); /* Timer MSB */
ad_write(devc, 20, 0x10); /* Timer LSB */ ad_write(devc, 20, 0x10); /* Timer LSB */
#ifndef __SMP__
ad_write(devc, 16, tmp | 0x40); /* Enable timer */ ad_write(devc, 16, tmp | 0x40); /* Enable timer */
for (x = 0; x < 100000 && devc->timer_ticks == 0; x++); for (x = 0; x < 100000 && devc->timer_ticks == 0; x++);
ad_write(devc, 16, tmp & ~0x40); /* Disable timer */ ad_write(devc, 16, tmp & ~0x40); /* Disable timer */
...@@ -1805,6 +1811,9 @@ int ad1848_init(char *name, int io_base, int irq, int dma_playback, int dma_capt ...@@ -1805,6 +1811,9 @@ int ad1848_init(char *name, int io_base, int irq, int dma_playback, int dma_capt
DDB(printk("Interrupt test OK\n")); DDB(printk("Interrupt test OK\n"));
devc->irq_ok = 1; devc->irq_ok = 1;
} }
#else
devc->irq_ok=1;
#endif
} }
else else
devc->irq_ok = 1; /* Couldn't test. assume it's OK */ devc->irq_ok = 1; /* Couldn't test. assume it's OK */
...@@ -1840,7 +1849,7 @@ int ad1848_init(char *name, int io_base, int irq, int dma_playback, int dma_capt ...@@ -1840,7 +1849,7 @@ int ad1848_init(char *name, int io_base, int irq, int dma_playback, int dma_capt
void ad1848_control(int cmd, int arg) void ad1848_control(int cmd, int arg)
{ {
ad1848_info *devc; ad1848_info *devc;
if (nr_ad1848_devs < 1) if (nr_ad1848_devs < 1)
return; return;
...@@ -1850,7 +1859,7 @@ void ad1848_control(int cmd, int arg) ...@@ -1850,7 +1859,7 @@ void ad1848_control(int cmd, int arg)
switch (cmd) switch (cmd)
{ {
case AD1848_SET_XTAL: /* Change clock frequency of AD1845 (only ) */ case AD1848_SET_XTAL: /* Change clock frequency of AD1845 (only ) */
if (devc->model != MD_1845) if (devc->model != MD_1845)
return; return;
ad_enter_MCE(devc); ad_enter_MCE(devc);
ad_write(devc, 29, (ad_read(devc, 29) & 0x1f) | (arg << 5)); ad_write(devc, 29, (ad_read(devc, 29) & 0x1f) | (arg << 5));
...@@ -1859,8 +1868,8 @@ void ad1848_control(int cmd, int arg) ...@@ -1859,8 +1868,8 @@ void ad1848_control(int cmd, int arg)
case AD1848_MIXER_REROUTE: case AD1848_MIXER_REROUTE:
{ {
int o = (arg >> 8) & 0xff; int o = (arg >> 8) & 0xff;
int n = arg & 0xff; int n = arg & 0xff;
if (n == SOUND_MIXER_NONE) if (n == SOUND_MIXER_NONE)
{ /* Just hide this control */ { /* Just hide this control */
...@@ -1906,12 +1915,14 @@ void ad1848_unload(int io_base, int irq, int dma_playback, int dma_capture, int ...@@ -1906,12 +1915,14 @@ void ad1848_unload(int io_base, int irq, int dma_playback, int dma_capture, int
if (devc != NULL) if (devc != NULL)
{ {
if(audio_devs[dev]->portc!=NULL)
kfree(audio_devs[dev]->portc);
release_region(devc->base, 4); release_region(devc->base, 4);
if (!share_dma) if (!share_dma)
{ {
if (irq > 0) if (irq > 0)
snd_release_irq(devc->irq); free_irq(devc->irq, NULL);
sound_free_dma(audio_devs[dev]->dmap_out->dma); sound_free_dma(audio_devs[dev]->dmap_out->dma);
...@@ -1926,35 +1937,15 @@ void ad1848_unload(int io_base, int irq, int dma_playback, int dma_capture, int ...@@ -1926,35 +1937,15 @@ void ad1848_unload(int io_base, int irq, int dma_playback, int dma_capture, int
void adintr(int irq, void *dev_id, struct pt_regs *dummy) void adintr(int irq, void *dev_id, struct pt_regs *dummy)
{ {
unsigned char status; unsigned char status;
ad1848_info *devc; ad1848_info *devc;
int dev; int dev;
int alt_stat = 0xff; int alt_stat = 0xff;
unsigned char c930_stat = 0; unsigned char c930_stat = 0;
int cnt = 0; int cnt = 0;
if (irq < 0 || irq > 15) dev = (int)dev_id;
{ devc = (ad1848_info *) audio_devs[dev]->devc;
dev = -1;
}
else
dev = irq2dev[irq];
if (dev < 0 || dev >= num_audiodevs)
{
for (irq = 0; irq < 17; irq++)
if (irq2dev[irq] != -1)
break;
if (irq > 15)
{
/* printk("ad1848.c: Bogus interrupt %d\n", irq); */
return;
}
dev = irq2dev[irq];
devc = (ad1848_info *) audio_devs[dev]->devc;
} else
devc = (ad1848_info *) audio_devs[dev]->devc;
interrupt_again: /* Jump back here if int status doesn't reset */ interrupt_again: /* Jump back here if int status doesn't reset */
...@@ -2542,12 +2533,12 @@ EXPORT_SYMBOL(unload_ms_sound); ...@@ -2542,12 +2533,12 @@ EXPORT_SYMBOL(unload_ms_sound);
#ifdef MODULE #ifdef MODULE
MODULE_PARM(io, "i"); MODULE_PARM(io, "i"); /* I/O for a raw AD1848 card */
MODULE_PARM(irq, "i"); MODULE_PARM(irq, "i"); /* IRQ to use */
MODULE_PARM(dma, "i"); MODULE_PARM(dma, "i"); /* First DMA channel */
MODULE_PARM(dma2, "i"); MODULE_PARM(dma2, "i"); /* Second DMA channel */
MODULE_PARM(type, "i"); MODULE_PARM(type, "i"); /* Card type */
MODULE_PARM(deskpro_xl, "i"); MODULE_PARM(deskpro_xl, "i"); /* Special magic for Deskpro XL boxen */
int io = -1; int io = -1;
int irq = -1; int irq = -1;
......
...@@ -2,12 +2,27 @@ ...@@ -2,12 +2,27 @@
int main( int argc, const char * argv [] ) int main( int argc, const char * argv [] )
{ {
const char * varname = argv[1]; const char * varname;
int i = 0; int i = 0;
int c; int c;
int id = 0;
if(argv[1] && strcmp(argv[1],"-i")==0)
{
argv++;
argc--;
id=1;
}
if(argc==1)
{
fprintf(stderr, "bin2hex: [-i] firmware\n");
exit(1);
}
varname = argv[1];
printf( "/* automatically generated by bin2hex */\n" ); printf( "/* automatically generated by bin2hex */\n" );
printf( "static unsigned char %s [] =\n{\n", varname ); printf( "static unsigned char %s [] %s =\n{\n", varname , id?"__initdata":"");
while ( ( c = getchar( ) ) != EOF ) while ( ( c = getchar( ) ) != EOF )
{ {
......
...@@ -12,7 +12,14 @@ ...@@ -12,7 +12,14 @@
* CS4232 * CS4232
* CS4236 * CS4236
* CS4236B * CS4236B
*
* Note: You will need a PnP config setup to initialise some CS4232 boards
* anyway.
*
* Changes
* Alan Cox Modularisation, Basic cleanups.
*/ */
/* /*
* Copyright (C) by Hannu Savolainen 1993-1997 * Copyright (C) by Hannu Savolainen 1993-1997
* *
...@@ -20,6 +27,7 @@ ...@@ -20,6 +27,7 @@
* Version 2 (June 1991). See the "COPYING" file distributed with this software * Version 2 (June 1991). See the "COPYING" file distributed with this software
* for more info. * for more info.
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -99,6 +107,8 @@ int probe_cs4232(struct address_info *hw_config) ...@@ -99,6 +107,8 @@ int probe_cs4232(struct address_info *hw_config)
* just one CS4232 compatible device can exist on the system. Also this * just one CS4232 compatible device can exist on the system. Also this
* method conflicts with possible PnP support in the OS. For this reason * method conflicts with possible PnP support in the OS. For this reason
* driver is just a temporary kludge. * driver is just a temporary kludge.
*
* Also the Cirrus/Crystal method doesnt always work. Try ISAPnP first ;)
*/ */
/* /*
...@@ -106,8 +116,8 @@ int probe_cs4232(struct address_info *hw_config) ...@@ -106,8 +116,8 @@ int probe_cs4232(struct address_info *hw_config)
* first time. * first time.
*/ */
for (n = 0; n < 4; n++) { for (n = 0; n < 4; n++)
{
/* /*
* Wake up the card by sending a 32 byte Crystal key to the key port. * Wake up the card by sending a 32 byte Crystal key to the key port.
*/ */
...@@ -298,8 +308,7 @@ struct address_info cfg; ...@@ -298,8 +308,7 @@ struct address_info cfg;
* loaded ready. * loaded ready.
*/ */
int int init_module(void)
init_module(void)
{ {
if (io == -1 || irq == -1 || dma == -1 || dma2 == -1) if (io == -1 || irq == -1 || dma == -1 || dma2 == -1)
{ {
......
...@@ -125,6 +125,7 @@ static void sound_free_dmap(struct dma_buffparms *dmap) ...@@ -125,6 +125,7 @@ static void sound_free_dmap(struct dma_buffparms *dmap)
free_pages((unsigned long) dmap->raw_buf, sz); free_pages((unsigned long) dmap->raw_buf, sz);
dmap->raw_buf = NULL; dmap->raw_buf = NULL;
/* Remember the buffer is deleted so we dont Oops later */
dmap->fragment_size = 0; dmap->fragment_size = 0;
} }
...@@ -832,12 +833,12 @@ int DMAbuf_move_wrpointer(int dev, int l) ...@@ -832,12 +833,12 @@ int DMAbuf_move_wrpointer(int dev, int l)
dmap->user_counter += l; dmap->user_counter += l;
dmap->flags |= DMA_DIRTY; dmap->flags |= DMA_DIRTY;
if (dmap->user_counter >= dmap->max_byte_counter) { if (dmap->byte_counter >= dmap->max_byte_counter) {
/* Wrap the byte counters */ /* Wrap the byte counters */
long decr = dmap->user_counter; long decr = dmap->byte_counter;
dmap->user_counter = (dmap->user_counter % dmap->bytes_in_use) + dmap->bytes_in_use; dmap->byte_counter = (dmap->byte_counter % dmap->bytes_in_use);
decr -= dmap->user_counter; decr -= dmap->byte_counter;
dmap->byte_counter -= decr; dmap->user_counter -= decr;
} }
end_ptr = (dmap->user_counter / dmap->fragment_size) * dmap->fragment_size; end_ptr = (dmap->user_counter / dmap->fragment_size) * dmap->fragment_size;
...@@ -928,7 +929,7 @@ static void do_outputintr(int dev, int dummy) ...@@ -928,7 +929,7 @@ static void do_outputintr(int dev, int dummy)
dmap->byte_counter += dmap->bytes_in_use; dmap->byte_counter += dmap->bytes_in_use;
if (dmap->byte_counter >= dmap->max_byte_counter) { /* Overflow */ if (dmap->byte_counter >= dmap->max_byte_counter) { /* Overflow */
long decr = dmap->byte_counter; long decr = dmap->byte_counter;
dmap->byte_counter = (dmap->byte_counter % dmap->bytes_in_use) + dmap->bytes_in_use; dmap->byte_counter = (dmap->byte_counter % dmap->bytes_in_use);
decr -= dmap->byte_counter; decr -= dmap->byte_counter;
dmap->user_counter -= decr; dmap->user_counter -= decr;
} }
...@@ -952,7 +953,7 @@ static void do_outputintr(int dev, int dummy) ...@@ -952,7 +953,7 @@ static void do_outputintr(int dev, int dummy)
dmap->byte_counter += dmap->bytes_in_use; dmap->byte_counter += dmap->bytes_in_use;
if (dmap->byte_counter >= dmap->max_byte_counter) { /* Overflow */ if (dmap->byte_counter >= dmap->max_byte_counter) { /* Overflow */
long decr = dmap->byte_counter; long decr = dmap->byte_counter;
dmap->byte_counter = (dmap->byte_counter % dmap->bytes_in_use) + dmap->bytes_in_use; dmap->byte_counter = (dmap->byte_counter % dmap->bytes_in_use);
decr -= dmap->byte_counter; decr -= dmap->byte_counter;
dmap->user_counter -= decr; dmap->user_counter -= decr;
} }
......
This diff is collapsed.
...@@ -30,7 +30,7 @@ int gus_pnp_flag = 0; ...@@ -30,7 +30,7 @@ int gus_pnp_flag = 0;
void attach_gus_card(struct address_info *hw_config) void attach_gus_card(struct address_info *hw_config)
{ {
snd_set_irq_handler(hw_config->irq, gusintr, "Gravis Ultrasound", hw_config->osp); snd_set_irq_handler(hw_config->irq, gusintr, "Gravis Ultrasound", hw_config->osp, hw_config);
gus_wave_init(hw_config); gus_wave_init(hw_config);
...@@ -101,7 +101,7 @@ void unload_gus(struct address_info *hw_config) ...@@ -101,7 +101,7 @@ void unload_gus(struct address_info *hw_config)
release_region(hw_config->io_base, 16); release_region(hw_config->io_base, 16);
release_region(hw_config->io_base + 0x100, 12); /* 0x10c-> is MAX */ release_region(hw_config->io_base + 0x100, 12); /* 0x10c-> is MAX */
snd_release_irq(hw_config->irq); snd_release_irq(hw_config->irq, hw_config);
sound_free_dma(hw_config->dma); sound_free_dma(hw_config->dma);
...@@ -111,14 +111,15 @@ void unload_gus(struct address_info *hw_config) ...@@ -111,14 +111,15 @@ void unload_gus(struct address_info *hw_config)
void gusintr(int irq, void *dev_id, struct pt_regs *dummy) void gusintr(int irq, void *dev_id, struct pt_regs *dummy)
{ {
unsigned char src; unsigned char src;
extern int gus_timer_enabled; extern int gus_timer_enabled;
struct address_info *hw_config=dev_id;
sti(); sti();
#ifdef CONFIG_GUSMAX #ifdef CONFIG_GUSMAX
if (have_gus_max) if (have_gus_max)
adintr(irq, NULL, NULL); adintr(irq, (void *)hw_config->slots[3], NULL);
#endif #endif
while (1) while (1)
......
...@@ -66,14 +66,27 @@ int loadhex(FILE *inf, unsigned char *buf) ...@@ -66,14 +66,27 @@ int loadhex(FILE *inf, unsigned char *buf)
int main( int argc, const char * argv [] ) int main( int argc, const char * argv [] )
{ {
const char * varline = argv[1]; const char * varline;
int i,l; int i,l;
int id=0;
if(argv[1] && strcmp(argv[1], "-i")==0)
{
argv++;
argc--;
id=1;
}
if(argv[1]==NULL)
{
fprintf(stderr,"hex2hex: [-i] filename\n");
exit(1);
}
varline = argv[1;
l = loadhex(stdin, buf); l = loadhex(stdin, buf);
printf("/*\n *\t Computer generated file. Do not edit.\n */\n"); printf("/*\n *\t Computer generated file. Do not edit.\n */\n");
printf("static int %s_len = %d;\n", varline, l); printf("static int %s_len = %d;\n", varline, l);
printf("static unsigned char %s[] = {\n", varline); printf("static unsigned char %s[] %s = {\n", varline, id?"__initdata":"");
for (i=0;i<l;i++) for (i=0;i<l;i++)
{ {
......
...@@ -9,7 +9,15 @@ ...@@ -9,7 +9,15 @@
* OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL) * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
* Version 2 (June 1991). See the "COPYING" file distributed with this software * Version 2 (June 1991). See the "COPYING" file distributed with this software
* for more info. * for more info.
*
* Changes:
* Alan Cox General clean up, use kernel IRQ
* system
*
* Status:
* Untested
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -327,7 +335,7 @@ int probe_maui(struct address_info *hw_config) ...@@ -327,7 +335,7 @@ int probe_maui(struct address_info *hw_config)
maui_base = hw_config->io_base; maui_base = hw_config->io_base;
maui_osp = hw_config->osp; maui_osp = hw_config->osp;
if (snd_set_irq_handler(hw_config->irq, mauiintr, "Maui", maui_osp) < 0) if (request_irq(hw_config->irq, mauiintr, 0, "Maui", NULL) < 0)
return 0; return 0;
/* /*
...@@ -342,26 +350,26 @@ int probe_maui(struct address_info *hw_config) ...@@ -342,26 +350,26 @@ int probe_maui(struct address_info *hw_config)
maui_read() == -1 || maui_read() == -1) maui_read() == -1 || maui_read() == -1)
if (!maui_init(hw_config->irq)) if (!maui_init(hw_config->irq))
{ {
snd_release_irq(hw_config->irq); free_irq(hw_config->irq, NULL);
return 0; return 0;
} }
} }
if (!maui_write(0xCF)) /* Report hardware version */ if (!maui_write(0xCF)) /* Report hardware version */
{ {
printk(KERN_ERR "No WaveFront firmware detected (card uninitialized?)\n"); printk(KERN_ERR "No WaveFront firmware detected (card uninitialized?)\n");
snd_release_irq(hw_config->irq); free_irq(hw_config->irq, NULL);
return 0; return 0;
} }
if ((tmp1 = maui_read()) == -1 || (tmp2 = maui_read()) == -1) if ((tmp1 = maui_read()) == -1 || (tmp2 = maui_read()) == -1)
{ {
printk(KERN_ERR "No WaveFront firmware detected (card uninitialized?)\n"); printk(KERN_ERR "No WaveFront firmware detected (card uninitialized?)\n");
snd_release_irq(hw_config->irq); free_irq(hw_config->irq, NULL);
return 0; return 0;
} }
if (tmp1 == 0xff || tmp2 == 0xff) if (tmp1 == 0xff || tmp2 == 0xff)
{ {
snd_release_irq(hw_config->irq); free_irq(hw_config->irq, NULL);
return 0; return 0;
} }
if (trace_init) if (trace_init)
printk(KERN_DEBUG "WaveFront hardware version %d.%d\n", tmp1, tmp2); printk(KERN_DEBUG "WaveFront hardware version %d.%d\n", tmp1, tmp2);
...@@ -439,7 +447,7 @@ void unload_maui(struct address_info *hw_config) ...@@ -439,7 +447,7 @@ void unload_maui(struct address_info *hw_config)
if (irq < 0) if (irq < 0)
irq = -irq; irq = -irq;
if (irq > 0) if (irq > 0)
snd_release_irq(irq); free_irq(irq, NULL);
} }
#ifdef MODULE #ifdef MODULE
...@@ -452,8 +460,7 @@ static int fw_load = 0; ...@@ -452,8 +460,7 @@ static int fw_load = 0;
struct address_info cfg; struct address_info cfg;
/* /*
* Install a CS4232 based card. Need to have ad1848 and mpu401 * Install a Maui card. Needs mpu401 loaded already.
* loaded ready.
*/ */
int init_module(void) int init_module(void)
......
This diff is collapsed.
...@@ -2,25 +2,30 @@ ...@@ -2,25 +2,30 @@
* sound/opl3.c * sound/opl3.c
* *
* A low level driver for Yamaha YM3812 and OPL-3 -chips * A low level driver for Yamaha YM3812 and OPL-3 -chips
*/ *
/* *
* Copyright (C) by Hannu Savolainen 1993-1997 * Copyright (C) by Hannu Savolainen 1993-1997
* *
* OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL) * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
* Version 2 (June 1991). See the "COPYING" file distributed with this software * Version 2 (June 1991). See the "COPYING" file distributed with this software
* for more info. * for more info.
*
*
* Changes
* Thomas Sailer ioctl code reworked (vmalloc/vfree removed)
* Alan Cox modularisation, fixed sound_mem allocs.
*
* Status
* Believed to work. Badly needs rewriting a bit to support multiple
* OPL3 devices.
*/ */
/*
* Thomas Sailer : ioctl code reworked (vmalloc/vfree removed)
*/
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/delay.h> #include <linux/delay.h>
/* /*
* Major improvements to the FM handling 30AUG92 by Rob Hooft, * Major improvements to the FM handling 30AUG92 by Rob Hooft,
*/
/*
* hooft@chem.ruu.nl * hooft@chem.ruu.nl
*/ */
...@@ -109,32 +114,32 @@ static int opl3_ioctl(int dev, unsigned int cmd, caddr_t arg) ...@@ -109,32 +114,32 @@ static int opl3_ioctl(int dev, unsigned int cmd, caddr_t arg)
struct sbi_instrument ins; struct sbi_instrument ins;
switch (cmd) { switch (cmd) {
case SNDCTL_FM_LOAD_INSTR: case SNDCTL_FM_LOAD_INSTR:
printk(KERN_WARNING "Warning: Obsolete ioctl(SNDCTL_FM_LOAD_INSTR) used. Fix the program.\n"); printk(KERN_WARNING "Warning: Obsolete ioctl(SNDCTL_FM_LOAD_INSTR) used. Fix the program.\n");
if (__copy_from_user(&ins, arg, sizeof(ins))) if (copy_from_user(&ins, arg, sizeof(ins)))
return -EFAULT; return -EFAULT;
if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR) { if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR) {
printk("FM Error: Invalid instrument number %d\n", ins.channel); printk(KERN_WARNING "FM Error: Invalid instrument number %d\n", ins.channel);
return -EINVAL; return -EINVAL;
} }
return store_instr(ins.channel, &ins); return store_instr(ins.channel, &ins);
case SNDCTL_SYNTH_INFO: case SNDCTL_SYNTH_INFO:
devc->fm_info.nr_voices = (devc->nr_voice == 12) ? 6 : devc->nr_voice; devc->fm_info.nr_voices = (devc->nr_voice == 12) ? 6 : devc->nr_voice;
if (__copy_to_user(arg, &devc->fm_info, sizeof(devc->fm_info))) if (copy_to_user(arg, &devc->fm_info, sizeof(devc->fm_info)))
return -EFAULT; return -EFAULT;
return 0; return 0;
case SNDCTL_SYNTH_MEMAVL: case SNDCTL_SYNTH_MEMAVL:
return 0x7fffffff; return 0x7fffffff;
case SNDCTL_FM_4OP_ENABLE: case SNDCTL_FM_4OP_ENABLE:
if (devc->model == 2) if (devc->model == 2)
enter_4op_mode(); enter_4op_mode();
return 0; return 0;
default: default:
return -EINVAL; return -EINVAL;
} }
} }
...@@ -151,8 +156,8 @@ int opl3_detect(int ioaddr, int *osp) ...@@ -151,8 +156,8 @@ int opl3_detect(int ioaddr, int *osp)
* Note2! The chip is initialized if detected. * Note2! The chip is initialized if detected.
*/ */
unsigned char stat1, signature; unsigned char stat1, signature;
int i; int i;
if (devc != NULL) if (devc != NULL)
{ {
...@@ -160,10 +165,7 @@ int opl3_detect(int ioaddr, int *osp) ...@@ -160,10 +165,7 @@ int opl3_detect(int ioaddr, int *osp)
return 0; return 0;
} }
devc = (struct opl_devinfo *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(*devc))); devc = (struct opl_devinfo *)kmalloc(sizeof(*devc), GFP_KERNEL);
sound_mem_sizes[sound_nblocks] = sizeof(*devc);
if (sound_nblocks < 1024)
sound_nblocks++;;
if (devc == NULL) if (devc == NULL)
{ {
...@@ -333,7 +335,7 @@ static char fm_volume_table[128] = ...@@ -333,7 +335,7 @@ static char fm_volume_table[128] =
static void calc_vol(unsigned char *regbyte, int volume, int main_vol) static void calc_vol(unsigned char *regbyte, int volume, int main_vol)
{ {
int level = (~*regbyte & 0x3f); int level = (~*regbyte & 0x3f);
if (main_vol > 127) if (main_vol > 127)
main_vol = 127; main_vol = 127;
...@@ -814,7 +816,8 @@ static int opl3_load_patch(int dev, int format, const char *addr, ...@@ -814,7 +816,8 @@ static int opl3_load_patch(int dev, int format, const char *addr,
return -EINVAL; return -EINVAL;
} }
copy_from_user(&((char *) &ins)[offs], &(addr)[offs], sizeof(ins) - offs); if(copy_from_user(&((char *) &ins)[offs], &(addr)[offs], sizeof(ins) - offs))
return -EFAULT;
if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR) if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR)
{ {
...@@ -1199,6 +1202,7 @@ void cleanup_module(void) ...@@ -1199,6 +1202,7 @@ void cleanup_module(void)
{ {
if (devc) if (devc)
{ {
kfree(devc);
devc = NULL; devc = NULL;
sound_unload_synthdev(me); sound_unload_synthdev(me);
} }
......
...@@ -164,7 +164,7 @@ static int config_pas_hw(struct address_info *hw_config) ...@@ -164,7 +164,7 @@ static int config_pas_hw(struct address_info *hw_config)
} }
else else
{ {
if (snd_set_irq_handler(pas_irq, pasintr, "PAS16", hw_config->osp) < 0) if (request_irq(pas_irq, pasintr, "PAS16", 0, NULL) < 0)
ok = 0; ok = 0;
} }
} }
...@@ -355,7 +355,7 @@ void ...@@ -355,7 +355,7 @@ void
unload_pas(struct address_info *hw_config) unload_pas(struct address_info *hw_config)
{ {
sound_free_dma(hw_config->dma); sound_free_dma(hw_config->dma);
snd_release_irq(hw_config->irq); free_irq(hw_config->irq, NULL);
} }
#ifdef MODULE #ifdef MODULE
......
This diff is collapsed.
...@@ -1151,14 +1151,14 @@ void sb_audio_init(sb_devc * devc, char *name) ...@@ -1151,14 +1151,14 @@ void sb_audio_init(sb_devc * devc, char *name)
} }
if ((devc->my_dev = sound_install_audiodrv(AUDIO_DRIVER_VERSION, if ((devc->my_dev = sound_install_audiodrv(AUDIO_DRIVER_VERSION,
name, name,
driver, driver,
sizeof(struct audio_driver), sizeof(struct audio_driver),
audio_flags, audio_flags,
format_mask, format_mask,
devc, devc,
devc->dma8, devc->dma8,
devc->dma8)) < 0) devc->dma8)) < 0)
{ {
printk(KERN_ERR "sb: unable to install audio.\n"); printk(KERN_ERR "sb: unable to install audio.\n");
return; return;
......
...@@ -69,6 +69,7 @@ int trix = 0; /* Set trix=1 to load this as support for trix */ ...@@ -69,6 +69,7 @@ int trix = 0; /* Set trix=1 to load this as support for trix */
int pas2 = 0; /* Set pas2=1 to load this as support for pas2 */ int pas2 = 0; /* Set pas2=1 to load this as support for pas2 */
int sm_games = 0; /* Mixer - see sb_mixer.c */ int sm_games = 0; /* Mixer - see sb_mixer.c */
int acer = 0; /* Do acer notebook init */ int acer = 0; /* Do acer notebook init */
int mwave_bug = 0; /* Using the dreadful mwave sb emulation */
MODULE_PARM(io, "i"); MODULE_PARM(io, "i");
MODULE_PARM(irq, "i"); MODULE_PARM(irq, "i");
...@@ -80,10 +81,11 @@ MODULE_PARM(mad16, "i"); ...@@ -80,10 +81,11 @@ MODULE_PARM(mad16, "i");
MODULE_PARM(trix, "i"); MODULE_PARM(trix, "i");
MODULE_PARM(pas2, "i"); MODULE_PARM(pas2, "i");
MODULE_PARM(sm_games, "i"); MODULE_PARM(sm_games, "i");
MODULE_PARM(mwave_bug, "i");
static int sbmpu = 0; static int sbmpu = 0;
void *smw_free = NULL; void *smw_free = NULL;
int init_module(void) int init_module(void)
{ {
...@@ -119,8 +121,7 @@ int init_module(void) ...@@ -119,8 +121,7 @@ int init_module(void)
return 0; return 0;
} }
void void cleanup_module(void)
cleanup_module(void)
{ {
if (smw_free) if (smw_free)
kfree(smw_free); kfree(smw_free);
...@@ -133,19 +134,20 @@ cleanup_module(void) ...@@ -133,19 +134,20 @@ cleanup_module(void)
#else #else
#ifdef SM_GAMES #ifdef CONFIG_SM_GAMES
int sm_games = 1; int sm_games = 1;
#else #else
int sm_games = 0; int sm_games = 0;
#endif #endif
#ifdef SB_ACER #ifdef CONFIG_SB_ACER
int acer = 1; int acer = 1;
#else #else
int acer = 0; int acer = 0;
#endif
#ifdef CONFIG_SB_MWAVE
int mwave_bug = 1;
#else
int mwave_bug = 0;
#endif #endif
#endif #endif
#endif #endif
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
static sb_devc *detected_devc = NULL; /* For communication from probe to init */ static sb_devc *detected_devc = NULL; /* For communication from probe to init */
static sb_devc *last_devc = NULL; /* For MPU401 initialization */ static sb_devc *last_devc = NULL; /* For MPU401 initialization */
static sb_devc *irq2devc[16] = {NULL};
static unsigned char jazz_irq_bits[] = { static unsigned char jazz_irq_bits[] = {
0, 0, 2, 3, 0, 1, 0, 4, 0, 2, 5, 0, 0, 0, 0, 6 0, 0, 2, 3, 0, 1, 0, 4, 0, 2, 5, 0, 0, 0, 0, 6
}; };
...@@ -123,15 +122,9 @@ static void sbintr(int irq, void *dev_id, struct pt_regs *dummy) ...@@ -123,15 +122,9 @@ static void sbintr(int irq, void *dev_id, struct pt_regs *dummy)
int status; int status;
unsigned char src = 0xff; unsigned char src = 0xff;
sb_devc *devc = irq2devc[irq]; sb_devc *devc = dev_id;
if (devc == NULL || devc->irq != irq)
{
DEB(printk("sbintr: Bogus interrupt IRQ%d\n", irq));
return;
}
devc->irq_ok = 1; devc->irq_ok = 1;
if (devc->model == MDL_SB16) if (devc->model == MDL_SB16)
{ {
src = sb_getmixer(devc, IRQ_STAT); /* Interrupt source register */ src = sb_getmixer(devc, IRQ_STAT); /* Interrupt source register */
...@@ -710,6 +703,7 @@ void sb_dsp_init(struct address_info *hw_config) ...@@ -710,6 +703,7 @@ void sb_dsp_init(struct address_info *hw_config)
sb_devc *devc; sb_devc *devc;
char name[100]; char name[100];
extern int sb_be_quiet; extern int sb_be_quiet;
extern int mwave_bug;
/* /*
* Check if we had detected a SB device earlier * Check if we had detected a SB device earlier
...@@ -743,21 +737,19 @@ void sb_dsp_init(struct address_info *hw_config) ...@@ -743,21 +737,19 @@ void sb_dsp_init(struct address_info *hw_config)
if (!(devc->caps & SB_NO_AUDIO && devc->caps & SB_NO_MIDI) && hw_config->irq > 0) if (!(devc->caps & SB_NO_AUDIO && devc->caps & SB_NO_MIDI) && hw_config->irq > 0)
{ /* IRQ setup */ { /* IRQ setup */
if (snd_set_irq_handler(hw_config->irq, sbintr, "soundblaster", devc->osp) < 0) if (request_irq(hw_config->irq, sbintr, 0, "soundblaster", devc) < 0)
{ {
printk(KERN_ERR "SB: Can't allocate IRQ%d\n", hw_config->irq); printk(KERN_ERR "SB: Can't allocate IRQ%d\n", hw_config->irq);
sound_unload_audiodev(devc->dev); sound_unload_audiodev(devc->dev);
return; return;
} }
irq2devc[hw_config->irq] = devc;
devc->irq_ok = 0; devc->irq_ok = 0;
if (devc->major == 4) if (devc->major == 4)
if (!sb16_set_irq_hw(devc, devc->irq)) /* Unsupported IRQ */ if (!sb16_set_irq_hw(devc, devc->irq)) /* Unsupported IRQ */
{ {
snd_release_irq(devc->irq); free_irq(devc->irq, devc);
sound_unload_audiodev(devc->dev); sound_unload_audiodev(devc->dev);
irq2devc[hw_config->irq] = NULL;
return; return;
} }
if ((devc->type == 0 || devc->type == MDL_ESS) && if ((devc->type == 0 || devc->type == MDL_ESS) &&
...@@ -777,7 +769,7 @@ void sb_dsp_init(struct address_info *hw_config) ...@@ -777,7 +769,7 @@ void sb_dsp_init(struct address_info *hw_config)
/* Skip IRQ detection if SMP (doesn't work) */ /* Skip IRQ detection if SMP (doesn't work) */
devc->irq_ok = 1; devc->irq_ok = 1;
#else #else
if (devc->major == 4 && devc->minor <= 11) /* Won't work */ if ((devc->major == 4 && devc->minor <= 11 ) || mwave_bug ) /* Won't work */
devc->irq_ok = 1; devc->irq_ok = 1;
else else
{ {
...@@ -883,6 +875,7 @@ void sb_dsp_init(struct address_info *hw_config) ...@@ -883,6 +875,7 @@ void sb_dsp_init(struct address_info *hw_config)
} }
} }
hw_config->card_subtype = devc->model; hw_config->card_subtype = devc->model;
hw_config->slots[0]=devc->dev;
last_devc = devc; /* For SB MPU detection */ last_devc = devc; /* For SB MPU detection */
if (!(devc->caps & SB_NO_AUDIO) && devc->dma8 >= 0) if (!(devc->caps & SB_NO_AUDIO) && devc->dma8 >= 0)
...@@ -915,15 +908,8 @@ void sb_dsp_disable_recording(int io_base) ...@@ -915,15 +908,8 @@ void sb_dsp_disable_recording(int io_base)
void sb_dsp_unload(struct address_info *hw_config) void sb_dsp_unload(struct address_info *hw_config)
{ {
sb_devc *devc; sb_devc *devc;
int irq = hw_config->irq;
if (irq < 0) devc = audio_devs[hw_config->slots[0]]->devc;
irq *= -1;
if (irq > 2 && irq < 16)
devc = irq2devc[irq];
else
devc = NULL;
if (devc && devc->base == hw_config->io_base) if (devc && devc->base == hw_config->io_base)
{ {
...@@ -937,12 +923,12 @@ void sb_dsp_unload(struct address_info *hw_config) ...@@ -937,12 +923,12 @@ void sb_dsp_unload(struct address_info *hw_config)
} }
if (!(devc->caps & SB_NO_AUDIO && devc->caps & SB_NO_MIDI) && devc->irq > 0) if (!(devc->caps & SB_NO_AUDIO && devc->caps & SB_NO_MIDI) && devc->irq > 0)
{ {
snd_release_irq(devc->irq); free_irq(devc->irq, devc);
irq2devc[devc->irq] = NULL;
sound_unload_mixerdev(devc->my_mixerdev); sound_unload_mixerdev(devc->my_mixerdev);
sound_unload_mididev(devc->my_mididev); sound_unload_mididev(devc->my_mididev);
sound_unload_audiodev(devc->my_dev); sound_unload_audiodev(devc->my_dev);
} }
kfree(devc);
} }
else else
release_region(hw_config->io_base, 16); release_region(hw_config->io_base, 16);
......
...@@ -83,8 +83,9 @@ void MIDIbuf_init(void); ...@@ -83,8 +83,9 @@ void MIDIbuf_init(void);
/* From soundcard.c */ /* From soundcard.c */
void request_sound_timer (int count); void request_sound_timer (int count);
void sound_stop_timer(void); void sound_stop_timer(void);
int snd_set_irq_handler (int interrupt_level, void(*iproc)(int, void*, struct pt_regs *), char *name, int *osp); /* These two are about to die.. */
void snd_release_irq(int vect); int snd_set_irq_handler (int interrupt_level, void(*iproc)(int, void*, struct pt_regs *), char *name, int *osp, void *dev_id);
void snd_release_irq(int vect, void *ptr);
void sound_dma_malloc(int dev); void sound_dma_malloc(int dev);
void sound_dma_free(int dev); void sound_dma_free(int dev);
void conf_printf(char *name, struct address_info *hw_config); void conf_printf(char *name, struct address_info *hw_config);
......
...@@ -47,6 +47,14 @@ void reprogram_timer(void) ...@@ -47,6 +47,14 @@ void reprogram_timer(void)
{ {
unsigned long usecs_per_tick; unsigned long usecs_per_tick;
/*
* The user is changing the timer rate before setting a timer
* slap, bad bad not allowed.
*/
if(!tmr)
return;
usecs_per_tick = (60 * 1000000) / (curr_tempo * curr_timebase); usecs_per_tick = (60 * 1000000) / (curr_tempo * curr_timebase);
/* /*
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/kmod.h>
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <asm/io.h> #include <asm/io.h>
#include <asm/segment.h> #include <asm/segment.h>
...@@ -438,7 +439,7 @@ static int sound_open(struct inode *inode, struct file *file) ...@@ -438,7 +439,7 @@ static int sound_open(struct inode *inode, struct file *file)
case SND_DEV_CTL: case SND_DEV_CTL:
dev >>= 4; dev >>= 4;
#ifdef CONFIG_KERNELD #ifdef CONFIG_KMOD
if (dev >= 0 && dev < MAX_MIXER_DEV && mixer_devs[dev] == NULL) { if (dev >= 0 && dev < MAX_MIXER_DEV && mixer_devs[dev] == NULL) {
char modname[20]; char modname[20];
sprintf(modname, "mixer%d", dev); sprintf(modname, "mixer%d", dev);
...@@ -554,14 +555,14 @@ static int sound_mixer_ioctl(int mixdev, unsigned int cmd, caddr_t arg) ...@@ -554,14 +555,14 @@ static int sound_mixer_ioctl(int mixdev, unsigned int cmd, caddr_t arg)
{ {
if (mixdev < 0 || mixdev >= MAX_MIXER_DEV) if (mixdev < 0 || mixdev >= MAX_MIXER_DEV)
return -ENXIO; return -ENXIO;
#ifdef CONFIG_KERNELD #ifdef CONFIG_KMOD
/* Try to load the mixer... */ /* Try to load the mixer... */
if (mixer_devs[mixdev] == NULL) { if (mixer_devs[mixdev] == NULL) {
char modname[20]; char modname[20];
sprintf(modname, "mixer%d", mixdev); sprintf(modname, "mixer%d", mixdev);
request_module(modname); request_module(modname);
} }
#endif /* CONFIG_KERNELD */ #endif /* CONFIG_KMOD */
if (mixdev >= num_mixers || !mixer_devs[mixdev]) if (mixdev >= num_mixers || !mixer_devs[mixdev])
return -ENXIO; return -ENXIO;
if (cmd == SOUND_MIXER_INFO) if (cmd == SOUND_MIXER_INFO)
...@@ -800,7 +801,7 @@ free_all_irqs(void) ...@@ -800,7 +801,7 @@ free_all_irqs(void)
if (irqs & (1ul << i)) if (irqs & (1ul << i))
{ {
printk(KERN_WARNING "Sound warning: IRQ%d was left allocated - fixed.\n", i); printk(KERN_WARNING "Sound warning: IRQ%d was left allocated - fixed.\n", i);
snd_release_irq(i); snd_release_irq(i, NULL);
} }
} }
irqs = 0; irqs = 0;
...@@ -894,14 +895,14 @@ void cleanup_module(void) ...@@ -894,14 +895,14 @@ void cleanup_module(void)
} }
#endif #endif
int snd_set_irq_handler(int interrupt_level, void (*iproc) (int, void *, struct pt_regs *), char *name, int *osp) int snd_set_irq_handler(int interrupt_level, void (*iproc) (int, void *, struct pt_regs *), char *name, int *osp, void *dev_id)
{ {
int retcode; int retcode;
unsigned long flags; unsigned long flags;
save_flags(flags); save_flags(flags);
cli(); cli();
retcode = request_irq(interrupt_level, iproc, 0, name, NULL); retcode = request_irq(interrupt_level, iproc, 0, name, dev_id);
if (retcode < 0) if (retcode < 0)
{ {
...@@ -914,13 +915,13 @@ int snd_set_irq_handler(int interrupt_level, void (*iproc) (int, void *, struct ...@@ -914,13 +915,13 @@ int snd_set_irq_handler(int interrupt_level, void (*iproc) (int, void *, struct
return retcode; return retcode;
} }
void snd_release_irq(int vect) void snd_release_irq(int vect, void *dev_id)
{ {
if (!(irqs & (1ul << vect))) if (!(irqs & (1ul << vect)))
return; return;
irqs &= ~(1ul << vect); irqs &= ~(1ul << vect);
free_irq(vect, NULL); free_irq(vect, dev_id);
} }
int sound_alloc_dma(int chn, char *deviceID) int sound_alloc_dma(int chn, char *deviceID)
......
This diff is collapsed.
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
* Extended by Alan Cox for Red Hat Software. Now a loadable MIDI driver. * Extended by Alan Cox for Red Hat Software. Now a loadable MIDI driver.
* 28/4/97 - (C) Copyright Alan Cox. Released under the GPL version 2. * 28/4/97 - (C) Copyright Alan Cox. Released under the GPL version 2.
* *
* Alan Cox: Updated for new modular code. Removed snd_* irq handling. Now
* uses native linux resources
*
* Status: Testing required
*
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -297,7 +302,7 @@ int probe_uart6850(struct address_info *hw_config) ...@@ -297,7 +302,7 @@ int probe_uart6850(struct address_info *hw_config)
uart6850_base = hw_config->io_base; uart6850_base = hw_config->io_base;
uart6850_irq = hw_config->irq; uart6850_irq = hw_config->irq;
if (snd_set_irq_handler(uart6850_irq, m6850intr, "MIDI6850", uart6850_osp) < 0) if (request_irq(uart6850_irq, m6850intr, 0, "MIDI6850", NULL) < 0)
return 0; return 0;
ok = reset_uart6850(); ok = reset_uart6850();
...@@ -307,7 +312,7 @@ int probe_uart6850(struct address_info *hw_config) ...@@ -307,7 +312,7 @@ int probe_uart6850(struct address_info *hw_config)
void unload_uart6850(struct address_info *hw_config) void unload_uart6850(struct address_info *hw_config)
{ {
snd_release_irq(hw_config->irq); free_irq(hw_config->irq, NULL);
sound_unload_mididev(hw_config->slots[4]); sound_unload_mididev(hw_config->slots[4]);
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment