| Bits 5-3: | Reeived Offset. Indicates the
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/MAINTAINERS linux.20p7/MAINTAINERS
--- linux.vanilla/MAINTAINERS Sun Mar 25 17:37:29 2001
+++ linux.20p7/MAINTAINERS Wed Jul 4 16:06:50 2001
@@ -211,7 +211,8 @@
CONFIGURE, MENUCONFIG, XCONFIG
P: Michael Elizabeth Chastain
M: mec@shout.net
-L: linux-kbuild@torque.net
+L: kbuild-devel@lists.sourceforge.net
+W: http://kbuild.sourceforge.net
S: Maintained
CONFIGURE.HELP
@@ -242,8 +243,8 @@
S: Supported
CYCLADES PC300 DRIVER
-P: Ivan Passos
-M: ivan@cyclades.com
+P: Daniela Squassoni
+M: daniela@cyclades.com
W: http://www.cyclades.com/
S: Supported
@@ -764,13 +765,13 @@
P: Phil Blundell
M: Philip.Blundell@pobox.com
P: Tim Waugh
-M: tim@cyberelk.demon.co.uk
+M: tim@cyberelk.net
P: David Campbell
M: campbell@torque.net
P: Andrea Arcangeli
M: andrea@e-mind.com
L: linux-parport@torque.net
-W: http://www.cyberelk.demon.co.uk/parport.html
+W: http://people.redhat.com/twaugh/parport/
S: Maintained
PARIDE DRIVERS FOR PARALLEL PORT IDE DEVICES
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/Makefile linux.20p7/Makefile
--- linux.vanilla/Makefile Sun Mar 25 17:39:55 2001
+++ linux.20p7/Makefile Wed Jul 4 16:03:53 2001
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 2
-SUBLEVEL = 19
-EXTRAVERSION =
+SUBLEVEL = 20
+EXTRAVERSION = pre6
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
@@ -423,7 +423,8 @@
rm -rf modules
distclean: mrproper
- rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
+ rm -f core `find . \( -not -type d \) -and \
+ \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/alpha/kernel/entry.S linux.20p7/arch/alpha/kernel/entry.S
--- linux.vanilla/arch/alpha/kernel/entry.S Sun Mar 25 17:37:29 2001
+++ linux.20p7/arch/alpha/kernel/entry.S Wed Jul 4 16:03:53 2001
@@ -32,11 +32,12 @@
#define TASK_ADDR_LIMIT 24
#define TASK_EXEC_DOMAIN 32
#define TASK_NEED_RESCHED 40
+#define TASK_PTRACE 48
/*
* task flags (must match include/linux/sched.h):
*/
-#define PF_PTRACED 0x00000010
+#define PT_PTRACED 0x00000001
/*
* This defines the normal kernel pt-regs layout.
@@ -558,7 +559,7 @@
ldq $3,TASK_FLAGS($8)
stq $17,SP_OFF+32($30)
s8addq $0,$5,$5
- and $3,PF_PTRACED,$3
+ and $3,PT_PTRACED,$3
stq $18,SP_OFF+40($30)
bne $3,strace
beq $4,1f
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/alpha/kernel/ptrace.c linux.20p7/arch/alpha/kernel/ptrace.c
--- linux.vanilla/arch/alpha/kernel/ptrace.c Sun Mar 25 17:31:46 2001
+++ linux.20p7/arch/alpha/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -527,10 +527,10 @@
ret = -EPERM;
if (request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
goto out;
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
ret = 0;
goto out;
}
@@ -553,9 +553,9 @@
&& !capable(CAP_SYS_PTRACE))
goto out;
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
if (child->p_pptr != current) {
REMOVE_LINKS(child);
child->p_pptr = current;
@@ -566,7 +566,7 @@
goto out;
}
ret = -ESRCH;
- if (!(child->flags & PF_PTRACED)) {
+ if (!(child->ptrace & PT_PTRACED)) {
DBG(DBG_MEM, ("child not traced\n"));
goto out;
}
@@ -622,9 +622,9 @@
if ((unsigned long) data > _NSIG)
goto out;
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
wake_up_process(child);
/* make sure single-step breakpoint is gone. */
@@ -652,7 +652,7 @@
if ((unsigned long) data > _NSIG)
goto out;
child->tss.bpt_nsaved = -1; /* mark single-stepping */
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
wake_up_process(child);
child->exit_code = data;
/* give it a chance to run. */
@@ -663,7 +663,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
goto out;
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
wake_up_process(child);
child->exit_code = data;
REMOVE_LINKS(child);
@@ -686,8 +686,8 @@
asmlinkage void
syscall_trace(void)
{
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/alpha/kernel/signal.c linux.20p7/arch/alpha/kernel/signal.c
--- linux.vanilla/arch/alpha/kernel/signal.c Sun Mar 25 17:31:46 2001
+++ linux.20p7/arch/alpha/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -621,7 +621,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -692,12 +692,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
- lock_kernel();
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
- unlock_kernel();
/* FALLTHRU */
default:
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/alpha/kernel/sys_alcor.c linux.20p7/arch/alpha/kernel/sys_alcor.c
--- linux.vanilla/arch/alpha/kernel/sys_alcor.c Sun Mar 25 17:31:46 2001
+++ linux.20p7/arch/alpha/kernel/sys_alcor.c Wed Jul 4 16:03:53 2001
@@ -15,6 +15,7 @@
#include
#include
#include
+#include
#include
#include
@@ -186,13 +187,21 @@
static void
alcor_kill_arch (int mode, char *reboot_cmd)
{
- /* Who said DEC engineer's have no sense of humor? ;-) */
- if (alpha_using_srm) {
- *(vuip) GRU_RESET = 0x0000dead;
- mb();
+ switch(mode) {
+ case LINUX_REBOOT_CMD_RESTART:
+ /* Who said DEC engineer's have no sense of humor? ;-) */
+ if (alpha_using_srm) {
+ *(vuip) GRU_RESET = 0x0000dead;
+ mb();
+ }
+ break;
+ case LINUX_REBOOT_CMD_HALT:
+ break;
+ case LINUX_REBOOT_CMD_POWER_OFF:
+ break;
}
- generic_kill_arch(mode, reboot_cmd);
+ halt();
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/alpha/kernel/sys_miata.c linux.20p7/arch/alpha/kernel/sys_miata.c
--- linux.vanilla/arch/alpha/kernel/sys_miata.c Sun Mar 25 17:31:46 2001
+++ linux.20p7/arch/alpha/kernel/sys_miata.c Wed Jul 4 16:03:53 2001
@@ -14,6 +14,7 @@
#include
#include
#include
+#include
#include
#include
@@ -274,12 +275,22 @@
static void
miata_kill_arch (int mode, char *reboot_cmd)
{
- /* Who said DEC engineers have no sense of humor? ;-) */
- if (alpha_using_srm) {
- *(vuip) PYXIS_RESET = 0x0000dead;
- mb();
- }
- generic_kill_arch(mode, reboot_cmd);
+ switch(mode) {
+ case LINUX_REBOOT_CMD_HALT:
+ break;
+ case LINUX_REBOOT_CMD_RESTART:
+ /* Who said DEC engineers have no sense of humor? ;-) */
+ if (alpha_using_srm) {
+ *(vuip) PYXIS_RESET = 0x0000dead;
+ mb();
+ }
+ generic_kill_arch(mode, reboot_cmd);
+ break;
+ case LINUX_REBOOT_CMD_POWER_OFF:
+ break;
+ }
+
+ halt();
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/arm/kernel/ptrace.c linux.20p7/arch/arm/kernel/ptrace.c
--- linux.vanilla/arch/arm/kernel/ptrace.c Sun Mar 25 17:37:29 2001
+++ linux.20p7/arch/arm/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -662,9 +662,9 @@
if ((unsigned long) data > _NSIG)
break;
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
/* make sure single-step breakpoint is gone. */
ptrace_cancel_bpt(child);
@@ -697,7 +697,7 @@
if ((unsigned long) data > _NSIG)
break;
child->tss.debug.nsaved = -1;
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
/* give it a chance to run. */
wake_up_process(child);
@@ -711,7 +711,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
break;
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
child->exit_code = data;
REMOVE_LINKS(child);
child->p_pptr = child->p_opptr;
@@ -799,10 +799,10 @@
ret = -EPERM;
if (request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
goto out;
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
ret = 0;
goto out;
}
@@ -826,9 +826,9 @@
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
goto out;
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
if (child->p_pptr != current) {
REMOVE_LINKS(child);
@@ -841,7 +841,7 @@
goto out;
}
ret = -ESRCH;
- if (!(child->flags & PF_PTRACED))
+ if (!(child->ptrace & PT_PTRACED))
goto out;
if (child->state != TASK_STOPPED && request != PTRACE_KILL)
goto out;
@@ -857,8 +857,8 @@
asmlinkage void syscall_trace(void)
{
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/arm/kernel/signal.c linux.20p7/arch/arm/kernel/signal.c
--- linux.vanilla/arch/arm/kernel/signal.c Sun Mar 25 17:37:29 2001
+++ linux.20p7/arch/arm/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -474,7 +474,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -544,12 +544,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
- lock_kernel();
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
- unlock_kernel();
/* FALLTHRU */
default:
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/i386/boot/compressed/head.S linux.20p7/arch/i386/boot/compressed/head.S
--- linux.vanilla/arch/i386/boot/compressed/head.S Sun Mar 25 17:31:45 2001
+++ linux.20p7/arch/i386/boot/compressed/head.S Wed Jul 4 16:03:53 2001
@@ -65,6 +65,7 @@
movl %eax,0x000000 # loop forever if it isn't
cmpl %eax,0x100000
je 1b
+
/*
* Initialize eflags. Some BIOS's leave bits like NT set. This would
* confuse the debugger if this code is traced.
@@ -86,10 +87,14 @@
* Do the decompression, and jump to the new kernel..
*/
subl $16,%esp # place for structure on the stack
- pushl %esp # address of structure as first arg
+ movl %esp,%eax
+ pushl %esi # real mode pointer as second arg
+ pushl %eax # address of structure as first arg
call SYMBOL_NAME(decompress_kernel)
orl %eax,%eax
jnz 3f
+ popl %esi # discard address
+ popl %esi # real mode pointer
xorl %ebx,%ebx
ljmp $(__KERNEL_CS), $0x100000
@@ -104,11 +109,14 @@
movl $0x1000,%edi
movl $move_routine_end,%ecx
subl %esi,%ecx
+ addl $3,%ecx
+ shrl $2,%ecx
cld
rep
- movsb
+ movsl
popl %esi # discard the address
+ popl %ebx # real mode pointer
popl %esi # low_buffer_start
popl %ecx # lcount
popl %edx # high_buffer_start
@@ -122,18 +130,21 @@
* if we were high loaded. This _must_ PIC-code !
*/
move_routine_start:
+ movl %ecx,%ebp
+ shrl $2,%ecx
+ rep
+ movsl
+ movl %ebp,%ecx
+ andl $3,%ecx
rep
movsb
movl %edx,%esi
movl %eax,%ecx # NOTE: rep movsb won't move if %ecx == 0
+ addl $3,%ecx
+ shrl $2,%ecx
rep
- movsb
+ movsl
+ movl %ebx,%esi # Restore setup pointer
xorl %ebx,%ebx
-/*
- * Well, the kernel relies on %esp pointing into low mem,
- * with the decompressor loaded high this is no longer true,
- * so we set esp here.
- */
- mov $0x90000,%esp
ljmp $(__KERNEL_CS), $0x100000
move_routine_end:
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/i386/boot/compressed/misc.c linux.20p7/arch/i386/boot/compressed/misc.c
--- linux.vanilla/arch/i386/boot/compressed/misc.c Sun Mar 25 17:31:45 2001
+++ linux.20p7/arch/i386/boot/compressed/misc.c Wed Jul 4 16:03:53 2001
@@ -74,11 +74,13 @@
/*
* This is set up by the setup-routine at boot-time
*/
-#define EXT_MEM_K (*(unsigned short *)0x90002)
+static unsigned char *real_mode; /* Pointer to real-mode data */
+
+#define EXT_MEM_K (*(unsigned short *)(real_mode + 0x2))
#ifndef STANDARD_MEMORY_BIOS_CALL
-#define ALT_MEM_K (*(unsigned long *) 0x901e0)
+#define ALT_MEM_K (*(unsigned long *)(real_mode + 0x1e0))
#endif
-#define SCREEN_INFO (*(struct screen_info *)0x90000)
+#define SCREEN_INFO (*(struct screen_info *)(real_mode+0))
extern char input_data[];
extern int input_len;
@@ -98,13 +100,13 @@
extern int end;
static long free_mem_ptr = (long)&end;
-static long free_mem_end_ptr = 0x90000;
+static long free_mem_end_ptr;
#define INPLACE_MOVE_ROUTINE 0x1000
#define LOW_BUFFER_START 0x2000
-#define LOW_BUFFER_END 0x90000
-#define LOW_BUFFER_SIZE ( LOW_BUFFER_END - LOW_BUFFER_START )
+#define LOW_BUFFER_MAX 0x90000
#define HEAP_SIZE 0x2400
+static unsigned int low_buffer_end, low_buffer_size;
static int high_loaded =0;
static uch *high_buffer_start /* = (uch *)(((ulg)&end) + HEAP_SIZE)*/;
@@ -255,7 +257,7 @@
in = window;
for (n = 0; n < outcnt; n++) {
ch = *output_data++ = *in++;
- if ((ulg)output_data == LOW_BUFFER_END) output_data=high_buffer_start;
+ if ((ulg)output_data == low_buffer_end) output_data=high_buffer_start;
c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
}
crc = c;
@@ -311,10 +313,13 @@
if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < (3*1024)) error("Less than 4MB of memory.\n");
#endif
mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START;
+ low_buffer_end = ((unsigned int)real_mode > LOW_BUFFER_MAX
+ ? LOW_BUFFER_MAX : (unsigned int)real_mode) & ~0xfff;
+ low_buffer_size = low_buffer_end - LOW_BUFFER_START;
high_loaded = 1;
free_mem_end_ptr = (long)high_buffer_start;
- if ( (0x100000 + LOW_BUFFER_SIZE) > ((ulg)high_buffer_start)) {
- high_buffer_start = (uch *)(0x100000 + LOW_BUFFER_SIZE);
+ if ( (0x100000 + low_buffer_size) > ((ulg)high_buffer_start)) {
+ high_buffer_start = (uch *)(0x100000 + low_buffer_size);
mv->hcount = 0; /* say: we need not to move high_buffer */
}
else mv->hcount = -1;
@@ -323,17 +328,21 @@
void close_output_buffer_if_we_run_high(struct moveparams *mv)
{
- mv->lcount = bytes_out;
- if (bytes_out > LOW_BUFFER_SIZE) {
- mv->lcount = LOW_BUFFER_SIZE;
- if (mv->hcount) mv->hcount = bytes_out - LOW_BUFFER_SIZE;
+ if (bytes_out > low_buffer_size) {
+ mv->lcount = low_buffer_size;
+ if (mv->hcount)
+ mv->hcount = bytes_out - low_buffer_size;
+ } else {
+ mv->lcount = bytes_out;
+ mv->hcount = 0;
}
- else mv->hcount = 0;
}
-int decompress_kernel(struct moveparams *mv)
+int decompress_kernel(struct moveparams *mv, void *rmode)
{
+ real_mode = rmode;
+
if (SCREEN_INFO.orig_video_mode == 7) {
vidmem = (char *) 0xb0000;
vidport = 0x3b4;
@@ -355,4 +364,3 @@
if (high_loaded) close_output_buffer_if_we_run_high(mv);
return high_loaded;
}
-
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/i386/boot/setup.S linux.20p7/arch/i386/boot/setup.S
--- linux.vanilla/arch/i386/boot/setup.S Sun Mar 25 17:37:29 2001
+++ linux.20p7/arch/i386/boot/setup.S Wed Jul 4 16:03:53 2001
@@ -69,7 +69,7 @@
! SETUP-header, must start at CS:2 (old 0x9020:2)
!
.ascii "HdrS" ! Signature for SETUP-header
- .word 0x0201 ! Version number of header format
+ .word 0x0202 ! Version number of header format
! (must be >= 0x0105
! else old loadlin-1.5 will fail)
realmode_swtch: .word 0,0 ! default_switch,SETUPSEG
@@ -120,9 +120,28 @@
ramdisk_size: .long 0 ! its size in bytes
bootsect_kludge:
.word bootsect_helper,SETUPSEG
-heap_end_ptr: .word modelist+1024 ! space from here (exclusive) down to
- ! end of setup code can be used by setup
- ! for local heap purposes.
+heap_end_ptr: .word modelist+1024 ! (Header version 0x0201 or later)
+ ! space from here (exclusive) down to
+ ! end of setup code can be used by setup
+ ! for local heap purposes.
+
+pad1: .word 0 ! Reserved for future use
+
+cmd_line_ptr: .long 0 ! (Header version 0x0202 or later)
+ ! If nonzero, a 32-bit pointer
+ ! to the kernel command line.
+ ! The command line should be
+ ! located between the start of
+ ! setup and the end of low
+ ! memory (0xa0000), or it may
+ ! get overwritten before it
+ ! gets read. If this field is
+ ! used, there is no longer
+ ! anything magical about the
+ ! 0x90000 segment; the setup
+ ! can be located anywhere in
+ ! low memory 0x10000 or higher.
+
! ------------------------ end of header ----------------------------------
start_of_setup:
@@ -534,6 +553,13 @@
mov ax,cs ! aka #SETUPSEG ! right, forgot this at first. didn't work :-)
mov ds,ax
+! Check whether we need to be downward compatible with version <= 0x0201
+ cmp dword ptr [cmd_line_ptr],#0
+ jne end_move_self
+ cmp byte ptr [type_of_loader],#0x20
+ je end_move_self
+
+! Boot loader does not support boot protocol version 2.02.
! If we have our code not at 0x90000, we need to move it there now.
! We also then need to move the parameters behind it (command line)
! Because we would overwrite the code on the current IP, we move
@@ -572,9 +598,14 @@
mov ds,ax
mov ss,dx
! now we are at the right place
-end_move_self:
+end_move_self:
lidt idt_48 ! load idt with 0,0
+ xor eax,eax
+ mov ax,ds
+ shl eax,#4
+ add eax,#gdt
+ mov [gdt_48+2],eax
lgdt gdt_48 ! load gdt with whatever appropriate
! that was painless, now we enable A20
@@ -679,7 +710,11 @@
jmp flush_instr
flush_instr:
xor bx,bx ! Flag to indicate a boot
-
+ xor esi,esi ! Pointer to real-mode code
+ mov si,cs
+ sub si,#DELTA_INITSEG
+ shl esi,#4 ! Convert to 32-bit pointer
+
! NOTE: For high loaded big kernels we need a
! jmpi 0x100000,__KERNEL_CS
!
@@ -873,7 +908,7 @@
gdt_48:
.word 0x800 ! gdt limit=2048, 256 GDT entries
- .word 512+gdt,0x9 ! gdt base = 0X9xxxx
+ .word 0, 0 ! gdt base (filled in later)
!
! Include video setup & detection code
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/i386/kernel/bluesmoke.c linux.20p7/arch/i386/kernel/bluesmoke.c
--- linux.vanilla/arch/i386/kernel/bluesmoke.c Sun Mar 25 17:31:45 2001
+++ linux.20p7/arch/i386/kernel/bluesmoke.c Wed Jul 4 16:03:53 2001
@@ -46,6 +46,7 @@
printk(" at %08x%08x",
high, low);
}
+ printk("\n");
/* Clear it */
wrmsr(0x401+i*4, 0UL, 0UL);
/* Serialize */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/i386/kernel/entry.S linux.20p7/arch/i386/kernel/entry.S
--- linux.vanilla/arch/i386/kernel/entry.S Sun Mar 25 17:37:29 2001
+++ linux.20p7/arch/i386/kernel/entry.S Wed Jul 4 16:03:53 2001
@@ -76,6 +76,7 @@
addr_limit = 12
exec_domain = 16
need_resched = 20
+ptrace = 24
ENOSYS = 38
@@ -174,7 +175,7 @@
GET_CURRENT(%ebx)
cmpl $(NR_syscalls),%eax
jae badsys
- testb $0x20,flags(%ebx) # PF_TRACESYS
+ testb $0x02,ptrace(%ebx) # PT_TRACESYS
jne tracesys
call *SYMBOL_NAME(sys_call_table)(,%eax,4)
movl %eax,EAX(%esp) # save the return value
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/i386/kernel/head.S linux.20p7/arch/i386/kernel/head.S
--- linux.vanilla/arch/i386/kernel/head.S Sun Mar 25 17:31:45 2001
+++ linux.20p7/arch/i386/kernel/head.S Wed Jul 4 16:03:53 2001
@@ -14,11 +14,11 @@
#include
#include
-
-#define CL_MAGIC_ADDR 0x90020
-#define CL_MAGIC 0xA33F
-#define CL_BASE_ADDR 0x90000
-#define CL_OFFSET 0x90022
+#define OLD_CL_MAGIC_ADDR 0x90020
+#define OLD_CL_MAGIC 0xA33F
+#define OLD_CL_BASE_ADDR 0x90000
+#define OLD_CL_OFFSET 0x90022
+#define NEW_CL_POINTER 0x228 /* Relative to real mode data */
/*
* References to members of the boot_cpu_data structure.
@@ -36,6 +36,8 @@
/*
* swapper_pg_dir is the main page directory, address 0x00101000
+ *
+ * On entry, %esi points to the real-mode code as a 32-bit pointer.
*/
ENTRY(stext)
ENTRY(_stext)
@@ -52,6 +54,9 @@
#ifdef __SMP__
orw %bx,%bx
jz 1f
+#endif
+
+#ifdef __SMP__
/*
* New page tables may be in 4Mbyte page mode and may
* be using the global pages.
@@ -89,6 +94,7 @@
jmp checkCPUtype
1:
#endif __SMP__
+
/*
* Clear BSS first so that there are no surprises...
*/
@@ -99,6 +105,7 @@
cld
rep
stosb
+
/*
* start system 32-bit setup. We need to re-do some of the things done
* in 16-bit mode for the "real" operations.
@@ -115,8 +122,9 @@
* Copy bootup parameters out of the way. First 2kB of
* _empty_zero_page is for boot parameters, second 2kB
* is for the command line.
+ *
+ * Note: %esi still has the pointer to the real-mode data.
*/
- movl $0x90000,%esi
movl $ SYMBOL_NAME(empty_zero_page),%edi
movl $512,%ecx
cld
@@ -126,11 +134,15 @@
movl $512,%ecx
rep
stosl
- cmpw $(CL_MAGIC),CL_MAGIC_ADDR
+ movl SYMBOL_NAME(empty_zero_page)+NEW_CL_POINTER,%esi
+ andl %esi,%esi
+ jnz 2f
+ cmpw $(OLD_CL_MAGIC),OLD_CL_MAGIC_ADDR
jne 1f
+ movzwl OLD_CL_OFFSET,%esi
+ addl $(OLD_CL_BASE_ADDR),%esi
+2:
movl $ SYMBOL_NAME(empty_zero_page)+2048,%edi
- movzwl CL_OFFSET,%esi
- addl $(CL_BASE_ADDR),%esi
movl $2048,%ecx
rep
movsb
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/i386/kernel/irq.h linux.20p7/arch/i386/kernel/irq.h
--- linux.vanilla/arch/i386/kernel/irq.h Sun Mar 25 17:31:45 2001
+++ linux.20p7/arch/i386/kernel/irq.h Wed Jul 4 16:22:43 2001
@@ -85,6 +85,7 @@
extern void init_IRQ_SMP(void);
extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
extern int setup_x86_irq(unsigned int, struct irqaction *);
+extern void release_x86_irqs(struct task_struct *);
/*
* Various low-level irq details needed by irq.c, process.c,
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/i386/kernel/process.c linux.20p7/arch/i386/kernel/process.c
--- linux.vanilla/arch/i386/kernel/process.c Sun Mar 25 17:31:45 2001
+++ linux.20p7/arch/i386/kernel/process.c Wed Jul 4 16:10:31 2001
@@ -544,6 +544,7 @@
void release_thread(struct task_struct *dead_task)
{
+ release_x86_irqs(dead_task);
}
/*
@@ -808,7 +809,7 @@
goto out;
error = do_execve(filename, (char **) regs.ecx, (char **) regs.edx, ®s);
if (error == 0)
- current->flags &= ~PF_DTRACE;
+ current->ptrace &= ~PT_DTRACE;
putname(filename);
out:
unlock_kernel();
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/i386/kernel/ptrace.c linux.20p7/arch/i386/kernel/ptrace.c
--- linux.vanilla/arch/i386/kernel/ptrace.c Sun Mar 25 17:31:45 2001
+++ linux.20p7/arch/i386/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -394,10 +394,10 @@
ret = -EPERM;
if (request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
goto out;
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
ret = 0;
goto out;
}
@@ -423,9 +423,9 @@
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
goto out;
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
write_lock_irqsave(&tasklist_lock, flags);
if (child->p_pptr != current) {
@@ -440,7 +440,7 @@
goto out;
}
ret = -ESRCH;
- if (!(child->flags & PF_PTRACED))
+ if (!(child->ptrace & PT_PTRACED))
goto out;
if (child->state != TASK_STOPPED) {
if (request != PTRACE_KILL)
@@ -542,9 +542,9 @@
if ((unsigned long) data > _NSIG)
goto out;
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
/* make sure the single step bit is not set. */
tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG;
@@ -579,10 +579,10 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
goto out;
- child->flags &= ~PF_TRACESYS;
- if ((child->flags & PF_DTRACE) == 0) {
+ child->ptrace &= ~PT_TRACESYS;
+ if ((child->ptrace & PT_DTRACE) == 0) {
/* Spurious delayed TF traps may occur */
- child->flags |= PF_DTRACE;
+ child->ptrace |= PT_DTRACE;
}
tmp = get_stack_long(child, EFL_OFFSET) | TRAP_FLAG;
put_stack_long(child, EFL_OFFSET, tmp);
@@ -599,7 +599,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
goto out;
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
child->exit_code = data;
write_lock_irqsave(&tasklist_lock, flags);
REMOVE_LINKS(child);
@@ -710,8 +710,8 @@
asmlinkage void syscall_trace(void)
{
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/i386/kernel/signal.c linux.20p7/arch/i386/kernel/signal.c
--- linux.vanilla/arch/i386/kernel/signal.c Sun Mar 25 17:31:45 2001
+++ linux.20p7/arch/i386/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -629,7 +629,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -697,12 +697,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
- lock_kernel();
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
- unlock_kernel();
/* FALLTHRU */
default:
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/i386/kernel/traps.c linux.20p7/arch/i386/kernel/traps.c
--- linux.vanilla/arch/i386/kernel/traps.c Sun Mar 25 17:37:30 2001
+++ linux.20p7/arch/i386/kernel/traps.c Wed Jul 4 16:03:53 2001
@@ -375,12 +375,12 @@
* The TF error should be masked out only if the current
* process is not traced and if the TRAP flag has been set
* previously by a tracing process (condition detected by
- * the PF_DTRACE flag); remember that the i386 TRAP flag
+ * the PT_DTRACE flag); remember that the i386 TRAP flag
* can be modified by the process itself in user mode,
* allowing programs to debug themselves without the ptrace()
* interface.
*/
- if ((tsk->flags & (PF_DTRACE|PF_PTRACED)) == PF_DTRACE)
+ if ((tsk->ptrace & (PT_DTRACE|PT_PTRACED)) == PT_DTRACE)
goto clear_TF;
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/i386/kernel/vm86.c linux.20p7/arch/i386/kernel/vm86.c
--- linux.vanilla/arch/i386/kernel/vm86.c Sun Mar 25 17:31:45 2001
+++ linux.20p7/arch/i386/kernel/vm86.c Wed Jul 4 16:10:31 2001
@@ -439,7 +439,7 @@
}
if (trapno !=1)
return 1; /* we let this handle by the calling routine */
- if (current->flags & PF_PTRACED) {
+ if (current->ptrace & PT_PTRACED) {
unsigned long flags;
spin_lock_irqsave(¤t->sigmask_lock, flags);
sigdelset(¤t->blocked, SIGTRAP);
@@ -618,6 +618,14 @@
}
read_unlock(&tasklist_lock);
return ret;
+}
+
+void release_x86_irqs(struct task_struct *task)
+{
+ int i;
+ for (i=3; i<16; i++)
+ if (vm86_irqs[i].tsk == task)
+ free_vm86_irq(i);
}
static inline void handle_irq_zombies(void)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/i386/math-emu/fpu_entry.c linux.20p7/arch/i386/math-emu/fpu_entry.c
--- linux.vanilla/arch/i386/math-emu/fpu_entry.c Sun Mar 25 17:31:45 2001
+++ linux.20p7/arch/i386/math-emu/fpu_entry.c Wed Jul 4 16:03:53 2001
@@ -210,7 +210,7 @@
}
FPU_lookahead = 1;
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
FPU_lookahead = 0;
if ( !valid_prefix(&byte1, (u_char **)&FPU_EIP,
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/m68k/kernel/ptrace.c linux.20p7/arch/m68k/kernel/ptrace.c
--- linux.vanilla/arch/m68k/kernel/ptrace.c Sun Mar 25 17:31:50 2001
+++ linux.20p7/arch/m68k/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -320,10 +320,10 @@
ret = -EPERM;
if (request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
goto out;
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
ret = 0;
goto out;
}
@@ -349,9 +349,9 @@
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
goto out;
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
write_lock_irqsave(&tasklist_lock, flags);
if (child->p_pptr != current) {
@@ -366,7 +366,7 @@
goto out;
}
ret = -ESRCH;
- if (!(child->flags & PF_PTRACED))
+ if (!(child->ptrace & PT_PTRACED))
goto out;
if (child->state != TASK_STOPPED) {
if (request != PTRACE_KILL)
@@ -473,9 +473,9 @@
if ((unsigned long) data > _NSIG)
goto out;
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
/* make sure the single step bit is not set. */
tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
@@ -510,7 +510,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
goto out;
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16);
put_reg(child, PT_SR, tmp);
@@ -527,7 +527,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
goto out;
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
child->exit_code = data;
write_lock_irqsave(&tasklist_lock, flags);
REMOVE_LINKS(child);
@@ -607,8 +607,8 @@
asmlinkage void syscall_trace(void)
{
lock_kernel();
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
goto out;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/m68k/kernel/signal.c linux.20p7/arch/m68k/kernel/signal.c
--- linux.vanilla/arch/m68k/kernel/signal.c Sun Mar 25 17:31:50 2001
+++ linux.20p7/arch/m68k/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -1007,7 +1007,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
current->exit_code = signr;
current->state = TASK_STOPPED;
regs->sr &= ~PS_T;
@@ -1093,9 +1093,7 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGIOT: case SIGFPE: case SIGSEGV:
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
/* FALLTHRU */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/m68k/kernel/traps.c linux.20p7/arch/m68k/kernel/traps.c
--- linux.vanilla/arch/m68k/kernel/traps.c Sun Mar 25 17:31:50 2001
+++ linux.20p7/arch/m68k/kernel/traps.c Wed Jul 4 16:03:53 2001
@@ -921,7 +921,7 @@
if (fp->ptregs.sr & PS_S) {
if ((fp->ptregs.vector >> 2) == VEC_TRACE) {
/* traced a trapping instruction */
- current->flags |= PF_DTRACE;
+ current->ptrace |= PT_DTRACE;
} else
bad_super_trap(fp);
return;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/mips/baget/irq.c linux.20p7/arch/mips/baget/irq.c
--- linux.vanilla/arch/mips/baget/irq.c Sun Mar 25 17:31:48 2001
+++ linux.20p7/arch/mips/baget/irq.c Wed Jul 4 16:03:53 2001
@@ -212,7 +212,7 @@
add_interrupt_randomness(irq);
__cli();
} else {
- printk("do_IRQ: Unregistered IRQ (0x%X) occured\n", irq);
+ printk("do_IRQ: Unregistered IRQ (0x%X) occurred\n", irq);
}
unmask_irq(irq);
hardirq_exit(cpu);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/mips/dec/prom/memory.c linux.20p7/arch/mips/dec/prom/memory.c
--- linux.vanilla/arch/mips/dec/prom/memory.c Sun Mar 25 17:31:48 2001
+++ linux.20p7/arch/mips/dec/prom/memory.c Wed Jul 4 16:03:53 2001
@@ -25,7 +25,7 @@
extern unsigned long mips_memory_upper;
-volatile unsigned long mem_err = 0; /* So we know an error occured */
+volatile unsigned long mem_err = 0; /* So we know an error occurred */
/*
* Probe memory in 4MB chunks, waiting for an error to tell us we've fallen
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/mips/kernel/irixelf.c linux.20p7/arch/mips/kernel/irixelf.c
--- linux.vanilla/arch/mips/kernel/irixelf.c Sun Mar 25 17:31:48 2001
+++ linux.20p7/arch/mips/kernel/irixelf.c Wed Jul 4 16:03:53 2001
@@ -44,15 +44,15 @@
static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs);
static int load_irix_library(int fd);
-static int irix_core_dump(long signr, struct pt_regs * regs);
+static int irix_core_dump(long signr, struct pt_regs * regs, struct file *);
extern int dump_fpu (elf_fpregset_t *);
static struct linux_binfmt irix_format = {
-#ifndef MODULE
- NULL, NULL, load_irix_binary, load_irix_library, irix_core_dump
-#else
- NULL, &__this_module.usecount, load_irix_binary, load_irix_library, irix_core_dump
-#endif
+ module: THIS_MODULE,
+ load_binary: load_irix_binary,
+ load_shlib: load_irix_library,
+ core_dump: irix_core_dump,
+ min_coredump: PAGE_SIZE,
};
#ifndef elf_addr_t
@@ -806,7 +806,7 @@
#endif
start_thread(regs, elf_entry, bprm->p);
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
send_sig(SIGTRAP, current, 0);
return 0;
@@ -1128,14 +1128,10 @@
* and then they are actually written out. If we run out of core limit
* we just truncate.
*/
-static int irix_core_dump(long signr, struct pt_regs * regs)
+static int irix_core_dump(long signr, struct pt_regs * regs, struct file * file)
{
int has_dumped = 0;
- struct file *file;
- struct dentry *dentry;
- struct inode *inode;
mm_segment_t fs;
- char corefile[6+sizeof(current->comm)];
int segs;
int i;
size_t size;
@@ -1148,14 +1144,6 @@
struct elf_prstatus prstatus; /* NT_PRSTATUS */
elf_fpregset_t fpu; /* NT_PRFPREG */
struct elf_prpsinfo psinfo; /* NT_PRPSINFO */
-
- if (!current->dumpable || limit < PAGE_SIZE)
- return 0;
- current->dumpable = 0;
-
-#ifndef CONFIG_BINFMT_IRIX
- MOD_INC_USE_COUNT;
-#endif
/* Count what's needed to dump, up to the limit of coredump size. */
segs = 0;
@@ -1201,27 +1189,6 @@
fs = get_fs();
set_fs(KERNEL_DS);
- memcpy(corefile,"core.", 5);
-#if 0
- memcpy(corefile+5,current->comm,sizeof(current->comm));
-#else
- corefile[4] = '\0';
-#endif
- file = filp_open(corefile, O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600);
- if (IS_ERR(file))
- goto end_coredump;
- dentry = file->f_dentry;
- inode = dentry->d_inode;
- if (inode->i_nlink > 1)
- goto close_coredump; /* multiple links - don't dump */
-
- if (!S_ISREG(inode->i_mode))
- goto close_coredump;
- if (!inode->i_op || !inode->i_op->default_file_ops)
- goto close_coredump;
- if (!file->f_op->write)
- goto close_coredump;
-
has_dumped = 1;
current->flags |= PF_DUMPCORE;
@@ -1386,13 +1353,7 @@
}
close_coredump:
- filp_close(file, NULL);
-
- end_coredump:
set_fs(fs);
-#ifndef CONFIG_BINFMT_ELF
- MOD_DEC_USE_COUNT;
-#endif
return has_dumped;
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/mips/kernel/irixsig.c linux.20p7/arch/mips/kernel/irixsig.c
--- linux.vanilla/arch/mips/kernel/irixsig.c Sun Mar 25 17:31:48 2001
+++ linux.20p7/arch/mips/kernel/irixsig.c Wed Jul 4 16:03:53 2001
@@ -193,7 +193,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -261,12 +261,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
- lock_kernel();
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
- unlock_kernel();
/* FALLTHRU */
default:
@@ -707,7 +703,7 @@
if (!p->exit_code)
continue;
if (!(options & (W_TRAPPED|W_STOPPED)) &&
- !(p->flags & PF_PTRACED))
+ !(p->ptrace & PT_PTRACED))
continue;
if (ru != NULL)
getrusage(p, RUSAGE_BOTH, ru);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/mips/kernel/ptrace.c linux.20p7/arch/mips/kernel/ptrace.c
--- linux.vanilla/arch/mips/kernel/ptrace.c Sun Mar 25 17:31:48 2001
+++ linux.20p7/arch/mips/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -270,12 +270,12 @@
#endif
if (request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED) {
+ if (current->ptrace & PT_PTRACED) {
res = -EPERM;
goto out;
}
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
res = 0;
goto out;
}
@@ -306,9 +306,9 @@
goto out;
}
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
write_lock_irqsave(&tasklist_lock, flags);
if (child->p_pptr != current) {
@@ -322,7 +322,7 @@
res = 0;
goto out;
}
- if (!(child->flags & PF_PTRACED)) {
+ if (!(child->ptrace & PT_PTRACED)) {
res = -ESRCH;
goto out;
}
@@ -473,9 +473,9 @@
goto out;
}
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
wake_up_process(child);
res = data;
@@ -501,7 +501,7 @@
res = -EIO;
goto out;
}
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
child->exit_code = data;
REMOVE_LINKS(child);
child->p_pptr = child->p_opptr;
@@ -522,8 +522,8 @@
asmlinkage void syscall_trace(void)
{
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/mips/kernel/scall_o32.S linux.20p7/arch/mips/kernel/scall_o32.S
--- linux.vanilla/arch/mips/kernel/scall_o32.S Sun Mar 25 17:31:48 2001
+++ linux.20p7/arch/mips/kernel/scall_o32.S Wed Jul 4 16:03:53 2001
@@ -15,7 +15,7 @@
#include
/* This duplicates the definition from */
-#define PF_TRACESYS 0x00000020 /* tracing system calls */
+#define PT_TRACESYS 0x00000002 /* tracing system calls */
/* This duplicates the definition from */
#define SIGILL 4 /* Illegal instruction (ANSI). */
@@ -48,8 +48,8 @@
bgez t0, stackargs
stack_done:
- lw t0, TASK_FLAGS($28) # syscall tracing enabled?
- andi t0, PF_TRACESYS
+ lw t0, TASK_PTRACE($28) # syscall tracing enabled?
+ andi t0, PT_TRACESYS
bnez t0, trace_a_syscall
jalr t2 # Do The Real Thing (TM)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/mips/kernel/signal.c linux.20p7/arch/mips/kernel/signal.c
--- linux.vanilla/arch/mips/kernel/signal.c Sun Mar 25 17:31:48 2001
+++ linux.20p7/arch/mips/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -424,7 +424,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -493,12 +493,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
case SIGBUS:
- lock_kernel();
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
- unlock_kernel();
/* FALLTHRU */
default:
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/ppc/kernel/head.S linux.20p7/arch/ppc/kernel/head.S
--- linux.vanilla/arch/ppc/kernel/head.S Sun Mar 25 17:31:48 2001
+++ linux.20p7/arch/ppc/kernel/head.S Wed Jul 4 16:03:53 2001
@@ -2129,8 +2129,8 @@
cmpi 1,r0,0x6666 /* Special case for 'sys_rt_sigreturn' */
beq- 10f
beq- cr1,16f
- lwz r10,TASK_FLAGS(r2)
- andi. r10,r10,PF_TRACESYS
+ lwz r10,TASK_PTRACE(r2)
+ andi. r10,r10,PT_TRACESYS
bne- 50f
cmpli 0,r0,NR_syscalls
bge- 66f
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/ppc/kernel/mk_defs.c linux.20p7/arch/ppc/kernel/mk_defs.c
--- linux.vanilla/arch/ppc/kernel/mk_defs.c Sun Mar 25 17:31:48 2001
+++ linux.20p7/arch/ppc/kernel/mk_defs.c Wed Jul 4 16:03:53 2001
@@ -43,8 +43,9 @@
DEFINE(PGD, offsetof(struct mm_struct, pgd));
DEFINE(LAST_SYSCALL, offsetof(struct thread_struct, last_syscall));
DEFINE(PT_REGS, offsetof(struct thread_struct, regs));
- DEFINE(PF_TRACESYS, PF_TRACESYS);
+ DEFINE(PT_TRACESYS, PT_TRACESYS);
DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
+ DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
DEFINE(NEED_RESCHED, offsetof(struct task_struct, need_resched));
DEFINE(TSS_FPR0, offsetof(struct thread_struct, fpr[0]));
DEFINE(TSS_FPSCR, offsetof(struct thread_struct, fpscr));
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/ppc/kernel/openpic.c linux.20p7/arch/ppc/kernel/openpic.c
--- linux.vanilla/arch/ppc/kernel/openpic.c Sun Mar 25 17:37:30 2001
+++ linux.20p7/arch/ppc/kernel/openpic.c Wed Jul 4 16:03:53 2001
@@ -242,8 +242,8 @@
openpic_mapirq(i, 1<<0);
}
} else {
- /* Prevent any interrupt from occuring during initialisation.
- * Hum... I beleive this is not necessary, Apple does that in
+ /* Prevent any interrupt from occurring during initialisation.
+ * Hum... I believe this is not necessary, Apple does that in
* Darwin's PowerExpress code.
*/
openpic_set_priority(0, 0xf);
@@ -635,4 +635,4 @@
for (i=0; iProcessor[i].Current_Task_Priority, save_cpu_task_pri[i]);
}
-#endif /* CONFIG_PMAC_PBOOK */
\ No newline at end of file
+#endif /* CONFIG_PMAC_PBOOK */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/ppc/kernel/pmac_pci.c linux.20p7/arch/ppc/kernel/pmac_pci.c
--- linux.vanilla/arch/ppc/kernel/pmac_pci.c Sun Mar 25 17:31:49 2001
+++ linux.20p7/arch/ppc/kernel/pmac_pci.c Wed Jul 4 16:03:53 2001
@@ -109,7 +109,7 @@
bridge_node = NULL;
node = find_pci_device_OFnode(bus, dev_fn & 0xf8);
if (node) {
- /* note: we don't stop on the first occurence since we need to go
+ /* note: we don't stop on the first occurrence since we need to go
* up to the root bridge */
do {
if (node->type && !strcmp(node->type, "pci")
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/ppc/kernel/ptrace.c linux.20p7/arch/ppc/kernel/ptrace.c
--- linux.vanilla/arch/ppc/kernel/ptrace.c Sun Mar 25 17:31:49 2001
+++ linux.20p7/arch/ppc/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -341,10 +341,10 @@
lock_kernel();
if (request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
goto out;
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
ret = 0;
goto out;
}
@@ -370,9 +370,9 @@
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
goto out;
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
write_lock_irqsave(&tasklist_lock, flags);
if (child->p_pptr != current) {
@@ -387,7 +387,7 @@
goto out;
}
ret = -ESRCH;
- if (!(child->flags & PF_PTRACED))
+ if (!(child->ptrace & PT_PTRACED))
goto out;
if (child->state != TASK_STOPPED) {
if (request != PTRACE_KILL)
@@ -472,9 +472,9 @@
if ((unsigned long) data > _NSIG)
goto out;
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
/* make sure the single step bit is not set. */
clear_single_step(child);
@@ -503,7 +503,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
goto out;
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
set_single_step(child);
child->exit_code = data;
/* give it a chance to run. */
@@ -516,7 +516,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
goto out;
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
child->exit_code = data;
write_lock_irqsave(&tasklist_lock, flags);
REMOVE_LINKS(child);
@@ -541,8 +541,8 @@
asmlinkage void syscall_trace(void)
{
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/ppc/kernel/signal.c linux.20p7/arch/ppc/kernel/signal.c
--- linux.vanilla/arch/ppc/kernel/signal.c Sun Mar 25 17:31:49 2001
+++ linux.20p7/arch/ppc/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -558,7 +558,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -626,12 +626,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
- lock_kernel();
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
- unlock_kernel();
/* FALLTHRU */
default:
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/s390/kernel/entry.S linux.20p7/arch/s390/kernel/entry.S
--- linux.vanilla/arch/s390/kernel/entry.S Sun Mar 25 17:37:30 2001
+++ linux.20p7/arch/s390/kernel/entry.S Wed Jul 4 16:03:53 2001
@@ -661,7 +661,7 @@
lr %r3,%r8
la %r0,0x7f
nr %r3,%r0 # clear per-event-bit
- be BASED(pgm_dn) # none of Martins exceptions occured bypass
+ be BASED(pgm_dn) # none of Martins exceptions occurred bypass
l %r9,BASED(.Ljump_table)
sll %r3,2
l %r9,0(%r3,%r9) # load address of handler routine
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/s390/kernel/process.c linux.20p7/arch/s390/kernel/process.c
--- linux.vanilla/arch/s390/kernel/process.c Sun Mar 25 17:31:55 2001
+++ linux.20p7/arch/s390/kernel/process.c Wed Jul 4 16:03:53 2001
@@ -404,7 +404,7 @@
error = do_execve(filename, (char **) regs.gprs[3], (char **) regs.gprs[4], ®s);
if (error == 0)
{
- current->flags &= ~PF_DTRACE;
+ current->ptrace &= ~PT_DTRACE;
current->tss.fp_regs.fpc=0;
if(MACHINE_HAS_IEEE)
{
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/s390/kernel/ptrace.c linux.20p7/arch/s390/kernel/ptrace.c
--- linux.vanilla/arch/s390/kernel/ptrace.c Sun Mar 25 17:31:55 2001
+++ linux.20p7/arch/s390/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -435,10 +435,10 @@
if (request == PTRACE_TRACEME)
{
/* are we already being traced? */
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
goto out;
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
ret = 0;
goto out;
}
@@ -459,9 +459,9 @@
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
goto out;
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
if (child->p_pptr != current)
{
REMOVE_LINKS(child);
@@ -478,7 +478,7 @@
/* ieee_instruction_pointer from the user structure DJB */
if(child!=current)
{
- if (!(child->flags & PF_PTRACED))
+ if (!(child->ptrace & PT_PTRACED))
goto out;
if (child->state != TASK_STOPPED)
{
@@ -524,9 +524,9 @@
if ((unsigned long) data >= _NSIG)
break;
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
/* make sure the single step bit is not set. */
clear_single_step(child);
@@ -553,7 +553,7 @@
ret = -EIO;
if ((unsigned long) data >= _NSIG)
break;
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
set_single_step(child);
/* give it a chance to run. */
@@ -565,7 +565,7 @@
ret = -EIO;
if ((unsigned long) data >= _NSIG)
break;
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
wake_up_process(child);
child->exit_code = data;
REMOVE_LINKS(child);
@@ -593,8 +593,8 @@
asmlinkage void syscall_trace(void)
{
lock_kernel();
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
goto out;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/s390/kernel/signal.c linux.20p7/arch/s390/kernel/signal.c
--- linux.vanilla/arch/s390/kernel/signal.c Sun Mar 25 17:37:30 2001
+++ linux.20p7/arch/s390/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -461,7 +461,7 @@
if (!signr)
break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -529,12 +529,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
- lock_kernel();
- if (current->binfmt
- && current->binfmt->core_dump
- && current->binfmt->core_dump(signr, regs))
+ if (do_coredump(signr, regs))
exit_code |= 0x80;
- unlock_kernel();
/* FALLTHRU */
default:
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/s390/kernel/traps.c linux.20p7/arch/s390/kernel/traps.c
--- linux.vanilla/arch/s390/kernel/traps.c Sun Mar 25 17:31:55 2001
+++ linux.20p7/arch/s390/kernel/traps.c Wed Jul 4 16:03:53 2001
@@ -94,7 +94,7 @@
{
if(regs->psw.mask&PSW_PROBLEM_STATE)
{
- if(current->flags & PF_PTRACED)
+ if(current->ptrace & PT_PTRACED)
force_sig(signal,current);
else
return(TRUE);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/s390/tools/dasdfmt/dasdfmt.c linux.20p7/arch/s390/tools/dasdfmt/dasdfmt.c
--- linux.vanilla/arch/s390/tools/dasdfmt/dasdfmt.c Sun Mar 25 17:37:30 2001
+++ linux.20p7/arch/s390/tools/dasdfmt/dasdfmt.c Wed Jul 4 16:03:53 2001
@@ -479,7 +479,7 @@
rc=stat(dev_name,&stat_buf);
if (rc) {
- ERRMSG_EXIT(EXIT_FAILURE,"%s: error occured during stat: " \
+ ERRMSG_EXIT(EXIT_FAILURE,"%s: error occurred during stat: " \
"%s\n",prog_name,strerror(errno));
} else {
if (!S_ISBLK(stat_buf.st_mode))
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc/kernel/entry.S linux.20p7/arch/sparc/kernel/entry.S
--- linux.vanilla/arch/sparc/kernel/entry.S Sun Mar 25 17:31:46 2001
+++ linux.20p7/arch/sparc/kernel/entry.S Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: entry.S,v 1.159.2.8 2000/10/05 04:17:17 anton Exp $
+/* $Id: entry.S,v 1.159.2.9 2001/06/18 12:26:13 davem Exp $
* arch/sparc/kernel/entry.S: Sparc trap low-level entry points.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -1237,8 +1237,8 @@
call C_LABEL(do_ptrace)
add %sp, REGWIN_SZ, %o0
- ld [%curptr + AOFF_task_flags], %l5
- andcc %l5, 0x20, %g0
+ ld [%curptr + AOFF_task_ptrace], %l5
+ andcc %l5, 0x02, %g0
be 1f
nop
@@ -1287,8 +1287,8 @@
call C_LABEL(do_sigpause)
add %sp, REGWIN_SZ, %o1
- ld [%curptr + AOFF_task_flags], %l5
- andcc %l5, 0x20, %g0
+ ld [%curptr + AOFF_task_ptrace], %l5
+ andcc %l5, 0x02, %g0
be 1f
nop
@@ -1305,8 +1305,8 @@
call C_LABEL(do_sigsuspend)
add %sp, REGWIN_SZ, %o0
- ld [%curptr + AOFF_task_flags], %l5
- andcc %l5, 0x20, %g0
+ ld [%curptr + AOFF_task_ptrace], %l5
+ andcc %l5, 0x02, %g0
be 1f
nop
@@ -1324,8 +1324,8 @@
call C_LABEL(do_rt_sigsuspend)
add %sp, REGWIN_SZ, %o2
- ld [%curptr + AOFF_task_flags], %l5
- andcc %l5, 0x20, %g0
+ ld [%curptr + AOFF_task_ptrace], %l5
+ andcc %l5, 0x02, %g0
be 1f
nop
@@ -1342,8 +1342,8 @@
call C_LABEL(do_sigreturn)
add %sp, REGWIN_SZ, %o0
- ld [%curptr + AOFF_task_flags], %l5
- andcc %l5, 0x20, %g0
+ ld [%curptr + AOFF_task_ptrace], %l5
+ andcc %l5, 0x02, %g0
be 1f
nop
@@ -1362,8 +1362,8 @@
call C_LABEL(do_rt_sigreturn)
add %sp, REGWIN_SZ, %o0
- ld [%curptr + AOFF_task_flags], %l5
- andcc %l5, 0x20, %g0
+ ld [%curptr + AOFF_task_ptrace], %l5
+ andcc %l5, 0x02, %g0
be 1f
nop
@@ -1500,9 +1500,9 @@
mov %i1, %o1
mov %i2, %o2
- ld [%curptr + AOFF_task_flags], %l5
+ ld [%curptr + AOFF_task_ptrace], %l5
mov %i3, %o3
- andcc %l5, 0x20, %g0
+ andcc %l5, 0x02, %g0
mov %i4, %o4
bne linux_syscall_trace
mov %i0, %l5
@@ -1514,12 +1514,12 @@
.globl C_LABEL(ret_sys_call)
C_LABEL(ret_sys_call):
- ld [%curptr + AOFF_task_flags], %l6
+ ld [%curptr + AOFF_task_ptrace], %l6
cmp %o0, -ENOIOCTLCMD
ld [%sp + REGWIN_SZ + PT_PSR], %g3
set PSR_C, %g2
bgeu 1f
- andcc %l6, 0x20, %l6
+ andcc %l6, 0x02, %l6
/* System call success, clear Carry condition code. */
andn %g3, %g2, %g3
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc/kernel/ptrace.c linux.20p7/arch/sparc/kernel/ptrace.c
--- linux.vanilla/arch/sparc/kernel/ptrace.c Sun Mar 25 17:31:47 2001
+++ linux.20p7/arch/sparc/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -535,12 +535,12 @@
#endif
if(request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED) {
+ if (current->ptrace & PT_PTRACED) {
pt_error_return(regs, EPERM);
goto out;
}
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
pt_succ_return(regs, 0);
goto out;
}
@@ -578,11 +578,11 @@
goto out;
}
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED) {
+ if (child->ptrace & PT_PTRACED) {
pt_error_return(regs, EPERM);
goto out;
}
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
write_lock_irqsave(&tasklist_lock, flags);
if(child->p_pptr != current) {
REMOVE_LINKS(child);
@@ -594,7 +594,7 @@
pt_succ_return(regs, 0);
goto out;
}
- if (!(child->flags & PF_PTRACED)
+ if (!(child->ptrace & PT_PTRACED)
&& ((current->personality & PER_BSD) && (request != PTRACE_SUNATTACH))
&& (!(current->personality & PER_BSD) && (request != PTRACE_ATTACH))) {
pt_error_return(regs, ESRCH);
@@ -861,9 +861,9 @@
}
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
#ifdef DEBUG_PTRACE
@@ -900,7 +900,7 @@
pt_error_return(regs, EIO);
goto out;
}
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
wake_up_process(child);
child->exit_code = data;
write_lock_irqsave(&tasklist_lock, flags);
@@ -927,8 +927,8 @@
#ifdef DEBUG_PTRACE
printk("%s [%d]: syscall_trace\n", current->comm, current->pid);
#endif
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc/kernel/signal.c linux.20p7/arch/sparc/kernel/signal.c
--- linux.vanilla/arch/sparc/kernel/signal.c Sun Mar 25 17:31:46 2001
+++ linux.20p7/arch/sparc/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: signal.c,v 1.91.2.2 2000/05/28 19:13:21 ecd Exp $
+/* $Id: signal.c,v 1.91.2.3 2001/06/18 12:26:13 davem Exp $
* linux/arch/sparc/kernel/signal.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
@@ -1139,7 +1139,7 @@
if (!signr) break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
current->exit_code = signr;
current->state = TASK_STOPPED;
@@ -1203,7 +1203,7 @@
continue;
case SIGSTOP:
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
continue;
current->state = TASK_STOPPED;
current->exit_code = signr;
@@ -1217,14 +1217,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS:
- if(current->binfmt && current->binfmt->core_dump) {
- lock_kernel();
- if(current->binfmt &&
- current->binfmt->core_dump &&
- current->binfmt->core_dump(signr, regs))
- exit_code |= 0x80;
- unlock_kernel();
- }
+ if (do_coredump(signr, regs))
+ exit_code |= 0x80;
#ifdef DEBUG_SIGNALS
/* Very useful to debug dynamic linker problems */
printk ("Sig %ld going for %s[%d]...\n", signr, current->comm, current->pid);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc/lib/memset.S linux.20p7/arch/sparc/lib/memset.S
--- linux.vanilla/arch/sparc/lib/memset.S Sun Mar 25 17:31:47 2001
+++ linux.20p7/arch/sparc/lib/memset.S Wed Jul 4 16:03:53 2001
@@ -185,7 +185,7 @@
b 30f
add %o0, %o1, %o0
30:
-/* %o4 is faulting address, %o5 is %pc where fault occured */
+/* %o4 is faulting address, %o5 is %pc where fault occurred */
save %sp, -104, %sp
mov %i5, %o0
mov %i7, %o1
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/kernel/binfmt_aout32.c linux.20p7/arch/sparc64/kernel/binfmt_aout32.c
--- linux.vanilla/arch/sparc64/kernel/binfmt_aout32.c Sun Mar 25 17:31:53 2001
+++ linux.20p7/arch/sparc64/kernel/binfmt_aout32.c Wed Jul 4 16:03:53 2001
@@ -34,12 +34,16 @@
static int load_aout32_binary(struct linux_binprm *, struct pt_regs * regs);
static int load_aout32_library(int fd);
-static int aout32_core_dump(long signr, struct pt_regs * regs);
+static int aout32_core_dump(long signr, struct pt_regs * regs, struct file *);
extern void dump_thread(struct pt_regs *, struct user *);
static struct linux_binfmt aout32_format = {
- NULL, NULL, load_aout32_binary, load_aout32_library, aout32_core_dump
+ module: THIS_MODULE,
+ load_binary: load_aout32_binary,
+ load_shlib: load_aout32_library,
+ core_dump: aout32_core_dump,
+ min_coredump: PAGE_SIZE,
};
static void set_brk(unsigned long start, unsigned long end)
@@ -87,46 +91,18 @@
* dumping of the process results in another error..
*/
-static inline int
-do_aout32_core_dump(long signr, struct pt_regs * regs)
+static int
+aout32_core_dump(long signr, struct pt_regs * regs, struct file * file)
{
- struct dentry * dentry = NULL;
- struct inode * inode = NULL;
- struct file * file;
mm_segment_t fs;
int has_dumped = 0;
- char corefile[6+sizeof(current->comm)];
unsigned long dump_start, dump_size;
struct user dump;
# define START_DATA(u) (u.u_tsize)
# define START_STACK(u) ((regs->u_regs[UREG_FP]) & ~(PAGE_SIZE - 1))
- if (!current->dumpable || atomic_read(¤t->mm->count) != 1)
- return 0;
- current->dumpable = 0;
-
-/* See if we have enough room to write the upage. */
- if (current->rlim[RLIMIT_CORE].rlim_cur < PAGE_SIZE)
- return 0;
fs = get_fs();
set_fs(KERNEL_DS);
- memcpy(corefile,"core.",5);
-#if 0
- memcpy(corefile+5,current->comm,sizeof(current->comm));
-#else
- corefile[4] = '\0';
-#endif
- file = filp_open(corefile,O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600);
- if (IS_ERR(file))
- goto end_coredump;
- dentry = file->f_dentry;
- inode = dentry->d_inode;
- if (!S_ISREG(inode->i_mode))
- goto close_coredump;
- if (!inode->i_op || !inode->i_op->default_file_ops)
- goto close_coredump;
- if (!file->f_op->write)
- goto close_coredump;
has_dumped = 1;
current->flags |= PF_DUMPCORE;
strncpy(dump.u_comm, current->comm, sizeof(current->comm));
@@ -172,23 +148,10 @@
set_fs(KERNEL_DS);
DUMP_WRITE(current,sizeof(*current));
close_coredump:
- filp_close(file, NULL);
-end_coredump:
set_fs(fs);
return has_dumped;
}
-static int
-aout32_core_dump(long signr, struct pt_regs * regs)
-{
- int retval;
-
- MOD_INC_USE_COUNT;
- retval = do_aout32_core_dump(signr, regs);
- MOD_DEC_USE_COUNT;
- return retval;
-}
-
/*
* create_aout32_tables() parses the env- and arg-strings in new user
* memory and creates the pointer tables from them, and puts their
@@ -375,7 +338,7 @@
p = (unsigned long) create_aout32_tables((char *)p, bprm);
current->mm->start_stack = p;
start_thread32(regs, ex.a_entry, p);
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
send_sig(SIGTRAP, current, 0);
return 0;
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/kernel/devices.c linux.20p7/arch/sparc64/kernel/devices.c
--- linux.vanilla/arch/sparc64/kernel/devices.c Sun Mar 25 17:31:53 2001
+++ linux.20p7/arch/sparc64/kernel/devices.c Wed Jul 4 16:03:53 2001
@@ -73,6 +73,15 @@
prom_cpu_nodes[0] = prom_node_cpu;
+#ifndef __SMP__
+ {
+ extern unsigned int up_clock_tick;
+ up_clock_tick = prom_getintdefault(prom_node_cpu,
+ "clock-frequency",
+ 0);
+ }
+#endif
+
mem_start = central_probe(mem_start);
cpu_probe();
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/kernel/entry.S linux.20p7/arch/sparc64/kernel/entry.S
--- linux.vanilla/arch/sparc64/kernel/entry.S Sun Mar 25 17:31:53 2001
+++ linux.20p7/arch/sparc64/kernel/entry.S Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: entry.S,v 1.103.2.6 2000/09/08 14:00:04 jj Exp $
+/* $Id: entry.S,v 1.103.2.7 2001/06/18 12:26:13 davem Exp $
* arch/sparc64/kernel/entry.S: Sparc64 trap low-level entry points.
*
* Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu)
@@ -880,8 +880,8 @@
add %o7, 1f-.-4, %o7
nop
.align 32
-1: ldx [%curptr + AOFF_task_flags], %l5
- andcc %l5, 0x20, %g0
+1: ldx [%curptr + AOFF_task_ptrace], %l5
+ andcc %l5, 0x02, %g0
be,pt %icc, rtrap
clr %l6
call syscall_trace
@@ -1015,12 +1015,12 @@
mov %i4, %o4 ! IEU1
lduw [%l7 + %l4], %l7 ! Load
srl %i1, 0, %o1 ! IEU0 Group
- ldx [%curptr + AOFF_task_flags], %l0 ! Load
+ ldx [%curptr + AOFF_task_ptrace], %l0 ! Load
mov %i5, %o5 ! IEU1
srl %i2, 0, %o2 ! IEU0 Group
mov %i0, %l5 ! IEU1
- andcc %l0, 0x20, %g0 ! IEU1 Group
+ andcc %l0, 0x02, %g0 ! IEU1 Group
bne,pn %icc, linux_syscall_trace32 ! CTI
srl %i3, 0, %o3 ! IEU0
call %l7 ! CTI Group brk forced
@@ -1044,11 +1044,11 @@
mov %i1, %o1 ! IEU1
lduw [%l7 + %l4], %l7 ! Load
4: mov %i2, %o2 ! IEU0 Group
- ldx [%curptr + AOFF_task_flags], %l0 ! Load
+ ldx [%curptr + AOFF_task_ptrace], %l0 ! Load
mov %i3, %o3 ! IEU1
mov %i4, %o4 ! IEU0 Group
- andcc %l0, 0x20, %g0 ! IEU1 Group+1 bubble
+ andcc %l0, 0x02, %g0 ! IEU1 Group+1 bubble
bne,pn %icc, linux_syscall_trace ! CTI Group
mov %i0, %l5 ! IEU0
2: call %l7 ! CTI Group brk forced
@@ -1059,14 +1059,14 @@
call syscall_trace_exit
add %sp, STACK_BIAS + REGWIN_SZ, %o1
#endif
- ldx [%curptr + AOFF_task_flags], %l6
+ ldx [%curptr + AOFF_task_ptrace], %l6
sra %o0, 0, %o0
mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE], %g3
cmp %o0, -ENOIOCTLCMD
sllx %g2, 32, %g2
bgeu,pn %xcc, 1f
- andcc %l6, 0x20, %l6
+ andcc %l6, 0x02, %l6
/* System call success, clear Carry condition code. */
andn %g3, %g2, %g3
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/kernel/ioctl32.c linux.20p7/arch/sparc64/kernel/ioctl32.c
--- linux.vanilla/arch/sparc64/kernel/ioctl32.c Sun Mar 25 17:37:30 2001
+++ linux.20p7/arch/sparc64/kernel/ioctl32.c Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: ioctl32.c,v 1.62.2.18 2001/01/26 22:26:07 davem Exp $
+/* $Id: ioctl32.c,v 1.62.2.21 2001/06/08 01:34:11 davem Exp $
* ioctl32.c: Conversion between 32bit and 64bit native ioctls.
*
* Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -43,6 +43,7 @@
#include
#include
#include
+#include
#include
#include
@@ -492,10 +493,19 @@
}
}
if (!err) {
- if (i <= ifc32.ifc_len)
+ if (ifc32.ifcbuf == 0) {
+ /* Translate from 64-bit structure multiple to
+ * a 32-bit one.
+ */
+ i = ifc.ifc_len;
+ i = ((i / sizeof(struct ifreq)) * sizeof(struct ifreq32));
ifc32.ifc_len = i;
- else
- ifc32.ifc_len = i - sizeof (struct ifreq32);
+ } else {
+ if (i <= ifc32.ifc_len)
+ ifc32.ifc_len = i;
+ else
+ ifc32.ifc_len = i - sizeof (struct ifreq32);
+ }
if (copy_to_user((struct ifconf32 *)arg, &ifc32, sizeof(struct ifconf32)))
err = -EFAULT;
}
@@ -2682,6 +2692,8 @@
case /* STOP_ARRAY */ _IO (MD_MAJOR, 0x32):
case /* STOP_ARRAY_RO */ _IO (MD_MAJOR, 0x33):
case /* RESTART_ARRAY_RW */ _IO (MD_MAJOR, 0x34):
+ case /* PRINT_RAID_DEBUG */ _IO (MD_MAJOR, 0x13):
+ case /* SET_DISK_FAULTY */ _IO (MD_MAJOR, 0x29):
/* Big K */
case PIO_FONT:
@@ -3136,6 +3148,13 @@
case DRM_IOCTL_FINISH:
#endif /* DRM */
+ /* Misc. */
+ case 0x41545900: /* ATYIO_CLKR */
+ case 0x41545901: /* ATYIO_CLKW */
+ case PCIIOC_CONTROLLER:
+ case PCIIOC_MMAP_IS_IO:
+ case PCIIOC_MMAP_IS_MEM:
+ case PCIIOC_WRITE_COMBINE:
error = sys_ioctl (fd, cmd, arg);
goto out;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/kernel/irq.c linux.20p7/arch/sparc64/kernel/irq.c
--- linux.vanilla/arch/sparc64/kernel/irq.c Sun Mar 25 17:31:53 2001
+++ linux.20p7/arch/sparc64/kernel/irq.c Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: irq.c,v 1.76.2.3 2000/03/02 02:03:27 davem Exp $
+/* $Id: irq.c,v 1.76.2.4 2001/06/04 06:51:17 ecd Exp $
* irq.c: UltraSparc IRQ handling/init/registry.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
@@ -1048,6 +1048,8 @@
unsigned char flags = bp->flags;
nbp = __bucket(bp->irq_chain);
+ bp->irq_chain = 0;
+
if((flags & IBF_ACTIVE) != 0) {
if((flags & IBF_MULTI) == 0) {
struct irqaction *ap = bp->irq_info;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/kernel/process.c linux.20p7/arch/sparc64/kernel/process.c
--- linux.vanilla/arch/sparc64/kernel/process.c Sun Mar 25 17:31:52 2001
+++ linux.20p7/arch/sparc64/kernel/process.c Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.92.2.3 1999/12/05 07:24:38 davem Exp $
+/* $Id: process.c,v 1.92.2.4 2001/06/03 13:41:48 ecd Exp $
* arch/sparc64/kernel/process.c
*
* Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -116,6 +116,7 @@
extern void (*prom_palette)(int);
extern int serial_console;
#endif
+extern void (*prom_keyboard)(void);
void machine_halt(void)
{
@@ -126,6 +127,8 @@
if (!serial_console && prom_palette)
prom_palette (1);
#endif
+ if (prom_keyboard)
+ prom_keyboard();
prom_halt();
panic("Halt failed!");
}
@@ -144,6 +147,8 @@
if (!serial_console && prom_palette)
prom_palette (1);
#endif
+ if (prom_keyboard)
+ prom_keyboard();
if (cmd)
prom_reboot(cmd);
if (*reboot_command)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/kernel/psycho.c linux.20p7/arch/sparc64/kernel/psycho.c
--- linux.vanilla/arch/sparc64/kernel/psycho.c Sun Mar 25 17:31:53 2001
+++ linux.20p7/arch/sparc64/kernel/psycho.c Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: psycho.c,v 1.85.2.11 2000/10/24 21:00:53 davem Exp $
+/* $Id: psycho.c,v 1.85.2.12 2001/05/16 07:28:41 davem Exp $
* psycho.c: Ultra/AX U2P PCI controller support.
*
* Copyright (C) 1997 David S. Miller (davem@caipfs.rutgers.edu)
@@ -682,12 +682,26 @@
static inline struct pci_vma *pci_vma_alloc(void)
{
- return kmalloc(sizeof(struct pci_vma), GFP_ATOMIC);
+ struct pci_vma *vma = kmalloc(sizeof(struct pci_vma), GFP_ATOMIC);
+
+ if (!vma) {
+ prom_printf("PCI: Critical error, cannot allocate PCI_VMA.\n");
+ prom_halt();
+ }
+
+ return vma;
}
static inline struct pcidev_cookie *pci_devcookie_alloc(void)
{
- return kmalloc(sizeof(struct pcidev_cookie), GFP_ATOMIC);
+ struct pcidev_cookie *cookie = kmalloc(sizeof(struct pcidev_cookie), GFP_ATOMIC);
+
+ if (!cookie) {
+ prom_printf("PCI: Critical error, cannot allocate PCIDEV_COOKIE.\n");
+ prom_halt();
+ }
+
+ return cookie;
}
@@ -804,18 +818,48 @@
}
}
+static void __init pci_fixup_host_bridge_self(struct pci_bus *pbus)
+{
+ struct pci_dev *pdev;
+
+ for (pdev = pbus->devices; pdev; pdev = pdev->sibling) {
+ if (pdev->class >> 8 == PCI_CLASS_BRIDGE_HOST) {
+ pbus->self = pdev;
+ return;
+ }
+ }
+
+ prom_printf("PCI: Critical error, cannot find host bridge PDEV.\n");
+ prom_halt();
+}
+
+static struct pcidev_cookie * __init pci_alloc_hostbridge_cookie(struct linux_pbm_info *pbm)
+{
+ struct pcidev_cookie *cookie = pci_devcookie_alloc();
+
+ memset(cookie, 0, sizeof(*cookie));
+ cookie->pbm = pbm;
+
+ return cookie;
+}
+
static void __init sabre_probe(struct linux_psycho *sabre)
{
struct pci_bus *pbus = sabre->pci_bus;
static unsigned char busno = 0;
+ sabre->pbms_same_domain = 1;
+
pbus->number = pbus->secondary = busno;
pbus->sysdata = sabre;
pbus->subordinate = pci_scan_bus(pbus);
busno = pbus->subordinate + 1;
- for(pbus = pbus->children; pbus; pbus = pbus->next) {
+ pci_fixup_host_bridge_self(pbus);
+ pbus->self->sysdata = pci_alloc_hostbridge_cookie(&sabre->pbm_A);
+
+ for (pbus = pbus->children; pbus; pbus = pbus->next) {
if (pbus->number == sabre->pbm_A.pci_first_busno)
memcpy(&sabre->pbm_A.pci_bus, pbus, sizeof(*pbus));
if (pbus->number == sabre->pbm_B.pci_first_busno)
@@ -845,6 +889,9 @@
pbus->subordinate = pci_scan_bus(pbus);
+ pci_fixup_host_bridge_self(pbus);
+ pbus->self->sysdata = pci_alloc_hostbridge_cookie(pbm);
+
/*
* Set the maximum subordinate bus of this pbm.
*/
@@ -2082,6 +2129,8 @@
if (apb_present(psycho)) {
sabre_probe(psycho);
} else {
+ psycho->pbms_same_domain = 0;
+
/* Probe busses under PBM B. */
pbm_probe(&psycho->pbm_B);
@@ -2654,6 +2703,150 @@
return NULL;
}
return str;
+}
+
+/* Platform support for /proc/bus/pci/X/Y mmap()s. */
+
+/* Adjust vm_offset of VMA such that it is the physical page offset corresponding
+ * to the 32-bit pci bus offset for DEV requested by the user.
+ *
+ * Basically, the user finds the base address for his device which he wishes
+ * to mmap. They read the 32-bit value from the config space base register,
+ * add whatever PAGE_SIZE multiple offset they wish, and feed this into the
+ * offset parameter of mmap on /proc/bus/pci/XXX for that device.
+ *
+ * Returns negative error code on failure, zero on success.
+ */
+static __inline__ int __pci_mmap_make_offset(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state)
+{
+ unsigned long user_offset = vma->vm_offset;
+ unsigned long user32 = user_offset & 0xffffffffUL;
+ unsigned long largest_base, this_base, addr32;
+ int i;
+
+ /* Figure out which base address this is for. */
+ largest_base = 0UL;
+ for (i = 0; i <= 6; i++) {
+ unsigned long base = dev->base_address[i];
+
+ /* Active? */
+ if (!base)
+ continue;
+
+ /* Same type? */
+ if (i == 6) {
+ if (mmap_state != pci_mmap_mem)
+ continue;
+ } else {
+ if ((mmap_state == pci_mmap_io &&
+ (base & PCI_BASE_ADDRESS_SPACE_IO) == 0) ||
+ (mmap_state == pci_mmap_mem &&
+ (base & PCI_BASE_ADDRESS_SPACE_IO) != 0))
+ continue;
+ }
+
+ this_base = base;
+
+ addr32 = (this_base & PAGE_MASK) & 0xffffffffUL;
+
+ if (mmap_state == pci_mmap_io)
+ addr32 &= 0xffffff;
+
+ if (addr32 <= user32 && this_base > largest_base)
+ largest_base = this_base;
+ }
+
+ if (largest_base == 0UL)
+ return -EINVAL;
+
+ largest_base = __pa(largest_base);
+
+ /* Now construct the final physical address. */
+ if (mmap_state == pci_mmap_io)
+ vma->vm_offset = (((largest_base & ~0xffffffUL) | user32) & PAGE_MASK);
+ else
+ vma->vm_offset = (((largest_base & ~0xffffffffUL) | user32) & PAGE_MASK);
+
+ return 0;
+}
+
+/* Set vm_flags of VMA, as appropriate for this architecture, for a pci device
+ * mapping.
+ */
+static __inline__ void __pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state)
+{
+ vma->vm_flags |= (VM_SHM | VM_LOCKED);
+}
+
+/* Set vm_page_prot of VMA, as appropriate for this architecture, for a pci
+ * device mapping.
+ */
+static __inline__ void __pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state)
+{
+ /* Our io_remap_page_range takes care of this, do nothing. */
+}
+
+extern int io_remap_page_range(unsigned long from, unsigned long offset,
+ unsigned long size, pgprot_t prot, int space);
+
+/* Perform the actual remap of the pages for a PCI device mapping, as appropriate
+ * for this architecture. The region in the process to map is described by vm_start
+ * and vm_end members of VMA, the base physical address is found in vm_pgoff.
+ * The pci device structure is provided so that architectures may make mapping
+ * decisions on a per-device or per-bus basis.
+ *
+ * Returns a negative error code on failure, zero on success.
+ */
+int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state,
+ int write_combine)
+{
+ int ret;
+
+ ret = __pci_mmap_make_offset(dev, vma, mmap_state);
+ if (ret < 0)
+ return ret;
+
+ __pci_mmap_set_flags(dev, vma, mmap_state);
+ __pci_mmap_set_pgprot(dev, vma, mmap_state);
+
+ ret = io_remap_page_range(vma->vm_start,
+ (vma->vm_offset |
+ (write_combine ? 0x1UL : 0x0UL)),
+ vma->vm_end - vma->vm_start, vma->vm_page_prot, 0);
+ if (ret)
+ return ret;
+
+ vma->vm_flags |= VM_IO;
+ return 0;
+}
+
+/* Return the index of the PCI controller for device PDEV. */
+
+int pci_controller_num(struct pci_dev *pdev)
+{
+ struct pcidev_cookie *cookie = pdev->sysdata;
+ int ret;
+
+ if (cookie != NULL) {
+ struct linux_pbm_info *pbm = cookie->pbm;
+
+ if (pbm == NULL || pbm->parent == NULL) {
+ ret = -ENXIO;
+ } else {
+ ret = pbm->parent->index;
+ if (!pbm->parent->pbms_same_domain)
+ ret = ((ret << 1) +
+ ((pbm == &pbm->parent->pbm_B) ? 1 : 0));
+ }
+ } else {
+ ret = -ENXIO;
+ }
+
+ return ret;
}
#endif
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/kernel/ptrace.c linux.20p7/arch/sparc64/kernel/ptrace.c
--- linux.vanilla/arch/sparc64/kernel/ptrace.c Sun Mar 25 17:31:53 2001
+++ linux.20p7/arch/sparc64/kernel/ptrace.c Wed Jul 4 16:03:53 2001
@@ -569,12 +569,12 @@
#endif
if(request == PTRACE_TRACEME) {
/* are we already being traced? */
- if (current->flags & PF_PTRACED) {
+ if (current->ptrace & PT_PTRACED) {
pt_error_return(regs, EPERM);
goto out;
}
/* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ current->ptrace |= PT_PTRACED;
pt_succ_return(regs, 0);
goto out;
}
@@ -616,11 +616,11 @@
goto out;
}
/* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED) {
+ if (child->ptrace & PT_PTRACED) {
pt_error_return(regs, EPERM);
goto out;
}
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
write_lock_irqsave(&tasklist_lock, flags);
if(child->p_pptr != current) {
REMOVE_LINKS(child);
@@ -632,7 +632,7 @@
pt_succ_return(regs, 0);
goto out;
}
- if (!(child->flags & PF_PTRACED)
+ if (!(child->ptrace & PT_PTRACED)
&& ((current->personality & PER_BSD) && (request != PTRACE_SUNATTACH))
&& (!(current->personality & PER_BSD) && (request != PTRACE_ATTACH))) {
pt_error_return(regs, ESRCH);
@@ -1064,9 +1064,9 @@
}
if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
#ifdef DEBUG_PTRACE
@@ -1104,7 +1104,7 @@
pt_error_return(regs, EIO);
goto out;
}
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
child->exit_code = data;
write_lock_irqsave(&tasklist_lock, flags);
@@ -1139,8 +1139,8 @@
#ifdef DEBUG_PTRACE
printk("%s [%d]: syscall_trace\n", current->comm, current->pid);
#endif
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/kernel/setup.c linux.20p7/arch/sparc64/kernel/setup.c
--- linux.vanilla/arch/sparc64/kernel/setup.c Sun Mar 25 17:31:53 2001
+++ linux.20p7/arch/sparc64/kernel/setup.c Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.43.2.5 2000/10/02 02:05:37 anton Exp $
+/* $Id: setup.c,v 1.43.2.7 2001/06/03 13:41:48 ecd Exp $
* linux/arch/sparc64/kernel/setup.c
*
* Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu)
@@ -65,6 +65,7 @@
#if CONFIG_SUN_CONSOLE
void (*prom_palette)(int);
#endif
+void (*prom_keyboard)(void);
asmlinkage void sys_sync(void); /* it's really int */
static void
@@ -620,6 +621,10 @@
extern int smp_bogo(char *);
extern int mmu_info(char *);
+#ifndef __SMP__
+unsigned int up_clock_tick;
+#endif
+
int get_cpuinfo(char *buffer)
{
int cpuid=smp_processor_id();
@@ -634,7 +639,8 @@
"ncpus probed\t: %d\n"
"ncpus active\t: %d\n"
#ifndef __SMP__
- "BogoMips\t: %lu.%02lu\n"
+ "Cpu0Bogo\t: %lu.%02lu\n"
+ "Cpu0ClkTck\t: %016lx\n"
#endif
,
sparc_cpu_type[cpuid],
@@ -642,7 +648,8 @@
prom_rev, prom_prev >> 16, (prom_prev >> 8) & 0xff, prom_prev & 0xff,
linux_num_cpus, smp_num_cpus
#ifndef __SMP__
- , loops_per_jiffy/(500000/HZ), (loops_per_jiffy/(5000/HZ)) % 100
+ , loops_per_jiffy/(500000/HZ), (loops_per_jiffy/(5000/HZ)) % 100,
+ (unsigned long) up_clock_tick
#endif
);
#ifdef __SMP__
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/kernel/signal.c linux.20p7/arch/sparc64/kernel/signal.c
--- linux.vanilla/arch/sparc64/kernel/signal.c Sun Mar 25 17:31:53 2001
+++ linux.20p7/arch/sparc64/kernel/signal.c Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: signal.c,v 1.38.2.1 1999/06/14 00:36:21 davem Exp $
+/* $Id: signal.c,v 1.38.2.2 2001/06/18 12:26:13 davem Exp $
* arch/sparc64/kernel/signal.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
@@ -850,7 +850,7 @@
if (!signr) break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
current->exit_code = signr;
current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD);
@@ -906,7 +906,7 @@
continue;
case SIGSTOP:
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
continue;
current->state = TASK_STOPPED;
current->exit_code = signr;
@@ -918,12 +918,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS:
- if(current->binfmt && current->binfmt->core_dump) {
- lock_kernel();
- if(current->binfmt->core_dump(signr, regs))
- exit_code |= 0x80;
- unlock_kernel();
- }
+ if (do_coredump(signr, regs))
+ exit_code |= 0x80;
#ifdef DEBUG_SIGNALS
/* Very useful to debug the dynamic linker */
printk ("Sig %d going...\n", (int)signr);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/kernel/signal32.c linux.20p7/arch/sparc64/kernel/signal32.c
--- linux.vanilla/arch/sparc64/kernel/signal32.c Sun Mar 25 17:31:52 2001
+++ linux.20p7/arch/sparc64/kernel/signal32.c Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: signal32.c,v 1.47.2.3 1999/12/20 01:14:06 davem Exp $
+/* $Id: signal32.c,v 1.47.2.4 2001/06/18 12:26:13 davem Exp $
* arch/sparc64/kernel/signal32.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
@@ -1279,7 +1279,7 @@
if (!signr) break;
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
current->exit_code = signr;
current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD);
@@ -1335,7 +1335,7 @@
continue;
case SIGSTOP:
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
continue;
current->state = TASK_STOPPED;
current->exit_code = signr;
@@ -1347,14 +1347,8 @@
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS:
- if(current->binfmt && current->binfmt->core_dump) {
- lock_kernel();
- if(current->binfmt &&
- current->binfmt->core_dump &&
- current->binfmt->core_dump(signr, regs))
- exit_code |= 0x80;
- unlock_kernel();
- }
+ if (do_coredump(signr, regs))
+ exit_code |= 0x80;
#ifdef DEBUG_SIGNALS
/* Very useful to debug dynamic linker problems */
printk ("Sig %ld going for %s[%d]...\n", signr, current->comm, current->pid);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/kernel/smp.c linux.20p7/arch/sparc64/kernel/smp.c
--- linux.vanilla/arch/sparc64/kernel/smp.c Sun Mar 25 17:31:53 2001
+++ linux.20p7/arch/sparc64/kernel/smp.c Wed Jul 4 16:03:53 2001
@@ -77,15 +77,17 @@
for (i = 0; i < NR_CPUS; i++)
if(cpu_present_map & (1UL << i))
len += sprintf(buf + len,
- "Cpu%dBogo\t: %lu.%02lu\n",
+ "Cpu%dBogo\t: %lu.%02lu\n"
+ "Cpu%dClkTck\t: %016lx\n",
i, cpu_data[i].udelay_val / (500000/HZ),
- (cpu_data[i].udelay_val / (5000/HZ)) % 100);
+ (cpu_data[i].udelay_val / (5000/HZ)) % 100,
+ i, (unsigned long) cpu_data[i].clock_tick);
return len;
}
__initfunc(void smp_store_cpu_info(int id))
{
- int i;
+ int i, no;
cpu_data[id].irq_count = 0;
cpu_data[id].bh_count = 0;
@@ -93,6 +95,13 @@
smp_setup_percpu_timer() */
cpu_data[id].udelay_val = loops_per_jiffy;
+
+ for (no = 0; no < linux_num_cpus; no++)
+ if (linux_cpus[no].mid == id)
+ break;
+
+ cpu_data[id].clock_tick = prom_getintdefault(linux_cpus[no].prom_node,
+ "clock-frequency", 0);
cpu_data[id].pgcache_size = 0;
cpu_data[id].pte_cache[0] = NULL;
cpu_data[id].pte_cache[1] = NULL;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/kernel/sparc64_ksyms.c linux.20p7/arch/sparc64/kernel/sparc64_ksyms.c
--- linux.vanilla/arch/sparc64/kernel/sparc64_ksyms.c Sun Mar 25 17:37:30 2001
+++ linux.20p7/arch/sparc64/kernel/sparc64_ksyms.c Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: sparc64_ksyms.c,v 1.58.2.13 2001/01/03 22:05:54 anton Exp $
+/* $Id: sparc64_ksyms.c,v 1.58.2.14 2001/03/01 00:48:59 davem Exp $
* arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/kernel/sys_sparc32.c linux.20p7/arch/sparc64/kernel/sys_sparc32.c
--- linux.vanilla/arch/sparc64/kernel/sys_sparc32.c Sun Mar 25 17:37:30 2001
+++ linux.20p7/arch/sparc64/kernel/sys_sparc32.c Wed Jul 4 16:13:56 2001
@@ -3002,6 +3002,7 @@
{
struct linux_binprm bprm;
struct dentry * dentry;
+ int was_dumpable;
int retval;
int i;
@@ -3029,6 +3030,9 @@
return bprm.envc;
}
+ was_dumpable = current->dumpable;
+ current->dumpable = 0;
+
retval = prepare_binprm(&bprm);
if(retval>=0) {
@@ -3042,9 +3046,12 @@
if (retval >= 0)
retval = search_binary_handler(&bprm,regs);
- if(retval>=0)
+
+ if (retval >= 0) {
/* execve success */
+ current->dumpable = bprm.dumpable;
return retval;
+ }
/* Something went wrong, return the inode and free the argument pages*/
if(bprm.dentry)
@@ -3052,7 +3059,10 @@
for (i=0 ; idumpable = was_dumpable;
+
+ return retval;
}
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/sparc64/solaris/entry64.S linux.20p7/arch/sparc64/solaris/entry64.S
--- linux.vanilla/arch/sparc64/solaris/entry64.S Sun Mar 25 17:31:53 2001
+++ linux.20p7/arch/sparc64/solaris/entry64.S Wed Jul 4 16:03:53 2001
@@ -1,4 +1,4 @@
-/* $Id: entry64.S,v 1.5 1998/03/26 08:46:15 jj Exp $
+/* $Id: entry64.S,v 1.5.2.1 2001/06/18 12:26:13 davem Exp $
* entry64.S: Solaris syscall emulation entry point.
*
* Copyright (C) 1996,1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -83,7 +83,7 @@
1: srl %i0, 0, %o0
lduw [%l7 + %l4], %l3
srl %i1, 0, %o1
- ldx [%g6 + AOFF_task_flags], %l5
+ ldx [%g6 + AOFF_task_ptrace], %l5
cmp %l3, NR_SYSCALLS
bleu,a,pn %xcc, linux_syscall_for_solaris
sethi %hi(sys_call_table32), %l6
@@ -93,21 +93,21 @@
10: srl %i2, 0, %o2
mov %i5, %o5
andn %l3, 3, %l7
- andcc %l5, 0x20, %g0
+ andcc %l5, 0x02, %g0
bne,pn %icc, solaris_syscall_trace
mov %i0, %l5
2: call %l7
srl %i3, 0, %o3
ret_from_solaris:
stx %o0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0]
- ldx [%g6 + AOFF_task_flags], %l6
+ ldx [%g6 + AOFF_task_ptrace], %l6
sra %o0, 0, %o0
mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE], %g3
cmp %o0, -ENOIOCTLCMD
sllx %g2, 32, %g2
bgeu,pn %xcc, 1f
- andcc %l6, 0x20, %l6
+ andcc %l6, 0x02, %l6
/* System call success, clear Carry condition code. */
andn %g3, %g2, %g3
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/block/Config.in linux.20p7/drivers/block/Config.in
--- linux.vanilla/drivers/block/Config.in Sun Mar 25 17:31:23 2001
+++ linux.20p7/drivers/block/Config.in Wed Jul 4 16:03:53 2001
@@ -140,7 +140,7 @@
tristate 'Compaq SMART2 support' CONFIG_BLK_CPQ_DA
fi
if [ "$CONFIG_PCI" = "y" ]; then
- tristate 'Compaq CISS Array support' CONFIG_BLK_CPQ_CISS_DA
+ tristate 'Compaq Smart Array 5xxx support' CONFIG_BLK_CPQ_CISS_DA
fi
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/block/cciss.c linux.20p7/drivers/block/cciss.c
--- linux.vanilla/drivers/block/cciss.c Sun Mar 25 17:31:24 2001
+++ linux.20p7/drivers/block/cciss.c Wed Jul 4 16:03:53 2001
@@ -42,12 +42,12 @@
#include
#define CCISS_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
-#define DRIVER_NAME "Compaq CISS Driver (v 1.0.0)"
-#define DRIVER_VERSION CCISS_DRIVER_VERSION(1,0,0)
+#define DRIVER_NAME "Compaq CISS Driver (v 1.0.4)"
+#define DRIVER_VERSION CCISS_DRIVER_VERSION(1,0,4)
/* Embedded module documentation macros - see modules.h */
MODULE_AUTHOR("Charles M. White III - Compaq Computer Corporation");
-MODULE_DESCRIPTION("Driver for Compaq Smart Array Controller 5300");
+MODULE_DESCRIPTION("Driver for Compaq Smart Array 5xxx Controllers ");
#include "cciss_cmd.h"
#include "cciss.h"
@@ -61,6 +61,8 @@
*/
static struct board_type products[] = {
{ 0x40700E11, "Smart Array 5300", &SA5_access },
+ { 0x40800E11, "Smart Array 5i", &SA5B_access},
+ { 0x40820E11, "Smart Array 532", &SA5B_access},
};
/* How long to wait (in millesconds) for board to go into simple mode */
@@ -135,10 +137,10 @@
ctlr = h->ctlr;
size = sprintf(buffer, "%s: Compaq %s Controller\n"
- " Board ID: %08lx\n"
+ " Board ID: 0x%08lx\n"
" Firmware Version: %c%c%c%c\n"
- " Memory Address: %08lx\n"
- " IRQ: 0x%x\n"
+ " Memory Address: 0x%08lx\n"
+ " IRQ: %d\n"
" Logical drives: %d\n"
" Current Q depth: %d\n"
" Current # commands on controller %d\n"
@@ -416,6 +418,8 @@
put_user(read_ahead[MAJOR(inode->i_rdev)], (int*)arg);
return 0;
case BLKRRPART:
+ if(!capable(CAP_SYS_ADMIN))
+ return -EPERM;
return revalidate_logvol(inode->i_rdev, 1);
case CCISS_GETPCIINFO:
@@ -719,7 +723,7 @@
spin_lock_irqsave(&io_request_lock, flags);
if (hba[ctlr]->drv[target].usage_count > maxusage) {
spin_unlock_irqrestore(&io_request_lock, flags);
- printk(KERN_WARNING "cpqarray: Device busy for "
+ printk(KERN_WARNING "cciss: Device busy for "
"revalidation (usage=%d)\n",
hba[ctlr]->drv[target].usage_count);
return -EBUSY;
@@ -730,7 +734,7 @@
max_p = gdev->max_p;
start = target << gdev->minor_shift;
- for(i=max_p; i>=0; i--) {
+ for(i=max_p-1; i>=0; i--) {
int minor = start+i;
kdev_t devi = MKDEV(MAJOR_NR + ctlr, minor);
struct super_block *sb = get_super(devi);
@@ -1125,7 +1129,7 @@
if (timeout)
status = 0;
if(cmd->err_info->CommandStatus != 0)
- { /* an error has occured */
+ { /* an error has occurred */
switch(cmd->err_info->CommandStatus)
{
case CMD_TARGET_STATUS:
@@ -1369,7 +1373,7 @@
a &= ~3;
if ((c = h->cmpQ) == NULL)
{
- printk(KERN_WARNING "cpqarray: Completion of %08lx ignored\n", (unsigned long)a1);
+ printk(KERN_WARNING "cciss: Completion of %08lx ignored\n", (unsigned long)a1);
continue;
}
while(c->busaddr != a) {
@@ -1437,7 +1441,7 @@
printk(" Heartbeat Counter = 0x%x\n\n\n",
readl(&(tb->HeartBeat)));
}
-#endif /* CCISS_DEBUG */
+#endif /* CCISS_DEBUG */
static int cciss_pci_init(ctlr_info_t *c, unchar bus, unchar device_fn)
{
@@ -1447,7 +1451,9 @@
uint addr[6];
__u32 board_id;
struct pci_dev *pdev;
-
+ int cfg_offset;
+ int cfg_base_addr;
+ int cfg_base_addr_index;
int i;
pdev = pci_find_slot(bus, device_fn);
@@ -1487,15 +1493,36 @@
* Memory base addr is first addr , the second points to the config
* table
*/
- c->paddr = addr[0];
- c->vaddr = remap_pci_mem(c->paddr, 128);
- c->cfgtable = (CfgTable_struct *) remap_pci_mem(addr[1],
- sizeof(CfgTable_struct));
- c->board_id = board_id;
+ c->paddr = addr[0] & 0xfffffff0; /* remove the addressing mode bits */
+#ifdef CCISS_DEBUG
+ printk("address 0 = %x\n", c->paddr);
+#endif /* CCISS_DEBUG */
+ c->vaddr = remap_pci_mem(c->paddr, 200);
+ /* get the address index number */
+ cfg_base_addr = readl(c->vaddr + SA5_CTCFG_OFFSET);
+ /* I am not prepared to deal with a 64 bit address value */
+ cfg_base_addr &= 0xffff;
#ifdef CCISS_DEBUG
- print_cfg_table(c->cfgtable);
+ printk("cfg base address = %x\n", cfg_base_addr);
+#endif /* CCISS_DEBUG */
+ cfg_base_addr_index = (cfg_base_addr - PCI_BASE_ADDRESS_0)/4;
+#ifdef CCISS_DEBUG
+ printk("cfg base address index = %x\n", cfg_base_addr_index);
+#endif /* CCISS_DEBUG */
+
+ cfg_offset = readl(c->vaddr + SA5_CTMEM_OFFSET);
+#ifdef CCISS_DEBUG
+ printk("cfg offset = %x\n", cfg_offset);
#endif /* CCISS_DEBUG */
+ c->cfgtable = (CfgTable_struct *)
+ remap_pci_mem((addr[cfg_base_addr_index] & 0xfffffff0)
+ + cfg_offset, sizeof(CfgTable_struct));
+ c->board_id = board_id;
+
+#ifdef CCISS_DEBUG
+ print_cfg_table(c->cfgtable);
+#endif CCISS_DEBUG
for(i=0; iproduct_name = products[i].product_name;
@@ -1509,6 +1536,14 @@
(unsigned long)board_id);
return -1;
}
+ if ( (readb(&c->cfgtable->Signature[0]) != 'C') ||
+ (readb(&c->cfgtable->Signature[1]) != 'I') ||
+ (readb(&c->cfgtable->Signature[2]) != 'S') ||
+ (readb(&c->cfgtable->Signature[3]) != 'S') )
+ {
+ printk("Does not appear to be a valid CISS config table\n");
+ return -1;
+ }
#ifdef CCISS_DEBUG
printk("Trying to put board into Simple mode\n");
#endif /* CCISS_DEBUG */
@@ -1550,14 +1585,22 @@
int index;
unchar bus=0, dev_fn=0;
-
+
+ #define CCISS_BOARD_TYPES 2
+ static int cciss_device_id[CCISS_BOARD_TYPES] = {
+ PCI_DEVICE_ID_COMPAQ_CISS, PCI_DEVICE_ID_COMPAQ_CISSB};
+ int brdtype;
+
+ /* search for all PCI board types that could be for this driver */
+ for(brdtype=0; brdtypevaddr + SA5_REPLY_INTR_MASK_OFFSET);
+ } else /* Turn them off */
+ {
+ writel( SA5B_INTR_OFF,
+ h->vaddr + SA5_REPLY_INTR_MASK_OFFSET);
+ }
+}
+/*
* Returns true if fifo is full.
*
*/
@@ -183,6 +204,21 @@
return 0 ;
}
+/*
+ * Returns true if an interrupt is pending..
+ */
+static unsigned long SA5B_intr_pending(ctlr_info_t *h)
+{
+ unsigned long register_value =
+ readl(h->vaddr + SA5_INTR_STATUS);
+#ifdef CCISS_DEBUG
+ printk("cciss: intr_pending %lx\n", register_value);
+#endif /* CCISS_DEBUG */
+ if( register_value & SA5B_INTR_PENDING)
+ return 1;
+ return 0 ;
+}
+
static struct access_method SA5_access = {
SA5_submit_command,
@@ -190,6 +226,14 @@
SA5_fifo_full,
SA5_intr_pending,
SA5_completed,
+};
+
+static struct access_method SA5B_access = {
+ SA5_submit_command,
+ SA5B_intr_mask,
+ SA5_fifo_full,
+ SA5B_intr_pending,
+ SA5_completed,
};
struct board_type {
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/block/cciss_cmd.h linux.20p7/drivers/block/cciss_cmd.h
--- linux.vanilla/drivers/block/cciss_cmd.h Sun Mar 25 17:31:24 2001
+++ linux.20p7/drivers/block/cciss_cmd.h Wed Jul 4 16:03:53 2001
@@ -125,20 +125,20 @@
//Command List Structure
typedef union _SCSI3Addr_struct {
struct {
+ BYTE Dev;
BYTE Bus:6;
BYTE Mode:2; // b00
- BYTE Dev;
} PeripDev;
struct {
+ BYTE DevLSB;
BYTE DevMSB:6;
BYTE Mode:2; // b01
- BYTE DevLSB;
} LogDev;
struct {
- BYTE Targ:6;
- BYTE Mode:2; // b10
BYTE Dev:5;
BYTE Bus:3;
+ BYTE Targ:6;
+ BYTE Mode:2; // b10
} LogUnit;
} SCSI3Addr_struct;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/block/cpqarray.c linux.20p7/drivers/block/cpqarray.c
--- linux.vanilla/drivers/block/cpqarray.c Sun Mar 25 17:31:24 2001
+++ linux.20p7/drivers/block/cpqarray.c Wed Jul 4 16:03:53 2001
@@ -41,8 +41,8 @@
#define SMART2_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
-#define DRIVER_NAME "Compaq SMART2 Driver (v 1.0.11)"
-#define DRIVER_VERSION SMART2_DRIVER_VERSION(1,0,11)
+#define DRIVER_NAME "Compaq SMART2 Driver (v 1.0.12)"
+#define DRIVER_VERSION SMART2_DRIVER_VERSION(1,0,12)
/* Embedded module documentation macros - see modules.h */
/* Original author Chris Frantz - Compaq Computer Corporation */
@@ -1167,6 +1167,8 @@
put_user(read_ahead[MAJOR(inode->i_rdev)], (int*)arg);
return 0;
case BLKRRPART:
+ if(!capable(CAP_SYS_ADMIN))
+ return -EPERM;
return revalidate_logvol(inode->i_rdev, 1);
case IDAPASSTHRU:
if (!suser()) return -EPERM;
@@ -1556,7 +1558,7 @@
max_p = gdev->max_p;
start = target << gdev->minor_shift;
- for(i=max_p; i>=0; i--) {
+ for(i=max_p-1; i>=0; i--) {
int minor = start+i;
kdev_t devi = MKDEV(MAJOR_NR + ctlr, minor);
struct super_block *sb = get_super(devi);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/block/genhd.c linux.20p7/drivers/block/genhd.c
--- linux.vanilla/drivers/block/genhd.c Sun Mar 25 17:37:30 2001
+++ linux.20p7/drivers/block/genhd.c Wed Jul 4 16:03:53 2001
@@ -336,7 +336,8 @@
goto done; /* nothing left to do */
hd->part[current_minor].nr_sects = NR_SECTS(p) * sector_size; /* JSt */
- hd->part[current_minor].start_sect = first_sector + START_SECT(p) * sector_size;
+ hd->part[current_minor].start_sect =
+ first_sector + START_SECT(p) * sector_size;
this_sector = first_sector + START_SECT(p) * sector_size;
dev = MKDEV(hd->major, current_minor);
brelse(bh);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/block/ide-cd.c linux.20p7/drivers/block/ide-cd.c
--- linux.vanilla/drivers/block/ide-cd.c Sun Mar 25 17:31:23 2001
+++ linux.20p7/drivers/block/ide-cd.c Wed Jul 4 16:03:53 2001
@@ -254,7 +254,7 @@
* They will disappear later when I get the time to
* do it cleanly.
* - Minimize the TOC reading - only do it when we
- * know a media change has occured.
+ * know a media change has occurred.
* - Moved all the CDROMREADx ioctls to the Uniform layer.
* - Heiko Eissfeldt supplied
* some fixes for CDI.
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/block/ide-dma.c linux.20p7/drivers/block/ide-dma.c
--- linux.vanilla/drivers/block/ide-dma.c Sun Mar 25 17:31:24 2001
+++ linux.20p7/drivers/block/ide-dma.c Wed Jul 4 16:03:53 2001
@@ -217,6 +217,20 @@
xcount = bcount & 0xffff;
if (is_trm290_chipset)
xcount = ((xcount >> 2) - 1) << 16;
+ if (xcount == 0x0000) {
+ /*
+ * Most chipsets correctly interpret a length of 0x0000 as 64KB,
+ * but at least one (e.g. CS5530) misinterprets it as zero (!).
+ * So here we break the 64KB entry into two 32KB entries instead.
+ */
+ if (count++ >= PRD_ENTRIES) {
+ printk("%s: DMA table too small\n", drive->name);
+ return 0; /* revert to PIO for this request */
+ }
+ *table++ = cpu_to_le32(0x8000);
+ *table++ = cpu_to_le32(addr + 0x8000);
+ xcount = 0x8000;
+ }
*table++ = cpu_to_le32(xcount);
addr += bcount;
size -= bcount;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/block/ide-floppy.c linux.20p7/drivers/block/ide-floppy.c
--- linux.vanilla/drivers/block/ide-floppy.c Sun Mar 25 17:31:24 2001
+++ linux.20p7/drivers/block/ide-floppy.c Wed Jul 4 16:03:54 2001
@@ -125,7 +125,7 @@
byte *current_position; /* Pointer into the above buffer */
void (*callback) (ide_drive_t *); /* Called when this packet command is completed */
byte pc_buffer[IDEFLOPPY_PC_BUFFER_SIZE]; /* Temporary buffer */
- unsigned int flags; /* Status/Action bit flags */
+ unsigned long flags; /* Status/Action bit flags */
} idefloppy_pc_t;
/*
@@ -259,7 +259,7 @@
idefloppy_flexible_disk_page_t flexible_disk_page; /* Copy of the flexible disk page */
int wp; /* Write protect */
- unsigned int flags; /* Status/Action flags */
+ unsigned long flags; /* Status/Action flags */
} idefloppy_floppy_t;
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/block/ide-pmac.c linux.20p7/drivers/block/ide-pmac.c
--- linux.vanilla/drivers/block/ide-pmac.c Sun Mar 25 17:37:30 2001
+++ linux.20p7/drivers/block/ide-pmac.c Wed Jul 4 16:03:54 2001
@@ -97,7 +97,7 @@
/* Wait 2s for disk to answer on IDE bus after
* enable operation.
* NOTE: There is at least one case I know of a disk that needs about 10sec
- * before anwering on the bus. I beleive we could add a kernel command
+ * before anwering on the bus. I believe we could add a kernel command
* line arg to override this delay for such cases.
*/
#define IDE_WAKEUP_DELAY_MS 2000
@@ -192,9 +192,10 @@
}
#endif
-/* Setup timings for the selected drive (master/slave). I still need to verify if this
- * is enough, I beleive selectproc will be called whenever an IDE command is started,
- * but... */
+/* Setup timings for the selected drive (master/slave). I still need to
+ * verify if this is enough, I believe selectproc will be called whenever
+ * an IDE command is started, but...
+ */
static void
pmac_ide_selectproc(ide_drive_t *drive)
{
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/block/ide.c linux.20p7/drivers/block/ide.c
--- linux.vanilla/drivers/block/ide.c Sun Mar 25 17:31:24 2001
+++ linux.20p7/drivers/block/ide.c Wed Jul 4 16:03:54 2001
@@ -1298,9 +1298,10 @@
del_timer(&hwgroup->timer);
if ((handler = hwgroup->handler) == NULL) {
/*
- * Either a marginal timeout occured (got the interrupt just as timer expired),
- * or we were "sleeping" to give other devices a chance. Either way, we don't
- * really want to complain about anything.
+ * Either a marginal timeout occurred (got the interrupt
+ * just as timer expired), or we were "sleeping" to give
+ * other devices a chance. Either way, we don't really
+ * want to complain about anything.
*/
if (hwgroup->sleeping) {
hwgroup->sleeping = 0;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/cdrom/cdrom.c linux.20p7/drivers/cdrom/cdrom.c
--- linux.vanilla/drivers/cdrom/cdrom.c Sun Mar 25 18:44:42 2001
+++ linux.20p7/drivers/cdrom/cdrom.c Wed Jul 4 16:03:54 2001
@@ -514,12 +514,12 @@
couldn't close the tray. We only care
that there is no disc in the drive,
since that is the _REAL_ problem here.*/
- ret=-ENOMEDIUM;
+ ret = -ENOMEDIUM;
goto clean_up_and_return;
}
} else {
cdinfo(CD_OPEN, "bummer. this drive can't close the tray.\n");
- ret=-ENOMEDIUM;
+ ret = -ENOMEDIUM;
goto clean_up_and_return;
}
/* Ok, the door should be closed now.. Check again */
@@ -527,7 +527,7 @@
if ((ret == CDS_NO_DISC) || (ret==CDS_TRAY_OPEN)) {
cdinfo(CD_OPEN, "bummer. the tray is still not closed.\n");
cdinfo(CD_OPEN, "tray might not contain a medium.\n");
- ret=-ENOMEDIUM;
+ ret = -ENOMEDIUM;
goto clean_up_and_return;
}
cdinfo(CD_OPEN, "the tray is now closed.\n");
@@ -540,7 +540,7 @@
cdrom_count_tracks(cdi, &tracks);
if (tracks.error == CDS_NO_DISC) {
cdinfo(CD_OPEN, "bummer. no disc.\n");
- ret=-ENOMEDIUM;
+ ret = -ENOMEDIUM;
goto clean_up_and_return;
}
/* CD-Players which don't use O_NONBLOCK, workman
@@ -1952,6 +1952,7 @@
ra.buf += (CD_FRAMESIZE_RAW * frames);
ra.nframes -= frames;
lba += frames;
+ if (frames>ra.nframes) frames=ra.nframes;
}
kfree(cgc.buffer);
return ret;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/Config.in linux.20p7/drivers/char/Config.in
--- linux.vanilla/drivers/char/Config.in Sun Mar 25 17:37:30 2001
+++ linux.20p7/drivers/char/Config.in Wed Jul 4 16:03:54 2001
@@ -53,8 +53,8 @@
tristate ' Stallion EasyIO or EC8/32 support' CONFIG_STALLION
tristate ' Stallion EC8/64, ONboard, Brumby support' CONFIG_ISTALLION
fi
- dep_tristate 'Microgate SyncLink card support' CONFIG_SYNCLINK m
- dep_tristate 'HDLC line discipline support' CONFIG_N_HDLC m
+ tristate 'Microgate SyncLink card support' CONFIG_SYNCLINK
+ tristate 'HDLC line discipline support' CONFIG_N_HDLC
fi
bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS
if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then
@@ -114,6 +114,7 @@
fi
fi
tristate ' WDT PCI Watchdog timer' CONFIG_WDTPCI
+ tristate ' ZF MachZ Watchdog' CONFIG_MACHZ_WDT
endmenu
fi
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/Makefile linux.20p7/drivers/char/Makefile
--- linux.vanilla/drivers/char/Makefile Sun Mar 25 17:37:30 2001
+++ linux.20p7/drivers/char/Makefile Wed Jul 4 16:03:54 2001
@@ -184,12 +184,20 @@
endif
endif
-ifeq ($(CONFIG_SYNCLINK),m)
+ifeq ($(CONFIG_SYNCLINK),y)
+O_OBJS += synclink.o
+else
+ ifeq ($(CONFIG_SYNCLINK),m)
M_OBJS += synclink.o
+ endif
endif
-ifeq ($(CONFIG_N_HDLC),m)
+ifeq ($(CONFIG_N_HDLC),y)
+O_OBJS += n_hdlc.o
+else
+ ifeq ($(CONFIG_N_HDLC),m)
M_OBJS += n_hdlc.o
+ endif
endif
ifeq ($(CONFIG_SPECIALIX),y)
@@ -370,6 +378,14 @@
else
ifeq ($(CONFIG_WDTPCI),m)
M_OBJS += wdt_pci.o
+ endif
+endif
+
+ifeq ($(CONFIG_MACHZ_WDT),y)
+O_OBJS += machzwd.o
+else
+ ifeq ($(CONFIG_MACHZ_WDT),m)
+ M_OBJS += machzwd.o
endif
endif
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/agp/agpgart_fe.c linux.20p7/drivers/char/agp/agpgart_fe.c
--- linux.vanilla/drivers/char/agp/agpgart_fe.c Sun Mar 25 17:31:28 2001
+++ linux.20p7/drivers/char/agp/agpgart_fe.c Wed Jul 4 16:03:54 2001
@@ -867,7 +867,7 @@
return -ENOMEM;
}
if (copy_from_user(segment, (void *) reserve.seg_list,
- GFP_KERNEL)) {
+ sizeof(agp_segment) * reserve.seg_count)) {
kfree(segment);
return -EFAULT;
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/atari_SCC.README linux.20p7/drivers/char/atari_SCC.README
--- linux.vanilla/drivers/char/atari_SCC.README Sun Mar 25 17:31:28 2001
+++ linux.20p7/drivers/char/atari_SCC.README Wed Jul 4 16:03:54 2001
@@ -96,7 +96,7 @@
If you should see a message like:
-Sep 26 10:39:32 zaphod kernel: SCC-A: DMA-INT occured, data lost!
+Sep 26 10:39:32 zaphod kernel: SCC-A: DMA-INT occurred, data lost!
that means that the timer routine itself has been delayed so long that the DMA
counter went to zero already. There's not very much to do about this, because
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/atari_SCC.c linux.20p7/drivers/char/atari_SCC.c
--- linux.vanilla/drivers/char/atari_SCC.c Sun Mar 25 17:31:28 2001
+++ linux.20p7/drivers/char/atari_SCC.c Wed Jul 4 16:03:54 2001
@@ -1453,11 +1453,11 @@
}
-/* DMA finished before timer occured?
+/* DMA finished before timer occurred?
*/
static void SCC_dma_int (int irq, void *data, struct pt_regs *fp)
{
- printk ("SCC-A: DMA-INT occured, data lost!\n");
+ printk ("SCC-A: DMA-INT occurred, data lost!\n");
#if 0
/* is there any reason why we should call this? if the timer INT was
* delayed so long that this happened then this INT was delayed too, so
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/cyclades.c linux.20p7/drivers/char/cyclades.c
--- linux.vanilla/drivers/char/cyclades.c Sun Mar 25 17:31:25 2001
+++ linux.20p7/drivers/char/cyclades.c Wed Jul 4 16:03:54 2001
@@ -149,7 +149,7 @@
* Revision 2.2.1.4 1998/08/04 11:02:50 ivan
* /proc/cyclades implementation with great collaboration of
* Marc Lewis ;
- * cyy_interrupt was changed to avoid occurence of kernel oopses
+ * cyy_interrupt was changed to avoid occurrence of kernel oopses
* during PPP operation.
*
* Revision 2.2.1.3 1998/06/01 12:09:10 ivan
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/epca.c linux.20p7/drivers/char/epca.c
--- linux.vanilla/drivers/char/epca.c Sun Mar 25 17:31:26 2001
+++ linux.20p7/drivers/char/epca.c Wed Jul 4 16:03:54 2001
@@ -953,7 +953,7 @@
Remember copy_from_user WILL generate a page fault if the
user memory being accessed has been swapped out. This can
cause this routine to temporarily sleep while this page
- fault is occuring.
+ fault is occurring.
----------------------------------------------------------------- */
@@ -3601,7 +3601,7 @@
/* ------------------------------------------------------------------
The below routines pc_throttle and pc_unthrottle are used
to slow (And resume) the receipt of data into the kernels
- receive buffers. The exact occurence of this depends on the
+ receive buffers. The exact occurrence of this depends on the
size of the kernels receive buffer and what the 'watermarks'
are set to for that buffer. See the n_ttys.c file for more
details.
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/hfmodem/refclock.c linux.20p7/drivers/char/hfmodem/refclock.c
--- linux.vanilla/drivers/char/hfmodem/refclock.c Sun Mar 25 17:31:26 2001
+++ linux.20p7/drivers/char/hfmodem/refclock.c Wed Jul 4 16:03:54 2001
@@ -133,7 +133,7 @@
"subl %2,%%eax\n\t"
"sbbl %3,%%edx\n\t" : "=&a" (tmp0), "=&d" (tmp1)
: "m" (dev->clk.starttime_lo), "m" (dev->clk.starttime_hi));
- __asm__("mull %2" : "=d" (tmp2), "=a" (tmp4) : "m" (scale_rdtsc), "1" (tmp0) : "ax");
+ __asm__("mull %2" : "=d" (tmp2), "=a" (tmp4) : "m" (scale_rdtsc), "1" (tmp0));
__asm__("mull %1" : "=a" (tmp3) : "m" (scale_rdtsc), "a" (tmp1) : "dx");
curtime = tmp2 + tmp3;
goto time_known;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/hfmodem/tables.h linux.20p7/drivers/char/hfmodem/tables.h
--- linux.vanilla/drivers/char/hfmodem/tables.h Thu Jan 1 01:00:00 1970
+++ linux.20p7/drivers/char/hfmodem/tables.h Wed Jul 4 16:17:17 2001
@@ -0,0 +1,90 @@
+/*
+ * This file is automatically generated by ./gentbl, DO NOT EDIT!
+*/
+
+#define SINTABBITS 9
+#define SINTABSIZE (1<
+ Copyright 2000,2001 Jeff Garzik
+ Copyright 2000,2001 Philipp Rumpf
- Driver Web site: http://gtf.org/garzik/drivers/i810_rng/
+ Driver Web site: http://sourceforge.net/projects/gkernel/
-
-
- Based on:
- Intel 82802AB/82802AC Firmware Hub (FWH) Datasheet
- May 1999 Order Number: 290658-002 R
-
- Intel 82802 Firmware Hub: Random Number Generator
- Programmer's Reference Manual
- December 1999 Order Number: 298029-001 R
-
- Intel 82802 Firmware HUB Random Number Generator Driver
- Copyright (c) 2000 Matt Sottek
-
- Special thanks to Matt Sottek. I did the "guts", he
- did the "brains" and all the testing. (Anybody wanna send
- me an i810 or i820?)
+ Please read Documentation/i810_rng.txt for details on use.
----------------------------------------------------------
This software may be used and distributed according to the terms
- of the GNU Public License, incorporated herein by reference.
-
- ----------------------------------------------------------
-
- From the firmware hub datasheet:
-
- The Firmware Hub integrates a Random Number Generator (RNG)
- using thermal noise generated from inherently random quantum
- mechanical properties of silicon. When not generating new random
- bits the RNG circuitry will enter a low power state. Intel will
- provide a binary software driver to give third party software
- access to our RNG for use as a security feature. At this time,
- the RNG is only to be used with a system in an OS-present state.
-
- ----------------------------------------------------------
-
- Theory of operation:
-
- Character driver. Using the standard open()
- and read() system calls, you can read random data from
- the i810 RNG device. This data is NOT CHECKED by any
- fitness tests, and could potentially be bogus (if the
- hardware is faulty or has been tampered with).
-
- /dev/intel_rng is char device major 10, minor 183.
-
-
- ----------------------------------------------------------
-
- Driver notes:
-
- * In order to unload the i810_rng module, you must first
- make sure all users of the character device have closed
-
- * FIXME: Currently only one open() of the character device is allowed.
- If another user tries to open() the device, they will get an
- -EBUSY error. Instead, this really should either support
- multiple simultaneous users of the character device (not hard),
- or simply block open() until the current user of the chrdev
- calls close().
-
- * FIXME: support poll()
-
- * FIXME: should we be crazy and support mmap()?
-
- ----------------------------------------------------------
+ of the GNU General Public License, incorporated herein by reference.
*/
@@ -80,20 +21,19 @@
#include
#include
#include
-#include
#include
-#include
#include
#include
#include
#include
+#include
/*
* core module and version information
*/
-#define RNG_VERSION "0.6.2-2.2.x"
+#define RNG_VERSION "0.9.6-2.2"
#define RNG_MODULE_NAME "i810_rng"
#define RNG_DRIVER_NAME RNG_MODULE_NAME " hardware driver " RNG_VERSION
#define PFX RNG_MODULE_NAME ": "
@@ -102,7 +42,7 @@
/*
* debugging macros
*/
-#undef RNG_DEBUG /* define to 1 to enable copious debugging info */
+#undef RNG_DEBUG /* define to enable copious debugging info */
#ifdef RNG_DEBUG
/* note: prints function name for you */
@@ -111,8 +51,8 @@
#define DPRINTK(fmt, args...)
#endif
-#define RNG_NDEBUG 0 /* define to 1 to disable lightweight runtime checks */
-#if RNG_NDEBUG
+#undef RNG_NDEBUG /* define to disable lightweight runtime checks */
+#ifdef RNG_NDEBUG
#define assert(expr)
#else
#define assert(expr) \
@@ -124,12 +64,6 @@
/*
- * misc helper macros
- */
-#define arraysize(x) (sizeof(x)/sizeof(*(x)))
-
-
-/*
* RNG registers (offsets from rng_mem)
*/
#define RNG_HW_STATUS 0
@@ -139,22 +73,21 @@
#define RNG_DATA_PRESENT 0x01
#define RNG_DATA 2
+/*
+ * Magic address at which Intel PCI bridges locate the RNG
+ */
#define RNG_ADDR 0xFFBC015F
#define RNG_ADDR_LEN 3
#define RNG_MISCDEV_MINOR 183 /* official */
-
/*
* various RNG status variables. they are globals
* as we only support a single RNG device
*/
-static int rng_allocated; /* is someone using the RNG region? */
-static int rng_hw_enabled; /* is the RNG h/w enabled? */
-static int rng_use_count; /* number of times RNG has been enabled */
static void *rng_mem; /* token to our ioremap'd RNG register area */
-static spinlock_t rng_lock = SPIN_LOCK_UNLOCKED; /* hardware lock */
-static int rng_open; /* boolean, 0 (false) if chrdev is closed, 1 (true) if open */
+static struct semaphore rng_open_sem; /* Semaphore for serializing rng_open/release */
+
/*
* inlined helper functions for accessing RNG registers
@@ -165,18 +98,17 @@
return readb (rng_mem + RNG_HW_STATUS);
}
-
-static inline void rng_hwstatus_set (u8 hw_status)
+static inline u8 rng_hwstatus_set (u8 hw_status)
{
assert (rng_mem != NULL);
writeb (hw_status, rng_mem + RNG_HW_STATUS);
+ return rng_hwstatus ();
}
static inline int rng_data_present (void)
{
assert (rng_mem != NULL);
- assert (rng_hw_enabled == 1);
return (readb (rng_mem + RNG_STATUS) & RNG_DATA_PRESENT) ? 1 : 0;
}
@@ -185,176 +117,157 @@
static inline int rng_data_read (void)
{
assert (rng_mem != NULL);
- assert (rng_hw_enabled == 1);
return readb (rng_mem + RNG_DATA);
}
-
/*
- * rng_enable - enable or disable the RNG hardware
+ * rng_enable - enable the RNG hardware
*/
-static int rng_enable (int enable)
+
+static int rng_enable (void)
{
int rc = 0;
- u8 hw_status;
+ u8 hw_status, new_status;
DPRINTK ("ENTER\n");
- spin_lock (&rng_lock);
-
hw_status = rng_hwstatus ();
- if (enable) {
- rng_hw_enabled = 1;
- rng_use_count++;
- MOD_INC_USE_COUNT;
- } else {
- rng_use_count--;
- if (rng_use_count == 0)
- rng_hw_enabled = 0;
- MOD_DEC_USE_COUNT;
- }
+ if ((hw_status & RNG_ENABLED) == 0) {
+ new_status = rng_hwstatus_set (hw_status | RNG_ENABLED);
- if (rng_hw_enabled && ((hw_status & RNG_ENABLED) == 0)) {
- rng_hwstatus_set (hw_status | RNG_ENABLED);
- printk (KERN_INFO PFX "RNG h/w enabled\n");
+ if (new_status & RNG_ENABLED)
+ printk (KERN_INFO PFX "RNG h/w enabled\n");
+ else {
+ printk (KERN_ERR PFX "Unable to enable the RNG\n");
+ rc = -EIO;
+ }
}
- else if (!rng_hw_enabled && (hw_status & RNG_ENABLED)) {
- rng_hwstatus_set (hw_status & ~RNG_ENABLED);
- printk (KERN_INFO PFX "RNG h/w disabled\n");
- }
+ DPRINTK ("EXIT, returning %d\n", rc);
+ return rc;
+}
+
+/*
+ * rng_disable - disable the RNG hardware
+ */
- spin_unlock (&rng_lock);
+static void rng_disable(void)
+{
+ u8 hw_status, new_status;
+
+ DPRINTK ("ENTER\n");
+
+ hw_status = rng_hwstatus ();
- if ((!!enable) != (!!(rng_hwstatus () & RNG_ENABLED))) {
- printk (KERN_ERR PFX "Unable to %sable the RNG\n",
- enable ? "en" : "dis");
- rc = -EIO;
+ if (hw_status & RNG_ENABLED) {
+ new_status = rng_hwstatus_set (hw_status & ~RNG_ENABLED);
+
+ if ((new_status & RNG_ENABLED) == 0)
+ printk (KERN_INFO PFX "RNG h/w disabled\n");
+ else {
+ printk (KERN_ERR PFX "Unable to disable the RNG\n");
+ }
}
- DPRINTK ("EXIT, returning %d\n", rc);
- return rc;
+ DPRINTK ("EXIT\n");
}
-
static int rng_dev_open (struct inode *inode, struct file *filp)
{
- int rc = -EINVAL;
-
- MOD_INC_USE_COUNT;
+ int rc;
if ((filp->f_mode & FMODE_READ) == 0)
- goto err_out;
+ return -EINVAL;
if (filp->f_mode & FMODE_WRITE)
- goto err_out;
-
- spin_lock (&rng_lock);
+ return -EINVAL;
- /* only allow one open of this device, exit with -EBUSY if already open */
- /* FIXME: we should sleep on a semaphore here, unless O_NONBLOCK */
- if (rng_open) {
- spin_unlock (&rng_lock);
- rc = -EBUSY;
- goto err_out;
+ /* wait for device to become free */
+ if (filp->f_flags & O_NONBLOCK) {
+ if (down_trylock (&rng_open_sem))
+ return -EAGAIN;
+ } else {
+ if (down_interruptible (&rng_open_sem))
+ return -ERESTARTSYS;
}
- rng_open = 1;
-
- spin_unlock (&rng_lock);
-
- if (rng_enable(1) != 0) {
- spin_lock (&rng_lock);
- rng_open = 0;
- spin_unlock (&rng_lock);
- rc = -EIO;
- goto err_out;
+ rc = rng_enable ();
+ if (rc) {
+ up (&rng_open_sem);
+ return rc;
}
+ MOD_INC_USE_COUNT;
return 0;
-
-err_out:
- MOD_DEC_USE_COUNT;
- return rc;
}
static int rng_dev_release (struct inode *inode, struct file *filp)
{
-
- if (rng_enable(0) != 0)
- return -EIO;
-
- spin_lock (&rng_lock);
- rng_open = 0;
- spin_unlock (&rng_lock);
-
+ rng_disable ();
+ up (&rng_open_sem);
MOD_DEC_USE_COUNT;
return 0;
}
-static ssize_t rng_dev_read (struct file *filp, char * buf, size_t size,
- loff_t *offp)
+static ssize_t rng_dev_read (struct file *filp, char *buf, size_t size,
+ loff_t * offp)
{
- int have_data, copied = 0;
- u8 data=0;
- u8 *page;
-
- if (size < 1)
- return 0;
-
- page = (unsigned char *) get_free_page (GFP_KERNEL);
- if (!page)
- return -ENOMEM;
-
-read_loop:
- /* using the fact that read() can return >0 but
- * less than the requested amount, we simply
- * read up to PAGE_SIZE or buffer size, whichever
- * is smaller, and return that data.
- */
- if ((copied == size) || (copied == PAGE_SIZE)) {
- size_t tmpsize = (copied == size) ? size : PAGE_SIZE;
- int rc = copy_to_user (buf, page, tmpsize);
- free_page ((long)page);
- if (rc) return rc;
- return tmpsize;
- }
+ static spinlock_t rng_lock = SPIN_LOCK_UNLOCKED;
+ int have_data;
+ u8 data = 0;
+ ssize_t ret = 0;
- spin_lock (&rng_lock);
+ while (size) {
+ spin_lock (&rng_lock);
- have_data = 0;
- if (rng_data_present ()) {
- data = rng_data_read ();
- have_data = 1;
- }
+ have_data = 0;
+ if (rng_data_present ()) {
+ data = rng_data_read ();
+ have_data = 1;
+ }
- spin_unlock (&rng_lock);
+ spin_unlock (&rng_lock);
- if (have_data) {
- page[copied] = data;
- copied++;
- } else {
- if (filp->f_flags & O_NONBLOCK) {
- free_page ((long)page);
- return -EAGAIN;
+ if (have_data) {
+ if (put_user (data, buf++)) {
+ ret = ret ? : -EFAULT;
+ break;
+ }
+ size--;
+ ret++;
}
- }
- if (current->need_resched)
- schedule ();
+ if (filp->f_flags & O_NONBLOCK)
+ return ret ? : -EAGAIN;
+
+ current->state = TASK_INTERRUPTIBLE;
+ schedule_timeout(1);
- if (signal_pending (current)) {
- free_page ((long)page);
- return -ERESTARTSYS;
+ if (signal_pending (current))
+ return ret ? : -ERESTARTSYS;
}
- goto read_loop;
+ return ret;
}
+static struct file_operations rng_chrdev_ops = {
+ open: rng_dev_open,
+ release: rng_dev_release,
+ read: rng_dev_read,
+};
+
+
+static struct miscdevice rng_miscdev = {
+ RNG_MISCDEV_MINOR,
+ RNG_MODULE_NAME,
+ &rng_chrdev_ops,
+};
+
+
/*
* rng_init_one - look for and attempt to init a single RNG
*/
@@ -365,10 +278,11 @@
DPRINTK ("ENTER\n");
- if (rng_allocated) {
- printk (KERN_ERR PFX "this driver only supports one RNG\n");
- DPRINTK ("EXIT, returning -EBUSY\n");
- return -EBUSY;
+ rc = misc_register (&rng_miscdev);
+ if (rc) {
+ printk (KERN_ERR PFX "cannot register misc device\n");
+ DPRINTK ("EXIT, returning %d\n", rc);
+ goto err_out;
}
rng_mem = ioremap (RNG_ADDR, RNG_ADDR_LEN);
@@ -376,7 +290,7 @@
printk (KERN_ERR PFX "cannot ioremap RNG Memory\n");
DPRINTK ("EXIT, returning -EBUSY\n");
rc = -EBUSY;
- goto err_out;
+ goto err_out_free_miscdev;
}
/* Check for Intel 82802 */
@@ -385,80 +299,59 @@
printk (KERN_ERR PFX "RNG not detected\n");
DPRINTK ("EXIT, returning -ENODEV\n");
rc = -ENODEV;
- goto err_out;
+ goto err_out_free_map;
}
- rng_allocated = 1;
-
- rc = rng_enable (0);
- if (rc) {
+ /* turn RNG h/w off, if it's on */
+ if (hw_status & RNG_ENABLED)
+ hw_status = rng_hwstatus_set (hw_status & ~RNG_ENABLED);
+ if (hw_status & RNG_ENABLED) {
printk (KERN_ERR PFX "cannot disable RNG, aborting\n");
- goto err_out;
+ goto err_out_free_map;
}
DPRINTK ("EXIT, returning 0\n");
return 0;
+err_out_free_map:
+ iounmap (rng_mem);
+err_out_free_miscdev:
+ misc_deregister (&rng_miscdev);
err_out:
- if (rng_mem)
- iounmap (rng_mem);
return rc;
}
-/*
- * Data for PCI driver interface
- */
-
-MODULE_AUTHOR("Jeff Garzik, Matt Sottek");
+MODULE_AUTHOR("Jeff Garzik, Philipp Rumpf, Matt Sottek");
MODULE_DESCRIPTION("Intel i8xx chipset Random Number Generator (RNG) driver");
-static struct file_operations rng_chrdev_ops = {
- open: rng_dev_open,
- release: rng_dev_release,
- read: rng_dev_read,
-};
-
-
-static struct miscdevice rng_miscdev = {
- RNG_MISCDEV_MINOR,
- RNG_MODULE_NAME,
- &rng_chrdev_ops,
-};
-
-
/*
* rng_init - initialize RNG module
*/
-int __init rng_init (void)
+static int __init rng_init (void)
{
int rc;
struct pci_dev *pdev;
-
- pdev = pci_find_device (0x8086, 0x2418, NULL);
- if (!pdev)
- pdev = pci_find_device (0x8086, 0x2428, NULL);
- if (!pdev)
- pdev = pci_find_device (0x8086, 0x1130, NULL);
- if (!pdev)
- return -ENODEV;
DPRINTK ("ENTER\n");
- rc = rng_init_one(pdev);
- if (rc) {
- DPRINTK ("EXIT, returning -ENODEV\n");
- return rc;
- }
+ init_MUTEX (&rng_open_sem);
- rc = misc_register (&rng_miscdev);
- if (rc) {
- if (rng_mem)
- iounmap (rng_mem);
- DPRINTK ("EXIT, returning %d\n", rc);
+ pdev = pci_find_device (0x8086, 0x2418, NULL);
+ if (pdev) goto match;
+ pdev = pci_find_device (0x8086, 0x2428, NULL);
+ if (pdev) goto match;
+ pdev = pci_find_device (0x8086, 0x1130, NULL);
+ if (pdev) goto match;
+
+ DPRINTK ("EXIT, returning -ENODEV\n");
+ return -ENODEV;
+
+match:
+ rc = rng_init_one (pdev);
+ if (rc)
return rc;
- }
printk (KERN_INFO RNG_DRIVER_NAME " loaded\n");
@@ -466,24 +359,21 @@
return 0;
}
-#ifdef MODULE
-
-int init_module (void) { return rng_init (); }
/*
* rng_init - shutdown RNG module
*/
-void cleanup_module (void)
+static void rng_cleanup (void)
{
DPRINTK ("ENTER\n");
-
- iounmap (rng_mem);
-
- rng_hwstatus_set (rng_hwstatus() & ~RNG_ENABLED);
misc_deregister (&rng_miscdev);
+ iounmap (rng_mem);
+
DPRINTK ("EXIT\n");
}
-#endif /* MODULE */
+
+module_init (rng_init);
+module_exit (rng_cleanup);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/lp.c linux.20p7/drivers/char/lp.c
--- linux.vanilla/drivers/char/lp.c Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/char/lp.c Wed Jul 4 16:03:54 2001
@@ -306,7 +306,7 @@
}
/*
* NOTE: if you run with irqs you _must_ use
- * `tunelp /dev/lp? -c 1' to be rasonable efficient!
+ * `tunelp /dev/lp? -c 1' to be reasonably efficient!
*
* ..but beware that data corruption can happen that way. -Tim
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/machzwd.c linux.20p7/drivers/char/machzwd.c
--- linux.vanilla/drivers/char/machzwd.c Thu Jan 1 01:00:00 1970
+++ linux.20p7/drivers/char/machzwd.c Wed Jul 4 16:03:54 2001
@@ -0,0 +1,545 @@
+/*
+ * MachZ ZF-Logic Watchdog Timer driver for Linux
+ *
+ *
+ * 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.
+ *
+ * The author does NOT admit liability nor provide warranty for
+ * any of this software. This material is provided "AS-IS" in
+ * the hope that it may be useful for others.
+ *
+ * Author: Fernando Fuganti
+ *
+ * Based on sbc60xxwdt.c by Jakob Oestergaard
+ *
+ *
+ * We have two timers (wd#1, wd#2) driven by a 32 KHz clock with the
+ * following periods:
+ * wd#1 - 2 seconds;
+ * wd#2 - 7.2 ms;
+ * After the expiration of wd#1, it can generate a NMI, SCI, SMI, or
+ * a system RESET and it starts wd#2 that unconditionaly will RESET
+ * the system when the counter reaches zero.
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+/* ports */
+#define ZF_IOBASE 0x218
+#define INDEX 0x218
+#define DATA_B 0x219
+#define DATA_W 0x21A
+#define DATA_D 0x21A
+
+/* indexes */ /* size */
+#define ZFL_VERSION 0x02 /* 16 */
+#define CONTROL 0x10 /* 16 */
+#define STATUS 0x12 /* 8 */
+#define COUNTER_1 0x0C /* 16 */
+#define COUNTER_2 0x0E /* 8 */
+#define PULSE_LEN 0x0F /* 8 */
+
+/* controls */
+#define ENABLE_WD1 0x0001
+#define ENABLE_WD2 0x0002
+#define RESET_WD1 0x0010
+#define RESET_WD2 0x0020
+#define GEN_SCI 0x0100
+#define GEN_NMI 0x0200
+#define GEN_SMI 0x0400
+#define GEN_RESET 0x0800
+
+
+/* utilities */
+
+#define WD1 0
+#define WD2 1
+
+#define zf_writew(port, data) { outb(port, INDEX); outw(data, DATA_W); }
+#define zf_writeb(port, data) { outb(port, INDEX); outb(data, DATA_B); }
+#define zf_get_ZFL_version() zf_readw(ZFL_VERSION)
+
+
+static unsigned short zf_readw(unsigned char port)
+{
+ outb(port, INDEX);
+ return inw(DATA_W);
+}
+
+static unsigned short zf_readb(unsigned char port)
+{
+ outb(port, INDEX);
+ return inb(DATA_B);
+}
+
+
+MODULE_AUTHOR("Fernando Fuganti ");
+MODULE_DESCRIPTION("MachZ ZF-Logic Watchdog driver");
+MODULE_PARM(action, "i");
+MODULE_PARM_DESC(action, "after watchdog resets, generate: 0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI");
+
+#define PFX "machzwd"
+
+static struct watchdog_info zf_info = {
+ options: WDIOF_KEEPALIVEPING,
+ firmware_version: 1,
+ identity: "ZF-Logic watchdog"
+};
+
+
+/*
+ * action refers to action taken when watchdog resets
+ * 0 = GEN_RESET
+ * 1 = GEN_SMI
+ * 2 = GEN_NMI
+ * 3 = GEN_SCI
+ * defaults to GEN_RESET (0)
+ */
+static int action = 0;
+static int zf_action = GEN_RESET;
+static int zf_is_open = 0;
+static int zf_expect_close = 0;
+static spinlock_t zf_lock;
+static struct timer_list zf_timer;
+static unsigned long next_heartbeat = 0;
+
+
+/* timeout for user land heart beat (10 seconds) */
+#define ZF_USER_TIMEO (HZ*10)
+
+/* timeout for hardware watchdog (~500ms) */
+#define ZF_HW_TIMEO (HZ/2)
+
+/* number of ticks on WD#1 (driven by a 32KHz clock, 2s) */
+#define ZF_CTIMEOUT 0xffff
+
+#ifndef ZF_DEBUG
+# define dprintk(format, args...)
+#else
+# define dprintk(format, args...) printk(KERN_DEBUG PFX ":" __FUNCTION__ ":%d: " format, __LINE__ , ## args)
+#endif
+
+
+/* STATUS register functions */
+
+static inline unsigned char zf_get_status(void)
+{
+ return zf_readb(STATUS);
+}
+
+static inline void zf_set_status(unsigned char new)
+{
+ zf_writeb(STATUS, new);
+}
+
+
+/* CONTROL register functions */
+
+static inline unsigned short zf_get_control(void)
+{
+ return zf_readw(CONTROL);
+}
+
+static inline void zf_set_control(unsigned short new)
+{
+ zf_writew(CONTROL, new);
+}
+
+
+/* WD#? counter functions */
+/*
+ * Just get current counter value
+ */
+
+inline unsigned short zf_get_timer(unsigned char n)
+{
+ switch(n){
+ case WD1:
+ return zf_readw(COUNTER_1);
+ case WD2:
+ return zf_readb(COUNTER_2);
+ default:
+ return 0;
+ }
+}
+
+/*
+ * Just set counter value
+ */
+
+static inline void zf_set_timer(unsigned short new, unsigned char n)
+{
+ switch(n){
+ case WD1:
+ zf_writew(COUNTER_1, new);
+ case WD2:
+ zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
+ default:
+ return;
+ }
+}
+
+/*
+ * stop hardware timer
+ */
+static void zf_timer_off(void)
+{
+ unsigned int ctrl_reg = 0;
+
+ /* stop internal ping */
+ del_timer(&zf_timer);
+
+ /* stop watchdog timer */
+ ctrl_reg = zf_get_control();
+ ctrl_reg |= (ENABLE_WD1|ENABLE_WD2); /* disable wd1 and wd2 */
+ ctrl_reg &= ~(ENABLE_WD1|ENABLE_WD2);
+ zf_set_control(ctrl_reg);
+
+ printk(PFX ": Watchdog timer is now disabled\n");
+}
+
+
+/*
+ * start hardware timer
+ */
+static void zf_timer_on(void)
+{
+ unsigned int ctrl_reg = 0;
+
+ zf_writeb(PULSE_LEN, 0xff);
+
+ zf_set_timer(ZF_CTIMEOUT, WD1);
+
+ /* user land ping */
+ next_heartbeat = jiffies + ZF_USER_TIMEO;
+
+ /* start the timer for internal ping */
+ zf_timer.expires = jiffies + ZF_HW_TIMEO;
+
+ add_timer(&zf_timer);
+
+ /* start watchdog timer */
+ ctrl_reg = zf_get_control();
+ ctrl_reg |= (ENABLE_WD1|zf_action);
+ zf_set_control(ctrl_reg);
+
+ printk(PFX ": Watchdog timer is now enabled\n");
+}
+
+
+static void zf_ping(unsigned long data)
+{
+ unsigned int ctrl_reg = 0;
+
+ zf_writeb(COUNTER_2, 0xff);
+
+ if(time_before(jiffies, next_heartbeat)){
+
+ dprintk("time_before: %ld\n", next_heartbeat - jiffies);
+
+ /*
+ * reset event is activated by transition from 0 to 1 on
+ * RESET_WD1 bit and we assume that it is already zero...
+ */
+ ctrl_reg = zf_get_control();
+ ctrl_reg |= RESET_WD1;
+ zf_set_control(ctrl_reg);
+
+ /* ...and nothing changes until here */
+ ctrl_reg &= ~(RESET_WD1);
+ zf_set_control(ctrl_reg);
+
+ zf_timer.expires = jiffies + ZF_HW_TIMEO;
+ add_timer(&zf_timer);
+ }else{
+ printk(PFX ": I will reset your machine\n");
+ }
+}
+
+static ssize_t zf_write(struct file *file, const char *buf, size_t count,
+ loff_t *ppos)
+{
+ /* Can't seek (pwrite) on this device */
+ if (ppos != &file->f_pos)
+ return -ESPIPE;
+
+ /* See if we got the magic character */
+ if(count){
+
+/*
+ * no need to check for close confirmation
+ * no way to disable watchdog ;)
+ */
+#ifndef CONFIG_WATCHDOG_NOWAYOUT
+ size_t ofs;
+
+ /*
+ * note: just in case someone wrote the magic character
+ * five months ago...
+ */
+ zf_expect_close = 0;
+
+ /* now scan */
+ for(ofs = 0; ofs != count; ofs++){
+ if(buf[ofs] == 'V'){
+ zf_expect_close = 1;
+ dprintk("zf_expect_close 1\n");
+ }
+ }
+#endif
+ /*
+ * Well, anyhow someone wrote to us,
+ * we should return that favour
+ */
+ next_heartbeat = jiffies + ZF_USER_TIMEO;
+ dprintk("user ping at %ld\n", jiffies);
+
+ return 1;
+ }
+
+ return 0;
+}
+
+static ssize_t zf_read(struct file *file, char *buf, size_t count,
+ loff_t *ppos)
+{
+ return -EINVAL;
+}
+
+
+
+static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+ unsigned long arg)
+{
+ int ret;
+
+ switch(cmd){
+ case WDIOC_GETSUPPORT:
+ ret = copy_to_user((struct watchdog_info *)arg,
+ &zf_info, sizeof(zf_info));
+ if(ret)
+ return -EFAULT;
+ break;
+
+ case WDIOC_GETSTATUS:
+ ret = copy_to_user((int *)arg, &zf_is_open,
+ sizeof(int));
+ if(ret)
+ return -EFAULT;
+ break;
+
+ case WDIOC_KEEPALIVE:
+ zf_ping(0);
+ break;
+
+ default:
+ return -ENOIOCTLCMD;
+ }
+
+ return 0;
+}
+
+static int zf_open(struct inode *inode, struct file *file)
+{
+ switch(MINOR(inode->i_rdev)){
+ case WATCHDOG_MINOR:
+ spin_lock(&zf_lock);
+ if(zf_is_open){
+ spin_unlock(&zf_lock);
+ return -EBUSY;
+ }
+
+#ifdef CONFIG_WATCHDOG_NOWAYOUT
+ MOD_INC_USE_COUNT;
+#endif
+ zf_is_open = 1;
+
+ spin_unlock(&zf_lock);
+
+ zf_timer_on();
+
+ return 0;
+ default:
+ return -ENODEV;
+ }
+}
+
+static int zf_close(struct inode *inode, struct file *file)
+{
+ if(MINOR(inode->i_rdev) == WATCHDOG_MINOR){
+
+ if(zf_expect_close){
+ zf_timer_off();
+ } else {
+ del_timer(&zf_timer);
+ printk(PFX ": device file closed unexpectedly. Will not stop the WDT!\n");
+ }
+
+ spin_lock(&zf_lock);
+ zf_is_open = 0;
+ spin_unlock(&zf_lock);
+
+ zf_expect_close = 0;
+ }
+
+ return 0;
+}
+
+/*
+ * Notifier for system down
+ */
+
+static int zf_notify_sys(struct notifier_block *this, unsigned long code,
+ void *unused)
+{
+ if(code == SYS_DOWN || code == SYS_HALT){
+ zf_timer_off();
+ }
+
+ return NOTIFY_DONE;
+}
+
+
+
+
+static struct file_operations zf_fops = {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,34)
+ owner: THIS_MODULE,
+#endif
+ read: zf_read,
+ write: zf_write,
+ ioctl: zf_ioctl,
+ open: zf_open,
+ release: zf_close,
+};
+
+static struct miscdevice zf_miscdev = {
+ WATCHDOG_MINOR,
+ "watchdog",
+ &zf_fops
+};
+
+
+/*
+ * The device needs to learn about soft shutdowns in order to
+ * turn the timebomb registers off.
+ */
+static struct notifier_block zf_notifier = {
+ zf_notify_sys,
+ NULL,
+ 0
+};
+
+static void __init zf_show_action(int act)
+{
+ char *str[] = { "RESET", "SMI", "NMI", "SCI" };
+
+ printk(PFX ": Watchdog using action = %s\n", str[act]);
+}
+
+int __init zf_init(void)
+{
+ int ret;
+
+ printk(PFX ": MachZ ZF-Logic Watchdog driver initializing.\n");
+
+ ret = zf_get_ZFL_version();
+ printk("%#x\n", ret);
+ if((!ret) || (ret != 0xffff)){
+ printk(PFX ": no ZF-Logic found\n");
+ return -ENODEV;
+ }
+
+ if((action <= 3) && (action >= 0)){
+ zf_action = zf_action>>action;
+ } else
+ action = 0;
+
+ zf_show_action(action);
+
+ spin_lock_init(&zf_lock);
+
+ ret = misc_register(&zf_miscdev);
+ if (ret){
+ printk(KERN_ERR "can't misc_register on minor=%d\n",
+ WATCHDOG_MINOR);
+ goto out;
+ }
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,3)
+ if(check_region(ZF_IOBASE, 3)){
+#else
+ if(!request_region(ZF_IOBASE, 3, "MachZ ZFL WDT")){
+#endif
+
+ printk(KERN_ERR "cannot reserve I/O ports at %d\n",
+ ZF_IOBASE);
+ ret = -EBUSY;
+ goto no_region;
+ }
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,3)
+ request_region(ZF_IOBASE, 3, "MachZ ZFL WDT");
+#define __exit
+#endif
+
+ ret = register_reboot_notifier(&zf_notifier);
+ if(ret){
+ printk(KERN_ERR "can't register reboot notifier (err=%d)\n",
+ ret);
+ goto no_reboot;
+ }
+
+ zf_set_status(0);
+ zf_set_control(0);
+
+ /* this is the timer that will do the hard work */
+ init_timer(&zf_timer);
+ zf_timer.function = zf_ping;
+ zf_timer.data = 0;
+
+ return 0;
+
+no_reboot:
+ release_region(ZF_IOBASE, 3);
+no_region:
+ misc_deregister(&zf_miscdev);
+out:
+ return ret;
+}
+
+
+void __exit zf_exit(void)
+{
+ zf_timer_off();
+
+ misc_deregister(&zf_miscdev);
+ unregister_reboot_notifier(&zf_notifier);
+ release_region(ZF_IOBASE, 3);
+}
+
+module_init(zf_init);
+module_exit(zf_exit);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/misc.c linux.20p7/drivers/char/misc.c
--- linux.vanilla/drivers/char/misc.c Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/char/misc.c Wed Jul 4 16:03:54 2001
@@ -84,7 +84,6 @@
extern int pc110pad_init(void);
extern int pmu_device_init(void);
extern int tosh_init(void);
-extern int rng_init(void);
static int misc_read_proc(char *buf, char **start, off_t offset,
int len, int *eof, void *private)
@@ -286,9 +285,6 @@
#endif
#ifdef CONFIG_SGI
streamable_init ();
-#endif
-#ifdef CONFIG_INTEL_RNG
- rng_init ();
#endif
#ifdef CONFIG_TOSHIBA
tosh_init();
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/n_hdlc.c linux.20p7/drivers/char/n_hdlc.c
--- linux.vanilla/drivers/char/n_hdlc.c Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/char/n_hdlc.c Wed Jul 4 16:03:54 2001
@@ -9,7 +9,7 @@
* Al Longyear , Paul Mackerras
*
* Original release 01/11/99
- * $Id: n_hdlc.c,v 2.2 2000/11/08 17:08:29 paul Exp $
+ * $Id: n_hdlc.c,v 2.3 2001/05/09 14:42:37 paul Exp $
*
* This code is released under the GNU General Public License (GPL)
*
@@ -78,7 +78,7 @@
*/
#define HDLC_MAGIC 0x239e
-#define HDLC_VERSION "2.2"
+#define HDLC_VERSION "$Revision: 2.3 $"
#include
#include
@@ -98,6 +98,7 @@
#include
#include
#include
+#include
#include /* used in new tty drivers */
#include /* used in new tty drivers */
#include
@@ -986,14 +987,7 @@
} /* end of n_hdlc_buf_get() */
-/* init_module()
- *
- * called when module is loading to register line discipline
- *
- * Arguments: None
- * Return Value: 0 if success, otherwise error code
- */
-int init_module(void)
+int __init n_hdlc_init()
{
static struct tty_ldisc n_hdlc_ldisc;
int status;
@@ -1031,16 +1025,14 @@
if (status)
printk(KERN_INFO"N_HDLC: init failure %d\n", status);
return (status);
-
-} /* end of init_module() */
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+ return n_hdlc_init();
+}
-/* cleanup_module()
- *
- * called when module is unloading to unregister line discipline
- *
- * Arguments: None
- * Return Value: None
- */
void cleanup_module(void)
{
int status;
@@ -1050,3 +1042,4 @@
else
printk("N_HDLC: line discipline unregistered\n");
}
+#endif
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/rio/linux_compat.h linux.20p7/drivers/char/rio/linux_compat.h
--- linux.vanilla/drivers/char/rio/linux_compat.h Sun Mar 25 17:31:28 2001
+++ linux.20p7/drivers/char/rio/linux_compat.h Wed Jul 4 16:03:54 2001
@@ -93,6 +93,7 @@
#define RIO_DEBUG_SPINLOCK 0x010000
#define RIO_DEBUG_DELAY 0x020000
#define RIO_DEBUG_MOD_COUNT 0x040000
+#define RIO_DEBUG_IOCTL 0x080000
/* Copied over from riowinif.h . This is ugly. The winif file declares
also much other stuff which is incompatible with the headers from
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/rio/rio_linux.c linux.20p7/drivers/char/rio/rio_linux.c
--- linux.vanilla/drivers/char/rio/rio_linux.c Sun Mar 25 17:31:28 2001
+++ linux.20p7/drivers/char/rio/rio_linux.c Wed Jul 4 16:03:54 2001
@@ -730,12 +730,31 @@
}
+int rio2l (int rio_bits)
+{
+ return ((rio_bits & MODEM_CD) ?TIOCM_CD :0) |
+ ((rio_bits & MODEM_DSR)?TIOCM_DSR:0) |
+ ((rio_bits & MODEM_RTS)?TIOCM_RTS:0) |
+ ((rio_bits & MODEM_RI) ?TIOCM_RI :0) |
+ ((rio_bits & MODEM_DTR)?TIOCM_DTR:0) |
+ ((rio_bits & MODEM_CTS)?TIOCM_CTS:0);
+}
+
+int l2rio (int l_bits)
+{
+ return ((l_bits & TIOCM_RTS)?MSET_RTS:0) |
+ ((l_bits & TIOCM_DTR)?MSET_DTR:0);
+}
+
+
static int rio_ioctl (struct tty_struct * tty, struct file * filp,
unsigned int cmd, unsigned long arg)
{
int rc;
struct Port *PortP;
int ival;
+ int state;
+ long flags;
func_enter();
@@ -766,7 +785,7 @@
break;
case TCSBRK:
if ( PortP->State & RIO_DELETED ) {
- rio_dprintk (RIO_DEBUG_TTY, "BREAK on deleted RTA\n");
+ rio_dprintk (RIO_DEBUG_IOCTL, "BREAK on deleted RTA\n");
rc = -EIO;
} else {
if (RIOShortCommand(p, PortP, SBREAK, 2, 250) == RIO_FAIL) {
@@ -777,7 +796,7 @@
break;
case TCSBRKP:
if ( PortP->State & RIO_DELETED ) {
- rio_dprintk (RIO_DEBUG_TTY, "BREAK on deleted RTA\n");
+ rio_dprintk (RIO_DEBUG_IOCTL, "BREAK on deleted RTA\n");
rc = -EIO;
} else {
int l;
@@ -794,39 +813,48 @@
sizeof(struct serial_struct))) == 0)
rc = gs_setserial(&PortP->gs, (struct serial_struct *) arg);
break;
-#if 0
case TIOCMGET:
- if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
- sizeof(unsigned int))) == 0) {
- ival = rio_getsignals(port);
- put_user(ival, (unsigned int *) arg);
- }
+ rio_dprintk (RIO_DEBUG_IOCTL, "TIOCMGET: %x -> %x \n",
+ PortP->ModemState, rio2l (PortP->ModemState));
+ return put_user (rio2l (PortP->ModemState), (unsigned int *) arg);
break;
- case TIOCMBIS:
- if ((rc = verify_area(VERIFY_READ, (void *) arg,
- sizeof(unsigned int))) == 0) {
- Get_user(ival, (unsigned int *) arg);
- rio_setsignals(port, ((ival & TIOCM_DTR) ? 1 : -1),
- ((ival & TIOCM_RTS) ? 1 : -1));
- }
+ case TIOCMSET:
+ Get_user(state, (unsigned int *) arg);
+ rio_dprintk (RIO_DEBUG_IOCTL, "TIOCMSET: %x -> %x\n",
+ PortP->ModemState, l2rio (state));
+
+ rio_spin_lock_irqsave(&PortP->portSem, flags);
+ PortP->ModemState = l2rio (state);
+ PortP->ModemLines = l2rio (state);
+ if (RIOPreemptiveCmd(p, PortP, MSET) == RIO_FAIL)
+ rio_dprintk (RIO_DEBUG_TTY, "MSET command failed\n");
+ PortP->State |= RIO_BUSY;
+ rio_spin_unlock_irqrestore(&PortP->portSem, flags);
break;
case TIOCMBIC:
- if ((rc = verify_area(VERIFY_READ, (void *) arg,
- sizeof(unsigned int))) == 0) {
- Get_user(ival, (unsigned int *) arg);
- rio_setsignals(port, ((ival & TIOCM_DTR) ? 0 : -1),
- ((ival & TIOCM_RTS) ? 0 : -1));
- }
+ rio_dprintk (RIO_DEBUG_IOCTL, "TIOCMBIC\n");
+ Get_user(state, (unsigned int *) arg);
+
+ rio_spin_lock_irqsave(&PortP->portSem, flags);
+ PortP->ModemState &= ~l2rio (state);
+ PortP->ModemLines = l2rio (state);
+ if (RIOPreemptiveCmd(p, PortP, MBIC) == RIO_FAIL)
+ rio_dprintk (RIO_DEBUG_TTY, "TCRIOMBIC command failed\n");
+ PortP->State |= RIO_BUSY;
+ rio_spin_unlock_irqrestore(&PortP->portSem, flags);
break;
- case TIOCMSET:
- if ((rc = verify_area(VERIFY_READ, (void *) arg,
- sizeof(unsigned int))) == 0) {
- Get_user(ival, (unsigned int *) arg);
- rio_setsignals(port, ((ival & TIOCM_DTR) ? 1 : 0),
- ((ival & TIOCM_RTS) ? 1 : 0));
- }
+ case TIOCMBIS:
+ rio_dprintk (RIO_DEBUG_IOCTL, "TIOCMBIS\n");
+ Get_user(state, (unsigned int *) arg);
+
+ rio_spin_lock_irqsave(&PortP->portSem, flags);
+ PortP->ModemState |= state;
+ PortP->ModemLines = state;
+ if (RIOPreemptiveCmd(p, PortP, MBIS) == RIO_FAIL)
+ rio_dprintk (RIO_DEBUG_TTY, "TCRIOMBIS command failed\n");
+ PortP->State |= RIO_BUSY;
+ rio_spin_unlock_irqrestore(&PortP->portSem, flags);
break;
-#endif
default:
rc = -ENOIOCTLCMD;
break;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/rio/rio_linux.h linux.20p7/drivers/char/rio/rio_linux.h
--- linux.vanilla/drivers/char/rio/rio_linux.h Sun Mar 25 17:31:28 2001
+++ linux.20p7/drivers/char/rio/rio_linux.h Wed Jul 4 16:03:54 2001
@@ -190,3 +190,20 @@
#define func_enter2()
#endif
+/* Documentation says to use these defines. Why aren't they in a
+ * header then? Hmm. They are in the header "riowinif.h", however
+ * that file doesn't compile. I give up. Copied here. -- REW
+ */
+
+#define MSET_RTS 0x01 /* RTS modem signal */
+#define MSET_DTR 0x02 /* DTR modem signal */
+
+#define MODEM_DSR 0x80 /* Data Set Ready modem state */
+#define MODEM_CTS 0x40 /* Clear To Send modem state */
+#define MODEM_RI 0x20 /* Ring Indicate modem state */
+#define MODEM_CD 0x10 /* Carrier Detect modem state */
+#define MODEM_TSTOP 0x08 /* Transmit Stopped state */
+#define MODEM_TEMPTY 0x04 /* Transmit Empty state */
+#define MODEM_DTR 0x02 /* DTR modem output state */
+#define MODEM_RTS 0x01 /* RTS modem output state */
+
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/rio/riodrvr.h linux.20p7/drivers/char/rio/riodrvr.h
--- linux.vanilla/drivers/char/rio/riodrvr.h Sun Mar 25 17:31:28 2001
+++ linux.20p7/drivers/char/rio/riodrvr.h Wed Jul 4 16:03:54 2001
@@ -33,12 +33,13 @@
#ifndef __riodrvr_h
#define __riodrvr_h
+#include /* for HZ */
+
#ifdef SCCS_LABELS
static char *_riodrvr_h_sccs_ = "@(#)riodrvr.h 1.3";
#endif
#define MEMDUMP_SIZE 32
-#define HZ 100
#define MOD_DISABLE (RIO_NOREAD|RIO_NOWRITE|RIO_NOXPRINT)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/sbc60xxwdt.c linux.20p7/drivers/char/sbc60xxwdt.c
--- linux.vanilla/drivers/char/sbc60xxwdt.c Sun Mar 25 17:31:28 2001
+++ linux.20p7/drivers/char/sbc60xxwdt.c Wed Jul 4 16:03:54 2001
@@ -49,7 +49,7 @@
*
* Why `V' ? Well, `V' is the character in ASCII for the value 86,
* and we all know that 86 is _the_ most random number in the universe.
- * Therefore it is the letter that has the slightest chance of occuring
+ * Therefore it is the letter that has the slightest chance of occurring
* by chance, when the system becomes corrupted.
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/synclink.c linux.20p7/drivers/char/synclink.c
--- linux.vanilla/drivers/char/synclink.c Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/char/synclink.c Wed Jul 4 16:03:54 2001
@@ -1,7 +1,7 @@
/*
* linux/drivers/char/synclink.c
*
- * $Id: synclink.c,v 2.4 2000/12/11 20:08:18 paul Exp $
+ * $Id: synclink.c,v 2.12 2001/05/10 20:53:04 paulkf Exp $
*
* Device driver for Microgate SyncLink ISA and PCI
* high speed multiprotocol serial adapters.
@@ -54,7 +54,11 @@
*/
#define VERSION(ver,rel,seq) (((ver)<<16) | ((rel)<<8) | (seq))
-#define BREAKPOINT() asm(" int $3");
+#if defined(__i386__)
+# define BREAKPOINT() asm(" int $3");
+#else
+# define BREAKPOINT() { }
+#endif
#define MAX_ISA_DEVICES 10
#define MAX_PCI_DEVICES 10
@@ -182,6 +186,13 @@
int cts_down;
};
+/* transmit holding buffer definitions*/
+#define MAX_TX_HOLDING_BUFFERS 5
+struct tx_holding_buffer {
+ int buffer_size;
+ unsigned char * buffer;
+};
+
/*
* Device instance data structure
*/
@@ -247,11 +258,21 @@
DMABUFFERENTRY *rx_buffer_list; /* list of receive buffer entries */
unsigned int current_rx_buffer;
+ int num_tx_dma_buffers; /* number of tx dma frames required */
+ int tx_dma_buffers_used;
unsigned int tx_buffer_count; /* count of total allocated Tx buffers */
DMABUFFERENTRY *tx_buffer_list; /* list of transmit buffer entries */
+ int start_tx_dma_buffer; /* tx dma buffer to start tx dma operation */
+ int current_tx_buffer; /* next tx dma buffer to be loaded */
unsigned char *intermediate_rxbuffer;
+ int num_tx_holding_buffers; /* number of tx holding buffer allocated */
+ int get_tx_holding_index; /* next tx holding buffer for adapter to load */
+ int put_tx_holding_index; /* next tx holding buffer to store user request */
+ int tx_holding_count; /* number of tx holding buffers waiting */
+ struct tx_holding_buffer tx_holding_buffers[MAX_TX_HOLDING_BUFFERS];
+
int rx_enabled;
int rx_overflow;
@@ -691,6 +712,8 @@
#define usc_TCmd(a,b) usc_OutReg((a), TCSR, (u16)((a)->tcsr_value + (b)))
#define usc_RCmd(a,b) usc_OutReg((a), RCSR, (b))
+#define usc_SetTransmitSyncChars(a,s0,s1) usc_OutReg((a), TSR, (u16)(((u16)s0<<8)|(u16)s1))
+
void usc_process_rxoverrun_sync( struct mgsl_struct *info );
void usc_start_receiver( struct mgsl_struct *info );
void usc_stop_receiver( struct mgsl_struct *info );
@@ -781,7 +804,10 @@
*/
void mgsl_free_rx_frame_buffers( struct mgsl_struct *info, unsigned int StartIndex, unsigned int EndIndex );
int mgsl_get_rx_frame( struct mgsl_struct *info );
+int mgsl_get_raw_rx_frame( struct mgsl_struct *info );
void mgsl_reset_rx_dma_buffers( struct mgsl_struct *info );
+void mgsl_reset_tx_dma_buffers( struct mgsl_struct *info );
+int num_free_tx_dma_buffers(struct mgsl_struct *info);
void mgsl_load_tx_dma_buffer( struct mgsl_struct *info, const char *Buffer, unsigned int BufferSize);
void mgsl_load_pci_memory(char* TargetPtr, const char* SourcePtr, unsigned short count);
@@ -796,6 +822,11 @@
void mgsl_free_buffer_list_memory(struct mgsl_struct *info);
int mgsl_alloc_intermediate_rxbuffer_memory(struct mgsl_struct *info);
void mgsl_free_intermediate_rxbuffer_memory(struct mgsl_struct *info);
+int mgsl_alloc_intermediate_txbuffer_memory(struct mgsl_struct *info);
+void mgsl_free_intermediate_txbuffer_memory(struct mgsl_struct *info);
+int load_next_tx_holding_buffer(struct mgsl_struct *info);
+int save_tx_buffer_request(struct mgsl_struct *info,const char *Buffer, unsigned int BufferSize);
+
/*
* Bottom half interrupt handlers
@@ -816,6 +847,7 @@
void mgsl_isr_io_pin( struct mgsl_struct *info );
void mgsl_isr_misc( struct mgsl_struct *info );
void mgsl_isr_receive_dma( struct mgsl_struct *info );
+void mgsl_isr_transmit_dma( struct mgsl_struct *info );
typedef void (*isr_dispatch_func)(struct mgsl_struct *);
@@ -880,6 +912,8 @@
static int debug_level = 0;
static int maxframe[MAX_TOTAL_DEVICES] = {0,};
static int dosyncppp[MAX_TOTAL_DEVICES] = {0,};
+static int txdmabufs[MAX_TOTAL_DEVICES] = {0,};
+static int txholdbufs[MAX_TOTAL_DEVICES] = {0,};
MODULE_PARM(break_on_load,"i");
MODULE_PARM(ttymajor,"i");
@@ -890,9 +924,11 @@
MODULE_PARM(debug_level,"i");
MODULE_PARM(maxframe,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i");
MODULE_PARM(dosyncppp,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i");
+MODULE_PARM(txdmabufs,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i");
+MODULE_PARM(txholdbufs,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i");
static char *driver_name = "SyncLink serial driver";
-static char *driver_version = "2.3";
+static char *driver_version = "$Revision: 2.12 $";
static struct tty_driver serial_driver, callout_driver;
static int serial_refcount;
@@ -1085,11 +1121,14 @@
void mgsl_bh_receive(struct mgsl_struct *info)
{
+ int (*get_rx_frame)(struct mgsl_struct *info) =
+ (info->params.mode == MGSL_MODE_HDLC ? mgsl_get_rx_frame : mgsl_get_raw_rx_frame);
+
if ( debug_level >= DEBUG_LEVEL_BH )
printk( "%s(%d):mgsl_bh_receive(%s)\n",
__FILE__,__LINE__,info->device_name);
- while( mgsl_get_rx_frame(info) );
+ while( (get_rx_frame)(info) );
}
void mgsl_bh_transmit(struct mgsl_struct *info)
@@ -1594,6 +1633,58 @@
} /* end of mgsl_isr_receive_dma() */
+/* mgsl_isr_transmit_dma()
+ *
+ * This function services a transmit DMA channel interrupt.
+ *
+ * For this driver there is one source of transmit DMA interrupts
+ * as identified in the Transmit DMA Mode Register (TDMR):
+ *
+ * BIT2 EOB End of Buffer. This interrupt occurs when a
+ * transmit DMA buffer has been emptied.
+ *
+ * The driver maintains enough transmit DMA buffers to hold at least
+ * one max frame size transmit frame. When operating in a buffered
+ * transmit mode, there may be enough transmit DMA buffers to hold at
+ * least two or more max frame size frames. On an EOB condition,
+ * determine if there are any queued transmit buffers and copy into
+ * transmit DMA buffers if we have room.
+ *
+ * Arguments: info pointer to device instance data
+ * Return Value: None
+ */
+void mgsl_isr_transmit_dma( struct mgsl_struct *info )
+{
+ u16 status;
+
+ /* clear interrupt pending and IUS bit for Tx DMA IRQ */
+ usc_OutDmaReg(info, CDIR, BIT8+BIT0 );
+
+ /* Read the transmit DMA status to identify interrupt type. */
+ /* This also clears the status bits. */
+
+ status = usc_InDmaReg( info, TDMR );
+
+ if ( debug_level >= DEBUG_LEVEL_ISR )
+ printk("%s(%d):mgsl_isr_transmit_dma(%s) status=%04X\n",
+ __FILE__,__LINE__,info->device_name,status);
+
+ if ( status & BIT2 ) {
+ --info->tx_dma_buffers_used;
+
+ /* if there are transmit frames queued,
+ * try to load the next one
+ */
+ if ( load_next_tx_holding_buffer(info) ) {
+ /* if call returns non-zero value, we have
+ * at least one free tx holding buffer
+ */
+ info->pending_bh |= BH_TRANSMIT;
+ }
+ }
+
+} /* end of mgsl_isr_transmit_dma() */
+
/* mgsl_interrupt()
*
* Interrupt service routine entry point.
@@ -1637,6 +1728,8 @@
/* Dispatch interrupt vector */
if ( UscVector )
(*UscIsrTable[UscVector])(info);
+ else if ( (DmaVector&(BIT10|BIT9)) == BIT10)
+ mgsl_isr_transmit_dma(info);
else
mgsl_isr_receive_dma(info);
@@ -1803,7 +1896,9 @@
usc_stop_transmitter(info);
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
- if (info->params.mode == MGSL_MODE_HDLC || info->netcount)
+ if (info->params.mode == MGSL_MODE_HDLC ||
+ info->params.mode == MGSL_MODE_RAW ||
+ info->netcount)
usc_set_sync_mode(info);
else
usc_set_async_mode(info);
@@ -1956,8 +2051,7 @@
spin_lock_irqsave(&info->irq_spinlock,flags);
- if ( (info->params.mode != MGSL_MODE_HDLC) ||
- !info->tx_active ) {
+ if ( (info->params.mode == MGSL_MODE_ASYNC ) || !info->tx_active ) {
if (info->xmit_cnt < SERIAL_XMIT_SIZE - 1) {
info->xmit_buf[info->xmit_head++] = ch;
@@ -2001,8 +2095,8 @@
spin_lock_irqsave(&info->irq_spinlock,flags);
if (!info->tx_active) {
- if ( (info->params.mode == MGSL_MODE_HDLC) &&
- info->xmit_cnt ) {
+ if ( (info->params.mode == MGSL_MODE_HDLC ||
+ info->params.mode == MGSL_MODE_RAW) && info->xmit_cnt ) {
/* operating in synchronous (frame oriented) mode */
/* copy data from circular xmit_buf to */
/* transmit DMA buffer. */
@@ -2046,11 +2140,51 @@
if (!tty || !info->xmit_buf || !tmp_buf)
goto cleanup;
- if ( info->params.mode == MGSL_MODE_HDLC ) {
- /* operating in synchronous (frame oriented) mode */
+ if ( info->params.mode == MGSL_MODE_HDLC ||
+ info->params.mode == MGSL_MODE_RAW ) {
+ /* operating in synchronous (frame oriented) mode */
if (info->tx_active) {
- ret = 0; goto cleanup;
+
+ if ( info->params.mode == MGSL_MODE_HDLC ) {
+ ret = 0;
+ goto cleanup;
+ }
+ /* transmitter is actively sending data -
+ * if we have multiple transmit dma and
+ * holding buffers, attempt to queue this
+ * frame for transmission at a later time.
+ */
+ if (info->tx_holding_count >= info->num_tx_holding_buffers ) {
+ /* no tx holding buffers available */
+ ret = 0;
+ goto cleanup;
+ }
+
+ /* queue transmit frame request */
+ ret = count;
+ if (from_user) {
+ down(&tmp_buf_sem);
+ COPY_FROM_USER(err,tmp_buf, buf, count);
+ if (err) {
+ if ( debug_level >= DEBUG_LEVEL_INFO )
+ printk( "%s(%d):mgsl_write(%s) sync user buf copy failed\n",
+ __FILE__,__LINE__,info->device_name);
+ ret = -EFAULT;
+ } else
+ save_tx_buffer_request(info,tmp_buf,count);
+ up(&tmp_buf_sem);
+ }
+ else
+ save_tx_buffer_request(info,buf,count);
+
+ /* if we have sufficient tx dma buffers,
+ * load the next buffered tx request
+ */
+ spin_lock_irqsave(&info->irq_spinlock,flags);
+ load_next_tx_holding_buffer(info);
+ spin_unlock_irqrestore(&info->irq_spinlock,flags);
+ goto cleanup;
}
/* if operating in HDLC LoopMode and the adapter */
@@ -2058,8 +2192,7 @@
/* transmit */
if ( (info->params.flags & HDLC_FLAG_HDLC_LOOPMODE) &&
- !usc_loopmode_active(info) )
- {
+ !usc_loopmode_active(info) ) {
ret = 0;
goto cleanup;
}
@@ -2186,7 +2319,8 @@
printk("%s(%d):mgsl_write_room(%s)=%d\n",
__FILE__,__LINE__, info->device_name,ret );
- if ( info->params.mode == MGSL_MODE_HDLC ) {
+ if ( info->params.mode == MGSL_MODE_HDLC ||
+ info->params.mode == MGSL_MODE_RAW ) {
/* operating in synchronous (frame oriented) mode */
if ( info->tx_active )
return 0;
@@ -2220,10 +2354,12 @@
printk("%s(%d):mgsl_chars_in_buffer(%s)=%d\n",
__FILE__,__LINE__, info->device_name,info->xmit_cnt );
- if ( info->params.mode == MGSL_MODE_HDLC ) {
+ if ( info->params.mode == MGSL_MODE_HDLC ||
+ info->params.mode == MGSL_MODE_RAW ) {
/* operating in synchronous (frame oriented) mode */
- if ( info->tx_active )
- return info->tx_buffer_list[0].rcc;
+ if ( info->tx_active ) {
+ return info->max_frame_size;
+ }
else
return 0;
}
@@ -2613,11 +2749,11 @@
unsigned long flags;
int s;
int rc=0;
- u16 regval;
struct mgsl_icount cprev, cnow;
- int events = 0;
+ int events;
int mask;
- struct _input_signal_events signal_events_prev, signal_events_now;
+ struct _input_signal_events oldsigs, newsigs;
+ DECLARE_WAITQUEUE(wait, current);
COPY_FROM_USER(rc,&mask, mask_ptr, sizeof(int));
if (rc) {
@@ -2630,114 +2766,99 @@
spin_lock_irqsave(&info->irq_spinlock,flags);
+ /* return immediately if state matches requested events */
usc_get_serial_signals(info);
s = info->serial_signals;
+ events = mask &
+ ( ((s & SerialSignal_DSR) ? MgslEvent_DsrActive:MgslEvent_DsrInactive) +
+ ((s & SerialSignal_DCD) ? MgslEvent_DcdActive:MgslEvent_DcdInactive) +
+ ((s & SerialSignal_CTS) ? MgslEvent_CtsActive:MgslEvent_CtsInactive) +
+ ((s & SerialSignal_RI) ? MgslEvent_RiActive :MgslEvent_RiInactive) );
+ if (events) {
+ spin_unlock_irqrestore(&info->irq_spinlock,flags);
+ goto exit;
+ }
- /* note the counters on entry */
+ /* save current irq counts */
cprev = info->icount;
- signal_events_prev = info->input_signal_events;
+ oldsigs = info->input_signal_events;
- if (mask & MgslEvent_ExitHuntMode) {
- /* enable exit hunt mode IRQ */
- regval = usc_InReg(info,RICR);
- if (!(regval & RXSTATUS_EXITED_HUNT))
- usc_OutReg(info, RICR, regval | RXSTATUS_EXITED_HUNT);
+ /* enable hunt and idle irqs if needed */
+ if (mask & (MgslEvent_ExitHuntMode + MgslEvent_IdleReceived)) {
+ u16 oldreg = usc_InReg(info,RICR);
+ u16 newreg = oldreg +
+ (mask & MgslEvent_ExitHuntMode ? RXSTATUS_EXITED_HUNT:0) +
+ (mask & MgslEvent_IdleReceived ? RXSTATUS_IDLE_RECEIVED:0);
+ if (oldreg != newreg)
+ usc_OutReg(info, RICR, newreg);
}
- if (mask & MgslEvent_IdleReceived) {
- /* enable idle mode received IRQ */
- regval = usc_InReg(info,RICR);
- if (!(regval & RXSTATUS_IDLE_RECEIVED))
- usc_OutReg(info, RICR, regval | RXSTATUS_IDLE_RECEIVED);
- }
+ set_current_state(TASK_INTERRUPTIBLE);
+ add_wait_queue(&info->event_wait_q, &wait);
spin_unlock_irqrestore(&info->irq_spinlock,flags);
- /* Determine if any user requested events for input signals is currently TRUE */
-
- events |= (mask & ((s & SerialSignal_DSR) ?
- MgslEvent_DsrActive:MgslEvent_DsrInactive));
-
- events |= (mask & ((s & SerialSignal_DCD) ?
- MgslEvent_DcdActive:MgslEvent_DcdInactive));
-
- events |= (mask & ((s & SerialSignal_CTS) ?
- MgslEvent_CtsActive:MgslEvent_CtsInactive));
-
- events |= (mask & ((s & SerialSignal_RI) ?
- MgslEvent_RiActive:MgslEvent_RiInactive));
-
- while(!events) {
- /* sleep until event occurs */
- interruptible_sleep_on(&info->event_wait_q);
-
- /* see if a signal woke us */
+ for(;;) {
+ schedule();
if (signal_pending(current)) {
rc = -ERESTARTSYS;
break;
}
+ /* get current irq counts */
spin_lock_irqsave(&info->irq_spinlock,flags);
-
- /* get icount and serial signal states */
cnow = info->icount;
- signal_events_now = info->input_signal_events;
+ newsigs = info->input_signal_events;
+ set_current_state(TASK_INTERRUPTIBLE);
spin_unlock_irqrestore(&info->irq_spinlock,flags);
- if (signal_events_now.dsr_up != signal_events_prev.dsr_up &&
- mask & MgslEvent_DsrActive )
- events |= MgslEvent_DsrActive;
-
- if (signal_events_now.dsr_down != signal_events_prev.dsr_down &&
- mask & MgslEvent_DsrInactive )
- events |= MgslEvent_DsrInactive;
-
- if (signal_events_now.dcd_up != signal_events_prev.dcd_up &&
- mask & MgslEvent_DcdActive )
- events |= MgslEvent_DcdActive;
-
- if (signal_events_now.dcd_down != signal_events_prev.dcd_down &&
- mask & MgslEvent_DcdInactive )
- events |= MgslEvent_DcdInactive;
-
- if (signal_events_now.cts_up != signal_events_prev.cts_up &&
- mask & MgslEvent_CtsActive )
- events |= MgslEvent_CtsActive;
-
- if (signal_events_now.cts_down != signal_events_prev.cts_down &&
- mask & MgslEvent_CtsInactive )
- events |= MgslEvent_CtsInactive;
-
- if (signal_events_now.ri_up != signal_events_prev.ri_up &&
- mask & MgslEvent_RiActive )
- events |= MgslEvent_RiActive;
-
- if (signal_events_now.ri_down != signal_events_prev.ri_down &&
- mask & MgslEvent_RiInactive )
- events |= MgslEvent_RiInactive;
-
- if (cnow.exithunt != cprev.exithunt)
- events |= (mask & MgslEvent_ExitHuntMode);
+ /* if no change, wait aborted for some reason */
+ if (newsigs.dsr_up == oldsigs.dsr_up &&
+ newsigs.dsr_down == oldsigs.dsr_down &&
+ newsigs.dcd_up == oldsigs.dcd_up &&
+ newsigs.dcd_down == oldsigs.dcd_down &&
+ newsigs.cts_up == oldsigs.cts_up &&
+ newsigs.cts_down == oldsigs.cts_down &&
+ newsigs.ri_up == oldsigs.ri_up &&
+ newsigs.ri_down == oldsigs.ri_down &&
+ cnow.exithunt == cprev.exithunt &&
+ cnow.rxidle == cprev.rxidle) {
+ rc = -EIO;
+ break;
+ }
- if (cnow.rxidle != cprev.rxidle)
- events |= (mask & MgslEvent_IdleReceived);
+ events = mask &
+ ( (newsigs.dsr_up != oldsigs.dsr_up ? MgslEvent_DsrActive:0) +
+ (newsigs.dsr_down != oldsigs.dsr_down ? MgslEvent_DsrInactive:0) +
+ (newsigs.dcd_up != oldsigs.dcd_up ? MgslEvent_DcdActive:0) +
+ (newsigs.dcd_down != oldsigs.dcd_down ? MgslEvent_DcdInactive:0) +
+ (newsigs.cts_up != oldsigs.cts_up ? MgslEvent_CtsActive:0) +
+ (newsigs.cts_down != oldsigs.cts_down ? MgslEvent_CtsInactive:0) +
+ (newsigs.ri_up != oldsigs.ri_up ? MgslEvent_RiActive:0) +
+ (newsigs.ri_down != oldsigs.ri_down ? MgslEvent_RiInactive:0) +
+ (cnow.exithunt != cprev.exithunt ? MgslEvent_ExitHuntMode:0) +
+ (cnow.rxidle != cprev.rxidle ? MgslEvent_IdleReceived:0) );
+ if (events)
+ break;
cprev = cnow;
- signal_events_prev = signal_events_now;
+ oldsigs = newsigs;
}
+ remove_wait_queue(&info->event_wait_q, &wait);
+ set_current_state(TASK_RUNNING);
+
if (mask & (MgslEvent_ExitHuntMode + MgslEvent_IdleReceived)) {
spin_lock_irqsave(&info->irq_spinlock,flags);
if (!waitqueue_active(&info->event_wait_q)) {
/* disable enable exit hunt mode/idle rcvd IRQs */
- regval = usc_InReg(info,RICR);
- usc_OutReg(info, RICR, regval &
+ usc_OutReg(info, RICR, usc_InReg(info,RICR) &
~(RXSTATUS_EXITED_HUNT + RXSTATUS_IDLE_RECEIVED));
}
spin_unlock_irqrestore(&info->irq_spinlock,flags);
}
-
+exit:
if ( rc == 0 )
PUT_USER(rc, events, mask_ptr);
@@ -2745,6 +2866,56 @@
} /* end of mgsl_wait_event() */
+static int modem_input_wait(struct mgsl_struct *info,int arg)
+{
+ unsigned long flags;
+ int rc;
+ struct mgsl_icount cprev, cnow;
+ DECLARE_WAITQUEUE(wait, current);
+
+ /* save current irq counts */
+ spin_lock_irqsave(&info->irq_spinlock,flags);
+ cprev = info->icount;
+ add_wait_queue(&info->status_event_wait_q, &wait);
+ set_current_state(TASK_INTERRUPTIBLE);
+ spin_unlock_irqrestore(&info->irq_spinlock,flags);
+
+ for(;;) {
+ schedule();
+ if (signal_pending(current)) {
+ rc = -ERESTARTSYS;
+ break;
+ }
+
+ /* get new irq counts */
+ spin_lock_irqsave(&info->irq_spinlock,flags);
+ cnow = info->icount;
+ set_current_state(TASK_INTERRUPTIBLE);
+ spin_unlock_irqrestore(&info->irq_spinlock,flags);
+
+ /* if no change, wait aborted for some reason */
+ if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
+ cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) {
+ rc = -EIO;
+ break;
+ }
+
+ /* check for change in caller specified modem input */
+ if ((arg & TIOCM_RNG && cnow.rng != cprev.rng) ||
+ (arg & TIOCM_DSR && cnow.dsr != cprev.dsr) ||
+ (arg & TIOCM_CD && cnow.dcd != cprev.dcd) ||
+ (arg & TIOCM_CTS && cnow.cts != cprev.cts)) {
+ rc = 0;
+ break;
+ }
+
+ cprev = cnow;
+ }
+ remove_wait_queue(&info->status_event_wait_q, &wait);
+ set_current_state(TASK_RUNNING);
+ return rc;
+}
+
/* get_modem_info()
*
* Read the state of the serial control and
@@ -2912,7 +3083,7 @@
int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigned long arg)
{
int error;
- struct mgsl_icount cprev, cnow; /* kernel counter temps */
+ struct mgsl_icount cnow; /* kernel counter temps */
struct serial_icounter_struct *p_cuser; /* user space */
unsigned long flags;
@@ -2947,37 +3118,12 @@
while(MOD_IN_USE)
MOD_DEC_USE_COUNT;
return 0;
- /*
- * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change
- * - mask passed in arg for lines of interest
- * (use |'ed TIOCM_RNG/DSR/CD/CTS for masking)
- * Caller should use TIOCGICOUNT to see which one it was
+
+ /* Wait for modem input (DCD,RI,DSR,CTS) change
+ * as specified by mask in arg (TIOCM_RNG/DSR/CD/CTS)
*/
case TIOCMIWAIT:
- spin_lock_irqsave(&info->irq_spinlock,flags);
- /* note the counters on entry */
- cprev = info->icount;
- spin_unlock_irqrestore(&info->irq_spinlock,flags);
- while (1) {
- interruptible_sleep_on(&info->status_event_wait_q);
- /* see if a signal did it */
- if (signal_pending(current))
- return -ERESTARTSYS;
- save_flags(flags); cli();
- cnow = info->icount; /* atomic copy */
- restore_flags(flags);
- if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
- cnow.dcd == cprev.dcd && cnow.cts == cprev.cts)
- return -EIO; /* no change => error */
- if ( ((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) ||
- ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) ||
- ((arg & TIOCM_CD) && (cnow.dcd != cprev.dcd)) ||
- ((arg & TIOCM_CTS) && (cnow.cts != cprev.cts)) ) {
- return 0;
- }
- cprev = cnow;
- }
- /* NOTREACHED */
+ return modem_input_wait(info,(int)arg);
/*
* Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
@@ -3229,7 +3375,8 @@
if (timeout)
char_time = MIN(char_time, timeout);
- if ( info->params.mode == MGSL_MODE_HDLC ) {
+ if ( info->params.mode == MGSL_MODE_HDLC ||
+ info->params.mode == MGSL_MODE_RAW ) {
while (info->tx_active) {
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(char_time);
@@ -3587,7 +3734,8 @@
if (info->serial_signals & SerialSignal_RI)
strcat(stat_buf, "|RI");
- if (info->params.mode == MGSL_MODE_HDLC) {
+ if (info->params.mode == MGSL_MODE_HDLC ||
+ info->params.mode == MGSL_MODE_RAW ) {
ret += sprintf(buf+ret, " HDLC txok:%d rxok:%d",
info->icount.txok, info->icount.rxok);
if (info->icount.txunder)
@@ -3728,28 +3876,27 @@
*
* This leaves 62 4K pages.
*
- * The next N pages are used for a transmit frame. We
- * reserve enough 4K page blocks to hold the configured
- * MaxFrameSize
+ * The next N pages are used for transmit frame(s). We
+ * reserve enough 4K page blocks to hold the required
+ * number of transmit dma buffers (num_tx_dma_buffers),
+ * each of MaxFrameSize size.
*
* Of the remaining pages (62-N), determine how many can
* be used to receive full MaxFrameSize inbound frames
*/
-
- info->tx_buffer_count = BuffersPerFrame;
+ info->tx_buffer_count = info->num_tx_dma_buffers * BuffersPerFrame;
info->rx_buffer_count = 62 - info->tx_buffer_count;
} else {
/* Calculate the number of PAGE_SIZE buffers needed for */
/* receive and transmit DMA buffers. */
-
/* Calculate the number of DMA buffers necessary to */
/* hold 7 max size receive frames and one max size transmit frame. */
/* The receive buffer count is bumped by one so we avoid an */
/* End of List condition if all receive buffers are used when */
/* using linked list DMA buffers. */
- info->tx_buffer_count = BuffersPerFrame;
+ info->tx_buffer_count = info->num_tx_dma_buffers * BuffersPerFrame;
info->rx_buffer_count = (BuffersPerFrame * MAXRXFRAMES) + 6;
/*
@@ -3769,12 +3916,14 @@
if ( mgsl_alloc_buffer_list_memory( info ) < 0 ||
mgsl_alloc_frame_memory(info, info->rx_buffer_list, info->rx_buffer_count) < 0 ||
mgsl_alloc_frame_memory(info, info->tx_buffer_list, info->tx_buffer_count) < 0 ||
- mgsl_alloc_intermediate_rxbuffer_memory(info) < 0 ) {
+ mgsl_alloc_intermediate_rxbuffer_memory(info) < 0 ||
+ mgsl_alloc_intermediate_txbuffer_memory(info) < 0 ) {
printk("%s(%d):Can't allocate DMA buffer memory\n",__FILE__,__LINE__);
return -ENOMEM;
}
mgsl_reset_rx_dma_buffers( info );
+ mgsl_reset_tx_dma_buffers( info );
return 0;
@@ -4030,6 +4179,149 @@
} /* end of mgsl_free_intermediate_rxbuffer_memory() */
+/*
+ * mgsl_alloc_intermediate_txbuffer_memory()
+ *
+ * Allocate intermdiate transmit buffer(s) large enough to hold max_frame_size.
+ * This buffer is used to load transmit frames into the adapter's dma transfer
+ * buffers when there is sufficient space.
+ *
+ * Arguments:
+ *
+ * info pointer to device instance data
+ *
+ * Return Value: 0 if success, otherwise -ENOMEM
+ */
+int mgsl_alloc_intermediate_txbuffer_memory(struct mgsl_struct *info)
+{
+ int i;
+
+ if ( debug_level >= DEBUG_LEVEL_INFO )
+ printk("%s %s(%d) allocating %d tx holding buffers\n",
+ info->device_name, __FILE__,__LINE__,info->num_tx_holding_buffers);
+
+ memset(info->tx_holding_buffers,0,sizeof(info->tx_holding_buffers));
+
+ for ( i=0; inum_tx_holding_buffers; ++i) {
+ info->tx_holding_buffers[i].buffer =
+ kmalloc(info->max_frame_size, GFP_KERNEL);
+ if ( info->tx_holding_buffers[i].buffer == NULL )
+ return -ENOMEM;
+ }
+
+ return 0;
+
+} /* end of mgsl_alloc_intermediate_txbuffer_memory() */
+
+/*
+ * mgsl_free_intermediate_txbuffer_memory()
+ *
+ *
+ * Arguments:
+ *
+ * info pointer to device instance data
+ *
+ * Return Value: None
+ */
+void mgsl_free_intermediate_txbuffer_memory(struct mgsl_struct *info)
+{
+ int i;
+
+ for ( i=0; inum_tx_holding_buffers; ++i ) {
+ if ( info->tx_holding_buffers[i].buffer ) {
+ kfree(info->tx_holding_buffers[i].buffer);
+ info->tx_holding_buffers[i].buffer=NULL;
+ }
+ }
+
+ info->get_tx_holding_index = 0;
+ info->put_tx_holding_index = 0;
+ info->tx_holding_count = 0;
+
+} /* end of mgsl_free_intermediate_txbuffer_memory() */
+
+
+/*
+ * load_next_tx_holding_buffer()
+ *
+ * attempts to load the next buffered tx request into the
+ * tx dma buffers
+ *
+ * Arguments:
+ *
+ * info pointer to device instance data
+ *
+ * Return Value: 1 if next buffered tx request loaded
+ * into adapter's tx dma buffer,
+ * 0 otherwise
+ */
+int load_next_tx_holding_buffer(struct mgsl_struct *info)
+{
+ int ret = 0;
+
+ if ( info->tx_holding_count ) {
+ /* determine if we have enough tx dma buffers
+ * to accomodate the next tx frame
+ */
+ struct tx_holding_buffer *ptx =
+ &info->tx_holding_buffers[info->get_tx_holding_index];
+ int num_free = num_free_tx_dma_buffers(info);
+ int num_needed = ptx->buffer_size / DMABUFFERSIZE;
+ if ( ptx->buffer_size % DMABUFFERSIZE )
+ ++num_needed;
+
+ if (num_needed <= num_free) {
+ info->xmit_cnt = ptx->buffer_size;
+ mgsl_load_tx_dma_buffer(info,ptx->buffer,ptx->buffer_size);
+
+ --info->tx_holding_count;
+ if ( ++info->get_tx_holding_index >= info->num_tx_holding_buffers)
+ info->get_tx_holding_index=0;
+
+ /* restart transmit timer */
+ del_timer(&info->tx_timer);
+ info->tx_timer.expires = jiffies + jiffies_from_ms(5000);
+ add_timer(&info->tx_timer);
+
+ ret = 1;
+ }
+ }
+
+ return ret;
+}
+
+/*
+ * save_tx_buffer_request()
+ *
+ * attempt to store transmit frame request for later transmission
+ *
+ * Arguments:
+ *
+ * info pointer to device instance data
+ * Buffer pointer to buffer containing frame to load
+ * BufferSize size in bytes of frame in Buffer
+ *
+ * Return Value: 1 if able to store, 0 otherwise
+ */
+int save_tx_buffer_request(struct mgsl_struct *info,const char *Buffer, unsigned int BufferSize)
+{
+ struct tx_holding_buffer *ptx;
+
+ if ( info->tx_holding_count >= info->num_tx_holding_buffers ) {
+ return 0; /* all buffers in use */
+ }
+
+ ptx = &info->tx_holding_buffers[info->put_tx_holding_index];
+ ptx->buffer_size = BufferSize;
+ memcpy( ptx->buffer, Buffer, BufferSize);
+
+ ++info->tx_holding_count;
+ if ( ++info->put_tx_holding_index >= info->num_tx_holding_buffers)
+ info->put_tx_holding_index=0;
+
+ return 1;
+}
+
int mgsl_claim_resources(struct mgsl_struct *info)
{
/* claim 16C32 I/O base address */
@@ -4123,6 +4415,7 @@
}
mgsl_free_dma_buffers(info);
mgsl_free_intermediate_rxbuffer_memory(info);
+ mgsl_free_intermediate_txbuffer_memory(info);
if ( info->io_addr_requested ) {
release_region(info->io_base,info->io_addr_size);
@@ -4163,6 +4456,21 @@
if (maxframe[info->line])
info->max_frame_size = maxframe[info->line];
info->dosyncppp = dosyncppp[info->line];
+
+ if (txdmabufs[info->line]) {
+ info->num_tx_dma_buffers = txdmabufs[info->line];
+ if (info->num_tx_dma_buffers < 1)
+ info->num_tx_dma_buffers = 1;
+ }
+
+ if (txholdbufs[info->line]) {
+ info->num_tx_holding_buffers = txholdbufs[info->line];
+ if (info->num_tx_holding_buffers < 1)
+ info->num_tx_holding_buffers = 1;
+ else if (info->num_tx_holding_buffers > MAX_TX_HOLDING_BUFFERS)
+ info->num_tx_holding_buffers = MAX_TX_HOLDING_BUFFERS;
+ }
+
}
mgsl_device_count++;
@@ -4182,18 +4490,20 @@
info->max_frame_size = 65535;
if ( info->bus_type == MGSL_BUS_TYPE_PCI ) {
- printk( "SyncLink device %s added:PCI bus IO=%04X IRQ=%d Mem=%08X LCR=%08X MaxFrameSize=%u\n",
+ printk( "SyncLink device %s:PCI IO=%04X IRQ=%d Mem=%08X LCR=%08X MaxFrameSize=%u\n",
info->device_name, info->io_base, info->irq_level,
info->phys_memory_base, info->phys_lcr_base,
info->max_frame_size );
} else {
- printk( "SyncLink device %s added:ISA bus IO=%04X IRQ=%d DMA=%d MaxFrameSize=%u\n",
+ printk( "SyncLink device %s:ISA IO=%04X IRQ=%d DMA=%d MaxFrameSize=%u\n",
info->device_name, info->io_base, info->irq_level, info->dma_level,
info->max_frame_size );
}
#ifdef CONFIG_SYNCLINK_SYNCPPP
+#ifdef MODULE
if (info->dosyncppp)
+#endif
mgsl_sppp_init(info);
#endif
} /* end of mgsl_add_device() */
@@ -4231,6 +4541,8 @@
spin_lock_init(&info->netlock);
memcpy(&info->params,&default_params,sizeof(MGSL_PARAMS));
info->idle_mode = HDLC_TXIDLE_FLAGS;
+ info->num_tx_dma_buffers = 1;
+ info->num_tx_holding_buffers = 0;
}
return info;
@@ -4355,7 +4667,7 @@
EXPORT_NO_SYMBOLS;
- printk("%s version %s\n", driver_name, driver_version);
+ printk("%s %s\n", driver_name, driver_version);
/* determine how many SyncLink devices are installed */
mgsl_enumerate_devices();
@@ -4423,7 +4735,7 @@
printk("%s(%d):Couldn't register callout driver\n",
__FILE__,__LINE__);
- printk("%s version %s, tty major#%d callout major#%d\n",
+ printk("%s %s, tty major#%d callout major#%d\n",
driver_name, driver_version,
serial_driver.major, callout_driver.major);
@@ -4440,6 +4752,7 @@
} /* end of mgsl_init() */
+#ifdef MODULE
int __init init_module(void)
{
/* Uncomment this to kernel debug module.
@@ -4459,6 +4772,7 @@
unsigned long flags;
int rc;
struct mgsl_struct *info;
+ struct mgsl_struct *tmp;
printk("Unloading %s: version %s\n", driver_name, driver_version);
save_flags(flags);
@@ -4478,7 +4792,9 @@
mgsl_sppp_delete(info);
#endif
mgsl_release_resources(info);
+ tmp = info;
info = info->next_device;
+ kfree(tmp);
}
if (tmp_buf) {
@@ -4487,6 +4803,7 @@
}
} /* end of cleanup_module() */
+#endif
/*
* usc_RTCmd()
@@ -4714,7 +5031,27 @@
*
* 0000 0110 0000 0110 = 0x0606
*/
+ if (info->params.mode == MGSL_MODE_RAW) {
+ RegValue = 0x0001; /* Set Receive mode = external sync */
+ usc_OutReg( info, IOCR, /* Set IOCR DCD is RxSync Detect Input */
+ (unsigned short)((usc_InReg(info, IOCR) & ~(BIT13|BIT12)) | BIT12));
+
+ /*
+ * TxSubMode:
+ * CMR <15> 0 Don't send CRC on Tx Underrun
+ * CMR <14> x undefined
+ * CMR <13> 0 Send preamble before openning sync
+ * CMR <12> 0 Send 8-bit syncs, 1=send Syncs per TxLength
+ *
+ * TxMode:
+ * CMR <11-8) 0100 MonoSync
+ *
+ * 0x00 0100 xxxx xxxx 04xx
+ */
+ RegValue |= 0x0400;
+ }
+ else {
RegValue = 0x0606;
if ( info->params.flags & HDLC_FLAG_UNDERRUN_ABORT15 )
@@ -4723,12 +5060,14 @@
RegValue |= BIT15;
else if ( info->params.flags & HDLC_FLAG_UNDERRUN_CRC )
RegValue |= BIT15 + BIT14;
+ }
if ( info->params.preamble != HDLC_PREAMBLE_PATTERN_NONE )
RegValue |= BIT13;
}
- if ( info->params.flags & HDLC_FLAG_SHARE_ZERO )
+ if ( info->params.mode == MGSL_MODE_HDLC &&
+ (info->params.flags & HDLC_FLAG_SHARE_ZERO) )
RegValue |= BIT12;
if ( info->params.addr_filter != 0xff )
@@ -4768,9 +5107,9 @@
case HDLC_ENCODING_DIFF_BIPHASE_LEVEL: RegValue |= BIT15 + BIT14 + BIT13; break;
}
- if ( info->params.crc_type == HDLC_CRC_16_CCITT )
+ if ( (info->params.crc_type & HDLC_CRC_MASK) == HDLC_CRC_16_CCITT )
RegValue |= BIT9;
- else if ( info->params.crc_type == HDLC_CRC_32_CCITT )
+ else if ( (info->params.crc_type & HDLC_CRC_MASK) == HDLC_CRC_32_CCITT )
RegValue |= ( BIT12 | BIT10 | BIT9 );
usc_OutReg( info, RMR, RegValue );
@@ -4845,9 +5184,9 @@
case HDLC_ENCODING_DIFF_BIPHASE_LEVEL: RegValue |= BIT15 + BIT14 + BIT13; break;
}
- if ( info->params.crc_type == HDLC_CRC_16_CCITT )
+ if ( (info->params.crc_type & HDLC_CRC_MASK) == HDLC_CRC_16_CCITT )
RegValue |= BIT9 + BIT8;
- else if ( info->params.crc_type == HDLC_CRC_32_CCITT )
+ else if ( (info->params.crc_type & HDLC_CRC_MASK) == HDLC_CRC_32_CCITT )
RegValue |= ( BIT12 | BIT10 | BIT9 | BIT8);
usc_OutReg( info, TMR, RegValue );
@@ -5518,7 +5857,8 @@
usc_OutReg( info, CCSR, (u16)(usc_InReg(info,CCSR) | BIT13) );
usc_RTCmd( info, RTCmd_PurgeRxFifo );
- if ( info->params.mode == MGSL_MODE_HDLC ) {
+ if ( info->params.mode == MGSL_MODE_HDLC ||
+ info->params.mode == MGSL_MODE_RAW ) {
/* DMA mode Transfers */
/* Program the DMA controller. */
/* Enable the DMA controller end of buffer interrupt. */
@@ -5607,9 +5947,14 @@
/* Transmit DMA buffer is loaded, so program USC */
/* to send the frame contained in the buffers. */
+ FrameSize = info->tx_buffer_list[info->start_tx_dma_buffer].rcc;
-
- FrameSize = info->tx_buffer_list[0].rcc;
+ /* if operating in Raw sync mode, reset the rcc component
+ * of the tx dma buffer entry, otherwise, the serial controller
+ * will send a closing sync char after this count.
+ */
+ if ( info->params.mode == MGSL_MODE_RAW )
+ info->tx_buffer_list[info->start_tx_dma_buffer].rcc = 0;
/* Program the Transmit Character Length Register (TCLR) */
/* and clear FIFO (TCC is loaded with TCLR on FIFO clear) */
@@ -5618,7 +5963,7 @@
usc_RTCmd( info, RTCmd_PurgeTxFifo );
/* Program the address of the 1st DMA Buffer Entry in linked list */
- phys_addr = info->tx_buffer_list[0].phys_entry;
+ phys_addr = info->tx_buffer_list[info->start_tx_dma_buffer].phys_entry;
usc_OutDmaReg( info, NTARL, (u16)phys_addr );
usc_OutDmaReg( info, NTARU, (u16)(phys_addr >> 16) );
@@ -5626,6 +5971,19 @@
usc_ClearIrqPendingBits( info, TRANSMIT_STATUS );
usc_EnableInterrupts( info, TRANSMIT_STATUS );
+ if ( info->params.mode == MGSL_MODE_RAW &&
+ info->num_tx_dma_buffers > 1 ) {
+ /* When running external sync mode, attempt to 'stream' transmit */
+ /* by filling tx dma buffers as they become available. To do this */
+ /* we need to enable Tx DMA EOB Status interrupts : */
+ /* */
+ /* 1. Arm End of Buffer (EOB) Transmit DMA Interrupt (BIT2 of TDIAR) */
+ /* 2. Enable Transmit DMA Interrupts (BIT0 of DICR) */
+
+ usc_OutDmaReg( info, TDIAR, BIT2|BIT3 );
+ usc_OutDmaReg( info, DICR, (u16)(usc_InDmaReg(info,DICR) | BIT0) );
+ }
+
/* Initialize Transmit DMA Channel */
usc_DmaCmd( info, DmaCmd_InitTxChannel );
@@ -6049,6 +6407,9 @@
void usc_loopback_frame( struct mgsl_struct *info )
{
int i;
+ unsigned long oldmode = info->params.mode;
+
+ info->params.mode = MGSL_MODE_HDLC;
usc_DisableMasterIrqBit( info );
@@ -6102,6 +6463,8 @@
usc_EnableMasterIrqBit(info);
+ info->params.mode = oldmode;
+
} /* end of usc_loopback_frame() */
/* usc_set_sync_mode() Programs the USC for SDLC communications.
@@ -6153,6 +6516,38 @@
info->tcsr_value += usc_idle_mode;
usc_OutReg(info, TCSR, info->tcsr_value);
+ /*
+ * if SyncLink WAN adapter is running in external sync mode, the
+ * transmitter has been set to Monosync in order to try to mimic
+ * a true raw outbound bit stream. Monosync still sends an open/close
+ * sync char at the start/end of a frame. Try to match those sync
+ * patterns to the idle mode set here
+ */
+ if ( info->params.mode == MGSL_MODE_RAW ) {
+ unsigned char syncpat = 0;
+ switch( info->idle_mode ) {
+ case HDLC_TXIDLE_FLAGS:
+ syncpat = 0x7e;
+ break;
+ case HDLC_TXIDLE_ALT_ZEROS_ONES:
+ syncpat = 0x55;
+ break;
+ case HDLC_TXIDLE_ZEROS:
+ case HDLC_TXIDLE_SPACE:
+ syncpat = 0x00;
+ break;
+ case HDLC_TXIDLE_ONES:
+ case HDLC_TXIDLE_MARK:
+ syncpat = 0xff;
+ break;
+ case HDLC_TXIDLE_ALT_MARK_SPACE:
+ syncpat = 0xaa;
+ break;
+ }
+
+ usc_SetTransmitSyncChars(info,syncpat,syncpat);
+ }
+
} /* end of usc_set_txidle() */
/* usc_get_serial_signals()
@@ -6330,6 +6725,48 @@
*/
/*
+ * mgsl_reset_tx_dma_buffers()
+ *
+ * Set the count for all transmit buffers to 0 to indicate the
+ * buffer is available for use and set the current buffer to the
+ * first buffer. This effectively makes all buffers free and
+ * discards any data in buffers.
+ *
+ * Arguments: info pointer to device instance data
+ * Return Value: None
+ */
+void mgsl_reset_tx_dma_buffers( struct mgsl_struct *info )
+{
+ unsigned int i;
+
+ for ( i = 0; i < info->tx_buffer_count; i++ ) {
+ *((unsigned long *)&(info->tx_buffer_list[i].count)) = 0;
+ }
+
+ info->current_tx_buffer = 0;
+ info->start_tx_dma_buffer = 0;
+ info->tx_dma_buffers_used = 0;
+
+ info->get_tx_holding_index = 0;
+ info->put_tx_holding_index = 0;
+ info->tx_holding_count = 0;
+
+} /* end of mgsl_reset_tx_dma_buffers() */
+
+/*
+ * num_free_tx_dma_buffers()
+ *
+ * returns the number of free tx dma buffers available
+ *
+ * Arguments: info pointer to device instance data
+ * Return Value: number of free tx dma buffers
+ */
+int num_free_tx_dma_buffers(struct mgsl_struct *info)
+{
+ return info->tx_buffer_count - info->tx_dma_buffers_used;
+}
+
+/*
* mgsl_reset_rx_dma_buffers()
*
* Set the count for all receive buffers to DMABUFFERSIZE
@@ -6415,10 +6852,11 @@
unsigned int StartIndex, EndIndex; /* index of 1st and last buffers of Rx frame */
unsigned short status;
DMABUFFERENTRY *pBufEntry;
- unsigned int framesize;
+ unsigned int framesize = 0;
int ReturnCode = 0;
unsigned long flags;
struct tty_struct *tty = info->tty;
+ int return_frame = 0;
/*
* current_rx_buffer points to the 1st buffer of the next available
@@ -6474,14 +6912,20 @@
info->icount.rxabort++;
else if ( status & RXSTATUS_OVERRUN )
info->icount.rxover++;
- else
+ else {
info->icount.rxcrc++;
+ if ( info->params.crc_type & HDLC_CRC_RETURN_EX )
+ return_frame = 1;
+ }
framesize = 0;
#ifdef CONFIG_SYNCLINK_SYNCPPP
info->netstats.rx_errors++;
info->netstats.rx_frame_errors++;
#endif
- } else {
+ } else
+ return_frame = 1;
+
+ if ( return_frame ) {
/* receive frame has no errors, get frame size.
* The frame size is the starting value of the RCC (which was
* set to 0xffff) minus the ending value of the RCC (decremented
@@ -6506,7 +6950,9 @@
MIN(framesize,DMABUFFERSIZE),0);
if (framesize) {
- if (framesize > info->max_frame_size)
+ if ( ( (info->params.crc_type & HDLC_CRC_RETURN_EX) &&
+ ((framesize+1) > info->max_frame_size) ) ||
+ (framesize > info->max_frame_size) )
info->icount.rxlong++;
else {
/* copy dma buffer(s) to contiguous intermediate buffer */
@@ -6514,6 +6960,7 @@
int index = StartIndex;
unsigned char *ptmp = info->intermediate_rxbuffer;
+ if ( !(status & RXSTATUS_CRC_ERROR))
info->icount.rxok++;
while(copy_count) {
@@ -6532,6 +6979,19 @@
index = 0;
}
+ if ( info->params.crc_type & HDLC_CRC_RETURN_EX ) {
+ ++framesize;
+ *ptmp = (status & RXSTATUS_CRC_ERROR ?
+ RX_CRC_ERROR :
+ RX_OK);
+
+ if ( debug_level >= DEBUG_LEVEL_DATA )
+ printk("%s(%d):mgsl_get_rx_frame(%s) rx frame status=%d\n",
+ __FILE__,__LINE__,info->device_name,
+ *ptmp);
+ }
+
+
#ifdef CONFIG_SYNCLINK_SYNCPPP
if (info->netcount) {
/* pass frame to syncppp device */
@@ -6541,6 +7001,7 @@
#endif
{
/* Call the line discipline receive callback directly. */
+ if ( tty && tty->ldisc.receive_buf )
tty->ldisc.receive_buf(tty, info->intermediate_rxbuffer, info->flag_buf, framesize);
}
}
@@ -6570,6 +7031,180 @@
} /* end of mgsl_get_rx_frame() */
+/* mgsl_get_raw_rx_frame()
+ *
+ * This function attempts to return a received frame from the
+ * receive DMA buffers when running in external loop mode. In this mode,
+ * we will return at most one DMABUFFERSIZE frame to the application.
+ * The USC receiver is triggering off of DCD going active to start a new
+ * frame, and DCD going inactive to terminate the frame (similar to
+ * processing a closing flag character).
+ *
+ * In this routine, we will return DMABUFFERSIZE "chunks" at a time.
+ * If DCD goes inactive, the last Rx DMA Buffer will have a non-zero
+ * status field and the RCC field will indicate the length of the
+ * entire received frame. We take this RCC field and get the modulus
+ * of RCC and DMABUFFERSIZE to determine if number of bytes in the
+ * last Rx DMA buffer and return that last portion of the frame.
+ *
+ * Arguments: info pointer to device extension
+ * Return Value: 1 if frame returned, otherwise 0
+ */
+int mgsl_get_raw_rx_frame(struct mgsl_struct *info)
+{
+ unsigned int CurrentIndex, NextIndex;
+ unsigned short status;
+ DMABUFFERENTRY *pBufEntry;
+ unsigned int framesize = 0;
+ int ReturnCode = 0;
+ unsigned long flags;
+ struct tty_struct *tty = info->tty;
+
+ /*
+ * current_rx_buffer points to the 1st buffer of the next available
+ * receive frame. The status field is set by the 16C32 after
+ * completing a receive frame. If the status field of this buffer
+ * is zero, either the USC is still filling this buffer or this
+ * is one of a series of buffers making up a received frame.
+ *
+ * If the count field of this buffer is zero, the USC is either
+ * using this buffer or has used this buffer. Look at the count
+ * field of the next buffer. If that next buffer's count is
+ * non-zero, the USC is still actively using the current buffer.
+ * Otherwise, if the next buffer's count field is zero, the
+ * current buffer is complete and the USC is using the next
+ * buffer.
+ */
+ CurrentIndex = NextIndex = info->current_rx_buffer;
+ ++NextIndex;
+ if ( NextIndex == info->rx_buffer_count )
+ NextIndex = 0;
+
+ if ( info->rx_buffer_list[CurrentIndex].status != 0 ||
+ (info->rx_buffer_list[CurrentIndex].count == 0 &&
+ info->rx_buffer_list[NextIndex].count == 0)) {
+ /*
+ * Either the status field of this dma buffer is non-zero
+ * (indicating the last buffer of a receive frame) or the next
+ * buffer is marked as in use -- implying this buffer is complete
+ * and an intermediate buffer for this received frame.
+ */
+
+ status = info->rx_buffer_list[CurrentIndex].status;
+
+ if ( status & (RXSTATUS_SHORT_FRAME + RXSTATUS_OVERRUN +
+ RXSTATUS_CRC_ERROR + RXSTATUS_ABORT) ) {
+ if ( status & RXSTATUS_SHORT_FRAME )
+ info->icount.rxshort++;
+ else if ( status & RXSTATUS_ABORT )
+ info->icount.rxabort++;
+ else if ( status & RXSTATUS_OVERRUN )
+ info->icount.rxover++;
+ else
+ info->icount.rxcrc++;
+ framesize = 0;
+ } else {
+ /*
+ * A receive frame is available, get frame size and status.
+ *
+ * The frame size is the starting value of the RCC (which was
+ * set to 0xffff) minus the ending value of the RCC (decremented
+ * once for each receive character) minus 2 or 4 for the 16-bit
+ * or 32-bit CRC.
+ *
+ * If the status field is zero, this is an intermediate buffer.
+ * It's size is 4K.
+ *
+ * If the DMA Buffer Entry's Status field is non-zero, the
+ * receive operation completed normally (ie: DCD dropped). The
+ * RCC field is valid and holds the received frame size.
+ * It is possible that the RCC field will be zero on a DMA buffer
+ * entry with a non-zero status. This can occur if the total
+ * frame size (number of bytes between the time DCD goes active
+ * to the time DCD goes inactive) exceeds 65535 bytes. In this
+ * case the 16C32 has underrun on the RCC count and appears to
+ * stop updating this counter to let us know the actual received
+ * frame size. If this happens (non-zero status and zero RCC),
+ * simply return the entire RxDMA Buffer
+ */
+ if ( status ) {
+ /*
+ * In the event that the final RxDMA Buffer is
+ * terminated with a non-zero status and the RCC
+ * field is zero, we interpret this as the RCC
+ * having underflowed (received frame > 65535 bytes).
+ *
+ * Signal the event to the user by passing back
+ * a status of RxStatus_CrcError returning the full
+ * buffer and let the app figure out what data is
+ * actually valid
+ */
+ if ( info->rx_buffer_list[CurrentIndex].rcc )
+ framesize = RCLRVALUE - info->rx_buffer_list[CurrentIndex].rcc;
+ else
+ framesize = DMABUFFERSIZE;
+ }
+ else
+ framesize = DMABUFFERSIZE;
+ }
+
+ if ( framesize > DMABUFFERSIZE ) {
+ /*
+ * if running in raw sync mode, ISR handler for
+ * End Of Buffer events terminates all buffers at 4K.
+ * If this frame size is said to be >4K, get the
+ * actual number of bytes of the frame in this buffer.
+ */
+ framesize = framesize % DMABUFFERSIZE;
+ }
+
+
+ if ( debug_level >= DEBUG_LEVEL_BH )
+ printk("%s(%d):mgsl_get_raw_rx_frame(%s) status=%04X size=%d\n",
+ __FILE__,__LINE__,info->device_name,status,framesize);
+
+ if ( debug_level >= DEBUG_LEVEL_DATA )
+ mgsl_trace_block(info,info->rx_buffer_list[CurrentIndex].virt_addr,
+ MIN(framesize,DMABUFFERSIZE),0);
+
+ if (framesize) {
+ /* copy dma buffer(s) to contiguous intermediate buffer */
+ /* NOTE: we never copy more than DMABUFFERSIZE bytes */
+
+ pBufEntry = &(info->rx_buffer_list[CurrentIndex]);
+ memcpy( info->intermediate_rxbuffer, pBufEntry->virt_addr, framesize);
+ info->icount.rxok++;
+
+ /* Call the line discipline receive callback directly. */
+ if ( tty && tty->ldisc.receive_buf )
+ tty->ldisc.receive_buf(tty, info->intermediate_rxbuffer, info->flag_buf, framesize);
+ }
+
+ /* Free the buffers used by this frame. */
+ mgsl_free_rx_frame_buffers( info, CurrentIndex, CurrentIndex );
+
+ ReturnCode = 1;
+ }
+
+
+ if ( info->rx_enabled && info->rx_overflow ) {
+ /* The receiver needs to restarted because of
+ * a receive overflow (buffer or FIFO). If the
+ * receive buffers are now empty, then restart receiver.
+ */
+
+ if ( !info->rx_buffer_list[CurrentIndex].status &&
+ info->rx_buffer_list[CurrentIndex].count ) {
+ spin_lock_irqsave(&info->irq_spinlock,flags);
+ usc_start_receiver(info);
+ spin_unlock_irqrestore(&info->irq_spinlock,flags);
+ }
+ }
+
+ return ReturnCode;
+
+} /* end of mgsl_get_raw_rx_frame() */
+
/* mgsl_load_tx_dma_buffer()
*
* Load the transmit DMA buffer with the specified data.
@@ -6599,12 +7234,19 @@
info->cmr_value |= BIT13;
}
+ /* begin loading the frame in the next available tx dma
+ * buffer, remember it's starting location for setting
+ * up tx dma operation
+ */
+ i = info->current_tx_buffer;
+ info->start_tx_dma_buffer = i;
+
/* Setup the status and RCC (Frame Size) fields of the 1st */
/* buffer entry in the transmit DMA buffer list. */
- info->tx_buffer_list[0].status = info->cmr_value & 0xf000;
- info->tx_buffer_list[0].rcc = BufferSize;
- info->tx_buffer_list[0].count = BufferSize;
+ info->tx_buffer_list[i].status = info->cmr_value & 0xf000;
+ info->tx_buffer_list[i].rcc = BufferSize;
+ info->tx_buffer_list[i].count = BufferSize;
/* Copy frame data from 1st source buffer to the DMA buffers. */
/* The frame data may span multiple DMA buffers. */
@@ -6613,6 +7255,9 @@
/* Get a pointer to next DMA buffer entry. */
pBufEntry = &info->tx_buffer_list[i++];
+ if ( i == info->tx_buffer_count )
+ i=0;
+
/* Calculate the number of bytes that can be copied from */
/* the source buffer to this DMA buffer. */
if ( BufferSize > DMABUFFERSIZE )
@@ -6632,8 +7277,13 @@
/* Advance source pointer and reduce remaining data count. */
Buffer += Copycount;
BufferSize -= Copycount;
+
+ ++info->tx_dma_buffers_used;
}
+ /* remember next available tx dma buffer */
+ info->current_tx_buffer = i;
+
} /* end of mgsl_load_tx_dma_buffer() */
/*
@@ -6764,7 +7414,7 @@
unsigned int i;
char *TmpPtr;
BOOLEAN rc = TRUE;
- unsigned short status;
+ unsigned short status=0;
unsigned long EndTime;
unsigned long flags;
MGSL_PARAMS tmp_params;
@@ -7021,7 +7671,7 @@
status = info->rx_buffer_list[0].status;
if ( status & (BIT8 + BIT3 + BIT1) ) {
- /* receive error has occured */
+ /* receive error has occurred */
rc = FALSE;
} else {
if ( memcmp( info->tx_buffer_list[0].virt_addr ,
@@ -7242,7 +7892,9 @@
if ( debug_level >= DEBUG_LEVEL_INFO )
printk( "%s(%d):mgsl_tx_timeout(%s)\n",
__FILE__,__LINE__,info->device_name);
- if(info->tx_active && info->params.mode == MGSL_MODE_HDLC) {
+ if(info->tx_active &&
+ (info->params.mode == MGSL_MODE_HDLC ||
+ info->params.mode == MGSL_MODE_RAW) ) {
info->icount.txtimeout++;
}
spin_lock_irqsave(&info->irq_spinlock,flags);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/toshiba.c linux.20p7/drivers/char/toshiba.c
--- linux.vanilla/drivers/char/toshiba.c Sun Mar 25 18:45:19 2001
+++ linux.20p7/drivers/char/toshiba.c Wed Jul 4 16:03:54 2001
@@ -60,10 +60,8 @@
#define TOSH_VERSION "1.9 22/3/2001"
#define TOSH_DEBUG 0
-#ifdef MODULE
#include
#include
-#endif
#include
#include
#include
@@ -78,7 +76,7 @@
#include
#endif
-#include"toshiba.h"
+#include
#define TOSH_MINOR_DEV 181
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/tty_io.c linux.20p7/drivers/char/tty_io.c
--- linux.vanilla/drivers/char/tty_io.c Sun Mar 25 17:31:24 2001
+++ linux.20p7/drivers/char/tty_io.c Wed Jul 4 16:03:54 2001
@@ -2244,5 +2244,11 @@
#ifdef CONFIG_VT
vcs_init();
#endif
+#ifdef CONFIG_SYNCLINK
+ mgsl_init();
+#endif
+#ifdef CONFIG_N_HDLC
+ n_hdlc_init();
+#endif
return 0;
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/char/wdt_pci.c linux.20p7/drivers/char/wdt_pci.c
--- linux.vanilla/drivers/char/wdt_pci.c Sun Mar 25 17:31:29 2001
+++ linux.20p7/drivers/char/wdt_pci.c Wed Jul 4 16:03:54 2001
@@ -149,7 +149,7 @@
*
* Handle an interrupt from the board. These are raised when the status
* map changes in what the board considers an interesting way. That means
- * a failure condition occuring.
+ * a failure condition occurring.
*/
static void wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/i2o/i2o_scsi.c linux.20p7/drivers/i2o/i2o_scsi.c
--- linux.vanilla/drivers/i2o/i2o_scsi.c Sun Mar 25 17:31:44 2001
+++ linux.20p7/drivers/i2o/i2o_scsi.c Wed Jul 4 16:03:54 2001
@@ -266,7 +266,7 @@
if(st)
{
- /* An error has occured */
+ /* An error has occurred */
dprintk((KERN_DEBUG "SCSI error %08X", m[4]));
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/Config.in linux.20p7/drivers/isdn/Config.in
--- linux.vanilla/drivers/isdn/Config.in Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/isdn/Config.in Wed Jul 4 16:03:54 2001
@@ -132,7 +132,7 @@
dep_tristate ' AVM T1/T1-B ISA support' CONFIG_ISDN_DRV_AVMB1_T1ISA $CONFIG_ISDN_CAPI
dep_tristate ' AVM B1/M1/M2 PCMCIA support' CONFIG_ISDN_DRV_AVMB1_B1PCMCIA $CONFIG_ISDN_CAPI $CONFIG_PCMCIA
dep_tristate ' AVM T1/T1-B PCI support' CONFIG_ISDN_DRV_AVMB1_T1PCI $CONFIG_ISDN_CAPI $CONFIG_PCI
- dep_tristate ' AVM C4 support' CONFIG_ISDN_DRV_AVMB1_C4 $CONFIG_ISDN_CAPI $CONFIG_PCI
+ dep_tristate ' AVM C4/C2 support' CONFIG_ISDN_DRV_AVMB1_C4 $CONFIG_ISDN_CAPI $CONFIG_PCI
fi
# HYSDN
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/act2000/act2000.h linux.20p7/drivers/isdn/act2000/act2000.h
--- linux.vanilla/drivers/isdn/act2000/act2000.h Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/isdn/act2000/act2000.h Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-/* $Id: act2000.h,v 1.8.6.1 2001/02/10 14:41:20 kai Exp $
+/* $Id: act2000.h,v 1.8.6.2 2001/02/16 16:43:23 kai Exp $
*
* ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/act2000/capi.c linux.20p7/drivers/isdn/act2000/capi.c
--- linux.vanilla/drivers/isdn/act2000/capi.c Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/isdn/act2000/capi.c Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-/* $Id: capi.c,v 1.9 2000/11/12 16:32:06 kai Exp $
+/* $Id: capi.c,v 1.9.6.1 2001/02/16 16:43:23 kai Exp $
*
* ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
* CAPI encoder/decoder
@@ -124,7 +124,7 @@
m->hdr.cmd.cmd = c; \
m->hdr.cmd.subcmd = s; \
m->hdr.msgnum = actcapi_nextsmsg(card); \
- } \
+ } else m = NULL;\
}
#define ACTCAPI_CHKSKB if (!skb) { \
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/act2000/capi.h linux.20p7/drivers/isdn/act2000/capi.h
--- linux.vanilla/drivers/isdn/act2000/capi.h Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/isdn/act2000/capi.h Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-/* $Id: capi.h,v 1.6 2000/11/12 16:32:06 kai Exp $
+/* $Id: capi.h,v 1.6.6.1 2001/02/16 16:43:23 kai Exp $
*
* ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
*
@@ -44,7 +44,7 @@
char *description;
} actcapi_msgdsc;
-/* CAPI Adress */
+/* CAPI Address */
typedef struct actcapi_addr {
__u8 len; /* Length of element */
__u8 tnp; /* Type/Numbering Plan */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/avmcard.h linux.20p7/drivers/isdn/avmb1/avmcard.h
--- linux.vanilla/drivers/isdn/avmb1/avmcard.h Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/isdn/avmb1/avmcard.h Wed Jul 4 16:03:54 2001
@@ -1,57 +1,8 @@
/*
- * $Id: avmcard.h,v 1.8 2000/10/10 17:44:19 kai Exp $
+ * $Id: avmcard.h,v 1.8.6.3 2001/05/17 21:15:33 kai Exp $
*
* Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
*
- * $Log: avmcard.h,v $
- * Revision 1.8 2000/10/10 17:44:19 kai
- * changes from/for 2.2.18
- *
- * Revision 1.7 2000/01/25 14:33:38 calle
- * - Added Support AVM B1 PCI V4.0 (tested with prototype)
- * - splitted up t1pci.c into b1dma.c for common function with b1pciv4
- * - support for revision register
- *
- * Revision 1.6 1999/11/05 16:38:01 calle
- * Cleanups before kernel 2.4:
- * - Changed all messages to use card->name or driver->name instead of
- * constant string.
- * - Moved some data from struct avmcard into new struct avmctrl_info.
- * Changed all lowlevel capi driver to match the new structur.
- *
- * Revision 1.5 1999/09/07 09:02:53 calle
- * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and
- * DATA_B3_IND is always directly after the CAPI message. The "Data" member
- * ist never used inside the kernel.
- *
- * Revision 1.4 1999/08/04 10:10:08 calle
- * Bugfix: corrected /proc functions, added structure for new AVM cards.
- *
- * Revision 1.3 1999/07/23 08:41:47 calle
- * prepared for new AVM cards.
- *
- * Revision 1.2 1999/07/05 15:09:45 calle
- * - renamed "appl_release" to "appl_released".
- * - version und profile data now cleared on controller reset
- * - extended /proc interface, to allow driver and controller specific
- * informations to include by driver hackers.
- *
- * Revision 1.1 1999/07/01 15:26:22 calle
- * complete new version (I love it):
- * + new hardware independed "capi_driver" interface that will make it easy to:
- * - support other controllers with CAPI-2.0 (i.e. USB Controller)
- * - write a CAPI-2.0 for the passive cards
- * - support serial link CAPI-2.0 boxes.
- * + wrote "capi_driver" for all supported cards.
- * + "capi_driver" (supported cards) now have to be configured with
- * make menuconfig, in the past all supported cards where included
- * at once.
- * + new and better informations in /proc/capi/
- * + new ioctl to switch trace of capi messages per controller
- * using "avmcapictrl trace [contr] on|off|...."
- * + complete testcircle with all supported cards and also the
- * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done.
- *
*/
#ifndef _AVMCARD_H_
@@ -59,7 +10,6 @@
#define AVMB1_PORTLEN 0x1f
#define AVM_MAXVERSION 8
-#define AVM_NAPPS 30
#define AVM_NCCI_PER_CHANNEL 4
/*
@@ -83,7 +33,8 @@
avm_m2,
avm_t1isa,
avm_t1pci,
- avm_c4
+ avm_c4,
+ avm_c2
};
typedef struct avmcard_dmainfo {
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/b1.c linux.20p7/drivers/isdn/avmb1/b1.c
--- linux.vanilla/drivers/isdn/avmb1/b1.c Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/isdn/avmb1/b1.c Wed Jul 4 16:03:54 2001
@@ -1,105 +1,9 @@
/*
- * $Id: b1.c,v 1.20.6.1 2001/02/13 11:43:29 kai Exp $
+ * $Id: b1.c,v 1.20.6.6 2001/05/17 21:15:33 kai Exp $
*
* Common module for AVM B1 cards.
*
* (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
- *
- * $Log: b1.c,v $
- * Revision 1.20.6.1 2001/02/13 11:43:29 kai
- * more compatility changes for 2.2.19
- *
- * Revision 1.20 2000/11/23 20:45:14 kai
- * fixed module_init/exit stuff
- * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
- *
- * Revision 1.19 2000/11/19 17:02:47 kai
- * compatibility cleanup - part 3
- *
- * Revision 1.18 2000/11/19 17:01:53 kai
- * compatibility cleanup - part 2
- *
- * Revision 1.17 2000/11/01 14:05:02 calle
- * - use module_init/module_exit from linux/init.h.
- * - all static struct variables are initialized with "membername:" now.
- * - avm_cs.c, let it work with newer pcmcia-cs.
- *
- * Revision 1.16 2000/08/04 15:36:31 calle
- * copied wrong from file to file :-(
- *
- * Revision 1.15 2000/08/04 12:20:08 calle
- * - Fix unsigned/signed warning in the right way ...
- *
- * Revision 1.14 2000/06/19 16:51:53 keil
- * don't free skb in irq context
- *
- * Revision 1.13 2000/01/25 14:33:38 calle
- * - Added Support AVM B1 PCI V4.0 (tested with prototype)
- * - splitted up t1pci.c into b1dma.c for common function with b1pciv4
- * - support for revision register
- *
- * Revision 1.12 1999/11/05 16:38:01 calle
- * Cleanups before kernel 2.4:
- * - Changed all messages to use card->name or driver->name instead of
- * constant string.
- * - Moved some data from struct avmcard into new struct avmctrl_info.
- * Changed all lowlevel capi driver to match the new structur.
- *
- * Revision 1.11 1999/10/11 22:04:12 keil
- * COMPAT_NEED_UACCESS (no include in isdn_compat.h)
- *
- * Revision 1.10 1999/09/15 08:16:03 calle
- * Implementation of 64Bit extention complete.
- *
- * Revision 1.9 1999/09/07 09:02:53 calle
- * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and
- * DATA_B3_IND is always directly after the CAPI message. The "Data" member
- * ist never used inside the kernel.
- *
- * Revision 1.8 1999/08/22 20:26:22 calle
- * backported changes from kernel 2.3.14:
- * - several #include "config.h" gone, others come.
- * - "struct device" changed to "struct net_device" in 2.3.14, added a
- * define in isdn_compat.h for older kernel versions.
- *
- * Revision 1.7 1999/08/04 10:10:09 calle
- * Bugfix: corrected /proc functions, added structure for new AVM cards.
- *
- * Revision 1.6 1999/07/23 08:51:04 calle
- * small fix and typo in checkin before.
- *
- * Revision 1.5 1999/07/23 08:41:48 calle
- * prepared for new AVM cards.
- *
- * Revision 1.4 1999/07/09 15:05:38 keil
- * compat.h is now isdn_compat.h
- *
- * Revision 1.3 1999/07/06 07:41:59 calle
- * - changes in /proc interface
- * - check and changed calls to [dev_]kfree_skb and [dev_]alloc_skb.
- *
- * Revision 1.2 1999/07/05 15:09:47 calle
- * - renamed "appl_release" to "appl_released".
- * - version und profile data now cleared on controller reset
- * - extended /proc interface, to allow driver and controller specific
- * informations to include by driver hackers.
- *
- * Revision 1.1 1999/07/01 15:26:23 calle
- * complete new version (I love it):
- * + new hardware independed "capi_driver" interface that will make it easy to:
- * - support other controllers with CAPI-2.0 (i.e. USB Controller)
- * - write a CAPI-2.0 for the passive cards
- * - support serial link CAPI-2.0 boxes.
- * + wrote "capi_driver" for all supported cards.
- * + "capi_driver" (supported cards) now have to be configured with
- * make menuconfig, in the past all supported cards where included
- * at once.
- * + new and better informations in /proc/capi/
- * + new ioctl to switch trace of capi messages per controller
- * using "avmcapictrl trace [contr] on|off|...."
- * + complete testcircle with all supported cards and also the
- * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done.
- *
*
*/
@@ -111,15 +15,18 @@
#include
#include
#include
+#include
#include
#include
+#include
#include
+#include
#include "capilli.h"
#include "avmcard.h"
#include "capicmd.h"
#include "capiutil.h"
-static char *revision = "$Revision: 1.20.6.1 $";
+static char *revision = "$Revision: 1.20.6.6 $";
/* ------------------------------------------------------------- */
@@ -364,7 +271,7 @@
cli();
b1_setinterrupt(port, card->irq, card->cardtype);
b1_put_byte(port, SEND_INIT);
- b1_put_word(port, AVM_NAPPS);
+ b1_put_word(port, CAPI_MAXAPPL);
b1_put_word(port, AVM_NCCI_PER_CHANNEL*2);
b1_put_word(port, ctrl->cnr - 1);
restore_flags(flags);
@@ -679,6 +586,7 @@
case avm_t1isa: s = "T1 ISA (HEMA)"; break;
case avm_t1pci: s = "T1 PCI"; break;
case avm_c4: s = "C4"; break;
+ case avm_c2: s = "C2"; break;
default: s = "???"; break;
}
len += sprintf(page+len, "%-16s %s\n", "type", s);
@@ -749,12 +657,13 @@
static int __init b1_init(void)
{
char *p;
- char rev[10];
+ char rev[32];
- if ((p = strchr(revision, ':'))) {
- strncpy(rev, p + 1, sizeof(rev));
- p = strchr(rev, '$');
- *p = 0;
+ if ((p = strchr(revision, ':')) != 0 && p[1]) {
+ strncpy(rev, p + 2, sizeof(rev));
+ rev[sizeof(rev)-1] = 0;
+ if ((p = strchr(rev, '$')) != 0 && p > rev)
+ *(p-1) = 0;
} else
strcpy(rev, "1.0");
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/b1dma.c linux.20p7/drivers/isdn/avmb1/b1dma.c
--- linux.vanilla/drivers/isdn/avmb1/b1dma.c Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/isdn/avmb1/b1dma.c Wed Jul 4 16:03:54 2001
@@ -1,50 +1,10 @@
/*
- * $Id: b1dma.c,v 1.11.6.1 2001/02/13 11:43:29 kai Exp $
+ * $Id: b1dma.c,v 1.11.6.6 2001/05/17 21:15:33 kai Exp $
*
* Common module for AVM B1 cards that support dma with AMCC
*
* (c) Copyright 2000 by Carsten Paeth (calle@calle.in-berlin.de)
*
- * $Log: b1dma.c,v $
- * Revision 1.11.6.1 2001/02/13 11:43:29 kai
- * more compatility changes for 2.2.19
- *
- * Revision 1.11 2000/11/19 17:02:47 kai
- * compatibility cleanup - part 3
- *
- * Revision 1.10 2000/11/19 17:01:53 kai
- * compatibility cleanup - part 2
- *
- * Revision 1.9 2000/11/01 14:05:02 calle
- * - use module_init/module_exit from linux/init.h.
- * - all static struct variables are initialized with "membername:" now.
- * - avm_cs.c, let it work with newer pcmcia-cs.
- *
- * Revision 1.8 2000/10/10 17:44:19 kai
- * changes from/for 2.2.18
- *
- * Revision 1.7 2000/08/04 12:20:08 calle
- * - Fix unsigned/signed warning in the right way ...
- *
- * Revision 1.6 2000/06/29 13:59:06 calle
- * Bugfix: reinit txdma without interrupt will confuse some AMCC chips.
- *
- * Revision 1.5 2000/06/19 16:51:53 keil
- * don't free skb in irq context
- *
- * Revision 1.4 2000/04/03 16:38:05 calle
- * made suppress_pollack static.
- *
- * Revision 1.3 2000/02/26 01:00:53 keil
- * changes from 2.3.47
- *
- * Revision 1.2 2000/01/25 14:44:47 calle
- * typo in b1pciv4_detect().
- *
- * Revision 1.1 2000/01/25 14:36:43 calle
- * common function for T1 PCI and B1 PCI V4.
- *
- *
*/
#include
@@ -56,15 +16,18 @@
#include
#include
#include
+#include
#include
#include
+#include
#include
+#include
#include "capilli.h"
#include "avmcard.h"
#include "capicmd.h"
#include "capiutil.h"
-static char *revision = "$Revision: 1.11.6.1 $";
+static char *revision = "$Revision: 1.11.6.6 $";
/* ------------------------------------------------------------- */
@@ -721,7 +684,7 @@
_put_byte(&p, 0);
_put_byte(&p, 0);
_put_byte(&p, SEND_INIT);
- _put_word(&p, AVM_NAPPS);
+ _put_word(&p, CAPI_MAXAPPL);
_put_word(&p, AVM_NCCI_PER_CHANNEL*30);
_put_word(&p, card->cardnr - 1);
skb_put(skb, (__u8 *)p - (__u8 *)skb->data);
@@ -900,6 +863,7 @@
case avm_t1isa: s = "T1 ISA (HEMA)"; break;
case avm_t1pci: s = "T1 PCI"; break;
case avm_c4: s = "C4"; break;
+ case avm_c2: s = "C2"; break;
default: s = "???"; break;
}
len += sprintf(page+len, "%-16s %s\n", "type", s);
@@ -990,12 +954,13 @@
int b1dma_init(void)
{
char *p;
- char rev[10];
+ char rev[32];
- if ((p = strchr(revision, ':'))) {
- strncpy(rev, p + 1, sizeof(rev));
- p = strchr(rev, '$');
- *p = 0;
+ if ((p = strchr(revision, ':')) != 0 && p[1]) {
+ strncpy(rev, p + 2, sizeof(rev));
+ rev[sizeof(rev)-1] = 0;
+ if ((p = strchr(rev, '$')) != 0 && p > rev)
+ *(p-1) = 0;
} else
strcpy(rev, "1.0");
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/b1isa.c linux.20p7/drivers/isdn/avmb1/b1isa.c
--- linux.vanilla/drivers/isdn/avmb1/b1isa.c Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/isdn/avmb1/b1isa.c Wed Jul 4 16:03:54 2001
@@ -1,74 +1,10 @@
/*
- * $Id: b1isa.c,v 1.10.6.1 2001/02/13 11:43:29 kai Exp $
+ * $Id: b1isa.c,v 1.10.6.5 2001/05/17 20:41:51 kai Exp $
*
* Module for AVM B1 ISA-card.
*
* (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
*
- * $Log: b1isa.c,v $
- * Revision 1.10.6.1 2001/02/13 11:43:29 kai
- * more compatility changes for 2.2.19
- *
- * Revision 1.10 2000/11/23 20:45:14 kai
- * fixed module_init/exit stuff
- * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
- *
- * Revision 1.9 2000/11/01 14:05:02 calle
- * - use module_init/module_exit from linux/init.h.
- * - all static struct variables are initialized with "membername:" now.
- * - avm_cs.c, let it work with newer pcmcia-cs.
- *
- * Revision 1.8 2000/04/03 13:29:24 calle
- * make Tim Waugh happy (module unload races in 2.3.99-pre3).
- * no real problem there, but now it is much cleaner ...
- *
- * Revision 1.7 2000/02/02 18:36:03 calle
- * - Modules are now locked while init_module is running
- * - fixed problem with memory mapping if address is not aligned
- *
- * Revision 1.6 2000/01/25 14:37:39 calle
- * new message after successfull detection including card revision and
- * used resources.
- *
- * Revision 1.5 1999/11/05 16:38:01 calle
- * Cleanups before kernel 2.4:
- * - Changed all messages to use card->name or driver->name instead of
- * constant string.
- * - Moved some data from struct avmcard into new struct avmctrl_info.
- * Changed all lowlevel capi driver to match the new structur.
- *
- * Revision 1.4 1999/08/22 20:26:24 calle
- * backported changes from kernel 2.3.14:
- * - several #include "config.h" gone, others come.
- * - "struct device" changed to "struct net_device" in 2.3.14, added a
- * define in isdn_compat.h for older kernel versions.
- *
- * Revision 1.3 1999/07/09 15:05:40 keil
- * compat.h is now isdn_compat.h
- *
- * Revision 1.2 1999/07/05 15:09:49 calle
- * - renamed "appl_release" to "appl_released".
- * - version und profile data now cleared on controller reset
- * - extended /proc interface, to allow driver and controller specific
- * informations to include by driver hackers.
- *
- * Revision 1.1 1999/07/01 15:26:27 calle
- * complete new version (I love it):
- * + new hardware independed "capi_driver" interface that will make it easy to:
- * - support other controllers with CAPI-2.0 (i.e. USB Controller)
- * - write a CAPI-2.0 for the passive cards
- * - support serial link CAPI-2.0 boxes.
- * + wrote "capi_driver" for all supported cards.
- * + "capi_driver" (supported cards) now have to be configured with
- * make menuconfig, in the past all supported cards where included
- * at once.
- * + new and better informations in /proc/capi/
- * + new ioctl to switch trace of capi messages per controller
- * using "avmcapictrl trace [contr] on|off|...."
- * + complete testcircle with all supported cards and also the
- * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done.
- *
- *
*/
#include
@@ -81,12 +17,13 @@
#include
#include
#include
+#include
#include "capicmd.h"
#include "capiutil.h"
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.10.6.1 $";
+static char *revision = "$Revision: 1.10.6.5 $";
/* ------------------------------------------------------------- */
@@ -281,11 +218,12 @@
MOD_INC_USE_COUNT;
- if ((p = strchr(revision, ':'))) {
- strncpy(driver->revision, p + 1, sizeof(driver->revision));
- p = strchr(driver->revision, '$');
- *p = 0;
- }
+ if ((p = strchr(revision, ':')) != 0 && p[1]) {
+ strncpy(driver->revision, p + 2, sizeof(driver->revision));
+ driver->revision[sizeof(driver->revision)-1] = 0;
+ if ((p = strchr(driver->revision, '$')) != 0 && p > driver->revision)
+ *(p-1) = 0;
+ }
printk(KERN_INFO "%s: revision %s\n", driver->name, driver->revision);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/b1pci.c linux.20p7/drivers/isdn/avmb1/b1pci.c
--- linux.vanilla/drivers/isdn/avmb1/b1pci.c Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/isdn/avmb1/b1pci.c Wed Jul 4 16:03:54 2001
@@ -1,105 +1,10 @@
/*
- * $Id: b1pci.c,v 1.29.6.1 2000/11/28 12:02:45 kai Exp $
+ * $Id: b1pci.c,v 1.29.6.4 2001/05/17 20:41:51 kai Exp $
*
* Module for AVM B1 PCI-card.
*
* (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
*
- * $Log: b1pci.c,v $
- * Revision 1.29.6.1 2000/11/28 12:02:45 kai
- * MODULE_DEVICE_TABLE for 2.4
- *
- * Revision 1.29.2.2 2000/11/26 17:47:53 kai
- * added PCI_DEV_TABLE for 2.4
- *
- * Revision 1.29.2.1 2000/11/26 17:14:19 kai
- * fix device ids
- * also needs patches to include/linux/pci_ids.h
- *
- * Revision 1.29 2000/11/23 20:45:14 kai
- * fixed module_init/exit stuff
- * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
- *
- * Revision 1.28 2000/11/01 14:05:02 calle
- * - use module_init/module_exit from linux/init.h.
- * - all static struct variables are initialized with "membername:" now.
- * - avm_cs.c, let it work with newer pcmcia-cs.
- *
- * Revision 1.27 2000/08/08 09:24:19 calle
- * calls to pci_enable_device surounded by #ifndef COMPAT_HAS_2_2_PCI
- *
- * Revision 1.26 2000/07/20 10:21:21 calle
- * Bugfix: driver will not be unregistered, if not cards were detected.
- * this result in an oops in kcapi.c
- *
- * Revision 1.25 2000/05/29 12:29:18 keil
- * make pci_enable_dev compatible to 2.2 kernel versions
- *
- * Revision 1.24 2000/05/19 15:43:22 calle
- * added calls to pci_device_start().
- *
- * Revision 1.23 2000/05/06 00:52:36 kai
- * merged changes from kernel tree
- * fixed timer and net_device->name breakage
- *
- * Revision 1.22 2000/04/21 13:01:33 calle
- * Revision in b1pciv4 driver was missing.
- *
- * Revision 1.21 2000/04/03 13:29:24 calle
- * make Tim Waugh happy (module unload races in 2.3.99-pre3).
- * no real problem there, but now it is much cleaner ...
- *
- * Revision 1.20 2000/02/02 18:36:03 calle
- * - Modules are now locked while init_module is running
- * - fixed problem with memory mapping if address is not aligned
- *
- * Revision 1.19 2000/01/25 14:33:38 calle
- * - Added Support AVM B1 PCI V4.0 (tested with prototype)
- * - splitted up t1pci.c into b1dma.c for common function with b1pciv4
- * - support for revision register
- *
- * Revision 1.18 1999/11/05 16:38:01 calle
- * Cleanups before kernel 2.4:
- * - Changed all messages to use card->name or driver->name instead of
- * constant string.
- * - Moved some data from struct avmcard into new struct avmctrl_info.
- * Changed all lowlevel capi driver to match the new structur.
- *
- * Revision 1.17 1999/10/05 06:50:07 calle
- * Forgot SA_SHIRQ as argument to request_irq.
- *
- * Revision 1.16 1999/08/11 21:01:07 keil
- * new PCI codefix
- *
- * Revision 1.15 1999/08/10 16:02:27 calle
- * struct pci_dev changed in 2.3.13. Made the necessary changes.
- *
- * Revision 1.14 1999/07/09 15:05:41 keil
- * compat.h is now isdn_compat.h
- *
- * Revision 1.13 1999/07/05 15:09:50 calle
- * - renamed "appl_release" to "appl_released".
- * - version und profile data now cleared on controller reset
- * - extended /proc interface, to allow driver and controller specific
- * informations to include by driver hackers.
- *
- * Revision 1.12 1999/07/01 15:26:29 calle
- * complete new version (I love it):
- * + new hardware independed "capi_driver" interface that will make it easy to:
- * - support other controllers with CAPI-2.0 (i.e. USB Controller)
- * - write a CAPI-2.0 for the passive cards
- * - support serial link CAPI-2.0 boxes.
- * + wrote "capi_driver" for all supported cards.
- * + "capi_driver" (supported cards) now have to be configured with
- * make menuconfig, in the past all supported cards where included
- * at once.
- * + new and better informations in /proc/capi/
- * + new ioctl to switch trace of capi messages per controller
- * using "avmcapictrl trace [contr] on|off|...."
- * + complete testcircle with all supported cards and also the
- * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done.
- *
- *
*/
#include
@@ -120,7 +25,7 @@
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.29.6.1 $";
+static char *revision = "$Revision: 1.29.6.4 $";
/* ------------------------------------------------------------- */
@@ -319,7 +224,7 @@
div4->detach_ctr(ctrl);
free_irq(card->irq, card);
- iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK));
+ iounmap(card->mbase);
release_region(card->port, AVMB1_PORTLEN);
ctrl->driverdata = 0;
kfree(card->ctrlinfo);
@@ -350,7 +255,6 @@
static int b1pciv4_add_card(struct capi_driver *driver, struct capicardparams *p)
{
- unsigned long base, page_offset;
avmcard *card;
avmctrl_info *cinfo;
int retval;
@@ -401,12 +305,8 @@
return -EBUSY;
}
- base = card->membase & PAGE_MASK;
- page_offset = card->membase - base;
- card->mbase = ioremap_nocache(base, page_offset + 64);
- if (card->mbase) {
- card->mbase += page_offset;
- } else {
+ card->mbase = ioremap_nocache(card->membase, 64);
+ if (!card->mbase) {
printk(KERN_NOTICE "%s: can't remap memory at 0x%lx\n",
driver->name, card->membase);
kfree(card->ctrlinfo);
@@ -421,7 +321,7 @@
if ((retval = b1pciv4_detect(card)) != 0) {
printk(KERN_NOTICE "%s: NO card at 0x%x (%d)\n",
driver->name, card->port, retval);
- iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK));
+ iounmap(card->mbase);
kfree(card->ctrlinfo);
kfree(card->dma);
kfree(card);
@@ -437,7 +337,7 @@
if (retval) {
printk(KERN_ERR "%s: unable to get IRQ %d.\n",
driver->name, card->irq);
- iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK));
+ iounmap(card->mbase);
release_region(card->port, AVMB1_PORTLEN);
kfree(card->ctrlinfo);
kfree(card->dma);
@@ -449,7 +349,7 @@
cinfo->capi_ctrl = div4->attach_ctr(driver, card->name, cinfo);
if (!cinfo->capi_ctrl) {
printk(KERN_ERR "%s: attach controller failed.\n", driver->name);
- iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK));
+ iounmap(card->mbase);
free_irq(card->irq, card);
release_region(card->port, AVMB1_PORTLEN);
kfree(card->ctrlinfo);
@@ -500,14 +400,21 @@
struct capicardparams param;
int retval;
+ if (pci_enable_device(dev) < 0) {
+ printk(KERN_ERR "%s: failed to enable AVM-B1\n",
+ driver->name);
+ return -ENODEV;
+ }
+ param.irq = dev->irq;
+
if (dev->base_address[ 2] & PCI_BASE_ADDRESS_IO_MASK) { /* B1 PCI V4 */
#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
driver = &b1pciv4_driver;
+
+ pci_set_master(dev);
#endif
param.membase = dev->base_address[ 0] & PCI_BASE_ADDRESS_MEM_MASK;
param.port = dev->base_address[ 2] & PCI_BASE_ADDRESS_IO_MASK;
- param.irq = dev->irq;
-
printk(KERN_INFO
"%s: PCI BIOS reports AVM-B1 V4 at i/o %#x, irq %d, mem %#x\n",
@@ -525,7 +432,6 @@
} else {
param.membase = 0;
param.port = dev->base_address[ 1] & PCI_BASE_ADDRESS_IO_MASK;
- param.irq = dev->irq;
printk(KERN_INFO
"%s: PCI BIOS reports AVM-B1 at i/o %#x, irq %d\n",
@@ -548,69 +454,50 @@
#endif
struct pci_dev *dev = NULL;
char *p;
- int retval;
MOD_INC_USE_COUNT;
- if ((p = strchr(revision, ':'))) {
- strncpy(driver->revision, p + 1, sizeof(driver->revision));
- p = strchr(driver->revision, '$');
- *p = 0;
+ if ((p = strchr(revision, ':')) != 0 && p[1]) {
+ strncpy(driver->revision, p + 2, sizeof(driver->revision));
+ driver->revision[sizeof(driver->revision)-1] = 0;
+ if ((p = strchr(driver->revision, '$')) != 0 && p > driver->revision)
+ *(p-1) = 0;
+ }
#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
- p = strchr(revision, ':');
- strncpy(driverv4->revision, p + 1, sizeof(driverv4->revision));
- p = strchr(driverv4->revision, '$');
- *p = 0;
-#endif
+ if ((p = strchr(revision, ':')) != 0 && p[1]) {
+ strncpy(driverv4->revision, p + 2, sizeof(driverv4->revision));
+ driverv4->revision[sizeof(driverv4->revision)-1] = 0;
+ if ((p = strchr(driverv4->revision, '$')) != 0 && p > driverv4->revision)
+ *(p-1) = 0;
}
+#endif
printk(KERN_INFO "%s: revision %s\n", driver->name, driver->revision);
di = attach_capi_driver(driver);
-
if (!di) {
printk(KERN_ERR "%s: failed to attach capi_driver\n",
driver->name);
MOD_DEC_USE_COUNT;
- return -EIO;
+ return -ENODEV;
}
#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
printk(KERN_INFO "%s: revision %s\n", driverv4->name, driverv4->revision);
div4 = attach_capi_driver(driverv4);
-
if (!div4) {
detach_capi_driver(driver);
printk(KERN_ERR "%s: failed to attach capi_driver\n",
driverv4->name);
MOD_DEC_USE_COUNT;
- return -EIO;
+ return -ENODEV;
}
#endif
-#ifdef CONFIG_PCI
- if (!pci_present()) {
- printk(KERN_ERR "%s: no PCI bus present\n", driver->name);
- detach_capi_driver(driver);
-#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
- detach_capi_driver(driverv4);
-#endif
- MOD_DEC_USE_COUNT;
- return -EIO;
- }
-
while ((dev = pci_find_device(PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_B1, dev))) {
- retval = add_card(dev);
- if (retval != 0) {
- detach_capi_driver(driver);
-#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
- detach_capi_driver(driverv4);
-#endif
- MOD_DEC_USE_COUNT;
- return retval;
- }
- ncards++;
+ if (add_card(dev) == 0)
+ ncards++;
}
if (ncards) {
printk(KERN_INFO "%s: %d B1-PCI card(s) detected\n",
@@ -624,12 +511,7 @@
detach_capi_driver(driverv4);
#endif
MOD_DEC_USE_COUNT;
- return -ESRCH;
-#else
- printk(KERN_ERR "%s: kernel not compiled with PCI.\n", driver->name);
- MOD_DEC_USE_COUNT;
- return -EIO;
-#endif
+ return -ENODEV;
}
static void b1pci_exit(void)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/b1pcmcia.c linux.20p7/drivers/isdn/avmb1/b1pcmcia.c
--- linux.vanilla/drivers/isdn/avmb1/b1pcmcia.c Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/isdn/avmb1/b1pcmcia.c Wed Jul 4 16:03:54 2001
@@ -1,83 +1,10 @@
/*
- * $Id: b1pcmcia.c,v 1.12.6.1 2001/02/13 11:43:29 kai Exp $
+ * $Id: b1pcmcia.c,v 1.12.6.4 2001/05/17 20:41:51 kai Exp $
*
* Module for AVM B1/M1/M2 PCMCIA-card.
*
* (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
*
- * $Log: b1pcmcia.c,v $
- * Revision 1.12.6.1 2001/02/13 11:43:29 kai
- * more compatility changes for 2.2.19
- *
- * Revision 1.12 2000/11/23 20:45:14 kai
- * fixed module_init/exit stuff
- * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
- *
- * Revision 1.11 2000/11/01 14:05:02 calle
- * - use module_init/module_exit from linux/init.h.
- * - all static struct variables are initialized with "membername:" now.
- * - avm_cs.c, let it work with newer pcmcia-cs.
- *
- * Revision 1.10 2000/05/06 00:52:36 kai
- * merged changes from kernel tree
- * fixed timer and net_device->name breakage
- *
- * Revision 1.9 2000/04/03 13:29:24 calle
- * make Tim Waugh happy (module unload races in 2.3.99-pre3).
- * no real problem there, but now it is much cleaner ...
- *
- * Revision 1.8 2000/03/06 18:00:23 calle
- * - Middleware extention now working with 2.3.49 (capifs).
- * - Fixed typos in debug section of capi.c
- * - Bugfix: Makefile corrected for b1pcmcia.c
- *
- * Revision 1.7 2000/02/02 18:36:03 calle
- * - Modules are now locked while init_module is running
- * - fixed problem with memory mapping if address is not aligned
- *
- * Revision 1.6 2000/01/25 14:37:39 calle
- * new message after successfull detection including card revision and
- * used resources.
- *
- * Revision 1.5 1999/11/05 16:38:01 calle
- * Cleanups before kernel 2.4:
- * - Changed all messages to use card->name or driver->name instead of
- * constant string.
- * - Moved some data from struct avmcard into new struct avmctrl_info.
- * Changed all lowlevel capi driver to match the new structur.
- *
- * Revision 1.4 1999/08/22 20:26:26 calle
- * backported changes from kernel 2.3.14:
- * - several #include "config.h" gone, others come.
- * - "struct device" changed to "struct net_device" in 2.3.14, added a
- * define in isdn_compat.h for older kernel versions.
- *
- * Revision 1.3 1999/07/09 15:05:41 keil
- * compat.h is now isdn_compat.h
- *
- * Revision 1.2 1999/07/05 15:09:51 calle
- * - renamed "appl_release" to "appl_released".
- * - version und profile data now cleared on controller reset
- * - extended /proc interface, to allow driver and controller specific
- * informations to include by driver hackers.
- *
- * Revision 1.1 1999/07/01 15:26:30 calle
- * complete new version (I love it):
- * + new hardware independed "capi_driver" interface that will make it easy to:
- * - support other controllers with CAPI-2.0 (i.e. USB Controller)
- * - write a CAPI-2.0 for the passive cards
- * - support serial link CAPI-2.0 boxes.
- * + wrote "capi_driver" for all supported cards.
- * + "capi_driver" (supported cards) now have to be configured with
- * make menuconfig, in the past all supported cards where included
- * at once.
- * + new and better informations in /proc/capi/
- * + new ioctl to switch trace of capi messages per controller
- * using "avmcapictrl trace [contr] on|off|...."
- * + complete testcircle with all supported cards and also the
- * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done.
- *
- *
*/
#include
@@ -96,7 +23,7 @@
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.12.6.1 $";
+static char *revision = "$Revision: 1.12.6.4 $";
/* ------------------------------------------------------------- */
@@ -321,10 +248,11 @@
MOD_INC_USE_COUNT;
- if ((p = strchr(revision, ':'))) {
- strncpy(driver->revision, p + 1, sizeof(driver->revision));
- p = strchr(driver->revision, '$');
- *p = 0;
+ if ((p = strchr(revision, ':')) != 0 && p[1]) {
+ strncpy(driver->revision, p + 2, sizeof(driver->revision));
+ driver->revision[sizeof(driver->revision)-1] = 0;
+ if ((p = strchr(driver->revision, '$')) != 0 && p > driver->revision)
+ *(p-1) = 0;
}
printk(KERN_INFO "%s: revision %s\n", driver->name, driver->revision);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/c4.c linux.20p7/drivers/isdn/avmb1/c4.c
--- linux.vanilla/drivers/isdn/avmb1/c4.c Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/isdn/avmb1/c4.c Wed Jul 4 16:03:54 2001
@@ -1,92 +1,9 @@
/*
- * $Id: c4.c,v 1.20.6.2 2001/02/13 11:43:29 kai Exp $
+ * $Id: c4.c,v 1.20.6.10 2001/06/09 15:14:15 kai Exp $
*
- * Module for AVM C4 card.
+ * Module for AVM C4 & C2 card.
*
* (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
- *
- * $Log: c4.c,v $
- * Revision 1.20.6.2 2001/02/13 11:43:29 kai
- * more compatility changes for 2.2.19
- *
- * Revision 1.20.6.1 2000/11/28 12:02:45 kai
- * MODULE_DEVICE_TABLE for 2.4
- *
- * Revision 1.20.2.2 2000/11/26 17:47:53 kai
- * added PCI_DEV_TABLE for 2.4
- *
- * Revision 1.20.2.1 2000/11/26 17:14:19 kai
- * fix device ids
- * also needs patches to include/linux/pci_ids.h
- *
- * Revision 1.20 2000/11/23 20:45:14 kai
- * fixed module_init/exit stuff
- * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
- *
- * Revision 1.19 2000/11/19 17:02:47 kai
- * compatibility cleanup - part 3
- *
- * Revision 1.18 2000/11/01 14:05:02 calle
- * - use module_init/module_exit from linux/init.h.
- * - all static struct variables are initialized with "membername:" now.
- * - avm_cs.c, let it work with newer pcmcia-cs.
- *
- * Revision 1.17 2000/10/10 17:44:19 kai
- * changes from/for 2.2.18
- *
- * Revision 1.16 2000/08/20 07:30:13 keil
- * changes for 2.4
- *
- * Revision 1.15 2000/08/08 09:24:19 calle
- * calls to pci_enable_device surounded by #ifndef COMPAT_HAS_2_2_PCI
- *
- * Revision 1.14 2000/08/04 12:20:08 calle
- * - Fix unsigned/signed warning in the right way ...
- *
- * Revision 1.13 2000/07/20 10:21:21 calle
- * Bugfix: driver will not be unregistered, if not cards were detected.
- * this result in an oops in kcapi.c
- *
- * Revision 1.12 2000/06/19 16:51:53 keil
- * don't free skb in irq context
- *
- * Revision 1.11 2000/06/19 15:11:24 keil
- * avoid use of freed structs
- * changes from 2.4.0-ac21
- *
- * Revision 1.10 2000/05/29 12:29:18 keil
- * make pci_enable_dev compatible to 2.2 kernel versions
- *
- * Revision 1.9 2000/05/19 15:43:22 calle
- * added calls to pci_device_start().
- *
- * Revision 1.8 2000/04/03 16:38:05 calle
- * made suppress_pollack static.
- *
- * Revision 1.7 2000/04/03 13:29:24 calle
- * make Tim Waugh happy (module unload races in 2.3.99-pre3).
- * no real problem there, but now it is much cleaner ...
- *
- * Revision 1.6 2000/03/17 12:21:08 calle
- * send patchvalues now working.
- *
- * Revision 1.5 2000/03/16 15:21:03 calle
- * Bugfix in c4_remove: loop 5 times instead of 4 :-(
- *
- * Revision 1.4 2000/02/02 18:36:03 calle
- * - Modules are now locked while init_module is running
- * - fixed problem with memory mapping if address is not aligned
- *
- * Revision 1.3 2000/01/25 14:37:39 calle
- * new message after successfull detection including card revision and
- * used resources.
- *
- * Revision 1.2 2000/01/21 20:52:58 keil
- * pci_find_subsys as local function for 2.2.X kernel
- *
- * Revision 1.1 2000/01/20 10:51:37 calle
- * Added driver for C4.
- *
*
*/
@@ -101,15 +18,17 @@
#include
#include
#include
+#include
#include
#include
#include
+#include
#include "capicmd.h"
#include "capiutil.h"
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.20.6.2 $";
+static char *revision = "$Revision: 1.20.6.10 $";
#undef CONFIG_C4_DEBUG
#undef CONFIG_C4_POLLDEBUG
@@ -599,7 +518,7 @@
MsgLen = _get_slice(&p, card->msgbuf);
DataB3Len = _get_slice(&p, card->databuf);
cidx = CAPIMSG_CONTROLLER(card->msgbuf)-card->cardnr;
- if (cidx > 3) cidx = 0;
+ if (cidx >= card->nlogcontr) cidx = 0;
ctrl = card->ctrlinfo[cidx].capi_ctrl;
if (MsgLen < 30) { /* not CAPI 64Bit */
@@ -622,7 +541,7 @@
ApplId = (unsigned) _get_word(&p);
MsgLen = _get_slice(&p, card->msgbuf);
cidx = CAPIMSG_CONTROLLER(card->msgbuf)-card->cardnr;
- if (cidx > 3) cidx = 0;
+ if (cidx >= card->nlogcontr) cidx = 0;
ctrl = card->ctrlinfo[cidx].capi_ctrl;
if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) {
@@ -640,7 +559,7 @@
NCCI = _get_word(&p);
WindowSize = _get_word(&p);
cidx = (NCCI&0x7f) - card->cardnr;
- if (cidx > 3) cidx = 0;
+ if (cidx >= card->nlogcontr) cidx = 0;
ctrl = card->ctrlinfo[cidx].capi_ctrl;
ctrl->new_ncci(ctrl, ApplId, NCCI, WindowSize);
@@ -654,13 +573,15 @@
if (NCCI != 0xffffffff) {
cidx = (NCCI&0x7f) - card->cardnr;
- if (cidx > 3) cidx = 0;
+ if (cidx >= card->nlogcontr) cidx = 0;
ctrl = card->ctrlinfo[cidx].capi_ctrl;
- ctrl->free_ncci(ctrl, ApplId, NCCI);
+ if (ctrl)
+ ctrl->free_ncci(ctrl, ApplId, NCCI);
} else {
for (cidx=0; cidx < 4; cidx++) {
ctrl = card->ctrlinfo[cidx].capi_ctrl;
- ctrl->appl_released(ctrl, ApplId);
+ if (ctrl)
+ ctrl->appl_released(ctrl, ApplId);
}
}
break;
@@ -673,20 +594,28 @@
queue_pollack(card);
for (cidx=0; cidx < 4; cidx++) {
ctrl = card->ctrlinfo[cidx].capi_ctrl;
- ctrl->resume_output(ctrl);
+ if (ctrl)
+ ctrl->resume_output(ctrl);
}
break;
case RECEIVE_STOP:
for (cidx=0; cidx < 4; cidx++) {
ctrl = card->ctrlinfo[cidx].capi_ctrl;
- ctrl->suspend_output(ctrl);
+ if (ctrl)
+ ctrl->suspend_output(ctrl);
}
break;
case RECEIVE_INIT:
- cidx = card->nlogcontr++;
+ cidx = card->nlogcontr;
+ if (cidx >= 4 || !card->ctrlinfo[cidx].capi_ctrl) {
+ printk(KERN_ERR "%s: card with %d controllers ??\n",
+ card->name, cidx+1);
+ break;
+ }
+ card->nlogcontr++;
cinfo = &card->ctrlinfo[cidx];
ctrl = cinfo->capi_ctrl;
cinfo->versionlen = _get_slice(&p, cinfo->versionbuf);
@@ -740,6 +669,8 @@
if (status & DBELL_RESET_HOST) {
int i;
c4outmeml(card->mbase+PCI_OUT_INT_MASK, 0x0c);
+ if (card->nlogcontr == 0)
+ return;
printk(KERN_ERR "%s: unexpected reset\n", card->name);
for (i=0; i < 4; i++) {
avmctrl_info *cinfo = &card->ctrlinfo[i];
@@ -747,6 +678,7 @@
if (cinfo->capi_ctrl)
cinfo->capi_ctrl->reseted(cinfo->capi_ctrl);
}
+ card->nlogcontr = 0;
return;
}
@@ -815,7 +747,7 @@
_put_byte(&p, 0);
_put_byte(&p, 0);
_put_byte(&p, SEND_INIT);
- _put_word(&p, AVM_NAPPS);
+ _put_word(&p, CAPI_MAXAPPL);
_put_word(&p, AVM_NCCI_PER_CHANNEL*30);
_put_word(&p, card->cardnr - 1);
skb_put(skb, (__u8 *)p - (__u8 *)skb->data);
@@ -978,6 +910,7 @@
if (cinfo->capi_ctrl)
cinfo->capi_ctrl->reseted(cinfo->capi_ctrl);
}
+ card->nlogcontr = 0;
}
static void c4_remove_ctr(struct capi_ctr *ctrl)
@@ -997,7 +930,7 @@
}
free_irq(card->irq, card);
- iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK));
+ iounmap(card->mbase);
release_region(card->port, AVMB1_PORTLEN);
ctrl->driverdata = 0;
kfree(card->ctrlinfo);
@@ -1130,6 +1063,7 @@
case avm_t1isa: s = "T1 ISA (HEMA)"; break;
case avm_t1pci: s = "T1 PCI"; break;
case avm_c4: s = "C4"; break;
+ case avm_c2: s = "C2"; break;
default: s = "???"; break;
}
len += sprintf(page+len, "%-16s %s\n", "type", s);
@@ -1177,9 +1111,10 @@
/* ------------------------------------------------------------- */
-static int c4_add_card(struct capi_driver *driver, struct capicardparams *p)
+static int c4_add_card(struct capi_driver *driver,
+ struct capicardparams *p,
+ int nr)
{
- unsigned long base, page_offset;
avmctrl_info *cinfo;
avmcard *card;
int retval;
@@ -1217,11 +1152,11 @@
cinfo = &card->ctrlinfo[i];
cinfo->card = card;
}
- sprintf(card->name, "c4-%x", p->port);
+ sprintf(card->name, "%s-%x", driver->name, p->port);
card->port = p->port;
card->irq = p->irq;
card->membase = p->membase;
- card->cardtype = avm_c4;
+ card->cardtype = nr == 4 ? avm_c4 : avm_c2;
if (check_region(card->port, AVMB1_PORTLEN)) {
printk(KERN_WARNING
@@ -1234,12 +1169,8 @@
return -EBUSY;
}
- base = card->membase & PAGE_MASK;
- page_offset = card->membase - base;
- card->mbase = ioremap_nocache(base, page_offset + 128);
- if (card->mbase) {
- card->mbase += page_offset;
- } else {
+ card->mbase = ioremap_nocache(card->membase, 128);
+ if (card->mbase == 0) {
printk(KERN_NOTICE "%s: can't remap memory at 0x%lx\n",
driver->name, card->membase);
kfree(card->ctrlinfo);
@@ -1252,7 +1183,7 @@
if ((retval = c4_detect(card)) != 0) {
printk(KERN_NOTICE "%s: NO card at 0x%x (%d)\n",
driver->name, card->port, retval);
- iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK));
+ iounmap(card->mbase);
kfree(card->ctrlinfo);
kfree(card->dma);
kfree(card);
@@ -1267,7 +1198,7 @@
if (retval) {
printk(KERN_ERR "%s: unable to get IRQ %d.\n",
driver->name, card->irq);
- iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK));
+ iounmap(card->mbase);
release_region(card->port, AVMB1_PORTLEN);
kfree(card->ctrlinfo);
kfree(card->dma);
@@ -1276,7 +1207,7 @@
return -EBUSY;
}
- for (i=0; i < 4; i++) {
+ for (i=0; i < nr ; i++) {
cinfo = &card->ctrlinfo[i];
cinfo->card = card;
cinfo->capi_ctrl = di->attach_ctr(driver, card->name, cinfo);
@@ -1287,7 +1218,7 @@
cinfo = &card->ctrlinfo[i];
di->detach_ctr(cinfo->capi_ctrl);
}
- iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK));
+ iounmap(card->mbase);
free_irq(card->irq, card);
release_region(card->port, AVMB1_PORTLEN);
kfree(card->dma);
@@ -1303,14 +1234,31 @@
skb_queue_head_init(&card->dma->send_queue);
printk(KERN_INFO
- "%s: AVM C4 at i/o %#x, irq %d, mem %#lx\n",
- driver->name, card->port, card->irq, card->membase);
+ "%s: AVM C%d at i/o %#x, irq %d, mem %#lx\n",
+ driver->name, nr, card->port, card->irq, card->membase);
return 0;
}
/* ------------------------------------------------------------- */
+static struct capi_driver c2_driver = {
+ name: "c2",
+ revision: "0.0",
+ load_firmware: c4_load_firmware,
+ reset_ctr: c4_reset_ctr,
+ remove_ctr: c4_remove_ctr,
+ register_appl: c4_register_appl,
+ release_appl: c4_release_appl,
+ send_message: c4_send_message,
+
+ procinfo: c4_procinfo,
+ ctr_read_proc: c4_read_proc,
+ driver_read_proc: 0, /* use standard driver_read_proc */
+
+ add_card: 0, /* no add_card function */
+};
+
static struct capi_driver c4_driver = {
name: "c4",
revision: "0.0",
@@ -1330,83 +1278,114 @@
static int ncards = 0;
-static int __init c4_init(void)
+static int c4_attach_driver (struct capi_driver * driver)
{
- struct capi_driver *driver = &c4_driver;
- struct pci_dev *dev = NULL;
char *p;
- int retval;
-
- MOD_INC_USE_COUNT;
-
- if ((p = strchr(revision, ':'))) {
- strncpy(driver->revision, p + 1, sizeof(driver->revision));
- p = strchr(driver->revision, '$');
- *p = 0;
+ if ((p = strchr(revision, ':')) != 0 && p[1]) {
+ strncpy(driver->revision, p + 2, sizeof(driver->revision));
+ driver->revision[sizeof(driver->revision)-1] = 0;
+ if ((p = strchr(driver->revision, '$')) != 0 && p > driver->revision)
+ *(p-1) = 0;
}
printk(KERN_INFO "%s: revision %s\n", driver->name, driver->revision);
di = attach_capi_driver(driver);
-
if (!di) {
printk(KERN_ERR "%s: failed to attach capi_driver\n",
driver->name);
MOD_DEC_USE_COUNT;
- return -EIO;
+ return -ENODEV;
}
+ return 0;
+}
-#ifdef CONFIG_PCI
- if (!pci_present()) {
- printk(KERN_ERR "%s: no PCI bus present\n", driver->name);
- detach_capi_driver(driver);
- MOD_DEC_USE_COUNT;
- return -EIO;
- }
+static int __init search_cards(struct capi_driver * driver,
+ int pci_id, int nr)
+{
+ struct pci_dev * dev = NULL;
+ int retval = 0;
while ((dev = pci_find_subsys(
PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21285,
- PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_C4, dev))) {
+ PCI_VENDOR_ID_AVM, pci_id, dev))) {
struct capicardparams param;
+ if (pci_enable_device(dev) < 0) {
+ printk(KERN_ERR "%s: failed to enable AVM-C%d\n",
+ driver->name, nr);
+ continue;
+ }
+ pci_set_master(dev);
+
param.port = dev->base_address[ 1] & PCI_BASE_ADDRESS_IO_MASK;
param.irq = dev->irq;
param.membase = dev->base_address[ 0] & PCI_BASE_ADDRESS_MEM_MASK;
-
-
+
printk(KERN_INFO
- "%s: PCI BIOS reports AVM-C4 at i/o %#x, irq %d, mem %#x\n",
- driver->name, param.port, param.irq, param.membase);
- retval = c4_add_card(driver, ¶m);
+ "%s: PCI BIOS reports AVM-C%d at i/o %#x, irq %d, mem %#x\n",
+ driver->name, nr, param.port, param.irq, param.membase);
+ retval = c4_add_card(driver, ¶m, nr);
if (retval != 0) {
printk(KERN_ERR
- "%s: no AVM-C4 at i/o %#x, irq %d detected, mem %#x\n",
- driver->name, param.port, param.irq, param.membase);
- detach_capi_driver(driver);
- MOD_DEC_USE_COUNT;
- return retval;
+ "%s: no AVM-C%d at i/o %#x, irq %d detected, mem %#x\n",
+ driver->name, nr, param.port, param.irq, param.membase);
+ continue;
}
ncards++;
}
+ return retval;
+}
+
+static int __init c4_init(void)
+{
+ int retval;
+
+ MOD_INC_USE_COUNT;
+
+ retval = c4_attach_driver (&c4_driver);
+ if (retval) {
+ MOD_DEC_USE_COUNT;
+ return retval;
+ }
+
+ retval = c4_attach_driver (&c2_driver);
+ if (retval) {
+ MOD_DEC_USE_COUNT;
+ return retval;
+ }
+
+ retval = search_cards(&c4_driver, PCI_DEVICE_ID_AVM_C4, 4);
+ if (retval && ncards == 0) {
+ detach_capi_driver(&c2_driver);
+ detach_capi_driver(&c4_driver);
+ MOD_DEC_USE_COUNT;
+ return retval;
+ }
+ retval = search_cards(&c2_driver, 0x1100, 2);
+ if (retval && ncards == 0) {
+ detach_capi_driver(&c2_driver);
+ detach_capi_driver(&c4_driver);
+ MOD_DEC_USE_COUNT;
+ return retval;
+ }
+
if (ncards) {
- printk(KERN_INFO "%s: %d C4 card(s) detected\n",
- driver->name, ncards);
+ printk(KERN_INFO "%s: %d C4/C2 card(s) detected\n",
+ c4_driver.name, ncards);
MOD_DEC_USE_COUNT;
return 0;
}
- printk(KERN_ERR "%s: NO C4 card detected\n", driver->name);
- detach_capi_driver(driver);
+ printk(KERN_ERR "%s: NO C4/C2 card detected\n", c4_driver.name);
+ detach_capi_driver(&c4_driver);
+ detach_capi_driver(&c2_driver);
MOD_DEC_USE_COUNT;
- return -ESRCH;
-#else
- printk(KERN_ERR "%s: kernel not compiled with PCI.\n", driver->name);
- MOD_DEC_USE_COUNT;
- return -EIO;
-#endif
+ return -ENODEV;
}
static void c4_exit(void)
{
+ detach_capi_driver(&c2_driver);
detach_capi_driver(&c4_driver);
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/capi.c linux.20p7/drivers/isdn/avmb1/capi.c
--- linux.vanilla/drivers/isdn/avmb1/capi.c Sun Mar 25 17:37:31 2001
+++ linux.20p7/drivers/isdn/avmb1/capi.c Wed Jul 4 16:03:54 2001
@@ -1,226 +1,10 @@
/*
- * $Id: capi.c,v 1.44.6.5 2001/02/13 11:43:29 kai Exp $
+ * $Id: capi.c,v 1.44.6.12 2001/06/09 15:14:15 kai Exp $
*
* CAPI 2.0 Interface for Linux
*
* Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
*
- * $Log: capi.c,v $
- * Revision 1.44.6.5 2001/02/13 11:43:29 kai
- * more compatility changes for 2.2.19
- *
- * Revision 1.44.6.4 2001/02/10 14:41:20 kai
- * Changes from kernel tree
- *
- * Revision 1.44.6.3 2000/12/17 22:45:08 kai
- * That's hopefully it for test13-4
- *
- * Revision 1.44.6.2 2000/12/14 23:04:12 kai
- * Makefile changes and the like for 2.4.0-test13-pre1
- * No compatiblity code for older kernels yet, but note the branch
- *
- * Revision 1.45 2000/12/02 19:47:29 kai
- * Change the Makefiles to new style.
- * There may be problems there that I missed, so this shouldn't go into
- * an offical kernel any time soon.
- * However, if I didn't commit it, we wouldn't find the bugs...
- *
- * Revision 1.44 2000/11/25 17:00:59 kai
- * compatibility cleanup - final part for the time being
- *
- * Revision 1.43 2000/11/23 20:45:14 kai
- * fixed module_init/exit stuff
- * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
- *
- * Revision 1.42 2000/11/19 17:03:55 kai
- * compatibility cleanup - part 5
- *
- * Revision 1.41 2000/11/01 14:05:02 calle
- * - use module_init/module_exit from linux/init.h.
- * - all static struct variables are initialized with "membername:" now.
- * - avm_cs.c, let it work with newer pcmcia-cs.
- *
- * Revision 1.40 2000/10/24 15:15:04 calle
- * Workaround: pppd calls restoretty before reseting the ldisc and
- * ldisc "ppp_sync" didn't support this. So we call n_tty_ioctl
- * in the driver ioctl function. (remember: driver ioctl function is
- * only called if ldisc ioctl function did not handle the call)
- *
- * Revision 1.39 2000/07/24 13:42:50 calle
- * - lock_kernel/unlock_kernel for _release functions. (from 2.4)
- *
- * Revision 1.38 2000/07/24 08:49:09 calle
- * - Bugfix: capiminor_del_all_ack completely wrong :-(
- *
- * Revision 1.37 2000/07/20 10:22:27 calle
- * - Made procfs function cleaner and removed variable "begin".
- *
- * Revision 1.36 2000/06/29 13:59:35 calle
- * - call to devfs_register was wrong
- *
- * Revision 1.35 2000/06/19 15:11:24 keil
- * avoid use of freed structs
- * changes from 2.4.0-ac21
- *
- * Revision 1.34 2000/06/18 16:09:54 keil
- * more changes for 2.4
- *
- * Revision 1.33 2000/05/18 16:35:43 calle
- * Uaaahh. Bad memory leak fixed.
- *
- * Revision 1.32 2000/04/21 12:38:42 calle
- * Bugfix: error in proc_ functions, begin-off => off-begin
- *
- * Revision 1.31 2000/04/03 13:29:24 calle
- * make Tim Waugh happy (module unload races in 2.3.99-pre3).
- * no real problem there, but now it is much cleaner ...
- *
- * Revision 1.30 2000/03/19 12:31:36 calle
- * PPP over CAPI raw driver disabled for now, ppp_generic has been changed.
- *
- * Revision 1.29 2000/03/13 17:48:13 calle
- * removed unused variable.
- *
- * Revision 1.28 2000/03/08 17:06:33 calle
- * - changes for devfs and 2.3.49
- * - capifs now configurable (no need with devfs)
- * - New Middleware ioctl CAPI_NCCI_GETUNIT
- * - Middleware again tested with 2.2.14 and 2.3.49 (with and without devfs)
- *
- * Revision 1.27 2000/03/06 18:00:23 calle
- * - Middleware extention now working with 2.3.49 (capifs).
- * - Fixed typos in debug section of capi.c
- * - Bugfix: Makefile corrected for b1pcmcia.c
- *
- * Revision 1.26 2000/03/03 16:48:38 calle
- * - Added CAPI2.0 Middleware support (CONFIG_ISDN_CAPI)
- * It is now possible to create a connection with a CAPI2.0 applikation
- * and than to handle the data connection from /dev/capi/ (capifs) and also
- * using async or sync PPP on this connection.
- * The two major device number 190 and 191 are not confirmed yet,
- * but I want to save the code in cvs, before I go on.
- *
- * Revision 1.25 2000/03/03 16:37:11 kai
- * incorporated some cosmetic changes from the official kernel tree back
- * into CVS
- *
- * Revision 1.24 2000/03/03 15:50:42 calle
- * - kernel CAPI:
- * - Changed parameter "param" in capi_signal from __u32 to void *.
- * - rewrote notifier handling in kcapi.c
- * - new notifier NCCI_UP and NCCI_DOWN
- * - User CAPI:
- * - /dev/capi20 is now a cloning device.
- * - middleware extentions prepared.
- * - capidrv.c
- * - locking of list operations and module count updates.
- *
- * Revision 1.23 2000/02/26 01:00:53 keil
- * changes from 2.3.47
- *
- * Revision 1.22 1999/11/13 21:27:16 keil
- * remove KERNELVERSION
- *
- * Revision 1.21 1999/09/10 17:24:18 calle
- * Changes for proposed standard for CAPI2.0:
- * - AK148 "Linux Exention"
- *
- * Revision 1.20 1999/09/07 09:02:53 calle
- * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and
- * DATA_B3_IND is always directly after the CAPI message. The "Data" member
- * ist never used inside the kernel.
- *
- * Revision 1.19 1999/07/09 15:05:42 keil
- * compat.h is now isdn_compat.h
- *
- * Revision 1.18 1999/07/06 07:42:01 calle
- * - changes in /proc interface
- * - check and changed calls to [dev_]kfree_skb and [dev_]alloc_skb.
- *
- * Revision 1.17 1999/07/01 15:26:30 calle
- * complete new version (I love it):
- * + new hardware independed "capi_driver" interface that will make it easy to:
- * - support other controllers with CAPI-2.0 (i.e. USB Controller)
- * - write a CAPI-2.0 for the passive cards
- * - support serial link CAPI-2.0 boxes.
- * + wrote "capi_driver" for all supported cards.
- * + "capi_driver" (supported cards) now have to be configured with
- * make menuconfig, in the past all supported cards where included
- * at once.
- * + new and better informations in /proc/capi/
- * + new ioctl to switch trace of capi messages per controller
- * using "avmcapictrl trace [contr] on|off|...."
- * + complete testcircle with all supported cards and also the
- * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done.
- *
- * Revision 1.16 1999/07/01 08:22:57 keil
- * compatibility macros now in
- *
- * Revision 1.15 1999/06/21 15:24:11 calle
- * extend information in /proc.
- *
- * Revision 1.14 1999/06/10 16:51:03 calle
- * Bugfix: open/release of control device was not handled correct.
- *
- * Revision 1.13 1998/08/28 04:32:25 calle
- * Added patch send by Michael.Mueller4@post.rwth-aachen.de, to get AVM B1
- * driver running with 2.1.118.
- *
- * Revision 1.12 1998/05/26 22:39:34 he
- * sync'ed with 2.1.102 where appropriate (CAPABILITY changes)
- * concap typo
- * cleared dev.tbusy in isdn_net BCONN status callback
- *
- * Revision 1.11 1998/03/09 17:46:37 he
- * merged in 2.1.89 changes
- *
- * Revision 1.10 1998/02/13 07:09:13 calle
- * change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb()
- *
- * Revision 1.9 1998/01/31 11:14:44 calle
- * merged changes to 2.0 tree, prepare 2.1.82 to work.
- *
- * Revision 1.8 1997/11/04 06:12:08 calle
- * capi.c: new read/write in file_ops since 2.1.60
- * capidrv.c: prepared isdnlog interface for d2-trace in newer firmware.
- * capiutil.c: needs config.h (CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON)
- * compat.h: added #define LinuxVersionCode
- *
- * Revision 1.7 1997/10/11 10:29:34 calle
- * llseek() parameters changed in 2.1.56.
- *
- * Revision 1.6 1997/10/01 09:21:15 fritz
- * Removed old compatibility stuff for 2.0.X kernels.
- * From now on, this code is for 2.1.X ONLY!
- * Old stuff is still in the separate branch.
- *
- * Revision 1.5 1997/08/21 23:11:55 fritz
- * Added changes for kernels >= 2.1.45
- *
- * Revision 1.4 1997/05/27 15:17:50 fritz
- * Added changes for recent 2.1.x kernels:
- * changed return type of isdn_close
- * queue_task_* -> queue_task
- * clear/set_bit -> test_and_... where apropriate.
- * changed type of hard_header_cache parameter.
- *
- * Revision 1.3 1997/05/18 09:24:14 calle
- * added verbose disconnect reason reporting to avmb1.
- * some fixes in capi20 interface.
- * changed info messages for B1-PCI
- *
- * Revision 1.2 1997/03/05 21:17:59 fritz
- * Added capi_poll for compiling under 2.1.27
- *
- * Revision 1.1 1997/03/04 21:50:29 calle
- * Frirst version in isdn4linux
- *
- * Revision 2.2 1997/02/12 09:31:39 calle
- * new version
- *
- * Revision 1.1 1997/01/31 10:32:20 calle
- * Initial revision
- *
*/
#include
@@ -237,6 +21,7 @@
#include
#include
#include
+#include
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
#include
#ifdef CONFIG_PPP
@@ -258,7 +43,7 @@
#include "capifs.h"
#endif
-static char *revision = "$Revision: 1.44.6.5 $";
+static char *revision = "$Revision: 1.44.6.12 $";
MODULE_AUTHOR("Carsten Paeth (calle@calle.in-berlin.de)");
@@ -465,7 +250,6 @@
void capiminor_free(struct capiminor *mp)
{
struct capiminor **pp;
- struct sk_buff *skb;
pp = &minors;
while (*pp) {
@@ -473,12 +257,9 @@
*pp = (*pp)->next;
if (mp->ttyskb) kfree_skb(mp->ttyskb);
mp->ttyskb = 0;
- while ((skb = skb_dequeue(&mp->recvqueue)) != 0)
- kfree_skb(skb);
- while ((skb = skb_dequeue(&mp->inqueue)) != 0)
- kfree_skb(skb);
- while ((skb = skb_dequeue(&mp->outqueue)) != 0)
- kfree_skb(skb);
+ skb_queue_purge(&mp->recvqueue);
+ skb_queue_purge(&mp->inqueue);
+ skb_queue_purge(&mp->outqueue);
capiminor_del_all_ack(mp);
kfree(mp);
MOD_DEC_USE_COUNT;
@@ -517,9 +298,6 @@
memset(np, 0, sizeof(struct capincci));
np->ncci = ncci;
np->cdev = cdev;
- for (pp=&cdev->nccis; *pp; pp = &(*pp)->next)
- ;
- *pp = np;
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
mp = 0;
if (cdev->userflags & CAPIFLAG_HIGHJACKING)
@@ -537,6 +315,9 @@
#endif
}
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
+ for (pp=&cdev->nccis; *pp; pp = &(*pp)->next)
+ ;
+ *pp = np;
return np;
}
@@ -620,15 +401,12 @@
static void capidev_free(struct capidev *cdev)
{
struct capidev **pp;
- struct sk_buff *skb;
if (cdev->applid)
(*capifuncs->capi_release) (cdev->applid);
cdev->applid = 0;
- while ((skb = skb_dequeue(&cdev->recvqueue)) != 0) {
- kfree_skb(skb);
- }
+ skb_queue_purge(&cdev->recvqueue);
pp=&capidev_openlist;
while (*pp && *pp != cdev) pp = &(*pp)->next;
@@ -985,6 +763,8 @@
return -ENODEV;
skb = alloc_skb(count, GFP_USER);
+ if (!skb)
+ return -ENOMEM;
if ((retval = copy_from_user(skb_put(skb, count), buf, count))) {
kfree_skb(skb);
@@ -1401,6 +1181,8 @@
return -EINVAL;
skb = alloc_skb(CAPI_DATA_B3_REQ_LEN+count, GFP_USER);
+ if (!skb)
+ return -ENOMEM;
skb_reserve(skb, CAPI_DATA_B3_REQ_LEN);
if ((retval = copy_from_user(skb_put(skb, count), buf, count))) {
@@ -2028,20 +1810,22 @@
callback: lower_callback,
};
-static char rev[10];
+static char rev[32];
static int __init capi_init(void)
{
char *p;
+ char *compileinfo;
MOD_INC_USE_COUNT;
- if ((p = strchr(revision, ':'))) {
- strcpy(rev, p + 2);
- p = strchr(rev, '$');
- *(p-1) = 0;
+ if ((p = strchr(revision, ':')) != 0 && p[1]) {
+ strncpy(rev, p + 2, sizeof(rev));
+ rev[sizeof(rev)-1] = 0;
+ if ((p = strchr(rev, '$')) != 0 && p > rev)
+ *(p-1) = 0;
} else
- strcpy(rev, "???");
+ strcpy(rev, "1.0");
if (register_chrdev(capi_major, "capi20", &capi_fops)) {
printk(KERN_ERR "capi20: unable to get major %d\n", capi_major);
@@ -2082,8 +1866,17 @@
(void)proc_init();
- printk(KERN_NOTICE "capi20: Rev%s: started up with major %d\n",
- rev, capi_major);
+#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
+#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
+ compileinfo = " (middleware+capifs)";
+#else
+ compileinfo = " (no capifs)";
+#endif
+#else
+ compileinfo = " (no middleware)";
+#endif
+ printk(KERN_NOTICE "capi20: Rev %s: started up with major %d%s\n",
+ rev, capi_major, compileinfo);
MOD_DEC_USE_COUNT;
return 0;
@@ -2102,7 +1895,7 @@
unregister_chrdev(capi_rawmajor, "capi/r%d");
#endif
(void) detach_capi_interface(&cuser);
- printk(KERN_NOTICE "capi: Rev%s: unloaded\n", rev);
+ printk(KERN_NOTICE "capi: Rev %s: unloaded\n", rev);
}
module_init(capi_init);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/capicmd.h linux.20p7/drivers/isdn/avmb1/capicmd.h
--- linux.vanilla/drivers/isdn/avmb1/capicmd.h Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/avmb1/capicmd.h Wed Jul 4 16:03:54 2001
@@ -1,31 +1,9 @@
/*
- * $Id: capicmd.h,v 1.2 2000/03/03 15:50:42 calle Exp $
+ * $Id: capicmd.h,v 1.2.6.1 2001/05/17 20:41:51 kai Exp $
*
* CAPI 2.0 Interface for Linux
*
* Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
- *
- * $Log: capicmd.h,v $
- * Revision 1.2 2000/03/03 15:50:42 calle
- * - kernel CAPI:
- * - Changed parameter "param" in capi_signal from __u32 to void *.
- * - rewrote notifier handling in kcapi.c
- * - new notifier NCCI_UP and NCCI_DOWN
- * - User CAPI:
- * - /dev/capi20 is now a cloning device.
- * - middleware extentions prepared.
- * - capidrv.c
- * - locking of list operations and module count updates.
- *
- * Revision 1.1 1997/03/04 21:50:30 calle
- * Frirst version in isdn4linux
- *
- * Revision 2.2 1997/02/12 09:31:39 calle
- * new version
- *
- * Revision 1.1 1997/01/31 10:32:20 calle
- * Initial revision
- *
*
*/
#ifndef __CAPICMD_H__
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/capidev.h linux.20p7/drivers/isdn/avmb1/capidev.h
--- linux.vanilla/drivers/isdn/avmb1/capidev.h Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/avmb1/capidev.h Wed Jul 4 16:03:54 2001
@@ -1,55 +1,9 @@
/*
- * $Id: capidev.h,v 1.6 2000/11/25 17:00:59 kai Exp $
+ * $Id: capidev.h,v 1.6.6.1 2001/05/17 20:41:51 kai Exp $
*
* CAPI 2.0 Interface for Linux
*
* (c) Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
- *
- * $Log: capidev.h,v $
- * Revision 1.6 2000/11/25 17:00:59 kai
- * compatibility cleanup - final part for the time being
- *
- * Revision 1.5 2000/03/03 15:50:42 calle
- * - kernel CAPI:
- * - Changed parameter "param" in capi_signal from __u32 to void *.
- * - rewrote notifier handling in kcapi.c
- * - new notifier NCCI_UP and NCCI_DOWN
- * - User CAPI:
- * - /dev/capi20 is now a cloning device.
- * - middleware extentions prepared.
- * - capidrv.c
- * - locking of list operations and module count updates.
- *
- * Revision 1.4 1999/07/01 15:26:32 calle
- * complete new version (I love it):
- * + new hardware independed "capi_driver" interface that will make it easy to:
- * - support other controllers with CAPI-2.0 (i.e. USB Controller)
- * - write a CAPI-2.0 for the passive cards
- * - support serial link CAPI-2.0 boxes.
- * + wrote "capi_driver" for all supported cards.
- * + "capi_driver" (supported cards) now have to be configured with
- * make menuconfig, in the past all supported cards where included
- * at once.
- * + new and better informations in /proc/capi/
- * + new ioctl to switch trace of capi messages per controller
- * using "avmcapictrl trace [contr] on|off|...."
- * + complete testcircle with all supported cards and also the
- * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done.
- *
- * Revision 1.3 1999/07/01 08:22:58 keil
- * compatibility macros now in
- *
- * Revision 1.2 1999/06/21 15:24:13 calle
- * extend information in /proc.
- *
- * Revision 1.1 1997/03/04 21:50:30 calle
- * Frirst version in isdn4linux
- *
- * Revision 2.2 1997/02/12 09:31:39 calle
- * new version
- *
- * Revision 1.1 1997/01/31 10:32:20 calle
- * Initial revision
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/capidrv.c linux.20p7/drivers/isdn/avmb1/capidrv.c
--- linux.vanilla/drivers/isdn/avmb1/capidrv.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/avmb1/capidrv.c Wed Jul 4 16:03:54 2001
@@ -1,202 +1,10 @@
/*
- * $Id: capidrv.c,v 1.39.6.2 2001/02/13 11:43:29 kai Exp $
+ * $Id: capidrv.c,v 1.39.6.6 2001/05/17 20:41:51 kai Exp $
*
* ISDN4Linux Driver, using capi20 interface (kernelcapi)
*
* Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
*
- * $Log: capidrv.c,v $
- * Revision 1.39.6.2 2001/02/13 11:43:29 kai
- * more compatility changes for 2.2.19
- *
- * Revision 1.39.6.1 2001/02/10 14:41:20 kai
- * Changes from kernel tree
- *
- * Revision 1.39 2000/11/23 20:45:14 kai
- * fixed module_init/exit stuff
- * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
- *
- * Revision 1.38 2000/11/14 08:43:07 calle
- * Bugfix for v110. Connectparamters where setup for sync ...
- *
- * Revision 1.37 2000/11/01 14:05:02 calle
- * - use module_init/module_exit from linux/init.h.
- * - all static struct variables are initialized with "membername:" now.
- * - avm_cs.c, let it work with newer pcmcia-cs.
- *
- * Revision 1.36 2000/06/26 15:13:41 keil
- * features should be or'ed
- *
- * Revision 1.35 2000/06/19 15:11:25 keil
- * avoid use of freed structs
- * changes from 2.4.0-ac21
- *
- * Revision 1.34 2000/06/19 13:13:55 calle
- * Added Modemsupport!
- *
- * Revision 1.33 2000/05/06 00:52:36 kai
- * merged changes from kernel tree
- * fixed timer and net_device->name breakage
- *
- * Revision 1.32 2000/04/07 15:19:58 calle
- * remove warnings
- *
- * Revision 1.31 2000/04/06 15:01:25 calle
- * Bugfix: crash in capidrv.c when reseting a capi controller.
- * - changed code order on remove of controller.
- * - using tq_schedule for notifier in kcapi.c.
- * - now using spin_lock_irqsave() and spin_unlock_irqrestore().
- * strange: sometimes even MP hang on unload of isdn.o ...
- *
- * Revision 1.30 2000/03/03 15:50:42 calle
- * - kernel CAPI:
- * - Changed parameter "param" in capi_signal from __u32 to void *.
- * - rewrote notifier handling in kcapi.c
- * - new notifier NCCI_UP and NCCI_DOWN
- * - User CAPI:
- * - /dev/capi20 is now a cloning device.
- * - middleware extentions prepared.
- * - capidrv.c
- * - locking of list operations and module count updates.
- *
- * Revision 1.29 1999/12/06 17:13:06 calle
- * Added controller watchdog.
- *
- * Revision 1.28 1999/11/05 16:22:37 calle
- * Bugfix: Missing break in switch on ISDN_CMD_HANGUP.
- *
- * Revision 1.27 1999/09/16 15:13:04 calle
- * forgot to change paramter type of contr for lower_callback ...
- *
- * Revision 1.26 1999/08/06 07:41:16 calle
- * Added the "vbox patch". if (si1 == 1) si2 = 0;
- *
- * Revision 1.25 1999/08/04 10:10:11 calle
- * Bugfix: corrected /proc functions, added structure for new AVM cards.
- *
- * Revision 1.24 1999/07/20 06:48:02 calle
- * Bugfix: firmware version check for D2 trace was too restrictiv.
- *
- * Revision 1.23 1999/07/09 15:05:44 keil
- * compat.h is now isdn_compat.h
- *
- * Revision 1.22 1999/07/06 07:24:14 calle
- * Bugfix: call to kfree_skb in capidrv_signal was too early,
- * thanks to Lars Heete .
- *
- * Revision 1.21 1999/07/01 15:26:34 calle
- * complete new version (I love it):
- * + new hardware independed "capi_driver" interface that will make it easy to:
- * - support other controllers with CAPI-2.0 (i.e. USB Controller)
- * - write a CAPI-2.0 for the passive cards
- * - support serial link CAPI-2.0 boxes.
- * + wrote "capi_driver" for all supported cards.
- * + "capi_driver" (supported cards) now have to be configured with
- * make menuconfig, in the past all supported cards where included
- * at once.
- * + new and better informations in /proc/capi/
- * + new ioctl to switch trace of capi messages per controller
- * using "avmcapictrl trace [contr] on|off|...."
- * + complete testcircle with all supported cards and also the
- * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done.
- *
- * Revision 1.20 1999/07/01 08:22:59 keil
- * compatibility macros now in
- *
- * Revision 1.19 1999/06/29 16:16:54 calle
- * Let ISDN_CMD_UNLOAD work with open isdn devices without crash again.
- * Also right unlocking (ISDN_CMD_UNLOCK) is done now.
- * isdnlog should check returncode of read(2) calls.
- *
- * Revision 1.18 1999/06/21 15:24:15 calle
- * extend information in /proc.
- *
- * Revision 1.17 1999/06/10 16:53:55 calle
- * Removing of module b1pci will now remove card from lower level.
- *
- * Revision 1.16 1999/05/31 11:50:33 calle
- * Bugfix: In if_sendbuf, skb_push'ed DATA_B3 header was not skb_pull'ed
- * on failure, result in data block with DATA_B3 header transmitted
- *
- * Revision 1.15 1999/05/25 21:26:16 calle
- * Include CAPI-Channelallocation (leased lines) from the 2.0 tree.
- *
- * Revision 1.14 1999/05/22 07:55:06 calle
- * Added *V110* to AVM B1 driver.
- *
- * Revision 1.13 1998/06/26 15:12:55 fritz
- * Added handling of STAT_ICALL with incomplete CPN.
- * Added AT&L for ttyI emulator.
- * Added more locking stuff in tty_write.
- *
- * Revision 1.12 1998/03/29 16:06:03 calle
- * changes from 2.0 tree merged.
- *
- * Revision 1.3.2.10 1998/03/20 14:38:24 calle
- * capidrv: prepared state machines for suspend/resume/hold
- * capidrv: fix bug in state machine if B1/T1 is out of nccis
- * b1capi: changed some errno returns.
- * b1capi: detect if you try to add same T1 to different io address.
- * b1capi: change number of nccis depending on number of channels.
- * b1lli: cosmetics
- *
- * Revision 1.3.2.9 1998/03/20 09:01:12 calle
- * Changes capi_register handling to get full support for 30 bchannels.
- *
- * Revision 1.3.2.8 1998/03/18 17:51:28 calle
- * added controller number to error messages
- *
- * Revision 1.3.2.7 1998/02/27 15:40:47 calle
- * T1 running with slow link. bugfix in capi_release.
- *
- * Revision 1.11 1998/02/13 07:09:15 calle
- * change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb()
- *
- * Revision 1.10 1998/02/02 19:52:23 calle
- * Fixed vbox (audio) acceptb.
- *
- * Revision 1.9 1998/01/31 11:14:45 calle
- * merged changes to 2.0 tree, prepare 2.1.82 to work.
- *
- * Revision 1.8 1997/11/04 06:12:09 calle
- * capi.c: new read/write in file_ops since 2.1.60
- * capidrv.c: prepared isdnlog interface for d2-trace in newer firmware.
- * capiutil.c: needs config.h (CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON)
- * compat.h: added #define LinuxVersionCode
- *
- * Revision 1.7 1997/10/11 10:36:34 calle
- * Added isdnlog support. patch to isdnlog needed.
- *
- * Revision 1.6 1997/10/11 10:25:55 calle
- * New interface for lowlevel drivers. BSENT with nr. of bytes sent,
- * allow sending without ACK.
- *
- * Revision 1.5 1997/10/01 09:21:16 fritz
- * Removed old compatibility stuff for 2.0.X kernels.
- * From now on, this code is for 2.1.X ONLY!
- * Old stuff is still in the separate branch.
- *
- * Revision 1.4 1997/07/13 12:22:43 calle
- * bug fix for more than one controller in connect_req.
- * debugoutput now with contrnr.
- *
- * Revision 1.3 1997/05/18 09:24:15 calle
- * added verbose disconnect reason reporting to avmb1.
- * some fixes in capi20 interface.
- * changed info messages for B1-PCI
- *
- * Revision 1.2 1997/03/05 21:19:59 fritz
- * Removed include of config.h (mkdep stated this is unneded).
- *
- * Revision 1.1 1997/03/04 21:50:31 calle
- * Frirst version in isdn4linux
- *
- * Revision 2.2 1997/02/12 09:31:39 calle
- * new version
- *
- * Revision 1.1 1997/01/31 10:32:20 calle
- * Initial revision
- *
*/
#include
@@ -225,7 +33,7 @@
#include "capicmd.h"
#include "capidrv.h"
-static char *revision = "$Revision: 1.39.6.2 $";
+static char *revision = "$Revision: 1.39.6.6 $";
static int debugmode = 0;
MODULE_AUTHOR("Carsten Paeth ");
@@ -494,7 +302,7 @@
}
-/* -------- controller managment ------------------------------------- */
+/* -------- controller management ------------------------------------- */
static inline capidrv_contr *findcontrbydriverid(int driverid)
{
@@ -2063,8 +1871,8 @@
__u16 datahandle;
if (!card) {
- printk(KERN_ERR "capidrv-%d: if_sendbuf called with invalid driverId %d!\n",
- card->contrnr, id);
+ printk(KERN_ERR "capidrv: if_sendbuf called with invalid driverId %d!\n",
+ id);
return 0;
}
if (debugmode > 1)
@@ -2133,8 +1941,8 @@
__u8 *p;
if (!card) {
- printk(KERN_ERR "capidrv-%d: if_readstat called with invalid driverId %d!\n",
- card->contrnr, id);
+ printk(KERN_ERR "capidrv: if_readstat called with invalid driverId %d!\n",
+ id);
return -ENODEV;
}
@@ -2490,7 +2298,7 @@
{
struct capi_register_params rparam;
capi_profile profile;
- char rev[10];
+ char rev[32];
char *p;
__u32 ncontr, contr;
__u16 errcode;
@@ -2504,12 +2312,13 @@
return -EIO;
}
- if ((p = strchr(revision, ':'))) {
- strcpy(rev, p + 1);
- p = strchr(rev, '$');
- *p = 0;
+ if ((p = strchr(revision, ':')) != 0 && p[1]) {
+ strncpy(rev, p + 2, sizeof(rev));
+ rev[sizeof(rev)-1] = 0;
+ if ((p = strchr(rev, '$')) != 0 && p > rev)
+ *(p-1) = 0;
} else
- strcpy(rev, " ??? ");
+ strcpy(rev, "1.0");
rparam.level3cnt = -2; /* number of bchannels twice */
rparam.datablkcnt = 16;
@@ -2540,7 +2349,7 @@
}
proc_init();
- printk(KERN_NOTICE "capidrv: Rev%s: loaded\n", rev);
+ printk(KERN_NOTICE "capidrv: Rev %s: loaded\n", rev);
MOD_DEC_USE_COUNT;
return 0;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/capidrv.h linux.20p7/drivers/isdn/avmb1/capidrv.h
--- linux.vanilla/drivers/isdn/avmb1/capidrv.h Sun Mar 25 17:31:37 2001
+++ linux.20p7/drivers/isdn/avmb1/capidrv.h Wed Jul 4 16:03:54 2001
@@ -1,30 +1,9 @@
/*
- * $Id: capidrv.h,v 1.2 1998/03/29 16:06:06 calle Exp $
+ * $Id: capidrv.h,v 1.2.8.1 2001/05/17 20:41:51 kai Exp $
*
* ISDN4Linux Driver, using capi20 interface (kernelcapi)
*
* Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
- *
- * $Log: capidrv.h,v $
- * Revision 1.2 1998/03/29 16:06:06 calle
- * changes from 2.0 tree merged.
- *
- * Revision 1.1.2.1 1998/03/20 14:38:28 calle
- * capidrv: prepared state machines for suspend/resume/hold
- * capidrv: fix bug in state machine if B1/T1 is out of nccis
- * b1capi: changed some errno returns.
- * b1capi: detect if you try to add same T1 to different io address.
- * b1capi: change number of nccis depending on number of channels.
- * b1lli: cosmetics
- *
- * Revision 1.1 1997/03/04 21:50:33 calle
- * Frirst version in isdn4linux
- *
- * Revision 2.2 1997/02/12 09:31:39 calle
- * new version
- *
- * Revision 1.1 1997/01/31 10:32:20 calle
- * Initial revision
*
*/
#ifndef __CAPIDRV_H__
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/capifs.c linux.20p7/drivers/isdn/avmb1/capifs.c
--- linux.vanilla/drivers/isdn/avmb1/capifs.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/avmb1/capifs.c Wed Jul 4 16:03:54 2001
@@ -1,81 +1,10 @@
/*
- * $Id: capifs.c,v 1.14.6.3 2001/02/13 11:43:29 kai Exp $
+ * $Id: capifs.c,v 1.14.6.7 2001/05/24 08:29:08 kai Exp $
*
* (c) Copyright 2000 by Carsten Paeth (calle@calle.de)
*
* Heavily based on devpts filesystem from H. Peter Anvin
*
- * $Log: capifs.c,v $
- * Revision 1.14.6.3 2001/02/13 11:43:29 kai
- * more compatility changes for 2.2.19
- *
- * Revision 1.14.6.2 2001/02/10 14:41:20 kai
- * Changes from kernel tree
- *
- * Revision 1.14.6.1 2000/11/28 12:02:45 kai
- * MODULE_DEVICE_TABLE for 2.4
- *
- * Revision 1.14.2.1 2000/11/26 17:47:53 kai
- * added PCI_DEV_TABLE for 2.4
- *
- * Revision 1.14 2000/11/23 20:45:14 kai
- * fixed module_init/exit stuff
- * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
- *
- * Revision 1.13 2000/11/18 16:17:25 kai
- * change from 2.4 tree
- *
- * Revision 1.12 2000/11/01 14:05:02 calle
- * - use module_init/module_exit from linux/init.h.
- * - all static struct variables are initialized with "membername:" now.
- * - avm_cs.c, let it work with newer pcmcia-cs.
- *
- * Revision 1.11 2000/10/24 15:08:47 calle
- * Too much includes.
- *
- * Revision 1.10 2000/10/12 10:12:35 calle
- * Bugfix: second iput(inode) on umount, destroies a foreign inode.
- *
- * Revision 1.9 2000/08/20 07:30:13 keil
- * changes for 2.4
- *
- * Revision 1.8 2000/07/20 10:23:13 calle
- * Include isdn_compat.h for people that don't use -p option of std2kern.
- *
- * Revision 1.7 2000/06/18 16:09:54 keil
- * more changes for 2.4
- *
- * Revision 1.6 2000/04/03 13:29:25 calle
- * make Tim Waugh happy (module unload races in 2.3.99-pre3).
- * no real problem there, but now it is much cleaner ...
- *
- * Revision 1.5 2000/03/13 17:49:52 calle
- * make it running with 2.3.51.
- *
- * Revision 1.4 2000/03/08 17:06:33 calle
- * - changes for devfs and 2.3.49
- * - capifs now configurable (no need with devfs)
- * - New Middleware ioctl CAPI_NCCI_GETUNIT
- * - Middleware again tested with 2.2.14 and 2.3.49 (with and without devfs)
- *
- * Revision 1.3 2000/03/06 18:00:23 calle
- * - Middleware extention now working with 2.3.49 (capifs).
- * - Fixed typos in debug section of capi.c
- * - Bugfix: Makefile corrected for b1pcmcia.c
- *
- * Revision 1.2 2000/03/06 09:17:07 calle
- * - capifs: fileoperations now in inode (change for 2.3.49)
- * - Config.in: Middleware extention not a tristate, uups.
- *
- * Revision 1.1 2000/03/03 16:48:38 calle
- * - Added CAPI2.0 Middleware support (CONFIG_ISDN_CAPI)
- * It is now possible to create a connection with a CAPI2.0 applikation
- * and than to handle the data connection from /dev/capi/ (capifs) and also
- * using async or sync PPP on this connection.
- * The two major device number 190 and 191 are not confirmed yet,
- * but I want to save the code in cvs, before I go on.
- *
- *
*/
#include
@@ -94,12 +23,13 @@
#include
#include
#include
+#include
#include
#include
MODULE_AUTHOR("Carsten Paeth ");
-static char *revision = "$Revision: 1.14.6.3 $";
+static char *revision = "$Revision: 1.14.6.7 $";
struct capifs_ncci {
struct inode *inode;
@@ -279,24 +209,16 @@
kfree(sbi->nccis);
kfree(sbi);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51)
MOD_DEC_USE_COUNT;
-#endif
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51)
static int capifs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
static void capifs_write_inode(struct inode *inode) { };
-#else
-static int capifs_statfs(struct super_block *sb, struct statfs *buf);
-#endif
static void capifs_read_inode(struct inode *inode);
static struct super_operations capifs_sops = {
read_inode: capifs_read_inode,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51)
write_inode: capifs_write_inode,
-#endif
put_super: capifs_put_super,
statfs: capifs_statfs,
};
@@ -367,10 +289,8 @@
struct dentry * root;
struct capifs_sb_info *sbi;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51)
MOD_INC_USE_COUNT;
lock_super(s);
-#endif
/* Super block already completed? */
if (s->s_root)
goto out;
@@ -446,19 +366,14 @@
mounts = s;
out: /* Success ... somebody else completed the super block for us. */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51)
unlock_super(s);
-#endif
return s;
fail:
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51)
unlock_super(s);
MOD_DEC_USE_COUNT;
-#endif
return NULL;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51)
static int capifs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
{
struct statfs tmp;
@@ -473,20 +388,6 @@
tmp.f_namelen = NAME_MAX;
return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
}
-#else
-static int capifs_statfs(struct super_block *sb, struct statfs *buf)
-{
- buf->f_type = CAPIFS_SUPER_MAGIC;
- buf->f_bsize = 1024;
- buf->f_blocks = 0;
- buf->f_bfree = 0;
- buf->f_bavail = 0;
- buf->f_files = 0;
- buf->f_ffree = 0;
- buf->f_namelen = NAME_MAX;
- return 0;
-}
-#endif
static void capifs_read_inode(struct inode *inode)
{
@@ -517,16 +418,12 @@
return;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,51)
static struct file_system_type capifs_fs_type = {
"capifs",
0,
capifs_read_super,
NULL
};
-#else
-static DECLARE_FSTYPE(capifs_fs_type, "capifs", capifs_read_super, 0);
-#endif
void capifs_new_ncci(char type, unsigned int num, kdev_t device)
{
@@ -547,8 +444,7 @@
break;
}
}
-
- if ((np->inode = iget(sb, ino+2)) != 0) {
+ if ((np->inode = iget(sb, ino+2)) != NULL) {
struct inode *inode = np->inode;
inode->i_uid = sbi->setuid ? sbi->uid : current->fsuid;
inode->i_gid = sbi->setgid ? sbi->gid : current->fsgid;
@@ -587,16 +483,17 @@
static int __init capifs_init(void)
{
- char rev[10];
+ char rev[32];
char *p;
int err;
MOD_INC_USE_COUNT;
- if ((p = strchr(revision, ':'))) {
- strcpy(rev, p + 1);
- p = strchr(rev, '$');
- *p = 0;
+ if ((p = strchr(revision, ':')) != 0 && p[1]) {
+ strncpy(rev, p + 2, sizeof(rev));
+ rev[sizeof(rev)-1] = 0;
+ if ((p = strchr(rev, '$')) != 0 && p > rev)
+ *(p-1) = 0;
} else
strcpy(rev, "1.0");
@@ -605,11 +502,7 @@
MOD_DEC_USE_COUNT;
return err;
}
-#ifdef MODULE
- printk(KERN_NOTICE "capifs: Rev%s: loaded\n", rev);
-#else
- printk(KERN_NOTICE "capifs: Rev%s: started\n", rev);
-#endif
+ printk(KERN_NOTICE "capifs: Rev %s\n", rev);
MOD_DEC_USE_COUNT;
return 0;
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/capifs.h linux.20p7/drivers/isdn/avmb1/capifs.h
--- linux.vanilla/drivers/isdn/avmb1/capifs.h Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/avmb1/capifs.h Wed Jul 4 16:03:54 2001
@@ -1,23 +1,7 @@
/*
- * $Id: capifs.h,v 1.2 2000/03/08 17:06:33 calle Exp $
+ * $Id: capifs.h,v 1.2.6.1 2001/05/17 20:41:51 kai Exp $
*
* (c) Copyright 2000 by Carsten Paeth (calle@calle.de)
- *
- * $Log: capifs.h,v $
- * Revision 1.2 2000/03/08 17:06:33 calle
- * - changes for devfs and 2.3.49
- * - capifs now configurable (no need with devfs)
- * - New Middleware ioctl CAPI_NCCI_GETUNIT
- * - Middleware again tested with 2.2.14 and 2.3.49 (with and without devfs)
- *
- * Revision 1.1 2000/03/03 16:48:38 calle
- * - Added CAPI2.0 Middleware support (CONFIG_ISDN_CAPI)
- * It is now possible to create a connection with a CAPI2.0 applikation
- * and than to handle the data connection from /dev/capi/ (capifs) and also
- * using async or sync PPP on this connection.
- * The two major device number 190 and 191 are not confirmed yet,
- * but I want to save the code in cvs, before I go on.
- *
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/capiutil.c linux.20p7/drivers/isdn/avmb1/capiutil.c
--- linux.vanilla/drivers/isdn/avmb1/capiutil.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/avmb1/capiutil.c Wed Jul 4 16:03:54 2001
@@ -1,91 +1,11 @@
/*
- * $Id: capiutil.c,v 1.13.6.1 2001/02/13 11:43:29 kai Exp $
+ * $Id: capiutil.c,v 1.13.6.3 2001/05/17 20:41:51 kai Exp $
*
* CAPI 2.0 convert capi message to capi message struct
*
* From CAPI 2.0 Development Kit AVM 1995 (msg.c)
* Rewritten for Linux 1996 by Carsten Paeth (calle@calle.in-berlin.de)
*
- * $Log: capiutil.c,v $
- * Revision 1.13.6.1 2001/02/13 11:43:29 kai
- * more compatility changes for 2.2.19
- *
- * Revision 1.13 2000/11/23 20:45:14 kai
- * fixed module_init/exit stuff
- * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
- *
- * Revision 1.12 2000/11/01 14:05:02 calle
- * - use module_init/module_exit from linux/init.h.
- * - all static struct variables are initialized with "membername:" now.
- * - avm_cs.c, let it work with newer pcmcia-cs.
- *
- * Revision 1.11 2000/03/03 15:50:42 calle
- * - kernel CAPI:
- * - Changed parameter "param" in capi_signal from __u32 to void *.
- * - rewrote notifier handling in kcapi.c
- * - new notifier NCCI_UP and NCCI_DOWN
- * - User CAPI:
- * - /dev/capi20 is now a cloning device.
- * - middleware extentions prepared.
- * - capidrv.c
- * - locking of list operations and module count updates.
- *
- * Revision 1.10 1999/08/31 11:19:54 paul
- * various spelling corrections (new checksums may be needed, Karsten!)
- *
- * Revision 1.9 1999/07/09 15:05:46 keil
- * compat.h is now isdn_compat.h
- *
- * Revision 1.8 1999/07/01 15:26:37 calle
- * complete new version (I love it):
- * + new hardware independed "capi_driver" interface that will make it easy to:
- * - support other controllers with CAPI-2.0 (i.e. USB Controller)
- * - write a CAPI-2.0 for the passive cards
- * - support serial link CAPI-2.0 boxes.
- * + wrote "capi_driver" for all supported cards.
- * + "capi_driver" (supported cards) now have to be configured with
- * make menuconfig, in the past all supported cards where included
- * at once.
- * + new and better informations in /proc/capi/
- * + new ioctl to switch trace of capi messages per controller
- * using "avmcapictrl trace [contr] on|off|...."
- * + complete testcircle with all supported cards and also the
- * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done.
- *
- * Revision 1.7 1999/07/01 08:23:01 keil
- * compatibility macros now in
- *
- * Revision 1.6 1997/11/04 06:12:12 calle
- * capi.c: new read/write in file_ops since 2.1.60
- * capidrv.c: prepared isdnlog interface for d2-trace in newer firmware.
- * capiutil.c: needs config.h (CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON)
- * compat.h: added #define LinuxVersionCode
- *
- * Revision 1.5 1997/10/01 09:21:19 fritz
- * Removed old compatibility stuff for 2.0.X kernels.
- * From now on, this code is for 2.1.X ONLY!
- * Old stuff is still in the separate branch.
- *
- * Revision 1.4 1997/08/10 07:43:55 calle
- * forgot to export symbol capi_info2str for 2.1.x
- *
- * Revision 1.3 1997/05/18 09:24:18 calle
- * added verbose disconnect reason reporting to avmb1.
- * some fixes in capi20 interface.
- * changed info messages for B1-PCI
- *
- * Revision 1.2 1997/03/05 21:22:13 fritz
- * Fix: Symbols have to be exported unconditionally.
- *
- * Revision 1.1 1997/03/04 21:50:34 calle
- * Frirst version in isdn4linux
- *
- * Revision 2.2 1997/02/12 09:31:39 calle
- * new version
- *
- * Revision 1.1 1997/01/31 10:32:20 calle
- * Initial revision
- *
*/
#include
#include
@@ -96,7 +16,7 @@
#include
#include
#include
-
+#include
#include "capiutil.h"
/* from CAPI2.0 DDK AVM Berlin GmbH */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/capiutil.h linux.20p7/drivers/isdn/avmb1/capiutil.h
--- linux.vanilla/drivers/isdn/avmb1/capiutil.h Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/avmb1/capiutil.h Wed Jul 4 16:03:54 2001
@@ -1,45 +1,10 @@
/*
- * $Id: capiutil.h,v 1.5 2000/03/03 15:50:42 calle Exp $
+ * $Id: capiutil.h,v 1.5.6.1 2001/05/17 20:41:51 kai Exp $
*
* CAPI 2.0 defines & types
*
* From CAPI 2.0 Development Kit AVM 1995 (capi20.h)
* Rewritten for Linux 1996 by Carsten Paeth (calle@calle.in-berlin.de)
- *
- * $Log: capiutil.h,v $
- * Revision 1.5 2000/03/03 15:50:42 calle
- * - kernel CAPI:
- * - Changed parameter "param" in capi_signal from __u32 to void *.
- * - rewrote notifier handling in kcapi.c
- * - new notifier NCCI_UP and NCCI_DOWN
- * - User CAPI:
- * - /dev/capi20 is now a cloning device.
- * - middleware extentions prepared.
- * - capidrv.c
- * - locking of list operations and module count updates.
- *
- * Revision 1.4 1999/09/15 08:16:03 calle
- * Implementation of 64Bit extention complete.
- *
- * Revision 1.3 1999/09/07 09:02:53 calle
- * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and
- * DATA_B3_IND is always directly after the CAPI message. The "Data" member
- * ist never used inside the kernel.
- *
- * Revision 1.2 1997/05/18 09:24:19 calle
- * added verbose disconnect reason reporting to avmb1.
- * some fixes in capi20 interface.
- * changed info messages for B1-PCI
- *
- * Revision 1.1 1997/03/04 21:50:35 calle
- * Frirst version in isdn4linux
- *
- * Revision 2.2 1997/02/12 09:31:39 calle
- * new version
- *
- * Revision 1.1 1997/01/31 10:32:20 calle
- * Initial revision
- *
*
*/
#ifndef __CAPIUTIL_H__
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/kcapi.c linux.20p7/drivers/isdn/avmb1/kcapi.c
--- linux.vanilla/drivers/isdn/avmb1/kcapi.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/avmb1/kcapi.c Wed Jul 4 16:03:54 2001
@@ -1,119 +1,10 @@
/*
- * $Id: kcapi.c,v 1.21.6.2 2001/02/13 11:43:29 kai Exp $
+ * $Id: kcapi.c,v 1.21.6.7 2001/06/09 15:14:15 kai Exp $
*
* Kernel CAPI 2.0 Module
*
* (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
*
- * $Log: kcapi.c,v $
- * Revision 1.21.6.2 2001/02/13 11:43:29 kai
- * more compatility changes for 2.2.19
- *
- * Revision 1.21.6.1 2000/12/10 23:39:19 kai
- * in 2.4 we don't have tq_scheduler anymore.
- * also add one supported card to hfc_pci.c
- * (from main branch)
- *
- * Revision 1.21 2000/11/23 20:45:14 kai
- * fixed module_init/exit stuff
- * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
- *
- * Revision 1.20 2000/11/19 17:01:53 kai
- * compatibility cleanup - part 2
- *
- * Revision 1.19 2000/11/01 14:05:02 calle
- * - use module_init/module_exit from linux/init.h.
- * - all static struct variables are initialized with "membername:" now.
- * - avm_cs.c, let it work with newer pcmcia-cs.
- *
- * Revision 1.18 2000/07/20 10:22:27 calle
- * - Made procfs function cleaner and removed variable "begin".
- *
- * Revision 1.17 2000/04/21 13:00:56 calle
- * Bugfix: driver_proc_info was also wrong.
- *
- * Revision 1.16 2000/04/21 12:38:42 calle
- * Bugfix: error in proc_ functions, begin-off => off-begin
- *
- * Revision 1.15 2000/04/06 15:01:25 calle
- * Bugfix: crash in capidrv.c when reseting a capi controller.
- * - changed code order on remove of controller.
- * - using tq_schedule for notifier in kcapi.c.
- * - now using spin_lock_irqsave() and spin_unlock_irqrestore().
- * strange: sometimes even MP hang on unload of isdn.o ...
- *
- * Revision 1.14 2000/04/03 13:29:25 calle
- * make Tim Waugh happy (module unload races in 2.3.99-pre3).
- * no real problem there, but now it is much cleaner ...
- *
- * Revision 1.13 2000/03/03 15:50:42 calle
- * - kernel CAPI:
- * - Changed parameter "param" in capi_signal from __u32 to void *.
- * - rewrote notifier handling in kcapi.c
- * - new notifier NCCI_UP and NCCI_DOWN
- * - User CAPI:
- * - /dev/capi20 is now a cloning device.
- * - middleware extentions prepared.
- * - capidrv.c
- * - locking of list operations and module count updates.
- *
- * Revision 1.12 2000/01/28 16:45:39 calle
- * new manufacturer command KCAPI_CMD_ADDCARD (generic addcard),
- * will search named driver and call the add_card function if one exist.
- *
- * Revision 1.11 1999/11/23 13:29:29 calle
- * Bugfix: incoming capi message were never traced.
- *
- * Revision 1.10 1999/10/26 15:30:32 calle
- * Generate error message if user want to add card, but driver module is
- * not loaded.
- *
- * Revision 1.9 1999/10/11 22:04:12 keil
- * COMPAT_NEED_UACCESS (no include in isdn_compat.h)
- *
- * Revision 1.8 1999/09/10 17:24:18 calle
- * Changes for proposed standard for CAPI2.0:
- * - AK148 "Linux Exention"
- *
- * Revision 1.7 1999/09/04 06:20:05 keil
- * Changes from kernel set_current_state()
- *
- * Revision 1.6 1999/07/20 06:41:49 calle
- * Bugfix: After the redesign of the AVM B1 driver, the driver didn't even
- * compile, if not selected as modules.
- *
- * Revision 1.5 1999/07/09 15:05:48 keil
- * compat.h is now isdn_compat.h
- *
- * Revision 1.4 1999/07/08 14:15:17 calle
- * Forgot to count down ncards in drivercb_detach_ctr.
- *
- * Revision 1.3 1999/07/06 07:42:02 calle
- * - changes in /proc interface
- * - check and changed calls to [dev_]kfree_skb and [dev_]alloc_skb.
- *
- * Revision 1.2 1999/07/05 15:09:52 calle
- * - renamed "appl_release" to "appl_released".
- * - version und profile data now cleared on controller reset
- * - extended /proc interface, to allow driver and controller specific
- * informations to include by driver hackers.
- *
- * Revision 1.1 1999/07/01 15:26:42 calle
- * complete new version (I love it):
- * + new hardware independed "capi_driver" interface that will make it easy to:
- * - support other controllers with CAPI-2.0 (i.e. USB Controller)
- * - write a CAPI-2.0 for the passive cards
- * - support serial link CAPI-2.0 boxes.
- * + wrote "capi_driver" for all supported cards.
- * + "capi_driver" (supported cards) now have to be configured with
- * make menuconfig, in the past all supported cards where included
- * at once.
- * + new and better informations in /proc/capi/
- * + new ioctl to switch trace of capi messages per controller
- * using "avmcapictrl trace [contr] on|off|...."
- * + complete testcircle with all supported cards and also the
- * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done.
- *
*/
#define CONFIG_AVMB1_COMPAT
@@ -127,6 +18,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -139,7 +31,7 @@
#include
#endif
-static char *revision = "$Revision: 1.21.6.2 $";
+static char *revision = "$Revision: 1.21.6.7 $";
/* ------------------------------------------------------------- */
@@ -814,7 +706,7 @@
}
}
/*
- * ncci managment
+ * ncci management
*/
static void controllercb_new_ncci(struct capi_ctr * card,
@@ -1235,14 +1127,12 @@
static __u16 capi_release(__u16 applid)
{
- struct sk_buff *skb;
int i;
if (!VALID_APPLID(applid) || APPL(applid)->releasing)
return CAPI_ILLAPPNR;
APPL(applid)->releasing++;
- while ((skb = skb_dequeue(&APPL(applid)->recv_queue)) != 0)
- kfree_skb(skb);
+ skb_queue_purge(&APPL(applid)->recv_queue);
for (i = 0; i < CAPI_MAXCONTR; i++) {
if (cards[i].cardstate != CARD_RUNNING)
continue;
@@ -1752,7 +1642,7 @@
static int __init kcapi_init(void)
{
char *p;
- char rev[10];
+ char rev[32];
MOD_INC_USE_COUNT;
@@ -1766,17 +1656,18 @@
proc_capi_init();
- if ((p = strchr(revision, ':'))) {
- strcpy(rev, p + 1);
- p = strchr(rev, '$');
- *p = 0;
+ if ((p = strchr(revision, ':')) != 0 && p[1]) {
+ strncpy(rev, p + 2, sizeof(rev));
+ rev[sizeof(rev)-1] = 0;
+ if ((p = strchr(rev, '$')) != 0 && p > rev)
+ *(p-1) = 0;
} else
strcpy(rev, "1.0");
#ifdef MODULE
- printk(KERN_NOTICE "CAPI-driver Rev%s: loaded\n", rev);
+ printk(KERN_NOTICE "CAPI-driver Rev %s: loaded\n", rev);
#else
- printk(KERN_NOTICE "CAPI-driver Rev%s: started\n", rev);
+ printk(KERN_NOTICE "CAPI-driver Rev %s: started\n", rev);
#endif
MOD_DEC_USE_COUNT;
return 0;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/t1isa.c linux.20p7/drivers/isdn/avmb1/t1isa.c
--- linux.vanilla/drivers/isdn/avmb1/t1isa.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/avmb1/t1isa.c Wed Jul 4 16:03:54 2001
@@ -1,95 +1,10 @@
/*
- * $Id: t1isa.c,v 1.16.6.1 2001/02/13 11:43:29 kai Exp $
+ * $Id: t1isa.c,v 1.16.6.6 2001/05/17 21:15:33 kai Exp $
*
* Module for AVM T1 HEMA-card.
*
* (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
*
- * $Log: t1isa.c,v $
- * Revision 1.16.6.1 2001/02/13 11:43:29 kai
- * more compatility changes for 2.2.19
- *
- * Revision 1.16 2000/11/23 20:45:14 kai
- * fixed module_init/exit stuff
- * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
- *
- * Revision 1.15 2000/11/01 14:05:02 calle
- * - use module_init/module_exit from linux/init.h.
- * - all static struct variables are initialized with "membername:" now.
- * - avm_cs.c, let it work with newer pcmcia-cs.
- *
- * Revision 1.14 2000/10/10 17:44:19 kai
- * changes from/for 2.2.18
- *
- * Revision 1.13 2000/08/04 15:36:31 calle
- * copied wrong from file to file :-(
- *
- * Revision 1.12 2000/08/04 12:20:08 calle
- * - Fix unsigned/signed warning in the right way ...
- *
- * Revision 1.11 2000/04/03 13:29:25 calle
- * make Tim Waugh happy (module unload races in 2.3.99-pre3).
- * no real problem there, but now it is much cleaner ...
- *
- * Revision 1.10 2000/02/02 18:36:04 calle
- * - Modules are now locked while init_module is running
- * - fixed problem with memory mapping if address is not aligned
- *
- * Revision 1.9 2000/01/25 14:37:39 calle
- * new message after successfull detection including card revision and
- * used resources.
- *
- * Revision 1.8 1999/11/05 16:38:01 calle
- * Cleanups before kernel 2.4:
- * - Changed all messages to use card->name or driver->name instead of
- * constant string.
- * - Moved some data from struct avmcard into new struct avmctrl_info.
- * Changed all lowlevel capi driver to match the new structur.
- *
- * Revision 1.7 1999/09/15 08:16:03 calle
- * Implementation of 64Bit extention complete.
- *
- * Revision 1.6 1999/09/07 09:02:53 calle
- * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and
- * DATA_B3_IND is always directly after the CAPI message. The "Data" member
- * ist never used inside the kernel.
- *
- * Revision 1.5 1999/08/22 20:26:28 calle
- * backported changes from kernel 2.3.14:
- * - several #include "config.h" gone, others come.
- * - "struct device" changed to "struct net_device" in 2.3.14, added a
- * define in isdn_compat.h for older kernel versions.
- *
- * Revision 1.4 1999/07/09 15:05:50 keil
- * compat.h is now isdn_compat.h
- *
- * Revision 1.3 1999/07/06 07:42:04 calle
- * - changes in /proc interface
- * - check and changed calls to [dev_]kfree_skb and [dev_]alloc_skb.
- *
- * Revision 1.2 1999/07/05 15:09:54 calle
- * - renamed "appl_release" to "appl_released".
- * - version und profile data now cleared on controller reset
- * - extended /proc interface, to allow driver and controller specific
- * informations to include by driver hackers.
- *
- * Revision 1.1 1999/07/01 15:26:44 calle
- * complete new version (I love it):
- * + new hardware independed "capi_driver" interface that will make it easy to:
- * - support other controllers with CAPI-2.0 (i.e. USB Controller)
- * - write a CAPI-2.0 for the passive cards
- * - support serial link CAPI-2.0 boxes.
- * + wrote "capi_driver" for all supported cards.
- * + "capi_driver" (supported cards) now have to be configured with
- * make menuconfig, in the past all supported cards where included
- * at once.
- * + new and better informations in /proc/capi/
- * + new ioctl to switch trace of capi messages per controller
- * using "avmcapictrl trace [contr] on|off|...."
- * + complete testcircle with all supported cards and also the
- * PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done.
- *
- *
*/
#include
@@ -100,14 +15,16 @@
#include
#include
#include
+#include
#include
+#include
#include
#include "capicmd.h"
#include "capiutil.h"
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.16.6.1 $";
+static char *revision = "$Revision: 1.16.6.6 $";
/* ------------------------------------------------------------- */
@@ -401,7 +318,7 @@
cli();
b1_setinterrupt(port, card->irq, card->cardtype);
b1_put_byte(port, SEND_INIT);
- b1_put_word(port, AVM_NAPPS);
+ b1_put_word(port, CAPI_MAXAPPL);
b1_put_word(port, AVM_NCCI_PER_CHANNEL*30);
b1_put_word(port, ctrl->cnr - 1);
restore_flags(flags);
@@ -628,10 +545,11 @@
MOD_INC_USE_COUNT;
- if ((p = strchr(revision, ':'))) {
- strncpy(driver->revision, p + 1, sizeof(driver->revision));
- p = strchr(driver->revision, '$');
- *p = 0;
+ if ((p = strchr(revision, ':')) != 0 && p[1]) {
+ strncpy(driver->revision, p + 2, sizeof(driver->revision));
+ driver->revision[sizeof(driver->revision)-1] = 0;
+ if ((p = strchr(driver->revision, '$')) != 0 && p > driver->revision)
+ *(p-1) = 0;
}
printk(KERN_INFO "%s: revision %s\n", driver->name, driver->revision);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/avmb1/t1pci.c linux.20p7/drivers/isdn/avmb1/t1pci.c
--- linux.vanilla/drivers/isdn/avmb1/t1pci.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/avmb1/t1pci.c Wed Jul 4 16:03:54 2001
@@ -1,77 +1,10 @@
/*
- * $Id: t1pci.c,v 1.13.6.2 2001/02/13 11:43:29 kai Exp $
+ * $Id: t1pci.c,v 1.13.6.5 2001/05/17 20:41:51 kai Exp $
*
* Module for AVM T1 PCI-card.
*
* (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
*
- * $Log: t1pci.c,v $
- * Revision 1.13.6.2 2001/02/13 11:43:29 kai
- * more compatility changes for 2.2.19
- *
- * Revision 1.13.6.1 2000/11/28 12:02:45 kai
- * MODULE_DEVICE_TABLE for 2.4
- *
- * Revision 1.13.2.2 2000/11/26 17:47:53 kai
- * added PCI_DEV_TABLE for 2.4
- *
- * Revision 1.13.2.1 2000/11/26 17:14:19 kai
- * fix device ids
- * also needs patches to include/linux/pci_ids.h
- *
- * Revision 1.13 2000/11/23 20:45:14 kai
- * fixed module_init/exit stuff
- * Note: compiled-in kernel doesn't work pre 2.2.18 anymore.
- *
- * Revision 1.12 2000/11/01 14:05:02 calle
- * - use module_init/module_exit from linux/init.h.
- * - all static struct variables are initialized with "membername:" now.
- * - avm_cs.c, let it work with newer pcmcia-cs.
- *
- * Revision 1.11 2000/08/08 09:24:19 calle
- * calls to pci_enable_device surounded by #ifndef COMPAT_HAS_2_2_PCI
- *
- * Revision 1.10 2000/07/20 10:21:21 calle
- * Bugfix: driver will not be unregistered, if not cards were detected.
- * this result in an oops in kcapi.c
- *
- * Revision 1.9 2000/05/19 15:43:22 calle
- * added calls to pci_device_start().
- *
- * Revision 1.8 2000/05/06 00:52:36 kai
- * merged changes from kernel tree
- * fixed timer and net_device->name breakage
- *
- * Revision 1.7 2000/04/07 15:26:55 calle
- * better error message if cabel not connected or T1 has no power.
- *
- * Revision 1.6 2000/04/03 13:29:25 calle
- * make Tim Waugh happy (module unload races in 2.3.99-pre3).
- * no real problem there, but now it is much cleaner ...
- *
- * Revision 1.5 2000/02/02 18:36:04 calle
- * - Modules are now locked while init_module is running
- * - fixed problem with memory mapping if address is not aligned
- *
- * Revision 1.4 2000/01/25 14:33:38 calle
- * - Added Support AVM B1 PCI V4.0 (tested with prototype)
- * - splitted up t1pci.c into b1dma.c for common function with b1pciv4
- * - support for revision register
- *
- * Revision 1.3 1999/11/13 21:27:16 keil
- * remove KERNELVERSION
- *
- * Revision 1.2 1999/11/05 16:38:02 calle
- * Cleanups before kernel 2.4:
- * - Changed all messages to use card->name or driver->name instead of
- * constant string.
- * - Moved some data from struct avmcard into new struct avmctrl_info.
- * Changed all lowlevel capi driver to match the new structur.
- *
- * Revision 1.1 1999/10/26 15:31:42 calle
- * Added driver for T1-PCI card.
- *
- *
*/
#include
@@ -92,7 +25,7 @@
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.13.6.2 $";
+static char *revision = "$Revision: 1.13.6.5 $";
#undef CONFIG_T1PCI_DEBUG
#undef CONFIG_T1PCI_POLLDEBUG
@@ -116,7 +49,7 @@
di->detach_ctr(ctrl);
free_irq(card->irq, card);
- iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK));
+ iounmap(card->mbase);
release_region(card->port, AVMB1_PORTLEN);
ctrl->driverdata = 0;
kfree(card->ctrlinfo);
@@ -130,7 +63,6 @@
static int t1pci_add_card(struct capi_driver *driver, struct capicardparams *p)
{
- unsigned long base, page_offset;
avmcard *card;
avmctrl_info *cinfo;
int retval;
@@ -181,12 +113,8 @@
return -EBUSY;
}
- base = card->membase & PAGE_MASK;
- page_offset = card->membase - base;
- card->mbase = ioremap_nocache(base, page_offset + 64);
- if (card->mbase) {
- card->mbase += page_offset;
- } else {
+ card->mbase = ioremap_nocache(card->membase, 64);
+ if (!card->mbase) {
printk(KERN_NOTICE "%s: can't remap memory at 0x%lx\n",
driver->name, card->membase);
kfree(card->ctrlinfo);
@@ -205,7 +133,7 @@
else
printk(KERN_NOTICE "%s: card at 0x%x, but cabel not connected or T1 has no power (%d)\n",
driver->name, card->port, retval);
- iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK));
+ iounmap(card->mbase);
kfree(card->ctrlinfo);
kfree(card->dma);
kfree(card);
@@ -220,7 +148,7 @@
if (retval) {
printk(KERN_ERR "%s: unable to get IRQ %d.\n",
driver->name, card->irq);
- iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK));
+ iounmap(card->mbase);
release_region(card->port, AVMB1_PORTLEN);
kfree(card->ctrlinfo);
kfree(card->dma);
@@ -232,7 +160,7 @@
cinfo->capi_ctrl = di->attach_ctr(driver, card->name, cinfo);
if (!cinfo->capi_ctrl) {
printk(KERN_ERR "%s: attach controller failed.\n", driver->name);
- iounmap((void *) (((unsigned long) card->mbase) & PAGE_MASK));
+ iounmap(card->mbase);
free_irq(card->irq, card);
release_region(card->port, AVMB1_PORTLEN);
kfree(card->ctrlinfo);
@@ -300,16 +228,16 @@
MOD_INC_USE_COUNT;
- if ((p = strchr(revision, ':'))) {
- strncpy(driver->revision, p + 1, sizeof(driver->revision));
- p = strchr(driver->revision, '$');
- *p = 0;
+ if ((p = strchr(revision, ':')) != 0 && p[1]) {
+ strncpy(driver->revision, p + 2, sizeof(driver->revision));
+ driver->revision[sizeof(driver->revision)-1] = 0;
+ if ((p = strchr(driver->revision, '$')) != 0 && p > driver->revision)
+ *(p-1) = 0;
}
printk(KERN_INFO "%s: revision %s\n", driver->name, driver->revision);
di = attach_capi_driver(driver);
-
if (!di) {
printk(KERN_ERR "%s: failed to attach capi_driver\n",
driver->name);
@@ -317,22 +245,20 @@
return -EIO;
}
-#ifdef CONFIG_PCI
- if (!pci_present()) {
- printk(KERN_ERR "%s: no PCI bus present\n", driver->name);
- detach_capi_driver(driver);
- MOD_DEC_USE_COUNT;
- return -EIO;
- }
-
while ((dev = pci_find_device(PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_T1, dev))) {
struct capicardparams param;
+ if (pci_enable_device(dev) < 0) {
+ printk(KERN_ERR "%s: failed to enable AVM-T1-PCI\n",
+ driver->name);
+ continue;
+ }
+ pci_set_master(dev);
+
param.port = dev->base_address[ 1] & PCI_BASE_ADDRESS_IO_MASK;
param.irq = dev->irq;
param.membase = dev->base_address[ 0] & PCI_BASE_ADDRESS_MEM_MASK;
-
printk(KERN_INFO
"%s: PCI BIOS reports AVM-T1-PCI at i/o %#x, irq %d, mem %#x\n",
driver->name, param.port, param.irq, param.membase);
@@ -341,9 +267,7 @@
printk(KERN_ERR
"%s: no AVM-T1-PCI at i/o %#x, irq %d detected, mem %#x\n",
driver->name, param.port, param.irq, param.membase);
- detach_capi_driver(&t1pci_driver);
- MOD_DEC_USE_COUNT;
- return retval;
+ continue;
}
ncards++;
}
@@ -356,12 +280,7 @@
printk(KERN_ERR "%s: NO T1-PCI card detected\n", driver->name);
detach_capi_driver(&t1pci_driver);
MOD_DEC_USE_COUNT;
- return -ESRCH;
-#else
- printk(KERN_ERR "%s: kernel not compiled with PCI.\n", driver->name);
- MOD_DEC_USE_COUNT;
- return -EIO;
-#endif
+ return -ENODEV;
}
static void t1pci_exit(void)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/divert/isdn_divert.c linux.20p7/drivers/isdn/divert/isdn_divert.c
--- linux.vanilla/drivers/isdn/divert/isdn_divert.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/divert/isdn_divert.c Wed Jul 4 16:03:54 2001
@@ -1,5 +1,5 @@
/*
- * $Id: isdn_divert.c,v 1.6.6.1 2001/02/07 11:31:31 kai Exp $
+ * $Id: isdn_divert.c,v 1.6.6.2 2001/02/16 16:43:25 kai Exp $
*
* DSS1 main diversion supplementary handling for i4l.
*
@@ -290,7 +290,7 @@
/* insert a new rule before idx */
/********************************/
int insertrule(int idx, divert_rule *newrule)
-{ struct deflect_struc *ds,*ds1;
+{ struct deflect_struc *ds,*ds1=NULL;
int flags;
if (!(ds = (struct deflect_struc *) kmalloc(sizeof(struct deflect_struc),
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/eicon/eicon_idi.c linux.20p7/drivers/isdn/eicon/eicon_idi.c
--- linux.vanilla/drivers/isdn/eicon/eicon_idi.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/eicon/eicon_idi.c Wed Jul 4 16:03:54 2001
@@ -2221,7 +2221,10 @@
static char *connmsg[] =
{"", "V.21", "V.23", "V.22", "V.22bis", "V.32bis", "V.34",
"V.8", "Bell 212A", "Bell 103", "V.29 Leased", "V.33 Leased", "V.90",
- "V.21 CH2", "V.27ter", "V.29", "V.33", "V.17"};
+ "V.21 CH2", "V.27ter", "V.29", "V.33", "V.17", "V.32", "K56Flex",
+ "X2", "V.18", "V.18LH", "V.18HL", "V.21LH", "V.21HL",
+ "Bell 103LH", "Bell 103HL", "V.23", "V.23", "EDT 110",
+ "Baudot45", "Baudot47", "Baudot50", "DTMF" };
static u_char dtmf_code[] = {
'1','4','7','*','2','5','8','0','3','6','9','#','A','B','C','D'
};
@@ -2243,7 +2246,11 @@
cmd.driver = ccard->myid;
cmd.command = ISDN_STAT_BCONN;
cmd.arg = chan->No;
- sprintf(cmd.parm.num, "%d/%s", p->speed, connmsg[p->norm]);
+ if (p->norm > 34) {
+ sprintf(cmd.parm.num, "%d/(%d)", p->speed, p->norm);
+ } else {
+ sprintf(cmd.parm.num, "%d/%s", p->speed, connmsg[p->norm]);
+ }
ccard->interface.statcallb(&cmd);
}
eicon_log(ccard, 8, "idi_ind: Ch%d: UDATA_DCD_ON time %d\n", chan->No, p->time);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/eicon/idi.h linux.20p7/drivers/isdn/eicon/idi.h
--- linux.vanilla/drivers/isdn/eicon/idi.h Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/eicon/idi.h Wed Jul 4 16:03:54 2001
@@ -62,7 +62,7 @@
struct postcall_s {
word command; /* command = 0x0300 */
word dummy; /* not used */
- IDI_CALL callback; /* routine adress to call back */
+ IDI_CALL callback; /* routine address to call back */
ENTITY *contxt; /* ptr to entity to use */
};
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/amd7930.c linux.20p7/drivers/isdn/hisax/amd7930.c
--- linux.vanilla/drivers/isdn/hisax/amd7930.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/amd7930.c Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-/* $Id: amd7930.c,v 1.5 2000/11/24 17:05:37 kai Exp $
+/* $Id: amd7930.c,v 1.5.6.3 2001/06/11 22:08:37 kai Exp $
*
* HiSax ISDN driver - chip specific routines for AMD 7930
*
@@ -14,7 +14,7 @@
*
* The code is unreliable enough to be consider alpha
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
* Advanced Micro Devices' Am79C30A is an ISDN/audio chip used in the
* SparcStation 1+. The chip provides microphone and speaker interfaces
@@ -94,7 +94,7 @@
#include "rawhdlc.h"
#include
-static const char *amd7930_revision = "$Revision: 1.5 $";
+static const char *amd7930_revision = "$Revision: 1.5.6.3 $";
#define RCV_BUFSIZE 1024 /* Size of raw receive buffer in bytes */
#define RCV_BUFBLKS 4 /* Number of blocks to divide buffer into
@@ -362,12 +362,8 @@
amd7930_bclose(0, bcs->channel);
if (test_bit(BC_FLG_INIT, &bcs->Flag)) {
- while ((skb = skb_dequeue(&bcs->rqueue))) {
- dev_kfree_skb(skb);
- }
- while ((skb = skb_dequeue(&bcs->squeue))) {
- dev_kfree_skb(skb);
- }
+ skb_queue_purge(&bcs->rqueue);
+ skb_queue_purge(&bcs->squeue);
}
test_and_clear_bit(BC_FLG_INIT, &bcs->Flag);
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/arcofi.c linux.20p7/drivers/isdn/hisax/arcofi.c
--- linux.vanilla/drivers/isdn/hisax/arcofi.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/arcofi.c Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: arcofi.c,v 1.12 2000/11/25 17:01:00 kai Exp $
+/* $Id: arcofi.c,v 1.12.6.1 2001/02/16 16:43:25 kai Exp $
*
* arcofi.c Ansteuerung ARCOFI 2165
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/arcofi.h linux.20p7/drivers/isdn/hisax/arcofi.h
--- linux.vanilla/drivers/isdn/hisax/arcofi.h Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/arcofi.h Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: arcofi.h,v 1.6 2000/06/26 08:59:12 keil Exp $
+/* $Id: arcofi.h,v 1.6.6.1 2001/02/16 16:43:25 kai Exp $
*
* arcofi.h Ansteuerung ARCOFI 2165
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/asuscom.c linux.20p7/drivers/isdn/hisax/asuscom.c
--- linux.vanilla/drivers/isdn/hisax/asuscom.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/asuscom.c Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-/* $Id: asuscom.c,v 1.11 2000/11/24 17:05:37 kai Exp $
+/* $Id: asuscom.c,v 1.11.6.1 2001/02/16 16:43:25 kai Exp $
*
* asuscom.c low level stuff for ASUSCOM NETWORK INC. ISDNLink cards
*
@@ -6,7 +6,7 @@
*
* Thanks to ASUSCOM NETWORK INC. Taiwan and Dynalink NL for informations
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -20,7 +20,7 @@
extern const char *CardType[];
-const char *Asuscom_revision = "$Revision: 1.11 $";
+const char *Asuscom_revision = "$Revision: 1.11.6.1 $";
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/avm_a1.c linux.20p7/drivers/isdn/hisax/avm_a1.c
--- linux.vanilla/drivers/isdn/hisax/avm_a1.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/avm_a1.c Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: avm_a1.c,v 2.13 2000/11/24 17:05:37 kai Exp $
+/* $Id: avm_a1.c,v 2.13.6.1 2001/02/16 16:43:25 kai Exp $
*
* avm_a1.c low level stuff for AVM A1 (Fritz) isdn cards
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
#define __NO_VERSION__
@@ -15,7 +15,7 @@
#include "isdnl1.h"
extern const char *CardType[];
-static const char *avm_revision = "$Revision: 2.13 $";
+static const char *avm_revision = "$Revision: 2.13.6.1 $";
#define AVM_A1_STAT_ISAC 0x01
#define AVM_A1_STAT_HSCX 0x02
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/avm_a1p.c linux.20p7/drivers/isdn/hisax/avm_a1p.c
--- linux.vanilla/drivers/isdn/hisax/avm_a1p.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/avm_a1p.c Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-/* $Id: avm_a1p.c,v 2.7 2000/11/24 17:05:37 kai Exp $
+/* $Id: avm_a1p.c,v 2.7.6.1 2001/02/16 16:43:25 kai Exp $
*
* avm_a1p.c low level stuff for the following AVM cards:
* A1 PCMCIA
@@ -7,7 +7,7 @@
*
* Author Carsten Paeth (calle@calle.in-berlin.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*/
#define __NO_VERSION__
#include
@@ -53,7 +53,7 @@
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
-static const char *avm_revision = "$Revision: 2.7 $";
+static const char *avm_revision = "$Revision: 2.7.6.1 $";
static inline u_char
ReadISAC(struct IsdnCardState *cs, u_char offset)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/avm_pci.c linux.20p7/drivers/isdn/hisax/avm_pci.c
--- linux.vanilla/drivers/isdn/hisax/avm_pci.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/avm_pci.c Wed Jul 4 16:03:54 2001
@@ -1,11 +1,11 @@
-/* $Id: avm_pci.c,v 1.22.6.3 2001/02/13 10:33:58 kai Exp $
+/* $Id: avm_pci.c,v 1.22.6.5 2001/06/09 15:14:16 kai Exp $
*
* avm_pci.c low level stuff for AVM Fritz!PCI and ISA PnP isdn cards
* Thanks to AVM, Berlin for informations
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
#define __NO_VERSION__
@@ -19,7 +19,7 @@
#include
extern const char *CardType[];
-static const char *avm_pci_rev = "$Revision: 1.22.6.3 $";
+static const char *avm_pci_rev = "$Revision: 1.22.6.5 $";
#define AVM_FRITZ_PCI 1
#define AVM_FRITZ_PNP 2
@@ -592,8 +592,8 @@
kfree(bcs->blog);
bcs->blog = NULL;
}
- discard_queue(&bcs->rqueue);
- discard_queue(&bcs->squeue);
+ skb_queue_purge(&bcs->rqueue);
+ skb_queue_purge(&bcs->squeue);
if (bcs->tx_skb) {
dev_kfree_skb(bcs->tx_skb);
bcs->tx_skb = NULL;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/bkm_a4t.c linux.20p7/drivers/isdn/hisax/bkm_a4t.c
--- linux.vanilla/drivers/isdn/hisax/bkm_a4t.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/bkm_a4t.c Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-/* $Id: bkm_a4t.c,v 1.13.6.3 2001/02/13 10:33:58 kai Exp $
+/* $Id: bkm_a4t.c,v 1.13.6.4 2001/02/16 16:43:25 kai Exp $
* bkm_a4t.c low level stuff for T-Berkom A4T
* derived from the original file sedlbauer.c
* derived from the original file niccy.c
@@ -6,7 +6,7 @@
*
* Author Roland Klabunde (R.Klabunde@Berkom.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -25,7 +25,7 @@
extern const char *CardType[];
-const char *bkm_a4t_revision = "$Revision: 1.13.6.3 $";
+const char *bkm_a4t_revision = "$Revision: 1.13.6.4 $";
static inline u_char
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/bkm_a8.c linux.20p7/drivers/isdn/hisax/bkm_a8.c
--- linux.vanilla/drivers/isdn/hisax/bkm_a8.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/bkm_a8.c Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-/* $Id: bkm_a8.c,v 1.14.6.3 2001/02/13 10:33:58 kai Exp $
+/* $Id: bkm_a8.c,v 1.14.6.5 2001/04/15 14:51:09 keil Exp $
* bkm_a8.c low level stuff for Scitel Quadro (4*S0, passive)
* derived from the original file sedlbauer.c
* derived from the original file niccy.c
@@ -6,7 +6,7 @@
*
* Author Roland Klabunde (R.Klabunde@Berkom.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
#define __NO_VERSION__
@@ -28,7 +28,7 @@
extern const char *CardType[];
-const char sct_quadro_revision[] = "$Revision: 1.14.6.3 $";
+const char sct_quadro_revision[] = "$Revision: 1.14.6.5 $";
static const char *sct_quadro_subtypes[] =
{
@@ -206,9 +206,9 @@
void
release_io_sct_quadro(struct IsdnCardState *cs)
{
- release_region(cs->hw.ax.base & 0xffffffc0, 256);
+ release_region(cs->hw.ax.base & 0xffffffc0, 128);
if (cs->subtyp == SCT_1)
- release_region(cs->hw.ax.plx_adr, 256);
+ release_region(cs->hw.ax.plx_adr, 64);
}
static void
@@ -404,9 +404,9 @@
switch(cs->subtyp) {
case 1:
cs->hw.ax.base = pci_ioaddr5 + 0x00;
- if (sct_alloc_io(pci_ioaddr1, 256))
+ if (sct_alloc_io(pci_ioaddr1, 128))
return(0);
- if (sct_alloc_io(pci_ioaddr5, 256))
+ if (sct_alloc_io(pci_ioaddr5, 64))
return(0);
/* disable all IPAC */
writereg(pci_ioaddr5, pci_ioaddr5 + 4,
@@ -420,17 +420,17 @@
break;
case 2:
cs->hw.ax.base = pci_ioaddr4 + 0x08;
- if (sct_alloc_io(pci_ioaddr4, 256))
+ if (sct_alloc_io(pci_ioaddr4, 64))
return(0);
break;
case 3:
cs->hw.ax.base = pci_ioaddr3 + 0x10;
- if (sct_alloc_io(pci_ioaddr3, 256))
+ if (sct_alloc_io(pci_ioaddr3, 64))
return(0);
break;
case 4:
cs->hw.ax.base = pci_ioaddr2 + 0x20;
- if (sct_alloc_io(pci_ioaddr2, 256))
+ if (sct_alloc_io(pci_ioaddr2, 64))
return(0);
break;
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/bkm_ax.h linux.20p7/drivers/isdn/hisax/bkm_ax.h
--- linux.vanilla/drivers/isdn/hisax/bkm_ax.h Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/bkm_ax.h Wed Jul 4 16:03:54 2001
@@ -1,9 +1,9 @@
-/* $Id: bkm_ax.h,v 1.5.6.1 2000/11/28 12:02:46 kai Exp $
+/* $Id: bkm_ax.h,v 1.5.6.2 2001/02/16 16:43:25 kai Exp $
* bkm_ax.h low level decls for T-Berkom cards A4T and Scitel Quadro (4*S0, passive)
*
* Author Roland Klabunde (R.Klabunde@Berkom.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/callc.c linux.20p7/drivers/isdn/hisax/callc.c
--- linux.vanilla/drivers/isdn/hisax/callc.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/callc.c Wed Jul 4 16:03:54 2001
@@ -1,9 +1,9 @@
-/* $Id: callc.c,v 2.51 2000/11/24 17:05:37 kai Exp $
+/* $Id: callc.c,v 2.51.6.4 2001/06/09 15:14:17 kai Exp $
*
* Author Karsten Keil (keil@isdn4linux.de)
* based on the teles driver from Jan den Ouden
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
* For changes and modifications please read
* ../../../Documentation/isdn/HiSax.cert
*
@@ -20,7 +20,7 @@
#define MOD_USE_COUNT ( GET_USE_COUNT (&__this_module))
#endif /* MODULE */
-const char *lli_revision = "$Revision: 2.51 $";
+const char *lli_revision = "$Revision: 2.51.6.4 $";
extern struct IsdnCard cards[];
extern int nrcards;
@@ -66,19 +66,6 @@
return (struct IsdnCardState *) 0;
}
-int
-discard_queue(struct sk_buff_head *q)
-{
- struct sk_buff *skb;
- int ret=0;
-
- while ((skb = skb_dequeue(q))) {
- dev_kfree_skb(skb);
- ret++;
- }
- return(ret);
-}
-
static void
link_debug(struct Channel *chanp, int direction, char *fmt, ...)
{
@@ -337,7 +324,7 @@
* RESUME
*/
-/* incomming call */
+/* incoming call */
static void
lli_deliver_call(struct FsmInst *fi, int event, void *arg)
@@ -850,14 +837,14 @@
#define FNCOUNT (sizeof(fnlist)/sizeof(struct FsmNode))
-void __init
+int __init
CallcNew(void)
{
callcfsm.state_count = STATE_COUNT;
callcfsm.event_count = EVENT_COUNT;
callcfsm.strEvent = strEvent;
callcfsm.strState = strState;
- FsmNew(&callcfsm, fnlist, FNCOUNT);
+ return FsmNew(&callcfsm, fnlist, FNCOUNT);
}
void
@@ -1026,9 +1013,11 @@
printk(KERN_WARNING"call to dummy_pstack pr=%04x arg %lx\n", pr, (long)arg);
}
-static void
+static int
init_PStack(struct PStack **stp) {
*stp = kmalloc(sizeof(struct PStack), GFP_ATOMIC);
+ if (!*stp)
+ return -ENOMEM;
(*stp)->next = NULL;
(*stp)->l1.l1l2 = dummy_pstack;
(*stp)->l1.l1hw = dummy_pstack;
@@ -1041,16 +1030,20 @@
(*stp)->l3.l3l4 = dummy_pstack;
(*stp)->lli.l4l3 = dummy_pstack;
(*stp)->ma.layer = dummy_pstack;
+ return 0;
}
-static void
+static int
init_d_st(struct Channel *chanp)
{
struct PStack *st;
struct IsdnCardState *cs = chanp->cs;
char tmp[16];
+ int err;
- init_PStack(&chanp->d_st);
+ err = init_PStack(&chanp->d_st);
+ if (err)
+ return err;
st = chanp->d_st;
st->next = NULL;
HiSax_addlist(cs, st);
@@ -1075,6 +1068,8 @@
st->lli.userdata = chanp;
st->lli.l2writewakeup = NULL;
st->l3.l3l4 = dchan_l3l4;
+
+ return 0;
}
static void
@@ -1090,10 +1085,11 @@
va_end(args);
}
-static void
+static int
init_chan(int chan, struct IsdnCardState *csta)
{
struct Channel *chanp = csta->channel + chan;
+ int err;
chanp->cs = csta;
chanp->bcs = csta->bcs + chan;
@@ -1102,7 +1098,9 @@
chanp->debug = 0;
chanp->Flags = 0;
chanp->leased = 0;
- init_PStack(&chanp->b_st);
+ err = init_PStack(&chanp->b_st);
+ if (err)
+ return err;
chanp->b_st->l1.delay = DEFAULT_B_DELAY;
chanp->fi.fsm = &callcfsm;
chanp->fi.state = ST_NULL;
@@ -1112,31 +1110,41 @@
FsmInitTimer(&chanp->fi, &chanp->dial_timer);
FsmInitTimer(&chanp->fi, &chanp->drel_timer);
if (!chan || (test_bit(FLG_TWO_DCHAN, &csta->HW_Flags) && chan < 2)) {
- init_d_st(chanp);
+ err = init_d_st(chanp);
+ if (err)
+ return err;
} else {
chanp->d_st = csta->channel->d_st;
}
chanp->data_open = 0;
+ return 0;
}
int
CallcNewChan(struct IsdnCardState *csta) {
- int i;
+ int i, err;
chancount += 2;
- init_chan(0, csta);
- init_chan(1, csta);
+ err = init_chan(0, csta);
+ if (err)
+ return err;
+ err = init_chan(1, csta);
+ if (err)
+ return err;
printk(KERN_INFO "HiSax: 2 channels added\n");
- for (i = 0; i < MAX_WAITING_CALLS; i++)
- init_chan(i+2,csta);
+ for (i = 0; i < MAX_WAITING_CALLS; i++) {
+ err = init_chan(i+2,csta);
+ if (err)
+ return err;
+ }
printk(KERN_INFO "HiSax: MAX_WAITING_CALLS added\n");
if (test_bit(FLG_PTP, &csta->channel->d_st->l2.flag)) {
printk(KERN_INFO "LAYER2 WATCHING ESTABLISH\n");
csta->channel->d_st->lli.l4l3(csta->channel->d_st,
DL_ESTABLISH | REQUEST, NULL);
}
- return (2);
+ return (0);
}
static void
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/cert.c linux.20p7/drivers/isdn/hisax/cert.c
--- linux.vanilla/drivers/isdn/hisax/cert.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/cert.c Wed Jul 4 16:03:54 2001
@@ -1,8 +1,8 @@
-/* $Id: cert.c,v 2.3 2000/06/26 08:59:12 keil Exp $
+/* $Id: cert.c,v 2.3.6.1 2001/02/16 16:43:25 kai Exp $
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
* For changes and modifications please read
* ../../../Documentation/isdn/HiSax.cert
*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/config.c linux.20p7/drivers/isdn/hisax/config.c
--- linux.vanilla/drivers/isdn/hisax/config.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/config.c Wed Jul 4 16:03:54 2001
@@ -1,9 +1,9 @@
-/* $Id: config.c,v 2.57.6.9 2001/02/13 10:33:58 kai Exp $
+/* $Id: config.c,v 2.57.6.15 2001/06/09 15:14:17 kai Exp $
*
* Author Karsten Keil (keil@isdn4linux.de)
* based on the teles driver from Jan den Ouden
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
#include
@@ -436,7 +436,7 @@
}
#ifndef MODULE
-void __init
+static void __init
HiSax_setup(char *str, int *ints)
{
int i, j, argc;
@@ -829,8 +829,8 @@
csta->bcs->BC_Close(csta->bcs);
}
- discard_queue(&csta->rq);
- discard_queue(&csta->sq);
+ skb_queue_purge(&csta->rq);
+ skb_queue_purge(&csta->sq);
if (csta->rcvbuf) {
kfree(csta->rcvbuf);
csta->rcvbuf = NULL;
@@ -906,13 +906,12 @@
save_flags(flags);
cli();
- if (!(cs = (struct IsdnCardState *)
- kmalloc(sizeof(struct IsdnCardState), GFP_ATOMIC))) {
+ cs = kmalloc(sizeof(struct IsdnCardState), GFP_ATOMIC);
+ if (!cs) {
printk(KERN_WARNING
"HiSax: No memory for IsdnCardState(card %d)\n",
cardnr + 1);
- restore_flags(flags);
- return (0);
+ goto out;
}
memset(cs, 0, sizeof(struct IsdnCardState));
card->cs = cs;
@@ -931,241 +930,235 @@
#endif
cs->protocol = card->protocol;
- if ((card->typ > 0) && (card->typ <= ISDN_CTYPE_COUNT)) {
- if (!(cs->dlog = kmalloc(MAX_DLOG_SPACE, GFP_ATOMIC))) {
- printk(KERN_WARNING
- "HiSax: No memory for dlog(card %d)\n",
- cardnr + 1);
- restore_flags(flags);
- return (0);
- }
- if (!(cs->status_buf = kmalloc(HISAX_STATUS_BUFSIZE, GFP_ATOMIC))) {
- printk(KERN_WARNING
- "HiSax: No memory for status_buf(card %d)\n",
- cardnr + 1);
- kfree(cs->dlog);
- restore_flags(flags);
- return (0);
- }
- cs->stlist = NULL;
- cs->status_read = cs->status_buf;
- cs->status_write = cs->status_buf;
- cs->status_end = cs->status_buf + HISAX_STATUS_BUFSIZE - 1;
- cs->typ = card->typ;
- strcpy(cs->iif.id, id);
- cs->iif.channels = 2;
- cs->iif.maxbufsize = MAX_DATA_SIZE;
- cs->iif.hl_hdrlen = MAX_HEADER_LEN;
- cs->iif.features =
- ISDN_FEATURE_L2_X75I |
- ISDN_FEATURE_L2_HDLC |
- ISDN_FEATURE_L2_HDLC_56K |
- ISDN_FEATURE_L2_TRANS |
- ISDN_FEATURE_L3_TRANS |
+ if (card->typ <= 0 || card->typ > ISDN_CTYPE_COUNT) {
+ printk(KERN_WARNING
+ "HiSax: Card Type %d out of range\n",
+ card->typ);
+ goto outf_cs;
+ }
+ if (!(cs->dlog = kmalloc(MAX_DLOG_SPACE, GFP_ATOMIC))) {
+ printk(KERN_WARNING
+ "HiSax: No memory for dlog(card %d)\n",
+ cardnr + 1);
+ goto outf_cs;
+ }
+ if (!(cs->status_buf = kmalloc(HISAX_STATUS_BUFSIZE, GFP_ATOMIC))) {
+ printk(KERN_WARNING
+ "HiSax: No memory for status_buf(card %d)\n",
+ cardnr + 1);
+ goto outf_dlog;
+ }
+ cs->stlist = NULL;
+ cs->status_read = cs->status_buf;
+ cs->status_write = cs->status_buf;
+ cs->status_end = cs->status_buf + HISAX_STATUS_BUFSIZE - 1;
+ cs->typ = card->typ;
+ strcpy(cs->iif.id, id);
+ cs->iif.channels = 2;
+ cs->iif.maxbufsize = MAX_DATA_SIZE;
+ cs->iif.hl_hdrlen = MAX_HEADER_LEN;
+ cs->iif.features =
+ ISDN_FEATURE_L2_X75I |
+ ISDN_FEATURE_L2_HDLC |
+ ISDN_FEATURE_L2_HDLC_56K |
+ ISDN_FEATURE_L2_TRANS |
+ ISDN_FEATURE_L3_TRANS |
#ifdef CONFIG_HISAX_1TR6
- ISDN_FEATURE_P_1TR6 |
+ ISDN_FEATURE_P_1TR6 |
#endif
#ifdef CONFIG_HISAX_EURO
- ISDN_FEATURE_P_EURO |
+ ISDN_FEATURE_P_EURO |
#endif
#ifdef CONFIG_HISAX_NI1
- ISDN_FEATURE_P_NI1 |
+ ISDN_FEATURE_P_NI1 |
#endif
- 0;
-
- cs->iif.command = HiSax_command;
- cs->iif.writecmd = NULL;
- cs->iif.writebuf_skb = HiSax_writebuf_skb;
- cs->iif.readstat = HiSax_readstatus;
- register_isdn(&cs->iif);
- cs->myid = cs->iif.channels;
- printk(KERN_INFO
- "HiSax: Card %d Protocol %s Id=%s (%d)\n", cardnr + 1,
- (card->protocol == ISDN_PTYPE_1TR6) ? "1TR6" :
- (card->protocol == ISDN_PTYPE_EURO) ? "EDSS1" :
- (card->protocol == ISDN_PTYPE_LEASED) ? "LEASED" :
- (card->protocol == ISDN_PTYPE_NI1) ? "NI1" :
- "NONE", cs->iif.id, cs->myid);
- switch (card->typ) {
+ 0;
+
+ cs->iif.command = HiSax_command;
+ cs->iif.writecmd = NULL;
+ cs->iif.writebuf_skb = HiSax_writebuf_skb;
+ cs->iif.readstat = HiSax_readstatus;
+ register_isdn(&cs->iif);
+ cs->myid = cs->iif.channels;
+ printk(KERN_INFO
+ "HiSax: Card %d Protocol %s Id=%s (%d)\n", cardnr + 1,
+ (card->protocol == ISDN_PTYPE_1TR6) ? "1TR6" :
+ (card->protocol == ISDN_PTYPE_EURO) ? "EDSS1" :
+ (card->protocol == ISDN_PTYPE_LEASED) ? "LEASED" :
+ (card->protocol == ISDN_PTYPE_NI1) ? "NI1" :
+ "NONE", cs->iif.id, cs->myid);
+ switch (card->typ) {
#if CARD_TELES0
- case ISDN_CTYPE_16_0:
- case ISDN_CTYPE_8_0:
- ret = setup_teles0(card);
- break;
+ case ISDN_CTYPE_16_0:
+ case ISDN_CTYPE_8_0:
+ ret = setup_teles0(card);
+ break;
#endif
#if CARD_TELES3
- case ISDN_CTYPE_16_3:
- case ISDN_CTYPE_PNP:
- case ISDN_CTYPE_TELESPCMCIA:
- case ISDN_CTYPE_COMPAQ_ISA:
- ret = setup_teles3(card);
- break;
+ case ISDN_CTYPE_16_3:
+ case ISDN_CTYPE_PNP:
+ case ISDN_CTYPE_TELESPCMCIA:
+ case ISDN_CTYPE_COMPAQ_ISA:
+ ret = setup_teles3(card);
+ break;
#endif
#if CARD_S0BOX
- case ISDN_CTYPE_S0BOX:
- ret = setup_s0box(card);
- break;
+ case ISDN_CTYPE_S0BOX:
+ ret = setup_s0box(card);
+ break;
#endif
#if CARD_TELESPCI
- case ISDN_CTYPE_TELESPCI:
- ret = setup_telespci(card);
- break;
+ case ISDN_CTYPE_TELESPCI:
+ ret = setup_telespci(card);
+ break;
#endif
#if CARD_AVM_A1
- case ISDN_CTYPE_A1:
- ret = setup_avm_a1(card);
- break;
+ case ISDN_CTYPE_A1:
+ ret = setup_avm_a1(card);
+ break;
#endif
#if CARD_AVM_A1_PCMCIA
- case ISDN_CTYPE_A1_PCMCIA:
- ret = setup_avm_a1_pcmcia(card);
- break;
+ case ISDN_CTYPE_A1_PCMCIA:
+ ret = setup_avm_a1_pcmcia(card);
+ break;
#endif
#if CARD_FRITZPCI
- case ISDN_CTYPE_FRITZPCI:
- ret = setup_avm_pcipnp(card);
- break;
+ case ISDN_CTYPE_FRITZPCI:
+ ret = setup_avm_pcipnp(card);
+ break;
#endif
#if CARD_ELSA
- case ISDN_CTYPE_ELSA:
- case ISDN_CTYPE_ELSA_PNP:
- case ISDN_CTYPE_ELSA_PCMCIA:
- case ISDN_CTYPE_ELSA_PCI:
- ret = setup_elsa(card);
- break;
+ case ISDN_CTYPE_ELSA:
+ case ISDN_CTYPE_ELSA_PNP:
+ case ISDN_CTYPE_ELSA_PCMCIA:
+ case ISDN_CTYPE_ELSA_PCI:
+ ret = setup_elsa(card);
+ break;
#endif
#if CARD_IX1MICROR2
- case ISDN_CTYPE_IX1MICROR2:
- ret = setup_ix1micro(card);
- break;
+ case ISDN_CTYPE_IX1MICROR2:
+ ret = setup_ix1micro(card);
+ break;
#endif
#if CARD_DIEHLDIVA
- case ISDN_CTYPE_DIEHLDIVA:
- ret = setup_diva(card);
- break;
+ case ISDN_CTYPE_DIEHLDIVA:
+ ret = setup_diva(card);
+ break;
#endif
#if CARD_ASUSCOM
- case ISDN_CTYPE_ASUSCOM:
- ret = setup_asuscom(card);
- break;
+ case ISDN_CTYPE_ASUSCOM:
+ ret = setup_asuscom(card);
+ break;
#endif
#if CARD_TELEINT
- case ISDN_CTYPE_TELEINT:
- ret = setup_TeleInt(card);
- break;
+ case ISDN_CTYPE_TELEINT:
+ ret = setup_TeleInt(card);
+ break;
#endif
#if CARD_SEDLBAUER
- case ISDN_CTYPE_SEDLBAUER:
- case ISDN_CTYPE_SEDLBAUER_PCMCIA:
- case ISDN_CTYPE_SEDLBAUER_FAX:
- ret = setup_sedlbauer(card);
- break;
+ case ISDN_CTYPE_SEDLBAUER:
+ case ISDN_CTYPE_SEDLBAUER_PCMCIA:
+ case ISDN_CTYPE_SEDLBAUER_FAX:
+ ret = setup_sedlbauer(card);
+ break;
#endif
#if CARD_SPORTSTER
- case ISDN_CTYPE_SPORTSTER:
- ret = setup_sportster(card);
- break;
+ case ISDN_CTYPE_SPORTSTER:
+ ret = setup_sportster(card);
+ break;
#endif
#if CARD_MIC
- case ISDN_CTYPE_MIC:
- ret = setup_mic(card);
- break;
+ case ISDN_CTYPE_MIC:
+ ret = setup_mic(card);
+ break;
#endif
#if CARD_NETJET_S
- case ISDN_CTYPE_NETJET_S:
- ret = setup_netjet_s(card);
- break;
+ case ISDN_CTYPE_NETJET_S:
+ ret = setup_netjet_s(card);
+ break;
#endif
#if CARD_HFCS
- case ISDN_CTYPE_TELES3C:
- case ISDN_CTYPE_ACERP10:
- ret = setup_hfcs(card);
- break;
+ case ISDN_CTYPE_TELES3C:
+ case ISDN_CTYPE_ACERP10:
+ ret = setup_hfcs(card);
+ break;
#endif
#if CARD_HFC_PCI
- case ISDN_CTYPE_HFC_PCI:
- ret = setup_hfcpci(card);
- break;
+ case ISDN_CTYPE_HFC_PCI:
+ ret = setup_hfcpci(card);
+ break;
#endif
#if CARD_HFC_SX
- case ISDN_CTYPE_HFC_SX:
- ret = setup_hfcsx(card);
- break;
+ case ISDN_CTYPE_HFC_SX:
+ ret = setup_hfcsx(card);
+ break;
#endif
#if CARD_NICCY
- case ISDN_CTYPE_NICCY:
- ret = setup_niccy(card);
- break;
+ case ISDN_CTYPE_NICCY:
+ ret = setup_niccy(card);
+ break;
#endif
#if CARD_AMD7930
- case ISDN_CTYPE_AMD7930:
- ret = setup_amd7930(card);
- break;
+ case ISDN_CTYPE_AMD7930:
+ ret = setup_amd7930(card);
+ break;
#endif
#if CARD_ISURF
- case ISDN_CTYPE_ISURF:
- ret = setup_isurf(card);
- break;
+ case ISDN_CTYPE_ISURF:
+ ret = setup_isurf(card);
+ break;
#endif
#if CARD_HSTSAPHIR
- case ISDN_CTYPE_HSTSAPHIR:
- ret = setup_saphir(card);
- break;
+ case ISDN_CTYPE_HSTSAPHIR:
+ ret = setup_saphir(card);
+ break;
#endif
#if CARD_TESTEMU
- case ISDN_CTYPE_TESTEMU:
- ret = setup_testemu(card);
- break;
+ case ISDN_CTYPE_TESTEMU:
+ ret = setup_testemu(card);
+ break;
#endif
#if CARD_BKM_A4T
- case ISDN_CTYPE_BKM_A4T:
- ret = setup_bkm_a4t(card);
- break;
+ case ISDN_CTYPE_BKM_A4T:
+ ret = setup_bkm_a4t(card);
+ break;
#endif
#if CARD_SCT_QUADRO
- case ISDN_CTYPE_SCT_QUADRO:
- ret = setup_sct_quadro(card);
- break;
+ case ISDN_CTYPE_SCT_QUADRO:
+ ret = setup_sct_quadro(card);
+ break;
#endif
#if CARD_GAZEL
- case ISDN_CTYPE_GAZEL:
- ret = setup_gazel(card);
- break;
+ case ISDN_CTYPE_GAZEL:
+ ret = setup_gazel(card);
+ break;
#endif
#if CARD_W6692
- case ISDN_CTYPE_W6692:
- ret = setup_w6692(card);
- break;
+ case ISDN_CTYPE_W6692:
+ ret = setup_w6692(card);
+ break;
#endif
#if CARD_NETJET_U
- case ISDN_CTYPE_NETJET_U:
- ret = setup_netjet_u(card);
- break;
+ case ISDN_CTYPE_NETJET_U:
+ ret = setup_netjet_u(card);
+ break;
#endif
- default:
- printk(KERN_WARNING
- "HiSax: Support for %s Card not selected\n",
- CardType[card->typ]);
- ll_unload(cs);
- restore_flags(flags);
- return (0);
- }
- } else {
+ default:
printk(KERN_WARNING
- "HiSax: Card Type %d out of range\n",
- card->typ);
- restore_flags(flags);
- return (0);
+ "HiSax: Support for %s Card not selected\n",
+ CardType[card->typ]);
+ ll_unload(cs);
+ goto outf_cs;
}
if (!ret) {
ll_unload(cs);
- restore_flags(flags);
- return (0);
+ goto outf_cs;
}
if (!(cs->rcvbuf = kmalloc(MAX_DFRAME_LEN_L1, GFP_ATOMIC))) {
printk(KERN_WARNING
"HiSax: No memory for isac rcvbuf\n");
- return (1);
+ ll_unload(cs);
+ goto outf_cs;
}
cs->rcvidx = 0;
cs->tx_skb = NULL;
@@ -1182,16 +1175,31 @@
ret = init_card(cs);
if (ret) {
closecard(cardnr);
- restore_flags(flags);
- return (0);
+ ret = 0;
+ goto outf_cs;
}
init_tei(cs, cs->protocol);
- CallcNewChan(cs);
+ ret = CallcNewChan(cs);
+ if (ret) {
+ closecard(cardnr);
+ ret = 0;
+ goto outf_cs;
+ }
/* ISAR needs firmware download first */
if (!test_bit(HW_ISAR, &cs->HW_Flags))
ll_run(cs, 0);
+
+ ret = 1;
+ goto out;
+
+ outf_dlog:
+ kfree(cs->dlog);
+ outf_cs:
+ kfree(cs);
+ card->cs = NULL;
+ out:
restore_flags(flags);
- return (1);
+ return ret;
}
void
@@ -1240,9 +1248,6 @@
} else {
printk(KERN_WARNING "HiSax: Card %s not installed !\n",
CardType[cards[i].typ]);
- if (cards[i].cs)
- kfree((void *) cards[i].cs);
- cards[i].cs = NULL;
HiSax_shiftcards(i);
nrcards--;
}
@@ -1319,15 +1324,28 @@
static int __init HiSax_init(void)
{
- int i,j;
+ int i, retval;
+#ifdef MODULE
+ int j;
int nzproto = 0;
+#endif
HiSaxVersion();
- CallcNew();
- Isdnl3New();
- Isdnl2New();
- TeiNew();
- Isdnl1New();
+ retval = CallcNew();
+ if (retval)
+ goto out;
+ retval = Isdnl3New();
+ if (retval)
+ goto out_callc;
+ retval = Isdnl2New();
+ if (retval)
+ goto out_isdnl3;
+ retval = TeiNew();
+ if (retval)
+ goto out_isdnl2;
+ retval = Isdnl1New();
+ if (retval)
+ goto out_tei;
#ifdef MODULE
if (!type[0]) {
@@ -1474,17 +1492,26 @@
printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
nrcards, (nrcards > 1) ? "s" : "");
- if (HiSax_inithardware(NULL)) {
- /* Install only, if at least one card found */
- return (0);
- } else {
- Isdnl1Free();
- TeiFree();
- Isdnl2Free();
- Isdnl3Free();
- CallcFree();
- return -EIO;
+ /* Install only, if at least one card found */
+ if (!HiSax_inithardware(NULL)) {
+ retval = -EIO;
+ goto out_isdnl1;
}
+
+ return 0;
+
+ out_isdnl1:
+ Isdnl1Free();
+ out_tei:
+ TeiFree();
+ out_isdnl2:
+ Isdnl2Free();
+ out_isdnl3:
+ Isdnl3Free();
+ out_callc:
+ CallcFree();
+ out:
+ return retval;
}
static void HiSax_exit(void)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/diva.c linux.20p7/drivers/isdn/hisax/diva.c
--- linux.vanilla/drivers/isdn/hisax/diva.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/diva.c Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: diva.c,v 1.25.6.3 2001/02/13 10:33:58 kai Exp $
+/* $Id: diva.c,v 1.25.6.4 2001/02/16 16:43:25 kai Exp $
*
* diva.c low level stuff for Eicon.Diehl Diva Family ISDN cards
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
* For changes and modifications please read
* ../../../Documentation/isdn/HiSax.cert
*
@@ -25,7 +25,7 @@
extern const char *CardType[];
-const char *Diva_revision = "$Revision: 1.25.6.3 $";
+const char *Diva_revision = "$Revision: 1.25.6.4 $";
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/elsa.c linux.20p7/drivers/isdn/hisax/elsa.c
--- linux.vanilla/drivers/isdn/hisax/elsa.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/elsa.c Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: elsa.c,v 2.26.6.2 2001/02/13 10:33:58 kai Exp $
+/* $Id: elsa.c,v 2.26.6.3 2001/02/16 16:43:25 kai Exp $
*
* elsa.c low level stuff for Elsa isdn cards
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
* For changes and modifications please read
* ../../../Documentation/isdn/HiSax.cert
*
@@ -31,7 +31,7 @@
extern const char *CardType[];
-const char *Elsa_revision = "$Revision: 2.26.6.2 $";
+const char *Elsa_revision = "$Revision: 2.26.6.3 $";
const char *Elsa_Types[] =
{"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro",
"PCMCIA", "QS 1000", "QS 3000", "Microlink PCI", "QS 3000 PCI",
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/elsa_ser.c linux.20p7/drivers/isdn/hisax/elsa_ser.c
--- linux.vanilla/drivers/isdn/hisax/elsa_ser.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/elsa_ser.c Wed Jul 4 16:03:54 2001
@@ -1,8 +1,8 @@
-/* $Id: elsa_ser.c,v 2.10 2000/11/19 17:02:47 kai Exp $
+/* $Id: elsa_ser.c,v 2.10.6.2 2001/06/09 15:14:17 kai Exp $
*
* stuff for the serial modem on ELSA cards
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
#include
@@ -439,8 +439,6 @@
void
close_elsastate(struct BCState *bcs)
{
- struct sk_buff *skb;
-
modehscx(bcs, 0, bcs->channel);
if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
if (bcs->hw.hscx.rcvbuf) {
@@ -448,12 +446,8 @@
kfree(bcs->hw.hscx.rcvbuf);
bcs->hw.hscx.rcvbuf = NULL;
}
- while ((skb = skb_dequeue(&bcs->rqueue))) {
- dev_kfree_skb(skb);
- }
- while ((skb = skb_dequeue(&bcs->squeue))) {
- dev_kfree_skb(skb);
- }
+ skb_queue_purge(&bcs->rqueue);
+ skb_queue_purge(&bcs->squeue);
if (bcs->tx_skb) {
dev_kfree_skb(bcs->tx_skb);
bcs->tx_skb = NULL;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/fsm.c linux.20p7/drivers/isdn/hisax/fsm.c
--- linux.vanilla/drivers/isdn/hisax/fsm.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/fsm.c Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-/* $Id: fsm.c,v 1.14 2000/11/24 17:05:37 kai Exp $
+/* $Id: fsm.c,v 1.14.6.2 2001/05/26 15:19:57 kai Exp $
*
* Author Karsten Keil (keil@isdn4linux.de)
* based on the teles driver from Jan den Ouden
@@ -6,7 +6,7 @@
* Thanks to Jan den Ouden
* Fritz Elfert
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
#define __NO_VERSION__
@@ -15,13 +15,16 @@
#define FSM_TIMER_DEBUG 0
-void __init
+int __init
FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount)
{
int i;
fsm->jumpmatrix = (FSMFNPTR *)
kmalloc(sizeof (FSMFNPTR) * fsm->state_count * fsm->event_count, GFP_KERNEL);
+ if (!fsm->jumpmatrix)
+ return -ENOMEM;
+
memset(fsm->jumpmatrix, 0, sizeof (FSMFNPTR) * fsm->state_count * fsm->event_count);
for (i = 0; i < fncount; i++)
@@ -32,6 +35,7 @@
} else
fsm->jumpmatrix[fsm->state_count * fnlist[i].event +
fnlist[i].state] = (FSMFNPTR) fnlist[i].routine;
+ return 0;
}
void
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/gazel.c linux.20p7/drivers/isdn/hisax/gazel.c
--- linux.vanilla/drivers/isdn/hisax/gazel.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/gazel.c Wed Jul 4 16:03:54 2001
@@ -1,11 +1,11 @@
-/* $Id: gazel.c,v 2.11.6.3 2001/02/13 10:33:58 kai Exp $
+/* $Id: gazel.c,v 2.11.6.6 2001/06/08 08:48:46 kai Exp $
*
* gazel.c low level stuff for Gazel isdn cards
*
* Author BeWan Systems
* based on source code from Karsten Keil
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
#include
@@ -20,7 +20,7 @@
#include
extern const char *CardType[];
-const char *gazel_revision = "$Revision: 2.11.6.3 $";
+const char *gazel_revision = "$Revision: 2.11.6.6 $";
#define R647 1
#define R685 2
@@ -440,10 +440,6 @@
reserve_regions(struct IsdnCard *card, struct IsdnCardState *cs)
{
unsigned int i, base = 0, adr = 0, len = 0;
- long flags;
-
- save_flags(flags);
- cli();
switch (cs->subtyp) {
case R647:
@@ -488,17 +484,15 @@
break;
}
- restore_flags(flags);
return 0;
error:
- restore_flags(flags);
printk(KERN_WARNING "Gazel: %s io ports 0x%x-0x%x already in use\n",
CardType[cs->typ], adr, adr + len);
return 1;
}
-static int
+static int __init
setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs)
{
printk(KERN_INFO "Gazel: ISA PnP card automatic recognition\n");
@@ -547,7 +541,7 @@
static struct pci_dev *dev_tel __initdata = NULL;
-static int
+static int __init
setup_gazelpci(struct IsdnCardState *cs)
{
u_int pci_ioaddr0 = 0, pci_ioaddr1 = 0;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/hfc_2bds0.c linux.20p7/drivers/isdn/hisax/hfc_2bds0.c
--- linux.vanilla/drivers/isdn/hisax/hfc_2bds0.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/hfc_2bds0.c Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: hfc_2bds0.c,v 1.15 2000/11/24 17:05:37 kai Exp $
+/* $Id: hfc_2bds0.c,v 1.15.6.2 2001/06/09 15:14:17 kai Exp $
*
* specific routines for CCD's HFC 2BDS0
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
#define __NO_VERSION__
@@ -568,8 +568,8 @@
{
mode_2bs0(bcs, 0, bcs->channel);
if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
- discard_queue(&bcs->rqueue);
- discard_queue(&bcs->squeue);
+ skb_queue_purge(&bcs->rqueue);
+ skb_queue_purge(&bcs->squeue);
if (bcs->tx_skb) {
dev_kfree_skb(bcs->tx_skb);
bcs->tx_skb = NULL;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/hfc_2bds0.h linux.20p7/drivers/isdn/hisax/hfc_2bds0.h
--- linux.vanilla/drivers/isdn/hisax/hfc_2bds0.h Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/hfc_2bds0.h Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: hfc_2bds0.h,v 1.4 2000/06/26 08:59:12 keil Exp $
+/* $Id: hfc_2bds0.h,v 1.4.6.1 2001/02/16 16:43:27 kai Exp $
*
* specific defines for CCD's HFC 2BDS0
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/hfc_2bs0.c linux.20p7/drivers/isdn/hisax/hfc_2bs0.c
--- linux.vanilla/drivers/isdn/hisax/hfc_2bs0.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/hfc_2bs0.c Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: hfc_2bs0.c,v 1.17 2000/11/24 17:05:37 kai Exp $
+/* $Id: hfc_2bs0.c,v 1.17.6.2 2001/06/09 15:14:17 kai Exp $
*
* specific routines for CCD's HFC 2BS0
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -532,8 +532,8 @@
{
mode_hfc(bcs, 0, bcs->channel);
if (test_bit(BC_FLG_INIT, &bcs->Flag)) {
- discard_queue(&bcs->rqueue);
- discard_queue(&bcs->squeue);
+ skb_queue_purge(&bcs->rqueue);
+ skb_queue_purge(&bcs->squeue);
if (bcs->tx_skb) {
dev_kfree_skb(bcs->tx_skb);
bcs->tx_skb = NULL;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/hfc_2bs0.h linux.20p7/drivers/isdn/hisax/hfc_2bs0.h
--- linux.vanilla/drivers/isdn/hisax/hfc_2bs0.h Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/hfc_2bs0.h Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: hfc_2bs0.h,v 1.3 2000/06/26 08:59:13 keil Exp $
+/* $Id: hfc_2bs0.h,v 1.3.6.1 2001/02/16 16:43:27 kai Exp $
*
* specific defines for CCD's HFC 2BS0
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/hfc_pci.c linux.20p7/drivers/isdn/hisax/hfc_pci.c
--- linux.vanilla/drivers/isdn/hisax/hfc_pci.c Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/hfc_pci.c Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-/* $Id: hfc_pci.c,v 1.34.6.4 2001/02/13 10:33:58 kai Exp $
+/* $Id: hfc_pci.c,v 1.34.6.6 2001/06/09 15:14:17 kai Exp $
* hfc_pci.c low level driver for CCD´s hfc-pci based cards
*
@@ -36,7 +36,7 @@
extern const char *CardType[];
-static const char *hfcpci_revision = "$Revision: 1.34.6.4 $";
+static const char *hfcpci_revision = "$Revision: 1.34.6.6 $";
/* table entry in the PCI devices list */
typedef struct {
@@ -236,6 +236,59 @@
return (NULL);
}
+/***************************************/
+/* clear the desired B-channel rx fifo */
+/***************************************/
+static void hfcpci_clear_fifo_rx(struct IsdnCardState *cs, int fifo)
+{ u_char fifo_state;
+ bzfifo_type *bzr;
+
+ if (fifo) {
+ bzr = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxbz_b2;
+ fifo_state = cs->hw.hfcpci.fifo_en & HFCPCI_FIFOEN_B2RX;
+ } else {
+ bzr = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxbz_b1;
+ fifo_state = cs->hw.hfcpci.fifo_en & HFCPCI_FIFOEN_B1RX;
+ }
+ if (fifo_state)
+ cs->hw.hfcpci.fifo_en ^= fifo_state;
+ Write_hfc(cs, HFCPCI_FIFO_EN, cs->hw.hfcpci.fifo_en);
+ cs->hw.hfcpci.last_bfifo_cnt[fifo] = 0;
+ bzr->za[MAX_B_FRAMES].z1 = B_FIFO_SIZE + B_SUB_VAL - 1;
+ bzr->za[MAX_B_FRAMES].z2 = bzr->za[MAX_B_FRAMES].z1;
+ bzr->f1 = MAX_B_FRAMES;
+ bzr->f2 = bzr->f1; /* init F pointers to remain constant */
+ if (fifo_state)
+ cs->hw.hfcpci.fifo_en |= fifo_state;
+ Write_hfc(cs, HFCPCI_FIFO_EN, cs->hw.hfcpci.fifo_en);
+}
+
+/***************************************/
+/* clear the desired B-channel tx fifo */
+/***************************************/
+static void hfcpci_clear_fifo_tx(struct IsdnCardState *cs, int fifo)
+{ u_char fifo_state;
+ bzfifo_type *bzt;
+
+ if (fifo) {
+ bzt = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.txbz_b2;
+ fifo_state = cs->hw.hfcpci.fifo_en & HFCPCI_FIFOEN_B2TX;
+ } else {
+ bzt = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.txbz_b1;
+ fifo_state = cs->hw.hfcpci.fifo_en & HFCPCI_FIFOEN_B1TX;
+ }
+ if (fifo_state)
+ cs->hw.hfcpci.fifo_en ^= fifo_state;
+ Write_hfc(cs, HFCPCI_FIFO_EN, cs->hw.hfcpci.fifo_en);
+ bzt->za[MAX_B_FRAMES].z1 = B_FIFO_SIZE + B_SUB_VAL - 1;
+ bzt->za[MAX_B_FRAMES].z2 = bzt->za[MAX_B_FRAMES].z1;
+ bzt->f1 = MAX_B_FRAMES;
+ bzt->f2 = bzt->f1; /* init F pointers to remain constant */
+ if (fifo_state)
+ cs->hw.hfcpci.fifo_en |= fifo_state;
+ Write_hfc(cs, HFCPCI_FIFO_EN, cs->hw.hfcpci.fifo_en);
+}
+
/*********************************************/
/* read a complete B-frame out of the buffer */
/*********************************************/
@@ -429,7 +482,7 @@
{
long flags;
struct IsdnCardState *cs = bcs->cs;
- int rcnt;
+ int rcnt, real_fifo;
int receive, count = 5;
struct sk_buff *skb;
bzfifo_type *bz;
@@ -441,9 +494,11 @@
if ((bcs->channel) && (!cs->hw.hfcpci.bswapped)) {
bz = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxbz_b2;
bdata = ((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxdat_b2;
+ real_fifo = 1;
} else {
bz = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxbz_b1;
bdata = ((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxdat_b1;
+ real_fifo = 0;
}
Begin:
count--;
@@ -476,6 +531,11 @@
rcnt = bz->f1 - bz->f2;
if (rcnt < 0)
rcnt += MAX_B_FRAMES + 1;
+ if (cs->hw.hfcpci.last_bfifo_cnt[real_fifo] > rcnt + 1) {
+ rcnt = 0;
+ hfcpci_clear_fifo_rx(cs, real_fifo);
+ }
+ cs->hw.hfcpci.last_bfifo_cnt[real_fifo] = rcnt;
if (rcnt > 1)
receive = 1;
else
@@ -1254,7 +1314,6 @@
mode_hfcpci(struct BCState *bcs, int mode, int bc)
{
struct IsdnCardState *cs = bcs->cs;
- bzfifo_type *bzr, *bzt;
int flags, fifo2;
if (cs->debug & L1_DEB_HSCX)
@@ -1301,6 +1360,8 @@
}
break;
case (L1_MODE_TRANS):
+ hfcpci_clear_fifo_rx(cs, fifo2);
+ hfcpci_clear_fifo_tx(cs, fifo2);
if (bc) {
cs->hw.hfcpci.sctrl |= SCTRL_B2_ENA;
cs->hw.hfcpci.sctrl_r |= SCTRL_B2_ENA;
@@ -1313,26 +1374,16 @@
cs->hw.hfcpci.int_m1 |= (HFCPCI_INTS_B2TRANS + HFCPCI_INTS_B2REC);
cs->hw.hfcpci.ctmt |= 2;
cs->hw.hfcpci.conn &= ~0x18;
- bzr = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxbz_b2;
- bzt = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.txbz_b2;
} else {
cs->hw.hfcpci.fifo_en |= HFCPCI_FIFOEN_B1;
cs->hw.hfcpci.int_m1 |= (HFCPCI_INTS_B1TRANS + HFCPCI_INTS_B1REC);
cs->hw.hfcpci.ctmt |= 1;
cs->hw.hfcpci.conn &= ~0x03;
- bzr = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxbz_b1;
- bzt = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.txbz_b1;
}
- bzr->za[MAX_B_FRAMES].z1 = B_FIFO_SIZE + B_SUB_VAL - 1;
- bzr->za[MAX_B_FRAMES].z2 = bzr->za[MAX_B_FRAMES].z1;
- bzr->f1 = MAX_B_FRAMES;
- bzr->f2 = bzr->f1; /* init F pointers to remain constant */
- bzt->za[MAX_B_FRAMES].z1 = B_FIFO_SIZE + B_SUB_VAL - 1;
- bzt->za[MAX_B_FRAMES].z2 = bzt->za[MAX_B_FRAMES].z1;
- bzt->f1 = MAX_B_FRAMES;
- bzt->f2 = bzt->f1; /* init F pointers to remain constant */
break;
case (L1_MODE_HDLC):
+ hfcpci_clear_fifo_rx(cs, fifo2);
+ hfcpci_clear_fifo_tx(cs, fifo2);
if (bc) {
cs->hw.hfcpci.sctrl |= SCTRL_B2_ENA;
cs->hw.hfcpci.sctrl_r |= SCTRL_B2_ENA;
@@ -1341,11 +1392,13 @@
cs->hw.hfcpci.sctrl_r |= SCTRL_B1_ENA;
}
if (fifo2) {
+ cs->hw.hfcpci.last_bfifo_cnt[1] = 0;
cs->hw.hfcpci.fifo_en |= HFCPCI_FIFOEN_B2;
cs->hw.hfcpci.int_m1 |= (HFCPCI_INTS_B2TRANS + HFCPCI_INTS_B2REC);
cs->hw.hfcpci.ctmt &= ~2;
cs->hw.hfcpci.conn &= ~0x18;
} else {
+ cs->hw.hfcpci.last_bfifo_cnt[0] = 0;
cs->hw.hfcpci.fifo_en |= HFCPCI_FIFOEN_B1;
cs->hw.hfcpci.int_m1 |= (HFCPCI_INTS_B1TRANS + HFCPCI_INTS_B1REC);
cs->hw.hfcpci.ctmt &= ~1;
@@ -1445,8 +1498,8 @@
{
mode_hfcpci(bcs, 0, bcs->channel);
if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
- discard_queue(&bcs->rqueue);
- discard_queue(&bcs->squeue);
+ skb_queue_purge(&bcs->rqueue);
+ skb_queue_purge(&bcs->squeue);
if (bcs->tx_skb) {
dev_kfree_skb(bcs->tx_skb);
bcs->tx_skb = NULL;
@@ -1634,7 +1687,8 @@
#endif /* CONFIG_PCI */
-int __init setup_hfcpci(struct IsdnCard *card)
+int __init
+setup_hfcpci(struct IsdnCard *card)
{
struct IsdnCardState *cs = card->cs;
char tmp[64];
@@ -1646,7 +1700,7 @@
#endif
strcpy(tmp, hfcpci_revision);
printk(KERN_INFO "HiSax: HFC-PCI driver Rev. %s\n", HiSax_getrev(tmp));
-#ifdef CONFIG_PCI
+#if CONFIG_PCI
cs->hw.hfcpci.int_s1 = 0;
cs->dc.hfcpci.ph_state = 0;
cs->hw.hfcpci.fifo = 255;
@@ -1660,6 +1714,7 @@
if (tmp_hfcpci) {
if (pci_enable_device(tmp_hfcpci))
continue;
+ pci_set_master(tmp_hfcpci);
if ((card->para[0]) && (card->para[0] != (tmp_hfcpci->base_address[ 0] & PCI_BASE_ADDRESS_IO_MASK)))
continue;
else
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/hfc_pci.h linux.20p7/drivers/isdn/hisax/hfc_pci.h
--- linux.vanilla/drivers/isdn/hisax/hfc_pci.h Sun Mar 25 17:37:32 2001
+++ linux.20p7/drivers/isdn/hisax/hfc_pci.h Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-/* $Id: hfc_pci.h,v 1.8 2000/06/26 08:59:13 keil Exp $
+/* $Id: hfc_pci.h,v 1.8.6.1 2001/04/08 19:32:26 kai Exp $
*
* specific defines for CCD's HFC 2BDS0 PCI chips
*
@@ -178,6 +178,9 @@
#define HFCPCI_FIFOEN_B1 0x03
#define HFCPCI_FIFOEN_B2 0x0C
#define HFCPCI_FIFOEN_DTX 0x10
+#define HFCPCI_FIFOEN_B1TX 0x01
+#define HFCPCI_FIFOEN_B1RX 0x02
+#define HFCPCI_FIFOEN_B2TX 0x04
#define HFCPCI_FIFOEN_B2RX 0x08
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/hfc_sx.c linux.20p7/drivers/isdn/hisax/hfc_sx.c
--- linux.vanilla/drivers/isdn/hisax/hfc_sx.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/hfc_sx.c Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-/* $Id: hfc_sx.c,v 1.9 2000/11/24 17:05:37 kai Exp $
+/* $Id: hfc_sx.c,v 1.9.6.1 2001/06/09 15:14:17 kai Exp $
* hfc_sx.c low level driver for CCD´s hfc-s+/sp based cards
*
@@ -32,7 +32,7 @@
extern const char *CardType[];
-static const char *hfcsx_revision = "$Revision: 1.9 $";
+static const char *hfcsx_revision = "$Revision: 1.9.6.1 $";
/***************************************/
/* IRQ-table for CCDs demo board */
@@ -1288,8 +1288,8 @@
{
mode_hfcsx(bcs, 0, bcs->channel);
if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
- discard_queue(&bcs->rqueue);
- discard_queue(&bcs->squeue);
+ skb_queue_purge(&bcs->rqueue);
+ skb_queue_purge(&bcs->squeue);
if (bcs->tx_skb) {
dev_kfree_skb(bcs->tx_skb);
bcs->tx_skb = NULL;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/hfcscard.c linux.20p7/drivers/isdn/hisax/hfcscard.c
--- linux.vanilla/drivers/isdn/hisax/hfcscard.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/hfcscard.c Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: hfcscard.c,v 1.8 2000/11/24 17:05:37 kai Exp $
+/* $Id: hfcscard.c,v 1.8.6.1 2001/02/16 16:43:27 kai Exp $
*
* hfcscard.c low level stuff for hfcs based cards (Teles3c, ACER P10)
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -16,7 +16,7 @@
extern const char *CardType[];
-static const char *hfcs_revision = "$Revision: 1.8 $";
+static const char *hfcs_revision = "$Revision: 1.8.6.1 $";
static void
hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/hisax.h linux.20p7/drivers/isdn/hisax/hisax.h
--- linux.vanilla/drivers/isdn/hisax/hisax.h Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/hisax.h Wed Jul 4 16:03:54 2001
@@ -1,8 +1,8 @@
-/* $Id: hisax.h,v 2.52.6.2 2001/02/10 14:41:22 kai Exp $
+/* $Id: hisax.h,v 2.52.6.6 2001/06/09 15:14:17 kai Exp $
*
* Basic declarations, defines and prototypes
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
#include
@@ -125,13 +125,13 @@
#define l3dss1_process
#include "l3dss1.h"
#undef l3dss1_process
-#endif CONFIG_HISAX_EURO
+#endif /* CONFIG_HISAX_EURO */
#ifdef CONFIG_HISAX_NI1
#define l3ni1_process
#include "l3ni1.h"
#undef l3ni1_process
-#endif CONFIG_HISAX_NI1
+#endif /* CONFIG_HISAX_NI1 */
#define MAX_DFRAME_LEN 260
#define MAX_DFRAME_LEN_L1 300
@@ -317,10 +317,10 @@
{ u_char uuuu; /* only as dummy */
#ifdef CONFIG_HISAX_EURO
dss1_stk_priv dss1; /* private dss1 data */
-#endif CONFIG_HISAX_EURO
+#endif /* CONFIG_HISAX_EURO */
#ifdef CONFIG_HISAX_NI1
ni1_stk_priv ni1; /* private ni1 data */
-#endif CONFIG_HISAX_NI1
+#endif /* CONFIG_HISAX_NI1 */
} prot;
};
@@ -341,10 +341,10 @@
{ u_char uuuu; /* only when euro not defined, avoiding empty union */
#ifdef CONFIG_HISAX_EURO
dss1_proc_priv dss1; /* private dss1 data */
-#endif CONFIG_HISAX_EURO
+#endif /* CONFIG_HISAX_EURO */
#ifdef CONFIG_HISAX_NI1
ni1_proc_priv ni1; /* private ni1 data */
-#endif CONFIG_HISAX_NI1
+#endif /* CONFIG_HISAX_NI1 */
} prot;
};
@@ -686,6 +686,7 @@
unsigned char *pci_io; /* start of PCI IO memory */
void *share_start; /* shared memory for Fifos start */
void *fifos; /* FIFO memory */
+ int last_bfifo_cnt[2]; /* marker saving last b-fifo frame count */
struct timer_list timer;
};
@@ -1302,7 +1303,7 @@
int getcallref(u_char * p);
int newcallref(void);
-void FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount);
+int FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount);
void FsmFree(struct Fsm *fsm);
int FsmEvent(struct FsmInst *fi, int event, void *arg);
void FsmChangeState(struct FsmInst *fi, int newstate);
@@ -1323,7 +1324,6 @@
void LogFrame(struct IsdnCardState *cs, u_char * p, int size);
void dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir);
void iecpy(u_char * dest, u_char * iestart, int ieoffset);
-int discard_queue(struct sk_buff_head *q);
#ifdef ISDN_CHIP_ISAC
void setstack_isac(struct PStack *st, struct IsdnCardState *cs);
#endif /* ISDN_CHIP_ISAC */
@@ -1333,19 +1333,19 @@
int ll_run(struct IsdnCardState *cs, int addfeatures);
void ll_stop(struct IsdnCardState *cs);
-void CallcNew(void);
+int CallcNew(void);
void CallcFree(void);
int CallcNewChan(struct IsdnCardState *cs);
void CallcFreeChan(struct IsdnCardState *cs);
-void Isdnl1New(void);
+int Isdnl1New(void);
void Isdnl1Free(void);
-void Isdnl2New(void);
+int Isdnl2New(void);
void Isdnl2Free(void);
-void Isdnl3New(void);
+int Isdnl3New(void);
void Isdnl3Free(void);
void init_tei(struct IsdnCardState *cs, int protocol);
void release_tei(struct IsdnCardState *cs);
char *HiSax_getrev(const char *revision);
-void TeiNew(void);
+int TeiNew(void);
void TeiFree(void);
int certification_check(int output);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/hscx.c linux.20p7/drivers/isdn/hisax/hscx.c
--- linux.vanilla/drivers/isdn/hisax/hscx.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/hscx.c Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: hscx.c,v 1.21 2000/11/24 17:05:37 kai Exp $
+/* $Id: hscx.c,v 1.21.6.2 2001/06/09 15:14:17 kai Exp $
*
* hscx.c HSCX specific routines
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -166,8 +166,8 @@
kfree(bcs->blog);
bcs->blog = NULL;
}
- discard_queue(&bcs->rqueue);
- discard_queue(&bcs->squeue);
+ skb_queue_purge(&bcs->rqueue);
+ skb_queue_purge(&bcs->squeue);
if (bcs->tx_skb) {
dev_kfree_skb(bcs->tx_skb);
bcs->tx_skb = NULL;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/hscx.h linux.20p7/drivers/isdn/hisax/hscx.h
--- linux.vanilla/drivers/isdn/hisax/hscx.h Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/hscx.h Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: hscx.h,v 1.6 2000/06/26 08:59:13 keil Exp $
+/* $Id: hscx.h,v 1.6.6.1 2001/02/16 16:43:27 kai Exp $
*
* hscx.h HSCX specific defines
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/hscx_irq.c linux.20p7/drivers/isdn/hisax/hscx_irq.c
--- linux.vanilla/drivers/isdn/hisax/hscx_irq.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/hscx_irq.c Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-/* $Id: hscx_irq.c,v 1.16 2000/11/19 17:02:47 kai Exp $
+/* $Id: hscx_irq.c,v 1.16.6.1 2001/02/16 16:43:27 kai Exp $
*
* hscx_irq.c low level b-channel stuff for Siemens HSCX
*
@@ -6,7 +6,7 @@
*
* This is an include file for fast inline IRQ stuff
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/icc.c linux.20p7/drivers/isdn/hisax/icc.c
--- linux.vanilla/drivers/isdn/hisax/icc.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/icc.c Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-// $Id: icc.c,v 1.5 2000/11/24 17:05:37 kai Exp $
+// $Id: icc.c,v 1.5.6.3 2001/06/09 15:14:17 kai Exp $
//-----------------------------------------------------------------------------
//
// ICC specific routines
@@ -7,10 +7,10 @@
// www.traverse.com.au
//
// 1999.6.25 Initial implementation of routines for Siemens ISDN
-// Communication Controler PEB 2070 based on the ISAC routines
+// Communication Controller PEB 2070 based on the ISAC routines
// written by Karsten Keil.
//
-// This file is (c) under GNU PUBLIC LICENSE
+// This file is (c) under GNU General Public License
//
//-----------------------------------------------------------------------------
@@ -551,8 +551,8 @@
}
break;
case (HW_DEACTIVATE | RESPONSE):
- discard_queue(&cs->rq);
- discard_queue(&cs->sq);
+ skb_queue_purge(&cs->rq);
+ skb_queue_purge(&cs->sq);
if (cs->tx_skb) {
dev_kfree_skb(cs->tx_skb);
cs->tx_skb = NULL;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/icc.h linux.20p7/drivers/isdn/hisax/icc.h
--- linux.vanilla/drivers/isdn/hisax/icc.h Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/icc.h Wed Jul 4 16:03:54 2001
@@ -1,4 +1,4 @@
-// $Id: icc.h,v 1.2 2000/06/26 08:59:13 keil Exp $
+// $Id: icc.h,v 1.2.6.2 2001/03/13 16:17:08 kai Exp $
//-----------------------------------------------------------------------------
//
// ICC specific routines
@@ -7,10 +7,10 @@
// www.traverse.com.au
//
// 1999.7.14 Initial implementation of routines for Siemens ISDN
-// Communication Controler PEB 2070 based on the ISAC routines
+// Communication Controller PEB 2070 based on the ISAC routines
// written by Karsten Keil.
//
-// This file is (c) under GNU PUBLIC LICENSE
+// This file is (c) under GNU General Public License
//
//-----------------------------------------------------------------------------
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/ipac.h linux.20p7/drivers/isdn/hisax/ipac.h
--- linux.vanilla/drivers/isdn/hisax/ipac.h Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/ipac.h Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: ipac.h,v 1.5 2000/06/26 08:59:13 keil Exp $
+/* $Id: ipac.h,v 1.5.6.1 2001/02/16 16:43:27 kai Exp $
*
* ipac.h IPAC specific defines
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/isac.c linux.20p7/drivers/isdn/hisax/isac.c
--- linux.vanilla/drivers/isdn/hisax/isac.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/isac.c Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: isac.c,v 1.28 2000/11/24 17:05:37 kai Exp $
+/* $Id: isac.c,v 1.28.6.2 2001/06/09 15:14:17 kai Exp $
*
* isac.c ISAC specific routines
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
* For changes and modifications please read
* ../../../Documentation/isdn/HiSax.cert
*/
@@ -445,7 +445,7 @@
if (cs->debug & L1_DEB_MONITOR)
debugl1(cs, "ISAC %02x -> MOX1", cs->dc.isac.mon_tx[cs->dc.isac.mon_txp -1]);
}
- AfterMOX1:
+ AfterMOX1:;
#endif
}
}
@@ -549,8 +549,8 @@
}
break;
case (HW_DEACTIVATE | RESPONSE):
- discard_queue(&cs->rq);
- discard_queue(&cs->sq);
+ skb_queue_purge(&cs->rq);
+ skb_queue_purge(&cs->sq);
if (cs->tx_skb) {
dev_kfree_skb(cs->tx_skb);
cs->tx_skb = NULL;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/isac.h linux.20p7/drivers/isdn/hisax/isac.h
--- linux.vanilla/drivers/isdn/hisax/isac.h Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/isac.h Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: isac.h,v 1.7 2000/06/26 08:59:13 keil Exp $
+/* $Id: isac.h,v 1.7.6.1 2001/02/16 16:43:27 kai Exp $
*
* isac.h ISAC specific defines
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/isar.c linux.20p7/drivers/isdn/hisax/isar.c
--- linux.vanilla/drivers/isdn/hisax/isar.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/isar.c Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: isar.c,v 1.17 2000/11/24 17:05:37 kai Exp $
+/* $Id: isar.c,v 1.17.6.3 2001/06/09 15:14:17 kai Exp $
*
* isar.c ISAR (Siemens PSB 7110) specific routines
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -383,12 +383,12 @@
} else {
printk(KERN_DEBUG"isar selftest not OK %x/%x/%x\n",
ireg->cmsb, ireg->clsb, ireg->par[0]);
- ret = 1;goto reterror;
+ ret = 1;goto reterrflg;
}
ireg->iis = 0;
if (!sendmsg(cs, ISAR_HIS_DIAG, ISAR_CTRL_SWVER, 0, NULL)) {
printk(KERN_ERR"isar RQST SVN failed\n");
- ret = 1;goto reterror;
+ ret = 1;goto reterrflg;
}
cnt = 30000; /* max 300 ms */
while ((ireg->iis != ISAR_IIS_DIAG) && cnt) {
@@ -1650,8 +1650,8 @@
kfree(bcs->hw.isar.rcvbuf);
bcs->hw.isar.rcvbuf = NULL;
}
- discard_queue(&bcs->rqueue);
- discard_queue(&bcs->squeue);
+ skb_queue_purge(&bcs->rqueue);
+ skb_queue_purge(&bcs->squeue);
if (bcs->tx_skb) {
dev_kfree_skb(bcs->tx_skb);
bcs->tx_skb = NULL;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/isar.h linux.20p7/drivers/isdn/hisax/isar.h
--- linux.vanilla/drivers/isdn/hisax/isar.h Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/isar.h Wed Jul 4 16:03:54 2001
@@ -1,10 +1,10 @@
-/* $Id: isar.h,v 1.9 2000/06/26 08:59:13 keil Exp $
+/* $Id: isar.h,v 1.9.6.1 2001/02/16 16:43:27 kai Exp $
*
* isar.h ISAR (Siemens PSB 7110) specific defines
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/isdnl1.c linux.20p7/drivers/isdn/hisax/isdnl1.c
--- linux.vanilla/drivers/isdn/hisax/isdnl1.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/isdnl1.c Wed Jul 4 16:03:54 2001
@@ -1,11 +1,11 @@
-/* $Id: isdnl1.c,v 2.41.6.1 2000/12/10 22:01:04 kai Exp $
+/* $Id: isdnl1.c,v 2.41.6.3 2001/05/26 15:19:57 kai Exp $
*
* isdnl1.c common low level stuff for Siemens Chipsetbased isdn cards
* based on the teles driver from Jan den Ouden
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
* For changes and modifications please read
* ../../../Documentation/isdn/HiSax.cert
*
@@ -15,7 +15,7 @@
*
*/
-const char *l1_revision = "$Revision: 2.41.6.1 $";
+const char *l1_revision = "$Revision: 2.41.6.3 $";
#define __NO_VERSION__
#include
@@ -736,26 +736,41 @@
#define L1B_FN_COUNT (sizeof(L1BFnList)/sizeof(struct FsmNode))
-void __init
+int __init
Isdnl1New(void)
{
-#ifdef HISAX_UINTERFACE
- l1fsm_u.state_count = L1U_STATE_COUNT;
- l1fsm_u.event_count = L1_EVENT_COUNT;
- l1fsm_u.strEvent = strL1Event;
- l1fsm_u.strState = strL1UState;
- FsmNew(&l1fsm_u, L1UFnList, L1U_FN_COUNT);
-#endif
+ int retval;
+
l1fsm_s.state_count = L1S_STATE_COUNT;
l1fsm_s.event_count = L1_EVENT_COUNT;
l1fsm_s.strEvent = strL1Event;
l1fsm_s.strState = strL1SState;
- FsmNew(&l1fsm_s, L1SFnList, L1S_FN_COUNT);
+ retval = FsmNew(&l1fsm_s, L1SFnList, L1S_FN_COUNT);
+ if (retval)
+ return retval;
+
l1fsm_b.state_count = L1B_STATE_COUNT;
l1fsm_b.event_count = L1_EVENT_COUNT;
l1fsm_b.strEvent = strL1Event;
l1fsm_b.strState = strL1BState;
- FsmNew(&l1fsm_b, L1BFnList, L1B_FN_COUNT);
+ retval = FsmNew(&l1fsm_b, L1BFnList, L1B_FN_COUNT);
+ if (retval) {
+ FsmFree(&l1fsm_s);
+ return retval;
+ }
+#ifdef HISAX_UINTERFACE
+ l1fsm_u.state_count = L1U_STATE_COUNT;
+ l1fsm_u.event_count = L1_EVENT_COUNT;
+ l1fsm_u.strEvent = strL1Event;
+ l1fsm_u.strState = strL1UState;
+ retval = FsmNew(&l1fsm_u, L1UFnList, L1U_FN_COUNT);
+ if (retval) {
+ FsmFree(&l1fsm_s);
+ FsmFree(&l1fsm_b);
+ return retval;
+ }
+#endif
+ return 0;
}
void Isdnl1Free(void)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/isdnl1.h linux.20p7/drivers/isdn/hisax/isdnl1.h
--- linux.vanilla/drivers/isdn/hisax/isdnl1.h Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/isdnl1.h Wed Jul 4 16:03:54 2001
@@ -1,8 +1,8 @@
-/* $Id: isdnl1.h,v 2.9 2000/06/26 08:59:13 keil Exp $
+/* $Id: isdnl1.h,v 2.9.6.1 2001/02/16 16:43:27 kai Exp $
*
* Layer 1 defines
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/isdnl2.c linux.20p7/drivers/isdn/hisax/isdnl2.c
--- linux.vanilla/drivers/isdn/hisax/isdnl2.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/isdnl2.c Wed Jul 4 16:03:55 2001
@@ -1,9 +1,9 @@
-/* $Id: isdnl2.c,v 2.25 2000/11/24 17:05:38 kai Exp $
+/* $Id: isdnl2.c,v 2.25.6.3 2001/06/09 15:14:17 kai Exp $
*
* Author Karsten Keil (keil@isdn4linux.de)
* based on the teles driver from Jan den Ouden
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
* For changes and modifications please read
* ../../../Documentation/isdn/HiSax.cert
*
@@ -16,7 +16,7 @@
#include "hisax.h"
#include "isdnl2.h"
-const char *l2_revision = "$Revision: 2.25 $";
+const char *l2_revision = "$Revision: 2.25.6.3 $";
static void l2m_debug(struct FsmInst *fi, char *fmt, ...);
@@ -649,7 +649,7 @@
{
struct PStack *st = fi->userdata;
- discard_queue(&st->l2.i_queue);
+ skb_queue_purge(&st->l2.i_queue);
test_and_set_bit(FLG_L3_INIT, &st->l2.flag);
test_and_clear_bit(FLG_PEND_REL, &st->l2.flag);
}
@@ -659,7 +659,7 @@
{
struct PStack *st = fi->userdata;
- discard_queue(&st->l2.i_queue);
+ skb_queue_purge(&st->l2.i_queue);
establishlink(fi);
test_and_set_bit(FLG_L3_INIT, &st->l2.flag);
}
@@ -685,7 +685,7 @@
{
struct PStack *st = fi->userdata;
- discard_queue(&st->l2.i_queue);
+ skb_queue_purge(&st->l2.i_queue);
freewin(st);
FsmChangeState(fi, ST_L2_6);
st->l2.rc = 0;
@@ -745,7 +745,7 @@
st->ma.layer(st, MDL_ERROR | INDICATION, (void *) 'F');
if (st->l2.vs != st->l2.va) {
- discard_queue(&st->l2.i_queue);
+ skb_queue_purge(&st->l2.i_queue);
est = 1;
}
@@ -778,7 +778,7 @@
send_uframe(st, UA | get_PollFlagFree(st, skb), RSP);
- discard_queue(&st->l2.i_queue);
+ skb_queue_purge(&st->l2.i_queue);
freewin(st);
lapb_dl_release_l2l3(st, INDICATION);
}
@@ -802,7 +802,7 @@
if (test_and_clear_bit(FLG_L3_INIT, &st->l2.flag)) {
pr = DL_ESTABLISH | CONFIRM;
} else if (st->l2.vs != st->l2.va) {
- discard_queue(&st->l2.i_queue);
+ skb_queue_purge(&st->l2.i_queue);
pr = DL_ESTABLISH | INDICATION;
}
@@ -860,7 +860,7 @@
if (get_PollFlagFree(st, skb)) {
stop_t200(st, 7);
if (!test_bit(FLG_L3_INIT, &st->l2.flag))
- discard_queue(&st->l2.i_queue);
+ skb_queue_purge(&st->l2.i_queue);
if (test_bit(FLG_LAPB, &st->l2.flag))
st->l2.l2l1(st, PH_DEACTIVATE | REQUEST, NULL);
st5_dl_release_l2l3(st);
@@ -1156,7 +1156,7 @@
} else if (st->l2.rc == st->l2.N200) {
FsmChangeState(fi, ST_L2_4);
test_and_clear_bit(FLG_T200_RUN, &st->l2.flag);
- discard_queue(&st->l2.i_queue);
+ skb_queue_purge(&st->l2.i_queue);
st->ma.layer(st, MDL_ERROR | INDICATION, (void *) 'G');
if (test_bit(FLG_LAPB, &st->l2.flag))
st->l2.l2l1(st, PH_DEACTIVATE | REQUEST, NULL);
@@ -1388,7 +1388,7 @@
{
struct PStack *st = fi->userdata;
- discard_queue(&st->l2.ui_queue);
+ skb_queue_purge(&st->l2.ui_queue);
st->l2.tei = -1;
FsmChangeState(fi, ST_L2_1);
}
@@ -1398,7 +1398,7 @@
{
struct PStack *st = fi->userdata;
- discard_queue(&st->l2.ui_queue);
+ skb_queue_purge(&st->l2.ui_queue);
st->l2.tei = -1;
st->l2.l2l3(st, DL_RELEASE | INDICATION, NULL);
FsmChangeState(fi, ST_L2_1);
@@ -1409,8 +1409,8 @@
{
struct PStack *st = fi->userdata;
- discard_queue(&st->l2.i_queue);
- discard_queue(&st->l2.ui_queue);
+ skb_queue_purge(&st->l2.i_queue);
+ skb_queue_purge(&st->l2.ui_queue);
freewin(st);
st->l2.tei = -1;
stop_t200(st, 17);
@@ -1423,7 +1423,7 @@
{
struct PStack *st = fi->userdata;
- discard_queue(&st->l2.ui_queue);
+ skb_queue_purge(&st->l2.ui_queue);
st->l2.tei = -1;
stop_t200(st, 18);
st->l2.l2l3(st, DL_RELEASE | CONFIRM, NULL);
@@ -1435,8 +1435,8 @@
{
struct PStack *st = fi->userdata;
- discard_queue(&st->l2.i_queue);
- discard_queue(&st->l2.ui_queue);
+ skb_queue_purge(&st->l2.i_queue);
+ skb_queue_purge(&st->l2.ui_queue);
freewin(st);
st->l2.tei = -1;
stop_t200(st, 17);
@@ -1450,8 +1450,8 @@
{
struct PStack *st = fi->userdata;
- discard_queue(&st->l2.i_queue);
- discard_queue(&st->l2.ui_queue);
+ skb_queue_purge(&st->l2.i_queue);
+ skb_queue_purge(&st->l2.ui_queue);
if (test_and_clear_bit(FLG_ESTAB_PEND, &st->l2.flag))
st->l2.l2l3(st, DL_RELEASE | INDICATION, NULL);
}
@@ -1461,8 +1461,8 @@
{
struct PStack *st = fi->userdata;
- discard_queue(&st->l2.i_queue);
- discard_queue(&st->l2.ui_queue);
+ skb_queue_purge(&st->l2.i_queue);
+ skb_queue_purge(&st->l2.ui_queue);
freewin(st);
stop_t200(st, 19);
st5_dl_release_l2l3(st);
@@ -1474,7 +1474,7 @@
{
struct PStack *st = fi->userdata;
- discard_queue(&st->l2.ui_queue);
+ skb_queue_purge(&st->l2.ui_queue);
stop_t200(st, 20);
st->l2.l2l3(st, DL_RELEASE | CONFIRM, NULL);
FsmChangeState(fi, ST_L2_4);
@@ -1485,8 +1485,8 @@
{
struct PStack *st = fi->userdata;
- discard_queue(&st->l2.i_queue);
- discard_queue(&st->l2.ui_queue);
+ skb_queue_purge(&st->l2.i_queue);
+ skb_queue_purge(&st->l2.ui_queue);
freewin(st);
stop_t200(st, 19);
FsmDelTimer(&st->l2.t203, 19);
@@ -1761,8 +1761,8 @@
{
FsmDelTimer(&st->l2.t200, 21);
FsmDelTimer(&st->l2.t203, 16);
- discard_queue(&st->l2.i_queue);
- discard_queue(&st->l2.ui_queue);
+ skb_queue_purge(&st->l2.i_queue);
+ skb_queue_purge(&st->l2.ui_queue);
ReleaseWin(&st->l2);
}
@@ -1831,14 +1831,14 @@
{
}
-void __init
+int __init
Isdnl2New(void)
{
l2fsm.state_count = L2_STATE_COUNT;
l2fsm.event_count = L2_EVENT_COUNT;
l2fsm.strEvent = strL2Event;
l2fsm.strState = strL2State;
- FsmNew(&l2fsm, L2FnList, L2_FN_COUNT);
+ return FsmNew(&l2fsm, L2FnList, L2_FN_COUNT);
}
void
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/isdnl2.h linux.20p7/drivers/isdn/hisax/isdnl2.h
--- linux.vanilla/drivers/isdn/hisax/isdnl2.h Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/isdnl2.h Wed Jul 4 16:03:55 2001
@@ -1,8 +1,8 @@
-/* $Id: isdnl2.h,v 1.3 2000/06/26 08:59:13 keil Exp $
+/* $Id: isdnl2.h,v 1.3.6.1 2001/02/16 16:43:27 kai Exp $
*
* Layer 2 defines
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/isdnl3.c linux.20p7/drivers/isdn/hisax/isdnl3.c
--- linux.vanilla/drivers/isdn/hisax/isdnl3.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/isdnl3.c Wed Jul 4 16:03:55 2001
@@ -1,9 +1,9 @@
-/* $Id: isdnl3.c,v 2.17.6.1 2001/01/08 17:09:20 kai Exp $
+/* $Id: isdnl3.c,v 2.17.6.4 2001/06/09 15:14:17 kai Exp $
*
* Author Karsten Keil (keil@isdn4linux.de)
* based on the teles driver from Jan den Ouden
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
* For changes and modifications please read
* ../../../Documentation/isdn/HiSax.cert
*
@@ -18,7 +18,7 @@
#include "isdnl3.h"
#include
-const char *l3_revision = "$Revision: 2.17.6.1 $";
+const char *l3_revision = "$Revision: 2.17.6.4 $";
static struct Fsm l3fsm;
@@ -404,7 +404,7 @@
st->l3.global = NULL;
}
FsmDelTimer(&st->l3.l3m_timer, 54);
- discard_queue(&st->l3.squeue);
+ skb_queue_purge(&st->l3.squeue);
}
void
@@ -520,7 +520,7 @@
FsmDelTimer(&st->l3.l3m_timer, 52);
FsmChangeState(fi, ST_L3_LC_REL);
- discard_queue(&st->l3.squeue);
+ skb_queue_purge(&st->l3.squeue);
l3ml3p(st, DL_RELEASE | INDICATION);
}
@@ -530,7 +530,7 @@
struct PStack *st = fi->userdata;
FsmChangeState(fi, ST_L3_LC_REL);
- discard_queue(&st->l3.squeue);
+ skb_queue_purge(&st->l3.squeue);
l3ml3p(st, DL_RELEASE | CONFIRM);
}
@@ -591,14 +591,14 @@
}
}
-void __init
+int __init
Isdnl3New(void)
{
l3fsm.state_count = L3_STATE_COUNT;
l3fsm.event_count = L3_EVENT_COUNT;
l3fsm.strEvent = strL3Event;
l3fsm.strState = strL3State;
- FsmNew(&l3fsm, L3FnList, L3_FN_COUNT);
+ return FsmNew(&l3fsm, L3FnList, L3_FN_COUNT);
}
void
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/isdnl3.h linux.20p7/drivers/isdn/hisax/isdnl3.h
--- linux.vanilla/drivers/isdn/hisax/isdnl3.h Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/isdnl3.h Wed Jul 4 16:03:55 2001
@@ -1,6 +1,6 @@
-/* $Id: isdnl3.h,v 2.6 2000/06/26 08:59:13 keil Exp $
+/* $Id: isdnl3.h,v 2.6.6.1 2001/02/16 16:43:27 kai Exp $
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/isurf.c linux.20p7/drivers/isdn/hisax/isurf.c
--- linux.vanilla/drivers/isdn/hisax/isurf.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/isurf.c Wed Jul 4 16:03:55 2001
@@ -1,10 +1,10 @@
-/* $Id: isurf.c,v 1.10 2000/11/24 17:05:38 kai Exp $
+/* $Id: isurf.c,v 1.10.6.1 2001/02/16 16:43:27 kai Exp $
*
* isurf.c low level stuff for Siemens I-Surf/I-Talk cards
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -17,7 +17,7 @@
extern const char *CardType[];
-static const char *ISurf_revision = "$Revision: 1.10 $";
+static const char *ISurf_revision = "$Revision: 1.10.6.1 $";
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/ix1_micro.c linux.20p7/drivers/isdn/hisax/ix1_micro.c
--- linux.vanilla/drivers/isdn/hisax/ix1_micro.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/ix1_micro.c Wed Jul 4 16:03:55 2001
@@ -1,4 +1,4 @@
-/* $Id: ix1_micro.c,v 2.10 2000/11/24 17:05:38 kai Exp $
+/* $Id: ix1_micro.c,v 2.10.6.1 2001/02/16 16:43:27 kai Exp $
*
* ix1_micro.c low level stuff for ITK ix1-micro Rev.2 isdn cards
* derived from the original file teles3.c from Karsten Keil
@@ -14,7 +14,7 @@
/*
For the modification done by the author the following terms and conditions
- apply (GNU PUBLIC LICENSE)
+ apply (GNU General Public License)
This program is free software; you can redistribute it and/or modify
@@ -50,7 +50,7 @@
#include "isdnl1.h"
extern const char *CardType[];
-const char *ix1_revision = "$Revision: 2.10 $";
+const char *ix1_revision = "$Revision: 2.10.6.1 $";
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/jade.c linux.20p7/drivers/isdn/hisax/jade.c
--- linux.vanilla/drivers/isdn/hisax/jade.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/jade.c Wed Jul 4 16:03:55 2001
@@ -1,10 +1,10 @@
-/* $Id: jade.c,v 1.6 2000/11/24 17:05:38 kai Exp $
+/* $Id: jade.c,v 1.6.6.2 2001/06/09 15:14:18 kai Exp $
*
* jade.c JADE stuff (derived from original hscx.c)
*
* Author Roland Klabunde (R.Klabunde@Berkom.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -209,8 +209,8 @@
kfree(bcs->blog);
bcs->blog = NULL;
}
- discard_queue(&bcs->rqueue);
- discard_queue(&bcs->squeue);
+ skb_queue_purge(&bcs->rqueue);
+ skb_queue_purge(&bcs->squeue);
if (bcs->tx_skb) {
dev_kfree_skb(bcs->tx_skb);
bcs->tx_skb = NULL;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/jade.h linux.20p7/drivers/isdn/hisax/jade.h
--- linux.vanilla/drivers/isdn/hisax/jade.h Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/jade.h Wed Jul 4 16:03:55 2001
@@ -1,9 +1,9 @@
-/* $Id: jade.h,v 1.3 2000/06/26 08:59:14 keil Exp $
+/* $Id: jade.h,v 1.3.6.1 2001/02/16 16:43:27 kai Exp $
* jade.h JADE specific defines
*
* Author Roland Klabunde (R.Klabunde@Berkom.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/jade_irq.c linux.20p7/drivers/isdn/hisax/jade_irq.c
--- linux.vanilla/drivers/isdn/hisax/jade_irq.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/jade_irq.c Wed Jul 4 16:03:55 2001
@@ -1,10 +1,10 @@
-/* $Id: jade_irq.c,v 1.5 2000/11/19 17:02:48 kai Exp $
+/* $Id: jade_irq.c,v 1.5.6.1 2001/02/16 16:43:27 kai Exp $
*
* jade_irq.c Low level JADE IRQ stuff (derived from original hscx_irq.c)
*
* Author Roland Klabunde (R.Klabunde@Berkom.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/l3_1tr6.c linux.20p7/drivers/isdn/hisax/l3_1tr6.c
--- linux.vanilla/drivers/isdn/hisax/l3_1tr6.c Sun Mar 25 17:37:33 2001
+++ linux.20p7/drivers/isdn/hisax/l3_1tr6.c Wed Jul 4 16:03:55 2001
@@ -1,10 +1,10 @@
-/* $Id: l3_1tr6.c,v 2.13 2000/11/19 17:02:48 kai Exp $
+/* $Id: l3_1tr6.c,v 2.13.6.1 2001/02/16 16:43:27 kai Exp $
*
* German 1TR6 D-channel protocol
*
* Author Karsten Keil (keil@isdn4linux.de)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
* For changes and modifications please read
* ../../../Documentation/isdn/HiSax.cert
*
@@ -17,7 +17,7 @@
#include |