| Bits 5-3: | Reeived Offset. Indicates the
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/MAINTAINERS linux.20p6/MAINTAINERS
--- linux.vanilla/MAINTAINERS Sun Mar 25 17:37:29 2001
+++ linux.20p6/MAINTAINERS Mon Jun 18 08:28:48 2001
@@ -242,8 +242,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 +764,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.20p6/Makefile
--- linux.vanilla/Makefile Sun Mar 25 17:39:55 2001
+++ linux.20p6/Makefile Mon Jun 25 15:35:03 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.20p6/arch/alpha/kernel/entry.S
--- linux.vanilla/arch/alpha/kernel/entry.S Sun Mar 25 17:37:29 2001
+++ linux.20p6/arch/alpha/kernel/entry.S Mon Jun 18 08:34:59 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.20p6/arch/alpha/kernel/ptrace.c
--- linux.vanilla/arch/alpha/kernel/ptrace.c Sun Mar 25 17:31:46 2001
+++ linux.20p6/arch/alpha/kernel/ptrace.c Mon Jun 18 08:34:59 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.20p6/arch/alpha/kernel/signal.c
--- linux.vanilla/arch/alpha/kernel/signal.c Sun Mar 25 17:31:46 2001
+++ linux.20p6/arch/alpha/kernel/signal.c Tue Jun 19 09:37:49 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.20p6/arch/alpha/kernel/sys_alcor.c
--- linux.vanilla/arch/alpha/kernel/sys_alcor.c Sun Mar 25 17:31:46 2001
+++ linux.20p6/arch/alpha/kernel/sys_alcor.c Mon Jun 18 08:21:42 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.20p6/arch/alpha/kernel/sys_miata.c
--- linux.vanilla/arch/alpha/kernel/sys_miata.c Sun Mar 25 17:31:46 2001
+++ linux.20p6/arch/alpha/kernel/sys_miata.c Mon Jun 18 08:28:04 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.20p6/arch/arm/kernel/ptrace.c
--- linux.vanilla/arch/arm/kernel/ptrace.c Sun Mar 25 17:37:29 2001
+++ linux.20p6/arch/arm/kernel/ptrace.c Mon Jun 18 08:34:59 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.20p6/arch/arm/kernel/signal.c
--- linux.vanilla/arch/arm/kernel/signal.c Sun Mar 25 17:37:29 2001
+++ linux.20p6/arch/arm/kernel/signal.c Tue Jun 19 09:37:49 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.20p6/arch/i386/boot/compressed/head.S
--- linux.vanilla/arch/i386/boot/compressed/head.S Sun Mar 25 17:31:45 2001
+++ linux.20p6/arch/i386/boot/compressed/head.S Tue Jun 19 09:53:19 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.20p6/arch/i386/boot/compressed/misc.c
--- linux.vanilla/arch/i386/boot/compressed/misc.c Sun Mar 25 17:31:45 2001
+++ linux.20p6/arch/i386/boot/compressed/misc.c Tue Jun 19 09:53:19 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.20p6/arch/i386/boot/setup.S
--- linux.vanilla/arch/i386/boot/setup.S Sun Mar 25 17:37:29 2001
+++ linux.20p6/arch/i386/boot/setup.S Tue Jun 19 09:53:19 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.20p6/arch/i386/kernel/bluesmoke.c
--- linux.vanilla/arch/i386/kernel/bluesmoke.c Sun Mar 25 17:31:45 2001
+++ linux.20p6/arch/i386/kernel/bluesmoke.c Fri May 4 23:10:21 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.20p6/arch/i386/kernel/entry.S
--- linux.vanilla/arch/i386/kernel/entry.S Sun Mar 25 17:37:29 2001
+++ linux.20p6/arch/i386/kernel/entry.S Mon Jun 18 08:34:59 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.20p6/arch/i386/kernel/head.S
--- linux.vanilla/arch/i386/kernel/head.S Sun Mar 25 17:31:45 2001
+++ linux.20p6/arch/i386/kernel/head.S Tue Jun 19 09:53:19 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/process.c linux.20p6/arch/i386/kernel/process.c
--- linux.vanilla/arch/i386/kernel/process.c Sun Mar 25 17:31:45 2001
+++ linux.20p6/arch/i386/kernel/process.c Mon Jun 18 08:34:59 2001
@@ -808,7 +808,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.20p6/arch/i386/kernel/ptrace.c
--- linux.vanilla/arch/i386/kernel/ptrace.c Sun Mar 25 17:31:45 2001
+++ linux.20p6/arch/i386/kernel/ptrace.c Mon Jun 18 08:34:59 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.20p6/arch/i386/kernel/signal.c
--- linux.vanilla/arch/i386/kernel/signal.c Sun Mar 25 17:31:45 2001
+++ linux.20p6/arch/i386/kernel/signal.c Tue Jun 19 09:37:49 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.20p6/arch/i386/kernel/traps.c
--- linux.vanilla/arch/i386/kernel/traps.c Sun Mar 25 17:37:30 2001
+++ linux.20p6/arch/i386/kernel/traps.c Mon Jun 18 08:34:59 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.20p6/arch/i386/kernel/vm86.c
--- linux.vanilla/arch/i386/kernel/vm86.c Sun Mar 25 17:31:45 2001
+++ linux.20p6/arch/i386/kernel/vm86.c Mon Jun 18 08:34:59 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);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/i386/math-emu/fpu_entry.c linux.20p6/arch/i386/math-emu/fpu_entry.c
--- linux.vanilla/arch/i386/math-emu/fpu_entry.c Sun Mar 25 17:31:45 2001
+++ linux.20p6/arch/i386/math-emu/fpu_entry.c Mon Jun 18 08:34:59 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.20p6/arch/m68k/kernel/ptrace.c
--- linux.vanilla/arch/m68k/kernel/ptrace.c Sun Mar 25 17:31:50 2001
+++ linux.20p6/arch/m68k/kernel/ptrace.c Mon Jun 18 08:34:59 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.20p6/arch/m68k/kernel/signal.c
--- linux.vanilla/arch/m68k/kernel/signal.c Sun Mar 25 17:31:50 2001
+++ linux.20p6/arch/m68k/kernel/signal.c Tue Jun 19 09:37:49 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.20p6/arch/m68k/kernel/traps.c
--- linux.vanilla/arch/m68k/kernel/traps.c Sun Mar 25 17:31:50 2001
+++ linux.20p6/arch/m68k/kernel/traps.c Mon Jun 18 08:34:59 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.20p6/arch/mips/baget/irq.c
--- linux.vanilla/arch/mips/baget/irq.c Sun Mar 25 17:31:48 2001
+++ linux.20p6/arch/mips/baget/irq.c Tue Jun 19 09:59:54 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.20p6/arch/mips/dec/prom/memory.c
--- linux.vanilla/arch/mips/dec/prom/memory.c Sun Mar 25 17:31:48 2001
+++ linux.20p6/arch/mips/dec/prom/memory.c Tue Jun 19 09:59:54 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.20p6/arch/mips/kernel/irixelf.c
--- linux.vanilla/arch/mips/kernel/irixelf.c Sun Mar 25 17:31:48 2001
+++ linux.20p6/arch/mips/kernel/irixelf.c Tue Jun 19 09:37:49 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.20p6/arch/mips/kernel/irixsig.c
--- linux.vanilla/arch/mips/kernel/irixsig.c Sun Mar 25 17:31:48 2001
+++ linux.20p6/arch/mips/kernel/irixsig.c Tue Jun 19 09:37:49 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.20p6/arch/mips/kernel/ptrace.c
--- linux.vanilla/arch/mips/kernel/ptrace.c Sun Mar 25 17:31:48 2001
+++ linux.20p6/arch/mips/kernel/ptrace.c Mon Jun 18 08:34:59 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.20p6/arch/mips/kernel/scall_o32.S
--- linux.vanilla/arch/mips/kernel/scall_o32.S Sun Mar 25 17:31:48 2001
+++ linux.20p6/arch/mips/kernel/scall_o32.S Mon Jun 18 08:34:59 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.20p6/arch/mips/kernel/signal.c
--- linux.vanilla/arch/mips/kernel/signal.c Sun Mar 25 17:31:48 2001
+++ linux.20p6/arch/mips/kernel/signal.c Tue Jun 19 09:37:49 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.20p6/arch/ppc/kernel/head.S
--- linux.vanilla/arch/ppc/kernel/head.S Sun Mar 25 17:31:48 2001
+++ linux.20p6/arch/ppc/kernel/head.S Mon Jun 18 08:34:59 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.20p6/arch/ppc/kernel/mk_defs.c
--- linux.vanilla/arch/ppc/kernel/mk_defs.c Sun Mar 25 17:31:48 2001
+++ linux.20p6/arch/ppc/kernel/mk_defs.c Mon Jun 18 08:34:59 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.20p6/arch/ppc/kernel/openpic.c
--- linux.vanilla/arch/ppc/kernel/openpic.c Sun Mar 25 17:37:30 2001
+++ linux.20p6/arch/ppc/kernel/openpic.c Tue Jun 19 09:59:54 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.20p6/arch/ppc/kernel/pmac_pci.c
--- linux.vanilla/arch/ppc/kernel/pmac_pci.c Sun Mar 25 17:31:49 2001
+++ linux.20p6/arch/ppc/kernel/pmac_pci.c Tue Jun 19 09:59:54 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.20p6/arch/ppc/kernel/ptrace.c
--- linux.vanilla/arch/ppc/kernel/ptrace.c Sun Mar 25 17:31:49 2001
+++ linux.20p6/arch/ppc/kernel/ptrace.c Mon Jun 18 08:34:59 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.20p6/arch/ppc/kernel/signal.c
--- linux.vanilla/arch/ppc/kernel/signal.c Sun Mar 25 17:31:49 2001
+++ linux.20p6/arch/ppc/kernel/signal.c Tue Jun 19 09:37:49 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.20p6/arch/s390/kernel/entry.S
--- linux.vanilla/arch/s390/kernel/entry.S Sun Mar 25 17:37:30 2001
+++ linux.20p6/arch/s390/kernel/entry.S Tue Jun 19 09:59:54 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.20p6/arch/s390/kernel/process.c
--- linux.vanilla/arch/s390/kernel/process.c Sun Mar 25 17:31:55 2001
+++ linux.20p6/arch/s390/kernel/process.c Mon Jun 18 08:34:59 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.20p6/arch/s390/kernel/ptrace.c
--- linux.vanilla/arch/s390/kernel/ptrace.c Sun Mar 25 17:31:55 2001
+++ linux.20p6/arch/s390/kernel/ptrace.c Mon Jun 18 08:34:59 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.20p6/arch/s390/kernel/signal.c
--- linux.vanilla/arch/s390/kernel/signal.c Sun Mar 25 17:37:30 2001
+++ linux.20p6/arch/s390/kernel/signal.c Tue Jun 19 09:37:49 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.20p6/arch/s390/kernel/traps.c
--- linux.vanilla/arch/s390/kernel/traps.c Sun Mar 25 17:31:55 2001
+++ linux.20p6/arch/s390/kernel/traps.c Mon Jun 18 08:34:59 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.20p6/arch/s390/tools/dasdfmt/dasdfmt.c
--- linux.vanilla/arch/s390/tools/dasdfmt/dasdfmt.c Sun Mar 25 17:37:30 2001
+++ linux.20p6/arch/s390/tools/dasdfmt/dasdfmt.c Tue Jun 19 09:59:54 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.20p6/arch/sparc/kernel/entry.S
--- linux.vanilla/arch/sparc/kernel/entry.S Sun Mar 25 17:31:46 2001
+++ linux.20p6/arch/sparc/kernel/entry.S Tue Jun 19 09:34:58 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.20p6/arch/sparc/kernel/ptrace.c
--- linux.vanilla/arch/sparc/kernel/ptrace.c Sun Mar 25 17:31:47 2001
+++ linux.20p6/arch/sparc/kernel/ptrace.c Mon Jun 18 08:34:59 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.20p6/arch/sparc/kernel/signal.c
--- linux.vanilla/arch/sparc/kernel/signal.c Sun Mar 25 17:31:46 2001
+++ linux.20p6/arch/sparc/kernel/signal.c Tue Jun 19 09:37:49 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.20p6/arch/sparc/lib/memset.S
--- linux.vanilla/arch/sparc/lib/memset.S Sun Mar 25 17:31:47 2001
+++ linux.20p6/arch/sparc/lib/memset.S Tue Jun 19 09:59:54 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.20p6/arch/sparc64/kernel/binfmt_aout32.c
--- linux.vanilla/arch/sparc64/kernel/binfmt_aout32.c Sun Mar 25 17:31:53 2001
+++ linux.20p6/arch/sparc64/kernel/binfmt_aout32.c Tue Jun 19 09:37:49 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.20p6/arch/sparc64/kernel/devices.c
--- linux.vanilla/arch/sparc64/kernel/devices.c Sun Mar 25 17:31:53 2001
+++ linux.20p6/arch/sparc64/kernel/devices.c Tue May 8 15:49:12 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.20p6/arch/sparc64/kernel/entry.S
--- linux.vanilla/arch/sparc64/kernel/entry.S Sun Mar 25 17:31:53 2001
+++ linux.20p6/arch/sparc64/kernel/entry.S Tue Jun 19 09:34:58 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.20p6/arch/sparc64/kernel/ioctl32.c
--- linux.vanilla/arch/sparc64/kernel/ioctl32.c Sun Mar 25 17:37:30 2001
+++ linux.20p6/arch/sparc64/kernel/ioctl32.c Tue Jun 19 09:34:59 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.20p6/arch/sparc64/kernel/irq.c
--- linux.vanilla/arch/sparc64/kernel/irq.c Sun Mar 25 17:31:53 2001
+++ linux.20p6/arch/sparc64/kernel/irq.c Mon Jun 18 08:19:48 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.20p6/arch/sparc64/kernel/process.c
--- linux.vanilla/arch/sparc64/kernel/process.c Sun Mar 25 17:31:52 2001
+++ linux.20p6/arch/sparc64/kernel/process.c Mon Jun 18 08:19:48 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.20p6/arch/sparc64/kernel/psycho.c
--- linux.vanilla/arch/sparc64/kernel/psycho.c Sun Mar 25 17:31:53 2001
+++ linux.20p6/arch/sparc64/kernel/psycho.c Mon Jun 18 08:19:05 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.20p6/arch/sparc64/kernel/ptrace.c
--- linux.vanilla/arch/sparc64/kernel/ptrace.c Sun Mar 25 17:31:53 2001
+++ linux.20p6/arch/sparc64/kernel/ptrace.c Mon Jun 18 08:34:59 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.20p6/arch/sparc64/kernel/setup.c
--- linux.vanilla/arch/sparc64/kernel/setup.c Sun Mar 25 17:31:53 2001
+++ linux.20p6/arch/sparc64/kernel/setup.c Mon Jun 18 08:19:48 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.20p6/arch/sparc64/kernel/signal.c
--- linux.vanilla/arch/sparc64/kernel/signal.c Sun Mar 25 17:31:53 2001
+++ linux.20p6/arch/sparc64/kernel/signal.c Tue Jun 19 09:37:49 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.20p6/arch/sparc64/kernel/signal32.c
--- linux.vanilla/arch/sparc64/kernel/signal32.c Sun Mar 25 17:31:52 2001
+++ linux.20p6/arch/sparc64/kernel/signal32.c Tue Jun 19 09:37:49 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.20p6/arch/sparc64/kernel/smp.c
--- linux.vanilla/arch/sparc64/kernel/smp.c Sun Mar 25 17:31:53 2001
+++ linux.20p6/arch/sparc64/kernel/smp.c Tue May 8 15:49:12 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.20p6/arch/sparc64/kernel/sparc64_ksyms.c
--- linux.vanilla/arch/sparc64/kernel/sparc64_ksyms.c Sun Mar 25 17:37:30 2001
+++ linux.20p6/arch/sparc64/kernel/sparc64_ksyms.c Tue May 8 15:49:12 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/solaris/entry64.S linux.20p6/arch/sparc64/solaris/entry64.S
--- linux.vanilla/arch/sparc64/solaris/entry64.S Sun Mar 25 17:31:53 2001
+++ linux.20p6/arch/sparc64/solaris/entry64.S Tue Jun 19 09:34:59 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.20p6/drivers/block/Config.in
--- linux.vanilla/drivers/block/Config.in Sun Mar 25 17:31:23 2001
+++ linux.20p6/drivers/block/Config.in Tue May 8 15:50:33 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.20p6/drivers/block/cciss.c
--- linux.vanilla/drivers/block/cciss.c Sun Mar 25 17:31:24 2001
+++ linux.20p6/drivers/block/cciss.c Tue Jun 19 09:59:54 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.20p6/drivers/block/cciss_cmd.h
--- linux.vanilla/drivers/block/cciss_cmd.h Sun Mar 25 17:31:24 2001
+++ linux.20p6/drivers/block/cciss_cmd.h Fri May 4 23:14:43 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.20p6/drivers/block/cpqarray.c
--- linux.vanilla/drivers/block/cpqarray.c Sun Mar 25 17:31:24 2001
+++ linux.20p6/drivers/block/cpqarray.c Tue Jun 19 09:49:28 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.20p6/drivers/block/genhd.c
--- linux.vanilla/drivers/block/genhd.c Sun Mar 25 17:37:30 2001
+++ linux.20p6/drivers/block/genhd.c Tue Jun 19 09:59:54 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.20p6/drivers/block/ide-cd.c
--- linux.vanilla/drivers/block/ide-cd.c Sun Mar 25 17:31:23 2001
+++ linux.20p6/drivers/block/ide-cd.c Tue Jun 19 09:59:54 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.20p6/drivers/block/ide-dma.c
--- linux.vanilla/drivers/block/ide-dma.c Sun Mar 25 17:31:24 2001
+++ linux.20p6/drivers/block/ide-dma.c Tue Jun 19 09:31:51 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.20p6/drivers/block/ide-floppy.c
--- linux.vanilla/drivers/block/ide-floppy.c Sun Mar 25 17:31:24 2001
+++ linux.20p6/drivers/block/ide-floppy.c Mon Jun 18 08:27:15 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.20p6/drivers/block/ide-pmac.c
--- linux.vanilla/drivers/block/ide-pmac.c Sun Mar 25 17:37:30 2001
+++ linux.20p6/drivers/block/ide-pmac.c Tue Jun 19 09:59: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.20p6/drivers/block/ide.c
--- linux.vanilla/drivers/block/ide.c Sun Mar 25 17:31:24 2001
+++ linux.20p6/drivers/block/ide.c Tue Jun 19 09:59: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.20p6/drivers/cdrom/cdrom.c
--- linux.vanilla/drivers/cdrom/cdrom.c Sun Mar 25 18:44:42 2001
+++ linux.20p6/drivers/cdrom/cdrom.c Tue Jun 19 09:59: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.20p6/drivers/char/Config.in
--- linux.vanilla/drivers/char/Config.in Sun Mar 25 17:37:30 2001
+++ linux.20p6/drivers/char/Config.in Tue Jun 19 09:39:08 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.20p6/drivers/char/Makefile
--- linux.vanilla/drivers/char/Makefile Sun Mar 25 17:37:30 2001
+++ linux.20p6/drivers/char/Makefile Tue Jun 19 09:39:08 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.20p6/drivers/char/agp/agpgart_fe.c
--- linux.vanilla/drivers/char/agp/agpgart_fe.c Sun Mar 25 17:31:28 2001
+++ linux.20p6/drivers/char/agp/agpgart_fe.c Fri May 4 23:52:03 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.20p6/drivers/char/atari_SCC.README
--- linux.vanilla/drivers/char/atari_SCC.README Sun Mar 25 17:31:28 2001
+++ linux.20p6/drivers/char/atari_SCC.README Tue Jun 19 09:59: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.20p6/drivers/char/atari_SCC.c
--- linux.vanilla/drivers/char/atari_SCC.c Sun Mar 25 17:31:28 2001
+++ linux.20p6/drivers/char/atari_SCC.c Tue Jun 19 09:59: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.20p6/drivers/char/cyclades.c
--- linux.vanilla/drivers/char/cyclades.c Sun Mar 25 17:31:25 2001
+++ linux.20p6/drivers/char/cyclades.c Tue Jun 19 09:59: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.20p6/drivers/char/epca.c
--- linux.vanilla/drivers/char/epca.c Sun Mar 25 17:31:26 2001
+++ linux.20p6/drivers/char/epca.c Tue Jun 19 09:59: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.20p6/drivers/char/hfmodem/refclock.c
--- linux.vanilla/drivers/char/hfmodem/refclock.c Sun Mar 25 17:31:26 2001
+++ linux.20p6/drivers/char/hfmodem/refclock.c Tue Jun 19 09:56:01 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.20p6/drivers/char/hfmodem/tables.h
--- linux.vanilla/drivers/char/hfmodem/tables.h Thu Jan 1 01:00:00 1970
+++ linux.20p6/drivers/char/hfmodem/tables.h Fri May 4 22:58:36 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.20p6/drivers/char/lp.c
--- linux.vanilla/drivers/char/lp.c Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/char/lp.c Tue Jun 19 09:59: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.20p6/drivers/char/machzwd.c
--- linux.vanilla/drivers/char/machzwd.c Thu Jan 1 01:00:00 1970
+++ linux.20p6/drivers/char/machzwd.c Fri May 4 23:36:56 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.20p6/drivers/char/misc.c
--- linux.vanilla/drivers/char/misc.c Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/char/misc.c Tue May 8 15:54:50 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.20p6/drivers/char/n_hdlc.c
--- linux.vanilla/drivers/char/n_hdlc.c Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/char/n_hdlc.c Tue Jun 19 09:38:18 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.20p6/drivers/char/rio/linux_compat.h
--- linux.vanilla/drivers/char/rio/linux_compat.h Sun Mar 25 17:31:28 2001
+++ linux.20p6/drivers/char/rio/linux_compat.h Fri May 4 23:50:58 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.20p6/drivers/char/rio/rio_linux.c
--- linux.vanilla/drivers/char/rio/rio_linux.c Sun Mar 25 17:31:28 2001
+++ linux.20p6/drivers/char/rio/rio_linux.c Fri May 4 23:31:29 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.20p6/drivers/char/rio/rio_linux.h
--- linux.vanilla/drivers/char/rio/rio_linux.h Sun Mar 25 17:31:28 2001
+++ linux.20p6/drivers/char/rio/rio_linux.h Fri May 4 23:31:29 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.20p6/drivers/char/rio/riodrvr.h
--- linux.vanilla/drivers/char/rio/riodrvr.h Sun Mar 25 17:31:28 2001
+++ linux.20p6/drivers/char/rio/riodrvr.h Tue May 8 15:54:50 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.20p6/drivers/char/sbc60xxwdt.c
--- linux.vanilla/drivers/char/sbc60xxwdt.c Sun Mar 25 17:31:28 2001
+++ linux.20p6/drivers/char/sbc60xxwdt.c Tue Jun 19 09:59: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.20p6/drivers/char/synclink.c
--- linux.vanilla/drivers/char/synclink.c Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/char/synclink.c Tue Jun 19 09:59: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.20p6/drivers/char/toshiba.c
--- linux.vanilla/drivers/char/toshiba.c Sun Mar 25 18:45:19 2001
+++ linux.20p6/drivers/char/toshiba.c Fri May 4 23:22:21 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.20p6/drivers/char/tty_io.c
--- linux.vanilla/drivers/char/tty_io.c Sun Mar 25 17:31:24 2001
+++ linux.20p6/drivers/char/tty_io.c Tue Jun 19 09:39:08 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.20p6/drivers/char/wdt_pci.c
--- linux.vanilla/drivers/char/wdt_pci.c Sun Mar 25 17:31:29 2001
+++ linux.20p6/drivers/char/wdt_pci.c Tue Jun 19 09:59: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.20p6/drivers/i2o/i2o_scsi.c
--- linux.vanilla/drivers/i2o/i2o_scsi.c Sun Mar 25 17:31:44 2001
+++ linux.20p6/drivers/i2o/i2o_scsi.c Tue Jun 19 09:59: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.20p6/drivers/isdn/Config.in
--- linux.vanilla/drivers/isdn/Config.in Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/isdn/Config.in Mon Jun 25 14:24:37 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.20p6/drivers/isdn/act2000/act2000.h
--- linux.vanilla/drivers/isdn/act2000/act2000.h Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/isdn/act2000/act2000.h Mon Jun 25 14:55:42 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.20p6/drivers/isdn/act2000/capi.c
--- linux.vanilla/drivers/isdn/act2000/capi.c Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/isdn/act2000/capi.c Fri May 4 23:24:34 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.20p6/drivers/isdn/act2000/capi.h
--- linux.vanilla/drivers/isdn/act2000/capi.h Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/isdn/act2000/capi.h Fri May 4 23:24:34 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.20p6/drivers/isdn/avmb1/avmcard.h
--- linux.vanilla/drivers/isdn/avmb1/avmcard.h Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/isdn/avmb1/avmcard.h Mon Jun 25 14:24:39 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.20p6/drivers/isdn/avmb1/b1.c
--- linux.vanilla/drivers/isdn/avmb1/b1.c Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/isdn/avmb1/b1.c Mon Jun 25 14:24:39 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.20p6/drivers/isdn/avmb1/b1dma.c
--- linux.vanilla/drivers/isdn/avmb1/b1dma.c Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/isdn/avmb1/b1dma.c Mon Jun 25 14:24:39 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.20p6/drivers/isdn/avmb1/b1isa.c
--- linux.vanilla/drivers/isdn/avmb1/b1isa.c Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/isdn/avmb1/b1isa.c Mon Jun 25 14:24:29 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.20p6/drivers/isdn/avmb1/b1pci.c
--- linux.vanilla/drivers/isdn/avmb1/b1pci.c Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/isdn/avmb1/b1pci.c Mon Jun 25 14:24:39 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.20p6/drivers/isdn/avmb1/b1pcmcia.c
--- linux.vanilla/drivers/isdn/avmb1/b1pcmcia.c Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/isdn/avmb1/b1pcmcia.c Mon Jun 25 14:24:29 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.20p6/drivers/isdn/avmb1/c4.c
--- linux.vanilla/drivers/isdn/avmb1/c4.c Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/isdn/avmb1/c4.c Mon Jun 25 14:24:37 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.20p6/drivers/isdn/avmb1/capi.c
--- linux.vanilla/drivers/isdn/avmb1/capi.c Sun Mar 25 17:37:31 2001
+++ linux.20p6/drivers/isdn/avmb1/capi.c Mon Jun 25 14:24:39 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.20p6/drivers/isdn/avmb1/capicmd.h
--- linux.vanilla/drivers/isdn/avmb1/capicmd.h Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/avmb1/capicmd.h Mon Jun 25 14:24:29 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.20p6/drivers/isdn/avmb1/capidev.h
--- linux.vanilla/drivers/isdn/avmb1/capidev.h Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/avmb1/capidev.h Mon Jun 25 14:24:29 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.20p6/drivers/isdn/avmb1/capidrv.c
--- linux.vanilla/drivers/isdn/avmb1/capidrv.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/avmb1/capidrv.c Mon Jun 25 14:24:39 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.20p6/drivers/isdn/avmb1/capidrv.h
--- linux.vanilla/drivers/isdn/avmb1/capidrv.h Sun Mar 25 17:31:37 2001
+++ linux.20p6/drivers/isdn/avmb1/capidrv.h Mon Jun 25 14:24:29 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.20p6/drivers/isdn/avmb1/capifs.c
--- linux.vanilla/drivers/isdn/avmb1/capifs.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/avmb1/capifs.c Mon Jun 25 14:24:29 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.20p6/drivers/isdn/avmb1/capifs.h
--- linux.vanilla/drivers/isdn/avmb1/capifs.h Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/avmb1/capifs.h Mon Jun 25 14:24:29 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.20p6/drivers/isdn/avmb1/capiutil.c
--- linux.vanilla/drivers/isdn/avmb1/capiutil.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/avmb1/capiutil.c Mon Jun 25 14:24:29 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.20p6/drivers/isdn/avmb1/capiutil.h
--- linux.vanilla/drivers/isdn/avmb1/capiutil.h Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/avmb1/capiutil.h Mon Jun 25 14:24:29 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.20p6/drivers/isdn/avmb1/kcapi.c
--- linux.vanilla/drivers/isdn/avmb1/kcapi.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/avmb1/kcapi.c Mon Jun 25 14:24:31 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.20p6/drivers/isdn/avmb1/t1isa.c
--- linux.vanilla/drivers/isdn/avmb1/t1isa.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/avmb1/t1isa.c Mon Jun 25 14:24:39 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.20p6/drivers/isdn/avmb1/t1pci.c
--- linux.vanilla/drivers/isdn/avmb1/t1pci.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/avmb1/t1pci.c Mon Jun 25 14:24:39 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.20p6/drivers/isdn/divert/isdn_divert.c
--- linux.vanilla/drivers/isdn/divert/isdn_divert.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/divert/isdn_divert.c Fri May 4 23:24:34 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.20p6/drivers/isdn/eicon/eicon_idi.c
--- linux.vanilla/drivers/isdn/eicon/eicon_idi.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/eicon/eicon_idi.c Fri May 4 23:09:23 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.20p6/drivers/isdn/eicon/idi.h
--- linux.vanilla/drivers/isdn/eicon/idi.h Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/eicon/idi.h Sat May 5 00:02:19 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.20p6/drivers/isdn/hisax/amd7930.c
--- linux.vanilla/drivers/isdn/hisax/amd7930.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/amd7930.c Mon Jun 25 14:24:31 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.20p6/drivers/isdn/hisax/arcofi.c
--- linux.vanilla/drivers/isdn/hisax/arcofi.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/arcofi.c Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/arcofi.h
--- linux.vanilla/drivers/isdn/hisax/arcofi.h Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/arcofi.h Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/asuscom.c
--- linux.vanilla/drivers/isdn/hisax/asuscom.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/asuscom.c Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/avm_a1.c
--- linux.vanilla/drivers/isdn/hisax/avm_a1.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/avm_a1.c Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/avm_a1p.c
--- linux.vanilla/drivers/isdn/hisax/avm_a1p.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/avm_a1p.c Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/avm_pci.c
--- linux.vanilla/drivers/isdn/hisax/avm_pci.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/avm_pci.c Mon Jun 25 14:24:32 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.20p6/drivers/isdn/hisax/bkm_a4t.c
--- linux.vanilla/drivers/isdn/hisax/bkm_a4t.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/bkm_a4t.c Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/bkm_a8.c
--- linux.vanilla/drivers/isdn/hisax/bkm_a8.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/bkm_a8.c Mon Jun 25 14:24:51 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.20p6/drivers/isdn/hisax/bkm_ax.h
--- linux.vanilla/drivers/isdn/hisax/bkm_ax.h Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/bkm_ax.h Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/callc.c
--- linux.vanilla/drivers/isdn/hisax/callc.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/callc.c Mon Jun 25 14:24:47 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.20p6/drivers/isdn/hisax/cert.c
--- linux.vanilla/drivers/isdn/hisax/cert.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/cert.c Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/config.c
--- linux.vanilla/drivers/isdn/hisax/config.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/config.c Mon Jun 25 14:24:47 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.20p6/drivers/isdn/hisax/diva.c
--- linux.vanilla/drivers/isdn/hisax/diva.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/diva.c Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/elsa.c
--- linux.vanilla/drivers/isdn/hisax/elsa.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/elsa.c Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/elsa_ser.c
--- linux.vanilla/drivers/isdn/hisax/elsa_ser.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/elsa_ser.c Mon Jun 25 14:24:32 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.20p6/drivers/isdn/hisax/fsm.c
--- linux.vanilla/drivers/isdn/hisax/fsm.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/fsm.c Mon Jun 25 14:24:47 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.20p6/drivers/isdn/hisax/gazel.c
--- linux.vanilla/drivers/isdn/hisax/gazel.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/gazel.c Mon Jun 25 14:24:52 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.20p6/drivers/isdn/hisax/hfc_2bds0.c
--- linux.vanilla/drivers/isdn/hisax/hfc_2bds0.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/hfc_2bds0.c Mon Jun 25 14:24:32 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.20p6/drivers/isdn/hisax/hfc_2bds0.h
--- linux.vanilla/drivers/isdn/hisax/hfc_2bds0.h Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/hfc_2bds0.h Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/hfc_2bs0.c
--- linux.vanilla/drivers/isdn/hisax/hfc_2bs0.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/hfc_2bs0.c Mon Jun 25 14:24:32 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.20p6/drivers/isdn/hisax/hfc_2bs0.h
--- linux.vanilla/drivers/isdn/hisax/hfc_2bs0.h Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/hfc_2bs0.h Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/hfc_pci.c
--- linux.vanilla/drivers/isdn/hisax/hfc_pci.c Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/hfc_pci.c Mon Jun 25 14:24:44 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.20p6/drivers/isdn/hisax/hfc_pci.h
--- linux.vanilla/drivers/isdn/hisax/hfc_pci.h Sun Mar 25 17:37:32 2001
+++ linux.20p6/drivers/isdn/hisax/hfc_pci.h Mon Jun 25 14:24:44 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.20p6/drivers/isdn/hisax/hfc_sx.c
--- linux.vanilla/drivers/isdn/hisax/hfc_sx.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/hfc_sx.c Mon Jun 25 14:24:32 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.20p6/drivers/isdn/hisax/hfcscard.c
--- linux.vanilla/drivers/isdn/hisax/hfcscard.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/hfcscard.c Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/hisax.h
--- linux.vanilla/drivers/isdn/hisax/hisax.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/hisax.h Mon Jun 25 14:56:20 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.20p6/drivers/isdn/hisax/hscx.c
--- linux.vanilla/drivers/isdn/hisax/hscx.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/hscx.c Mon Jun 25 14:24:32 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.20p6/drivers/isdn/hisax/hscx.h
--- linux.vanilla/drivers/isdn/hisax/hscx.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/hscx.h Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/hscx_irq.c
--- linux.vanilla/drivers/isdn/hisax/hscx_irq.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/hscx_irq.c Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/icc.c
--- linux.vanilla/drivers/isdn/hisax/icc.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/icc.c Mon Jun 25 14:24:32 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.20p6/drivers/isdn/hisax/icc.h
--- linux.vanilla/drivers/isdn/hisax/icc.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/icc.h Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/ipac.h
--- linux.vanilla/drivers/isdn/hisax/ipac.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/ipac.h Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/isac.c
--- linux.vanilla/drivers/isdn/hisax/isac.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/isac.c Mon Jun 25 14:24:32 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.20p6/drivers/isdn/hisax/isac.h
--- linux.vanilla/drivers/isdn/hisax/isac.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/isac.h Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/isar.c
--- linux.vanilla/drivers/isdn/hisax/isar.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/isar.c Mon Jun 25 14:24:52 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.20p6/drivers/isdn/hisax/isar.h
--- linux.vanilla/drivers/isdn/hisax/isar.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/isar.h Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/isdnl1.c
--- linux.vanilla/drivers/isdn/hisax/isdnl1.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/isdnl1.c Mon Jun 25 14:24:47 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.20p6/drivers/isdn/hisax/isdnl1.h
--- linux.vanilla/drivers/isdn/hisax/isdnl1.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/isdnl1.h Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/isdnl2.c
--- linux.vanilla/drivers/isdn/hisax/isdnl2.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/isdnl2.c Mon Jun 25 14:24:47 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.20p6/drivers/isdn/hisax/isdnl2.h
--- linux.vanilla/drivers/isdn/hisax/isdnl2.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/isdnl2.h Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/isdnl3.c
--- linux.vanilla/drivers/isdn/hisax/isdnl3.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/isdnl3.c Mon Jun 25 14:24:47 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.20p6/drivers/isdn/hisax/isdnl3.h
--- linux.vanilla/drivers/isdn/hisax/isdnl3.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/isdnl3.h Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/isurf.c
--- linux.vanilla/drivers/isdn/hisax/isurf.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/isurf.c Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/ix1_micro.c
--- linux.vanilla/drivers/isdn/hisax/ix1_micro.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/ix1_micro.c Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/jade.c
--- linux.vanilla/drivers/isdn/hisax/jade.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/jade.c Mon Jun 25 14:24:32 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.20p6/drivers/isdn/hisax/jade.h
--- linux.vanilla/drivers/isdn/hisax/jade.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/jade.h Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/jade_irq.c
--- linux.vanilla/drivers/isdn/hisax/jade_irq.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/jade_irq.c Fri May 4 23:24:34 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.20p6/drivers/isdn/hisax/l3_1tr6.c
--- linux.vanilla/drivers/isdn/hisax/l3_1tr6.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/l3_1tr6.c Fri May 4 23:24:34 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
extern char *HiSax_getrev(const char *revision);
-const char *l3_1tr6_revision = "$Revision: 2.13 $";
+const char *l3_1tr6_revision = "$Revision: 2.13.6.1 $";
#define MsgHead(ptr, cref, mty, dis) \
*ptr++ = dis; \
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/l3_1tr6.h linux.20p6/drivers/isdn/hisax/l3_1tr6.h
--- linux.vanilla/drivers/isdn/hisax/l3_1tr6.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/l3_1tr6.h Fri May 4 23:24:34 2001
@@ -1,8 +1,8 @@
-/* $Id: l3_1tr6.h,v 2.2 2000/06/26 08:59:14 keil Exp $
+/* $Id: l3_1tr6.h,v 2.2.6.1 2001/02/16 16:43:27 kai Exp $
*
* German 1TR6 D-channel protocol defines
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
#ifndef l3_1tr6
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/l3dss1.c linux.20p6/drivers/isdn/hisax/l3dss1.c
--- linux.vanilla/drivers/isdn/hisax/l3dss1.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/l3dss1.c Mon Jun 25 14:24:29 2001
@@ -1,11 +1,11 @@
-/* $Id: l3dss1.c,v 2.30 2000/11/19 17:02:48 kai Exp $
+/* $Id: l3dss1.c,v 2.30.6.1 2001/02/16 16:43:27 kai Exp $
*
* EURO/DSS1 D-channel protocol
*
* 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
*
@@ -22,7 +22,7 @@
#include
extern char *HiSax_getrev(const char *revision);
-const char *dss1_revision = "$Revision: 2.30 $";
+const char *dss1_revision = "$Revision: 2.30.6.1 $";
#define EXT_BEARER_CAPS 1
@@ -426,9 +426,9 @@
#undef FOO1
}
-#else not HISAX_DE_AOC
+#else /* not HISAX_DE_AOC */
l3_debug(st, "invoke break");
-#endif not HISAX_DE_AOC
+#endif /* not HISAX_DE_AOC */
break;
case 2: /* return result */
/* if no process available handle separately */
@@ -438,12 +438,12 @@
return;
}
if ((pc->prot.dss1.invoke_id) && (pc->prot.dss1.invoke_id == id))
- { /* Diversion successfull */
+ { /* Diversion successful */
free_invoke_id(st,pc->prot.dss1.invoke_id);
pc->prot.dss1.remote_result = 0; /* success */
pc->prot.dss1.invoke_id = 0;
pc->redir_result = pc->prot.dss1.remote_result;
- st->l3.l3l4(st, CC_REDIR | INDICATION, pc); } /* Diversion successfull */
+ st->l3.l3l4(st, CC_REDIR | INDICATION, pc); } /* Diversion successful */
else
l3_debug(st,"return error unknown identifier");
break;
@@ -2112,7 +2112,7 @@
MsgHead(p, pc->callref, MT_FACILITY);
for (subp = pc->chan->setup.phone; (*subp) && (*subp != '.'); subp++) len_phone++; /* len of phone number */
- if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subadress element */
+ if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subaddress element */
*p++ = 0x1c; /* Facility info element */
*p++ = len_phone + len_sub + 2 + 2 + 8 + 3 + 3; /* length of element */
@@ -2138,7 +2138,7 @@
*p++ = pc->chan->setup.phone[l];
if (len_sub)
- { *p++ = 0x04; /* called party subadress */
+ { *p++ = 0x04; /* called party subaddress */
*p++ = len_sub - 2;
while (*subp) *p++ = *subp++;
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/l3dss1.h linux.20p6/drivers/isdn/hisax/l3dss1.h
--- linux.vanilla/drivers/isdn/hisax/l3dss1.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/l3dss1.h Fri May 4 23:24:34 2001
@@ -1,8 +1,8 @@
-/* $Id: l3dss1.h,v 1.10 2000/06/26 08:59:14 keil Exp $
+/* $Id: l3dss1.h,v 1.10.6.1 2001/02/16 16:43:28 kai Exp $
*
* DSS1 (Euro) D-channel protocol 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/l3ni1.c linux.20p6/drivers/isdn/hisax/l3ni1.c
--- linux.vanilla/drivers/isdn/hisax/l3ni1.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/l3ni1.c Mon Jun 25 14:24:52 2001
@@ -1,4 +1,4 @@
-// $Id: l3ni1.c,v 2.5.6.1 2000/12/06 16:59:19 kai Exp $
+// $Id: l3ni1.c,v 2.5.6.2 2001/02/16 16:43:28 kai Exp $
//
//-----------------------------------------------------------------------------
//
@@ -16,7 +16,7 @@
// Will Scales - beta tester extraordinaire
// Brett Whittacre - beta tester and remote devel system in Vegas
//
-// This file is (c) under GNU PUBLIC LICENSE
+// This file is (c) under GNU General Public License
//
//-----------------------------------------------------------------------------
#define __NO_VERSION__
@@ -26,7 +26,7 @@
#include
extern char *HiSax_getrev(const char *revision);
-const char *ni1_revision = "$Revision: 2.5.6.1 $";
+const char *ni1_revision = "$Revision: 2.5.6.2 $";
#define EXT_BEARER_CAPS 1
@@ -372,12 +372,12 @@
return;
}
if ((pc->prot.ni1.invoke_id) && (pc->prot.ni1.invoke_id == id))
- { /* Diversion successfull */
+ { /* Diversion successful */
free_invoke_id(st,pc->prot.ni1.invoke_id);
pc->prot.ni1.remote_result = 0; /* success */
pc->prot.ni1.invoke_id = 0;
pc->redir_result = pc->prot.ni1.remote_result;
- st->l3.l3l4(st, CC_REDIR | INDICATION, pc); } /* Diversion successfull */
+ st->l3.l3l4(st, CC_REDIR | INDICATION, pc); } /* Diversion successful */
else
l3_debug(st,"return error unknown identifier");
break;
@@ -1973,7 +1973,7 @@
MsgHead(p, pc->callref, MT_FACILITY);
for (subp = pc->chan->setup.phone; (*subp) && (*subp != '.'); subp++) len_phone++; /* len of phone number */
- if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subadress element */
+ if (*subp++ == '.') len_sub = strlen(subp) + 2; /* length including info subaddress element */
*p++ = 0x1c; /* Facility info element */
*p++ = len_phone + len_sub + 2 + 2 + 8 + 3 + 3; /* length of element */
@@ -1999,7 +1999,7 @@
*p++ = pc->chan->setup.phone[l];
if (len_sub)
- { *p++ = 0x04; /* called party subadress */
+ { *p++ = 0x04; /* called party subaddress */
*p++ = len_sub - 2;
while (*subp) *p++ = *subp++;
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/l3ni1.h linux.20p6/drivers/isdn/hisax/l3ni1.h
--- linux.vanilla/drivers/isdn/hisax/l3ni1.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/l3ni1.h Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-// $Id: l3ni1.h,v 2.3 2000/11/16 13:50:43 keil Exp $
+// $Id: l3ni1.h,v 2.3.6.1 2001/02/16 16:43:28 kai Exp $
//-----------------------------------------------------------------------------
//
// NI1 D-channel protocol
@@ -12,7 +12,7 @@
// code provided by Ragnar Paulson.
//
//
-// 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/lmgr.c linux.20p6/drivers/isdn/hisax/lmgr.c
--- linux.vanilla/drivers/isdn/hisax/lmgr.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/lmgr.c Fri May 4 23:24:34 2001
@@ -1,10 +1,10 @@
-/* $Id: lmgr.c,v 1.7 2000/06/26 08:59:14 keil Exp $
+/* $Id: lmgr.c,v 1.7.6.1 2001/02/16 16:43:28 kai Exp $
*
* Author Karsten Keil (keil@isdn4linux.de)
*
* Layermanagement module
*
- * 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/mic.c linux.20p6/drivers/isdn/hisax/mic.c
--- linux.vanilla/drivers/isdn/hisax/mic.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/mic.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: mic.c,v 1.10 2000/11/24 17:05:38 kai Exp $
+/* $Id: mic.c,v 1.10.6.1 2001/02/16 16:43:28 kai Exp $
*
* mic.c low level stuff for mic cards
*
@@ -6,7 +6,7 @@
*
* Author Stephan von Krawczynski
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -19,7 +19,7 @@
extern const char *CardType[];
-const char *mic_revision = "$Revision: 1.10 $";
+const char *mic_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/netjet.c linux.20p6/drivers/isdn/hisax/netjet.c
--- linux.vanilla/drivers/isdn/hisax/netjet.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/netjet.c Mon Jun 25 14:24:32 2001
@@ -1,4 +1,4 @@
-/* $Id: netjet.c,v 1.24.6.3 2001/02/13 10:33:58 kai Exp $
+/* $Id: netjet.c,v 1.24.6.5 2001/06/09 15:14:18 kai Exp $
*
* netjet.c low level stuff for Traverse Technologie NETJet ISDN cards
*
@@ -6,7 +6,7 @@
*
* Thanks to Traverse Technologie Australia for documents and informations
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -16,12 +16,13 @@
#include "isac.h"
#include "hscx.h"
#include "isdnl1.h"
+#include
#include
#include
#include
#include "netjet.h"
-const char *NETjet_revision = "$Revision: 1.24.6.3 $";
+const char *NETjet_revision = "$Revision: 1.24.6.5 $";
/* Interface functions */
@@ -879,8 +880,8 @@
kfree(bcs->hw.tiger.sendbuf);
bcs->hw.tiger.sendbuf = 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/netjet.h linux.20p6/drivers/isdn/hisax/netjet.h
--- linux.vanilla/drivers/isdn/hisax/netjet.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/netjet.h Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-// $Id: netjet.h,v 2.5.6.1 2000/11/28 12:02:46 kai Exp $
+// $Id: netjet.h,v 2.5.6.2 2001/02/16 16:43:28 kai Exp $
//-----------------------------------------------------------------------------
//
// NETjet common header file
@@ -6,7 +6,7 @@
// Author Kerstern Keil repackaged by
// Matt Henderson - Traverse Technologies P/L www.traverse.com.au
//
-// 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/niccy.c linux.20p6/drivers/isdn/hisax/niccy.c
--- linux.vanilla/drivers/isdn/hisax/niccy.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/niccy.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: niccy.c,v 1.15.6.3 2001/02/13 10:33:58 kai Exp $
+/* $Id: niccy.c,v 1.15.6.4 2001/02/16 16:43:28 kai Exp $
*
* niccy.c low level stuff for Dr. Neuhaus NICCY PnP and NICCY PCI and
* compatible (SAGEM cybermodem)
@@ -7,7 +7,7 @@
*
* Thanks to Dr. Neuhaus and SAGEM for informations
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -23,7 +23,7 @@
#include
extern const char *CardType[];
-const char *niccy_revision = "$Revision: 1.15.6.3 $";
+const char *niccy_revision = "$Revision: 1.15.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/nj_s.c linux.20p6/drivers/isdn/hisax/nj_s.c
--- linux.vanilla/drivers/isdn/hisax/nj_s.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/nj_s.c Fri May 4 23:24:34 2001
@@ -1,6 +1,6 @@
-// $Id: nj_s.c,v 2.7.6.3 2001/02/13 10:33:58 kai Exp $
+// $Id: nj_s.c,v 2.7.6.4 2001/02/16 16:43:28 kai Exp $
//
-// 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
#include "netjet.h"
-const char *NETjet_S_revision = "$Revision: 2.7.6.3 $";
+const char *NETjet_S_revision = "$Revision: 2.7.6.4 $";
static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off)
{
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/nj_u.c linux.20p6/drivers/isdn/hisax/nj_u.c
--- linux.vanilla/drivers/isdn/hisax/nj_u.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/nj_u.c Fri May 4 23:24:34 2001
@@ -1,6 +1,6 @@
-/* $Id: nj_u.c,v 2.8.6.3 2001/02/13 10:33:58 kai Exp $
+/* $Id: nj_u.c,v 2.8.6.4 2001/02/16 16:43:28 kai Exp $
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -16,7 +16,7 @@
#include
#include "netjet.h"
-const char *NETjet_U_revision = "$Revision: 2.8.6.3 $";
+const char *NETjet_U_revision = "$Revision: 2.8.6.4 $";
static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off)
{
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/q931.c linux.20p6/drivers/isdn/hisax/q931.c
--- linux.vanilla/drivers/isdn/hisax/q931.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/q931.c Fri May 4 23:24:34 2001
@@ -1,10 +1,10 @@
-/* $Id: q931.c,v 1.10 2000/06/26 08:59:14 keil Exp $
+/* $Id: q931.c,v 1.10.6.2 2001/03/13 16:17:08 kai Exp $
*
* q931.c code to decode ITU Q.931 call control messages
*
* Author Jan den Ouden
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
* Changelog
*
@@ -1228,7 +1228,7 @@
finish = 1;
}
} else if (sapi == TEI_SAPI) {
- dp += sprintf(dp, "tei managment\n");
+ dp += sprintf(dp, "tei management\n");
finish = 1;
} else {
dp += sprintf(dp, "unknown sapi %d broadcast\n", sapi);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/rawhdlc.c linux.20p6/drivers/isdn/hisax/rawhdlc.c
--- linux.vanilla/drivers/isdn/hisax/rawhdlc.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/rawhdlc.c Fri May 4 23:24:34 2001
@@ -1,11 +1,11 @@
-/* $Id: rawhdlc.c,v 1.5 2000/06/26 08:59:14 keil Exp $
+/* $Id: rawhdlc.c,v 1.5.6.1 2001/02/16 16:43:28 kai Exp $
*
* rawhdlc.c support routines for cards that don't support HDLC
*
* Author Karsten Keil (keil@isdn4linux.de)
* Brent Baccala
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
* Some passive ISDN cards, such as the Traverse NETJet and the AMD 7930,
* don't perform HDLC encapsulation over the B channel. Drivers for
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/rawhdlc.h linux.20p6/drivers/isdn/hisax/rawhdlc.h
--- linux.vanilla/drivers/isdn/hisax/rawhdlc.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/rawhdlc.h Fri May 4 23:24:34 2001
@@ -1,10 +1,10 @@
-/* $Id: rawhdlc.h,v 1.3 2000/06/26 08:59:14 keil Exp $
+/* $Id: rawhdlc.h,v 1.3.6.1 2001/02/16 16:43:29 kai Exp $
*
* rawhdlc.h support routines for cards that don't support HDLC
*
* Author Brent Baccala
*
- * 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/s0box.c linux.20p6/drivers/isdn/hisax/s0box.c
--- linux.vanilla/drivers/isdn/hisax/s0box.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/s0box.c Fri May 4 23:24:34 2001
@@ -1,10 +1,10 @@
-/* $Id: s0box.c,v 2.4 2000/11/24 17:05:38 kai Exp $
+/* $Id: s0box.c,v 2.4.6.1 2001/02/16 16:43:29 kai Exp $
*
* s0box.c low level stuff for Creatix S0BOX
*
* Author S0BOX specific stuff: Enrik Berkhan (enrik@starfleet.inka.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[];
-const char *s0box_revision = "$Revision: 2.4 $";
+const char *s0box_revision = "$Revision: 2.4.6.1 $";
static inline void
writereg(unsigned int padr, signed int addr, u_char off, u_char val) {
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/saphir.c linux.20p6/drivers/isdn/hisax/saphir.c
--- linux.vanilla/drivers/isdn/hisax/saphir.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/saphir.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: saphir.c,v 1.8 2000/11/24 17:05:38 kai Exp $
+/* $Id: saphir.c,v 1.8.6.1 2001/02/16 16:43:29 kai Exp $
*
* saphir.c low level stuff for HST Saphir 1
*
@@ -6,7 +6,7 @@
*
* Thanks to HST High Soft Tech GmbH
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -19,7 +19,7 @@
#include "isdnl1.h"
extern const char *CardType[];
-static char *saphir_rev = "$Revision: 1.8 $";
+static char *saphir_rev = "$Revision: 1.8.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/sedlbauer.c linux.20p6/drivers/isdn/hisax/sedlbauer.c
--- linux.vanilla/drivers/isdn/hisax/sedlbauer.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/sedlbauer.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: sedlbauer.c,v 1.25.6.3 2001/02/13 10:33:58 kai Exp $
+/* $Id: sedlbauer.c,v 1.25.6.4 2001/02/16 16:43:29 kai Exp $
*
* sedlbauer.c low level stuff for Sedlbauer cards
* includes support for the Sedlbauer speed star (speed star II),
@@ -16,7 +16,7 @@
* Sedlbauer AG for informations
* Edgar Toernig
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -53,7 +53,7 @@
extern const char *CardType[];
-const char *Sedlbauer_revision = "$Revision: 1.25.6.3 $";
+const char *Sedlbauer_revision = "$Revision: 1.25.6.4 $";
const char *Sedlbauer_Types[] =
{"None", "speed card/win", "speed star", "speed fax+",
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/sportster.c linux.20p6/drivers/isdn/hisax/sportster.c
--- linux.vanilla/drivers/isdn/hisax/sportster.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/sportster.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: sportster.c,v 1.14 2000/11/24 17:05:38 kai Exp $
+/* $Id: sportster.c,v 1.14.6.1 2001/02/16 16:43:29 kai Exp $
*
* sportster.c low level stuff for USR Sportster internal TA
*
@@ -6,7 +6,7 @@
*
* Thanks to Christian "naddy" Weisgerber (3Com, US Robotics) for documentation
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
#define __NO_VERSION__
@@ -17,7 +17,7 @@
#include "isdnl1.h"
extern const char *CardType[];
-const char *sportster_revision = "$Revision: 1.14 $";
+const char *sportster_revision = "$Revision: 1.14.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/tei.c linux.20p6/drivers/isdn/hisax/tei.c
--- linux.vanilla/drivers/isdn/hisax/tei.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/tei.c Mon Jun 25 14:24:47 2001
@@ -1,9 +1,9 @@
-/* $Id: tei.c,v 2.17 2000/11/24 17:05:38 kai Exp $
+/* $Id: tei.c,v 2.17.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
*
- * 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
#include
-const char *tei_revision = "$Revision: 2.17 $";
+const char *tei_revision = "$Revision: 2.17.6.2 $";
#define ID_REQUEST 1
#define ID_ASSIGNED 2
@@ -446,14 +446,14 @@
#define TEI_FN_COUNT (sizeof(TeiFnList)/sizeof(struct FsmNode))
-void __init
+int __init
TeiNew(void)
{
teifsm.state_count = TEI_STATE_COUNT;
teifsm.event_count = TEI_EVENT_COUNT;
teifsm.strEvent = strTeiEvent;
teifsm.strState = strTeiState;
- FsmNew(&teifsm, TeiFnList, TEI_FN_COUNT);
+ return FsmNew(&teifsm, TeiFnList, TEI_FN_COUNT);
}
void
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/teleint.c linux.20p6/drivers/isdn/hisax/teleint.c
--- linux.vanilla/drivers/isdn/hisax/teleint.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/teleint.c Fri May 4 23:24:34 2001
@@ -1,10 +1,10 @@
-/* $Id: teleint.c,v 1.14 2000/11/24 17:05:38 kai Exp $
+/* $Id: teleint.c,v 1.14.6.1 2001/02/16 16:43:29 kai Exp $
*
* teleint.c low level stuff for TeleInt 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
*
*/
@@ -17,7 +17,7 @@
extern const char *CardType[];
-const char *TeleInt_revision = "$Revision: 1.14 $";
+const char *TeleInt_revision = "$Revision: 1.14.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/teles0.c linux.20p6/drivers/isdn/hisax/teles0.c
--- linux.vanilla/drivers/isdn/hisax/teles0.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/teles0.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: teles0.c,v 2.13 2000/11/24 17:05:38 kai Exp $
+/* $Id: teles0.c,v 2.13.6.1 2001/02/16 16:43:29 kai Exp $
*
* teles0.c low level stuff for Teles Memory IO isdn cards
* based on the teles driver from Jan den Ouden
@@ -9,7 +9,7 @@
* Fritz Elfert
* Beat Doebeli
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
#define __NO_VERSION__
@@ -21,7 +21,7 @@
extern const char *CardType[];
-const char *teles0_revision = "$Revision: 2.13 $";
+const char *teles0_revision = "$Revision: 2.13.6.1 $";
#define TELES_IOMEM_SIZE 0x400
#define byteout(addr,val) outb(val,addr)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/teles3.c linux.20p6/drivers/isdn/hisax/teles3.c
--- linux.vanilla/drivers/isdn/hisax/teles3.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/teles3.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: teles3.c,v 2.17 2000/11/24 17:05:38 kai Exp $
+/* $Id: teles3.c,v 2.17.6.1 2001/02/16 16:43:29 kai Exp $
*
* teles3.c low level stuff for Teles 16.3 & PNP isdn cards
*
@@ -10,7 +10,7 @@
* Fritz Elfert
* Beat Doebeli
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
#define __NO_VERSION__
@@ -21,7 +21,7 @@
#include "isdnl1.h"
extern const char *CardType[];
-const char *teles3_revision = "$Revision: 2.17 $";
+const char *teles3_revision = "$Revision: 2.17.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/telespci.c linux.20p6/drivers/isdn/hisax/telespci.c
--- linux.vanilla/drivers/isdn/hisax/telespci.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/telespci.c Fri May 4 23:24:34 2001
@@ -1,11 +1,11 @@
-/* $Id: telespci.c,v 2.16.6.3 2001/02/13 10:33:58 kai Exp $
+/* $Id: telespci.c,v 2.16.6.4 2001/02/16 16:43:29 kai Exp $
*
* telespci.c low level stuff for Teles PCI isdn cards
*
* Author Ton van Rosmalen
* 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[];
-const char *telespci_revision = "$Revision: 2.16.6.3 $";
+const char *telespci_revision = "$Revision: 2.16.6.4 $";
#define ZORAN_PO_RQ_PEN 0x02000000
#define ZORAN_PO_WR 0x00800000
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hisax/w6692.c linux.20p6/drivers/isdn/hisax/w6692.c
--- linux.vanilla/drivers/isdn/hisax/w6692.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/w6692.c Mon Jun 25 14:24:32 2001
@@ -1,11 +1,11 @@
-/* $Id: w6692.c,v 1.12.6.3 2001/02/13 10:33:58 kai Exp $
+/* $Id: w6692.c,v 1.12.6.5 2001/06/09 15:14:18 kai Exp $
*
* w6692.c Winbond W6692 specific routines
*
* Author Petr Novak
* (based on HiSax driver by Karsten Keil)
*
- * This file is (c) under GNU PUBLIC LICENSE
+ * This file is (c) under GNU General Public License
*
*/
@@ -36,7 +36,7 @@
extern const char *CardType[];
-const char *w6692_revision = "$Revision: 1.12.6.3 $";
+const char *w6692_revision = "$Revision: 1.12.6.5 $";
#define DBUSY_TIMER_VALUE 80
@@ -642,8 +642,8 @@
/* !!! not implemented yet */
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;
@@ -806,8 +806,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/w6692.h linux.20p6/drivers/isdn/hisax/w6692.h
--- linux.vanilla/drivers/isdn/hisax/w6692.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hisax/w6692.h Fri May 4 23:24:34 2001
@@ -1,10 +1,10 @@
-/* $Id: w6692.h,v 1.2 2000/06/26 08:59:15 keil Exp $
+/* $Id: w6692.h,v 1.2.6.1 2001/02/16 16:43:29 kai Exp $
*
* w6692.h Winbond W6692 specific defines
*
* Author Petr Novak
*
- * 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/hysdn/boardergo.c linux.20p6/drivers/isdn/hysdn/boardergo.c
--- linux.vanilla/drivers/isdn/hysdn/boardergo.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hysdn/boardergo.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: boardergo.c,v 1.5.6.1 2000/12/10 22:01:04 kai Exp $
+/* $Id: boardergo.c,v 1.5.6.3 2001/03/13 16:17:09 kai Exp $
* Linux driver for HYSDN cards, specific routines for ergo type boards.
*
@@ -270,7 +270,7 @@
return (-ERR_BOOTIMG_FAIL);
}
} /* start_boot_img */
- return (0); /* successfull */
+ return (0); /* successful */
} /* ergo_writebootimg */
/********************************************************************************/
@@ -337,7 +337,7 @@
/***********************************************************************************/
/* ergo_waitpofready waits for a maximum of 10 seconds for the completition of the */
-/* boot process. If the process has been successfull 0 is returned otherwise a */
+/* boot process. If the process has been successful 0 is returned otherwise a */
/* negative error code is returned. */
/***********************************************************************************/
static int
@@ -361,7 +361,7 @@
(dpr->ToPcSize < MIN_RDY_MSG_SIZE) ||
(dpr->ToPcSize > MAX_RDY_MSG_SIZE) ||
((*(ulong *) dpr->ToPcBuf) != RDY_MAGIC))
- break; /* an error occured */
+ break; /* an error occurred */
/* Check for additional data delivered during SysReady */
msg_size = dpr->ToPcSize - RDY_MAGIC_SIZE;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hysdn/hycapi.c linux.20p6/drivers/isdn/hysdn/hycapi.c
--- linux.vanilla/drivers/isdn/hysdn/hycapi.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hysdn/hycapi.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: hycapi.c,v 1.8 2000/11/22 17:13:13 kai Exp $
+/* $Id: hycapi.c,v 1.8.6.1 2001/02/16 16:43:30 kai Exp $
*
* Linux driver for HYSDN cards, CAPI2.0-Interface.
* written by Ulrich Albrecht (u.albrecht@hypercope.de) for Hypercope GmbH
@@ -41,7 +41,7 @@
#include "hysdn_defs.h"
#include
-static char hycapi_revision[]="$Revision: 1.8 $";
+static char hycapi_revision[]="$Revision: 1.8.6.1 $";
typedef struct _hycapi_appl {
unsigned int ctrl_mask;
@@ -522,7 +522,7 @@
/******************************************************************
hycapi_rx_capipkt
-Recieve a capi-message.
+Receive a capi-message.
All B3_DATA_IND are converted to 64K-extension compatible format.
New nccis are created if neccessary.
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hysdn/hysdn_boot.c linux.20p6/drivers/isdn/hysdn/hysdn_boot.c
--- linux.vanilla/drivers/isdn/hysdn/hysdn_boot.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hysdn/hysdn_boot.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: hysdn_boot.c,v 1.4.6.1 2001/02/10 14:41:22 kai Exp $
+/* $Id: hysdn_boot.c,v 1.4.6.3 2001/03/13 16:17:09 kai Exp $
* Linux driver for HYSDN cards, specific routines for booting and pof handling.
*
@@ -49,7 +49,7 @@
uchar pof_state; /* actual state of read handler */
uchar is_crypted; /* card data is crypted */
int BufSize; /* actual number of bytes bufferd */
- int last_error; /* last occured error */
+ int last_error; /* last occurred error */
word pof_recid; /* actual pof recid */
ulong pof_reclen; /* total length of pof record data */
ulong pof_recoffset; /* actual offset inside pof record */
@@ -62,7 +62,7 @@
};
/*****************************************************/
-/* start decryption of sucessive POF file chuncks. */
+/* start decryption of successive POF file chuncks. */
/* */
/* to be called at start of POF file reading, */
/* before starting any decryption on any POF record. */
@@ -93,7 +93,7 @@
/********************************************************************************/
/* pof_handle_data executes the required actions dependant on the active record */
-/* id. If successfull 0 is returned, a negative value shows an error. */
+/* id. If successful 0 is returned, a negative value shows an error. */
/********************************************************************************/
static int
pof_handle_data(hysdn_card * card, int datlen)
@@ -182,7 +182,7 @@
/* number of data bytes. The number delivered is additionally supplied for */
/* verification. The functions handles the data and returns the needed number */
/* of bytes for the next action. If the returned value is 0 or less an error */
-/* occured and booting must be aborted. */
+/* occurred and booting must be aborted. */
/******************************************************************************/
int
pof_write_buffer(hysdn_card * card, int datlen)
@@ -253,7 +253,7 @@
break;
}
if ((boot->last_error = pof_handle_data(card, datlen)) < 0)
- return (boot->last_error); /* an error occured */
+ return (boot->last_error); /* an error occurred */
boot->pof_recoffset += datlen;
if (boot->pof_recoffset >= boot->pof_reclen) {
boot->pof_state = POF_READ_TAG_HEAD; /* now start with single tags */
@@ -346,7 +346,7 @@
/*********************************************************************************/
/* EvalSysrTokData checks additional records delivered with the Sysready Message */
-/* when POF has been booted. A return value of 0 is used if no error occured. */
+/* when POF has been booted. A return value of 0 is used if no error occurred. */
/*********************************************************************************/
int
EvalSysrTokData(hysdn_card * card, uchar * cp, int len)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hysdn/hysdn_init.c linux.20p6/drivers/isdn/hysdn/hysdn_init.c
--- linux.vanilla/drivers/isdn/hysdn/hysdn_init.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hysdn/hysdn_init.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: hysdn_init.c,v 1.6.6.4 2001/02/10 14:41:22 kai Exp $
+/* $Id: hysdn_init.c,v 1.6.6.5 2001/02/16 16:43:30 kai Exp $
* Linux driver for HYSDN cards, init functions.
* written by Werner Cornelius (werner@titro.de) for Hypercope GmbH
@@ -32,7 +32,7 @@
#include "hysdn_defs.h"
-static char *hysdn_init_revision = "$Revision: 1.6.6.4 $";
+static char *hysdn_init_revision = "$Revision: 1.6.6.5 $";
int cardmax; /* number of found cards */
hysdn_card *card_root = NULL; /* pointer to first card */
@@ -189,7 +189,7 @@
/****************************************************************************/
/* init_module is called once when the module is loaded to do all necessary */
/* things like autodetect... */
-/* If the return value of this function is 0 the init has been successfull */
+/* If the return value of this function is 0 the init has been successful */
/* and the module is added to the list in /proc/modules, otherwise an error */
/* is assumed and the module will not be kept in memory. */
/****************************************************************************/
@@ -227,7 +227,7 @@
/***********************************************************************/
/* cleanup_module is called when the module is released by the kernel. */
-/* The routine is only called if init_module has been successfull and */
+/* The routine is only called if init_module has been successful and */
/* the module counter has a value of 0. Otherwise this function will */
/* not be called. This function must release all resources still allo- */
/* cated as after the return from this function the module code will */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hysdn/hysdn_net.c linux.20p6/drivers/isdn/hysdn/hysdn_net.c
--- linux.vanilla/drivers/isdn/hysdn/hysdn_net.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hysdn/hysdn_net.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: hysdn_net.c,v 1.8 2000/11/13 22:51:47 kai Exp $
+/* $Id: hysdn_net.c,v 1.8.6.1 2001/02/16 16:43:30 kai Exp $
* Linux driver for HYSDN cards, net (ethernet type) handling routines.
*
@@ -38,7 +38,7 @@
#include "hysdn_defs.h"
/* store the actual version for log reporting */
-char *hysdn_net_revision = "$Revision: 1.8 $";
+char *hysdn_net_revision = "$Revision: 1.8.6.1 $";
#define MAX_SKB_BUFFERS 20 /* number of buffers for keeping TX-data */
@@ -317,7 +317,7 @@
if (card->debug_flags & LOG_NET_INIT)
hysdn_addlog(card, "network device deleted");
- return (0); /* always successfull */
+ return (0); /* always successful */
} /* hysdn_net_release */
/*****************************************************************************/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hysdn/hysdn_procconf.c linux.20p6/drivers/isdn/hysdn/hysdn_procconf.c
--- linux.vanilla/drivers/isdn/hysdn/hysdn_procconf.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hysdn/hysdn_procconf.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: hysdn_procconf.c,v 1.8 2000/11/13 22:51:47 kai Exp $
+/* $Id: hysdn_procconf.c,v 1.8.6.1 2001/03/13 16:17:09 kai Exp $
* Linux driver for HYSDN cards, /proc/net filesystem dir and conf functions.
* written by Werner Cornelius (werner@titro.de) for Hypercope GmbH
@@ -30,7 +30,7 @@
#include "hysdn_defs.h"
-static char *hysdn_procconf_revision = "$Revision: 1.8 $";
+static char *hysdn_procconf_revision = "$Revision: 1.8.6.1 $";
#define INFO_OUT_LEN 80 /* length of info line including lf */
@@ -55,7 +55,7 @@
/***********************************************************************/
/* process_line parses one config line and transfers it to the card if */
/* necessary. */
-/* if the return value is negative an error occured. */
+/* if the return value is negative an error occurred. */
/***********************************************************************/
static int
process_line(struct conf_writedata *cnf)
@@ -129,7 +129,7 @@
if (ch == 0x1A) {
/* we detected a pof file */
if ((cnf->needed_size = pof_write_open(cnf->card, &cnf->pof_buffer)) <= 0)
- return (cnf->needed_size); /* an error occured -> exit */
+ return (cnf->needed_size); /* an error occurred -> exit */
cnf->buf_size = 0; /* buffer is empty */
cnf->state = CONF_STATE_POF; /* new state */
} else {
@@ -157,7 +157,7 @@
cnf->needed_size = pof_write_buffer(cnf->card, cnf->buf_size); /* write data */
if (cnf->needed_size <= 0) {
cnf->card->state = CARD_STATE_BOOTERR; /* show boot error */
- return (cnf->needed_size); /* an error occured */
+ return (cnf->needed_size); /* an error occurred */
}
cnf->buf_size = 0; /* buffer is empty again */
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/hysdn/hysdn_sched.c linux.20p6/drivers/isdn/hysdn/hysdn_sched.c
--- linux.vanilla/drivers/isdn/hysdn/hysdn_sched.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/hysdn/hysdn_sched.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: hysdn_sched.c,v 1.5 2000/11/22 17:13:13 kai Exp $
+/* $Id: hysdn_sched.c,v 1.5.6.1 2001/03/13 16:17:09 kai Exp $
* Linux driver for HYSDN cards, scheduler routines for handling exchange card <-> pc.
*
@@ -141,7 +141,7 @@
/*****************************************************************************/
-/* send one config line to the card and return 0 if successfull, otherwise a */
+/* send one config line to the card and return 0 if successful, otherwise a */
/* negative error code. */
/* The function works with timeouts perhaps not giving the greatest speed */
/* sending the line, but this should be meaningless beacuse only some lines */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/icn/icn.c linux.20p6/drivers/isdn/icn/icn.c
--- linux.vanilla/drivers/isdn/icn/icn.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/icn/icn.c Mon Jun 25 14:24:41 2001
@@ -1,4 +1,4 @@
-/* $Id: icn.c,v 1.65.6.2 2000/12/17 22:45:13 kai Exp $
+/* $Id: icn.c,v 1.65.6.5 2001/06/09 15:14:19 kai Exp $
* ISDN low-level module for the ICN active ISDN-Card.
*
@@ -34,7 +34,7 @@
#undef MAP_DEBUG
static char
-*revision = "$Revision: 1.65.6.2 $";
+*revision = "$Revision: 1.65.6.5 $";
static int icn_addcard(int, char *, char *);
@@ -51,8 +51,7 @@
struct sk_buff *skb;
unsigned long flags;
- while ((skb = skb_dequeue(queue)))
- dev_kfree_skb(skb);
+ skb_queue_purge(queue);
save_flags(flags);
cli();
card->xlen[channel] = 0;
@@ -838,23 +837,23 @@
card->other->rvalid = 1;
}
if (!dev.mvalid) {
- if (check_shmem((ulong) dev.shmem, 0x4000)) {
+ if (check_mem_region(dev.memaddr, 0x4000)) {
printk(KERN_WARNING
- "icn: memory at 0x%08lx in use.\n",
- (ulong) dev.shmem);
+ "icn: memory at 0x%08lx in use.\n", dev.memaddr);
restore_flags(flags);
return -EBUSY;
}
- request_shmem((ulong) dev.shmem, 0x4000, "icn");
+ request_mem_region(dev.memaddr, 0x4000, "icn-isdn (all cards)");
+ dev.shmem = ioremap(dev.memaddr, 0x4000);
dev.mvalid = 1;
}
restore_flags(flags);
OUTB_P(0, ICN_RUN); /* Reset Controller */
OUTB_P(0, ICN_MAPRAM); /* Disable RAM */
icn_shiftout(ICN_CFG, 0x0f, 3, 4); /* Windowsize= 16k */
- icn_shiftout(ICN_CFG, (unsigned long) dev.shmem, 23, 10); /* Set RAM-Addr. */
+ icn_shiftout(ICN_CFG, dev.memaddr, 23, 10); /* Set RAM-Addr. */
#ifdef BOOT_DEBUG
- printk(KERN_DEBUG "shmem=%08lx\n", (ulong) dev.shmem);
+ printk(KERN_DEBUG "shmem=%08lx\n", dev.memaddr);
#endif
SLEEP(1);
#ifdef BOOT_DEBUG
@@ -868,7 +867,7 @@
SLEEP(1);
memcpy_toio(dev.shmem, codebuf, ICN_CODE_STAGE1); /* Copy code */
#ifdef BOOT_DEBUG
- printk(KERN_DEBUG "Bootloader transfered\n");
+ printk(KERN_DEBUG "Bootloader transferred\n");
#endif
if (card->doubleS0) {
SLEEP(1);
@@ -884,7 +883,7 @@
SLEEP(1);
memcpy_toio(dev.shmem, codebuf, ICN_CODE_STAGE1); /* Copy code */
#ifdef BOOT_DEBUG
- printk(KERN_DEBUG "Bootloader transfered\n");
+ printk(KERN_DEBUG "Bootloader transferred\n");
#endif
}
kfree(codebuf);
@@ -1177,29 +1176,31 @@
memcpy(&a, c->parm.num, sizeof(ulong));
switch (c->arg) {
case ICN_IOCTL_SETMMIO:
- if ((unsigned long) dev.shmem != (a & 0x0ffc000)) {
- if (check_shmem((ulong) (a & 0x0ffc000), 0x4000)) {
+ if (dev.memaddr != (a & 0x0ffc000)) {
+ if (check_mem_region(a & 0x0ffc000, 0x4000)) {
printk(KERN_WARNING
"icn: memory at 0x%08lx in use.\n",
- (ulong) (a & 0x0ffc000));
+ a & 0x0ffc000);
return -EINVAL;
}
icn_stopallcards();
save_flags(flags);
cli();
- if (dev.mvalid)
- release_shmem((ulong) dev.shmem, 0x4000);
+ if (dev.mvalid) {
+ iounmap(dev.shmem);
+ release_mem_region(dev.memaddr, 0x4000);
+ }
dev.mvalid = 0;
- dev.shmem = (icn_shmem *) (a & 0x0ffc000);
+ dev.memaddr = a & 0x0ffc000;
restore_flags(flags);
printk(KERN_INFO
"icn: (%s) mmio set to 0x%08lx\n",
CID,
- (unsigned long) dev.shmem);
+ dev.memaddr);
}
break;
case ICN_IOCTL_GETMMIO:
- return (long) dev.shmem;
+ return (long) dev.memaddr;
case ICN_IOCTL_SETPORT:
if (a == 0x300 || a == 0x310 || a == 0x320 || a == 0x330
|| a == 0x340 || a == 0x350 || a == 0x360 ||
@@ -1649,7 +1650,7 @@
if (ints[0])
portbase = ints[1];
if (ints[0] > 1)
- membase = ints[2];
+ membase = (unsigned long)ints[2];
if (str && *str) {
strcpy(sid, str);
icn_id = sid;
@@ -1668,7 +1669,7 @@
char rev[10];
memset(&dev, 0, sizeof(icn_dev));
- dev.shmem = (icn_shmem *) ((unsigned long) membase & 0x0ffc000);
+ dev.memaddr = (membase & 0x0ffc000);
dev.channel = -1;
dev.mcard = NULL;
dev.firstload = 1;
@@ -1680,7 +1681,7 @@
} else
strcpy(rev, " ??? ");
printk(KERN_NOTICE "ICN-ISDN-driver Rev%smem=0x%08lx\n", rev,
- (ulong) dev.shmem);
+ dev.memaddr);
return (icn_addcard(portbase, icn_id, icn_id2));
}
@@ -1714,8 +1715,10 @@
card = card->next;
kfree(last);
}
- if (dev.mvalid)
- release_shmem((ulong) dev.shmem, 0x4000);
+ if (dev.mvalid) {
+ iounmap(dev.shmem);
+ release_mem_region(dev.memaddr, 0x4000);
+ }
printk(KERN_NOTICE "ICN-ISDN-driver unloaded\n");
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/icn/icn.h linux.20p6/drivers/isdn/icn/icn.h
--- linux.vanilla/drivers/isdn/icn/icn.h Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/icn/icn.h Mon Jun 25 14:56:47 2001
@@ -1,4 +1,4 @@
-/* $Id: icn.h,v 1.30.6.1 2001/02/10 14:41:23 kai Exp $
+/* $Id: icn.h,v 1.30.6.3 2001/04/20 02:42:01 keil Exp $
* ISDN lowlevel-module for the ICN active ISDN-Card.
*
@@ -187,6 +187,7 @@
* Main driver data
*/
typedef struct icn_dev {
+ unsigned long memaddr; /* Address of memory mapped buffers */
icn_shmem *shmem; /* Pointer to memory-mapped-buffers */
int mvalid; /* IO-shmem has been requested */
int channel; /* Currently mapped channel */
@@ -210,16 +211,16 @@
* integers.
*/
static int portbase = ICN_BASEADDR;
-static int membase = ICN_MEMADDR;
+static unsigned long membase = ICN_MEMADDR;
static char *icn_id = "\0";
static char *icn_id2 = "\0";
#ifdef MODULE
MODULE_AUTHOR("Fritz Elfert");
MODULE_PARM(portbase, "i");
-MODULE_PARM_DESC(portbase, "Port adress of first card");
-MODULE_PARM(membase, "i");
-MODULE_PARM_DESC(membase, "Shared memory adress of all cards");
+MODULE_PARM_DESC(portbase, "Port address of first card");
+MODULE_PARM(membase, "l");
+MODULE_PARM_DESC(membase, "Shared memory address of all cards");
MODULE_PARM(icn_id, "s");
MODULE_PARM_DESC(icn_id, "ID-String of first card");
MODULE_PARM(icn_id2, "s");
@@ -286,14 +287,6 @@
#define MIN(a,b) ((ab)?a:b)
-
-/* Hopefully, a separate resource-registration-scheme for shared-memory
- * will be introduced into the kernel. Until then, we use the normal
- * routines, designed for port-registration.
- */
-#define check_shmem check_region
-#define release_shmem release_region
-#define request_shmem request_region
#endif /* defined(__KERNEL__) || defined(__DEBUGVAR__) */
#endif /* icn_h */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/isdn_common.c linux.20p6/drivers/isdn/isdn_common.c
--- linux.vanilla/drivers/isdn/isdn_common.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/isdn_common.c Mon Jun 25 14:24:32 2001
@@ -1,4 +1,4 @@
-/* $Id: isdn_common.c,v 1.114.6.7 2001/02/10 14:41:19 kai Exp $
+/* $Id: isdn_common.c,v 1.114.6.12 2001/06/09 15:14:15 kai Exp $
* Linux ISDN subsystem, common used functions (linklevel).
*
@@ -42,7 +42,7 @@
#endif
#ifdef CONFIG_ISDN_DIVERSION
#include
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
#include "isdn_v110.h"
/* Debugflags */
@@ -50,7 +50,7 @@
isdn_dev *dev;
-static char *isdn_revision = "$Revision: 1.114.6.7 $";
+static char *isdn_revision = "$Revision: 1.114.6.12 $";
extern char *isdn_net_revision;
extern char *isdn_tty_revision;
@@ -68,7 +68,7 @@
#ifdef CONFIG_ISDN_DIVERSION
static isdn_divert_if *divert_if; /* = NULL */
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
static int isdn_writebuf_stub(int, int, const u_char *, int, int);
@@ -230,20 +230,6 @@
return isdn_wildmat( TmpMsn1, TmpMsn2 );
}
-static void
-isdn_free_queue(struct sk_buff_head *queue)
-{
- struct sk_buff *skb;
- unsigned long flags;
-
- save_flags(flags);
- cli();
- if (skb_queue_len(queue))
- while ((skb = skb_dequeue(queue)))
- dev_kfree_skb(skb);
- restore_flags(flags);
-}
-
int
isdn_dc2minor(int di, int ch)
{
@@ -516,7 +502,7 @@
if (divert_if)
if ((retval = divert_if->stat_callback(c)))
return(retval); /* processed */
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
if ((!retval) && (dev->drv[di]->flags & DRV_FLAG_REJBUS)) {
/* No tty responding */
cmd.driver = di;
@@ -589,7 +575,7 @@
#ifdef CONFIG_ISDN_DIVERSION
if (divert_if)
divert_if->stat_callback(c);
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
break;
case ISDN_STAT_DISPLAY:
#ifdef ISDN_DEBUG_STATCALLB
@@ -599,7 +585,7 @@
#ifdef CONFIG_ISDN_DIVERSION
if (divert_if)
divert_if->stat_callback(c);
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
break;
case ISDN_STAT_DCONN:
if (i < 0)
@@ -641,7 +627,7 @@
#ifdef CONFIG_ISDN_DIVERSION
if (divert_if)
divert_if->stat_callback(c);
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
break;
break;
case ISDN_STAT_BCONN:
@@ -740,7 +726,7 @@
kfree(dev->drv[di]->rcverr);
kfree(dev->drv[di]->rcvcount);
for (i = 0; i < dev->drv[di]->channels; i++)
- isdn_free_queue(&dev->drv[di]->rpqueue[i]);
+ skb_queue_purge(&dev->drv[di]->rpqueue[i]);
kfree(dev->drv[di]->rpqueue);
kfree(dev->drv[di]->rcv_waitq);
kfree(dev->drv[di]);
@@ -769,7 +755,7 @@
case ISDN_STAT_REDIR:
if (divert_if)
return(divert_if->stat_callback(c));
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
default:
return -1;
}
@@ -1869,7 +1855,7 @@
dev->v110[i] = NULL;
// 20.10.99 JIM, try to reinitialize v110 !
isdn_info_update();
- isdn_free_queue(&dev->drv[di]->rpqueue[ch]);
+ skb_queue_purge(&dev->drv[di]->rpqueue[ch]);
}
restore_flags(flags);
}
@@ -2032,7 +2018,7 @@
if ((adding) && (d->rpqueue)) {
for (j = 0; j < d->channels; j++)
- isdn_free_queue(&d->rpqueue[j]);
+ skb_queue_purge(&d->rpqueue[j]);
kfree(d->rpqueue);
}
if (!(d->rpqueue =
@@ -2149,7 +2135,7 @@
EXPORT_SYMBOL(DIVERT_REG_NAME);
-#endif CONFIG_ISDN_DIVERSION
+#endif /* CONFIG_ISDN_DIVERSION */
EXPORT_SYMBOL(register_isdn);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/isdn_net.c linux.20p6/drivers/isdn/isdn_net.c
--- linux.vanilla/drivers/isdn/isdn_net.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/isdn_net.c Mon Jun 25 14:24:32 2001
@@ -1,4 +1,4 @@
-/* $Id: isdn_net.c,v 1.140.6.3 2001/02/07 11:31:30 kai Exp $
+/* $Id: isdn_net.c,v 1.140.6.6 2001/06/11 22:08:37 kai Exp $
* Linux ISDN subsystem, network interfaces and related functions (linklevel).
*
@@ -30,9 +30,9 @@
#include
#include
#include
-#include
#include "isdn_common.h"
#include "isdn_net.h"
+#include
#ifdef CONFIG_ISDN_PPP
#include "isdn_ppp.h"
#endif
@@ -294,13 +294,11 @@
isdn_net_unbind_channel(isdn_net_local * lp)
{
ulong flags;
- struct sk_buff *skb;
save_flags(flags);
cli();
- while ((skb = skb_dequeue(&lp->super_tx_queue))) {
- kfree_skb(skb);
- }
+ skb_queue_purge(&lp->super_tx_queue);
+
if (!lp->master) { /* reset only master device */
/* Moral equivalent of dev_purge_queues():
BEWARE! This chunk of code cannot be called from hardware
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/isdn_tty.c linux.20p6/drivers/isdn/isdn_tty.c
--- linux.vanilla/drivers/isdn/isdn_tty.c Sun Mar 25 17:37:33 2001
+++ linux.20p6/drivers/isdn/isdn_tty.c Mon Jun 25 14:24:32 2001
@@ -1,4 +1,4 @@
-/* $Id: isdn_tty.c,v 1.94 2000/11/25 17:00:59 kai Exp $
+/* $Id: isdn_tty.c,v 1.94.6.2 2001/06/09 15:14:15 kai Exp $
* Linux ISDN subsystem, tty functions and AT-command emulator (linklevel).
*
@@ -66,7 +66,7 @@
static int si2bit[8] =
{4, 1, 4, 4, 4, 4, 4, 4};
-char *isdn_tty_revision = "$Revision: 1.94 $";
+char *isdn_tty_revision = "$Revision: 1.94.6.2 $";
/* isdn_tty_try_read() is called from within isdn_tty_rcv_skb()
@@ -307,18 +307,13 @@
void
isdn_tty_cleanup_xmit(modem_info * info)
{
- struct sk_buff *skb;
unsigned long flags;
save_flags(flags);
cli();
- if (skb_queue_len(&info->xmit_queue))
- while ((skb = skb_dequeue(&info->xmit_queue)))
- kfree_skb(skb);
-#ifdef CONFIG_ISDN_AUDIO
- if (skb_queue_len(&info->dtmf_queue))
- while ((skb = skb_dequeue(&info->dtmf_queue)))
- kfree_skb(skb);
+ skb_queue_purge(&info->xmit_queue);
+#ifdef CONFIG_ISDN_AUDIO
+ skb_queue_purge(&info->dtmf_queue);
#endif
restore_flags(flags);
}
@@ -3773,7 +3768,7 @@
sprintf(ds, "\r\n%d", info->emu.charge);
isdn_tty_at_cout(ds, info);
break;
- default:
+ default:;
}
break;
#ifdef DUMMY_HAYES_AT
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/isdn_v110.c linux.20p6/drivers/isdn/isdn_v110.c
--- linux.vanilla/drivers/isdn/isdn_v110.c Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/isdn/isdn_v110.c Fri May 4 23:24:34 2001
@@ -1,4 +1,4 @@
-/* $Id: isdn_v110.c,v 1.5.6.2 2001/02/10 14:41:19 kai Exp $
+/* $Id: isdn_v110.c,v 1.5.6.3 2001/02/16 16:43:23 kai Exp $
* Linux ISDN subsystem, V.110 related functions (linklevel).
*
@@ -30,7 +30,7 @@
#undef ISDN_V110_DEBUG
-char *isdn_v110_revision = "$Revision: 1.5.6.2 $";
+char *isdn_v110_revision = "$Revision: 1.5.6.3 $";
#define V110_38400 255
#define V110_19200 15
@@ -70,7 +70,7 @@
* FlipBits reorders sequences of keylen bits in one byte.
* E.g. source order 7654321 will be converted to 45670123 when keylen = 4,
* and to 67452301 when keylen = 2. This is necessary because ordering on
- * the isdn line is the the other way.
+ * the isdn line is the other way.
*/
static __inline unsigned char
FlipBits(unsigned char c, int keylen)
@@ -600,7 +600,7 @@
case ISDN_PROTO_L2_V11038:
dev->v110[idx] = isdn_v110_open(V110_38400, hdrlen, maxsize);
break;
- default:
+ default:;
}
if ((v = dev->v110[idx])) {
while (v->SyncInit) {
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/isdnloop/isdnloop.c linux.20p6/drivers/isdn/isdnloop/isdnloop.c
--- linux.vanilla/drivers/isdn/isdnloop/isdnloop.c Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/isdn/isdnloop/isdnloop.c Mon Jun 25 14:24:32 2001
@@ -1,4 +1,4 @@
-/* $Id: isdnloop.c,v 1.11.6.1 2000/12/17 16:47:18 kai Exp $
+/* $Id: isdnloop.c,v 1.11.6.3 2001/06/09 15:14:19 kai Exp $
* ISDN low-level module implementing a dummy loop driver.
*
@@ -26,7 +26,7 @@
#include "isdnloop.h"
static char
-*revision = "$Revision: 1.11.6.1 $";
+*revision = "$Revision: 1.11.6.3 $";
static int isdnloop_addcard(char *);
@@ -41,10 +41,8 @@
isdnloop_free_queue(isdnloop_card * card, int channel)
{
struct sk_buff_head *queue = &card->bqueue[channel];
- struct sk_buff *skb;
- while ((skb = skb_dequeue(queue)))
- dev_kfree_skb(skb);
+ skb_queue_purge(queue);
card->sndcount[channel] = 0;
}
@@ -977,7 +975,7 @@
* user = flag: 1 = called form userlevel, 0 called from kernel.
* card = pointer to card struct.
* Return:
- * number of bytes transfered (currently always equals len).
+ * number of bytes transferred (currently always equals len).
*/
static int
isdnloop_writecmd(const u_char * buf, int len, int user, isdnloop_card * card)
@@ -1574,11 +1572,8 @@
}
card = cards;
while (card) {
- struct sk_buff *skb;
-
last = card;
- while ((skb = skb_dequeue(&card->dqueue)))
- dev_kfree_skb(skb);
+ skb_queue_purge(&card->dqueue);
card = card->next;
kfree(last);
}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/pcbit/callbacks.c linux.20p6/drivers/isdn/pcbit/callbacks.c
--- linux.vanilla/drivers/isdn/pcbit/callbacks.c Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/isdn/pcbit/callbacks.c Fri May 4 23:24:34 2001
@@ -4,7 +4,7 @@
* Written by Pedro Roque Marques (roque@di.fc.ul.pt)
*
* This software may be used and distributed according to the terms of
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
*/
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/pcbit/callbacks.h linux.20p6/drivers/isdn/pcbit/callbacks.h
--- linux.vanilla/drivers/isdn/pcbit/callbacks.h Sun Mar 25 17:31:37 2001
+++ linux.20p6/drivers/isdn/pcbit/callbacks.h Fri May 4 23:24:34 2001
@@ -4,7 +4,7 @@
* Written by Pedro Roque Marques (roque@di.fc.ul.pt)
*
* This software may be used and distributed according to the terms of
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
*/
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/pcbit/capi.c linux.20p6/drivers/isdn/pcbit/capi.c
--- linux.vanilla/drivers/isdn/pcbit/capi.c Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/isdn/pcbit/capi.c Fri May 4 23:24:34 2001
@@ -4,7 +4,7 @@
* Written by Pedro Roque Marques (roque@di.fc.ul.pt)
*
* This software may be used and distributed according to the terms of
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
*/
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/pcbit/capi.h linux.20p6/drivers/isdn/pcbit/capi.h
--- linux.vanilla/drivers/isdn/pcbit/capi.h Sun Mar 25 17:31:37 2001
+++ linux.20p6/drivers/isdn/pcbit/capi.h Fri May 4 23:24:34 2001
@@ -4,7 +4,7 @@
* Written by Pedro Roque Marques (roque@di.fc.ul.pt)
*
* This software may be used and distributed according to the terms of
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
*/
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/pcbit/drv.c linux.20p6/drivers/isdn/pcbit/drv.c
--- linux.vanilla/drivers/isdn/pcbit/drv.c Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/isdn/pcbit/drv.c Fri May 4 23:24:34 2001
@@ -4,7 +4,7 @@
* Written by Pedro Roque Marques (roque@di.fc.ul.pt)
*
* This software may be used and distributed according to the terms of
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
*/
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/pcbit/edss1.c linux.20p6/drivers/isdn/pcbit/edss1.c
--- linux.vanilla/drivers/isdn/pcbit/edss1.c Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/isdn/pcbit/edss1.c Fri May 4 23:24:34 2001
@@ -4,7 +4,7 @@
* Written by Pedro Roque Marques (roque@di.fc.ul.pt)
*
* This software may be used and distributed according to the terms of
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
*/
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/pcbit/edss1.h linux.20p6/drivers/isdn/pcbit/edss1.h
--- linux.vanilla/drivers/isdn/pcbit/edss1.h Sun Mar 25 17:31:37 2001
+++ linux.20p6/drivers/isdn/pcbit/edss1.h Fri May 4 23:24:34 2001
@@ -4,7 +4,7 @@
* Written by Pedro Roque Marques (roque@di.fc.ul.pt)
*
* This software may be used and distributed according to the terms of
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
*/
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/pcbit/layer2.c linux.20p6/drivers/isdn/pcbit/layer2.c
--- linux.vanilla/drivers/isdn/pcbit/layer2.c Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/isdn/pcbit/layer2.c Fri May 4 23:24:34 2001
@@ -4,7 +4,7 @@
* Written by Pedro Roque Marques (roque@di.fc.ul.pt)
*
* This software may be used and distributed according to the terms of
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
*/
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/pcbit/layer2.h linux.20p6/drivers/isdn/pcbit/layer2.h
--- linux.vanilla/drivers/isdn/pcbit/layer2.h Sun Mar 25 17:31:37 2001
+++ linux.20p6/drivers/isdn/pcbit/layer2.h Sat May 5 00:03:04 2001
@@ -4,7 +4,7 @@
* Written by Pedro Roque Marques (roque@di.fc.ul.pt)
*
* This software may be used and distributed according to the terms of
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
*/
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/pcbit/module.c linux.20p6/drivers/isdn/pcbit/module.c
--- linux.vanilla/drivers/isdn/pcbit/module.c Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/isdn/pcbit/module.c Fri May 4 23:24:34 2001
@@ -4,7 +4,7 @@
* Written by Pedro Roque Marques (roque@di.fc.ul.pt)
*
* This software may be used and distributed according to the terms of
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
*/
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/pcbit/pcbit.h linux.20p6/drivers/isdn/pcbit/pcbit.h
--- linux.vanilla/drivers/isdn/pcbit/pcbit.h Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/isdn/pcbit/pcbit.h Fri May 4 23:24:34 2001
@@ -4,7 +4,7 @@
* Written by Pedro Roque Marques (roque@di.fc.ul.pt)
*
* This software may be used and distributed according to the terms of
- * the GNU Public License, incorporated herein by reference.
+ * the GNU General Public License, incorporated herein by reference.
*/
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/sc/interrupt.c linux.20p6/drivers/isdn/sc/interrupt.c
--- linux.vanilla/drivers/isdn/sc/interrupt.c Sun Mar 25 17:31:38 2001
+++ linux.20p6/drivers/isdn/sc/interrupt.c Mon Jun 25 14:24:34 2001
@@ -1,5 +1,5 @@
/*
- * $Id: interrupt.c,v 1.4 1998/01/31 22:10:52 keil Exp $
+ * $Id: interrupt.c,v 1.4.8.2 2001/04/08 17:51:43 kai Exp $
* Copyright (C) 1996 SpellCaster Telecommunications Inc.
*
* This program is free software; you can redistribute it and/or modify
@@ -34,7 +34,6 @@
extern int indicate_status(int, int, ulong, char *);
extern void check_phystat(unsigned long);
-extern void dump_messages(int);
extern int receivemessage(int, RspMessage *);
extern int sendmessage(int, unsigned int, unsigned int, unsigned int,
unsigned int, unsigned int, unsigned int, unsigned int *);
@@ -141,7 +140,7 @@
}
else if(callid>=0x0000 && callid<=0x7FFF)
{
- pr_debug("%s: Got Incomming Call\n", adapter[card]->devicename);
+ pr_debug("%s: Got Incoming Call\n", adapter[card]->devicename);
strcpy(setup.phone,&(rcvmsg.msg_data.byte_array[4]));
strcpy(setup.eazmsn,adapter[card]->channel[rcvmsg.phy_link_no-1].dn);
setup.si1 = 7;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/isdn/sc/message.c linux.20p6/drivers/isdn/sc/message.c
--- linux.vanilla/drivers/isdn/sc/message.c Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/isdn/sc/message.c Mon Jun 25 14:24:34 2001
@@ -1,5 +1,5 @@
/*
- * $Id: message.c,v 1.5 1999/09/04 06:20:07 keil Exp $
+ * $Id: message.c,v 1.5.8.1 2001/04/08 17:51:43 kai Exp $
* Copyright (C) 1996 SpellCaster Telecommunications Inc.
*
* message.c - functions for sending and receiving control messages
@@ -38,55 +38,12 @@
extern unsigned int cinst;
/*
- * Obligitory function prototypes
+ * Obligatory function prototypes
*/
extern int indicate_status(int,ulong,char*);
extern int scm_command(isdn_ctrl *);
extern void *memcpy_fromshmem(int, void *, const void *, size_t);
-/*
- * Dump message queue in shared memory to screen
- */
-void dump_messages(int card)
-{
- DualPortMemory dpm;
- unsigned long flags;
-
- int i =0;
-
- if (!IS_VALID_CARD(card)) {
- pr_debug("Invalid param: %d is not a valid card id\n", card);
- }
-
- save_flags(flags);
- cli();
- outb(adapter[card]->ioport[adapter[card]->shmem_pgport],
- (adapter[card]->shmem_magic >> 14) | 0x80);
- memcpy_fromshmem(card, &dpm, 0, sizeof(dpm));
- restore_flags(flags);
-
- pr_debug("%s: Dumping Request Queue\n", adapter[card]->devicename);
- for (i = 0; i < dpm.req_head; i++) {
- pr_debug("%s: Message #%d: (%d,%d,%d), link: %d\n",
- adapter[card]->devicename, i,
- dpm.req_queue[i].type,
- dpm.req_queue[i].class,
- dpm.req_queue[i].code,
- dpm.req_queue[i].phy_link_no);
- }
-
- pr_debug("%s: Dumping Response Queue\n", adapter[card]->devicename);
- for (i = 0; i < dpm.rsp_head; i++) {
- pr_debug("%s: Message #%d: (%d,%d,%d), link: %d, status: %d\n",
- adapter[card]->devicename, i,
- dpm.rsp_queue[i].type,
- dpm.rsp_queue[i].class,
- dpm.rsp_queue[i].code,
- dpm.rsp_queue[i].phy_link_no,
- dpm.rsp_queue[i].rsp_status);
- }
-
-}
/*
* receive a message from the board
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/macintosh/via-pmu.c linux.20p6/drivers/macintosh/via-pmu.c
--- linux.vanilla/drivers/macintosh/via-pmu.c Sun Mar 25 17:31:41 2001
+++ linux.20p6/drivers/macintosh/via-pmu.c Tue Jun 19 09:59:54 2001
@@ -1356,7 +1356,7 @@
/* Make sure the decrementer won't interrupt us */
asm volatile("mtdec %0" : : "r" (0x7fffffff));
- /* Make sure any pending DEC interrupt occuring while we did
+ /* Make sure any pending DEC interrupt occurring while we did
* the above didn't re-enable the DEC */
mb();
asm volatile("mtdec %0" : : "r" (0x7fffffff));
@@ -1509,7 +1509,7 @@
/* Make sure the decrementer won't interrupt us */
asm volatile("mtdec %0" : : "r" (0x7fffffff));
- /* Make sure any pending DEC interrupt occuring while we did
+ /* Make sure any pending DEC interrupt occurring while we did
* the above didn't re-enable the DEC */
mb();
asm volatile("mtdec %0" : : "r" (0x7fffffff));
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/misc/parport_pc.c linux.20p6/drivers/misc/parport_pc.c
--- linux.vanilla/drivers/misc/parport_pc.c Sun Mar 25 17:31:41 2001
+++ linux.20p6/drivers/misc/parport_pc.c Mon Jun 18 08:28:48 2001
@@ -966,7 +966,7 @@
printk (KERN_INFO
"Unknown PCI parallel I/O card (%04x/%04x)\n"
"Please send 'lspci' output to "
- "tim@cyberelk.demon.co.uk\n",
+ "tim@cyberelk.net\n",
pcidev->vendor, pcidev->device);
}
#endif
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/3c509.c linux.20p6/drivers/net/3c509.c
--- linux.vanilla/drivers/net/3c509.c Sun Mar 25 17:31:15 2001
+++ linux.20p6/drivers/net/3c509.c Tue May 8 15:54:50 2001
@@ -180,12 +180,20 @@
if (EISA_bus) {
static int eisa_addr = 0x1000;
while (eisa_addr < 0x9000) {
+ int device_id;
+
ioaddr = eisa_addr;
eisa_addr += 0x1000;
/* Check the standard EISA ID register for an encoded '3Com'. */
if (inw(ioaddr + 0xC80) != 0x6d50)
continue;
+
+ /* Avoid conflict with 3c590, 3c592, 3c597, etc */
+ device_id = (inb(ioaddr + 0xC82)<<8) + inb(ioaddr + 0xC83);
+ if ((device_id & 0xFF00) == 0x5900) {
+ continue;
+ }
/* Change the register set to the configuration window 0. */
outw(SelectWindow | 0, ioaddr + 0xC80 + EL3_CMD);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/8139too.c linux.20p6/drivers/net/8139too.c
--- linux.vanilla/drivers/net/8139too.c Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/net/8139too.c Tue Jun 19 09:44:47 2001
@@ -1603,7 +1603,11 @@
struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
unsigned long timeout;
+ lock_kernel();
daemonize ();
+ exit_files(current);
+ unlock_kernel();
+
spin_lock_irq(¤t->sigmask_lock);
sigemptyset(¤t->blocked);
recalc_sigpending(current);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/82596.c linux.20p6/drivers/net/82596.c
--- linux.vanilla/drivers/net/82596.c Sun Mar 25 17:31:20 2001
+++ linux.20p6/drivers/net/82596.c Tue Jun 19 08:51:53 2001
@@ -1106,7 +1106,7 @@
{
int i;
struct i596_private *lp;
- char eth_addr[6];
+ char eth_addr[8];
static int probed = 0;
if (probed)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/Config.in linux.20p6/drivers/net/Config.in
--- linux.vanilla/drivers/net/Config.in Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/net/Config.in Tue Jun 19 09:39:08 2001
@@ -301,7 +301,7 @@
#
# Microgate Synclink HDLC/SYNCPPP support
#
-dep_tristate 'SyncLink HDLC/SYNCPPP support' CONFIG_SYNCLINK_SYNCPPP m
+tristate 'SyncLink HDLC/SYNCPPP support' CONFIG_SYNCLINK_SYNCPPP
#
# Lan Media's board. Currently 1000, 1200, 5200, 5245
@@ -342,6 +342,11 @@
fi
fi
fi
+fi
+
+if [ "$CONFIG_HDLC" = "y" -o "$CONFIG_SYNCLINK_SYNCPPP" = "y" -o \
+ "$CONFIG_LANMEDIA" = "y" ] ; then
+ define_bool CONFIG_SYNCPPP y
fi
tristate 'Frame relay DLCI support' CONFIG_DLCI
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/Makefile linux.20p6/drivers/net/Makefile
--- linux.vanilla/drivers/net/Makefile Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/net/Makefile Fri May 4 23:09:00 2001
@@ -1445,7 +1445,7 @@
rm -f core *.o *.a *.s
wanpipe.o: $(WANPIPE_OBJS)
- ld -r -o $@ $(WANPIPE_OBJS)
+ $(LD) -r -o $@ $(WANPIPE_OBJS)
rcpci.o: rcpci45.o rclanmtl.o
$(LD) -r -o rcpci.o rcpci45.o rclanmtl.o
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/daynaport.c linux.20p6/drivers/net/daynaport.c
--- linux.vanilla/drivers/net/daynaport.c Sun Mar 25 17:31:20 2001
+++ linux.20p6/drivers/net/daynaport.c Tue Jun 19 09:59:54 2001
@@ -447,7 +447,7 @@
}
/* We should hopefully not get here */
- printk(KERN_ERR "Probe unsucessful.\n");
+ printk(KERN_ERR "Probe unsuccessful.\n");
return -ENODEV;
membad:
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/falc-lh.h linux.20p6/drivers/net/falc-lh.h
--- linux.vanilla/drivers/net/falc-lh.h Thu Jan 1 01:00:00 1970
+++ linux.20p6/drivers/net/falc-lh.h Fri May 4 23:05:08 2001
@@ -0,0 +1,1232 @@
+/*
+ * falc.h Description of the Siemens FALC T1/E1 framer.
+ *
+ * Author: Ivan Passos
+ *
+ * Copyright: (c) 2000-2001 Cyclades Corp.
+ *
+ * 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.
+ *
+ * $Log: falc.h,v $
+ * Revision 1.1 2000/05/15 ivan
+ * Included DJA bits for the LIM2 register.
+ *
+ * Revision 1.0 2000/02/22 ivan
+ * Initial version.
+ *
+ */
+
+#ifndef _FALC_LH_H
+#define _FALC_LH_H
+
+#define NUM_OF_T1_CHANNELS 24
+#define NUM_OF_E1_CHANNELS 32
+
+/*>>>>>>>>>>>>>>>>> FALC Register Bits (Transmit Mode) <<<<<<<<<<<<<<<<<<< */
+
+/* CMDR (Command Register)
+ ---------------- E1 & T1 ------------------------------ */
+#define CMDR_RMC 0x80
+#define CMDR_RRES 0x40
+#define CMDR_XREP 0x20
+#define CMDR_XRES 0x10
+#define CMDR_XHF 0x08
+#define CMDR_XTF 0x04
+#define CMDR_XME 0x02
+#define CMDR_SRES 0x01
+
+/* MODE (Mode Register)
+ ----------------- E1 & T1 ----------------------------- */
+#define MODE_MDS2 0x80
+#define MODE_MDS1 0x40
+#define MODE_MDS0 0x20
+#define MODE_BRAC 0x10
+#define MODE_HRAC 0x08
+
+/* IPC (Interrupt Port Configuration)
+ ----------------- E1 & T1 ----------------------------- */
+#define IPC_VIS 0x80
+#define IPC_SCI 0x04
+#define IPC_IC1 0x02
+#define IPC_IC0 0x01
+
+/* CCR1 (Common Configuration Register 1)
+ ----------------- E1 & T1 ----------------------------- */
+#define CCR1_SFLG 0x80
+#define CCR1_XTS16RA 0x40
+#define CCR1_BRM 0x40
+#define CCR1_CASSYM 0x20
+#define CCR1_EDLX 0x20
+#define CCR1_EITS 0x10
+#define CCR1_ITF 0x08
+#define CCR1_RFT1 0x02
+#define CCR1_RFT0 0x01
+
+/* CCR3 (Common Configuration Register 3)
+ ---------------- E1 & T1 ------------------------------ */
+
+#define CCR3_PRE1 0x80
+#define CCR3_PRE0 0x40
+#define CCR3_EPT 0x20
+#define CCR3_RADD 0x10
+#define CCR3_RCRC 0x04
+#define CCR3_XCRC 0x02
+
+
+/* RTR1-4 (Receive Timeslot Register 1-4)
+ ---------------- E1 & T1 ------------------------------ */
+
+#define RTR1_TS0 0x80
+#define RTR1_TS1 0x40
+#define RTR1_TS2 0x20
+#define RTR1_TS3 0x10
+#define RTR1_TS4 0x08
+#define RTR1_TS5 0x04
+#define RTR1_TS6 0x02
+#define RTR1_TS7 0x01
+
+#define RTR2_TS8 0x80
+#define RTR2_TS9 0x40
+#define RTR2_TS10 0x20
+#define RTR2_TS11 0x10
+#define RTR2_TS12 0x08
+#define RTR2_TS13 0x04
+#define RTR2_TS14 0x02
+#define RTR2_TS15 0x01
+
+#define RTR3_TS16 0x80
+#define RTR3_TS17 0x40
+#define RTR3_TS18 0x20
+#define RTR3_TS19 0x10
+#define RTR3_TS20 0x08
+#define RTR3_TS21 0x04
+#define RTR3_TS22 0x02
+#define RTR3_TS23 0x01
+
+#define RTR4_TS24 0x80
+#define RTR4_TS25 0x40
+#define RTR4_TS26 0x20
+#define RTR4_TS27 0x10
+#define RTR4_TS28 0x08
+#define RTR4_TS29 0x04
+#define RTR4_TS30 0x02
+#define RTR4_TS31 0x01
+
+
+/* TTR1-4 (Transmit Timeslot Register 1-4)
+ ---------------- E1 & T1 ------------------------------ */
+
+#define TTR1_TS0 0x80
+#define TTR1_TS1 0x40
+#define TTR1_TS2 0x20
+#define TTR1_TS3 0x10
+#define TTR1_TS4 0x08
+#define TTR1_TS5 0x04
+#define TTR1_TS6 0x02
+#define TTR1_TS7 0x01
+
+#define TTR2_TS8 0x80
+#define TTR2_TS9 0x40
+#define TTR2_TS10 0x20
+#define TTR2_TS11 0x10
+#define TTR2_TS12 0x08
+#define TTR2_TS13 0x04
+#define TTR2_TS14 0x02
+#define TTR2_TS15 0x01
+
+#define TTR3_TS16 0x80
+#define TTR3_TS17 0x40
+#define TTR3_TS18 0x20
+#define TTR3_TS19 0x10
+#define TTR3_TS20 0x08
+#define TTR3_TS21 0x04
+#define TTR3_TS22 0x02
+#define TTR3_TS23 0x01
+
+#define TTR4_TS24 0x80
+#define TTR4_TS25 0x40
+#define TTR4_TS26 0x20
+#define TTR4_TS27 0x10
+#define TTR4_TS28 0x08
+#define TTR4_TS29 0x04
+#define TTR4_TS30 0x02
+#define TTR4_TS31 0x01
+
+
+
+/* IMR0-4 (Interrupt Mask Register 0-4)
+
+ ----------------- E1 & T1 ----------------------------- */
+
+#define IMR0_RME 0x80
+#define IMR0_RFS 0x40
+#define IMR0_T8MS 0x20
+#define IMR0_ISF 0x20
+#define IMR0_RMB 0x10
+#define IMR0_CASC 0x08
+#define IMR0_RSC 0x08
+#define IMR0_CRC6 0x04
+#define IMR0_CRC4 0x04
+#define IMR0_PDEN 0x02
+#define IMR0_RPF 0x01
+
+#define IMR1_CASE 0x80
+#define IMR1_RDO 0x40
+#define IMR1_ALLS 0x20
+#define IMR1_XDU 0x10
+#define IMR1_XMB 0x08
+#define IMR1_XLSC 0x02
+#define IMR1_XPR 0x01
+#define IMR1_LLBSC 0x80
+
+#define IMR2_FAR 0x80
+#define IMR2_LFA 0x40
+#define IMR2_MFAR 0x20
+#define IMR2_T400MS 0x10
+#define IMR2_LMFA 0x10
+#define IMR2_AIS 0x08
+#define IMR2_LOS 0x04
+#define IMR2_RAR 0x02
+#define IMR2_RA 0x01
+
+#define IMR3_ES 0x80
+#define IMR3_SEC 0x40
+#define IMR3_LMFA16 0x20
+#define IMR3_AIS16 0x10
+#define IMR3_RA16 0x08
+#define IMR3_API 0x04
+#define IMR3_XSLP 0x20
+#define IMR3_XSLN 0x10
+#define IMR3_LLBSC 0x08
+#define IMR3_XRS 0x04
+#define IMR3_SLN 0x02
+#define IMR3_SLP 0x01
+
+#define IMR4_LFA 0x80
+#define IMR4_FER 0x40
+#define IMR4_CER 0x20
+#define IMR4_AIS 0x10
+#define IMR4_LOS 0x08
+#define IMR4_CVE 0x04
+#define IMR4_SLIP 0x02
+#define IMR4_EBE 0x01
+
+/* FMR0-5 for E1 and T1 (Framer Mode Register ) */
+
+#define FMR0_XC1 0x80
+#define FMR0_XC0 0x40
+#define FMR0_RC1 0x20
+#define FMR0_RC0 0x10
+#define FMR0_EXTD 0x08
+#define FMR0_ALM 0x04
+#define E1_FMR0_FRS 0x02
+#define T1_FMR0_FRS 0x08
+#define FMR0_SRAF 0x04
+#define FMR0_EXLS 0x02
+#define FMR0_SIM 0x01
+
+#define FMR1_MFCS 0x80
+#define FMR1_AFR 0x40
+#define FMR1_ENSA 0x20
+#define FMR1_CTM 0x80
+#define FMR1_SIGM 0x40
+#define FMR1_EDL 0x20
+#define FMR1_PMOD 0x10
+#define FMR1_XFS 0x08
+#define FMR1_CRC 0x08
+#define FMR1_ECM 0x04
+#define FMR1_IMOD 0x02
+#define FMR1_XAIS 0x01
+
+#define FMR2_RFS1 0x80
+#define FMR2_RFS0 0x40
+#define FMR2_MCSP 0x40
+#define FMR2_RTM 0x20
+#define FMR2_SSP 0x20
+#define FMR2_DAIS 0x10
+#define FMR2_SAIS 0x08
+#define FMR2_PLB 0x04
+#define FMR2_AXRA 0x02
+#define FMR2_ALMF 0x01
+#define FMR2_EXZE 0x01
+
+#define LOOP_RTM 0x40
+#define LOOP_SFM 0x40
+#define LOOP_ECLB 0x20
+#define LOOP_CLA 0x1f
+
+/*--------------------- E1 ----------------------------*/
+#define FMR3_XLD 0x20
+#define FMR3_XLU 0x10
+
+/*--------------------- T1 ----------------------------*/
+#define FMR4_AIS3 0x80
+#define FMR4_TM 0x40
+#define FMR4_XRA 0x20
+#define FMR4_SSC1 0x10
+#define FMR4_SSC0 0x08
+#define FMR4_AUTO 0x04
+#define FMR4_FM1 0x02
+#define FMR4_FM0 0x01
+
+#define FMR5_SRS 0x80
+#define FMR5_EIBR 0x40
+#define FMR5_XLD 0x20
+#define FMR5_XLU 0x10
+
+
+/* LOOP (Channel Loop Back)
+
+ ------------------ E1 & T1 ---------------------------- */
+
+#define LOOP_SFM 0x40
+#define LOOP_ECLB 0x20
+#define LOOP_CLA4 0x10
+#define LOOP_CLA3 0x08
+#define LOOP_CLA2 0x04
+#define LOOP_CLA1 0x02
+#define LOOP_CLA0 0x01
+
+
+
+/* XSW (Transmit Service Word Pulseframe)
+
+ ------------------- E1 --------------------------- */
+
+#define XSW_XSIS 0x80
+#define XSW_XTM 0x40
+#define XSW_XRA 0x20
+#define XSW_XY0 0x10
+#define XSW_XY1 0x08
+#define XSW_XY2 0x04
+#define XSW_XY3 0x02
+#define XSW_XY4 0x01
+
+
+/* XSP (Transmit Spare Bits)
+
+ ------------------- E1 --------------------------- */
+
+#define XSP_XAP 0x80
+#define XSP_CASEN 0x40
+#define XSP_TT0 0x20
+#define XSP_EBP 0x10
+#define XSP_AXS 0x08
+#define XSP_XSIF 0x04
+#define XSP_XS13 0x02
+#define XSP_XS15 0x01
+
+
+/* XC0/1 (Transmit Control 0/1)
+ ------------------ E1 & T1 ---------------------------- */
+
+#define XC0_SA8E 0x80
+#define XC0_SA7E 0x40
+#define XC0_SA6E 0x20
+#define XC0_SA5E 0x10
+#define XC0_SA4E 0x08
+#define XC0_BRM 0x80
+#define XC0_MFBS 0x40
+#define XC0_SFRZ 0x10
+#define XC0_XCO2 0x04
+#define XC0_XCO1 0x02
+#define XC0_XCO0 0x01
+
+#define XC1_XTO5 0x20
+#define XC1_XTO4 0x10
+#define XC1_XTO3 0x08
+#define XC1_XTO2 0x04
+#define XC1_XTO1 0x02
+#define XC1_XTO0 0x01
+
+
+/* RC0/1 (Receive Control 0/1)
+ ------------------ E1 & T1 ---------------------------- */
+
+#define RC0_SICS 0x40
+#define RC0_CRCI 0x20
+#define RC0_XCRCI 0x10
+#define RC0_RDIS 0x08
+#define RC0_RCO2 0x04
+#define RC0_RCO1 0x02
+#define RC0_RCO0 0x01
+
+#define RC1_SWD 0x80
+#define RC1_ASY4 0x40
+#define RC1_RRAM 0x40
+#define RC1_RTO5 0x20
+#define RC1_RTO4 0x10
+#define RC1_RTO3 0x08
+#define RC1_RTO2 0x04
+#define RC1_RTO1 0x02
+#define RC1_RTO0 0x01
+
+
+
+/* XPM0-2 (Transmit Pulse Mask 0-2)
+ --------------------- E1 & T1 ------------------------- */
+
+#define XPM0_XP12 0x80
+#define XPM0_XP11 0x40
+#define XPM0_XP10 0x20
+#define XPM0_XP04 0x10
+#define XPM0_XP03 0x08
+#define XPM0_XP02 0x04
+#define XPM0_XP01 0x02
+#define XPM0_XP00 0x01
+
+#define XPM1_XP30 0x80
+#define XPM1_XP24 0x40
+#define XPM1_XP23 0x20
+#define XPM1_XP22 0x10
+#define XPM1_XP21 0x08
+#define XPM1_XP20 0x04
+#define XPM1_XP14 0x02
+#define XPM1_XP13 0x01
+
+#define XPM2_XLHP 0x80
+#define XPM2_XLT 0x40
+#define XPM2_DAXLT 0x20
+#define XPM2_XP34 0x08
+#define XPM2_XP33 0x04
+#define XPM2_XP32 0x02
+#define XPM2_XP31 0x01
+
+
+/* TSWM (Transparent Service Word Mask)
+ ------------------ E1 ---------------------------- */
+
+#define TSWM_TSIS 0x80
+#define TSWM_TSIF 0x40
+#define TSWM_TRA 0x20
+#define TSWM_TSA4 0x10
+#define TSWM_TSA5 0x08
+#define TSWM_TSA6 0x04
+#define TSWM_TSA7 0x02
+#define TSWM_TSA8 0x01
+
+/* IDLE
+
+ ------------------ E1 & T1 ----------------------- */
+
+#define IDLE_IDL7 0x80
+#define IDLE_IDL6 0x40
+#define IDLE_IDL5 0x20
+#define IDLE_IDL4 0x10
+#define IDLE_IDL3 0x08
+#define IDLE_IDL2 0x04
+#define IDLE_IDL1 0x02
+#define IDLE_IDL0 0x01
+
+
+/* XSA4-8
+ -------------------E1 ----------------------------- */
+
+#define XSA4_XS47 0x80
+#define XSA4_XS46 0x40
+#define XSA4_XS45 0x20
+#define XSA4_XS44 0x10
+#define XSA4_XS43 0x08
+#define XSA4_XS42 0x04
+#define XSA4_XS41 0x02
+#define XSA4_XS40 0x01
+
+#define XSA5_XS57 0x80
+#define XSA5_XS56 0x40
+#define XSA5_XS55 0x20
+#define XSA5_XS54 0x10
+#define XSA5_XS53 0x08
+#define XSA5_XS52 0x04
+#define XSA5_XS51 0x02
+#define XSA5_XS50 0x01
+
+#define XSA6_XS67 0x80
+#define XSA6_XS66 0x40
+#define XSA6_XS65 0x20
+#define XSA6_XS64 0x10
+#define XSA6_XS63 0x08
+#define XSA6_XS62 0x04
+#define XSA6_XS61 0x02
+#define XSA6_XS60 0x01
+
+#define XSA7_XS77 0x80
+#define XSA7_XS76 0x40
+#define XSA7_XS75 0x20
+#define XSA7_XS74 0x10
+#define XSA7_XS73 0x08
+#define XSA7_XS72 0x04
+#define XSA7_XS71 0x02
+#define XSA7_XS70 0x01
+
+#define XSA8_XS87 0x80
+#define XSA8_XS86 0x40
+#define XSA8_XS85 0x20
+#define XSA8_XS84 0x10
+#define XSA8_XS83 0x08
+#define XSA8_XS82 0x04
+#define XSA8_XS81 0x02
+#define XSA8_XS80 0x01
+
+
+/* XDL1-3 (Transmit DL-Bit Register1-3 (read/write))
+ ----------------------- T1 --------------------- */
+
+#define XDL1_XDL17 0x80
+#define XDL1_XDL16 0x40
+#define XDL1_XDL15 0x20
+#define XDL1_XDL14 0x10
+#define XDL1_XDL13 0x08
+#define XDL1_XDL12 0x04
+#define XDL1_XDL11 0x02
+#define XDL1_XDL10 0x01
+
+#define XDL2_XDL27 0x80
+#define XDL2_XDL26 0x40
+#define XDL2_XDL25 0x20
+#define XDL2_XDL24 0x10
+#define XDL2_XDL23 0x08
+#define XDL2_XDL22 0x04
+#define XDL2_XDL21 0x02
+#define XDL2_XDL20 0x01
+
+#define XDL3_XDL37 0x80
+#define XDL3_XDL36 0x40
+#define XDL3_XDL35 0x20
+#define XDL3_XDL34 0x10
+#define XDL3_XDL33 0x08
+#define XDL3_XDL32 0x04
+#define XDL3_XDL31 0x02
+#define XDL3_XDL30 0x01
+
+
+/* ICB1-4 (Idle Channel Register 1-4)
+ ------------------ E1 ---------------------------- */
+
+#define E1_ICB1_IC0 0x80
+#define E1_ICB1_IC1 0x40
+#define E1_ICB1_IC2 0x20
+#define E1_ICB1_IC3 0x10
+#define E1_ICB1_IC4 0x08
+#define E1_ICB1_IC5 0x04
+#define E1_ICB1_IC6 0x02
+#define E1_ICB1_IC7 0x01
+
+#define E1_ICB2_IC8 0x80
+#define E1_ICB2_IC9 0x40
+#define E1_ICB2_IC10 0x20
+#define E1_ICB2_IC11 0x10
+#define E1_ICB2_IC12 0x08
+#define E1_ICB2_IC13 0x04
+#define E1_ICB2_IC14 0x02
+#define E1_ICB2_IC15 0x01
+
+#define E1_ICB3_IC16 0x80
+#define E1_ICB3_IC17 0x40
+#define E1_ICB3_IC18 0x20
+#define E1_ICB3_IC19 0x10
+#define E1_ICB3_IC20 0x08
+#define E1_ICB3_IC21 0x04
+#define E1_ICB3_IC22 0x02
+#define E1_ICB3_IC23 0x01
+
+#define E1_ICB4_IC24 0x80
+#define E1_ICB4_IC25 0x40
+#define E1_ICB4_IC26 0x20
+#define E1_ICB4_IC27 0x10
+#define E1_ICB4_IC28 0x08
+#define E1_ICB4_IC29 0x04
+#define E1_ICB4_IC30 0x02
+#define E1_ICB4_IC31 0x01
+
+/* ICB1-4 (Idle Channel Register 1-4)
+ ------------------ T1 ---------------------------- */
+
+#define T1_ICB1_IC1 0x80
+#define T1_ICB1_IC2 0x40
+#define T1_ICB1_IC3 0x20
+#define T1_ICB1_IC4 0x10
+#define T1_ICB1_IC5 0x08
+#define T1_ICB1_IC6 0x04
+#define T1_ICB1_IC7 0x02
+#define T1_ICB1_IC8 0x01
+
+#define T1_ICB2_IC9 0x80
+#define T1_ICB2_IC10 0x40
+#define T1_ICB2_IC11 0x20
+#define T1_ICB2_IC12 0x10
+#define T1_ICB2_IC13 0x08
+#define T1_ICB2_IC14 0x04
+#define T1_ICB2_IC15 0x02
+#define T1_ICB2_IC16 0x01
+
+#define T1_ICB3_IC17 0x80
+#define T1_ICB3_IC18 0x40
+#define T1_ICB3_IC19 0x20
+#define T1_ICB3_IC20 0x10
+#define T1_ICB3_IC21 0x08
+#define T1_ICB3_IC22 0x04
+#define T1_ICB3_IC23 0x02
+#define T1_ICB3_IC24 0x01
+
+/* FMR3 (Framer Mode Register 3)
+ --------------------E1------------------------ */
+
+#define FMR3_CMI 0x08
+#define FMR3_SYNSA 0x04
+#define FMR3_CFRZ 0x02
+#define FMR3_EXTIW 0x01
+
+
+
+/* CCB1-3 (Clear Channel Register)
+ ------------------- T1 ----------------------- */
+
+#define CCB1_CH1 0x80
+#define CCB1_CH2 0x40
+#define CCB1_CH3 0x20
+#define CCB1_CH4 0x10
+#define CCB1_CH5 0x08
+#define CCB1_CH6 0x04
+#define CCB1_CH7 0x02
+#define CCB1_CH8 0x01
+
+#define CCB2_CH9 0x80
+#define CCB2_CH10 0x40
+#define CCB2_CH11 0x20
+#define CCB2_CH12 0x10
+#define CCB2_CH13 0x08
+#define CCB2_CH14 0x04
+#define CCB2_CH15 0x02
+#define CCB2_CH16 0x01
+
+#define CCB3_CH17 0x80
+#define CCB3_CH18 0x40
+#define CCB3_CH19 0x20
+#define CCB3_CH20 0x10
+#define CCB3_CH21 0x08
+#define CCB3_CH22 0x04
+#define CCB3_CH23 0x02
+#define CCB3_CH24 0x01
+
+
+/* LIM0/1 (Line Interface Mode 0/1)
+ ------------------- E1 & T1 --------------------------- */
+
+#define LIM0_XFB 0x80
+#define LIM0_XDOS 0x40
+#define LIM0_SCL1 0x20
+#define LIM0_SCL0 0x10
+#define LIM0_EQON 0x08
+#define LIM0_ELOS 0x04
+#define LIM0_LL 0x02
+#define LIM0_MAS 0x01
+
+#define LIM1_EFSC 0x80
+#define LIM1_RIL2 0x40
+#define LIM1_RIL1 0x20
+#define LIM1_RIL0 0x10
+#define LIM1_DCOC 0x08
+#define LIM1_JATT 0x04
+#define LIM1_RL 0x02
+#define LIM1_DRS 0x01
+
+
+/* PCDR (Pulse Count Detection Register(Read/Write))
+ ------------------ E1 & T1 ------------------------- */
+
+#define PCDR_PCD7 0x80
+#define PCDR_PCD6 0x40
+#define PCDR_PCD5 0x20
+#define PCDR_PCD4 0x10
+#define PCDR_PCD3 0x08
+#define PCDR_PCD2 0x04
+#define PCDR_PCD1 0x02
+#define PCDR_PCD0 0x01
+
+#define PCRR_PCR7 0x80
+#define PCRR_PCR6 0x40
+#define PCRR_PCR5 0x20
+#define PCRR_PCR4 0x10
+#define PCRR_PCR3 0x08
+#define PCRR_PCR2 0x04
+#define PCRR_PCR1 0x02
+#define PCRR_PCR0 0x01
+
+
+/* LIM2 (Line Interface Mode 2)
+
+ ------------------ E1 & T1 ---------------------------- */
+
+#define LIM2_DJA2 0x20
+#define LIM2_DJA1 0x10
+#define LIM2_LOS2 0x02
+#define LIM2_LOS1 0x01
+
+/* LCR1 (Loop Code Register 1) */
+
+#define LCR1_EPRM 0x80
+#define LCR1_XPRBS 0x40
+
+/* SIC1 (System Interface Control 1) */
+#define SIC1_SRSC 0x80
+#define SIC1_RBS1 0x20
+#define SIC1_RBS0 0x10
+#define SIC1_SXSC 0x08
+#define SIC1_XBS1 0x02
+#define SIC1_XBS0 0x01
+
+/* DEC (Disable Error Counter)
+ ------------------ E1 & T1 ---------------------------- */
+
+#define DEC_DCEC3 0x20
+#define DEC_DBEC 0x10
+#define DEC_DCEC1 0x08
+#define DEC_DCEC 0x08
+#define DEC_DEBC 0x04
+#define DEC_DCVC 0x02
+#define DEC_DFEC 0x01
+
+
+/* FALC Register Bits (Receive Mode)
+ ---------------------------------------------------------------------------- */
+
+
+/* FRS0/1 (Framer Receive Status Register 0/1)
+ ----------------- E1 & T1 ---------------------------------- */
+
+#define FRS0_LOS 0x80
+#define FRS0_AIS 0x40
+#define FRS0_LFA 0x20
+#define FRS0_RRA 0x10
+#define FRS0_API 0x08
+#define FRS0_NMF 0x04
+#define FRS0_LMFA 0x02
+#define FRS0_FSRF 0x01
+
+#define FRS1_TS16RA 0x40
+#define FRS1_TS16LOS 0x20
+#define FRS1_TS16AIS 0x10
+#define FRS1_TS16LFA 0x08
+#define FRS1_EXZD 0x80
+#define FRS1_LLBDD 0x10
+#define FRS1_LLBAD 0x08
+#define FRS1_XLS 0x02
+#define FRS1_XLO 0x01
+#define FRS1_PDEN 0x40
+
+/* FRS2/3 (Framer Receive Status Register 2/3)
+ ----------------- T1 ---------------------------------- */
+
+#define FRS2_ESC2 0x80
+#define FRS2_ESC1 0x40
+#define FRS2_ESC0 0x20
+
+#define FRS3_FEH5 0x20
+#define FRS3_FEH4 0x10
+#define FRS3_FEH3 0x08
+#define FRS3_FEH2 0x04
+#define FRS3_FEH1 0x02
+#define FRS3_FEH0 0x01
+
+
+/* RSW (Receive Service Word Pulseframe)
+ ----------------- E1 ------------------------------ */
+
+#define RSW_RSI 0x80
+#define RSW_RRA 0x20
+#define RSW_RYO 0x10
+#define RSW_RY1 0x08
+#define RSW_RY2 0x04
+#define RSW_RY3 0x02
+#define RSW_RY4 0x01
+
+
+/* RSP (Receive Spare Bits / Additional Status)
+ ---------------- E1 ------------------------------- */
+
+#define RSP_SI1 0x80
+#define RSP_SI2 0x40
+#define RSP_LLBDD 0x10
+#define RSP_LLBAD 0x08
+#define RSP_RSIF 0x04
+#define RSP_RS13 0x02
+#define RSP_RS15 0x01
+
+
+/* FECL (Framing Error Counter)
+ ---------------- E1 & T1 -------------------------- */
+
+#define FECL_FE7 0x80
+#define FECL_FE6 0x40
+#define FECL_FE5 0x20
+#define FECL_FE4 0x10
+#define FECL_FE3 0x08
+#define FECL_FE2 0x04
+#define FECL_FE1 0x02
+#define FECL_FE0 0x01
+
+#define FECH_FE15 0x80
+#define FECH_FE14 0x40
+#define FECH_FE13 0x20
+#define FECH_FE12 0x10
+#define FECH_FE11 0x08
+#define FECH_FE10 0x04
+#define FECH_FE9 0x02
+#define FECH_FE8 0x01
+
+
+/* CVCl (Code Violation Counter)
+ ----------------- E1 ------------------------- */
+
+#define CVCL_CV7 0x80
+#define CVCL_CV6 0x40
+#define CVCL_CV5 0x20
+#define CVCL_CV4 0x10
+#define CVCL_CV3 0x08
+#define CVCL_CV2 0x04
+#define CVCL_CV1 0x02
+#define CVCL_CV0 0x01
+
+#define CVCH_CV15 0x80
+#define CVCH_CV14 0x40
+#define CVCH_CV13 0x20
+#define CVCH_CV12 0x10
+#define CVCH_CV11 0x08
+#define CVCH_CV10 0x04
+#define CVCH_CV9 0x02
+#define CVCH_CV8 0x01
+
+
+/* CEC1-3L (CRC Error Counter)
+ ------------------ E1 ----------------------------- */
+
+#define CEC1L_CR7 0x80
+#define CEC1L_CR6 0x40
+#define CEC1L_CR5 0x20
+#define CEC1L_CR4 0x10
+#define CEC1L_CR3 0x08
+#define CEC1L_CR2 0x04
+#define CEC1L_CR1 0x02
+#define CEC1L_CR0 0x01
+
+#define CEC1H_CR15 0x80
+#define CEC1H_CR14 0x40
+#define CEC1H_CR13 0x20
+#define CEC1H_CR12 0x10
+#define CEC1H_CR11 0x08
+#define CEC1H_CR10 0x04
+#define CEC1H_CR9 0x02
+#define CEC1H_CR8 0x01
+
+#define CEC2L_CR7 0x80
+#define CEC2L_CR6 0x40
+#define CEC2L_CR5 0x20
+#define CEC2L_CR4 0x10
+#define CEC2L_CR3 0x08
+#define CEC2L_CR2 0x04
+#define CEC2L_CR1 0x02
+#define CEC2L_CR0 0x01
+
+#define CEC2H_CR15 0x80
+#define CEC2H_CR14 0x40
+#define CEC2H_CR13 0x20
+#define CEC2H_CR12 0x10
+#define CEC2H_CR11 0x08
+#define CEC2H_CR10 0x04
+#define CEC2H_CR9 0x02
+#define CEC2H_CR8 0x01
+
+#define CEC3L_CR7 0x80
+#define CEC3L_CR6 0x40
+#define CEC3L_CR5 0x20
+#define CEC3L_CR4 0x10
+#define CEC3L_CR3 0x08
+#define CEC3L_CR2 0x04
+#define CEC3L_CR1 0x02
+#define CEC3L_CR0 0x01
+
+#define CEC3H_CR15 0x80
+#define CEC3H_CR14 0x40
+#define CEC3H_CR13 0x20
+#define CEC3H_CR12 0x10
+#define CEC3H_CR11 0x08
+#define CEC3H_CR10 0x04
+#define CEC3H_CR9 0x02
+#define CEC3H_CR8 0x01
+
+
+/* CECL (CRC Error Counter)
+
+ ------------------ T1 ----------------------------- */
+
+#define CECL_CR7 0x80
+#define CECL_CR6 0x40
+#define CECL_CR5 0x20
+#define CECL_CR4 0x10
+#define CECL_CR3 0x08
+#define CECL_CR2 0x04
+#define CECL_CR1 0x02
+#define CECL_CR0 0x01
+
+#define CECH_CR15 0x80
+#define CECH_CR14 0x40
+#define CECH_CR13 0x20
+#define CECH_CR12 0x10
+#define CECH_CR11 0x08
+#define CECH_CR10 0x04
+#define CECH_CR9 0x02
+#define CECH_CR8 0x01
+
+/* EBCL (E Bit Error Counter)
+ ------------------- E1 & T1 ------------------------- */
+
+#define EBCL_EB7 0x80
+#define EBCL_EB6 0x40
+#define EBCL_EB5 0x20
+#define EBCL_EB4 0x10
+#define EBCL_EB3 0x08
+#define EBCL_EB2 0x04
+#define EBCL_EB1 0x02
+#define EBCL_EB0 0x01
+
+#define EBCH_EB15 0x80
+#define EBCH_EB14 0x40
+#define EBCH_EB13 0x20
+#define EBCH_EB12 0x10
+#define EBCH_EB11 0x08
+#define EBCH_EB10 0x04
+#define EBCH_EB9 0x02
+#define EBCH_EB8 0x01
+
+
+/* RSA4-8 (Receive Sa4-8-Bit Register)
+ -------------------- E1 --------------------------- */
+
+#define RSA4_RS47 0x80
+#define RSA4_RS46 0x40
+#define RSA4_RS45 0x20
+#define RSA4_RS44 0x10
+#define RSA4_RS43 0x08
+#define RSA4_RS42 0x04
+#define RSA4_RS41 0x02
+#define RSA4_RS40 0x01
+
+#define RSA5_RS57 0x80
+#define RSA5_RS56 0x40
+#define RSA5_RS55 0x20
+#define RSA5_RS54 0x10
+#define RSA5_RS53 0x08
+#define RSA5_RS52 0x04
+#define RSA5_RS51 0x02
+#define RSA5_RS50 0x01
+
+#define RSA6_RS67 0x80
+#define RSA6_RS66 0x40
+#define RSA6_RS65 0x20
+#define RSA6_RS64 0x10
+#define RSA6_RS63 0x08
+#define RSA6_RS62 0x04
+#define RSA6_RS61 0x02
+#define RSA6_RS60 0x01
+
+#define RSA7_RS77 0x80
+#define RSA7_RS76 0x40
+#define RSA7_RS75 0x20
+#define RSA7_RS74 0x10
+#define RSA7_RS73 0x08
+#define RSA7_RS72 0x04
+#define RSA7_RS71 0x02
+#define RSA7_RS70 0x01
+
+#define RSA8_RS87 0x80
+#define RSA8_RS86 0x40
+#define RSA8_RS85 0x20
+#define RSA8_RS84 0x10
+#define RSA8_RS83 0x08
+#define RSA8_RS82 0x04
+#define RSA8_RS81 0x02
+#define RSA8_RS80 0x01
+
+/* RSA6S (Receive Sa6 Bit Status Register)
+ ------------------------ T1 ------------------------- */
+
+#define RSA6S_SX 0x20
+#define RSA6S_SF 0x10
+#define RSA6S_SE 0x08
+#define RSA6S_SC 0x04
+#define RSA6S_SA 0x02
+#define RSA6S_S8 0x01
+
+
+/* RDL1-3 Receive DL-Bit Register1-3)
+ ------------------------ T1 ------------------------- */
+
+#define RDL1_RDL17 0x80
+#define RDL1_RDL16 0x40
+#define RDL1_RDL15 0x20
+#define RDL1_RDL14 0x10
+#define RDL1_RDL13 0x08
+#define RDL1_RDL12 0x04
+#define RDL1_RDL11 0x02
+#define RDL1_RDL10 0x01
+
+#define RDL2_RDL27 0x80
+#define RDL2_RDL26 0x40
+#define RDL2_RDL25 0x20
+#define RDL2_RDL24 0x10
+#define RDL2_RDL23 0x08
+#define RDL2_RDL22 0x04
+#define RDL2_RDL21 0x02
+#define RDL2_RDL20 0x01
+
+#define RDL3_RDL37 0x80
+#define RDL3_RDL36 0x40
+#define RDL3_RDL35 0x20
+#define RDL3_RDL34 0x10
+#define RDL3_RDL33 0x08
+#define RDL3_RDL32 0x04
+#define RDL3_RDL31 0x02
+#define RDL3_RDL30 0x01
+
+
+/* SIS (Signaling Status Register)
+
+ -------------------- E1 & T1 -------------------------- */
+
+#define SIS_XDOV 0x80
+#define SIS_XFW 0x40
+#define SIS_XREP 0x20
+#define SIS_RLI 0x08
+#define SIS_CEC 0x04
+#define SIS_BOM 0x01
+
+
+/* RSIS (Receive Signaling Status Register)
+
+ -------------------- E1 & T1 --------------------------- */
+
+#define RSIS_VFR 0x80
+#define RSIS_RDO 0x40
+#define RSIS_CRC16 0x20
+#define RSIS_RAB 0x10
+#define RSIS_HA1 0x08
+#define RSIS_HA0 0x04
+#define RSIS_HFR 0x02
+#define RSIS_LA 0x01
+
+
+/* RBCL/H (Receive Byte Count Low/High)
+
+ ------------------- E1 & T1 ----------------------- */
+
+#define RBCL_RBC7 0x80
+#define RBCL_RBC6 0x40
+#define RBCL_RBC5 0x20
+#define RBCL_RBC4 0x10
+#define RBCL_RBC3 0x08
+#define RBCL_RBC2 0x04
+#define RBCL_RBC1 0x02
+#define RBCL_RBC0 0x01
+
+#define RBCH_OV 0x10
+#define RBCH_RBC11 0x08
+#define RBCH_RBC10 0x04
+#define RBCH_RBC9 0x02
+#define RBCH_RBC8 0x01
+
+
+/* ISR1-3 (Interrupt Status Register 1-3)
+
+ ------------------ E1 & T1 ------------------------------ */
+
+#define FISR0_RME 0x80
+#define FISR0_RFS 0x40
+#define FISR0_T8MS 0x20
+#define FISR0_ISF 0x20
+#define FISR0_RMB 0x10
+#define FISR0_CASC 0x08
+#define FISR0_RSC 0x08
+#define FISR0_CRC6 0x04
+#define FISR0_CRC4 0x04
+#define FISR0_PDEN 0x02
+#define FISR0_RPF 0x01
+
+#define FISR1_CASE 0x80
+#define FISR1_LLBSC 0x80
+#define FISR1_RDO 0x40
+#define FISR1_ALLS 0x20
+#define FISR1_XDU 0x10
+#define FISR1_XMB 0x08
+#define FISR1_XLSC 0x02
+#define FISR1_XPR 0x01
+
+#define FISR2_FAR 0x80
+#define FISR2_LFA 0x40
+#define FISR2_MFAR 0x20
+#define FISR2_T400MS 0x10
+#define FISR2_LMFA 0x10
+#define FISR2_AIS 0x08
+#define FISR2_LOS 0x04
+#define FISR2_RAR 0x02
+#define FISR2_RA 0x01
+
+#define FISR3_ES 0x80
+#define FISR3_SEC 0x40
+#define FISR3_LMFA16 0x20
+#define FISR3_AIS16 0x10
+#define FISR3_RA16 0x08
+#define FISR3_API 0x04
+#define FISR3_XSLP 0x20
+#define FISR3_XSLN 0x10
+#define FISR3_LLBSC 0x08
+#define FISR3_XRS 0x04
+#define FISR3_SLN 0x02
+#define FISR3_SLP 0x01
+
+
+/* GIS (Global Interrupt Status Register)
+
+ --------------------- E1 & T1 --------------------- */
+
+#define GIS_ISR3 0x08
+#define GIS_ISR2 0x04
+#define GIS_ISR1 0x02
+#define GIS_ISR0 0x01
+
+
+/* VSTR (Version Status Register)
+
+ --------------------- E1 & T1 --------------------- */
+
+#define VSTR_VN3 0x08
+#define VSTR_VN2 0x04
+#define VSTR_VN1 0x02
+#define VSTR_VN0 0x01
+
+
+/*>>>>>>>>>>>>>>>>>>>>> Local Control Structures <<<<<<<<<<<<<<<<<<<<<<<<< */
+
+/* Write-only Registers (E1/T1 control mode write registers) */
+#define XFIFOH 0x00 /* Tx FIFO High Byte */
+#define XFIFOL 0x01 /* Tx FIFO Low Byte */
+#define CMDR 0x02 /* Command Reg */
+#define DEC 0x60 /* Disable Error Counter */
+#define TEST2 0x62 /* Manuf. Test Reg 2 */
+#define XS(nbr) (0x70 + (nbr)) /* Tx CAS Reg (0 to 15) */
+
+/* Read-write Registers (E1/T1 status mode read registers) */
+#define MODE 0x03 /* Mode Reg */
+#define RAH1 0x04 /* Receive Address High 1 */
+#define RAH2 0x05 /* Receive Address High 2 */
+#define RAL1 0x06 /* Receive Address Low 1 */
+#define RAL2 0x07 /* Receive Address Low 2 */
+#define IPC 0x08 /* Interrupt Port Configuration */
+#define CCR1 0x09 /* Common Configuration Reg 1 */
+#define CCR3 0x0A /* Common Configuration Reg 3 */
+#define PRE 0x0B /* Preamble Reg */
+#define RTR1 0x0C /* Receive Timeslot Reg 1 */
+#define RTR2 0x0D /* Receive Timeslot Reg 2 */
+#define RTR3 0x0E /* Receive Timeslot Reg 3 */
+#define RTR4 0x0F /* Receive Timeslot Reg 4 */
+#define TTR1 0x10 /* Transmit Timeslot Reg 1 */
+#define TTR2 0x11 /* Transmit Timeslot Reg 2 */
+#define TTR3 0x12 /* Transmit Timeslot Reg 3 */
+#define TTR4 0x13 /* Transmit Timeslot Reg 4 */
+#define IMR0 0x14 /* Interrupt Mask Reg 0 */
+#define IMR1 0x15 /* Interrupt Mask Reg 1 */
+#define IMR2 0x16 /* Interrupt Mask Reg 2 */
+#define IMR3 0x17 /* Interrupt Mask Reg 3 */
+#define IMR4 0x18 /* Interrupt Mask Reg 4 */
+#define IMR5 0x19 /* Interrupt Mask Reg 5 */
+#define FMR0 0x1A /* Framer Mode Reigster 0 */
+#define FMR1 0x1B /* Framer Mode Reigster 1 */
+#define FMR2 0x1C /* Framer Mode Reigster 2 */
+#define LOOP 0x1D /* Channel Loop Back */
+#define XSW 0x1E /* Transmit Service Word */
+#define FMR4 0x1E /* Framer Mode Reg 4 */
+#define XSP 0x1F /* Transmit Spare Bits */
+#define FMR5 0x1F /* Framer Mode Reg 5 */
+#define XC0 0x20 /* Transmit Control 0 */
+#define XC1 0x21 /* Transmit Control 1 */
+#define RC0 0x22 /* Receive Control 0 */
+#define RC1 0x23 /* Receive Control 1 */
+#define XPM0 0x24 /* Transmit Pulse Mask 0 */
+#define XPM1 0x25 /* Transmit Pulse Mask 1 */
+#define XPM2 0x26 /* Transmit Pulse Mask 2 */
+#define TSWM 0x27 /* Transparent Service Word Mask */
+#define TEST1 0x28 /* Manuf. Test Reg 1 */
+#define IDLE 0x29 /* Idle Channel Code */
+#define XSA4 0x2A /* Transmit SA4 Bit Reg */
+#define XDL1 0x2A /* Transmit DL-Bit Reg 2 */
+#define XSA5 0x2B /* Transmit SA4 Bit Reg */
+#define XDL2 0x2B /* Transmit DL-Bit Reg 2 */
+#define XSA6 0x2C /* Transmit SA4 Bit Reg */
+#define XDL3 0x2C /* Transmit DL-Bit Reg 2 */
+#define XSA7 0x2D /* Transmit SA4 Bit Reg */
+#define CCB1 0x2D /* Clear Channel Reg 1 */
+#define XSA8 0x2E /* Transmit SA4 Bit Reg */
+#define CCB2 0x2E /* Clear Channel Reg 2 */
+#define FMR3 0x2F /* Framer Mode Reg. 3 */
+#define CCB3 0x2F /* Clear Channel Reg 3 */
+#define ICB1 0x30 /* Idle Channel Reg 1 */
+#define ICB2 0x31 /* Idle Channel Reg 2 */
+#define ICB3 0x32 /* Idle Channel Reg 3 */
+#define ICB4 0x33 /* Idle Channel Reg 4 */
+#define LIM0 0x34 /* Line Interface Mode 0 */
+#define LIM1 0x35 /* Line Interface Mode 1 */
+#define PCDR 0x36 /* Pulse Count Detection */
+#define PCRR 0x37 /* Pulse Count Recovery */
+#define LIM2 0x38 /* Line Interface Mode Reg 2 */
+#define LCR1 0x39 /* Loop Code Reg 1 */
+#define LCR2 0x3A /* Loop Code Reg 2 */
+#define LCR3 0x3B /* Loop Code Reg 3 */
+#define SIC1 0x3C /* System Interface Control 1 */
+
+/* Read-only Registers (E1/T1 control mode read registers) */
+#define RFIFOH 0x00 /* Receive FIFO */
+#define RFIFOL 0x01 /* Receive FIFO */
+#define FRS0 0x4C /* Framer Receive Status 0 */
+#define FRS1 0x4D /* Framer Receive Status 1 */
+#define RSW 0x4E /* Receive Service Word */
+#define FRS2 0x4E /* Framer Receive Status 2 */
+#define RSP 0x4F /* Receive Spare Bits */
+#define FRS3 0x4F /* Framer Receive Status 3 */
+#define FECL 0x50 /* Framing Error Counter */
+#define FECH 0x51 /* Framing Error Counter */
+#define CVCL 0x52 /* Code Violation Counter */
+#define CVCH 0x53 /* Code Violation Counter */
+#define CECL 0x54 /* CRC Error Counter 1 */
+#define CECH 0x55 /* CRC Error Counter 1 */
+#define EBCL 0x56 /* E-Bit Error Counter */
+#define EBCH 0x57 /* E-Bit Error Counter */
+#define BECL 0x58 /* Bit Error Counter Low */
+#define BECH 0x59 /* Bit Error Counter Low */
+#define CEC3 0x5A /* CRC Error Counter 3 (16-bit) */
+#define RSA4 0x5C /* Receive SA4 Bit Reg */
+#define RDL1 0x5C /* Receive DL-Bit Reg 1 */
+#define RSA5 0x5D /* Receive SA5 Bit Reg */
+#define RDL2 0x5D /* Receive DL-Bit Reg 2 */
+#define RSA6 0x5E /* Receive SA6 Bit Reg */
+#define RDL3 0x5E /* Receive DL-Bit Reg 3 */
+#define RSA7 0x5F /* Receive SA7 Bit Reg */
+#define RSA8 0x60 /* Receive SA8 Bit Reg */
+#define RSA6S 0x61 /* Receive SA6 Bit Status Reg */
+#define TSR0 0x62 /* Manuf. Test Reg 0 */
+#define TSR1 0x63 /* Manuf. Test Reg 1 */
+#define SIS 0x64 /* Signaling Status Reg */
+#define RSIS 0x65 /* Receive Signaling Status Reg */
+#define RBCL 0x66 /* Receive Byte Control */
+#define RBCH 0x67 /* Receive Byte Control */
+#define FISR0 0x68 /* Interrupt Status Reg 0 */
+#define FISR1 0x69 /* Interrupt Status Reg 1 */
+#define FISR2 0x6A /* Interrupt Status Reg 2 */
+#define FISR3 0x6B /* Interrupt Status Reg 3 */
+#define GIS 0x6E /* Global Interrupt Status */
+#define VSTR 0x6F /* Version Status */
+#define RS(nbr) (0x70 + (nbr)) /* Rx CAS Reg (0 to 15) */
+
+#endif /* _FALC_LH_H */
+
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/hd64572.h linux.20p6/drivers/net/hd64572.h
--- linux.vanilla/drivers/net/hd64572.h Thu Jan 1 01:00:00 1970
+++ linux.20p6/drivers/net/hd64572.h Fri May 4 23:05:08 2001
@@ -0,0 +1,437 @@
+/*
+ * hd64572.h Description of the Hitachi HD64572 (SCA-II), valid for
+ * CPU modes 0 & 2.
+ *
+ * Author: Ivan Passos
+ *
+ * Copyright: (c) 2000-2001 Cyclades Corp.
+ *
+ * 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.
+ *
+ * $Log: hd64572.h,v $
+ * Revision 1.0 2000/01/25 ivan
+ * Initial version.
+ *
+ */
+
+#ifndef _HD64572_H
+#define _HD64572_H
+
+/* Illegal Access Register */
+#define ILAR 0x00
+
+/* Wait Controller Registers */
+#define PABR0L 0x20 /* Physical Addr Boundary Register 0 L */
+#define PABR0H 0x21 /* Physical Addr Boundary Register 0 H */
+#define PABR1L 0x22 /* Physical Addr Boundary Register 1 L */
+#define PABR1H 0x23 /* Physical Addr Boundary Register 1 H */
+#define WCRL 0x24 /* Wait Control Register L */
+#define WCRM 0x25 /* Wait Control Register M */
+#define WCRH 0x26 /* Wait Control Register H */
+
+/* Interrupt Registers */
+#define IVR 0x60 /* Interrupt Vector Register */
+#define IMVR 0x64 /* Interrupt Modified Vector Register */
+#define ITCR 0x68 /* Interrupt Control Register */
+#define ISR0 0x6c /* Interrupt Status Register 0 */
+#define ISR1 0x70 /* Interrupt Status Register 1 */
+#define IER0 0x74 /* Interrupt Enable Register 0 */
+#define IER1 0x78 /* Interrupt Enable Register 1 */
+
+/* Register Access Macros (chan is 0 or 1 in _any_ case) */
+#define M_REG(reg, chan) (reg + 0x80*chan) /* MSCI */
+#define DRX_REG(reg, chan) (reg + 0x40*chan) /* DMA Rx */
+#define DTX_REG(reg, chan) (reg + 0x20*(2*chan + 1)) /* DMA Tx */
+#define TRX_REG(reg, chan) (reg + 0x20*chan) /* Timer Rx */
+#define TTX_REG(reg, chan) (reg + 0x10*(2*chan + 1)) /* Timer Tx */
+#define ST_REG(reg, chan) (reg + 0x80*chan) /* Status Cnt */
+#define IR0_DRX(val, chan) ((val)<<(8*(chan))) /* Int DMA Rx */
+#define IR0_DTX(val, chan) ((val)<<(4*(2*chan + 1))) /* Int DMA Tx */
+#define IR0_M(val, chan) ((val)<<(8*(chan))) /* Int MSCI */
+
+/* MSCI Channel Registers */
+#define MD0 0x138 /* Mode reg 0 */
+#define MD1 0x139 /* Mode reg 1 */
+#define MD2 0x13a /* Mode reg 2 */
+#define MD3 0x13b /* Mode reg 3 */
+#define CTL 0x130 /* Control reg */
+#define RXS 0x13c /* RX clock source */
+#define TXS 0x13d /* TX clock source */
+#define EXS 0x13e /* External clock input selection */
+#define TMCT 0x144 /* Time constant (Tx) */
+#define TMCR 0x145 /* Time constant (Rx) */
+#define CMD 0x128 /* Command reg */
+#define ST0 0x118 /* Status reg 0 */
+#define ST1 0x119 /* Status reg 1 */
+#define ST2 0x11a /* Status reg 2 */
+#define ST3 0x11b /* Status reg 3 */
+#define ST4 0x11c /* Status reg 4 */
+#define FST 0x11d /* frame Status reg */
+#define IE0 0x120 /* Interrupt enable reg 0 */
+#define IE1 0x121 /* Interrupt enable reg 1 */
+#define IE2 0x122 /* Interrupt enable reg 2 */
+#define IE4 0x124 /* Interrupt enable reg 4 */
+#define FIE 0x125 /* Frame Interrupt enable reg */
+#define SA0 0x140 /* Syn Address reg 0 */
+#define SA1 0x141 /* Syn Address reg 1 */
+#define IDL 0x142 /* Idle register */
+#define TRBL 0x100 /* TX/RX buffer reg L */
+#define TRBK 0x101 /* TX/RX buffer reg K */
+#define TRBJ 0x102 /* TX/RX buffer reg J */
+#define TRBH 0x103 /* TX/RX buffer reg H */
+#define TRC0 0x148 /* TX Ready control reg 0 */
+#define TRC1 0x149 /* TX Ready control reg 1 */
+#define RRC 0x14a /* RX Ready control reg */
+#define CST0 0x108 /* Current Status Register 0 */
+#define CST1 0x109 /* Current Status Register 1 */
+#define CST2 0x10a /* Current Status Register 2 */
+#define CST3 0x10b /* Current Status Register 3 */
+#define GPO 0x131 /* General Purpose Output Pin Ctl Reg */
+#define TFS 0x14b /* Tx Start Threshold Ctl Reg */
+#define TFN 0x143 /* Inter-transmit-frame Time Fill Ctl Reg */
+#define TBN 0x110 /* Tx Buffer Number Reg */
+#define RBN 0x111 /* Rx Buffer Number Reg */
+#define TNR0 0x150 /* Tx DMA Request Ctl Reg 0 */
+#define TNR1 0x151 /* Tx DMA Request Ctl Reg 1 */
+#define TCR 0x152 /* Tx DMA Critical Request Reg */
+#define RNR 0x154 /* Rx DMA Request Ctl Reg */
+#define RCR 0x156 /* Rx DMA Critical Request Reg */
+
+/* Timer Registers */
+#define TCNTL 0x200 /* Timer Upcounter L */
+#define TCNTH 0x201 /* Timer Upcounter H */
+#define TCONRL 0x204 /* Timer Constant Register L */
+#define TCONRH 0x205 /* Timer Constant Register H */
+#define TCSR 0x206 /* Timer Control/Status Register */
+#define TEPR 0x207 /* Timer Expand Prescale Register */
+
+/* DMA registers */
+#define PCR 0x40 /* DMA priority control reg */
+#define DRR 0x44 /* DMA reset reg */
+#define DMER 0x07 /* DMA Master Enable reg */
+#define BTCR 0x08 /* Burst Tx Ctl Reg */
+#define BOLR 0x0c /* Back-off Length Reg */
+#define DSR_RX(chan) (0x48 + 2*chan) /* DMA Status Reg (Rx) */
+#define DSR_TX(chan) (0x49 + 2*chan) /* DMA Status Reg (Tx) */
+#define DIR_RX(chan) (0x4c + 2*chan) /* DMA Interrupt Enable Reg (Rx) */
+#define DIR_TX(chan) (0x4d + 2*chan) /* DMA Interrupt Enable Reg (Tx) */
+#define FCT_RX(chan) (0x50 + 2*chan) /* Frame End Interrupt Counter (Rx) */
+#define FCT_TX(chan) (0x51 + 2*chan) /* Frame End Interrupt Counter (Tx) */
+#define DMR_RX(chan) (0x54 + 2*chan) /* DMA Mode Reg (Rx) */
+#define DMR_TX(chan) (0x55 + 2*chan) /* DMA Mode Reg (Tx) */
+#define DCR_RX(chan) (0x58 + 2*chan) /* DMA Command Reg (Rx) */
+#define DCR_TX(chan) (0x59 + 2*chan) /* DMA Command Reg (Tx) */
+
+/* DMA Channel Registers */
+#define DARL 0x80 /* Dest Addr Register L (single-block, RX only) */
+#define DARH 0x81 /* Dest Addr Register H (single-block, RX only) */
+#define DARB 0x82 /* Dest Addr Register B (single-block, RX only) */
+#define DARBH 0x83 /* Dest Addr Register BH (single-block, RX only) */
+#define SARL 0x80 /* Source Addr Register L (single-block, TX only) */
+#define SARH 0x81 /* Source Addr Register H (single-block, TX only) */
+#define SARB 0x82 /* Source Addr Register B (single-block, TX only) */
+#define DARBH 0x83 /* Source Addr Register BH (single-block, TX only) */
+#define BARL 0x80 /* Buffer Addr Register L (chained-block) */
+#define BARH 0x81 /* Buffer Addr Register H (chained-block) */
+#define BARB 0x82 /* Buffer Addr Register B (chained-block) */
+#define BARBH 0x83 /* Buffer Addr Register BH (chained-block) */
+#define CDAL 0x84 /* Current Descriptor Addr Register L */
+#define CDAH 0x85 /* Current Descriptor Addr Register H */
+#define CDAB 0x86 /* Current Descriptor Addr Register B */
+#define CDABH 0x87 /* Current Descriptor Addr Register BH */
+#define EDAL 0x88 /* Error Descriptor Addr Register L */
+#define EDAH 0x89 /* Error Descriptor Addr Register H */
+#define EDAB 0x8a /* Error Descriptor Addr Register B */
+#define EDABH 0x8b /* Error Descriptor Addr Register BH */
+#define BFLL 0x90 /* RX Buffer Length L (only RX) */
+#define BFLH 0x91 /* RX Buffer Length H (only RX) */
+#define BCRL 0x8c /* Byte Count Register L */
+#define BCRH 0x8d /* Byte Count Register H */
+
+/* Block Descriptor Structure */
+typedef struct {
+ unsigned long next; /* pointer to next block descriptor */
+ unsigned long ptbuf; /* buffer pointer */
+ unsigned short len; /* data length */
+ unsigned char status; /* status */
+ unsigned char filler[5]; /* alignment filler (16 bytes) */
+} pcsca_bd_t;
+
+/*
+ Descriptor Status definitions:
+
+ Bit Transmission Reception
+
+ 7 EOM EOM
+ 6 - Short Frame
+ 5 - Abort
+ 4 - Residual bit
+ 3 Underrun Overrun
+ 2 - CRC
+ 1 Ownership Ownership
+ 0 EOT -
+*/
+#define DST_EOT 0x01 /* End of transmit command */
+#define DST_OSB 0x02 /* Ownership bit */
+#define DST_CRC 0x04 /* CRC Error */
+#define DST_OVR 0x08 /* Overrun */
+#define DST_UDR 0x08 /* Underrun */
+#define DST_RBIT 0x10 /* Residual bit */
+#define DST_ABT 0x20 /* Abort */
+#define DST_SHRT 0x40 /* Short Frame */
+#define DST_EOM 0x80 /* End of Message */
+
+/* Status Counter Registers */
+#define CMCR 0x158 /* Counter Master Ctl Reg */
+#define TECNTL 0x160 /* Tx EOM Counter L */
+#define TECNTM 0x161 /* Tx EOM Counter M */
+#define TECNTH 0x162 /* Tx EOM Counter H */
+#define TECCR 0x163 /* Tx EOM Counter Ctl Reg */
+#define URCNTL 0x164 /* Underrun Counter L */
+#define URCNTH 0x165 /* Underrun Counter H */
+#define URCCR 0x167 /* Underrun Counter Ctl Reg */
+#define RECNTL 0x168 /* Rx EOM Counter L */
+#define RECNTM 0x169 /* Rx EOM Counter M */
+#define RECNTH 0x16a /* Rx EOM Counter H */
+#define RECCR 0x16b /* Rx EOM Counter Ctl Reg */
+#define ORCNTL 0x16c /* Overrun Counter L */
+#define ORCNTH 0x16d /* Overrun Counter H */
+#define ORCCR 0x16f /* Overrun Counter Ctl Reg */
+#define CECNTL 0x170 /* CRC Counter L */
+#define CECNTH 0x171 /* CRC Counter H */
+#define CECCR 0x173 /* CRC Counter Ctl Reg */
+#define ABCNTL 0x174 /* Abort frame Counter L */
+#define ABCNTH 0x175 /* Abort frame Counter H */
+#define ABCCR 0x177 /* Abort frame Counter Ctl Reg */
+#define SHCNTL 0x178 /* Short frame Counter L */
+#define SHCNTH 0x179 /* Short frame Counter H */
+#define SHCCR 0x17b /* Short frame Counter Ctl Reg */
+#define RSCNTL 0x17c /* Residual bit Counter L */
+#define RSCNTH 0x17d /* Residual bit Counter H */
+#define RSCCR 0x17f /* Residual bit Counter Ctl Reg */
+
+/* Register Programming Constants */
+
+#define IR0_DMIC 0x00000001
+#define IR0_DMIB 0x00000002
+#define IR0_DMIA 0x00000004
+#define IR0_EFT 0x00000008
+#define IR0_DMAREQ 0x00010000
+#define IR0_TXINT 0x00020000
+#define IR0_RXINTB 0x00040000
+#define IR0_RXINTA 0x00080000
+#define IR0_TXRDY 0x00100000
+#define IR0_RXRDY 0x00200000
+
+#define MD0_CRC16_0 0x00
+#define MD0_CRC16_1 0x01
+#define MD0_CRC32 0x02
+#define MD0_CRC_CCITT 0x03
+#define MD0_CRCC0 0x04
+#define MD0_CRCC1 0x08
+#define MD0_AUTO_ENA 0x10
+#define MD0_ASYNC 0x00
+#define MD0_BY_MSYNC 0x20
+#define MD0_BY_BISYNC 0x40
+#define MD0_BY_EXT 0x60
+#define MD0_BIT_SYNC 0x80
+#define MD0_TRANSP 0xc0
+
+#define MD1_NOADDR 0x00
+#define MD1_SADDR1 0x40
+#define MD1_SADDR2 0x80
+#define MD1_DADDR 0xc0
+
+#define MD2_F_DUPLEX 0x00
+#define MD2_AUTO_ECHO 0x01
+#define MD2_LOOP_HI_Z 0x02
+#define MD2_LOOP_MIR 0x03
+#define MD2_ADPLL_X8 0x00
+#define MD2_ADPLL_X16 0x08
+#define MD2_ADPLL_X32 0x10
+#define MD2_NRZ 0x00
+#define MD2_NRZI 0x20
+#define MD2_NRZ_IEEE 0x40
+#define MD2_MANCH 0x00
+#define MD2_FM1 0x20
+#define MD2_FM0 0x40
+#define MD2_FM 0x80
+
+#define CTL_RTS 0x01
+#define CTL_DTR 0x02
+#define CTL_SYN 0x04
+#define CTL_IDLC 0x10
+#define CTL_UDRNC 0x20
+#define CTL_URSKP 0x40
+#define CTL_URCT 0x80
+
+#define RXS_BR0 0x01
+#define RXS_BR1 0x02
+#define RXS_BR2 0x04
+#define RXS_BR3 0x08
+#define RXS_ECLK 0x00
+#define RXS_ECLK_NS 0x20
+#define RXS_IBRG 0x40
+#define RXS_PLL1 0x50
+#define RXS_PLL2 0x60
+#define RXS_PLL3 0x70
+#define RXS_DRTXC 0x80
+
+#define TXS_BR0 0x01
+#define TXS_BR1 0x02
+#define TXS_BR2 0x04
+#define TXS_BR3 0x08
+#define TXS_ECLK 0x00
+#define TXS_IBRG 0x40
+#define TXS_RCLK 0x60
+#define TXS_DTRXC 0x80
+
+#define EXS_RES0 0x01
+#define EXS_RES1 0x02
+#define EXS_RES2 0x04
+#define EXS_TES0 0x10
+#define EXS_TES1 0x20
+#define EXS_TES2 0x40
+
+#define CMD_RX_RST 0x11
+#define CMD_RX_ENA 0x12
+#define CMD_RX_DIS 0x13
+#define CMD_RX_CRC_INIT 0x14
+#define CMD_RX_MSG_REJ 0x15
+#define CMD_RX_MP_SRCH 0x16
+#define CMD_RX_CRC_EXC 0x17
+#define CMD_RX_CRC_FRC 0x18
+#define CMD_TX_RST 0x01
+#define CMD_TX_ENA 0x02
+#define CMD_TX_DISA 0x03
+#define CMD_TX_CRC_INIT 0x04
+#define CMD_TX_CRC_EXC 0x05
+#define CMD_TX_EOM 0x06
+#define CMD_TX_ABORT 0x07
+#define CMD_TX_MP_ON 0x08
+#define CMD_TX_BUF_CLR 0x09
+#define CMD_TX_DISB 0x0b
+#define CMD_CH_RST 0x21
+#define CMD_SRCH_MODE 0x31
+#define CMD_NOP 0x00
+
+#define ST0_RXRDY 0x01
+#define ST0_TXRDY 0x02
+#define ST0_RXINTB 0x20
+#define ST0_RXINTA 0x40
+#define ST0_TXINT 0x80
+
+#define ST1_IDLE 0x01
+#define ST1_ABORT 0x02
+#define ST1_CDCD 0x04
+#define ST1_CCTS 0x08
+#define ST1_SYN_FLAG 0x10
+#define ST1_CLMD 0x20
+#define ST1_TXIDLE 0x40
+#define ST1_UDRN 0x80
+
+#define ST2_CRCE 0x04
+#define ST2_ONRN 0x08
+#define ST2_RBIT 0x10
+#define ST2_ABORT 0x20
+#define ST2_SHORT 0x40
+#define ST2_EOM 0x80
+
+#define ST3_RX_ENA 0x01
+#define ST3_TX_ENA 0x02
+#define ST3_DCD 0x04
+#define ST3_CTS 0x08
+#define ST3_SRCH_MODE 0x10
+#define ST3_SLOOP 0x20
+#define ST3_GPI 0x80
+
+#define ST4_RDNR 0x01
+#define ST4_RDCR 0x02
+#define ST4_TDNR 0x04
+#define ST4_TDCR 0x08
+#define ST4_OCLM 0x20
+#define ST4_CFT 0x40
+#define ST4_CGPI 0x80
+
+#define FST_CRCEF 0x04
+#define FST_OVRNF 0x08
+#define FST_RBIF 0x10
+#define FST_ABTF 0x20
+#define FST_SHRTF 0x40
+#define FST_EOMF 0x80
+
+#define IE0_RXRDY 0x01
+#define IE0_TXRDY 0x02
+#define IE0_RXINTB 0x20
+#define IE0_RXINTA 0x40
+#define IE0_TXINT 0x80
+
+#define IE1_IDLD 0x01
+#define IE1_ABTD 0x02
+#define IE1_CDCD 0x04
+#define IE1_CCTS 0x08
+#define IE1_SYNCD 0x10
+#define IE1_CLMD 0x20
+#define IE1_IDL 0x40
+#define IE1_UDRN 0x80
+
+#define IE2_CRCE 0x04
+#define IE2_OVRN 0x08
+#define IE2_RBIT 0x10
+#define IE2_ABT 0x20
+#define IE2_SHRT 0x40
+#define IE2_EOM 0x80
+
+#define IE4_RDNR 0x01
+#define IE4_RDCR 0x02
+#define IE4_TDNR 0x04
+#define IE4_TDCR 0x08
+#define IE4_OCLM 0x20
+#define IE4_CFT 0x40
+#define IE4_CGPI 0x80
+
+#define FIE_CRCEF 0x04
+#define FIE_OVRNF 0x08
+#define FIE_RBIF 0x10
+#define FIE_ABTF 0x20
+#define FIE_SHRTF 0x40
+#define FIE_EOMF 0x80
+
+#define DSR_DWE 0x01
+#define DSR_DE 0x02
+#define DSR_REF 0x04
+#define DSR_UDRF 0x04
+#define DSR_COA 0x08
+#define DSR_COF 0x10
+#define DSR_BOF 0x20
+#define DSR_EOM 0x40
+#define DSR_EOT 0x80
+
+#define DIR_REF 0x04
+#define DIR_UDRF 0x04
+#define DIR_COA 0x08
+#define DIR_COF 0x10
+#define DIR_BOF 0x20
+#define DIR_EOM 0x40
+#define DIR_EOT 0x80
+
+#define DMR_CNTE 0x02
+#define DMR_NF 0x04
+#define DMR_SEOME 0x08
+#define DMR_TMOD 0x10
+
+#define DCR_SW_ABT 0x01
+#define DCR_FCT_CLR 0x02
+
+#define PCR_PR0 0x01
+#define PCR_PR1 0x02
+#define PCR_PR2 0x04
+#define PCR_CCC 0x08
+#define PCR_BRC 0x10
+#define PCR_OSB 0x40
+#define PCR_BURST 0x80
+
+#endif /* (_HD64572_H) */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/macmace.c linux.20p6/drivers/net/macmace.c
--- linux.vanilla/drivers/net/macmace.c Sun Mar 25 17:31:23 2001
+++ linux.20p6/drivers/net/macmace.c Tue Jun 19 09:59:54 2001
@@ -607,7 +607,7 @@
}
/*
- * A transmit error has occured. (We kick the transmit side from
+ * A transmit error has occurred. (We kick the transmit side from
* the DMA completion)
*/
@@ -636,7 +636,7 @@
}
/*
- * A receive interrupt occured.
+ * A receive interrupt occurred.
*/
static void mace68k_recv_interrupt(struct device *dev)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/net_init.c linux.20p6/drivers/net/net_init.c
--- linux.vanilla/drivers/net/net_init.c Sun Mar 25 17:31:16 2001
+++ linux.20p6/drivers/net/net_init.c Tue Jun 19 09:59:54 2001
@@ -292,8 +292,8 @@
void ether_setup(struct device *dev)
{
int i;
- /* Fill in the fields of the device structure with ethernet-generic values.
- This should be in a common file instead of per-driver. */
+ /* Fill in the fields of the device structure with
+ ethernet-generic values. */
/* register boot-defined "eth" devices */
if (dev->name && (strncmp(dev->name, "eth", 3) == 0)) {
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/ni52.c linux.20p6/drivers/net/ni52.c
--- linux.vanilla/drivers/net/ni52.c Sun Mar 25 17:31:16 2001
+++ linux.20p6/drivers/net/ni52.c Tue Jun 19 09:59:54 2001
@@ -33,20 +33,20 @@
* I have also done a look in the following sources: (mail me if you need them)
* crynwr-packet-driver by Russ Nelson
* Garret A. Wollman's (fourth) i82586-driver for BSD
- * (before getting an i82596 (yes 596 not 586) manual, the existing drivers helped
- * me a lot to understand this tricky chip.)
+ * (before getting an i82596 (yes 596 not 586) manual, the existing drivers
+ * helped me a lot to understand this tricky chip.)
*
* Known Problems:
* The internal sysbus seems to be slow. So we often lose packets because of
* overruns while receiving from a fast remote host.
- * This can slow down TCP connections. Maybe the newer ni5210 cards are better.
- * my experience is, that if a machine sends with more then about 500-600K/s
- * the fifo/sysbus overflows.
+ * This can slow down TCP connections. Maybe the newer ni5210 cards are
+ * better. My experience is, that if a machine sends with more than
+ * about 500-600K/s the fifo/sysbus overflows.
*
* IMPORTANT NOTE:
* On fast networks, it's a (very) good idea to have 16K shared memory. With
- * 8K, we can store only 4 receive frames, so it can (easily) happen that a remote
- * machine 'overruns' our system.
+ * 8K, we can store only 4 receive frames, so it can (easily) happen that a
+ * remote machine 'overruns' our system.
*
* Known i82586/card problems (I'm sure, there are many more!):
* Running the NOP-mode, the i82586 sometimes seems to forget to report
@@ -60,7 +60,8 @@
*
* results from ftp performance tests with Linux 1.2.5
* send and receive about 350-400 KByte/s (peak up to 460 kbytes/s)
- * sending in NOP-mode: peak performance up to 530K/s (but better don't run this mode)
+ * sending in NOP-mode: peak performance up to 530K/s (but better
+ * don't run this mode)
*/
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/pc300.c linux.20p6/drivers/net/pc300.c
--- linux.vanilla/drivers/net/pc300.c Sun Mar 25 17:31:23 2001
+++ linux.20p6/drivers/net/pc300.c Fri May 4 23:05:08 2001
@@ -1,13 +1,13 @@
#define USE_PCI_CLOCK
static char rcsid[] =
-"$Revision: 3.1.0.2 $$Date: 2000/06/27 $";
+"$Revision: 3.1.0.6 $$Date: 2001/03/02 $";
/*
* pc300.c Cyclades-PC300(tm) Driver.
*
* Author: Ivan Passos
*
- * Copyright: (c) 1999-2000 Cyclades Corp.
+ * Copyright: (c) 1999-2001 Cyclades Corp.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -15,6 +15,23 @@
* 2 of the License, or (at your option) any later version.
*
* $Log: pc300.c,v $
+ * Revision 3.1.0.6 2001/03/02 daniela
+ * Changed SIOCGPC300CONF ioctl, to give hw information to pc300util.
+ *
+ * Revision 3.1.0.5 2001/02/23 daniela
+ * Fixed falc_check_status for Unframed E1.
+ *
+ * Revision 3.1.0.4 2000/12/22 daniela,ivan
+ * Added support for Unframed E1.
+ * Implemented pc300util support: trace, statistics, status and loopback
+ * tests for the PC300 TE boards.
+ * Implemented monitor mode.
+ * Fixed DCD sensitivity on the second channel.
+ *
+ * Revision 3.1.0.3 2000/09/28 daniela,ivan
+ * Implemented DCD sensitivity.
+ * Changed location of pc300.h .
+ *
* Revision 3.1.0.2 2000/06/27 ivan
* Previous bugfix for the framing errors with external clock made X21
* boards stop working. This version fixes it.
@@ -73,7 +90,7 @@
* Fixed bug in ch_config that would disable interrupts on a previously
* enabled channel if the other channel on the same board was enabled later.
*
- * Revision 0.3.0.0 1999/11/16 Daniela Squassoni
+ * Revision 0.3.0.0 1999/11/16 daniela
* X.25 support.
*
* Revision 0.2.3.0 1999/11/15 ivan
@@ -127,16 +144,14 @@
#include
#include
#include
+#include
#ifdef CONFIG_PC300_X25
#include
#endif /* CONFIG_PC300_X25 */
#include "syncppp.h"
-
-#include
-
-#include
+#include "pc300.h"
#define CPC_LOCK(card,flags) \
do { \
@@ -475,28 +490,36 @@
/* Enable SEC and ES interrupts */
cpc_writeb(falcbase + F_REG(IMR3, ch),
cpc_readb(falcbase + F_REG(IMR3, ch)) & ~(IMR3_SEC | IMR3_ES));
- cpc_writeb(falcbase + F_REG(IMR4, ch),
- cpc_readb(falcbase + F_REG(IMR4, ch)) &
- ~(IMR4_LFA | IMR4_AIS | IMR4_LOS | IMR4_SLIP));
+ if (conf->fr_mode == PC300_FR_UNFRAMED) {
+ cpc_writeb(falcbase + F_REG(IMR4, ch),
+ cpc_readb(falcbase + F_REG(IMR4, ch)) & ~(IMR4_LOS));
+ } else {
+ cpc_writeb(falcbase + F_REG(IMR4, ch),
+ cpc_readb(falcbase + F_REG(IMR4, ch)) &
+ ~(IMR4_LFA | IMR4_AIS | IMR4_LOS | IMR4_SLIP));
+ }
if (conf->media == LINE_T1) {
cpc_writeb(falcbase + F_REG(IMR3, ch),
cpc_readb(falcbase + F_REG(IMR3, ch)) & ~IMR3_LLBSC);
} else {
cpc_writeb(falcbase + F_REG(IPC, ch),
cpc_readb(falcbase + F_REG(IPC, ch)) | IPC_SCI);
- cpc_writeb(falcbase + F_REG(IMR2, ch),
- cpc_readb(falcbase + F_REG(IMR2, ch)) &
- ~(IMR2_FAR | IMR2_LFA | IMR2_AIS | IMR2_LOS));
- cpc_writeb(falcbase + F_REG(IMR1, ch),
- cpc_readb(falcbase + F_REG(IMR1, ch)) & ~IMR1_LLBSC);
- if (pfalc->multiframe_mode) {
- cpc_writeb(falcbase + F_REG(IMR2, ch),
- cpc_readb(falcbase + F_REG(IMR2, ch)) &
- ~(IMR2_T400MS | IMR2_MFAR));
+ if (conf->fr_mode == PC300_FR_UNFRAMED) {
+ cpc_writeb(falcbase + F_REG(IMR2, ch),
+ cpc_readb(falcbase + F_REG(IMR2, ch)) & ~(IMR2_LOS));
} else {
- cpc_writeb(falcbase + F_REG(IMR2, ch),
- cpc_readb(falcbase + F_REG(IMR2, ch)) |
- IMR2_T400MS | IMR2_MFAR);
+ cpc_writeb(falcbase + F_REG(IMR2, ch),
+ cpc_readb(falcbase + F_REG(IMR2, ch)) &
+ ~(IMR2_FAR | IMR2_LFA | IMR2_AIS | IMR2_LOS));
+ if (pfalc->multiframe_mode) {
+ cpc_writeb(falcbase + F_REG(IMR2, ch),
+ cpc_readb(falcbase + F_REG(IMR2, ch)) &
+ ~(IMR2_T400MS | IMR2_MFAR));
+ } else {
+ cpc_writeb(falcbase + F_REG(IMR2, ch),
+ cpc_readb(falcbase + F_REG(IMR2, ch)) |
+ IMR2_T400MS | IMR2_MFAR);
+ }
}
}
}
@@ -565,10 +588,15 @@
pc300chconf_t *conf = (pc300chconf_t *)&chan->conf;
uclong falcbase = card->hw.falcbase;
- /* Timeslot 0 is never enabled */
cpc_writeb(falcbase + F_REG(ICB1, ch), 0);
- cpc_writeb(falcbase + F_REG(TTR1, ch), 0x7f);
- cpc_writeb(falcbase + F_REG(RTR1, ch), 0x7f);
+ if (conf->fr_mode == PC300_FR_UNFRAMED) {
+ cpc_writeb(falcbase + F_REG(TTR1, ch), 0xff);
+ cpc_writeb(falcbase + F_REG(RTR1, ch), 0xff);
+ } else {
+ /* Timeslot 0 is never enabled */
+ cpc_writeb(falcbase + F_REG(TTR1, ch), 0x7f);
+ cpc_writeb(falcbase + F_REG(RTR1, ch), 0x7f);
+ }
cpc_writeb(falcbase + F_REG(ICB2, ch), 0);
cpc_writeb(falcbase + F_REG(TTR2, ch), 0xff);
cpc_writeb(falcbase + F_REG(RTR2, ch), 0xff);
@@ -617,9 +645,9 @@
falc_init_timeslot(card, ch);
}
// CTS/DCD ON
- cpc_writeb(card->hw.falcbase + CPLD_REG1,
- cpc_readb(card->hw.falcbase + CPLD_REG1) |
- ((CPLD_REG1_FALC_DCD | CPLD_REG1_FALC_CTS) << (2*ch)));
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg1,
+ cpc_readb(card->hw.falcbase + card->hw.cpld_reg1) &
+ ~((CPLD_REG1_FALC_DCD | CPLD_REG1_FALC_CTS) << (2*ch)));
}
void
@@ -632,9 +660,9 @@
falc_close_all_timeslots(card, ch);
}
// CTS/DCD OFF
- cpc_writeb(card->hw.falcbase + CPLD_REG1,
- cpc_readb(card->hw.falcbase + CPLD_REG1) &
- ~((CPLD_REG1_FALC_DCD | CPLD_REG1_FALC_CTS) << (2*ch)));
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg1,
+ cpc_readb(card->hw.falcbase + card->hw.cpld_reg1) |
+ ((CPLD_REG1_FALC_DCD | CPLD_REG1_FALC_CTS) << (2*ch)));
}
void
@@ -831,7 +859,7 @@
cpc_readb(falcbase + F_REG(LIM0, ch)) & ~LIM0_MAS);
}
cpc_writeb(falcbase + F_REG(LOOP, ch),
- cpc_readb(falcbase + F_REG(LOOP, ch)) & ~LOOP_RTM);
+ cpc_readb(falcbase + F_REG(LOOP, ch)) & ~LOOP_SFM);
cpc_writeb(falcbase + F_REG(IPC, ch), IPC_SCI);
cpc_writeb(falcbase + F_REG(FMR0, ch),
@@ -894,6 +922,19 @@
cpc_writeb(falcbase + F_REG(XSP, ch),
cpc_readb(falcbase + F_REG(XSP, ch)) |
XSP_XS13 | XSP_XS15);
+
+ /* Automatic Force Resynchronization */
+ cpc_writeb(falcbase + F_REG(FMR1, ch),
+ cpc_readb(falcbase + F_REG(FMR1, ch)) | FMR1_AFR);
+
+ /* Transmit Automatic Remote Alarm */
+ cpc_writeb(falcbase + F_REG(FMR2, ch),
+ cpc_readb(falcbase + F_REG(FMR2, ch)) | FMR2_AXRA);
+
+ /* Transmit Spare Bits for National Use (Y, Sn, Sa) */
+ cpc_writeb(falcbase + F_REG(XSW, ch),
+ cpc_readb(falcbase + F_REG(XSW, ch)) |
+ XSW_XY0 | XSW_XY1 | XSW_XY2 | XSW_XY3 | XSW_XY4);
break;
case PC300_FR_MF_NON_CRC4:
@@ -902,23 +943,53 @@
cpc_writeb(falcbase + F_REG(FMR1, ch),
cpc_readb(falcbase + F_REG(FMR1, ch)) & ~FMR1_XFS);
cpc_writeb(falcbase + F_REG(FMR2, ch),
- cpc_readb(falcbase + F_REG(FMR2, ch)) & ~FMR2_RFS1);
- cpc_writeb(falcbase + F_REG(FMR2, ch),
- cpc_readb(falcbase + F_REG(FMR2, ch)) & ~FMR2_RFS0);
+ cpc_readb(falcbase + F_REG(FMR2, ch)) &
+ ~(FMR2_RFS1|FMR2_RFS0));
cpc_writeb(falcbase + F_REG(XSW, ch),
cpc_readb(falcbase + F_REG(XSW, ch)) | XSW_XSIS);
cpc_writeb(falcbase + F_REG(XSP, ch),
cpc_readb(falcbase + F_REG(XSP, ch)) | XSP_XSIF);
- break;
- }
- /* Automatic Force Resynchronization */
- cpc_writeb(falcbase + F_REG(FMR1, ch),
- cpc_readb(falcbase + F_REG(FMR1, ch)) | FMR1_AFR);
+ /* Automatic Force Resynchronization */
+ cpc_writeb(falcbase + F_REG(FMR1, ch),
+ cpc_readb(falcbase + F_REG(FMR1, ch)) | FMR1_AFR);
- /* Transmit Automatic Remote Alarm */
- cpc_writeb(falcbase + F_REG(FMR2, ch),
- cpc_readb(falcbase + F_REG(FMR2, ch)) | FMR2_AXRA);
+ /* Transmit Automatic Remote Alarm */
+ cpc_writeb(falcbase + F_REG(FMR2, ch),
+ cpc_readb(falcbase + F_REG(FMR2, ch)) | FMR2_AXRA);
+
+ /* Transmit Spare Bits for National Use (Y, Sn, Sa) */
+ cpc_writeb(falcbase + F_REG(XSW, ch),
+ cpc_readb(falcbase + F_REG(XSW, ch)) |
+ XSW_XY0 | XSW_XY1 | XSW_XY2 | XSW_XY3 | XSW_XY4);
+ break;
+
+ case PC300_FR_UNFRAMED:
+ pfalc->multiframe_mode = 0;
+ cpc_writeb(falcbase + F_REG(FMR1, ch),
+ cpc_readb(falcbase + F_REG(FMR1, ch)) & ~FMR1_XFS);
+ cpc_writeb(falcbase + F_REG(FMR2, ch),
+ cpc_readb(falcbase + F_REG(FMR2, ch)) &
+ ~(FMR2_RFS1|FMR2_RFS0));
+ cpc_writeb(falcbase + F_REG(XSP, ch),
+ cpc_readb(falcbase + F_REG(XSP, ch)) | XSP_TT0);
+ cpc_writeb(falcbase + F_REG(XSW, ch),
+ cpc_readb(falcbase + F_REG(XSW, ch)) &
+ ~(XSW_XTM|XSW_XY0|XSW_XY1|XSW_XY2|XSW_XY3|XSW_XY4));
+ cpc_writeb(falcbase + F_REG(TSWM, ch), 0xff);
+ cpc_writeb(falcbase + F_REG(FMR2, ch),
+ cpc_readb(falcbase + F_REG(FMR2, ch)) |
+ (FMR2_RTM|FMR2_DAIS));
+ cpc_writeb(falcbase + F_REG(FMR2, ch),
+ cpc_readb(falcbase + F_REG(FMR2, ch)) & ~FMR2_AXRA);
+ cpc_writeb(falcbase + F_REG(FMR1, ch),
+ cpc_readb(falcbase + F_REG(FMR1, ch)) & ~FMR1_AFR);
+ pfalc->sync = 1;
+ cpc_writeb(falcbase + card->hw.cpld_reg2,
+ cpc_readb(falcbase + card->hw.cpld_reg2) |
+ (CPLD_REG2_FALC_LED2 << (2*ch)));
+ break;
+ }
/* No signaling */
cpc_writeb(falcbase + F_REG(XSP, ch),
@@ -944,11 +1015,6 @@
/* LOS Recovery after 22 ones in the time window of PCD */
cpc_writeb(falcbase + F_REG(PCRR, ch), 0x15);
- /* Transmit Spare Bits for National Use (Y-Bits, Sn-Bits, Sa-Bits) */
- cpc_writeb(falcbase + F_REG(XSW, ch),
- cpc_readb(falcbase + F_REG(XSW, ch)) |
- XSW_XY0 | XSW_XY1 | XSW_XY2 | XSW_XY3 | XSW_XY4);
-
cpc_writeb(falcbase + F_REG(IDLE, ch), 0x7f);
falc_close_all_timeslots(card, ch);
@@ -958,14 +1024,21 @@
falc_init_hdlc(pc300_t *card, int ch)
{
uclong falcbase = card->hw.falcbase;
+ pc300ch_t *chan = (pc300ch_t *)&card->chan[ch];
+ pc300chconf_t *conf = (pc300chconf_t *)&chan->conf;
/* Enable transparent data transfer */
- cpc_writeb(falcbase + F_REG(MODE, ch),
- cpc_readb(falcbase + F_REG(MODE, ch)) | MODE_HRAC | MODE_MDS2);
- cpc_writeb(falcbase + F_REG(RAH2, ch), 0xff);
- cpc_writeb(falcbase + F_REG(RAH1, ch), 0xff);
- cpc_writeb(falcbase + F_REG(RAL2, ch), 0xff);
- cpc_writeb(falcbase + F_REG(RAL1, ch), 0xff);
+ if (conf->fr_mode == PC300_FR_UNFRAMED) {
+ cpc_writeb(falcbase + F_REG(MODE, ch), 0);
+ } else {
+ cpc_writeb(falcbase + F_REG(MODE, ch),
+ cpc_readb(falcbase + F_REG(MODE, ch)) |
+ (MODE_HRAC|MODE_MDS2));
+ cpc_writeb(falcbase + F_REG(RAH2, ch), 0xff);
+ cpc_writeb(falcbase + F_REG(RAH1, ch), 0xff);
+ cpc_writeb(falcbase + F_REG(RAL2, ch), 0xff);
+ cpc_writeb(falcbase + F_REG(RAL1, ch), 0xff);
+ }
/* Tx/Rx reset */
falc_issue_cmd(card, ch, CMDR_RRES | CMDR_XRES | CMDR_SRES);
@@ -1002,12 +1075,12 @@
CPC_LOCK(card, flags);
/* Reset the FALC chip */
- cpc_writeb(card->hw.falcbase + CPLD_REG1,
- cpc_readb(card->hw.falcbase + CPLD_REG1) |
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg1,
+ cpc_readb(card->hw.falcbase + card->hw.cpld_reg1) |
(CPLD_REG1_FALC_RESET << (2*ch)));
udelay(10000);
- cpc_writeb(card->hw.falcbase + CPLD_REG1,
- cpc_readb(card->hw.falcbase + CPLD_REG1) &
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg1,
+ cpc_readb(card->hw.falcbase + card->hw.cpld_reg1) &
~(CPLD_REG1_FALC_RESET << (2*ch)));
if (conf->media == LINE_T1) {
@@ -1023,8 +1096,8 @@
cpc_writeb(falcbase + F_REG(LIM0, ch),
cpc_readb(falcbase + F_REG(LIM0, ch)) | LIM0_EQON);
}
- cpc_writeb(card->hw.falcbase + CPLD_REG2,
- cpc_readb(card->hw.falcbase + CPLD_REG2) |
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2,
+ cpc_readb(card->hw.falcbase + card->hw.cpld_reg2) |
((CPLD_REG2_FALC_TX_CLK | CPLD_REG2_FALC_RX_CLK) << (2*ch)));
/* Clear all interrupt registers */
@@ -1043,132 +1116,138 @@
falc_t *pfalc = (falc_t *)&chan->falc;
uclong falcbase = card->hw.falcbase;
- /* Verify AIS alarm */
- if (frs0 & FRS0_AIS) {
- if (!pfalc->blue_alarm) {
- pfalc->blue_alarm = 1;
- pfalc->ais++;
- // EVENT_AIS
- if (conf->media == LINE_T1) {
- /* Disable this interrupt as it may otherwise interfere with
- other working boards. */
- cpc_writeb(falcbase + F_REG(IMR0, ch),
- cpc_readb(falcbase + F_REG(IMR0, ch)) | IMR0_PDEN);
- }
- falc_disable_comm(card, ch);
- // EVENT_AIS
- }
- } else {
- pfalc->blue_alarm = 0;
- }
-
- /* Verify LOS */
- if (frs0 & FRS0_LOS) {
- if (! pfalc->red_alarm) {
- pfalc->red_alarm = 1;
- pfalc->los++;
+ if (conf->fr_mode != PC300_FR_UNFRAMED) {
+ /* Verify AIS alarm */
+ if (frs0 & FRS0_AIS) {
if (!pfalc->blue_alarm) {
- // EVENT_FALC_ABNORMAL
+ pfalc->blue_alarm = 1;
+ pfalc->ais++;
+ // EVENT_AIS
if (conf->media == LINE_T1) {
- /* Disable this interrupt as it may otherwise interfere
- with other working boards. */
+ /* Disable this interrupt as it may otherwise interfere with
+ other working boards. */
cpc_writeb(falcbase + F_REG(IMR0, ch),
- cpc_readb(falcbase + F_REG(IMR0, ch)) |
+ cpc_readb(falcbase + F_REG(IMR0, ch)) |
IMR0_PDEN);
}
falc_disable_comm(card, ch);
- // EVENT_FALC_ABNORMAL
+ // EVENT_AIS
}
- }
- } else {
- if (pfalc->red_alarm) {
- pfalc->red_alarm = 0;
- pfalc->losr++;
- }
- }
+ } else {
+ pfalc->blue_alarm = 0;
+ }
- /* Verify LFA */
- if (frs0 & FRS0_LFA) {
- if (!pfalc->loss_fa) {
- pfalc->loss_fa = 1;
- pfalc->lfa++;
- if (!pfalc->blue_alarm && !pfalc->red_alarm) {
- // EVENT_FALC_ABNORMAL
- if (conf->media == LINE_T1) {
- /* Disable this interrupt as it may otherwise interfere
- with other working boards. */
- cpc_writeb(falcbase + F_REG(IMR0, ch),
- cpc_readb(falcbase + F_REG(IMR0, ch)) |
- IMR0_PDEN);
+ /* Verify LOS */
+ if (frs0 & FRS0_LOS) {
+ if (!pfalc->red_alarm) {
+ pfalc->red_alarm = 1;
+ pfalc->los++;
+ if (!pfalc->blue_alarm) {
+ // EVENT_FALC_ABNORMAL
+ if (conf->media == LINE_T1) {
+ /* Disable this interrupt as it may otherwise interfere
+ with other working boards. */
+ cpc_writeb(falcbase + F_REG(IMR0, ch),
+ cpc_readb(falcbase + F_REG(IMR0, ch)) |
+ IMR0_PDEN);
+ }
+ falc_disable_comm(card, ch);
+ // EVENT_FALC_ABNORMAL
}
- falc_disable_comm(card, ch);
- // EVENT_FALC_ABNORMAL
+ }
+ } else {
+ if (pfalc->red_alarm) {
+ pfalc->red_alarm = 0;
+ pfalc->losr++;
}
}
- } else {
- if (pfalc->loss_fa) {
- pfalc->loss_fa = 0;
- pfalc->farec++;
+
+ /* Verify LFA */
+ if (frs0 & FRS0_LFA) {
+ if (!pfalc->loss_fa) {
+ pfalc->loss_fa = 1;
+ pfalc->lfa++;
+ if (!pfalc->blue_alarm && !pfalc->red_alarm) {
+ // EVENT_FALC_ABNORMAL
+ if (conf->media == LINE_T1) {
+ /* Disable this interrupt as it may otherwise
+ interfere with other working boards. */
+ cpc_writeb(falcbase + F_REG(IMR0, ch),
+ cpc_readb(falcbase + F_REG(IMR0, ch)) |
+ IMR0_PDEN);
+ }
+ falc_disable_comm(card, ch);
+ // EVENT_FALC_ABNORMAL
+ }
+ }
+ } else {
+ if (pfalc->loss_fa) {
+ pfalc->loss_fa = 0;
+ pfalc->farec++;
+ }
}
- }
- /* Verify LMFA */
- if ((pfalc->multiframe_mode) && (frs0 & FRS0_LMFA)) {
- /* D4 or CRC4 frame mode */
- if (! pfalc->loss_mfa) {
- pfalc->loss_mfa = 1;
- pfalc->lmfa++;
- if (!pfalc->blue_alarm && !pfalc->red_alarm && !pfalc->loss_fa) {
- // EVENT_FALC_ABNORMAL
- if (conf->media == LINE_T1) {
- /* Disable this interrupt as it may otherwise interfere
- with other working boards. */
- cpc_writeb(falcbase + F_REG(IMR0, ch),
- cpc_readb(falcbase + F_REG(IMR0, ch)) |
- IMR0_PDEN);
+ /* Verify LMFA */
+ if (pfalc->multiframe_mode && (frs0 & FRS0_LMFA)) {
+ /* D4 or CRC4 frame mode */
+ if (!pfalc->loss_mfa) {
+ pfalc->loss_mfa = 1;
+ pfalc->lmfa++;
+ if (!pfalc->blue_alarm && !pfalc->red_alarm &&
+ !pfalc->loss_fa) {
+ // EVENT_FALC_ABNORMAL
+ if (conf->media == LINE_T1) {
+ /* Disable this interrupt as it may otherwise
+ interfere with other working boards. */
+ cpc_writeb(falcbase + F_REG(IMR0, ch),
+ cpc_readb(falcbase + F_REG(IMR0, ch)) |
+ IMR0_PDEN);
+ }
+ falc_disable_comm(card, ch);
+ // EVENT_FALC_ABNORMAL
}
- falc_disable_comm(card, ch);
- // EVENT_FALC_ABNORMAL
}
+ } else {
+ pfalc->loss_mfa = 0;
}
- } else {
- pfalc->loss_mfa = 0;
- }
- if (pfalc->red_alarm || pfalc->loss_fa ||
- pfalc->loss_mfa || pfalc->blue_alarm) {
- if (pfalc->sync) {
- pfalc->sync = 0;
- cpc_writeb(falcbase + CPLD_REG2,
- cpc_readb(falcbase + CPLD_REG2) &
- ~(CPLD_REG2_FALC_LED2 << (2*ch)));
- }
- } else {
- if ((!pfalc->sync)) {
- pfalc->sync = 1;
- cpc_writeb(falcbase + CPLD_REG2,
- cpc_readb(falcbase + CPLD_REG2) |
- (CPLD_REG2_FALC_LED2 << (2*ch)));
+ if (pfalc->red_alarm || pfalc->loss_fa ||
+ pfalc->loss_mfa || pfalc->blue_alarm) {
+ if (pfalc->sync) {
+ pfalc->sync = 0;
+ chan->d.line_off++;
+ cpc_writeb(falcbase + card->hw.cpld_reg2,
+ cpc_readb(falcbase + card->hw.cpld_reg2) &
+ ~(CPLD_REG2_FALC_LED2 << (2*ch)));
+ }
+ } else {
+ if (!pfalc->sync) {
+ pfalc->sync = 1;
+ chan->d.line_on++;
+ cpc_writeb(falcbase + card->hw.cpld_reg2,
+ cpc_readb(falcbase + card->hw.cpld_reg2) |
+ (CPLD_REG2_FALC_LED2 << (2*ch)));
+ }
}
- }
- /* Verify Remote Alarm */
- if (frs0 & FRS0_RRA) {
- if (! pfalc->yellow_alarm) {
- pfalc->yellow_alarm = 1;
- pfalc->rai++;
- if (pfalc->sync) {
- // EVENT_RAI
- falc_disable_comm(card, ch);
- // EVENT_RAI
+ /* Verify Remote Alarm */
+ if (frs0 & FRS0_RRA) {
+ if (!pfalc->yellow_alarm) {
+ pfalc->yellow_alarm = 1;
+ pfalc->rai++;
+ if (pfalc->sync) {
+ // EVENT_RAI
+ falc_disable_comm(card, ch);
+ // EVENT_RAI
+ }
}
+ } else {
+ pfalc->yellow_alarm = 0;
}
- } else {
- pfalc->yellow_alarm = 0;
- }
+ } /* if !PC300_UNFRAMED */
- if ((pfalc->sync) && (!(pfalc->yellow_alarm))) {
- if (! pfalc->active) {
+ if (pfalc->sync && !pfalc->yellow_alarm) {
+ if (!pfalc->active) {
// EVENT_FALC_NORMAL
if (pfalc->loop_active) {
return;
@@ -1214,6 +1293,7 @@
pfalc->ebc += counter;
if (cpc_readb(falcbase + F_REG(LCR1, ch)) & LCR1_EPRM) {
+ mdelay (10);
counter = cpc_readb(falcbase + F_REG(BECL, ch));
counter |= cpc_readb(falcbase + F_REG(BECH, ch)) << 8;
pfalc->bec += counter;
@@ -1231,6 +1311,16 @@
}
}
+/*----------------------------------------------------------------------------
+ * falc_remote_loop
+ *----------------------------------------------------------------------------
+ * Description: In the remote loopback mode the clock and data recovered
+ * from the line inputs RL1/2 or RDIP/RDIN are routed back
+ * to the line outputs XL1/2 or XDOP/XDON via the analog
+ * transmitter. As in normal mode they are processsed by
+ * the synchronizer and then sent to the system interface.
+ *----------------------------------------------------------------------------
+ */
void
falc_remote_loop(pc300_t *card, int ch, int loop_on)
{
@@ -1256,8 +1346,98 @@
cpc_writeb(falcbase + F_REG(LIM1, ch),
cpc_readb(falcbase + F_REG(LIM1, ch)) & ~LIM1_RL);
pfalc->sync = 0;
- cpc_writeb(falcbase + CPLD_REG2,
- cpc_readb(falcbase + CPLD_REG2) &
+ cpc_writeb(falcbase + card->hw.cpld_reg2,
+ cpc_readb(falcbase + card->hw.cpld_reg2) &
+ ~(CPLD_REG2_FALC_LED2 << (2*ch)));
+ pfalc->active = 0;
+ falc_issue_cmd(card, ch, CMDR_XRES);
+ pfalc->loop_active = 0;
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * falc_local_loop
+ *----------------------------------------------------------------------------
+ * Description: The local loopback mode disconnects the receive lines
+ * RL1/RL2 resp. RDIP/RDIN from the receiver. Instead of the
+ * signals coming from the line the data provided by system
+ * interface are routed through the analog receiver back to
+ * the system interface. The unipolar bit stream will be
+ * undisturbed transmitted on the line. Receiver and transmitter
+ * coding must be identical.
+ *----------------------------------------------------------------------------
+ */
+void
+falc_local_loop(pc300_t *card, int ch, int loop_on)
+{
+ pc300ch_t *chan = (pc300ch_t *)&card->chan[ch];
+ falc_t *pfalc = (falc_t *)&chan->falc;
+ uclong falcbase = card->hw.falcbase;
+
+ if (loop_on) {
+ cpc_writeb(falcbase + F_REG(LIM0, ch),
+ cpc_readb(falcbase + F_REG(LIM0, ch)) | LIM0_LL);
+ pfalc->loop_active = 1;
+ }
+ else {
+ cpc_writeb(falcbase + F_REG(LIM0, ch),
+ cpc_readb(falcbase + F_REG(LIM0, ch)) & ~LIM0_LL);
+ pfalc->loop_active = 0;
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * falc_payload_loop
+ *----------------------------------------------------------------------------
+ * Description: This routine allows to enable/disable payload loopback.
+ * When the payload loop is activated, the received 192 bits
+ * of payload data will be looped back to the transmit
+ * direction. The framing bits, CRC6 and DL bits are not
+ * looped. They are originated by the FALC-LH transmitter.
+ *----------------------------------------------------------------------------
+ */
+void
+falc_payload_loop(pc300_t *card, int ch, int loop_on)
+{
+ pc300ch_t *chan = (pc300ch_t *)&card->chan[ch];
+ pc300chconf_t *conf = (pc300chconf_t *)&chan->conf;
+ falc_t *pfalc = (falc_t *)&chan->falc;
+ uclong falcbase = card->hw.falcbase;
+
+ if (loop_on) {
+ // EVENT_FALC_ABNORMAL
+ if (conf->media == LINE_T1) {
+ /* Disable this interrupt as it may otherwise interfere with
+ other working boards. */
+ cpc_writeb(falcbase + F_REG(IMR0, ch),
+ cpc_readb(falcbase + F_REG(IMR0, ch)) | IMR0_PDEN);
+ }
+ falc_disable_comm(card, ch);
+ // EVENT_FALC_ABNORMAL
+ cpc_writeb(falcbase + F_REG(FMR2, ch),
+ cpc_readb(falcbase + F_REG(FMR2, ch)) | FMR2_PLB);
+ if (conf->media == LINE_T1) {
+ cpc_writeb(falcbase + F_REG(FMR4, ch),
+ cpc_readb(falcbase + F_REG(FMR4, ch)) | FMR4_TM);
+ } else {
+ cpc_writeb(falcbase + F_REG(FMR5, ch),
+ cpc_readb(falcbase + F_REG(FMR5, ch)) | XSP_TT0);
+ }
+ falc_open_all_timeslots(card, ch);
+ pfalc->loop_active = 2;
+ } else {
+ cpc_writeb(falcbase + F_REG(FMR2, ch),
+ cpc_readb(falcbase + F_REG(FMR2, ch)) & ~FMR2_PLB);
+ if (conf->media == LINE_T1) {
+ cpc_writeb(falcbase + F_REG(FMR4, ch),
+ cpc_readb(falcbase + F_REG(FMR4, ch)) & ~FMR4_TM);
+ } else {
+ cpc_writeb(falcbase + F_REG(FMR5, ch),
+ cpc_readb(falcbase + F_REG(FMR5, ch)) & ~XSP_TT0);
+ }
+ pfalc->sync = 0;
+ cpc_writeb(falcbase + card->hw.cpld_reg2,
+ cpc_readb(falcbase + card->hw.cpld_reg2) &
~(CPLD_REG2_FALC_LED2 << (2*ch)));
pfalc->active = 0;
falc_issue_cmd(card, ch, CMDR_XRES);
@@ -1265,15 +1445,213 @@
}
}
+/*----------------------------------------------------------------------------
+ * turn_off_xlu
+ *----------------------------------------------------------------------------
+ * Description: Turns XLU bit off in the proper register
+ *----------------------------------------------------------------------------
+ */
+void
+turn_off_xlu(pc300_t *card, int ch)
+{
+ pc300ch_t *chan = (pc300ch_t *)&card->chan[ch];
+ pc300chconf_t *conf = (pc300chconf_t *)&chan->conf;
+ uclong falcbase = card->hw.falcbase;
+
+ if (conf->media == LINE_T1) {
+ cpc_writeb(falcbase + F_REG(FMR5, ch),
+ cpc_readb(falcbase + F_REG(FMR5, ch)) & ~FMR5_XLU);
+ } else {
+ cpc_writeb(falcbase + F_REG(FMR3, ch),
+ cpc_readb(falcbase + F_REG(FMR3, ch)) & ~FMR3_XLU);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * turn_off_xld
+ *----------------------------------------------------------------------------
+ * Description: Turns XLD bit off in the proper register
+ *----------------------------------------------------------------------------
+ */
+void
+turn_off_xld (pc300_t *card, int ch)
+{
+ pc300ch_t *chan = (pc300ch_t *)&card->chan[ch];
+ pc300chconf_t *conf = (pc300chconf_t *)&chan->conf;
+ uclong falcbase = card->hw.falcbase;
+
+ if (conf->media == LINE_T1) {
+ cpc_writeb(falcbase + F_REG(FMR5, ch),
+ cpc_readb(falcbase + F_REG(FMR5, ch)) & ~FMR5_XLD);
+ } else {
+ cpc_writeb(falcbase + F_REG(FMR3, ch),
+ cpc_readb(falcbase + F_REG(FMR3, ch)) & ~FMR3_XLD);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * falc_generate_loop_up_code
+ *----------------------------------------------------------------------------
+ * Description: This routine writes the proper FALC chip register in order
+ * to generate a LOOP activation code over a T1/E1 line.
+ *----------------------------------------------------------------------------
+ */
+void
+falc_generate_loop_up_code (pc300_t *card, int ch)
+{
+ pc300ch_t *chan = (pc300ch_t *)&card->chan[ch];
+ pc300chconf_t *conf = (pc300chconf_t *)&chan->conf;
+ falc_t *pfalc = (falc_t *)&chan->falc;
+ uclong falcbase = card->hw.falcbase;
+
+ if (conf->media == LINE_T1) {
+ cpc_writeb(falcbase + F_REG(FMR5, ch),
+ cpc_readb(falcbase + F_REG(FMR5, ch)) | FMR5_XLU);
+ } else {
+ cpc_writeb(falcbase + F_REG(FMR3, ch),
+ cpc_readb(falcbase + F_REG(FMR3, ch)) | FMR3_XLU);
+ }
+ // EVENT_FALC_ABNORMAL
+ if (conf->media == LINE_T1) {
+ /* Disable this interrupt as it may otherwise interfere with
+ other working boards. */
+ cpc_writeb(falcbase + F_REG(IMR0, ch),
+ cpc_readb(falcbase + F_REG(IMR0, ch)) | IMR0_PDEN);
+ }
+ falc_disable_comm(card, ch);
+ // EVENT_FALC_ABNORMAL
+ pfalc->loop_gen = 1;
+}
+
+/*----------------------------------------------------------------------------
+ * falc_generate_loop_down_code
+ *----------------------------------------------------------------------------
+ * Description: This routine writes the proper FALC chip register in order
+ * to generate a LOOP deactivation code over a T1/E1 line.
+ *----------------------------------------------------------------------------
+ */
+void
+falc_generate_loop_down_code(pc300_t *card, int ch)
+{
+ pc300ch_t *chan = (pc300ch_t *)&card->chan[ch];
+ pc300chconf_t *conf = (pc300chconf_t *)&chan->conf;
+ falc_t *pfalc = (falc_t *)&chan->falc;
+ uclong falcbase = card->hw.falcbase;
+
+ if (conf->media == LINE_T1) {
+ cpc_writeb(falcbase + F_REG(FMR5, ch),
+ cpc_readb(falcbase + F_REG(FMR5, ch)) | FMR5_XLD);
+ } else {
+ cpc_writeb(falcbase + F_REG(FMR3, ch),
+ cpc_readb(falcbase + F_REG(FMR3, ch)) | FMR3_XLD);
+ }
+ pfalc->sync = 0;
+ cpc_writeb(falcbase + card->hw.cpld_reg2,
+ cpc_readb(falcbase + card->hw.cpld_reg2) &
+ ~(CPLD_REG2_FALC_LED2 << (2*ch)));
+ pfalc->active = 0;
+//? falc_issue_cmd(card, ch, CMDR_XRES);
+ pfalc->loop_gen = 0;
+}
+
+/*----------------------------------------------------------------------------
+ * falc_pattern_test
+ *----------------------------------------------------------------------------
+ * Description: This routine generates a pattern code and checks
+ * it on the reception side.
+ *----------------------------------------------------------------------------
+ */
+void
+falc_pattern_test(pc300_t *card, int ch, unsigned int activate)
+{
+ pc300ch_t *chan = (pc300ch_t *)&card->chan[ch];
+ pc300chconf_t *conf = (pc300chconf_t *)&chan->conf;
+ falc_t *pfalc = (falc_t *)&chan->falc;
+ uclong falcbase = card->hw.falcbase;
+
+ if (activate) {
+ pfalc->prbs = 1;
+ pfalc->bec = 0;
+ if (conf->media == LINE_T1) {
+ /* Disable local loop activation/deactivation detect */
+ cpc_writeb(falcbase + F_REG(IMR3, ch),
+ cpc_readb(falcbase + F_REG(IMR3, ch)) | IMR3_LLBSC);
+ } else {
+ /* Disable local loop activation/deactivation detect */
+ cpc_writeb(falcbase + F_REG(IMR1, ch),
+ cpc_readb(falcbase + F_REG(IMR1, ch)) | IMR1_LLBSC);
+ }
+ /* Activates generation and monitoring of PRBS
+ * (Pseudo Random Bit Sequence) */
+ cpc_writeb(falcbase + F_REG(LCR1, ch),
+ cpc_readb(falcbase + F_REG(LCR1, ch)) | LCR1_EPRM | LCR1_XPRBS);
+ } else {
+ pfalc->prbs = 0;
+ /* Deactivates generation and monitoring of PRBS
+ * (Pseudo Random Bit Sequence) */
+ cpc_writeb(falcbase + F_REG(LCR1, ch),
+ cpc_readb(falcbase + F_REG(LCR1, ch)) & ~(LCR1_EPRM | LCR1_XPRBS));
+ if (conf->media == LINE_T1) {
+ /* Enable local loop activation/deactivation detect */
+ cpc_writeb(falcbase + F_REG(IMR3, ch),
+ cpc_readb(falcbase + F_REG(IMR3, ch)) & ~IMR3_LLBSC);
+ } else {
+ /* Enable local loop activation/deactivation detect */
+ cpc_writeb(falcbase + F_REG(IMR1, ch),
+ cpc_readb(falcbase + F_REG(IMR1, ch)) & ~IMR1_LLBSC);
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * falc_pattern_test_error
+ *----------------------------------------------------------------------------
+ * Description: This routine returns the bit error counter value
+ *----------------------------------------------------------------------------
+ */
+ucshort falc_pattern_test_error(pc300_t *card, int ch)
+{
+ pc300ch_t *chan = (pc300ch_t *)&card->chan[ch];
+ falc_t *pfalc = (falc_t *)&chan->falc;
+
+ return (pfalc->bec);
+}
+
/**********************************/
/*** Net Interface Routines ***/
/**********************************/
-int cpc_queue_xmit(struct sk_buff *skb, struct device *dev)
+static void
+cpc_trace (struct device *dev, struct sk_buff *skb_main, char rx_tx)
+{
+ struct sk_buff *skb;
+
+ if ((skb = dev_alloc_skb(3 + skb_main->len)) == NULL) {
+ printk("%s: out of memory\n", dev->name);
+ return;
+ }
+ skb_put (skb, 3 + skb_main->len);
+
+ skb->dev = dev;
+ skb->protocol = htons(ETH_P_CUST);
+ skb->mac.raw = skb->data;
+ skb->pkt_type = PACKET_HOST;
+ skb->len = 3 + skb_main->len;
+
+ skb->data[0] = rx_tx;
+ skb->data[1] = ':';
+ skb->data[2] = ' ';
+ memcpy(&skb->data[3], skb_main->data, skb_main->len);
+
+ netif_rx(skb);
+}
+
+int
+cpc_queue_xmit(struct sk_buff *skb, struct device *dev)
{
pc300dev_t *d = (pc300dev_t *)dev->priv;
pc300ch_t *chan = (pc300ch_t *)d->chan;
pc300_t *card = (pc300_t *)chan->card;
- struct enet_statistics *stats = &d->hdlc->stats;
+ struct net_device_stats *stats = &d->hdlc->stats;
int ch = chan->channel;
volatile pcsca_bd_t *ptdescr;
uclong flags;
@@ -1281,6 +1659,38 @@
int i;
#endif
+ if (chan->conf.monitor) {
+ /* In monitor mode no Tx is done: ignore packet */
+ dev_kfree_skb(skb);
+ return 0;
+ } else if (!(dev->flags & IFF_RUNNING)) {
+ /* DCD must be OFF: drop packet */
+ dev_kfree_skb(skb);
+ stats->tx_errors++;
+ stats->tx_carrier_errors++;
+ return 0;
+ } else if (cpc_readb(card->hw.scabase + M_REG(ST3, ch)) & ST3_DCD) {
+ printk("%s: DCD is OFF. Going admnistrative down.\n", dev->name);
+ stats->tx_errors++;
+ stats->tx_carrier_errors++;
+ dev_kfree_skb(skb);
+ dev->flags &= ~IFF_RUNNING;
+ CPC_LOCK(card, flags);
+ if (d->tx_skb) {
+ dev_kfree_skb(d->tx_skb);
+ d->tx_skb = NULL;
+ }
+ cpc_writeb(card->hw.scabase + M_REG(CMD, ch), CMD_TX_BUF_CLR);
+ if (card->hw.type == PC300_TE) {
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2,
+ cpc_readb(card->hw.falcbase + card->hw.cpld_reg2) &
+ ~(CPLD_REG2_FALC_LED1 << (2*ch)));
+ }
+ dev->tbusy = 0;
+ CPC_UNLOCK(card, flags);
+ return 0;
+ }
+
if (dev->tbusy) {
ucchar ilar;
@@ -1303,8 +1713,8 @@
d->tx_skb = NULL;
}
if (card->hw.type == PC300_TE) {
- cpc_writeb(card->hw.falcbase + CPLD_REG2,
- cpc_readb(card->hw.falcbase + CPLD_REG2) &
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2,
+ cpc_readb(card->hw.falcbase + card->hw.cpld_reg2) &
~(CPLD_REG2_FALC_LED1 << (2*ch)));
}
CPC_UNLOCK(card, flags);
@@ -1345,6 +1755,9 @@
printk("\n");
#endif
+ if (d->trace_on) {
+ cpc_trace (dev, skb, 'T');
+ }
d->tx_skb = skb;
dev->trans_start = jiffies;
@@ -1355,8 +1768,8 @@
cpc_writeb(card->hw.scabase + M_REG(CMD, ch), CMD_TX_ENA);
cpc_writeb(card->hw.scabase + DSR_TX(ch), DSR_DE);
if (card->hw.type == PC300_TE) {
- cpc_writeb(card->hw.falcbase + CPLD_REG2,
- cpc_readb(card->hw.falcbase + CPLD_REG2) |
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2,
+ cpc_readb(card->hw.falcbase + card->hw.cpld_reg2) |
(CPLD_REG2_FALC_LED1 << (2*ch)));
}
CPC_UNLOCK(card, flags);
@@ -1371,7 +1784,7 @@
pc300dev_t *d = (pc300dev_t *)dev->priv;
pc300ch_t *chan = (pc300ch_t *)d->chan;
pc300_t *card = (pc300_t *)chan->card;
- struct enet_statistics *stats = &hdlc->stats;
+ struct net_device_stats *stats = &hdlc->stats;
int ch = chan->channel;
#ifdef PC300_DEBUG_RX
int i;
@@ -1416,6 +1829,9 @@
printk(" %02x", *(skb->data + i));
printk("\n");
#endif
+ if (d->trace_on) {
+ cpc_trace (dev, skb, 'R');
+ }
switch(hdlc->mode & ~MODE_SOFT) {
#ifdef CONFIG_PC300_X25
@@ -1591,6 +2007,7 @@
hdlc_device *hdlc = d->hdlc;
struct device *dev = hdlc_to_dev(hdlc);
+ spin_lock(&card->card_lock);
dev->interrupt = 1;
/**** Reception ****/
@@ -1619,14 +2036,16 @@
if (status & IR0_DRX(IR0_DMIB, ch)) {
if (drx_stat & DSR_EOM) {
if (card->hw.type == PC300_TE) {
- cpc_writeb(card->hw.falcbase + CPLD_REG2,
- cpc_readb(card->hw.falcbase + CPLD_REG2)
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2,
+ cpc_readb(card->hw.falcbase +
+ card->hw.cpld_reg2)
| (CPLD_REG2_FALC_LED1 << (2*ch)));
}
cpc_net_rx(hdlc);
if (card->hw.type == PC300_TE) {
- cpc_writeb(card->hw.falcbase + CPLD_REG2,
- cpc_readb(card->hw.falcbase + CPLD_REG2)
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2,
+ cpc_readb(card->hw.falcbase +
+ card->hw.cpld_reg2)
& ~(CPLD_REG2_FALC_LED1 << (2*ch)));
}
}
@@ -1651,8 +2070,9 @@
CMD_TX_BUF_CLR);
}
if (card->hw.type == PC300_TE) {
- cpc_writeb(card->hw.falcbase + CPLD_REG2,
- cpc_readb(card->hw.falcbase + CPLD_REG2)
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2,
+ cpc_readb(card->hw.falcbase +
+ card->hw.cpld_reg2)
& ~(CPLD_REG2_FALC_LED1 << (2*ch)));
}
if (d->tx_skb) {
@@ -1676,8 +2096,9 @@
if (status & IR0_DTX(IR0_DMIB, ch)) {
if (dtx_stat & DSR_EOM) {
if (card->hw.type == PC300_TE) {
- cpc_writeb(card->hw.falcbase + CPLD_REG2,
- cpc_readb(card->hw.falcbase + CPLD_REG2)
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2,
+ cpc_readb(card->hw.falcbase +
+ card->hw.cpld_reg2)
& ~(CPLD_REG2_FALC_LED1 << (2*ch)));
}
if (d->tx_skb) {
@@ -1695,7 +2116,34 @@
}
}
}
+
+ /**** MSCI ****/
+ if (status & IR0_M(IR0_RXINTA, ch)) {
+ ucchar st1 = cpc_readb(scabase + M_REG(ST1, ch));
+
+ /* Clear MSCI interrupts */
+ cpc_writeb(scabase + M_REG(ST1, ch), st1);
+
+#ifdef PC300_DEBUG_INTR
+ printk("sca_intr: MSCI intr (st=0x%08lx, st1=0x%02x)\n",
+ status, st1);
+#endif
+ if (st1 & ST1_CDCD) { /* DCD changed */
+ if (cpc_readb(scabase + M_REG(ST3, ch)) & ST3_DCD) {
+ printk("%s: DCD is OFF. Going administrative down.\n",
+ dev->name);
+ dev->flags &= ~IFF_RUNNING;
+ card->chan[ch].d.line_off++;
+ } else { /* DCD = 1 */
+ printk("%s: DCD is ON. Going administrative up.\n",
+ dev->name);
+ dev->flags |= IFF_RUNNING;
+ card->chan[ch].d.line_on++;
+ }
+ }
+ }
dev->interrupt = 0;
+ spin_unlock(&card->card_lock);
}
if (++intr_count == 10)
/* Too much work at this board. Force exit */
@@ -1713,14 +2161,14 @@
if (((cpc_readb(falcbase + F_REG(LCR1, ch)) & LCR1_XPRBS) == 0) &&
!pfalc->loop_gen) {
if (frs1 & FRS1_LLBDD) {
- // A Line Loop Back Deactuation signal detected
+ // A Line Loop Back Deactivation signal detected
if (pfalc->loop_active) {
falc_remote_loop(card, ch, 0);
}
} else {
if ((frs1 & FRS1_LLBAD) &&
((cpc_readb(falcbase + F_REG(LCR1, ch)) & LCR1_EPRM) == 0)) {
- // A Line Loop Back Actuation signal detected
+ // A Line Loop Back Activation signal detected
if (!pfalc->loop_active) {
falc_remote_loop(card, ch, 1);
}
@@ -1739,14 +2187,14 @@
if (((cpc_readb(falcbase + F_REG(LCR1, ch)) & LCR1_XPRBS) == 0) &&
!pfalc->loop_gen) {
if (rsp & RSP_LLBDD) {
- // A Line Loop Back Deactuation signal detected
+ // A Line Loop Back Deactivation signal detected
if (pfalc->loop_active) {
falc_remote_loop(card, ch, 0);
}
} else {
if ((rsp & RSP_LLBAD) &&
((cpc_readb(falcbase + F_REG(LCR1, ch)) & LCR1_EPRM) == 0)) {
- // A Line Loop Back Actuation signal detected
+ // A Line Loop Back Activation signal detected
if (!pfalc->loop_active) {
falc_remote_loop(card, ch, 1);
}
@@ -2056,10 +2504,12 @@
pc300dev_t *d = (pc300dev_t *)dev->priv;
pc300ch_t *chan = (pc300ch_t *)d->chan;
pc300_t *card = (pc300_t *)chan->card;
+ pc300conf_t conf_aux;
pc300chconf_t *conf = (pc300chconf_t *)&chan->conf;
int ch = chan->channel;
int value;
void *arg = (void *) ifr->ifr_data;
+ uclong scabase = card->hw.scabase;
if(!capable(CAP_NET_ADMIN))
return -EPERM;
@@ -2067,14 +2517,24 @@
switch(cmd) {
case SIOCGPC300CONF:
conf->proto = hdlc->mode;
- if (!arg || copy_to_user(arg, conf, sizeof(pc300chconf_t)))
+ memcpy(&conf_aux.conf, conf, sizeof(pc300chconf_t));
+ memcpy(&conf_aux.hw, &card->hw, sizeof(pc300hw_t));
+ if (!arg || copy_to_user(arg, &conf_aux, sizeof(pc300conf_t)))
return -EINVAL;
return 0;
case SIOCSPC300CONF:
if (!suser())
return -EPERM;
- if (!arg || copy_from_user(conf, arg, sizeof(pc300chconf_t)))
+ if (!arg || copy_from_user(&conf_aux.conf, arg,
+ sizeof(pc300chconf_t)))
return -EINVAL;
+ if (card->hw.cpld_id < 0x02 &&
+ conf_aux.conf.fr_mode == PC300_FR_UNFRAMED) {
+ /* CPLD_ID < 0x02 doesn't support Unframed E1 */
+ return -EINVAL;
+ }
+ memcpy(conf, &conf_aux.conf, sizeof(pc300chconf_t));
+ hdlc->mode = conf->proto;
return 0;
case SIOCGPC300STATUS:
cpc_sca_status(card, ch);
@@ -2113,7 +2573,135 @@
conf->clkrate = value;
return 0;
}
-
+
+ case SIOCGPC300UTILSTATS:
+ {
+ pc300stats_t pc300stats;
+
+ memset(&pc300stats, 0, sizeof(pc300stats_t));
+ pc300stats.hw_type = card->hw.type;
+ pc300stats.line_on = card->chan[ch].d.line_on;
+ pc300stats.line_off = card->chan[ch].d.line_off;
+ memcpy(&pc300stats.gen_stats, &d->hdlc->stats,
+ sizeof(struct net_device_stats));
+ if (card->hw.type == PC300_TE)
+ memcpy(&pc300stats.te_stats, &chan->falc, sizeof(falc_t));
+ if (!arg || copy_to_user(arg, &pc300stats, sizeof(pc300stats_t)))
+ return -EINVAL;
+ return 0;
+ }
+
+ case SIOCGPC300UTILSTATUS:
+ {
+ struct pc300status pc300status;
+
+ pc300status.hw_type = card->hw.type;
+ if (card->hw.type == PC300_TE) {
+ pc300status.te_status.sync = chan->falc.sync;
+ pc300status.te_status.red_alarm = chan->falc.red_alarm;
+ pc300status.te_status.blue_alarm = chan->falc.blue_alarm;
+ pc300status.te_status.loss_fa = chan->falc.loss_fa;
+ pc300status.te_status.yellow_alarm = chan->falc.yellow_alarm;
+ pc300status.te_status.loss_mfa = chan->falc.loss_mfa;
+ pc300status.te_status.prbs = chan->falc.prbs;
+ } else {
+ pc300status.gen_status.dcd =
+ !(cpc_readb(scabase + M_REG(ST3, ch)) & ST3_DCD);
+ pc300status.gen_status.cts =
+ !(cpc_readb(scabase + M_REG(ST3, ch)) & ST3_CTS);
+ pc300status.gen_status.rts =
+ !(cpc_readb(scabase + M_REG(CTL, ch)) & CTL_RTS);
+ pc300status.gen_status.dtr =
+ !(cpc_readb(scabase + M_REG(CTL, ch)) & CTL_DTR);
+ /* There is no DSR in HD64572 */
+ }
+ if (!arg || copy_to_user(arg, &pc300status, sizeof(pc300status_t)))
+ return -EINVAL;
+ return 0;
+ }
+
+ case SIOCSPC300TRACE:
+ /* Sets/resets a trace_flag for the respective device */
+ if (!arg || copy_from_user(&d->trace_on, arg,
+ sizeof(unsigned char)))
+ return -EINVAL;
+ return 0;
+
+ case SIOCSPC300LOOPBACK:
+ {
+ struct pc300loopback pc300loop;
+
+ /* TE boards only */
+ if (card->hw.type != PC300_TE)
+ return -EINVAL;
+
+ if (!arg || copy_from_user(&pc300loop, arg,
+ sizeof(pc300loopback_t)))
+ return -EINVAL;
+ switch (pc300loop.loop_type) {
+ case PC300LOCLOOP: /* Turn the local loop on/off */
+ falc_local_loop(card, ch, pc300loop.loop_on);
+ return 0;
+
+ case PC300REMLOOP: /* Turn the remote loop on/off */
+ falc_remote_loop(card, ch, pc300loop.loop_on);
+ return 0;
+
+ case PC300PAYLOADLOOP: /* Turn the payload loop on/off */
+ falc_payload_loop(card, ch, pc300loop.loop_on);
+ return 0;
+
+ case PC300GENLOOPUP: /* Generate loop UP */
+ if (pc300loop.loop_on) {
+ falc_generate_loop_up_code(card, ch);
+ } else {
+ turn_off_xlu(card, ch);
+ }
+ return 0;
+
+ case PC300GENLOOPDOWN: /* Generate loop DOWN */
+ if (pc300loop.loop_on) {
+ falc_generate_loop_down_code(card, ch);
+ } else {
+ turn_off_xld(card, ch);
+ }
+ return 0;
+
+ default:
+ return -EINVAL;
+ }
+ }
+
+ case SIOCSPC300PATTERNTEST:
+ /* Turn the pattern test on/off and show the errors counter */
+ {
+ struct pc300patterntst pc300patrntst;
+
+ /* TE boards only */
+ if (card->hw.type != PC300_TE)
+ return -EINVAL;
+
+ if (card->hw.cpld_id < 0x02) {
+ /* CPLD_ID < 0x02 doesn't support pattern test */
+ return -EINVAL;
+ }
+ if (!arg || copy_from_user(&pc300patrntst, arg,
+ sizeof(pc300patterntst_t)))
+ return -EINVAL;
+ if (pc300patrntst.patrntst_on == 2) {
+ if (chan->falc.prbs == 0) {
+ falc_pattern_test(card, ch, 1);
+ }
+ pc300patrntst.num_errors = falc_pattern_test_error(card, ch);
+ if (!arg || copy_to_user(arg, &pc300patrntst,
+ sizeof(pc300patterntst_t)))
+ return -EINVAL;
+ } else {
+ falc_pattern_test(card, ch, pc300patrntst.patrntst_on);
+ }
+ return 0;
+ }
+
default:
switch(hdlc->mode & ~MODE_SOFT) {
#ifdef CONFIG_PC300_X25
@@ -2203,7 +2791,7 @@
case PC300_RSV:
case PC300_X21:
if (clkrate) {
- /* Calculate the clkrate rate parameters */
+ /* Calculate the clkrate parameters */
tmc = clock_rate_calc(clkrate, card->hw.clock, &br);
cpc_writeb(scabase + M_REG(TMCT, ch), tmc);
cpc_writeb(scabase + M_REG(TXS, ch), (TXS_DTRXC|TXS_IBRG|br));
@@ -2241,10 +2829,14 @@
/* Enable Interrupts */
cpc_writel(scabase + IER0,
- cpc_readl(scabase + IER0) |
- IR0_DRX(IR0_EFT|IR0_DMIA|IR0_DMIB, ch) |
- IR0_DTX(IR0_EFT|IR0_DMIA|IR0_DMIB, ch) );
-
+ cpc_readl(scabase + IER0) |
+ IR0_M(IR0_RXINTA, ch) |
+ IR0_DRX(IR0_EFT|IR0_DMIA|IR0_DMIB, ch) |
+ IR0_DTX(IR0_EFT|IR0_DMIA|IR0_DMIB, ch));
+ cpc_writel(scabase + M_REG(IE0, ch),
+ cpc_readl(scabase + M_REG(IE0, ch)) | IE0_RXINTA);
+ cpc_writel(scabase + M_REG(IE1, ch),
+ cpc_readl(scabase + M_REG(IE1, ch)) | IE1_CDCD);
return 0;
}
@@ -2355,17 +2947,17 @@
cpc_writeb(card->hw.scabase + M_REG(CMD, ch), CMD_CH_RST);
if (card->hw.type == PC300_TE) {
memset(pfalc, 0, sizeof(falc_t));
- cpc_writeb(card->hw.falcbase + CPLD_REG2,
- cpc_readb(card->hw.falcbase + CPLD_REG2) &
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2,
+ cpc_readb(card->hw.falcbase + card->hw.cpld_reg2) &
~((CPLD_REG2_FALC_TX_CLK | CPLD_REG2_FALC_RX_CLK |
CPLD_REG2_FALC_LED2) << (2*ch)));
/* Reset the FALC chip */
- cpc_writeb(card->hw.falcbase + CPLD_REG1,
- cpc_readb(card->hw.falcbase + CPLD_REG1) |
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg1,
+ cpc_readb(card->hw.falcbase + card->hw.cpld_reg1) |
(CPLD_REG1_FALC_RESET << (2*ch)));
udelay(10000);
- cpc_writeb(card->hw.falcbase + CPLD_REG1,
- cpc_readb(card->hw.falcbase + CPLD_REG1) &
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg1,
+ cpc_readb(card->hw.falcbase + card->hw.cpld_reg1) &
~(CPLD_REG1_FALC_RESET << (2*ch)));
}
}
@@ -2664,14 +3256,35 @@
/* Set board type */
switch(device_id) {
case PCI_DEVICE_ID_PC300_TE_1:
- case PCI_DEVICE_ID_PC300_TE_2:
+ case PCI_DEVICE_ID_PC300_TE_2: {
+ ucchar reg1;
+
card->hw.type = PC300_TE;
+
+ /* Check CPLD version */
+ reg1 = cpc_readb(card->hw.falcbase + CPLD_REG1);
+ cpc_writeb(card->hw.falcbase + CPLD_REG1, (reg1 + 0x5a));
+ if (cpc_readb(card->hw.falcbase + CPLD_REG1) == reg1) {
+ /* New CPLD */
+ card->hw.cpld_id = cpc_readb(card->hw.falcbase +
+ CPLD_ID_REG);
+ card->hw.cpld_reg1 = CPLD_V2_REG1;
+ card->hw.cpld_reg2 = CPLD_V2_REG2;
+ } else {
+ /* old CPLD */
+ card->hw.cpld_id = 0;
+ card->hw.cpld_reg1 = CPLD_REG1;
+ card->hw.cpld_reg2 = CPLD_REG2;
+ cpc_writeb(card->hw.falcbase + CPLD_REG1, reg1);
+ }
+
/* Enable the board's global clock */
- cpc_writeb(card->hw.falcbase + CPLD_REG1,
- cpc_readb(card->hw.falcbase + CPLD_REG1) |
+ cpc_writeb(card->hw.falcbase + card->hw.cpld_reg1,
+ cpc_readb(card->hw.falcbase +
+ card->hw.cpld_reg1) |
CPLD_REG1_GLOBAL_CLK);
break;
-
+ }
case PCI_DEVICE_ID_PC300_RX_1:
case PCI_DEVICE_ID_PC300_RX_2:
default:
@@ -2765,6 +3378,9 @@
d->chan = chan;
d->tx_skb = NULL;
+ d->trace_on = 0;
+ d->line_on = 0;
+ d->line_off = 0;
d->hdlc = (hdlc_device *)
kmalloc(sizeof(hdlc_device), GFP_KERNEL);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/pc300.h linux.20p6/drivers/net/pc300.h
--- linux.vanilla/drivers/net/pc300.h Thu Jan 1 01:00:00 1970
+++ linux.20p6/drivers/net/pc300.h Mon Jun 25 14:49:20 2001
@@ -0,0 +1,466 @@
+/*
+ * pc300.h Cyclades-PC300(tm) Kernel API Definitions.
+ *
+ * Author: Ivan Passos
+ *
+ * Copyright: (c) 1999-2001 Cyclades Corp.
+ *
+ * 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.
+ *
+ * $Log: pc300.h,v $
+ * Revision 2.5 2001/03/02 daniela
+ * Created struct pc300conf, to provide the hardware information to pc300util.
+ *
+ * Revision 2.4 2000/12/22 daniela
+ * Structures and defines to support pc300util: statistics, status,
+ * loopback tests, trace.
+ *
+ * Revision 2.3 2000/09/28 ivan
+ * Changed location of include files.
+ *
+ * Revision 2.2 2000/06/23 ivan
+ * Inclusion of 'loopback' field on structure 'pc300chconf', to allow
+ * loopback mode operation.
+ *
+ * Revision 2.1 2000/06/09 ivan
+ * Changes to use the new generic HDLC layer in the driver.
+ *
+ * Revision 2.0 2000/03/27 ivan
+ * Added support for the PC300/TE cards.
+ *
+ * Revision 1.1 2000/01/31 ivan
+ * Replaced 'pc300[drv|sca].h' former PC300 driver include files.
+ *
+ * Revision 1.0 1999/12/16 ivan
+ * First official release.
+ * Inclusion of 'nchan' field on structure 'pc300hw', to allow variable
+ * number of ports per card.
+ * Inclusion of 'if_ptr' field on structure 'pc300dev'.
+ *
+ * Revision 0.6 1999/11/17 ivan
+ * Changed X.25-specific function names to comply with adopted convention.
+ *
+ * Revision 0.5 1999/11/16 Daniela Squassoni
+ * X.25 support.
+ *
+ * Revision 0.4 1999/11/15 ivan
+ * Inclusion of 'clock' field on structure 'pc300hw'.
+ *
+ * Revision 0.3 1999/11/10 ivan
+ * IOCTL name changing.
+ * Inclusion of driver function prototypes.
+ *
+ * Revision 0.2 1999/11/03 ivan
+ * Inclusion of 'tx_skb' and union 'ifu' on structure 'pc300dev'.
+ *
+ * Revision 0.1 1999/01/15 ivan
+ * Initial version.
+ *
+ */
+
+#ifndef _PC300_H
+#define _PC300_H
+
+#ifndef __HDLC_H
+#include
+#endif
+#ifndef _HD64572_H
+#include "hd64572.h"
+#endif
+#ifndef _FALC_LH_H
+#include "falc-lh.h"
+#endif
+
+#ifndef CY_TYPES
+#define CY_TYPES
+#if defined(__alpha__)
+typedef unsigned long ucdouble; /* 64 bits, unsigned */
+typedef unsigned int uclong; /* 32 bits, unsigned */
+#else
+typedef unsigned long uclong; /* 32 bits, unsigned */
+#endif
+typedef unsigned short ucshort; /* 16 bits, unsigned */
+typedef unsigned char ucchar; /* 8 bits, unsigned */
+#endif /* CY_TYPES */
+
+#define PC300_DEVNAME "hdlc" /* Dev. name base (for hdlc0, hdlc1, etc.) */
+#define PC300_MAXINDEX 100 /* Max dev. name index (the '0' in hdlc0) */
+
+#define PC300_MAXCARDS 4 /* Max number of cards per system */
+#define PC300_MAXCHAN 2 /* Number of channels per card */
+
+#define PC300_PLX_WIN 0x80 /* PLX control window size (128b) */
+#define PC300_RAMSIZE 0x80000 /* RAM window size (512Kb) */
+#define PC300_SCASIZE 0x400 /* SCA window size (1Kb) */
+#define PC300_FALCSIZE 0x400 /* FALC window size (1Kb) */
+
+#define PC300_OSC_CLOCK 24576000
+#define PC300_PCI_CLOCK 33000000
+
+#define BD_DEF_LEN 0x0800 /* DMA buffer length (2KB) */
+#define DMA_TX_MEMSZ 0x8000 /* Total DMA Tx memory size (32KB/ch) */
+#define DMA_RX_MEMSZ 0x10000 /* Total DMA Rx memory size (64KB/ch) */
+
+#define N_DMA_TX_BUF (DMA_TX_MEMSZ / BD_DEF_LEN) /* DMA Tx buffers */
+#define N_DMA_RX_BUF (DMA_RX_MEMSZ / BD_DEF_LEN) /* DMA Rx buffers */
+
+/* DMA Buffer Offsets */
+#define DMA_TX_BASE ((N_DMA_TX_BUF + N_DMA_RX_BUF) * \
+ PC300_MAXCHAN * sizeof(pcsca_bd_t))
+#define DMA_RX_BASE (DMA_TX_BASE + PC300_MAXCHAN*DMA_TX_MEMSZ)
+
+/* DMA Descriptor Offsets */
+#define DMA_TX_BD_BASE 0x0000
+#define DMA_RX_BD_BASE (DMA_TX_BD_BASE + ((PC300_MAXCHAN*DMA_TX_MEMSZ / \
+ BD_DEF_LEN) * sizeof(pcsca_bd_t)))
+
+/* DMA Descriptor Macros */
+#define TX_BD_ADDR(chan, n) (DMA_TX_BD_BASE + \
+ ((N_DMA_TX_BUF*chan) + n) * sizeof(pcsca_bd_t))
+#define RX_BD_ADDR(chan, n) (DMA_RX_BD_BASE + \
+ ((N_DMA_RX_BUF*chan) + n) * sizeof(pcsca_bd_t))
+
+/* Macro to access the FALC registers (TE only) */
+#define F_REG(reg, chan) (0x200*(chan) + ((reg)<<2))
+
+/***************************************
+ * Memory access functions/macros *
+ * (required to support Alpha systems) *
+ ***************************************/
+#ifdef __KERNEL__
+#define cpc_writeb(port,val) {writeb((ucchar)(val),(ulong)(port)); mb();}
+#define cpc_writew(port,val) {writew((ushort)(val),(ulong)(port)); mb();}
+#define cpc_writel(port,val) {writel((uclong)(val),(ulong)(port)); mb();}
+
+#define cpc_readb(port) readb(port)
+#define cpc_readw(port) readw(port)
+#define cpc_readl(port) readl(port)
+
+#else /* __KERNEL__ */
+#define cpc_writeb(port,val) (*(volatile ucchar *)(port) = (ucchar)(val))
+#define cpc_writew(port,val) (*(volatile ucshort *)(port) = (ucshort)(val))
+#define cpc_writel(port,val) (*(volatile uclong *)(port) = (uclong)(val))
+
+#define cpc_readb(port) (*(volatile ucchar *)(port))
+#define cpc_readw(port) (*(volatile ucshort *)(port))
+#define cpc_readl(port) (*(volatile uclong *)(port))
+
+#endif /* __KERNEL__ */
+
+/****** Data Structures *****************************************************/
+
+/*
+ * RUNTIME_9050 - PLX PCI9050-1 local configuration and shared runtime
+ * registers. This structure can be used to access the 9050 registers
+ * (memory mapped).
+ */
+struct RUNTIME_9050 {
+ uclong loc_addr_range[4]; /* 00-0Ch : Local Address Ranges */
+ uclong loc_rom_range; /* 10h : Local ROM Range */
+ uclong loc_addr_base[4]; /* 14-20h : Local Address Base Addrs */
+ uclong loc_rom_base; /* 24h : Local ROM Base */
+ uclong loc_bus_descr[4]; /* 28-34h : Local Bus Descriptors */
+ uclong rom_bus_descr; /* 38h : ROM Bus Descriptor */
+ uclong cs_base[4]; /* 3C-48h : Chip Select Base Addrs */
+ uclong intr_ctrl_stat; /* 4Ch : Interrupt Control/Status */
+ uclong init_ctrl; /* 50h : EEPROM ctrl, Init Ctrl, etc */
+};
+
+#define PLX_9050_LINT1_ENABLE 0x01
+#define PLX_9050_LINT1_POL 0x02
+#define PLX_9050_LINT1_STATUS 0x04
+#define PLX_9050_LINT2_ENABLE 0x08
+#define PLX_9050_LINT2_POL 0x10
+#define PLX_9050_LINT2_STATUS 0x20
+#define PLX_9050_INTR_ENABLE 0x40
+#define PLX_9050_SW_INTR 0x80
+
+/* Masks to access the init_ctrl PLX register */
+#define PC300_CLKSEL_MASK (0x00000004UL)
+#define PC300_CHMEDIA_MASK(chan) (0x00000020UL<<(chan*3))
+#define PC300_CTYPE_MASK (0x00000800UL)
+
+/* CPLD Registers (base addr = falcbase, TE only) */
+/* CPLD v. 0 */
+#define CPLD_REG1 0x140 /* Chip resets, DCD/CTS status */
+#define CPLD_REG2 0x144 /* Clock enable , LED control */
+/* CPLD v. 2 or higher */
+#define CPLD_V2_REG1 0x100 /* Chip resets, DCD/CTS status */
+#define CPLD_V2_REG2 0x104 /* Clock enable , LED control */
+#define CPLD_ID_REG 0x108 /* CPLD version */
+
+/* CPLD Register bit description: for the FALC bits, they should always be
+ set based on the channel (use (bit<<(2*ch)) to access the correct bit for
+ that channel) */
+#define CPLD_REG1_FALC_RESET 0x01
+#define CPLD_REG1_SCA_RESET 0x02
+#define CPLD_REG1_GLOBAL_CLK 0x08
+#define CPLD_REG1_FALC_DCD 0x10
+#define CPLD_REG1_FALC_CTS 0x20
+
+#define CPLD_REG2_FALC_TX_CLK 0x01
+#define CPLD_REG2_FALC_RX_CLK 0x02
+#define CPLD_REG2_FALC_LED1 0x10
+#define CPLD_REG2_FALC_LED2 0x20
+
+/* Structure with FALC-related fields (TE only) */
+#define PC300_FALC_MAXLOOP 0x0000ffff /* for falc_issue_cmd() */
+
+typedef struct falc {
+ ucchar sync; /* If true FALC is synchronized */
+ ucchar active; /* if TRUE then already active */
+ ucchar loop_active; /* if TRUE a line loopback UP was received */
+ ucchar loop_gen; /* if TRUE a line loopback UP was issued */
+
+ ucchar num_channels;
+ ucchar offset; /* 1 for T1, 0 for E1 */
+ ucchar full_bandwidth;
+
+ ucchar xmb_cause;
+ ucchar multiframe_mode;
+
+ /* Statistics */
+ ucshort pden; /* Pulse Density violation count */
+ ucshort los; /* Loss of Signal count */
+ ucshort losr; /* Loss of Signal recovery count */
+ ucshort lfa; /* Loss of frame alignment count */
+ ucshort farec; /* Frame Alignment Recovery count */
+ ucshort lmfa; /* Loss of multiframe alignment count */
+ ucshort ais; /* Remote Alarm indication Signal count */
+ ucshort sec; /* One-second timer */
+ ucshort es; /* Errored second */
+ ucshort rai; /* remote alarm received */
+ ucshort bec;
+ ucshort fec;
+ ucshort cvc;
+ ucshort cec;
+ ucshort ebc;
+
+ /* Status */
+ ucchar red_alarm;
+ ucchar blue_alarm;
+ ucchar loss_fa;
+ ucchar yellow_alarm;
+ ucchar loss_mfa;
+ ucchar prbs;
+} falc_t;
+
+typedef struct falc_status {
+ ucchar sync; /* If true FALC is synchronized */
+ ucchar red_alarm;
+ ucchar blue_alarm;
+ ucchar loss_fa;
+ ucchar yellow_alarm;
+ ucchar loss_mfa;
+ ucchar prbs;
+} falc_status_t;
+
+typedef struct rsv_x21_status {
+ ucchar dcd;
+ ucchar dsr;
+ ucchar cts;
+ ucchar rts;
+ ucchar dtr;
+} rsv_x21_status_t;
+
+typedef struct pc300stats {
+ int hw_type;
+ uclong line_on;
+ uclong line_off;
+ struct net_device_stats gen_stats;
+ falc_t te_stats;
+} pc300stats_t;
+
+typedef struct pc300status {
+ int hw_type;
+ rsv_x21_status_t gen_status;
+ falc_status_t te_status;
+} pc300status_t;
+
+typedef struct pc300loopback {
+ char loop_type;
+ char loop_on;
+} pc300loopback_t;
+
+typedef struct pc300patterntst {
+ char patrntst_on; /* 0 - off; 1 - on; 2 - read num_errors */
+ ucshort num_errors;
+} pc300patterntst_t;
+
+typedef struct pc300dev {
+ void *if_ptr; /* General purpose pointer */
+ struct pc300ch *chan;
+ ucchar trace_on;
+ uclong line_on; /* DCD(X.21, RSV) / sync(TE) change counters */
+ uclong line_off;
+#ifdef __KERNEL__
+ char name[16];
+ void *private;
+ hdlc_device *hdlc;
+ struct sk_buff *tx_skb;
+#endif /* __KERNEL__ */
+}pc300dev_t;
+
+typedef struct pc300hw {
+ int type; /* RSV, X21, etc. */
+ int nchan; /* number of channels */
+ int irq; /* interrupt request level */
+ uclong clock; /* Board clock */
+ ucchar cpld_id; /* CPLD ID (TE only) */
+ ucshort cpld_reg1; /* CPLD reg 1 (TE only) */
+ ucshort cpld_reg2; /* CPLD reg 2 (TE only) */
+ uclong plxphys; /* PLX registers MMIO base (physical) */
+ uclong plxbase; /* PLX registers MMIO base (virtual) */
+ uclong plxsize; /* PLX registers MMIO size */
+ uclong scaphys; /* SCA registers MMIO base (physical) */
+ uclong scabase; /* SCA registers MMIO base (virtual) */
+ uclong scasize; /* SCA registers MMIO size */
+ uclong ramphys; /* On-board RAM MMIO base (physical) */
+ uclong rambase; /* On-board RAM MMIO base (virtual) */
+ uclong ramsize; /* On-board RAM MMIO size */
+ uclong falcphys; /* FALC registers MMIO base (physical) */
+ uclong falcbase; /* FALC registers MMIO base (virtual) */
+ uclong falcsize; /* FALC registers MMIO size */
+} pc300hw_t;
+
+typedef struct pc300chconf {
+ ucchar media; /* HW media (RS232, V.35, etc.) */
+ uclong proto; /* Protocol (PPP, X.25, etc.) */
+ uclong clkrate; /* Clock rate (in bps, 0 = ext. clock) */
+ ucchar loopback; /* Loopback mode */
+ ucchar monitor; /* Monitor mode (0 = off, !0 = on) */
+
+ /* TE-specific parameters */
+ ucchar lcode; /* Line Code (AMI, B8ZS, etc.) */
+ ucchar fr_mode; /* Frame Mode (ESF, D4, etc.) */
+ ucchar lbo; /* Line Build Out */
+ ucchar rx_sens; /* Rx Sensitivity (long- or short-haul) */
+ uclong tslot_bitmap; /* bit[i]=1 => timeslot _i_ is active */
+} pc300chconf_t;
+
+typedef struct pc300ch {
+ struct pc300 *card;
+ int channel;
+ pc300dev_t d;
+ pc300chconf_t conf;
+ ucchar tx_first_bd; /* First TX DMA block descr. w/ data */
+ ucchar tx_next_bd; /* Next free TX DMA block descriptor */
+ ucchar rx_first_bd; /* First free RX DMA block descriptor */
+ ucchar rx_last_bd; /* Last free RX DMA block descriptor */
+ falc_t falc; /* FALC structure (TE only) */
+} pc300ch_t;
+
+typedef struct pc300 {
+ pc300hw_t hw; /* hardware config. */
+ pc300ch_t chan[PC300_MAXCHAN];
+#ifdef __KERNEL__
+ spinlock_t card_lock;
+#endif /* __KERNEL__ */
+} pc300_t;
+
+typedef struct pc300conf {
+ pc300hw_t hw;
+ pc300chconf_t conf;
+} pc300conf_t;
+
+/* DEV ioctl() commands */
+#define N_SPPP_IOCTLS 2
+
+enum pc300_ioctl_cmds {
+ SIOCCPCRESERVED = (SIOCDEVPRIVATE + N_SPPP_IOCTLS),
+ SIOCGPC300CONF,
+ SIOCSPC300CONF,
+ SIOCGPC300STATUS,
+ SIOCGPC300FALCSTATUS,
+ SIOCGPC300UTILSTATS,
+ SIOCGPC300UTILSTATUS,
+ SIOCSPC300TRACE,
+ SIOCSPC300LOOPBACK,
+ SIOCSPC300PATTERNTEST,
+};
+
+/* Loopback types - PC300/TE boards */
+enum pc300_loopback_cmds {
+ PC300LOCLOOP = 1,
+ PC300REMLOOP,
+ PC300PAYLOADLOOP,
+ PC300GENLOOPUP,
+ PC300GENLOOPDOWN,
+};
+
+/* Control Constant Definitions */
+#define PC300_RSV 0x01
+#define PC300_X21 0x02
+#define PC300_TE 0x03
+
+#define PC300_LC_AMI 0x01
+#define PC300_LC_B8ZS 0x02
+#define PC300_LC_NRZ 0x03
+#define PC300_LC_HDB3 0x04
+
+/* Framing (T1) */
+#define PC300_FR_ESF 0x01
+#define PC300_FR_D4 0x02
+#define PC300_FR_ESF_JAPAN 0x03
+
+/* Framing (E1) */
+#define PC300_FR_MF_CRC4 0x04
+#define PC300_FR_MF_NON_CRC4 0x05
+#define PC300_FR_UNFRAMED 0x06
+
+#define PC300_LBO_0_DB 0x00
+#define PC300_LBO_7_5_DB 0x01
+#define PC300_LBO_15_DB 0x02
+#define PC300_LBO_22_5_DB 0x03
+
+#define PC300_RX_SENS_SH 0x01
+#define PC300_RX_SENS_LH 0x02
+
+#define PC300_TX_TIMEOUT (2*HZ)
+#define PC300_TX_QUEUE_LEN 10
+#define PC300_DEF_MTU 1500
+
+#ifdef __KERNEL__
+/* Function Prototypes */
+static void tx_dma_buf_pt_init(pc300_t *, int);
+static void tx_dma_buf_init(pc300_t *, int);
+static void rx_dma_buf_pt_init(pc300_t *, int);
+static void rx_dma_buf_init(pc300_t *, int);
+static void tx_dma_buf_check(pc300_t *, int);
+static void rx_dma_buf_check(pc300_t *, int);
+int dma_buf_write(pc300_t *, int, ucchar *, int);
+int dma_buf_read(pc300_t *, int, struct sk_buff *);
+void tx_dma_start(pc300_t *, int);
+void rx_dma_start(pc300_t *, int);
+void tx_dma_stop(pc300_t *, int);
+void rx_dma_stop(pc300_t *, int);
+int cpc_queue_xmit(struct sk_buff *, struct device *);
+void cpc_net_rx(hdlc_device *);
+#ifdef CONFIG_PC300_X25
+int cpc_x25_packetlayer_xmit(struct sk_buff *, struct device *);
+void cpc_lapb_connected(void *, int);
+void cpc_lapb_disconnected(void *, int);
+void cpc_lapb_data_indication(void *, struct sk_buff *);
+void cpc_lapb_data_transmit(void *, struct sk_buff *);
+#endif /* CONFIG_PC300_X25 */
+static void cpc_intr(int, void *, struct pt_regs *);
+void cpc_sca_status(pc300_t *, int);
+int cpc_ioctl(hdlc_device *, struct ifreq *, int);
+static int clock_rate_calc(uclong, uclong, int *);
+int ch_config(pc300dev_t *);
+int rx_config(pc300dev_t *);
+int tx_config(pc300dev_t *);
+int cpc_opench(pc300dev_t *);
+void cpc_closech(pc300dev_t *);
+int cpc_open(hdlc_device *);
+void cpc_close(hdlc_device *);
+static uclong detect_ram(pc300_t *);
+static void plx_init(pc300_t *);
+static int cpc_detect(void);
+static void cpc_trace(struct device *, struct sk_buff *, char);
+#endif /* __KERNEL__ */
+
+#endif /* _PC300_H */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/rtl8139.c linux.20p6/drivers/net/rtl8139.c
--- linux.vanilla/drivers/net/rtl8139.c Sun Mar 25 17:31:20 2001
+++ linux.20p6/drivers/net/rtl8139.c Mon Jun 18 08:27:15 2001
@@ -1425,8 +1425,11 @@
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
mc_filter[1] = mc_filter[0] = 0;
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
- i++, mclist = mclist->next)
- set_bit(ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26, mc_filter);
+ i++, mclist = mclist->next) {
+ int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
+
+ mc_filter[bit_nr >> 5] |= cpu_to_le32(1 << (bit_nr & 31));
+ }
}
/* We can safely update without stopping the chip. */
outb(rx_mode, ioaddr + RxConfig);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sbni.c linux.20p6/drivers/net/sbni.c
--- linux.vanilla/drivers/net/sbni.c Sun Mar 25 17:31:21 2001
+++ linux.20p6/drivers/net/sbni.c Tue Jun 19 09:59:54 2001
@@ -758,7 +758,7 @@
*/
DP( printk("%s: sbni_recv SendComplete\n",dev->name); );
/*
- * We sucessfully sent current packet
+ * We successfully sent current packet
*/
if(lp->waitack)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sdla_fr.c linux.20p6/drivers/net/sdla_fr.c
--- linux.vanilla/drivers/net/sdla_fr.c Sun Mar 25 17:31:19 2001
+++ linux.20p6/drivers/net/sdla_fr.c Tue Jun 19 09:59:54 2001
@@ -77,7 +77,7 @@
* the if clause for it(0,dev->tbusy)
* forever.
* The code got into this stage due to an
-* interrupt occuring within the if clause for
+* interrupt occurring within the if clause for
* set_bit(0,dev->tbusy). Since an interrupt
* disables furhter transmit interrupt and
* makes dev->tbusy = 0, this effect was undone
@@ -1329,7 +1329,7 @@
/*============================================================================
- * Setup so that a frame can be transmitted on the occurence of a transmit
+ * Setup so that a frame can be transmitted on the occurrence of a transmit
* interrupt.
*/
static void setup_for_delayed_transmit (struct device* dev, void* buf,
@@ -1647,7 +1647,7 @@
++card->statistics.isr_intr_test;
break;
- case FR_INTR_DLC: /* Event interrupt occured */
+ case FR_INTR_DLC: /* Event interrupt occurred */
mbox->cmd.command = FR_READ_STATUS;
mbox->cmd.length = 0;
err = sdla_exec(mbox) ? mbox->cmd.result : CMD_TIMEOUT;
@@ -1684,7 +1684,7 @@
/*============================================================================
* Receive interrupt handler.
* When a receive interrupt occurs do the following:
- * 1- Find the structure for the dlci that the interrupt occured on
+ * 1- Find the structure for the dlci that the interrupt occurred on
* 2- If it doesn't exist then print appropriate msg and goto step 8.
* 3- If it exist then copy data to a skb.
* 4- If skb contains Sangoma UDP data then process them
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sis900.c linux.20p6/drivers/net/sis900.c
--- linux.vanilla/drivers/net/sis900.c Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/net/sis900.c Fri May 4 23:17:33 2001
@@ -1,6 +1,6 @@
/* sis900.c: A SiS 900/7016 PCI Fast Ethernet driver for Linux.
Copyright 1999 Silicon Integrated System Corporation
- Revision: 1.06.07 Jan. 8 2001
+ Revision: 1.06.08 Apr. 3 2001
Modified from the driver which is originally written by Donald Becker.
@@ -18,6 +18,7 @@
preliminary Rev. 1.0 Jan. 18, 1998
http://www.sis.com.tw/support/databook.htm
+ Rev 1.06.08 Mar. 2 2001 Hui-Fen Hsu (hfhsu@sis.com.tw) some bug fix & 635M/B support
Rev 1.06.07 Jan. 8 2001 Lei-Chun Chang added RTL8201 PHY support
Rev 1.06.06 Sep. 6 2000 Lei-Chun Chang added ICS1893 PHY support
Rev 1.06.05 Aug. 22 2000 Lei-Chun Chang (lcchang@sis.com.tw) modified 630E equalier workaroung rule
@@ -53,7 +54,7 @@
#include "sis900.h"
static const char *version =
-"sis900.c: v1.06.07 01/08/01\n";
+"sis900.c: v1.06.08 04/03/2001\n";
static int max_interrupt_work = 20;
static int multicast_filter_limit = 128;
@@ -79,34 +80,36 @@
PCI_COMMAND_IO|PCI_COMMAND_MASTER, SIS900_TOTAL_SIZE, sis900_mac_probe},
{ "SiS 7016 PCI Fast Ethernet",PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7016,
PCI_COMMAND_IO|PCI_COMMAND_MASTER, SIS900_TOTAL_SIZE, sis900_mac_probe},
- {0,}, /* 0 terminated list. */
+ {0,}, /* 0 terminatted list. */
};
-static void sis900_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex);
-static void amd79c901_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex);
-static void ics1893_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex);
-static void rtl8201_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex);
+static void sis900_read_mode(struct device *net_dev, int *speed, int *duplex);
static struct mii_chip_info {
const char * name;
u16 phy_id0;
u16 phy_id1;
- void (*read_mode) (struct device *net_dev, int phy_addr, int *speed, int *duplex);
+ u8 phy_types;
+#define HOME 0x0001
+#define LAN 0x0002
+#define MIX 0x0003
} mii_chip_table[] = {
- {"SiS 900 Internal MII PHY", 0x001d, 0x8000, sis900_read_mode},
- {"SiS 7014 Physical Layer Solution", 0x0016, 0xf830,sis900_read_mode},
- {"AMD 79C901 10BASE-T PHY", 0x0000, 0x35b9, amd79c901_read_mode},
- {"AMD 79C901 HomePNA PHY", 0x0000, 0x35c8, amd79c901_read_mode},
- {"ICS 1893 Integrated PHYceiver" , 0x0015, 0xf441,ics1893_read_mode},
- {"RTL 8201 10/100Mbps Phyceiver" , 0x0000, 0x8201,rtl8201_read_mode},
+ { "SiS 900 Internal MII PHY", 0x001d, 0x8000, LAN },
+ { "SiS 7014 Physical Layer Solution", 0x0016, 0xf830, LAN },
+ { "AMD 79C901 10BASE-T PHY", 0x0000, 0x6B70, LAN },
+ { "AMD 79C901 HomePNA PHY", 0x0000, 0x6B90, HOME},
+ { "ICS LAN PHY", 0x0015, 0xF440, LAN },
+ { "NS 83851 PHY", 0x2000, 0x5C20, MIX },
{0,},
};
struct mii_phy {
struct mii_phy * next;
- struct mii_chip_info * chip_info;
int phy_addr;
+ u16 phy_id0;
+ u16 phy_id1;
u16 status;
+ u8 phy_types;
};
typedef struct _BufferDesc {
@@ -122,9 +125,11 @@
struct mac_chip_info * mac;
struct mii_phy * mii;
+ struct mii_phy * first_mii; /* record the first mii structure */
unsigned int cur_phy;
- struct timer_list timer; /* Link status detection timer. */
+ struct timer_list timer; /* Link status detection timer. */
+ u8 autong_complete; /* 1: auto-negotiate complete */
unsigned int cur_rx, dirty_rx; /* producer/comsumer pointers for Tx/Rx ring */
unsigned int cur_tx, dirty_tx;
@@ -167,10 +172,15 @@
static int sis900_close(struct device *net_dev);
static int mii_ioctl(struct device *net_dev, struct ifreq *rq, int cmd);
static struct enet_statistics *sis900_get_stats(struct device *net_dev);
-static u16 sis900_compute_hashtable_index(u8 *addr);
+static u16 sis900_compute_hashtable_index(u8 *addr, u8 revision);
static void set_rx_mode(struct device *net_dev);
static void sis900_reset(struct device *net_dev);
-static void sis630e_set_eq(struct device *net_dev);
+static void sis630_set_eq(struct device *net_dev, u8 revision);
+static u16 sis900_default_phy(struct device * net_dev);
+static void sis900_set_capability( struct device *net_dev ,struct mii_phy *phy);
+static u16 sis900_reset_phy(struct device *net_dev, int phy_addr);
+static void sis900_auto_negotiate(struct device *net_dev, int phy_addr);
+static void sis900_set_mode (long ioaddr, int speed, int duplex);
/* A list of all installed SiS900 devices, for removing the driver module. */
static struct device *root_sis900_dev = NULL;
@@ -265,26 +275,30 @@
return 1;
}
-/* SiS630E A1, The Mac address is hardcoded in the RFCR register so it is actually not necessary to
- probe the MAC address */
-static int sis630ea1_get_mac_addr(struct pci_dev * pci_dev, struct device *net_dev)
+/* 635 model : set Mac reload bit and get mac address from rfdr */
+static int sis635_get_mac_addr(struct pci_dev * pci_dev, struct device *net_dev)
{
- long ioaddr = pci_dev->base_address[0] & ~3;
- u32 reg;
- int i;
+ long ioaddr = net_dev->base_addr;
+ u32 rfcrSave;
+ u32 i;
- /* reload MAC address */
- reg = inl(ioaddr + cr);
- outl(reg | RELOAD, ioaddr + cr);
+ rfcrSave = inl(rfcr + ioaddr);
- reg = inl(ioaddr + cr);
- outl(reg & ~RELOAD, ioaddr + cr);
+ outl(rfcrSave | RELOAD, ioaddr + cr);
+ outl(0, ioaddr + cr);
- for (i = 0; i < 3; i++) {
- outl((u32)(0x00000004+i) << RFADDR_shift, ioaddr + rfcr);
- ((u16 *)(net_dev->dev_addr))[i] = inl(ioaddr + rfdr);
+ /* disable packet filtering before setting filter */
+ outl(rfcrSave & ~RFEN, rfcr + ioaddr);
+
+ /* load MAC addr to filter data register */
+ for (i = 0 ; i < 3 ; i++) {
+ outl((i << RFADDR_shift), ioaddr + rfcr);
+ *( ((u16 *)net_dev->dev_addr) + i) = inw(ioaddr + rfdr);
}
+ /* enable packet filitering */
+ outl(rfcrSave | RFEN, rfcr + ioaddr);
+
return 1;
}
@@ -304,16 +318,31 @@
if ((net_dev = init_etherdev(net_dev, 0)) == NULL)
return NULL;
+ if ((net_dev->priv = kmalloc(sizeof(struct sis900_private), GFP_KERNEL)) == NULL) {
+ unregister_netdev(net_dev);
+ return NULL;
+ }
+
+ sis_priv = net_dev->priv;
+ memset(sis_priv, 0, sizeof(struct sis900_private));
+
+ /* We do a request_region() to register /proc/ioports info. */
+ request_region(ioaddr, mac->io_size, net_dev->name);
+ net_dev->base_addr = ioaddr;
+ net_dev->irq = irq;
+ sis_priv->pci_dev = pci_dev;
+ sis_priv->mac = mac;
+
pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &revision);
- if (revision == SIS630E_REV || revision == SIS630EA1_REV)
- ret = sis630e_get_mac_addr(pci_dev, net_dev);
- else if (revision == SIS630S_REV)
+ if ( revision == SIS630E_900_REV )
ret = sis630e_get_mac_addr(pci_dev, net_dev);
+ else if ((revision > 0x81) && (revision <= 0x90))
+ ret = sis635_get_mac_addr(pci_dev, net_dev);
else
ret = sis900_get_mac_addr(pci_dev, net_dev);
if (ret == 0) {
- unregister_netdevice(net_dev);
+ unregister_netdev(net_dev);
return NULL;
}
@@ -324,21 +353,6 @@
printk("%2.2x:", (u8)net_dev->dev_addr[i]);
printk("%2.2x.\n", net_dev->dev_addr[i]);
- if ((net_dev->priv = kmalloc(sizeof(struct sis900_private), GFP_KERNEL)) == NULL) {
- unregister_netdevice(net_dev);
- return NULL;
- }
-
- sis_priv = net_dev->priv;
- memset(sis_priv, 0, sizeof(struct sis900_private));
-
- /* We do a request_region() to register /proc/ioports info. */
- request_region(ioaddr, mac->io_size, net_dev->name);
- net_dev->base_addr = ioaddr;
- net_dev->irq = irq;
- sis_priv->pci_dev = pci_dev;
- sis_priv->mac = mac;
-
/* probe for mii transciver */
if (sis900_mii_probe(net_dev) == 0) {
unregister_netdev(net_dev);
@@ -361,81 +375,171 @@
return net_dev;
}
+/* sis900_mii_probe: - Probe MII PHY for sis900 */
static int sis900_mii_probe (struct device * net_dev)
{
struct sis900_private * sis_priv = (struct sis900_private *)net_dev->priv;
+ u16 poll_bit = MII_STAT_LINK, status = 0;
+ unsigned int timeout = jiffies + 5 * HZ;
int phy_addr;
u8 revision;
sis_priv->mii = NULL;
/* search for total of 32 possible mii phy addresses */
- for (phy_addr = 0; phy_addr < 32; phy_addr++) {
+ for (phy_addr = 0; phy_addr < 32; phy_addr++) {
+ struct mii_phy * mii_phy = NULL;
u16 mii_status;
- u16 phy_id0, phy_id1;
int i;
- mii_status = mdio_read(net_dev, phy_addr, MII_STATUS);
+ for(i=0; i<2; i++)
+ mii_status = mdio_read(net_dev, phy_addr, MII_STATUS);
+
if (mii_status == 0xffff || mii_status == 0x0000)
/* the mii is not accessable, try next one */
continue;
-
- phy_id0 = mdio_read(net_dev, phy_addr, MII_PHY_ID0);
- phy_id1 = mdio_read(net_dev, phy_addr, MII_PHY_ID1);
-
- /* search our mii table for the current mii */
- for (i = 0; mii_chip_table[i].phy_id1; i++)
- if (phy_id0 == mii_chip_table[i].phy_id0 &&
- phy_id1 == mii_chip_table[i].phy_id1) {
- struct mii_phy * mii_phy;
-
- printk(KERN_INFO
- "%s: %s transceiver found at address %d.\n",
- net_dev->name, mii_chip_table[i].name,
- phy_addr);;
- if ((mii_phy = kmalloc(sizeof(struct mii_phy), GFP_KERNEL)) != NULL) {
- mii_phy->chip_info = mii_chip_table+i;
- mii_phy->phy_addr = phy_addr;
- mii_phy->status = mdio_read(net_dev, phy_addr,
- MII_STATUS);
- mii_phy->next = sis_priv->mii;
- sis_priv->mii = mii_phy;
- }
- /* the current mii is on our mii_info_table,
- try next address */
+
+ if ((mii_phy = kmalloc(sizeof(struct mii_phy), GFP_KERNEL)) == NULL) {
+ printk(KERN_INFO "Cannot allocate mem for struct mii_phy\n");
+ return 0;
+ }
+
+ mii_phy->phy_id0 = mdio_read(net_dev, phy_addr, MII_PHY_ID0);
+ mii_phy->phy_id1 = mdio_read(net_dev, phy_addr, MII_PHY_ID1);
+ mii_phy->phy_addr = phy_addr;
+ mii_phy->status = mii_status;
+ mii_phy->next = sis_priv->mii;
+ sis_priv->mii = mii_phy;
+ sis_priv->first_mii = mii_phy;
+
+ for (i=0; mii_chip_table[i].phy_id1; i++)
+ if ( ( mii_phy->phy_id0 == mii_chip_table[i].phy_id0 ) &&
+ ( (mii_phy->phy_id1 & 0xFFF0) == mii_chip_table[i].phy_id1 )){
+
+ mii_phy->phy_types = mii_chip_table[i].phy_types;
+ if(mii_chip_table[i].phy_types == MIX)
+ mii_phy->phy_types =
+ (mii_status & (MII_STAT_CAN_TX_FDX | MII_STAT_CAN_TX))?LAN:HOME;
+ printk(KERN_INFO "%s: %s transceiver found at address %d.\n",
+ net_dev->name, mii_chip_table[i].name, phy_addr);
break;
}
- }
+ if( !mii_chip_table[i].phy_id1 )
+ printk(KERN_INFO "%s: Unknown PHY transceiver found at address %d.\n",
+ net_dev->name, phy_addr);
+ }
+
if (sis_priv->mii == NULL) {
printk(KERN_INFO "%s: No MII transceivers found!\n",
net_dev->name);
return 0;
}
- /* arbitrary choose that last PHY as current PHY */
- sis_priv->cur_phy = sis_priv->mii->phy_addr;
- printk(KERN_INFO "%s: Using %s as default\n", net_dev->name,
- sis_priv->mii->chip_info->name);
+ /* Slect Default PHY to put in sis_priv->mii & sis_priv->cur_phy */
+ sis_priv->mii = NULL;
+ sis900_default_phy( net_dev );
+
+ /* Reset PHY if default PHY is internal sis900 */
+ if( (sis_priv->mii->phy_id0 == 0x001D) &&
+ ( (sis_priv->mii->phy_id1&0xFFF0) == 0x8000) )
+ status = sis900_reset_phy( net_dev, sis_priv->cur_phy );
+
+ if( status & MII_STAT_LINK ){
+ while (poll_bit) {
+ current->state = TASK_INTERRUPTIBLE;
+ schedule_timeout(0);
+ poll_bit ^= (mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS) & poll_bit);
+ if (jiffies >= timeout) {
+ printk(KERN_WARNING "%s: reset phy and link down\n", net_dev->name);
+ return -ETIME;
+ }
+ }
+ }
pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision);
- if (revision == SIS630E_REV) {
+ if (revision == SIS630E_900_REV) {
/* SiS 630E has some bugs on default value of PHY registers */
mdio_write(net_dev, sis_priv->cur_phy, MII_ANADV, 0x05e1);
mdio_write(net_dev, sis_priv->cur_phy, MII_CONFIG1, 0x22);
mdio_write(net_dev, sis_priv->cur_phy, MII_CONFIG2, 0xff00);
mdio_write(net_dev, sis_priv->cur_phy, MII_MASK, 0xffc0);
- mdio_write(net_dev, sis_priv->cur_phy, MII_CONTROL, 0x1000);
+ //mdio_write(net_dev, sis_priv->cur_phy, MII_CONTROL, 0x1000);
}
if (sis_priv->mii->status & MII_STAT_LINK)
sis_priv->LinkOn = TRUE;
else
sis_priv->LinkOn = FALSE;
-
+
return 1;
}
+
+/* sis900_default_phy : Select one default PHY for sis900 mac */
+static u16 sis900_default_phy(struct device * net_dev)
+{
+ struct sis900_private * sis_priv = (struct sis900_private *)net_dev->priv;
+ struct mii_phy *phy = NULL, *phy_home = NULL, *default_phy = NULL;
+ u16 status;
+
+ for( phy=sis_priv->first_mii; phy; phy=phy->next ){
+ status = mdio_read(net_dev, phy->phy_addr, MII_STATUS);
+ status = mdio_read(net_dev, phy->phy_addr, MII_STATUS);
+
+ /* Link ON & Not select deafalut PHY */
+ if ( (status & MII_STAT_LINK) && !(default_phy) )
+ default_phy = phy;
+ else{
+ status = mdio_read(net_dev, phy->phy_addr, MII_CONTROL);
+ mdio_write(net_dev, phy->phy_addr, MII_CONTROL,
+ status | MII_CNTL_AUTO | MII_CNTL_ISOLATE);
+ if( phy->phy_types == HOME )
+ phy_home = phy;
+ }
+ }
+
+ if( (!default_phy) && phy_home )
+ default_phy = phy_home;
+ else if(!default_phy)
+ default_phy = sis_priv->first_mii;
+
+ if( sis_priv->mii != default_phy ){
+ sis_priv->mii = default_phy;
+ sis_priv->cur_phy = default_phy->phy_addr;
+ printk(KERN_INFO "%s: Using transceiver found at address %d as default\n", net_dev->name,sis_priv->cur_phy);
+ }
+
+ status = mdio_read(net_dev, sis_priv->cur_phy, MII_CONTROL);
+ status &= (~MII_CNTL_ISOLATE);
+
+ mdio_write(net_dev, sis_priv->cur_phy, MII_CONTROL, status);
+ status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS);
+ status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS);
+
+ return status;
+}
+
+
+/* sis900_set_capability : set the media capability of network adapter */
+static void sis900_set_capability( struct device *net_dev , struct mii_phy *phy )
+{
+ u16 cap;
+ u16 status;
+
+ status = mdio_read(net_dev, phy->phy_addr, MII_STATUS);
+ status = mdio_read(net_dev, phy->phy_addr, MII_STATUS);
+
+ cap = MII_NWAY_CSMA_CD |
+ ((phy->status & MII_STAT_CAN_TX_FDX)? MII_NWAY_TX_FDX:0) |
+ ((phy->status & MII_STAT_CAN_TX) ? MII_NWAY_TX:0) |
+ ((phy->status & MII_STAT_CAN_T_FDX) ? MII_NWAY_T_FDX:0)|
+ ((phy->status & MII_STAT_CAN_T) ? MII_NWAY_T:0);
+
+ mdio_write( net_dev, phy->phy_addr, MII_ANADV, cap );
+}
+
+
/* Delay between EEPROM clock transitions. */
#define eeprom_delay() inl(ee_addr)
@@ -580,6 +684,19 @@
return;
}
+static u16 sis900_reset_phy(struct device *net_dev, int phy_addr)
+{
+ int i = 0;
+ u16 status;
+
+ while (i++ < 2)
+ status = mdio_read(net_dev, phy_addr, MII_STATUS);
+
+ mdio_write( net_dev, phy_addr, MII_CONTROL, MII_CNTL_RESET );
+
+ return status;
+}
+
static int
sis900_open(struct device *net_dev)
{
@@ -592,8 +709,7 @@
/* Equalizer workaroung Rule */
pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision);
- if (revision == SIS630E_REV || revision == SIS630EA1_REV)
- sis630e_set_eq(net_dev);
+ sis630_set_eq(net_dev, revision);
if (request_irq(net_dev->irq, &sis900_interrupt, SA_SHIRQ, net_dev->name, net_dev)) {
return -EAGAIN;
@@ -641,7 +757,7 @@
rfcrSave = inl(rfcr + ioaddr);
/* disable packet filtering before setting filter */
- outl(rfcrSave & ~RFEN, rfcr);
+ outl(rfcrSave & ~RFEN, rfcr + ioaddr);
/* load MAC addr to filter data register */
for (i = 0 ; i < 3 ; i++) {
@@ -734,51 +850,76 @@
net_dev->name, inl(ioaddr + rxdp));
}
-/* 630E equalizer workaroung rule(Cyrus Huang 08/15)
- PHY register 14h(Test)
- Bit 14: 0 -- Automatically dectect (default)
- 1 -- Manually set Equalizer filter
- Bit 13: 0 -- (Default)
- 1 -- Speed up convergence of equalizer setting
- Bit 9 : 0 -- (Default)
- 1 -- Disable Baseline Wander
- Bit 3~7 -- Equalizer filter setting
-
- Link ON: Set Bit 9, 13 to 1, Bit 14 to 0
- Then calculate equalizer value
- Then set equalizer value, and set Bit 14 to 1, Bit 9 to 0
- Link Off:Set Bit 13 to 1, Bit 14 to 0
-
- Calculate Equalizer value:
- When Link is ON and Bit 14 is 0, SIS900PHY will auto-dectect proper equalizer value.
- When the equalizer is stable, this value is not a fixed value. It will be within
- a small range(eg. 7~9). Then we get a minimum and a maximum value(eg. min=7, max=9)
- 0 <= max <= 4 --> set equalizer to max
- 5 <= max <= 14 --> set equalizer to max+1 or
- set equalizer to max+2 if max == min
- max >= 15 --> set equalizer to max+5 or
- set equalizer to max+6 if max == min
-*/
-static void sis630e_set_eq(struct device *net_dev)
+/**
+ * sis630_set_eq: - set phy equalizer value for 630 LAN
+ * @net_dev: the net device to set equalizer value
+ * @revision: 630 LAN revision number
+ *
+ * 630E equalizer workaround rule(Cyrus Huang 08/15)
+ * PHY register 14h(Test)
+ * Bit 14: 0 -- Automatically dectect (default)
+ * 1 -- Manually set Equalizer filter
+ * Bit 13: 0 -- (Default)
+ * 1 -- Speed up convergence of equalizer setting
+ * Bit 9 : 0 -- (Default)
+ * 1 -- Disable Baseline Wander
+ * Bit 3~7 -- Equalizer filter setting
+ * Link ON: Set Bit 9, 13 to 1, Bit 14 to 0
+ * Then calculate equalizer value
+ * Then set equalizer value, and set Bit 14 to 1, Bit 9 to 0
+ * Link Off:Set Bit 13 to 1, Bit 14 to 0
+ * Calculate Equalizer value:
+ * When Link is ON and Bit 14 is 0, SIS900PHY will auto-dectect proper equalizer value.
+ * When the equalizer is stable, this value is not a fixed value. It will be within
+ * a small range(eg. 7~9). Then we get a minimum and a maximum value(eg. min=7, max=9)
+ * 0 <= max <= 4 --> set equalizer to max
+ * 5 <= max <= 14 --> set equalizer to max+1 or set equalizer to max+2 if max == min
+ * max >= 15 --> set equalizer to max+5 or set equalizer to max+6 if max == min
+ */
+
+static void sis630_set_eq(struct device *net_dev, u8 revision)
{
struct sis900_private *sis_priv = (struct sis900_private *)net_dev->priv;
u16 reg14h, eq_value, max_value=0, min_value=0;
+ u8 host_bridge_rev;
int i, maxcount=10;
+ struct pci_dev *dev=NULL;
+
+ if ( !(revision == SIS630E_900_REV || revision == SIS630EA1_900_REV ||
+ revision == SIS630A_900_REV) )
+ return;
+
+ if ((dev = pci_find_device(SIS630_VENDOR_ID, SIS630_DEVICE_ID, dev)))
+ pci_read_config_byte(dev, PCI_CLASS_REVISION, &host_bridge_rev);
- if (sis_priv->LinkOn == TRUE) {
+ if (sis_priv->LinkOn) {
reg14h=mdio_read(net_dev, sis_priv->cur_phy, MII_RESV);
mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, (0x2200 | reg14h) & 0xBFFF);
for (i=0; i < maxcount; i++) {
eq_value=(0x00F8 & mdio_read(net_dev, sis_priv->cur_phy, MII_RESV)) >> 3;
+ if (i == 0)
+ max_value=min_value=eq_value;
max_value=(eq_value > max_value) ? eq_value : max_value;
min_value=(eq_value < min_value) ? eq_value : min_value;
- }
- if (max_value < 5)
- eq_value=max_value;
- else if (max_value >= 5 && max_value < 15)
- eq_value=(max_value == min_value) ? max_value+2 : max_value+1;
- else if (max_value >= 15)
- eq_value=(max_value == min_value) ? max_value+6 : max_value+5;
+ }
+ /* 630E rule to determine the equalizer value */
+ if (revision == SIS630E_900_REV || revision == SIS630EA1_900_REV) {
+ if (max_value < 5)
+ eq_value=max_value;
+ else if (max_value >= 5 && max_value < 15)
+ eq_value=(max_value == min_value) ? max_value+2 : max_value+1;
+ else if (max_value >= 15)
+ eq_value=(max_value == min_value) ? max_value+6 : max_value+5;
+ }
+ /* 630B0&B1 rule to determine the equalizer value */
+ if (revision == SIS630A_900_REV &&
+ (host_bridge_rev == SIS630B0 || host_bridge_rev == SIS630B1)) {
+ if (max_value == 0)
+ eq_value=3;
+ else
+ eq_value=(max_value+min_value+1)/2;
+ }
+ /* write equalizer value and setting */
reg14h=mdio_read(net_dev, sis_priv->cur_phy, MII_RESV);
reg14h=(reg14h & 0xFF07) | ((eq_value << 3) & 0x00F8);
reg14h=(reg14h | 0x6000) & 0xFDFF;
@@ -786,14 +927,19 @@
}
else {
reg14h=mdio_read(net_dev, sis_priv->cur_phy, MII_RESV);
- mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, (reg14h | 0x2000) & 0xBFFF);
+ if (revision == SIS630A_900_REV &&
+ (host_bridge_rev == SIS630B0 || host_bridge_rev == SIS630B1))
+ mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, (reg14h | 0x2200) & 0xBFFF);
+ else
+ mdio_write(net_dev, sis_priv->cur_phy, MII_RESV, (reg14h | 0x2000) & 0xBFFF);
}
return;
}
+
/* on each timer ticks we check two things, Link Status (ON/OFF) and
- Link Mode (10/100/Full/Half)
- */
+ Link Mode (10/100/Full/Half)
+*/
static void sis900_timer(unsigned long data)
{
struct device *net_dev = (struct device *)data;
@@ -801,77 +947,91 @@
struct mii_phy *mii_phy = sis_priv->mii;
static int next_tick = 5*HZ;
u16 status;
- u8 revision;
-
- status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS);
- status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS);
+ u8 revision;
- /* current mii phy is failed to link, try another one */
- while (!(status & MII_STAT_LINK)) {
- if (mii_phy->next == NULL) {
- if (sis_priv->LinkOn) {
- /* link stat change from ON to OFF */
- next_tick = HZ;
- sis_priv->LinkOn = FALSE;
-
- /* Equalizer workaroung Rule */
- pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision);
- if (revision == SIS630E_REV || revision == SIS630EA1_REV)
- sis630e_set_eq(net_dev);
+ if(!sis_priv->autong_complete){
+ int speed, duplex = 0;
- printk(KERN_INFO "%s: Media Link Off\n",
- net_dev->name);
- }
- sis_priv->timer.expires = jiffies + next_tick;
- add_timer(&sis_priv->timer);
- return;
+ sis900_read_mode(net_dev, &speed, &duplex);
+ if(duplex){
+ sis900_set_mode(net_dev->base_addr, speed, duplex);
+ pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision);
+ sis630_set_eq(net_dev, revision);
}
- mii_phy = mii_phy->next;
- status = mdio_read(net_dev, mii_phy->phy_addr, MII_STATUS);
+
+ sis_priv->timer.expires = jiffies + HZ;
+ add_timer(&sis_priv->timer);
+ return;
}
- if (!sis_priv->LinkOn) {
- /* link stat change forn OFF to ON, read and report link mode */
- sis_priv->LinkOn = TRUE;
- next_tick = 5*HZ;
-
- /* Equalizer workaroung Rule */
- pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision);
- if (revision == SIS630E_REV || revision == SIS630EA1_REV)
- sis630e_set_eq(net_dev);
-
- /* change what cur_phy means */
- if (mii_phy->phy_addr != sis_priv->cur_phy) {
- printk(KERN_INFO "%s: Changing transceiver to %s\n",
- net_dev->name, mii_phy->chip_info->name);
- /* disable previous PHY */
- status = mdio_read(net_dev, sis_priv->cur_phy, MII_CONTROL);
- mdio_write(net_dev, sis_priv->cur_phy,
- MII_CONTROL, status | MII_CNTL_ISOLATE);
- /* enable next PHY */
- status = mdio_read(net_dev, mii_phy->phy_addr, MII_CONTROL);
- mdio_write(net_dev, mii_phy->phy_addr,
- MII_CONTROL, status & ~MII_CNTL_ISOLATE);
- sis_priv->cur_phy = mii_phy->phy_addr;
- }
- sis900_check_mode(net_dev, mii_phy);
+ status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS);
+ status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS);
+ /* Link OFF -> ON */
+ if ( !sis_priv->LinkOn ) {
+LookForLink:
+ /* Search for new PHY */
+ status = sis900_default_phy( net_dev );
+ mii_phy = sis_priv->mii;
+
+ if( status & MII_STAT_LINK ){
+ sis900_check_mode(net_dev, mii_phy);
+ sis_priv->LinkOn = TRUE;
+ }
+ }
+ /* Link ON -> OFF */
+ else{
+ if( !(status & MII_STAT_LINK) ){
+ sis_priv->LinkOn = FALSE;
+ printk(KERN_INFO "%s: Media Link Off\n", net_dev->name);
+
+ /* Change mode issue */
+ if( (mii_phy->phy_id0 == 0x001D) &&
+ ( (mii_phy->phy_id1 & 0xFFF0) == 0x8000 ))
+ sis900_reset_phy( net_dev, sis_priv->cur_phy );
+
+ pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision);
+ sis630_set_eq(net_dev, revision);
+
+ goto LookForLink;
+ }
}
sis_priv->timer.expires = jiffies + next_tick;
add_timer(&sis_priv->timer);
}
+
static void sis900_check_mode (struct device *net_dev, struct mii_phy *mii_phy)
{
struct sis900_private *sis_priv = (struct sis900_private *)net_dev->priv;
long ioaddr = net_dev->base_addr;
int speed, duplex;
- u32 tx_flags = 0, rx_flags = 0;
- mii_phy->chip_info->read_mode(net_dev, sis_priv->cur_phy, &speed, &duplex);
+ if( mii_phy->phy_types == LAN ){
+ outl( ~EXD & inl( ioaddr + cfg ), ioaddr + cfg);
+ sis900_set_capability(net_dev , mii_phy);
+ sis900_auto_negotiate(net_dev, sis_priv->cur_phy);
+ }else{
+ outl(EXD | inl( ioaddr + cfg ), ioaddr + cfg);
+ speed = HW_SPEED_HOME;
+ duplex = FDX_CAPABLE_HALF_SELECTED;
+ sis900_set_mode(net_dev->base_addr, speed, duplex);
+ sis_priv->autong_complete = 1;
+ }
+}
- tx_flags = TxATP | (TX_DMA_BURST << TxMXDMA_shift) | (TX_FILL_THRESH << TxFILLT_shift);
- rx_flags = RX_DMA_BURST << RxMXDMA_shift;
+static void sis900_set_mode (long ioaddr, int speed, int duplex)
+{
+ u32 tx_flags = 0, rx_flags = 0;
+
+ if( inl(ioaddr + cfg) & EDB_MASTER_EN ){
+ tx_flags = TxATP | (DMA_BURST_64 << TxMXDMA_shift) | (TX_FILL_THRESH << TxFILLT_shift);
+ rx_flags = DMA_BURST_64 << RxMXDMA_shift;
+ }
+ else{
+ tx_flags = TxATP | (DMA_BURST_512 << TxMXDMA_shift) | (TX_FILL_THRESH << TxFILLT_shift);
+ rx_flags = DMA_BURST_512 << RxMXDMA_shift;
+ }
if (speed == HW_SPEED_HOME || speed == HW_SPEED_10_MBPS ) {
rx_flags |= (RxDRNT_10 << RxDRNT_shift);
@@ -890,141 +1050,68 @@
outl (tx_flags, ioaddr + txcfg);
outl (rx_flags, ioaddr + rxcfg);
}
-static void sis900_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex)
+
+
+static void sis900_auto_negotiate(struct device *net_dev, int phy_addr)
{
+ struct sis900_private *sis_priv = (struct sis900_private *)net_dev->priv;
int i = 0;
u32 status;
-
- /* STSOUT register is Latched on Transition, read operation updates it */
+
while (i++ < 2)
- status = mdio_read(net_dev, phy_addr, MII_STSOUT);
-
- if (status & MII_STSOUT_SPD)
- *speed = HW_SPEED_100_MBPS;
- else
- *speed = HW_SPEED_10_MBPS;
-
- if (status & MII_STSOUT_DPLX)
- *duplex = FDX_CAPABLE_FULL_SELECTED;
- else
- *duplex = FDX_CAPABLE_HALF_SELECTED;
+ status = mdio_read(net_dev, phy_addr, MII_STATUS);
- if (status & MII_STSOUT_LINK_FAIL)
+ if (!(status & MII_STAT_LINK)){
printk(KERN_INFO "%s: Media Link Off\n", net_dev->name);
- else
- printk(KERN_INFO "%s: Media Link On %s %s-duplex \n",
- net_dev->name,
- *speed == HW_SPEED_100_MBPS ?
- "100mbps" : "10mbps",
- *duplex == FDX_CAPABLE_FULL_SELECTED ?
- "full" : "half");
-}
-static void amd79c901_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex)
-{
- int i;
- u16 status;
+ sis_priv->autong_complete = 1;
+ sis_priv->LinkOn = FALSE;
+ return;
+ }
- for (i = 0; i < 2; i++)
- status = mdio_read(net_dev, phy_addr, MII_STATUS);
+ /* (Re)start AutoNegotiate */
+ mdio_write(net_dev, phy_addr, MII_CONTROL,
+ MII_CNTL_AUTO | MII_CNTL_RST_AUTO);
+ sis_priv->autong_complete = 0;
+}
- if (status & MII_STAT_CAN_AUTO) {
- /* 10BASE-T PHY */
- for (i = 0; i < 2; i++)
- status = mdio_read(net_dev, phy_addr, MII_STATUS_SUMMARY);
- if (status & MII_STSSUM_SPD)
- *speed = HW_SPEED_100_MBPS;
- else
- *speed = HW_SPEED_10_MBPS;
- if (status & MII_STSSUM_DPLX)
- *duplex = FDX_CAPABLE_FULL_SELECTED;
- else
- *duplex = FDX_CAPABLE_HALF_SELECTED;
- if (status & MII_STSSUM_LINK)
- printk(KERN_INFO "%s: Media Link On %s %s-duplex \n",
- net_dev->name,
- *speed == HW_SPEED_100_MBPS ?
- "100mbps" : "10mbps",
- *duplex == FDX_CAPABLE_FULL_SELECTED ?
- "full" : "half");
- else
- printk(KERN_INFO "%s: Media Link Off\n", net_dev->name);
- }
- else {
- /* HomePNA */
- *speed = HW_SPEED_HOME;
- *duplex = FDX_CAPABLE_HALF_SELECTED;
- if (status & MII_STAT_LINK)
- printk(KERN_INFO "%s: Media Link On 1mbps half-duplex \n",
- net_dev->name);
- else
- printk(KERN_INFO "%s: Media Link Off\n", net_dev->name);
- }
-}
-/* ICS1893 PHY use Quick Poll Detailed Status Register to get its status */
-static void ics1893_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex)
+static void sis900_read_mode(struct device *net_dev, int *speed, int *duplex)
{
- int i = 0;
+ struct sis900_private *sis_priv = (struct sis900_private *)net_dev->priv;
+ int phy_addr = sis_priv->cur_phy;
u32 status;
+ u16 autoadv, autorec;
+ int i = 0;
+
+ while (i++ < 2)
+ status = mdio_read(net_dev, phy_addr, MII_STATUS);
- /* MII_QPDSTS is Latched, read twice in succession will reflect the current state */
- for (i = 0; i < 2; i++)
- status = mdio_read(net_dev, phy_addr, MII_QPDSTS);
+ if (!(status & MII_STAT_LINK)) return;
+
+ /* AutoNegotiate completed */
+ autoadv = mdio_read(net_dev, phy_addr, MII_ANADV);
+ autorec = mdio_read(net_dev, phy_addr, MII_ANLPAR);
+ status = autoadv & autorec;
- if (status & MII_STSICS_SPD)
+ if (status & (MII_NWAY_TX | MII_NWAY_TX_FDX))
*speed = HW_SPEED_100_MBPS;
else
*speed = HW_SPEED_10_MBPS;
-
- if (status & MII_STSICS_DPLX)
+ if (status & ( MII_NWAY_TX_FDX | MII_NWAY_T_FDX))
*duplex = FDX_CAPABLE_FULL_SELECTED;
else
*duplex = FDX_CAPABLE_HALF_SELECTED;
- if (status & MII_STSICS_LINKSTS)
- printk(KERN_INFO "%s: Media Link On %s %s-duplex \n",
- net_dev->name,
- *speed == HW_SPEED_100_MBPS ?
- "100mbps" : "10mbps",
- *duplex == FDX_CAPABLE_FULL_SELECTED ?
- "full" : "half");
- else
- printk(KERN_INFO "%s: Media Link Off\n", net_dev->name);
+ sis_priv->autong_complete = 1;
+
+ printk(KERN_INFO "%s: Media Link On %s %s-duplex \n",
+ net_dev->name,
+ *speed == HW_SPEED_100_MBPS ?
+ "100mbps" : "10mbps",
+ *duplex == FDX_CAPABLE_FULL_SELECTED ?
+ "full" : "half");
}
-static void rtl8201_read_mode(struct device *net_dev, int phy_addr, int *speed, int *duplex)
-{
- u32 status;
-
- status = mdio_read(net_dev, phy_addr, MII_STATUS);
-
- if (status & MII_STAT_CAN_TX_FDX) {
- *speed = HW_SPEED_100_MBPS;
- *duplex = FDX_CAPABLE_FULL_SELECTED;
- }
- else if (status & MII_STAT_CAN_TX) {
- *speed = HW_SPEED_100_MBPS;
- *duplex = FDX_CAPABLE_HALF_SELECTED;
- }
- else if (status & MII_STAT_CAN_T_FDX) {
- *speed = HW_SPEED_10_MBPS;
- *duplex = FDX_CAPABLE_FULL_SELECTED;
- }
- else if (status & MII_STAT_CAN_T) {
- *speed = HW_SPEED_10_MBPS;
- *duplex = FDX_CAPABLE_HALF_SELECTED;
- }
-
- if (status & MII_STAT_LINK)
- printk(KERN_INFO "%s: Media Link On %s %s-duplex \n",
- net_dev->name,
- *speed == HW_SPEED_100_MBPS ?
- "100mbps" : "10mbps",
- *duplex == FDX_CAPABLE_FULL_SELECTED ?
- "full" : "half");
- else
- printk(KERN_INFO "%s: Media Link Off\n", net_dev->name);
-}
static void sis900_tx_timeout(struct device *net_dev)
{
@@ -1308,14 +1395,14 @@
tx_status = sis_priv->tx_ring[entry].cmdsts;
if (tx_status & OWN) {
- /* The packet is not transmited yet (owned by hardware) !
+ /* The packet is not transmitted yet (owned by hardware) !
Note: the interrupt is generated only when Tx Machine
is idle, so this is an almost impossible case */
break;
}
if (tx_status & (ABORT | UNDERRUN | OWCOLL)) {
- /* packet unsuccessfully transmited */
+ /* packet unsuccessfully transmitted */
if (sis900_debug > 3)
printk(KERN_INFO "%s: Transmit "
"error, Tx status %8.8x.\n",
@@ -1330,7 +1417,7 @@
if (tx_status & OWCOLL)
sis_priv->stats.tx_window_errors++;
} else {
- /* packet successfully transmited */
+ /* packet successfully transmitted */
sis_priv->stats.collisions += (tx_status & COLCNT) >> 16;
sis_priv->stats.tx_bytes += tx_status & DSIZE;
sis_priv->stats.tx_packets++;
@@ -1422,9 +1509,13 @@
return &sis_priv->stats;
}
-/* SiS 900 uses the most sigificant 7 bits to index a 128 bits multicast hash table, which makes
- this function a little bit different from other drivers */
-static u16 sis900_compute_hashtable_index(u8 *addr)
+
+/* SiS 900 uses the most sigificant 7 bits to index a 128 bits multicast
+ * hash table, which makes this function a little bit different from other drivers
+ * SiS 900 B0 & 635 M/B uses the most significat 8 bits to index 256 bits
+ * multicast hash table.
+ */
+static u16 sis900_compute_hashtable_index(u8 *addr, u8 revision)
{
/* what is the correct value of the POLYNOMIAL ??
@@ -1447,43 +1538,54 @@
byte >>= 1;
}
}
- /* leave 7 most siginifant bits */
- return ((int)(crc >> 25));
+
+ /* leave 8 or 7 most siginifant bits */
+ if((revision == SIS635A_900_REV) || (revision == SIS900B_900_REV))
+ return ((int)(crc >> 24));
+ else
+ return ((int)(crc >> 25));
}
static void set_rx_mode(struct device *net_dev)
{
long ioaddr = net_dev->base_addr;
- u16 mc_filter[8]; /* 128 bits multicast hash table */
- int i;
+ struct sis900_private * sis_priv = (struct sis900_private *)net_dev->priv;
+ u16 mc_filter[16] = {0}; /* 256/128 bits multicast hash table */
+ int i, table_entries;
u32 rx_mode;
+ u8 revision;
+
+ /* 635 Hash Table entires = 256(2^16) */
+ pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision);
+ if((revision == SIS635A_900_REV) || (revision == SIS900B_900_REV))
+ table_entries = 16;
+ else
+ table_entries = 8;
if (net_dev->flags & IFF_PROMISC) {
/* Accept any kinds of packets */
rx_mode = RFPromiscuous;
- for (i = 0; i < 8; i++)
+ for (i = 0; i < table_entries; i++)
mc_filter[i] = 0xffff;
} else if ((net_dev->mc_count > multicast_filter_limit) ||
(net_dev->flags & IFF_ALLMULTI)) {
/* too many multicast addresses or accept all multicast packets */
rx_mode = RFAAB | RFAAM;
- for (i = 0; i < 8; i++)
+ for (i = 0; i < table_entries; i++)
mc_filter[i] = 0xffff;
} else {
/* Accept Broadcast packets, destination addresses match our MAC address,
use Receive Filter to reject unwanted MCAST packets */
struct dev_mc_list *mclist;
rx_mode = RFAAB;
- for (i = 0; i < 8; i++)
- mc_filter[i]=0;
for (i = 0, mclist = net_dev->mc_list; mclist && i < net_dev->mc_count;
i++, mclist = mclist->next)
- set_bit(sis900_compute_hashtable_index(mclist->dmi_addr),
+ set_bit(sis900_compute_hashtable_index(mclist->dmi_addr, revision),
mc_filter);
}
/* update Multicast Hash Table in Receive Filter */
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < table_entries; i++) {
/* why plus 0x04 ??, That makes the correct value for hash table. */
outl((u32)(0x00000004+i) << RFADDR_shift, ioaddr + rfcr);
outl(mc_filter[i], ioaddr + rfdr);
@@ -1510,7 +1612,9 @@
static void sis900_reset(struct device *net_dev)
{
long ioaddr = net_dev->base_addr;
+ struct sis900_private *sis_priv = (struct sis900_private *)net_dev->priv;
int i = 0;
+ u8 revision;
u32 status = TxRCMP | RxRCMP;
outl(0, ioaddr + ier);
@@ -1524,7 +1628,11 @@
status ^= (inl(isr + ioaddr) & status);
}
- outl(PESEL, ioaddr + cfg);
+ pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision);
+ if( (revision == SIS635A_900_REV) || (revision == SIS900B_900_REV) )
+ outl(PESEL | RND_CNT, ioaddr + cfg);
+ else
+ outl(PESEL, ioaddr + cfg);
}
#ifdef MODULE
@@ -1541,6 +1649,13 @@
struct sis900_private *sis_priv =
(struct sis900_private *)root_sis900_dev->priv;
struct device *next_dev = sis_priv->next_module;
+ struct mii_phy *phy = NULL;
+
+ while(sis_priv->first_mii){
+ phy = sis_priv->first_mii;
+ sis_priv->first_mii = phy->next;
+ kfree(phy);
+ }
unregister_netdev(root_sis900_dev);
release_region(root_sis900_dev->base_addr,
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sis900.h linux.20p6/drivers/net/sis900.h
--- linux.vanilla/drivers/net/sis900.h Sun Mar 25 17:37:34 2001
+++ linux.20p6/drivers/net/sis900.h Fri May 4 23:17:33 2001
@@ -47,7 +47,10 @@
enum sis900_configuration_register_bits {
DESCRFMT = 0x00000100 /* 7016 specific */, REQALG = 0x00000080,
SB = 0x00000040, POW = 0x00000020, EXD = 0x00000010,
- PESEL = 0x00000008, LPM = 0x00000004, BEM = 0x00000001
+ PESEL = 0x00000008, LPM = 0x00000004, BEM = 0x00000001,
+ /* 635 & 900B Specific */
+ RND_CNT = 0x00000400, FAIR_BACKOFF = 0x00000200,
+ EDB_MASTER_EN = 0x00002000
};
enum sis900_eeprom_access_reigster_bits {
@@ -74,9 +77,11 @@
/* maximum dma burst fro transmission and receive*/
#define MAX_DMA_RANGE 7 /* actually 0 means MAXIMUM !! */
#define TxMXDMA_shift 20
-#define RxMXDMA_shift 20
-#define TX_DMA_BURST 0
-#define RX_DMA_BURST 0
+#define RxMXDMA_shift 20
+
+enum sis900_tx_rx_dma{
+ DMA_BURST_512 = 0, DMA_BURST_64 = 5
+};
/* transmit FIFO threshholds */
#define TX_FILL_THRESH 16 /* 1/4 FIFO size */
@@ -228,11 +233,17 @@
MII_STSSUM_AUTO = 0x0002, MII_STSSUM_SPD = 0x0001
};
-enum sis630_revision_id {
- SIS630E_REV = 0x81, SIS630EA1_REV = 0x83,
- SIS630S_REV = 0x82
+enum sis900_revision_id {
+ SIS630A_900_REV = 0x80, SIS630E_900_REV = 0x81,
+ SIS630S_900_REV = 0x82, SIS630EA1_900_REV = 0x83,
+ SIS635A_900_REV = 0x90, SIS900B_900_REV = 0x03
};
+enum sis630_revision_id {
+ SIS630A0 = 0x00, SIS630A1 = 0x01,
+ SIS630B0 = 0x10, SIS630B1 = 0x11
+};
+
#define FDX_CAPABLE_DUPLEX_UNKNOWN 0
#define FDX_CAPABLE_HALF_SELECTED 1
#define FDX_CAPABLE_FULL_SELECTED 2
@@ -258,6 +269,8 @@
/* PCI stuff, should be move to pic.h */
#define PCI_DEVICE_ID_SI_900 0x900
#define PCI_DEVICE_ID_SI_7016 0x7016
+#define SIS630_VENDOR_ID 0x1039
+#define SIS630_DEVICE_ID 0x0630
/* ioctl for accessing MII transveiver */
#define SIOCGMIIPHY (SIOCDEVPRIVATE) /* Get the PHY in use. */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/Makefile linux.20p6/drivers/net/sk98lin/Makefile
--- linux.vanilla/drivers/net/sk98lin/Makefile Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/Makefile Tue Jun 19 09:46:01 2001
@@ -3,9 +3,13 @@
# Makefile for the SysKonnect SK-98xx device driver.
#
+#DEBUG = 1
+
+
ifeq ($(CONFIG_SK98LIN),y)
O_TARGET := sk98lin.o
- O_OBJS = skge.o skaddr.o skgehwt.o skgeinit.o skgepnmi.o skgesirq.o \
+ O_OBJS = skge.o skproc.o skaddr.o skgehwt.o skgeinit.o skgepnmi.o \
+ skgesirq.o \
ski2c.o sklm80.o skqueue.o skrlmt.o sktimer.o skvpd.o \
skxmac2.o skcsum.o
else
@@ -13,19 +17,20 @@
MOD_LIST_NAME := SK98LIN_MODULES
M_OBJS := sk98lin.o
O_TARGET := sk98lin.o
- O_OBJS = skge.o skaddr.o skgehwt.o skgeinit.o skgepnmi.o skgesirq.o \
+ O_OBJS = skge.o skproc.o skaddr.o skgehwt.o skgeinit.o skgepnmi.o \
+ skgesirq.o \
ski2c.o sklm80.o skqueue.o skrlmt.o sktimer.o skvpd.o \
skxmac2.o skcsum.o
endif
endif
-# DBGDEF = \
-# -DDEBUG
-
ifdef DEBUG
+DBGDEF = \
+ -DDEBUG
+
DBGDEF += \
--DSK_DEBUG_CHKMOD=0x00000000L \
--DSK_DEBUG_CHKCAT=0x00000000L
+ -DSK_DEBUG_CHKMOD=0x00000000L \
+ -DSK_DEBUG_CHKCAT=0xFFFFFFFF
endif
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/h/lm80.h linux.20p6/drivers/net/sk98lin/h/lm80.h
--- linux.vanilla/drivers/net/sk98lin/h/lm80.h Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/h/lm80.h Tue Jun 19 09:59:54 2001
@@ -126,7 +126,7 @@
#define LM80_IS_BTI (1<<1) /* state of BTI# pin */
#define LM80_IS_FAN1 (1<<2) /* count limit exceeded for Fan 1 */
#define LM80_IS_FAN2 (1<<3) /* count limit exceeded for Fan 2 */
-#define LM80_IS_CI (1<<4) /* Chassis Intrusion occured */
+#define LM80_IS_CI (1<<4) /* Chassis Intrusion occurred */
#define LM80_IS_OS (1<<5) /* OS temperature limit exceeded */
/* bit 6 and 7 are reserved in LM80_ISRC_2 */
#define LM80_IS_HT_IRQ_MD (1<<6) /* Hot temperature interrupt mode */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/h/skaddr.h linux.20p6/drivers/net/sk98lin/h/skaddr.h
--- linux.vanilla/drivers/net/sk98lin/h/skaddr.h Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/h/skaddr.h Tue Jun 19 09:46:01 2001
@@ -2,16 +2,15 @@
*
* Name: skaddr.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.20 $
- * Date: $Date: 1999/11/22 13:46:14 $
- * Purpose: Header file for Address Management (MC, UC, Prom)
+ * Version: $Revision: 1.24 $
+ * Date: $Date: 2001/01/22 13:41:34 $
+ * Purpose: Header file for Address Management (MC, UC, Prom).
*
******************************************************************************/
/******************************************************************************
*
- * (C)Copyright 1998,1999 SysKonnect,
- * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ * (C)Copyright 1998-2001 SysKonnect GmbH.
*
* 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
@@ -27,6 +26,20 @@
* History:
*
* $Log: skaddr.h,v $
+ * Revision 1.24 2001/01/22 13:41:34 rassmann
+ * Supporting two nets on dual-port adapters.
+ *
+ * Revision 1.23 2000/08/10 11:27:50 rassmann
+ * Editorial changes.
+ * Preserving 32-bit alignment in structs for the adapter context.
+ *
+ * Revision 1.22 2000/08/07 11:10:40 rassmann
+ * Editorial changes.
+ *
+ * Revision 1.21 2000/05/04 09:39:59 rassmann
+ * Editorial changes.
+ * Corrected multicast address hashing.
+ *
* Revision 1.20 1999/11/22 13:46:14 cgoos
* Changed license header to GPL.
* Allowing overwrite for SK_ADDR_EQUAL.
@@ -119,33 +132,36 @@
#define __INC_SKADDR_H
#ifdef __cplusplus
-xxxx /* not supported yet - force error */
+#error C++ is not yet supported.
extern "C" {
#endif /* cplusplus */
/* defines ********************************************************************/
-#define SK_MAC_ADDR_LEN 6 /* Length of MAC address. */
-#define SK_MAX_ADDRS 14 /* #Addrs for exact match. */
+#define SK_MAC_ADDR_LEN 6 /* Length of MAC address. */
+#define SK_MAX_ADDRS 14 /* #Addrs for exact match. */
/* ----- Common return values ----- */
-#define SK_ADDR_SUCCESS 0 /* Function returned successfully. */
-#define SK_ADDR_ILLEGAL_PORT 100 /* Port number too high. */
-#define SK_ADDR_TOO_EARLY 101 /* Function called too early. */
+#define SK_ADDR_SUCCESS 0 /* Function returned successfully. */
+#define SK_ADDR_ILLEGAL_PORT 100 /* Port number too high. */
+#define SK_ADDR_TOO_EARLY 101 /* Function called too early. */
/* ----- Clear/Add flag bits ----- */
-#define SK_ADDR_PERMANENT 1 /* RLMT Address */
+#define SK_ADDR_PERMANENT 1 /* RLMT Address */
/* ----- Additional Clear flag bits ----- */
-#define SK_MC_SW_ONLY 2 /* Do not update HW when clearing. */
+#define SK_MC_SW_ONLY 2 /* Do not update HW when clearing. */
/* ----- Override flag bits ----- */
-#define SK_ADDR_VIRTUAL_ADDRESS 0
+#define SK_ADDR_LOGICAL_ADDRESS 0
+#define SK_ADDR_VIRTUAL_ADDRESS (SK_ADDR_LOGICAL_ADDRESS) /* old */
#define SK_ADDR_PHYSICAL_ADDRESS 1
+#define SK_ADDR_CLEAR_LOGICAL 2
+#define SK_ADDR_SET_LOGICAL 4
/* ----- Override return values ----- */
@@ -155,7 +171,7 @@
/* ----- Partitioning of excact match table ----- */
-#define SK_ADDR_EXACT_MATCHES 16 /* #Exact match entries. */
+#define SK_ADDR_EXACT_MATCHES 16 /* #Exact match entries. */
#define SK_ADDR_FIRST_MATCH_RLMT 1
#define SK_ADDR_LAST_MATCH_RLMT 2
@@ -164,39 +180,43 @@
/* ----- SkAddrMcAdd/SkAddrMcUpdate return values ----- */
-#define SK_MC_FILTERING_EXACT 0 /* Exact filtering. */
-#define SK_MC_FILTERING_INEXACT 1 /* Inexact filtering. */
+#define SK_MC_FILTERING_EXACT 0 /* Exact filtering. */
+#define SK_MC_FILTERING_INEXACT 1 /* Inexact filtering. */
/* ----- Additional SkAddrMcAdd return values ----- */
-#define SK_MC_ILLEGAL_ADDRESS 2 /* Illegal address. */
-#define SK_MC_ILLEGAL_PORT 3 /* Illegal port (not the active one). */
-#define SK_MC_RLMT_OVERFLOW 4 /* Too many RLMT mc addresses. */
+#define SK_MC_ILLEGAL_ADDRESS 2 /* Illegal address. */
+#define SK_MC_ILLEGAL_PORT 3 /* Illegal port (not the active one). */
+#define SK_MC_RLMT_OVERFLOW 4 /* Too many RLMT mc addresses. */
/* Promiscuous mode bits ----- */
-#define SK_PROM_MODE_NONE 0 /* Normal receive. */
-#define SK_PROM_MODE_LLC 1 /* Receive all LLC frames. */
-#define SK_PROM_MODE_ALL_MC 2 /* Receive all multicast frames. */
-/* #define SK_PROM_MODE_NON_LLC 4 */ /* Receive all non-LLC frames. */
+#define SK_PROM_MODE_NONE 0 /* Normal receive. */
+#define SK_PROM_MODE_LLC 1 /* Receive all LLC frames. */
+#define SK_PROM_MODE_ALL_MC 2 /* Receive all multicast frames. */
+/* #define SK_PROM_MODE_NON_LLC 4 */ /* Receive all non-LLC frames. */
/* Macros */
#ifndef SK_ADDR_EQUAL
+/*
+ * "&" instead of "&&" allows better optimization on IA-64.
+ * The replacement is safe here, as all bytes exist.
+ */
#ifndef SK_ADDR_DWORD_COMPARE
#define SK_ADDR_EQUAL(A1,A2) ( \
- ((SK_U8 *)(A1))[5] == ((SK_U8 *)(A2))[5] && \
- ((SK_U8 *)(A1))[4] == ((SK_U8 *)(A2))[4] && \
- ((SK_U8 *)(A1))[3] == ((SK_U8 *)(A2))[3] && \
- ((SK_U8 *)(A1))[2] == ((SK_U8 *)(A2))[2] && \
- ((SK_U8 *)(A1))[1] == ((SK_U8 *)(A2))[1] && \
- ((SK_U8 *)(A1))[0] == ((SK_U8 *)(A2))[0])
+ (((SK_U8 *)(A1))[5] == ((SK_U8 *)(A2))[5]) & \
+ (((SK_U8 *)(A1))[4] == ((SK_U8 *)(A2))[4]) & \
+ (((SK_U8 *)(A1))[3] == ((SK_U8 *)(A2))[3]) & \
+ (((SK_U8 *)(A1))[2] == ((SK_U8 *)(A2))[2]) & \
+ (((SK_U8 *)(A1))[1] == ((SK_U8 *)(A2))[1]) & \
+ (((SK_U8 *)(A1))[0] == ((SK_U8 *)(A2))[0]))
#else /* SK_ADDR_DWORD_COMPARE */
#define SK_ADDR_EQUAL(A1,A2) ( \
- *(SK_U32 *)&(((SK_U8 *)(A1))[2]) == *(SK_U32 *)&(((SK_U8 *)(A2))[2]) && \
- *(SK_U32 *)&(((SK_U8 *)(A1))[0]) == *(SK_U32 *)&(((SK_U8 *)(A2))[0]))
+ (*(SK_U32 *)&(((SK_U8 *)(A1))[2]) == *(SK_U32 *)&(((SK_U8 *)(A2))[2])) & \
+ (*(SK_U32 *)&(((SK_U8 *)(A1))[0]) == *(SK_U32 *)&(((SK_U8 *)(A2))[0])))
#endif /* SK_ADDR_DWORD_COMPARE */
-#endif /* SK_ADDR_EQUAL */
+#endif /* SK_ADDR_EQUAL */
/* typedefs *******************************************************************/
@@ -204,104 +224,120 @@
SK_U8 a[SK_MAC_ADDR_LEN];
} SK_MAC_ADDR;
+
/* SK_FILTER is used to ensure alignment of the filter. */
typedef union s_InexactFilter {
SK_U8 Bytes[8];
- SK_U64 Val; /* Dummy entry for alignment only. */
+ SK_U64 Val; /* Dummy entry for alignment only. */
} SK_FILTER64;
+
+typedef struct s_AddrNet SK_ADDR_NET;
+
+
typedef struct s_AddrPort {
/* ----- Public part (read-only) ----- */
- SK_MAC_ADDR PermanentMacAddress; /* Physical MAC Address. */
- SK_MAC_ADDR CurrentMacAddress; /* Physical MAC Address. */
- int PromMode; /* Promiscuous Mode. */
+ SK_MAC_ADDR CurrentMacAddress; /* Current physical MAC Address. */
+ SK_MAC_ADDR PermanentMacAddress; /* Permanent physical MAC Address. */
+ int PromMode; /* Promiscuous Mode. */
/* ----- Private part ----- */
+ SK_MAC_ADDR PreviousMacAddress; /* Prev. phys. MAC Address. */
SK_BOOL CurrentMacAddressSet; /* CurrentMacAddress is set. */
- SK_MAC_ADDR PreviousMacAddress; /* Prev. phys. MAC Address. */
+ SK_U8 Align01;
+
SK_U32 FirstExactMatchRlmt;
SK_U32 NextExactMatchRlmt;
SK_U32 FirstExactMatchDrv;
SK_U32 NextExactMatchDrv;
SK_MAC_ADDR Exact[SK_ADDR_EXACT_MATCHES];
- SK_FILTER64 InexactFilter; /* For 64-bit hash register. */
+ SK_FILTER64 InexactFilter; /* For 64-bit hash register. */
} SK_ADDR_PORT;
+
+struct s_AddrNet {
+/* ----- Public part (read-only) ----- */
+
+ SK_MAC_ADDR CurrentMacAddress; /* Logical MAC Address. */
+ SK_MAC_ADDR PermanentMacAddress; /* Logical MAC Address. */
+
+/* ----- Private part ----- */
+
+ SK_U32 ActivePort; /* View of module ADDR. */
+ SK_BOOL CurrentMacAddressSet; /* CurrentMacAddress is set. */
+ SK_U8 Align01;
+ SK_U16 Align02;
+};
+
+
typedef struct s_Addr {
/* ----- Public part (read-only) ----- */
+ SK_ADDR_NET Net[SK_MAX_NETS];
SK_ADDR_PORT Port[SK_MAX_MACS];
- SK_MAC_ADDR PermanentMacAddress; /* Logical MAC Address. */
- SK_MAC_ADDR CurrentMacAddress; /* Logical MAC Address. */
/* ----- Private part ----- */
-
-#if 0
- SK_BOOL Initialized; /* Flag: Addr module is initialized. */
-#endif /* 0 */
- SK_BOOL CurrentMacAddressSet; /* CurrentMacAddress is set. */
- SK_U32 ActivePort; /* Vie of module ADDR. */
} SK_ADDR;
/* function prototypes ********************************************************/
#ifndef SK_KR_PROTO
-/* Functions provided by SkRlmt */
+/* Functions provided by SkAddr */
/* ANSI/C++ compliant function prototypes */
extern int SkAddrInit(
SK_AC *pAC,
SK_IOC IoC,
- int Level);
+ int Level);
extern int SkAddrMcClear(
SK_AC *pAC,
SK_IOC IoC,
- SK_U32 PortIdx,
- int Flags);
+ SK_U32 PortNumber,
+ int Flags);
extern int SkAddrMcAdd(
SK_AC *pAC,
SK_IOC IoC,
- SK_U32 PortIdx,
+ SK_U32 PortNumber,
SK_MAC_ADDR *pMc,
- int Flags);
+ int Flags);
extern int SkAddrMcUpdate(
SK_AC *pAC,
SK_IOC IoC,
- SK_U32 PortIdx);
+ SK_U32 PortNumber);
extern int SkAddrOverride(
SK_AC *pAC,
SK_IOC IoC,
- SK_U32 PortIdx,
+ SK_U32 PortNumber,
SK_MAC_ADDR *pNewAddr,
- int Flags);
+ int Flags);
extern int SkAddrPromiscuousChange(
SK_AC *pAC,
SK_IOC IoC,
- SK_U32 PortIdx,
- int NewPromMode);
+ SK_U32 PortNumber,
+ int NewPromMode);
extern int SkAddrSwap(
SK_AC *pAC,
SK_IOC IoC,
- SK_U32 FromPortIdx,
- SK_U32 ToPortIdx);
+ SK_U32 FromPortNumber,
+ SK_U32 ToPortNumber);
#else /* defined(SK_KR_PROTO)) */
/* Non-ANSI/C++ compliant function prototypes */
-xxxx /* not supported yet - force error */
+#error KR-style prototypes are not yet provided.
#endif /* defined(SK_KR_PROTO)) */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/h/skcsum.h linux.20p6/drivers/net/sk98lin/h/skcsum.h
--- linux.vanilla/drivers/net/sk98lin/h/skcsum.h Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/h/skcsum.h Tue Jun 19 09:46:01 2001
@@ -2,16 +2,15 @@
*
* Name: skcsum.h
* Project: GEnesis - SysKonnect SK-NET Gigabit Ethernet (SK-98xx)
- * Version: $Revision: 1.5 $
- * Date: $Date: 2000/02/21 12:10:05 $
+ * Version: $Revision: 1.9 $
+ * Date: $Date: 2001/02/06 11:21:39 $
* Purpose: Store/verify Internet checksum in send/receive packets.
*
******************************************************************************/
/******************************************************************************
*
- * (C)Copyright 1998,1999 SysKonnect,
- * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ * (C)Copyright 1998-2001 SysKonnect GmbH.
*
* 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
@@ -27,6 +26,19 @@
* History:
*
* $Log: skcsum.h,v $
+ * Revision 1.9 2001/02/06 11:21:39 rassmann
+ * Editorial changes.
+ *
+ * Revision 1.8 2001/02/06 11:15:36 rassmann
+ * Supporting two nets on dual-port adapters.
+ *
+ * Revision 1.7 2000/06/29 13:17:05 rassmann
+ * Corrected reception of a packet with UDP checksum == 0 (which means there
+ * is no UDP checksum).
+ *
+ * Revision 1.6 2000/02/28 12:33:44 cgoos
+ * Changed C++ style comments to C style.
+ *
* Revision 1.5 2000/02/21 12:10:05 cgoos
* Fixed license comment.
*
@@ -110,27 +122,32 @@
*
* SKCS_STATUS_UNKNOWN_IP_VERSION - Not an IP v4 frame.
* SKCS_STATUS_IP_CSUM_ERROR - IP checksum error.
+ * SKCS_STATUS_IP_CSUM_ERROR_TCP - IP checksum error in TCP frame.
+ * SKCS_STATUS_IP_CSUM_ERROR_UDP - IP checksum error in UDP frame
* SKCS_STATUS_IP_FRAGMENT - IP fragment (IP checksum ok).
* SKCS_STATUS_IP_CSUM_OK - IP checksum ok (not a TCP or UDP frame).
* SKCS_STATUS_TCP_CSUM_ERROR - TCP checksum error (IP checksum ok).
* SKCS_STATUS_UDP_CSUM_ERROR - UDP checksum error (IP checksum ok).
* SKCS_STATUS_TCP_CSUM_OK - IP and TCP checksum ok.
* SKCS_STATUS_UDP_CSUM_OK - IP and UDP checksum ok.
+ * SKCS_STATUS_IP_CSUM_OK_NO_UDP - IP checksum OK and no UDP checksum.
*/
#ifndef SKCS_OVERWRITE_STATUS /* User overwrite? */
#define SKCS_STATUS int /* Define status type. */
#define SKCS_STATUS_UNKNOWN_IP_VERSION 1
-#define SKCS_STATUS_IP_CSUM_ERROR 2
-#define SKCS_STATUS_IP_FRAGMENT 3
-#define SKCS_STATUS_IP_CSUM_OK 4
-#define SKCS_STATUS_TCP_CSUM_ERROR 5
-#define SKCS_STATUS_UDP_CSUM_ERROR 6
-#define SKCS_STATUS_TCP_CSUM_OK 7
-#define SKCS_STATUS_UDP_CSUM_OK 8
-// needed for Microsoft
+#define SKCS_STATUS_IP_CSUM_ERROR 2
+#define SKCS_STATUS_IP_FRAGMENT 3
+#define SKCS_STATUS_IP_CSUM_OK 4
+#define SKCS_STATUS_TCP_CSUM_ERROR 5
+#define SKCS_STATUS_UDP_CSUM_ERROR 6
+#define SKCS_STATUS_TCP_CSUM_OK 7
+#define SKCS_STATUS_UDP_CSUM_OK 8
+/* needed for Microsoft */
#define SKCS_STATUS_IP_CSUM_ERROR_UDP 9
#define SKCS_STATUS_IP_CSUM_ERROR_TCP 10
+/* UDP checksum may be omitted */
+#define SKCS_STATUS_IP_CSUM_OK_NO_UDP 11
#endif /* !SKCS_OVERWRITE_STATUS */
/* Clear protocol statistics event. */
@@ -181,13 +198,13 @@
*/
typedef struct s_Csum {
/* Enabled receive SK_PROTO_XXX bit flags. */
- unsigned ReceiveFlags;
+ unsigned ReceiveFlags[SK_MAX_NETS];
#ifdef TX_CSUM
- unsigned TransmitFlags;
-#endif // TX_CSUM
+ unsigned TransmitFlags[SK_MAX_NETS];
+#endif /* TX_CSUM */
/* The protocol statistics structure; one per supported protocol. */
- SKCS_PROTO_STATS ProtoStats[SKCS_NUM_PROTOCOLS];
+ SKCS_PROTO_STATS ProtoStats[SK_MAX_NETS][SKCS_NUM_PROTOCOLS];
} SK_CSUM;
/*
@@ -225,17 +242,20 @@
SK_AC *pAc,
void *pIpHeader,
unsigned Checksum1,
- unsigned Checksum2);
+ unsigned Checksum2,
+ int NetNumber);
extern void SkCsGetSendInfo(
- SK_AC *pAc,
- void *pIpHeader,
- SKCS_PACKET_INFO *pPacketInfo);
+ SK_AC *pAc,
+ void *pIpHeader,
+ SKCS_PACKET_INFO *pPacketInfo,
+ int NetNumber);
extern void SkCsSetReceiveFlags(
SK_AC *pAc,
unsigned ReceiveFlags,
unsigned *pChecksum1Offset,
- unsigned *pChecksum2Offset);
+ unsigned *pChecksum2Offset,
+ int NetNumber);
#endif /* __INC_SKCSUM_H */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/h/skdrv1st.h linux.20p6/drivers/net/sk98lin/h/skdrv1st.h
--- linux.vanilla/drivers/net/sk98lin/h/skdrv1st.h Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/h/skdrv1st.h Tue Jun 19 09:46:01 2001
@@ -2,8 +2,8 @@
*
* Name: skdrv1st.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.8 $
- * Date: $Date: 2000/02/21 12:19:18 $
+ * Version: $Revision: 1.9 $
+ * Date: $Date: 2001/01/22 14:16:04 $
* Purpose: First header file for driver and all other modules
*
******************************************************************************/
@@ -27,6 +27,11 @@
* History:
*
* $Log: skdrv1st.h,v $
+ * Revision 1.9 2001/01/22 14:16:04 mlindner
+ * added ProcFs functionality
+ * Dual Net functionality integrated
+ * Rlmt networks added
+ *
* Revision 1.8 2000/02/21 12:19:18 cgoos
* Added default for SK_DEBUG_CHKMOD/_CHKCAT
*
@@ -140,6 +145,7 @@
// #define SK_RLMT_SLOW_LOOKAHEAD
#define SK_MAX_MACS 2
+#define SK_MAX_NETS 2
#define SK_IOC char*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/h/skdrv2nd.h linux.20p6/drivers/net/sk98lin/h/skdrv2nd.h
--- linux.vanilla/drivers/net/sk98lin/h/skdrv2nd.h Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/h/skdrv2nd.h Tue Jun 19 09:46:01 2001
@@ -2,8 +2,8 @@
*
* Name: skdrv2nd.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.9 $
- * Date: $Date: 2000/02/21 10:39:55 $
+ * Version: $Revision: 1.12 $
+ * Date: $Date: 2001/03/01 12:52:15 $
* Purpose: Second header file for driver and all other modules
*
******************************************************************************/
@@ -27,6 +27,22 @@
* History:
*
* $Log: skdrv2nd.h,v $
+ * Revision 1.12 2001/03/01 12:52:15 mlindner
+ * Fixed ring size
+ *
+ * Revision 1.11 2001/02/19 13:28:02 mlindner
+ * Changed PNMI parameter values
+ *
+ * Revision 1.10 2001/01/22 14:16:04 mlindner
+ * added ProcFs functionality
+ * Dual Net functionality integrated
+ * Rlmt networks added
+ *
+ * Revision 1.1 2000/10/05 19:46:50 phargrov
+ * Add directory src/vipk_devs_nonlbl/vipk_sk98lin/
+ * This is the SysKonnect SK-98xx Gigabit Ethernet driver,
+ * contributed by SysKonnect.
+ *
* Revision 1.9 2000/02/21 10:39:55 cgoos
* Added flag for jumbo support usage.
*
@@ -139,7 +155,7 @@
*/
#define TX_RING_SIZE (8*1024)
-#define RX_RING_SIZE (24*1024)
+#define RX_RING_SIZE (TX_RING_SIZE*3)
/*
* Buffer size for ethernet packets
@@ -167,6 +183,12 @@
#define SK_DRIVER_RESET(pAC, IoC) 0
#define SK_DRIVER_SENDEVENT(pAC, IoC) 0
#define SK_DRIVER_SELFTEST(pAC, IoC) 0
+/* For get mtu you must add an own function */
+#define SK_DRIVER_GET_MTU(pAc,IoC,i) 0
+#define SK_DRIVER_SET_MTU(pAc,IoC,i,v) 0
+#define SK_DRIVER_PRESET_MTU(pAc,IoC,i,v) 0
+
+
/* TX and RX descriptors *****************************************************/
@@ -366,6 +388,20 @@
int PortIndex; /* index number of port (0 or 1) */
};
+
+typedef struct s_DevNet DEV_NET;
+
+struct s_DevNet {
+ int PortNr;
+ int NetNr;
+ int Mtu;
+ int Up;
+ SK_AC *pAC;
+};
+
+
+
+
typedef struct s_RxPort RX_PORT;
struct s_RxPort {
@@ -382,6 +418,7 @@
int PortIndex; /* index number of port (0 or 1) */
};
+
typedef struct s_PerStrm PER_STRM;
#define SK_ALLOC_IRQ 0x00000001
@@ -404,7 +441,8 @@
SK_RLMT Rlmt; /* for rlmt module */
spinlock_t SlowPathLock; /* Normal IRQ lock */
SK_PNMI_STRUCT_DATA PnmiStruct; /* structure to get all Pnmi-Data */
- int RlmtMode; /* link check mode to set */
+ int RlmtMode; /* link check mode to set */
+ int RlmtNets; /* Number of nets */
SK_IOC IoBase; /* register set of adapter */
int BoardLevel; /* level of active hw init (0-2) */
@@ -412,11 +450,11 @@
SK_U32 AllocFlag; /* flag allocation of resources */
struct pci_dev PciDev; /* for access to pci config space */
SK_U32 PciDevId; /* pci device id */
- struct device *dev; /* pointer to device struct */
+ struct device *dev[2]; /* pointer to device struct */
char Name[30]; /* driver name */
struct device *Next; /* link all devices (for clearing) */
int RxBufSize; /* length of receive buffers */
- struct net_device_stats stats; /* linux 'netstat -i' statistics */
+ struct net_device_stats stats; /* linux 'netstat -i' statistics */
int Index; /* internal board index number */
SK_BOOL JumboActivated; /* jumbo support ever activated */
@@ -428,10 +466,11 @@
int PromiscCount; /* promiscuous mode counter */
int AllMultiCount; /* allmulticast mode counter */
int MulticCount; /* number of different MC */
- /* addresses for this board */
- /* (may be more than HW can)*/
+ /* addresses for this board */
+ /* (may be more than HW can)*/
- int ActivePort; /* the active XMAC port */
+ int ActivePort; /* the active XMAC port */
+ int MaxPorts; /* number of activated ports */
int TxDescrPerRing; /* # of descriptors per tx ring */
int RxDescrPerRing; /* # of descriptors per rx ring */
@@ -447,7 +486,6 @@
SK_BOOL CheckQueue; /* check event queue soon */
};
-
#endif /* __INC_SKDRV2ND_H */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/h/skgehw.h linux.20p6/drivers/net/sk98lin/h/skgehw.h
--- linux.vanilla/drivers/net/sk98lin/h/skgehw.h Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/h/skgehw.h Tue Jun 19 09:59:54 2001
@@ -2,8 +2,8 @@
*
* Name: skgehw.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.34 $
- * Date: $Date: 1999/11/22 13:53:40 $
+ * Version: $Revision: 1.36 $
+ * Date: $Date: 2000/11/09 12:32:49 $
* Purpose: Defines and Macros for the Gigabit Ethernet Adapter Product
* Family
*
@@ -11,8 +11,7 @@
/******************************************************************************
*
- * (C)Copyright 1998,1999 SysKonnect,
- * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ * (C)Copyright 1998-2000 SysKonnect GmbH.
*
* 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
@@ -27,6 +26,12 @@
*
* History:
* $Log: skgehw.h,v $
+ * Revision 1.36 2000/11/09 12:32:49 rassmann
+ * Renamed variables.
+ *
+ * Revision 1.35 2000/05/19 10:17:13 cgoos
+ * Added inactivity check in PHY_READ (in DEBUG mode only).
+ *
* Revision 1.34 1999/11/22 13:53:40 cgoos
* Changed license header to GPL.
*
@@ -177,27 +182,27 @@
*/
#define PCI_VENDOR_ID 0x00 /* 16 bit Vendor ID */
#define PCI_DEVICE_ID 0x02 /* 16 bit Device ID */
-#define PCI_COMMAND 0x04 /* 16 bit Command */
-#define PCI_STATUS 0x06 /* 16 bit Status */
-#define PCI_REV_ID 0x08 /* 8 bit Revision ID */
+#define PCI_COMMAND 0x04 /* 16 bit Command */
+#define PCI_STATUS 0x06 /* 16 bit Status */
+#define PCI_REV_ID 0x08 /* 8 bit Revision ID */
#define PCI_CLASS_CODE 0x09 /* 24 bit Class Code */
#define PCI_CACHE_LSZ 0x0c /* 8 bit Cache Line Size */
-#define PCI_LAT_TIM 0x0d /* 8 bit Latency Timer */
+#define PCI_LAT_TIM 0x0d /* 8 bit Latency Timer */
#define PCI_HEADER_T 0x0e /* 8 bit Header Type */
-#define PCI_BIST 0x0f /* 8 bit Built-in selftest */
+#define PCI_BIST 0x0f /* 8 bit Built-in selftest */
#define PCI_BASE_1ST 0x10 /* 32 bit 1st Base address */
#define PCI_BASE_2ND 0x14 /* 32 bit 2nd Base address */
/* Byte 18..2b: reserved */
-#define PCI_SUB_VID 0x2c /* 16 bit Subsystem Vendor ID */
-#define PCI_SUB_ID 0x2e /* 16 bit Subsystem ID */
+#define PCI_SUB_VID 0x2c /* 16 bit Subsystem Vendor ID */
+#define PCI_SUB_ID 0x2e /* 16 bit Subsystem ID */
#define PCI_BASE_ROM 0x30 /* 32 bit Expansion ROM Base Address */
/* Byte 34..33: reserved */
-#define PCI_CAP_PTR 0x34 /* 8 bit Capabilities Ptr */
+#define PCI_CAP_PTR 0x34 /* 8 bit Capabilities Ptr */
/* Byte 35..3b: reserved */
#define PCI_IRQ_LINE 0x3c /* 8 bit Interrupt Line */
-#define PCI_IRQ_PIN 0x3d /* 8 bit Interrupt Pin */
-#define PCI_MIN_GNT 0x3e /* 8 bit Min_Gnt */
-#define PCI_MAX_LAT 0x3f /* 8 bit Max_Lat */
+#define PCI_IRQ_PIN 0x3d /* 8 bit Interrupt Pin */
+#define PCI_MIN_GNT 0x3e /* 8 bit Min_Gnt */
+#define PCI_MAX_LAT 0x3f /* 8 bit Max_Lat */
/* Device Dependent Region */
#define PCI_OUR_REG_1 0x40 /* 32 bit Our Register 1 */
#define PCI_OUR_REG_2 0x44 /* 32 bit Our Register 2 */
@@ -230,34 +235,34 @@
/* PCI_DEVICE_ID 16 bit Device ID */
/* Values for Vendor ID and Device ID shall be patched into the code */
/* PCI_COMMAND 16 bit Command */
- /* Bit 15..10: reserved */
-#define PCI_FBTEN (1<<9) /* Bit 9: Fast Back-To-Back enable */
-#define PCI_SERREN (1<<8) /* Bit 8: SERR enable */
-#define PCI_ADSTEP (1<<7) /* Bit 7: Address Stepping */
-#define PCI_PERREN (1<<6) /* Bit 6: Parity Report Response enable */
+ /* Bit 15..10: reserved */
+#define PCI_FBTEN (1<<9) /* Bit 9: Fast Back-To-Back enable */
+#define PCI_SERREN (1<<8) /* Bit 8: SERR enable */
+#define PCI_ADSTEP (1<<7) /* Bit 7: Address Stepping */
+#define PCI_PERREN (1<<6) /* Bit 6: Parity Report Response enable */
#define PCI_VGA_SNOOP (1<<5) /* Bit 5: VGA palette snoop */
-#define PCI_MWIEN (1<<4) /* Bit 4: Memory write an inv cycl ena */
-#define PCI_SCYCEN (1<<3) /* Bit 3: Special Cycle enable */
-#define PCI_BMEN (1<<2) /* Bit 2: Bus Master enable */
-#define PCI_MEMEN (1<<1) /* Bit 1: Memory Space Access enable */
-#define PCI_IOEN (1<<0) /* Bit 0: IO Space Access enable */
+#define PCI_MWIEN (1<<4) /* Bit 4: Memory write an inv cycl ena */
+#define PCI_SCYCEN (1<<3) /* Bit 3: Special Cycle enable */
+#define PCI_BMEN (1<<2) /* Bit 2: Bus Master enable */
+#define PCI_MEMEN (1<<1) /* Bit 1: Memory Space Access enable */
+#define PCI_IOEN (1<<0) /* Bit 0: IO Space Access enable */
/* PCI_STATUS 16 bit Status */
-#define PCI_PERR (1<<15) /* Bit 15: Parity Error */
-#define PCI_SERR (1<<14) /* Bit 14: Signaled SERR */
-#define PCI_RMABORT (1<<13) /* Bit 13: Received Master Abort */
-#define PCI_RTABORT (1<<12) /* Bit 12: Received Target Abort */
- /* Bit 11: reserved */
-#define PCI_DEVSEL (3<<9) /* Bit 10..9: DEVSEL Timing */
+#define PCI_PERR (1<<15) /* Bit 15: Parity Error */
+#define PCI_SERR (1<<14) /* Bit 14: Signaled SERR */
+#define PCI_RMABORT (1<<13) /* Bit 13: Received Master Abort */
+#define PCI_RTABORT (1<<12) /* Bit 12: Received Target Abort */
+ /* Bit 11: reserved */
+#define PCI_DEVSEL (3<<9) /* Bit 10..9: DEVSEL Timing */
#define PCI_DEV_FAST (0<<9) /* fast */
#define PCI_DEV_MEDIUM (1<<9) /* medium */
#define PCI_DEV_SLOW (2<<9) /* slow */
#define PCI_DATAPERR (1<<8) /* Bit 8: DATA Parity error detected */
-#define PCI_FB2BCAP (1<<7) /* Bit 7: Fast Back-to-Back Capability */
-#define PCI_UDF (1<<6) /* Bit 6: User Defined Features */
+#define PCI_FB2BCAP (1<<7) /* Bit 7: Fast Back-to-Back Capability */
+#define PCI_UDF (1<<6) /* Bit 6: User Defined Features */
#define PCI_66MHZCAP (1<<5) /* Bit 5: 66 MHz PCI bus clock capable */
-#define PCI_NEWCAP (1<<4) /* Bit 4: New cap. list implemented */
- /* Bit 3..0: reserved */
+#define PCI_NEWCAP (1<<4) /* Bit 4: New cap. list implemented */
+ /* Bit 3..0: reserved */
#define PCI_ERRBITS (PCI_PERR | PCI_SERR | PCI_RMABORT | PCI_RTABORT |\
PCI_DATAPERR)
@@ -272,59 +277,59 @@
/* PCI_HEADER_T 8 bit Header Type */
#define PCI_HD_MF_DEV (1<<7) /* Bit 7: 0= single, 1= multi-func dev */
-#define PCI_HD_TYPE 0x7f /* Bit 6..0: Header Layout 0= normal */
+#define PCI_HD_TYPE 0x7f /* Bit 6..0: Header Layout 0= normal */
/* PCI_BIST 8 bit Built-in selftest */
/* Built-in Self test not supported (optional) */
/* PCI_BASE_1ST 32 bit 1st Base address */
-#define PCI_MEMSIZE 0x4000L /* use 16 kB Memory Base */
+#define PCI_MEMSIZE 0x4000L /* use 16 kB Memory Base */
#define PCI_MEMBASE_MSK 0xffffc000L /* Bit 31..14: Memory Base Address */
#define PCI_MEMSIZE_MSK 0x00003ff0L /* Bit 13.. 4: Memory Size Req. */
-#define PCI_PREFEN (1L<<3) /* Bit 3: Prefetchable */
-#define PCI_MEM_TYP (3L<<2) /* Bit 2.. 1: Memory Type */
+#define PCI_PREFEN (1L<<3) /* Bit 3: Prefetchable */
+#define PCI_MEM_TYP (3L<<2) /* Bit 2.. 1: Memory Type */
#define PCI_MEM32BIT (0L<<1) /* Base addr anywhere in 32 Bit range */
-#define PCI_MEM1M (1L<<1) /* Base addr below 1 MegaByte */
+#define PCI_MEM1M (1L<<1) /* Base addr below 1 MegaByte */
#define PCI_MEM64BIT (2L<<1) /* Base addr anywhere in 64 Bit range */
#define PCI_MEMSPACE (1L<<0) /* Bit 0: Memory Space Indic. */
/* PCI_BASE_2ND 32 bit 2nd Base address */
-#define PCI_IOBASE 0xffffff00L /* Bit 31..8: I/O Base address */
-#define PCI_IOSIZE 0x000000fcL /* Bit 7..2: I/O Size Requirements */
- /* Bit 1: reserved */
-#define PCI_IOSPACE (1L<<0) /* Bit 0: I/O Space Indicator */
+#define PCI_IOBASE 0xffffff00L /* Bit 31..8: I/O Base address */
+#define PCI_IOSIZE 0x000000fcL /* Bit 7..2: I/O Size Requirements */
+ /* Bit 1: reserved */
+#define PCI_IOSPACE (1L<<0) /* Bit 0: I/O Space Indicator */
/* PCI_BASE_ROM 32 bit Expansion ROM Base Address */
-#define PCI_ROMBASE (0xfffeL<<17) /* Bit 31..17: ROM BASE address (1st)*/
-#define PCI_ROMBASZ (0x1cL<<14) /* Bit 16..14: Treat as BASE or SIZE */
-#define PCI_ROMSIZE (0x38L<<11) /* Bit 13..11: ROM Size Requirements */
- /* Bit 10.. 1: reserved */
-#define PCI_ROMEN (0x1L<<0) /* Bit 0: Address Decode enable */
+#define PCI_ROMBASE (0xfffeL<<17) /* Bit 31..17: ROM BASE address (1st)*/
+#define PCI_ROMBASZ (0x1cL<<14) /* Bit 16..14: Treat as BASE or SIZE */
+#define PCI_ROMSIZE (0x38L<<11) /* Bit 13..11: ROM Size Requirements */
+ /* Bit 10.. 1: reserved */
+#define PCI_ROMEN (0x1L<<0) /* Bit 0: Address Decode enable */
/* Device Dependent Region */
/* PCI_OUR_REG_1 32 bit Our Register 1 */
- /* Bit 31..26: reserved */
-#define PCI_VIO (1L<<25) /* Bit 25: PCI IO Voltage, */
- /* 0 = 3.3V / 1 = 5V */
-#define PCI_EN_BOOT (1L<<24) /* Bit 24: Enable BOOT via ROM */
- /* 1 = Don't boot wth ROM*/
- /* 0 = Boot with ROM */
-#define PCI_EN_IO (1L<<23) /* Bit 23: Mapping to IO space */
+ /* Bit 31..26: reserved */
+#define PCI_VIO (1L<<25) /* Bit 25: PCI IO Voltage, */
+ /* 0 = 3.3V / 1 = 5V */
+#define PCI_EN_BOOT (1L<<24) /* Bit 24: Enable BOOT via ROM */
+ /* 1 = Don't boot wth ROM*/
+ /* 0 = Boot with ROM */
+#define PCI_EN_IO (1L<<23) /* Bit 23: Mapping to IO space */
#define PCI_EN_FPROM (1L<<22) /* Bit 22: FLASH mapped to mem? */
- /* 1 = Map Flash to Mem */
- /* 0 = Disable addr. dec*/
+ /* 1 = Map Flash to Mem */
+ /* 0 = Disable addr. dec*/
#define PCI_PAGESIZE (3L<<20) /* Bit 21..20: FLASH Page Size */
-#define PCI_PAGE_16 (0L<<20) /* 16 k pages */
+#define PCI_PAGE_16 (0L<<20) /* 16 k pages */
#define PCI_PAGE_32K (1L<<20) /* 32 k pages */
#define PCI_PAGE_64K (2L<<20) /* 64 k pages */
#define PCI_PAGE_128K (3L<<20) /* 128 k pages */
- /* Bit 19: reserved */
-#define PCI_PAGEREG (7L<<16) /* Bit 18..16: Page Register */
-#define PCI_NOTAR (1L<<15) /* Bit 15: No turnaround cycle */
+ /* Bit 19: reserved */
+#define PCI_PAGEREG (7L<<16) /* Bit 18..16: Page Register */
+#define PCI_NOTAR (1L<<15) /* Bit 15: No turnaround cycle */
#define PCI_FORCE_BE (1L<<14) /* Bit 14: Assert all BEs on MR */
-#define PCI_DIS_MRL (1L<<13) /* Bit 13: Disable Mem R Line */
-#define PCI_DIS_MRM (1L<<12) /* Bit 12: Disable Mem R multip */
-#define PCI_DIS_MWI (1L<<11) /* Bit 11: Disable Mem W & inv */
+#define PCI_DIS_MRL (1L<<13) /* Bit 13: Disable Mem R Line */
+#define PCI_DIS_MRM (1L<<12) /* Bit 12: Disable Mem R multip */
+#define PCI_DIS_MWI (1L<<11) /* Bit 11: Disable Mem W & inv */
#define PCI_DISC_CLS (1L<<10) /* Bit 10: Disc: cacheLsz bound */
#define PCI_BURST_DIS (1L<<9) /* Bit 9: Burst Disable */
#define PCI_DIS_PCI_CLK (1L<<8) /* Bit 8: Disable PCI clock driv*/
@@ -334,9 +339,9 @@
/* PCI_OUR_REG_2 32 bit Our Register 2 */
#define PCI_VPD_WR_THR (0xffL<<24) /* Bit 31..24: VPD Write Threshold */
-#define PCI_DEV_SEL (0x7fL<<17) /* Bit 23..17: EEPROM Device Select */
+#define PCI_DEV_SEL (0x7fL<<17) /* Bit 23..17: EEPROM Device Select */
#define PCI_VPD_ROM_SZ (7L<<14) /* Bit 16..14: VPD ROM Size */
- /* Bit 13..12: reserved */
+ /* Bit 13..12: reserved */
#define PCI_PATCH_DIR (0xfL<<8) /* Bit 11.. 8: Ext Patchs dir 3..0 */
#define PCI_PATCH_DIR_0 (1L<<8)
#define PCI_PATCH_DIR_1 (1L<<9)
@@ -349,27 +354,27 @@
#define PCI_EXT_PATCH_3 (1L<<7)
#define PCI_EN_DUMMY_RD (1L<<3) /* Bit 3: Enable Dummy Read */
#define PCI_REV_DESC (1L<<2) /* Bit 2: Reverse Desc. Bytes */
- /* Bit 1: reserved */
+ /* Bit 1: reserved */
#define PCI_USEDATA64 (1L<<0) /* Bit 0: Use 64Bit Data bus ext*/
/* Power Management Region */
/* PCI_PM_CAP_REG 16 bit Power Management Capabilities */
-#define PCI_PME_SUP (0x1f<<11) /* Bit 15..11: PM Manag. Event Sup */
+#define PCI_PME_SUP (0x1f<<11) /* Bit 15..11: PM Manag. Event Sup */
#define PCI_PM_D2_SUB (1<<10) /* Bit 10: D2 Support Bit */
#define PCI_PM_D1_SUB (1<<9) /* Bit 9: D1 Support Bit */
- /* Bit 8..6: reserved */
-#define PCI_PM_DSI (1<<5) /* Bit 5: Device Specific Init.*/
-#define PCI_PM_APS (1<<4) /* Bit 4: Auxialiary Power Src */
+ /* Bit 8..6: reserved */
+#define PCI_PM_DSI (1<<5) /* Bit 5: Device Specific Init.*/
+#define PCI_PM_APS (1<<4) /* Bit 4: Auxialiary Power Src */
#define PCI_PME_CLOCK (1<<3) /* Bit 3: PM Event Clock */
-#define PCI_PM_VER (7<<0) /* Bit 2..0: PM PCI Spec. version */
+#define PCI_PM_VER (7<<0) /* Bit 2..0: PM PCI Spec. version */
/* PCI_PM_CTL_STS 16 bit Power Manag. Control/Status */
#define PCI_PME_STATUS (1<<15) /* Bit 15: PGA doesn't sup. PME# */
#define PCI_PM_DAT_SCL (3<<13) /* Bit 14..13: dat reg Scaling factor*/
#define PCI_PM_DAT_SEL (0xf<<9) /* Bit 12.. 9: PM data selector field*/
-#define PCI_PME_EN (1<<8) /* Bit 8: PGA doesn't sup. PME# */
- /* Bit 7.. 2: reserved */
+#define PCI_PME_EN (1<<8) /* Bit 8: PGA doesn't sup. PME# */
+ /* Bit 7.. 2: reserved */
#define PCI_PM_STATE (3<<0) /* Bit 1.. 0: Power Management State*/
#define PCI_PM_STATE_D0 (0<<0) /* D0: Operational (default) */
#define PCI_PM_STATE_D1 (1<<0) /* D1: not supported */
@@ -385,22 +390,22 @@
* Control Register File:
* Bank 0
*/
-#define B0_RAP 0x0000 /* 8 bit Register Address Port */
+#define B0_RAP 0x0000 /* 8 bit Register Address Port */
/* 0x0001 - 0x0003: reserved */
-#define B0_CTST 0x0004 /* 16 bit Control/Status register */
-#define B0_LED 0x0006 /* 8 Bit LED register */
+#define B0_CTST 0x0004 /* 16 bit Control/Status register */
+#define B0_LED 0x0006 /* 8 Bit LED register */
/* 0x0007: reserved */
-#define B0_ISRC 0x0008 /* 32 bit Interrupt Source Register */
-#define B0_IMSK 0x000c /* 32 bit Interrupt Mask Register */
-#define B0_HWE_ISRC 0x0010 /* 32 bit HW Error Interrupt Src Reg */
-#define B0_HWE_IMSK 0x0014 /* 32 bit HW Error Interrupt Mask Reg */
-#define B0_SP_ISRC 0x0018 /* 32 bit Special Interrupt Source Reg */
+#define B0_ISRC 0x0008 /* 32 bit Interrupt Source Register */
+#define B0_IMSK 0x000c /* 32 bit Interrupt Mask Register */
+#define B0_HWE_ISRC 0x0010 /* 32 bit HW Error Interrupt Src Reg */
+#define B0_HWE_IMSK 0x0014 /* 32 bit HW Error Interrupt Mask Reg */
+#define B0_SP_ISRC 0x0018 /* 32 bit Special Interrupt Source Reg */
/* 0x001c: reserved */
/* B0 XMAC 1 registers */
-#define B0_XM1_IMSK 0x0020 /* 16 bit r/w XMAC 1 Interrupt Mask Register*/
+#define B0_XM1_IMSK 0x0020 /* 16 bit r/w XMAC 1 Interrupt Mask Register*/
/* 0x0022 - 0x0027 reserved */
-#define B0_XM1_ISRC 0x0028 /* 16 bit ro XMAC 1 Interrupt Status Reg */
+#define B0_XM1_ISRC 0x0028 /* 16 bit ro XMAC 1 Interrupt Status Reg */
/* 0x002a - 0x002f reserved */
#define B0_XM1_PHY_ADDR 0x0030 /* 16 bit r/w XMAC 1 PHY Address Register */
/* 0x0032 - 0x0033 reserved */
@@ -408,9 +413,9 @@
/* 0x0036 - 0x003f reserved */
/* B0 XMAC 2 registers */
-#define B0_XM2_IMSK 0x0040 /* 16 bit r/w XMAC 2 Interrupt Mask Register*/
+#define B0_XM2_IMSK 0x0040 /* 16 bit r/w XMAC 2 Interrupt Mask Register*/
/* 0x0042 - 0x0047 reserved */
-#define B0_XM2_ISRC 0x0048 /* 16 bit ro XMAC 2 Interrupt Status Reg */
+#define B0_XM2_ISRC 0x0048 /* 16 bit ro XMAC 2 Interrupt Status Reg */
/* 0x004a - 0x004f reserved */
#define B0_XM2_PHY_ADDR 0x0050 /* 16 bit r/w XMAC 2 PHY Address Register */
/* 0x0052 - 0x0053 reserved */
@@ -418,12 +423,12 @@
/* 0x0056 - 0x005f reserved */
/* BMU Control Status Registers */
-#define B0_R1_CSR 0x0060 /* 32 bit BMU Ctrl/Stat Rx Queue 1 */
-#define B0_R2_CSR 0x0064 /* 32 bit BMU Ctrl/Stat Rx Queue 2 */
-#define B0_XS1_CSR 0x0068 /* 32 bit BMU Ctrl/Stat Sync Tx Queue 1 */
-#define B0_XA1_CSR 0x006c /* 32 bit BMU Ctrl/Stat Async Tx Queue 1*/
-#define B0_XS2_CSR 0x0070 /* 32 bit BMU Ctrl/Stat Sync Tx Queue 2 */
-#define B0_XA2_CSR 0x0074 /* 32 bit BMU Ctrl/Stat Async Tx Queue 2*/
+#define B0_R1_CSR 0x0060 /* 32 bit BMU Ctrl/Stat Rx Queue 1 */
+#define B0_R2_CSR 0x0064 /* 32 bit BMU Ctrl/Stat Rx Queue 2 */
+#define B0_XS1_CSR 0x0068 /* 32 bit BMU Ctrl/Stat Sync Tx Queue 1 */
+#define B0_XA1_CSR 0x006c /* 32 bit BMU Ctrl/Stat Async Tx Queue 1*/
+#define B0_XS2_CSR 0x0070 /* 32 bit BMU Ctrl/Stat Sync Tx Queue 2 */
+#define B0_XA2_CSR 0x0074 /* 32 bit BMU Ctrl/Stat Async Tx Queue 2*/
/* x0078 - 0x007f reserved */
/*
@@ -437,34 +442,34 @@
*/
/* NA reg = 48 bit Network Address Register, 3x16 or 8x8 bit readable */
-#define B2_MAC_1 0x0100 /* NA reg MAC Address 1 */
+#define B2_MAC_1 0x0100 /* NA reg MAC Address 1 */
/* 0x0106 - 0x0107 reserved */
-#define B2_MAC_2 0x0108 /* NA reg MAC Address 2 */
+#define B2_MAC_2 0x0108 /* NA reg MAC Address 2 */
/* 0x010e - 0x010f reserved */
-#define B2_MAC_3 0x0110 /* NA reg MAC Address 3 */
+#define B2_MAC_3 0x0110 /* NA reg MAC Address 3 */
/* 0x0116 - 0x0117 reserved */
-#define B2_CONN_TYP 0x0118 /* 8 bit Connector type */
-#define B2_PMD_TYP 0x0119 /* 8 bit PMD type */
-#define B2_MAC_CFG 0x011a /* 8 bit MAC Configuration */
-#define B2_CHIP_REV 0x011b /* 8 bit Queen Chip Revision Number */
+#define B2_CONN_TYP 0x0118 /* 8 bit Connector type */
+#define B2_PMD_TYP 0x0119 /* 8 bit PMD type */
+#define B2_MAC_CFG 0x011a /* 8 bit MAC Configuration */
+#define B2_CHIP_REV 0x011b /* 8 bit Queen Chip Revision Number */
/* Eprom registers are currently of no use */
-#define B2_E_0 0x011c /* 8 bit EPROM Byte 0 */
-#define B2_E_1 0x011d /* 8 bit EPROM Byte 1 */
-#define B2_E_2 0x011e /* 8 bit EPROM Byte 2 */
-#define B2_E_3 0x011f /* 8 bit EPROM Byte 3 */
-#define B2_FAR 0x0120 /* 32 bit Flash-Prom Addr Reg/Cnt */
-#define B2_FDP 0x0124 /* 8 bit Flash-Prom Data Port */
+#define B2_E_0 0x011c /* 8 bit EPROM Byte 0 */
+#define B2_E_1 0x011d /* 8 bit EPROM Byte 1 */
+#define B2_E_2 0x011e /* 8 bit EPROM Byte 2 */
+#define B2_E_3 0x011f /* 8 bit EPROM Byte 3 */
+#define B2_FAR 0x0120 /* 32 bit Flash-Prom Addr Reg/Cnt */
+#define B2_FDP 0x0124 /* 8 bit Flash-Prom Data Port */
/* 0x0125 - 0x0127: reserved */
-#define B2_LD_CRTL 0x0128 /* 8 bit EPROM loader control register */
-#define B2_LD_TEST 0x0129 /* 8 bit EPROM loader test register */
+#define B2_LD_CRTL 0x0128 /* 8 bit EPROM loader control register */
+#define B2_LD_TEST 0x0129 /* 8 bit EPROM loader test register */
/* 0x012a - 0x012f: reserved */
-#define B2_TI_INI 0x0130 /* 32 bit Timer init value */
-#define B2_TI_VAL 0x0134 /* 32 bit Timer value */
-#define B2_TI_CRTL 0x0138 /* 8 bit Timer control */
-#define B2_TI_TEST 0x0139 /* 8 Bit Timer Test */
+#define B2_TI_INI 0x0130 /* 32 bit Timer init value */
+#define B2_TI_VAL 0x0134 /* 32 bit Timer value */
+#define B2_TI_CRTL 0x0138 /* 8 bit Timer control */
+#define B2_TI_TEST 0x0139 /* 8 Bit Timer Test */
/* 0x013a - 0x013f: reserved */
-#define B2_IRQM_INI 0x0140 /* 32 bit IRQ Moderation Timer Init Reg.*/
-#define B2_IRQM_VAL 0x0144 /* 32 bit IRQ Moderation Timer Value */
+#define B2_IRQM_INI 0x0140 /* 32 bit IRQ Moderation Timer Init Reg.*/
+#define B2_IRQM_VAL 0x0144 /* 32 bit IRQ Moderation Timer Value */
#define B2_IRQM_CTRL 0x0148 /* 8 bit IRQ Moderation Timer Control */
#define B2_IRQM_TEST 0x0149 /* 8 bit IRQ Moderation Timer Test */
#define B2_IRQM_MSK 0x014c /* 32 bit IRQ Moderation Mask */
@@ -473,22 +478,22 @@
#define B2_TST_CTRL1 0x0158 /* 8 bit Test Control Register 1 */
#define B2_TST_CTRL2 0x0159 /* 8 bit Test Control Register 2 */
/* 0x015a - 0x015b: reserved */
-#define B2_GP_IO 0x015c /* 32 bit General Purpose IO Register */
-#define B2_I2C_CTRL 0x0160 /* 32 bit I2C HW Control Register */
-#define B2_I2C_DATA 0x0164 /* 32 bit I2C HW Data Register */
-#define B2_I2C_IRQ 0x0168 /* 32 bit I2C HW IRQ Register */
-#define B2_I2C_SW 0x016c /* 32 bit I2C SW Port Register */
-#define B2_BSC_INI 0x0170 /* 32 bit Blink Source Counter Init Val */
-#define B2_BSC_VAL 0x0174 /* 32 bit Blink Source Counter Value */
-#define B2_BSC_CTRL 0x0178 /* 8 bit Blink Source Counter Control */
-#define B2_BSC_STAT 0x0179 /* 8 bit Blink Source Counter Status */
-#define B2_BSC_TST 0x017a /* 16 bit Blink Source Counter Test Reg */
+#define B2_GP_IO 0x015c /* 32 bit General Purpose IO Register */
+#define B2_I2C_CTRL 0x0160 /* 32 bit I2C HW Control Register */
+#define B2_I2C_DATA 0x0164 /* 32 bit I2C HW Data Register */
+#define B2_I2C_IRQ 0x0168 /* 32 bit I2C HW IRQ Register */
+#define B2_I2C_SW 0x016c /* 32 bit I2C SW Port Register */
+#define B2_BSC_INI 0x0170 /* 32 bit Blink Source Counter Init Val */
+#define B2_BSC_VAL 0x0174 /* 32 bit Blink Source Counter Value */
+#define B2_BSC_CTRL 0x0178 /* 8 bit Blink Source Counter Control */
+#define B2_BSC_STAT 0x0179 /* 8 bit Blink Source Counter Status */
+#define B2_BSC_TST 0x017a /* 16 bit Blink Source Counter Test Reg */
/* 0x017c - 0x017f: reserved */
/*
* Bank 3
*/
-#define B3_RAM_ADDR 0x0180 /* 32 bit RAM Address, to read or write */
+#define B3_RAM_ADDR 0x0180 /* 32 bit RAM Address, to read or write */
#define B3_RAM_DATA_LO 0x0184 /* 32 bit RAM Data Word (low dWord) */
#define B3_RAM_DATA_HI 0x0188 /* 32 bit RAM Data Word (high dWord) */
/* 0x018c - 0x018f: reserved */
@@ -512,8 +517,8 @@
#define B3_RI_RTO_XS2 0x019b /* 8 bit RAM Iface RD Timeout Queue XS2 (TO11)*/
#define B3_RI_TO_VAL 0x019c /* 8 bit RAM Iface Current Timeout Count Val */
/* 0x019d - 0x019f reserved */
-#define B3_RI_CTRL 0x01a0 /* 16 bit RAM Iface Control Register */
-#define B3_RI_TEST 0x01a2 /* 8 bit RAM Iface Test Register */
+#define B3_RI_CTRL 0x01a0 /* 16 bit RAM Iface Control Register */
+#define B3_RI_TEST 0x01a2 /* 8 bit RAM Iface Test Register */
/* 0x01a3 - 0x01af reserved */
/* MAC Arbiter Registers */
/* Please notice these are the number of qWord tranfered continously and */
@@ -566,42 +571,42 @@
*/
/* Transmit Arbiter Registers MAC 1 and 2, user MR_ADDR() to address */
-#define TXA_ITI_INI 0x0200 /* 32 bit Tx Arb Interval Timer Init Val*/
-#define TXA_ITI_VAL 0x0204 /* 32 bit Tx Arb Interval Timer Value */
-#define TXA_LIM_INI 0x0208 /* 32 bit Tx Arb Limit Counter Init Val */
-#define TXA_LIM_VAL 0x020c /* 32 bit Tx Arb Limit Counter Value */
-#define TXA_CTRL 0x0210 /* 8 bit Tx Arbiter Control Register */
-#define TXA_TEST 0x0211 /* 8 bit Tx Arbiter Test Register */
-#define TXA_STAT 0x0212 /* 8 bit Tx Arbiter Status Register */
+#define TXA_ITI_INI 0x0200 /* 32 bit Tx Arb Interval Timer Init Val*/
+#define TXA_ITI_VAL 0x0204 /* 32 bit Tx Arb Interval Timer Value */
+#define TXA_LIM_INI 0x0208 /* 32 bit Tx Arb Limit Counter Init Val */
+#define TXA_LIM_VAL 0x020c /* 32 bit Tx Arb Limit Counter Value */
+#define TXA_CTRL 0x0210 /* 8 bit Tx Arbiter Control Register */
+#define TXA_TEST 0x0211 /* 8 bit Tx Arbiter Test Register */
+#define TXA_STAT 0x0212 /* 8 bit Tx Arbiter Status Register */
/* 0x0213 - 0x027f: reserved */
/*
* Bank 6
*/
/* External registers */
-#define B6_EXT_REG 0x0300
+#define B6_EXT_REG 0x0300
/*
* Bank 7
*/
/* This is a copy of the Configuration register file (lower half) */
-#define B7_CFG_SPC 0x0380
+#define B7_CFG_SPC 0x0380
/*
* Bank 8 - 15
*/
/* Receive and Transmit Queue Registers, use Q_ADDR() to access */
-#define B8_Q_REGS 0x0400
+#define B8_Q_REGS 0x0400
/* Queue Register Offsets, use Q_ADDR() to access */
-#define Q_D 0x00 /* 8*32 bit Current Descriptor */
+#define Q_D 0x00 /* 8*32 bit Current Descriptor */
#define Q_DA_L 0x20 /* 32 bit Current Descriptor Address Low dWord */
#define Q_DA_H 0x24 /* 32 bit Current Descriptor Address High dWord */
#define Q_AC_L 0x28 /* 32 bit Current Address Counter Low dWord */
#define Q_AC_H 0x2c /* 32 bit Current Address Counter High dWord */
#define Q_BC 0x30 /* 32 bit Current Byte Counter */
#define Q_CSR 0x34 /* 32 bit BMU Control/Status Register */
-#define Q_F 0x38 /* 32 bit Flag Register */
+#define Q_F 0x38 /* 32 bit Flag Register */
#define Q_T1 0x3c /* 32 bit Test Register 1 */
#define Q_T1_TR 0x3c /* 8 bit Test Register 1 Transfer SM */
#define Q_T1_WR 0x3d /* 8 bit Test Register 1 Write Descriptor SM */
@@ -639,64 +644,64 @@
* Bank 24 - 25
*/
/* Receive MAC FIFO, Receive LED, and Link Sync regs, use MR_ADDR() to address*/
-#define RX_MFF_EA 0x0c00 /* 32 bit Receive MAC FIFO End Address */
-#define RX_MFF_WP 0x0c04 /* 32 bit Receive MAC FIFO Write Pointer*/
+#define RX_MFF_EA 0x0c00 /* 32 bit Receive MAC FIFO End Address */
+#define RX_MFF_WP 0x0c04 /* 32 bit Receive MAC FIFO Write Pointer*/
/* 0x0c08 - 0x0c0b reserved */
-#define RX_MFF_RP 0x0c0c /* 32 bit Receive MAC FIFO Read Pointer */
-#define RX_MFF_PC 0x0c10 /* 32 bit Receive MAC FIFO Packet Cnt */
-#define RX_MFF_LEV 0x0c14 /* 32 bit Receive MAC FIFO Level */
+#define RX_MFF_RP 0x0c0c /* 32 bit Receive MAC FIFO Read Pointer */
+#define RX_MFF_PC 0x0c10 /* 32 bit Receive MAC FIFO Packet Cnt */
+#define RX_MFF_LEV 0x0c14 /* 32 bit Receive MAC FIFO Level */
#define RX_MFF_CTRL1 0x0c18 /* 16 bit Receive MAC FIFO Control Reg 1*/
#define RX_MFF_STAT_TO 0x0c1a /* 8 bit Receive MAC Status Timeout */
#define RX_MFF_TIST_TO 0x0c1b /* 8 bit Receive MAC Timestamp Timeout */
#define RX_MFF_CTRL2 0x0c1c /* 8 bit Receive MAC FIFO Control Reg 2*/
-#define RX_MFF_TST1 0x0c1d /* 8 bit Receive MAC FIFO Test Reg 1 */
-#define RX_MFF_TST2 0x0c1e /* 8 bit Receive MAC FIFO Test Reg 2 */
+#define RX_MFF_TST1 0x0c1d /* 8 bit Receive MAC FIFO Test Reg 1 */
+#define RX_MFF_TST2 0x0c1e /* 8 bit Receive MAC FIFO Test Reg 2 */
/* 0x0c1f reserved */
-#define RX_LED_INI 0x0c20 /* 32 bit Receive LED Cnt Init Value */
-#define RX_LED_VAL 0x0c24 /* 32 bit Receive LED Cnt Current Value */
-#define RX_LED_CTRL 0x0c28 /* 8 bit Receive LED Cnt Control Reg */
-#define RX_LED_TST 0x0c29 /* 8 bit Receive LED Cnt Test Register */
+#define RX_LED_INI 0x0c20 /* 32 bit Receive LED Cnt Init Value */
+#define RX_LED_VAL 0x0c24 /* 32 bit Receive LED Cnt Current Value */
+#define RX_LED_CTRL 0x0c28 /* 8 bit Receive LED Cnt Control Reg */
+#define RX_LED_TST 0x0c29 /* 8 bit Receive LED Cnt Test Register */
/* 0x0c2a - 0x0c2f reserved */
#define LNK_SYNC_INI 0x0c30 /* 32 bit Link Sync Cnt Init Value */
#define LNK_SYNC_VAL 0x0c34 /* 32 bit Link Sync Cnt Current Value */
#define LNK_SYNC_CTRL 0x0c38 /* 8 bit Link Sync Cnt Control Register*/
#define LNK_SYNC_TST 0x0c39 /* 8 bit Link Sync Cnt Test Register */
/* 0x0c3a - 0x0c3b reserved */
-#define LNK_LED_REG 0x0c3c /* 8 bit Link LED Register */
+#define LNK_LED_REG 0x0c3c /* 8 bit Link LED Register */
/* 0x0c3d - 0x0c7f reserved */
/*
* Bank 26 - 27
*/
/* Transmit MAC FIFO and Transmit LED Registers, use MR_ADDR() to address */
-#define TX_MFF_EA 0x0d00 /* 32 bit Transmit MAC FIFO End Address */
-#define TX_MFF_WP 0x0d04 /* 32 bit Transmit MAC FIFO WR Pointer */
-#define TX_MFF_WSP 0x0d08 /* 32 bit Transmit MAC FIFO WR Shadow Pt*/
-#define TX_MFF_RP 0x0d0c /* 32 bit Transmit MAC FIFO RD Pointer */
-#define TX_MFF_PC 0x0d10 /* 32 bit Transmit MAC FIFO Packet Cnt */
-#define TX_MFF_LEV 0x0d14 /* 32 bit Transmit MAC FIFO Level */
+#define TX_MFF_EA 0x0d00 /* 32 bit Transmit MAC FIFO End Address */
+#define TX_MFF_WP 0x0d04 /* 32 bit Transmit MAC FIFO WR Pointer */
+#define TX_MFF_WSP 0x0d08 /* 32 bit Transmit MAC FIFO WR Shadow Pt*/
+#define TX_MFF_RP 0x0d0c /* 32 bit Transmit MAC FIFO RD Pointer */
+#define TX_MFF_PC 0x0d10 /* 32 bit Transmit MAC FIFO Packet Cnt */
+#define TX_MFF_LEV 0x0d14 /* 32 bit Transmit MAC FIFO Level */
#define TX_MFF_CTRL1 0x0d18 /* 16 bit Transmit MAC FIFO Ctrl Reg 1 */
-#define TX_MFF_WAF 0x0d1a /* 8 bit Transmit MAC Wait after flush*/
+#define TX_MFF_WAF 0x0d1a /* 8 bit Transmit MAC Wait after flush*/
/* 0x0c1b reserved */
#define TX_MFF_CTRL2 0x0d1c /* 8 bit Transmit MAC FIFO Ctrl Reg 2 */
-#define TX_MFF_TST1 0x0d1d /* 8 bit Transmit MAC FIFO Test Reg 1 */
-#define TX_MFF_TST2 0x0d1e /* 8 bit Transmit MAC FIFO Test Reg 2 */
+#define TX_MFF_TST1 0x0d1d /* 8 bit Transmit MAC FIFO Test Reg 1 */
+#define TX_MFF_TST2 0x0d1e /* 8 bit Transmit MAC FIFO Test Reg 2 */
/* 0x0d1f reserved */
-#define TX_LED_INI 0x0d20 /* 32 bit Transmit LED Cnt Init Value */
-#define TX_LED_VAL 0x0d24 /* 32 bit Transmit LED Cnt Current Val */
-#define TX_LED_CTRL 0x0d28 /* 8 bit Transmit LED Cnt Control Reg */
-#define TX_LED_TST 0x0d29 /* 8 bit Transmit LED Cnt Test Register*/
+#define TX_LED_INI 0x0d20 /* 32 bit Transmit LED Cnt Init Value */
+#define TX_LED_VAL 0x0d24 /* 32 bit Transmit LED Cnt Current Val */
+#define TX_LED_CTRL 0x0d28 /* 8 bit Transmit LED Cnt Control Reg */
+#define TX_LED_TST 0x0d29 /* 8 bit Transmit LED Cnt Test Register*/
/* 0x0d2a - 0x0d7f reserved */
/*
* Bank 28
*/
/* Descriptor Poll Timer Registers */
-#define B28_DPT_INI 0x0e00 /* 32 bit Descriptor Poll Timer Init Val*/
-#define B28_DPT_VAL 0x0e04 /* 32 bit Descriptor Poll Timer Curr Val*/
+#define B28_DPT_INI 0x0e00 /* 32 bit Descriptor Poll Timer Init Val*/
+#define B28_DPT_VAL 0x0e04 /* 32 bit Descriptor Poll Timer Curr Val*/
#define B28_DPT_CTRL 0x0e08 /* 8 bit Descriptor Poll Timer Ctrl Reg*/
/* 0x0e09: reserved */
-#define B28_DPT_TST 0x0e0a /* 8 bit Descriptor Poll Timer Test Reg*/
+#define B28_DPT_TST 0x0e0a /* 8 bit Descriptor Poll Timer Test Reg*/
/* 0x0e0b - 0x0e8f: reserved */
/*
@@ -736,7 +741,7 @@
*/
/* B0_RAP 8 bit Register Address Port */
/* Bit 7: reserved */
-#define RAP_RAP 0x3f /* Bit 6..0: 0 = block 0, .., 6f = block 6f*/
+#define RAP_RAP 0x3f /* Bit 6..0: 0 = block 0, .., 6f = block 6f*/
/* B0_CTST 16 bit Control/Status register */
/* Bit 15..10: reserved */
@@ -746,70 +751,70 @@
#define CS_CL_SW_IRQ (1<<6) /* Bit 6: Clear IRQ SW Request */
#define CS_STOP_DONE (1<<5) /* Bit 5: Stop Master is finished */
#define CS_STOP_MAST (1<<4) /* Bit 4: Command Bit to stop the master*/
-#define CS_MRST_CLR (1<<3) /* Bit 3: Clear Master reset */
-#define CS_MRST_SET (1<<2) /* Bit 2: Set Master reset */
-#define CS_RST_CLR (1<<1) /* Bit 1: Clear Software reset */
-#define CS_RST_SET (1<<0) /* Bit 0: Set Software reset */
+#define CS_MRST_CLR (1<<3) /* Bit 3: Clear Master reset */
+#define CS_MRST_SET (1<<2) /* Bit 2: Set Master reset */
+#define CS_RST_CLR (1<<1) /* Bit 1: Clear Software reset */
+#define CS_RST_SET (1<<0) /* Bit 0: Set Software reset */
/* B0_LED 8 Bit LED register */
/* Bit 7..2: reserved */
-#define LED_STAT_ON (1<<1) /* Bit 1: Status LED on */
+#define LED_STAT_ON (1<<1) /* Bit 1: Status LED on */
#define LED_STAT_OFF (1<<0) /* Bit 0: Status LED off */
/* B0_ISRC 32 bit Interrupt Source Register */
/* B0_IMSK 32 bit Interrupt Mask Register */
/* B0_SP_ISRC 32 bit Special Interrupt Source Reg */
/* B2_IRQM_MSK 32 bit IRQ Moderation Mask */
-#define IS_ALL_MSK 0xbfffffffL /* All Interrupt bits */
-#define IS_HW_ERR (1UL<<31) /* Bit 31: Interrupt HW Error */
- /* Bit 30: reserved */
+#define IS_ALL_MSK 0xbfffffffL /* All Interrupt bits */
+#define IS_HW_ERR (1UL<<31) /* Bit 31: Interrupt HW Error */
+ /* Bit 30: reserved */
#define IS_PA_TO_RX1 (1L<<29) /* Bit 29: Packet Arb Timeout Rx1*/
#define IS_PA_TO_RX2 (1L<<28) /* Bit 28: Packet Arb Timeout Rx2*/
#define IS_PA_TO_TX1 (1L<<27) /* Bit 27: Packet Arb Timeout Tx1*/
#define IS_PA_TO_TX2 (1L<<26) /* Bit 26: Packet Arb Timeout Tx2*/
#define IS_I2C_READY (1L<<25) /* Bit 25: IRQ on end of I2C tx */
-#define IS_IRQ_SW (1L<<24) /* Bit 24: SW forced IRQ */
-#define IS_EXT_REG (1L<<23) /* Bit 23: IRQ from external reg */
-#define IS_TIMINT (1L<<22) /* Bit 22: IRQ from Timer */
-#define IS_MAC1 (1L<<21) /* Bit 21: IRQ from MAC 1 */
+#define IS_IRQ_SW (1L<<24) /* Bit 24: SW forced IRQ */
+#define IS_EXT_REG (1L<<23) /* Bit 23: IRQ from external reg */
+#define IS_TIMINT (1L<<22) /* Bit 22: IRQ from Timer */
+#define IS_MAC1 (1L<<21) /* Bit 21: IRQ from MAC 1 */
#define IS_LNK_SYNC_M1 (1L<<20) /* Bit 20: Link Sync Cnt wrap M1 */
-#define IS_MAC2 (1L<<19) /* Bit 19: IRQ from MAC 2 */
+#define IS_MAC2 (1L<<19) /* Bit 19: IRQ from MAC 2 */
#define IS_LNK_SYNC_M2 (1L<<18) /* Bit 18: Link Sync Cnt wrap M2 */
/* Receive Queue 1 */
-#define IS_R1_B (1L<<17) /* Bit 17: Q_R1 End of Buffer */
-#define IS_R1_F (1L<<16) /* Bit 16: Q_R1 End of Frame */
-#define IS_R1_C (1L<<15) /* Bit 15: Q_R1 Encoding Error */
+#define IS_R1_B (1L<<17) /* Bit 17: Q_R1 End of Buffer */
+#define IS_R1_F (1L<<16) /* Bit 16: Q_R1 End of Frame */
+#define IS_R1_C (1L<<15) /* Bit 15: Q_R1 Encoding Error */
/* Receive Queue 2 */
-#define IS_R2_B (1L<<14) /* Bit 14: Q_R2 End of Buffer */
-#define IS_R2_F (1L<<13) /* Bit 13: Q_R2 End of Frame */
-#define IS_R2_C (1L<<12) /* Bit 12: Q_R2 Encoding Error */
+#define IS_R2_B (1L<<14) /* Bit 14: Q_R2 End of Buffer */
+#define IS_R2_F (1L<<13) /* Bit 13: Q_R2 End of Frame */
+#define IS_R2_C (1L<<12) /* Bit 12: Q_R2 Encoding Error */
/* Synchronous Transmit Queue 1 */
-#define IS_XS1_B (1L<<11) /* Bit 11: Q_XS1 End of Buffer */
-#define IS_XS1_F (1L<<10) /* Bit 10: Q_XS1 End of Frame */
-#define IS_XS1_C (1L<<9) /* Bit 9: Q_XS1 Encoding Error */
+#define IS_XS1_B (1L<<11) /* Bit 11: Q_XS1 End of Buffer */
+#define IS_XS1_F (1L<<10) /* Bit 10: Q_XS1 End of Frame */
+#define IS_XS1_C (1L<<9) /* Bit 9: Q_XS1 Encoding Error */
/* Asynchronous Transmit Queue 1 */
-#define IS_XA1_B (1L<<8) /* Bit 8: Q_XA1 End of Buffer */
-#define IS_XA1_F (1L<<7) /* Bit 7: Q_XA1 End of Frame */
-#define IS_XA1_C (1L<<6) /* Bit 6: Q_XA1 Encoding Error */
+#define IS_XA1_B (1L<<8) /* Bit 8: Q_XA1 End of Buffer */
+#define IS_XA1_F (1L<<7) /* Bit 7: Q_XA1 End of Frame */
+#define IS_XA1_C (1L<<6) /* Bit 6: Q_XA1 Encoding Error */
/* Synchronous Transmit Queue 2 */
-#define IS_XS2_B (1L<<5) /* Bit 5: Q_XS2 End of Buffer */
-#define IS_XS2_F (1L<<4) /* Bit 4: Q_XS2 End of Frame */
-#define IS_XS2_C (1L<<3) /* Bit 3: Q_XS2 Encoding Error */
+#define IS_XS2_B (1L<<5) /* Bit 5: Q_XS2 End of Buffer */
+#define IS_XS2_F (1L<<4) /* Bit 4: Q_XS2 End of Frame */
+#define IS_XS2_C (1L<<3) /* Bit 3: Q_XS2 Encoding Error */
/* Asynchronous Transmit Queue 2 */
-#define IS_XA2_B (1L<<2) /* Bit 2: Q_XA2 End of Buffer */
-#define IS_XA2_F (1L<<1) /* Bit 1: Q_XA2 End of Frame */
-#define IS_XA2_C (1L<<0) /* Bit 0: Q_XA2 Encoding Error */
+#define IS_XA2_B (1L<<2) /* Bit 2: Q_XA2 End of Buffer */
+#define IS_XA2_F (1L<<1) /* Bit 1: Q_XA2 End of Frame */
+#define IS_XA2_C (1L<<0) /* Bit 0: Q_XA2 Encoding Error */
/* B0_HWE_ISRC 32 bit HW Error Interrupt Src Reg */
/* B0_HWE_IMSK 32 bit HW Error Interrupt Mask Reg */
/* B2_IRQM_HWE_MSK 32 bit IRQ Moderation HW Error Mask */
-#define IS_ERR_MSK 0x00000fffL /* All Error bits */
- /* Bit 31..12: reserved */
+#define IS_ERR_MSK 0x00000fffL /* All Error bits */
+ /* Bit 31..12: reserved */
#define IS_IRQ_MST_ERR (1L<<11) /* Bit 11: IRQ master error */
- /* PERR,RMABORT,RTABORT,DATAPERR */
-#define IS_IRQ_STAT (1L<<10) /* Bit 10: IRQ status execption */
- /* RMABORT, RTABORT, DATAPERR */
+ /* PERR,RMABORT,RTABORT,DATAPERR */
+#define IS_IRQ_STAT (1L<<10) /* Bit 10: IRQ status execption */
+ /* RMABORT, RTABORT, DATAPERR */
#define IS_NO_STAT_M1 (1L<<9) /* Bit 9: No Rx Status from MAC1*/
#define IS_NO_STAT_M2 (1L<<8) /* Bit 8: No Rx Status from MAC2*/
#define IS_NO_TIST_M1 (1L<<7) /* Bit 7: No Timestamp from MAC1*/
@@ -826,53 +831,53 @@
/* Values of connector and PMD type comply to SysKonnect internal std */
/* B2_MAC_CFG 8 bit MAC Configuration */
- /* Bit 7..2: reserved */
+ /* Bit 7..2: reserved */
#define CFG_DIS_M2_CLK (1<<1) /* Bit 1: Disable Clock for 2nd MAC */
-#define CFG_SNG_MAC (1<<0) /* Bit 0: MAC Config: 1=2 MACs / 0=1 MAC*/
+#define CFG_SNG_MAC (1<<0) /* Bit 0: MAC Config: 1=2 MACs / 0=1 MAC*/
/* B2_CHIP_REV 8 bit Queen Chip Revision Number */
#define FIRST_CHIP_REV 0x0a /* Initial Revision Value */
/* B2_FAR 32 bit Flash-Prom Addr Reg/Cnt */
-#define FAR_ADDR 0x1ffffL /* Bit 16..0: FPROM Address mask */
+#define FAR_ADDR 0x1ffffL /* Bit 16..0: FPROM Address mask */
/* B2_LD_CRTL 8 bit EPROM loader control register */
/* Bits are currently reserved */
/* B2_LD_TEST 8 bit EPROM loader test register */
- /* Bit 7..4: reserved */
-#define LD_T_ON (1<<3) /* Bit 3: Loader Testmode on */
-#define LD_T_OFF (1<<2) /* Bit 2: Loader Testmode off */
-#define LD_T_STEP (1<<1) /* Bit 1: Decrement FPROM addr. Counter */
-#define LD_START (1<<0) /* Bit 0: Start loading FPROM */
+ /* Bit 7..4: reserved */
+#define LD_T_ON (1<<3) /* Bit 3: Loader Testmode on */
+#define LD_T_OFF (1<<2) /* Bit 2: Loader Testmode off */
+#define LD_T_STEP (1<<1) /* Bit 1: Decrement FPROM addr. Counter */
+#define LD_START (1<<0) /* Bit 0: Start loading FPROM */
/*
* Timer Section
*/
/* B2_TI_CRTL 8 bit Timer control */
/* B2_IRQM_CTRL 8 bit IRQ Moderation Timer Control */
- /* Bit 7..3: reserved */
-#define TIM_START (1<<2) /* Bit 2: Start Timer */
-#define TIM_STOP (1<<1) /* Bit 1: Stop Timer */
-#define TIM_CLR_IRQ (1<<0) /* Bit 0: Clear Timer IRQ, (!IRQM) */
+ /* Bit 7..3: reserved */
+#define TIM_START (1<<2) /* Bit 2: Start Timer */
+#define TIM_STOP (1<<1) /* Bit 1: Stop Timer */
+#define TIM_CLR_IRQ (1<<0) /* Bit 0: Clear Timer IRQ, (!IRQM) */
/* B2_TI_TEST 8 Bit Timer Test */
/* B2_IRQM_TEST 8 bit IRQ Moderation Timer Test */
/* B28_DPT_TST 8 bit Descriptor Poll Timer Test Reg */
- /* Bit 7..3: reserved */
-#define TIM_T_ON (1<<2) /* Bit 2: Test mode on */
-#define TIM_T_OFF (1<<1) /* Bit 1: Test mode off */
-#define TIM_T_STEP (1<<0) /* Bit 0: Test step */
+ /* Bit 7..3: reserved */
+#define TIM_T_ON (1<<2) /* Bit 2: Test mode on */
+#define TIM_T_OFF (1<<1) /* Bit 1: Test mode off */
+#define TIM_T_STEP (1<<0) /* Bit 0: Test step */
/* B28_DPT_INI 32 bit Descriptor Poll Timer Init Val */
/* B28_DPT_VAL 32 bit Descriptor Poll Timer Curr Val */
- /* Bit 31..24: reserved */
-#define DPT_MSK 0x00ffffffL /* Bit 23.. 0: Desc Poll Timer Bits */
+ /* Bit 31..24: reserved */
+#define DPT_MSK 0x00ffffffL /* Bit 23.. 0: Desc Poll Timer Bits */
/* B28_DPT_CTRL 8 bit Descriptor Poll Timer Ctrl Reg */
- /* Bit 7..2: reserved */
-#define DPT_START (1<<1) /* Bit 1: Start Desciptor Poll Timer */
-#define DPT_STOP (1<<0) /* Bit 0: Stop Desciptor Poll Timer */
+ /* Bit 7..2: reserved */
+#define DPT_START (1<<1) /* Bit 1: Start Desciptor Poll Timer */
+#define DPT_STOP (1<<0) /* Bit 0: Stop Desciptor Poll Timer */
/* B2_TST_CTRL1 8 bit Test Control Register 1 */
@@ -886,7 +891,7 @@
#define TST_CFG_WRITE_OFF (1<<0) /* Bit 0: Disable Config Reg WR */
/* B2_TST_CTRL2 8 bit Test Control Register 2 */
- /* Bit 7..4: reserved */
+ /* Bit 7..4: reserved */
/* force the following error on */
/* the next master read/write */
#define TST_FRC_DPERR_MR64 (1<<3) /* Bit 3: DataPERR RD 64 */
@@ -895,7 +900,7 @@
#define TST_FRC_APERR_2M64 (1<<0) /* Bit 0: AddrPERR on 2. phase */
/* B2_GP_IO 32 bit General Purpose IO Register */
- /* Bit 31..26: reserved */
+ /* Bit 31..26: reserved */
#define GP_DIR_9 (1L<<25) /* Bit 25: IO_9 direct, 0=I/1=O */
#define GP_DIR_8 (1L<<24) /* Bit 24: IO_8 direct, 0=I/1=O */
#define GP_DIR_7 (1L<<23) /* Bit 23: IO_7 direct, 0=I/1=O */
@@ -906,7 +911,7 @@
#define GP_DIR_2 (1L<<18) /* Bit 18: IO_2 direct, 0=I/1=O */
#define GP_DIR_1 (1L<<17) /* Bit 17: IO_1 direct, 0=I/1=O */
#define GP_DIR_0 (1L<<16) /* Bit 16: IO_0 direct, 0=I/1=O */
- /* Bit 15..10: reserved */
+ /* Bit 15..10: reserved */
#define GP_IO_9 (1L<<9) /* Bit 9: IO_9 pin */
#define GP_IO_8 (1L<<8) /* Bit 8: IO_8 pin */
#define GP_IO_7 (1L<<7) /* Bit 7: IO_7 pin */
@@ -919,31 +924,31 @@
#define GP_IO_0 (1L<<0) /* Bit 0: IO_0 pin */
/* B2_I2C_CTRL 32 bit I2C HW Control Register */
-#define I2C_FLAG (1UL<<31) /* Bit 31: Start read/write if WR*/
+#define I2C_FLAG (1UL<<31) /* Bit 31: Start read/write if WR*/
#define I2C_ADDR (0x7fffL<<16) /* Bit 30..16: Addr to be RD/WR */
-#define I2C_DEV_SEL (0x7fL<<9) /* Bit 15.. 9: I2C Device Select */
- /* Bit 8.. 5: reserved */
+#define I2C_DEV_SEL (0x7fL<<9) /* Bit 15.. 9: I2C Device Select */
+ /* Bit 8.. 5: reserved */
#define I2C_BURST_LEN (1L<<4) /* Bit 4: Burst Len, 1/4 bytes */
#define I2C_DEV_SIZE (7L<<1) /* Bit 3.. 1: I2C Device Size */
#define I2C_025K_DEV (0L<<1) /* 0: 256 Bytes or smal. */
-#define I2C_05K_DEV (1L<<1) /* 1: 512 Bytes */
-#define I2C_1K_DEV (2L<<1) /* 2: 1024 Bytes */
-#define I2C_2K_DEV (3L<<1) /* 3: 2048 Bytes */
-#define I2C_4K_DEV (4L<<1) /* 4: 4096 Bytes */
-#define I2C_8K_DEV (5L<<1) /* 5: 8192 Bytes */
-#define I2C_16K_DEV (6L<<1) /* 6: 16384 Bytes */
-#define I2C_32K_DEV (7L<<1) /* 7: 32768 Bytes */
-#define I2C_STOP (1L<<0) /* Bit 0: Interrupt I2C transfer*/
+#define I2C_05K_DEV (1L<<1) /* 1: 512 Bytes */
+#define I2C_1K_DEV (2L<<1) /* 2: 1024 Bytes */
+#define I2C_2K_DEV (3L<<1) /* 3: 2048 Bytes */
+#define I2C_4K_DEV (4L<<1) /* 4: 4096 Bytes */
+#define I2C_8K_DEV (5L<<1) /* 5: 8192 Bytes */
+#define I2C_16K_DEV (6L<<1) /* 6: 16384 Bytes */
+#define I2C_32K_DEV (7L<<1) /* 7: 32768 Bytes */
+#define I2C_STOP (1L<<0) /* Bit 0: Interrupt I2C transfer*/
/* B2_I2C_IRQ 32 bit I2C HW IRQ Register */
- /* Bit 31..1 reserved */
-#define I2C_CLR_IRQ (1<<0) /* Bit 0: Clear I2C IRQ */
+ /* Bit 31..1 reserved */
+#define I2C_CLR_IRQ (1<<0) /* Bit 0: Clear I2C IRQ */
/* B2_I2C_SW 32 bit I2C HW SW Port Register */
- /* Bit 7..3: reserved */
+ /* Bit 7..3: reserved */
#define I2C_DATA_DIR (1<<2) /* Bit 2: direction of I2C_DATA */
-#define I2C_DATA (1<<1) /* Bit 1: I2C Data Port */
-#define I2C_CLK (1<<0) /* Bit 0: I2C Clock Port */
+#define I2C_DATA (1<<1) /* Bit 1: I2C Data Port */
+#define I2C_CLK (1<<0) /* Bit 0: I2C Clock Port */
/*
* I2C Address
@@ -952,12 +957,12 @@
/* B2_BSC_CTRL 8 bit Blink Source Counter Control */
- /* Bit 7..2: reserved */
+ /* Bit 7..2: reserved */
#define BSC_START (1<<1) /* Bit 1: Start Blink Source Counter */
#define BSC_STOP (1<<0) /* Bit 0: Stop Blink Source Counter */
/* B2_BSC_STAT 8 bit Blink Source Counter Status */
- /* Bit 7..1: reserved */
+ /* Bit 7..1: reserved */
#define BSC_SRC (1<<0) /* Bit 0: Blink Source, 0=Off / 1=On */
/* B2_BSC_TST 16 bit Blink Source Counter Test Reg */
@@ -972,30 +977,30 @@
/* RAM Interface Registers */
/* B3_RI_CTRL 16 bit RAM Iface Control Register */
- /* Bit 15..10: reserved */
+ /* Bit 15..10: reserved */
#define RI_CLR_RD_PERR (1<<9) /* Bit 9: Clear IRQ RAM Read Parity Err */
#define RI_CLR_WR_PERR (1<<8) /* Bit 8: Clear IRQ RAM Write Parity Err*/
- /* Bit 7..2: reserved */
-#define RI_RST_CLR (1<<1) /* Bit 1: Clear RAM Interface Reset */
-#define RI_RST_SET (1<<0) /* Bit 0: Set RAM Interface Reset */
+ /* Bit 7..2: reserved */
+#define RI_RST_CLR (1<<1) /* Bit 1: Clear RAM Interface Reset */
+#define RI_RST_SET (1<<0) /* Bit 0: Set RAM Interface Reset */
/* B3_RI_TEST 8 bit RAM Iface Test Register */
- /* Bit 15..4: reserved */
-#define RI_T_EV (1<<3) /* Bit 3: Timeout Event occured */
-#define RI_T_ON (1<<2) /* Bit 2: Timeout Timer Test On */
-#define RI_T_OFF (1<<1) /* Bit 1: Timeout Timer Test Off */
-#define RI_T_STEP (1<<0) /* Bit 0: Timeout Timer Step */
+ /* Bit 15..4: reserved */
+#define RI_T_EV (1<<3) /* Bit 3: Timeout Event occurred */
+#define RI_T_ON (1<<2) /* Bit 2: Timeout Timer Test On */
+#define RI_T_OFF (1<<1) /* Bit 1: Timeout Timer Test Off */
+#define RI_T_STEP (1<<0) /* Bit 0: Timeout Timer Step */
/* MAC Arbiter Registers */
/* B3_MA_TO_CTRL 16 bit MAC Arbiter Timeout Ctrl Reg */
- /* Bit 15..4: reserved */
-#define MA_FOE_ON (1<<3) /* Bit 3: XMAC Fast Output Enable ON */
-#define MA_FOE_OFF (1<<2) /* Bit 2: XMAC Fast Output Enable OFF */
-#define MA_RST_CLR (1<<1) /* Bit 1: Clear MAC Arbiter Reset */
-#define MA_RST_SET (1<<0) /* Bit 0: Set MAC Arbiter Reset */
+ /* Bit 15..4: reserved */
+#define MA_FOE_ON (1<<3) /* Bit 3: XMAC Fast Output Enable ON */
+#define MA_FOE_OFF (1<<2) /* Bit 2: XMAC Fast Output Enable OFF */
+#define MA_RST_CLR (1<<1) /* Bit 1: Clear MAC Arbiter Reset */
+#define MA_RST_SET (1<<0) /* Bit 0: Set MAC Arbiter Reset */
/* B3_MA_RC_CTRL 16 bit MAC Arbiter Recovery Ctrl Reg */
- /* Bit 15..8: reserved */
+ /* Bit 15..8: reserved */
#define MA_ENA_REC_TX2 (1<<7) /* Bit 7: Enable Recovery Timer TX2 */
#define MA_DIS_REC_TX2 (1<<6) /* Bit 6: Disable Recovery Timer TX2 */
#define MA_ENA_REC_TX1 (1<<5) /* Bit 5: Enable Recovery Timer TX1 */
@@ -1007,7 +1012,7 @@
/* Packet Arbiter Registers */
/* B3_PA_CTRL 16 bit Packet Arbiter Ctrl Register */
- /* Bit 15..14: reserved */
+ /* Bit 15..14: reserved */
#define PA_CLR_TO_TX2 (1<<13) /* Bit 13: Clear IRQ Packet Timeout TX2 */
#define PA_CLR_TO_TX1 (1<<12) /* Bit 12: Clear IRQ Packet Timeout TX1 */
#define PA_CLR_TO_RX2 (1<<11) /* Bit 11: Clear IRQ Packet Timeout RX2 */
@@ -1020,30 +1025,30 @@
#define PA_DIS_TO_RX2 (1<<4) /* Bit 4: Disable Timeout Timer RX2 */
#define PA_ENA_TO_RX1 (1<<3) /* Bit 3: Enable Timeout Timer RX1 */
#define PA_DIS_TO_RX1 (1<<2) /* Bit 2: Disable Timeout Timer RX1 */
-#define PA_RST_CLR (1<<1) /* Bit 1: Clear MAC Arbiter Reset */
-#define PA_RST_SET (1<<0) /* Bit 0: Set MAC Arbiter Reset */
+#define PA_RST_CLR (1<<1) /* Bit 1: Clear MAC Arbiter Reset */
+#define PA_RST_SET (1<<0) /* Bit 0: Set MAC Arbiter Reset */
#define PA_ENA_TO_ALL (PA_ENA_TO_RX1 | PA_ENA_TO_RX2 |\
- PA_ENA_TO_TX1 | PA_ENA_TO_TX2)
+ PA_ENA_TO_TX1 | PA_ENA_TO_TX2)
/* Rx/Tx Path related Arbiter Test Registers */
/* B3_MA_TO_TEST 16 bit MAC Arbiter Timeout Test Reg */
/* B3_MA_RC_TEST 16 bit MAC Arbiter Recovery Test Reg */
/* B3_PA_TEST 16 bit Packet Arbiter Test Register */
/* Bit 15, 11, 7, and 3 are reserved in B3_PA_TEST */
-#define TX2_T_EV (1<<15) /* Bit 15: TX2 Timeout/Recv Event occured*/
+#define TX2_T_EV (1<<15) /* Bit 15: TX2 Timeout/Recv Event occurred*/
#define TX2_T_ON (1<<14) /* Bit 14: TX2 Timeout/Recv Timer Test On*/
#define TX2_T_OFF (1<<13) /* Bit 13: TX2 Timeout/Recv Timer Tst Off*/
#define TX2_T_STEP (1<<12) /* Bit 12: TX2 Timeout/Recv Timer Step */
-#define TX1_T_EV (1<<11) /* Bit 11: TX1 Timeout/Recv Event occured*/
+#define TX1_T_EV (1<<11) /* Bit 11: TX1 Timeout/Recv Event occurred*/
#define TX1_T_ON (1<<10) /* Bit 10: TX1 Timeout/Recv Timer Test On*/
#define TX1_T_OFF (1<<9) /* Bit 9: TX1 Timeout/Recv Timer Tst Off*/
#define TX1_T_STEP (1<<8) /* Bit 8: TX1 Timeout/Recv Timer Step */
-#define RX2_T_EV (1<<7) /* Bit 7: RX2 Timeout/Recv Event occured*/
+#define RX2_T_EV (1<<7) /* Bit 7: RX2 Timeout/Recv Event occurred*/
#define RX2_T_ON (1<<6) /* Bit 6: RX2 Timeout/Recv Timer Test On*/
#define RX2_T_OFF (1<<5) /* Bit 5: RX2 Timeout/Recv Timer Tst Off*/
#define RX2_T_STEP (1<<4) /* Bit 4: RX2 Timeout/Recv Timer Step */
-#define RX1_T_EV (1<<3) /* Bit 3: RX1 Timeout/Recv Event occured*/
+#define RX1_T_EV (1<<3) /* Bit 3: RX1 Timeout/Recv Event occurred*/
#define RX1_T_ON (1<<2) /* Bit 2: RX1 Timeout/Recv Timer Test On*/
#define RX1_T_OFF (1<<1) /* Bit 1: RX1 Timeout/Recv Timer Tst Off*/
#define RX1_T_STEP (1<<0) /* Bit 0: RX1 Timeout/Recv Timer Step */
@@ -1054,7 +1059,7 @@
/* TXA_ITI_VAL 32 bit Tx Arb Interval Timer Value */
/* TXA_LIM_INI 32 bit Tx Arb Limit Counter Init Val */
/* TXA_LIM_VAL 32 bit Tx Arb Limit Counter Value */
- /* Bit 31..24: reserved */
+ /* Bit 31..24: reserved */
#define TXA_MAX_VAL 0x00ffffffL /* Bit 23.. 0: Max TXA Timer/Cnt Val */
/* TXA_CTRL 8 bit Tx Arbiter Control Register */
@@ -1063,9 +1068,9 @@
#define TXA_ENA_ALLOC (1<<5) /* Bit 5: Enable alloc of free bandwidth*/
#define TXA_DIS_ALLOC (1<<4) /* Bit 4: Disabl alloc of free bandwidth*/
#define TXA_START_RC (1<<3) /* Bit 3: Start sync Rate Control */
-#define TXA_STOP_RC (1<<2) /* Bit 2: Stop sync Rate Control */
-#define TXA_ENA_ARB (1<<1) /* Bit 1: Enable Tx Arbiter */
-#define TXA_DIS_ARB (1<<0) /* Bit 0: Disable Tx Arbiter */
+#define TXA_STOP_RC (1<<2) /* Bit 2: Stop sync Rate Control */
+#define TXA_ENA_ARB (1<<1) /* Bit 1: Enable Tx Arbiter */
+#define TXA_DIS_ARB (1<<0) /* Bit 0: Disable Tx Arbiter */
/* TXA_TEST 8 bit Tx Arbiter Test Register */
/* Bit 7..6: reserved */
@@ -1077,12 +1082,12 @@
#define TXA_LIM_T_STEP (1<<0) /* Bit 0: Tx Arb Limit Timer Step */
/* TXA_STAT 8 bit Tx Arbiter Status Register */
- /* Bit 7..1: reserved */
-#define TXA_PRIO_XS (1<<0) /* Bit 0: sync queue has prio to send */
+ /* Bit 7..1: reserved */
+#define TXA_PRIO_XS (1<<0) /* Bit 0: sync queue has prio to send */
/* Q_BC 32 bit Current Byte Counter */
/* Bit 31..16: reserved */
-#define BC_MAX 0xffff /* Bit 15.. 0: Byte counter */
+#define BC_MAX 0xffff /* Bit 15.. 0: Byte counter */
/* BMU Control Status Registers */
/* B0_R1_CSR 32 bit BMU Ctrl/Stat Rx Queue 1 */
@@ -1092,47 +1097,47 @@
/* B0_XA2_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 2 */
/* B0_XS2_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 2 */
/* Q_CSR 32 bit BMU Control/Status Register */
- /* Bit 31..25: reserved */
-#define CSR_SV_IDLE (1L<<24) /* Bit 24: BMU SM Idle */
- /* Bit 23..22: reserved */
+ /* Bit 31..25: reserved */
+#define CSR_SV_IDLE (1L<<24) /* Bit 24: BMU SM Idle */
+ /* Bit 23..22: reserved */
#define CSR_DESC_CLR (1L<<21) /* Bit 21: Clear Reset for Descr */
#define CSR_DESC_SET (1L<<20) /* Bit 20: Set Reset for Descr */
#define CSR_FIFO_CLR (1L<<19) /* Bit 19: Clear Reset for FIFO */
#define CSR_FIFO_SET (1L<<18) /* Bit 18: Set Reset for FIFO */
-#define CSR_HPI_RUN (1L<<17) /* Bit 17: Release HPI SM */
-#define CSR_HPI_RST (1L<<16) /* Bit 16: Reset HPI SM to Idle */
-#define CSR_SV_RUN (1L<<15) /* Bit 15: Release Supervisor SM */
-#define CSR_SV_RST (1L<<14) /* Bit 14: Reset Supervisor SM */
+#define CSR_HPI_RUN (1L<<17) /* Bit 17: Release HPI SM */
+#define CSR_HPI_RST (1L<<16) /* Bit 16: Reset HPI SM to Idle */
+#define CSR_SV_RUN (1L<<15) /* Bit 15: Release Supervisor SM */
+#define CSR_SV_RST (1L<<14) /* Bit 14: Reset Supervisor SM */
#define CSR_DREAD_RUN (1L<<13) /* Bit 13: Release Descr Read SM */
#define CSR_DREAD_RST (1L<<12) /* Bit 12: Reset Descr Read SM */
#define CSR_DWRITE_RUN (1L<<11) /* Bit 11: Rel. Descr Write SM */
#define CSR_DWRITE_RST (1L<<10) /* Bit 10: Reset Descr Write SM */
#define CSR_TRANS_RUN (1L<<9) /* Bit 9: Release Transfer SM */
#define CSR_TRANS_RST (1L<<8) /* Bit 8: Reset Transfer SM */
-#define CSR_ENA_POL (1L<<7) /* Bit 7: Enable Descr Polling */
-#define CSR_DIS_POL (1L<<6) /* Bit 6: Disable Descr Polling */
-#define CSR_STOP (1L<<5) /* Bit 5: Stop Rx/Tx Queue */
-#define CSR_START (1L<<4) /* Bit 4: Start Rx/Tx Queue */
+#define CSR_ENA_POL (1L<<7) /* Bit 7: Enable Descr Polling */
+#define CSR_DIS_POL (1L<<6) /* Bit 6: Disable Descr Polling */
+#define CSR_STOP (1L<<5) /* Bit 5: Stop Rx/Tx Queue */
+#define CSR_START (1L<<4) /* Bit 4: Start Rx/Tx Queue */
#define CSR_IRQ_CL_P (1L<<3) /* Bit 3: (Rx) Clear Parity IRQ */
#define CSR_IRQ_CL_B (1L<<2) /* Bit 2: Clear EOB IRQ */
#define CSR_IRQ_CL_F (1L<<1) /* Bit 1: Clear EOF IRQ */
#define CSR_IRQ_CL_C (1L<<0) /* Bit 0: Clear ERR IRQ */
#define CSR_SET_RESET (CSR_DESC_SET|CSR_FIFO_SET|CSR_HPI_RST|CSR_SV_RST|\
- CSR_DREAD_RST|CSR_DWRITE_RST|CSR_TRANS_RST)
+ CSR_DREAD_RST|CSR_DWRITE_RST|CSR_TRANS_RST)
#define CSR_CLR_RESET (CSR_DESC_CLR|CSR_FIFO_CLR|CSR_HPI_RUN|CSR_SV_RUN|\
- CSR_DREAD_RUN|CSR_DWRITE_RUN|CSR_TRANS_RUN)
+ CSR_DREAD_RUN|CSR_DWRITE_RUN|CSR_TRANS_RUN)
/* Q_F 32 bit Flag Register */
/* Bit 28..31: reserved */
-#define F_ALM_FULL (1L<<27) (Rx) /* Bit 27: (Rx) FIFO almost full */
-#define F_EMPTY (1L<<27) (Tx) /* Bit 27: (Tx) FIFO empty flag */
-#define F_FIFO_EOF (1L<<26) /* Bit 26: Fag bit in FIFO */
+#define F_ALM_FULL (1L<<27) (Rx) /* Bit 27: (Rx) FIFO almost full */
+#define F_EMPTY (1L<<27) (Tx) /* Bit 27: (Tx) FIFO empty flag */
+#define F_FIFO_EOF (1L<<26) /* Bit 26: Fag bit in FIFO */
#define F_WM_REACHED (1L<<25) /* Bit 25: Watermark reached */
- /* Bit 24: reserved */
+ /* Bit 24: reserved */
#define F_FIFO_LEVEL (0x1fL<<16) /* Bit 23..16: # of Qwords in FIFO */
- /* Bit 15..11: reserved */
+ /* Bit 15..11: reserved */
#define F_WATER_MARK 0x0007ffL /* Bit 10.. 0: Watermark */
/* Q_T1 32 bit Test Register 1 */
@@ -1166,9 +1171,9 @@
#define T2_STEP01 (1<<0) /* Bit 0: Inc AC/Dec BC by 1 */
/* Q_T3 32 bit Test Register 3 */
- /* Bit 31..7: reserved */
+ /* Bit 31..7: reserved */
#define T3_MUX (7<<4) /* Bit 6.. 4: Mux Position */
- /* Bit 3: reserved */
+ /* Bit 3: reserved */
#define T3_VRAM (7<<0) /* Bit 2.. 0: Virtual RAM Buffer Address */
/* RAM Buffer Register Offsets */
@@ -1187,7 +1192,7 @@
#define RB_MSK 0x0007ffff /* Bit 18.. 0: RAM Buffer Pointer Bits */
/* RB_TST2 8 bit RAM Buffer Test Register 2 */
- /* Bit 4..7: reserved */
+ /* Bit 4..7: reserved */
#define RB_PC_DEC (1<<3) /* Bit 3: Packet Counter Decrem */
#define RB_PC_T_ON (1<<2) /* Bit 2: Packet Counter Test On */
#define RB_PC_T_OFF (1<<1) /* Bit 1: Packet Counter Tst Off */
@@ -1198,19 +1203,19 @@
#define RB_WP_T_ON (1<<6) /* Bit 6: Write Pointer Test On */
#define RB_WP_T_OFF (1<<5) /* Bit 5: Write Pointer Test Off */
#define RB_WP_INC (1<<4) /* Bit 4: Write Pointer Increm */
- /* Bit 3: reserved */
+ /* Bit 3: reserved */
#define RB_RP_T_ON (1<<2) /* Bit 2: Read Pointer Test On */
#define RB_RP_T_OFF (1<<1) /* Bit 1: Read Pointer Test Off */
#define RB_RP_DEC (1<<0) /* Bit 0: Read Pointer Decrement */
/* RB_CTRL 8 bit RAM Buffer Control Register */
- /* Bit 7..6: reserved */
+ /* Bit 7..6: reserved */
#define RB_ENA_STFWD (1<<5) /* Bit 5: Enable Store & Forward */
#define RB_DIS_STFWD (1<<4) /* Bit 4: Disab. Store & Forward */
#define RB_ENA_OP_MD (1<<3) /* Bit 3: Enable Operation Mode */
#define RB_DIS_OP_MD (1<<2) /* Bit 2: Disab. Operation Mode */
-#define RB_RST_CLR (1<<1) /* Bit 1: Clr RAM Buf STM Reset */
-#define RB_RST_SET (1<<0) /* Bit 0: Set RAM Buf STM Reset */
+#define RB_RST_CLR (1<<1) /* Bit 1: Clr RAM Buf STM Reset */
+#define RB_RST_SET (1<<0) /* Bit 0: Set RAM Buf STM Reset */
/* Receive and Transmit MAC FIFO Registers, use MR_ADDR() to address */
@@ -1225,11 +1230,11 @@
/* TX_MFF_RP 32 bit Transmit MAC FIFO Read Pointer */
/* TX_MFF_PC 32 bit Transmit MAC FIFO Packet Cnt */
/* TX_MFF_LEV 32 bit Transmit MAC FIFO Level */
- /* Bit 31..6: reserved */
+ /* Bit 31..6: reserved */
#define MFF_MSK 0x007fL /* Bit 5..0: MAC FIFO Address/Pointer Bits */
/* RX_MFF_CTRL1 16 bit Receive MAC FIFO Control Reg 1 */
- /* Bit 15..14: reserved */
+ /* Bit 15..14: reserved */
#define MFF_ENA_RDY_PAT (1<<13) /* Bit 13: Enable Ready Patch */
#define MFF_DIS_RDY_PAT (1<<12) /* Bit 12: Disable Ready Patch */
#define MFF_ENA_TIM_PAT (1<<11) /* Bit 11: Enable Timing Patch */
@@ -1249,15 +1254,15 @@
/* TX_MFF_CTRL1 16 bit Transmit MAC FIFO Control Reg 1 */
#define MFF_CLR_PERR (1<<15) /* Bit 15: Clear Parity Error IRQ*/
- /* Bit 14: reserved */
+ /* Bit 14: reserved */
#define MFF_ENA_PKT_REC (1<<13) /* Bit 13: Enable Packet Recovery*/
#define MFF_DIS_PKT_REC (1<<12) /* Bit 12: Disable Packet Recov. */
/* MFF_ENA_TIM_PAT (see RX_MFF_CTRL1)Bit 11: Enable Timing Patch */
/* MFF_DIS_TIM_PAT (see RX_MFF_CTRL1)Bit 10: Disable Timing Patch */
/* MFF_ENA_ALM_FUL (see RX_MFF_CTRL1)Bit 9: Enable AlmostFull Sign*/
/* MFF_DIS_ALM_FUL (see RX_MFF_CTRL1)Bit 8: Disab. AlmostFull Sign*/
-#define MFF_ENA_W4E (1<<7) /* Bit 7: Enable Wait for Empty */
-#define MFF_DIS_W4E (1<<6) /* Bit 6: Disab. Wait for Empty */
+#define MFF_ENA_W4E (1<<7) /* Bit 7: Enable Wait for Empty */
+#define MFF_DIS_W4E (1<<6) /* Bit 6: Disab. Wait for Empty */
/* MFF_ENA_FLUSH (see RX_MFF_CTRL1)Bit 5: Enable Frame Flushing */
/* MFF_DIS_FLUSH (see RX_MFF_CTRL1)Bit 4: Disab. Frame Flushing */
#define MFF_ENA_LOOPB (1<<3) /* Bit 3: Enable Loopback */
@@ -1269,61 +1274,61 @@
/* RX_MFF_TST2 8 bit Receive MAC FIFO Test Register 2 */
/* TX_MFF_TST2 8 bit Transmit MAC FIFO Test Register 2 */
- /* Bit 7: reserved */
+ /* Bit 7: reserved */
#define MFF_WSP_T_ON (1<<6) /* Bit 6: (Tx) Write Shadow Pt TestOn */
#define MFF_WSP_T_OFF (1<<5) /* Bit 5: (Tx) Write Shadow Pt TstOff */
-#define MFF_WSP_INC (1<<4) /* Bit 4: (Tx) Write Shadow Pt Increm */
-#define MFF_PC_DEC (1<<3) /* Bit 3: Packet Counter Decrem */
-#define MFF_PC_T_ON (1<<2) /* Bit 2: Packet Counter Test On */
+#define MFF_WSP_INC (1<<4) /* Bit 4: (Tx) Write Shadow Pt Increm */
+#define MFF_PC_DEC (1<<3) /* Bit 3: Packet Counter Decrem */
+#define MFF_PC_T_ON (1<<2) /* Bit 2: Packet Counter Test On */
#define MFF_PC_T_OFF (1<<1) /* Bit 1: Packet Counter Tst Off */
-#define MFF_PC_INC (1<<0) /* Bit 0: Packet Counter Increm */
+#define MFF_PC_INC (1<<0) /* Bit 0: Packet Counter Increm */
/* RX_MFF_TST1 8 bit Receive MAC FIFO Test Register 1 */
/* TX_MFF_TST1 8 bit Transmit MAC FIFO Test Register 1 */
- /* Bit 7: reserved */
-#define MFF_WP_T_ON (1<<6) /* Bit 6: Write Pointer Test On */
+ /* Bit 7: reserved */
+#define MFF_WP_T_ON (1<<6) /* Bit 6: Write Pointer Test On */
#define MFF_WP_T_OFF (1<<5) /* Bit 5: Write Pointer Test Off */
-#define MFF_WP_INC (1<<4) /* Bit 4: Write Pointer Increm */
- /* Bit 3: reserved */
-#define MFF_RP_T_ON (1<<2) /* Bit 2: Read Pointer Test On */
+#define MFF_WP_INC (1<<4) /* Bit 4: Write Pointer Increm */
+ /* Bit 3: reserved */
+#define MFF_RP_T_ON (1<<2) /* Bit 2: Read Pointer Test On */
#define MFF_RP_T_OFF (1<<1) /* Bit 1: Read Pointer Test Off */
-#define MFF_RP_DEC (1<<0) /* Bit 0: Read Pointer Decrement */
+#define MFF_RP_DEC (1<<0) /* Bit 0: Read Pointer Decrement */
/* RX_MFF_CTRL2 8 bit Receive MAC FIFO Control Reg 2 */
/* TX_MFF_CTRL2 8 bit Transmit MAC FIFO Control Reg 2 */
- /* Bit 7..4: reserved */
+ /* Bit 7..4: reserved */
#define MFF_ENA_OP_MD (1<<3) /* Bit 3: Enable Operation Mode */
#define MFF_DIS_OP_MD (1<<2) /* Bit 2: Disab. Operation Mode */
-#define MFF_RST_CLR (1<<1) /* Bit 1: Clear MAC FIFO Reset */
-#define MFF_RST_SET (1<<0) /* Bit 0: Set MAC FIFO Reset */
+#define MFF_RST_CLR (1<<1) /* Bit 1: Clear MAC FIFO Reset */
+#define MFF_RST_SET (1<<0) /* Bit 0: Set MAC FIFO Reset */
/* Receive, Transmit, and Link LED Counter Registers */
-/* RX_LED_CTRL 8 bit Receive LED Cnt Control Reg */
-/* TX_LED_CTRL 8 bit Transmit LED Cnt Control Reg */
-/* LNK_SYNC_CTRL 8 bit Link Sync Cnt Control Register */
- /* Bit 7..3: reserved */
+/* RX_LED_CTRL 8 bit Receive LED Cnt Control Reg */
+/* TX_LED_CTRL 8 bit Transmit LED Cnt Control Reg */
+/* LNK_SYNC_CTRL 8 bit Link Sync Cnt Control Register */
+ /* Bit 7..3: reserved */
#define LED_START (1<<2) /* Bit 2: Start Timer */
#define LED_STOP (1<<1) /* Bit 1: Stop Timer */
#define LED_STATE (1<<0) /* Bit 0:(Rx/Tx)LED State, 1=LED on */
#define LED_CLR_IRQ (1<<0) /* Bit 0:(Lnk) Clear Link IRQ */
-/* RX_LED_TST 8 bit Receive LED Cnt Test Register */
-/* TX_LED_TST 8 bit Transmit LED Cnt Test Register */
-/* LNK_SYNC_TST 8 bit Link Sync Cnt Test Register */
- /* Bit 7..3: reserved */
+/* RX_LED_TST 8 bit Receive LED Cnt Test Register */
+/* TX_LED_TST 8 bit Transmit LED Cnt Test Register */
+/* LNK_SYNC_TST 8 bit Link Sync Cnt Test Register */
+ /* Bit 7..3: reserved */
#define LED_T_ON (1<<2) /* Bit 2: LED Counter Testmode On */
#define LED_T_OFF (1<<1) /* Bit 1: LED Counter Testmode Off */
#define LED_T_STEP (1<<0) /* Bit 0: LED Counter Step */
/* LNK_LED_REG 8 bit Link LED Register */
- /* Bit 7..6: reserved */
-#define LED_BLK_ON (1<<5) /* Bit 5: Link LED Blinking On */
-#define LED_BLK_OFF (1<<4) /* Bit 4: Link LED Blinking Off */
-#define LED_SYNC_ON (1<<3) /* Bit 3: Use Sync Wire to switch LED */
+ /* Bit 7..6: reserved */
+#define LED_BLK_ON (1<<5) /* Bit 5: Link LED Blinking On */
+#define LED_BLK_OFF (1<<4) /* Bit 4: Link LED Blinking Off */
+#define LED_SYNC_ON (1<<3) /* Bit 3: Use Sync Wire to switch LED */
#define LED_SYNC_OFF (1<<2) /* Bit 2: Disable Sync Wire Input */
-#define LED_ON (1<<1) /* Bit 1: switch LED on */
-#define LED_OFF (1<<0) /* Bit 0: switch LED off */
+#define LED_ON (1<<1) /* Bit 1: switch LED on */
+#define LED_OFF (1<<0) /* Bit 0: switch LED off */
/* Receive and Transmit Descriptors ******************************************/
@@ -1331,42 +1336,42 @@
/* Transmit Descriptor struct */
typedef struct s_HwTxd {
SK_U32 volatile TxCtrl; /* Transmit Buffer Control Field */
- SK_U32 TxNext ; /* Physical Address Pointer to the next TxD */
- SK_U32 TxAdrLo ; /* Physical Tx Buffer Address lower dword */
- SK_U32 TxAdrHi ; /* Physical Tx Buffer Address upper dword */
- SK_U32 TxStat ; /* Transmit Frame Status Word */
+ SK_U32 TxNext; /* Physical Address Pointer to the next TxD */
+ SK_U32 TxAdrLo; /* Physical Tx Buffer Address lower dword */
+ SK_U32 TxAdrHi; /* Physical Tx Buffer Address upper dword */
+ SK_U32 TxStat; /* Transmit Frame Status Word */
#ifndef SK_USE_REV_DESC
- SK_U16 TxTcpOffs ; /* TCP Checksum Calculation Start Value */
- SK_U16 TxRes1 ; /* 16 bit reserved field */
- SK_U16 TxTcpWp ; /* TCP Checksum Write Position */
- SK_U16 TxTcpSp ; /* TCP Checksum Calculation Start Position */
+ SK_U16 TxTcpOffs; /* TCP Checksum Calculation Start Value */
+ SK_U16 TxRes1; /* 16 bit reserved field */
+ SK_U16 TxTcpWp; /* TCP Checksum Write Position */
+ SK_U16 TxTcpSp; /* TCP Checksum Calculation Start Position */
#else /* SK_USE_REV_DESC */
- SK_U16 TxRes1 ; /* 16 bit reserved field */
- SK_U16 TxTcpOffs ; /* TCP Checksum Calculation Start Value */
- SK_U16 TxTcpSp ; /* TCP Checksum Calculation Start Position */
- SK_U16 TxTcpWp ; /* TCP Checksum Write Position */
+ SK_U16 TxRes1; /* 16 bit reserved field */
+ SK_U16 TxTcpOffs; /* TCP Checksum Calculation Start Value */
+ SK_U16 TxTcpSp; /* TCP Checksum Calculation Start Position */
+ SK_U16 TxTcpWp; /* TCP Checksum Write Position */
#endif /* SK_USE_REV_DESC */
- SK_U32 TxRes2; /* 32 bit reserved field */
+ SK_U32 TxRes2; /* 32 bit reserved field */
} SK_HWTXD;
/* Receive Descriptor struct */
typedef struct s_HwRxd {
SK_U32 volatile RxCtrl; /* Receive Buffer Control Field */
- SK_U32 RxNext ; /* Physical Address Pointer to the next TxD */
- SK_U32 RxAdrLo ; /* Physical Receive Buffer Address lower dword*/
- SK_U32 RxAdrHi ; /* Physical Receive Buffer Address upper dword*/
- SK_U32 RxStat ; /* Receive Frame Status Word */
- SK_U32 RxTiSt ; /* Receive Timestamp provided by the XMAC */
+ SK_U32 RxNext; /* Physical Address Pointer to the next TxD */
+ SK_U32 RxAdrLo; /* Physical Receive Buffer Address lower dword*/
+ SK_U32 RxAdrHi; /* Physical Receive Buffer Address upper dword*/
+ SK_U32 RxStat; /* Receive Frame Status Word */
+ SK_U32 RxTiSt; /* Receive Timestamp provided by the XMAC */
#ifndef SK_USE_REV_DESC
- SK_U16 RxTcpSum1 ; /* TCP Checksum 1 */
- SK_U16 RxTcpSum2 ; /* TCP Checksum 2 */
- SK_U16 RxTcpSp1 ; /* TCP Checksum Calculation Start Position 1 */
- SK_U16 RxTcpSp2 ; /* TCP Checksum Calculation Start Position 2 */
+ SK_U16 RxTcpSum1; /* TCP Checksum 1 */
+ SK_U16 RxTcpSum2; /* TCP Checksum 2 */
+ SK_U16 RxTcpSp1; /* TCP Checksum Calculation Start Position 1 */
+ SK_U16 RxTcpSp2; /* TCP Checksum Calculation Start Position 2 */
#else /* SK_USE_REV_DESC */
- SK_U16 RxTcpSum2 ; /* TCP Checksum 2 */
- SK_U16 RxTcpSum1 ; /* TCP Checksum 1 */
- SK_U16 RxTcpSp2 ; /* TCP Checksum Calculation Start Position 2 */
- SK_U16 RxTcpSp1 ; /* TCP Checksum Calculation Start Position 1 */
+ SK_U16 RxTcpSum2; /* TCP Checksum 2 */
+ SK_U16 RxTcpSum1; /* TCP Checksum 1 */
+ SK_U16 RxTcpSp2; /* TCP Checksum Calculation Start Position 2 */
+ SK_U16 RxTcpSp1; /* TCP Checksum Calculation Start Position 1 */
#endif /* SK_USE_REV_DESC */
} SK_HWRXD;
@@ -1384,23 +1389,23 @@
/* Descriptor Bit Definition */
/* TxCtrl Transmit Buffer Control Field */
/* RxCtrl Receive Buffer Control Field */
-#define BMU_OWN (1UL<<31) /* Bit 31: OWN bit: 0=host/1=BMU */
-#define BMU_STF (1L<<30) /* Bit 30: Start of Frame ? */
-#define BMU_EOF (1L<<29) /* Bit 29: End of Frame ? */
-#define BMU_IRQ_EOB (1L<<28) /* Bit 28: Req "End of Buff" IRQ */
-#define BMU_IRQ_EOF (1L<<27) /* Bit 27: Req "End of Frame" IRQ*/
+#define BMU_OWN (1UL<<31) /* Bit 31: OWN bit: 0=host/1=BMU */
+#define BMU_STF (1L<<30) /* Bit 30: Start of Frame ? */
+#define BMU_EOF (1L<<29) /* Bit 29: End of Frame ? */
+#define BMU_IRQ_EOB (1L<<28) /* Bit 28: Req "End of Buff" IRQ */
+#define BMU_IRQ_EOF (1L<<27) /* Bit 27: Req "End of Frame" IRQ*/
/* TxCtrl specific bits */
-#define BMU_STFWD (1L<<26) /* Bit 26: (Tx) Store&Forward Frame */
-#define BMU_NO_FCS (1L<<25) /* Bit 25: (Tx) disable XMAC FCS gener*/
-#define BMU_SW (1L<<24) /* Bit 24: (Tx) 1 bit res. for SW use */
+#define BMU_STFWD (1L<<26) /* Bit 26: (Tx) Store&Forward Frame */
+#define BMU_NO_FCS (1L<<25) /* Bit 25: (Tx) disable XMAC FCS gener*/
+#define BMU_SW (1L<<24) /* Bit 24: (Tx) 1 bit res. for SW use */
/* RxCtrl specific bits */
-#define BMU_DEV_0 (1L<<26) /* Bit 26: (Rx) transfer data to Dev0 */
+#define BMU_DEV_0 (1L<<26) /* Bit 26: (Rx) transfer data to Dev0 */
#define BMU_STAT_VAL (1L<<25) /* Bit 25: (Rx) RxStat Valid */
#define BMU_TIST_VAL (1L<<24) /* Bit 24: (Rx) RxTiSt Valid */
- /* Bit 23..16: BMU Check Opcodes */
-#define BMU_CHECK 0x00550000L /* Default BMU check */
+ /* Bit 23..16: BMU Check Opcodes */
+#define BMU_CHECK 0x00550000L /* Default BMU check */
#define BMU_TCP_CHECK 0x00560000L /* Descr with TCP ext */
-#define BMU_BBC 0x0000FFFFL /* Bit 15..0: Buffer Byte Counter */
+#define BMU_BBC 0x0000FFFFL /* Bit 15..0: Buffer Byte Counter */
/* TxStat Transmit Frame Status Word */
/* RxStat Receive Frame Status Word */
@@ -1417,8 +1422,8 @@
* FlashProm specification
*/
#define MAX_PAGES 0x20000L /* Every byte has a single page */
-#define MAX_FADDR 1 /* 1 byte per page */
-#define SKFDDI_PSZ 8 /* address PROM size */
+#define MAX_FADDR 1 /* 1 byte per page */
+#define SKFDDI_PSZ 8 /* address PROM size */
/* macros ********************************************************************/
@@ -1504,7 +1509,7 @@
* (p)Val Value or pointer to the value which should be read or
* written.
*
- * usage: XM_OUT16(IoC, MAC_1, XM_MMU_CMD, Value) ;
+ * usage: XM_OUT16(IoC, MAC_1, XM_MMU_CMD, Value);
*/
#ifdef SK_LITTLE_ENDIAN
@@ -1517,19 +1522,19 @@
#define XMA(Mac,Reg) (((0x1000 << (Mac)) + 0x1000) | ((Reg) << 1))
-#define XM_IN16(IoC,Mac,Reg,pVal) SK_IN16((IoC),XMA((Mac),(Reg)),(pVal))
-#define XM_OUT16(IoC,Mac,Reg,Val) SK_OUT16((IoC),XMA((Mac),(Reg)),(Val))
+#define XM_IN16(IoC,Mac,Reg,pVal) SK_IN16((IoC), XMA((Mac), (Reg)), (pVal))
+#define XM_OUT16(IoC,Mac,Reg,Val) SK_OUT16((IoC), XMA((Mac), (Reg)), (Val))
-#define XM_IN32(IoC,Mac,Reg,pVal) { \
- SK_IN16((IoC),XMA((Mac),(Reg)), \
+#define XM_IN32(IoC,Mac,Reg,pVal) { \
+ SK_IN16((IoC), XMA((Mac), (Reg)), \
(SK_U16 *)&((SK_U16 *)(pVal))[XM_WORD_LO]); \
- SK_IN16((IoC),XMA((Mac),(Reg+2)), \
+ SK_IN16((IoC), XMA((Mac), (Reg+2)), \
(SK_U16 *)&((SK_U16 *)(pVal))[XM_WORD_HI]); \
}
-#define XM_OUT32(IoC,Mac,Reg,Val) { \
- SK_OUT16((IoC),XMA((Mac),(Reg)), (SK_U16)((Val) & 0x0000ffffL));\
- SK_OUT16((IoC),XMA((Mac),(Reg+2)),(SK_U16)(((Val)>>16) & 0x0000ffffL));\
+#define XM_OUT32(IoC,Mac,Reg,Val) { \
+ SK_OUT16((IoC), XMA((Mac), (Reg)), (SK_U16)((Val) & 0x0000ffffL)); \
+ SK_OUT16((IoC), XMA((Mac), (Reg+2)),(SK_U16)(((Val)>>16) & 0x0000ffffL)); \
}
/*
@@ -1537,67 +1542,67 @@
*/
#define XM_INADDR(IoC, Mac, Reg, pVal) { \
- SK_U16 Word; \
- SK_U8 *pByte; \
+ SK_U16 Word; \
+ SK_U8 *pByte; \
pByte = (SK_U8 *)&((SK_U8 *)(pVal))[0]; \
SK_IN16((IoC), XMA((Mac), (Reg)), &Word); \
- pByte[0] = (SK_U8) (Word & 0x00ff); \
- pByte[1] = (SK_U8) ((Word >> 8) & 0x00ff); \
+ pByte[0] = (SK_U8)(Word & 0x00ff); \
+ pByte[1] = (SK_U8)((Word >> 8) & 0x00ff); \
SK_IN16((IoC), XMA((Mac), (Reg+2)), &Word); \
- pByte[2] = (SK_U8) (Word & 0x00ff); \
- pByte[3] = (SK_U8) ((Word >> 8) & 0x00ff); \
+ pByte[2] = (SK_U8)(Word & 0x00ff); \
+ pByte[3] = (SK_U8)((Word >> 8) & 0x00ff); \
SK_IN16((IoC), XMA((Mac), (Reg+4)), &Word); \
- pByte[4] = (SK_U8) (Word & 0x00ff); \
- pByte[5] = (SK_U8) ((Word >> 8) & 0x00ff); \
+ pByte[4] = (SK_U8)(Word & 0x00ff); \
+ pByte[5] = (SK_U8)((Word >> 8) & 0x00ff); \
}
#define XM_OUTADDR(IoC, Mac, Reg, pVal) { \
- SK_U8 *pByte; \
+ SK_U8 *pByte; \
pByte = (SK_U8 *)&((SK_U8 *)(pVal))[0]; \
SK_OUT16((IoC), XMA((Mac), (Reg)), (SK_U16) \
- (((SK_U16)(pByte[0]) & 0x00ff)| \
- (((SK_U16)(pByte[1]) << 8) & 0xff00))); \
- SK_OUT16((IoC), XMA((Mac), (Reg+2)), (SK_U16) \
- (((SK_U16)(pByte[2]) & 0x00ff)| \
- (((SK_U16)(pByte[3]) << 8) & 0xff00))); \
- SK_OUT16((IoC), XMA((Mac), (Reg+4)), (SK_U16) \
- (((SK_U16)(pByte[4]) & 0x00ff)| \
- (((SK_U16)(pByte[5]) << 8) & 0xff00))); \
+ (((SK_U16)(pByte[0]) & 0x00ff) | \
+ (((SK_U16)(pByte[1]) << 8) & 0xff00))); \
+ SK_OUT16((IoC), XMA((Mac), (Reg+2)), (SK_U16) \
+ (((SK_U16)(pByte[2]) & 0x00ff) | \
+ (((SK_U16)(pByte[3]) << 8) & 0xff00))); \
+ SK_OUT16((IoC), XMA((Mac), (Reg+4)), (SK_U16) \
+ (((SK_U16)(pByte[4]) & 0x00ff) | \
+ (((SK_U16)(pByte[5]) << 8) & 0xff00))); \
}
#define XM_INHASH(IoC, Mac, Reg, pVal) { \
- SK_U16 Word; \
- SK_U8 *pByte; \
+ SK_U16 Word; \
+ SK_U8 *pByte; \
pByte = (SK_U8 *)&((SK_U8 *)(pVal))[0]; \
SK_IN16((IoC), XMA((Mac), (Reg)), &Word); \
- pByte[0] = (SK_U8) (Word & 0x00ff); \
- pByte[1] = (SK_U8) ((Word >> 8) & 0x00ff); \
+ pByte[0] = (SK_U8)(Word & 0x00ff); \
+ pByte[1] = (SK_U8)((Word >> 8) & 0x00ff); \
SK_IN16((IoC), XMA((Mac), (Reg+2)), &Word); \
- pByte[2] = (SK_U8) (Word & 0x00ff); \
- pByte[3] = (SK_U8) ((Word >> 8) & 0x00ff); \
+ pByte[2] = (SK_U8)(Word & 0x00ff); \
+ pByte[3] = (SK_U8)((Word >> 8) & 0x00ff); \
SK_IN16((IoC), XMA((Mac), (Reg+4)), &Word); \
- pByte[4] = (SK_U8) (Word & 0x00ff); \
- pByte[5] = (SK_U8) ((Word >> 8) & 0x00ff); \
+ pByte[4] = (SK_U8)(Word & 0x00ff); \
+ pByte[5] = (SK_U8)((Word >> 8) & 0x00ff); \
SK_IN16((IoC), XMA((Mac), (Reg+6)), &Word); \
- pByte[6] = (SK_U8) (Word & 0x00ff); \
- pByte[7] = (SK_U8) ((Word >> 8) & 0x00ff); \
+ pByte[6] = (SK_U8)(Word & 0x00ff); \
+ pByte[7] = (SK_U8)((Word >> 8) & 0x00ff); \
}
#define XM_OUTHASH(IoC, Mac, Reg, pVal) { \
- SK_U8 *pByte; \
+ SK_U8 *pByte; \
pByte = (SK_U8 *)&((SK_U8 *)(pVal))[0]; \
SK_OUT16((IoC), XMA((Mac), (Reg)), (SK_U16) \
- (((SK_U16)(pByte[0]) & 0x00ff)| \
- (((SK_U16)(pByte[1]) << 8) & 0xff00))); \
- SK_OUT16((IoC), XMA((Mac), (Reg+2)), (SK_U16) \
- (((SK_U16)(pByte[2]) & 0x00ff)| \
- (((SK_U16)(pByte[3]) << 8) & 0xff00))); \
- SK_OUT16((IoC), XMA((Mac), (Reg+4)), (SK_U16) \
- (((SK_U16)(pByte[4]) & 0x00ff)| \
- (((SK_U16)(pByte[5]) << 8) & 0xff00))); \
- SK_OUT16((IoC), XMA((Mac), (Reg+6)), (SK_U16) \
- (((SK_U16)(pByte[6]) & 0x00ff)| \
- (((SK_U16)(pByte[7]) << 8) & 0xff00))); \
+ (((SK_U16)(pByte[0]) & 0x00ff)| \
+ (((SK_U16)(pByte[1]) << 8) & 0xff00))); \
+ SK_OUT16((IoC), XMA((Mac), (Reg+2)), (SK_U16) \
+ (((SK_U16)(pByte[2]) & 0x00ff)| \
+ (((SK_U16)(pByte[3]) << 8) & 0xff00))); \
+ SK_OUT16((IoC), XMA((Mac), (Reg+4)), (SK_U16) \
+ (((SK_U16)(pByte[4]) & 0x00ff)| \
+ (((SK_U16)(pByte[5]) << 8) & 0xff00))); \
+ SK_OUT16((IoC), XMA((Mac), (Reg+6)), (SK_U16) \
+ (((SK_U16)(pByte[6]) & 0x00ff)| \
+ (((SK_U16)(pByte[7]) << 8) & 0xff00))); \
}
/*
@@ -1630,35 +1635,60 @@
* written.
*
* usage: PHY_READ(IoC, pPort, MAC_1, PHY_CTRL, Value);
+ * Warning: a PHY_READ on an uninitialized PHY (PHY still in reset) never
+ * comes back. This is checked in DEBUG mode.
*/
-#define PHY_READ(IoC, pPort, Mac, PhyReg, pVal) { \
- SK_U16 Mmu; \
- \
- XM_OUT16((IoC),(Mac), XM_PHY_ADDR, (PhyReg)|(pPort)->PhyAddr); \
- XM_IN16((IoC), (Mac), XM_PHY_DATA, (pVal)); \
- if ((pPort)->PhyType != SK_PHY_XMAC) { \
- do { \
- XM_IN16((IoC), (Mac), XM_MMU_CMD, &Mmu); \
- } while ((Mmu & XM_MMU_PHY_RDY) == 0); \
- XM_IN16((IoC), (Mac), XM_PHY_DATA, (pVal)); \
- } \
+#ifndef DEBUG
+#define PHY_READ(IoC, pPort, Mac, PhyReg, pVal) { \
+ SK_U16 Mmu; \
+ \
+ XM_OUT16((IoC), (Mac), XM_PHY_ADDR, (PhyReg) | (pPort)->PhyAddr); \
+ XM_IN16((IoC), (Mac), XM_PHY_DATA, (pVal)); \
+ if ((pPort)->PhyType != SK_PHY_XMAC) { \
+ do { \
+ XM_IN16((IoC), (Mac), XM_MMU_CMD, &Mmu); \
+ } while ((Mmu & XM_MMU_PHY_RDY) == 0); \
+ XM_IN16((IoC), (Mac), XM_PHY_DATA, (pVal)); \
+ } \
+}
+#else
+#define PHY_READ(IoC, pPort, Mac, PhyReg, pVal) { \
+ SK_U16 Mmu; \
+ int __i = 0; \
+ \
+ XM_OUT16((IoC), (Mac), XM_PHY_ADDR, (PhyReg) | (pPort)->PhyAddr); \
+ XM_IN16((IoC), (Mac), XM_PHY_DATA, (pVal)); \
+ if ((pPort)->PhyType != SK_PHY_XMAC) { \
+ do { \
+ XM_IN16((IoC), (Mac), XM_MMU_CMD, &Mmu); \
+ __i++; \
+ if (__i > 100000) { \
+ SK_DBG_PRINTF("*****************************\n"); \
+ SK_DBG_PRINTF("PHY_READ on uninitialized PHY\n"); \
+ SK_DBG_PRINTF("*****************************\n"); \
+ break; \
+ } \
+ } while ((Mmu & XM_MMU_PHY_RDY) == 0); \
+ XM_IN16((IoC), (Mac), XM_PHY_DATA, (pVal)); \
+ } \
}
+#endif
-#define PHY_WRITE(IoC, pPort, Mac, PhyReg, Val) { \
- SK_U16 Mmu; \
- \
- if ((pPort)->PhyType != SK_PHY_XMAC) { \
- do { \
- XM_IN16((IoC), (Mac), XM_MMU_CMD, &Mmu); \
- } while ((Mmu & XM_MMU_PHY_BUSY) != 0); \
- } \
- XM_OUT16((IoC), (Mac), XM_PHY_ADDR, (PhyReg)|(pPort)->PhyAddr); \
- XM_OUT16((IoC), (Mac), XM_PHY_DATA, (Val)); \
- if ((pPort)->PhyType != SK_PHY_XMAC) { \
- do { \
- XM_IN16((IoC), (Mac), XM_MMU_CMD, &Mmu); \
- } while ((Mmu & XM_MMU_PHY_BUSY) != 0); \
- } \
+#define PHY_WRITE(IoC, pPort, Mac, PhyReg, Val) { \
+ SK_U16 Mmu; \
+ \
+ if ((pPort)->PhyType != SK_PHY_XMAC) { \
+ do { \
+ XM_IN16((IoC), (Mac), XM_MMU_CMD, &Mmu); \
+ } while ((Mmu & XM_MMU_PHY_BUSY) != 0); \
+ } \
+ XM_OUT16((IoC), (Mac), XM_PHY_ADDR, (PhyReg) | (pPort)->PhyAddr); \
+ XM_OUT16((IoC), (Mac), XM_PHY_DATA, (Val)); \
+ if ((pPort)->PhyType != SK_PHY_XMAC) { \
+ do { \
+ XM_IN16((IoC), (Mac), XM_MMU_CMD, &Mmu); \
+ } while ((Mmu & XM_MMU_PHY_BUSY) != 0); \
+ } \
}
/*
@@ -1703,7 +1733,7 @@
* Mode Mode to set for this LED
*/
#define SK_HWAC_LINK_LED(pAC, IoC, Port, Mode) \
-SK_OUT8(IoC, MR_ADDR(Port,LNK_LED_REG), Mode);
+ SK_OUT8(IoC, MR_ADDR(Port,LNK_LED_REG), Mode);
/* typedefs *******************************************************************/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/h/skgeinit.h linux.20p6/drivers/net/sk98lin/h/skgeinit.h
--- linux.vanilla/drivers/net/sk98lin/h/skgeinit.h Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/h/skgeinit.h Tue Jun 19 09:46:01 2001
@@ -2,16 +2,15 @@
*
* Name: skgeinit.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.45 $
- * Date: $Date: 1999/11/22 13:56:19 $
+ * Version: $Revision: 1.51 $
+ * Date: $Date: 2001/02/09 12:26:38 $
* Purpose: Structures and prototypes for the GE Init Module
*
******************************************************************************/
/******************************************************************************
*
- * (C)Copyright 1998,1999 SysKonnect,
- * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ * (C)Copyright 1998-2001 SysKonnect GmbH.
*
* 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
@@ -27,6 +26,26 @@
* History:
*
* $Log: skgeinit.h,v $
+ * Revision 1.51 2001/02/09 12:26:38 cgoos
+ * Inserted #ifdef DIAG for half duplex workaround timer.
+ *
+ * Revision 1.50 2001/02/07 07:56:40 rassmann
+ * Corrected copyright.
+ *
+ * Revision 1.49 2001/01/31 15:32:18 gklug
+ * fix: problem with autosensing an SR8800 switch
+ * add: counter for autoneg timeouts
+ *
+ * Revision 1.48 2000/11/09 11:30:10 rassmann
+ * WA: Waiting after releasing reset until BCom chip is accessible.
+ *
+ * Revision 1.47 2000/10/18 12:22:40 cgoos
+ * Added workaround for half duplex hangup.
+ *
+ * Revision 1.46 2000/08/10 11:28:00 rassmann
+ * Editorial changes.
+ * Preserving 32-bit alignment in structs for the adapter context.
+ *
* Revision 1.45 1999/11/22 13:56:19 cgoos
* Changed license header to GPL.
*
@@ -436,6 +455,12 @@
*/
#define SK_MAX_LRESTART 3 /* Max. 3 times the link is restarted */
+/*
+ * define max. autonegotiation timeouts before link detection in sense mode is
+ * reset.
+ */
+#define SK_MAX_ANEG_TO 10 /* Max. 10 times the sense mode is reset */
+
/* structures *****************************************************************/
/*
@@ -446,61 +471,71 @@
SK_TIMER PWaTimer; /* Workaround Timer */
#endif
SK_U64 PPrevShorts; /* Previous short Counter checking */
- SK_U64 PPrevRx; /* Previous RxOk Counter checking */
- SK_U64 PPrevFcs; /* Previous FCS Error Counter checking */
- SK_U64 PRxLim; /* Previous RxOk Counter checking */
- int PLinkResCt; /* Link Restart Counter */
- int PAutoNegTimeOut;/* AutoNegotiation timeout current value */
- int PRxQSize; /* Port Rx Queue Size in kB */
- int PXSQSize; /* Port Synchronous Transmit Queue Size in kB */
- int PXAQSize; /* Port Asynchronous Transmit Queue Size in kB*/
+ SK_U64 PPrevRx; /* Previous RxOk Counter checking */
+ SK_U64 PPrevFcs; /* Previous FCS Error Counter checking */
+ SK_U64 PRxLim; /* Previous RxOk Counter checking */
+ SK_U64 LastOctets; /* For half duplex hang check */
+#ifndef SK_DIAG
+ SK_TIMER HalfDupChkTimer;
+#endif
+ int PLinkResCt; /* Link Restart Counter */
+ int PAutoNegTimeOut;/* AutoNegotiation timeout current value */
+ int PAutoNegTOCt; /* AutoNeg Timeout Counter */
+ int PRxQSize; /* Port Rx Queue Size in kB */
+ int PXSQSize; /* Port Synchronous Transmit Queue Size in kB */
+ int PXAQSize; /* Port Asynchronous Transmit Queue Size in kB*/
SK_U32 PRxQRamStart; /* Receive Queue RAM Buffer Start Address */
- SK_U32 PRxQRamEnd; /* Receive Queue RAM Buffer End Address */
+ SK_U32 PRxQRamEnd; /* Receive Queue RAM Buffer End Address */
SK_U32 PXsQRamStart; /* Sync Tx Queue RAM Buffer Start Address */
- SK_U32 PXsQRamEnd; /* Sync Tx Queue RAM Buffer End Address */
+ SK_U32 PXsQRamEnd; /* Sync Tx Queue RAM Buffer End Address */
SK_U32 PXaQRamStart; /* Async Tx Queue RAM Buffer Start Address */
- SK_U32 PXaQRamEnd; /* Async Tx Queue RAM Buffer End Address */
- int PRxQOff; /* Rx Queue Address Offset */
- int PXsQOff; /* Synchronous Tx Queue Address Offset */
- int PXaQOff; /* Asynchronous Tx Queue Address Offset */
- SK_U16 PRxCmd; /* Port Receive Command Configuration Value */
- SK_U16 PIsave; /* Saved Interrupt status word */
- SK_U16 PSsave; /* Saved PHY status word */
- SK_BOOL PHWLinkUp; /* The hardware Link is up (wireing) */
- SK_BOOL PState; /* Is port initialized ? */
+ SK_U32 PXaQRamEnd; /* Async Tx Queue RAM Buffer End Address */
+ int PRxQOff; /* Rx Queue Address Offset */
+ int PXsQOff; /* Synchronous Tx Queue Address Offset */
+ int PXaQOff; /* Asynchronous Tx Queue Address Offset */
+ int PhyType; /* PHY used on this port */
+ SK_U16 PhyAddr; /* MDIO/MDC PHY address */
+ SK_U16 PRxCmd; /* Port Receive Command Configuration Value */
+ SK_U16 PIsave; /* Saved Interrupt status word */
+ SK_U16 PSsave; /* Saved PHY status word */
+ SK_U16 Align01;
+ SK_BOOL PHWLinkUp; /* The hardware Link is up (wireing) */
+ SK_BOOL PState; /* Is port initialized ? */
SK_BOOL PLinkBroken; /* Is Link broken ? */
- SK_BOOL PCheckPar; /* Do we check for parity errors ? */
- SK_U8 PLinkCap; /* Link Capabilities */
+ SK_BOOL PCheckPar; /* Do we check for parity errors ? */
+ SK_BOOL HalfDupTimerActive;
+ SK_U8 PLinkCap; /* Link Capabilities */
SK_U8 PLinkModeConf; /* Link Mode configured */
- SK_U8 PLinkMode; /* Link Mode currently used */
- SK_U8 PLinkModeStatus; /* Link Mode Status */
+ SK_U8 PLinkMode; /* Link Mode currently used */
+ SK_U8 PLinkModeStatus;/* Link Mode Status */
SK_U8 PFlowCtrlCap; /* Flow Control Capabilities */
SK_U8 PFlowCtrlMode; /* Flow Control Mode */
- SK_U8 PFlowCtrlStatus; /* Flow Control Status */
- SK_U8 PMSCap; /* Master/Slave Capabilities */
- SK_U8 PMSMode; /* Master/Slave Mode */
- SK_U8 PMSStatus; /* Master/Slave Status */
+ SK_U8 PFlowCtrlStatus;/* Flow Control Status */
+ SK_U8 PMSCap; /* Master/Slave Capabilities */
+ SK_U8 PMSMode; /* Master/Slave Mode */
+ SK_U8 PMSStatus; /* Master/Slave Status */
SK_U8 PAutoNegFail; /* Autonegotiation fail flag */
SK_U8 PLipaAutoNeg; /* Autonegotiation possible with Link Partner */
- int PhyType; /* PHY used on this port */
- SK_U16 PhyAddr; /* MDIO/MDC PHY address */
+ SK_U8 Align02;
} SK_GEPORT;
/*
* Gigabit Ethernet Initalization Struct
- * (has to be included in the adapter context
+ * (has to be included in the adapter context)
*/
typedef struct s_GeInit {
- int GIMacsFound; /* Number of MACs found on this adapter */
- int GIPciHwRev; /* PCI HW Revision Number */
- SK_U32 GIRamOffs; /* RAM Address Offset for addr calculation */
- int GIRamSize; /* The RAM size of the adapter in kB */
- int GIHstClkFact; /* Host Clock Factor (62.5 / HstClk * 100) */
- int GIPortUsage; /* driver port usage: SK_RED_LINK/SK_MUL_LINK */
- SK_U32 GIPollTimerVal; /* Descriptor Poll Timer Init Val in clk ticks*/
- int GILevel; /* Initialization Level Completed */
- SK_BOOL GIAnyPortAct; /* Is True if one or more port is initialized */
- SK_GEPORT GP[SK_MAX_MACS]; /* Port Dependent Information */
+ int GIMacsFound; /* Number of MACs found on this adapter */
+ int GIPciHwRev; /* PCI HW Revision Number */
+ SK_U32 GIRamOffs; /* RAM Address Offset for addr calculation */
+ int GIRamSize; /* The RAM size of the adapter in kB */
+ int GIHstClkFact; /* Host Clock Factor (62.5 / HstClk * 100) */
+ int GIPortUsage; /* driver port usage: SK_RED_LINK/SK_MUL_LINK */
+ SK_U32 GIPollTimerVal; /* Descriptor Poll Timer Init Val in clk ticks*/
+ int GILevel; /* Initialization Level Completed */
+ SK_GEPORT GP[SK_MAX_MACS];/* Port Dependent Information */
+ SK_BOOL GIAnyPortAct; /* Is True if one or more port is initialized */
+ SK_U8 Align01;
+ SK_U16 Align02;
} SK_GEINIT;
/*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/h/skgepnm2.h linux.20p6/drivers/net/sk98lin/h/skgepnm2.h
--- linux.vanilla/drivers/net/sk98lin/h/skgepnm2.h Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/h/skgepnm2.h Tue Jun 19 09:46:01 2001
@@ -2,16 +2,15 @@
*
* Name: skgepnm2.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.25 $
- * Date: $Date: 1999/11/22 13:57:41 $
+ * Version: $Revision: 1.30 $
+ * Date: $Date: 2001/02/06 10:03:41 $
* Purpose: Defines for Private Network Management Interface
*
****************************************************************************/
/******************************************************************************
*
- * (C)Copyright 1998,1999 SysKonnect,
- * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ * (C)Copyright 1998-2001 SysKonnect GmbH.
*
* 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
@@ -27,6 +26,24 @@
* History:
*
* $Log: skgepnm2.h,v $
+ * Revision 1.30 2001/02/06 10:03:41 mkunz
+ * - Pnmi V4 dual net support added. Interface functions and macros extended
+ * - Vpd bug fixed
+ * - OID_SKGE_MTU added
+ *
+ * Revision 1.29 2001/01/22 13:41:37 rassmann
+ * Supporting two nets on dual-port adapters.
+ *
+ * Revision 1.28 2000/08/03 15:12:48 rwahl
+ * - Additional comment for MAC statistic data structure.
+ *
+ * Revision 1.27 2000/08/01 16:10:18 rwahl
+ * - Added mac statistic data structure for StatRxLongFrame counter.
+ *
+ * Revision 1.26 2000/03/31 13:51:34 rwahl
+ * Added SK_UPTR cast to offset calculation for PNMI struct fields;
+ * missing cast caused compiler warnings by Win64 compiler.
+ *
* Revision 1.25 1999/11/22 13:57:41 cgoos
* Changed license header to GPL.
* Allowing overwrite for SK_PNMI_STORE/_READ defines.
@@ -149,8 +166,6 @@
/*
* VPD releated defines
*/
-#define SK_PNMI_VPD_ARR_SIZE 40
-#define SK_PNMI_VPD_STR_SIZE 5
#define SK_PNMI_VPD_RW 1
#define SK_PNMI_VPD_RO 2
@@ -191,7 +206,8 @@
int Access;
int (* Func)(SK_AC *pAc, SK_IOC pIo, int action,
SK_U32 Id, char* pBuf, unsigned int* pLen,
- SK_U32 Instance, unsigned int TableIndex);
+ SK_U32 Instance, unsigned int TableIndex,
+ SK_U32 NetNumber);
SK_U16 Param;
} SK_PNMI_TAB_ENTRY;
@@ -207,6 +223,8 @@
/*
* MAC statistic data structures
+ * Only for the first 64 counters: the number relates to the bit in the
+ * XMAC overflow status register
*/
#define SK_PNMI_HTX 0
#define SK_PNMI_HTX_OCTET 1
@@ -278,6 +296,8 @@
#define SK_PNMI_HTX_SYNC 64
#define SK_PNMI_HTX_SYNC_OCTET 65
+#define SK_PNMI_HRX_LONGFRAMES 66
+
#define SK_PNMI_MAX_IDX (SK_PNMI_CNT_NO)
/*
@@ -292,25 +312,25 @@
/*
* SK_PNMI_STRUCT_DATA copy offset evaluation macros
*/
-#define SK_PNMI_OFF(e) ((SK_U32)&(((SK_PNMI_STRUCT_DATA *)0)->e))
-#define SK_PNMI_MAI_OFF(e) ((SK_U32)&(((SK_PNMI_STRUCT_DATA *)0)->e))
-#define SK_PNMI_VPD_OFF(e) ((SK_U32)&(((SK_PNMI_VPD *)0)->e))
-#define SK_PNMI_SEN_OFF(e) ((SK_U32)&(((SK_PNMI_SENSOR *)0)->e))
-#define SK_PNMI_CHK_OFF(e) ((SK_U32)&(((SK_PNMI_CHECKSUM *)0)->e))
-#define SK_PNMI_STA_OFF(e) ((SK_U32)&(((SK_PNMI_STAT *)0)->e))
-#define SK_PNMI_CNF_OFF(e) ((SK_U32)&(((SK_PNMI_CONF *)0)->e))
-#define SK_PNMI_RLM_OFF(e) ((SK_U32)&(((SK_PNMI_RLMT *)0)->e))
-#define SK_PNMI_MON_OFF(e) ((SK_U32)&(((SK_PNMI_RLMT_MONITOR *)0)->e))
-#define SK_PNMI_TRP_OFF(e) ((SK_U32)&(((SK_PNMI_TRAP *)0)->e))
+#define SK_PNMI_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_STRUCT_DATA *)0)->e))
+#define SK_PNMI_MAI_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_STRUCT_DATA *)0)->e))
+#define SK_PNMI_VPD_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_VPD *)0)->e))
+#define SK_PNMI_SEN_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_SENSOR *)0)->e))
+#define SK_PNMI_CHK_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_CHECKSUM *)0)->e))
+#define SK_PNMI_STA_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_STAT *)0)->e))
+#define SK_PNMI_CNF_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_CONF *)0)->e))
+#define SK_PNMI_RLM_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_RLMT *)0)->e))
+#define SK_PNMI_MON_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_RLMT_MONITOR *)0)->e))
+#define SK_PNMI_TRP_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_TRAP *)0)->e))
#define SK_PNMI_SET_STAT(b,s,o) {SK_U32 Val32; char *pVal; \
Val32 = (s); \
- pVal = (char *)(b) + ((SK_U32) \
+ pVal = (char *)(b) + ((SK_U32)(SK_UPTR) \
&(((SK_PNMI_STRUCT_DATA *)0)-> \
ReturnStatus.ErrorStatus)); \
SK_PNMI_STORE_U32(pVal, Val32); \
Val32 = (o); \
- pVal = (char *)(b) + ((SK_U32) \
+ pVal = (char *)(b) + ((SK_U32)(SK_UPTR) \
&(((SK_PNMI_STRUCT_DATA *)0)-> \
ReturnStatus.ErrorOffset)); \
SK_PNMI_STORE_U32(pVal, Val32);}
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/h/skgepnmi.h linux.20p6/drivers/net/sk98lin/h/skgepnmi.h
--- linux.vanilla/drivers/net/sk98lin/h/skgepnmi.h Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/h/skgepnmi.h Tue Jun 19 09:46:01 2001
@@ -2,16 +2,15 @@
*
* Name: skgepnmi.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.39 $
- * Date: $Date: 1999/12/06 10:09:47 $
+ * Version: $Revision: 1.48 $
+ * Date: $Date: 2001/02/23 14:34:24 $
* Purpose: Defines for Private Network Management Interface
*
****************************************************************************/
/******************************************************************************
*
- * (C)Copyright 1998,1999 SysKonnect,
- * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ * (C)Copyright 1998-2001 SysKonnect GmbH.
*
* 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
@@ -27,12 +26,53 @@
* History:
*
* $Log: skgepnmi.h,v $
+ * Revision 1.48 2001/02/23 14:34:24 mkunz
+ * Changed macro PHYS2INST. Added pAC to Interface
+ *
+ * Revision 1.47 2001/02/07 08:28:23 mkunz
+ * - Added Oids: OID_SKGE_DIAG_ACTION
+ * OID_SKGE_DIAG_RESULT
+ * OID_SKGE_MULTICAST_LIST
+ * OID_SKGE_CURRENT_PACKET_FILTER
+ * OID_SKGE_INTERMEDIATE_SUPPORT
+ * - Changed value of OID_SKGE_MTU
+ *
+ * Revision 1.46 2001/02/06 10:01:41 mkunz
+ * - Pnmi V4 dual net support added. Interface functions and macros extended
+ * - Vpd bug fixed
+ * - OID_SKGE_MTU added
+ *
+ * Revision 1.45 2001/01/22 13:41:37 rassmann
+ * Supporting two nets on dual-port adapters.
+ *
+ * Revision 1.44 2000/09/07 07:35:27 rwahl
+ * - removed NDIS counter specific data type.
+ * - fixed spelling for OID_SKGE_RLMT_PORT_PREFERRED.
+ *
+ * Revision 1.43 2000/08/04 11:41:08 rwahl
+ * - Fixed compiler warning (port is always >= 0) for macros
+ * SK_PNMI_CNT_RX_LONGFRAMES & SK_PNMI_CNT_SYNC_OCTETS
+ *
+ * Revision 1.42 2000/08/03 15:14:07 rwahl
+ * - Corrected error in driver macros addressing a physical port.
+ *
+ * Revision 1.41 2000/08/01 16:22:29 rwahl
+ * - Changed MDB version to 3.1.
+ * - Added definitions for StatRxLongFrames counter.
+ * - Added macro to be used by driver to count long frames received.
+ * - Added directive to control width (default = 32bit) of NDIS statistic
+ * counters (SK_NDIS_64BIT_CTR).
+ *
+ * Revision 1.40 2000/03/31 13:51:34 rwahl
+ * Added SK_UPTR cast to offset calculation for PNMI struct fields;
+ * missing cast caused compiler warnings by Win64 compiler.
+ *
* Revision 1.39 1999/12/06 10:09:47 rwahl
* Added new error log message.
*
* Revision 1.38 1999/11/22 13:57:55 cgoos
* Changed license header to GPL.
- *
+ *
* Revision 1.37 1999/09/14 14:25:32 rwahl
* Set MDB version for 1000Base-T (sensors, Master/Slave) changes.
*
@@ -90,7 +130,7 @@
*
* Revision 1.22 1998/11/03 12:05:51 mhaveman
* Added pAC parameter to counter macors.
- *
+ *
* Revision 1.21 1998/11/02 10:47:36 mhaveman
* Added syslog messages for internal errors.
*
@@ -165,33 +205,34 @@
#include "h/ski2c.h"
#include "h/skaddr.h"
#include "h/skrlmt.h"
-
+#include "h/skvpd.h"
/*
* Management Database Version
*/
-#define SK_PNMI_MDB_VERSION 0x00030000 /* 3.0 */
+#define SK_PNMI_MDB_VERSION 0x00030001 /* 3.1 */
/*
* Event definitions
*/
-#define SK_PNMI_EVT_SIRQ_OVERFLOW 1 /* Counter overflow */
-#define SK_PNMI_EVT_SEN_WAR_LOW 2 /* Lower war thres exceeded */
-#define SK_PNMI_EVT_SEN_WAR_UPP 3 /* Upper war thres exceeded */
-#define SK_PNMI_EVT_SEN_ERR_LOW 4 /* Lower err thres exceeded */
-#define SK_PNMI_EVT_SEN_ERR_UPP 5 /* Upper err thres exceeded */
-#define SK_PNMI_EVT_CHG_EST_TIMER 6 /* Timer event for RLMT Chg */
+#define SK_PNMI_EVT_SIRQ_OVERFLOW 1 /* Counter overflow */
+#define SK_PNMI_EVT_SEN_WAR_LOW 2 /* Lower war thres exceeded */
+#define SK_PNMI_EVT_SEN_WAR_UPP 3 /* Upper war thres exceeded */
+#define SK_PNMI_EVT_SEN_ERR_LOW 4 /* Lower err thres exceeded */
+#define SK_PNMI_EVT_SEN_ERR_UPP 5 /* Upper err thres exceeded */
+#define SK_PNMI_EVT_CHG_EST_TIMER 6 /* Timer event for RLMT Chg */
#define SK_PNMI_EVT_UTILIZATION_TIMER 7 /* Timer event for Utiliza. */
-#define SK_PNMI_EVT_CLEAR_COUNTER 8 /* Clear statistic counters */
-#define SK_PNMI_EVT_XMAC_RESET 9 /* XMAC will be reset */
+#define SK_PNMI_EVT_CLEAR_COUNTER 8 /* Clear statistic counters */
+#define SK_PNMI_EVT_XMAC_RESET 9 /* XMAC will be reset */
-#define SK_PNMI_EVT_RLMT_PORT_UP 10 /* Port came logically up */
-#define SK_PNMI_EVT_RLMT_PORT_DOWN 11 /* Port went logically down */
-#define SK_PNMI_EVT_RLMT_PORT_SWITCH 12 /* Switched active port */
+#define SK_PNMI_EVT_RLMT_PORT_UP 10 /* Port came logically up */
+#define SK_PNMI_EVT_RLMT_PORT_DOWN 11 /* Port went logically down */
#define SK_PNMI_EVT_RLMT_SEGMENTATION 13 /* Two SP root bridges found */
#define SK_PNMI_EVT_RLMT_ACTIVE_DOWN 14 /* Port went logically down */
-#define SK_PNMI_EVT_RLMT_ACTIVE_UP 15 /* Port came logically up */
+#define SK_PNMI_EVT_RLMT_ACTIVE_UP 15 /* Port came logically up */
+#define SK_PNMI_EVT_RLMT_SET_NETS 16 /* 1. Parameter is number of nets
+ 1 = single net; 2 = dual net */
/*
* Return values
@@ -203,6 +244,7 @@
#define SK_PNMI_ERR_READ_ONLY 4
#define SK_PNMI_ERR_UNKNOWN_OID 5
#define SK_PNMI_ERR_UNKNOWN_INST 6
+#define SK_PNMI_ERR_UNKNOWN_NET 7
/*
@@ -333,7 +375,7 @@
#define OID_SKGE_CHKSM_RX_ERR_CTS 0xFF020113
#define OID_SKGE_CHKSM_TX_OK_CTS 0xFF020114
#define OID_SKGE_CHKSM_TX_UNABLE_CTS 0xFF020115
-
+
#define OID_SKGE_STAT_TX 0xFF020120
#define OID_SKGE_STAT_TX_OCTETS 0xFF020121
#define OID_SKGE_STAT_TX_BROADCAST 0xFF020122
@@ -389,7 +431,11 @@
#define OID_SKGE_STAT_RX_511 0xFF020154
#define OID_SKGE_STAT_RX_1023 0xFF020155
#define OID_SKGE_STAT_RX_MAX 0xFF020156
-
+#define OID_SKGE_STAT_RX_LONGFRAMES 0xFF020157
+
+#define OID_SKGE_DIAG_ACTION 0xFF01011D
+#define OID_SKGE_DIAG_RESULT 0xFF01011E
+#define OID_SKGE_MTU 0xFF01011F
#define OID_SKGE_PHYS_CUR_ADDR 0xFF010120
#define OID_SKGE_PHYS_FAC_ADDR 0xFF010121
#define OID_SKGE_PMD 0xFF010122
@@ -404,19 +450,22 @@
#define OID_SKGE_PHY_OPERATION_CAP 0xFF01012B
#define OID_SKGE_PHY_OPERATION_MODE 0xFF01012C
#define OID_SKGE_PHY_OPERATION_STATUS 0xFF01012D
-
+#define OID_SKGE_MULTICAST_LIST 0xFF01012E
+#define OID_SKGE_CURRENT_PACKET_FILTER 0xFF01012F
+
#define OID_SKGE_TRAP 0xFF010130
#define OID_SKGE_TRAP_NUMBER 0xFF010131
#define OID_SKGE_RLMT_MODE 0xFF010140
#define OID_SKGE_RLMT_PORT_NUMBER 0xFF010141
#define OID_SKGE_RLMT_PORT_ACTIVE 0xFF010142
-#define OID_SKGE_RLMT_PORT_PREFERED 0xFF010143
+#define OID_SKGE_RLMT_PORT_PREFERRED 0xFF010143
+#define OID_SKGE_INTERMEDIATE_SUPPORT 0xFF010160
#define OID_SKGE_RLMT_CHANGE_CTS 0xFF020160
#define OID_SKGE_RLMT_CHANGE_TIME 0xFF020161
#define OID_SKGE_RLMT_CHANGE_ESTIM 0xFF020162
#define OID_SKGE_RLMT_CHANGE_THRES 0xFF020163
-
+
#define OID_SKGE_RLMT_PORT_INDEX 0xFF020164
#define OID_SKGE_RLMT_STATUS 0xFF020165
#define OID_SKGE_RLMT_TX_HELLO_CTS 0xFF020166
@@ -424,7 +473,7 @@
#define OID_SKGE_RLMT_TX_SP_REQ_CTS 0xFF020168
#define OID_SKGE_RLMT_RX_SP_CTS 0xFF020169
-#define OID_SKGE_RLMT_MONITOR_NUMBER 0xFF010150
+#define OID_SKGE_RLMT_MONITOR_NUMBER 0xFF010150
#define OID_SKGE_RLMT_MONITOR_INDEX 0xFF010151
#define OID_SKGE_RLMT_MONITOR_ADDR 0xFF010152
#define OID_SKGE_RLMT_MONITOR_ERRS 0xFF010153
@@ -448,7 +497,7 @@
#define OID_SKGE_ERR_RECOVERY_CTS 0xFF02017E
#define OID_SKGE_SYSUPTIME 0xFF02017F
-#define OID_SKGE_ALL_DATA 0xFF020190
+#define OID_SKGE_ALL_DATA 0xFF020190
#define OID_SKGE_TRAP_SEN_WAR_LOW 500
@@ -577,32 +626,40 @@
#define SK_PNMI_SET_DRIVER_VER(pAC,v) ((pAC)->Pnmi.pDriverVersion = \
(char *)(v))
-#define SK_PNMI_CNT_TX_QUEUE_LEN(pAC,v) \
+
+#define SK_PNMI_CNT_TX_QUEUE_LEN(pAC,v,p) \
{ \
- (pAC)->Pnmi.TxSwQueueLen = (SK_U64)(v); \
- if ((pAC)->Pnmi.TxSwQueueLen > (pAC)->Pnmi.TxSwQueueMax) { \
- (pAC)->Pnmi.TxSwQueueMax = (pAC)->Pnmi.TxSwQueueLen; \
+ (pAC)->Pnmi.Port[p].TxSwQueueLen = (SK_U64)(v); \
+ if ((pAC)->Pnmi.Port[p].TxSwQueueLen > (pAC)->Pnmi.Port[p].TxSwQueueMax) { \
+ (pAC)->Pnmi.Port[p].TxSwQueueMax = (pAC)->Pnmi.Port[p].TxSwQueueLen; \
} \
}
-#define SK_PNMI_CNT_TX_RETRY(pAC) (((pAC)->Pnmi.TxRetryCts)++)
-#define SK_PNMI_CNT_RX_INTR(pAC) (((pAC)->Pnmi.RxIntrCts)++)
-#define SK_PNMI_CNT_TX_INTR(pAC) (((pAC)->Pnmi.TxIntrCts)++)
-#define SK_PNMI_CNT_NO_RX_BUF(pAC) (((pAC)->Pnmi.RxNoBufCts)++)
-#define SK_PNMI_CNT_NO_TX_BUF(pAC) (((pAC)->Pnmi.TxNoBufCts)++)
-#define SK_PNMI_CNT_USED_TX_DESCR(pAC,v) \
- ((pAC)->Pnmi.TxUsedDescrNo=(SK_U64)(v));
-#define SK_PNMI_CNT_RX_OCTETS_DELIVERED(pAC,v) \
+#define SK_PNMI_CNT_TX_RETRY(pAC,p) (((pAC)->Pnmi.Port[p].TxRetryCts)++)
+#define SK_PNMI_CNT_RX_INTR(pAC,p) (((pAC)->Pnmi.Port[p].RxIntrCts)++)
+#define SK_PNMI_CNT_TX_INTR(pAC,p) (((pAC)->Pnmi.Port[p].TxIntrCts)++)
+#define SK_PNMI_CNT_NO_RX_BUF(pAC,p) (((pAC)->Pnmi.Port[p].RxNoBufCts)++)
+#define SK_PNMI_CNT_NO_TX_BUF(pAC,p) (((pAC)->Pnmi.Port[p].TxNoBufCts)++)
+#define SK_PNMI_CNT_USED_TX_DESCR(pAC,v,p) \
+ ((pAC)->Pnmi.Port[p].TxUsedDescrNo=(SK_U64)(v));
+#define SK_PNMI_CNT_RX_OCTETS_DELIVERED(pAC,v,p) \
{ \
- ((pAC)->Pnmi.RxDeliveredCts)++; \
- (pAC)->Pnmi.RxOctetsDeliveredCts += (SK_U64)(v); \
+ ((pAC)->Pnmi.Port[p].RxDeliveredCts)++; \
+ (pAC)->Pnmi.Port[p].RxOctetsDeliveredCts += (SK_U64)(v); \
}
-#define SK_PNMI_CNT_ERR_RECOVERY(pAC) (((pAC)->Pnmi.ErrRecoveryCts)++);
+#define SK_PNMI_CNT_ERR_RECOVERY(pAC,p) (((pAC)->Pnmi.Port[p].ErrRecoveryCts)++);
#define SK_PNMI_CNT_SYNC_OCTETS(pAC,p,v) \
{ \
- if (((p) >= 0) && ((p) < SK_MAX_MACS)) { \
- ((pAC)->Pnmi.StatSyncCts[p])++; \
- (pAC)->Pnmi.StatSyncOctetsCts[p] += (SK_U64)(v); \
+ if ((p) < SK_MAX_MACS) { \
+ ((pAC)->Pnmi.Port[p].StatSyncCts)++; \
+ (pAC)->Pnmi.Port[p].StatSyncOctetsCts += (SK_U64)(v); \
+ } \
+ }
+
+#define SK_PNMI_CNT_RX_LONGFRAMES(pAC,p) \
+ { \
+ if ((p) < SK_MAX_MACS) { \
+ ((pAC)->Pnmi.Port[p].StatRxLongFrameCts)++; \
} \
}
@@ -613,14 +670,18 @@
#define SK_PNMI_PORT_LOG2INST(l) ((unsigned int)(l) + 1)
#define SK_PNMI_PORT_PHYS2LOG(p) ((unsigned int)(p) + 1)
#define SK_PNMI_PORT_LOG2PHYS(pAC,l) ((unsigned int)(l) - 1)
-#define SK_PNMI_PORT_PHYS2INST(p) ((unsigned int)(p) + 2)
+#define SK_PNMI_PORT_PHYS2INST(pAC,p) \
+ (pAC->Pnmi.DualNetActiveFlag ? 2 : ((unsigned int)(p) + 2))
#define SK_PNMI_PORT_INST2PHYS(pAC,i) ((unsigned int)(i) - 2)
/*
* Structure definition for SkPnmiGetStruct and SkPnmiSetStruct
*/
-#define SK_PNMI_VPD_ENTRIES 20
-#define SK_PNMI_VPD_DATALEN 128
+#define SK_PNMI_VPD_KEY_SIZE 5
+#define SK_PNMI_VPD_BUFSIZE (VPD_SIZE)
+#define SK_PNMI_VPD_ENTRIES (VPD_SIZE / 4)
+#define SK_PNMI_VPD_DATALEN 128 /* Number of data bytes */
+
#define SK_PNMI_MULTICAST_LISTLEN 64
#define SK_PNMI_SENSOR_ENTRIES (SK_MAX_SENSORS)
#define SK_PNMI_CHECKSUM_ENTRIES 3
@@ -633,7 +694,7 @@
#define SK_PNMI_TRAP_QUEUE_LEN 512
typedef struct s_PnmiVpd {
- char VpdKey[5];
+ char VpdKey[SK_PNMI_VPD_KEY_SIZE];
char VpdValue[SK_PNMI_VPD_DATALEN];
SK_U8 VpdAccess;
SK_U8 VpdAction;
@@ -695,6 +756,7 @@
SK_U64 StatRxBroadcastOkCts;
SK_U64 StatRxMulticastOkCts;
SK_U64 StatRxUnicastOkCts;
+ SK_U64 StatRxLongFramesCts;
SK_U64 StatRxPauseMacCtrlCts;
SK_U64 StatRxMacCtrlCts;
SK_U64 StatRxPauseMacCtrlErrorCts;
@@ -764,7 +826,7 @@
SK_U32 MgmtDBVersion;
SK_PNMI_REQUEST_STATUS ReturnStatus;
SK_U32 VpdFreeBytes;
- char VpdEntriesList[SK_PNMI_VPD_DATALEN];
+ char VpdEntriesList[SK_PNMI_VPD_ENTRIES * SK_PNMI_VPD_KEY_SIZE];
SK_U32 VpdEntriesNumber;
SK_PNMI_VPD Vpd[SK_PNMI_VPD_ENTRIES];
SK_U32 PortNumber;
@@ -774,6 +836,7 @@
char HwDescr[SK_PNMI_STRINGLEN1];
char HwVersion[SK_PNMI_STRINGLEN2];
SK_U16 Chipset;
+ SK_U32 MtuSize;
SK_U32 Action;
SK_U32 TestResult;
SK_U8 BusType;
@@ -817,8 +880,9 @@
} SK_PNMI_STRUCT_DATA;
#define SK_PNMI_STRUCT_SIZE (sizeof(SK_PNMI_STRUCT_DATA))
-#define SK_PNMI_MIN_STRUCT_SIZE ((unsigned int)&(((SK_PNMI_STRUCT_DATA *)0)->\
- VpdFreeBytes)) /*
+#define SK_PNMI_MIN_STRUCT_SIZE ((unsigned int)(SK_UPTR)\
+ &(((SK_PNMI_STRUCT_DATA *)0)->VpdFreeBytes))
+ /*
* ReturnStatus field
* must be located
* before VpdFreeBytes
@@ -830,7 +894,7 @@
#define SK_PNMI_MAX_PROTOS 3
#define SK_PNMI_SCNT_NOT 64
-#define SK_PNMI_CNT_NO 66
+#define SK_PNMI_CNT_NO 67
/*
* Estimate data structure
@@ -851,9 +915,26 @@
SK_U64 CounterOffset[SK_PNMI_CNT_NO];
SK_U64 StatSyncCts;
SK_U64 StatSyncOctetsCts;
+ SK_U64 StatRxLongFrameCts;
SK_BOOL ActiveFlag;
+ SK_U64 TxSwQueueLen;
+ SK_U64 TxSwQueueMax;
+ SK_U64 TxRetryCts;
+ SK_U64 RxIntrCts;
+ SK_U64 TxIntrCts;
+ SK_U64 RxNoBufCts;
+ SK_U64 TxNoBufCts;
+ SK_U64 TxUsedDescrNo;
+ SK_U64 RxDeliveredCts;
+ SK_U64 RxOctetsDeliveredCts;
+ SK_U64 RxHwErrorsCts;
+ SK_U64 TxHwErrorsCts;
+ SK_U64 InErrorsCts;
+ SK_U64 OutErrorsCts;
+ SK_U64 ErrRecoveryCts;
} SK_PNMI_PORT;
+
typedef struct s_PnmiData {
SK_PNMI_PORT Port[SK_MAX_MACS];
SK_U64 VirtualCounterOffset[SK_PNMI_CNT_NO];
@@ -884,19 +965,8 @@
char PciBusWidth;
char PMD;
char Connector;
-
- SK_U64 TxSwQueueLen;
- SK_U64 TxSwQueueMax;
- SK_U64 TxRetryCts;
- SK_U64 RxIntrCts;
- SK_U64 TxIntrCts;
- SK_U64 RxNoBufCts;
- SK_U64 TxNoBufCts;
- SK_U64 TxUsedDescrNo;
- SK_U64 RxDeliveredCts;
- SK_U64 RxOctetsDeliveredCts;
- SK_U64 ErrRecoveryCts;
SK_U64 StartUpTime;
+ SK_BOOL DualNetActiveFlag;
} SK_PNMI;
@@ -905,17 +975,17 @@
*/
extern int SkPnmiInit(SK_AC *pAc, SK_IOC IoC, int level);
extern int SkPnmiGetVar(SK_AC *pAc, SK_IOC IoC, SK_U32 Id, void* pBuf,
- unsigned int* pLen, SK_U32 Instance);
+ unsigned int* pLen, SK_U32 Instance, SK_U32 NetIndex);
extern int SkPnmiPreSetVar(SK_AC *pAc, SK_IOC IoC, SK_U32 Id,
- void* pBuf, unsigned int *pLen, SK_U32 Instance);
+ void* pBuf, unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex);
extern int SkPnmiSetVar(SK_AC *pAc, SK_IOC IoC, SK_U32 Id, void* pBuf,
- unsigned int *pLen, SK_U32 Instance);
+ unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex);
extern int SkPnmiGetStruct(SK_AC *pAc, SK_IOC IoC, void* pBuf,
- unsigned int *pLen);
+ unsigned int *pLen, SK_U32 NetIndex);
extern int SkPnmiPreSetStruct(SK_AC *pAc, SK_IOC IoC, void* pBuf,
- unsigned int *pLen);
+ unsigned int *pLen, SK_U32 NetIndex);
extern int SkPnmiSetStruct(SK_AC *pAc, SK_IOC IoC, void* pBuf,
- unsigned int *pLen);
+ unsigned int *pLen, SK_U32 NetIndex);
extern int SkPnmiEvent(SK_AC *pAc, SK_IOC IoC, SK_U32 Event,
SK_EVPARA Param);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/h/skgesirq.h linux.20p6/drivers/net/sk98lin/h/skgesirq.h
--- linux.vanilla/drivers/net/sk98lin/h/skgesirq.h Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/h/skgesirq.h Tue Jun 19 09:46:01 2001
@@ -2,16 +2,15 @@
*
* Name: skgesirq.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.20 $
- * Date: $Date: 1999/12/06 10:00:44 $
+ * Version: $Revision: 1.22 $
+ * Date: $Date: 2000/11/09 11:30:10 $
* Purpose: SK specific Gigabit Ethernet special IRQ functions
*
******************************************************************************/
/******************************************************************************
*
- * (C)Copyright 1998,1999 SysKonnect,
- * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ * (C)Copyright 1998-2000 SysKonnect GmbH.
*
* 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
@@ -26,6 +25,12 @@
*
* History:
* $Log: skgesirq.h,v $
+ * Revision 1.22 2000/11/09 11:30:10 rassmann
+ * WA: Waiting after releasing reset until BCom chip is accessible.
+ *
+ * Revision 1.21 2000/10/18 12:22:40 cgoos
+ * Added workaround for half duplex hangup.
+ *
* Revision 1.20 1999/12/06 10:00:44 cgoos
* Added SET event for role.
*
@@ -106,9 +111,12 @@
#define SK_HWEV_SET_LMODE 6 /* Set Link Mode by PNMI */
#define SK_HWEV_SET_FLOWMODE 7 /* Set Flow Control Mode by PNMI */
#define SK_HWEV_SET_ROLE 8 /* Set Master/Slave (Role) by PNMI */
+#define SK_HWEV_HALFDUP_CHK 9 /* Set Master/Slave (Role) by PNMI */
#define SK_WA_ACT_TIME (5000000L) /* 5 sec */
#define SK_WA_INA_TIME (100000L) /* 100 msec */
+
+#define SK_HALFDUP_CHK_TIME (10000L) /* 10 msec */
/*
* Define the error numbers and messages
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/h/ski2c.h linux.20p6/drivers/net/sk98lin/h/ski2c.h
--- linux.vanilla/drivers/net/sk98lin/h/ski2c.h Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/h/ski2c.h Tue Jun 19 09:46:04 2001
@@ -2,8 +2,8 @@
*
* Name: ski2c.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.28 $
- * Date: $Date: 1999/11/22 13:55:46 $
+ * Version: $Revision: 1.30 $
+ * Date: $Date: 2001/04/05 11:38:09 $
* Purpose: Defines to access Voltage and Temperature Sensor
* (taken from Monalisa (taken from Concentrator))
*
@@ -28,6 +28,14 @@
* History:
*
* $Log: ski2c.h,v $
+ * Revision 1.30 2001/04/05 11:38:09 rassmann
+ * Set SenState to idle in SkI2cWaitIrq().
+ * Changed error message in SkI2cWaitIrq().
+ *
+ * Revision 1.29 2000/08/03 14:28:17 rassmann
+ * - Added function to wait for I2C being ready before resetting the board.
+ * - Replaced one duplicate "out of range" message with correct one.
+ *
* Revision 1.28 1999/11/22 13:55:46 cgoos
* Changed license header to GPL.
*
@@ -178,24 +186,26 @@
#define SKERR_I2C_E014MSG "WARNING: fan sensor out of range"
#define SKERR_I2C_E015 (SKERR_I2C_E014+1)
#define SKERR_I2C_E015MSG "ERROR: fan sensor out of range"
+#define SKERR_I2C_E016 (SKERR_I2C_E015+1)
+#define SKERR_I2C_E016MSG "I2C: active transfer does not complete.\n"
/*
* Define Timeout values
*/
-#define SK_I2C_TIM_LONG 2000000L /* 2 second */
-#define SK_I2C_TIM_SHORT 100000L /* 100 milli second */
+#define SK_I2C_TIM_LONG 2000000L /* 2 seconds */
+#define SK_I2C_TIM_SHORT 100000L /* 100 milliseconds */
/*
* Define trap and error log hold times
*/
#ifndef SK_SEN_ERR_TR_HOLD
-#define SK_SEN_ERR_TR_HOLD (4*SK_TICKS_PER_SEC)
+#define SK_SEN_ERR_TR_HOLD (4*SK_TICKS_PER_SEC)
#endif
#ifndef SK_SEN_ERR_LOG_HOLD
-#define SK_SEN_ERR_LOG_HOLD (60*SK_TICKS_PER_SEC)
+#define SK_SEN_ERR_LOG_HOLD (60*SK_TICKS_PER_SEC)
#endif
#ifndef SK_SEN_WARN_TR_HOLD
-#define SK_SEN_WARN_TR_HOLD (15*SK_TICKS_PER_SEC)
+#define SK_SEN_WARN_TR_HOLD (15*SK_TICKS_PER_SEC)
#endif
#ifndef SK_SEN_WARN_LOG_HOLD
#define SK_SEN_WARN_LOG_HOLD (15*60*SK_TICKS_PER_SEC)
@@ -257,10 +267,11 @@
extern int SkI2cReadSensor(SK_AC *pAC, SK_IOC IoC, SK_SENSOR *pSen);
#ifndef SK_DIAG
-extern int SkI2cEvent(SK_AC *pAC, SK_IOC IoC, SK_U32 Event,
- SK_EVPARA Para);
+extern int SkI2cEvent(SK_AC *pAC, SK_IOC IoC, SK_U32 Event, SK_EVPARA Para);
extern int SkI2cInit(SK_AC *pAC, SK_IOC IoC, int Level);
+extern void SkI2cWaitIrq(SK_AC *pAC, SK_IOC IoC);
extern void SkI2cIsr(SK_AC *pAC, SK_IOC IoC);
#endif
#endif /* n_SKI2C_H */
+
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/h/skrlmt.h linux.20p6/drivers/net/sk98lin/h/skrlmt.h
--- linux.vanilla/drivers/net/sk98lin/h/skrlmt.h Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/h/skrlmt.h Tue Jun 19 09:46:01 2001
@@ -2,16 +2,15 @@
*
* Name: skrlmt.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.27 $
- * Date: $Date: 1999/11/22 13:59:56 $
+ * Version: $Revision: 1.32 $
+ * Date: $Date: 2001/02/14 14:06:31 $
* Purpose: Header file for Redundant Link ManagemenT.
*
******************************************************************************/
/******************************************************************************
*
- * (C)Copyright 1998,1999 SysKonnect,
- * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ * (C)Copyright 1998-2001 SysKonnect GmbH.
*
* 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
@@ -27,14 +26,26 @@
* History:
*
* $Log: skrlmt.h,v $
+ * Revision 1.32 2001/02/14 14:06:31 rassmann
+ * Editorial changes.
+ *
+ * Revision 1.31 2001/02/05 14:25:26 rassmann
+ * Prepared RLMT for transparent operation.
+ *
+ * Revision 1.30 2001/01/22 13:41:39 rassmann
+ * Supporting two nets on dual-port adapters.
+ *
+ * Revision 1.29 2000/11/17 08:58:00 rassmann
+ * Moved CheckSwitch from SK_RLMT_PACKET_RECEIVED to SK_RLMT_TIM event.
+ *
+ * Revision 1.28 2000/11/09 12:24:34 rassmann
+ * Editorial changes.
+ *
* Revision 1.27 1999/11/22 13:59:56 cgoos
* Changed license header to GPL.
*
* Revision 1.26 1999/10/04 14:01:19 rassmann
- * Corrected reaction to reception of BPDU frames.
- * Added parameter descriptions to "For Readme" section skrlmt.txt.
- * Clarified usage of lookahead result *pForRlmt.
- * Requested driver to present RLMT packets as soon as poosible.
+ * Corrected reaction to reception of BPDU frames (#10441).
*
* Revision 1.25 1999/07/20 12:53:39 rassmann
* Fixed documentation errors for lookahead macros.
@@ -149,7 +160,7 @@
#define __INC_SKRLMT_H
#ifdef __cplusplus
-xxxx /* not supported yet - force error */
+#error C++ is not yet supported.
extern "C" {
#endif /* cplusplus */
@@ -169,128 +180,140 @@
/* ----- PORT states ----- */
-#define SK_RLMT_PS_INIT 0 /* Port state: Init. */
+#define SK_RLMT_PS_INIT 0 /* Port state: Init. */
#define SK_RLMT_PS_LINK_DOWN 1 /* Port state: Link down. */
-#define SK_RLMT_PS_DOWN 2 /* Port state: Port down. */
-#define SK_RLMT_PS_GOING_UP 3 /* Port state: Going up. */
-#define SK_RLMT_PS_UP 4 /* Port state: Up. */
+#define SK_RLMT_PS_DOWN 2 /* Port state: Port down. */
+#define SK_RLMT_PS_GOING_UP 3 /* Port state: Going up. */
+#define SK_RLMT_PS_UP 4 /* Port state: Up. */
/* ----- RLMT states ----- */
-#define SK_RLMT_RS_INIT 0 /* RLMT state: Init. */
-#define SK_RLMT_RS_NET_DOWN 1 /* RLMT state: Net down. */
-#define SK_RLMT_RS_NET_UP 2 /* RLMT state: Net up. */
+#define SK_RLMT_RS_INIT 0 /* RLMT state: Init. */
+#define SK_RLMT_RS_NET_DOWN 1 /* RLMT state: Net down. */
+#define SK_RLMT_RS_NET_UP 2 /* RLMT state: Net up. */
/* ----- PORT events ----- */
-#define SK_RLMT_LINK_UP 1001 /* Link came up. */
-#define SK_RLMT_LINK_DOWN 1002 /* Link went down. */
-#define SK_RLMT_PORT_ADDR 1003 /* Port address changed. */
+#define SK_RLMT_LINK_UP 1001 /* Link came up. */
+#define SK_RLMT_LINK_DOWN 1002 /* Link went down. */
+#define SK_RLMT_PORT_ADDR 1003 /* Port address changed. */
/* ----- RLMT events ----- */
-#define SK_RLMT_START 2001 /* Start RLMT. */
-#define SK_RLMT_STOP 2002 /* Stop RLMT. */
+#define SK_RLMT_START 2001 /* Start RLMT. */
+#define SK_RLMT_STOP 2002 /* Stop RLMT. */
#define SK_RLMT_PACKET_RECEIVED 2003 /* Packet was received for RLMT. */
-#define SK_RLMT_STATS_CLEAR 2004 /* Clear statistics. */
+#define SK_RLMT_STATS_CLEAR 2004 /* Clear statistics. */
#define SK_RLMT_STATS_UPDATE 2005 /* Update statistics. */
#define SK_RLMT_PREFPORT_CHANGE 2006 /* Change preferred port. */
-#define SK_RLMT_MODE_CHANGE 2007 /* New RlmtMode. */
+#define SK_RLMT_MODE_CHANGE 2007 /* New RlmtMode. */
+#define SK_RLMT_SET_NETS 2008 /* Number of Nets (1 or 2). */
/* ----- RLMT mode bits ----- */
-#define SK_RLMT_CHECK_LINK 1 /* Check Link. */
-#define SK_RLMT_CHECK_LOC_LINK 2 /* Check other link on same adapter. */
-#define SK_RLMT_CHECK_SEG 4 /* Check segmentation. */
+/*
+ * CAUTION: These defines are private to RLMT.
+ * Please use the RLMT mode defines below.
+ */
+
+#define SK_RLMT_CHECK_LINK 1 /* Check Link. */
+#define SK_RLMT_CHECK_LOC_LINK 2 /* Check other link on same adapter. */
+#define SK_RLMT_CHECK_SEG 4 /* Check segmentation. */
#ifndef RLMT_CHECK_REMOTE
#define SK_RLMT_CHECK_OTHERS SK_RLMT_CHECK_LOC_LINK
#else /* RLMT_CHECK_REMOTE */
-#define SK_RLMT_CHECK_REM_LINK 8 /* Check link(s) on other adapter(s). */
+#define SK_RLMT_CHECK_REM_LINK 8 /* Check link(s) on other adapter(s). */
#define SK_RLMT_MAX_REMOTE_PORTS_CHECKED 3
-#define SK_RLMT_CHECK_OTHERS (SK_RLMT_CHECK_LOC_LINK | \
- SK_RLMT_CHECK_REM_LINK)
+#define SK_RLMT_CHECK_OTHERS \
+ (SK_RLMT_CHECK_LOC_LINK | SK_RLMT_CHECK_REM_LINK)
#endif /* RLMT_CHECK_REMOTE */
+#ifndef SK_RLMT_ENABLE_TRANSPARENT
+#define SK_RLMT_TRANSPARENT 0 /* RLMT transparent - inactive. */
+#else /* SK_RLMT_ENABLE_TRANSPARENT */
+#define SK_RLMT_TRANSPARENT 128 /* RLMT transparent. */
+#endif /* SK_RLMT_ENABLE_TRANSPARENT */
+
/* ----- RLMT modes ----- */
/* Check Link State. */
#define SK_RLMT_MODE_CLS (SK_RLMT_CHECK_LINK)
/* Check Local Ports: check other links on the same adapter. */
-#define SK_RLMT_MODE_CLP (SK_RLMT_CHECK_LINK | \
- SK_RLMT_CHECK_LOC_LINK)
+#define SK_RLMT_MODE_CLP (SK_RLMT_CHECK_LINK | SK_RLMT_CHECK_LOC_LINK)
/* Check Local Ports and Segmentation Status. */
-#define SK_RLMT_MODE_CLPSS (SK_RLMT_CHECK_LINK | \
- SK_RLMT_CHECK_LOC_LINK | \
- SK_RLMT_CHECK_SEG)
+#define SK_RLMT_MODE_CLPSS \
+ (SK_RLMT_CHECK_LINK | SK_RLMT_CHECK_LOC_LINK | SK_RLMT_CHECK_SEG)
#ifdef RLMT_CHECK_REMOTE
/* Check Local and Remote Ports: check links (local or remote). */
Name of define TBD!
-#define SK_RLMT_MODE_CRP (SK_RLMT_CHECK_LINK | \
- SK_RLMT_CHECK_LOC_LINK | \
- SK_RLMT_CHECK_REM_LINK)
+#define SK_RLMT_MODE_CRP \
+ (SK_RLMT_CHECK_LINK | SK_RLMT_CHECK_LOC_LINK | SK_RLMT_CHECK_REM_LINK)
/* Check Local and Remote Ports and Segmentation Status. */
Name of define TBD!
-#define SK_RLMT_MODE_CRPSS (SK_RLMT_CHECK_LINK | \
- SK_RLMT_CHECK_LOC_LINK | \
- SK_RLMT_CHECK_REM_LINK | \
- SK_RLMT_CHECK_SEG)
+#define SK_RLMT_MODE_CRPSS \
+ (SK_RLMT_CHECK_LINK | SK_RLMT_CHECK_LOC_LINK | \
+ SK_RLMT_CHECK_REM_LINK | SK_RLMT_CHECK_SEG)
#endif /* RLMT_CHECK_REMOTE */
/* ----- RLMT lookahead result bits ----- */
-#define SK_RLMT_RX_RLMT 1 /* Give packet to RLMT. */
-#define SK_RLMT_RX_PROTOCOL 2 /* Give packet to protocol. */
+#define SK_RLMT_RX_RLMT 1 /* Give packet to RLMT. */
+#define SK_RLMT_RX_PROTOCOL 2 /* Give packet to protocol. */
/* Macros */
#if 0
SK_AC *pAC /* adapter context */
-SK_U32 PortIdx /* receiving port */
-unsigned PacketLength /* received packet's length */
-SK_BOOL IsBc /* Flag: broadcast received */
-unsigned *pOffset /* Result: offset of bytes to present
- to SK_RLMT_LOOKAHEAD */
-unsigned *pNumBytes /* Result: #Bytes to present
- to SK_RLMT_LOOKAHEAD */
+SK_U32 PortNum /* receiving port */
+unsigned PktLen /* received packet's length */
+SK_BOOL IsBc /* Flag: packet is broadcast */
+unsigned *pOffset /* offs. of bytes to present to SK_RLMT_LOOKAHEAD */
+unsigned *pNumBytes /* #Bytes to present to SK_RLMT_LOOKAHEAD */
#endif /* 0 */
-
-#define SK_RLMT_PRE_LOOKAHEAD(pAC,PortIdx,PacketLength,IsBc,pOffset,pNumBytes) { \
+#define SK_RLMT_PRE_LOOKAHEAD(pAC,PortNum,PktLen,IsBc,pOffset,pNumBytes) { \
SK_AC *_pAC; \
- SK_U32 _PortIdx; \
+ SK_U32 _PortNum; \
_pAC = (pAC); \
- _PortIdx = (SK_U32)(PortIdx); \
- _pAC->Rlmt.Port[_PortIdx].PacketsRx++; \
- _pAC->Rlmt.Port[_PortIdx].PacketsPerTimeSlot++; \
- if ((IsBc) && _pAC->Rlmt.RlmtMode != SK_RLMT_MODE_CLS) { \
- *(pOffset) = 6; \
- *(pNumBytes) = 6; \
+ _PortNum = (SK_U32)(PortNum); \
+ /* _pAC->Rlmt.Port[_PortNum].PacketsRx++; */ \
+ _pAC->Rlmt.Port[_PortNum].PacketsPerTimeSlot++; \
+ if ((_pAC->Rlmt.Port[_PortNum].Net->RlmtMode & SK_RLMT_TRANSPARENT) != 0) { \
+ *(pNumBytes) = 0; \
+ } \
+ else if (IsBc) { \
+ if (_pAC->Rlmt.Port[_PortNum].Net->RlmtMode != SK_RLMT_MODE_CLS) { \
+ *(pNumBytes) = 6; \
+ *(pOffset) = 6; \
+ } \
+ else { \
+ *(pNumBytes) = 0; \
+ } \
} \
else { \
- *(pOffset) = 0; \
- if ((PacketLength) > SK_RLMT_MAX_TX_BUF_SIZE) { \
- _pAC->Rlmt.Port[_PortIdx].DataPacketsPerTimeSlot++; \
+ if ((PktLen) > SK_RLMT_MAX_TX_BUF_SIZE) { \
+ /* _pAC->Rlmt.Port[_PortNum].DataPacketsPerTimeSlot++; */ \
*(pNumBytes) = 0; \
} \
else { \
*(pNumBytes) = 6; \
+ *(pOffset) = 0; \
} \
} \
}
#if 0
SK_AC *pAC /* adapter context */
-SK_U32 PortIdx /* receiving port */
+SK_U32 PortNum /* receiving port */
SK_U8 *pLaPacket, /* received packet's data (points to pOffset) */
-SK_BOOL IsBc /* Flag: broadcast received */
-SK_BOOL IsMc /* Flag: multicast received */
-unsigned *pForRlmt /* Result: bits SK_RLMT_RX_RLMT,
- SK_RLMT_RX_PROTOCOL */
+SK_BOOL IsBc /* Flag: packet is broadcast */
+SK_BOOL IsMc /* Flag: packet is multicast */
+unsigned *pForRlmt /* Result: bits SK_RLMT_RX_RLMT, SK_RLMT_RX_PROTOCOL */
SK_RLMT_LOOKAHEAD() expects *pNumBytes from
packet offset *pOffset (s.a.) at *pLaPacket.
@@ -298,29 +321,28 @@
BC, MC, or UC, you should use constants for IsBc and IsMc, so that your compiler
can trash unneeded parts of the if construction.
#endif /* 0 */
-#define SK_RLMT_LOOKAHEAD(pAC,PortIdx,pLaPacket,IsBc,IsMc,pForRlmt) { \
+
+#define SK_RLMT_LOOKAHEAD(pAC,PortNum,pLaPacket,IsBc,IsMc,pForRlmt) { \
SK_AC *_pAC; \
- SK_U32 _PortIdx; \
+ SK_U32 _PortNum; \
SK_U8 *_pLaPacket; \
_pAC = (pAC); \
- _PortIdx = (SK_U32)(PortIdx); \
+ _PortNum = (SK_U32)(PortNum); \
_pLaPacket = (SK_U8 *)(pLaPacket); \
if (IsBc) {\
- if (!SK_ADDR_EQUAL( \
- _pLaPacket, \
- _pAC->Addr.CurrentMacAddress.a)) { \
- _pAC->Rlmt.Port[_PortIdx].BcTimeStamp = \
- SkOsGetTime(_pAC); \
+ if (!SK_ADDR_EQUAL(_pLaPacket, _pAC->Addr.Net[_pAC->Rlmt.Port[ \
+ _PortNum].Net->NetNumber].CurrentMacAddress.a)) { \
+ _pAC->Rlmt.Port[_PortNum].BcTimeStamp = SkOsGetTime(_pAC); \
+ _pAC->Rlmt.CheckSwitch = SK_TRUE; \
} \
- _pAC->Rlmt.Port[_PortIdx].DataPacketsPerTimeSlot++; \
+ /* _pAC->Rlmt.Port[_PortNum].DataPacketsPerTimeSlot++; */ \
*(pForRlmt) = SK_RLMT_RX_PROTOCOL; \
} \
else if (IsMc) { \
if (SK_ADDR_EQUAL(_pLaPacket, BridgeMcAddr.a)) { \
- _pAC->Rlmt.Port[_PortIdx].BpduPacketsPerTimeSlot++; \
- if (_pAC->Rlmt.RlmtMode & SK_RLMT_CHECK_SEG) { \
- *(pForRlmt) = SK_RLMT_RX_RLMT | \
- SK_RLMT_RX_PROTOCOL; \
+ _pAC->Rlmt.Port[_PortNum].BpduPacketsPerTimeSlot++; \
+ if (_pAC->Rlmt.Port[_PortNum].Net->RlmtMode & SK_RLMT_CHECK_SEG) { \
+ *(pForRlmt) = SK_RLMT_RX_RLMT | SK_RLMT_RX_PROTOCOL; \
} \
else { \
*(pForRlmt) = SK_RLMT_RX_PROTOCOL; \
@@ -330,18 +352,18 @@
*(pForRlmt) = SK_RLMT_RX_RLMT; \
} \
else { \
- _pAC->Rlmt.Port[_PortIdx].DataPacketsPerTimeSlot++; \
+ /* _pAC->Rlmt.Port[_PortNum].DataPacketsPerTimeSlot++; */ \
*(pForRlmt) = SK_RLMT_RX_PROTOCOL; \
} \
} \
else { \
if (SK_ADDR_EQUAL( \
_pLaPacket, \
- _pAC->Addr.Port[_PortIdx].CurrentMacAddress.a)) { \
+ _pAC->Addr.Port[_PortNum].CurrentMacAddress.a)) { \
*(pForRlmt) = SK_RLMT_RX_RLMT; \
} \
else { \
- _pAC->Rlmt.Port[_PortIdx].DataPacketsPerTimeSlot++; \
+ /* _pAC->Rlmt.Port[_PortNum].DataPacketsPerTimeSlot++; */ \
*(pForRlmt) = SK_RLMT_RX_PROTOCOL; \
} \
} \
@@ -350,107 +372,143 @@
#ifdef SK_RLMT_FAST_LOOKAHEAD
Error: SK_RLMT_FAST_LOOKAHEAD no longer used. Use new macros for lookahead.
#endif /* SK_RLMT_FAST_LOOKAHEAD */
+#ifdef SK_RLMT_SLOW_LOOKAHEAD
+Error: SK_RLMT_SLOW_LOOKAHEAD no longer used. Use new macros for lookahead.
+#endif /* SK_RLMT_SLOW_LOOKAHEAD */
/* typedefs *******************************************************************/
+#ifdef SK_RLMT_MBUF_PRIVATE
+typedef struct s_RlmtMbuf {
+ some content
+} SK_RLMT_MBUF;
+#endif /* SK_RLMT_MBUF_PRIVATE */
+
+
+#ifdef SK_LA_INFO
+typedef struct s_Rlmt_PacketInfo {
+ unsigned PacketLength; /* Length of packet. */
+ unsigned PacketType; /* Directed/Multicast/Broadcast. */
+} SK_RLMT_PINFO;
+#endif /* SK_LA_INFO */
+
+
typedef struct s_RootId {
- SK_U8 Id[8]; /* Root Bridge Id. */
+ SK_U8 Id[8]; /* Root Bridge Id. */
} SK_RLMT_ROOT_ID;
+
typedef struct s_port {
SK_MAC_ADDR CheckAddr;
SK_BOOL SuspectTx;
} SK_PORT_CHECK;
+
+typedef struct s_RlmtNet SK_RLMT_NET;
+
+
typedef struct s_RlmtPort {
/* ----- Public part (read-only) ----- */
- SK_U8 PortState; /* Current state of this port. */
+ SK_U8 PortState; /* Current state of this port. */
/* For PNMI */
-
- SK_BOOL LinkDown;
- SK_BOOL PortDown;
-
- SK_U64 TxHelloCts;
- SK_U64 RxHelloCts;
- SK_U64 TxSpHelloReqCts;
- SK_U64 RxSpHelloCts;
+ SK_BOOL LinkDown;
+ SK_BOOL PortDown;
+ SK_U8 Align01;
+
+ SK_U32 PortNumber; /* Number of port on adapter. */
+ SK_RLMT_NET * Net; /* Net port belongs to. */
+
+ SK_U64 TxHelloCts;
+ SK_U64 RxHelloCts;
+ SK_U64 TxSpHelloReqCts;
+ SK_U64 RxSpHelloCts;
/* ----- Private part ----- */
- SK_BOOL PortStarted; /* Port is started. */
- SK_BOOL PortNoRx; /* NoRx for >= 1 time slot. */
- SK_U32 CheckingState; /* Checking State. */
-
- SK_U64 PacketsRx; /* Total packets received. */
- SK_U32 PacketsPerTimeSlot; /* Packets rxed between TOs. */
- SK_U32 DataPacketsPerTimeSlot; /* Data packets ... */
-#if 0
- SK_U32 RlmtAcksPerTimeSlot; /* RLMT Acks rxed in TS. */
- SK_U32 RlmtChksPerTimeSlot; /* RLMT Chks rxed in TS. */
-#endif /* 0 */
- SK_U32 BpduPacketsPerTimeSlot; /* BPDU packets rxed in TS. */
- SK_U64 BcTimeStamp; /* Time of last BC receive. */
- SK_U64 GuTimeStamp; /* Time of entering GOING_UP. */
-
- SK_TIMER UpTimer; /* Timer struct Link/Port up. */
- SK_TIMER DownRxTimer; /* Timer struct down rx. */
- SK_TIMER DownTxTimer; /* Timer struct down tx. */
-
- SK_U8 Random[4]; /* Random value. */
- unsigned PortsChecked; /* #ports checked. */
- unsigned PortsSuspect; /* #ports checked that are s. */
+/* SK_U64 PacketsRx; */ /* Total packets received. */
+ SK_U32 PacketsPerTimeSlot; /* Packets rxed between TOs. */
+/* SK_U32 DataPacketsPerTimeSlot; */ /* Data packets ... */
+ SK_U32 BpduPacketsPerTimeSlot; /* BPDU packets rxed in TS. */
+ SK_U64 BcTimeStamp; /* Time of last BC receive. */
+ SK_U64 GuTimeStamp; /* Time of entering GOING_UP. */
+
+ SK_TIMER UpTimer; /* Timer struct Link/Port up. */
+ SK_TIMER DownRxTimer; /* Timer struct down rx. */
+ SK_TIMER DownTxTimer; /* Timer struct down tx. */
+
+ SK_U32 CheckingState; /* Checking State. */
+
+ SK_ADDR_PORT * AddrPort;
+
+ SK_U8 Random[4]; /* Random value. */
+ unsigned PortsChecked; /* #ports checked. */
+ unsigned PortsSuspect; /* #ports checked that are s. */
SK_PORT_CHECK PortCheck[1];
/* SK_PORT_CHECK PortCheck[SK_MAX_MACS - 1]; */
- SK_BOOL RootIdSet;
- SK_RLMT_ROOT_ID Root; /* Root Bridge Id. */
+ SK_BOOL PortStarted; /* Port is started. */
+ SK_BOOL PortNoRx; /* NoRx for >= 1 time slot. */
+ SK_BOOL RootIdSet;
+ SK_RLMT_ROOT_ID Root; /* Root Bridge Id. */
} SK_RLMT_PORT;
-#ifdef SK_RLMT_MBUF_PRIVATE
-typedef struct s_RlmtMbuf {
- some content
-} SK_RLMT_MBUF;
-#endif /* SK_RLMT_MBUF_PRIVATE */
-#ifdef SK_LA_INFO
-typedef struct s_Rlmt_PacketInfo {
- unsigned PacketLength; /* Length of packet. */
- unsigned PacketType; /* Directed/Multicast/Broadcast. */
-} SK_RLMT_PINFO;
-#endif /* SK_LA_INFO */
-
-typedef struct s_Rlmt {
+struct s_RlmtNet {
/* ----- Public part (read-only) ----- */
- SK_U8 RlmtState; /* Current RLMT state. */
- SK_RLMT_PORT Port[SK_MAX_MACS]; /* Array of available ports. */
- SK_U32 PrefPort; /* Preferred port. */
+ SK_U32 NetNumber; /* Number of net. */
+
+ SK_RLMT_PORT * Port[SK_MAX_MACS]; /* Ports that belong to this net. */
+ SK_U32 NumPorts; /* Number of ports. */
+ SK_U32 PrefPort; /* Preferred port. */
/* For PNMI */
- SK_U32 RlmtMode; /* Check ... */
- SK_U32 MacActive; /* Active port. */
- SK_U32 MacPreferred; /* 0xFFFFFFFF: Automatic. */
+ SK_U32 RlmtMode; /* Check ... */
+ SK_U32 ActivePort; /* Active port. */
+ SK_U32 Preference; /* 0xFFFFFFFF: Automatic. */
+
+ SK_U8 RlmtState; /* Current RLMT state. */
+
+/* ----- Private part ----- */
+ SK_BOOL RootIdSet;
+ SK_U16 Align01;
+
+ int LinksUp; /* #Links up. */
+ int PortsUp; /* #Ports up. */
+ SK_U32 TimeoutValue; /* RLMT timeout value. */
+
+ SK_U32 CheckingState; /* Checking State. */
+ SK_RLMT_ROOT_ID Root; /* Root Bridge Id. */
+
+ SK_TIMER LocTimer; /* Timer struct. */
+ SK_TIMER SegTimer; /* Timer struct. */
+};
+
+
+typedef struct s_Rlmt {
+
+/* ----- Public part (read-only) ----- */
+
+ SK_U32 NumNets; /* Number of nets. */
+ SK_U32 NetsStarted; /* Number of nets started. */
+ SK_RLMT_NET Net[SK_MAX_NETS]; /* Array of available nets. */
+ SK_RLMT_PORT Port[SK_MAX_MACS]; /* Array of available ports. */
/* ----- Private part ----- */
+ SK_BOOL CheckSwitch;
+ SK_U8 Align01;
+ SK_U16 Align02;
- int LinksUp; /* #Links up. */
- int PortsUp; /* #Ports up. */
- SK_U32 TimeoutValue; /* RLMT timeout value. */
- SK_TIMER LocTimer; /* Timer struct. */
-
- SK_U32 CheckingState; /* Checking State. */
- SK_BOOL RootIdSet;
- SK_RLMT_ROOT_ID Root; /* Root Bridge Id. */
- SK_TIMER SegTimer; /* Timer struct. */
} SK_RLMT;
+
extern SK_MAC_ADDR BridgeMcAddr;
-extern SK_MAC_ADDR SkRlmtMcAddr;
+extern SK_MAC_ADDR SkRlmtMcAddr;
/* function prototypes ********************************************************/
@@ -464,16 +522,7 @@
extern void SkRlmtInit(
SK_AC *pAC,
SK_IOC IoC,
- int Level);
-
-#ifdef SK_RLMT_SLOW_LOOKAHEAD
-extern SK_BOOL SkRlmtLookaheadPacket(
- SK_AC *pAC,
- SK_U32 PortIdx,
- SK_U8 *pLaPacket,
- unsigned PacketLength,
- unsigned LaLength);
-#endif /* SK_RLMT_SLOW_LOOKAHEAD */
+ int Level);
extern int SkRlmtEvent(
SK_AC *pAC,
@@ -481,11 +530,11 @@
SK_U32 Event,
SK_EVPARA Para);
-#else /* defined(SK_KR_PROTO)) */
+#else /* defined(SK_KR_PROTO) */
/* Non-ANSI/C++ compliant function prototypes */
-xxxx /* not supported yet - force error */
+#error KR-style function prototypes are not yet provided.
#endif /* defined(SK_KR_PROTO)) */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/h/skversion.h linux.20p6/drivers/net/sk98lin/h/skversion.h
--- linux.vanilla/drivers/net/sk98lin/h/skversion.h Thu Jan 1 01:00:00 1970
+++ linux.20p6/drivers/net/sk98lin/h/skversion.h Tue Jun 19 09:46:04 2001
@@ -0,0 +1,46 @@
+/******************************************************************************
+ *
+ * Name: version.h
+ * Project: GEnesis, PCI Gigabit Ethernet Adapter
+ * Version: $Revision: 1.1 $
+ * Date: $Date: 2001/03/06 09:25:00 $
+ * Purpose: SK specific Error log support
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * (C)Copyright 1998,1999 SysKonnect,
+ * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ *
+ * 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 information in this file is provided "AS IS" without warranty.
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * History:
+ * $Log: skversion.h,v $
+ * Revision 1.1 2001/03/06 09:25:00 mlindner
+ * first version
+ *
+ *
+ *
+ ******************************************************************************/
+
+
+static const char SysKonnectFileId[] = "@(#)" __FILE__ " (C) SysKonnect GmbH.";
+static const char SysKonnectBuildNumber[] =
+ "@(#)SK-BUILD: 4.07 PL: 01";
+
+#define BOOT_STRING "sk98lin: Network Device Driver v4.07\n" \
+ "Copyright (C) 2000-2001 SysKonnect GmbH."
+
+#define VER_STRING "4.07"
+
+
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/h/xmac_ii.h linux.20p6/drivers/net/sk98lin/h/xmac_ii.h
--- linux.vanilla/drivers/net/sk98lin/h/xmac_ii.h Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/h/xmac_ii.h Tue Jun 19 09:59:54 2001
@@ -2,16 +2,15 @@
*
* Name: xmac_ii.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.26 $
- * Date: $Date: 1999/11/22 14:03:00 $
+ * Version: $Revision: 1.28 $
+ * Date: $Date: 2000/11/09 12:32:49 $
* Purpose: Defines and Macros for XaQti's Gigabit Ethernet Controller
*
******************************************************************************/
/******************************************************************************
*
- * (C)Copyright 1998,1999 SysKonnect,
- * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ * (C)Copyright 1998-2000 SysKonnect GmbH.
*
* 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
@@ -27,6 +26,12 @@
* History:
*
* $Log: xmac_ii.h,v $
+ * Revision 1.28 2000/11/09 12:32:49 rassmann
+ * Renamed variables.
+ *
+ * Revision 1.27 2000/05/17 11:00:46 malthoff
+ * Add bit for enable/disable power management in BCOM chip.
+ *
* Revision 1.26 1999/11/22 14:03:00 cgoos
* Changed license header to GPL.
*
@@ -142,40 +147,40 @@
* Note: NA reg = Network Address e.g DA, SA etc.
*
*/
-#define XM_MMU_CMD 0x0000 /* 16 bit r/w MMU Command Register */
+#define XM_MMU_CMD 0x0000 /* 16 bit r/w MMU Command Register */
/* 0x0004: reserved */
-#define XM_POFF 0x0008 /* 32 bit r/w Packet Offset Register */
-#define XM_BURST 0x000c /* 32 bit r/w Burst Register for half duplex*/
+#define XM_POFF 0x0008 /* 32 bit r/w Packet Offset Register */
+#define XM_BURST 0x000c /* 32 bit r/w Burst Register for half duplex*/
#define XM_1L_VLAN_TAG 0x0010 /* 16 bit r/w One Level VLAN Tag ID */
#define XM_2L_VLAN_TAG 0x0014 /* 16 bit r/w Two Level VLAN Tag ID */
/* 0x0018 - 0x001e: reserved */
-#define XM_TX_CMD 0x0020 /* 16 bit r/w Transmit Command Register */
+#define XM_TX_CMD 0x0020 /* 16 bit r/w Transmit Command Register */
#define XM_TX_RT_LIM 0x0024 /* 16 bit r/w Transmit Retry Limit Register */
-#define XM_TX_STIME 0x0028 /* 16 bit r/w Transmit Slottime Register */
-#define XM_TX_IPG 0x002c /* 16 bit r/w Transmit Inter Packet Gap */
-#define XM_RX_CMD 0x0030 /* 16 bit r/w Receive Command Register */
-#define XM_PHY_ADDR 0x0034 /* 16 bit r/w PHY Address Register */
-#define XM_PHY_DATA 0x0038 /* 16 bit r/w PHY Data Register */
+#define XM_TX_STIME 0x0028 /* 16 bit r/w Transmit Slottime Register */
+#define XM_TX_IPG 0x002c /* 16 bit r/w Transmit Inter Packet Gap */
+#define XM_RX_CMD 0x0030 /* 16 bit r/w Receive Command Register */
+#define XM_PHY_ADDR 0x0034 /* 16 bit r/w PHY Address Register */
+#define XM_PHY_DATA 0x0038 /* 16 bit r/w PHY Data Register */
/* 0x003c: reserved */
-#define XM_GP_PORT 0x0040 /* 32 bit r/w General Purpose Port Register */
-#define XM_IMSK 0x0044 /* 16 bit r/w Interrupt Mask Register */
-#define XM_ISRC 0x0048 /* 16 bit ro Interrupt Status Register */
-#define XM_HW_CFG 0x004c /* 16 bit r/w Hardware Config Register */
+#define XM_GP_PORT 0x0040 /* 32 bit r/w General Purpose Port Register */
+#define XM_IMSK 0x0044 /* 16 bit r/w Interrupt Mask Register */
+#define XM_ISRC 0x0048 /* 16 bit ro Interrupt Status Register */
+#define XM_HW_CFG 0x004c /* 16 bit r/w Hardware Config Register */
/* 0x0050 - 0x005e: reserved */
-#define XM_TX_LO_WM 0x0060 /* 16 bit r/w Tx FIFO Low Water Mark */
-#define XM_TX_HI_WM 0x0062 /* 16 bit r/w Tx FIFO High Water Mark */
-#define XM_TX_THR 0x0064 /* 16 bit r/w Tx Request Threshold */
-#define XM_HT_THR 0x0066 /* 16 bit r/w Host Request Threshold */
-#define XM_PAUSE_DA 0x0068 /* NA reg r/w Pause Destination Address */
+#define XM_TX_LO_WM 0x0060 /* 16 bit r/w Tx FIFO Low Water Mark */
+#define XM_TX_HI_WM 0x0062 /* 16 bit r/w Tx FIFO High Water Mark */
+#define XM_TX_THR 0x0064 /* 16 bit r/w Tx Request Threshold */
+#define XM_HT_THR 0x0066 /* 16 bit r/w Host Request Threshold */
+#define XM_PAUSE_DA 0x0068 /* NA reg r/w Pause Destination Address */
/* 0x006e: reserved */
-#define XM_CTL_PARA 0x0070 /* 32 bit r/w Control Parameter Register */
+#define XM_CTL_PARA 0x0070 /* 32 bit r/w Control Parameter Register */
#define XM_MAC_OPCODE 0x0074 /* 16 bit r/w Opcode for MAC control frames */
#define XM_MAC_PTIME 0x0076 /* 16 bit r/w Pause time for MAC ctrl frames*/
-#define XM_TX_STAT 0x0078 /* 32 bit ro Tx Status LIFO Register */
+#define XM_TX_STAT 0x0078 /* 32 bit ro Tx Status LIFO Register */
/* 0x0080 - 0x00fc: 16 NA reg r/w Exakt Match Address Registers */
/* use the XM_EMX() macro to address */
-#define XM_EXM_START 0x0080 /* r/w Start Address of the EXM Regs */
+#define XM_EXM_START 0x0080 /* r/w Start Address of the EXM Regs */
/*
* XM_EXM(Reg)
@@ -188,18 +193,18 @@
*/
#define XM_EXM(Reg) (XM_EXM_START + ((Reg) << 3))
-#define XM_SRC_CHK 0x0100 /* NA reg r/w Source Check Address Register */
-#define XM_SA 0x0108 /* NA reg r/w Station Address Register */
-#define XM_HSM 0x0110 /* 64 bit r/w Hash Match Address Registers */
-#define XM_RX_LO_WM 0x0118 /* 16 bit r/w Receive Low Water Mark */
-#define XM_RX_HI_WM 0x011a /* 16 bit r/w Receive High Water Mark */
-#define XM_RX_THR 0x011c /* 32 bit r/w Receive Request Threshold */
-#define XM_DEV_ID 0x0120 /* 32 bit ro Device ID Register */
-#define XM_MODE 0x0124 /* 32 bit r/w Mode Register */
-#define XM_LSA 0x0128 /* NA reg ro Last Source Register */
+#define XM_SRC_CHK 0x0100 /* NA reg r/w Source Check Address Register */
+#define XM_SA 0x0108 /* NA reg r/w Station Address Register */
+#define XM_HSM 0x0110 /* 64 bit r/w Hash Match Address Registers */
+#define XM_RX_LO_WM 0x0118 /* 16 bit r/w Receive Low Water Mark */
+#define XM_RX_HI_WM 0x011a /* 16 bit r/w Receive High Water Mark */
+#define XM_RX_THR 0x011c /* 32 bit r/w Receive Request Threshold */
+#define XM_DEV_ID 0x0120 /* 32 bit ro Device ID Register */
+#define XM_MODE 0x0124 /* 32 bit r/w Mode Register */
+#define XM_LSA 0x0128 /* NA reg ro Last Source Register */
/* 0x012e: reserved */
-#define XM_TS_READ 0x0130 /* 32 bit ro TimeStamp Read Regeister */
-#define XM_TS_LOAD 0x0134 /* 32 bit ro TimeStamp Load Value */
+#define XM_TS_READ 0x0130 /* 32 bit ro TimeStamp Read Regeister */
+#define XM_TS_LOAD 0x0134 /* 32 bit ro TimeStamp Load Value */
/* 0x0138 - 0x01fe: reserved */
#define XM_STAT_CMD 0x0200 /* 16 bit r/w Statistics Command Register */
#define XM_RX_CNT_EV 0x0204 /* 32 bit ro Rx Counter Event Register */
@@ -207,13 +212,13 @@
#define XM_RX_EV_MSK 0x020c /* 32 bit r/w Rx Counter Event Mask */
#define XM_TX_EV_MSK 0x0210 /* 32 bit r/w Tx Counter Event Mask */
/* 0x0204 - 0x027e: reserved */
-#define XM_TXF_OK 0x0280 /* 32 bit ro Frames Transmitted OK Conuter */
+#define XM_TXF_OK 0x0280 /* 32 bit ro Frames Transmitted OK Conuter */
#define XM_TXO_OK_HI 0x0284 /* 32 bit ro Octets Transmitted OK High Cnt*/
#define XM_TXO_OK_LO 0x0288 /* 32 bit ro Octets Transmitted OK Low Cnt */
#define XM_TXF_BC_OK 0x028c /* 32 bit ro Broadcast Frames Xmitted OK */
#define XM_TXF_MC_OK 0x0290 /* 32 bit ro Multicast Frames Xmitted OK */
#define XM_TXF_UC_OK 0x0294 /* 32 bit ro Unicast Frames Xmitted OK */
-#define XM_TXF_LONG 0x0298 /* 32 bit ro Tx Long Frame Counter */
+#define XM_TXF_LONG 0x0298 /* 32 bit ro Tx Long Frame Counter */
#define XM_TXE_BURST 0x029c /* 32 bit ro Tx Burst Event Counter */
#define XM_TXF_MPAUSE 0x02a0 /* 32 bit ro Tx Pause MAC Ctrl Frame Cnt */
#define XM_TXF_MCTRL 0x02a4 /* 32 bit ro Tx MAC Ctrl Frame Counter */
@@ -221,20 +226,20 @@
#define XM_TXF_MUL_COL 0x02ac /* 32 bit ro Tx Multiple Collision Counter */
#define XM_TXF_ABO_COL 0x02b0 /* 32 bit ro Tx aborted due to Exessive Col*/
#define XM_TXF_LAT_COL 0x02b4 /* 32 bit ro Tx Late Collision Counter */
-#define XM_TXF_DEF 0x02b8 /* 32 bit ro Tx Deferred Frame Counter */
+#define XM_TXF_DEF 0x02b8 /* 32 bit ro Tx Deferred Frame Counter */
#define XM_TXF_EX_DEF 0x02bc /* 32 bit ro Tx Excessive Deferall Counter */
#define XM_TXE_FIFO_UR 0x02c0 /* 32 bit ro Tx FIFO Underrun Event Cnt */
#define XM_TXE_CS_ERR 0x02c4 /* 32 bit ro Tx Carrier Sence Error Cnt */
-#define XM_TXP_UTIL 0x02c8 /* 32 bit ro Tx Utilization in % */
+#define XM_TXP_UTIL 0x02c8 /* 32 bit ro Tx Utilization in % */
/* 0x02cc - 0x02ce: reserved */
-#define XM_TXF_64B 0x02d0 /* 32 bit ro 64 Byte Tx Frame Counter */
-#define XM_TXF_127B 0x02d4 /* 32 bit ro 65-127 Byte Tx Frame Counter */
-#define XM_TXF_255B 0x02d8 /* 32 bit ro 128-255 Byte Tx Frame Counter */
-#define XM_TXF_511B 0x02dc /* 32 bit ro 256-511 Byte Tx Frame Counter */
+#define XM_TXF_64B 0x02d0 /* 32 bit ro 64 Byte Tx Frame Counter */
+#define XM_TXF_127B 0x02d4 /* 32 bit ro 65-127 Byte Tx Frame Counter */
+#define XM_TXF_255B 0x02d8 /* 32 bit ro 128-255 Byte Tx Frame Counter */
+#define XM_TXF_511B 0x02dc /* 32 bit ro 256-511 Byte Tx Frame Counter */
#define XM_TXF_1023B 0x02e0 /* 32 bit ro 512-1023 Byte Tx Frame Counter*/
#define XM_TXF_MAX_SZ 0x02e4 /* 32 bit ro 1024-MaxSize Byte Tx Frame Cnt*/
/* 0x02e8 - 0x02fe: reserved */
-#define XM_RXF_OK 0x0300 /* 32 bit ro Frames Received OK */
+#define XM_RXF_OK 0x0300 /* 32 bit ro Frames Received OK */
#define XM_RXO_OK_HI 0x0304 /* 32 bit ro Octets Received OK High Cnt */
#define XM_RXO_OK_LO 0x0308 /* 32 bit ro Octets Received OK Low Counter*/
#define XM_RXF_BC_OK 0x030c /* 32 bit ro Broadcast Frames Received OK */
@@ -253,17 +258,17 @@
#define XM_RXF_LEN_ERR 0x0340 /* 32 bit ro Rx in Range Length Error */
#define XM_RXE_SYM_ERR 0x0344 /* 32 bit ro Rx Symbol Error Counter */
#define XM_RXE_SHT_ERR 0x0348 /* 32 bit ro Rx Short Event Error Cnt */
-#define XM_RXE_RUNT 0x034c /* 32 bit ro Rx Runt Event Counter */
+#define XM_RXE_RUNT 0x034c /* 32 bit ro Rx Runt Event Counter */
#define XM_RXF_LNG_ERR 0x0350 /* 32 bit ro Rx Frame too Long Error Cnt */
#define XM_RXF_FCS_ERR 0x0354 /* 32 bit ro Rx Frame Check Seq. Error Cnt */
/* 0x0358 - 0x035a: reserved */
#define XM_RXF_CEX_ERR 0x035c /* 32 bit ro Rx Carrier Ext Error Frame Cnt*/
-#define XM_RXP_UTIL 0x0360 /* 32 bit ro Rx Utilization in % */
+#define XM_RXP_UTIL 0x0360 /* 32 bit ro Rx Utilization in % */
/* 0x0364 - 0x0366: reserved */
-#define XM_RXF_64B 0x0368 /* 32 bit ro 64 Byte Rx Frame Counter */
-#define XM_RXF_127B 0x036c /* 32 bit ro 65-127 Byte Rx Frame Counter */
-#define XM_RXF_255B 0x0370 /* 32 bit ro 128-255 Byte Rx Frame Counter */
-#define XM_RXF_511B 0x0374 /* 32 bit ro 256-511 Byte Rx Frame Counter */
+#define XM_RXF_64B 0x0368 /* 32 bit ro 64 Byte Rx Frame Counter */
+#define XM_RXF_127B 0x036c /* 32 bit ro 65-127 Byte Rx Frame Counter */
+#define XM_RXF_255B 0x0370 /* 32 bit ro 128-255 Byte Rx Frame Counter */
+#define XM_RXF_511B 0x0374 /* 32 bit ro 256-511 Byte Rx Frame Counter */
#define XM_RXF_1023B 0x0378 /* 32 bit ro 512-1023 Byte Rx Frame Counter*/
#define XM_RXF_MAX_SZ 0x037c /* 32 bit ro 1024-MaxSize Byte Rx Frame Cnt*/
/* 0x02e8 - 0x02fe: reserved */
@@ -281,12 +286,12 @@
*/
/* XM_MMU_CMD 16 bit r/w MMU Comamnd Register */
- /* Bit 15..13: reserved */
+ /* Bit 15..13: reserved */
#define XM_MMU_PHY_RDY (1<<12) /* Bit 12: PHY Read Ready */
#define XM_MMU_PHY_BUSY (1<<11) /* Bit 11: PHY Busy */
#define XM_MMU_IGN_PF (1<<10) /* Bit 10: Ignore Pause Frame */
#define XM_MMU_MAC_LB (1<<9) /* Bit 9: Enable MAC Loopback */
- /* Bit 8: reserved */
+ /* Bit 8: reserved */
#define XM_MMU_FRC_COL (1<<7) /* Bit 7: Force Collision */
#define XM_MMU_SIM_COL (1<<6) /* Bit 6: Simulate Collision */
#define XM_MMU_NO_PRE (1<<5) /* Bit 5: No MDIO Preamble */
@@ -298,8 +303,8 @@
/* XM_TX_CMD 16 bit r/w Transmit Command Register */
- /* Bit 15..7: reserved */
-#define XM_TX_BK2BK (1<<6) /* Bit 6: Ignor Carrier Sense (tx Bk2Bk)*/
+ /* Bit 15..7: reserved */
+#define XM_TX_BK2BK (1<<6) /* Bit 6: Ignor Carrier Sense (tx Bk2Bk)*/
#define XM_TX_ENC_BYP (1<<5) /* Bit 5: Set Encoder in Bypass Mode */
#define XM_TX_SAM_LINE (1<<4) /* Bit 4: (sc) Start utilization calculation */
#define XM_TX_NO_GIG_MD (1<<3) /* Bit 3: Disable Carrier Extension */
@@ -309,28 +314,28 @@
/* XM_TX_RT_LIM 16 bit r/w Transmit Retry Limit Register */
- /* Bit 15..5: reserved */
+ /* Bit 15..5: reserved */
#define XM_RT_LIM_MSK 0x1f /* Bit 4..0: Tx Retry Limit */
/* XM_TX_STIME 16 bit r/w Transmit Slottime Register */
- /* Bit 15..7: reserved */
+ /* Bit 15..7: reserved */
#define XM_STIME_MSK 0x7f /* Bit 6..0: Tx Slottime bits */
/* XM_TX_IPG 16 bit r/w Transmit Inter Packet Gap */
- /* Bit 15..8: reserved */
-#define XM_IPG_MSK 0xff /* Bit 7..0: IPG value bits */
+ /* Bit 15..8: reserved */
+#define XM_IPG_MSK 0xff /* Bit 7..0: IPG value bits */
/* XM_RX_CMD 16 bit r/w Receive Command Register */
- /* Bit 15..9: reserved */
+ /* Bit 15..9: reserved */
#define XM_RX_LENERR_OK (1<<8) /* Bit 8 don't set Rx Err bit for */
- /* inrange error packets */
+ /* inrange error packets */
#define XM_RX_BIG_PK_OK (1<<7) /* Bit 7 don't set Rx Err bit for */
- /* jumbo packets */
+ /* jumbo packets */
#define XM_RX_IPG_CAP (1<<6) /* Bit 6 repl. type field with IPG */
-#define XM_RX_TP_MD (1<<5) /* Bit 5: Enable transparent Mode */
+#define XM_RX_TP_MD (1<<5) /* Bit 5: Enable transparent Mode */
#define XM_RX_STRIP_FCS (1<<4) /* Bit 4: Enable FCS Stripping */
#define XM_RX_SELF_RX (1<<3) /* Bit 3: Enable Rx of own packets */
#define XM_RX_SAM_LINE (1<<2) /* Bit 2: (sc) Start utilization calculation */
@@ -339,24 +344,24 @@
/* XM_PHY_ADDR 16 bit r/w PHY Address Register */
- /* Bit 15..5: reserved */
+ /* Bit 15..5: reserved */
#define XM_PHY_ADDR_SZ 0x1f /* Bit 4..0: PHY Address bits */
/* XM_GP_PORT 32 bit r/w General Purpose Port Register */
- /* Bit 31..7: reserved */
-#define XM_GP_ANIP (1L<<6) /* Bit 6: (ro) Auto Negotiation in Progress */
+ /* Bit 31..7: reserved */
+#define XM_GP_ANIP (1L<<6) /* Bit 6: (ro) Auto Negotiation in Progress */
#define XM_GP_FRC_INT (1L<<5) /* Bit 5: (sc) Force Interrupt */
- /* Bit 4: reserved */
+ /* Bit 4: reserved */
#define XM_GP_RES_MAC (1L<<3) /* Bit 3: (sc) Reset MAC and FIFOs */
#define XM_GP_RES_STAT (1L<<2) /* Bit 2: (sc) Reset the statistics module */
- /* Bit 1: reserved */
+ /* Bit 1: reserved */
#define XM_GP_INP_ASS (1L<<0) /* Bit 0: (ro) GP Input Pin asserted */
/* XM_IMSK 16 bit r/w Interrupt Mask Register */
/* XM_ISRC 16 bit ro Interrupt Status Register */
- /* Bit 15: reserved */
+ /* Bit 15: reserved */
#define XM_IS_LNK_AE (1<<14) /* Bit 14: Link Asynchronous Event */
#define XM_IS_TX_ABORT (1<<13) /* Bit 13: Transmit Abort, late Col. etc */
#define XM_IS_FRC_INT (1<<12) /* Bit 12: Force INT bit set in GP */
@@ -364,7 +369,7 @@
#define XM_IS_LIPA_RC (1<<10) /* Bit 10: Link Partner requests config */
#define XM_IS_RX_PAGE (1<<9) /* Bit 9: Page Received */
#define XM_IS_TX_PAGE (1<<8) /* Bit 8: Next Page Loaded for Transmit */
-#define XM_IS_AND (1<<7) /* Bit 7: Auto Negotiation Done */
+#define XM_IS_AND (1<<7) /* Bit 7: Auto Negotiation Done */
#define XM_IS_TSC_OV (1<<6) /* Bit 6: Time Stamp Counter Overflow */
#define XM_IS_RXC_OV (1<<5) /* Bit 5: Rx Counter Event Overflow */
#define XM_IS_TXC_OV (1<<4) /* Bit 4: Tx Counter Event Overflow */
@@ -374,42 +379,41 @@
#define XM_IS_RX_COMP (1<<0) /* Bit 0: Frame Rx Complete */
#define XM_DEF_MSK (~(XM_IS_INP_ASS | XM_IS_LIPA_RC | XM_IS_RX_PAGE |\
- XM_IS_AND | XM_IS_RXC_OV | XM_IS_TXC_OV |\
- XM_IS_TXF_UR))
+ XM_IS_AND | XM_IS_RXC_OV | XM_IS_TXC_OV | XM_IS_TXF_UR))
/* XM_HW_CFG 16 bit r/w Hardware Config Register */
- /* Bit 15.. 4: reserved */
+ /* Bit 15.. 4: reserved */
#define XM_HW_GEN_EOP (1<<3) /* Bit 3: generate End of Packet pulse */
#define XM_HW_COM4SIG (1<<2) /* Bit 2: use Comma Detect for Sig. Det.*/
- /* Bit 1: reserved */
+ /* Bit 1: reserved */
#define XM_HW_GMII_MD (1<<0) /* Bit 0: GMII Interface selected */
/* XM_TX_LO_WM 16 bit r/w Tx FIFO Low Water Mark */
/* XM_TX_HI_WM 16 bit r/w Tx FIFO High Water Mark */
- /* Bit 15..10 reserved */
+ /* Bit 15..10 reserved */
#define XM_TX_WM_MSK 0x01ff /* Bit 9.. 0 Tx FIFO Watermark bits */
/* XM_TX_THR 16 bit r/w Tx Request Threshold */
/* XM_HT_THR 16 bit r/w Host Request Threshold */
/* XM_RX_THR 16 bit r/w Receive Request Threshold */
- /* Bit 15..11 reserved */
-#define XM_THR_MSK 0x03ff /* Bit 10.. 0 Tx FIFO Watermark bits */
+ /* Bit 15..11 reserved */
+#define XM_THR_MSK 0x03ff /* Bit 10.. 0 Tx FIFO Watermark bits */
/* XM_TX_STAT 32 bit ro Tx Status LIFO Register */
-#define XM_ST_VALID (1UL<<31) /* Bit 31: Status Valid */
+#define XM_ST_VALID (1UL<<31) /* Bit 31: Status Valid */
#define XM_ST_BYTE_CNT (0x3fffL<<17) /* Bit 30..17: Tx frame Length */
#define XM_ST_RETRY_CNT (0x1fL<<12) /* Bit 16..12: Retry Count */
#define XM_ST_EX_COL (1L<<11) /* Bit 11: Excessive Collisions */
#define XM_ST_EX_DEF (1L<<10) /* Bit 10: Excessive Deferral */
-#define XM_ST_BURST (1L<<9) /* Bit 9: p. xmitted in burst md*/
-#define XM_ST_DEFER (1L<<8) /* Bit 8: packet was defered */
-#define XM_ST_BC (1L<<7) /* Bit 7: Broadcast packet */
-#define XM_ST_MC (1L<<6) /* Bit 6: Multicast packet */
-#define XM_ST_UC (1L<<5) /* Bit 5: Unicast packet */
-#define XM_ST_TX_UR (1L<<4) /* Bit 4: FIFO Underrun occured */
+#define XM_ST_BURST (1L<<9) /* Bit 9: p. xmitted in burst md*/
+#define XM_ST_DEFER (1L<<8) /* Bit 8: packet was defered */
+#define XM_ST_BC (1L<<7) /* Bit 7: Broadcast packet */
+#define XM_ST_MC (1L<<6) /* Bit 6: Multicast packet */
+#define XM_ST_UC (1L<<5) /* Bit 5: Unicast packet */
+#define XM_ST_TX_UR (1L<<4) /* Bit 4: FIFO Underrun occurred */
#define XM_ST_CS_ERR (1L<<3) /* Bit 3: Carrier Sense Error */
#define XM_ST_LAT_COL (1L<<2) /* Bit 2: Late Collision Error */
#define XM_ST_MUL_COL (1L<<1) /* Bit 1: Multiple Collisions */
@@ -417,8 +421,8 @@
/* XM_RX_LO_WM 16 bit r/w Receive Low Water Mark */
/* XM_RX_HI_WM 16 bit r/w Receive High Water Mark */
- /* Bit 15..11: reserved */
-#define XM_RX_WM_MSK 0x03ff /* Bit 11.. 0: Rx FIFO Watermark bits */
+ /* Bit 15..11: reserved */
+#define XM_RX_WM_MSK 0x03ff /* Bit 11.. 0: Rx FIFO Watermark bits */
/* XM_DEV_ID 32 bit ro Device ID Register */
@@ -427,25 +431,25 @@
/* XM_MODE 32 bit r/w Mode Register */
- /* Bit 31..27: reserved */
+ /* Bit 31..27: reserved */
#define XM_MD_ENA_REJ (1L<<26) /* Bit 26: Enable Frame Reject */
#define XM_MD_SPOE_E (1L<<25) /* Bit 25: Send Pause on Edge */
- /* extern generated */
+ /* extern generated */
#define XM_MD_TX_REP (1L<<24) /* Bit 24: Transmit Repeater Mode*/
#define XM_MD_SPOFF_I (1L<<23) /* Bit 23: Send Pause on FIFOfull*/
- /* intern generated */
+ /* intern generated */
#define XM_MD_LE_STW (1L<<22) /* Bit 22: Rx Stat Word in Lit En*/
#define XM_MD_TX_CONT (1L<<21) /* Bit 21: Send Continuous */
#define XM_MD_TX_PAUSE (1L<<20) /* Bit 20: (sc) Send Pause Frame */
-#define XM_MD_ATS (1L<<19) /* Bit 19: Append Time Stamp */
+#define XM_MD_ATS (1L<<19) /* Bit 19: Append Time Stamp */
#define XM_MD_SPOL_I (1L<<18) /* Bit 18: Send Pause on Low */
- /* intern generated */
+ /* intern generated */
#define XM_MD_SPOH_I (1L<<17) /* Bit 17: Send Pause on High */
- /* intern generated */
-#define XM_MD_CAP (1L<<16) /* Bit 16: Check Address Pair */
+ /* intern generated */
+#define XM_MD_CAP (1L<<16) /* Bit 16: Check Address Pair */
#define XM_MD_ENA_HSH (1L<<15) /* Bit 15: Enable Hashing */
-#define XM_MD_CSA (1L<<14) /* Bit 14: Check Station Address */
-#define XM_MD_CAA (1L<<13) /* Bit 13: Check Address Array */
+#define XM_MD_CSA (1L<<14) /* Bit 14: Check Station Address */
+#define XM_MD_CAA (1L<<13) /* Bit 13: Check Address Array */
#define XM_MD_RX_MCTRL (1L<<12) /* Bit 12: Rx MAC Control Frames */
#define XM_MD_RX_RUNT (1L<<11) /* Bit 11: Rx Runt Frames */
#define XM_MD_RX_IRLE (1L<<10) /* Bit 10: Rx in Range Len Err F */
@@ -457,16 +461,15 @@
#define XM_MD_DIS_BC (1L<<4) /* Bit 4: Disable Rx Boradcast */
#define XM_MD_ENA_PROM (1L<<3) /* Bit 3: Enable Promiscuous */
#define XM_MD_ENA_BE (1L<<2) /* Bit 2: Enable Big Endian */
-#define XM_MD_FTF (1L<<1) /* Bit 1: (sc) Flush Tx FIFO */
-#define XM_MD_FRF (1L<<0) /* Bit 0: (sc) Flush Rx FIFO */
+#define XM_MD_FTF (1L<<1) /* Bit 1: (sc) Flush Tx FIFO */
+#define XM_MD_FRF (1L<<0) /* Bit 0: (sc) Flush Rx FIFO */
#define XM_PAUSE_MODE (XM_MD_SPOE_E | XM_MD_SPOL_I | XM_MD_SPOH_I)
#define XM_DEF_MODE (XM_MD_RX_RUNT | XM_MD_RX_IRLE | XM_MD_RX_LONG |\
- XM_MD_RX_CRCE | XM_MD_RX_ERR | XM_MD_CSA |\
- XM_MD_CAA)
+ XM_MD_RX_CRCE | XM_MD_RX_ERR | XM_MD_CSA | XM_MD_CAA)
/* XM_STAT_CMD 16 bit r/w Statistics Command Register */
- /* Bit 16..6: reserved */
+ /* Bit 16..6: reserved */
#define XM_SC_SNP_RXC (1<<5) /* Bit 5: (sc) Snap Rx Counters */
#define XM_SC_SNP_TXC (1<<4) /* Bit 4: (sc) Snap Tx Counters */
#define XM_SC_CP_RXC (1<<3) /* Bit 3: Copy Rx Counters Continuously */
@@ -479,28 +482,28 @@
/* XM_RX_EV_MSK 32 bit r/w Rx Counter Event Mask */
#define XMR_MAX_SZ_OV (1UL<<31) /* Bit 31: 1024-MaxSize Rx Cnt Ov*/
#define XMR_1023B_OV (1L<<30) /* Bit 30: 512-1023Byte Rx Cnt Ov*/
-#define XMR_511B_OV (1L<<29) /* Bit 29: 256-511 Byte Rx Cnt Ov*/
-#define XMR_255B_OV (1L<<28) /* Bit 28: 128-255 Byte Rx Cnt Ov*/
-#define XMR_127B_OV (1L<<27) /* Bit 27: 65-127 Byte Rx Cnt Ov */
-#define XMR_64B_OV (1L<<26) /* Bit 26: 64 Byte Rx Cnt Ov */
-#define XMR_UTIL_OV (1L<<25) /* Bit 25: Rx Util Cnt Overflow */
-#define XMR_UTIL_UR (1L<<24) /* Bit 24: Rx Util Cnt Underrun */
+#define XMR_511B_OV (1L<<29) /* Bit 29: 256-511 Byte Rx Cnt Ov*/
+#define XMR_255B_OV (1L<<28) /* Bit 28: 128-255 Byte Rx Cnt Ov*/
+#define XMR_127B_OV (1L<<27) /* Bit 27: 65-127 Byte Rx Cnt Ov */
+#define XMR_64B_OV (1L<<26) /* Bit 26: 64 Byte Rx Cnt Ov */
+#define XMR_UTIL_OV (1L<<25) /* Bit 25: Rx Util Cnt Overflow */
+#define XMR_UTIL_UR (1L<<24) /* Bit 24: Rx Util Cnt Underrun */
#define XMR_CEX_ERR_OV (1L<<23) /* Bit 23: CEXT Err Cnt Ov */
- /* Bit 22: reserved */
+ /* Bit 22: reserved */
#define XMR_FCS_ERR_OV (1L<<21) /* Bit 21: Rx FCS Error Cnt Ov */
#define XMR_LNG_ERR_OV (1L<<20) /* Bit 20: Rx too Long Err Cnt Ov*/
-#define XMR_RUNT_OV (1L<<19) /* Bit 19: Runt Event Cnt Ov */
+#define XMR_RUNT_OV (1L<<19) /* Bit 19: Runt Event Cnt Ov */
#define XMR_SHT_ERR_OV (1L<<18) /* Bit 18: Rx Short Ev Err Cnt Ov*/
#define XMR_SYM_ERR_OV (1L<<17) /* Bit 17: Rx Sym Err Cnt Ov */
- /* Bit 16: reserved */
+ /* Bit 16: reserved */
#define XMR_CAR_ERR_OV (1L<<15) /* Bit 15: Rx Carr Ev Err Cnt Ov */
#define XMR_JAB_PKT_OV (1L<<14) /* Bit 14: Rx Jabb Packet Cnt Ov */
-#define XMR_FIFO_OV (1L<<13) /* Bit 13: Rx FIFO Ov Ev Cnt Ov */
+#define XMR_FIFO_OV (1L<<13) /* Bit 13: Rx FIFO Ov Ev Cnt Ov */
#define XMR_FRA_ERR_OV (1L<<12) /* Bit 12: Rx Framing Err Cnt Ov */
#define XMR_FMISS_OV (1L<<11) /* Bit 11: Rx Missed Ev Cnt Ov */
-#define XMR_BURST (1L<<10) /* Bit 10: Rx Burst Event Cnt Ov */
-#define XMR_INV_MOC (1L<<9) /* Bit 9: Rx with inv. MAC OC Ov*/
-#define XMR_INV_MP (1L<<8) /* Bit 8: Rx inv Pause Frame Ov */
+#define XMR_BURST (1L<<10) /* Bit 10: Rx Burst Event Cnt Ov */
+#define XMR_INV_MOC (1L<<9) /* Bit 9: Rx with inv. MAC OC Ov*/
+#define XMR_INV_MP (1L<<8) /* Bit 8: Rx inv Pause Frame Ov */
#define XMR_MCTRL_OV (1L<<7) /* Bit 7: Rx MAC Ctrl-F Cnt Ov */
#define XMR_MPAUSE_OV (1L<<6) /* Bit 6: Rx Pause MAC Ctrl-F Ov*/
#define XMR_UC_OK_OV (1L<<5) /* Bit 5: Rx Unicast Frame CntOv*/
@@ -508,39 +511,39 @@
#define XMR_BC_OK_OV (1L<<3) /* Bit 3: Rx Broadcast Cnt Ov */
#define XMR_OK_LO_OV (1L<<2) /* Bit 2: Octets Rx OK Low CntOv*/
#define XMR_OK_HI_OV (1L<<1) /* Bit 1: Octets Rx OK Hi Cnt Ov*/
-#define XMR_OK_OV (1L<<0) /* Bit 0: Frames Received Ok Ov */
+#define XMR_OK_OV (1L<<0) /* Bit 0: Frames Received Ok Ov */
#define XMR_DEF_MSK 0x00000006L /* all bits excepting 1 and 2 */
/* XM_TX_CNT_EV 32 bit ro Tx Counter Event Register */
/* XM_TX_EV_MSK 32 bit r/w Tx Counter Event Mask */
- /* Bit 31..26: reserved */
+ /* Bit 31..26: reserved */
#define XMT_MAX_SZ_OV (1L<<25) /* Bit 25: 1024-MaxSize Tx Cnt Ov*/
#define XMT_1023B_OV (1L<<24) /* Bit 24: 512-1023Byte Tx Cnt Ov*/
-#define XMT_511B_OV (1L<<23) /* Bit 23: 256-511 Byte Tx Cnt Ov*/
-#define XMT_255B_OV (1L<<22) /* Bit 22: 128-255 Byte Tx Cnt Ov*/
-#define XMT_127B_OV (1L<<21) /* Bit 21: 65-127 Byte Tx Cnt Ov */
-#define XMT_64B_OV (1L<<20) /* Bit 20: 64 Byte Tx Cnt Ov */
-#define XMT_UTIL_OV (1L<<19) /* Bit 19: Tx Util Cnt Overflow */
-#define XMT_UTIL_UR (1L<<18) /* Bit 18: Tx Util Cnt Underrun */
+#define XMT_511B_OV (1L<<23) /* Bit 23: 256-511 Byte Tx Cnt Ov*/
+#define XMT_255B_OV (1L<<22) /* Bit 22: 128-255 Byte Tx Cnt Ov*/
+#define XMT_127B_OV (1L<<21) /* Bit 21: 65-127 Byte Tx Cnt Ov */
+#define XMT_64B_OV (1L<<20) /* Bit 20: 64 Byte Tx Cnt Ov */
+#define XMT_UTIL_OV (1L<<19) /* Bit 19: Tx Util Cnt Overflow */
+#define XMT_UTIL_UR (1L<<18) /* Bit 18: Tx Util Cnt Underrun */
#define XMT_CS_ERR_OV (1L<<17) /* Bit 17: Tx Carr Sen Err Cnt Ov*/
#define XMT_FIFO_UR_OV (1L<<16) /* Bit 16: Tx FIFO Ur Ev Cnt Ov */
#define XMT_EX_DEF_OV (1L<<15) /* Bit 15: Tx Ex Deferall Cnt Ov */
-#define XMT_DEF (1L<<14) /* Bit 14: Tx Deferred Cnt Ov */
+#define XMT_DEF (1L<<14) /* Bit 14: Tx Deferred Cnt Ov */
#define XMT_LAT_COL_OV (1L<<13) /* Bit 13: Tx Late Col Cnt Ov */
#define XMT_ABO_COL_OV (1L<<12) /* Bit 12: Tx abo dueto Ex Col Ov*/
#define XMT_MUL_COL_OV (1L<<11) /* Bit 11: Tx Mult Col Cnt Ov */
-#define XMT_SNG_COL (1L<<10) /* Bit 10: Tx Single Col Cnt Ov */
+#define XMT_SNG_COL (1L<<10) /* Bit 10: Tx Single Col Cnt Ov */
#define XMT_MCTRL_OV (1L<<9) /* Bit 9: Tx MAC Ctrl Counter Ov*/
-#define XMT_MPAUSE (1L<<8) /* Bit 8: Tx Pause MAC Ctrl-F Ov*/
-#define XMT_BURST (1L<<7) /* Bit 7: Tx Burst Event Cnt Ov */
-#define XMT_LONG (1L<<6) /* Bit 6: Tx Long Frame Cnt Ov */
+#define XMT_MPAUSE (1L<<8) /* Bit 8: Tx Pause MAC Ctrl-F Ov*/
+#define XMT_BURST (1L<<7) /* Bit 7: Tx Burst Event Cnt Ov */
+#define XMT_LONG (1L<<6) /* Bit 6: Tx Long Frame Cnt Ov */
#define XMT_UC_OK_OV (1L<<5) /* Bit 5: Tx Unicast Cnt Ov */
#define XMT_MC_OK_OV (1L<<4) /* Bit 4: Tx Multicast Cnt Ov */
#define XMT_BC_OK_OV (1L<<3) /* Bit 3: Tx Broadcast Cnt Ov */
#define XMT_OK_LO_OV (1L<<2) /* Bit 2: Octets Tx OK Low CntOv*/
#define XMT_OK_HI_OV (1L<<1) /* Bit 1: Octets Tx OK Hi Cnt Ov*/
-#define XMT_OK_OV (1L<<0) /* Bit 0: Frames Tx Ok Ov */
+#define XMT_OK_OV (1L<<0) /* Bit 0: Frames Tx Ok Ov */
#define XMT_DEF_MSK 0x00000006L /* all bits excepting 1 and 2 */
@@ -550,10 +553,10 @@
#define XMR_FS_LEN (0x3fffUL<<18) /* Bit 31..18: Rx Frame Length */
#define XMR_FS_2L_VLAN (1L<<17) /* Bit 17: tagged wh 2Lev VLAN ID*/
#define XMR_FS_1L_VLAN (1L<<16) /* Bit 16: tagged wh 1Lev VLAN ID*/
-#define XMR_FS_BC (1L<<15) /* Bit 15: Broadcast Frame */
-#define XMR_FS_MC (1L<<14) /* Bit 14: Multicast Frame */
-#define XMR_FS_UC (1L<<13) /* Bit 13: Unicast Frame */
- /* Bit 12: reserved */
+#define XMR_FS_BC (1L<<15) /* Bit 15: Broadcast Frame */
+#define XMR_FS_MC (1L<<14) /* Bit 14: Multicast Frame */
+#define XMR_FS_UC (1L<<13) /* Bit 13: Unicast Frame */
+ /* Bit 12: reserved */
#define XMR_FS_BURST (1L<<11) /* Bit 11: Burst Mode */
#define XMR_FS_CEX_ERR (1L<<10) /* Bit 10: Carrier Ext. Error */
#define XMR_FS_802_3 (1L<<9) /* Bit 9: 802.3 Frame */
@@ -561,10 +564,10 @@
#define XMR_FS_CAR_ERR (1L<<7) /* Bit 7: Carrier Event Error */
#define XMR_FS_LEN_ERR (1L<<6) /* Bit 6: In-Range Length Error */
#define XMR_FS_FRA_ERR (1L<<5) /* Bit 5: Framing Error */
-#define XMR_FS_RUNT (1L<<4) /* Bit 4: Runt Error */
+#define XMR_FS_RUNT (1L<<4) /* Bit 4: Runt Error */
#define XMR_FS_LNG_ERR (1L<<3) /* Bit 3: Gaint Error */
#define XMR_FS_FCS_ERR (1L<<2) /* Bit 2: Frame Check Sequ Err */
-#define XMR_FS_ERR (1L<<1) /* Bit 1: Frame Error */
+#define XMR_FS_ERR (1L<<1) /* Bit 1: Frame Error */
#define XMR_FS_MCTRL (1L<<0) /* Bit 0: MAC Control Packet */
/*
@@ -658,8 +661,8 @@
*/
#define PHY_NAT_CTRL 0x00 /* 16 bit r/w PHY Control Register */
#define PHY_NAT_STAT 0x01 /* 16 bit r/w PHY Status Register */
-#define PHY_NAT_ID0 0x02 /* 16 bit ro PHY ID0 Register */
-#define PHY_NAT_ID1 0x03 /* 16 bit ro PHY ID1 Register */
+#define PHY_NAT_ID0 0x02 /* 16 bit ro PHY ID0 Register */
+#define PHY_NAT_ID1 0x03 /* 16 bit ro PHY ID1 Register */
#define PHY_NAT_AUNE_ADV 0x04 /* 16 bit r/w Autonegotiation Advertisement */
#define PHY_NAT_AUNE_LP 0x05 /* 16 bit ro Link Partner Ability Reg */
#define PHY_NAT_AUNE_EXP 0x06 /* 16 bit ro Autonegotiation Expansion Reg */
@@ -692,16 +695,16 @@
/***** PHY_BCOM_CTRL 16 bit r/w PHY Control Register *****/
/***** PHY_LONE_CTRL 16 bit r/w PHY Control Register *****/
#define PHY_CT_RESET (1<<15) /* Bit 15: (sc) clear all PHY releated regs */
-#define PHY_CT_LOOP (1<<14) /* Bit 14: enable Loopback over PHY */
+#define PHY_CT_LOOP (1<<14) /* Bit 14: enable Loopback over PHY */
#define PHY_CT_SPS_LSB (1<<13) /* Bit 13: (BC,L1) Speed select, lower bit */
-#define PHY_CT_ANE (1<<12) /* Bit 12: Autonegotiation Enabled */
+#define PHY_CT_ANE (1<<12) /* Bit 12: Autonegotiation Enabled */
#define PHY_CT_PDOWN (1<<11) /* Bit 11: (BC,L1) Power Down Mode */
-#define PHY_CT_ISOL (1<<10) /* Bit 10: (BC,L1) Isolate Mode */
+#define PHY_CT_ISOL (1<<10) /* Bit 10: (BC,L1) Isolate Mode */
#define PHY_CT_RE_CFG (1<<9) /* Bit 9: (sc) Restart Autonegotiation */
#define PHY_CT_DUP_MD (1<<8) /* Bit 8: Duplex Mode */
#define PHY_CT_COL_TST (1<<7) /* Bit 7: (BC,L1) Collsion Test enabled */
#define PHY_CT_SPS_MSB (1<<6) /* Bit 6: (BC,L1) Speed select, upper bit */
- /* Bit 5..0: reserved */
+ /* Bit 5..0: reserved */
#define PHY_B_CT_SP1000 (1<<6) /* Bit 6: enable speed of 1000 MBit/s */
#define PHY_B_CT_SP100 (1<<13) /* Bit 13: enable speed of 100 MBit/s */
@@ -715,10 +718,10 @@
/***** PHY_XMAC_STAT 16 bit r/w PHY Status Register *****/
/***** PHY_BCOM_STAT 16 bit r/w PHY Status Register *****/
/***** PHY_LONE_STAT 16 bit r/w PHY Status Register *****/
- /* Bit 15..9: reserved */
+ /* Bit 15..9: reserved */
/* (BC/L1) 100/10 MBit/s cap bits ignored*/
#define PHY_ST_EXT_ST (1<<8) /* Bit 8: Extended Status Present */
- /* Bit 7: reserved */
+ /* Bit 7: reserved */
#define PHY_ST_PRE_SUB (1<<6) /* Bit 6: (BC/L1) preamble suppression */
#define PHY_ST_AN_OVER (1<<5) /* Bit 5: Autonegotiation Over */
#define PHY_ST_REM_FLT (1<<4) /* Bit 4: Remode Fault Condition Occured*/
@@ -731,9 +734,9 @@
/* PHY_XMAC_ID1 16 bit ro PHY ID1 Register */
/* PHY_BCOM_ID1 16 bit ro PHY ID1 Register */
/* PHY_LONE_ID1 16 bit ro PHY ID1 Register */
-#define PHY_I1_OUI (0x3f<<10) /* Bit 15..10: Organiz. Unique ID */
+#define PHY_I1_OUI (0x3f<<10) /* Bit 15..10: Organiz. Unique ID */
#define PHY_I1_MOD_NUM (0x3f<<4) /* Bit 9.. 4: Model Number */
-#define PHY_I1_REV (0x0f<<0) /* Bit 3.. 0: Revision Number */
+#define PHY_I1_REV (0x0f<<0) /* Bit 3.. 0: Revision Number */
/***** PHY_XMAC_AUNE_ADV 16 bit r/w Autoneg Advertisement *****/
@@ -741,43 +744,43 @@
#define PHY_AN_NXT_PG (1<<15) /* Bit 15: Request Next Page */
#define PHY_X_AN_ACK (1<<14) /* Bit 14: (ro) Acknowledge Received */
#define PHY_X_AN_RFB (3<<12) /* Bit 13..12: Remode Fault Bits */
- /* Bit 11.. 9: reserved */
+ /* Bit 11.. 9: reserved */
#define PHY_X_AN_PAUSE (3<<7) /* Bit 8.. 7: Pause Bits */
-#define PHY_X_AN_HD (1<<6) /* Bit 6: Half Duplex */
-#define PHY_X_AN_FD (1<<5) /* Bit 5: Full Duplex */
- /* Bit 4.. 0: reserved */
+#define PHY_X_AN_HD (1<<6) /* Bit 6: Half Duplex */
+#define PHY_X_AN_FD (1<<5) /* Bit 5: Full Duplex */
+ /* Bit 4.. 0: reserved */
/***** PHY_BCOM_AUNE_ADV 16 bit r/w Autoneg Advertisement *****/
/***** PHY_BCOM_AUNE_LP 16 bit ro Link Partner Ability Reg *****/
-/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */
- /* Bit 14: reserved */
-#define PHY_B_AN_RF (1<<13) /* Bit 13: Remote Fault */
- /* Bit 12: reserved */
+/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */
+ /* Bit 14: reserved */
+#define PHY_B_AN_RF (1<<13) /* Bit 13: Remote Fault */
+ /* Bit 12: reserved */
#define PHY_B_AN_ASP (1<<11) /* Bit 11: Asymetric Pause */
-#define PHY_B_AN_PC (1<<10) /* Bit 10: Pause Capable */
- /* Bit 9..5: 100/10 BT cap bits ingnored */
+#define PHY_B_AN_PC (1<<10) /* Bit 10: Pause Capable */
+ /* Bit 9..5: 100/10 BT cap bits ingnored */
#define PHY_B_AN_SEL (0x1f<<0)/* Bit 4..0: Selector Field, 00001=Ethernet*/
/***** PHY_LONE_AUNE_ADV 16 bit r/w Autoneg Advertisement *****/
/***** PHY_LONE_AUNE_LP 16 bit ro Link Partner Ability Reg *****/
-/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */
- /* Bit 14: reserved */
-#define PHY_L_AN_RF (1<<13) /* Bit 13: Remote Fault */
- /* Bit 12: reserved */
+/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */
+ /* Bit 14: reserved */
+#define PHY_L_AN_RF (1<<13) /* Bit 13: Remote Fault */
+ /* Bit 12: reserved */
#define PHY_L_AN_ASP (1<<11) /* Bit 11: Asymetric Pause */
-#define PHY_L_AN_PC (1<<10) /* Bit 10: Pause Capable */
- /* Bit 9..5: 100/10 BT cap bits ingnored */
+#define PHY_L_AN_PC (1<<10) /* Bit 10: Pause Capable */
+ /* Bit 9..5: 100/10 BT cap bits ingnored */
#define PHY_L_AN_SEL (0x1f<<0)/* Bit 4..0: Selector Field, 00001=Ethernet*/
/***** PHY_NAT_AUNE_ADV 16 bit r/w Autoneg Advertisement *****/
/***** PHY_NAT_AUNE_LP 16 bit ro Link Partner Ability Reg *****/
-/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */
- /* Bit 14: reserved */
-#define PHY_N_AN_RF (1<<13) /* Bit 13: Remote Fault */
- /* Bit 12: reserved */
+/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */
+ /* Bit 14: reserved */
+#define PHY_N_AN_RF (1<<13) /* Bit 13: Remote Fault */
+ /* Bit 12: reserved */
#define PHY_N_AN_100F (1<<11) /* Bit 11: 100Base-T2 FD Support */
#define PHY_N_AN_100H (1<<10) /* Bit 10: 100Base-T2 HD Support */
- /* Bit 9..5: 100/10 BT cap bits ingnored */
+ /* Bit 9..5: 100/10 BT cap bits ingnored */
#define PHY_N_AN_SEL (0x1f<<0)/* Bit 4..0: Selector Field, 00001=Ethernet*/
/* field type definition for PHY_x_AN_SEL */
@@ -788,22 +791,22 @@
#define PHY_AN_LP_NP (1<<3) /* Bit 3: Link Partner can Next Page */
#define PHY_AN_LOC_NP (1<<2) /* Bit 2: Local PHY can Next Page */
#define PHY_AN_RX_PG (1<<1) /* Bit 1: Page Received */
- /* Bit 0: reserved */
+ /* Bit 0: reserved */
/***** PHY_BCOM_AUNE_EXP 16 bit ro Autoneg Expansion Reg *****/
- /* Bit 15..5: reserved */
+ /* Bit 15..5: reserved */
#define PHY_B_AN_PDF (1<<4) /* Bit 4: Parallel Detection Fault */
-/* PHY_AN_LP_NP (see XMAC) Bit 3: Link Partner can Next Page */
-/* PHY_AN_LOC_NP (see XMAC) Bit 2: Local PHY can Next Page */
-/* PHY_AN_RX_PG (see XMAC) Bit 1: Page Received */
+/* PHY_AN_LP_NP (see XMAC) Bit 3: Link Partner can Next Page */
+/* PHY_AN_LOC_NP (see XMAC) Bit 2: Local PHY can Next Page */
+/* PHY_AN_RX_PG (see XMAC) Bit 1: Page Received */
#define PHY_B_AN_LP_CAP (1<<0) /* Bit 0: Link Partner Autoneg Cap. */
/***** PHY_LONE_AUNE_EXP 16 bit ro Autoneg Expansion Reg *****/
-#define PHY_L_AN_BP (1<<5) /* Bit 5: Base Page Indication */
+#define PHY_L_AN_BP (1<<5) /* Bit 5: Base Page Indication */
#define PHY_L_AN_PDF (1<<4) /* Bit 4: Parallel Detection Fault */
-/* PHY_AN_LP_NP (see XMAC) Bit 3: Link Partner can Next Page */
-/* PHY_AN_LOC_NP (see XMAC) Bit 2: Local PHY can Next Page */
-/* PHY_AN_RX_PG (see XMAC) Bit 1: Page Received */
+/* PHY_AN_LP_NP (see XMAC) Bit 3: Link Partner can Next Page */
+/* PHY_AN_LOC_NP (see XMAC) Bit 2: Local PHY can Next Page */
+/* PHY_AN_RX_PG (see XMAC) Bit 1: Page Received */
#define PHY_B_AN_LP_CAP (1<<0) /* Bit 0: Link Partner Autoneg Cap. */
@@ -813,35 +816,35 @@
/***** PHY_XMAC_NEPG_LP 16 bit ro Next Page Link Partner *****/
/***** PHY_BCOM_NEPG_LP 16 bit ro Next Page Link Partner *****/
/***** PHY_LONE_NEPG_LP 16 bit ro Next Page Link Partner *****/
-#define PHY_NP_MORE (1<<15) /* Bit 15: More, Next Pages to follow */
-#define PHY_NP_ACK1 (1<<14) /* Bit 14: (ro) Ack 1, for receiving a message*/
+#define PHY_NP_MORE (1<<15) /* Bit 15: More, Next Pages to follow */
+#define PHY_NP_ACK1 (1<<14) /* Bit 14: (ro) Ack 1, for receiving a message*/
#define PHY_NP_MSG_VAL (1<<13) /* Bit 13: Message Page valid */
-#define PHY_NP_ACK2 (1<<12) /* Bit 12: Ack 2, comply with msg content*/
-#define PHY_NP_TOG (1<<11) /* Bit 11: Toggle Bit, ensure sync */
-#define PHY_NP_MSG 0x07ff /* Bit 10..0: Message from/to Link Partner */
+#define PHY_NP_ACK2 (1<<12) /* Bit 12: Ack 2, comply with msg content*/
+#define PHY_NP_TOG (1<<11) /* Bit 11: Toggle Bit, ensure sync */
+#define PHY_NP_MSG 0x07ff /* Bit 10..0: Message from/to Link Partner */
/*
* XMAC-Specific
*/
/***** PHY_XMAC_EXT_STAT 16 bit r/w Extended Status Register *****/
-#define PHY_X_EX_FD (1<<15) /* Bit 15: Device Supports Full Duplex */
-#define PHY_X_EX_HD (1<<14) /* Bit 14: Device Supports Half Duplex */
- /* Bit 13..0: reserved */
+#define PHY_X_EX_FD (1<<15) /* Bit 15: Device Supports Full Duplex */
+#define PHY_X_EX_HD (1<<14) /* Bit 14: Device Supports Half Duplex */
+ /* Bit 13..0: reserved */
/***** PHY_XMAC_RES_ABI 16 bit ro PHY Resolved Ability *****/
- /* Bit 15..9: reserved */
+ /* Bit 15..9: reserved */
#define PHY_X_RS_PAUSE (3<<7) /* Bit 8..7: selected Pause Mode */
-#define PHY_X_RS_HD (1<<6) /* Bit 6: Half Duplex Mode selected */
-#define PHY_X_RS_FD (1<<5) /* Bit 5: Full Duplex Mode selected */
+#define PHY_X_RS_HD (1<<6) /* Bit 6: Half Duplex Mode selected */
+#define PHY_X_RS_FD (1<<5) /* Bit 5: Full Duplex Mode selected */
#define PHY_X_RS_ABLMIS (1<<4) /* Bit 4: duplex or pause cap mismatch */
#define PHY_X_RS_PAUMIS (1<<3) /* Bit 3: pause capability missmatch */
- /* Bit 2..0: reserved */
+ /* Bit 2..0: reserved */
/*
* Remote Fault Bits (PHY_X_AN_RFB) encoding
*/
-#define X_RFB_OK (0<<12) /* Bit 12..13 No errors, Link OK */
-#define X_RFB_LF (1<<12) /* Bit 12..13 Link Failure */
-#define X_RFB_OFF (2<<12) /* Bit 12..13 Offline */
+#define X_RFB_OK (0<<12) /* Bit 12..13 No errors, Link OK */
+#define X_RFB_LF (1<<12) /* Bit 12..13 Link Failure */
+#define X_RFB_OFF (2<<12) /* Bit 12..13 Offline */
#define X_RFB_AN_ERR (3<<12) /* Bit 12..13 Autonegotiation Error */
/*
@@ -863,7 +866,7 @@
#define PHY_B_1000C_RD (1<<10) /* Bit 10: Repeater/DTE */
#define PHY_B_1000C_AFD (1<<9) /* Bit 9: Advertise Full Duplex */
#define PHY_B_1000C_AHD (1<<8) /* Bit 8: Advertise Half Duplex */
- /* Bit 7..0: reserved */
+ /* Bit 7..0: reserved */
/***** PHY_BCOM_1000T_STAT 16 bit ro 1000Base-T Status Reg *****/
#define PHY_B_1000S_MSF (1<<15) /* Bit 15: Master/Slave Fault */
@@ -872,7 +875,7 @@
#define PHY_B_1000S_RRS (1<<12) /* Bit 12: Remote Receiver Status */
#define PHY_B_1000S_LP_FD (1<<11) /* Bit 11: Link Partner can FD */
#define PHY_B_1000S_LP_HD (1<<10) /* Bit 10: Link Partner can HD */
- /* Bit 9..8: reserved */
+ /* Bit 9..8: reserved */
#define PHY_B_1000S_IEC (255<<0)/* Bit 7..0: Idle Error Count */
/***** PHY_BCOM_EXT_STAT 16 bit ro Extended Status Register *****/
@@ -880,7 +883,7 @@
#define PHY_B_ES_X_HD_CAP (1<<14) /* Bit 14: 1000Base-X HD capable */
#define PHY_B_ES_T_FD_CAP (1<<13) /* Bit 13: 1000Base-T FD capable */
#define PHY_B_ES_T_HD_CAP (1<<12) /* Bit 12: 1000Base-T HD capable */
- /* Bit 11..0: reserved */
+ /* Bit 11..0: reserved */
/***** PHY_BCOM_P_EXT_CTRL 16 bit r/w PHY Extended Control Reg *****/
#define PHY_B_PEC_MAC_PHY (1<<15) /* Bit 15: 10BIT/GMI-Interface */
@@ -889,36 +892,36 @@
#define PHY_B_PEC_INT_DIS (1<<12) /* Bit 12: Interrupts Disabled */
#define PHY_B_PEC_F_INT (1<<11) /* Bit 11: Force Interrupt */
#define PHY_B_PEC_BY_45 (1<<10) /* Bit 10: Bypass 4B5B-Decoder */
-#define PHY_B_PEC_BY_SCR (1<<9) /* Bit 9: Bypass Scrambler */
-#define PHY_B_PEC_BY_MLT3 (1<<8) /* Bit 8: Bypass MLT3 Encoder */
-#define PHY_B_PEC_BY_RXA (1<<7) /* Bit 7: Bypass Rx Alignm. */
-#define PHY_B_PEC_RES_SCR (1<<6) /* Bit 6: Reset Scrambler */
-#define PHY_B_PEC_EN_LTR (1<<5) /* Bit 5: Ena LED Traffic Mode */
-#define PHY_B_PEC_LED_ON (1<<4) /* Bit 4: Force LED's on */
-#define PHY_B_PEC_LED_OFF (1<<3) /* Bit 3: Force LED's off */
-#define PHY_B_PEC_EX_IPG (1<<2) /* Bit 2: Extend Tx IPG Mode */
-#define PHY_B_PEC_3_LED (1<<1) /* Bit 1: Three Link LED mode */
-#define PHY_B_PEC_HIGH_LA (1<<0) /* Bit 0: GMII Fifo Elasticy */
+#define PHY_B_PEC_BY_SCR (1<<9) /* Bit 9: Bypass Scrambler */
+#define PHY_B_PEC_BY_MLT3 (1<<8) /* Bit 8: Bypass MLT3 Encoder */
+#define PHY_B_PEC_BY_RXA (1<<7) /* Bit 7: Bypass Rx Alignm. */
+#define PHY_B_PEC_RES_SCR (1<<6) /* Bit 6: Reset Scrambler */
+#define PHY_B_PEC_EN_LTR (1<<5) /* Bit 5: Ena LED Traffic Mode */
+#define PHY_B_PEC_LED_ON (1<<4) /* Bit 4: Force LED's on */
+#define PHY_B_PEC_LED_OFF (1<<3) /* Bit 3: Force LED's off */
+#define PHY_B_PEC_EX_IPG (1<<2) /* Bit 2: Extend Tx IPG Mode */
+#define PHY_B_PEC_3_LED (1<<1) /* Bit 1: Three Link LED mode */
+#define PHY_B_PEC_HIGH_LA (1<<0) /* Bit 0: GMII Fifo Elasticy */
/***** PHY_BCOM_P_EXT_STAT 16 bit ro PHY Extended Status Reg *****/
- /* Bit 15..14: reserved */
+ /* Bit 15..14: reserved */
#define PHY_B_PES_CROSS_STAT (1<<13) /* Bit 13: MDI Crossover Status */
#define PHY_B_PES_INT_STAT (1<<12) /* Bit 12: Interrupt Status */
#define PHY_B_PES_RRS (1<<11) /* Bit 11: Remote Receiver Stat. */
#define PHY_B_PES_LRS (1<<10) /* Bit 10: Local Receiver Stat. */
-#define PHY_B_PES_LOCKED (1<<9) /* Bit 9: Locked */
-#define PHY_B_PES_LS (1<<8) /* Bit 8: Link Status */
-#define PHY_B_PES_RF (1<<7) /* Bit 7: Remote Fault */
-#define PHY_B_PES_CE_ER (1<<6) /* Bit 6: Carrier Ext Error */
-#define PHY_B_PES_BAD_SSD (1<<5) /* Bit 5: Bad SSD */
-#define PHY_B_PES_BAD_ESD (1<<4) /* Bit 4: Bad ESD */
-#define PHY_B_PES_RX_ER (1<<3) /* Bit 3: Receive Error */
-#define PHY_B_PES_TX_ER (1<<2) /* Bit 2: Transmit Error */
-#define PHY_B_PES_LOCK_ER (1<<1) /* Bit 1: Lock Error */
-#define PHY_B_PES_MLT3_ER (1<<0) /* Bit 0: MLT3 code Error */
+#define PHY_B_PES_LOCKED (1<<9) /* Bit 9: Locked */
+#define PHY_B_PES_LS (1<<8) /* Bit 8: Link Status */
+#define PHY_B_PES_RF (1<<7) /* Bit 7: Remote Fault */
+#define PHY_B_PES_CE_ER (1<<6) /* Bit 6: Carrier Ext Error */
+#define PHY_B_PES_BAD_SSD (1<<5) /* Bit 5: Bad SSD */
+#define PHY_B_PES_BAD_ESD (1<<4) /* Bit 4: Bad ESD */
+#define PHY_B_PES_RX_ER (1<<3) /* Bit 3: Receive Error */
+#define PHY_B_PES_TX_ER (1<<2) /* Bit 2: Transmit Error */
+#define PHY_B_PES_LOCK_ER (1<<1) /* Bit 1: Lock Error */
+#define PHY_B_PES_MLT3_ER (1<<0) /* Bit 0: MLT3 code Error */
/***** PHY_BCOM_FC_CTR 16 bit r/w False Carrier Counter *****/
- /* Bit 15..8: reserved */
+ /* Bit 15..8: reserved */
#define PHY_B_FC_CTR (255<<0)/* Bit 7..0: False Carrier Counter */
/***** PHY_BCOM_RNO_CTR 16 bit r/w Receive NOT_OK Counter *****/
@@ -929,13 +932,15 @@
#define PHY_B_AC_L_SQE (1<<15) /* Bit 15: Low Squelch */
#define PHY_B_AC_LONG_PACK (1<<14) /* Bit 14: Rx Long Packets */
#define PHY_B_AC_ER_CTRL (3<<12) /* Bit 13..12: Edgerate Control */
- /* Bit 11: reserved */
+ /* Bit 11: reserved */
#define PHY_B_AC_TX_TST (1<<10) /* Bit 10: tx test bit, always 1 */
- /* Bit 9.. 8: reserved */
+ /* Bit 9.. 8: reserved */
#define PHY_B_AC_DIS_PRF (1<<7) /* Bit 7: dis part resp filter */
- /* Bit 6.. 4: reserved */
+ /* Bit 6: reserved */
+#define PHY_B_AC_DIS_PM (1<<5) /* Bit 5: dis power management */
+ /* Bit 4: reserved */
#define PHY_B_AC_DIAG (1<<3) /* Bit 3: Diagnostic Mode */
- /* Bit 2.. 0: reserved */
+ /* Bit 2.. 0: reserved */
/***** PHY_BCOM_AUX_STAT 16 bit ro Auxiliary Status Reg *****/
#define PHY_B_AS_AN_C (1<<15) /* Bit 15: AutoNeg complete */
@@ -944,37 +949,36 @@
#define PHY_B_AS_ANAB_D (1<<12) /* Bit 12: AN Ability Detect */
#define PHY_B_AS_NPW (1<<11) /* Bit 11: AN Next Page Wait */
#define PHY_B_AS_AN_RES (7<<8) /* Bit 10..8: AN HDC */
-#define PHY_B_AS_PDF (1<<7) /* Bit 7: Parallel Detect. Fault*/
-#define PHY_B_AS_RF (1<<6) /* Bit 6: Remote Fault */
-#define PHY_B_AS_ANP_R (1<<5) /* Bit 5: AN Page Received */
-#define PHY_B_AS_LP_ANAB (1<<4) /* Bit 4: LP AN Ability */
-#define PHY_B_AS_LP_NPAB (1<<3) /* Bit 3: LP Next Page Ability */
-#define PHY_B_AS_LS (1<<2) /* Bit 2: Link Status */
-#define PHY_B_AS_PRR (1<<1) /* Bit 1: Pause Resolution-Rx */
-#define PHY_B_AS_PRT (1<<0) /* Bit 0: Pause Resolution-Tx */
+#define PHY_B_AS_PDF (1<<7) /* Bit 7: Parallel Detect. Fault*/
+#define PHY_B_AS_RF (1<<6) /* Bit 6: Remote Fault */
+#define PHY_B_AS_ANP_R (1<<5) /* Bit 5: AN Page Received */
+#define PHY_B_AS_LP_ANAB (1<<4) /* Bit 4: LP AN Ability */
+#define PHY_B_AS_LP_NPAB (1<<3) /* Bit 3: LP Next Page Ability */
+#define PHY_B_AS_LS (1<<2) /* Bit 2: Link Status */
+#define PHY_B_AS_PRR (1<<1) /* Bit 1: Pause Resolution-Rx */
+#define PHY_B_AS_PRT (1<<0) /* Bit 0: Pause Resolution-Tx */
/***** PHY_BCOM_INT_STAT 16 bit ro Interrupt Status Reg *****/
/***** PHY_BCOM_INT_MASK 16 bit r/w Interrupt Mask Reg *****/
- /* Bit 15: reserved */
+ /* Bit 15: reserved */
#define PHY_B_IS_PSE (1<<14) /* Bit 14: Pair Swap Error */
#define PHY_B_IS_MDXI_SC (1<<13) /* Bit 13: MDIX Status Change */
#define PHY_B_IS_HCT (1<<12) /* Bit 12: counter above 32k */
-#define PHY_B_IS_LCT (1<<11) /* Bit 11: all counter below 128 */
+#define PHY_B_IS_LCT (1<<11) /* Bit 11: counter above 128 */
#define PHY_B_IS_AN_PR (1<<10) /* Bit 10: Page Received */
-#define PHY_B_IS_NO_HDCL (1<<9) /* Bit 9: No HCD Link */
-#define PHY_B_IS_NO_HDC (1<<8) /* Bit 8: No HCD */
-#define PHY_B_IS_NEG_USHDC (1<<7) /* Bit 7: Negotiated Unsup. HCD */
-#define PHY_B_IS_SCR_S_ER (1<<6) /* Bit 6: Scrambler Sync Error */
-#define PHY_B_IS_RRS_CHANGE (1<<5) /* Bit 5: Remote Rx Stat Change */
-#define PHY_B_IS_LRS_CHANGE (1<<4) /* Bit 4: Local Rx Stat Change */
-#define PHY_B_IS_DUP_CHANGE (1<<3) /* Bit 3: Duplex Mode Change */
-#define PHY_B_IS_LSP_CHANGE (1<<2) /* Bit 2: Link Speed Change */
-#define PHY_B_IS_LST_CHANGE (1<<1) /* Bit 1: Link Status Changed */
-#define PHY_B_IS_CRC_ER (1<<0) /* Bit 0: CRC Error */
+#define PHY_B_IS_NO_HDCL (1<<9) /* Bit 9: No HCD Link */
+#define PHY_B_IS_NO_HDC (1<<8) /* Bit 8: No HCD */
+#define PHY_B_IS_NEG_USHDC (1<<7) /* Bit 7: Negotiated Unsup. HCD */
+#define PHY_B_IS_SCR_S_ER (1<<6) /* Bit 6: Scrambler Sync Error */
+#define PHY_B_IS_RRS_CHANGE (1<<5) /* Bit 5: Remote Rx Stat Change */
+#define PHY_B_IS_LRS_CHANGE (1<<4) /* Bit 4: Local Rx Stat Change */
+#define PHY_B_IS_DUP_CHANGE (1<<3) /* Bit 3: Duplex Mode Change */
+#define PHY_B_IS_LSP_CHANGE (1<<2) /* Bit 2: Link Speed Change */
+#define PHY_B_IS_LST_CHANGE (1<<1) /* Bit 1: Link Status Changed */
+#define PHY_B_IS_CRC_ER (1<<0) /* Bit 0: CRC Error */
#define PHY_B_DEF_MSK (~(PHY_B_IS_AN_PR | PHY_B_IS_LST_CHANGE))
-
/*
* Pause Bits (PHY_B_AN_ASP and PHY_B_AN_PC) encoding
*/
@@ -1000,7 +1004,7 @@
#define PHY_L_1000C_RD (1<<10) /* Bit 10: Repeater/DTE */
#define PHY_L_1000C_AFD (1<<9) /* Bit 9: Advertise Full Duplex */
#define PHY_L_1000C_AHD (1<<8) /* Bit 8: Advertise Half Duplex */
- /* Bit 7..0: reserved */
+ /* Bit 7..0: reserved */
/***** PHY_LONE_1000T_STAT 16 bit ro 1000Base-T Status Reg *****/
#define PHY_L_1000S_MSF (1<<15) /* Bit 15: Master/Slave Fault */
@@ -1009,7 +1013,7 @@
#define PHY_L_1000S_RRS (1<<12) /* Bit 12: Remote Receiver Status*/
#define PHY_L_1000S_LP_FD (1<<11) /* Bit 11: Link Partner can FD */
#define PHY_L_1000S_LP_HD (1<<10) /* Bit 10: Link Partner can HD */
- /* Bit 9..8: reserved */
+ /* Bit 9..8: reserved */
#define PHY_B_1000S_IEC (255<<0)/* Bit 7..0: Idle Error Count */
/***** PHY_LONE_EXT_STAT 16 bit ro Extended Status Register *****/
@@ -1017,11 +1021,11 @@
#define PHY_L_ES_X_HD_CAP (1<<14) /* Bit 14: 1000Base-X HD capable */
#define PHY_L_ES_T_FD_CAP (1<<13) /* Bit 13: 1000Base-T FD capable */
#define PHY_L_ES_T_HD_CAP (1<<12) /* Bit 12: 1000Base-T HD capable */
- /* Bit 11..0: reserved */
+ /* Bit 11..0: reserved */
/***** PHY_LONE_PORT_CFG 16 bit r/w Port Configuration Reg *****/
#define PHY_L_PC_REP_MODE (1<<15) /* Bit 15: Repeater Mode */
- /* Bit 14: reserved */
+ /* Bit 14: reserved */
#define PHY_L_PC_TX_DIS (1<<13) /* Bit 13: Tx output Disabled */
#define PHY_L_PC_BY_SCR (1<<12) /* Bit 12: Bypass Scrambler */
#define PHY_L_PC_BY_45 (1<<11) /* Bit 11: Bypass 4B5B-Decoder */
@@ -1044,7 +1048,7 @@
#define PHY_L_QS_COL_STAT (1<<11) /* Bit 11: Collision */
#define PHY_L_QS_L_STAT (1<<10) /* Bit 10: Link is up */
#define PHY_L_QS_DUP_MOD (1<<9) /* Bit 9: Full/Half Duplex */
-#define PHY_L_QS_AN (1<<8) /* Bit 8: AutoNeg is On */
+#define PHY_L_QS_AN (1<<8) /* Bit 8: AutoNeg is On */
#define PHY_L_QS_AN_C (1<<7) /* Bit 7: AN is Complete */
#define PHY_L_QS_LLE (7<<4) /* Bit 6: Line Length Estim. */
#define PHY_L_QS_PAUSE (1<<3) /* Bit 3: LP advertised Pause */
@@ -1054,24 +1058,24 @@
/***** PHY_LONE_INT_ENAB 16 bit r/w Interrupt Enable Reg *****/
/***** PHY_LONE_INT_STAT 16 bit ro Interrupt Status Reg *****/
- /* Bit 15..14: reserved */
+ /* Bit 15..14: reserved */
#define PHY_L_IS_AN_F (1<<13) /* Bit 13: Autoneg fault */
- /* Bit 12: not described */
+ /* Bit 12: not described */
#define PHY_L_IS_CROSS (1<<11) /* Bit 11: Crossover used */
#define PHY_L_IS_POL (1<<10) /* Bit 10: Polarity correct. used*/
-#define PHY_L_IS_SS (1<<9) /* Bit 9: Smart Speed Downgrade*/
+#define PHY_L_IS_SS (1<<9) /* Bit 9: Smart Speed Downgrade*/
#define PHY_L_IS_CFULL (1<<8) /* Bit 8: Counter Full */
#define PHY_L_IS_AN_C (1<<7) /* Bit 7: AutoNeg Complete */
#define PHY_L_IS_SPEED (1<<6) /* Bit 6: Speed Changed */
#define PHY_L_IS_DUP (1<<5) /* Bit 5: Duplex Changed */
-#define PHY_L_IS_LS (1<<4) /* Bit 4: Link Status Changed */
+#define PHY_L_IS_LS (1<<4) /* Bit 4: Link Status Changed */
#define PHY_L_IS_ISOL (1<<3) /* Bit 3: Isolate Occured */
#define PHY_L_IS_MDINT (1<<2) /* Bit 2: (ro) STAT: MII Int Pending */
#define PHY_L_IS_INTEN (1<<1) /* Bit 1: ENAB: Enable IRQs */
#define PHY_L_IS_FORCE (1<<0) /* Bit 0: ENAB: Force Interrupt */
-#define PHY_L_DEF_MSK (PHY_L_IS_LS | PHY_L_IS_ISOL | \
- PHY_L_IS_INTEN) /* int. mask */
+/* int. mask */
+#define PHY_L_DEF_MSK (PHY_L_IS_LS | PHY_L_IS_ISOL | PHY_L_IS_INTEN)
/***** PHY_LONE_LED_CFG 16 bit r/w LED Configuration Reg *****/
#define PHY_L_LC_LEDC (3<<14) /* Bit 15..14: Col/Blink/On/Off */
@@ -1086,12 +1090,12 @@
/***** PHY_LONE_PORT_CTRL 16 bit r/w Port Control Reg *****/
#define PHY_L_PC_TX_TCLK (1<<15) /* Bit 15: Enable TX_TCLK */
- /* Bit 14: reserved */
+ /* Bit 14: reserved */
#define PHY_L_PC_ALT_NP (1<<13) /* Bit 14: Alternate Next Page */
#define PHY_L_PC_GMII_ALT (1<<12) /* Bit 13: Alternate GMII driver */
- /* Bit 11: reserved */
+ /* Bit 11: reserved */
#define PHY_L_PC_TEN_CRS (1<<10) /* Bit 10: Extend CRS*/
- /* Bit 9..0: not described */
+ /* Bit 9..0: not described */
/***** PHY_LONE_CIM 16 bit ro CIM Reg *****/
#define PHY_L_CIM_ISOL (255<<8)/* Bit 15..8: Isolate Count */
@@ -1118,7 +1122,7 @@
#define PHY_N_1000C_AFD (1<<9) /* Bit 9: Advertise Full Duplex */
#define PHY_N_1000C_AHD (1<<8) /* Bit 8: Advertise Half Duplex */
#define PHY_N_1000C_APC (1<<7) /* Bit 7: Asymetric Pause Cap. */
- /* Bit 6..0: reserved */
+ /* Bit 6..0: reserved */
/***** PHY_NAT_1000T_STAT 16 bit ro 1000Base-T Status Reg *****/
#define PHY_N_1000S_MSF (1<<15) /* Bit 15: Master/Slave Fault */
@@ -1128,7 +1132,7 @@
#define PHY_N_1000S_LP_FD (1<<11) /* Bit 11: Link Partner can FD */
#define PHY_N_1000S_LP_HD (1<<10) /* Bit 10: Link Partner can HD */
#define PHY_N_1000C_LP_APC (1<<9) /* Bit 9: LP Asym. Pause Cap. */
- /* Bit 8: reserved */
+ /* Bit 8: reserved */
#define PHY_N_1000S_IEC (255<<0)/* Bit 7..0: Idle Error Count */
/***** PHY_NAT_EXT_STAT 16 bit ro Extended Status Register *****/
@@ -1136,7 +1140,7 @@
#define PHY_N_ES_X_HD_CAP (1<<14) /* Bit 14: 1000Base-X HD capable */
#define PHY_N_ES_T_FD_CAP (1<<13) /* Bit 13: 1000Base-T FD capable */
#define PHY_N_ES_T_HD_CAP (1<<12) /* Bit 12: 1000Base-T HD capable */
- /* Bit 11..0: reserved */
+ /* Bit 11..0: reserved */
/* todo: those are still missing */
/***** PHY_NAT_EXT_CTRL1 16 bit ro Extended Control Reg1 *****/
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/skaddr.c linux.20p6/drivers/net/sk98lin/skaddr.c
--- linux.vanilla/drivers/net/sk98lin/skaddr.c Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/skaddr.c Tue Jun 19 09:46:01 2001
@@ -2,16 +2,15 @@
*
* Name: skaddr.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.34 $
- * Date: $Date: 1999/11/22 13:23:44 $
- * Purpose: Manage Addresses (Multicast and Unicast) and Promiscuous Mode
+ * Version: $Revision: 1.40 $
+ * Date: $Date: 2001/02/14 14:04:59 $
+ * Purpose: Manage Addresses (Multicast and Unicast) and Promiscuous Mode.
*
******************************************************************************/
/******************************************************************************
*
- * (C)Copyright 1998,1999 SysKonnect,
- * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ * (C)Copyright 1998-2001 SysKonnect GmbH.
*
* 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
@@ -27,6 +26,25 @@
* History:
*
* $Log: skaddr.c,v $
+ * Revision 1.40 2001/02/14 14:04:59 rassmann
+ * Editorial changes.
+ *
+ * Revision 1.39 2001/01/30 10:30:04 rassmann
+ * Editorial changes.
+ *
+ * Revision 1.38 2001/01/25 16:26:52 rassmann
+ * Ensured that logical address overrides are done on net's active port.
+ *
+ * Revision 1.37 2001/01/22 13:41:34 rassmann
+ * Supporting two nets on dual-port adapters.
+ *
+ * Revision 1.36 2000/08/07 11:10:39 rassmann
+ * Editorial changes.
+ *
+ * Revision 1.35 2000/05/04 09:38:41 rassmann
+ * Editorial changes.
+ * Corrected multicast address hashing.
+ *
* Revision 1.34 1999/11/22 13:23:44 cgoos
* Changed license header to GPL.
*
@@ -165,13 +183,13 @@
#ifndef lint
static const char SysKonnectFileId[] =
- "@(#) $Id: skaddr.c,v 1.34 1999/11/22 13:23:44 cgoos Exp $ (C) SysKonnect.";
+ "@(#) $Id: skaddr.c,v 1.40 2001/02/14 14:04:59 rassmann Exp $ (C) SysKonnect.";
#endif /* !defined(lint) */
#define __SKADDR_C
#ifdef __cplusplus
-xxxx /* not supported yet - force error */
+#error C++ is not yet supported.
extern "C" {
#endif /* cplusplus */
@@ -180,19 +198,9 @@
/* defines ********************************************************************/
-#define SK_ADDR_CHEAT YES /* Cheat. */
-
-/*
- * G32:
- * POLY equ 04C11DB6h ; CRC polynominal term
- * bit-reversed: 6DB88320
- */
#define CRC32_POLY 0xEDB88320UL /* CRC32-Poly - XMAC: Little Endian */
-#if 0
-#define CRC32_POLY 0x6DB88320UL /* CRC32-Poly - XMAC: Little Endian */
-#endif /* 0 */
-#define HASH_BITS 6 /* #bits in hash */
+#define HASH_BITS 6 /* #bits in hash */
#define SK_MC_BIT 0x01
/* Error numbers and messages. */
@@ -220,13 +228,6 @@
/* functions ******************************************************************/
-#if 0
-void SkAddrDummy(void)
-{
- SkAddrInit(NULL, NULL, 0);
-} /* SkAddrDummy */
-#endif /* 0 */
-
/******************************************************************************
*
* SkAddrInit - initialize data, set state to init
@@ -237,7 +238,7 @@
* ============
*
* This routine clears the multicast tables and resets promiscuous mode.
- * Some entries are reserved for the "logical board address", the
+ * Some entries are reserved for the "logical MAC address", the
* SK-RLMT multicast address, and the BPDU multicast address.
*
*
@@ -264,12 +265,12 @@
int SkAddrInit(
SK_AC *pAC, /* the adapter context */
SK_IOC IoC, /* I/O context */
-int Level) /* initialization level */
+int Level) /* initialization level */
{
- int j;
- SK_U32 i;
- SK_U8 *InAddr;
- SK_U16 *OutAddr;
+ int j;
+ SK_U32 i;
+ SK_U8 *InAddr;
+ SK_U16 *OutAddr;
SK_ADDR_PORT *pAPort;
switch (Level) {
@@ -280,20 +281,15 @@
pAPort = &pAC->Addr.Port[i];
pAPort->PromMode = SK_PROM_MODE_NONE;
- pAPort->FirstExactMatchRlmt =
- SK_ADDR_FIRST_MATCH_RLMT;
- pAPort->FirstExactMatchDrv =
- SK_ADDR_FIRST_MATCH_DRV;
- pAPort->NextExactMatchRlmt =
- SK_ADDR_FIRST_MATCH_RLMT;
- pAPort->NextExactMatchDrv =
- SK_ADDR_FIRST_MATCH_DRV;
+ pAPort->FirstExactMatchRlmt = SK_ADDR_FIRST_MATCH_RLMT;
+ pAPort->FirstExactMatchDrv = SK_ADDR_FIRST_MATCH_DRV;
+ pAPort->NextExactMatchRlmt = SK_ADDR_FIRST_MATCH_RLMT;
+ pAPort->NextExactMatchDrv = SK_ADDR_FIRST_MATCH_DRV;
#if 0
- /* Not here ... */
+ /* Don't do this here ... */
/* Reset Promiscuous mode. */
-
(void)SkAddrPromiscuousChange(
pAC,
IoC,
@@ -315,7 +311,9 @@
break;
case SK_INIT_IO:
- pAC->Addr.ActivePort = pAC->Rlmt.MacActive;
+ for (i = 0; i < SK_MAX_NETS; i++) {
+ pAC->Addr.Net[i].ActivePort = pAC->Rlmt.Net[i].ActivePort;
+ }
#ifdef DEBUG
for (i = 0; i < SK_MAX_MACS; i++) {
@@ -326,28 +324,35 @@
}
#endif /* DEBUG */
- /* Read permanent virtual address from Control Register File. */
-
+ /* Read permanent logical MAC address from Control Register File. */
for (j = 0; j < SK_MAC_ADDR_LEN; j++) {
- InAddr = (SK_U8 *)&pAC->Addr.PermanentMacAddress.a[j];
+ InAddr = (SK_U8 *)&pAC->Addr.Net[0].PermanentMacAddress.a[j];
SK_IN8(IoC, B2_MAC_1 + j, InAddr);
}
- if (!pAC->Addr.CurrentMacAddressSet) {
- /*
- * Set the current virtual MAC address
- * to the permanent one.
- */
-
- pAC->Addr.CurrentMacAddress =
- pAC->Addr.PermanentMacAddress;
- pAC->Addr.CurrentMacAddressSet = SK_TRUE;
+ if (!pAC->Addr.Net[0].CurrentMacAddressSet) {
+ /* Set the current logical MAC address to the permanent one. */
+ pAC->Addr.Net[0].CurrentMacAddress =
+ pAC->Addr.Net[0].PermanentMacAddress;
+ pAC->Addr.Net[0].CurrentMacAddressSet = SK_TRUE;
+ }
+
+ /* Set the current logical MAC address. */
+ pAC->Addr.Port[pAC->Addr.Net[0].ActivePort].Exact[0] =
+ pAC->Addr.Net[0].CurrentMacAddress;
+
+#if SK_MAX_NETS > 1
+ /* Set logical MAC address for net 2 to (log | 3). */
+ if (!pAC->Addr.Net[1].CurrentMacAddressSet) {
+ pAC->Addr.Net[1].PermanentMacAddress =
+ pAC->Addr.Net[0].PermanentMacAddress;
+ pAC->Addr.Net[1].PermanentMacAddress.a[5] |= 3;
+ /* Set the current logical MAC address to the permanent one. */
+ pAC->Addr.Net[1].CurrentMacAddress =
+ pAC->Addr.Net[1].PermanentMacAddress;
+ pAC->Addr.Net[1].CurrentMacAddressSet = SK_TRUE;
}
-
- /* Set the current virtual MAC address. */
-
- pAC->Addr.Port[pAC->Addr.ActivePort].Exact[0] =
- pAC->Addr.CurrentMacAddress;
+#endif /* SK_MAX_NETS > 1 */
#ifdef xDEBUG
SK_DBG_MSG(
@@ -355,27 +360,27 @@
SK_DBGMOD_ADDR,
SK_DBGCAT_INIT,
("Permanent MAC Address: %02X %02X %02X %02X %02X %02X\n",
- pAC->Addr.PermanentMacAddress.a[0],
- pAC->Addr.PermanentMacAddress.a[1],
- pAC->Addr.PermanentMacAddress.a[2],
- pAC->Addr.PermanentMacAddress.a[3],
- pAC->Addr.PermanentMacAddress.a[4],
- pAC->Addr.PermanentMacAddress.a[5]))
+ pAC->Addr.PermanentMacAddress.a[0],
+ pAC->Addr.PermanentMacAddress.a[1],
+ pAC->Addr.PermanentMacAddress.a[2],
+ pAC->Addr.PermanentMacAddress.a[3],
+ pAC->Addr.PermanentMacAddress.a[4],
+ pAC->Addr.PermanentMacAddress.a[5]))
SK_DBG_MSG(
pAC,
SK_DBGMOD_ADDR,
SK_DBGCAT_INIT,
- ("Virtual MAC Address: %02X %02X %02X %02X %02X %02X\n",
- pAC->Addr.CurrentMacAddress.a[0],
- pAC->Addr.CurrentMacAddress.a[1],
- pAC->Addr.CurrentMacAddress.a[2],
- pAC->Addr.CurrentMacAddress.a[3],
- pAC->Addr.CurrentMacAddress.a[4],
- pAC->Addr.CurrentMacAddress.a[5]))
+ ("Logical MAC Address: %02X %02X %02X %02X %02X %02X\n",
+ pAC->Addr.CurrentMacAddress.a[0],
+ pAC->Addr.CurrentMacAddress.a[1],
+ pAC->Addr.CurrentMacAddress.a[2],
+ pAC->Addr.CurrentMacAddress.a[3],
+ pAC->Addr.CurrentMacAddress.a[4],
+ pAC->Addr.CurrentMacAddress.a[5]))
#endif /* DEBUG */
#if 0
- /* Not here ... */
+ /* Don't do this here ... */
(void)SkAddrMcUpdate(pAC, IoC, pAC->Addr.ActivePort);
#endif /* 0 */
@@ -383,33 +388,23 @@
for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) {
pAPort = &pAC->Addr.Port[i];
- /*
- * Read permanent port addresses from
- * Control Register File.
- */
-
+ /* Read permanent port addresses from Control Register File. */
for (j = 0; j < SK_MAC_ADDR_LEN; j++) {
- InAddr = (SK_U8 *)
- &pAPort->PermanentMacAddress.a[j];
+ InAddr = (SK_U8 *)&pAPort->PermanentMacAddress.a[j];
SK_IN8(IoC, B2_MAC_2 + 8 * i + j, InAddr);
}
if (!pAPort->CurrentMacAddressSet) {
/*
- * Set the current and previous physical
- * MAC address of this port to its permanent
- * MAC address.
+ * Set the current and previous physical MAC address
+ * of this port to its permanent MAC address.
*/
-
- pAPort->CurrentMacAddress =
- pAPort->PermanentMacAddress;
- pAPort->PreviousMacAddress =
- pAPort->PermanentMacAddress;
+ pAPort->CurrentMacAddress = pAPort->PermanentMacAddress;
+ pAPort->PreviousMacAddress = pAPort->PermanentMacAddress;
pAPort->CurrentMacAddressSet = SK_TRUE;
}
/* Set port's current MAC addresses. */
-
OutAddr = (SK_U16 *)&pAPort->CurrentMacAddress.a[0];
XM_OUTADDR(IoC, i, XM_SA, OutAddr);
@@ -484,45 +479,42 @@
int SkAddrMcClear(
SK_AC *pAC, /* adapter context */
SK_IOC IoC, /* I/O context */
-SK_U32 PortIdx, /* Index of affected port */
-int Flags) /* permanent/non-perm, sw-only */
+SK_U32 PortNumber, /* Index of affected port */
+int Flags) /* permanent/non-perm, sw-only */
{
int i;
- if (PortIdx >= (SK_U32)pAC->GIni.GIMacsFound) {
+ if (PortNumber >= (SK_U32)pAC->GIni.GIMacsFound) {
return (SK_ADDR_ILLEGAL_PORT);
}
if (Flags & SK_ADDR_PERMANENT) {
/* Clear RLMT multicast addresses. */
-
- pAC->Addr.Port[PortIdx].NextExactMatchRlmt =
- SK_ADDR_FIRST_MATCH_RLMT;
+ pAC->Addr.Port[PortNumber].NextExactMatchRlmt = SK_ADDR_FIRST_MATCH_RLMT;
}
else { /* not permanent => DRV */
/* Clear InexactFilter. */
for (i = 0; i < 8; i++) {
- pAC->Addr.Port[PortIdx].InexactFilter.Bytes[i] = 0;
+ pAC->Addr.Port[PortNumber].InexactFilter.Bytes[i] = 0;
}
/* Clear DRV multicast addresses. */
- pAC->Addr.Port[PortIdx].NextExactMatchDrv =
- SK_ADDR_FIRST_MATCH_DRV;
+ pAC->Addr.Port[PortNumber].NextExactMatchDrv = SK_ADDR_FIRST_MATCH_DRV;
}
if (!(Flags & SK_MC_SW_ONLY)) {
- (void)SkAddrMcUpdate(pAC, IoC, PortIdx);
+ (void)SkAddrMcUpdate(pAC, IoC, PortNumber);
}
return (SK_ADDR_SUCCESS);
} /* SkAddrMcClear */
#ifndef SK_ADDR_CHEAT
-// RA;:;:
+
/******************************************************************************
*
* SkCrc32McHash - hash multicast address
@@ -549,15 +541,13 @@
Crc = 0xFFFFFFFFUL;
for (Idx = 0; Idx < SK_MAC_ADDR_LEN; Idx++) {
- Data = *pMc++;
+ Data = *pMc++;
for (Bit = 0; Bit < 8; Bit++, Data >>= 1) {
- Crc = (Crc >> 1) ^
- (((Crc ^ Data) & 1) ? CRC32_POLY : 0);
+ Crc = (Crc >> 1) ^ (((Crc ^ Data) & 1) ? CRC32_POLY : 0);
}
}
return (Crc & ((1 << HASH_BITS) - 1));
-
} /* SkCrc32McHash */
#endif /* not SK_ADDR_CHEAT */
@@ -592,9 +582,9 @@
int SkAddrMcAdd(
SK_AC *pAC, /* adapter context */
SK_IOC IoC, /* I/O context */
-SK_U32 PortIdx, /* Port Index */
+SK_U32 PortNumber, /* Port Number */
SK_MAC_ADDR *pMc, /* multicast address to be added */
-int Flags) /* permanent/non-permanent */
+int Flags) /* permanent/non-permanent */
{
int i;
SK_U8 Inexact;
@@ -602,98 +592,87 @@
unsigned HashBit;
#endif /* !defined(SK_ADDR_CHEAT) */
- if (PortIdx >= (SK_U32)pAC->GIni.GIMacsFound) {
+ if (PortNumber >= (SK_U32)pAC->GIni.GIMacsFound) {
return (SK_ADDR_ILLEGAL_PORT);
}
if (Flags & SK_ADDR_PERMANENT) {
#ifdef DEBUG
- if (pAC->Addr.Port[PortIdx].NextExactMatchRlmt <
+ if (pAC->Addr.Port[PortNumber].NextExactMatchRlmt <
SK_ADDR_FIRST_MATCH_RLMT) {
- Next0[PortIdx] |= 1;
+ Next0[PortNumber] |= 1;
return (SK_MC_RLMT_OVERFLOW);
}
#endif /* DEBUG */
- if (pAC->Addr.Port[PortIdx].NextExactMatchRlmt >
+ if (pAC->Addr.Port[PortNumber].NextExactMatchRlmt >
SK_ADDR_LAST_MATCH_RLMT) {
return (SK_MC_RLMT_OVERFLOW);
}
/* Set an RLMT multicast address. */
- pAC->Addr.Port[PortIdx].Exact[
- pAC->Addr.Port[PortIdx].NextExactMatchRlmt++] = *pMc;
+ pAC->Addr.Port[PortNumber].Exact[
+ pAC->Addr.Port[PortNumber].NextExactMatchRlmt++] = *pMc;
return (SK_MC_FILTERING_EXACT);
}
+#if 0
/* Not PERMANENT => DRV */
-
- if (PortIdx != pAC->Addr.ActivePort) {
-
+ if (PortNumber != pAC->Addr.ActivePort) {
/* Only RLMT is allowed to do this. */
-
return (SK_MC_ILLEGAL_PORT);
}
+#endif /* 0 */
#ifdef DEBUG
- if (pAC->Addr.Port[PortIdx].NextExactMatchDrv <
+ if (pAC->Addr.Port[PortNumber].NextExactMatchDrv <
SK_ADDR_FIRST_MATCH_DRV) {
- Next0[PortIdx] |= 2;
+ Next0[PortNumber] |= 2;
return (SK_MC_RLMT_OVERFLOW);
}
#endif /* DEBUG */
- if (pAC->Addr.Port[PortIdx].NextExactMatchDrv <= SK_ADDR_LAST_MATCH_DRV) {
+ if (pAC->Addr.Port[PortNumber].NextExactMatchDrv <= SK_ADDR_LAST_MATCH_DRV) {
/* Set exact match entry. */
-
- pAC->Addr.Port[PortIdx].Exact[
- pAC->Addr.Port[PortIdx].NextExactMatchDrv++] = *pMc;
+ pAC->Addr.Port[PortNumber].Exact[
+ pAC->Addr.Port[PortNumber].NextExactMatchDrv++] = *pMc;
/* Clear InexactFilter. */
-
for (i = 0; i < 8; i++) {
- pAC->Addr.Port[PortIdx
- ].InexactFilter.Bytes[i] = 0;
+ pAC->Addr.Port[PortNumber].InexactFilter.Bytes[i] = 0;
}
}
else {
if (!(pMc->a[0] & SK_MC_BIT)) {
-
/*
* Hashing only possible with
* multicast addresses.
*/
-
return (SK_MC_ILLEGAL_ADDRESS);
}
#ifndef SK_ADDR_CHEAT
/* Compute hash value of address. */
-RA;:;: untested
- HashBit = SkCrc32McHash(&pMc->a[0]);
+ HashBit = 63 - SkCrc32McHash(&pMc->a[0]);
/* Add bit to InexactFilter. */
-
- pAC->Addr.Port[PortIdx].InexactFilter.Bytes[HashBit / 8] |=
+ pAC->Addr.Port[PortNumber].InexactFilter.Bytes[HashBit / 8] |=
1 << (HashBit % 8);
-
#else /* SK_ADDR_CHEAT */
-
/* Set all bits in InexactFilter. */
-
for (i = 0; i < 8; i++) {
- pAC->Addr.Port[PortIdx].InexactFilter.Bytes[i] = 0xFF;
+ pAC->Addr.Port[PortNumber].InexactFilter.Bytes[i] = 0xFF;
}
#endif /* SK_ADDR_CHEAT */
}
for (Inexact = 0, i = 0; i < 8; i++) {
- Inexact |= pAC->Addr.Port[PortIdx].InexactFilter.Bytes[i];
+ Inexact |= pAC->Addr.Port[PortNumber].InexactFilter.Bytes[i];
}
- if (Inexact == 0 && pAC->Addr.Port[PortIdx].PromMode == 0) {
+ if (Inexact == 0 && pAC->Addr.Port[PortNumber].PromMode == 0) {
return (SK_MC_FILTERING_EXACT);
}
else {
@@ -726,15 +705,15 @@
int SkAddrMcUpdate(
SK_AC *pAC, /* adapter context */
SK_IOC IoC, /* I/O context */
-SK_U32 PortIdx) /* Port Index */
+SK_U32 PortNumber) /* Port Number */
{
- SK_U32 i;
- SK_U8 Inexact;
- SK_U16 *OutAddr;
- SK_U16 LoMode; /* Lower 16 bits of XMAC Mode Reg. */
+ SK_U32 i;
+ SK_U8 Inexact;
+ SK_U16 *OutAddr;
+ SK_U16 LoMode; /* Lower 16 bits of XMAC Mode Reg. */
SK_ADDR_PORT *pAPort;
- if (PortIdx >= (SK_U32)pAC->GIni.GIMacsFound) {
+ if (PortNumber >= (SK_U32)pAC->GIni.GIMacsFound) {
return (SK_ADDR_ILLEGAL_PORT);
}
@@ -742,129 +721,102 @@
pAC,
SK_DBGMOD_ADDR,
SK_DBGCAT_CTRL,
- ("SkAddrMcUpdate on Port %u.\n", PortIdx))
+ ("SkAddrMcUpdate on Port %u.\n", PortNumber))
- pAPort = &pAC->Addr.Port[PortIdx];
+ pAPort = &pAC->Addr.Port[PortNumber];
#ifdef DEBUG
SK_DBG_MSG(
pAC,
SK_DBGMOD_ADDR,
SK_DBGCAT_CTRL,
- ("Next0 on Port %d: %d\n", PortIdx, Next0[PortIdx]))
+ ("Next0 on Port %d: %d\n", PortNumber, Next0[PortNumber]))
#endif /* DEBUG */
- for (i = 0; /* Also program the virtual address. */
- i < pAPort->NextExactMatchRlmt;
- i++) {
-
+ /* Start with 0 to also program the logical MAC address. */
+ for (i = 0; i < pAPort->NextExactMatchRlmt; i++) {
/* Set exact match address i on HW. */
-
OutAddr = (SK_U16 *)&pAPort->Exact[i].a[0];
- XM_OUTADDR(IoC, PortIdx, XM_EXM(i), OutAddr);
+ XM_OUTADDR(IoC, PortNumber, XM_EXM(i), OutAddr);
}
/* Clear other permanent exact match addresses on HW. */
-
if (pAPort->NextExactMatchRlmt <= SK_ADDR_LAST_MATCH_RLMT) {
SkXmClrExactAddr(
pAC,
IoC,
- PortIdx,
+ PortNumber,
pAPort->NextExactMatchRlmt,
SK_ADDR_LAST_MATCH_RLMT);
}
- for (i = pAPort->FirstExactMatchDrv;
- i < pAPort->NextExactMatchDrv;
- i++) {
-
+ for (i = pAPort->FirstExactMatchDrv; i < pAPort->NextExactMatchDrv; i++) {
OutAddr = (SK_U16 *)&pAPort->Exact[i].a[0];
- XM_OUTADDR(IoC, PortIdx, XM_EXM(i), OutAddr);
-
+ XM_OUTADDR(IoC, PortNumber, XM_EXM(i), OutAddr);
}
/* Clear other non-permanent exact match addresses on HW. */
-
if (pAPort->NextExactMatchDrv <= SK_ADDR_LAST_MATCH_DRV) {
SkXmClrExactAddr(
pAC,
IoC,
- PortIdx,
+ PortNumber,
pAPort->NextExactMatchDrv,
SK_ADDR_LAST_MATCH_DRV);
}
- for (Inexact = 0xFF, i = 0; i < 8; i++) {
- Inexact &= pAPort->InexactFilter.Bytes[i];
+ for (Inexact = 0, i = 0; i < 8; i++) {
+ Inexact |= pAPort->InexactFilter.Bytes[i];
}
- if (pAPort->PromMode & SK_PROM_MODE_ALL_MC) {
+ if (pAPort->PromMode & SK_PROM_MODE_ALL_MC) {
/* Set all bits in 64-bit hash register. */
-
- XM_OUTHASH(IoC, PortIdx, XM_HSM, &OnesHash);
+ XM_OUTHASH(IoC, PortNumber, XM_HSM, &OnesHash);
/* Set bit 15 in mode register. */
-
- XM_IN16(IoC, PortIdx, XM_MODE, &LoMode);
+ XM_IN16(IoC, PortNumber, XM_MODE, &LoMode);
LoMode |= XM_MD_ENA_HSH;
- XM_OUT16(IoC, PortIdx, XM_MODE, LoMode);
+ XM_OUT16(IoC, PortNumber, XM_MODE, LoMode);
}
- else if (Inexact != 0xFF) {
-
- /* Clear bit 15 in mode register. */
-
- XM_IN16(IoC, PortIdx, XM_MODE, &LoMode);
- LoMode &= ~XM_MD_ENA_HSH;
- XM_OUT16(IoC, PortIdx, XM_MODE, LoMode);
- }
- else {
+ else if (Inexact != 0) {
/* Set 64-bit hash register to InexactFilter. */
-
- XM_OUTHASH(
- IoC,
- PortIdx,
- XM_HSM,
- &pAPort->InexactFilter.Bytes[0]);
+ XM_OUTHASH(IoC, PortNumber, XM_HSM, &pAPort->InexactFilter.Bytes[0]);
/* Set bit 15 in mode register. */
-
- XM_IN16(IoC, PortIdx, XM_MODE, &LoMode);
+ XM_IN16(IoC, PortNumber, XM_MODE, &LoMode);
LoMode |= XM_MD_ENA_HSH;
- XM_OUT16(IoC, PortIdx, XM_MODE, LoMode);
+ XM_OUT16(IoC, PortNumber, XM_MODE, LoMode);
+ }
+ else {
+ /* Clear bit 15 in mode register. */
+ XM_IN16(IoC, PortNumber, XM_MODE, &LoMode);
+ LoMode &= ~XM_MD_ENA_HSH;
+ XM_OUT16(IoC, PortNumber, XM_MODE, LoMode);
}
if (pAPort->PromMode != SK_PROM_MODE_NONE) {
- (void)SkAddrPromiscuousChange(
- pAC,
- IoC,
- PortIdx,
- pAPort->PromMode);
+ (void)SkAddrPromiscuousChange(pAC, IoC, PortNumber, pAPort->PromMode);
}
/* Set port's current MAC address. */
-
OutAddr = (SK_U16 *)&pAPort->CurrentMacAddress.a[0];
- XM_OUTADDR(IoC, PortIdx, XM_SA, OutAddr);
+ XM_OUTADDR(IoC, PortNumber, XM_SA, OutAddr);
-#ifdef DEBUG
- for (i = 0; /* Also program the virtual address. */
- i < pAPort->NextExactMatchRlmt;
- i++) {
+#ifdef xDEBUG
+ for (i = 0; i < pAPort->NextExactMatchRlmt; i++) {
SK_U8 InAddr8[6];
SK_U16 *InAddr;
- /* Get exact match address i from port PortIdx. */
-
+ /* Get exact match address i from port PortNumber. */
InAddr = (SK_U16 *)&InAddr8[0];
- XM_INADDR(IoC, PortIdx, XM_EXM(i), InAddr);
+ XM_INADDR(IoC, PortNumber, XM_EXM(i), InAddr);
SK_DBG_MSG(
pAC,
- SK_DBGMOD_RLMT,
+ SK_DBGMOD_ADDR,
SK_DBGCAT_CTRL,
("MC address %d on Port %u: %02x %02x %02x %02x %02x %02x -- %02x %02x %02x %02x %02x %02x.\n",
i,
- PortIdx,
+ PortNumber,
InAddr8[0],
InAddr8[1],
InAddr8[2],
@@ -881,10 +833,6 @@
#endif /* DEBUG */
/* Determine return value. */
-
- for (Inexact = 0, i = 0; i < 8; i++) {
- Inexact |= pAPort->InexactFilter.Bytes[i];
- }
if (Inexact == 0 && pAPort->PromMode == 0) {
return (SK_MC_FILTERING_EXACT);
}
@@ -914,52 +862,70 @@
int SkAddrOverride(
SK_AC *pAC, /* adapter context */
SK_IOC IoC, /* I/O context */
-SK_U32 PortIdx, /* Port Index */
+SK_U32 PortNumber, /* Port Number */
SK_MAC_ADDR *pNewAddr, /* new MAC address */
-int Flags) /* logical/physical address */
+int Flags) /* logical/physical MAC address */
{
+ SK_EVPARA Para;
+ SK_U32 NetNumber;
SK_U32 i;
SK_U16 *OutAddr;
- SK_EVPARA Para;
-#if 0
- SK_MAC_ADDR NewAddr; /* new MAC address */
- SK_U8 AddrBits;
-#endif /* 0 */
- if (PortIdx >= (SK_U32)pAC->GIni.GIMacsFound) {
+ NetNumber = pAC->Rlmt.Port[PortNumber].Net->NetNumber;
+
+ if (PortNumber >= (SK_U32)pAC->GIni.GIMacsFound) {
return (SK_ADDR_ILLEGAL_PORT);
}
- if (pNewAddr->a[0] & SK_MC_BIT) {
+ if (pNewAddr != NULL && (pNewAddr->a[0] & SK_MC_BIT) != 0) {
return (SK_ADDR_MULTICAST_ADDRESS);
}
-#if 0
-DANGEROUS!
- if (Flags & SK_ADDR_PHYSICAL_ADDRESS) { /* Physical address. */
- if (!pAC->Addr.Port[PortIdx].CurrentMacAddressSet) {
- pAC->Addr.Port[PortIdx].PreviousMacAddress = *pNewAddr;
- pAC->Addr.Port[PortIdx].CurrentMacAddress = *pNewAddr;
- pAC->Addr.Port[PortIdx].CurrentMacAddressSet = SK_TRUE;
- return (SK_ADDR_SUCCESS);
- }
+ if (!pAC->Addr.Net[NetNumber].CurrentMacAddressSet) {
+ return (SK_ADDR_TOO_EARLY);
}
- else {
- if (!pAC->Addr.CurrentMacAddressSet) {
- pAC->Addr.CurrentMacAddress = *pNewAddr;
- pAC->Addr.CurrentMacAddressSet = SK_TRUE;
- return (SK_ADDR_SUCCESS);
+
+ if (Flags & SK_ADDR_SET_LOGICAL) { /* Activate logical MAC address. */
+ /* Parameter *pNewAddr is ignored. */
+ for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) {
+ if (!pAC->Addr.Port[i].CurrentMacAddressSet) {
+ return (SK_ADDR_TOO_EARLY);
+ }
}
- }
-DANGEROUS!
-#endif /* 0 */
- if (!pAC->Addr.CurrentMacAddressSet) {
- return (SK_ADDR_TOO_EARLY);
+ /* Set PortNumber to number of net's active port. */
+ PortNumber = pAC->Rlmt.Net[NetNumber].
+ Port[pAC->Addr.Net[NetNumber].ActivePort]->PortNumber;
+
+ pAC->Addr.Port[PortNumber].Exact[0] =
+ pAC->Addr.Net[NetNumber].CurrentMacAddress;
+
+ /* Write address to first exact match entry of active port. */
+ (void)SkAddrMcUpdate(pAC, IoC, PortNumber);
}
+ else if (Flags & SK_ADDR_CLEAR_LOGICAL) {
+ /* Deactivate logical MAC address. */
+ /* Parameter *pNewAddr is ignored. */
+ for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) {
+ if (!pAC->Addr.Port[i].CurrentMacAddressSet) {
+ return (SK_ADDR_TOO_EARLY);
+ }
+ }
- if (Flags & SK_ADDR_PHYSICAL_ADDRESS) { /* Physical address. */
- if (SK_ADDR_EQUAL(pNewAddr->a, pAC->Addr.CurrentMacAddress.a)) {
+ /* Set PortNumber to number of net's active port. */
+ PortNumber = pAC->Rlmt.Net[NetNumber].
+ Port[pAC->Addr.Net[NetNumber].ActivePort]->PortNumber;
+
+ for (i = 0; i < SK_MAC_ADDR_LEN; i++ ) {
+ pAC->Addr.Port[PortNumber].Exact[0].a[i] = 0;
+ }
+
+ /* Write address to first exact match entry of active port. */
+ (void)SkAddrMcUpdate(pAC, IoC, PortNumber);
+ }
+ else if (Flags & SK_ADDR_PHYSICAL_ADDRESS) { /* Physical MAC address. */
+ if (SK_ADDR_EQUAL(pNewAddr->a,
+ pAC->Addr.Net[NetNumber].CurrentMacAddress.a)) {
return (SK_ADDR_DUPLICATE_ADDRESS);
}
@@ -968,10 +934,9 @@
return (SK_ADDR_TOO_EARLY);
}
- if (SK_ADDR_EQUAL(
- pNewAddr->a,
+ if (SK_ADDR_EQUAL(pNewAddr->a,
pAC->Addr.Port[i].CurrentMacAddress.a)) {
- if (i == PortIdx) {
+ if (i == PortNumber) {
return (SK_ADDR_SUCCESS);
}
else {
@@ -980,22 +945,22 @@
}
}
- pAC->Addr.Port[PortIdx].PreviousMacAddress =
- pAC->Addr.Port[PortIdx].CurrentMacAddress;
- pAC->Addr.Port[PortIdx].CurrentMacAddress = *pNewAddr;
+ pAC->Addr.Port[PortNumber].PreviousMacAddress =
+ pAC->Addr.Port[PortNumber].CurrentMacAddress;
+ pAC->Addr.Port[PortNumber].CurrentMacAddress = *pNewAddr;
/* Change port's address. */
-
OutAddr = (SK_U16 *)pNewAddr;
- XM_OUTADDR(IoC, PortIdx, XM_SA, OutAddr);
+ XM_OUTADDR(IoC, PortNumber, XM_SA, OutAddr);
/* Report address change to RLMT. */
-
- Para.Para32[0] = PortIdx;
+ Para.Para32[0] = PortNumber;
+ Para.Para32[0] = -1;
SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_PORT_ADDR, Para);
}
- else { /* Logical Address. */
- if (SK_ADDR_EQUAL(pNewAddr->a, pAC->Addr.CurrentMacAddress.a)) {
+ else { /* Logical MAC address. */
+ if (SK_ADDR_EQUAL(pNewAddr->a,
+ pAC->Addr.Net[NetNumber].CurrentMacAddress.a)) {
return (SK_ADDR_SUCCESS);
}
@@ -1004,15 +969,18 @@
return (SK_ADDR_TOO_EARLY);
}
- if (SK_ADDR_EQUAL(
- pNewAddr->a,
+ if (SK_ADDR_EQUAL(pNewAddr->a,
pAC->Addr.Port[i].CurrentMacAddress.a)) {
return (SK_ADDR_DUPLICATE_ADDRESS);
}
}
- pAC->Addr.CurrentMacAddress = *pNewAddr;
- pAC->Addr.Port[PortIdx].Exact[0] = *pNewAddr;
+ /* Set PortNumber to number of net's active port. */
+ PortNumber = pAC->Rlmt.Net[NetNumber].
+ Port[pAC->Addr.Net[NetNumber].ActivePort]->PortNumber;
+
+ pAC->Addr.Net[NetNumber].CurrentMacAddress = *pNewAddr;
+ pAC->Addr.Port[PortNumber].Exact[0] = *pNewAddr;
#ifdef DEBUG
SK_DBG_MSG(
@@ -1020,28 +988,27 @@
SK_DBGMOD_ADDR,
SK_DBGCAT_CTRL,
("Permanent MAC Address: %02X %02X %02X %02X %02X %02X\n",
- pAC->Addr.PermanentMacAddress.a[0],
- pAC->Addr.PermanentMacAddress.a[1],
- pAC->Addr.PermanentMacAddress.a[2],
- pAC->Addr.PermanentMacAddress.a[3],
- pAC->Addr.PermanentMacAddress.a[4],
- pAC->Addr.PermanentMacAddress.a[5]))
+ pAC->Addr.Net[NetNumber].PermanentMacAddress.a[0],
+ pAC->Addr.Net[NetNumber].PermanentMacAddress.a[1],
+ pAC->Addr.Net[NetNumber].PermanentMacAddress.a[2],
+ pAC->Addr.Net[NetNumber].PermanentMacAddress.a[3],
+ pAC->Addr.Net[NetNumber].PermanentMacAddress.a[4],
+ pAC->Addr.Net[NetNumber].PermanentMacAddress.a[5]))
SK_DBG_MSG(
pAC,
SK_DBGMOD_ADDR,
SK_DBGCAT_CTRL,
- ("New Virtual MAC Address: %02X %02X %02X %02X %02X %02X\n",
- pAC->Addr.CurrentMacAddress.a[0],
- pAC->Addr.CurrentMacAddress.a[1],
- pAC->Addr.CurrentMacAddress.a[2],
- pAC->Addr.CurrentMacAddress.a[3],
- pAC->Addr.CurrentMacAddress.a[4],
- pAC->Addr.CurrentMacAddress.a[5]))
+ ("New logical MAC Address: %02X %02X %02X %02X %02X %02X\n",
+ pAC->Addr.Net[NetNumber].CurrentMacAddress.a[0],
+ pAC->Addr.Net[NetNumber].CurrentMacAddress.a[1],
+ pAC->Addr.Net[NetNumber].CurrentMacAddress.a[2],
+ pAC->Addr.Net[NetNumber].CurrentMacAddress.a[3],
+ pAC->Addr.Net[NetNumber].CurrentMacAddress.a[4],
+ pAC->Addr.Net[NetNumber].CurrentMacAddress.a[5]))
#endif /* DEBUG */
/* Write address to first exact match entry of active port. */
-
- (void)SkAddrMcUpdate(pAC, IoC, PortIdx);
+ (void)SkAddrMcUpdate(pAC, IoC, PortNumber);
}
return (SK_ADDR_SUCCESS);
@@ -1067,48 +1034,44 @@
* SK_ADDR_ILLEGAL_PORT
*/
int SkAddrPromiscuousChange(
-SK_AC *pAC, /* adapter context */
-SK_IOC IoC, /* I/O context */
-SK_U32 PortIdx, /* port whose promiscuous mode changes */
-int NewPromMode) /* new promiscuous mode */
+SK_AC *pAC, /* adapter context */
+SK_IOC IoC, /* I/O context */
+SK_U32 PortNumber, /* port whose promiscuous mode changes */
+int NewPromMode) /* new promiscuous mode */
{
- int i;
+ int i;
SK_BOOL InexactModeBit;
SK_U8 Inexact;
SK_U8 HwInexact;
SK_FILTER64 HwInexactFilter;
SK_U16 LoMode; /* Lower 16 bits of XMAC Mode Register. */
- int CurPromMode = SK_PROM_MODE_NONE;
+ int CurPromMode = SK_PROM_MODE_NONE;
- if (PortIdx >= (SK_U32)pAC->GIni.GIMacsFound) {
+ if (PortNumber >= (SK_U32)pAC->GIni.GIMacsFound) {
return (SK_ADDR_ILLEGAL_PORT);
}
/* Read CurPromMode from Hardware. */
-
- XM_IN16(IoC, PortIdx, XM_MODE, &LoMode);
+ XM_IN16(IoC, PortNumber, XM_MODE, &LoMode);
if (LoMode & XM_MD_ENA_PROM) {
CurPromMode |= SK_PROM_MODE_LLC;
}
for (Inexact = 0xFF, i = 0; i < 8; i++) {
- Inexact &= pAC->Addr.Port[PortIdx].InexactFilter.Bytes[i];
+ Inexact &= pAC->Addr.Port[PortNumber].InexactFilter.Bytes[i];
}
if (Inexact == 0xFF) {
- CurPromMode |= (pAC->Addr.Port[PortIdx].PromMode &
- SK_PROM_MODE_ALL_MC);
+ CurPromMode |= (pAC->Addr.Port[PortNumber].PromMode & SK_PROM_MODE_ALL_MC);
}
else {
/* Read InexactModeBit (bit 15 in mode register). */
-
- XM_IN16(IoC, PortIdx, XM_MODE, &LoMode);
-
- InexactModeBit = (LoMode & XM_MD_ENA_HSH) != 0;
+ XM_IN16(IoC, PortNumber, XM_MODE, &LoMode);
+
+ InexactModeBit = (LoMode & XM_MD_ENA_HSH) != 0;
/* Read 64-bit hash register from HW. */
-
- XM_INHASH(IoC, PortIdx, XM_HSM, &HwInexactFilter.Bytes[0]);
+ XM_INHASH(IoC, PortNumber, XM_HSM, &HwInexactFilter.Bytes[0]);
for (HwInexact = 0xFF, i = 0; i < 8; i++) {
HwInexact &= HwInexactFilter.Bytes[i];
@@ -1119,7 +1082,7 @@
}
}
- pAC->Addr.Port[PortIdx].PromMode = NewPromMode;
+ pAC->Addr.Port[PortNumber].PromMode = NewPromMode;
if (NewPromMode == CurPromMode) {
return (SK_ADDR_SUCCESS);
@@ -1127,76 +1090,65 @@
if ((NewPromMode & SK_PROM_MODE_ALL_MC) &&
!(CurPromMode & SK_PROM_MODE_ALL_MC)) { /* All MC. */
-
/* Set all bits in 64-bit hash register. */
-
- XM_OUTHASH(IoC, PortIdx, XM_HSM, &OnesHash);
+ XM_OUTHASH(IoC, PortNumber, XM_HSM, &OnesHash);
/* Set bit 15 in mode register. */
-
- XM_IN16(IoC, PortIdx, XM_MODE, &LoMode);
+ XM_IN16(IoC, PortNumber, XM_MODE, &LoMode);
LoMode |= XM_MD_ENA_HSH;
- XM_OUT16(IoC, PortIdx, XM_MODE, LoMode);
+ XM_OUT16(IoC, PortNumber, XM_MODE, LoMode);
}
else if ((CurPromMode & SK_PROM_MODE_ALL_MC) &&
!(NewPromMode & SK_PROM_MODE_ALL_MC)) { /* Norm MC. */
-
for (Inexact = 0, i = 0; i < 8; i++) {
- Inexact |=
- pAC->Addr.Port[PortIdx].InexactFilter.Bytes[i];
+ Inexact |= pAC->Addr.Port[PortNumber].InexactFilter.Bytes[i];
}
if (Inexact == 0) {
/* Clear bit 15 in mode register. */
-
- XM_IN16(IoC, PortIdx, XM_MODE, &LoMode);
+ XM_IN16(IoC, PortNumber, XM_MODE, &LoMode);
LoMode &= ~XM_MD_ENA_HSH;
- XM_OUT16(IoC, PortIdx, XM_MODE, LoMode);
+ XM_OUT16(IoC, PortNumber, XM_MODE, LoMode);
}
else {
/* Set 64-bit hash register to InexactFilter. */
-
XM_OUTHASH(
IoC,
- PortIdx,
+ PortNumber,
XM_HSM,
- &pAC->Addr.Port[PortIdx
- ].InexactFilter.Bytes[0]);
+ &pAC->Addr.Port[PortNumber].InexactFilter.Bytes[0]);
/* Set bit 15 in mode register. */
-
- XM_IN16(IoC, PortIdx, XM_MODE, &LoMode);
+ XM_IN16(IoC, PortNumber, XM_MODE, &LoMode);
LoMode |= XM_MD_ENA_HSH;
- XM_OUT16(IoC, PortIdx, XM_MODE, LoMode);
+ XM_OUT16(IoC, PortNumber, XM_MODE, LoMode);
}
}
if ((NewPromMode & SK_PROM_MODE_LLC) &&
!(CurPromMode & SK_PROM_MODE_LLC)) { /* Prom. LLC */
-
/* Set promiscuous bit in mode register. */
+ XM_IN16(IoC, PortNumber, XM_MODE, &LoMode);
- XM_IN16(IoC, PortIdx, XM_MODE, &LoMode);
#if 0
/* Receive MAC frames. */
-
LoMode |= XM_MD_RX_MCTRL;
#endif /* 0 */
+
LoMode |= XM_MD_ENA_PROM;
- XM_OUT16(IoC, PortIdx, XM_MODE, LoMode);
+ XM_OUT16(IoC, PortNumber, XM_MODE, LoMode);
}
else if ((CurPromMode & SK_PROM_MODE_LLC) &&
!(NewPromMode & SK_PROM_MODE_LLC)) { /* Norm. LLC. */
-
/* Clear promiscuous bit in mode register. */
+ XM_IN16(IoC, PortNumber, XM_MODE, &LoMode);
- XM_IN16(IoC, PortIdx, XM_MODE, &LoMode);
#if 0
/* Don't receive MAC frames. */
-
LoMode &= ~XM_MD_RX_MCTRL;
#endif /* 0 */
+
LoMode &= ~XM_MD_ENA_PROM;
- XM_OUT16(IoC, PortIdx, XM_MODE, LoMode);
+ XM_OUT16(IoC, PortNumber, XM_MODE, LoMode);
}
return (SK_ADDR_SUCCESS);
@@ -1219,21 +1171,25 @@
* SK_ADDR_ILLEGAL_PORT
*/
int SkAddrSwap(
-SK_AC *pAC, /* adapter context */
-SK_IOC IoC, /* I/O context */
-SK_U32 FromPortIdx, /* Port1 Index */
-SK_U32 ToPortIdx) /* Port2 Index */
+SK_AC *pAC, /* adapter context */
+SK_IOC IoC, /* I/O context */
+SK_U32 FromPortNumber, /* Port1 Index */
+SK_U32 ToPortNumber) /* Port2 Index */
{
- int i;
+ int i;
SK_U8 Byte;
SK_MAC_ADDR MacAddr;
SK_U32 DWord;
- if (FromPortIdx >= (SK_U32)pAC->GIni.GIMacsFound) {
+ if (FromPortNumber >= (SK_U32)pAC->GIni.GIMacsFound) {
+ return (SK_ADDR_ILLEGAL_PORT);
+ }
+
+ if (ToPortNumber >= (SK_U32)pAC->GIni.GIMacsFound) {
return (SK_ADDR_ILLEGAL_PORT);
}
- if (ToPortIdx >= (SK_U32)pAC->GIni.GIMacsFound) {
+ if (pAC->Rlmt.Port[FromPortNumber].Net != pAC->Rlmt.Port[ToPortNumber].Net) {
return (SK_ADDR_ILLEGAL_PORT);
}
@@ -1250,48 +1206,56 @@
*/
for (i = 0; i < SK_ADDR_EXACT_MATCHES; i++) {
- MacAddr = pAC->Addr.Port[FromPortIdx].Exact[i];
- pAC->Addr.Port[FromPortIdx].Exact[i] =
- pAC->Addr.Port[ToPortIdx].Exact[i];
- pAC->Addr.Port[ToPortIdx].Exact[i] = MacAddr;
+ MacAddr = pAC->Addr.Port[FromPortNumber].Exact[i];
+ pAC->Addr.Port[FromPortNumber].Exact[i] =
+ pAC->Addr.Port[ToPortNumber].Exact[i];
+ pAC->Addr.Port[ToPortNumber].Exact[i] = MacAddr;
}
for (i = 0; i < 8; i++) {
- Byte = pAC->Addr.Port[FromPortIdx].InexactFilter.Bytes[i];
- pAC->Addr.Port[FromPortIdx].InexactFilter.Bytes[i] =
- pAC->Addr.Port[ToPortIdx].InexactFilter.Bytes[i];
- pAC->Addr.Port[ToPortIdx].InexactFilter.Bytes[i] = Byte;
- }
-
- i = pAC->Addr.Port[FromPortIdx].PromMode;
- pAC->Addr.Port[FromPortIdx].PromMode =
- pAC->Addr.Port[ToPortIdx].PromMode;
- pAC->Addr.Port[ToPortIdx].PromMode = i;
-
- DWord = pAC->Addr.Port[FromPortIdx].FirstExactMatchRlmt;
- pAC->Addr.Port[FromPortIdx].FirstExactMatchRlmt =
- pAC->Addr.Port[ToPortIdx].FirstExactMatchRlmt;
- pAC->Addr.Port[ToPortIdx].FirstExactMatchRlmt = DWord;
-
- DWord = pAC->Addr.Port[FromPortIdx].NextExactMatchRlmt;
- pAC->Addr.Port[FromPortIdx].NextExactMatchRlmt =
- pAC->Addr.Port[ToPortIdx].NextExactMatchRlmt;
- pAC->Addr.Port[ToPortIdx].NextExactMatchRlmt = DWord;
-
- DWord = pAC->Addr.Port[FromPortIdx].FirstExactMatchDrv;
- pAC->Addr.Port[FromPortIdx].FirstExactMatchDrv =
- pAC->Addr.Port[ToPortIdx].FirstExactMatchDrv;
- pAC->Addr.Port[ToPortIdx].FirstExactMatchDrv = DWord;
-
- DWord = pAC->Addr.Port[FromPortIdx].NextExactMatchDrv;
- pAC->Addr.Port[FromPortIdx].NextExactMatchDrv =
- pAC->Addr.Port[ToPortIdx].NextExactMatchDrv;
- pAC->Addr.Port[ToPortIdx].NextExactMatchDrv = DWord;
+ Byte = pAC->Addr.Port[FromPortNumber].InexactFilter.Bytes[i];
+ pAC->Addr.Port[FromPortNumber].InexactFilter.Bytes[i] =
+ pAC->Addr.Port[ToPortNumber].InexactFilter.Bytes[i];
+ pAC->Addr.Port[ToPortNumber].InexactFilter.Bytes[i] = Byte;
+ }
+
+ i = pAC->Addr.Port[FromPortNumber].PromMode;
+ pAC->Addr.Port[FromPortNumber].PromMode = pAC->Addr.Port[ToPortNumber].PromMode;
+ pAC->Addr.Port[ToPortNumber].PromMode = i;
+
+ DWord = pAC->Addr.Port[FromPortNumber].FirstExactMatchRlmt;
+ pAC->Addr.Port[FromPortNumber].FirstExactMatchRlmt =
+ pAC->Addr.Port[ToPortNumber].FirstExactMatchRlmt;
+ pAC->Addr.Port[ToPortNumber].FirstExactMatchRlmt = DWord;
+
+ DWord = pAC->Addr.Port[FromPortNumber].NextExactMatchRlmt;
+ pAC->Addr.Port[FromPortNumber].NextExactMatchRlmt =
+ pAC->Addr.Port[ToPortNumber].NextExactMatchRlmt;
+ pAC->Addr.Port[ToPortNumber].NextExactMatchRlmt = DWord;
+
+ DWord = pAC->Addr.Port[FromPortNumber].FirstExactMatchDrv;
+ pAC->Addr.Port[FromPortNumber].FirstExactMatchDrv =
+ pAC->Addr.Port[ToPortNumber].FirstExactMatchDrv;
+ pAC->Addr.Port[ToPortNumber].FirstExactMatchDrv = DWord;
+
+ DWord = pAC->Addr.Port[FromPortNumber].NextExactMatchDrv;
+ pAC->Addr.Port[FromPortNumber].NextExactMatchDrv =
+ pAC->Addr.Port[ToPortNumber].NextExactMatchDrv;
+ pAC->Addr.Port[ToPortNumber].NextExactMatchDrv = DWord;
+
+ /* CAUTION: Solution works if only ports of one adapter are in use. */
+ for (i = 0; (SK_U32)i < pAC->Rlmt.Net[pAC->Rlmt.Port[ToPortNumber].
+ Net->NetNumber].NumPorts; i++) {
+ if (pAC->Rlmt.Net[pAC->Rlmt.Port[ToPortNumber].Net->NetNumber].
+ Port[i]->PortNumber == ToPortNumber) {
+ pAC->Addr.Net[pAC->Rlmt.Port[ToPortNumber].Net->NetNumber].
+ ActivePort = i;
+ /* 20001207 RA: Was "ToPortNumber;". */
- pAC->Addr.ActivePort = ToPortIdx;
-
- (void)SkAddrMcUpdate(pAC, IoC, FromPortIdx);
- (void)SkAddrMcUpdate(pAC, IoC, ToPortIdx);
+ }
+ }
+ (void)SkAddrMcUpdate(pAC, IoC, FromPortNumber);
+ (void)SkAddrMcUpdate(pAC, IoC, ToPortNumber);
return (SK_ADDR_SUCCESS);
} /* SkAddrSwap */
@@ -1299,3 +1263,4 @@
#ifdef __cplusplus
}
#endif /* __cplusplus */
+
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/skcsum.c linux.20p6/drivers/net/sk98lin/skcsum.c
--- linux.vanilla/drivers/net/sk98lin/skcsum.c Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/skcsum.c Tue Jun 19 09:46:01 2001
@@ -2,16 +2,15 @@
*
* Name: skcsum.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.6 $
- * Date: $Date: 2000/02/21 12:35:10 $
+ * Version: $Revision: 1.8 $
+ * Date: $Date: 2001/02/06 11:15:36 $
* Purpose: Store/verify Internet checksum in send/receive packets.
*
******************************************************************************/
/******************************************************************************
*
- * (C)Copyright 1998,1999 SysKonnect,
- * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ * (C)Copyright 1998-2001 SysKonnect GmbH.
*
* 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
@@ -27,6 +26,13 @@
* History:
*
* $Log: skcsum.c,v $
+ * Revision 1.8 2001/02/06 11:15:36 rassmann
+ * Supporting two nets on dual-port adapters.
+ *
+ * Revision 1.7 2000/06/29 13:17:05 rassmann
+ * Corrected reception of a packet with UDP checksum == 0 (which means there
+ * is no UDP checksum).
+ *
* Revision 1.6 2000/02/21 12:35:10 cgoos
* Fixed license header comment.
*
@@ -59,7 +65,7 @@
#ifndef lint
static const char SysKonnectFileId[] = "@(#)"
- "$Id: skcsum.c,v 1.6 2000/02/21 12:35:10 cgoos Exp $"
+ "$Id: skcsum.c,v 1.8 2001/02/06 11:15:36 rassmann Exp $"
" (C) SysKonnect.";
#endif /* !lint */
@@ -105,13 +111,13 @@
/* defines ********************************************************************/
/* The size of an Ethernet MAC header. */
-#define SKCS_ETHERNET_MAC_HEADER_SIZE (6+6+2)
+#define SKCS_ETHERNET_MAC_HEADER_SIZE (6+6+2)
/* The size of the used topology's MAC header. */
#define SKCS_MAC_HEADER_SIZE SKCS_ETHERNET_MAC_HEADER_SIZE
/* The size of the IP header without any option fields. */
-#define SKCS_IP_HEADER_SIZE 20
+#define SKCS_IP_HEADER_SIZE 20
/*
* Field offsets within the IP header.
@@ -121,23 +127,31 @@
#define SKCS_OFS_IP_HEADER_VERSION_AND_LENGTH 0
/* "Total Length". */
-#define SKCS_OFS_IP_TOTAL_LENGTH 2
+#define SKCS_OFS_IP_TOTAL_LENGTH 2
/* "Flags" "Fragment Offset". */
#define SKCS_OFS_IP_FLAGS_AND_FRAGMENT_OFFSET 6
/* "Next Level Protocol" identifier. */
-#define SKCS_OFS_IP_NEXT_LEVEL_PROTOCOL 9
+#define SKCS_OFS_IP_NEXT_LEVEL_PROTOCOL 9
/* Source IP address. */
-#define SKCS_OFS_IP_SOURCE_ADDRESS 12
+#define SKCS_OFS_IP_SOURCE_ADDRESS 12
/* Destination IP address. */
-#define SKCS_OFS_IP_DESTINATION_ADDRESS 16
+#define SKCS_OFS_IP_DESTINATION_ADDRESS 16
+
+
+/*
+ * Field offsets within the UDP header.
+ */
+
+/* UDP checksum. */
+#define SKCS_OFS_UDP_CHECKSUM 6
/* IP "Next Level Protocol" identifiers (see RFC 790). */
-#define SKCS_PROTO_ID_TCP 6 /* Transport Control Protocol */
-#define SKCS_PROTO_ID_UDP 17 /* User Datagram Protocol */
+#define SKCS_PROTO_ID_TCP 6 /* Transport Control Protocol */
+#define SKCS_PROTO_ID_UDP 17 /* User Datagram Protocol */
/* IP "Don't Fragment" bit. */
#define SKCS_IP_DONT_FRAGMENT SKCS_HTON16(0x4000)
@@ -235,9 +249,10 @@
* of the TCP or UDP pseudo header is returned here.
*/
void SkCsGetSendInfo(
-SK_AC *pAc, /* Adapter context struct. */
-void *pIpHeader, /* IP header. */
-SKCS_PACKET_INFO *pPacketInfo) /* Packet information struct. */
+SK_AC *pAc, /* Adapter context struct. */
+void *pIpHeader, /* IP header. */
+SKCS_PACKET_INFO *pPacketInfo, /* Packet information struct. */
+int NetNumber) /* Net number */
{
/* Internet Header Version found in IP header. */
unsigned InternetHeaderVersion;
@@ -279,7 +294,7 @@
("Tx: Unknown Internet Header Version %u.\n",
InternetHeaderVersion));
pPacketInfo->ProtocolFlags = 0;
- pAc->Csum.ProtoStats[SKCS_PROTO_STATS_IP].TxUnableCts++;
+ pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].TxUnableCts++;
return;
}
@@ -300,13 +315,13 @@
SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_TX,
("Tx: Invalid IP Header Length %u.\n", IpHeaderLength));
pPacketInfo->ProtocolFlags = 0;
- pAc->Csum.ProtoStats[SKCS_PROTO_STATS_IP].TxUnableCts++;
+ pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].TxUnableCts++;
return;
}
/* This is an IPv4 frame with a header of valid length. */
- pAc->Csum.ProtoStats[SKCS_PROTO_STATS_IP].TxOkCts++;
+ pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].TxOkCts++;
/* Check if we should calculate the IP header checksum. */
@@ -335,14 +350,14 @@
/* TCP/IP frame. */
ProtocolFlags &= SKCS_PROTO_TCP | SKCS_PROTO_IP;
NextLevelProtoStats =
- &pAc->Csum.ProtoStats[SKCS_PROTO_STATS_TCP];
+ &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_TCP];
}
else if ((ProtocolFlags & SKCS_PROTO_UDP) != 0 &&
NextLevelProtocol == SKCS_PROTO_ID_UDP) {
/* UDP/IP frame. */
ProtocolFlags &= SKCS_PROTO_UDP | SKCS_PROTO_IP;
NextLevelProtoStats =
- &pAc->Csum.ProtoStats[SKCS_PROTO_STATS_UDP];
+ &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_UDP];
}
else {
/*
@@ -408,7 +423,8 @@
SKCS_OC_ADD(pPacketInfo->PseudoHeaderChecksum, PseudoHeaderChecksum, 0);
NextLevelProtoStats->TxOkCts++; /* Success. */
-}
+} /* SkCsGetSendInfo */
+
/******************************************************************************
*
@@ -426,7 +442,8 @@
* pAc - Pointer to adapter context struct.
*
* pIpHeader - Pointer to IP header. Must be at least the length in bytes
- * of the received IP header including any option fields.
+ * of the received IP header including any option fields. For UDP packets,
+ * 8 additional bytes are needed to access the UDP checksum.
*
* Note: The actual length of the IP header is stored in the lower four
* bits of the first octet of the IP header as the number of 4-byte words,
@@ -442,24 +459,27 @@
* Returns:
* SKCS_STATUS_UNKNOWN_IP_VERSION - Not an IP v4 frame.
* SKCS_STATUS_IP_CSUM_ERROR - IP checksum error.
+ * SKCS_STATUS_IP_CSUM_ERROR_TCP - IP checksum error in TCP frame.
+ * SKCS_STATUS_IP_CSUM_ERROR_UDP - IP checksum error in UDP frame
* SKCS_STATUS_IP_FRAGMENT - IP fragment (IP checksum ok).
* SKCS_STATUS_IP_CSUM_OK - IP checksum ok (not a TCP or UDP frame).
* SKCS_STATUS_TCP_CSUM_ERROR - TCP checksum error (IP checksum ok).
* SKCS_STATUS_UDP_CSUM_ERROR - UDP checksum error (IP checksum ok).
* SKCS_STATUS_TCP_CSUM_OK - IP and TCP checksum ok.
* SKCS_STATUS_UDP_CSUM_OK - IP and UDP checksum ok.
+ * SKCS_STATUS_IP_CSUM_OK_NO_UDP - IP checksum OK and no UDP checksum.
*
- * Note: The SKCS_STATUS_XXX values returned here are *not* defined by
- * the CSUM module but must be defined in some header file by the module
- * using CSUM. In this way, the calling module can assign return values
- * for its own needs, e.g. by assigning bit flags to the individual
- * protocols.
+ * Note: If SKCS_OVERWRITE_STATUS is defined, the SKCS_STATUS_XXX values
+ * returned here can be defined in some header file by the module using CSUM.
+ * In this way, the calling module can assign return values for its own needs,
+ * e.g. by assigning bit flags to the individual protocols.
*/
SKCS_STATUS SkCsGetReceiveInfo(
SK_AC *pAc, /* Adapter context struct. */
void *pIpHeader, /* IP header. */
unsigned Checksum1, /* Hardware checksum 1. */
-unsigned Checksum2) /* Hardware checksum 2. */
+unsigned Checksum2, /* Hardware checksum 2. */
+int NetNumber) /* Net number */
{
/* Internet Header Version found in IP header. */
unsigned InternetHeaderVersion;
@@ -506,7 +526,7 @@
SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_RX,
("Rx: Unknown Internet Header Version %u.\n",
InternetHeaderVersion));
- pAc->Csum.ProtoStats[SKCS_PROTO_STATS_IP].RxUnableCts++;
+ pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxUnableCts++;
return (SKCS_STATUS_UNKNOWN_IP_VERSION);
}
@@ -525,7 +545,7 @@
if (IpHeaderLength < 5*4) {
SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_RX,
("Rx: Invalid IP Header Length %u.\n", IpHeaderLength));
- pAc->Csum.ProtoStats[SKCS_PROTO_STATS_IP].RxErrCts++;
+ pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxErrCts++;
return (SKCS_STATUS_IP_CSUM_ERROR);
}
@@ -555,18 +575,17 @@
/* Adjust the IP header and IP data checksums. */
- SKCS_OC_ADD(IpHeaderChecksum,
- IpHeaderChecksum, IpOptionsChecksum);
+ SKCS_OC_ADD(IpHeaderChecksum, IpHeaderChecksum, IpOptionsChecksum);
- SKCS_OC_SUB(IpDataChecksum,
- IpDataChecksum, IpOptionsChecksum);
+ SKCS_OC_SUB(IpDataChecksum, IpDataChecksum, IpOptionsChecksum);
}
- /* Check if the IP header checksum is ok. */
/*
- * NOTE: We must check the IP header checksum even if the caller does
- * not want us to do so because we cannot do any further processing of
- * the packet without a valid IP checksum.
+ * Check if the IP header checksum is ok.
+ *
+ * NOTE: We must check the IP header checksum even if the caller just wants
+ * us to check upper-layer checksums, because we cannot do any further
+ * processing of the packet without a valid IP checksum.
*/
/* Get the next level protocol identifier. */
@@ -575,7 +594,7 @@
SKCS_IDX(pIpHeader, SKCS_OFS_IP_NEXT_LEVEL_PROTOCOL);
if (IpHeaderChecksum != 0xFFFF) {
- pAc->Csum.ProtoStats[SKCS_PROTO_STATS_IP].RxErrCts++;
+ pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxErrCts++;
/* the NDIS tester wants to know the upper level protocol too */
if (NextLevelProtocol == SKCS_PROTO_ID_TCP) {
return(SKCS_STATUS_IP_CSUM_ERROR_TCP);
@@ -586,7 +605,6 @@
return (SKCS_STATUS_IP_CSUM_ERROR);
}
-
/*
* Check if this is a TCP or UDP frame and if we should calculate the
* TCP/UDP pseudo header checksum.
@@ -595,17 +613,17 @@
* frame.
*/
- if ((pAc->Csum.ReceiveFlags & SKCS_PROTO_TCP) != 0 &&
+ if ((pAc->Csum.ReceiveFlags[NetNumber] & SKCS_PROTO_TCP) != 0 &&
NextLevelProtocol == SKCS_PROTO_ID_TCP) {
/* TCP/IP frame. */
NextLevelProtoStats =
- &pAc->Csum.ProtoStats[SKCS_PROTO_STATS_TCP];
+ &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_TCP];
}
- else if ((pAc->Csum.ReceiveFlags & SKCS_PROTO_UDP) != 0 &&
+ else if ((pAc->Csum.ReceiveFlags[NetNumber] & SKCS_PROTO_UDP) != 0 &&
NextLevelProtocol == SKCS_PROTO_ID_UDP) {
/* UDP/IP frame. */
NextLevelProtoStats =
- &pAc->Csum.ProtoStats[SKCS_PROTO_STATS_UDP];
+ &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_UDP];
}
else {
/*
@@ -634,6 +652,24 @@
}
/*
+ * 08-May-2000 ra
+ *
+ * From RFC 768 (UDP)
+ * If the computed checksum is zero, it is transmitted as all ones (the
+ * equivalent in one's complement arithmetic). An all zero transmitted
+ * checksum value means that the transmitter generated no checksum (for
+ * debugging or for higher level protocols that don't care).
+ */
+
+ if (NextLevelProtocol == SKCS_PROTO_ID_UDP &&
+ *(SK_U16*)SKCS_IDX(pIpHeader, IpHeaderLength + 6) == 0x0000) {
+
+ NextLevelProtoStats->RxOkCts++;
+
+ return (SKCS_STATUS_IP_CSUM_OK_NO_UDP);
+ }
+
+ /*
* Calculate the TCP/UDP checksum.
*/
@@ -691,7 +727,8 @@
return (NextLevelProtocol == SKCS_PROTO_ID_TCP ?
SKCS_STATUS_TCP_CSUM_ERROR : SKCS_STATUS_UDP_CSUM_ERROR);
-}
+} /* SkCsGetReceiveInfo */
+
/******************************************************************************
*
@@ -721,14 +758,15 @@
* Returns the two hardware checksum start offsets.
*/
void SkCsSetReceiveFlags(
-SK_AC *pAc, /* Adapter context struct. */
+SK_AC *pAc, /* Adapter context struct. */
unsigned ReceiveFlags, /* New receive flags. */
unsigned *pChecksum1Offset, /* Offset for hardware checksum 1. */
-unsigned *pChecksum2Offset) /* Offset for hardware checksum 2. */
+unsigned *pChecksum2Offset, /* Offset for hardware checksum 2. */
+int NetNumber)
{
/* Save the receive flags. */
- pAc->Csum.ReceiveFlags = ReceiveFlags;
+ pAc->Csum.ReceiveFlags[NetNumber] = ReceiveFlags;
/* First checksum start offset is the IP header. */
*pChecksum1Offset = SKCS_MAC_HEADER_SIZE;
@@ -738,9 +776,10 @@
* if there are any IP header options in the actual packet.
*/
*pChecksum2Offset = SKCS_MAC_HEADER_SIZE + SKCS_IP_HEADER_SIZE;
-}
+} /* SkCsSetReceiveFlags */
#ifndef SkCsCalculateChecksum
+
/******************************************************************************
*
* SkCsCalculateChecksum - calculate checksum for specified data
@@ -802,7 +841,8 @@
/* Note: All bits beyond the 16-bit limit are now zero. */
return ((unsigned) Checksum);
-}
+} /* SkCsCalculateChecksum */
+
#endif /* SkCsCalculateChecksum */
/******************************************************************************
@@ -838,29 +878,32 @@
SK_EVPARA Param) /* Event dependent parameter. */
{
int ProtoIndex;
+ int NetNumber;
switch (Event) {
/*
* Clear protocol statistics.
*
* Param - Protocol index, or -1 for all protocols.
+ * - Net number.
*/
case SK_CSUM_EVENT_CLEAR_PROTO_STATS:
- ProtoIndex = (int) Param.Para32[0];
+ ProtoIndex = (int)Param.Para32[0];
+ NetNumber = (int)Param.Para32[1];
if (ProtoIndex < 0) { /* Clear for all protocols. */
- memset(&pAc->Csum.ProtoStats[0], 0,
- sizeof(pAc->Csum.ProtoStats));
+ memset(&pAc->Csum.ProtoStats[NetNumber][0], 0,
+ sizeof(pAc->Csum.ProtoStats[NetNumber]));
}
- else { /* Clear for individual protocol. */
- memset(&pAc->Csum.ProtoStats[ProtoIndex], 0,
- sizeof(pAc->Csum.ProtoStats[ProtoIndex]));
+ else { /* Clear for individual protocol. */
+ memset(&pAc->Csum.ProtoStats[NetNumber][ProtoIndex], 0,
+ sizeof(pAc->Csum.ProtoStats[NetNumber][ProtoIndex]));
}
break;
default:
break;
}
return (0); /* Success. */
-}
+} /* SkCsEvent */
#endif /* SK_USE_CSUM */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/net/sk98lin/skge.c linux.20p6/drivers/net/sk98lin/skge.c
--- linux.vanilla/drivers/net/sk98lin/skge.c Sun Mar 25 17:31:22 2001
+++ linux.20p6/drivers/net/sk98lin/skge.c Tue Jun 19 09:46:04 2001
@@ -1,20 +1,22 @@
/******************************************************************************
*
- * Name: skge.c
+ * Name: skge.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.29 $
- * Date: $Date: 2000/02/21 13:31:56 $
+ * Version: $Revision: 1.37 $
+ * Date: $Date: 2001/05/08 11:25:40 $
* Purpose: The main driver source module
*
******************************************************************************/
+
/******************************************************************************
*
- * (C)Copyright 1998,1999 SysKonnect,
- * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ * (C)Copyright 1998-2001 SysKonnect GmbH.
*
* Driver for SysKonnect Gigabit Ethernet Server Adapters:
*
+ * SK-9861 (single link 1000Base-SX, VF45 Volition Plug)
+ * SK-9862 (dual link 1000Base-SX, VF45 Volition Plug)
* SK-9841 (single link 1000Base-LX)
* SK-9842 (dual link 1000Base-LX)
* SK-9843 (single link 1000Base-SX)
@@ -25,6 +27,7 @@
* Created 10-Feb-1999, based on Linux' acenic.c, 3c59x.c and
* SysKonnects GEnesis Solaris driver
* Author: Christoph Goos (cgoos@syskonnect.de)
+ * Mirko Lindner (mlindner@syskonnect.de)
*
* Address all question to: linux@syskonnect.de
*
@@ -41,11 +44,40 @@
*
******************************************************************************/
+
/******************************************************************************
*
* History:
*
* $Log: skge.c,v $
+ * Revision 1.37 2001/05/08 11:25:40 mlindner
+ * fix: removed VLAN error message
+ *
+ * Revision 1.36 2001/05/04 12:02:25 gklug
+ * fix: compilation bug
+ *
+ * Revision 1.35 2001/05/04 11:42:12 gklug
+ * fix: receive IRQ can now handle invalid frames correctly
+ *
+ * Revision 1.34 2001/05/04 11:13:49 gklug
+ * fix: do not free meassage if ring is full on entry.
+ *
+ * Revision 1.33 2001/03/20 12:26:08 mlindner
+ * Fix: Memory problem
+ * Fix: proc_unregister fixed
+ *
+ * Revision 1.32 2001/03/01 12:50:52 mlindner
+ * Fixed ring size
+ *
+ * Revision 1.31 2001/02/19 13:14:16 mlindner
+ * Changed PNMI parameter values
+ * Corrected ProcFs functionality
+ *
+ * Revision 1.30 2001/01/22 14:15:29 mlindner
+ * added ProcFs functionality
+ * Dual Net functionality integrated
+ * Rlmt networks added
+ *
* Revision 1.29 2000/02/21 13:31:56 cgoos
* Fixed "unused" warning for UltraSPARC change.
*
@@ -233,23 +265,16 @@
*
******************************************************************************/
-static const char SysKonnectFileId[] = "@(#)" __FILE__ " (C) SysKonnect.";
-static const char SysKonnectBuildNumber[] =
- "@(#)SK-BUILD: 3.04 (19991111) PL: 01";
+#include "h/skversion.h"
#include
+#include
#include "h/skdrv1st.h"
#include "h/skdrv2nd.h"
/* defines ******************************************************************/
-#define BOOT_STRING "sk98lin: Network Device Driver v3.04\n" \
- "Copyright (C) 1999 SysKonnect"
-
-#define VER_STRING "3.04"
-
-
/* for debuging on x86 only */
/* #define BREAKPOINT() asm(" int $3"); */
@@ -269,6 +294,7 @@
/* number of adapters that can be configured via command line params */
#define SK_MAX_CARD_PARAM 16
+
/*
* use those defines for a compile-in version of the driver instead
* of command line parameters
@@ -282,7 +308,8 @@
// #define ROLE_A {"Auto", }
// #define ROLE_B {"Auto", }
// #define PREF_PORT {"A", }
-// #define RLMT_MODE {"CheckLink", }
+// #define RLMT_MODE {"CheckLinkState", }
+
#define DEV_KFREE_SKB(skb) dev_kfree_skb(skb);
@@ -314,14 +341,23 @@
static void FillRxRing(SK_AC*, RX_PORT*);
static SK_BOOL FillRxDescriptor(SK_AC*, RX_PORT*);
static void ReceiveIrq(SK_AC*, RX_PORT*);
-static void ClearAndStartRx(SK_AC*, int);
+void ClearAndStartRx(SK_AC*, int);
static void ClearTxIrq(SK_AC*, int, int);
static void ClearRxRing(SK_AC*, RX_PORT*);
static void ClearTxRing(SK_AC*, TX_PORT*);
static void SetQueueSizes(SK_AC *pAC);
static int SkGeChangeMtu(struct device *dev, int new_mtu);
static void PortReInitBmu(SK_AC*, int);
-static int SkGeIocMib(SK_AC*, unsigned int, int);
+static int SkGeIocMib(DEV_NET*, unsigned int, int);
+static struct dentry *SkgeProcLookup(struct inode *dir, struct dentry *dentry);
+static int SkgeProcFileOpen(struct inode *inode, struct file *file);
+static int SkgeProcFileRelease(struct inode *inode, struct file *file);
+
+/*Extern */
+extern struct proc_dir_entry Our_Proc_Dir;
+extern int proc_read(char *buffer, char **buffer_location,
+ off_t offset, int buffer_length, int *eof, void *data);
+
#ifdef DEBUG
static void DumpMsg(struct sk_buff*, char*);
static void DumpData(char*, int);
@@ -331,13 +367,27 @@
/* global variables *********************************************************/
static const char *BootString = BOOT_STRING;
-static struct device *root_dev = NULL;
+struct device *root_dev = NULL;
static int probed __initdata = 0;
+struct inode_operations SkInodeOps;
+static struct file_operations SkFileOps; /* with open/relase */
/* local variables **********************************************************/
static uintptr_t TxQueueAddr[SK_MAX_MACS][2] = {{0x680, 0x600},{0x780, 0x700}};
static uintptr_t RxQueueAddr[SK_MAX_MACS] = {0x400, 0x480};
+
+
+void proc_fill_inode(struct inode *inode, int fill)
+{
+ if (fill)
+ MOD_INC_USE_COUNT;
+ else
+ MOD_DEC_USE_COUNT;
+}
+
+
+
/*****************************************************************************
*
* skge_probe - find all SK-98xx adapters
@@ -353,11 +403,13 @@
*/
__initfunc(int skge_probe (struct device *dev))
{
-int boards_found = 0;
-int version_disp = 0;
-SK_AC *pAC;
-struct pci_dev *pdev = NULL;
-unsigned long base_address;
+int boards_found = 0;
+int DeviceFound = SK_FALSE;
+SK_AC *pAC;
+DEV_NET *pNet = NULL;
+struct pci_dev *pdev = NULL;
+unsigned long base_address;
+struct proc_dir_entry *pProcFile;
#ifdef __sparc_v9__
unsigned short tmp;
#endif
@@ -366,52 +418,76 @@
return -ENODEV;
probed++;
- /* display driver info */
- if (!version_disp)
- {
- /* set display flag to TRUE so that */
- /* we only display this string ONCE */
- version_disp = 1;
- printk("%s\n", BootString);
- }
-
if (!pci_present()) /* is PCI support present? */
return -ENODEV;
while((pdev = pci_find_class(PCI_CLASS_NETWORK_ETHERNET << 8, pdev)))
{
dev = NULL;
+ pNet = NULL;
if (pdev->vendor != PCI_VENDOR_ID_SYSKONNECT ||
pdev->device != PCI_DEVICE_ID_SYSKONNECT_GE) {
continue;
+ }
+
+ if ((dev = init_etherdev(dev, sizeof(DEV_NET))) == 0) {
+ printk(KERN_ERR "Unable to allocate etherdev "
+ "structure!\n");
+ break;
}
- dev = init_etherdev(dev, sizeof(SK_AC));
- if (dev == NULL){
- printk(KERN_ERR "Unable to allocate etherdev "
+ if (dev->priv == NULL)
+ dev->priv = kmalloc(sizeof(DEV_NET), GFP_KERNEL);
+
+ if (dev->priv == NULL) {
+ printk(KERN_ERR "Unable to allocate adapter "
"structure!\n");
break;
}
- if (!dev->priv)
- dev->priv = kmalloc(sizeof(SK_AC), GFP_KERNEL);
- if (dev->priv == NULL){
+ pNet = dev->priv;
+ pNet->pAC = kmalloc(sizeof(SK_AC), GFP_KERNEL);
+ if (pNet->pAC == NULL){
+ kfree(dev->priv);
printk(KERN_ERR "Unable to allocate adapter "
"structure!\n");
break;
}
+ if (!DeviceFound) {
+ /* set display flag to TRUE so that */
+ /* we only display this string ONCE */
+ printk("%s\n", BootString);
+
+ DeviceFound = SK_TRUE;
+
+ /*Create proc (directory)*/
+ proc_register(proc_net, &Our_Proc_Dir);
+
+ memcpy(&SkInodeOps, &proc_dir_inode_operations,
+ sizeof(struct inode_operations));
+ SkInodeOps.lookup = &SkgeProcLookup;
+ SkInodeOps.default_file_ops = &SkFileOps;
+
+ memcpy(&SkFileOps, proc_net_inode_operations.default_file_ops,
+ sizeof(struct file_operations));
+ SkFileOps.open = &SkgeProcFileOpen;
+ SkFileOps.release = &SkgeProcFileRelease;
+ }
- memset(dev->priv, 0, sizeof(SK_AC));
-
- pAC = dev->priv;
+ memset(pNet->pAC, 0, sizeof(SK_AC));
+ pAC = pNet->pAC;
pAC->PciDev = *pdev;
pAC->PciDevId = pdev->device;
- pAC->dev = dev;
+ pAC->dev[0] = dev;
+ pAC->dev[1] = dev;
sprintf(pAC->Name, "SysKonnect SK-98xx");
pAC->CheckQueue = SK_FALSE;
+
+ pNet->Mtu = 1500;
+ pNet->Up = 0;
dev->irq = pdev->irq;
dev->open = &SkGeOpen;
@@ -422,7 +498,16 @@
dev->set_mac_address = &SkGeSetMacAddr;
dev->do_ioctl = &SkGeIoctl;
dev->change_mtu = &SkGeChangeMtu;
-
+
+ pProcFile = create_proc_entry(dev->name,
+ S_IFREG | 0444, &Our_Proc_Dir);
+ pProcFile->ops = &SkInodeOps;
+ pProcFile->read_proc = proc_read;
+ pProcFile->write_proc = NULL;
+ pProcFile->nlink = 1;
+ pProcFile->size = sizeof(dev->name+1);
+ pProcFile->data = (void*)pProcFile;
+
/*
* Dummy value.
*/
@@ -433,8 +518,9 @@
base_address = pdev->base_address[0];
base_address &= PCI_BASE_ADDRESS_MEM_MASK;
+
#ifdef __sparc_v9__
- /* SPARC machines do not initialize the chache line size */
+ /* SPARC machines do not initialize the cache line size */
pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 64);
/* SPARC machines do not set "Memory write and invalidate" */
pci_read_config_word(pdev, PCI_COMMAND, &tmp);
@@ -473,17 +559,76 @@
break;
}
pAC->Index = boards_found;
-
if (SkGeBoardInit(dev, pAC)) {
FreeResources(dev);
continue;
}
- memcpy((caddr_t) &dev->dev_addr,
- (caddr_t) &pAC->Addr.CurrentMacAddress, 6);
-
+ memcpy((caddr_t) &dev->dev_addr,
+ (caddr_t) &pAC->Addr.Net[0].CurrentMacAddress, 6);
+
+ pNet->PortNr = 0;
+ pNet->NetNr = 0;
+
boards_found++;
+ /* More then one port found */
+ if ((pAC->GIni.GIMacsFound == 2 ) && (pAC->RlmtNets == 2)) {
+ if ((dev = init_etherdev(NULL, sizeof(DEV_NET))) == 0) {
+ printk(KERN_ERR "Unable to allocate etherdev "
+ "structure!\n");
+ break;
+ }
+
+ if (dev->priv == NULL)
+ dev->priv = kmalloc(sizeof(DEV_NET), GFP_KERNEL);
+
+ if (dev->priv == NULL) {
+ printk(KERN_ERR "Unable to allocate adapter "
+ "structure!\n");
+ break;
+ }
+
+ pAC->dev[1] = dev;
+ pNet = dev->priv;
+ pNet->PortNr = 1;
+ pNet->NetNr = 1;
+ pNet->pAC = pAC;
+ pNet->Mtu = 1500;
+ pNet->Up = 0;
+
+ dev->open = &SkGeOpen;
+ dev->stop = &SkGeClose;
+ dev->hard_start_xmit = &SkGeXmit;
+ dev->get_stats = &SkGeStats;
+ dev->set_multicast_list = &SkGeSetRxMode;
+ dev->set_mac_address = &SkGeSetMacAddr;
+ dev->do_ioctl = &SkGeIoctl;
+ dev->change_mtu = &SkGeChangeMtu;
+
+
+ pProcFile = create_proc_entry(dev->name,
+ S_IFREG | 0444, &Our_Proc_Dir);
+ pProcFile->ops = &SkInodeOps;
+ pProcFile->read_proc = proc_read;
+ pProcFile->write_proc = NULL;
+ pProcFile->nlink = 1;
+ pProcFile->size = sizeof(dev->name);
+ pProcFile->data = (void*)pProcFile;
+
+ memcpy((caddr_t) &dev->dev_addr,
+ (caddr_t) &pAC->Addr.Net[1].CurrentMacAddress, 6);
+
+ printk("%s: %s\n", dev->name, pAC->DeviceStr);
+ printk(" PrefPort:B RlmtMode:Dual Check Link State\n");
+
+ SkCsSetReceiveFlags(pAC,
+ SKCS_PROTO_IP | SKCS_PROTO_TCP | SKCS_PROTO_UDP,
+ &pAC->CsOfs1, &pAC->CsOfs2, 1);
+
+ }
+
+
/*
* This is bollocks, but we need to tell the net-init
* code that it shall go for the next device.
@@ -493,6 +638,9 @@
#endif
}
+
+
+
/*
* If we're at this point we're going through skge_probe() for
* the first time. Return success (0) if we've initialized 1
@@ -524,10 +672,13 @@
static void FreeResources(struct device *dev)
{
SK_U32 AllocFlag;
-SK_AC *pAC;
+
+DEV_NET *pNet;
+SK_AC *pAC;
if (dev->priv) {
- pAC = (SK_AC*) dev->priv;
+ pNet = (DEV_NET*) dev->priv;
+ pAC = pNet->pAC;
AllocFlag = pAC->AllocFlag;
if (AllocFlag & SK_ALLOC_IRQ) {
free_irq(dev->irq, dev);
@@ -542,6 +693,24 @@
} /* FreeResources */
+static struct dentry *SkgeProcLookup(struct inode *dir, struct dentry *dentry)
+{
+ return NULL;
+}
+
+static int SkgeProcFileOpen(struct inode *inode, struct file *file)
+{
+ MOD_INC_USE_COUNT;
+ return 0;
+}
+
+static int SkgeProcFileRelease(struct inode *inode, struct file *file)
+{
+ MOD_DEC_USE_COUNT;
+ return 0;
+}
+
+
#ifdef MODULE
@@ -630,7 +799,6 @@
static int debug = 0; /* not used */
static int options[SK_MAX_CARD_PARAM] = {0, }; /* not used */
-
/*****************************************************************************
*
* init_module - module initialization function
@@ -645,7 +813,6 @@
int init_module(void)
{
int cards;
-
root_dev = NULL;
/* just to avoid warnings ... */
@@ -653,9 +820,6 @@
options[0] = 0;
cards = skge_probe(NULL);
- if (cards == 0) {
- printk("No adapter found\n");
- }
return cards ? 0 : -ENODEV;
} /* init_module */
@@ -672,21 +836,29 @@
*/
void cleanup_module(void)
{
-SK_AC *pAC;
+DEV_NET *pNet;
+SK_AC *pAC;
struct device *next;
unsigned long Flags;
SK_EVPARA EvPara;
while (root_dev) {
- pAC = (SK_AC*)root_dev->priv;
+ pNet = (DEV_NET*) root_dev->priv;
+ pAC = pNet->pAC;
next = pAC->Next;
root_dev->tbusy = 1;
SkGeYellowLED(pAC, pAC->IoBase, 0);
+ remove_proc_entry(pAC->dev[0]->name, &Our_Proc_Dir);
if(pAC->BoardLevel == 2) {
/* board is still alive */
spin_lock_irqsave(&pAC->SlowPathLock, Flags);
+ EvPara.Para32[0] = 0;
+ EvPara.Para32[1] = -1;
+ SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara);
+ EvPara.Para32[0] = 1;
+ EvPara.Para32[1] = -1;
SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara);
SkEventDispatcher(pAC, pAC->IoBase);
/* disable interrupts */
@@ -696,25 +868,36 @@
pAC->BoardLevel = 0;
/* We do NOT check here, if IRQ was pending, of course*/
}
-
+
if(pAC->BoardLevel == 1) {
/* board is still alive */
SkGeDeInit(pAC, pAC->IoBase);
pAC->BoardLevel = 0;
}
-
+
+ if ((pAC->GIni.GIMacsFound == 2) && pAC->RlmtNets == 2){
+ remove_proc_entry(pAC->dev[1]->name, &Our_Proc_Dir);
+ unregister_netdev(pAC->dev[1]);
+ kfree(pAC->dev[1]);
+ }
+
FreeResources(root_dev);
-
+
root_dev->get_stats = NULL;
/*
* otherwise unregister_netdev calls get_stats with
* invalid IO ... :-(
*/
+
unregister_netdev(root_dev);
kfree(root_dev);
-
+ kfree(pAC);
root_dev = next;
}
+
+ /* clear proc-dir */
+ proc_unregister(proc_net, Our_Proc_Dir.low_ino);
+
}
#endif /* cleanup_module */
@@ -781,8 +964,6 @@
spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
- GetConfiguration(pAC);
-
/* level 1 init common modules here (HW init) */
spin_lock_irqsave(&pAC->SlowPathLock, Flags);
if (SkGeInit(pAC, pAC->IoBase, 1) != 0) {
@@ -800,6 +981,12 @@
pAC->BoardLevel = 1;
spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
+ GetConfiguration(pAC);
+ if (pAC->RlmtNets == 2) {
+ pAC->GIni.GIPortUsage = SK_MUL_LINK;
+ }
+
+
if (pAC->GIni.GIMacsFound == 2) {
Ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, pAC->Name, dev);
} else if (pAC->GIni.GIMacsFound == 1) {
@@ -825,7 +1012,7 @@
SkCsSetReceiveFlags(pAC,
SKCS_PROTO_IP | SKCS_PROTO_TCP | SKCS_PROTO_UDP,
- &pAC->CsOfs1, &pAC->CsOfs2);
+ &pAC->CsOfs1, &pAC->CsOfs2, 0);
pAC->CsOfs = (pAC->CsOfs2 << 16) | pAC->CsOfs1;
BoardInitMem(pAC);
@@ -838,13 +1025,15 @@
/* Print configuration settings */
printk(" PrefPort:%c RlmtMode:%s\n",
- 'A' + pAC->Rlmt.PrefPort,
- (pAC->RlmtMode==0) ? "ChkLink" :
- ((pAC->RlmtMode==1) ? "ChkLink" :
- ((pAC->RlmtMode==3) ? "ChkOth" :
- ((pAC->RlmtMode==7) ? "ChkSeg" : "Error"))));
+ 'A' + pAC->Rlmt.Net[0].Port[pAC->Rlmt.Net[0].PrefPort]->PortNumber,
+ (pAC->RlmtMode==0) ? "Check Link State" :
+ ((pAC->RlmtMode==1) ? "Check Link State" :
+ ((pAC->RlmtMode==3) ? "Check Local Port" :
+ ((pAC->RlmtMode==7) ? "Check Segmentation" :
+ ((pAC->RlmtMode==17) ? "Dual Check Link State" :"Error")))));
- SkGeYellowLED(pAC, pAC->IoBase, 1);
+ SkGeYellowLED(pAC, pAC->IoBase, 1);
+
/*
* Register the device here
@@ -1028,8 +1217,7 @@
DescrSize = (((sizeof(TXD) - 1) / DESCR_ALIGN) + 1) *
DESCR_ALIGN;
DescrNum = TX_RING_SIZE / DescrSize;
- }
- else {
+ } else {
DescrSize = (((sizeof(RXD) - 1) / DESCR_ALIGN) + 1) *
DESCR_ALIGN;
DescrNum = RX_RING_SIZE / DescrSize;
@@ -1048,7 +1236,8 @@
pDescr->VNextRxd = VNextDescr & 0xffffffffULL;
pDescr->pNextRxd = pNextDescr;
pDescr->TcpSumStarts = pAC->CsOfs;
- /* advance on step */
+
+ /* advance one step */
pPrevDescr = pDescr;
pDescr = pNextDescr;
pNextDescr = (RXD*) (((char*)pDescr) + DescrSize);
@@ -1123,10 +1312,12 @@
static void SkGeIsr(int irq, void *dev_id, struct pt_regs *ptregs)
{
struct device *dev = (struct device *)dev_id;
+DEV_NET *pNet;
SK_AC *pAC;
SK_U32 IntSrc; /* interrupts source register contents */
- pAC = (SK_AC*) dev->priv;
+ pNet = (DEV_NET*) dev->priv;
+ pAC = pNet->pAC;
/*
* Check and process if its our interrupt
@@ -1149,21 +1340,21 @@
SK_DBGCAT_DRV_INT_SRC,
("EOF RX1 IRQ\n"));
ReceiveIrq(pAC, &pAC->RxPort[0]);
- SK_PNMI_CNT_RX_INTR(pAC);
+ SK_PNMI_CNT_RX_INTR(pAC, 0);
}
if (IntSrc & IRQ_EOF_RX2) {
SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
SK_DBGCAT_DRV_INT_SRC,
("EOF RX2 IRQ\n"));
ReceiveIrq(pAC, &pAC->RxPort[1]);
- SK_PNMI_CNT_RX_INTR(pAC);
+ SK_PNMI_CNT_RX_INTR(pAC, 1);
}
#ifdef USE_TX_COMPLETE /* only if tx complete interrupt used */
if (IntSrc & IRQ_EOF_AS_TX1) {
SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
SK_DBGCAT_DRV_INT_SRC,
("EOF AS TX1 IRQ\n"));
- SK_PNMI_CNT_TX_INTR(pAC);
+ SK_PNMI_CNT_TX_INTR(pAC, 0);
spin_lock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock);
FreeTxDescriptors(pAC, &pAC->TxPort[0][TX_PRIO_LOW]);
spin_unlock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock);
@@ -1172,7 +1363,7 @@
SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
SK_DBGCAT_DRV_INT_SRC,
("EOF AS TX2 IRQ\n"));
- SK_PNMI_CNT_TX_INTR(pAC);
+ SK_PNMI_CNT_TX_INTR(pAC, 1);
spin_lock(&pAC->TxPort[1][TX_PRIO_LOW].TxDesRingLock);
FreeTxDescriptors(pAC, &pAC->TxPort[1][TX_PRIO_LOW]);
spin_unlock(&pAC->TxPort[1][TX_PRIO_LOW].TxDesRingLock);
@@ -1182,7 +1373,7 @@
SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
SK_DBGCAT_DRV_INT_SRC,
("EOF SY TX1 IRQ\n"));
- SK_PNMI_CNT_TX_INTR(pAC);
+ SK_PNMI_CNT_TX_INTR(pAC, 1);
spin_lock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock);
FreeTxDescriptors(pAC, 0, TX_PRIO_HIGH);
spin_unlock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock);
@@ -1192,7 +1383,7 @@
SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
SK_DBGCAT_DRV_INT_SRC,
("EOF SY TX2 IRQ\n"));
- SK_PNMI_CNT_TX_INTR(pAC);
+ SK_PNMI_CNT_TX_INTR(pAC, 1);
spin_lock(&pAC->TxPort[1][TX_PRIO_HIGH].TxDesRingLock);
FreeTxDescriptors(pAC, 1, TX_PRIO_HIGH);
spin_unlock(&pAC->TxPort[1][TX_PRIO_HIGH].TxDesRingLock);
@@ -1217,11 +1408,12 @@
if ((IntSrc & SPECIAL_IRQS) || pAC->CheckQueue) {
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_INT_SRC,
- ("SPECIAL IRQ\n"));
+ ("SPECIAL IRQ DP-Cards => %x\n", IntSrc));
pAC->CheckQueue = SK_FALSE;
spin_lock(&pAC->SlowPathLock);
- if (IntSrc & SPECIAL_IRQS)
+ if (IntSrc & SPECIAL_IRQS)
SkGeSirqIsr(pAC, pAC->IoBase, IntSrc);
+
SkEventDispatcher(pAC, pAC->IoBase);
spin_unlock(&pAC->SlowPathLock);
}
@@ -1230,29 +1422,10 @@
* came in after handling the ring (OUTs may be delayed
* in hardware buffers, but are through after IN)
*/
- ReceiveIrq(pAC, &pAC->RxPort[pAC->ActivePort]);
-// ReceiveIrq(pAC, &pAC->RxPort[1]);
+// ReceiveIrq(pAC, &pAC->RxPort[pAC->ActivePort]);
+ ReceiveIrq(pAC, &pAC->RxPort[0]);
+ ReceiveIrq(pAC, &pAC->RxPort[1]);
-#if 0
-// #ifdef USE_TX_COMPLETE /* only if tx complete interrupt used */
- spin_lock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock);
- FreeTxDescriptors(pAC, &pAC->TxPort[0][TX_PRIO_LOW]);
- spin_unlock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock);
-
- spin_lock(&pAC->TxPort[1][TX_PRIO_LOW].TxDesRingLock);
- FreeTxDescriptors(pAC, &pAC->TxPort[1][TX_PRIO_LOW]);
- spin_unlock(&pAC->TxPort[1][TX_PRIO_LOW].TxDesRingLock);
-
-#if 0 /* only if sync. queues used */
- spin_lock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock);
- FreeTxDescriptors(pAC, 0, TX_PRIO_HIGH);
- spin_unlock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock);
-
- spin_lock(&pAC->TxPort[1][TX_PRIO_HIGH].TxDesRingLock);
- FreeTxDescriptors(pAC, 1, TX_PRIO_HIGH);
- spin_unlock(&pAC->TxPort[1][TX_PRIO_HIGH].TxDesRingLock);
-#endif /* 0 */
-#endif /* USE_TX_COMPLETE */
/* IRQ is processed - Enable IRQs again*/
SK_OUT32(pAC->IoBase, B0_IMSK, IRQ_MASK);
@@ -1277,10 +1450,12 @@
static void SkGeIsrOnePort(int irq, void *dev_id, struct pt_regs *ptregs)
{
struct device *dev = (struct device *)dev_id;
+DEV_NET *pNet;
SK_AC *pAC;
SK_U32 IntSrc; /* interrupts source register contents */
- pAC = (SK_AC*) dev->priv;
+ pNet = (DEV_NET*) dev->priv;
+ pAC = pNet->pAC;
/*
* Check and process if its our interrupt
@@ -1303,14 +1478,14 @@
SK_DBGCAT_DRV_INT_SRC,
("EOF RX1 IRQ\n"));
ReceiveIrq(pAC, &pAC->RxPort[0]);
- SK_PNMI_CNT_RX_INTR(pAC);
+ SK_PNMI_CNT_RX_INTR(pAC, 0);
}
#ifdef USE_TX_COMPLETE /* only if tx complete interrupt used */
if (IntSrc & IRQ_EOF_AS_TX1) {
SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
SK_DBGCAT_DRV_INT_SRC,
("EOF AS TX1 IRQ\n"));
- SK_PNMI_CNT_TX_INTR(pAC);
+ SK_PNMI_CNT_TX_INTR(pAC, 0);
spin_lock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock);
FreeTxDescriptors(pAC, &pAC->TxPort[0][TX_PRIO_LOW]);
spin_unlock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock);
@@ -1320,7 +1495,7 @@
SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
SK_DBGCAT_DRV_INT_SRC,
("EOF SY TX1 IRQ\n"));
- SK_PNMI_CNT_TX_INTR(pAC);
+ SK_PNMI_CNT_TX_INTR(pAC, 0);
spin_lock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock);
FreeTxDescriptors(pAC, 0, TX_PRIO_HIGH);
spin_unlock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock);
@@ -1341,11 +1516,12 @@
if ((IntSrc & SPECIAL_IRQS) || pAC->CheckQueue) {
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_INT_SRC,
- ("SPECIAL IRQ\n"));
+ ("SPECIAL IRQ SP-Cards => %x\n", IntSrc));
pAC->CheckQueue = SK_FALSE;
spin_lock(&pAC->SlowPathLock);
- if (IntSrc & SPECIAL_IRQS)
+ if (IntSrc & SPECIAL_IRQS)
SkGeSirqIsr(pAC, pAC->IoBase, IntSrc);
+
SkEventDispatcher(pAC, pAC->IoBase);
spin_unlock(&pAC->SlowPathLock);
}
@@ -1356,20 +1532,6 @@
*/
ReceiveIrq(pAC, &pAC->RxPort[0]);
-#if 0
-// #ifdef USE_TX_COMPLETE /* only if tx complete interrupt used */
- spin_lock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock);
- FreeTxDescriptors(pAC, &pAC->TxPort[0][TX_PRIO_LOW]);
- spin_unlock(&pAC->TxPort[0][TX_PRIO_LOW].TxDesRingLock);
-
-#if 0 /* only if sync. queues used */
- spin_lock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock);
- FreeTxDescriptors(pAC, 0, TX_PRIO_HIGH);
- spin_unlock(&pAC->TxPort[0][TX_PRIO_HIGH].TxDesRingLock);
-
-#endif /* 0 */
-#endif /* USE_TX_COMPLETE */
-
/* IRQ is processed - Enable IRQs again*/
SK_OUT32(pAC->IoBase, B0_IMSK, IRQ_MASK);
@@ -1396,12 +1558,14 @@
static int SkGeOpen(
struct device *dev)
{
-SK_AC *pAC; /* pointer to adapter context struct */
+DEV_NET *pNet;
+SK_AC *pAC;
unsigned int Flags; /* for spin lock */
int i;
-SK_EVPARA EvPara; /* an event parameter union */
+SK_EVPARA EvPara; /* an event parameter union */
- pAC = (SK_AC*) dev->priv;
+ pNet = (DEV_NET*) dev->priv;
+ pAC = pNet->pAC;
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
("SkGeOpen: pAC=0x%lX:\n", (unsigned long)pAC));
@@ -1409,7 +1573,7 @@
if (pAC->BoardLevel == 0) {
/* level 1 init common modules here */
if (SkGeInit(pAC, pAC->IoBase, 1) != 0) {
- printk("%s: HWInit(1) failed\n", pAC->dev->name);
+ printk("%s: HWInit(1) failed\n", pAC->dev[pNet->PortNr]->name);
return (-1);
}
SkI2cInit (pAC, pAC->IoBase, 1);
@@ -1420,26 +1584,30 @@
SkTimerInit (pAC, pAC->IoBase, 1);
pAC->BoardLevel = 1;
}
-
- /* level 2 init modules here */
- SkGeInit (pAC, pAC->IoBase, 2);
- SkI2cInit (pAC, pAC->IoBase, 2);
- SkEventInit (pAC, pAC->IoBase, 2);
- SkPnmiInit (pAC, pAC->IoBase, 2);
- SkAddrInit (pAC, pAC->IoBase, 2);
- SkRlmtInit (pAC, pAC->IoBase, 2);
- SkTimerInit (pAC, pAC->IoBase, 2);
- pAC->BoardLevel = 2;
+
+ if (pAC->BoardLevel != 2) {
+ /* level 2 init modules here */
+ SkGeInit (pAC, pAC->IoBase, 2);
+ SkI2cInit (pAC, pAC->IoBase, 2);
+ SkEventInit (pAC, pAC->IoBase, 2);
+ SkPnmiInit (pAC, pAC->IoBase, 2);
+ SkAddrInit (pAC, pAC->IoBase, 2);
+ SkRlmtInit (pAC, pAC->IoBase, 2);
+ SkTimerInit (pAC, pAC->IoBase, 2);
+ pAC->BoardLevel = 2;
+ }
for (i=0; iGIni.GIMacsFound; i++) {
- // Enable transmit descriptor polling.
+ /* Enable transmit descriptor polling. */
SkGePollTxD(pAC, pAC->IoBase, i, SK_TRUE);
FillRxRing(pAC, &pAC->RxPort[i]);
+ // Enable rx pad byte stripping
+ SkXmSetRxCmd(pAC, pAC->IoBase, i, SK_STRIP_PAD_ON);
}
SkGeYellowLED(pAC, pAC->IoBase, 1);
#ifdef USE_INT_MOD
-// moderate only TX complete interrupts (these are not time critical)
+/* moderate only TX complete interrupts (these are not time critical) */
#define IRQ_MOD_MASK (IRQ_EOF_AS_TX1 | IRQ_EOF_AS_TX2)
{
unsigned long ModBase;
@@ -1455,21 +1623,32 @@
SK_OUT32(pAC->IoBase, B0_HWE_IMSK, IRQ_HWE_MASK);
spin_lock_irqsave(&pAC->SlowPathLock, Flags);
- SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara);
- if (pAC->RlmtMode != 0) {
+
+ if ((pAC->RlmtMode != 0) && (pAC->MaxPorts == 0)) {
+ EvPara.Para32[0] = pAC->RlmtNets;
+ EvPara.Para32[1] = -1;
+ SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_SET_NETS,
+ EvPara);
EvPara.Para32[0] = pAC->RlmtMode;
+ EvPara.Para32[1] = 0;
SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_MODE_CHANGE,
EvPara);
}
+
+ EvPara.Para32[0] = pNet->NetNr;
+ EvPara.Para32[1] = -1;
+ SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara);
SkEventDispatcher(pAC, pAC->IoBase);
spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
+ pAC->MaxPorts++;
+ pNet->Up = 1;
dev->tbusy = 0;
dev->interrupt = 0;
dev->start = 1;
MOD_INC_USE_COUNT;
-
+
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
("SkGeOpen suceeded\n"));
@@ -1491,54 +1670,91 @@
static int SkGeClose(
struct device *dev)
{
+DEV_NET *pNet;
SK_AC *pAC;
+
unsigned int Flags; /* for spin lock */
int i;
SK_EVPARA EvPara;
+int PortIdx;
dev->start = 0;
set_bit(0, (void*)&dev->tbusy);
- pAC = (SK_AC*) dev->priv;
+ pNet = (DEV_NET*) dev->priv;
+ pAC = pNet->pAC;
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
("SkGeClose: pAC=0x%lX ", (unsigned long)pAC));
+ if (pAC->RlmtNets == 1) {
+ PortIdx = pAC->ActivePort;
+ }
+ else {
+ PortIdx = pNet->NetNr;
+ }
/*
* Clear multicast table, promiscuous mode ....
*/
- SkAddrMcClear(pAC, pAC->IoBase, pAC->ActivePort, 0);
- SkAddrPromiscuousChange(pAC, pAC->IoBase, pAC->ActivePort,
+ SkAddrMcClear(pAC, pAC->IoBase, PortIdx, 0);
+ SkAddrPromiscuousChange(pAC, pAC->IoBase, PortIdx,
SK_PROM_MODE_NONE);
+ if (pAC->MaxPorts == 1) {
+ spin_lock_irqsave(&pAC->SlowPathLock, Flags);
+ /* disable interrupts */
+ SK_OUT32(pAC->IoBase, B0_IMSK, 0);
+ EvPara.Para32[0] = pNet->NetNr;
+ EvPara.Para32[1] = -1;
+ SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara);
+ SkEventDispatcher(pAC, pAC->IoBase);
+ SK_OUT32(pAC->IoBase, B0_IMSK, 0);
+ /* stop the hardware */
+ SkGeDeInit(pAC, pAC->IoBase);
+ pAC->BoardLevel = 0;
+ spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
+ } else {
- spin_lock_irqsave(&pAC->SlowPathLock, Flags);
- /* disable interrupts */
- SK_OUT32(pAC->IoBase, B0_IMSK, 0);
- SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara);
- SkEventDispatcher(pAC, pAC->IoBase);
- SK_OUT32(pAC->IoBase, B0_IMSK, 0);
- /* stop the hardware */
- SkGeDeInit(pAC, pAC->IoBase);
- pAC->BoardLevel = 0;
-
- spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
+ spin_lock_irqsave(&pAC->SlowPathLock, Flags);
+ EvPara.Para32[0] = pNet->NetNr;
+ EvPara.Para32[1] = -1;
+ SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara);
+ SkEventDispatcher(pAC, pAC->IoBase);
+ spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
+
+ /* Stop port */
+ spin_lock_irqsave(&pAC->TxPort[pNet->PortNr]
+ [TX_PRIO_LOW].TxDesRingLock, Flags);
+ SkGeStopPort(pAC, pAC->IoBase, pNet->PortNr,
+ SK_STOP_ALL, SK_HARD_RST);
+ spin_unlock_irqrestore(&pAC->TxPort[pNet->PortNr]
+ [TX_PRIO_LOW].TxDesRingLock, Flags);
+ }
- for (i=0; iGIni.GIMacsFound; i++) {
+ if (pAC->RlmtNets == 1) {
/* clear all descriptor rings */
- ReceiveIrq(pAC, &pAC->RxPort[i]);
- ClearRxRing(pAC, &pAC->RxPort[i]);
- ClearTxRing(pAC, &pAC->TxPort[i][TX_PRIO_LOW]);
+ for (i=0; iGIni.GIMacsFound; i++) {
+ ReceiveIrq(pAC, &pAC->RxPort[i]);
+ ClearRxRing(pAC, &pAC->RxPort[i]);
+ ClearTxRing(pAC, &pAC->TxPort[i][TX_PRIO_LOW]);
+ }
+ } else {
+ /* clear port descriptor rings */
+ ReceiveIrq(pAC, &pAC->RxPort[pNet->PortNr]);
+ ClearRxRing(pAC, &pAC->RxPort[pNet->PortNr]);
+ ClearTxRing(pAC, &pAC->TxPort[pNet->PortNr][TX_PRIO_LOW]);
}
- SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
- ("SkGeClose: done "));
+ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,("SkGeClose: done "));
+ pAC->MaxPorts--;
+ pNet->Up = 0;
MOD_DEC_USE_COUNT;
return (0);
} /* SkGeClose */
+
/*****************************************************************************
*
* SkGeXmit - Linux frame transmit function
@@ -1556,12 +1772,18 @@
*/
static int SkGeXmit(struct sk_buff *skb, struct device *dev)
{
+DEV_NET *pNet;
SK_AC *pAC;
-int Rc; /* return code of XmitFrame */
-
- pAC = (SK_AC*) dev->priv;
+int Rc; /* return code of XmitFrame */
- Rc = XmitFrame(pAC, &pAC->TxPort[pAC->ActivePort][TX_PRIO_LOW], skb);
+
+ pNet = (DEV_NET*) dev->priv;
+ pAC = pNet->pAC;
+
+ if (pAC->RlmtNets == 2)
+ Rc = XmitFrame(pAC, &pAC->TxPort[pNet->PortNr][TX_PRIO_LOW], skb);
+ else
+ Rc = XmitFrame(pAC, &pAC->TxPort[pAC->ActivePort][TX_PRIO_LOW], skb);
if (Rc <= 0) {
/* transmitter out of resources */
@@ -1618,12 +1840,13 @@
FreeTxDescriptors(pAC, pTxPort);
if (pTxPort->TxdRingFree == 0) {
spin_unlock_irqrestore(&pTxPort->TxDesRingLock, Flags);
- SK_PNMI_CNT_NO_TX_BUF(pAC);
+ SK_PNMI_CNT_NO_TX_BUF(pAC, pTxPort->PortIndex);
SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
SK_DBGCAT_DRV_TX_PROGRESS,
("XmitFrame failed\n"));
/* this message can not be sent now */
- DEV_KFREE_SKB(pMessage);
+ /* Because tbusy seems to be set, the message should not be freed here */
+ /* It will be used by the scheduler of the ethernet handler */
return (-1);
}
}
@@ -1701,9 +1924,11 @@
TXD *pTxd; /* pointer to the checked descriptor */
TXD *pNewTail; /* pointer to 'end' of the ring */
SK_U32 Control; /* TBControl field of descriptor */
+DEV_NET *pNet;
pNewTail = pTxPort->pTxdRingTail;
pTxd = pNewTail;
+ pNet = (DEV_NET*) pAC->dev[pTxPort->PortIndex]->priv;
/*
* loop forever; exits if TX_CTRL_SOFTWARE bit not set in start frame
@@ -1719,20 +1944,21 @@
* freed ( -> ring completely free now).
*/
pTxPort->pTxdRingTail = pTxd;
- pAC->dev->tbusy = 0;
+ pAC->dev[pTxPort->PortIndex]->tbusy = 0;
return;
}
if (Control & TX_CTRL_OWN_BMU) {
pTxPort->pTxdRingTail = pTxd;
if (pTxPort->TxdRingFree > 0) {
- pAC->dev->tbusy = 0;
+ pAC->dev[pTxPort->PortIndex]->tbusy = 0;
}
return;
}
-
+
DEV_KFREE_SKB(pTxd->pMBuf); /* free message */
+
pTxPort->TxdRingFree++;
- pTxd->TBControl &= ~TX_CTRL_SOFTWARE;
+ pTxd->TBControl = 0; /* reset TX_CTRL_SOFTWARE */
pTxd = pTxd->pNextTxd; /* point behind fragment with EOF */
} /* while(forever) */
} /* FreeTxDescriptors */
@@ -1796,8 +2022,8 @@
SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
SK_DBGCAT_DRV_ENTRY,
("%s: Allocation of rx buffer failed !\n",
- pAC->dev->name));
- SK_PNMI_CNT_NO_RX_BUF(pAC);
+ pAC->dev[pRxPort->PortIndex]->name));
+ SK_PNMI_CNT_NO_RX_BUF(pAC, pRxPort->PortIndex);
return(SK_FALSE);
}
skb_reserve(pMsgBlock, 2); /* to align IP frames */
@@ -1887,31 +2113,71 @@
rx_start:
/* do forever; exit if RX_CTRL_OWN_BMU found */
- while (pRxPort->RxdRingFree < pAC->RxDescrPerRing) {
- pRxd = pRxPort->pRxdRingHead;
-
+ for ( pRxd = pRxPort->pRxdRingHead ;
+ pRxPort->RxdRingFree < pAC->RxDescrPerRing ;
+ pRxd = pRxd->pNextRxd,
+ pRxPort->pRxdRingHead = pRxd,
+ pRxPort->RxdRingFree ++) {
+
+ /*
+ * For a better understanding of this loop
+ * Go through every descriptor beginning at the head
+ * Please note: the ring might be completely received so the OWN bit
+ * set is not a good crirteria to leave that loop.
+ * Therefore the RingFree counter is used.
+ * On entry of this loop pRxd is a pointer to the Rxd that needs
+ * to be checked next.
+ */
+
Control = pRxd->RBControl;
-
+
/* check if this descriptor is ready */
if ((Control & RX_CTRL_OWN_BMU) != 0) {
/* this descriptor is not yet ready */
+ /* This is the usual end of the loop */
+ /* We don't need to start the ring again */
FillRxRing(pAC, pRxPort);
return;
}
-
+
/* get length of frame and check it */
FrameLength = Control & RX_CTRL_LEN_MASK;
- if (FrameLength > pAC->RxBufSize)
+ if (FrameLength > pAC->RxBufSize) {
goto rx_failed;
+ }
/* check for STF and EOF */
if ((Control & (RX_CTRL_STF | RX_CTRL_EOF)) !=
- (RX_CTRL_STF | RX_CTRL_EOF))
+ (RX_CTRL_STF | RX_CTRL_EOF)) {
goto rx_failed;
+ }
/* here we have a complete frame in the ring */
pMsg = pRxd->pMBuf;
+
+ FrameStat = pRxd->FrameStat;
+ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 0,
+ ("Received frame of length %d on port %d\n",
+ FrameLength, PortIndex));
+ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 0,
+ ("Number of free rx descriptors: %d\n",
+ pRxPort->RxdRingFree));
+/*DumpMsg(pMsg, "Rx"); */
+ if ((Control & RX_CTRL_STAT_VALID) != RX_CTRL_STAT_VALID ||
+ (FrameStat & (XMR_FS_ANY_ERR | XMR_FS_2L_VLAN)) != 0) {
+ /* there is a receive error in this frame */
+ SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
+ SK_DBGCAT_DRV_RX_PROGRESS,
+ ("skge: Error in received frame, dropped!\n"
+ "Control: %x\nRxStat: %x\n",
+ Control, FrameStat));
+ ReQueueRxBuffer(pAC, pRxPort, pMsg,
+ pRxd->VDataHigh, pRxd->VDataLow);
+
+ continue;
+ }
+
/*
* if short frame then copy data to reduce memory waste
*/
@@ -1946,7 +2212,7 @@
if ((Csum1 & 0xfffe) && (Csum2 & 0xfffe)) {
Result = SkCsGetReceiveInfo(pAC,
&pMsg->data[14],
- Csum1, Csum2);
+ Csum1, Csum2, pRxPort->PortIndex);
if (Result ==
SKCS_STATUS_IP_FRAGMENT ||
Result ==
@@ -1962,119 +2228,85 @@
} /* IP frame */
} /* frame > SK_COPY_TRESHOLD */
- FrameStat = pRxd->FrameStat;
- pRxd = pRxd->pNextRxd;
- pRxPort->pRxdRingHead = pRxd;
- pRxPort->RxdRingFree ++;
- SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_RX_PROGRESS,
- ("Received frame of length %d on port %d\n",
- FrameLength, PortIndex));
- SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_RX_PROGRESS,
- ("Number of free rx descriptors: %d\n",
- pRxPort->RxdRingFree));
-
- if ((Control & RX_CTRL_STAT_VALID) == RX_CTRL_STAT_VALID &&
- (FrameStat &
- (XMR_FS_ANY_ERR | XMR_FS_1L_VLAN | XMR_FS_2L_VLAN))
- == 0) {
- SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
- SK_DBGCAT_DRV_RX_PROGRESS,("V"));
- ForRlmt = SK_RLMT_RX_PROTOCOL;
- IsBc = (FrameStat & XMR_FS_BC)==XMR_FS_BC;
- SK_RLMT_PRE_LOOKAHEAD(pAC, PortIndex, FrameLength,
- IsBc, &Offset, &NumBytes);
- if (NumBytes != 0) {
- IsMc = (FrameStat & XMR_FS_MC)==XMR_FS_MC;
- SK_RLMT_LOOKAHEAD(pAC, PortIndex,
- &pMsg->data[Offset],
- IsBc, IsMc, &ForRlmt);
+ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("V"));
+ ForRlmt = SK_RLMT_RX_PROTOCOL;
+ IsBc = (FrameStat & XMR_FS_BC)==XMR_FS_BC;
+ SK_RLMT_PRE_LOOKAHEAD(pAC, PortIndex, FrameLength,
+ IsBc, &Offset, &NumBytes);
+ if (NumBytes != 0) {
+ IsMc = (FrameStat & XMR_FS_MC)==XMR_FS_MC;
+ SK_RLMT_LOOKAHEAD(pAC, PortIndex,
+ &pMsg->data[Offset],
+ IsBc, IsMc, &ForRlmt);
+ }
+ if (ForRlmt == SK_RLMT_RX_PROTOCOL) {
+ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("W"));
+/* send up only frames from active port */
+ if ((PortIndex == pAC->ActivePort) ||
+ (pAC->RlmtNets == 2)) {
+ /* frame for upper layer */
+ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("U"));
+#ifdef xDEBUG
+ DumpMsg(pMsg, "Rx");
+#endif
+ SK_PNMI_CNT_RX_OCTETS_DELIVERED(pAC,
+ FrameLength, pRxPort->PortIndex);
+
+ pMsg->dev = pAC->dev[pRxPort->PortIndex];
+ pMsg->protocol = eth_type_trans(pMsg,
+ pAC->dev[pRxPort->PortIndex]);
+ netif_rx(pMsg);
+ pAC->dev[pRxPort->PortIndex]->last_rx = jiffies;
}
- if (ForRlmt == SK_RLMT_RX_PROTOCOL) {
- /* send up only frames from active port */
- if (PortIndex == pAC->ActivePort) {
- /* frame for upper layer */
- SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
- SK_DBGCAT_DRV_RX_PROGRESS,
- ("U"));
-#ifdef DUMP_RX
- DumpMsg(pMsg, "Rx");
-#endif
- pMsg->dev = pAC->dev;
- pMsg->protocol = eth_type_trans(pMsg,
- pAC->dev);
- SK_PNMI_CNT_RX_OCTETS_DELIVERED(pAC,
- FrameLength);
- netif_rx(pMsg);
- pAC->dev->last_rx = jiffies;
- }
- else {
- /* drop frame */
- SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
- SK_DBGCAT_DRV_RX_PROGRESS,
- ("D"));
- DEV_KFREE_SKB(pMsg);
- }
- } /* if not for rlmt */
else {
- /* packet for rlmt */
+ /* drop frame */
SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
- SK_DBGCAT_DRV_RX_PROGRESS, ("R"));
- pRlmtMbuf = SkDrvAllocRlmtMbuf(pAC,
- pAC->IoBase, FrameLength);
- if (pRlmtMbuf != NULL) {
- pRlmtMbuf->pNext = NULL;
- pRlmtMbuf->Length = FrameLength;
- pRlmtMbuf->PortIdx = PortIndex;
- EvPara.pParaPtr = pRlmtMbuf;
- memcpy((char*)(pRlmtMbuf->pData),
- (char*)(pMsg->data),
- FrameLength);
- SkEventQueue(pAC, SKGE_RLMT,
- SK_RLMT_PACKET_RECEIVED,
- EvPara);
- pAC->CheckQueue = SK_TRUE;
- SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
- SK_DBGCAT_DRV_RX_PROGRESS,
- ("Q"));
- }
- if ((pAC->dev->flags &
- (IFF_PROMISC | IFF_ALLMULTI)) != 0 ||
- (ForRlmt & SK_RLMT_RX_PROTOCOL) ==
- SK_RLMT_RX_PROTOCOL) {
- pMsg->dev = pAC->dev;
- pMsg->protocol = eth_type_trans(pMsg,
- pAC->dev);
- netif_rx(pMsg);
- pAC->dev->last_rx = jiffies;
- }
- else {
- DEV_KFREE_SKB(pMsg);
- }
-
- } /* if packet for rlmt */
- } /* if valid frame */
+ SK_DBGCAT_DRV_RX_PROGRESS,
+ ("D"));
+ DEV_KFREE_SKB(pMsg);
+ }
+
+ } /* if not for rlmt */
else {
- /* there is a receive error in this frame */
- if ((FrameStat & XMR_FS_1L_VLAN) != 0) {
- printk("%s: Received frame"
- " with VLAN Level 1 header, check"
- " switch configuration\n",
- pAC->dev->name);
+ /* packet for rlmt */
+ SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
+ SK_DBGCAT_DRV_RX_PROGRESS, ("R"));
+ pRlmtMbuf = SkDrvAllocRlmtMbuf(pAC,
+ pAC->IoBase, FrameLength);
+ if (pRlmtMbuf != NULL) {
+ pRlmtMbuf->pNext = NULL;
+ pRlmtMbuf->Length = FrameLength;
+ pRlmtMbuf->PortIdx = PortIndex;
+ EvPara.pParaPtr = pRlmtMbuf;
+ memcpy((char*)(pRlmtMbuf->pData),
+ (char*)(pMsg->data),
+ FrameLength);
+ SkEventQueue(pAC, SKGE_RLMT,
+ SK_RLMT_PACKET_RECEIVED,
+ EvPara);
+ pAC->CheckQueue = SK_TRUE;
+ SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
+ SK_DBGCAT_DRV_RX_PROGRESS,
+ ("Q"));
}
- if ((FrameStat & XMR_FS_2L_VLAN) != 0) {
- printk("%s: Received frame"
- " with VLAN Level 2 header, check"
- " switch configuration\n",
- pAC->dev->name);
+ if ((pAC->dev[pRxPort->PortIndex]->flags &
+ (IFF_PROMISC | IFF_ALLMULTI)) != 0 ||
+ (ForRlmt & SK_RLMT_RX_PROTOCOL) ==
+ SK_RLMT_RX_PROTOCOL) {
+ pMsg->dev = pAC->dev[pRxPort->PortIndex];
+ pMsg->protocol = eth_type_trans(pMsg,
+ pAC->dev[pRxPort->PortIndex]);
+ netif_rx(pMsg);
+ pAC->dev[pRxPort->PortIndex]->last_rx = jiffies;
}
- SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
- SK_DBGCAT_DRV_RX_PROGRESS,
- ("skge: Error in received frame, dropped!\n"
- "Control: %x\nRxStat: %x\n",
- Control, FrameStat));
- DEV_KFREE_SKB(pMsg);
- }
- } /* while */
+ else {
+ DEV_KFREE_SKB(pMsg);
+ }
+
+ } /* if packet for rlmt */
+ } /* for ... scanning the RXD ring */
+
+ /* RXD ring is empty -> fill and restart */
FillRxRing(pAC, pRxPort);
/* do not start if called from Close */
if (pAC->BoardLevel > 0) {
@@ -2106,7 +2338,7 @@
* Returns: N/A
* none
*/
-static void ClearAndStartRx(
+void ClearAndStartRx(
SK_AC *pAC, /* pointer to the adapter context */
int PortIndex) /* index of the receive port (XMAC) */
{
@@ -2227,6 +2459,7 @@
int RxRam; /* RAM used for the active port receive queue */
int i; /* loop counter */
+if (pAC->RlmtNets == 1) {
StandbyRam = SK_RLMT_STANDBY_QRXSIZE + SK_RLMT_STANDBY_QXASIZE +
SK_RLMT_STANDBY_QXSSIZE;
RemainingRam = pAC->GIni.GIRamSize -
@@ -2247,21 +2480,40 @@
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
("queue sizes settings - rx:%d txA:%d txS:%d\n",
pAC->RxQueueSize,pAC->TxAQueueSize, pAC->TxSQueueSize));
+} else {
+ RemainingRam = pAC->GIni.GIRamSize/pAC->GIni.GIMacsFound;
+ RxRam = (RemainingRam * 8 / 10) & ~7;
+ for (i=0; iGIni.GIMacsFound; i++) {
+ pAC->GIni.GP[i].PRxQSize = RxRam;
+ pAC->GIni.GP[i].PXSQSize = 0;
+ pAC->GIni.GP[i].PXAQSize = (RemainingRam - RxRam) & ~7;
+ }
+ pAC->RxQueueSize = RxRam;
+ pAC->TxSQueueSize = 0;
+ pAC->TxAQueueSize = (RemainingRam - RxRam) & ~7;
+}
for (i=0; iRxPort[i].RxFillLimit = pAC->RxDescrPerRing;
}
- for (i=0; iGIni.GIMacsFound; i++) {
- pAC->RxPort[i].RxFillLimit = pAC->RxDescrPerRing - 100;
+ if (pAC->RlmtNets == 2) {
+ for (i=0; iGIni.GIMacsFound; i++) {
+ pAC->RxPort[i].RxFillLimit = 1;
+ }
+ } else {
+ for (i=0; iGIni.GIMacsFound; i++) {
+ pAC->RxPort[i].RxFillLimit = pAC->RxDescrPerRing - 100;
+ }
+ /*
+ * Do not set the Limit to 0, because this could cause
+ * wrap around with ReQueue'ed buffers (a buffer could
+ * be requeued in the same position, made accessable to
+ * the hardware, and the hardware could change its
+ * contents!
+ */
+ pAC->RxPort[pAC->ActivePort].RxFillLimit = 1;
}
- /*
- * Do not set the Limit to 0, because this could cause
- * wrap around with ReQueue'ed buffers (a buffer could
- * be requeued in the same position, made accessable to
- * the hardware, and the hardware could change its
- * contents!
- */
- pAC->RxPort[pAC->ActivePort].RxFillLimit = 1;
+
#ifdef DEBUG
for (i=0; iGIni.GIMacsFound; i++) {
@@ -2289,19 +2541,31 @@
*/
static int SkGeSetMacAddr(struct device *dev, void *p)
{
-SK_AC *pAC = (SK_AC*) dev->priv;
+
+DEV_NET *pNet = (DEV_NET*) dev->priv;
+SK_AC *pAC = pNet->pAC;
+
struct sockaddr *addr = p;
unsigned int Flags;
+int PortIdx;
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
("SkGeSetMacAddr starts now...\n"));
if(dev->start) {
return -EBUSY;
}
+
+ if (pAC->RlmtNets == 1) {
+ PortIdx = pAC->ActivePort;
+ }
+ else {
+ PortIdx = pNet->NetNr;
+ }
+
memcpy(dev->dev_addr, addr->sa_data,dev->addr_len);
spin_lock_irqsave(&pAC->SlowPathLock, Flags);
- SkAddrOverride(pAC, pAC->IoBase, pAC->ActivePort,
+ SkAddrOverride(pAC, pAC->IoBase, PortIdx,
(SK_MAC_ADDR*)dev->dev_addr, SK_ADDR_VIRTUAL_ADDRESS);
spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
@@ -2325,37 +2589,49 @@
*/
static void SkGeSetRxMode(struct device *dev)
{
-SK_AC *pAC;
+
+DEV_NET *pNet;
+SK_AC *pAC;
+
struct dev_mc_list *pMcList;
int i;
unsigned int Flags;
+int PortIdx;
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
("SkGeSetRxMode starts now... "));
- pAC = (SK_AC*) dev->priv;
+
+ pNet = (DEV_NET*) dev->priv;
+ pAC = pNet->pAC;
+ if (pAC->RlmtNets == 1) {
+ PortIdx = pAC->ActivePort;
+ }
+ else {
+ PortIdx = pNet->NetNr;
+ }
spin_lock_irqsave(&pAC->SlowPathLock, Flags);
if (dev->flags & IFF_PROMISC) {
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
("PROMISCUOUS mode\n"));
- SkAddrPromiscuousChange(pAC, pAC->IoBase, pAC->ActivePort,
+ SkAddrPromiscuousChange(pAC, pAC->IoBase, PortIdx,
SK_PROM_MODE_LLC);
} else if (dev->flags & IFF_ALLMULTI) {
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
("ALLMULTI mode\n"));
- SkAddrPromiscuousChange(pAC, pAC->IoBase, pAC->ActivePort,
+ SkAddrPromiscuousChange(pAC, pAC->IoBase, PortIdx,
SK_PROM_MODE_ALL_MC);
} else {
- SkAddrPromiscuousChange(pAC, pAC->IoBase, pAC->ActivePort,
+ SkAddrPromiscuousChange(pAC, pAC->IoBase, PortIdx,
SK_PROM_MODE_NONE);
- SkAddrMcClear(pAC, pAC->IoBase, pAC->ActivePort, 0);
+ SkAddrMcClear(pAC, pAC->IoBase, PortIdx, 0);
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
("Number of MC entries: %d ", dev->mc_count));
pMcList = dev->mc_list;
for (i=0; imc_count; i++, pMcList = pMcList->next) {
- SkAddrMcAdd(pAC, pAC->IoBase, pAC->ActivePort,
+ SkAddrMcAdd(pAC, pAC->IoBase, PortIdx,
(SK_MAC_ADDR*)pMcList->dmi_addr, 0);
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_MCA,
("%02x:%02x:%02x:%02x:%02x:%02x\n",
@@ -2366,8 +2642,7 @@
pMcList->dmi_addr[4],
pMcList->dmi_addr[5]));
}
- SkAddrMcUpdate(pAC, pAC->IoBase, pAC->ActivePort);
-
+ SkAddrMcUpdate(pAC, pAC->IoBase, PortIdx);
}
spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
@@ -2390,6 +2665,8 @@
*/
static int SkGeChangeMtu(struct device *dev, int NewMtu)
{
+DEV_NET *pNet;
+DEV_NET *pOtherNet;
SK_AC *pAC;
unsigned int Flags;
int i;
@@ -2398,11 +2675,22 @@
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
("SkGeChangeMtu starts now...\n"));
- pAC = (SK_AC*) dev->priv;
+ pNet = (DEV_NET*) dev->priv;
+ pAC = pNet->pAC;
+
if ((NewMtu < 68) || (NewMtu > SK_JUMBO_MTU)) {
return -EINVAL;
}
+ pNet->Mtu = NewMtu;
+ pOtherNet = (DEV_NET*)pAC->dev[1 - pNet->NetNr]->priv;
+ if ((pOtherNet->Mtu > 1500) && (NewMtu <= 1500) && (pOtherNet->Up==1)) {
+ return(0);
+ }
+
+ EvPara.Para32[0] = pNet->NetNr;
+ EvPara.Para32[1] = -1;
+
pAC->RxBufSize = NewMtu + 32;
dev->mtu = NewMtu;
@@ -2414,14 +2702,27 @@
/* disable interrupts */
SK_OUT32(pAC->IoBase, B0_IMSK, 0);
spin_lock_irqsave(&pAC->SlowPathLock, Flags);
- SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara);
+
+ /* Found more than one port */
+ if ((pAC->GIni.GIMacsFound == 2 ) &&
+ (pAC->RlmtNets == 2)) {
+ /* Stop both ports */
+ EvPara.Para32[0] = 0;
+ SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara);
+ EvPara.Para32[0] = 1;
+ SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara);
+ } else {
+ SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STOP, EvPara);
+ }
+
SkEventDispatcher(pAC, pAC->IoBase);
for (i=0; iGIni.GIMacsFound; i++) {
spin_lock_irqsave(
&pAC->TxPort[i][TX_PRIO_LOW].TxDesRingLock, Flags);
+ pAC->dev[i]->tbusy = 1;
}
- pAC->dev->tbusy = 1;
+
/*
* adjust number of rx buffers allocated
@@ -2429,23 +2730,35 @@
if (NewMtu > 1500) {
/* use less rx buffers */
for (i=0; iGIni.GIMacsFound; i++) {
- if (i == pAC->ActivePort)
- pAC->RxPort[i].RxFillLimit =
- pAC->RxDescrPerRing - 100;
- else
- pAC->RxPort[i].RxFillLimit =
- pAC->RxDescrPerRing - 10;
-
+ /* Found more than one port */
+ if ((pAC->GIni.GIMacsFound == 2 ) &&
+ (pAC->RlmtNets == 2)) {
+ pAC->RxPort[i].RxFillLimit =
+ pAC->RxDescrPerRing - 100;
+ } else {
+ if (i == pAC->ActivePort)
+ pAC->RxPort[i].RxFillLimit =
+ pAC->RxDescrPerRing - 100;
+ else
+ pAC->RxPort[i].RxFillLimit =
+ pAC->RxDescrPerRing - 10;
+ }
}
}
else {
/* use normal anoumt of rx buffers */
for (i=0; iGIni.GIMacsFound; i++) {
- if (i == pAC->ActivePort)
- pAC->RxPort[i].RxFillLimit = 1;
- else
- pAC->RxPort[i].RxFillLimit =
- pAC->RxDescrPerRing - 100;
+ /* Found more than one port */
+ if ((pAC->GIni.GIMacsFound == 2 ) &&
+ (pAC->RlmtNets == 2)) {
+ pAC->RxPort[i].RxFillLimit = 1;
+ } else {
+ if (i == pAC->ActivePort)
+ pAC->RxPort[i].RxFillLimit = 1;
+ else
+ pAC->RxPort[i].RxFillLimit =
+ pAC->RxDescrPerRing - 100;
+ }
}
}
@@ -2455,7 +2768,7 @@
* enable/disable hardware support for long frames
*/
if (NewMtu > 1500) {
- pAC->JumboActivated = SK_TRUE; // is never set back !!!
+ pAC->JumboActivated = SK_TRUE; /* is never set back !!! */
pAC->GIni.GIPortUsage = SK_JUMBO_LINK;
for (i=0; iGIni.GIMacsFound; i++) {
pAC->GIni.GP[i].PRxCmd =
@@ -2463,10 +2776,14 @@
}
}
else {
- pAC->GIni.GIPortUsage = SK_RED_LINK;
+ if ((pAC->GIni.GIMacsFound == 2 ) &&
+ (pAC->RlmtNets == 2)) {
+ pAC->GIni.GIPortUsage = SK_MUL_LINK;
+ } else {
+ pAC->GIni.GIPortUsage = SK_RED_LINK;
+ }
for (i=0; iGIni.GIMacsFound; i++) {
- pAC->GIni.GP[i].PRxCmd =
- XM_RX_STRIP_FCS | XM_RX_LENERR_OK;
+ pAC->GIni.GP[i].PRxCmd = XM_RX_STRIP_FCS;
}
}
@@ -2494,9 +2811,8 @@
ClearRxRing(pAC, &pAC->RxPort[i]);
FillRxRing(pAC, &pAC->RxPort[i]);
- // Enable transmit descriptor polling.
+ /* Enable transmit descriptor polling. */
SkGePollTxD(pAC, pAC->IoBase, i, SK_TRUE);
- FillRxRing(pAC, &pAC->RxPort[i]);
};
SkGeYellowLED(pAC, pAC->IoBase, 1);
@@ -2511,7 +2827,7 @@
}
#endif
- pAC->dev->tbusy = 0;
+ pAC->dev[pNet->PortNr]->tbusy = 0;
for (i=pAC->GIni.GIMacsFound-1; i>=0; i--) {
spin_unlock_irqrestore(
&pAC->TxPort[i][TX_PRIO_LOW].TxDesRingLock, Flags);
@@ -2521,7 +2837,31 @@
SK_OUT32(pAC->IoBase, B0_IMSK, IRQ_MASK);
SK_OUT32(pAC->IoBase, B0_HWE_IMSK, IRQ_HWE_MASK);
- SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara);
+/*++++++++++++++++++++++++++++++++++++*/
+
+ /* Found more than one port */
+ if ((pAC->GIni.GIMacsFound == 2 ) &&
+ (pAC->RlmtNets == 2)) {
+ /* Start both ports */
+ EvPara.Para32[0] = pAC->RlmtNets;
+ EvPara.Para32[1] = -1;
+ SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_SET_NETS,
+ EvPara);
+
+
+ EvPara.Para32[1] = -1;
+ EvPara.Para32[0] = pNet->PortNr;
+ SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara);
+
+ if (pOtherNet->Up) {
+ EvPara.Para32[0] = pOtherNet->PortNr;
+ SkEventQueue(pAC, SKGE_RLMT,
+ SK_RLMT_START, EvPara);
+ }
+ } else {
+ SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara);
+ }
+
SkEventDispatcher(pAC, pAC->IoBase);
@@ -2544,9 +2884,11 @@
*/
static struct net_device_stats *SkGeStats(struct device *dev)
{
-SK_AC *pAC = (SK_AC*) dev->priv;
+DEV_NET *pNet = (DEV_NET*) dev->priv;
+SK_AC *pAC = pNet->pAC;
SK_PNMI_STRUCT_DATA *pPnmiStruct; /* structure for all Pnmi-Data */
-SK_PNMI_STAT *pPnmiStat; /* pointer to virtual XMAC stat. data */SK_PNMI_CONF *pPnmiConf; /* pointer to virtual link config. */
+SK_PNMI_STAT *pPnmiStat; /* pointer to virtual XMAC stat. data */
+SK_PNMI_CONF *pPnmiConf; /* pointer to virtual link config. */
unsigned int Size; /* size of pnmi struct */
unsigned int Flags; /* for spin lock */
@@ -2556,14 +2898,14 @@
memset(pPnmiStruct, 0, sizeof(SK_PNMI_STRUCT_DATA));
spin_lock_irqsave(&pAC->SlowPathLock, Flags);
Size = SK_PNMI_STRUCT_SIZE;
- SkPnmiGetStruct(pAC, pAC->IoBase, pPnmiStruct, &Size);
+ SkPnmiGetStruct(pAC, pAC->IoBase, pPnmiStruct, &Size, pNet->NetNr);
spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
pPnmiStat = &pPnmiStruct->Stat[0];
pPnmiConf = &pPnmiStruct->Conf[0];
- pAC->stats.rx_packets = (SK_U32) pPnmiStruct->RxDeliveredCts & 0xFFFFFFFF;
+ pAC->stats.rx_packets = (SK_U32) pPnmiStat->StatRxOkCts & 0xFFFFFFFF;
pAC->stats.tx_packets = (SK_U32) pPnmiStat->StatTxOkCts & 0xFFFFFFFF;
- pAC->stats.rx_bytes = (SK_U32) pPnmiStruct->RxOctetsDeliveredCts;
+ pAC->stats.rx_bytes = (SK_U32) pPnmiStat->StatRxOctetsOkCts;
pAC->stats.tx_bytes = (SK_U32) pPnmiStat->StatTxOctetsOkCts;
if (!pAC->JumboActivated) {
pAC->stats.rx_errors = (SK_U32) pPnmiStruct->InErrorsCts & 0xFFFFFFFF;
@@ -2612,14 +2954,18 @@
*/
static int SkGeIoctl(struct device *dev, struct ifreq *rq, int cmd)
{
+DEV_NET *pNet;
SK_AC *pAC;
+
SK_GE_IOCTL Ioctl;
unsigned int Err = 0;
int Size;
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
("SkGeIoctl starts now...\n"));
- pAC = (SK_AC*) dev->priv;
+
+ pNet = (DEV_NET*) dev->priv;
+ pAC = pNet->pAC;
if(copy_from_user(&Ioctl, rq->ifr_data, sizeof(SK_GE_IOCTL))) {
return -EFAULT;
@@ -2635,7 +2981,7 @@
Ioctl.Len : sizeof(pAC->PnmiStruct))) {
return -EFAULT;
}
- Size = SkGeIocMib(pAC, Ioctl.Len, cmd);
+ Size = SkGeIocMib(pNet, Ioctl.Len, cmd);
if(copy_to_user(Ioctl.pData, &pAC->PnmiStruct,
Ioctl.LenpAC;
/* access MIB */
spin_lock_irqsave(&pAC->SlowPathLock, Flags);
switch(mode) {
case SK_IOCTL_GETMIB:
- SkPnmiGetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size);
+ SkPnmiGetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size, pNet->NetNr);
break;
case SK_IOCTL_PRESETMIB:
- SkPnmiPreSetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size);
+ SkPnmiPreSetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size, pNet->NetNr);
break;
case SK_IOCTL_SETMIB:
- SkPnmiSetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size);
+ SkPnmiSetStruct(pAC, pAC->IoBase, &pAC->PnmiStruct, &Size, pNet->NetNr);
break;
default:
break;
@@ -2762,7 +3110,7 @@
AutoNeg = AN_SENS;
}
else printk("%s: Illegal value for AutoNeg_A\n",
- pAC->dev->name);
+ pAC->dev[0]->name);
}
DuplexCap = DC_BOTH;
@@ -2783,18 +3131,18 @@
DuplexCap = DC_HALF;
}
else printk("%s: Illegal value for DupCap_A\n",
- pAC->dev->name);
+ pAC->dev[0]->name);
}
/* check for illegal combinations */
if (AutoSet && AutoNeg==AN_SENS && DupSet) {
printk("%s, Port A: DuplexCapabilities"
- " ignored using Sense mode\n", pAC->dev->name);
+ " ignored using Sense mode\n", pAC->dev[0]->name);
}
if (AutoSet && AutoNeg==AN_OFF && DupSet && DuplexCap==DC_BOTH){
printk("%s, Port A: Illegal combination"
" of values AutoNeg. and DuplexCap.\n Using "
- "Full Duplex\n", pAC->dev->name);
+ "Full Duplex\n", pAC->dev[0]->name);
DuplexCap = DC_FULL;
}
@@ -2806,7 +3154,7 @@
printk("%s, Port A: Duplex setting not"
" possible in\n default AutoNegotiation mode"
" (Sense).\n Using AutoNegotiation On\n",
- pAC->dev->name);
+ pAC->dev[0]->name);
AutoNeg = AN_ON;
}
@@ -2841,7 +3189,7 @@
SK_FLOW_MODE_NONE) {
printk("%s, Port A: FlowControl"
" impossible without AutoNegotiation,"
- " disabled\n", pAC->dev->name);
+ " disabled\n", pAC->dev[0]->name);
pAC->GIni.GP[0].PFlowCtrlMode = SK_FLOW_MODE_NONE;
}
@@ -2860,7 +3208,7 @@
MSMode = SK_MS_MODE_SLAVE;
}
else printk("%s: Illegal value for Role_A\n",
- pAC->dev->name);
+ pAC->dev[0]->name);
}
pAC->GIni.GP[0].PMSMode = MSMode;
@@ -2909,12 +3257,12 @@
/* check for illegal combinations */
if (AutoSet && AutoNeg==AN_SENS && DupSet) {
printk("%s, Port B: DuplexCapabilities"
- " ignored using Sense mode\n", pAC->dev->name);
+ " ignored using Sense mode\n", pAC->dev[1]->name);
}
if (AutoSet && AutoNeg==AN_OFF && DupSet && DuplexCap==DC_BOTH){
printk("%s, Port B: Illegal combination"
" of values AutoNeg. and DuplexCap.\n Using "
- "Full Duplex\n", pAC->dev->name);
+ "Full Duplex\n", pAC->dev[1]->name);
DuplexCap = DC_FULL;
}
@@ -2926,14 +3274,14 @@
printk("%s, Port B: Duplex setting not"
" possible in\n default AutoNegotiation mode"
" (Sense).\n Using AutoNegotiation On\n",
- pAC->dev->name);
+ pAC->dev[1]->name);
AutoNeg = AN_ON;
}
-
+
/* set the desired mode */
pAC->GIni.GP[1].PLinkModeConf =
Capabilities[AutoNeg][DuplexCap];
-
+
pAC->GIni.GP[1].PFlowCtrlMode = SK_FLOW_MODE_SYM_OR_REM;
if (FlowCtrl_B != NULL && pAC->IndexIndex] != NULL) {
@@ -2961,7 +3309,7 @@
SK_FLOW_MODE_NONE) {
printk("%s, Port B: FlowControl"
" impossible without AutoNegotiation,"
- " disabled\n", pAC->dev->name);
+ " disabled\n", pAC->dev[1]->name);
pAC->GIni.GP[1].PFlowCtrlMode = SK_FLOW_MODE_NONE;
}
@@ -2980,7 +3328,7 @@
MSMode = SK_MS_MODE_SLAVE;
}
else printk("%s: Illegal value for Role_B\n",
- pAC->dev->name);
+ pAC->dev[1]->name);
}
pAC->GIni.GP[1].PMSMode = MSMode;
@@ -2991,8 +3339,8 @@
PrefPort[pAC->Index] != NULL) {
if (strcmp(PrefPort[pAC->Index],"") == 0) { /* Auto */
pAC->ActivePort = 0;
- pAC->Rlmt.MacPreferred = -1; /* auto */
- pAC->Rlmt.PrefPort = 0;
+ pAC->Rlmt.Net[0].Preference = -1; /* auto */
+ pAC->Rlmt.Net[0].PrefPort = 0;
}
else if (strcmp(PrefPort[pAC->Index],"A") == 0) {
/*
@@ -3000,8 +3348,8 @@
* switch is issued after net up.
*/
Port = 0;
- pAC->Rlmt.MacPreferred = Port;
- pAC->Rlmt.PrefPort = Port;
+ pAC->Rlmt.Net[0].Preference = Port;
+ pAC->Rlmt.Net[0].PrefPort = Port;
}
else if (strcmp(PrefPort[pAC->Index],"B") == 0) {
/*
@@ -3009,13 +3357,16 @@
* switch is issued after net up.
*/
Port = 1;
- pAC->Rlmt.MacPreferred = Port;
- pAC->Rlmt.PrefPort = Port;
+ pAC->Rlmt.Net[0].Preference = Port;
+ pAC->Rlmt.Net[0].PrefPort = Port;
}
else printk("%s: Illegal value for PrefPort\n",
- pAC->dev->name);
+ pAC->dev[0]->name);
}
-
+
+
+ pAC->RlmtNets = 1;
+
if (RlmtMode != NULL && pAC->Index |