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
presence.
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
>/proc/sys/net/ipv4/ip_boot_agent
......
......@@ -6571,12 +6571,6 @@ CONFIG_JOYSTICK
be called joystick.o. If you want to compile it as a module, say M
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
CONFIG_SOUND
If you have a Sound Card in your Computer, i.e. if it can say more
......@@ -6612,6 +6606,16 @@ CONFIG_SB
an unknown card you may answer Y if the card claims to be
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
CONFIG_ADLIB
Answer Y if your card has a FM chip made by Yamaha (OPL2/OPL3/OPL4).
......
......@@ -16,6 +16,7 @@ usage.
Currently, these files are in /proc/sys/vm:
- bdflush
- buffermem
- freepages
- overcommit_memory
- swapctl
......@@ -88,11 +89,27 @@ number of jiffies per second is 100, except on Alpha machines
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:
This file contains three values: min_free_pages, free_pages_low
and free_pages_high in order.
This file contains the values in the struct freepages. That
struct contains three members: min, low and high.
These numbers are used by the VM subsystem to keep a reasonable
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
free used pages first. The actual freeing of pages is done
by kswapd, a kernel daemon.
min_free_pages -- when the number of free pages reaches this
level, only the kernel can allocate memory
for _critical_ tasks only
free_pages_low -- when the number of free pages drops below
this level, kswapd is woken up immediately
free_pages_high -- this is kswapd's target, when more than
free_pages_high pages are free, kswapd will
stop swapping.
min -- when the number of free pages reaches this
level, only the kernel can allocate memory
for _critical_ tasks only
low -- when the number of free pages drops below
this level, kswapd is woken up immediately
high -- this is kswapd's target, when more than <high>
pages are free, kswapd will stop swapping.
When the number of free pages is between free_pages_low and
free_pages_high, and kswapd hasn't run for swapout_interval
jiffies, then kswapd is woken up too. See swapout_interval
for more info.
When the number of free pages is between low and high,
and kswapd hasn't run for swapout_interval jiffies, then
kswapd is woken up too. See swapout_interval for more info.
When free memory is always low on your system, and kswapd has
trouble keeping up with allocations, you might want to
increase these values, especially free_pages_high and perhaps
free_pages_low. I've found that a 1:2:4 relation for these
values tend to work rather well in a heavily loaded system.
increase these values, especially high and perhaps low.
I've found that a 1:2:4 relation for these values tend to work
rather well in a heavily loaded system.
==============================================================
......@@ -163,9 +178,7 @@ static inline int vm_enough_memory(long pages)
swapctl:
This file contains no less than 16 variables, of which about
half is actually used :-) In the listing below, the unused
variables are marked as such.
This file contains no less than 8 variables.
All of these values are used by kswapd, and the usage can be
found in linux/mm/vmscan.c.
......@@ -177,18 +190,10 @@ typedef struct swap_control_v5
unsigned int sc_page_advance;
unsigned int sc_page_decline;
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_min;
unsigned int sc_pageout_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;
--------------------------------------------------------------
......@@ -207,9 +212,8 @@ is adjusted according to the following scheme:
(default 1)
And when a page reaches age 0, it's ready to be swapped out.
The variables sc_age_cluster_fract till sc_bufferout_weight
have to do with the amount of scanning kswapd is doing on
each call to try_to_swap_out().
The next four variables can be used to control kswapd's
agressiveness in swapping out pages.
sc_age_cluster_fract is used to calculate how many pages from
a process are to be scanned by kswapd. The formula used is
......@@ -221,9 +225,12 @@ also scan small processes.
The values of sc_pageout_weight and sc_bufferout_weight are
used to control the how many tries kswapd will do in order
to swapout one page / buffer. As with sc_age_cluster_fract,
the actual value is calculated by several more or less complex
formulae and the default value is good for every purpose.
to swapout one page / buffer. These values can be used to
finetune the ratio between user pages and buffer/cache memory.
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 @@
*/
.text
#include <linux/config.h>
#include <linux/tasks.h>
#include <linux/linkage.h>
#include <asm/segment.h>
......
......@@ -513,7 +513,7 @@ void print_IO_APIC (void)
return;
}
void init_sym_mode (void)
static void init_sym_mode (void)
{
printk("enabling Symmetric IO mode ... ");
outb (0x70, 0x22);
......@@ -521,6 +521,14 @@ void init_sym_mode (void)
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_Product_ID [16];
......
......@@ -13,6 +13,7 @@
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/stddef.h>
/* 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)
......@@ -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)
{
struct thread_struct * t = &current->tss;
if ((from + num <= from) || (from + num > IO_BITMAP_SIZE*32))
return -EINVAL;
if (!suser())
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;
}
......
#ifndef __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
*/
......@@ -20,6 +19,7 @@ void init_IO_APIC_traps(void);
int IO_APIC_get_PCI_irq_vector (int bus, int slot, int fn);
void make_8259A_irq (unsigned int irq);
void send_IPI (int dest, int vector);
void init_pic_mode (void);
extern unsigned int io_apic_irqs;
......
......@@ -44,6 +44,7 @@
#ifdef CONFIG_MATH_EMULATION
#include <asm/math_emu.h>
#endif
#include "irq.h"
#ifdef __SMP__
asmlinkage void ret_from_smpfork(void) __asm__("ret_from_smpfork");
......@@ -280,6 +281,12 @@ static inline void kb_wait(void)
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) {
/* 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,
set_ldt_desc(gdt+(nr<<1)+FIRST_LDT_ENTRY,p->ldt, 512);
else
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 */
p->tss.io_bitmap[i] = ~0;
/*
* a bitmap offset pointing outside of the TSS limit causes a nicely
* 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)
__asm__("clts ; fnsave %0 ; frstor %0":"=m" (p->tss.i387));
......
......@@ -26,7 +26,6 @@
* entries except for the gdt one..
*/
#include <linux/config.h>
#include <linux/linkage.h>
#include <asm/segment.h>
#include <asm/page.h>
......
......@@ -17,6 +17,7 @@
#include <linux/mman.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/swapctl.h>
#ifdef CONFIG_BLK_DEV_INITRD
#include <linux/blk.h>
#endif
......@@ -172,9 +173,6 @@ paging_init(unsigned long start_mem, unsigned long end_mem))
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);
int physmem_mapped_contig = 1;
......@@ -265,11 +263,11 @@ __initfunc(void mem_init(unsigned long start_mem, unsigned long end_mem))
initpages << (PAGE_SHIFT-10),
PAGE_OFFSET, end_mem);
min_free_pages = nr_free_pages >> 7;
if(min_free_pages < 16)
min_free_pages = 16;
free_pages_low = min_free_pages + (min_free_pages >> 1);
free_pages_high = min_free_pages + min_free_pages;
freepages.min = nr_free_pages >> 7;
if(freepages.min < 16)
freepages.min = 16;
freepages.low = freepages.min + (freepages.min >> 1);
freepages.high = freepages.min + freepages.min;
}
void free_initmem (void)
......
......@@ -26,8 +26,8 @@
#include <asm/uaccess.h>
#include <asm/fpumacro.h>
#include <asm/lsu.h>
#ifdef CONFIG_KERNELD
#include <linux/kerneld.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
/* #define SYSCALL_TRACING */
......@@ -327,7 +327,7 @@ void do_fpother(struct pt_regs *regs)
case (2 << 14): /* unfinished_FPop */
case (3 << 14): /* unimplemented_FPop */
#ifdef CONFIG_MATHEMU_MODULE
#ifdef CONFIG_KERNELD
#ifdef CONFIG_KMOD
if (!handle_mathemu)
request_module("math-emu");
#endif
......
......@@ -10,6 +10,7 @@
#include <linux/init.h>
#include <linux/blk.h>
#include <linux/swap.h>
#include <linux/swapctl.h>
#include <asm/head.h>
#include <asm/system.h>
......@@ -864,10 +865,6 @@ paging_init(unsigned long start_mem, unsigned long end_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))
{
unsigned long addr, tmp2 = 0;
......@@ -946,11 +943,11 @@ __initfunc(void mem_init(unsigned long start_mem, unsigned long end_mem))
initpages << (PAGE_SHIFT-10),
PAGE_OFFSET, end_mem);
min_free_pages = nr_free_pages >> 7;
if(min_free_pages < 16)
min_free_pages = 16;
free_pages_low = min_free_pages + (min_free_pages >> 1);
free_pages_high = min_free_pages + min_free_pages;
freepages.low = nr_free_pages >> 7;
if(freepages.low < 16)
freepages.low = 16;
freepages.low = freepages.low + (freepages.low >> 1);
freepages.high = freepages.low + freepages.low;
}
void free_initmem (void)
......
......@@ -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]) {
printk("raid5: bug: stripe->bh_new[%d], sector %lu exists\n", dd_idx, sh->sector);
printk("forcing oops.\n");
*(int*)=0;
*(int*)0=0;
}
set_bit(BH_Lock, &bh->b_state);
......
......@@ -106,11 +106,6 @@ if [ "$CONFIG_WATCHDOG" != "n" ]; then
tristate ' Acquire SBC Watchdog Timer' CONFIG_ACQUIRE_WDT
fi
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
bool 'Tadpole ANA H8 Support' CONFIG_H8
fi
......
......@@ -24,7 +24,6 @@
* for the QIC-117 floppy-tape driver for Linux.
*/
#include <linux/config.h>
#include <linux/errno.h>
#include <linux/mm.h>
......
......@@ -24,7 +24,6 @@
* for the QIC-117 floppy-tape driver for Linux.
*/
#include <linux/config.h>
#include <linux/errno.h>
#include <linux/mm.h>
......
......@@ -63,13 +63,6 @@
#include <asm/uaccess.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
* up another valuable major dev number for this. If you add
......@@ -126,12 +119,8 @@ unsigned char days_in_mo[] =
* so that there is no possibility of conflicting with the
* set_rtc_mmss() call that happens during some timer interrupts.
* (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)
{
/*
......@@ -152,11 +141,9 @@ static void rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
add_timer(&rtc_irq_timer);
}
}
#endif
/*
* 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)
......@@ -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,
size_t count, loff_t *ppos)
{
#ifdef __alpha__
return -EIO;
#else
struct wait_queue wait = { current, NULL };
unsigned long data;
ssize_t retval;
......@@ -201,7 +185,6 @@ static ssize_t rtc_read(struct file *file, char *buf,
remove_wait_queue(&rtc_wait, &wait);
return retval;
#endif
}
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;
switch (cmd) {
#ifndef __alpha__
case RTC_AIE_OFF: /* Mask alarm int. enab. bit */
{
mask_rtc_irq_bit(RTC_AIE);
......@@ -260,7 +242,6 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
set_rtc_irq_bit(RTC_UIE);
return 0;
}
#endif
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,
sizeof(struct rtc_time)))
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 */
day = rtc_tm.tm_mday;
hrs = rtc_tm.tm_hour;
......@@ -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);
}
#ifndef __alpha__
case RTC_IRQP_SET: /* Set periodic IRQ rate. */
{
int tmp = 0;
......@@ -437,7 +417,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
restore_flags(flags);
return 0;
}
#else /* __alpha__ */
#ifdef __alpha__
case RTC_EPOCH_READ: /* Read the epoch. */
{
return put_user (epoch, (unsigned long *)arg);
......@@ -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.
* Also clear the previous interrupt data on an open, and clean
* 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)
{
#ifndef __alpha__
if(rtc_status & RTC_IS_OPEN)
return -EBUSY;
rtc_status |= RTC_IS_OPEN;
rtc_irq_data = 0;
#endif
return 0;
}
......@@ -489,7 +466,6 @@ static int rtc_release(struct inode *inode, struct file *file)
* in use, and clear the data.
*/
#ifndef __alpha__
unsigned char tmp;
unsigned long flags;
......@@ -510,11 +486,9 @@ static int rtc_release(struct inode *inode, struct file *file)
rtc_irq_data = 0;
rtc_status &= ~RTC_IS_OPEN;
#endif
return 0;
}
#ifndef __alpha__
static unsigned int rtc_poll(struct file *file, poll_table *wait)
{
poll_wait(file, &rtc_wait, wait);
......@@ -522,7 +496,6 @@ static unsigned int rtc_poll(struct file *file, poll_table *wait)
return POLLIN | POLLRDNORM;
return 0;
}
#endif
/*
* The various file operations we support.
......@@ -533,11 +506,7 @@ static struct file_operations rtc_fops = {
rtc_read,
NULL, /* No write */
NULL, /* No readdir */
#ifdef __alpha__
NULL, /* No select on Alpha */
#else
rtc_poll,
#endif
rtc_ioctl,
NULL, /* No mmap */
rtc_open,
......@@ -560,14 +529,12 @@ __initfunc(int rtc_init(void))
char *guess = NULL;
#endif
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))
{
/* Yeah right, seeing as irq 8 doesn't even hit the bus. */
printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ);
return -EIO;
}
#endif
misc_register(&rtc_dev);
/* Check region? Naaah! Just snarf it up. */
request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc");
......@@ -599,8 +566,8 @@ __initfunc(int rtc_init(void))
guess = "Digital UNIX";
}
if (guess)
printk("rtc: %s epoch (%ld) detected\n", guess, epoch);
#else
printk("rtc: %s epoch (%lu) detected\n", guess, epoch);
#endif
init_timer(&rtc_irq_timer);
rtc_irq_timer.function = rtc_dropped_irq;
rtc_wait = NULL;
......@@ -610,7 +577,6 @@ __initfunc(int rtc_init(void))
CMOS_WRITE(((CMOS_READ(RTC_FREQ_SELECT) & 0xF0) | 0x06), RTC_FREQ_SELECT);
restore_flags(flags);
rtc_freq = 1024;
#endif
return 0;
}
......@@ -626,7 +592,6 @@ __initfunc(int rtc_init(void))
* for something that requires a steady > 1KHz signal anyways.)
*/
#ifndef __alpha__
void rtc_dropped_irq(unsigned long data)
{
unsigned long flags;
......@@ -643,7 +608,6 @@ void rtc_dropped_irq(unsigned long data)
rtc_irq_data |= (CMOS_READ(RTC_INTR_FLAGS) & 0xF0); /* restart */
restore_flags(flags);
}
#endif
/*
* Info exported via "/proc/rtc".
......@@ -672,9 +636,10 @@ int get_rtc_status(char *buf)
*/
p += sprintf(p,
"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_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);
......@@ -788,12 +753,9 @@ void get_rtc_time(struct rtc_time *rtc_tm)
* Account for differences between how the RTC uses the values
* 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;
/* if ARCFUDGE == 0, the optimizer should do away with this */
rtc_tm->tm_year -= ARCFUDGE;
rtc_tm->tm_mon--;
}
......@@ -832,7 +794,6 @@ void get_rtc_alm_time(struct rtc_time *alm_tm)
* meddles with the interrupt enable/disable bits.
*/
#ifndef __alpha__
void mask_rtc_irq_bit(unsigned char bit)
{
unsigned char val;
......@@ -862,4 +823,3 @@ void set_rtc_irq_bit(unsigned char bit)
rtc_irq_data = 0;
restore_flags(flags);
}
#endif
......@@ -83,9 +83,6 @@ static unsigned int ipddp_debug = IPDDP_DEBUG;
/* Index to functions, as function prototypes. */
static int ipddp_xmit(struct sk_buff *skb, 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_delete(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)
/* Let the user now what mode we are in */
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);
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);
/* Fill in the device structure with ethernet-generic values. */
......@@ -140,8 +137,6 @@ int ipddp_init(struct device *dev)
dev->stop = ipddp_close;
dev->get_stats = ipddp_get_stats;
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->mtu = 585;
......@@ -157,24 +152,6 @@ int ipddp_init(struct device *dev)
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.
*/
......@@ -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
* ddpehdr we reserved earlier. skb->h.raw will be the higher level header.
* Transmit LLAP/ELAP frame using aarp_send_ddp.
*/
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;
struct ddpehdr *ddp;
struct at_addr at;
struct ipddp_route *rt;
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.
*/
......@@ -205,25 +178,21 @@ static int ipddp_rebuild_header(struct sk_buff *skb)
if(rt->ip == paddr)
break;
}
if(rt == NULL)
{
printk("%s: unreachable dst %s\n", cardname, in_ntoa(paddr));
return -ENETUNREACH;
}
return 0;
our_addr = atalk_find_dev_addr(rt->dev);
if(ipddp_mode == IPDDP_DECAP)
/*
* Pull off the excess room that should not be there.
* This is the case for Localtalk, this may not hold
* true for Ethertalk, etc.
* This is due to a hard-header problem. This is the
* 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 */
ddp = (struct ddpehdr *) (skb->data+4);
ddp = (struct ddpehdr *)skb->data;
ddp->deh_len = skb->len;
ddp->deh_hops = 1;
ddp->deh_pad = 0;
......@@ -231,7 +200,7 @@ static int ipddp_rebuild_header(struct sk_buff *skb)
/*
* 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)
{
......@@ -248,24 +217,16 @@ static int ipddp_rebuild_header(struct sk_buff *skb)
ddp->deh_dport = 72;
ddp->deh_sport = 72;
*((__u8 *)(ddp+1)) = 22; /* ddp type = IP */
*((__u16 *)ddp)=ntohs(*((__u16 *)ddp)); /* fix up length field */
*((__u8 *)(ddp+1)) = 22; /* ddp type = IP */
*((__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 */
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,
unsigned short type, void *daddr, void *saddr, unsigned len)
{
/* Push down the header space and the type byte */
skb_push(skb, sizeof(struct ddpehdr)+1+4);
if(aarp_send_ddp(rt->dev, skb, &rt->at, NULL) < 0)
dev_kfree_skb(skb);
return 0;
}
......
......@@ -10,7 +10,6 @@
#define SIOCADDIPDDPRT (SIOCDEVPRIVATE)
#define SIOCDELIPDDPRT (SIOCDEVPRIVATE+1)
#define SIOCFINDIPDDPRT (SIOCDEVPRIVATE+2)
#define SIOCPRINTIPDDPRT (SIOCDEVPRIVATE+3)
struct ipddp_route
{
......
......@@ -51,7 +51,7 @@
/* $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/kernel.h>
#include <linux/sched.h>
......
......@@ -8,7 +8,6 @@
*
*/
#include <linux/config.h>
#define __NO_VERSION__
#include <linux/module.h>
......
......@@ -43,7 +43,6 @@
* driver uses the new code this *ENTIRE* file will be nuked.
*/
#include <linux/config.h> /* for CONFIG_KERNELD */
#define __NO_VERSION__
#include <linux/module.h>
......
......@@ -10,7 +10,6 @@
* we attempt to remove commands from the queue and retry them.
*/
#include <linux/config.h>
#define __NO_VERSION__
#include <linux/module.h>
......
......@@ -6,6 +6,8 @@ fi
dep_tristate '100% Sound Blaster compatibles (SB16/32/64, ESS, Jazz16) support' CONFIG_SB $CONFIG_SOUND
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
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
......
......@@ -117,22 +117,6 @@ else
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)
LX_OBJS += uart401.o
else
......@@ -159,9 +143,31 @@ endif
ifeq ($(CONFIG_SSCAPE),y)
L_OBJS += sscape.o
LX_OBJS += ad1848.o
CONFIG_MPU401 = y
else
ifeq ($(CONFIG_SSCAPE),m)
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
......@@ -265,7 +271,7 @@ CONFIG_MAUI_BOOT_FILE := $(patsubst "%", %, $(CONFIG_MAUI_BOOT_FILE))
maui.o: maui_boot.h
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 'FILES_BOOT_UP_TO_DATE += $@'; \
......@@ -297,7 +303,7 @@ CONFIG_TRIX_BOOT_FILE := $(patsubst "%", %, $(CONFIG_TRIX_BOOT_FILE))
trix.o: trix_boot.h
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 'FILES_BOOT_UP_TO_DATE += $@'; \
......
......@@ -23,6 +23,12 @@
*/
/*
* 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>
......@@ -144,9 +150,9 @@ static void ad1848_tmr_reprogram(int dev);
static int ad_read(ad1848_info * devc, int reg)
{
unsigned long flags;
int x;
int timeout = 900000;
unsigned long flags;
int x;
int timeout = 900000;
while (timeout > 0 && inb(devc->base) == 0x80) /*Are we initializing */
timeout--;
......@@ -163,11 +169,10 @@ static int ad_read(ad1848_info * devc, int reg)
static void ad_write(ad1848_info * devc, int reg, int data)
{
unsigned long flags;
int timeout = 900000;
unsigned long flags;
int timeout = 900000;
while (timeout > 0 &&
inb(devc->base) == 0x80) /*Are we initializing */
while (timeout > 0 && inb(devc->base) == 0x80) /* Are we initializing */
timeout--;
save_flags(flags);
......@@ -180,7 +185,7 @@ static void ad_write(ad1848_info * devc, int reg, int data)
static void wait_for_calibration(ad1848_info * devc)
{
int timeout = 0;
int timeout = 0;
/*
* 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
else
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,
dev_name,
&ad1848_audio_driver,
......@@ -1762,12 +1771,11 @@ int ad1848_init(char *name, int io_base, int irq, int dma_playback, int dma_capt
dma_playback,
dma_capture)) < 0)
{
kfree(portc);
portc=NULL;
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;
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
if (irq > 0)
{
irq2dev[irq] = devc->dev_no = my_dev;
if (snd_set_irq_handler(devc->irq, adintr,
devc->name,
NULL) < 0)
devc->dev_no = my_dev;
if (request_irq(devc->irq, adintr, 0, devc->name, (void *)my_dev) < 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)
{
int x;
unsigned char tmp = ad_read(devc, 16);
int x;
unsigned char tmp = ad_read(devc, 16);
devc->timer_ticks = 0;
ad_write(devc, 21, 0x00); /* Timer MSB */
ad_write(devc, 20, 0x10); /* Timer LSB */
#ifndef __SMP__
ad_write(devc, 16, tmp | 0x40); /* Enable timer */
for (x = 0; x < 100000 && devc->timer_ticks == 0; x++);
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
DDB(printk("Interrupt test OK\n"));
devc->irq_ok = 1;
}
#else
devc->irq_ok=1;
#endif
}
else
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
void ad1848_control(int cmd, int arg)
{
ad1848_info *devc;
ad1848_info *devc;
if (nr_ad1848_devs < 1)
return;
......@@ -1850,7 +1859,7 @@ void ad1848_control(int cmd, int arg)
switch (cmd)
{
case AD1848_SET_XTAL: /* Change clock frequency of AD1845 (only ) */
if (devc->model != MD_1845)
if (devc->model != MD_1845)
return;
ad_enter_MCE(devc);
ad_write(devc, 29, (ad_read(devc, 29) & 0x1f) | (arg << 5));
......@@ -1859,8 +1868,8 @@ void ad1848_control(int cmd, int arg)
case AD1848_MIXER_REROUTE:
{
int o = (arg >> 8) & 0xff;
int n = arg & 0xff;
int o = (arg >> 8) & 0xff;
int n = arg & 0xff;
if (n == SOUND_MIXER_NONE)
{ /* Just hide this control */
......@@ -1906,12 +1915,14 @@ void ad1848_unload(int io_base, int irq, int dma_playback, int dma_capture, int
if (devc != NULL)
{
if(audio_devs[dev]->portc!=NULL)
kfree(audio_devs[dev]->portc);
release_region(devc->base, 4);
if (!share_dma)
{
if (irq > 0)
snd_release_irq(devc->irq);
free_irq(devc->irq, NULL);
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
void adintr(int irq, void *dev_id, struct pt_regs *dummy)
{
unsigned char status;
ad1848_info *devc;
int dev;
int alt_stat = 0xff;
unsigned char c930_stat = 0;
int cnt = 0;
if (irq < 0 || irq > 15)
{
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;
unsigned char status;
ad1848_info *devc;
int dev;
int alt_stat = 0xff;
unsigned char c930_stat = 0;
int cnt = 0;
dev = (int)dev_id;
devc = (ad1848_info *) audio_devs[dev]->devc;
interrupt_again: /* Jump back here if int status doesn't reset */
......@@ -2542,12 +2533,12 @@ EXPORT_SYMBOL(unload_ms_sound);
#ifdef MODULE
MODULE_PARM(io, "i");
MODULE_PARM(irq, "i");
MODULE_PARM(dma, "i");
MODULE_PARM(dma2, "i");
MODULE_PARM(type, "i");
MODULE_PARM(deskpro_xl, "i");
MODULE_PARM(io, "i"); /* I/O for a raw AD1848 card */
MODULE_PARM(irq, "i"); /* IRQ to use */
MODULE_PARM(dma, "i"); /* First DMA channel */
MODULE_PARM(dma2, "i"); /* Second DMA channel */
MODULE_PARM(type, "i"); /* Card type */
MODULE_PARM(deskpro_xl, "i"); /* Special magic for Deskpro XL boxen */
int io = -1;
int irq = -1;
......
......@@ -2,12 +2,27 @@
int main( int argc, const char * argv [] )
{
const char * varname = argv[1];
const char * varname;
int i = 0;
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( "static unsigned char %s [] =\n{\n", varname );
printf( "static unsigned char %s [] %s =\n{\n", varname , id?"__initdata":"");
while ( ( c = getchar( ) ) != EOF )
{
......
......@@ -12,7 +12,14 @@
* CS4232
* CS4236
* 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
*
......@@ -20,6 +27,7 @@
* Version 2 (June 1991). See the "COPYING" file distributed with this software
* for more info.
*/
#include <linux/config.h>
#include <linux/module.h>
......@@ -99,6 +107,8 @@ int probe_cs4232(struct address_info *hw_config)
* just one CS4232 compatible device can exist on the system. Also this
* method conflicts with possible PnP support in the OS. For this reason
* 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)
* 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.
*/
......@@ -298,8 +308,7 @@ struct address_info cfg;
* loaded ready.
*/
int
init_module(void)
int init_module(void)
{
if (io == -1 || irq == -1 || dma == -1 || dma2 == -1)
{
......
......@@ -125,6 +125,7 @@ static void sound_free_dmap(struct dma_buffparms *dmap)
free_pages((unsigned long) dmap->raw_buf, sz);
dmap->raw_buf = NULL;
/* Remember the buffer is deleted so we dont Oops later */
dmap->fragment_size = 0;
}
......@@ -832,12 +833,12 @@ int DMAbuf_move_wrpointer(int dev, int l)
dmap->user_counter += l;
dmap->flags |= DMA_DIRTY;
if (dmap->user_counter >= dmap->max_byte_counter) {
if (dmap->byte_counter >= dmap->max_byte_counter) {
/* Wrap the byte counters */
long decr = dmap->user_counter;
dmap->user_counter = (dmap->user_counter % dmap->bytes_in_use) + dmap->bytes_in_use;
decr -= dmap->user_counter;
dmap->byte_counter -= decr;
long decr = dmap->byte_counter;
dmap->byte_counter = (dmap->byte_counter % dmap->bytes_in_use);
decr -= dmap->byte_counter;
dmap->user_counter -= decr;
}
end_ptr = (dmap->user_counter / dmap->fragment_size) * dmap->fragment_size;
......@@ -928,7 +929,7 @@ static void do_outputintr(int dev, int dummy)
dmap->byte_counter += dmap->bytes_in_use;
if (dmap->byte_counter >= dmap->max_byte_counter) { /* Overflow */
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;
dmap->user_counter -= decr;
}
......@@ -952,7 +953,7 @@ static void do_outputintr(int dev, int dummy)
dmap->byte_counter += dmap->bytes_in_use;
if (dmap->byte_counter >= dmap->max_byte_counter) { /* Overflow */
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;
dmap->user_counter -= decr;
}
......
This diff is collapsed.
......@@ -30,7 +30,7 @@ int gus_pnp_flag = 0;
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);
......@@ -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 + 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);
......@@ -111,14 +111,15 @@ void unload_gus(struct address_info *hw_config)
void gusintr(int irq, void *dev_id, struct pt_regs *dummy)
{
unsigned char src;
extern int gus_timer_enabled;
unsigned char src;
extern int gus_timer_enabled;
struct address_info *hw_config=dev_id;
sti();
#ifdef CONFIG_GUSMAX
if (have_gus_max)
adintr(irq, NULL, NULL);
adintr(irq, (void *)hw_config->slots[3], NULL);
#endif
while (1)
......
......@@ -66,14 +66,27 @@ int loadhex(FILE *inf, unsigned char *buf)
int main( int argc, const char * argv [] )
{
const char * varline = argv[1];
const char * varline;
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);
printf("/*\n *\t Computer generated file. Do not edit.\n */\n");
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++)
{
......
......@@ -9,7 +9,15 @@
* 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
* for more info.
*
* Changes:
* Alan Cox General clean up, use kernel IRQ
* system
*
* Status:
* Untested
*/
#include <linux/config.h>
#include <linux/module.h>
......@@ -327,7 +335,7 @@ int probe_maui(struct address_info *hw_config)
maui_base = hw_config->io_base;
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;
/*
......@@ -342,26 +350,26 @@ int probe_maui(struct address_info *hw_config)
maui_read() == -1 || maui_read() == -1)
if (!maui_init(hw_config->irq))
{
snd_release_irq(hw_config->irq);
free_irq(hw_config->irq, NULL);
return 0;
}
}
if (!maui_write(0xCF)) /* Report hardware version */
{
printk(KERN_ERR "No WaveFront firmware detected (card uninitialized?)\n");
snd_release_irq(hw_config->irq);
free_irq(hw_config->irq, NULL);
return 0;
}
if ((tmp1 = maui_read()) == -1 || (tmp2 = maui_read()) == -1)
{
printk(KERN_ERR "No WaveFront firmware detected (card uninitialized?)\n");
snd_release_irq(hw_config->irq);
free_irq(hw_config->irq, NULL);
return 0;
}
if (tmp1 == 0xff || tmp2 == 0xff)
{
snd_release_irq(hw_config->irq);
return 0;
free_irq(hw_config->irq, NULL);
return 0;
}
if (trace_init)
printk(KERN_DEBUG "WaveFront hardware version %d.%d\n", tmp1, tmp2);
......@@ -439,7 +447,7 @@ void unload_maui(struct address_info *hw_config)
if (irq < 0)
irq = -irq;
if (irq > 0)
snd_release_irq(irq);
free_irq(irq, NULL);
}
#ifdef MODULE
......@@ -452,8 +460,7 @@ static int fw_load = 0;
struct address_info cfg;
/*
* Install a CS4232 based card. Need to have ad1848 and mpu401
* loaded ready.
* Install a Maui card. Needs mpu401 loaded already.
*/
int init_module(void)
......
This diff is collapsed.
......@@ -2,25 +2,30 @@
* sound/opl3.c
*
* A low level driver for Yamaha YM3812 and OPL-3 -chips
*/
/*
*
*
* Copyright (C) by Hannu Savolainen 1993-1997
*
* 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
* 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/module.h>
#include <linux/delay.h>
/*
* Major improvements to the FM handling 30AUG92 by Rob Hooft,
*/
/*
* hooft@chem.ruu.nl
*/
......@@ -109,32 +114,32 @@ static int opl3_ioctl(int dev, unsigned int cmd, caddr_t arg)
struct sbi_instrument ins;
switch (cmd) {
case SNDCTL_FM_LOAD_INSTR:
printk(KERN_WARNING "Warning: Obsolete ioctl(SNDCTL_FM_LOAD_INSTR) used. Fix the program.\n");
if (__copy_from_user(&ins, arg, sizeof(ins)))
return -EFAULT;
if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR) {
printk("FM Error: Invalid instrument number %d\n", ins.channel);
return -EINVAL;
}
return store_instr(ins.channel, &ins);
case SNDCTL_FM_LOAD_INSTR:
printk(KERN_WARNING "Warning: Obsolete ioctl(SNDCTL_FM_LOAD_INSTR) used. Fix the program.\n");
if (copy_from_user(&ins, arg, sizeof(ins)))
return -EFAULT;
if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR) {
printk(KERN_WARNING "FM Error: Invalid instrument number %d\n", ins.channel);
return -EINVAL;
}
return store_instr(ins.channel, &ins);
case SNDCTL_SYNTH_INFO:
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)))
return -EFAULT;
return 0;
case SNDCTL_SYNTH_INFO:
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)))
return -EFAULT;
return 0;
case SNDCTL_SYNTH_MEMAVL:
return 0x7fffffff;
case SNDCTL_SYNTH_MEMAVL:
return 0x7fffffff;
case SNDCTL_FM_4OP_ENABLE:
if (devc->model == 2)
enter_4op_mode();
return 0;
case SNDCTL_FM_4OP_ENABLE:
if (devc->model == 2)
enter_4op_mode();
return 0;
default:
return -EINVAL;
default:
return -EINVAL;
}
}
......@@ -151,8 +156,8 @@ int opl3_detect(int ioaddr, int *osp)
* Note2! The chip is initialized if detected.
*/
unsigned char stat1, signature;
int i;
unsigned char stat1, signature;
int i;
if (devc != NULL)
{
......@@ -160,10 +165,7 @@ int opl3_detect(int ioaddr, int *osp)
return 0;
}
devc = (struct opl_devinfo *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(*devc)));
sound_mem_sizes[sound_nblocks] = sizeof(*devc);
if (sound_nblocks < 1024)
sound_nblocks++;;
devc = (struct opl_devinfo *)kmalloc(sizeof(*devc), GFP_KERNEL);
if (devc == NULL)
{
......@@ -333,7 +335,7 @@ static char fm_volume_table[128] =
static void calc_vol(unsigned char *regbyte, int volume, int main_vol)
{
int level = (~*regbyte & 0x3f);
int level = (~*regbyte & 0x3f);
if (main_vol > 127)
main_vol = 127;
......@@ -814,7 +816,8 @@ static int opl3_load_patch(int dev, int format, const char *addr,
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)
{
......@@ -1199,6 +1202,7 @@ void cleanup_module(void)
{
if (devc)
{
kfree(devc);
devc = NULL;
sound_unload_synthdev(me);
}
......
......@@ -164,7 +164,7 @@ static int config_pas_hw(struct address_info *hw_config)
}
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;
}
}
......@@ -355,7 +355,7 @@ void
unload_pas(struct address_info *hw_config)
{
sound_free_dma(hw_config->dma);
snd_release_irq(hw_config->irq);
free_irq(hw_config->irq, NULL);
}
#ifdef MODULE
......
This diff is collapsed.
......@@ -1151,14 +1151,14 @@ void sb_audio_init(sb_devc * devc, char *name)
}
if ((devc->my_dev = sound_install_audiodrv(AUDIO_DRIVER_VERSION,
name,
driver,
sizeof(struct audio_driver),
audio_flags,
format_mask,
devc,
devc->dma8,
devc->dma8)) < 0)
name,
driver,
sizeof(struct audio_driver),
audio_flags,
format_mask,
devc,
devc->dma8,
devc->dma8)) < 0)
{
printk(KERN_ERR "sb: unable to install audio.\n");
return;
......
......@@ -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 sm_games = 0; /* Mixer - see sb_mixer.c */
int acer = 0; /* Do acer notebook init */
int mwave_bug = 0; /* Using the dreadful mwave sb emulation */
MODULE_PARM(io, "i");
MODULE_PARM(irq, "i");
......@@ -80,10 +81,11 @@ MODULE_PARM(mad16, "i");
MODULE_PARM(trix, "i");
MODULE_PARM(pas2, "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)
{
......@@ -119,8 +121,7 @@ int init_module(void)
return 0;
}
void
cleanup_module(void)
void cleanup_module(void)
{
if (smw_free)
kfree(smw_free);
......@@ -133,19 +134,20 @@ cleanup_module(void)
#else
#ifdef SM_GAMES
#ifdef CONFIG_SM_GAMES
int sm_games = 1;
#else
int sm_games = 0;
#endif
#ifdef SB_ACER
#ifdef CONFIG_SB_ACER
int acer = 1;
#else
int acer = 0;
#endif
#ifdef CONFIG_SB_MWAVE
int mwave_bug = 1;
#else
int mwave_bug = 0;
#endif
#endif
#endif
......
......@@ -28,7 +28,6 @@
static sb_devc *detected_devc = NULL; /* For communication from probe to init */
static sb_devc *last_devc = NULL; /* For MPU401 initialization */
static sb_devc *irq2devc[16] = {NULL};
static unsigned char jazz_irq_bits[] = {
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)
int status;
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;
if (devc->model == MDL_SB16)
{
src = sb_getmixer(devc, IRQ_STAT); /* Interrupt source register */
......@@ -710,6 +703,7 @@ void sb_dsp_init(struct address_info *hw_config)
sb_devc *devc;
char name[100];
extern int sb_be_quiet;
extern int mwave_bug;
/*
* Check if we had detected a SB device earlier
......@@ -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)
{ /* 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);
sound_unload_audiodev(devc->dev);
return;
}
irq2devc[hw_config->irq] = devc;
devc->irq_ok = 0;
if (devc->major == 4)
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);
irq2devc[hw_config->irq] = NULL;
return;
}
if ((devc->type == 0 || devc->type == MDL_ESS) &&
......@@ -777,7 +769,7 @@ void sb_dsp_init(struct address_info *hw_config)
/* Skip IRQ detection if SMP (doesn't work) */
devc->irq_ok = 1;
#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;
else
{
......@@ -883,6 +875,7 @@ void sb_dsp_init(struct address_info *hw_config)
}
}
hw_config->card_subtype = devc->model;
hw_config->slots[0]=devc->dev;
last_devc = devc; /* For SB MPU detection */
if (!(devc->caps & SB_NO_AUDIO) && devc->dma8 >= 0)
......@@ -915,15 +908,8 @@ void sb_dsp_disable_recording(int io_base)
void sb_dsp_unload(struct address_info *hw_config)
{
sb_devc *devc;
int irq = hw_config->irq;
if (irq < 0)
irq *= -1;
if (irq > 2 && irq < 16)
devc = irq2devc[irq];
else
devc = NULL;
devc = audio_devs[hw_config->slots[0]]->devc;
if (devc && devc->base == hw_config->io_base)
{
......@@ -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)
{
snd_release_irq(devc->irq);
irq2devc[devc->irq] = NULL;
free_irq(devc->irq, devc);
sound_unload_mixerdev(devc->my_mixerdev);
sound_unload_mididev(devc->my_mididev);
sound_unload_audiodev(devc->my_dev);
}
kfree(devc);
}
else
release_region(hw_config->io_base, 16);
......
......@@ -83,8 +83,9 @@ void MIDIbuf_init(void);
/* From soundcard.c */
void request_sound_timer (int count);
void sound_stop_timer(void);
int snd_set_irq_handler (int interrupt_level, void(*iproc)(int, void*, struct pt_regs *), char *name, int *osp);
void snd_release_irq(int vect);
/* These two are about to die.. */
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_free(int dev);
void conf_printf(char *name, struct address_info *hw_config);
......
......@@ -47,6 +47,14 @@ void reprogram_timer(void)
{
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);
/*
......
......@@ -26,6 +26,7 @@
#include <linux/fcntl.h>
#include <linux/ctype.h>
#include <linux/stddef.h>
#include <linux/kmod.h>
#ifdef __KERNEL__
#include <asm/io.h>
#include <asm/segment.h>
......@@ -438,7 +439,7 @@ static int sound_open(struct inode *inode, struct file *file)
case SND_DEV_CTL:
dev >>= 4;
#ifdef CONFIG_KERNELD
#ifdef CONFIG_KMOD
if (dev >= 0 && dev < MAX_MIXER_DEV && mixer_devs[dev] == NULL) {
char modname[20];
sprintf(modname, "mixer%d", dev);
......@@ -554,14 +555,14 @@ static int sound_mixer_ioctl(int mixdev, unsigned int cmd, caddr_t arg)
{
if (mixdev < 0 || mixdev >= MAX_MIXER_DEV)
return -ENXIO;
#ifdef CONFIG_KERNELD
#ifdef CONFIG_KMOD
/* Try to load the mixer... */
if (mixer_devs[mixdev] == NULL) {
char modname[20];
sprintf(modname, "mixer%d", mixdev);
request_module(modname);
}
#endif /* CONFIG_KERNELD */
#endif /* CONFIG_KMOD */
if (mixdev >= num_mixers || !mixer_devs[mixdev])
return -ENXIO;
if (cmd == SOUND_MIXER_INFO)
......@@ -800,7 +801,7 @@ free_all_irqs(void)
if (irqs & (1ul << 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;
......@@ -894,14 +895,14 @@ void cleanup_module(void)
}
#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;
unsigned long flags;
int retcode;
unsigned long flags;
save_flags(flags);
cli();
retcode = request_irq(interrupt_level, iproc, 0, name, NULL);
retcode = request_irq(interrupt_level, iproc, 0, name, dev_id);
if (retcode < 0)
{
......@@ -914,13 +915,13 @@ int snd_set_irq_handler(int interrupt_level, void (*iproc) (int, void *, struct
return retcode;
}
void snd_release_irq(int vect)
void snd_release_irq(int vect, void *dev_id)
{
if (!(irqs & (1ul << vect)))
return;
irqs &= ~(1ul << vect);
free_irq(vect, NULL);
free_irq(vect, dev_id);
}
int sound_alloc_dma(int chn, char *deviceID)
......
This diff is collapsed.
......@@ -10,6 +10,11 @@
* 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.
*
* 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/module.h>
......@@ -297,7 +302,7 @@ int probe_uart6850(struct address_info *hw_config)
uart6850_base = hw_config->io_base;
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;
ok = reset_uart6850();
......@@ -307,7 +312,7 @@ int probe_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]);
}
......
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