Commit e3be5730 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.13pre5

parent 4e5f45c6
......@@ -105,7 +105,7 @@ EXPORT_SYMBOL(alpha_read_fp_reg);
EXPORT_SYMBOL(alpha_write_fp_reg);
/* In-kernel system calls. */
EXPORT_SYMBOL(__kernel_thread);
EXPORT_SYMBOL(kernel_thread);
EXPORT_SYMBOL(sys_open);
EXPORT_SYMBOL(sys_dup);
EXPORT_SYMBOL(sys_exit);
......
......@@ -26,7 +26,7 @@
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/tasks.h>
#include <linux/threads.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
......
......@@ -38,6 +38,8 @@
*/
#define PF_PTRACED 0x00000010
#define CLONE_VM 0x00000100
/*
* This defines the normal kernel pt-regs layout.
*
......@@ -225,21 +227,23 @@ kernel_clone:
.end kernel_clone
/*
* __kernel_thread(clone_flags, fn, arg)
* kernel_thread(fn, arg, clone_flags)
*/
.align 3
.globl __kernel_thread
.ent __kernel_thread
__kernel_thread:
.globl kernel_thread
.ent kernel_thread
kernel_thread:
ldgp $29,0($27) /* we can be called from a module */
.frame $30, 4*8, $26
subq $30,4*8,$30
stq $10,16($30)
stq $9,8($30)
lda $0,CLONE_VM
stq $26,0($30)
.prologue 1
mov $17,$9 /* save fn */
mov $18,$10 /* save arg */
mov $16,$9 /* save fn */
mov $17,$10 /* save arg */
or $18,$0,$16 /* shuffle flags to front; add CLONE_VM. */
bsr $26,kernel_clone
bne $20,1f /* $20 is non-zero in child */
ldq $26,0($30)
......@@ -257,7 +261,7 @@ __kernel_thread:
mov $0,$16
mov $31,$26
jsr $31,sys_exit
.end __kernel_thread
.end kernel_thread
/*
* __kernel_execve(path, argv, envp, regs)
......
......@@ -45,6 +45,7 @@ SECTIONS
/* Global data */
_data = .;
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
.rodata : { *(.rodata) }
.data : { *(.data) CONSTRUCTORS }
.got : { *(.got) }
......
......@@ -548,6 +548,11 @@ static int apm_set_power_state(u_short state)
*/
#define HARD_IDLE_TIMEOUT (HZ/3)
/* This should wake up kapmd and ask it to slow the CPU */
#define powermanagement_idle() do { } while (0)
extern int hlt_counter;
/*
* This is the idle thing.
*/
......
......@@ -907,12 +907,17 @@ static void __init pcibios_fixup_io_addr(struct pci_dev *dev, int idx)
if ((try & PCI_BASE_ADDRESS_IO_MASK) != addr) {
addr = 0;
printk("PCI: Address setup failed, got %04x\n", try);
} else
dev->base_address[idx] = try;
} else {
struct resource *res = dev->resource + idx;
res->start = addr;
res->end = addr + size - 1;
res->flags |= PCI_BASE_ADDRESS_IO_MASK;
}
}
if (!addr) {
pcibios_write_config_dword(bus, devfn, reg, 0);
dev->base_address[idx] = 0;
dev->resource[idx].start = 0;
dev->resource[idx].flags = 0;
}
pcibios_write_config_word(bus, devfn, PCI_COMMAND, cmd);
}
......@@ -939,7 +944,7 @@ static void __init pcibios_fixup_ghosts(struct pci_bus *b)
e->vendor == d->vendor &&
e->device == d->device &&
e->class == d->class &&
!memcmp(e->base_address, d->base_address, sizeof(e->base_address)))
!memcmp(e->resource, d->resource, sizeof(e->resource)))
break;
if (!e)
return;
......@@ -1060,7 +1065,7 @@ static void __init pci_fixup_umc_ide(struct pci_dev *d)
int i;
for(i=0; i<4; i++)
d->base_address[i] |= PCI_BASE_ADDRESS_SPACE_IO;
d->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO;
}
struct dev_ex {
......@@ -1112,11 +1117,12 @@ static void __init pcibios_fixup_devices(void)
*/
has_io = has_mem = 0;
for(i=0; i<6; i++) {
unsigned long a = dev->base_address[i];
struct resource *res = dev->resource + i;
unsigned long a = res->flags;
if (a & PCI_BASE_ADDRESS_SPACE_IO) {
unsigned long addr = res->start;
has_io = 1;
a &= PCI_BASE_ADDRESS_IO_MASK;
if (!a || a == PCI_BASE_ADDRESS_IO_MASK)
if (!addr || addr == PCI_BASE_ADDRESS_IO_MASK)
pcibios_fixup_io_addr(dev, i);
} else if (a & PCI_BASE_ADDRESS_MEM_MASK)
has_mem = 1;
......
......@@ -255,9 +255,9 @@ __setup("noapic", ioapic_setup);
static int __init ioapic_pirq_setup(char *str)
{
int i, max;
int ints[11];
int ints[MAX_PIRQS+1];
get_options(str, ints);
get_options(str, MAX_PIRQS+1, ints);
for (i = 0; i < MAX_PIRQS; i++)
pirq_entries[i] = -1;
......
......@@ -470,7 +470,6 @@ static void show(char * str)
int i;
unsigned long *stack;
int cpu = smp_processor_id();
extern char *get_options(char *str, int *ints);
printk("\n%s, CPU %d:\n", str, cpu);
printk("irq: %d [%d %d]\n",
......
......@@ -51,15 +51,6 @@ spinlock_t semaphore_wake_lock = SPIN_LOCK_UNLOCKED;
asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
/*
* We'll get there..
*/
#ifdef CONFIG_APM
#define powermanagement_idle() do { } while (0)
#else
#define powermanagement_idle() do { } while (0)
#endif
static int hlt_counter=0;
void disable_hlt(void)
......
......@@ -182,11 +182,7 @@ __setup("nosmp", nosmp);
static int __init maxcpus(char *str)
{
int ints[11];
get_options(str, ints);
if (ints[0] > 0)
max_cpus = ints[1];
get_option(&str, &max_cpus);
return 1;
}
......
......@@ -17,7 +17,7 @@
*/
#include <linux/config.h>
#include <asm/init.h>
#include <linux/init.h>
#include <asm/dec/machtype.h>
#ifdef CONFIG_ZS
......
......@@ -13,7 +13,7 @@
#include <linux/param.h>
#include <asm/mipsregs.h>
#include <asm/bootinfo.h>
#include <asm/init.h>
#include <linux/init.h>
#include <asm/irq.h>
#include <asm/reboot.h>
......
......@@ -14,7 +14,7 @@
*/
#include <asm/bootinfo.h>
#include <asm/init.h>
#include <linux/init.h>
static void wbflush_kn01(void);
static void wbflush_kn210(void);
......
......@@ -5,7 +5,7 @@
#include <linux/stddef.h>
#include <linux/reboot.h>
#include <linux/nvram.h>
#include <asm/init.h>
#include <linux/init.h>
#include <asm/ptrace.h>
#include <asm/io.h>
#include <asm/pgtable.h>
......
......@@ -31,7 +31,7 @@
#include <asm/spinlock.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/init.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/prom.h>
......
/* $Id: trampoline.S,v 1.12 1998/03/19 15:36:38 jj Exp $
/* $Id: trampoline.S,v 1.13 1999/08/04 03:19:15 davem Exp $
* trampoline.S: SMP cpu boot-up trampoline code.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
* Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
*/
#include <linux/init.h>
#include <asm/cprefix.h>
#include <asm/head.h>
#include <asm/psr.h>
......@@ -13,7 +14,6 @@
#include <asm/ptrace.h>
#include <asm/vaddrs.h>
#include <asm/contregs.h>
#include <asm/init.h>
.globl C_LABEL(sun4m_cpu_startup), C_LABEL(__smp4m_processor_id)
.globl C_LABEL(sun4d_cpu_startup), C_LABEL(__smp4d_processor_id)
......
/* $Id: asyncd.c,v 1.15 1999/07/04 04:35:50 davem Exp $
/* $Id: asyncd.c,v 1.16 1999/08/04 03:19:16 davem Exp $
* The asyncd kernel daemon. This handles paging on behalf of
* processes that receive page faults due to remote (async) memory
* accesses.
......
# $Id: config.in,v 1.71 1999/07/30 09:35:13 davem Exp $
# $Id: config.in,v 1.72 1999/08/04 03:19:17 davem Exp $
# For a description of the syntax of this configuration file,
# see the Configure script.
#
......
/* $Id: process.c,v 1.98 1999/08/02 08:39:35 davem Exp $
/* $Id: process.c,v 1.99 1999/08/04 03:19:20 davem Exp $
* arch/sparc64/kernel/process.c
*
* Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu)
......
......@@ -48,6 +48,8 @@ SECTIONS
__initcall_end = .;
. = ALIGN(8192);
__init_end = .;
. = ALIGN(64);
.data.cacheline_aligned : { *(.data-cacheline_aligned) }
__bss_start = .;
.sbss : { *(.sbss) *(.scommon) }
.bss :
......
......@@ -4063,10 +4063,13 @@ static struct param_table {
{ "L40SX", 0, &print_unex, 0, 0 } };
#define FLOPPY_SETUP
void __init floppy_setup(char *str, int *ints)
void __init floppy_setup(char *str)
{
int i;
int param;
int ints[11];
str = get_options(str,ARRAY_SIZE(ints),ints);
if (str) {
for (i=0; i< ARRAY_SIZE(config_params); i++){
if (strcmp(str,config_params[i].name) == 0){
......@@ -4358,8 +4361,6 @@ static void floppy_release_irq_and_dma(void)
#ifdef MODULE
extern char *get_options(char *str, int *ints);
char *floppy=NULL;
static void __init parse_floppy_cfg_string(char *cfg)
......@@ -4374,18 +4375,17 @@ static void __init parse_floppy_cfg_string(char *cfg)
cfg++;
}
if(*ptr)
floppy_setup(get_options(ptr,ints),ints);
floppy_setup(ptr);
}
}
static void __init mod_setup(char *pattern, void (*setup)(char *, int *))
static void __init mod_setup(char *pattern, void (*setup)(char *))
{
unsigned long i;
char c;
int j;
int match;
char buffer[100];
int ints[11];
int length = strlen(pattern)+1;
match=0;
......@@ -4400,7 +4400,7 @@ static void __init mod_setup(char *pattern, void (*setup)(char *, int *))
if (!c || c == ' ' || c == '\t'){
if (j){
buffer[j] = '\0';
setup(get_options(buffer,ints),ints);
setup(buffer);
}
j=0;
} else
......
......@@ -231,15 +231,17 @@ __initfunc(static unsigned int ide_special_settings (struct pci_dev *dev, const
{
int i;
unsigned short pcicmd = 0;
unsigned long hpt34xIoBase = dev->base_address[4] & PCI_BASE_ADDRESS_IO_MASK;
unsigned long hpt34xIoBase = dev->resource[4].start;
pci_write_config_byte(dev, 0x80, 0x00);
dev->base_address[0] = (hpt34xIoBase + 0x20);
dev->base_address[1] = (hpt34xIoBase + 0x34);
dev->base_address[2] = (hpt34xIoBase + 0x28);
dev->base_address[3] = (hpt34xIoBase + 0x3c);
/* FIXME - this is too ugly, and looks senseless. Why not just use resource[4]? */
dev->resource[0].start = (hpt34xIoBase + 0x20);
dev->resource[1].start = (hpt34xIoBase + 0x34);
dev->resource[2].start = (hpt34xIoBase + 0x28);
dev->resource[3].start = (hpt34xIoBase + 0x3c);
for(i=0; i<4; i++)
dev->base_address[i] |= PCI_BASE_ADDRESS_SPACE_IO;
dev->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO;
pci_read_config_word(dev, PCI_COMMAND, &pcicmd);
if (!(pcicmd & PCI_COMMAND_MEMORY)) {
......@@ -346,11 +348,15 @@ __initfunc(static int ide_setup_pci_baseregs (struct pci_dev *dev, const char *n
/*
* Setup base registers for IDE command/control spaces for each interface:
*/
for (reg = 0; reg < 4; reg++)
if (!dev->base_address[reg]) {
for (reg = 0; reg < 4; reg++) {
struct resource *res = dev->resource + reg;
if (!(res->flags & PCI_BASE_ADDRESS_SPACE_IO))
continue;
if (!res->start) {
printk("%s: Missing I/O address #%d\n", name, reg);
return 1;
}
}
return 0;
}
......@@ -447,8 +453,9 @@ __initfunc(static void ide_setup_pci_device (struct pci_dev *dev, ide_pci_device
if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || (tmp & e->mask) != e->val))
continue; /* port not enabled */
if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE || (dev->class & (port ? 4 : 1)) != 0) {
ctl = dev->base_address[(2*port)+1] & PCI_BASE_ADDRESS_IO_MASK;
base = dev->base_address[2*port] & ~7;
/* FIXME! This really should check that it really gets the IO/MEM part right! */
ctl = dev->resource[(2*port)+1].start;
base = dev->resource[2*port].start;
}
if ((ctl && !base) || (base && !ctl)) {
printk("%s: inconsistent baseregs (BIOS) for port %d, skipping\n", d->name, port);
......
......@@ -534,19 +534,6 @@ else
endif
endif
ifeq ($(CONFIG_HFMODEM),y)
ALL_SUB_DIRS += hfmodem
SUB_DIRS += hfmodem
O_OBJS += hfmodem/hfmodem.o
else
ifeq ($(CONFIG_HFMODEM),m)
ALL_SUB_DIRS += hfmodem
MOD_SUB_DIRS += hfmodem
endif
endif
include $(TOPDIR)/Rules.make
fastdep:
......
comment 'Misc. hamradio protocols'
dep_tristate 'Shortwave radio modem driver' CONFIG_HFMODEM $CONFIG_PARPORT
if [ "$CONFIG_HFMODEM" != "n" ]; then
bool ' HFmodem support for Soundblaster and compatible cards' CONFIG_HFMODEM_SBC
bool ' HFmodem support for WSS and Crystal cards' CONFIG_HFMODEM_WSS
fi
#
# Makefile for the hfmodem device driver.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now inherited from the
# parent makes..
#
O_TARGET := hfmodem.o
O_OBJS := refclock.o modem.o main.o
ifeq ($(CONFIG_HFMODEM_SBC),y)
O_OBJS += sbc.o
endif
ifeq ($(CONFIG_HFMODEM_WSS),y)
O_OBJS += wss.o
endif
M_OBJS := $(O_TARGET)
all: all_targets
.PHONY: all
gentbl: gentbl.c
$(HOSTCC) $(HOSTCFLAGS) $< -o $@ -lm
TBLHDR := tables.h
tables.h: gentbl
./gentbl > $@
fastdep: $(TBLHDR)
include $(TOPDIR)/Rules.make
/*****************************************************************************/
/*
* gentbl.c -- Linux soundcard HF FSK driver,
* Table generator.
*
* Copyright (C) 1997 Thomas Sailer (sailer@ife.ee.ethz.ch)
* Swiss Federal Institute of Technology (ETH), Electronics Lab
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
*/
/*****************************************************************************/
/* This is compiled with HOSTCC - do not include any <linux/foo.h> headers. */
#include <math.h>
#include <stdio.h>
/* --------------------------------------------------------------------- */
#define SINTABBITS 9
#define SINTABSIZE (1<<SINTABBITS)
/* --------------------------------------------------------------------- */
static void gensintbl(void)
{
int i;
printf("#define SINTABBITS %d\n#define SINTABSIZE (1<<SINTABBITS)\n"
"\nstatic short isintab[SINTABSIZE+SINTABSIZE/4] = {\n\t", SINTABBITS);
for (i = 0; i < (SINTABSIZE+SINTABSIZE/4); i++) {
printf("%6d", (int)(32767.0 * sin(2.0 * M_PI / SINTABSIZE * i)));
if (i < (SINTABSIZE+SINTABSIZE/4)-1) {
if ((i & 7) == 7)
printf(",\n\t");
else
printf(",");
}
}
printf("\n};\n\n");
}
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
printf("/*\n * This file is automatically generated by %s, DO NOT EDIT!\n*/\n\n",
argv[0]);
gensintbl();
exit(0);
}
/* --------------------------------------------------------------------- */
This diff is collapsed.
This diff is collapsed.
/*****************************************************************************/
/*
* refclock.c -- Linux soundcard HF FSK driver,
* Reference clock routines.
*
* Copyright (C) 1997 Thomas Sailer (sailer@ife.ee.ethz.ch)
* Swiss Federal Institute of Technology (ETH), Electronics Lab
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
*/
/*****************************************************************************/
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/time.h>
#include <linux/hfmodem.h>
#include <asm/processor.h>
/* --------------------------------------------------------------------- */
/*
* currently this module is supposed to support both module styles, i.e.
* the old one present up to about 2.1.9, and the new one functioning
* starting with 2.1.21. The reason is I have a kit allowing to compile
* this module also under 2.0.x which was requested by several people.
* This will go in 2.2
*/
#include <linux/version.h>
#if LINUX_VERSION_CODE >= 0x20123
#include <linux/init.h>
#else
#define __init
#define __initdata
#define __initfunc(x) x
#endif
/* --------------------------------------------------------------------- */
/*
* command line params
*/
static unsigned int scale_tvusec = 1UL<<24;
#ifdef __i386__
static unsigned int scale_rdtsc = 0;
static int rdtsc_ok = 1;
#endif /* __i386__ */
/* --------------------------------------------------------------------- */
#ifdef __i386__
static void __init i386_capability(void)
{
if (boot_cpu_data.x86_capability & X86_FEATURE_TSC)
rdtsc_ok = 1;
else
printk(KERN_INFO "%s: cpu does not support the rdtsc instruction\n", hfmodem_drvname);
}
#endif /* __i386__ */
/* --------------------------------------------------------------------- */
void __init hfmodem_refclock_probe(void)
{
#ifdef __i386__
if (rdtsc_ok) {
rdtsc_ok = 0;
i386_capability();
if (rdtsc_ok) {
unsigned int tmp0, tmp1, tmp2, tmp3;
__asm__("rdtsc" : "=a" (tmp0), "=d" (tmp1));
__asm__("rdtsc" : "=a" (tmp2), "=d" (tmp3));
if (tmp0 == tmp2 && tmp1 == tmp3) {
rdtsc_ok = 0;
printk(KERN_WARNING "%s: rdtsc unusable, does not change\n",
hfmodem_drvname);
}
}
}
printk(KERN_INFO "%s: using %s as timing source\n", hfmodem_drvname,
rdtsc_ok ? "rdtsc" : "gettimeofday");
#endif /* __i386__ */
}
/* --------------------------------------------------------------------- */
void hfmodem_refclock_init(struct hfmodem_state *dev)
{
struct timeval tv;
dev->clk.lasttime = 0;
#ifdef __i386__
if (rdtsc_ok) {
__asm__("rdtsc;" : "=&d" (dev->clk.starttime_hi), "=&a" (dev->clk.starttime_lo));
return;
}
#endif /* __i386__ */
do_gettimeofday(&tv);
dev->clk.last_tvusec = tv.tv_usec;
dev->clk.time_cnt = 0;
}
/* --------------------------------------------------------------------- */
hfmodem_time_t hfmodem_refclock_current(struct hfmodem_state *dev, hfmodem_time_t expected, int exp_valid)
{
struct timeval tv;
hfmodem_time_t curtime;
long diff;
#ifdef __i386__
if (rdtsc_ok) {
unsigned int tmp0, tmp1;
unsigned int tmp2, tmp3;
__asm__("rdtsc;\n\t"
"subl %2,%%eax\n\t"
"sbbl %3,%%edx\n\t" : "=&a" (tmp0), "=&d" (tmp1)
: "m" (dev->clk.starttime_lo), "m" (dev->clk.starttime_hi) : "ax", "dx");
__asm__("mull %1" : "=d" (tmp2) : "m" (scale_rdtsc), "a" (tmp0) : "ax");
__asm__("mull %1" : "=a" (tmp3) : "m" (scale_rdtsc), "a" (tmp1) : "dx");
curtime = tmp2 + tmp3;
goto time_known;
}
#endif /* __i386__ */
do_gettimeofday(&tv);
dev->clk.time_cnt += (unsigned)(1000000 + tv.tv_usec - dev->clk.last_tvusec) % 1000000;
dev->clk.last_tvusec = tv.tv_usec;
curtime = (dev->clk.time_cnt * scale_tvusec) >> 24;
time_known:
if (exp_valid && abs(diff = (curtime - dev->clk.lasttime - expected)) >= 1000)
printk(KERN_DEBUG "%s: refclock adjustment %ld more than 1ms\n",
hfmodem_drvname, diff);
return (dev->clk.lasttime = curtime);
}
/* --------------------------------------------------------------------- */
This diff is collapsed.
This diff is collapsed.
......@@ -31,7 +31,7 @@
#include <asm/pmu.h>
#include <asm/uaccess.h>
#include <asm/hydra.h>
#include <asm/init.h>
#include <linux/init.h>
EXPORT_SYMBOL(adb_controller);
EXPORT_SYMBOL(adb_client_list);
......
......@@ -44,7 +44,7 @@
#include <asm/adb.h>
#include <asm/cuda.h>
#include <asm/pmu.h>
#include <asm/init.h>
#include <linux/init.h>
#include <linux/kbd_kern.h>
#include <linux/kbd_ll.h>
......
......@@ -14,7 +14,7 @@
#include <asm/hydra.h>
#include <asm/irq.h>
#include <asm/system.h>
#include <asm/init.h>
#include <linux/init.h>
struct preg {
unsigned char r;
......
......@@ -39,7 +39,7 @@
#ifdef CONFIG_KGDB
#include <asm/kgdb.h>
#endif
#include <asm/init.h>
#include <linux/init.h>
#include "macserial.h"
......
......@@ -25,7 +25,7 @@
#include <asm/io.h>
#include <asm/feature.h>
#include <asm/mediabay.h>
#include <asm/init.h>
#include <linux/init.h>
#undef MB_USE_INTERRUPTS
......
......@@ -20,7 +20,7 @@
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/system.h>
#include <asm/init.h>
#include <linux/init.h>
static volatile unsigned char *via;
......
......@@ -28,7 +28,7 @@
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/system.h>
#include <asm/init.h>
#include <linux/init.h>
#include <asm/irq.h>
#include <asm/feature.h>
#include <asm/uaccess.h>
......
......@@ -563,9 +563,9 @@ int eepro100_init(struct device *dev)
{
struct pci_dev *pdev = pci_find_slot(pci_bus, pci_device_fn);
#ifdef USE_IO
pciaddr = pdev->base_address[1]; /* Use [0] to mem-map */
pciaddr = pdev->resource[1].start;
#else
pciaddr = pdev->base_address[0];
pciaddr = pdev->resource[0].start;
#endif
irq = pdev->irq;
}
......
......@@ -16,7 +16,7 @@ tristate 'BAYCOM ser12 halfduplex driver for AX.25' CONFIG_BAYCOM_SER_HDX
dep_tristate 'BAYCOM picpar and par96 driver for AX.25' CONFIG_BAYCOM_PAR $CONFIG_PARPORT
dep_tristate 'BAYCOM epp driver for AX.25' CONFIG_BAYCOM_EPP $CONFIG_PARPORT
tristate 'Soundcard modem driver' CONFIG_SOUNDMODEM
dep_tristate 'Soundcard modem driver' CONFIG_SOUNDMODEM $CONFIG_PARPORT
if [ "$CONFIG_SOUNDMODEM" != "n" ]; then
bool ' soundmodem support for Soundblaster and compatible cards' CONFIG_SOUNDMODEM_SBC
bool ' soundmodem support for WSS and Crystal cards' CONFIG_SOUNDMODEM_WSS
......
......@@ -31,6 +31,8 @@
* Integrated FPGA EPP modem configuration routines
* 0.3 11.05.98 Took FPGA config out and moved it into a separate program
* 0.4 26.07.99 Adapted to new lowlevel parport driver interface
* 0.5 03.08.99 adapt to Linus' new __setup/__initcall
* removed some pre-2.2 kernel compatibility cruft
*
*/
......@@ -39,25 +41,13 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/socket.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <linux/init.h>
#include <linux/string.h>
#include <linux/tqueue.h>
#include <linux/fs.h>
#include <linux/parport.h>
#include <linux/bitops.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/processor.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/netdevice.h>
#include <asm/uaccess.h>
#include <linux/if_arp.h>
//#include <net/ax25dev.h>
#include <linux/kmod.h>
#include <linux/hdlcdrv.h>
#include <linux/baycom.h>
#include <linux/soundmodem.h>
......@@ -71,56 +61,6 @@
/* --------------------------------------------------------------------- */
/*
* currently this module is supposed to support both module styles, i.e.
* the old one present up to about 2.1.9, and the new one functioning
* starting with 2.1.21. The reason is I have a kit allowing to compile
* this module also under 2.0.x which was requested by several people.
* This will go in 2.2
*/
#include <linux/version.h>
#if LINUX_VERSION_CODE >= 0x20100
#include <asm/uaccess.h>
#else
#include <asm/segment.h>
#include <linux/mm.h>
#undef put_user
#undef get_user
#define put_user(x,ptr) ({ __put_user((unsigned long)(x),(ptr),sizeof(*(ptr))); 0; })
#define get_user(x,ptr) ({ x = ((__typeof__(*(ptr)))__get_user((ptr),sizeof(*(ptr)))); 0; })
extern inline int copy_from_user(void *to, const void *from, unsigned long n)
{
int i = verify_area(VERIFY_READ, from, n);
if (i)
return i;
memcpy_fromfs(to, from, n);
return 0;
}
extern inline int copy_to_user(void *to, const void *from, unsigned long n)
{
int i = verify_area(VERIFY_WRITE, to, n);
if (i)
return i;
memcpy_tofs(to, from, n);
return 0;
}
#endif
#if LINUX_VERSION_CODE >= 0x20123
#include <linux/init.h>
#else
#define __init
#define __initdata
#define __initfunc(x) x
#endif
/* --------------------------------------------------------------------- */
#define BAYCOM_DEBUG
#define BAYCOM_MAGIC 19730510
......@@ -148,8 +88,8 @@ static const char paranoia_str[] = KERN_ERR
/* --------------------------------------------------------------------- */
static const char bc_drvname[] = "baycom_epp";
static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998 Thomas Sailer, HB9JNX/AE4WA\n"
KERN_INFO "baycom_epp: version 0.4 compiled " __TIME__ " " __DATE__ "\n";
static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-1999 Thomas Sailer, HB9JNX/AE4WA\n"
KERN_INFO "baycom_epp: version 0.5 compiled " __TIME__ " " __DATE__ "\n";
/* --------------------------------------------------------------------- */
......@@ -157,11 +97,6 @@ KERN_INFO "baycom_epp: version 0.4 compiled " __TIME__ " " __DATE__ "\n";
static struct device baycom_device[NR_PORTS];
static struct {
const char *mode;
int iobase;
} baycom_ports[NR_PORTS] = { { NULL, 0 }, };
/* --------------------------------------------------------------------- */
/* EPP status register */
......@@ -1477,7 +1412,18 @@ static int baycom_probe(struct device *dev)
/* --------------------------------------------------------------------- */
__initfunc(int baycom_epp_init(void))
/*
* command line settable parameters
*/
static const char *mode[NR_PORTS] = { "", };
static int iobase[NR_PORTS] = { 0x378, };
/* --------------------------------------------------------------------- */
#ifndef MODULE
static
#endif
int __init init_module(void)
{
struct device *dev;
int i, found = 0;
......@@ -1490,10 +1436,10 @@ __initfunc(int baycom_epp_init(void))
*/
for (i = 0; i < NR_PORTS; i++) {
dev = baycom_device+i;
if (!baycom_ports[i].mode)
if (!mode[i])
set_hw = 0;
if (!set_hw)
baycom_ports[i].iobase = 0;
iobase[i] = 0;
memset(dev, 0, sizeof(struct device));
if (!(bc = dev->priv = kmalloc(sizeof(struct baycom_state), GFP_KERNEL)))
return -ENOMEM;
......@@ -1513,7 +1459,7 @@ __initfunc(int baycom_epp_init(void))
dev->init = baycom_probe;
dev->start = 0;
dev->tbusy = 1;
dev->base_addr = baycom_ports[i].iobase;
dev->base_addr = iobase[i];
dev->irq = 0;
dev->dma = 0;
if (register_netdev(dev)) {
......@@ -1521,7 +1467,7 @@ __initfunc(int baycom_epp_init(void))
kfree(dev->priv);
return -ENXIO;
}
if (set_hw && baycom_setmode(bc, baycom_ports[i].mode))
if (set_hw && baycom_setmode(bc, mode[i]))
set_hw = 0;
found++;
}
......@@ -1534,39 +1480,14 @@ __initfunc(int baycom_epp_init(void))
#ifdef MODULE
/*
* command line settable parameters
*/
static const char *mode[NR_PORTS] = { "epp", };
static int iobase[NR_PORTS] = { 0x378, };
#if LINUX_VERSION_CODE >= 0x20115
MODULE_PARM(mode, "s");
MODULE_PARM_DESC(mode, "baycom operating mode; epp");
MODULE_PARM(iobase, "i");
MODULE_PARM(mode, "1-" __MODULE_STRING(NR_PORTS) "s");
MODULE_PARM_DESC(mode, "baycom operating mode");
MODULE_PARM(iobase, "1-" __MODULE_STRING(NR_PORTS) "i");
MODULE_PARM_DESC(iobase, "baycom io base address");
MODULE_AUTHOR("Thomas M. Sailer, sailer@ife.ee.ethz.ch, hb9jnx@hb9w.che.eu");
MODULE_DESCRIPTION("Baycom epp amateur radio modem driver");
#endif
__initfunc(int init_module(void))
{
int i;
for (i = 0; (i < NR_PORTS) && (mode[i]); i++) {
baycom_ports[i].mode = mode[i];
baycom_ports[i].iobase = iobase[i];
}
if (i < NR_PORTS-1)
baycom_ports[i+1].mode = NULL;
return baycom_epp_init();
}
/* --------------------------------------------------------------------- */
void cleanup_module(void)
{
struct device *dev;
......@@ -1587,27 +1508,30 @@ void cleanup_module(void)
}
#else /* MODULE */
/* --------------------------------------------------------------------- */
/*
* format: baycom=io,mode
* mode: epp
* format: baycom_epp=io,mode
* mode: fpga config options
*/
__initfunc(void baycom_epp_setup(char *str, int *ints))
static int __init baycom_epp_setup(char *str)
{
int i;
static unsigned __initdata nr_dev = 0;
int ints[11];
for (i = 0; (i < NR_PORTS) && (baycom_ports[i].mode); i++);
if ((i >= NR_PORTS) || (ints[0] < 1)) {
printk(KERN_INFO "%s: too many or invalid interface "
"specifications\n", bc_drvname);
return;
}
baycom_ports[i].mode = str;
baycom_ports[i].iobase = ints[1];
if (i < NR_PORTS-1)
baycom_ports[i+1].mode = NULL;
if (nr_dev >= NR_PORTS)
return 0;
str = get_options(str, ints);
if (ints[0] < 1)
return 0;
mode[nr_dev] = str;
iobase[nr_dev] = ints[1];
nr_dev++;
return 1;
}
__setup("baycom_epp=", baycom_epp_setup);
__initcall(init_module);
#endif /* MODULE */
/* --------------------------------------------------------------------- */
......@@ -3,7 +3,7 @@
/*
* baycom_par.c -- baycom par96 and picpar radio modem driver.
*
* Copyright (C) 1997 Thomas Sailer (sailer@ife.ee.ethz.ch)
* Copyright (C) 1996-1999 Thomas Sailer (sailer@ife.ee.ethz.ch)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -58,10 +58,14 @@
* 0.3 26.04.97 init code/data tagged
* 0.4 08.07.97 alternative ser12 decoding algorithm (uses delta CTS ints)
* 0.5 11.11.97 split into separate files for ser12/par96
* 0.6 03.08.99 adapt to Linus' new __setup/__initcall
* removed some pre-2.2 kernel compatibility cruft
*/
/*****************************************************************************/
#include <linux/config.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
......@@ -74,6 +78,8 @@
#include <asm/system.h>
#include <asm/bitops.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/netdevice.h>
......@@ -83,56 +89,6 @@
/* --------------------------------------------------------------------- */
/*
* currently this module is supposed to support both module styles, i.e.
* the old one present up to about 2.1.9, and the new one functioning
* starting with 2.1.21. The reason is I have a kit allowing to compile
* this module also under 2.0.x which was requested by several people.
* This will go in 2.2
*/
#include <linux/version.h>
#if LINUX_VERSION_CODE >= 0x20100
#include <asm/uaccess.h>
#else
#include <asm/segment.h>
#include <linux/mm.h>
#undef put_user
#undef get_user
#define put_user(x,ptr) ({ __put_user((unsigned long)(x),(ptr),sizeof(*(ptr))); 0; })
#define get_user(x,ptr) ({ x = ((__typeof__(*(ptr)))__get_user((ptr),sizeof(*(ptr)))); 0; })
extern __inline__ int copy_from_user(void *to, const void *from, unsigned long n)
{
int i = verify_area(VERIFY_READ, from, n);
if (i)
return i;
memcpy_fromfs(to, from, n);
return 0;
}
extern __inline__ int copy_to_user(void *to, const void *from, unsigned long n)
{
int i = verify_area(VERIFY_WRITE, to, n);
if (i)
return i;
memcpy_tofs(to, from, n);
return 0;
}
#endif
#if LINUX_VERSION_CODE >= 0x20123
#include <linux/init.h>
#else
#define __init
#define __initdata
#define __initfunc(x) x
#endif
/* --------------------------------------------------------------------- */
#define BAYCOM_DEBUG
/*
......@@ -143,8 +99,8 @@ extern __inline__ int copy_to_user(void *to, const void *from, unsigned long n)
/* --------------------------------------------------------------------- */
static const char bc_drvname[] = "baycom_par";
static const char bc_drvinfo[] = KERN_INFO "baycom_par: (C) 1997 Thomas Sailer, HB9JNX/AE4WA\n"
KERN_INFO "baycom_par: version 0.5 compiled " __TIME__ " " __DATE__ "\n";
static const char bc_drvinfo[] = KERN_INFO "baycom_par: (C) 1996-1999 Thomas Sailer, HB9JNX/AE4WA\n"
KERN_INFO "baycom_par: version 0.6 compiled " __TIME__ " " __DATE__ "\n";
/* --------------------------------------------------------------------- */
......@@ -152,11 +108,6 @@ KERN_INFO "baycom_par: version 0.5 compiled " __TIME__ " " __DATE__ "\n";
static struct device baycom_device[NR_PORTS];
static struct {
const char *mode;
int iobase;
} baycom_ports[NR_PORTS] = { { NULL, 0 }, };
/* --------------------------------------------------------------------- */
#define SER12_EXTENT 8
......@@ -533,14 +484,24 @@ static int baycom_ioctl(struct device *dev, struct ifreq *ifr,
/* --------------------------------------------------------------------- */
int __init baycom_par_init(void)
/*
* command line settable parameters
*/
static const char *mode[NR_PORTS] = { "picpar", };
static int iobase[NR_PORTS] = { 0x378, };
/* --------------------------------------------------------------------- */
#ifndef MODULE
static
#endif
int __init init_module(void)
{
int i, j, found = 0;
char set_hw = 1;
struct baycom_state *bc;
char ifname[HDLCDRV_IFNAMELEN];
printk(bc_drvinfo);
/*
* register net devices
......@@ -549,16 +510,15 @@ int __init baycom_par_init(void)
struct device *dev = baycom_device+i;
sprintf(ifname, "bcp%d", i);
if (!baycom_ports[i].mode)
if (!mode[i])
set_hw = 0;
if (!set_hw)
baycom_ports[i].iobase = 0;
j = hdlcdrv_register_hdlcdrv(dev, &par96_ops,
sizeof(struct baycom_state),
ifname, baycom_ports[i].iobase, 0, 0);
iobase[i] = 0;
j = hdlcdrv_register_hdlcdrv(dev, &par96_ops, sizeof(struct baycom_state),
ifname, iobase[i], 0, 0);
if (!j) {
bc = (struct baycom_state *)dev->priv;
if (set_hw && baycom_setmode(bc, baycom_ports[i].mode))
if (set_hw && baycom_setmode(bc, mode[i]))
set_hw = 0;
found++;
} else {
......@@ -575,14 +535,6 @@ int __init baycom_par_init(void)
#ifdef MODULE
/*
* command line settable parameters
*/
static const char *mode[NR_PORTS] = { "picpar", };
static int iobase[NR_PORTS] = { 0x378, };
#if LINUX_VERSION_CODE >= 0x20115
MODULE_PARM(mode, "1-" __MODULE_STRING(NR_PORTS) "s");
MODULE_PARM_DESC(mode, "baycom operating mode; eg. par96 or picpar");
MODULE_PARM(iobase, "1-" __MODULE_STRING(NR_PORTS) "i");
......@@ -591,23 +543,6 @@ MODULE_PARM_DESC(iobase, "baycom io base address");
MODULE_AUTHOR("Thomas M. Sailer, sailer@ife.ee.ethz.ch, hb9jnx@hb9w.che.eu");
MODULE_DESCRIPTION("Baycom par96 and picpar amateur radio modem driver");
#endif
int __init init_module(void)
{
int i;
for (i = 0; (i < NR_PORTS) && (mode[i]); i++) {
baycom_ports[i].mode = mode[i];
baycom_ports[i].iobase = iobase[i];
}
if (i < NR_PORTS-1)
baycom_ports[i+1].mode = NULL;
return baycom_par_init();
}
/* --------------------------------------------------------------------- */
void cleanup_module(void)
{
int i;
......@@ -627,27 +562,30 @@ void cleanup_module(void)
}
#else /* MODULE */
/* --------------------------------------------------------------------- */
/*
* format: baycom_par=io,mode
* mode: par96,picpar
*/
void __init baycom_par_setup(char *str, int *ints)
static int __init baycom_par_setup(char *str)
{
int i;
for (i = 0; (i < NR_PORTS) && (baycom_ports[i].mode); i++);
if ((i >= NR_PORTS) || (ints[0] < 1)) {
printk(KERN_INFO "%s: too many or invalid interface "
"specifications\n", bc_drvname);
return;
}
baycom_ports[i].mode = str;
baycom_ports[i].iobase = ints[1];
if (i < NR_PORTS-1)
baycom_ports[i+1].mode = NULL;
static unsigned __initdata nr_dev = 0;
int ints[11];
if (nr_dev >= NR_PORTS)
return 0;
str = get_options(str, ints);
if (ints[0] < 1)
return 0;
mode[nr_dev] = str;
iobase[nr_dev] = ints[1];
nr_dev++;
return 1;
}
__setup("baycom_par=", baycom_par_setup);
__initcall(init_module);
#endif /* MODULE */
/* --------------------------------------------------------------------- */
......@@ -3,7 +3,7 @@
/*
* baycom_ser_fdx.c -- baycom ser12 fullduplex radio modem driver.
*
* Copyright (C) 1997-1998 Thomas Sailer (sailer@ife.ee.ethz.ch)
* Copyright (C) 1996-1999 Thomas Sailer (sailer@ife.ee.ethz.ch)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -60,30 +60,21 @@
* 0.6 24.01.98 Thorsten Kranzkowski, dl8bcu and Thomas Sailer:
* reduced interrupt load in transmit case
* reworked receiver
* 0.7 03.08.99 adapt to Linus' new __setup/__initcall
*/
/*****************************************************************************/
#include <linux/config.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/bitops.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/netdevice.h>
#include <linux/hdlcdrv.h>
#include <linux/baycom.h>
#include <linux/version.h>
/* --------------------------------------------------------------------- */
......@@ -97,8 +88,8 @@
/* --------------------------------------------------------------------- */
static const char bc_drvname[] = "baycom_ser_fdx";
static const char bc_drvinfo[] = KERN_INFO "baycom_ser_fdx: (C) 1997-1998 Thomas Sailer, HB9JNX/AE4WA\n"
KERN_INFO "baycom_ser_fdx: version 0.6 compiled " __TIME__ " " __DATE__ "\n";
static const char bc_drvinfo[] = KERN_INFO "baycom_ser_fdx: (C) 1996-1999 Thomas Sailer, HB9JNX/AE4WA\n"
KERN_INFO "baycom_ser_fdx: version 0.7 compiled " __TIME__ " " __DATE__ "\n";
/* --------------------------------------------------------------------- */
......@@ -106,11 +97,6 @@ KERN_INFO "baycom_ser_fdx: version 0.6 compiled " __TIME__ " " __DATE__ "\n";
static struct device baycom_device[NR_PORTS];
static struct {
char *mode;
int iobase, irq, baud;
} baycom_ports[NR_PORTS] = { { NULL, 0, 0 }, };
/* --------------------------------------------------------------------- */
#define RBR(iobase) (iobase+0)
......@@ -605,7 +591,20 @@ static int baycom_ioctl(struct device *dev, struct ifreq *ifr,
/* --------------------------------------------------------------------- */
int __init baycom_ser_fdx_init(void)
/*
* command line settable parameters
*/
static char *mode[NR_PORTS] = { "ser12*", };
static int iobase[NR_PORTS] = { 0x3f8, };
static int irq[NR_PORTS] = { 4, };
static int baud[NR_PORTS] = { [0 ... NR_PORTS-1] = 1200 };
/* --------------------------------------------------------------------- */
#ifndef MODULE
static
#endif
int __init init_module(void)
{
int i, j, found = 0;
char set_hw = 1;
......@@ -621,19 +620,17 @@ int __init baycom_ser_fdx_init(void)
struct device *dev = baycom_device+i;
sprintf(ifname, "bcsf%d", i);
if (!baycom_ports[i].mode)
if (!mode[i])
set_hw = 0;
if (!set_hw)
baycom_ports[i].iobase = baycom_ports[i].irq = 0;
j = hdlcdrv_register_hdlcdrv(dev, &ser12_ops,
sizeof(struct baycom_state),
ifname, baycom_ports[i].iobase,
baycom_ports[i].irq, 0);
iobase[i] = irq[i] = 0;
j = hdlcdrv_register_hdlcdrv(dev, &ser12_ops, sizeof(struct baycom_state),
ifname, iobase[i], irq[i], 0);
if (!j) {
bc = (struct baycom_state *)dev->priv;
if (set_hw && baycom_setmode(bc, baycom_ports[i].mode))
if (set_hw && baycom_setmode(bc, mode[i]))
set_hw = 0;
bc->baud = baycom_ports[i].baud;
bc->baud = baud[i];
found++;
} else {
printk(KERN_WARNING "%s: cannot register net device\n",
......@@ -649,16 +646,6 @@ int __init baycom_ser_fdx_init(void)
#ifdef MODULE
/*
* command line settable parameters
*/
static char *mode[NR_PORTS] = { "ser12*", };
static int iobase[NR_PORTS] = { 0x3f8, };
static int irq[NR_PORTS] = { 4, };
static int baud[NR_PORTS] = { [0 ... NR_PORTS-1] = 1200 };
#if LINUX_VERSION_CODE >= 0x20115
MODULE_PARM(mode, "1-" __MODULE_STRING(NR_PORTS) "s");
MODULE_PARM_DESC(mode, "baycom operating mode; * for software DCD");
MODULE_PARM(iobase, "1-" __MODULE_STRING(NR_PORTS) "i");
......@@ -671,25 +658,6 @@ MODULE_PARM_DESC(baud, "baycom baud rate (300 to 4800)");
MODULE_AUTHOR("Thomas M. Sailer, sailer@ife.ee.ethz.ch, hb9jnx@hb9w.che.eu");
MODULE_DESCRIPTION("Baycom ser12 full duplex amateur radio modem driver");
#endif
int __init init_module(void)
{
int i;
for (i = 0; (i < NR_PORTS) && (mode[i]); i++) {
baycom_ports[i].mode = mode[i];
baycom_ports[i].iobase = iobase[i];
baycom_ports[i].irq = irq[i];
baycom_ports[i].baud = baud[i];
}
if (i < NR_PORTS-1)
baycom_ports[i+1].mode = NULL;
return baycom_ser_fdx_init();
}
/* --------------------------------------------------------------------- */
void cleanup_module(void)
{
int i;
......@@ -709,33 +677,34 @@ void cleanup_module(void)
}
#else /* MODULE */
/* --------------------------------------------------------------------- */
/*
* format: baycom_ser_fdx=io,irq,mode
* mode: [*]
* * indicates sofware DCD
*/
void __init baycom_ser_fdx_setup(char *str, int *ints)
static int __init baycom_ser_fdx_setup(char *str)
{
int i;
for (i = 0; (i < NR_PORTS) && (baycom_ports[i].mode); i++);
if ((i >= NR_PORTS) || (ints[0] < 2)) {
printk(KERN_INFO "%s: too many or invalid interface "
"specifications\n", bc_drvname);
return;
}
baycom_ports[i].mode = str;
baycom_ports[i].iobase = ints[1];
baycom_ports[i].irq = ints[2];
static unsigned __initdata nr_dev = 0;
int ints[11];
if (nr_dev >= NR_PORTS)
return 0;
str = get_options(str, ints);
if (ints[0] < 2)
return 0;
mode[nr_dev] = str;
iobase[nr_dev] = ints[1];
irq[nr_dev] = ints[2];
if (ints[0] >= 3)
baycom_ports[i].baud = ints[3];
else
baycom_ports[i].baud = 1200;
if (i < NR_PORTS-1)
baycom_ports[i+1].mode = NULL;
baud[nr_dev] = ints[3];
nr_dev++;
return 1;
}
__setup("baycom_ser_fdx=", baycom_ser_fdx_setup);
__initcall(init_module);
#endif /* MODULE */
/* --------------------------------------------------------------------- */
......@@ -3,7 +3,7 @@
/*
* baycom_ser_hdx.c -- baycom ser12 halfduplex radio modem driver.
*
* Copyright (C) 1997 Thomas Sailer (sailer@ife.ee.ethz.ch)
* Copyright (C) 1996-1999 Thomas Sailer (sailer@ife.ee.ethz.ch)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -49,30 +49,21 @@
* 0.4 08.07.97 alternative ser12 decoding algorithm (uses delta CTS ints)
* 0.5 11.11.97 ser12/par96 split into separate files
* 0.6 14.04.98 cleanups
* 0.7 03.08.99 adapt to Linus' new __setup/__initcall
*/
/*****************************************************************************/
#include <linux/config.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <linux/string.h>
#include <linux/init.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/netdevice.h>
#include <linux/hdlcdrv.h>
#include <linux/baycom.h>
#include <linux/version.h>
/* --------------------------------------------------------------------- */
......@@ -86,8 +77,8 @@
/* --------------------------------------------------------------------- */
static const char bc_drvname[] = "baycom_ser_hdx";
static const char bc_drvinfo[] = KERN_INFO "baycom_ser_hdx: (C) 1997-1998 Thomas Sailer, HB9JNX/AE4WA\n"
KERN_INFO "baycom_ser_hdx: version 0.6 compiled " __TIME__ " " __DATE__ "\n";
static const char bc_drvinfo[] = KERN_INFO "baycom_ser_hdx: (C) 1996-1999 Thomas Sailer, HB9JNX/AE4WA\n"
KERN_INFO "baycom_ser_hdx: version 0.7 compiled " __TIME__ " " __DATE__ "\n";
/* --------------------------------------------------------------------- */
......@@ -95,11 +86,6 @@ KERN_INFO "baycom_ser_hdx: version 0.6 compiled " __TIME__ " " __DATE__ "\n";
static struct device baycom_device[NR_PORTS];
static struct {
char *mode;
int iobase, irq;
} baycom_ports[NR_PORTS] = { { NULL, 0, 0 }, };
/* --------------------------------------------------------------------- */
#define RBR(iobase) (iobase+0)
......@@ -643,7 +629,19 @@ static int baycom_ioctl(struct device *dev, struct ifreq *ifr,
/* --------------------------------------------------------------------- */
int __init baycom_ser_hdx_init(void)
/*
* command line settable parameters
*/
static char *mode[NR_PORTS] = { "ser12*", };
static int iobase[NR_PORTS] = { 0x3f8, };
static int irq[NR_PORTS] = { 4, };
/* --------------------------------------------------------------------- */
#ifndef MODULE
static
#endif
int __init init_module(void)
{
int i, j, found = 0;
char set_hw = 1;
......@@ -659,17 +657,15 @@ int __init baycom_ser_hdx_init(void)
struct device *dev = baycom_device+i;
sprintf(ifname, "bcsh%d", i);
if (!baycom_ports[i].mode)
if (!mode[i])
set_hw = 0;
if (!set_hw)
baycom_ports[i].iobase = baycom_ports[i].irq = 0;
j = hdlcdrv_register_hdlcdrv(dev, &ser12_ops,
sizeof(struct baycom_state),
ifname, baycom_ports[i].iobase,
baycom_ports[i].irq, 0);
iobase[i] = irq[i] = 0;
j = hdlcdrv_register_hdlcdrv(dev, &ser12_ops, sizeof(struct baycom_state),
ifname, iobase[i], irq[i], 0);
if (!j) {
bc = (struct baycom_state *)dev->priv;
if (set_hw && baycom_setmode(bc, baycom_ports[i].mode))
if (set_hw && baycom_setmode(bc, mode[i]))
set_hw = 0;
found++;
} else {
......@@ -686,15 +682,6 @@ int __init baycom_ser_hdx_init(void)
#ifdef MODULE
/*
* command line settable parameters
*/
static char *mode[NR_PORTS] = { "ser12*", };
static int iobase[NR_PORTS] = { 0x3f8, };
static int irq[NR_PORTS] = { 4, };
#if LINUX_VERSION_CODE >= 0x20115
MODULE_PARM(mode, "1-" __MODULE_STRING(NR_PORTS) "s");
MODULE_PARM_DESC(mode, "baycom operating mode; * for software DCD");
MODULE_PARM(iobase, "1-" __MODULE_STRING(NR_PORTS) "i");
......@@ -705,24 +692,6 @@ MODULE_PARM_DESC(irq, "baycom irq number");
MODULE_AUTHOR("Thomas M. Sailer, sailer@ife.ee.ethz.ch, hb9jnx@hb9w.che.eu");
MODULE_DESCRIPTION("Baycom ser12 half duplex amateur radio modem driver");
#endif
int __init init_module(void)
{
int i;
for (i = 0; (i < NR_PORTS) && (mode[i]); i++) {
baycom_ports[i].mode = mode[i];
baycom_ports[i].iobase = iobase[i];
baycom_ports[i].irq = irq[i];
}
if (i < NR_PORTS-1)
baycom_ports[i+1].mode = NULL;
return baycom_ser_hdx_init();
}
/* --------------------------------------------------------------------- */
void cleanup_module(void)
{
int i;
......@@ -742,29 +711,32 @@ void cleanup_module(void)
}
#else /* MODULE */
/* --------------------------------------------------------------------- */
/*
* format: baycom_ser_=io,irq,mode
* format: baycom_ser_hdx=io,irq,mode
* mode: [*]
* * indicates sofware DCD
*/
void __init baycom_ser_hdx_setup(char *str, int *ints)
static int __init baycom_ser_hdx_setup(char *str)
{
int i;
static unsigned __initdata nr_dev = 0;
int ints[11];
for (i = 0; (i < NR_PORTS) && (baycom_ports[i].mode); i++);
if ((i >= NR_PORTS) || (ints[0] < 2)) {
printk(KERN_INFO "%s: too many or invalid interface "
"specifications\n", bc_drvname);
return;
}
baycom_ports[i].mode = str;
baycom_ports[i].iobase = ints[1];
baycom_ports[i].irq = ints[2];
if (i < NR_PORTS-1)
baycom_ports[i+1].mode = NULL;
if (nr_dev >= NR_PORTS)
return 0;
str = get_options(str, ints);
if (ints[0] < 2)
return 0;
mode[nr_dev] = str;
iobase[nr_dev] = ints[1];
irq[nr_dev] = ints[2];
nr_dev++;
return 1;
}
__setup("baycom_ser_hdx=", baycom_ser_hdx_setup);
__initcall(init_module);
#endif /* MODULE */
/* --------------------------------------------------------------------- */
......@@ -3,7 +3,7 @@
/*
* hdlcdrv.c -- HDLC packet radio network driver.
*
* Copyright (C) 1996-1998 Thomas Sailer (sailer@ife.ee.ethz.ch)
* Copyright (C) 1996-1999 Thomas Sailer (sailer@ife.ee.ethz.ch)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -36,6 +36,7 @@
* 0.5 30.07.97 made HDLC buffers bigger (solves a problem with the
* soundmodem driver)
* 0.6 05.04.98 add spinlocks
* 0.7 03.08.99 removed some old compatibility cruft
*/
/*****************************************************************************/
......@@ -516,11 +517,7 @@ static int hdlcdrv_set_mac_address(struct device *dev, void *addr)
/* --------------------------------------------------------------------- */
#if LINUX_VERSION_CODE >= 0x20119
static struct net_device_stats *hdlcdrv_get_stats(struct device *dev)
#else
static struct enet_statistics *hdlcdrv_get_stats(struct device *dev)
#endif
{
struct hdlcdrv_state *sm;
......@@ -695,9 +692,6 @@ static int hdlcdrv_ioctl(struct device *dev, struct ifreq *ifr, int cmd)
bi.data.ocs.ptt = hdlcdrv_ptt(s);
bi.data.ocs.dcd = s->hdlcrx.dcd;
bi.data.ocs.ptt_keyed = s->ptt_keyed;
#if LINUX_VERSION_CODE < 0x20100
bi.data.ocs.stats = s->stats;
#endif
break;
case HDLCDRVCTL_CALIBRATE:
......@@ -900,48 +894,25 @@ int hdlcdrv_unregister_hdlcdrv(struct device *dev)
/* --------------------------------------------------------------------- */
#if LINUX_VERSION_CODE >= 0x20115
EXPORT_SYMBOL(hdlcdrv_receiver);
EXPORT_SYMBOL(hdlcdrv_transmitter);
EXPORT_SYMBOL(hdlcdrv_arbitrate);
EXPORT_SYMBOL(hdlcdrv_register_hdlcdrv);
EXPORT_SYMBOL(hdlcdrv_unregister_hdlcdrv);
#else
static struct symbol_table hdlcdrv_syms = {
#include <linux/symtab_begin.h>
X(hdlcdrv_receiver),
X(hdlcdrv_transmitter),
X(hdlcdrv_arbitrate),
X(hdlcdrv_register_hdlcdrv),
X(hdlcdrv_unregister_hdlcdrv),
#include <linux/symtab_end.h>
};
#endif
/* --------------------------------------------------------------------- */
#ifdef MODULE
#if LINUX_VERSION_CODE >= 0x20115
MODULE_AUTHOR("Thomas M. Sailer, sailer@ife.ee.ethz.ch, hb9jnx@hb9w.che.eu");
MODULE_DESCRIPTION("Packet Radio network interface HDLC encoder/decoder");
#endif
/* --------------------------------------------------------------------- */
int __init init_module(void)
{
printk(KERN_INFO "hdlcdrv: (C) 1996 Thomas Sailer HB9JNX/AE4WA\n");
printk(KERN_INFO "hdlcdrv: version 0.6 compiled " __TIME__ " " __DATE__ "\n");
#if LINUX_VERSION_CODE < 0x20115
register_symtab(&hdlcdrv_syms);
#endif
printk(KERN_INFO "hdlcdrv: version 0.7 compiled " __TIME__ " " __DATE__ "\n");
return 0;
}
......
This diff is collapsed.
......@@ -3,7 +3,7 @@
/*
* sm.h -- soundcard radio modem driver internal header.
*
* Copyright (C) 1996-1998 Thomas Sailer (sailer@ife.ee.ethz.ch)
* Copyright (C) 1996-1999 Thomas Sailer (sailer@ife.ee.ethz.ch)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -34,6 +34,7 @@
#include <linux/soundmodem.h>
#include <asm/processor.h>
#include <linux/bitops.h>
#include <linux/parport.h>
#define SM_DEBUG
......@@ -50,6 +51,8 @@ struct sm_state {
const struct hardware_info *hwdrv;
struct pardevice *pardev;
/*
* Hardware (soundcard) access routines state
*/
......
......@@ -11,7 +11,7 @@ if [ "$CONFIG_PARPORT" != "n" ]; then
if [ "$CONFIG_PARPORT_PC" != "n" ]; then
bool ' Use FIFO/DMA if available' CONFIG_PARPORT_PC_FIFO
fi
if [ "$CONFIG_PARPORT_PC" = y ]; then
if [ "$CONFIG_PARPORT_PC" = "y" ]; then
# Don't bother with this if parport_pc is a module; it only affects
# the presence or not of some __init's, which are no-ops for modules.
bool ' Support for PCMCIA management for PC-style ports' CONFIG_PARPORT_PC_PCMCIA
......
......@@ -11,7 +11,7 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/threads.h>
#include <linux/string.h>
#include <linux/parport.h>
#include <linux/errno.h>
#include <linux/kernel.h>
......@@ -28,71 +28,86 @@ extern int parport_pc_init(int *io, int *io_hi, int *irq, int *dma);
static int parport_setup_ptr __initdata = 0;
__initfunc(void parport_setup(char *str, int *ints))
/*
* Acceptable parameters:
*
* parport=0
* parport=auto
* parport=0xBASE[,IRQ[,DMA]]
*
* IRQ/DMA may be numeric or 'auto' or 'none'
*/
static int __init parport_setup (char *str)
{
if (ints[0] == 0) {
if (str && !strncmp(str, "auto", 4)) {
irq[0] = PARPORT_IRQ_AUTO;
dma[0] = PARPORT_DMA_AUTO;
}
else if (str)
printk (KERN_ERR "parport: `%s': huh?\n", str);
else
printk (KERN_ERR "parport: parport=.. what?\n");
return;
}
else if (ints[1] == 0) {
char *endptr;
char *sep;
int val;
if (!str || !*str || (*str == '0' && !*(str+1))) {
/* Disable parport if "parport=0" in cmdline */
io[0] = PARPORT_DISABLE;
return;
io[0] = PARPORT_DISABLE;
return 0;
}
if (parport_setup_ptr < PARPORT_MAX) {
char *sep;
io[parport_setup_ptr] = ints[1];
irq[parport_setup_ptr] = PARPORT_IRQ_NONE;
dma[parport_setup_ptr] = PARPORT_DMA_NONE;
if (ints[0] > 1) {
irq[parport_setup_ptr] = ints[2];
if (ints[0] > 2) {
dma[parport_setup_ptr] = ints[3];
goto done;
}
if (!strncmp (str, "auto", 4)) {
irq[0] = PARPORT_IRQ_AUTO;
dma[0] = PARPORT_DMA_AUTO;
return 0;
}
if (str == NULL)
goto done;
val = simple_strtoul (str, &endptr, 0);
if (endptr == str) {
printk (KERN_WARNING "parport=%s not understood\n", str);
return 1;
}
goto dma_from_str;
}
else if (str == NULL)
goto done;
else if (!strncmp(str, "auto", 4))
if (parport_setup_ptr == PARPORT_MAX) {
printk(KERN_ERR "parport=%s ignored, too many ports\n", str);
return 1;
}
io[parport_setup_ptr] = val;
irq[parport_setup_ptr] = PARPORT_IRQ_NONE;
dma[parport_setup_ptr] = PARPORT_DMA_NONE;
sep = strchr (str, ',');
if (sep++) {
if (!strncmp (sep, "auto", 4))
irq[parport_setup_ptr] = PARPORT_IRQ_AUTO;
else if (strncmp(str, "none", 4) != 0) {
printk(KERN_ERR "parport: bad irq `%s'\n", str);
return;
else if (strncmp (sep, "none", 4)) {
val = simple_strtoul (sep, &endptr, 0);
if (endptr == sep) {
printk (KERN_WARNING
"parport=%s: irq not understood\n",
str);
return 1;
}
irq[parport_setup_ptr] = val;
}
}
if ((sep = strchr(str, ',')) == NULL) goto done;
str = sep+1;
dma_from_str:
if (!strncmp(str, "auto", 4))
sep = strchr (sep, ',');
if (sep++) {
if (!strncmp (sep, "auto", 4))
dma[parport_setup_ptr] = PARPORT_DMA_AUTO;
else if (strncmp(str, "none", 4) != 0) {
char *ep;
dma[parport_setup_ptr] = simple_strtoul(str, &ep, 0);
if (ep == str) {
printk(KERN_ERR "parport: bad dma `%s'\n",
str);
return;
else if (strncmp (sep, "none", 4)) {
val = simple_strtoul (sep, &endptr, 0);
if (endptr == sep) {
printk (KERN_WARNING
"parport=%s: dma not understood\n",
str);
return 1;
}
dma[parport_setup_ptr] = val;
}
done:
parport_setup_ptr++;
} else
printk(KERN_ERR "parport=%s ignored, too many ports\n", str);
}
parport_setup_ptr++;
return 0;
}
__setup ("parport=", parport_setup);
#endif
#ifdef MODULE
......@@ -113,7 +128,7 @@ void cleanup_module(void)
#else
__initfunc(int parport_init(void))
int __init parport_init (void)
{
if (io[0] == PARPORT_DISABLE)
return 1;
......@@ -139,6 +154,9 @@ __initfunc(int parport_init(void))
#endif
return 0;
}
__initcall (parport_init);
#endif
/* Exported symbols for modules. */
......
This diff is collapsed.
......@@ -1648,7 +1648,8 @@ struct parport *__maybe_init parport_pc_probe_port (unsigned long int base,
p->name, p->dma);
p->dma = PARPORT_DMA_NONE;
} else {
priv->dma_buf = (char *) __get_dma_pages(GFP_KERNEL, 0);
priv->dma_buf =
(char *)__get_dma_pages(GFP_KERNEL, 0);
if (! priv->dma_buf) {
printk (KERN_WARNING "%s: "
"cannot get buffer for DMA, "
......
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.
......@@ -1166,6 +1166,7 @@ void __init mount_root(void)
if (MAJOR(ROOT_DEV) == FLOPPY_MAJOR) {
#ifdef CONFIG_BLK_DEV_RAM
extern int rd_doload;
extern void rd_load_secondary(void);
#endif
floppy_eject();
#ifndef CONFIG_BLK_DEV_RAM
......
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