diff -u --recursive --new-file v2.4.10/linux/CREDITS linux/CREDITS
--- v2.4.10/linux/CREDITS Sun Sep 23 11:40:54 2001
+++ linux/CREDITS Mon Oct 1 13:45:42 2001
@@ -603,6 +603,13 @@
S: Guildford, GU1 3DA
S: United Kingdom
+N: Cristian Mihail Craciunescu
+W: http://www.dnt.ro/~cristi/
+E: cristi@dnt.ro
+D: Support for Xircom PGSDB9 (firmware and host driver)
+S: Bucharest
+S: Romania
+
N: Laurence Culhane
E: loz@holmes.demon.co.uk
D: Wrote the initial alpha SLIP code
diff -u --recursive --new-file v2.4.10/linux/Documentation/Configure.help linux/Documentation/Configure.help
--- v2.4.10/linux/Documentation/Configure.help Sun Sep 23 11:40:54 2001
+++ linux/Documentation/Configure.help Mon Oct 1 13:49:14 2001
@@ -120,17 +120,30 @@
If you don't know what to do here, say N.
-APIC and IO-APIC Support on Uniprocessors
+IO-APIC Support on Uniprocessors
CONFIG_X86_UP_IOAPIC
- APIC (Advanced Programmable Interrupt Controller) is a scheme for
- delivering hardware interrupt requests to the CPU. It is commonly
- used on systems with several CPU's. If you have a single-CPU system
- which uses APIC, you can say Y here to use it. If you say Y here
- even though your machine doesn't have APIC, then the kernel will
- still run with no slowdown at all.
+ An IO-APIC (I/O Advanced Programmable Interrupt Controller) is an
+ SMP-capable replacement for PC-style interrupt controllers. Most
+ SMP systems and a small number of uniprocessor systems have one.
+ If you have a single-CPU system with an IO-APIC, you can say Y here
+ to use it. If you say Y here even though your machine doesn't have
+ an IO-APIC, then the kernel will still run with no slowdown at all.
- If you have system with several CPU's, you do not need to say Y
- here: APIC will be used automatically.
+ If you have a system with several CPUs, you do not need to say Y
+ here: the IO-APIC will be used automatically.
+
+Local APIC Support on Uniprocessors
+CONFIG_X86_UP_APIC
+ A local APIC (Advanced Programmable Interrupt Controller) is an
+ integrated interrupt controller in the CPU. If you have a single-CPU
+ system which has a processor with a local APIC, you can say Y here to
+ enable and use it. If you say Y here even though your machine doesn't
+ have a local APIC, then the kernel will still run with no slowdown at
+ all. The local APIC supports CPU-generated self-interrupts (timer,
+ performance counters), and the NMI watchdog which detects hard lockups.
+
+ If you have a system with several CPUs, you do not need to say Y
+ here: the local APIC will be used automatically.
Kernel math emulation
CONFIG_MATH_EMULATION
diff -u --recursive --new-file v2.4.10/linux/Documentation/DocBook/mousedrivers.tmpl linux/Documentation/DocBook/mousedrivers.tmpl
--- v2.4.10/linux/Documentation/DocBook/mousedrivers.tmpl Thu Jan 4 12:50:12 2001
+++ linux/Documentation/DocBook/mousedrivers.tmpl Sun Sep 30 12:26:05 2001
@@ -241,16 +241,12 @@
struct file_operations our_mouse_fops = {
- NULL, /* Mice don't seek */
- read_mouse, /* You can read a mouse */
- write_mouse, /* This won't do a lot */
- NULL, /* No readdir - not a directory */
- poll_mouse, /* Poll */
- NULL, /* No ioctl calls */
- NULL, /* No mmap */
- open_mouse, /* Called on open */
- NULL, /* Flush - 2.2+ only */
- close_mouse, /* Called on close */
+ owner: THIS_MODULE, /* Automatic usage management */
+ read: read_mouse, /* You can read a mouse */
+ write: write_mouse, /* This won't do a lot */
+ poll: poll_mouse, /* Poll */
+ open: open_mouse, /* Called on open */
+ release: close_mouse, /* Called on close */
};
@@ -262,6 +258,18 @@
configuration interfaces via ioctl calls.
+ The syntax we use is not standard C as such. GCC provides the ability
+ to initialise fields by name, and this generally makes the method table
+ much easier to read than counting through NULL pointers and remembering
+ the order by hand.
+
+
+ The owner field is used to manage the locking of module load an
+ unloading. It is obviously important that a module is not unloaded while
+ in use. When your device is opened the module specified by "owner" is
+ locked. When it is finally released the module is unlocked.
+
+
The open and close routines need to manage enabling and disabling the
interrupts for the mouse as well as stopping the mouse being unloaded
when it is no longer required.
@@ -278,12 +286,9 @@
if(mouse_users++)
return 0;
- MOD_INC_USE_COUNT;
-
if(request_irq(mouse_intr, OURMOUSE_IRQ, 0, "ourmouse", NULL))
{
mouse_users--;
- MOD_DEC_USE_COUNT;
return -EBUSY;
}
mouse_dx = 0;
@@ -301,11 +306,6 @@
0 for success.
- Firstly we use MOD_INC_USE_COUNT to ensure that
- while the mouse is open nobody will unload it and cause a nasty crash.
- We must do this before we sleep - and grabbing the interrupt might sleep.
-
-
We grab the interrupt and thus start mouse interrupts. If the interrupt
has been borrowed by some other driver then request_irq
will fail and we will return an error. If we were capable of sharing an
@@ -328,7 +328,6 @@
if(--mouse_users)
return 0;
free_irq(OURMOUSE_IRQ, NULL);
- MOD_DEC_USE_COUNT;
return 0;
}
@@ -336,8 +335,7 @@
We count off a user and provided that there are still other users need
take no further action. The last person closing the mouse causes us to
free up the interrupt. This stops interrupts from the mouse from using
- our CPU time, and lets us use MOD_DEC_USE_COUNT so
- that the mouse can now be unloaded.
+ our CPU time, and ensures that the mouse can now be unloaded.
We can fill in the write handler at this point as the write function for
@@ -718,14 +716,14 @@
struct wait_queue wait = { current, NULL };
add_wait_queue(&mouse_wait, &wait);
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
while(!mouse_event)
{
if(file->f_flags&O_NDELAY)
{
remove_wait_queue(&mouse_wait, &wait);
- current->state = TASK_RUNNING;
+ set_current_state(TASK_RUNNING);
return -EWOULDBLOCK;
}
if(signal_pending(current))
@@ -735,11 +733,11 @@
return -ERESTARTSYS;
}
schedule();
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
}
remove_wait_wait(&mouse_wait, &wait);
- current->state = TASK_RUNNING;
+ set_current_state(TASK_RUNNING);
@@ -889,18 +887,13 @@
struct file_operations our_mouse_fops = {
- NULL, /* Mice don't seek */
- read_mouse, /* You can read a mouse */
- write_mouse, /* This won't do a lot */
- NULL, /* No readdir - not a directory */
- poll_mouse, /* Poll */
- NULL, /* No ioctl calls */
- NULL, /* No mmap */
- open_mouse, /* Called on open */
- NULL, /* Flush */
- close_mouse, /* Called on close */
- NULL, /* No fsync on a mouse */
- fasync_mouse, /* Asynchronous I/O */
+ owner: THIS_MODULE
+ read: read_mouse, /* You can read a mouse */
+ write: write_mouse, /* This won't do a lot */
+ poll: poll_mouse, /* Poll */
+ open: open_mouse, /* Called on open */
+ release: close_mouse, /* Called on close */
+ fasync: fasync_mouse, /* Asynchronous I/O */
};
diff -u --recursive --new-file v2.4.10/linux/Documentation/fb/matroxfb.txt linux/Documentation/fb/matroxfb.txt
--- v2.4.10/linux/Documentation/fb/matroxfb.txt Tue Jul 3 17:08:18 2001
+++ linux/Documentation/fb/matroxfb.txt Sun Sep 30 12:26:08 2001
@@ -216,6 +216,13 @@
secondary (TV) output - if DFP is active, TV output must be
inactive and vice versa. DFP always uses same timing as primary
(monitor) output.
+dfp:X - use settings X for digital flat panel interface. X is number from
+ 0 to 0xFF, and meaning of each individual bit is described in
+ G400 manual, in description of DAC register 0x1F. For normal operation
+ you should set all bits to zero, except lowest bit. This lowest bit
+ selects who is source of display clocks, whether G400, or panel.
+ Default value is now read back from hardware - so you should specify
+ this value only if you are also using `init' parameter.
vesa:X - selects startup videomode. X is number from 0 to 0x1FF, see table
above for detailed explanation. Default is 640x480x8bpp if driver
has 8bpp support. Otherwise first available of 640x350x4bpp,
@@ -280,6 +287,8 @@
+ interlaced text mode is not supported; it looks like hardware limitation,
but I'm not sure.
+ Gxx0 SGRAM/SDRAM is not autodetected.
+ + If you are using more than one framebuffer device, you must boot kernel
+ with 'video=scrollback:0'.
+ maybe more...
And following misfeatures:
+ SVGALib does not restore screen on exit.
diff -u --recursive --new-file v2.4.10/linux/Documentation/filesystems/fat_cvf.txt linux/Documentation/filesystems/fat_cvf.txt
--- v2.4.10/linux/Documentation/filesystems/fat_cvf.txt Fri Jul 28 12:50:51 2000
+++ linux/Documentation/filesystems/fat_cvf.txt Mon Oct 1 13:45:42 2001
@@ -112,7 +112,7 @@
int (*mount_cvf) (struct super_block*sb,char*options);
int (*unmount_cvf) (struct super_block*sb);
[...]
- void (*cvf_zero_cluster) (struct inode*inode,int clusternr);
+ void (*zero_out_cluster) (struct inode*, int clusternr);
}
This structure defines the capabilities of a CVF module. It must be filled
@@ -161,8 +161,8 @@
functions. NULL means use the original FAT driver functions instead.
If you really want "no action", write a function that does nothing and
hang it in instead.
- - cvf_zero_cluster:
- The cvf_zero_cluster function is called when the fat driver wants to
+ - zero_out_cluster:
+ The zero_out_cluster function is called when the fat driver wants to
zero out a (new) cluster. This is important for directories (mkdir).
If it is NULL, the FAT driver defaults to overwriting the whole
cluster with zeros. Note that clusternr is absolute, not relative
diff -u --recursive --new-file v2.4.10/linux/Documentation/filesystems/ntfs.txt linux/Documentation/filesystems/ntfs.txt
--- v2.4.10/linux/Documentation/filesystems/ntfs.txt Sun Sep 23 11:40:54 2001
+++ linux/Documentation/filesystems/ntfs.txt Sun Sep 30 11:42:44 2001
@@ -98,6 +98,14 @@
ChangeLog
=========
+NTFS 1.1.20:
+ - Fixed two bugs in ntfs_readwrite_attr(). Thanks to Jan Kara for
+ spotting the out of bounds one.
+ - Check return value of set_blocksize() in ntfs_read_super() and make
+ use of get_hardsect_size() to determine the minimum block size.
+ - Fix return values of ntfs_vcn_to_lcn(). This should stop
+ peoples start of partition being overwritten at random.
+
NTFS 1.1.19:
- Fixed ntfs_getdir_unsorted(), ntfs_readdir() and ntfs_printcb() to
cope with arbitrary cluster sizes. Very important for Win2k+. Also,
diff -u --recursive --new-file v2.4.10/linux/Documentation/oops-tracing.txt linux/Documentation/oops-tracing.txt
--- v2.4.10/linux/Documentation/oops-tracing.txt Tue Oct 3 09:24:41 2000
+++ linux/Documentation/oops-tracing.txt Sun Sep 30 12:26:08 2001
@@ -201,3 +201,26 @@
820 4th St. N.
Fargo, ND 58122
Phone: 701-234-7556
+
+
+---------------------------------------------------------------------------
+Tainted kernels:
+
+Some oops reports contain the string 'Tainted: ' after the program
+counter, this indicates that the kernel has been tainted by some
+mechanism. The string is followed by a series of position sensitive
+characters, each representing a particular tainted value.
+
+ 1: 'G' if all modules loaded have a GPL or compatible license, 'P' if
+ any proprietary module has been loaded. Modules without a
+ MODULE_LICENSE or with a MODULE_LICENSE that is not recognised by
+ insmod as GPL compatible are assumed to be proprietary.
+
+ 2: 'F' if any module was force loaded by insmod -f, ' ' if all
+ modules were loaded normally.
+
+The primary reason for the 'Tainted: ' string is to tell kernel
+debuggers if this is a clean kernel or if anything unusual has
+occurred. Tainting is permanent, even if an offending module is
+unloading the tainted value remains to indicate that the kernel is not
+trustworthy.
diff -u --recursive --new-file v2.4.10/linux/Documentation/sysctl/kernel.txt linux/Documentation/sysctl/kernel.txt
--- v2.4.10/linux/Documentation/sysctl/kernel.txt Mon Jan 10 18:15:58 2000
+++ linux/Documentation/sysctl/kernel.txt Sun Sep 30 12:26:08 2001
@@ -39,6 +39,7 @@
- rtsig-max
- sg-big-buff [ generic SCSI device (sg) ]
- shmmax [ sysv ipc ]
+- tainted
- version
- zero-paged [ PPC only ]
@@ -217,6 +218,19 @@
on the maximum shared memory segment size that can be created.
Shared memory segments up to 1Gb are now supported in the
kernel. This value defaults to SHMMAX.
+
+==============================================================
+
+tainted:
+
+Non-zero if the kernel has been tainted. Numeric values, which
+can be ORed together:
+
+ 1 - A module with a non-GPL license has been loaded, this
+ includes modules with no license.
+ Set by modutils >= 2.4.9.
+ 2 - A module was force loaded by insmod -f.
+ Set by modutils >= 2.4.9.
==============================================================
diff -u --recursive --new-file v2.4.10/linux/MAINTAINERS linux/MAINTAINERS
--- v2.4.10/linux/MAINTAINERS Sun Sep 23 11:40:54 2001
+++ linux/MAINTAINERS Sun Sep 30 12:26:05 2001
@@ -132,6 +132,14 @@
W: http://www.uni-karlsruhe.de/~Robert.Siemer/Private/
S: Maintained
+ACP/MWAVE MODEM
+P: Paul B Schroeder
+M: paulsch@us.ibm.com
+P: Mike Sullivan
+M: sullivam@us.ibm.com
+W: http://www.ibm.com/linux/ltc/
+S: Supported
+
ACPI
P: Andy Grover
M: andrew.grover@intel.com
diff -u --recursive --new-file v2.4.10/linux/Makefile linux/Makefile
--- v2.4.10/linux/Makefile Sun Sep 23 11:40:54 2001
+++ linux/Makefile Mon Oct 1 20:04:03 2001
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 4
-SUBLEVEL = 10
-EXTRAVERSION =
+SUBLEVEL = 11
+EXTRAVERSION =-pre3
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
diff -u --recursive --new-file v2.4.10/linux/arch/alpha/kernel/process.c linux/arch/alpha/kernel/process.c
--- v2.4.10/linux/arch/alpha/kernel/process.c Sun Sep 23 11:40:55 2001
+++ linux/arch/alpha/kernel/process.c Sun Sep 30 12:26:08 2001
@@ -214,7 +214,8 @@
{
printk("\n");
printk("Pid: %d, comm: %20s\n", current->pid, current->comm);
- printk("ps: %04lx pc: [<%016lx>] CPU %d\n", regs->ps, regs->pc, smp_processor_id());
+ printk("ps: %04lx pc: [<%016lx>] CPU %d %s\n",
+ regs->ps, regs->pc, smp_processor_id(), print_tainted());
printk("rp: [<%016lx>] sp: %p\n", regs->r26, regs+1);
printk(" r0: %016lx r1: %016lx r2: %016lx r3: %016lx\n",
regs->r0, regs->r1, regs->r2, regs->r3);
diff -u --recursive --new-file v2.4.10/linux/arch/alpha/kernel/traps.c linux/arch/alpha/kernel/traps.c
--- v2.4.10/linux/arch/alpha/kernel/traps.c Sun Sep 23 11:40:55 2001
+++ linux/arch/alpha/kernel/traps.c Sun Sep 30 12:26:08 2001
@@ -53,8 +53,8 @@
void
dik_show_regs(struct pt_regs *regs, unsigned long *r9_15)
{
- printk("pc = [<%016lx>] ra = [<%016lx>] ps = %04lx\n",
- regs->pc, regs->r26, regs->ps);
+ printk("pc = [<%016lx>] ra = [<%016lx>] ps = %04lx %s\n",
+ regs->pc, regs->r26, regs->ps, print_tainted());
printk("v0 = %016lx t0 = %016lx t1 = %016lx\n",
regs->r0, regs->r1, regs->r2);
printk("t2 = %016lx t3 = %016lx t4 = %016lx\n",
diff -u --recursive --new-file v2.4.10/linux/arch/arm/kernel/process.c linux/arch/arm/kernel/process.c
--- v2.4.10/linux/arch/arm/kernel/process.c Sun Sep 23 11:40:55 2001
+++ linux/arch/arm/kernel/process.c Sun Sep 30 12:26:08 2001
@@ -158,10 +158,10 @@
flags = condition_codes(regs);
- printk("pc : [<%08lx>] lr : [<%08lx>]\n"
+ printk("pc : [<%08lx>] lr : [<%08lx>] %s\n"
"sp : %08lx ip : %08lx fp : %08lx\n",
instruction_pointer(regs),
- regs->ARM_lr, regs->ARM_sp,
+ regs->ARM_lr, print_tainted(), regs->ARM_sp,
regs->ARM_ip, regs->ARM_fp);
printk("r10: %08lx r9 : %08lx r8 : %08lx\n",
regs->ARM_r10, regs->ARM_r9,
diff -u --recursive --new-file v2.4.10/linux/arch/cris/kernel/traps.c linux/arch/cris/kernel/traps.c
--- v2.4.10/linux/arch/cris/kernel/traps.c Sun Aug 12 13:27:58 2001
+++ linux/arch/cris/kernel/traps.c Sun Sep 30 12:26:08 2001
@@ -138,8 +138,8 @@
register. */
unsigned long usp = rdusp();
- printk("IRP: %08lx SRP: %08lx DCCR: %08lx USP: %08lx MOF: %08lx\n",
- regs->irp, regs->srp, regs->dccr, usp, regs->mof );
+ printk("IRP: %08lx SRP: %08lx DCCR: %08lx USP: %08lx MOF: %08lx %s\n",
+ regs->irp, regs->srp, regs->dccr, usp, regs->mof, print_tainted());
printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n",
regs->r0, regs->r1, regs->r2, regs->r3);
printk(" r4: %08lx r5: %08lx r6: %08lx r7: %08lx\n",
diff -u --recursive --new-file v2.4.10/linux/arch/i386/config.in linux/arch/i386/config.in
--- v2.4.10/linux/arch/i386/config.in Sun Sep 23 11:40:55 2001
+++ linux/arch/i386/config.in Mon Oct 1 13:49:14 2001
@@ -170,10 +170,13 @@
bool 'MTRR (Memory Type Range Register) support' CONFIG_MTRR
bool 'Symmetric multi-processing support' CONFIG_SMP
if [ "$CONFIG_SMP" != "y" ]; then
- bool 'APIC and IO-APIC support on uniprocessors' CONFIG_X86_UP_IOAPIC
+ bool 'Local APIC support on uniprocessors' CONFIG_X86_UP_APIC
+ dep_bool 'IO-APIC support on uniprocessors' CONFIG_X86_UP_IOAPIC $CONFIG_X86_UP_APIC
+ if [ "$CONFIG_X86_UP_APIC" = "y" ]; then
+ define_bool CONFIG_X86_LOCAL_APIC y
+ fi
if [ "$CONFIG_X86_UP_IOAPIC" = "y" ]; then
define_bool CONFIG_X86_IO_APIC y
- define_bool CONFIG_X86_LOCAL_APIC y
fi
fi
diff -u --recursive --new-file v2.4.10/linux/arch/i386/defconfig linux/arch/i386/defconfig
--- v2.4.10/linux/arch/i386/defconfig Sun Sep 23 11:40:55 2001
+++ linux/arch/i386/defconfig Sun Sep 30 12:28:37 2001
@@ -311,7 +311,6 @@
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_NCR53C406A is not set
-# CONFIG_SCSI_NCR_D700 is not set
# CONFIG_SCSI_NCR53C7xx is not set
# CONFIG_SCSI_NCR53C8XX is not set
CONFIG_SCSI_SYM53C8XX=y
@@ -753,6 +752,7 @@
#
# CONFIG_USB_PEGASUS is not set
# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
# CONFIG_USB_KAWETH is not set
# CONFIG_USB_USBNET is not set
diff -u --recursive --new-file v2.4.10/linux/arch/i386/kernel/apm.c linux/arch/i386/kernel/apm.c
--- v2.4.10/linux/arch/i386/kernel/apm.c Sun Sep 23 11:40:55 2001
+++ linux/arch/i386/kernel/apm.c Sun Sep 30 12:26:42 2001
@@ -689,7 +689,6 @@
(void) apm_set_power_state(APM_STATE_OFF);
}
-#ifdef CONFIG_MAGIC_SYSRQ
/*
* Magic sysrq key and handler for the power off function
*/
@@ -703,7 +702,6 @@
help_msg: "Off",
action_msg: "Power Off\n"
};
-#endif
#ifdef CONFIG_APM_DO_ENABLE
@@ -1672,7 +1670,7 @@
apm_info.realmode_power_off = 1;
/* User can override, but default is to trust DMI */
if (apm_disabled != -1)
- apm_info.disabled = 1;
+ apm_info.disabled = apm_disabled;
/*
* Fix for the Compaq Contura 3/25c which reports BIOS version 0.1
@@ -1699,8 +1697,7 @@
}
if (apm_info.disabled) {
- if(apm_disabled == 1)
- printk(KERN_NOTICE "apm: disabled on user request.\n");
+ printk(KERN_NOTICE "apm: disabled on user request.\n");
return -ENODEV;
}
if ((smp_num_cpus > 1) && !power_off) {
diff -u --recursive --new-file v2.4.10/linux/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S
--- v2.4.10/linux/arch/i386/kernel/entry.S Sun Sep 23 11:40:55 2001
+++ linux/arch/i386/kernel/entry.S Sat Sep 29 12:59:47 2001
@@ -620,6 +620,7 @@
.long SYMBOL_NAME(sys_getdents64) /* 220 */
.long SYMBOL_NAME(sys_fcntl64)
.long SYMBOL_NAME(sys_ni_syscall) /* reserved for TUX */
+ .long SYMBOL_NAME(sys_ni_syscall) /* Reserved for Security */
.rept NR_syscalls-(.-sys_call_table)/4
.long SYMBOL_NAME(sys_ni_syscall)
diff -u --recursive --new-file v2.4.10/linux/arch/i386/kernel/pci-pc.c linux/arch/i386/kernel/pci-pc.c
--- v2.4.10/linux/arch/i386/kernel/pci-pc.c Sun Sep 23 11:40:55 2001
+++ linux/arch/i386/kernel/pci-pc.c Wed Sep 26 22:43:44 2001
@@ -261,18 +261,14 @@
u32 data;
result = pci_conf2_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn), where, 2, &data);
- *value = (u8)data;
+ *value = (u16)data;
return result;
}
static int pci_conf2_read_config_dword(struct pci_dev *dev, int where, u32 *value)
{
- int result;
- u32 data;
- result = pci_conf2_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, &data);
- *value = (u8)data;
- return result;
+ return pci_conf2_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
+ PCI_FUNC(dev->devfn), where, 4, value);
}
static int pci_conf2_write_config_byte(struct pci_dev *dev, int where, u8 value)
diff -u --recursive --new-file v2.4.10/linux/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
--- v2.4.10/linux/arch/i386/kernel/process.c Sun Sep 23 11:40:55 2001
+++ linux/arch/i386/kernel/process.c Sun Sep 30 12:26:08 2001
@@ -442,7 +442,7 @@
printk("EIP: %04x:[<%08lx>] CPU: %d",0xffff & regs->xcs,regs->eip, smp_processor_id());
if (regs->xcs & 3)
printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
- printk(" EFLAGS: %08lx\n",regs->eflags);
+ printk(" EFLAGS: %08lx %s\n",regs->eflags, print_tainted());
printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
regs->eax,regs->ebx,regs->ecx,regs->edx);
printk("ESI: %08lx EDI: %08lx EBP: %08lx",
diff -u --recursive --new-file v2.4.10/linux/arch/i386/kernel/traps.c linux/arch/i386/kernel/traps.c
--- v2.4.10/linux/arch/i386/kernel/traps.c Sun Sep 23 11:40:55 2001
+++ linux/arch/i386/kernel/traps.c Sun Sep 30 12:26:08 2001
@@ -200,8 +200,8 @@
esp = regs->esp;
ss = regs->xss & 0xffff;
}
- printk("CPU: %d\nEIP: %04x:[<%08lx>]\nEFLAGS: %08lx\n",
- smp_processor_id(), 0xffff & regs->xcs, regs->eip, regs->eflags);
+ printk("CPU: %d\nEIP: %04x:[<%08lx>] %s\nEFLAGS: %08lx\n",
+ smp_processor_id(), 0xffff & regs->xcs, regs->eip, print_tainted(), regs->eflags);
printk("eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n",
regs->eax, regs->ebx, regs->ecx, regs->edx);
printk("esi: %08lx edi: %08lx ebp: %08lx esp: %08lx\n",
diff -u --recursive --new-file v2.4.10/linux/arch/ia64/kernel/process.c linux/arch/ia64/kernel/process.c
--- v2.4.10/linux/arch/ia64/kernel/process.c Sun Aug 12 13:27:58 2001
+++ linux/arch/ia64/kernel/process.c Sun Sep 30 12:26:08 2001
@@ -63,8 +63,8 @@
{
unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri;
- printk("\npsr : %016lx ifs : %016lx ip : [<%016lx>]\n",
- regs->cr_ipsr, regs->cr_ifs, ip);
+ printk("\npsr : %016lx ifs : %016lx ip : [<%016lx>] %s\n",
+ regs->cr_ipsr, regs->cr_ifs, ip, print_tainted());
printk("unat: %016lx pfs : %016lx rsc : %016lx\n",
regs->ar_unat, regs->ar_pfs, regs->ar_rsc);
printk("rnat: %016lx bsps: %016lx pr : %016lx\n",
diff -u --recursive --new-file v2.4.10/linux/arch/m68k/kernel/process.c linux/arch/m68k/kernel/process.c
--- v2.4.10/linux/arch/m68k/kernel/process.c Sun Sep 23 11:40:55 2001
+++ linux/arch/m68k/kernel/process.c Sun Sep 30 12:26:08 2001
@@ -109,8 +109,8 @@
void show_regs(struct pt_regs * regs)
{
printk("\n");
- printk("Format %02x Vector: %04x PC: %08lx Status: %04x\n",
- regs->format, regs->vector, regs->pc, regs->sr);
+ printk("Format %02x Vector: %04x PC: %08lx Status: %04x %s\n",
+ regs->format, regs->vector, regs->pc, regs->sr, print_tainted());
printk("ORIG_D0: %08lx D0: %08lx A2: %08lx A1: %08lx\n",
regs->orig_d0, regs->d0, regs->a2, regs->a1);
printk("A0: %08lx D5: %08lx D4: %08lx\n",
diff -u --recursive --new-file v2.4.10/linux/arch/mips/mm/mips32.c linux/arch/mips/mm/mips32.c
--- v2.4.10/linux/arch/mips/mm/mips32.c Sun Sep 23 11:40:55 2001
+++ linux/arch/mips/mm/mips32.c Sun Sep 30 12:26:08 2001
@@ -739,8 +739,8 @@
regs->regs[28], regs->regs[29], regs->regs[30], regs->regs[31]);
/* Saved cp0 registers. */
- printk("epc : %08lx\nStatus: %08lx\nCause : %08lx\n",
- regs->cp0_epc, regs->cp0_status, regs->cp0_cause);
+ printk("epc : %08lx %s\nStatus: %08lx\nCause : %08lx\n",
+ regs->cp0_epc, print_tainted(), regs->cp0_status, regs->cp0_cause);
}
void add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
diff -u --recursive --new-file v2.4.10/linux/arch/mips/mm/r2300.c linux/arch/mips/mm/r2300.c
--- v2.4.10/linux/arch/mips/mm/r2300.c Sun Sep 23 11:40:55 2001
+++ linux/arch/mips/mm/r2300.c Sun Sep 30 12:26:08 2001
@@ -665,8 +665,10 @@
/*
* Saved cp0 registers
*/
- printk("epc : %08lx\nStatus: %08x\nCause : %08x\n",
- (unsigned long) regs->cp0_epc, (unsigned int) regs->cp0_status,
+ printk("epc : %08lx %s\nStatus: %08x\nCause : %08x\n",
+ (unsigned long) regs->cp0_epc,
+ print_tainted(),
+ (unsigned int) regs->cp0_status,
(unsigned int) regs->cp0_cause);
}
diff -u --recursive --new-file v2.4.10/linux/arch/mips/mm/r4xx0.c linux/arch/mips/mm/r4xx0.c
--- v2.4.10/linux/arch/mips/mm/r4xx0.c Sun Sep 23 11:40:55 2001
+++ linux/arch/mips/mm/r4xx0.c Sun Sep 30 12:26:08 2001
@@ -2364,8 +2364,8 @@
regs->regs[28], regs->regs[29], regs->regs[30], regs->regs[31]);
/* Saved cp0 registers. */
- printk("epc : %08lx\nStatus: %08lx\nCause : %08lx\n",
- regs->cp0_epc, regs->cp0_status, regs->cp0_cause);
+ printk("epc : %08lx %s\nStatus: %08lx\nCause : %08lx\n",
+ regs->cp0_epc, print_tainted(), regs->cp0_status, regs->cp0_cause);
}
void add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
diff -u --recursive --new-file v2.4.10/linux/arch/mips/mm/r5432.c linux/arch/mips/mm/r5432.c
--- v2.4.10/linux/arch/mips/mm/r5432.c Sun Sep 23 11:40:55 2001
+++ linux/arch/mips/mm/r5432.c Sun Sep 30 12:26:08 2001
@@ -765,8 +765,8 @@
regs->regs[28], regs->regs[29], regs->regs[30], regs->regs[31]);
/* Saved cp0 registers. */
- printk("epc : %08lx\nStatus: %08lx\nCause : %08lx\n",
- regs->cp0_epc, regs->cp0_status, regs->cp0_cause);
+ printk("epc : %08lx %s\nStatus: %08lx\nCause : %08lx\n",
+ regs->cp0_epc, print_tainted(), regs->cp0_status, regs->cp0_cause);
}
void add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
diff -u --recursive --new-file v2.4.10/linux/arch/mips/mm/rm7k.c linux/arch/mips/mm/rm7k.c
--- v2.4.10/linux/arch/mips/mm/rm7k.c Wed Jul 25 17:10:18 2001
+++ linux/arch/mips/mm/rm7k.c Sun Sep 30 12:26:08 2001
@@ -507,8 +507,8 @@
regs->regs[28], regs->regs[29], regs->regs[30], regs->regs[31]);
/* Saved cp0 registers. */
- printk(KERN_INFO "epc : %08lx\nStatus: %08lx\nCause : %08lx\n",
- regs->cp0_epc, regs->cp0_status, regs->cp0_cause);
+ printk(KERN_INFO "epc : %08lx %s\nStatus: %08lx\nCause : %08lx\n",
+ regs->cp0_epc, print_tainted(), regs->cp0_status, regs->cp0_cause);
}
void add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
diff -u --recursive --new-file v2.4.10/linux/arch/mips64/mm/andes.c linux/arch/mips64/mm/andes.c
--- v2.4.10/linux/arch/mips64/mm/andes.c Sun Sep 23 11:40:55 2001
+++ linux/arch/mips64/mm/andes.c Sun Sep 30 12:26:08 2001
@@ -326,8 +326,8 @@
printk("Lo : %016lx\n", regs->lo);
/* Saved cp0 registers. */
- printk("epc : %016lx\nbadvaddr: %016lx\n",
- regs->cp0_epc, regs->cp0_badvaddr);
+ printk("epc : %016lx %s\nbadvaddr: %016lx\n",
+ regs->cp0_epc, print_tainted(), regs->cp0_badvaddr);
printk("Status : %08x\nCause : %08x\n",
(unsigned int) regs->cp0_status, (unsigned int) regs->cp0_cause);
}
diff -u --recursive --new-file v2.4.10/linux/arch/mips64/mm/r4xx0.c linux/arch/mips64/mm/r4xx0.c
--- v2.4.10/linux/arch/mips64/mm/r4xx0.c Sun Sep 23 11:40:55 2001
+++ linux/arch/mips64/mm/r4xx0.c Sun Sep 30 12:26:08 2001
@@ -2109,8 +2109,8 @@
printk("Lo : %016lx\n", regs->lo);
/* Saved cp0 registers. */
- printk("epc : %016lx\nbadvaddr: %016lx\n",
- regs->cp0_epc, regs->cp0_badvaddr);
+ printk("epc : %016lx %s\nbadvaddr: %016lx\n",
+ regs->cp0_epc, print_tainted(), regs->cp0_badvaddr);
printk("Status : %08x\nCause : %08x\n",
(unsigned int) regs->cp0_status, (unsigned int) regs->cp0_cause);
}
diff -u --recursive --new-file v2.4.10/linux/arch/parisc/kernel/traps.c linux/arch/parisc/kernel/traps.c
--- v2.4.10/linux/arch/parisc/kernel/traps.c Wed Dec 6 11:46:39 2000
+++ linux/arch/parisc/kernel/traps.c Sun Sep 30 12:26:08 2001
@@ -82,7 +82,7 @@
printk(" YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI\nPSW: ");
printbinary(regs->gr[0], 32);
- printk("\n");
+ printk(" %s\n", print_tainted());
for (i = 0; i < 32; i += 4) {
int j;
diff -u --recursive --new-file v2.4.10/linux/arch/parisc/mm/pa11.c linux/arch/parisc/mm/pa11.c
--- v2.4.10/linux/arch/parisc/mm/pa11.c Tue Dec 5 12:29:39 2000
+++ linux/arch/parisc/mm/pa11.c Sun Sep 30 12:26:08 2001
@@ -127,8 +127,9 @@
/*
* Saved cp0 registers
*/
- printk("epc : %08lx\nStatus: %08x\nCause : %08x\n",
- (unsigned long) regs->cp0_epc, (unsigned int) regs->cp0_status,
+ printk("epc : %08lx %s\nStatus: %08x\nCause : %08x\n",
+ (unsigned long) regs->cp0_epc, print_tainted(),
+ (unsigned int) regs->cp0_status,
(unsigned int) regs->cp0_cause);
}
diff -u --recursive --new-file v2.4.10/linux/arch/parisc/mm/pa20.c linux/arch/parisc/mm/pa20.c
--- v2.4.10/linux/arch/parisc/mm/pa20.c Tue Dec 5 12:29:39 2000
+++ linux/arch/parisc/mm/pa20.c Sun Sep 30 12:26:08 2001
@@ -127,8 +127,9 @@
/*
* Saved cp0 registers
*/
- printk("epc : %08lx\nStatus: %08x\nCause : %08x\n",
- (unsigned long) regs->cp0_epc, (unsigned int) regs->cp0_status,
+ printk("epc : %08lx %s\nStatus: %08x\nCause : %08x\n",
+ (unsigned long) regs->cp0_epc, print_tainted(),
+ (unsigned int) regs->cp0_status,
(unsigned int) regs->cp0_cause);
}
diff -u --recursive --new-file v2.4.10/linux/arch/ppc/kernel/process.c linux/arch/ppc/kernel/process.c
--- v2.4.10/linux/arch/ppc/kernel/process.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/process.c Sun Sep 30 12:26:08 2001
@@ -243,8 +243,8 @@
{
int i;
- printk("NIP: %08lX XER: %08lX LR: %08lX SP: %08lX REGS: %p TRAP: %04lx\n",
- regs->nip, regs->xer, regs->link, regs->gpr[1], regs,regs->trap);
+ printk("NIP: %08lX XER: %08lX LR: %08lX SP: %08lX REGS: %p TRAP: %04lx %s\n",
+ regs->nip, regs->xer, regs->link, regs->gpr[1], regs,regs->trap, print_tainted());
printk("MSR: %08lx EE: %01x PR: %01x FP: %01x ME: %01x IR/DR: %01x%01x\n",
regs->msr, regs->msr&MSR_EE ? 1 : 0, regs->msr&MSR_PR ? 1 : 0,
regs->msr & MSR_FP ? 1 : 0,regs->msr&MSR_ME ? 1 : 0,
diff -u --recursive --new-file v2.4.10/linux/arch/ppc/kernel/traps.c linux/arch/ppc/kernel/traps.c
--- v2.4.10/linux/arch/ppc/kernel/traps.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/traps.c Sun Sep 30 12:26:08 2001
@@ -191,8 +191,8 @@
void
UnknownException(struct pt_regs *regs)
{
- printk("Bad trap at PC: %lx, SR: %lx, vector=%lx\n",
- regs->nip, regs->msr, regs->trap);
+ printk("Bad trap at PC: %lx, SR: %lx, vector=%lx %s\n",
+ regs->nip, regs->msr, regs->trap, print_tainted());
_exception(SIGTRAP, regs);
}
@@ -338,9 +338,9 @@
void
trace_syscall(struct pt_regs *regs)
{
- printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld\n",
+ printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n",
current, current->pid, regs->nip, regs->link, regs->gpr[0],
- regs->ccr&0x10000000?"Error=":"", regs->gpr[3]);
+ regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted());
}
#ifdef CONFIG_8xx
@@ -376,8 +376,8 @@
void
TAUException(struct pt_regs *regs)
{
- printk("TAU trap at PC: %lx, SR: %lx, vector=%lx\n",
- regs->nip, regs->msr, regs->trap);
+ printk("TAU trap at PC: %lx, SR: %lx, vector=%lx %s\n",
+ regs->nip, regs->msr, regs->trap, print_tainted());
}
#endif /* CONFIG_INT_TAU */
diff -u --recursive --new-file v2.4.10/linux/arch/ppc/mm/fault.c linux/arch/ppc/mm/fault.c
--- v2.4.10/linux/arch/ppc/mm/fault.c Tue Jul 3 17:08:18 2001
+++ linux/arch/ppc/mm/fault.c Tue Oct 2 09:12:44 2001
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fault.c 1.13 06/28/01 15:50:17 paulus
+ * BK Id: SCCS/s.fault.c 1.15 09/24/01 16:35:10 paulus
*/
/*
* arch/ppc/mm/fault.c
@@ -150,6 +150,7 @@
* make sure we exit gracefully rather than endlessly redo
* the fault.
*/
+ survive:
switch (handle_mm_fault(mm, vma, address, is_write)) {
case 1:
current->min_flt++;
@@ -195,6 +196,12 @@
*/
out_of_memory:
up_read(&mm->mmap_sem);
+ if (current->pid == 1) {
+ current->policy |= SCHED_YIELD;
+ schedule();
+ down_read(&mm->mmap_sem);
+ goto survive;
+ }
printk("VM: killing process %s\n", current->comm);
if (user_mode(regs))
do_exit(SIGKILL);
@@ -346,34 +353,3 @@
return(retval);
}
#endif /* CONFIG_8xx */
-
-#if 0
-/*
- * Misc debugging functions. Please leave them here. -- Cort
- */
-void print_pte(struct _PTE p)
-{
- printk(
-"%08x %08x vsid: %06x h: %01x api: %02x rpn: %05x rcwimg: %d%d%d%d%d%d pp: %02x\n",
- *((unsigned long *)(&p)), *((long *)&p+1),
- p.vsid, p.h, p.api, p.rpn,
- p.r,p.c,p.w,p.i,p.m,p.g,p.pp);
-}
-
-/*
- * Search the hw hash table for a mapping to the given physical
- * address. -- Cort
- */
-unsigned long htab_phys_to_va(unsigned long address)
-{
- extern PTE *Hash, *Hash_end;
- PTE *ptr;
-
- for ( ptr = Hash ; ptr < Hash_end ; ptr++ )
- {
- if ( ptr->rpn == (address>>12) )
- printk("phys %08lX -> va ???\n",
- address);
- }
-}
-#endif
diff -u --recursive --new-file v2.4.10/linux/arch/ppc/mm/init.c linux/arch/ppc/mm/init.c
--- v2.4.10/linux/arch/ppc/mm/init.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/mm/init.c Tue Oct 2 09:12:44 2001
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.init.c 1.34 08/20/01 22:12:43 paulus
+ * BK Id: SCCS/s.init.c 1.36 09/22/01 14:03:09 paulus
*/
/*
* PowerPC version
@@ -44,11 +44,14 @@
#include
#include
#include
+#include
#include "mem_pieces.h"
#include "mmu_decl.h"
#define MAX_LOW_MEM (0xF0000000UL - KERNELBASE)
+
+mmu_gather_t mmu_gathers[NR_CPUS];
void *end_of_DRAM;
unsigned long total_memory;
diff -u --recursive --new-file v2.4.10/linux/arch/ppc/mm/mmu_context.c linux/arch/ppc/mm/mmu_context.c
--- v2.4.10/linux/arch/ppc/mm/mmu_context.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/mm/mmu_context.c Tue Oct 2 09:12:44 2001
@@ -36,7 +36,7 @@
#include
mm_context_t next_mmu_context;
-unsigned long context_map[(LAST_CONTEXT+1) / (8*sizeof(unsigned long))];
+unsigned long context_map[LAST_CONTEXT / BITS_PER_LONG + 1];
#ifdef FEW_CONTEXTS
atomic_t nr_free_contexts;
struct mm_struct *context_mm[LAST_CONTEXT+1];
@@ -57,7 +57,7 @@
context_map[0] = (1 << FIRST_CONTEXT) - 1;
next_mmu_context = FIRST_CONTEXT;
#ifdef FEW_CONTEXTS
- atomic_set(&nr_free_contexts, LAST_CONTEXT);
+ atomic_set(&nr_free_contexts, LAST_CONTEXT - FIRST_CONTEXT + 1);
#endif /* FEW_CONTEXTS */
}
diff -u --recursive --new-file v2.4.10/linux/arch/ppc/mm/pgtable.c linux/arch/ppc/mm/pgtable.c
--- v2.4.10/linux/arch/ppc/mm/pgtable.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/mm/pgtable.c Tue Oct 2 09:12:44 2001
@@ -211,12 +211,12 @@
#else
if ((char *) v < _stext || (char *) v >= etext)
f |= _PAGE_RW | _PAGE_DIRTY;
-#ifndef CONFIG_8xx
+#ifdef CONFIG_PPC_STD_MMU
else
- /* On the powerpc (not 8xx), no user access
+ /* On the powerpc (not all), no user access
forces R/W kernel access */
f |= _PAGE_USER;
-#endif /* CONFIG_8xx */
+#endif /* CONFIG_PPC_STD_MMU */
#endif /* CONFIG_KGDB */
map_page(v, p, f);
v += PAGE_SIZE;
diff -u --recursive --new-file v2.4.10/linux/arch/s390/kernel/process.c linux/arch/s390/kernel/process.c
--- v2.4.10/linux/arch/s390/kernel/process.c Mon Aug 27 12:41:39 2001
+++ linux/arch/s390/kernel/process.c Sun Sep 30 12:26:08 2001
@@ -129,9 +129,10 @@
break;
case sp_psw:
if(regs)
- linelen=sprintf(buff, "%s PSW: %08lx %08lx\n", mode,
+ linelen=sprintf(buff, "%s PSW: %08lx %08lx %s\n", mode,
(unsigned long) regs->psw.mask,
- (unsigned long) regs->psw.addr);
+ (unsigned long) regs->psw.addr,
+ print_tainted());
else
linelen=sprintf(buff,"pt_regs=NULL some info unavailable\n");
break;
diff -u --recursive --new-file v2.4.10/linux/arch/s390x/kernel/process.c linux/arch/s390x/kernel/process.c
--- v2.4.10/linux/arch/s390x/kernel/process.c Mon Aug 27 12:41:39 2001
+++ linux/arch/s390x/kernel/process.c Sun Sep 30 12:26:08 2001
@@ -133,9 +133,10 @@
break;
case sp_psw:
if(regs)
- linelen=sprintf(buff, "%s PSW: %016lx %016lx\n", mode,
+ linelen=sprintf(buff, "%s PSW: %016lx %016lx %s\n", mode,
(unsigned long) regs->psw.mask,
- (unsigned long) regs->psw.addr);
+ (unsigned long) regs->psw.addr,
+ print_tainted());
else
linelen=sprintf(buff,"pt_regs=NULL some info unavailable\n");
break;
diff -u --recursive --new-file v2.4.10/linux/arch/sh/kernel/process.c linux/arch/sh/kernel/process.c
--- v2.4.10/linux/arch/sh/kernel/process.c Sun Sep 23 11:40:56 2001
+++ linux/arch/sh/kernel/process.c Sun Sep 30 12:26:08 2001
@@ -81,8 +81,8 @@
void show_regs(struct pt_regs * regs)
{
printk("\n");
- printk("PC : %08lx SP : %08lx SR : %08lx TEA : %08x\n",
- regs->pc, regs->regs[15], regs->sr, ctrl_inl(MMU_TEA));
+ printk("PC : %08lx SP : %08lx SR : %08lx TEA : %08x %s\n",
+ regs->pc, regs->regs[15], regs->sr, ctrl_inl(MMU_TEA), print_tainted());
printk("R0 : %08lx R1 : %08lx R2 : %08lx R3 : %08lx\n",
regs->regs[0],regs->regs[1],
regs->regs[2],regs->regs[3]);
diff -u --recursive --new-file v2.4.10/linux/arch/sparc/kernel/process.c linux/arch/sparc/kernel/process.c
--- v2.4.10/linux/arch/sparc/kernel/process.c Sun Feb 18 19:49:44 2001
+++ linux/arch/sparc/kernel/process.c Sun Sep 30 12:26:08 2001
@@ -268,8 +268,8 @@
void show_regs(struct pt_regs * regs)
{
- printk("PSR: %08lx PC: %08lx NPC: %08lx Y: %08lx\n", regs->psr,
- regs->pc, regs->npc, regs->y);
+ printk("PSR: %08lx PC: %08lx NPC: %08lx Y: %08lx %s\n", regs->psr,
+ regs->pc, regs->npc, regs->y, print_tainted());
printk("g0: %08lx g1: %08lx g2: %08lx g3: %08lx ",
regs->u_regs[0], regs->u_regs[1], regs->u_regs[2],
regs->u_regs[3]);
diff -u --recursive --new-file v2.4.10/linux/arch/sparc/mm/init.c linux/arch/sparc/mm/init.c
--- v2.4.10/linux/arch/sparc/mm/init.c Sun Sep 23 11:40:56 2001
+++ linux/arch/sparc/mm/init.c Mon Oct 1 09:19:56 2001
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.99 2001/07/17 16:17:33 anton Exp $
+/* $Id: init.c,v 1.100 2001/09/21 22:51:47 davem Exp $
* linux/arch/sparc/mm/init.c
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
diff -u --recursive --new-file v2.4.10/linux/arch/sparc64/defconfig linux/arch/sparc64/defconfig
--- v2.4.10/linux/arch/sparc64/defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/sparc64/defconfig Mon Oct 1 09:19:56 2001
@@ -753,6 +753,7 @@
#
CONFIG_USB_PEGASUS=m
CONFIG_USB_CATC=m
+CONFIG_USB_CDCETHER=m
CONFIG_USB_KAWETH=m
CONFIG_USB_USBNET=m
diff -u --recursive --new-file v2.4.10/linux/arch/sparc64/kernel/dtlb_backend.S linux/arch/sparc64/kernel/dtlb_backend.S
--- v2.4.10/linux/arch/sparc64/kernel/dtlb_backend.S Sun Sep 23 11:40:56 2001
+++ linux/arch/sparc64/kernel/dtlb_backend.S Mon Oct 1 09:19:56 2001
@@ -1,4 +1,4 @@
-/* $Id: dtlb_backend.S,v 1.14 2001/09/07 18:26:17 kanoj Exp $
+/* $Id: dtlb_backend.S,v 1.15 2001/09/24 21:54:09 davem Exp $
* dtlb_backend.S: Back end to DTLB miss replacement strategy.
* This is included directly into the trap table.
*
@@ -13,12 +13,14 @@
sllx %g2, 62, r1
#define FILL_VALID_SZ_BITS2(r1)
#define FILL_VALID_SZ_BITS_NOP nop
-#else /* PAGE_SHIFT */
+#elif PAGE_SHIFT == 16
#define FILL_VALID_SZ_BITS1(r1) \
or %g0, 5, r1
#define FILL_VALID_SZ_BITS2(r1) \
sllx r1, 61, r1
#define FILL_VALID_SZ_BITS_NOP
+#else
+#error unsupported PAGE_SIZE
#endif /* PAGE_SHIFT */
#define VPTE_BITS (_PAGE_CP | _PAGE_CV | _PAGE_P )
diff -u --recursive --new-file v2.4.10/linux/arch/sparc64/kernel/process.c linux/arch/sparc64/kernel/process.c
--- v2.4.10/linux/arch/sparc64/kernel/process.c Sun Sep 23 11:40:56 2001
+++ linux/arch/sparc64/kernel/process.c Sun Sep 30 12:26:08 2001
@@ -282,8 +282,8 @@
local_irq_count(smp_processor_id()),
irqs_running());
#endif
- printk("TSTATE: %016lx TPC: %016lx TNPC: %016lx Y: %08x\n", regs->tstate,
- regs->tpc, regs->tnpc, regs->y);
+ printk("TSTATE: %016lx TPC: %016lx TNPC: %016lx Y: %08x %s\n", regs->tstate,
+ regs->tpc, regs->tnpc, regs->y, print_tainted());
printk("g0: %016lx g1: %016lx g2: %016lx g3: %016lx\n",
regs->u_regs[0], regs->u_regs[1], regs->u_regs[2],
regs->u_regs[3]);
@@ -349,8 +349,8 @@
void show_regs32(struct pt_regs32 *regs)
{
- printk("PSR: %08x PC: %08x NPC: %08x Y: %08x\n", regs->psr,
- regs->pc, regs->npc, regs->y);
+ printk("PSR: %08x PC: %08x NPC: %08x Y: %08x %s\n", regs->psr,
+ regs->pc, regs->npc, regs->y, print_tainted());
printk("g0: %08x g1: %08x g2: %08x g3: %08x ",
regs->u_regs[0], regs->u_regs[1], regs->u_regs[2],
regs->u_regs[3]);
diff -u --recursive --new-file v2.4.10/linux/arch/sparc64/kernel/ptrace.c linux/arch/sparc64/kernel/ptrace.c
--- v2.4.10/linux/arch/sparc64/kernel/ptrace.c Sun Sep 23 11:40:56 2001
+++ linux/arch/sparc64/kernel/ptrace.c Mon Oct 1 09:19:56 2001
@@ -25,6 +25,7 @@
#include
#include
#include
+#include
#define MAGIC_CONSTANT 0x80000000
@@ -596,7 +597,7 @@
spitfire_put_dcache_tag(va, 0x0);
/* No need to mess with I-cache on Cheetah. */
} else {
- for (va = 0; va < (PAGE_SIZE << 1); va += 32)
+ for (va = 0; va < L1DCACHE_SIZE; va += 32)
spitfire_put_dcache_tag(va, 0x0);
if (request == PTRACE_PEEKTEXT ||
request == PTRACE_POKETEXT ||
diff -u --recursive --new-file v2.4.10/linux/arch/sparc64/kernel/setup.c linux/arch/sparc64/kernel/setup.c
--- v2.4.10/linux/arch/sparc64/kernel/setup.c Sun Sep 23 11:40:56 2001
+++ linux/arch/sparc64/kernel/setup.c Mon Oct 1 09:19:56 2001
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.66 2001/09/20 00:35:31 davem Exp $
+/* $Id: setup.c,v 1.67 2001/09/21 03:17:06 kanoj Exp $
* linux/arch/sparc64/kernel/setup.c
*
* Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu)
@@ -38,6 +38,7 @@
#include
#include
#include
+#include
#ifdef CONFIG_IP_PNP
#include
@@ -95,6 +96,14 @@
if (!(cmd = (char *)args[0]))
return -1;
+ /*
+ * The callback can be invoked on the cpu that first dropped
+ * into prom_cmdline after taking the serial interrupt, or on
+ * a slave processor that was smp_captured() if the
+ * administrator has done a switch-cpu inside obp. In either
+ * case, the cpu is marked as in-interrupt. Drop IRQ locks.
+ */
+ irq_exit(smp_processor_id(), 0);
save_and_cli(flags);
cons = console_drivers;
while (cons) {
@@ -271,6 +280,10 @@
register_console(cons);
}
restore_flags(flags);
+ /*
+ * Restore in-interrupt status for a resume from obp.
+ */
+ irq_enter(smp_processor_id(), 0);
return 0;
}
diff -u --recursive --new-file v2.4.10/linux/arch/sparc64/kernel/sparc64_ksyms.c linux/arch/sparc64/kernel/sparc64_ksyms.c
--- v2.4.10/linux/arch/sparc64/kernel/sparc64_ksyms.c Sun Sep 23 11:40:56 2001
+++ linux/arch/sparc64/kernel/sparc64_ksyms.c Mon Oct 1 09:19:56 2001
@@ -1,4 +1,4 @@
-/* $Id: sparc64_ksyms.c,v 1.111 2001/08/30 03:22:00 kanoj Exp $
+/* $Id: sparc64_ksyms.c,v 1.112 2001/09/25 23:30:23 davem Exp $
* arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -278,6 +278,7 @@
EXPORT_SYMBOL(strlen);
EXPORT_SYMBOL(strnlen);
EXPORT_SYMBOL(__strlen_user);
+EXPORT_SYMBOL(__strnlen_user);
EXPORT_SYMBOL(strcpy);
EXPORT_SYMBOL(strncpy);
EXPORT_SYMBOL(strcat);
diff -u --recursive --new-file v2.4.10/linux/arch/sparc64/kernel/sys_sparc32.c linux/arch/sparc64/kernel/sys_sparc32.c
--- v2.4.10/linux/arch/sparc64/kernel/sys_sparc32.c Mon Aug 27 12:41:40 2001
+++ linux/arch/sparc64/kernel/sys_sparc32.c Mon Oct 1 09:19:56 2001
@@ -1,4 +1,4 @@
-/* $Id: sys_sparc32.c,v 1.178 2001/08/13 14:40:07 davem Exp $
+/* $Id: sys_sparc32.c,v 1.179 2001/09/25 00:48:09 davem Exp $
* sys_sparc32.c: Conversion between 32bit and 64bit native syscalls.
*
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -4015,7 +4015,7 @@
ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count);
set_fs(old_fs);
- if (!ret && offset && put_user(of, offset))
+ if (offset && put_user(of, offset))
return -EFAULT;
return ret;
diff -u --recursive --new-file v2.4.10/linux/arch/sparc64/kernel/traps.c linux/arch/sparc64/kernel/traps.c
--- v2.4.10/linux/arch/sparc64/kernel/traps.c Sun Sep 23 11:40:56 2001
+++ linux/arch/sparc64/kernel/traps.c Mon Oct 1 09:19:56 2001
@@ -1,4 +1,4 @@
-/* $Id: traps.c,v 1.78 2001/09/14 19:49:32 kanoj Exp $
+/* $Id: traps.c,v 1.79 2001/09/21 02:14:39 kanoj Exp $
* arch/sparc64/kernel/traps.c
*
* Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu)
@@ -1636,44 +1636,6 @@
{
die_if_kernel("TL1: Tag Overflow Exception", regs);
}
-
-#ifdef CONFIG_EC_FLUSH_TRAP
-void cache_flush_trap(struct pt_regs *regs)
-{
-#ifndef CONFIG_SMP
- unsigned node = linux_cpus[get_cpuid()].prom_node;
-#else
-#error cache_flush_trap not supported on sparc64/SMP yet
-#endif
-
-#if 0
-/* Broken */
- int size = prom_getintdefault(node, "ecache-size", 512*1024);
- int i, j;
- unsigned long addr;
- struct page *page, *end;
-
- regs->tpc = regs->tnpc;
- regs->tnpc = regs->tnpc + 4;
- if (!capable(CAP_SYS_ADMIN)) return;
- size >>= PAGE_SHIFT;
- addr = PAGE_OFFSET - PAGE_SIZE;
- page = mem_map - 1;
- end = mem_map + max_mapnr;
- for (i = 0; i < size; i++) {
- do {
- addr += PAGE_SIZE;
- page++;
- if (page >= end)
- return;
- } while (!PageReserved(page));
- /* E-Cache line size is 64B. Let us pollute it :)) */
- for (j = 0; j < PAGE_SIZE; j += 64)
- __asm__ __volatile__ ("ldx [%0 + %1], %%g1" : : "r" (j), "r" (addr) : "g1");
- }
-#endif
-}
-#endif
void do_getpsr(struct pt_regs *regs)
{
diff -u --recursive --new-file v2.4.10/linux/arch/sparc64/kernel/ttable.S linux/arch/sparc64/kernel/ttable.S
--- v2.4.10/linux/arch/sparc64/kernel/ttable.S Mon Aug 27 12:41:40 2001
+++ linux/arch/sparc64/kernel/ttable.S Mon Oct 1 09:19:56 2001
@@ -1,4 +1,4 @@
-/* $Id: ttable.S,v 1.34 2001/08/12 09:08:56 davem Exp $
+/* $Id: ttable.S,v 1.35 2001/09/21 02:14:39 kanoj Exp $
* ttable.S: Sparc V9 Trap Table(s) with SpitFire/Cheetah extensions.
*
* Copyright (C) 1996, 2001 David S. Miller (davem@caip.rutgers.edu)
@@ -144,12 +144,7 @@
tl0_resv169: BTRAP(0x169) BTRAP(0x16a) BTRAP(0x16b) BTRAP(0x16c)
tl0_linux64: LINUX_64BIT_SYSCALL_TRAP
tl0_gsctx: TRAP(sparc64_get_context) TRAP(sparc64_set_context)
-tl0_resv170: BTRAP(0x170) BTRAP(0x171)
-#ifdef CONFIG_EC_FLUSH_TRAP
- TRAP(cache_flush_trap)
-#else
- BTRAP(0x172)
-#endif
+tl0_resv170: BTRAP(0x170) BTRAP(0x171) BTRAP(0x172)
tl0_resv173: BTRAP(0x173) BTRAP(0x174) BTRAP(0x175) BTRAP(0x176) BTRAP(0x177)
tl0_resv178: BTRAP(0x178) BTRAP(0x179) BTRAP(0x17a) BTRAP(0x17b) BTRAP(0x17c)
tl0_resv17d: BTRAP(0x17d) BTRAP(0x17e) BTRAP(0x17f)
diff -u --recursive --new-file v2.4.10/linux/arch/sparc64/lib/VIScopy.S linux/arch/sparc64/lib/VIScopy.S
--- v2.4.10/linux/arch/sparc64/lib/VIScopy.S Thu Nov 9 15:57:41 2000
+++ linux/arch/sparc64/lib/VIScopy.S Mon Oct 1 09:19:56 2001
@@ -1,4 +1,4 @@
-/* $Id: VIScopy.S,v 1.25 2000/11/01 09:29:19 davem Exp $
+/* $Id: VIScopy.S,v 1.26 2001/09/27 04:36:24 kanoj Exp $
* VIScopy.S: High speed copy operations utilizing the UltraSparc
* Visual Instruction Set.
*
@@ -310,17 +310,6 @@
.globl __memcpy
.type __memcpy,@function
- .globl __memcpy_384plus
- .type __memcpy_384plus,@function
-
- .globl __memcpy_16plus
- .type __memcpy_16plus,@function
-
- .globl __memcpy_short
- .type __memcpy_short,@function
-
- .globl __memcpy_entry
- .type __memcpy_entry,@function
memcpy_private:
__memcpy:
memcpy: mov ASI_P, asi_src ! IEU0 Group
@@ -395,7 +384,6 @@
.align 32
#ifdef __KERNEL__
-__memcpy_384plus:
andcc %o0, 7, %g2 ! IEU1 Group
#endif
VIS_enter:
@@ -735,9 +723,6 @@
bleu,pn %xcc, __memcpy_short ! CTI
cmp %o2, (64 * 6) ! IEU1 Group
bgeu,pn %xcc, VIS_enter ! CTI
-#ifdef __KERNEL__
-__memcpy_16plus:
-#endif
andcc %o0, 7, %g2 ! IEU1 Group
sub %o0, %o1, %g5 ! IEU0
andcc %g5, 3, %o5 ! IEU1 Group
diff -u --recursive --new-file v2.4.10/linux/arch/sparc64/lib/blockops.S linux/arch/sparc64/lib/blockops.S
--- v2.4.10/linux/arch/sparc64/lib/blockops.S Sun Sep 23 11:40:56 2001
+++ linux/arch/sparc64/lib/blockops.S Mon Oct 1 09:19:56 2001
@@ -1,4 +1,4 @@
-/* $Id: blockops.S,v 1.35 2001/09/04 16:39:53 kanoj Exp $
+/* $Id: blockops.S,v 1.36 2001/09/24 21:44:03 davem Exp $
* blockops.S: UltraSparc block zero optimized routines.
*
* Copyright (C) 1996, 1998, 1999, 2000 David S. Miller (davem@redhat.com)
@@ -25,7 +25,7 @@
#if (PAGE_SHIFT == 13) || (PAGE_SHIFT == 19)
#define PAGE_SIZE_REM 0x80
-#elif (PAGE_SHIFT == 16) || (PAGE_SHIFT == 21)
+#elif (PAGE_SHIFT == 16) || (PAGE_SHIFT == 22)
#define PAGE_SIZE_REM 0x100
#else
#error Wrong PAGE_SHIFT specified
@@ -64,7 +64,7 @@
cmp %o2, PAGE_SIZE_REM
bne,pt %xcc, 1b
add %o0, 0x40, %o0
-#if (PAGE_SHIFT == 16) || (PAGE_SHIFT == 21)
+#if (PAGE_SHIFT == 16) || (PAGE_SHIFT == 22)
TOUCH(f0, f2, f4, f6, f8, f10, f12, f14)
ldda [%o1] ASI_BLK_P, %f32
stda %f48, [%o0] ASI_BLK_P
@@ -287,7 +287,7 @@
cmp %o2, PAGE_SIZE_REM
bne,pt %xcc, 1b
add %o0, 0x40, %o0
-#if (PAGE_SHIFT == 16) || (PAGE_SHIFT == 21)
+#if (PAGE_SHIFT == 16) || (PAGE_SHIFT == 22)
TOUCH(f0, f2, f4, f6, f8, f10, f12, f14)
ldda [%o1] ASI_BLK_P, %f32
stda %f48, [%o0] ASI_BLK_P
@@ -353,7 +353,7 @@
cmp %o2, PAGE_SIZE_REM
bne,pt %xcc, 1b
add %o0, 0x40, %o0
-#if (PAGE_SHIFT == 16) || (PAGE_SHIFT == 21)
+#if (PAGE_SHIFT == 16) || (PAGE_SHIFT == 22)
TOUCH(f0, f2, f4, f6, f8, f10, f12, f14)
ldda [%o1] ASI_BLK_P, %f32
stda %f48, [%o0] ASI_BLK_COMMIT_P
diff -u --recursive --new-file v2.4.10/linux/arch/sparc64/mm/init.c linux/arch/sparc64/mm/init.c
--- v2.4.10/linux/arch/sparc64/mm/init.c Sun Sep 23 11:40:56 2001
+++ linux/arch/sparc64/mm/init.c Mon Oct 1 09:19:56 2001
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.189 2001/09/02 23:27:18 kanoj Exp $
+/* $Id: init.c,v 1.193 2001/09/25 22:47:35 davem Exp $
* arch/sparc64/mm/init.c
*
* Copyright (C) 1996-1999 David S. Miller (davem@caip.rutgers.edu)
@@ -30,6 +30,7 @@
#include
#include
#include
+#include
mmu_gather_t mmu_gathers[NR_CPUS];
@@ -113,16 +114,17 @@
if (VALID_PAGE(page) && page->mapping &&
test_bit(PG_dcache_dirty, &page->flags)) {
- __flush_dcache_page(page->virtual,
- (tlb_type == spitfire));
+#if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */
+ __flush_dcache_page(page->virtual, (tlb_type == spitfire));
+#else
+ if (tlb_type == spitfire) /* fix local I$ coherency */
+ __flush_icache_page(__get_phys((unsigned long)(page->virtual)));
+#endif
clear_bit(PG_dcache_dirty, &page->flags);
}
__update_mmu_cache(vma, address, pte);
}
-/* In arch/sparc64/mm/ultra.S */
-extern void __flush_icache_page(unsigned long);
-
void flush_icache_range(unsigned long start, unsigned long end)
{
/* Cheetah has coherent I-cache. */
@@ -887,23 +889,28 @@
* addresses. The idea is that if the vpte color and PAGE_OFFSET range
* color is the same, then when the kernel initializes the pagetable
* using the later address range, accesses with the first address
- * range will not see the newly initialized data rather than the
- * garbage.
+ * range will see the newly initialized data rather than the garbage.
*/
-
+#if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */
+#define DC_ALIAS_SHIFT 1
+#else
+#define DC_ALIAS_SHIFT 0
+#endif
pte_t *pte_alloc_one(struct mm_struct *mm, unsigned long address)
{
- struct page *page = alloc_pages(GFP_KERNEL, 1);
- unsigned long color = ((address >> (PAGE_SHIFT + 10)) & 1UL);
+ struct page *page = alloc_pages(GFP_KERNEL, DC_ALIAS_SHIFT);
+ unsigned long color = VPTE_COLOR(address);
if (page) {
unsigned long *to_free;
unsigned long paddr;
pte_t *pte;
+#if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */
set_page_count((page + 1), 1);
+#endif
paddr = (unsigned long) page_address(page);
- memset((char *)paddr, 0, (PAGE_SIZE << 1));
+ memset((char *)paddr, 0, (PAGE_SIZE << DC_ALIAS_SHIFT));
if (!color) {
pte = (pte_t *) paddr;
@@ -913,10 +920,12 @@
to_free = (unsigned long *) paddr;
}
+#if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */
/* Now free the other one up, adjust cache size. */
*to_free = (unsigned long) pte_quicklist[color ^ 0x1];
pte_quicklist[color ^ 0x1] = to_free;
pgtable_cache_size++;
+#endif
return pte;
}
diff -u --recursive --new-file v2.4.10/linux/arch/sparc64/mm/ultra.S linux/arch/sparc64/mm/ultra.S
--- v2.4.10/linux/arch/sparc64/mm/ultra.S Sun Sep 23 11:40:56 2001
+++ linux/arch/sparc64/mm/ultra.S Mon Oct 1 09:19:56 2001
@@ -1,4 +1,4 @@
-/* $Id: ultra.S,v 1.57 2001/09/06 19:27:17 kanoj Exp $
+/* $Id: ultra.S,v 1.61 2001/09/25 18:04:51 kanoj Exp $
* ultra.S: Don't expand these all over the place...
*
* Copyright (C) 1997, 2000 David S. Miller (davem@redhat.com)
@@ -237,6 +237,16 @@
retl
/*IC22*/ wrpr %g1, 0x0, %pstate
+/*
+ * The following code flushes one page_size worth.
+ */
+#if (PAGE_SHIFT == 13)
+#define ITAG_MASK 0xfe
+#elif (PAGE_SHIFT == 16)
+#define ITAG_MASK 0x7fe
+#else
+#error unsupported PAGE_SIZE
+#endif
.align 32
.globl __flush_icache_page
__flush_icache_page: /* %o0 = phys_page */
@@ -250,7 +260,7 @@
or %o0, %g1, %o0 ! VALID+phys-addr comparitor
sllx %g2, 1, %g2
- andn %g2, 0xfe, %g2 ! IC_tag mask
+ andn %g2, ITAG_MASK, %g2 ! IC_tag mask
nop
nop
nop
@@ -313,6 +323,16 @@
retl
nop
+#if (PAGE_SHIFT == 13)
+#define DTAG_MASK 0x3
+#elif (PAGE_SHIFT == 16)
+#define DTAG_MASK 0x1f
+#elif (PAGE_SHIFT == 19)
+#define DTAG_MASK 0xff
+#elif (PAGE_SHIFT == 22)
+#define DTAG_MASK 0x3ff
+#endif
+
flush_dcpage_spitfire:
clr %o4
srlx %o0, 11, %o0
@@ -323,19 +343,19 @@
add %o4, (1 << 5), %o4 ! IEU0
ldxa [%o4] ASI_DCACHE_TAG, %g2 ! LSU Group o3 available
add %o4, (1 << 5), %o4 ! IEU0
- andn %o3, 0x3, %o3 ! IEU1
+ andn %o3, DTAG_MASK, %o3 ! IEU1
ldxa [%o4] ASI_DCACHE_TAG, %g3 ! LSU Group
add %o4, (1 << 5), %o4 ! IEU0
- andn %g1, 0x3, %g1 ! IEU1
+ andn %g1, DTAG_MASK, %g1 ! IEU1
cmp %o0, %o3 ! IEU1 Group
be,a,pn %xcc, dflush1 ! CTI
sub %o4, (4 << 5), %o4 ! IEU0 (Group)
cmp %o0, %g1 ! IEU1 Group
- andn %g2, 0x3, %g2 ! IEU0
+ andn %g2, DTAG_MASK, %g2 ! IEU0
be,a,pn %xcc, dflush2 ! CTI
sub %o4, (3 << 5), %o4 ! IEU0 (Group)
cmp %o0, %g2 ! IEU1 Group
- andn %g3, 0x3, %g3 ! IEU0
+ andn %g3, DTAG_MASK, %g3 ! IEU0
be,a,pn %xcc, dflush3 ! CTI
sub %o4, (2 << 5), %o4 ! IEU0 (Group)
cmp %o0, %g3 ! IEU1 Group
diff -u --recursive --new-file v2.4.10/linux/arch/sparc64/prom/misc.c linux/arch/sparc64/prom/misc.c
--- v2.4.10/linux/arch/sparc64/prom/misc.c Wed Jul 5 22:15:25 2000
+++ linux/arch/sparc64/prom/misc.c Mon Oct 1 09:19:56 2001
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.19 2000/06/30 10:18:38 davem Exp $
+/* $Id: misc.c,v 1.20 2001/09/21 03:17:07 kanoj Exp $
* misc.c: Miscellaneous prom functions that don't belong
* anywhere else.
*
@@ -59,25 +59,15 @@
prom_palette (1);
#endif
- /* We always arrive here via a serial interrupt.
- * So in order for everything to work reliably, even
- * on SMP, we need to drop the IRQ locks we hold.
- */
#ifdef CONFIG_SMP
- irq_exit(smp_processor_id(), 0);
smp_capture();
-#else
- local_irq_count(smp_processor_id())--;
#endif
p1275_cmd ("enter", P1275_INOUT(0,0));
#ifdef CONFIG_SMP
smp_release();
- irq_enter(smp_processor_id(), 0);
spin_unlock_wait(&__br_write_locks[BR_GLOBALIRQ_LOCK].lock);
-#else
- local_irq_count(smp_processor_id())++;
#endif
#ifdef CONFIG_SUN_CONSOLE
diff -u --recursive --new-file v2.4.10/linux/drivers/block/genhd.c linux/drivers/block/genhd.c
--- v2.4.10/linux/drivers/block/genhd.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/block/genhd.c Mon Oct 1 10:19:22 2001
@@ -47,9 +47,27 @@
void
add_gendisk(struct gendisk *gp)
{
+ struct gendisk *sgp;
+
write_lock(&gendisk_lock);
+
+ /*
+ * In 2.5 this will go away. Fix the drivers who rely on
+ * old behaviour.
+ */
+
+ for (sgp = gendisk_head; sgp; sgp = sgp->next)
+ {
+ if (sgp == gp)
+ {
+// printk(KERN_ERR "add_gendisk: device major %d is buggy and added a live gendisk!\n",
+// sgp->major)
+ goto out;
+ }
+ }
gp->next = gendisk_head;
gendisk_head = gp;
+out:
write_unlock(&gendisk_lock);
}
diff -u --recursive --new-file v2.4.10/linux/drivers/block/loop.c linux/drivers/block/loop.c
--- v2.4.10/linux/drivers/block/loop.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/block/loop.c Fri Sep 28 11:21:40 2001
@@ -719,7 +719,7 @@
return err;
}
-static int loop_clr_fd(struct loop_device *lo, kdev_t dev)
+static int loop_clr_fd(struct loop_device *lo, struct block_device *bdev)
{
struct file *filp = lo->lo_backing_file;
int gfp = lo->old_gfp_mask;
@@ -752,7 +752,7 @@
memset(lo->lo_encrypt_key, 0, LO_KEY_SIZE);
memset(lo->lo_name, 0, LO_NAME_SIZE);
loop_sizes[lo->lo_number] = 0;
- invalidate_buffers(dev);
+ invalidate_bdev(bdev, 0);
filp->f_dentry->d_inode->i_mapping->gfp_mask = gfp;
lo->lo_state = Lo_unbound;
fput(filp);
@@ -852,7 +852,7 @@
err = loop_set_fd(lo, file, inode->i_rdev, arg);
break;
case LOOP_CLR_FD:
- err = loop_clr_fd(lo, inode->i_rdev);
+ err = loop_clr_fd(lo, inode->i_bdev);
break;
case LOOP_SET_STATUS:
err = loop_set_status(lo, (struct loop_info *) arg);
diff -u --recursive --new-file v2.4.10/linux/drivers/char/mwave/3780i.c linux/drivers/char/mwave/3780i.c
--- v2.4.10/linux/drivers/char/mwave/3780i.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/mwave/3780i.c Sun Sep 30 12:26:05 2001
@@ -0,0 +1,730 @@
+/*
+*
+* 3780i.c -- helper routines for the 3780i DSP
+*
+*
+* Written By: Mike Sullivan IBM Corporation
+*
+* Copyright (C) 1999 IBM Corporation
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* NO WARRANTY
+* THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
+* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
+* LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+* solely responsible for determining the appropriateness of using and
+* distributing the Program and assumes all risks associated with its
+* exercise of rights under this Agreement, including but not limited to
+* the risks and costs of program errors, damage to or loss of data,
+* programs or equipment, and unavailability or interruption of operations.
+*
+* DISCLAIMER OF LIABILITY
+* NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+* USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+* HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*
+*
+* 10/23/2000 - Alpha Release
+* First release to the public
+*/
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "smapi.h"
+#include "mwavedd.h"
+#include "3780i.h"
+
+static spinlock_t dsp_lock = SPIN_LOCK_UNLOCKED;
+static unsigned long flags;
+
+
+static void PaceMsaAccess(unsigned short usDspBaseIO)
+{
+ if(current->need_resched)
+ schedule();
+ udelay(100);
+ if(current->need_resched)
+ schedule();
+}
+
+unsigned short dsp3780I_ReadMsaCfg(unsigned short usDspBaseIO,
+ unsigned long ulMsaAddr)
+{
+ unsigned short val;
+
+ PRINTK_3(TRACE_3780I,
+ "3780i::dsp3780I_ReadMsaCfg entry usDspBaseIO %x ulMsaAddr %lx\n",
+ usDspBaseIO, ulMsaAddr);
+
+ spin_lock_irqsave(&dsp_lock, flags);
+ OutWordDsp(DSP_MsaAddrLow, (unsigned short) ulMsaAddr);
+ OutWordDsp(DSP_MsaAddrHigh, (unsigned short) (ulMsaAddr >> 16));
+ val = InWordDsp(DSP_MsaDataDSISHigh);
+ spin_unlock_irqrestore(&dsp_lock, flags);
+
+ PRINTK_2(TRACE_3780I, "3780i::dsp3780I_ReadMsaCfg exit val %x\n", val);
+
+ return val;
+}
+
+void dsp3780I_WriteMsaCfg(unsigned short usDspBaseIO,
+ unsigned long ulMsaAddr, unsigned short usValue)
+{
+
+ PRINTK_4(TRACE_3780I,
+ "3780i::dsp3780i_WriteMsaCfg entry usDspBaseIO %x ulMsaAddr %lx usValue %x\n",
+ usDspBaseIO, ulMsaAddr, usValue);
+
+ spin_lock_irqsave(&dsp_lock, flags);
+ OutWordDsp(DSP_MsaAddrLow, (unsigned short) ulMsaAddr);
+ OutWordDsp(DSP_MsaAddrHigh, (unsigned short) (ulMsaAddr >> 16));
+ OutWordDsp(DSP_MsaDataDSISHigh, usValue);
+ spin_unlock_irqrestore(&dsp_lock, flags);
+}
+
+void dsp3780I_WriteGenCfg(unsigned short usDspBaseIO, unsigned uIndex,
+ unsigned char ucValue)
+{
+ DSP_ISA_SLAVE_CONTROL rSlaveControl;
+ DSP_ISA_SLAVE_CONTROL rSlaveControl_Save;
+
+
+ PRINTK_4(TRACE_3780I,
+ "3780i::dsp3780i_WriteGenCfg entry usDspBaseIO %x uIndex %x ucValue %x\n",
+ usDspBaseIO, uIndex, ucValue);
+
+ MKBYTE(rSlaveControl) = InByteDsp(DSP_IsaSlaveControl);
+
+ PRINTK_2(TRACE_3780I,
+ "3780i::dsp3780i_WriteGenCfg rSlaveControl %x\n",
+ MKBYTE(rSlaveControl));
+
+ rSlaveControl_Save = rSlaveControl;
+ rSlaveControl.ConfigMode = TRUE;
+
+ PRINTK_2(TRACE_3780I,
+ "3780i::dsp3780i_WriteGenCfg entry rSlaveControl+ConfigMode %x\n",
+ MKBYTE(rSlaveControl));
+
+ OutByteDsp(DSP_IsaSlaveControl, MKBYTE(rSlaveControl));
+ OutByteDsp(DSP_ConfigAddress, (unsigned char) uIndex);
+ OutByteDsp(DSP_ConfigData, ucValue);
+ OutByteDsp(DSP_IsaSlaveControl, MKBYTE(rSlaveControl_Save));
+
+ PRINTK_1(TRACE_3780I, "3780i::dsp3780i_WriteGenCfg exit\n");
+
+
+}
+
+unsigned char dsp3780I_ReadGenCfg(unsigned short usDspBaseIO,
+ unsigned uIndex)
+{
+ DSP_ISA_SLAVE_CONTROL rSlaveControl;
+ DSP_ISA_SLAVE_CONTROL rSlaveControl_Save;
+ unsigned char ucValue;
+
+
+ PRINTK_3(TRACE_3780I,
+ "3780i::dsp3780i_ReadGenCfg entry usDspBaseIO %x uIndex %x\n",
+ usDspBaseIO, uIndex);
+
+ MKBYTE(rSlaveControl) = InByteDsp(DSP_IsaSlaveControl);
+ rSlaveControl_Save = rSlaveControl;
+ rSlaveControl.ConfigMode = TRUE;
+ OutByteDsp(DSP_IsaSlaveControl, MKBYTE(rSlaveControl));
+ OutByteDsp(DSP_ConfigAddress, (unsigned char) uIndex);
+ ucValue = InByteDsp(DSP_ConfigData);
+ OutByteDsp(DSP_IsaSlaveControl, MKBYTE(rSlaveControl_Save));
+
+ PRINTK_2(TRACE_3780I,
+ "3780i::dsp3780i_ReadGenCfg exit ucValue %x\n", ucValue);
+
+
+ return ucValue;
+}
+
+int dsp3780I_EnableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings,
+ unsigned short *pIrqMap,
+ unsigned short *pDmaMap)
+{
+ unsigned short usDspBaseIO = pSettings->usDspBaseIO;
+ int i;
+ DSP_UART_CFG_1 rUartCfg1;
+ DSP_UART_CFG_2 rUartCfg2;
+ DSP_HBRIDGE_CFG_1 rHBridgeCfg1;
+ DSP_HBRIDGE_CFG_2 rHBridgeCfg2;
+ DSP_BUSMASTER_CFG_1 rBusmasterCfg1;
+ DSP_BUSMASTER_CFG_2 rBusmasterCfg2;
+ DSP_ISA_PROT_CFG rIsaProtCfg;
+ DSP_POWER_MGMT_CFG rPowerMgmtCfg;
+ DSP_HBUS_TIMER_CFG rHBusTimerCfg;
+ DSP_LBUS_TIMEOUT_DISABLE rLBusTimeoutDisable;
+ DSP_CHIP_RESET rChipReset;
+ DSP_CLOCK_CONTROL_1 rClockControl1;
+ DSP_CLOCK_CONTROL_2 rClockControl2;
+ DSP_ISA_SLAVE_CONTROL rSlaveControl;
+ DSP_HBRIDGE_CONTROL rHBridgeControl;
+ unsigned short ChipID = 0;
+ unsigned short tval;
+
+
+ PRINTK_2(TRACE_3780I,
+ "3780i::dsp3780I_EnableDSP entry pSettings->bDSPEnabled %x\n",
+ pSettings->bDSPEnabled);
+
+
+ if (!pSettings->bDSPEnabled) {
+ PRINTK_ERROR( KERN_ERR "3780i::dsp3780I_EnableDSP: Error: DSP not enabled. Aborting.\n" );
+ return -EIO;
+ }
+
+
+ PRINTK_2(TRACE_3780I,
+ "3780i::dsp3780i_EnableDSP entry pSettings->bModemEnabled %x\n",
+ pSettings->bModemEnabled);
+
+ if (pSettings->bModemEnabled) {
+ rUartCfg1.Reserved = rUartCfg2.Reserved = 0;
+ rUartCfg1.IrqActiveLow = pSettings->bUartIrqActiveLow;
+ rUartCfg1.IrqPulse = pSettings->bUartIrqPulse;
+ rUartCfg1.Irq =
+ (unsigned char) pIrqMap[pSettings->usUartIrq];
+ switch (pSettings->usUartBaseIO) {
+ case 0x03F8:
+ rUartCfg1.BaseIO = 0;
+ break;
+ case 0x02F8:
+ rUartCfg1.BaseIO = 1;
+ break;
+ case 0x03E8:
+ rUartCfg1.BaseIO = 2;
+ break;
+ case 0x02E8:
+ rUartCfg1.BaseIO = 3;
+ break;
+ }
+ rUartCfg2.Enable = TRUE;
+ }
+
+ rHBridgeCfg1.Reserved = rHBridgeCfg2.Reserved = 0;
+ rHBridgeCfg1.IrqActiveLow = pSettings->bDspIrqActiveLow;
+ rHBridgeCfg1.IrqPulse = pSettings->bDspIrqPulse;
+ rHBridgeCfg1.Irq = (unsigned char) pIrqMap[pSettings->usDspIrq];
+ rHBridgeCfg1.AccessMode = 1;
+ rHBridgeCfg2.Enable = TRUE;
+
+
+ rBusmasterCfg2.Reserved = 0;
+ rBusmasterCfg1.Dma = (unsigned char) pDmaMap[pSettings->usDspDma];
+ rBusmasterCfg1.NumTransfers =
+ (unsigned char) pSettings->usNumTransfers;
+ rBusmasterCfg1.ReRequest = (unsigned char) pSettings->usReRequest;
+ rBusmasterCfg1.MEMCS16 = pSettings->bEnableMEMCS16;
+ rBusmasterCfg2.IsaMemCmdWidth =
+ (unsigned char) pSettings->usIsaMemCmdWidth;
+
+
+ rIsaProtCfg.Reserved = 0;
+ rIsaProtCfg.GateIOCHRDY = pSettings->bGateIOCHRDY;
+
+ rPowerMgmtCfg.Reserved = 0;
+ rPowerMgmtCfg.Enable = pSettings->bEnablePwrMgmt;
+
+ rHBusTimerCfg.LoadValue =
+ (unsigned char) pSettings->usHBusTimerLoadValue;
+
+ rLBusTimeoutDisable.Reserved = 0;
+ rLBusTimeoutDisable.DisableTimeout =
+ pSettings->bDisableLBusTimeout;
+
+ MKWORD(rChipReset) = ~pSettings->usChipletEnable;
+
+ rClockControl1.Reserved1 = rClockControl1.Reserved2 = 0;
+ rClockControl1.N_Divisor = pSettings->usN_Divisor;
+ rClockControl1.M_Multiplier = pSettings->usM_Multiplier;
+
+ rClockControl2.Reserved = 0;
+ rClockControl2.PllBypass = pSettings->bPllBypass;
+
+ /* Issue a soft reset to the chip */
+ /* Note: Since we may be coming in with 3780i clocks suspended, we must keep
+ * soft-reset active for 10ms.
+ */
+ rSlaveControl.ClockControl = 0;
+ rSlaveControl.SoftReset = TRUE;
+ rSlaveControl.ConfigMode = FALSE;
+ rSlaveControl.Reserved = 0;
+
+ PRINTK_4(TRACE_3780I,
+ "3780i::dsp3780i_EnableDSP usDspBaseIO %x index %x taddr %x\n",
+ usDspBaseIO, DSP_IsaSlaveControl,
+ usDspBaseIO + DSP_IsaSlaveControl);
+
+ PRINTK_2(TRACE_3780I,
+ "3780i::dsp3780i_EnableDSP rSlaveContrl %x\n",
+ MKWORD(rSlaveControl));
+
+ spin_lock_irqsave(&dsp_lock, flags);
+ OutWordDsp(DSP_IsaSlaveControl, MKWORD(rSlaveControl));
+ MKWORD(tval) = InWordDsp(DSP_IsaSlaveControl);
+
+ PRINTK_2(TRACE_3780I,
+ "3780i::dsp3780i_EnableDSP rSlaveControl 2 %x\n", tval);
+
+
+ for (i = 0; i < 11; i++)
+ udelay(2000);
+
+ rSlaveControl.SoftReset = FALSE;
+ OutWordDsp(DSP_IsaSlaveControl, MKWORD(rSlaveControl));
+
+ MKWORD(tval) = InWordDsp(DSP_IsaSlaveControl);
+
+ PRINTK_2(TRACE_3780I,
+ "3780i::dsp3780i_EnableDSP rSlaveControl 3 %x\n", tval);
+
+
+ /* Program our general configuration registers */
+ WriteGenCfg(DSP_HBridgeCfg1Index, MKBYTE(rHBridgeCfg1));
+ WriteGenCfg(DSP_HBridgeCfg2Index, MKBYTE(rHBridgeCfg2));
+ WriteGenCfg(DSP_BusMasterCfg1Index, MKBYTE(rBusmasterCfg1));
+ WriteGenCfg(DSP_BusMasterCfg2Index, MKBYTE(rBusmasterCfg2));
+ WriteGenCfg(DSP_IsaProtCfgIndex, MKBYTE(rIsaProtCfg));
+ WriteGenCfg(DSP_PowerMgCfgIndex, MKBYTE(rPowerMgmtCfg));
+ WriteGenCfg(DSP_HBusTimerCfgIndex, MKBYTE(rHBusTimerCfg));
+
+ if (pSettings->bModemEnabled) {
+ WriteGenCfg(DSP_UartCfg1Index, MKBYTE(rUartCfg1));
+ WriteGenCfg(DSP_UartCfg2Index, MKBYTE(rUartCfg2));
+ }
+
+
+ rHBridgeControl.EnableDspInt = FALSE;
+ rHBridgeControl.MemAutoInc = TRUE;
+ rHBridgeControl.IoAutoInc = FALSE;
+ rHBridgeControl.DiagnosticMode = FALSE;
+
+ PRINTK_3(TRACE_3780I,
+ "3780i::dsp3780i_EnableDSP DSP_HBridgeControl %x rHBridgeControl %x\n",
+ DSP_HBridgeControl, MKWORD(rHBridgeControl));
+
+ OutWordDsp(DSP_HBridgeControl, MKWORD(rHBridgeControl));
+ spin_unlock_irqrestore(&dsp_lock, flags);
+ WriteMsaCfg(DSP_LBusTimeoutDisable, MKWORD(rLBusTimeoutDisable));
+ WriteMsaCfg(DSP_ClockControl_1, MKWORD(rClockControl1));
+ WriteMsaCfg(DSP_ClockControl_2, MKWORD(rClockControl2));
+ WriteMsaCfg(DSP_ChipReset, MKWORD(rChipReset));
+
+ ChipID = ReadMsaCfg(DSP_ChipID);
+
+ PRINTK_2(TRACE_3780I,
+ "3780i::dsp3780I_EnableDSP exiting bRC=TRUE, ChipID %x\n",
+ ChipID);
+
+ return 0;
+}
+
+int dsp3780I_DisableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings)
+{
+ unsigned short usDspBaseIO = pSettings->usDspBaseIO;
+ DSP_ISA_SLAVE_CONTROL rSlaveControl;
+
+
+ PRINTK_1(TRACE_3780I, "3780i::dsp3780i_DisableDSP entry\n");
+
+ rSlaveControl.ClockControl = 0;
+ rSlaveControl.SoftReset = TRUE;
+ rSlaveControl.ConfigMode = FALSE;
+ rSlaveControl.Reserved = 0;
+ spin_lock_irqsave(&dsp_lock, flags);
+ OutWordDsp(DSP_IsaSlaveControl, MKWORD(rSlaveControl));
+
+ udelay(5);
+
+ rSlaveControl.ClockControl = 1;
+ OutWordDsp(DSP_IsaSlaveControl, MKWORD(rSlaveControl));
+ spin_unlock_irqrestore(&dsp_lock, flags);
+
+ udelay(5);
+
+
+ PRINTK_1(TRACE_3780I, "3780i::dsp3780i_DisableDSP exit\n");
+
+ return 0;
+}
+
+int dsp3780I_Reset(DSP_3780I_CONFIG_SETTINGS * pSettings)
+{
+ unsigned short usDspBaseIO = pSettings->usDspBaseIO;
+ DSP_BOOT_DOMAIN rBootDomain;
+ DSP_HBRIDGE_CONTROL rHBridgeControl;
+
+
+ PRINTK_1(TRACE_3780I, "3780i::dsp3780i_Reset entry\n");
+
+ spin_lock_irqsave(&dsp_lock, flags);
+ /* Mask DSP to PC interrupt */
+ MKWORD(rHBridgeControl) = InWordDsp(DSP_HBridgeControl);
+
+ PRINTK_2(TRACE_3780I, "3780i::dsp3780i_Reset rHBridgeControl %x\n",
+ MKWORD(rHBridgeControl));
+
+ rHBridgeControl.EnableDspInt = FALSE;
+ OutWordDsp(DSP_HBridgeControl, MKWORD(rHBridgeControl));
+ spin_unlock_irqrestore(&dsp_lock, flags);
+
+ /* Reset the core via the boot domain register */
+ rBootDomain.ResetCore = TRUE;
+ rBootDomain.Halt = TRUE;
+ rBootDomain.NMI = TRUE;
+ rBootDomain.Reserved = 0;
+
+ PRINTK_2(TRACE_3780I, "3780i::dsp3780i_Reset rBootDomain %x\n",
+ MKWORD(rBootDomain));
+
+ WriteMsaCfg(DSP_MspBootDomain, MKWORD(rBootDomain));
+
+ /* Reset all the chiplets and then reactivate them */
+ WriteMsaCfg(DSP_ChipReset, 0xFFFF);
+ udelay(5);
+ WriteMsaCfg(DSP_ChipReset,
+ (unsigned short) (~pSettings->usChipletEnable));
+
+
+ PRINTK_1(TRACE_3780I, "3780i::dsp3780i_Reset exit bRC=0\n");
+
+ return 0;
+}
+
+
+int dsp3780I_Run(DSP_3780I_CONFIG_SETTINGS * pSettings)
+{
+ unsigned short usDspBaseIO = pSettings->usDspBaseIO;
+ DSP_BOOT_DOMAIN rBootDomain;
+ DSP_HBRIDGE_CONTROL rHBridgeControl;
+
+
+ PRINTK_1(TRACE_3780I, "3780i::dsp3780i_Run entry\n");
+
+
+ /* Transition the core to a running state */
+ rBootDomain.ResetCore = TRUE;
+ rBootDomain.Halt = FALSE;
+ rBootDomain.NMI = TRUE;
+ rBootDomain.Reserved = 0;
+ WriteMsaCfg(DSP_MspBootDomain, MKWORD(rBootDomain));
+
+ udelay(5);
+
+ rBootDomain.ResetCore = FALSE;
+ WriteMsaCfg(DSP_MspBootDomain, MKWORD(rBootDomain));
+ udelay(5);
+
+ rBootDomain.NMI = FALSE;
+ WriteMsaCfg(DSP_MspBootDomain, MKWORD(rBootDomain));
+ udelay(5);
+
+ /* Enable DSP to PC interrupt */
+ spin_lock_irqsave(&dsp_lock, flags);
+ MKWORD(rHBridgeControl) = InWordDsp(DSP_HBridgeControl);
+ rHBridgeControl.EnableDspInt = TRUE;
+
+ PRINTK_2(TRACE_3780I, "3780i::dsp3780i_Run rHBridgeControl %x\n",
+ MKWORD(rHBridgeControl));
+
+ OutWordDsp(DSP_HBridgeControl, MKWORD(rHBridgeControl));
+ spin_unlock_irqrestore(&dsp_lock, flags);
+
+
+ PRINTK_1(TRACE_3780I, "3780i::dsp3780i_Run exit bRC=TRUE\n");
+
+ return 0;
+}
+
+
+int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void *pvBuffer,
+ unsigned uCount, unsigned long ulDSPAddr)
+{
+ unsigned short *pusBuffer = pvBuffer;
+ unsigned short val;
+
+
+ PRINTK_5(TRACE_3780I,
+ "3780i::dsp3780I_ReadDStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n",
+ usDspBaseIO, pusBuffer, uCount, ulDSPAddr);
+
+
+ /* Set the initial MSA address. No adjustments need to be made to data store addresses */
+ spin_lock_irqsave(&dsp_lock, flags);
+ OutWordDsp(DSP_MsaAddrLow, (unsigned short) ulDSPAddr);
+ OutWordDsp(DSP_MsaAddrHigh, (unsigned short) (ulDSPAddr >> 16));
+ spin_unlock_irqrestore(&dsp_lock, flags);
+
+ /* Transfer the memory block */
+ while (uCount-- != 0) {
+ spin_lock_irqsave(&dsp_lock, flags);
+ val = InWordDsp(DSP_MsaDataDSISHigh);
+ spin_unlock_irqrestore(&dsp_lock, flags);
+ if(put_user(val, pusBuffer++))
+ return -EFAULT;
+
+ PRINTK_3(TRACE_3780I,
+ "3780I::dsp3780I_ReadDStore uCount %x val %x\n",
+ uCount, val);
+
+ PaceMsaAccess(usDspBaseIO);
+ }
+
+
+ PRINTK_1(TRACE_3780I,
+ "3780I::dsp3780I_ReadDStore exit bRC=TRUE\n");
+
+ return 0;
+}
+
+int dsp3780I_ReadAndClearDStore(unsigned short usDspBaseIO,
+ void *pvBuffer, unsigned uCount,
+ unsigned long ulDSPAddr)
+{
+ unsigned short *pusBuffer = pvBuffer;
+ unsigned short val;
+
+
+ PRINTK_5(TRACE_3780I,
+ "3780i::dsp3780I_ReadAndDStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n",
+ usDspBaseIO, pusBuffer, uCount, ulDSPAddr);
+
+
+ /* Set the initial MSA address. No adjustments need to be made to data store addresses */
+ spin_lock_irqsave(&dsp_lock, flags);
+ OutWordDsp(DSP_MsaAddrLow, (unsigned short) ulDSPAddr);
+ OutWordDsp(DSP_MsaAddrHigh, (unsigned short) (ulDSPAddr >> 16));
+ spin_unlock_irqrestore(&dsp_lock, flags);
+
+ /* Transfer the memory block */
+ while (uCount-- != 0) {
+ spin_lock_irqsave(&dsp_lock, flags);
+ val = InWordDsp(DSP_ReadAndClear);
+ spin_unlock_irqrestore(&dsp_lock, flags);
+ if(put_user(val, pusBuffer++))
+ return -EFAULT;
+
+ PRINTK_3(TRACE_3780I,
+ "3780I::dsp3780I_ReadAndCleanDStore uCount %x val %x\n",
+ uCount, val);
+
+ PaceMsaAccess(usDspBaseIO);
+ }
+
+
+ PRINTK_1(TRACE_3780I,
+ "3780I::dsp3780I_ReadAndClearDStore exit bRC=TRUE\n");
+
+ return 0;
+}
+
+
+int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void *pvBuffer,
+ unsigned uCount, unsigned long ulDSPAddr)
+{
+ unsigned short *pusBuffer = pvBuffer;
+
+
+ PRINTK_5(TRACE_3780I,
+ "3780i::dsp3780D_WriteDStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n",
+ usDspBaseIO, pusBuffer, uCount, ulDSPAddr);
+
+
+ /* Set the initial MSA address. No adjustments need to be made to data store addresses */
+ spin_lock_irqsave(&dsp_lock, flags);
+ OutWordDsp(DSP_MsaAddrLow, (unsigned short) ulDSPAddr);
+ OutWordDsp(DSP_MsaAddrHigh, (unsigned short) (ulDSPAddr >> 16));
+ spin_unlock_irqrestore(&dsp_lock, flags);
+
+ /* Transfer the memory block */
+ while (uCount-- != 0) {
+ unsigned short val;
+ if(get_user(val, pusBuffer++))
+ return -EFAULT;
+ spin_lock_irqsave(&dsp_lock, flags);
+ OutWordDsp(DSP_MsaDataDSISHigh, val);
+ spin_unlock_irqrestore(&dsp_lock, flags);
+
+ PRINTK_3(TRACE_3780I,
+ "3780I::dsp3780I_WriteDStore uCount %x val %x\n",
+ uCount, val);
+
+ PaceMsaAccess(usDspBaseIO);
+ }
+
+
+ PRINTK_1(TRACE_3780I,
+ "3780I::dsp3780D_WriteDStore exit bRC=TRUE\n");
+
+ return 0;
+}
+
+
+int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void *pvBuffer,
+ unsigned uCount, unsigned long ulDSPAddr)
+{
+ unsigned short *pusBuffer = pvBuffer;
+
+ PRINTK_5(TRACE_3780I,
+ "3780i::dsp3780I_ReadIStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n",
+ usDspBaseIO, pusBuffer, uCount, ulDSPAddr);
+
+ /*
+ * Set the initial MSA address. To convert from an instruction store
+ * address to an MSA address
+ * shift the address two bits to the left and set bit 22
+ */
+ ulDSPAddr = (ulDSPAddr << 2) | (1 << 22);
+ spin_lock_irqsave(&dsp_lock, flags);
+ OutWordDsp(DSP_MsaAddrLow, (unsigned short) ulDSPAddr);
+ OutWordDsp(DSP_MsaAddrHigh, (unsigned short) (ulDSPAddr >> 16));
+ spin_unlock_irqrestore(&dsp_lock, flags);
+
+ /* Transfer the memory block */
+ while (uCount-- != 0) {
+ unsigned short val_lo, val_hi;
+ spin_lock_irqsave(&dsp_lock, flags);
+ val_lo = InWordDsp(DSP_MsaDataISLow);
+ val_hi = InWordDsp(DSP_MsaDataDSISHigh);
+ spin_unlock_irqrestore(&dsp_lock, flags);
+ if(put_user(val_lo, pusBuffer++))
+ return -EFAULT;
+ if(put_user(val_hi, pusBuffer++))
+ return -EFAULT;
+
+ PRINTK_4(TRACE_3780I,
+ "3780I::dsp3780I_ReadIStore uCount %x val_lo %x val_hi %x\n",
+ uCount, val_lo, val_hi);
+
+ PaceMsaAccess(usDspBaseIO);
+
+ }
+
+ PRINTK_1(TRACE_3780I,
+ "3780I::dsp3780I_ReadIStore exit bRC=TRUE\n");
+
+ return 0;
+}
+
+
+int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void *pvBuffer,
+ unsigned uCount, unsigned long ulDSPAddr)
+{
+ unsigned short *pusBuffer = pvBuffer;
+
+ PRINTK_5(TRACE_3780I,
+ "3780i::dsp3780I_WriteIStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n",
+ usDspBaseIO, pusBuffer, uCount, ulDSPAddr);
+
+
+ /*
+ * Set the initial MSA address. To convert from an instruction store
+ * address to an MSA address
+ * shift the address two bits to the left and set bit 22
+ */
+ ulDSPAddr = (ulDSPAddr << 2) | (1 << 22);
+ spin_lock_irqsave(&dsp_lock, flags);
+ OutWordDsp(DSP_MsaAddrLow, (unsigned short) ulDSPAddr);
+ OutWordDsp(DSP_MsaAddrHigh, (unsigned short) (ulDSPAddr >> 16));
+ spin_unlock_irqrestore(&dsp_lock, flags);
+
+ /* Transfer the memory block */
+ while (uCount-- != 0) {
+ unsigned short val_lo, val_hi;
+ if(get_user(val_lo, pusBuffer++))
+ return -EFAULT;
+ if(get_user(val_hi, pusBuffer++))
+ return -EFAULT;
+ spin_lock_irqsave(&dsp_lock, flags);
+ OutWordDsp(DSP_MsaDataISLow, val_lo);
+ OutWordDsp(DSP_MsaDataDSISHigh, val_hi);
+ spin_unlock_irqrestore(&dsp_lock, flags);
+
+ PRINTK_4(TRACE_3780I,
+ "3780I::dsp3780I_WriteIStore uCount %x val_lo %x val_hi %x\n",
+ uCount, val_lo, val_hi);
+
+ PaceMsaAccess(usDspBaseIO);
+
+ }
+
+ PRINTK_1(TRACE_3780I,
+ "3780I::dsp3780I_WriteIStore exit bRC=TRUE\n");
+
+ return 0;
+}
+
+
+int dsp3780I_GetIPCSource(unsigned short usDspBaseIO,
+ unsigned short *pusIPCSource)
+{
+ DSP_HBRIDGE_CONTROL rHBridgeControl;
+ unsigned short temp;
+
+
+ PRINTK_3(TRACE_3780I,
+ "3780i::dsp3780I_GetIPCSource entry usDspBaseIO %x pusIPCSource %p\n",
+ usDspBaseIO, pusIPCSource);
+
+ /*
+ * Disable DSP to PC interrupts, read the interupt register,
+ * clear the pending IPC bits, and reenable DSP to PC interrupts
+ */
+ spin_lock_irqsave(&dsp_lock, flags);
+ MKWORD(rHBridgeControl) = InWordDsp(DSP_HBridgeControl);
+ rHBridgeControl.EnableDspInt = FALSE;
+ OutWordDsp(DSP_HBridgeControl, MKWORD(rHBridgeControl));
+
+ *pusIPCSource = InWordDsp(DSP_Interrupt);
+ temp = (unsigned short) ~(*pusIPCSource);
+
+ PRINTK_3(TRACE_3780I,
+ "3780i::dsp3780I_GetIPCSource, usIPCSource %x ~ %x\n",
+ *pusIPCSource, temp);
+
+ OutWordDsp(DSP_Interrupt, (unsigned short) ~(*pusIPCSource));
+
+ rHBridgeControl.EnableDspInt = TRUE;
+ OutWordDsp(DSP_HBridgeControl, MKWORD(rHBridgeControl));
+ spin_unlock_irqrestore(&dsp_lock, flags);
+
+
+ PRINTK_2(TRACE_3780I,
+ "3780i::dsp3780I_GetIPCSource exit usIPCSource %x\n",
+ *pusIPCSource);
+
+ return 0;
+}
diff -u --recursive --new-file v2.4.10/linux/drivers/char/mwave/3780i.h linux/drivers/char/mwave/3780i.h
--- v2.4.10/linux/drivers/char/mwave/3780i.h Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/mwave/3780i.h Sun Sep 30 12:26:05 2001
@@ -0,0 +1,362 @@
+/*
+*
+* 3780i.h -- declarations for 3780i.c
+*
+*
+* Written By: Mike Sullivan IBM Corporation
+*
+* Copyright (C) 1999 IBM Corporation
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* NO WARRANTY
+* THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
+* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
+* LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+* solely responsible for determining the appropriateness of using and
+* distributing the Program and assumes all risks associated with its
+* exercise of rights under this Agreement, including but not limited to
+* the risks and costs of program errors, damage to or loss of data,
+* programs or equipment, and unavailability or interruption of operations.
+*
+* DISCLAIMER OF LIABILITY
+* NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+* USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+* HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*
+*
+* 10/23/2000 - Alpha Release
+* First release to the public
+*/
+
+#ifndef _LINUX_3780I_H
+#define _LINUX_3780I_H
+
+#include
+
+/* DSP I/O port offsets and definitions */
+#define DSP_IsaSlaveControl 0x0000 /* ISA slave control register */
+#define DSP_IsaSlaveStatus 0x0001 /* ISA slave status register */
+#define DSP_ConfigAddress 0x0002 /* General config address register */
+#define DSP_ConfigData 0x0003 /* General config data register */
+#define DSP_HBridgeControl 0x0002 /* HBridge control register */
+#define DSP_MsaAddrLow 0x0004 /* MSP System Address, low word */
+#define DSP_MsaAddrHigh 0x0006 /* MSP System Address, high word */
+#define DSP_MsaDataDSISHigh 0x0008 /* MSA data register: d-store word or high byte of i-store */
+#define DSP_MsaDataISLow 0x000A /* MSA data register: low word of i-store */
+#define DSP_ReadAndClear 0x000C /* MSA read and clear data register */
+#define DSP_Interrupt 0x000E /* Interrupt register (IPC source) */
+
+typedef struct {
+ unsigned char ClockControl:1; /* RW: Clock control: 0=normal, 1=stop 3780i clocks */
+ unsigned char SoftReset:1; /* RW: Soft reset 0=normal, 1=soft reset active */
+ unsigned char ConfigMode:1; /* RW: Configuration mode, 0=normal, 1=config mode */
+ unsigned char Reserved:5; /* 0: Reserved */
+} DSP_ISA_SLAVE_CONTROL;
+
+
+typedef struct {
+ unsigned short EnableDspInt:1; /* RW: Enable DSP to X86 ISA interrupt 0=mask it, 1=enable it */
+ unsigned short MemAutoInc:1; /* RW: Memory address auto increment, 0=disable, 1=enable */
+ unsigned short IoAutoInc:1; /* RW: I/O address auto increment, 0=disable, 1=enable */
+ unsigned short DiagnosticMode:1; /* RW: Disgnostic mode 0=nromal, 1=diagnostic mode */
+ unsigned short IsaPacingTimer:12; /* R: ISA access pacing timer: count of core cycles stolen */
+} DSP_HBRIDGE_CONTROL;
+
+
+/* DSP register indexes used with the configuration register address (index) register */
+#define DSP_UartCfg1Index 0x0003 /* UART config register 1 */
+#define DSP_UartCfg2Index 0x0004 /* UART config register 2 */
+#define DSP_HBridgeCfg1Index 0x0007 /* HBridge config register 1 */
+#define DSP_HBridgeCfg2Index 0x0008 /* HBridge config register 2 */
+#define DSP_BusMasterCfg1Index 0x0009 /* ISA bus master config register 1 */
+#define DSP_BusMasterCfg2Index 0x000A /* ISA bus master config register 2 */
+#define DSP_IsaProtCfgIndex 0x000F /* ISA protocol control register */
+#define DSP_PowerMgCfgIndex 0x0010 /* Low poser suspend/resume enable */
+#define DSP_HBusTimerCfgIndex 0x0011 /* HBUS timer load value */
+
+typedef struct {
+ unsigned char IrqActiveLow:1; /* RW: IRQ active high or low: 0=high, 1=low */
+ unsigned char IrqPulse:1; /* RW: IRQ pulse or level: 0=level, 1=pulse */
+ unsigned char Irq:3; /* RW: IRQ selection */
+ unsigned char BaseIO:2; /* RW: Base I/O selection */
+ unsigned char Reserved:1; /* 0: Reserved */
+} DSP_UART_CFG_1;
+
+typedef struct {
+ unsigned char Enable:1; /* RW: Enable I/O and IRQ: 0=FALSE, 1=TRUE */
+ unsigned char Reserved:7; /* 0: Reserved */
+} DSP_UART_CFG_2;
+
+typedef struct {
+ unsigned char IrqActiveLow:1; /* RW: IRQ active high=0 or low=1 */
+ unsigned char IrqPulse:1; /* RW: IRQ pulse=1 or level=0 */
+ unsigned char Irq:3; /* RW: IRQ selection */
+ unsigned char AccessMode:1; /* RW: 16-bit register access method 0=byte, 1=word */
+ unsigned char Reserved:2; /* 0: Reserved */
+} DSP_HBRIDGE_CFG_1;
+
+typedef struct {
+ unsigned char Enable:1; /* RW: enable I/O and IRQ: 0=FALSE, 1=TRUE */
+ unsigned char Reserved:7; /* 0: Reserved */
+} DSP_HBRIDGE_CFG_2;
+
+
+typedef struct {
+ unsigned char Dma:3; /* RW: DMA channel selection */
+ unsigned char NumTransfers:2; /* RW: Maximum # of transfers once being granted the ISA bus */
+ unsigned char ReRequest:2; /* RW: Minumum delay between releasing the ISA bus and requesting it again */
+ unsigned char MEMCS16:1; /* RW: ISA signal MEMCS16: 0=disabled, 1=enabled */
+} DSP_BUSMASTER_CFG_1;
+
+typedef struct {
+ unsigned char IsaMemCmdWidth:2; /* RW: ISA memory command width */
+ unsigned char Reserved:6; /* 0: Reserved */
+} DSP_BUSMASTER_CFG_2;
+
+
+typedef struct {
+ unsigned char GateIOCHRDY:1; /* RW: Enable IOCHRDY gating: 0=FALSE, 1=TRUE */
+ unsigned char Reserved:7; /* 0: Reserved */
+} DSP_ISA_PROT_CFG;
+
+typedef struct {
+ unsigned char Enable:1; /* RW: Enable low power suspend/resume 0=FALSE, 1=TRUE */
+ unsigned char Reserved:7; /* 0: Reserved */
+} DSP_POWER_MGMT_CFG;
+
+typedef struct {
+ unsigned char LoadValue:8; /* RW: HBUS timer load value */
+} DSP_HBUS_TIMER_CFG;
+
+
+
+/* DSP registers that exist in MSA I/O space */
+#define DSP_ChipID 0x80000000
+#define DSP_MspBootDomain 0x80000580
+#define DSP_LBusTimeoutDisable 0x80000580
+#define DSP_ClockControl_1 0x8000058A
+#define DSP_ClockControl_2 0x8000058C
+#define DSP_ChipReset 0x80000588
+#define DSP_GpioModeControl_15_8 0x80000082
+#define DSP_GpioDriverEnable_15_8 0x80000076
+#define DSP_GpioOutputData_15_8 0x80000072
+
+typedef struct {
+ unsigned short NMI:1; /* RW: non maskable interrupt */
+ unsigned short Halt:1; /* RW: Halt MSP clock */
+ unsigned short ResetCore:1; /* RW: Reset MSP core interface */
+ unsigned short Reserved:13; /* 0: Reserved */
+} DSP_BOOT_DOMAIN;
+
+typedef struct {
+ unsigned short DisableTimeout:1; /* RW: Disable LBus timeout */
+ unsigned short Reserved:15; /* 0: Reserved */
+} DSP_LBUS_TIMEOUT_DISABLE;
+
+typedef struct {
+ unsigned short Memory:1; /* RW: Reset memory interface */
+ unsigned short SerialPort1:1; /* RW: Reset serial port 1 interface */
+ unsigned short SerialPort2:1; /* RW: Reset serial port 2 interface */
+ unsigned short SerialPort3:1; /* RW: Reset serial port 3 interface */
+ unsigned short Gpio:1; /* RW: Reset GPIO interface */
+ unsigned short Dma:1; /* RW: Reset DMA interface */
+ unsigned short SoundBlaster:1; /* RW: Reset soundblaster interface */
+ unsigned short Uart:1; /* RW: Reset UART interface */
+ unsigned short Midi:1; /* RW: Reset MIDI interface */
+ unsigned short IsaMaster:1; /* RW: Reset ISA master interface */
+ unsigned short Reserved:6; /* 0: Reserved */
+} DSP_CHIP_RESET;
+
+typedef struct {
+ unsigned short N_Divisor:6; /* RW: (N) PLL output clock divisor */
+ unsigned short Reserved1:2; /* 0: reserved */
+ unsigned short M_Multiplier:6; /* RW: (M) PLL feedback clock multiplier */
+ unsigned short Reserved2:2; /* 0: reserved */
+} DSP_CLOCK_CONTROL_1;
+
+typedef struct {
+ unsigned short PllBypass:1; /* RW: PLL Bypass */
+ unsigned short Reserved:15; /* 0: Reserved */
+} DSP_CLOCK_CONTROL_2;
+
+typedef struct {
+ unsigned short Latch8:1;
+ unsigned short Latch9:1;
+ unsigned short Latch10:1;
+ unsigned short Latch11:1;
+ unsigned short Latch12:1;
+ unsigned short Latch13:1;
+ unsigned short Latch14:1;
+ unsigned short Latch15:1;
+ unsigned short Mask8:1;
+ unsigned short Mask9:1;
+ unsigned short Mask10:1;
+ unsigned short Mask11:1;
+ unsigned short Mask12:1;
+ unsigned short Mask13:1;
+ unsigned short Mask14:1;
+ unsigned short Mask15:1;
+} DSP_GPIO_OUTPUT_DATA_15_8;
+
+typedef struct {
+ unsigned short Enable8:1;
+ unsigned short Enable9:1;
+ unsigned short Enable10:1;
+ unsigned short Enable11:1;
+ unsigned short Enable12:1;
+ unsigned short Enable13:1;
+ unsigned short Enable14:1;
+ unsigned short Enable15:1;
+ unsigned short Mask8:1;
+ unsigned short Mask9:1;
+ unsigned short Mask10:1;
+ unsigned short Mask11:1;
+ unsigned short Mask12:1;
+ unsigned short Mask13:1;
+ unsigned short Mask14:1;
+ unsigned short Mask15:1;
+} DSP_GPIO_DRIVER_ENABLE_15_8;
+
+typedef struct {
+ unsigned short GpioMode8:2;
+ unsigned short GpioMode9:2;
+ unsigned short GpioMode10:2;
+ unsigned short GpioMode11:2;
+ unsigned short GpioMode12:2;
+ unsigned short GpioMode13:2;
+ unsigned short GpioMode14:2;
+ unsigned short GpioMode15:2;
+} DSP_GPIO_MODE_15_8;
+
+/* Component masks that are defined in dspmgr.h */
+#define MW_ADC_MASK 0x0001
+#define MW_AIC2_MASK 0x0006
+#define MW_MIDI_MASK 0x0008
+#define MW_CDDAC_MASK 0x8001
+#define MW_AIC1_MASK 0xE006
+#define MW_UART_MASK 0xE00A
+#define MW_ACI_MASK 0xE00B
+
+/*
+* Definition of 3780i configuration structure. Unless otherwise stated,
+* these values are provided as input to the 3780i support layer. At present,
+* the only values maintained by the 3780i support layer are the saved UART
+* registers.
+*/
+typedef struct _DSP_3780I_CONFIG_SETTINGS {
+
+ /* Location of base configuration register */
+ unsigned short usBaseConfigIO;
+
+ /* Enables for various DSP components */
+ int bDSPEnabled;
+ int bModemEnabled;
+ int bInterruptClaimed;
+
+ /* IRQ, DMA, and Base I/O addresses for various DSP components */
+ unsigned short usDspIrq;
+ unsigned short usDspDma;
+ unsigned short usDspBaseIO;
+ unsigned short usUartIrq;
+ unsigned short usUartBaseIO;
+
+ /* IRQ modes for various DSP components */
+ int bDspIrqActiveLow;
+ int bUartIrqActiveLow;
+ int bDspIrqPulse;
+ int bUartIrqPulse;
+
+ /* Card abilities */
+ unsigned uIps;
+ unsigned uDStoreSize;
+ unsigned uIStoreSize;
+ unsigned uDmaBandwidth;
+
+ /* Adapter specific 3780i settings */
+ unsigned short usNumTransfers;
+ unsigned short usReRequest;
+ int bEnableMEMCS16;
+ unsigned short usIsaMemCmdWidth;
+ int bGateIOCHRDY;
+ int bEnablePwrMgmt;
+ unsigned short usHBusTimerLoadValue;
+ int bDisableLBusTimeout;
+ unsigned short usN_Divisor;
+ unsigned short usM_Multiplier;
+ int bPllBypass;
+ unsigned short usChipletEnable; /* Used with the chip reset register to enable specific chiplets */
+
+ /* Saved UART registers. These are maintained by the 3780i support layer. */
+ int bUartSaved; /* True after a successful save of the UART registers */
+ unsigned char ucIER; /* Interrupt enable register */
+ unsigned char ucFCR; /* FIFO control register */
+ unsigned char ucLCR; /* Line control register */
+ unsigned char ucMCR; /* Modem control register */
+ unsigned char ucSCR; /* Scratch register */
+ unsigned char ucDLL; /* Divisor latch, low byte */
+ unsigned char ucDLM; /* Divisor latch, high byte */
+} DSP_3780I_CONFIG_SETTINGS;
+
+
+/* 3780i support functions */
+int dsp3780I_EnableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings,
+ unsigned short *pIrqMap,
+ unsigned short *pDmaMap);
+int dsp3780I_DisableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings);
+int dsp3780I_Reset(DSP_3780I_CONFIG_SETTINGS * pSettings);
+int dsp3780I_Run(DSP_3780I_CONFIG_SETTINGS * pSettings);
+int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void *pvBuffer,
+ unsigned uCount, unsigned long ulDSPAddr);
+int dsp3780I_ReadAndClearDStore(unsigned short usDspBaseIO,
+ void *pvBuffer, unsigned uCount,
+ unsigned long ulDSPAddr);
+int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void *pvBuffer,
+ unsigned uCount, unsigned long ulDSPAddr);
+int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void *pvBuffer,
+ unsigned uCount, unsigned long ulDSPAddr);
+int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void *pvBuffer,
+ unsigned uCount, unsigned long ulDSPAddr);
+unsigned short dsp3780I_ReadMsaCfg(unsigned short usDspBaseIO,
+ unsigned long ulMsaAddr);
+void dsp3780I_WriteMsaCfg(unsigned short usDspBaseIO,
+ unsigned long ulMsaAddr, unsigned short usValue);
+void dsp3780I_WriteGenCfg(unsigned short usDspBaseIO, unsigned uIndex,
+ unsigned char ucValue);
+unsigned char dsp3780I_ReadGenCfg(unsigned short usDspBaseIO,
+ unsigned uIndex);
+int dsp3780I_GetIPCSource(unsigned short usDspBaseIO,
+ unsigned short *pusIPCSource);
+
+/* I/O port access macros */
+#define MKWORD(var) (*((unsigned short *)(&var)))
+#define MKBYTE(var) (*((unsigned char *)(&var)))
+
+#define WriteMsaCfg(addr,value) dsp3780I_WriteMsaCfg(usDspBaseIO,addr,value)
+#define ReadMsaCfg(addr) dsp3780I_ReadMsaCfg(usDspBaseIO,addr)
+#define WriteGenCfg(index,value) dsp3780I_WriteGenCfg(usDspBaseIO,index,value)
+#define ReadGenCfg(index) dsp3780I_ReadGenCfg(usDspBaseIO,index)
+
+#define InWordDsp(index) inw(usDspBaseIO+index)
+#define InByteDsp(index) inb(usDspBaseIO+index)
+#define OutWordDsp(index,value) outw(value,usDspBaseIO+index)
+#define OutByteDsp(index,value) outb(value,usDspBaseIO+index)
+
+#endif
diff -u --recursive --new-file v2.4.10/linux/drivers/char/mwave/Makefile linux/drivers/char/mwave/Makefile
--- v2.4.10/linux/drivers/char/mwave/Makefile Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/mwave/Makefile Sun Sep 30 12:26:05 2001
@@ -0,0 +1,25 @@
+#
+# Makefile for ACP Modem (Mwave).
+#
+# See the README file in this directory for more info.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+# Note 2! The CFLAGS definitions are now inherited from the
+# parent makes..
+#
+
+# To compile in lots (~20 KiB) of run-time enablable printk()s for debugging:
+EXTRA_CFLAGS += -DMW_TRACE
+
+# To have the mwave driver disable other uarts if necessary
+# EXTRA_CFLAGS += -DMWAVE_FUTZ_WITH_OTHER_DEVICES
+
+O_TARGET := mwave.o
+
+obj-y := mwavedd.o smapi.o tp3780i.o 3780i.o
+obj-m := $(O_TARGET)
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.10/linux/drivers/char/mwave/README linux/drivers/char/mwave/README
--- v2.4.10/linux/drivers/char/mwave/README Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/mwave/README Sun Sep 30 12:26:05 2001
@@ -0,0 +1,50 @@
+Module options
+--------------
+
+The mwave module takes the following options. Note that these options
+are not saved by the BIOS and so do not persist after unload and reload.
+
+ mwave_debug=value, where value is bitwise OR of trace flags:
+ 0x0001 mwavedd api tracing
+ 0x0002 smapi api tracing
+ 0x0004 3780i tracing
+ 0x0008 tp3780i tracing
+
+ Tracing only occurs if the driver has been compiled with the
+ MW_TRACE macro #defined (i.e. let EXTRA_CFLAGS += -DMW_TRACE
+ in the Makefile).
+
+ mwave_3780i_irq=5/7/10/11/15
+ If the dsp irq has not been setup and stored in bios by the
+ thinkpad configuration utility then this parameter allows the
+ irq used by the dsp to be configured.
+
+ mwave_3780i_io=0x130/0x350/0x0070/0xDB0
+ If the dsp io range has not been setup and stored in bios by the
+ thinkpad configuration utility then this parameter allows the
+ io range used by the dsp to be configured.
+
+ mwave_uart_irq=3/4
+ If the mwave's uart irq has not been setup and stored in bios by the
+ thinkpad configuration utility then this parameter allows the
+ irq used by the mwave uart to be configured.
+
+ mwave_uart_io=0x3f8/0x2f8/0x3E8/0x2E8
+ If the uart io range has not been setup and stored in bios by the
+ thinkpad configuration utility then this parameter allows the
+ io range used by the mwave uart to be configured.
+
+Example to enable the 3780i DSP using ttyS1 resources:
+
+ insmod mwave mwave_3780i_irq=10 mwave_3780i_io=0x0130 mwave_uart_irq=3 mwave_uart_io=0x2f8
+
+Accessing the driver
+--------------------
+
+You must also create a node for the driver. Without devfs:
+ mkdir -p /dev/modems
+ mknod --mode=660 /dev/modems/mwave c 10 219
+With devfs:
+ mkdir -p /dev/modems
+ ln -s ../misc/mwave /dev/modems/mwave
+
diff -u --recursive --new-file v2.4.10/linux/drivers/char/mwave/mwavedd.c linux/drivers/char/mwave/mwavedd.c
--- v2.4.10/linux/drivers/char/mwave/mwavedd.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/mwave/mwavedd.c Sun Sep 30 12:26:05 2001
@@ -0,0 +1,638 @@
+/*
+*
+* mwavedd.c -- mwave device driver
+*
+*
+* Written By: Mike Sullivan IBM Corporation
+*
+* Copyright (C) 1999 IBM Corporation
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* NO WARRANTY
+* THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
+* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
+* LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+* solely responsible for determining the appropriateness of using and
+* distributing the Program and assumes all risks associated with its
+* exercise of rights under this Agreement, including but not limited to
+* the risks and costs of program errors, damage to or loss of data,
+* programs or equipment, and unavailability or interruption of operations.
+*
+* DISCLAIMER OF LIABILITY
+* NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+* USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+* HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*
+*
+* 10/23/2000 - Alpha Release
+* First release to the public
+*/
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#include
+#else
+#include
+#endif
+#include
+#include "smapi.h"
+#include "mwavedd.h"
+#include "3780i.h"
+#include "tp3780i.h"
+
+#ifndef __exit
+#define __exit
+#endif
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+static int mwave_get_info(char *buf, char **start, off_t offset, int len);
+#else
+static int mwave_read_proc(char *buf, char **start, off_t offset, int xlen, int unused);
+static struct proc_dir_entry mwave_proc = {
+ 0, /* unsigned short low_ino */
+ 5, /* unsigned short namelen */
+ "mwave", /* const char *name */
+ S_IFREG | S_IRUGO, /* mode_t mode */
+ 1, /* nlink_t nlink */
+ 0, /* uid_t uid */
+ 0, /* gid_t gid */
+ 0, /* unsigned long size */
+ NULL, /* struct inode_operations *ops */
+ &mwave_read_proc /* int (*get_info) (...) */
+};
+#endif
+
+/*
+* These parameters support the setting of MWave resources. Note that no
+* checks are made against other devices (ie. superio) for conflicts.
+* We'll depend on users using the tpctl utility to do that for now
+*/
+int mwave_debug = 0;
+int mwave_3780i_irq = 0;
+int mwave_3780i_io = 0;
+int mwave_uart_irq = 0;
+int mwave_uart_io = 0;
+MODULE_PARM(mwave_debug, "i");
+MODULE_PARM(mwave_3780i_irq, "i");
+MODULE_PARM(mwave_3780i_io, "i");
+MODULE_PARM(mwave_uart_irq, "i");
+MODULE_PARM(mwave_uart_io, "i");
+
+static int mwave_open(struct inode *inode, struct file *file);
+static int mwave_close(struct inode *inode, struct file *file);
+static int mwave_ioctl(struct inode *inode, struct file *filp,
+ unsigned int iocmd, unsigned long ioarg);
+
+MWAVE_DEVICE_DATA mwave_s_mdd;
+
+static int mwave_open(struct inode *inode, struct file *file)
+{
+ unsigned int retval = 0;
+
+ PRINTK_3(TRACE_MWAVE,
+ "mwavedd::mwave_open, entry inode %x file %x\n",
+ (int) inode, (int) file);
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_open, exit return retval %x\n", retval);
+
+ MOD_INC_USE_COUNT;
+ return retval;
+}
+
+static int mwave_close(struct inode *inode, struct file *file)
+{
+ unsigned int retval = 0;
+
+ PRINTK_3(TRACE_MWAVE,
+ "mwavedd::mwave_close, entry inode %x file %x\n",
+ (int) inode, (int) file);
+
+ PRINTK_2(TRACE_MWAVE, "mwavedd::mwave_close, exit retval %x\n",
+ retval);
+
+ MOD_DEC_USE_COUNT;
+ return retval;
+}
+
+static int mwave_ioctl(struct inode *inode, struct file *file,
+ unsigned int iocmd, unsigned long ioarg)
+{
+ unsigned int retval = 0;
+ pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd;
+
+ PRINTK_5(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl, entry inode %x file %x cmd %x arg %x\n",
+ (int) inode, (int) file, iocmd, (int) ioarg);
+
+ switch (iocmd) {
+
+ case IOCTL_MW_RESET:
+ PRINTK_1(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl, IOCTL_MW_RESET calling tp3780I_ResetDSP\n");
+ retval = tp3780I_ResetDSP(&pDrvData->rBDData);
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl, IOCTL_MW_RESET retval %x from tp3780I_ResetDSP\n",
+ retval);
+ break;
+
+ case IOCTL_MW_RUN:
+ PRINTK_1(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl, IOCTL_MW_RUN calling tp3780I_StartDSP\n");
+ retval = tp3780I_StartDSP(&pDrvData->rBDData);
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl, IOCTL_MW_RUN retval %x from tp3780I_StartDSP\n",
+ retval);
+ break;
+
+ case IOCTL_MW_DSP_ABILITIES: {
+ MW_ABILITIES rAbilities;
+
+ PRINTK_1(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl, IOCTL_MW_DSP_ABILITIES calling tp3780I_QueryAbilities\n");
+ retval = tp3780I_QueryAbilities(&pDrvData->rBDData, &rAbilities);
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl, IOCTL_MW_DSP_ABILITIES retval %x from tp3780I_QueryAbilities\n",
+ retval);
+ if (retval == 0) {
+ if( copy_to_user((char *) ioarg, (char *) &rAbilities, sizeof(MW_ABILITIES)) )
+ return -EFAULT;
+ }
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl, IOCTL_MW_DSP_ABILITIES exit retval %x\n",
+ retval);
+ }
+ break;
+
+ case IOCTL_MW_READ_DATA:
+ case IOCTL_MW_READCLEAR_DATA: {
+ MW_READWRITE rReadData;
+ unsigned short *pusBuffer = 0;
+
+ if( copy_from_user((char *) &rReadData, (char *) ioarg, sizeof(MW_READWRITE)) )
+ return -EFAULT;
+ pusBuffer = (unsigned short *) (rReadData.pBuf);
+
+ PRINTK_4(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl IOCTL_MW_READ_DATA, size %lx, ioarg %lx pusBuffer %p\n",
+ rReadData.ulDataLength, ioarg, pusBuffer);
+ retval = tp3780I_ReadWriteDspDStore(&pDrvData->rBDData, iocmd,
+ (void *) pusBuffer, rReadData.ulDataLength, rReadData.usDspAddress);
+ }
+ break;
+
+ case IOCTL_MW_READ_INST: {
+ MW_READWRITE rReadData;
+ unsigned short *pusBuffer = 0;
+
+ if( copy_from_user((char *) &rReadData, (char *) ioarg, sizeof(MW_READWRITE)) )
+ return -EFAULT;
+ pusBuffer = (unsigned short *) (rReadData.pBuf);
+
+ PRINTK_4(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl IOCTL_MW_READ_INST, size %lx, ioarg %lx pusBuffer %p\n",
+ rReadData.ulDataLength / 2, ioarg,
+ pusBuffer);
+ retval = tp3780I_ReadWriteDspDStore(&pDrvData->rBDData,
+ iocmd, pusBuffer,
+ rReadData.ulDataLength / 2,
+ rReadData.usDspAddress);
+ }
+ break;
+
+ case IOCTL_MW_WRITE_DATA: {
+ MW_READWRITE rWriteData;
+ unsigned short *pusBuffer = 0;
+
+ if( copy_from_user((char *) &rWriteData, (char *) ioarg, sizeof(MW_READWRITE)) )
+ return -EFAULT;
+ pusBuffer = (unsigned short *) (rWriteData.pBuf);
+
+ PRINTK_4(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl IOCTL_MW_WRITE_DATA, size %lx, ioarg %lx pusBuffer %p\n",
+ rWriteData.ulDataLength, ioarg,
+ pusBuffer);
+ retval = tp3780I_ReadWriteDspDStore(&pDrvData->rBDData, iocmd,
+ pusBuffer, rWriteData.ulDataLength, rWriteData.usDspAddress);
+ }
+ break;
+
+ case IOCTL_MW_WRITE_INST: {
+ MW_READWRITE rWriteData;
+ unsigned short *pusBuffer = 0;
+
+ if( copy_from_user((char *) &rWriteData, (char *) ioarg, sizeof(MW_READWRITE)) )
+ return -EFAULT;
+ pusBuffer = (unsigned short *) (rWriteData.pBuf);
+
+ PRINTK_4(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl IOCTL_MW_WRITE_INST, size %lx, ioarg %lx pusBuffer %p\n",
+ rWriteData.ulDataLength, ioarg,
+ pusBuffer);
+ retval = tp3780I_ReadWriteDspIStore(&pDrvData->rBDData, iocmd,
+ pusBuffer, rWriteData.ulDataLength, rWriteData.usDspAddress);
+ }
+ break;
+
+ case IOCTL_MW_REGISTER_IPC: {
+ unsigned int ipcnum = (unsigned int) ioarg;
+
+ PRINTK_3(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl IOCTL_MW_REGISTER_IPC ipcnum %x entry usIntCount %x\n",
+ ipcnum,
+ pDrvData->IPCs[ipcnum].usIntCount);
+
+ if (ipcnum > 16) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "mwavedd::mwave_ioctl: IOCTL_MW_REGISTER_IPC: Error: Invalid ipcnum %x\n", ipcnum);
+ return -EINVAL;
+ }
+ pDrvData->IPCs[ipcnum].bIsHere = FALSE;
+ pDrvData->IPCs[ipcnum].bIsEnabled = TRUE;
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ current->nice = -20; /* boost to provide priority timing */
+ #else
+ current->priority = 0x28; /* boost to provide priority timing */
+ #endif
+
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl IOCTL_MW_REGISTER_IPC ipcnum %x exit\n",
+ ipcnum);
+ }
+ break;
+
+ case IOCTL_MW_GET_IPC: {
+ unsigned int ipcnum = (unsigned int) ioarg;
+ spinlock_t ipc_lock = SPIN_LOCK_UNLOCKED;
+ unsigned long flags;
+
+ PRINTK_3(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl IOCTL_MW_GET_IPC ipcnum %x, usIntCount %x\n",
+ ipcnum,
+ pDrvData->IPCs[ipcnum].usIntCount);
+ if (ipcnum > 16) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "mwavedd::mwave_ioctl: IOCTL_MW_GET_IPC: Error: Invalid ipcnum %x\n", ipcnum);
+ return -EINVAL;
+ }
+
+ if (pDrvData->IPCs[ipcnum].bIsEnabled == TRUE) {
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl, thread for ipc %x going to sleep\n",
+ ipcnum);
+
+ spin_lock_irqsave(&ipc_lock, flags);
+ /* check whether an event was signalled by */
+ /* the interrupt handler while we were gone */
+ if (pDrvData->IPCs[ipcnum].usIntCount == 1) { /* first int has occurred (race condition) */
+ pDrvData->IPCs[ipcnum].usIntCount = 2; /* first int has been handled */
+ spin_unlock_irqrestore(&ipc_lock, flags);
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl IOCTL_MW_GET_IPC ipcnum %x handling first int\n",
+ ipcnum);
+ } else { /* either 1st int has not yet occurred, or we have already handled the first int */
+ pDrvData->IPCs[ipcnum].bIsHere = TRUE;
+ interruptible_sleep_on(&pDrvData->IPCs[ipcnum].ipc_wait_queue);
+ pDrvData->IPCs[ipcnum].bIsHere = FALSE;
+ if (pDrvData->IPCs[ipcnum].usIntCount == 1) {
+ pDrvData->IPCs[ipcnum].
+ usIntCount = 2;
+ }
+ spin_unlock_irqrestore(&ipc_lock, flags);
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl IOCTL_MW_GET_IPC ipcnum %x woke up and returning to application\n",
+ ipcnum);
+ }
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl IOCTL_MW_GET_IPC, returning thread for ipc %x processing\n",
+ ipcnum);
+ }
+ }
+ break;
+
+ case IOCTL_MW_UNREGISTER_IPC: {
+ unsigned int ipcnum = (unsigned int) ioarg;
+
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_ioctl IOCTL_MW_UNREGISTER_IPC ipcnum %x\n",
+ ipcnum);
+ if (ipcnum > 16) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "mwavedd::mwave_ioctl: IOCTL_MW_UNREGISTER_IPC: Error: Invalid ipcnum %x\n", ipcnum);
+ return -EINVAL;
+ }
+ if (pDrvData->IPCs[ipcnum].bIsEnabled == TRUE) {
+ pDrvData->IPCs[ipcnum].bIsEnabled = FALSE;
+ if (pDrvData->IPCs[ipcnum].bIsHere == TRUE) {
+ wake_up_interruptible(&pDrvData->IPCs[ipcnum].ipc_wait_queue);
+ }
+ }
+ }
+ break;
+
+ default:
+ PRINTK_ERROR(KERN_ERR_MWAVE "mwavedd::mwave_ioctl: Error: Unrecognized iocmd %x\n", iocmd);
+ return -ENOTTY;
+ break;
+ } /* switch */
+
+ PRINTK_2(TRACE_MWAVE, "mwavedd::mwave_ioctl, exit retval %x\n", retval);
+
+ return retval;
+}
+
+
+static ssize_t mwave_read(struct file *file, char *buf, size_t count,
+ loff_t * ppos)
+{
+ PRINTK_5(TRACE_MWAVE,
+ "mwavedd::mwave_read entry file %p, buf %p, count %x ppos %p\n",
+ file, buf, count, ppos);
+
+ return -EINVAL;
+}
+
+
+static ssize_t mwave_write(struct file *file, const char *buf,
+ size_t count, loff_t * ppos)
+{
+ PRINTK_5(TRACE_MWAVE,
+ "mwavedd::mwave_write entry file %p, buf %p, count %x ppos %p\n",
+ file, buf, count, ppos);
+
+ return -EINVAL;
+}
+
+
+static int register_serial_portandirq(unsigned int port, int irq)
+{
+ struct serial_struct serial;
+
+ switch ( port ) {
+ case 0x3f8:
+ case 0x2f8:
+ case 0x3e8:
+ case 0x2e8:
+ /* OK */
+ break;
+ default:
+ PRINTK_ERROR(KERN_ERR_MWAVE "mwavedd::register_serial_portandirq: Error: Illegal port %x\n", port );
+ return -1;
+ } /* switch */
+ /* port is okay */
+
+ switch ( irq ) {
+ case 3:
+ case 4:
+ case 5:
+ case 7:
+ /* OK */
+ break;
+ default:
+ PRINTK_ERROR(KERN_ERR_MWAVE "mwavedd::register_serial_portandirq: Error: Illegal irq %x\n", irq );
+ return -1;
+ } /* switch */
+ /* irq is okay */
+
+ memset(&serial, 0, sizeof(serial));
+ serial.port = port;
+ serial.irq = irq;
+ serial.flags = ASYNC_SHARE_IRQ;
+
+ return register_serial(&serial);
+}
+
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+static struct file_operations mwave_fops = {
+ owner:THIS_MODULE,
+ read:mwave_read,
+ write:mwave_write,
+ ioctl:mwave_ioctl,
+ open:mwave_open,
+ release:mwave_close
+};
+#else
+static struct file_operations mwave_fops = {
+ NULL, /* lseek */
+ mwave_read, /* read */
+ mwave_write, /* write */
+ NULL, /* readdir */
+ NULL, /* poll */
+ mwave_ioctl, /* ioctl */
+ NULL, /* mmap */
+ mwave_open, /* open */
+ NULL, /* flush */
+ mwave_close /* release */
+};
+#endif
+
+static struct miscdevice mwave_misc_dev = { MWAVE_MINOR, "mwave", &mwave_fops };
+
+/*
+* mwave_init is called on module load
+*
+* mwave_exit is called on module unload
+* mwave_exit is also used to clean up after an aborted mwave_init
+*/
+static void __exit mwave_exit(void)
+{
+ pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd;
+
+ PRINTK_1(TRACE_MWAVE, "mwavedd::mwave_exit entry\n");
+
+ if (pDrvData->bProcEntryCreated) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ remove_proc_entry("mwave", NULL);
+#else
+ proc_unregister(&proc_root, mwave_proc.low_ino);
+#endif
+ }
+ if ( pDrvData->sLine >= 0 ) {
+ unregister_serial(pDrvData->sLine);
+ }
+ if (pDrvData->bMwaveDevRegistered) {
+ misc_deregister(&mwave_misc_dev);
+ }
+ if (pDrvData->bDSPEnabled) {
+ tp3780I_DisableDSP(&pDrvData->rBDData);
+ }
+ if (pDrvData->bResourcesClaimed) {
+ tp3780I_ReleaseResources(&pDrvData->rBDData);
+ }
+ if (pDrvData->bBDInitialized) {
+ tp3780I_Cleanup(&pDrvData->rBDData);
+ }
+
+ PRINTK_1(TRACE_MWAVE, "mwavedd::mwave_exit exit\n");
+}
+
+module_exit(mwave_exit);
+
+static int __init mwave_init(void)
+{
+ int i;
+ int retval = 0;
+ unsigned int resultMiscRegister;
+ pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd;
+
+ memset(&mwave_s_mdd, 0, sizeof(MWAVE_DEVICE_DATA));
+
+ PRINTK_1(TRACE_MWAVE, "mwavedd::mwave_init entry\n");
+
+ pDrvData->bBDInitialized = FALSE;
+ pDrvData->bResourcesClaimed = FALSE;
+ pDrvData->bDSPEnabled = FALSE;
+ pDrvData->bDSPReset = FALSE;
+ pDrvData->bMwaveDevRegistered = FALSE;
+ pDrvData->sLine = -1;
+ pDrvData->bProcEntryCreated = FALSE;
+
+ for (i = 0; i < 16; i++) {
+ pDrvData->IPCs[i].bIsEnabled = FALSE;
+ pDrvData->IPCs[i].bIsHere = FALSE;
+ pDrvData->IPCs[i].usIntCount = 0; /* no ints received yet */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ init_waitqueue_head(&pDrvData->IPCs[i].ipc_wait_queue);
+#endif
+ }
+
+ retval = tp3780I_InitializeBoardData(&pDrvData->rBDData);
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_init, return from tp3780I_InitializeBoardData retval %x\n",
+ retval);
+ if (retval) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "mwavedd::mwave_init: Error: Failed to initialize board data\n");
+ goto cleanup_error;
+ }
+ pDrvData->bBDInitialized = TRUE;
+
+ retval = tp3780I_CalcResources(&pDrvData->rBDData);
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_init, return from tp3780I_CalcResources retval %x\n",
+ retval);
+ if (retval) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "mwavedd:mwave_init: Error: Failed to calculate resources\n");
+ goto cleanup_error;
+ }
+
+ retval = tp3780I_ClaimResources(&pDrvData->rBDData);
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_init, return from tp3780I_ClaimResources retval %x\n",
+ retval);
+ if (retval) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "mwavedd:mwave_init: Error: Failed to claim resources\n");
+ goto cleanup_error;
+ }
+ pDrvData->bResourcesClaimed = TRUE;
+
+ retval = tp3780I_EnableDSP(&pDrvData->rBDData);
+ PRINTK_2(TRACE_MWAVE,
+ "mwavedd::mwave_init, return from tp3780I_EnableDSP retval %x\n",
+ retval);
+ if (retval) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "mwavedd:mwave_init: Error: Failed to enable DSP\n");
+ goto cleanup_error;
+ }
+ pDrvData->bDSPEnabled = TRUE;
+
+ resultMiscRegister = misc_register(&mwave_misc_dev);
+ if (resultMiscRegister < 0) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "mwavedd:mwave_init: Error: Failed to register misc device\n");
+ goto cleanup_error;
+ }
+ pDrvData->bMwaveDevRegistered = TRUE;
+
+ pDrvData->sLine = register_serial_portandirq(
+ pDrvData->rBDData.rDspSettings.usUartBaseIO,
+ pDrvData->rBDData.rDspSettings.usUartIrq
+ );
+ if (pDrvData->sLine < 0) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "mwavedd:mwave_init: Error: Failed to register serial driver\n");
+ goto cleanup_error;
+ }
+ /* uart is registered */
+
+ if (
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ !create_proc_info_entry("mwave", 0, NULL, mwave_get_info)
+#else
+ proc_register(&proc_root, &mwave_proc)
+#endif
+ ) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "mwavedd::mwave_init: Error: Failed to register /proc/mwave\n");
+ goto cleanup_error;
+ }
+ pDrvData->bProcEntryCreated = TRUE;
+
+ /* SUCCESS! */
+ return 0;
+
+ cleanup_error:
+ PRINTK_ERROR(KERN_ERR_MWAVE "mwavedd::mwave_init: Error: Failed to initialize\n");
+ mwave_exit(); /* clean up */
+
+ return -EIO;
+}
+
+module_init(mwave_init);
+
+
+/*
+* proc entry stuff added by Ian Pilcher
+*/
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+static int mwave_get_info(char *buf, char **start, off_t offset, int len)
+{
+ DSP_3780I_CONFIG_SETTINGS *pSettings = &mwave_s_mdd.rBDData.rDspSettings;
+
+ char *out = buf;
+
+ out += sprintf(out, "3780i_IRQ %i\n", pSettings->usDspIrq);
+ out += sprintf(out, "3780i_DMA %i\n", pSettings->usDspDma);
+ out += sprintf(out, "3780i_IO %#.4x\n", pSettings->usDspBaseIO);
+ out += sprintf(out, "UART_IRQ %i\n", pSettings->usUartIrq);
+ out += sprintf(out, "UART_IO %#.4x\n", pSettings->usUartBaseIO);
+
+ return out - buf;
+}
+#else /* kernel version < 2.4.0 */
+static int mwave_read_proc(char *buf, char **start, off_t offset,
+ int xlen, int unused)
+{
+ DSP_3780I_CONFIG_SETTINGS *pSettings = &mwave_s_mdd.rBDData.rDspSettings;
+ int len;
+
+ len = sprintf(buf, "3780i_IRQ %i\n", pSettings->usDspIrq);
+ len += sprintf(&buf[len], "3780i_DMA %i\n", pSettings->usDspDma);
+ len += sprintf(&buf[len], "3780i_IO %#.4x\n", pSettings->usDspBaseIO);
+ len += sprintf(&buf[len], "UART_IRQ %i\n", pSettings->usUartIrq);
+ len += sprintf(&buf[len], "UART_IO %#.4x\n", pSettings->usUartBaseIO);
+
+ return len;
+}
+#endif
diff -u --recursive --new-file v2.4.10/linux/drivers/char/mwave/mwavedd.h linux/drivers/char/mwave/mwavedd.h
--- v2.4.10/linux/drivers/char/mwave/mwavedd.h Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/mwave/mwavedd.h Sun Sep 30 12:26:05 2001
@@ -0,0 +1,151 @@
+/*
+*
+* mwavedd.h -- declarations for mwave device driver
+*
+*
+* Written By: Mike Sullivan IBM Corporation
+*
+* Copyright (C) 1999 IBM Corporation
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* NO WARRANTY
+* THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
+* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
+* LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+* solely responsible for determining the appropriateness of using and
+* distributing the Program and assumes all risks associated with its
+* exercise of rights under this Agreement, including but not limited to
+* the risks and costs of program errors, damage to or loss of data,
+* programs or equipment, and unavailability or interruption of operations.
+*
+* DISCLAIMER OF LIABILITY
+* NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+* USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+* HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*
+*
+* 10/23/2000 - Alpha Release
+* First release to the public
+*/
+
+#ifndef _LINUX_MWAVEDD_H
+#define _LINUX_MWAVEDD_H
+#include "3780i.h"
+#include "tp3780i.h"
+#include "mwavepub.h"
+#include
+#include
+
+extern int mwave_debug;
+extern int mwave_3780i_irq;
+extern int mwave_3780i_io;
+extern int mwave_uart_irq;
+extern int mwave_uart_io;
+
+#define PRINTK_ERROR printk
+#define KERN_ERR_MWAVE KERN_ERR "mwave: "
+
+#define TRACE_MWAVE 0x0001
+#define TRACE_SMAPI 0x0002
+#define TRACE_3780I 0x0004
+#define TRACE_TP3780I 0x0008
+
+#ifdef MW_TRACE
+#define PRINTK_1(f,s) \
+ if (f & (mwave_debug)) { \
+ printk(s); \
+ }
+
+#define PRINTK_2(f,s,v1) \
+ if (f & (mwave_debug)) { \
+ printk(s,v1); \
+ }
+
+#define PRINTK_3(f,s,v1,v2) \
+ if (f & (mwave_debug)) { \
+ printk(s,v1,v2); \
+ }
+
+#define PRINTK_4(f,s,v1,v2,v3) \
+ if (f & (mwave_debug)) { \
+ printk(s,v1,v2,v3); \
+ }
+
+#define PRINTK_5(f,s,v1,v2,v3,v4) \
+ if (f & (mwave_debug)) { \
+ printk(s,v1,v2,v3,v4); \
+ }
+
+#define PRINTK_6(f,s,v1,v2,v3,v4,v5) \
+ if (f & (mwave_debug)) { \
+ printk(s,v1,v2,v3,v4,v5); \
+ }
+
+#define PRINTK_7(f,s,v1,v2,v3,v4,v5,v6) \
+ if (f & (mwave_debug)) { \
+ printk(s,v1,v2,v3,v4,v5,v6); \
+ }
+
+#define PRINTK_8(f,s,v1,v2,v3,v4,v5,v6,v7) \
+ if (f & (mwave_debug)) { \
+ printk(s,v1,v2,v3,v4,v5,v6,v7); \
+ }
+
+#else
+#define PRINTK_1(f,s)
+#define PRINTK_2(f,s,v1)
+#define PRINTK_3(f,s,v1,v2)
+#define PRINTK_4(f,s,v1,v2,v3)
+#define PRINTK_5(f,s,v1,v2,v3,v4)
+#define PRINTK_6(f,s,v1,v2,v3,v4,v5)
+#define PRINTK_7(f,s,v1,v2,v3,v4,v5,v6)
+#define PRINTK_8(f,s,v1,v2,v3,v4,v5,v6,v7)
+#endif
+
+
+typedef struct _MWAVE_IPC {
+ unsigned short usIntCount; /* 0=none, 1=first, 2=greater than 1st */
+ BOOLEAN bIsEnabled;
+ BOOLEAN bIsHere;
+ /* entry spin lock */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ wait_queue_head_t ipc_wait_queue;
+#else
+ struct wait_queue *ipc_wait_queue;
+#endif
+} MWAVE_IPC;
+
+typedef struct _MWAVE_DEVICE_DATA {
+ THINKPAD_BD_DATA rBDData; /* board driver's data area */
+ unsigned long ulIPCSource_ISR; /* IPC source bits for recently processed intr, set during ISR processing */
+ unsigned long ulIPCSource_DPC; /* IPC source bits for recently processed intr, set during DPC processing */
+ BOOLEAN bBDInitialized;
+ BOOLEAN bResourcesClaimed;
+ BOOLEAN bDSPEnabled;
+ BOOLEAN bDSPReset;
+ MWAVE_IPC IPCs[16];
+ BOOLEAN bMwaveDevRegistered;
+ BOOLEAN bProcEntryCreated;
+ short sLine;
+
+} MWAVE_DEVICE_DATA, *pMWAVE_DEVICE_DATA;
+
+#endif
diff -u --recursive --new-file v2.4.10/linux/drivers/char/mwave/mwavepub.h linux/drivers/char/mwave/mwavepub.h
--- v2.4.10/linux/drivers/char/mwave/mwavepub.h Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/mwave/mwavepub.h Sun Sep 30 12:26:05 2001
@@ -0,0 +1,94 @@
+/*
+*
+* mwavepub.h -- PUBLIC declarations for the mwave driver
+* and applications using it
+*
+*
+* Written By: Mike Sullivan IBM Corporation
+*
+* Copyright (C) 1999 IBM Corporation
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* NO WARRANTY
+* THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
+* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
+* LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+* solely responsible for determining the appropriateness of using and
+* distributing the Program and assumes all risks associated with its
+* exercise of rights under this Agreement, including but not limited to
+* the risks and costs of program errors, damage to or loss of data,
+* programs or equipment, and unavailability or interruption of operations.
+*
+* DISCLAIMER OF LIABILITY
+* NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+* USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+* HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*
+*
+* 10/23/2000 - Alpha Release
+* First release to the public
+*/
+
+#ifndef _LINUX_MWAVEPUB_H
+#define _LINUX_MWAVEPUB_H
+
+#ifndef MWAVEM_APP_DIST
+#include
+#endif
+
+#ifdef MWAVEM_APP_DIST
+#define MWAVE_MINOR 219
+#endif
+
+typedef struct _MW_ABILITIES {
+ unsigned long instr_per_sec;
+ unsigned long data_size;
+ unsigned long inst_size;
+ unsigned long bus_dma_bw;
+ unsigned short uart_enable;
+ short component_count;
+ unsigned long component_list[7];
+ char mwave_os_name[16];
+ char bios_task_name[16];
+} MW_ABILITIES, *pMW_ABILITIES;
+
+
+typedef struct _MW_READWRITE {
+ unsigned short usDspAddress; /* The dsp address */
+ unsigned long ulDataLength; /* The size in bytes of the data or user buffer */
+ void *pBuf; /* Input:variable sized buffer */
+} MW_READWRITE, *pMW_READWRITE;
+
+#define IOCTL_MW_RESET _IO(MWAVE_MINOR,1)
+#define IOCTL_MW_RUN _IO(MWAVE_MINOR,2)
+#define IOCTL_MW_DSP_ABILITIES _IOR(MWAVE_MINOR,3,MW_ABILITIES)
+#define IOCTL_MW_READ_DATA _IOR(MWAVE_MINOR,4,MW_READWRITE)
+#define IOCTL_MW_READCLEAR_DATA _IOR(MWAVE_MINOR,5,MW_READWRITE)
+#define IOCTL_MW_READ_INST _IOR(MWAVE_MINOR,6,MW_READWRITE)
+#define IOCTL_MW_WRITE_DATA _IOW(MWAVE_MINOR,7,MW_READWRITE)
+#define IOCTL_MW_WRITE_INST _IOW(MWAVE_MINOR,8,MW_READWRITE)
+#define IOCTL_MW_REGISTER_IPC _IOW(MWAVE_MINOR,9,int)
+#define IOCTL_MW_UNREGISTER_IPC _IOW(MWAVE_MINOR,10,int)
+#define IOCTL_MW_GET_IPC _IOW(MWAVE_MINOR,11,int)
+#define IOCTL_MW_TRACE _IOR(MWAVE_MINOR,12,MW_READWRITE)
+
+
+#endif
diff -u --recursive --new-file v2.4.10/linux/drivers/char/mwave/smapi.c linux/drivers/char/mwave/smapi.c
--- v2.4.10/linux/drivers/char/mwave/smapi.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/mwave/smapi.c Sun Sep 30 12:26:05 2001
@@ -0,0 +1,563 @@
+/*
+*
+* smapi.c -- SMAPI interface routines
+*
+*
+* Written By: Mike Sullivan IBM Corporation
+*
+* Copyright (C) 1999 IBM Corporation
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* NO WARRANTY
+* THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
+* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
+* LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+* solely responsible for determining the appropriateness of using and
+* distributing the Program and assumes all risks associated with its
+* exercise of rights under this Agreement, including but not limited to
+* the risks and costs of program errors, damage to or loss of data,
+* programs or equipment, and unavailability or interruption of operations.
+*
+* DISCLAIMER OF LIABILITY
+* NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+* USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+* HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*
+*
+* 10/23/2000 - Alpha Release
+* First release to the public
+*/
+
+#include
+#include
+#include /* CMOS defines */
+#include "smapi.h"
+#include "mwavedd.h"
+
+static unsigned short g_usSmapiPort = 0;
+
+
+int smapi_request(unsigned short inBX, unsigned short inCX,
+ unsigned short inDI, unsigned short inSI,
+ unsigned short *outAX, unsigned short *outBX,
+ unsigned short *outCX, unsigned short *outDX,
+ unsigned short *outDI, unsigned short *outSI)
+{
+ unsigned short myoutAX = 2, *pmyoutAX = &myoutAX;
+ unsigned short myoutBX = 3, *pmyoutBX = &myoutBX;
+ unsigned short myoutCX = 4, *pmyoutCX = &myoutCX;
+ unsigned short myoutDX = 5, *pmyoutDX = &myoutDX;
+ unsigned short myoutDI = 6, *pmyoutDI = &myoutDI;
+ unsigned short myoutSI = 7, *pmyoutSI = &myoutSI;
+ unsigned short usSmapiOK = -EIO, *pusSmapiOK = &usSmapiOK;
+ unsigned int inBXCX = (inBX << 16) | inCX;
+ unsigned int inDISI = (inDI << 16) | inSI;
+ int retval = 0;
+
+ PRINTK_5(TRACE_SMAPI, "inBX %x inCX %x inDI %x inSI %x\n",
+ inBX, inCX, inDI, inSI);
+
+ __asm__ __volatile__("movw $0x5380,%%ax\n\t"
+ "movl %7,%%ebx\n\t"
+ "shrl $16, %%ebx\n\t"
+ "movw %7,%%cx\n\t"
+ "movl %8,%%edi\n\t"
+ "shrl $16,%%edi\n\t"
+ "movw %8,%%si\n\t"
+ "movw %9,%%dx\n\t"
+ "out %%al,%%dx\n\t"
+ "out %%al,$0x4F\n\t"
+ "cmpb $0x53,%%ah\n\t"
+ "je 2f\n\t"
+ "1:\n\t"
+ "orb %%ah,%%ah\n\t"
+ "jnz 2f\n\t"
+ "movw %%ax,%0\n\t"
+ "movw %%bx,%1\n\t"
+ "movw %%cx,%2\n\t"
+ "movw %%dx,%3\n\t"
+ "movw %%di,%4\n\t"
+ "movw %%si,%5\n\t"
+ "movw $1,%6\n\t"
+ "2:\n\t":"=m"(*(unsigned short *) pmyoutAX),
+ "=m"(*(unsigned short *) pmyoutBX),
+ "=m"(*(unsigned short *) pmyoutCX),
+ "=m"(*(unsigned short *) pmyoutDX),
+ "=m"(*(unsigned short *) pmyoutDI),
+ "=m"(*(unsigned short *) pmyoutSI),
+ "=m"(*(unsigned short *) pusSmapiOK)
+ :"m"(inBXCX), "m"(inDISI), "m"(g_usSmapiPort)
+ :"%eax", "%ebx", "%ecx", "%edx", "%edi",
+ "%esi");
+
+ PRINTK_8(TRACE_SMAPI,
+ "myoutAX %x myoutBX %x myoutCX %x myoutDX %x myoutDI %x myoutSI %x usSmapiOK %x\n",
+ myoutAX, myoutBX, myoutCX, myoutDX, myoutDI, myoutSI,
+ usSmapiOK);
+ *outAX = myoutAX;
+ *outBX = myoutBX;
+ *outCX = myoutCX;
+ *outDX = myoutDX;
+ *outDI = myoutDI;
+ *outSI = myoutSI;
+
+ retval = (usSmapiOK == 1) ? 0 : -EIO;
+ PRINTK_2(TRACE_SMAPI, "smapi::smapi_request exit retval %x\n", retval);
+ return retval;
+}
+
+
+int smapi_query_DSP_cfg(SMAPI_DSP_SETTINGS * pSettings)
+{
+ int bRC = -EIO;
+ unsigned short usAX, usBX, usCX, usDX, usDI, usSI;
+ unsigned short ausDspBases[] = { 0x0030, 0x4E30, 0x8E30, 0xCE30, 0x0130, 0x0350, 0x0070, 0x0DB0 };
+ unsigned short ausUartBases[] = { 0x03F8, 0x02F8, 0x03E8, 0x02E8 };
+ unsigned short numDspBases = 8;
+ unsigned short numUartBases = 4;
+
+ PRINTK_1(TRACE_SMAPI, "smapi::smapi_query_DSP_cfg entry\n");
+
+ bRC = smapi_request(0x1802, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_query_DSP_cfg: Error: Could not get DSP Settings. Aborting.\n");
+ return bRC;
+ }
+
+ PRINTK_1(TRACE_SMAPI, "smapi::smapi_query_DSP_cfg, smapi_request OK\n");
+
+ pSettings->bDSPPresent = ((usBX & 0x0100) != 0);
+ pSettings->bDSPEnabled = ((usCX & 0x0001) != 0);
+ pSettings->usDspIRQ = usSI & 0x00FF;
+ pSettings->usDspDMA = (usSI & 0xFF00) >> 8;
+ if ((usDI & 0x00FF) < numDspBases) {
+ pSettings->usDspBaseIO = ausDspBases[usDI & 0x00FF];
+ } else {
+ pSettings->usDspBaseIO = 0;
+ }
+ PRINTK_6(TRACE_SMAPI,
+ "smapi::smapi_query_DSP_cfg get DSP Settings bDSPPresent %x bDSPEnabled %x usDspIRQ %x usDspDMA %x usDspBaseIO %x\n",
+ pSettings->bDSPPresent, pSettings->bDSPEnabled,
+ pSettings->usDspIRQ, pSettings->usDspDMA,
+ pSettings->usDspBaseIO);
+
+ /* check for illegal values */
+ if ( pSettings->usDspBaseIO == 0 )
+ PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_query_DSP_cfg: Worry: DSP base I/O address is 0\n");
+ if ( pSettings->usDspIRQ == 0 )
+ PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_query_DSP_cfg: Worry: DSP IRQ line is 0\n");
+
+ bRC = smapi_request(0x1804, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) {
+ PRINTK_ERROR("smapi::smapi_query_DSP_cfg: Error: Could not get DSP modem settings. Aborting.\n");
+ return bRC;
+ }
+
+ PRINTK_1(TRACE_SMAPI, "smapi::smapi_query_DSP_cfg, smapi_request OK\n");
+
+ pSettings->bModemEnabled = ((usCX & 0x0001) != 0);
+ pSettings->usUartIRQ = usSI & 0x000F;
+ if (((usSI & 0xFF00) >> 8) < numUartBases) {
+ pSettings->usUartBaseIO = ausUartBases[(usSI & 0xFF00) >> 8];
+ } else {
+ pSettings->usUartBaseIO = 0;
+ }
+
+ PRINTK_4(TRACE_SMAPI,
+ "smapi::smapi_query_DSP_cfg get DSP modem settings bModemEnabled %x usUartIRQ %x usUartBaseIO %x\n",
+ pSettings->bModemEnabled,
+ pSettings->usUartIRQ,
+ pSettings->usUartBaseIO);
+
+ /* check for illegal values */
+ if ( pSettings->usUartBaseIO == 0 )
+ PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_query_DSP_cfg: Worry: UART base I/O address is 0\n");
+ if ( pSettings->usUartIRQ == 0 )
+ PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_query_DSP_cfg: Worry: UART IRQ line is 0\n");
+
+ PRINTK_2(TRACE_SMAPI, "smapi::smapi_query_DSP_cfg exit bRC %x\n", bRC);
+
+ return bRC;
+}
+
+
+int smapi_set_DSP_cfg(void)
+{
+ int bRC = -EIO;
+ int i;
+ unsigned short usAX, usBX, usCX, usDX, usDI, usSI;
+ unsigned short ausDspBases[] = { 0x0030, 0x4E30, 0x8E30, 0xCE30, 0x0130, 0x0350, 0x0070, 0x0DB0 };
+ unsigned short ausUartBases[] = { 0x03F8, 0x02F8, 0x03E8, 0x02E8 };
+ unsigned short ausDspIrqs[] = { 5, 7, 10, 11, 15 };
+ unsigned short ausUartIrqs[] = { 3, 4 };
+
+ unsigned short numDspBases = 8;
+ unsigned short numUartBases = 4;
+ unsigned short numDspIrqs = 5;
+ unsigned short numUartIrqs = 2;
+ unsigned short dspio_index = 0, uartio_index = 0;
+
+ PRINTK_5(TRACE_SMAPI,
+ "smapi::smapi_set_DSP_cfg entry mwave_3780i_irq %x mwave_3780i_io %x mwave_uart_irq %x mwave_uart_io %x\n",
+ mwave_3780i_irq, mwave_3780i_io, mwave_uart_irq, mwave_uart_io);
+
+ if (mwave_3780i_io) {
+ for (i = 0; i < numDspBases; i++) {
+ if (mwave_3780i_io == ausDspBases[i])
+ break;
+ }
+ if (i == numDspBases) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg: Error: Invalid mwave_3780i_io address %x. Aborting.\n", mwave_3780i_io);
+ return bRC;
+ }
+ dspio_index = i;
+ }
+
+ if (mwave_3780i_irq) {
+ for (i = 0; i < numDspIrqs; i++) {
+ if (mwave_3780i_irq == ausDspIrqs[i])
+ break;
+ }
+ if (i == numDspIrqs) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg: Error: Invalid mwave_3780i_irq %x. Aborting.\n", mwave_3780i_irq);
+ return bRC;
+ }
+ }
+
+ if (mwave_uart_io) {
+ for (i = 0; i < numUartBases; i++) {
+ if (mwave_uart_io == ausUartBases[i])
+ break;
+ }
+ if (i == numUartBases) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg: Error: Invalid mwave_uart_io address %x. Aborting.\n", mwave_uart_io);
+ return bRC;
+ }
+ uartio_index = i;
+ }
+
+
+ if (mwave_uart_irq) {
+ for (i = 0; i < numUartIrqs; i++) {
+ if (mwave_uart_irq == ausUartIrqs[i])
+ break;
+ }
+ if (i == numUartIrqs) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg: Error: Invalid mwave_uart_irq %x. Aborting.\n", mwave_uart_irq);
+ return bRC;
+ }
+ }
+
+ if (mwave_uart_irq || mwave_uart_io) {
+
+ /* Check serial port A */
+ bRC = smapi_request(0x1402, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+ /* bRC == 0 */
+ if (usBX & 0x0100) { /* serial port A is present */
+ if (usCX & 1) { /* serial port is enabled */
+ if ((usSI & 0xFF) == mwave_uart_irq) {
+#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
+ PRINTK_ERROR(KERN_ERR_MWAVE
+#else
+ PRINTK_3(TRACE_SMAPI,
+#endif
+ "smapi::smapi_set_DSP_cfg: Serial port A irq %x conflicts with mwave_uart_irq %x\n", usSI, mwave_uart_irq);
+#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
+ PRINTK_1(TRACE_SMAPI,
+ "smapi::smapi_set_DSP_cfg Disabling conflicting serial port\n");
+ bRC = smapi_request(0x1403, 0x0100, 0, usSI,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+ bRC = smapi_request(0x1402, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+#else
+ goto exit_conflict;
+#endif
+ } else {
+ if ((usSI >> 8) == uartio_index) {
+#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
+ PRINTK_ERROR(KERN_ERR_MWAVE
+#else
+ PRINTK_3(TRACE_SMAPI,
+#endif
+ "smapi::smapi_set_DSP_cfg: Serial port A base I/O address index %x conflicts with uartio_index %x\n", usSI >> 8, uartio_index);
+#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
+ PRINTK_1(TRACE_SMAPI,
+ "smapi::smapi_set_DSP_cfg Disabling conflicting serial port\n");
+ bRC = smapi_request (0x1403, 0x0100, 0, usSI,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+ bRC = smapi_request (0x1402, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+#else
+ goto exit_conflict;
+#endif
+ }
+ }
+ }
+ }
+
+ /* Check serial port B */
+ bRC = smapi_request(0x1404, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+ /* bRC == 0 */
+ if (usBX & 0x0100) { /* serial port B is present */
+ if (usCX & 1) { /* serial port is enabled */
+ if ((usSI & 0xFF) == mwave_uart_irq) {
+#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
+ PRINTK_ERROR(KERN_ERR_MWAVE
+#else
+ PRINTK_3(TRACE_SMAPI,
+#endif
+ "smapi::smapi_set_DSP_cfg: Serial port B irq %x conflicts with mwave_uart_irq %x\n", usSI, mwave_uart_irq);
+#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
+ PRINTK_1(TRACE_SMAPI,
+ "smapi::smapi_set_DSP_cfg Disabling conflicting serial port\n");
+ bRC = smapi_request(0x1405, 0x0100, 0, usSI,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+ bRC = smapi_request(0x1404, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+#else
+ goto exit_conflict;
+#endif
+ } else {
+ if ((usSI >> 8) == uartio_index) {
+#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
+ PRINTK_ERROR(KERN_ERR_MWAVE
+#else
+ PRINTK_3(TRACE_SMAPI,
+#endif
+ "smapi::smapi_set_DSP_cfg: Serial port B base I/O address index %x conflicts with uartio_index %x\n", usSI >> 8, uartio_index);
+#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
+ PRINTK_1 (TRACE_SMAPI,
+ "smapi::smapi_set_DSP_cfg Disabling conflicting serial port\n");
+ bRC = smapi_request (0x1405, 0x0100, 0, usSI,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+ bRC = smapi_request (0x1404, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+#else
+ goto exit_conflict;
+#endif
+ }
+ }
+ }
+ }
+
+ /* Check IR port */
+ bRC = smapi_request(0x1700, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+ bRC = smapi_request(0x1704, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+ /* bRC == 0 */
+ if ((usCX & 0xff) == mwave_uart_irq) { /* serial port is enabled */
+#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
+ PRINTK_ERROR(KERN_ERR_MWAVE
+#else
+ PRINTK_3(TRACE_SMAPI,
+#endif
+ "smapi::smapi_set_DSP_cfg: IR port irq %x conflicts with mwave_uart_irq %x\n", usSI, mwave_uart_irq);
+#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
+ PRINTK_1(TRACE_SMAPI,
+ "smapi::smapi_set_DSP_cfg Disabling conflicting IR port\n");
+ bRC = smapi_request(0x1701, 0x0100, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+ bRC = smapi_request(0x1700, 0, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+ bRC = smapi_request(0x1705, 0x01ff, 0, usSI,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+ bRC = smapi_request(0x1704, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+#else
+ goto exit_conflict;
+#endif
+ } else {
+ if ((usSI & 0xff) == uartio_index) {
+#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
+ PRINTK_ERROR(KERN_ERR_MWAVE
+#else
+ PRINTK_3(TRACE_SMAPI,
+#endif
+ "smapi::smapi_set_DSP_cfg: IR port base I/O address index %x conflicts with uartio_index %x\n", usSI & 0xff, uartio_index);
+#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
+ PRINTK_1(TRACE_SMAPI,
+ "smapi::smapi_set_DSP_cfg Disabling conflicting IR port\n");
+ bRC = smapi_request(0x1701, 0x0100, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+ bRC = smapi_request(0x1700, 0, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+ bRC = smapi_request(0x1705, 0x01ff, 0, usSI,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+ bRC = smapi_request(0x1704, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+#else
+ goto exit_conflict;
+#endif
+ }
+ }
+ }
+
+ bRC = smapi_request(0x1802, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+
+ if (mwave_3780i_io) {
+ usDI = dspio_index;;
+ }
+ if (mwave_3780i_irq) {
+ usSI = (usSI & 0xff00) | mwave_3780i_irq;
+ }
+
+ bRC = smapi_request(0x1803, 0x0101, usDI, usSI,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+
+ bRC = smapi_request(0x1804, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+
+ if (mwave_uart_io) {
+ usSI = (usSI & 0x00ff) | (uartio_index << 8);
+ }
+ if (mwave_uart_irq) {
+ usSI = (usSI & 0xff00) | mwave_uart_irq;
+ }
+ bRC = smapi_request(0x1805, 0x0101, 0, usSI,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+
+ bRC = smapi_request(0x1802, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+
+ bRC = smapi_request(0x1804, 0x0000, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+ if (bRC) goto exit_smapi_request_error;
+
+/* normal exit: */
+ PRINTK_1(TRACE_SMAPI, "smapi::smapi_set_DSP_cfg exit\n");
+ return 0;
+
+exit_conflict:
+ /* Message has already been printed */
+ return -EIO;
+
+exit_smapi_request_error:
+ PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg exit on smapi_request error bRC %x\n", bRC);
+ return bRC;
+}
+
+
+int smapi_set_DSP_power_state(BOOLEAN bOn)
+{
+ int bRC = -EIO;
+ unsigned short usAX, usBX, usCX, usDX, usDI, usSI;
+ unsigned short usPowerFunction;
+
+ PRINTK_2(TRACE_SMAPI, "smapi::smapi_set_DSP_power_state entry bOn %x\n", bOn);
+
+ usPowerFunction = (bOn) ? 1 : 0;
+
+ bRC = smapi_request(0x4901, 0x0000, 0, usPowerFunction,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+
+ PRINTK_2(TRACE_SMAPI, "smapi::smapi_set_DSP_power_state exit bRC %x\n", bRC);
+
+ return bRC;
+}
+
+
+int SmapiQuerySystemID(void)
+{
+ int bRC = -EIO;
+ unsigned short usAX = 0xffff, usBX = 0xffff, usCX = 0xffff,
+ usDX = 0xffff, usDI = 0xffff, usSI = 0xffff;
+
+ printk("smapi::SmapiQUerySystemID entry\n");
+ bRC = smapi_request(0x0000, 0, 0, 0,
+ &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
+
+ if (bRC == 0) {
+ printk("AX=%x, BX=%x, CX=%x, DX=%x, DI=%x, SI=%x\n",
+ usAX, usBX, usCX, usDX, usDI, usSI);
+ } else {
+ printk("smapi::SmapiQuerySystemID smapi_request error\n");
+ }
+
+ return bRC;
+}
+
+
+int smapi_init(void)
+{
+ int retval = -EIO;
+ unsigned short usSmapiID = 0;
+ unsigned long flags;
+
+ PRINTK_1(TRACE_SMAPI, "smapi::smapi_init entry\n");
+
+ spin_lock_irqsave(&rtc_lock, flags);
+ usSmapiID = CMOS_READ(0x7C);
+ usSmapiID |= (CMOS_READ(0x7D) << 8);
+ spin_unlock_irqrestore(&rtc_lock, flags);
+ PRINTK_2(TRACE_SMAPI, "smapi::smapi_init usSmapiID %x\n", usSmapiID);
+
+ if (usSmapiID == 0x5349) {
+ spin_lock_irqsave(&rtc_lock, flags);
+ g_usSmapiPort = CMOS_READ(0x7E);
+ g_usSmapiPort |= (CMOS_READ(0x7F) << 8);
+ spin_unlock_irqrestore(&rtc_lock, flags);
+ if (g_usSmapiPort == 0) {
+ PRINTK_ERROR("smapi::smapi_init, ERROR unable to read from SMAPI port\n");
+ } else {
+ PRINTK_2(TRACE_SMAPI,
+ "smapi::smapi_init, exit TRUE g_usSmapiPort %x\n",
+ g_usSmapiPort);
+ retval = 0;
+ //SmapiQuerySystemID();
+ }
+ } else {
+ PRINTK_ERROR("smapi::smapi_init, ERROR invalid usSmapiID\n");
+ retval = -ENXIO;
+ }
+
+ return retval;
+}
diff -u --recursive --new-file v2.4.10/linux/drivers/char/mwave/smapi.h linux/drivers/char/mwave/smapi.h
--- v2.4.10/linux/drivers/char/mwave/smapi.h Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/mwave/smapi.h Sun Sep 30 12:26:05 2001
@@ -0,0 +1,80 @@
+/*
+*
+* smapi.h -- declarations for SMAPI interface routines
+*
+*
+* Written By: Mike Sullivan IBM Corporation
+*
+* Copyright (C) 1999 IBM Corporation
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* NO WARRANTY
+* THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
+* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
+* LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+* solely responsible for determining the appropriateness of using and
+* distributing the Program and assumes all risks associated with its
+* exercise of rights under this Agreement, including but not limited to
+* the risks and costs of program errors, damage to or loss of data,
+* programs or equipment, and unavailability or interruption of operations.
+*
+* DISCLAIMER OF LIABILITY
+* NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+* USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+* HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*
+*
+* 10/23/2000 - Alpha Release
+* First release to the public
+*/
+
+#ifndef _LINUX_SMAPI_H
+#define _LINUX_SMAPI_H
+
+#define TRUE 1
+#define FALSE 0
+#define BOOLEAN int
+
+typedef struct {
+ int bDSPPresent;
+ int bDSPEnabled;
+ int bModemEnabled;
+ int bMIDIEnabled;
+ int bSblstEnabled;
+ unsigned short usDspIRQ;
+ unsigned short usDspDMA;
+ unsigned short usDspBaseIO;
+ unsigned short usUartIRQ;
+ unsigned short usUartBaseIO;
+ unsigned short usMidiIRQ;
+ unsigned short usMidiBaseIO;
+ unsigned short usSndblstIRQ;
+ unsigned short usSndblstDMA;
+ unsigned short usSndblstBaseIO;
+} SMAPI_DSP_SETTINGS;
+
+int smapi_init(void);
+int smapi_query_DSP_cfg(SMAPI_DSP_SETTINGS * pSettings);
+int smapi_set_DSP_cfg(void);
+int smapi_set_DSP_power_state(BOOLEAN bOn);
+
+
+#endif
diff -u --recursive --new-file v2.4.10/linux/drivers/char/mwave/tp3780i.c linux/drivers/char/mwave/tp3780i.c
--- v2.4.10/linux/drivers/char/mwave/tp3780i.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/mwave/tp3780i.c Sun Sep 30 12:26:05 2001
@@ -0,0 +1,589 @@
+/*
+*
+* tp3780i.c -- board driver for 3780i on ThinkPads
+*
+*
+* Written By: Mike Sullivan IBM Corporation
+*
+* Copyright (C) 1999 IBM Corporation
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* NO WARRANTY
+* THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
+* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
+* LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+* solely responsible for determining the appropriateness of using and
+* distributing the Program and assumes all risks associated with its
+* exercise of rights under this Agreement, including but not limited to
+* the risks and costs of program errors, damage to or loss of data,
+* programs or equipment, and unavailability or interruption of operations.
+*
+* DISCLAIMER OF LIABILITY
+* NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+* USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+* HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*
+*
+* 10/23/2000 - Alpha Release
+* First release to the public
+*/
+
+#include
+#include
+#include
+#include
+#include
+#include "smapi.h"
+#include "mwavedd.h"
+#include "tp3780i.h"
+#include "3780i.h"
+#include "mwavepub.h"
+
+extern MWAVE_DEVICE_DATA mwave_s_mdd;
+
+static unsigned short s_ausThinkpadIrqToField[16] =
+ { 0xFFFF, 0xFFFF, 0xFFFF, 0x0001, 0x0002, 0x0003, 0xFFFF, 0x0004,
+ 0xFFFF, 0xFFFF, 0x0005, 0x0006, 0xFFFF, 0xFFFF, 0xFFFF, 0x0007 };
+static unsigned short s_ausThinkpadDmaToField[8] =
+ { 0x0001, 0x0002, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0003, 0x0004 };
+static unsigned short s_numIrqs = 16, s_numDmas = 8;
+
+
+static void EnableSRAM(THINKPAD_BD_DATA * pBDData)
+{
+ DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings;
+ unsigned short usDspBaseIO = pSettings->usDspBaseIO;
+ DSP_GPIO_OUTPUT_DATA_15_8 rGpioOutputData;
+ DSP_GPIO_DRIVER_ENABLE_15_8 rGpioDriverEnable;
+ DSP_GPIO_MODE_15_8 rGpioMode;
+
+ PRINTK_1(TRACE_TP3780I, "tp3780i::EnableSRAM, entry\n");
+
+ MKWORD(rGpioMode) = ReadMsaCfg(DSP_GpioModeControl_15_8);
+ rGpioMode.GpioMode10 = 0;
+ WriteMsaCfg(DSP_GpioModeControl_15_8, MKWORD(rGpioMode));
+
+ MKWORD(rGpioDriverEnable) = 0;
+ rGpioDriverEnable.Enable10 = TRUE;
+ rGpioDriverEnable.Mask10 = TRUE;
+ WriteMsaCfg(DSP_GpioDriverEnable_15_8, MKWORD(rGpioDriverEnable));
+
+ MKWORD(rGpioOutputData) = 0;
+ rGpioOutputData.Latch10 = 0;
+ rGpioOutputData.Mask10 = TRUE;
+ WriteMsaCfg(DSP_GpioOutputData_15_8, MKWORD(rGpioOutputData));
+
+ PRINTK_1(TRACE_TP3780I, "tp3780i::EnableSRAM exit\n");
+}
+
+
+static void UartInterrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+ PRINTK_3(TRACE_TP3780I,
+ "tp3780i::UartInterrupt entry irq %x dev_id %x\n", irq, (int) dev_id);
+}
+
+static void DspInterrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+ pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd;
+ DSP_3780I_CONFIG_SETTINGS *pSettings = &pDrvData->rBDData.rDspSettings;
+ unsigned short usDspBaseIO = pSettings->usDspBaseIO;
+ unsigned short usIPCSource = 0, usIsolationMask, usPCNum;
+
+ PRINTK_3(TRACE_TP3780I,
+ "tp3780i::DspInterrupt entry irq %x dev_id %x\n", irq, (int) dev_id);
+
+ if (dsp3780I_GetIPCSource(usDspBaseIO, &usIPCSource) == 0) {
+ PRINTK_2(TRACE_TP3780I,
+ "tp3780i::DspInterrupt, return from dsp3780i_GetIPCSource, usIPCSource %x\n",
+ usIPCSource);
+ usIsolationMask = 1;
+ for (usPCNum = 1; usPCNum <= 16; usPCNum++) {
+ if (usIPCSource & usIsolationMask) {
+ usIPCSource &= ~usIsolationMask;
+ PRINTK_3(TRACE_TP3780I,
+ "tp3780i::DspInterrupt usPCNum %x usIPCSource %x\n",
+ usPCNum, usIPCSource);
+ if (pDrvData->IPCs[usPCNum - 1].usIntCount == 0) {
+ pDrvData->IPCs[usPCNum - 1].usIntCount = 1;
+ }
+ PRINTK_2(TRACE_TP3780I,
+ "tp3780i::DspInterrupt usIntCount %x\n",
+ pDrvData->IPCs[usPCNum - 1].usIntCount);
+ if (pDrvData->IPCs[usPCNum - 1].bIsEnabled == TRUE) {
+ PRINTK_2(TRACE_TP3780I,
+ "tp3780i::DspInterrupt, waking up usPCNum %x\n",
+ usPCNum - 1);
+ wake_up_interruptible(&pDrvData->IPCs[usPCNum - 1].ipc_wait_queue);
+ } else {
+ PRINTK_2(TRACE_TP3780I,
+ "tp3780i::DspInterrupt, no one waiting for IPC %x\n",
+ usPCNum - 1);
+ }
+ }
+ if (usIPCSource == 0)
+ break;
+ /* try next IPC */
+ usIsolationMask = usIsolationMask << 1;
+ }
+ } else {
+ PRINTK_1(TRACE_TP3780I,
+ "tp3780i::DspInterrupt, return false from dsp3780i_GetIPCSource\n");
+ }
+ PRINTK_1(TRACE_TP3780I, "tp3780i::DspInterrupt exit\n");
+}
+
+
+int tp3780I_InitializeBoardData(THINKPAD_BD_DATA * pBDData)
+{
+ int retval = 0;
+ DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings;
+
+
+ PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_InitializeBoardData entry pBDData %p\n", pBDData);
+
+ pBDData->bDSPEnabled = FALSE;
+ pSettings->bInterruptClaimed = FALSE;
+
+ retval = smapi_init();
+ if (retval) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_InitializeBoardData: Error: SMAPI is not available on this machine\n");
+ } else {
+ if (mwave_3780i_irq || mwave_3780i_io || mwave_uart_irq || mwave_uart_io) {
+ retval = smapi_set_DSP_cfg();
+ }
+ }
+
+ PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_InitializeBoardData exit retval %x\n", retval);
+
+ return retval;
+}
+
+int tp3780I_Cleanup(THINKPAD_BD_DATA * pBDData)
+{
+ int retval = 0;
+
+ PRINTK_2(TRACE_TP3780I,
+ "tp3780i::tp3780I_Cleanup entry and exit pBDData %p\n", pBDData);
+
+ return retval;
+}
+
+int tp3780I_CalcResources(THINKPAD_BD_DATA * pBDData)
+{
+ SMAPI_DSP_SETTINGS rSmapiInfo;
+ DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings;
+
+ PRINTK_2(TRACE_TP3780I,
+ "tp3780i::tp3780I_CalcResources entry pBDData %p\n", pBDData);
+
+ if (smapi_query_DSP_cfg(&rSmapiInfo)) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_CalcResources: Error: Could not query DSP config. Aborting.\n");
+ return -EIO;
+ }
+
+ /* Sanity check */
+ if (
+ ( rSmapiInfo.usDspIRQ == 0 )
+ || ( rSmapiInfo.usDspBaseIO == 0 )
+ || ( rSmapiInfo.usUartIRQ == 0 )
+ || ( rSmapiInfo.usUartBaseIO == 0 )
+ ) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_CalcResources: Error: Illegal resource setting. Aborting.\n");
+ return -EIO;
+ }
+
+ pSettings->bDSPEnabled = (rSmapiInfo.bDSPEnabled && rSmapiInfo.bDSPPresent);
+ pSettings->bModemEnabled = rSmapiInfo.bModemEnabled;
+ pSettings->usDspIrq = rSmapiInfo.usDspIRQ;
+ pSettings->usDspDma = rSmapiInfo.usDspDMA;
+ pSettings->usDspBaseIO = rSmapiInfo.usDspBaseIO;
+ pSettings->usUartIrq = rSmapiInfo.usUartIRQ;
+ pSettings->usUartBaseIO = rSmapiInfo.usUartBaseIO;
+
+ pSettings->uDStoreSize = TP_ABILITIES_DATA_SIZE;
+ pSettings->uIStoreSize = TP_ABILITIES_INST_SIZE;
+ pSettings->uIps = TP_ABILITIES_INTS_PER_SEC;
+
+ if (pSettings->bDSPEnabled && pSettings->bModemEnabled && pSettings->usDspIrq == pSettings->usUartIrq) {
+ pBDData->bShareDspIrq = pBDData->bShareUartIrq = 1;
+ } else {
+ pBDData->bShareDspIrq = pBDData->bShareUartIrq = 0;
+ }
+
+ PRINTK_1(TRACE_TP3780I, "tp3780i::tp3780I_CalcResources exit\n");
+
+ return 0;
+}
+
+
+int tp3780I_ClaimResources(THINKPAD_BD_DATA * pBDData)
+{
+ int retval = 0;
+ DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ struct resource *pres;
+#endif
+
+ PRINTK_2(TRACE_TP3780I,
+ "tp3780i::tp3780I_ClaimResources entry pBDData %p\n", pBDData);
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ pres = request_region(pSettings->usDspBaseIO, 16, "mwave_3780i");
+ if ( pres == NULL ) retval = -EIO;
+#else
+ retval = check_region(pSettings->usDspBaseIO, 16);
+ if (!retval) request_region(pSettings->usDspBaseIO, 16, "mwave_3780i");
+#endif
+ if (retval) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_ClaimResources: Error: Could not claim I/O region starting at %x\n", pSettings->usDspBaseIO);
+ retval = -EIO;
+ }
+
+ PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_ClaimResources exit retval %x\n", retval);
+
+ return retval;
+}
+
+int tp3780I_ReleaseResources(THINKPAD_BD_DATA * pBDData)
+{
+ int retval = 0;
+ DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings;
+
+ PRINTK_2(TRACE_TP3780I,
+ "tp3780i::tp3780I_ReleaseResources entry pBDData %p\n", pBDData);
+
+ release_region(pSettings->usDspBaseIO & (~3), 16);
+
+ if (pSettings->bInterruptClaimed) {
+ free_irq(pSettings->usDspIrq, 0);
+ pSettings->bInterruptClaimed = FALSE;
+ }
+
+ PRINTK_2(TRACE_TP3780I,
+ "tp3780i::tp3780I_ReleaseResources exit retval %x\n", retval);
+
+ return retval;
+}
+
+
+
+int tp3780I_EnableDSP(THINKPAD_BD_DATA * pBDData)
+{
+ DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings;
+ BOOLEAN bDSPPoweredUp = FALSE, bDSPEnabled = FALSE, bInterruptAllocated = FALSE;
+
+ PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_EnableDSP entry pBDData %p\n", pBDData);
+
+ if (pBDData->bDSPEnabled) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_EnableDSP: Error: DSP already enabled!\n");
+ goto exit_cleanup;
+ }
+
+ if (!pSettings->bDSPEnabled) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "tp3780::tp3780I_EnableDSP: Error: pSettings->bDSPEnabled not set\n");
+ goto exit_cleanup;
+ }
+
+ if (
+ (pSettings->usDspIrq >= s_numIrqs)
+ || (pSettings->usDspDma >= s_numDmas)
+ || (s_ausThinkpadIrqToField[pSettings->usDspIrq] == 0xFFFF)
+ || (s_ausThinkpadDmaToField[pSettings->usDspDma] == 0xFFFF)
+ ) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_EnableDSP: Error: invalid irq %x\n", pSettings->usDspIrq);
+ goto exit_cleanup;
+ }
+
+ if (
+ ((pSettings->usDspBaseIO & 0xF00F) != 0)
+ || (pSettings->usDspBaseIO & 0x0FF0) == 0
+ ) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_EnableDSP: Error: Invalid DSP base I/O address %x\n", pSettings->usDspBaseIO);
+ goto exit_cleanup;
+ }
+
+ if (pSettings->bModemEnabled) {
+ if (
+ pSettings->usUartIrq >= s_numIrqs
+ || s_ausThinkpadIrqToField[pSettings->usUartIrq] == 0xFFFF
+ ) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_EnableDSP: Error: Invalid UART IRQ %x\n", pSettings->usUartIrq);
+ goto exit_cleanup;
+ }
+ switch (pSettings->usUartBaseIO) {
+ case 0x03F8:
+ case 0x02F8:
+ case 0x03E8:
+ case 0x02E8:
+ break;
+
+ default:
+ PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Error: Invalid UART base I/O address %x\n", pSettings->usUartBaseIO);
+ goto exit_cleanup;
+ }
+ }
+
+ pSettings->bDspIrqActiveLow = pSettings->bDspIrqPulse = TRUE;
+ pSettings->bUartIrqActiveLow = pSettings->bUartIrqPulse = TRUE;
+
+ if (pBDData->bShareDspIrq) {
+ pSettings->bDspIrqActiveLow = FALSE;
+ }
+ if (pBDData->bShareUartIrq) {
+ pSettings->bUartIrqActiveLow = FALSE;
+ }
+
+ pSettings->usNumTransfers = TP_CFG_NumTransfers;
+ pSettings->usReRequest = TP_CFG_RerequestTimer;
+ pSettings->bEnableMEMCS16 = TP_CFG_MEMCS16;
+ pSettings->usIsaMemCmdWidth = TP_CFG_IsaMemCmdWidth;
+ pSettings->bGateIOCHRDY = TP_CFG_GateIOCHRDY;
+ pSettings->bEnablePwrMgmt = TP_CFG_EnablePwrMgmt;
+ pSettings->usHBusTimerLoadValue = TP_CFG_HBusTimerValue;
+ pSettings->bDisableLBusTimeout = TP_CFG_DisableLBusTimeout;
+ pSettings->usN_Divisor = TP_CFG_N_Divisor;
+ pSettings->usM_Multiplier = TP_CFG_M_Multiplier;
+ pSettings->bPllBypass = TP_CFG_PllBypass;
+ pSettings->usChipletEnable = TP_CFG_ChipletEnable;
+
+ if (request_irq(pSettings->usUartIrq, &UartInterrupt, 0, "mwave_uart", 0)) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_EnableDSP: Error: Could not get UART IRQ %x\n", pSettings->usUartIrq);
+ goto exit_cleanup;
+ } else { /* no conflict just release */
+ free_irq(pSettings->usUartIrq, 0);
+ }
+
+ if (request_irq(pSettings->usDspIrq, &DspInterrupt, 0, "mwave_3780i", 0)) {
+ PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Error: Could not get 3780i IRQ %x\n", pSettings->usDspIrq);
+ goto exit_cleanup;
+ } else {
+ PRINTK_3(TRACE_TP3780I,
+ "tp3780i::tp3780I_EnableDSP, got interrupt %x bShareDspIrq %x\n",
+ pSettings->usDspIrq, pBDData->bShareDspIrq);
+ bInterruptAllocated = TRUE;
+ pSettings->bInterruptClaimed = TRUE;
+ }
+
+ smapi_set_DSP_power_state(FALSE);
+ if (smapi_set_DSP_power_state(TRUE)) {
+ PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_EnableDSP: Error: smapi_set_DSP_power_state(TRUE) failed\n");
+ goto exit_cleanup;
+ } else {
+ bDSPPoweredUp = TRUE;
+ }
+
+ if (dsp3780I_EnableDSP(pSettings, s_ausThinkpadIrqToField, s_ausThinkpadDmaToField)) {
+ PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Error: dsp7880I_EnableDSP() failed\n");
+ goto exit_cleanup;
+ } else {
+ bDSPEnabled = TRUE;
+ }
+
+ EnableSRAM(pBDData);
+
+ pBDData->bDSPEnabled = TRUE;
+
+ PRINTK_1(TRACE_TP3780I, "tp3780i::tp3780I_EnableDSP exit\n");
+
+ return 0;
+
+exit_cleanup:
+ PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Cleaning up\n");
+ if (bDSPEnabled)
+ dsp3780I_DisableDSP(pSettings);
+ if (bDSPPoweredUp)
+ smapi_set_DSP_power_state(FALSE);
+ if (bInterruptAllocated) {
+ free_irq(pSettings->usDspIrq, 0);
+ pSettings->bInterruptClaimed = FALSE;
+ }
+ return -EIO;
+}
+
+
+int tp3780I_DisableDSP(THINKPAD_BD_DATA * pBDData)
+{
+ int retval = 0;
+ DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings;
+
+ PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_DisableDSP entry pBDData %p\n", pBDData);
+
+ if (pBDData->bDSPEnabled) {
+ dsp3780I_DisableDSP(&pBDData->rDspSettings);
+ if (pSettings->bInterruptClaimed) {
+ free_irq(pSettings->usDspIrq, 0);
+ pSettings->bInterruptClaimed = FALSE;
+ }
+ smapi_set_DSP_power_state(FALSE);
+ pBDData->bDSPEnabled = FALSE;
+ }
+
+ PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_DisableDSP exit retval %x\n", retval);
+
+ return retval;
+}
+
+
+int tp3780I_ResetDSP(THINKPAD_BD_DATA * pBDData)
+{
+ int retval = 0;
+ DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings;
+
+ PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_ResetDSP entry pBDData %p\n",
+ pBDData);
+
+ if (dsp3780I_Reset(pSettings) == 0) {
+ EnableSRAM(pBDData);
+ } else {
+ retval = -EIO;
+ }
+
+ PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_ResetDSP exit retval %x\n", retval);
+
+ return retval;
+}
+
+
+int tp3780I_StartDSP(THINKPAD_BD_DATA * pBDData)
+{
+ int retval = 0;
+ DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings;
+
+ PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_StartDSP entry pBDData %p\n", pBDData);
+
+ if (dsp3780I_Run(pSettings) == 0) {
+ // @BUG @TBD EnableSRAM(pBDData);
+ } else {
+ retval = -EIO;
+ }
+
+ PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_StartDSP exit retval %x\n", retval);
+
+ return retval;
+}
+
+
+int tp3780I_QueryAbilities(THINKPAD_BD_DATA * pBDData, MW_ABILITIES * pAbilities)
+{
+ int retval = 0;
+
+ PRINTK_2(TRACE_TP3780I,
+ "tp3780i::tp3780I_QueryAbilities entry pBDData %p\n", pBDData);
+
+ /* fill out standard constant fields */
+ pAbilities->instr_per_sec = pBDData->rDspSettings.uIps;
+ pAbilities->data_size = pBDData->rDspSettings.uDStoreSize;
+ pAbilities->inst_size = pBDData->rDspSettings.uIStoreSize;
+ pAbilities->bus_dma_bw = pBDData->rDspSettings.uDmaBandwidth;
+
+ /* fill out dynamically determined fields */
+ pAbilities->component_list[0] = 0x00010000 | MW_ADC_MASK;
+ pAbilities->component_list[1] = 0x00010000 | MW_ACI_MASK;
+ pAbilities->component_list[2] = 0x00010000 | MW_AIC1_MASK;
+ pAbilities->component_list[3] = 0x00010000 | MW_AIC2_MASK;
+ pAbilities->component_list[4] = 0x00010000 | MW_CDDAC_MASK;
+ pAbilities->component_list[5] = 0x00010000 | MW_MIDI_MASK;
+ pAbilities->component_list[6] = 0x00010000 | MW_UART_MASK;
+ pAbilities->component_count = 7;
+
+ /* Fill out Mwave OS and BIOS task names */
+
+ memcpy(pAbilities->mwave_os_name, TP_ABILITIES_MWAVEOS_NAME,
+ sizeof(TP_ABILITIES_MWAVEOS_NAME));
+ memcpy(pAbilities->bios_task_name, TP_ABILITIES_BIOSTASK_NAME,
+ sizeof(TP_ABILITIES_BIOSTASK_NAME));
+
+ PRINTK_1(TRACE_TP3780I,
+ "tp3780i::tp3780I_QueryAbilities exit retval=SUCCESSFUL\n");
+
+ return retval;
+}
+
+int tp3780I_ReadWriteDspDStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
+ void *pvBuffer, unsigned int uCount,
+ unsigned long ulDSPAddr)
+{
+ int retval = 0;
+ DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings;
+ unsigned short usDspBaseIO = pSettings->usDspBaseIO;
+ BOOLEAN bRC = 0;
+
+ PRINTK_6(TRACE_TP3780I,
+ "tp3780i::tp3780I_ReadWriteDspDStore entry pBDData %p, uOpcode %x, pvBuffer %p, uCount %x, ulDSPAddr %lx\n",
+ pBDData, uOpcode, pvBuffer, uCount, ulDSPAddr);
+
+ if (pBDData->bDSPEnabled) {
+ switch (uOpcode) {
+ case IOCTL_MW_READ_DATA:
+ bRC = dsp3780I_ReadDStore(usDspBaseIO, pvBuffer, uCount, ulDSPAddr);
+ break;
+
+ case IOCTL_MW_READCLEAR_DATA:
+ bRC = dsp3780I_ReadAndClearDStore(usDspBaseIO, pvBuffer, uCount, ulDSPAddr);
+ break;
+
+ case IOCTL_MW_WRITE_DATA:
+ bRC = dsp3780I_WriteDStore(usDspBaseIO, pvBuffer, uCount, ulDSPAddr);
+ break;
+ }
+ }
+
+ retval = (bRC) ? -EIO : 0;
+ PRINTK_2(TRACE_TP3780I, "tp3780i::tp3780I_ReadWriteDspDStore exit retval %x\n", retval);
+
+ return retval;
+}
+
+
+int tp3780I_ReadWriteDspIStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
+ void *pvBuffer, unsigned int uCount,
+ unsigned long ulDSPAddr)
+{
+ int retval = 0;
+ DSP_3780I_CONFIG_SETTINGS *pSettings = &pBDData->rDspSettings;
+ unsigned short usDspBaseIO = pSettings->usDspBaseIO;
+ BOOLEAN bRC = 0;
+
+ PRINTK_6(TRACE_TP3780I,
+ "tp3780i::tp3780I_ReadWriteDspIStore entry pBDData %p, uOpcode %x, pvBuffer %p, uCount %x, ulDSPAddr %lx\n",
+ pBDData, uOpcode, pvBuffer, uCount, ulDSPAddr);
+
+ if (pBDData->bDSPEnabled) {
+ switch (uOpcode) {
+ case IOCTL_MW_READ_INST:
+ bRC = dsp3780I_ReadIStore(usDspBaseIO, pvBuffer, uCount, ulDSPAddr);
+ break;
+
+ case IOCTL_MW_WRITE_INST:
+ bRC = dsp3780I_WriteIStore(usDspBaseIO, pvBuffer, uCount, ulDSPAddr);
+ break;
+ }
+ }
+
+ retval = (bRC) ? -EIO : 0;
+
+ PRINTK_2(TRACE_TP3780I,
+ "tp3780i::tp3780I_ReadWriteDspIStore exit retval %x\n", retval);
+
+ return retval;
+}
+
diff -u --recursive --new-file v2.4.10/linux/drivers/char/mwave/tp3780i.h linux/drivers/char/mwave/tp3780i.h
--- v2.4.10/linux/drivers/char/mwave/tp3780i.h Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/mwave/tp3780i.h Sun Sep 30 12:26:05 2001
@@ -0,0 +1,103 @@
+/*
+*
+* tp3780i.h -- declarations for tp3780i.c
+*
+*
+* Written By: Mike Sullivan IBM Corporation
+*
+* Copyright (C) 1999 IBM Corporation
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* NO WARRANTY
+* THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
+* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
+* LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+* solely responsible for determining the appropriateness of using and
+* distributing the Program and assumes all risks associated with its
+* exercise of rights under this Agreement, including but not limited to
+* the risks and costs of program errors, damage to or loss of data,
+* programs or equipment, and unavailability or interruption of operations.
+*
+* DISCLAIMER OF LIABILITY
+* NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+* USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+* HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*
+*
+* 10/23/2000 - Alpha Release
+* First release to the public
+*/
+
+#ifndef _LINUX_TP3780I_H
+#define _LINUX_TP3780I_H
+
+#include
+#include "mwavepub.h"
+
+
+/* DSP abilities constants for 3780i based Thinkpads */
+#define TP_ABILITIES_INTS_PER_SEC 39160800
+#define TP_ABILITIES_DATA_SIZE 32768
+#define TP_ABILITIES_INST_SIZE 32768
+#define TP_ABILITIES_MWAVEOS_NAME "mwaveos0700.dsp"
+#define TP_ABILITIES_BIOSTASK_NAME "mwbio701.dsp"
+
+
+/* DSP configuration values for 3780i based Thinkpads */
+#define TP_CFG_NumTransfers 3 /* 16 transfers */
+#define TP_CFG_RerequestTimer 1 /* 2 usec */
+#define TP_CFG_MEMCS16 0 /* Disabled, 16-bit memory assumed */
+#define TP_CFG_IsaMemCmdWidth 3 /* 295 nsec (16-bit) */
+#define TP_CFG_GateIOCHRDY 0 /* No IOCHRDY gating */
+#define TP_CFG_EnablePwrMgmt 1 /* Enable low poser suspend/resume */
+#define TP_CFG_HBusTimerValue 255 /* HBus timer load value */
+#define TP_CFG_DisableLBusTimeout 0 /* Enable LBus timeout */
+#define TP_CFG_N_Divisor 32 /* Clock = 39.1608 Mhz */
+#define TP_CFG_M_Multiplier 37 /* " */
+#define TP_CFG_PllBypass 0 /* dont bypass */
+#define TP_CFG_ChipletEnable 0xFFFF /* Enable all chiplets */
+
+typedef struct {
+ int bDSPEnabled;
+ int bShareDspIrq;
+ int bShareUartIrq;
+ DSP_3780I_CONFIG_SETTINGS rDspSettings;
+} THINKPAD_BD_DATA;
+
+int tp3780I_InitializeBoardData(THINKPAD_BD_DATA * pBDData);
+int tp3780I_CalcResources(THINKPAD_BD_DATA * pBDData);
+int tp3780I_ClaimResources(THINKPAD_BD_DATA * pBDData);
+int tp3780I_ReleaseResources(THINKPAD_BD_DATA * pBDData);
+int tp3780I_EnableDSP(THINKPAD_BD_DATA * pBDData);
+int tp3780I_DisableDSP(THINKPAD_BD_DATA * pBDData);
+int tp3780I_ResetDSP(THINKPAD_BD_DATA * pBDData);
+int tp3780I_StartDSP(THINKPAD_BD_DATA * pBDData);
+int tp3780I_QueryAbilities(THINKPAD_BD_DATA * pBDData, MW_ABILITIES * pAbilities);
+int tp3780I_Cleanup(THINKPAD_BD_DATA * pBDData);
+int tp3780I_ReadWriteDspDStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
+ void *pvBuffer, unsigned int uCount,
+ unsigned long ulDSPAddr);
+int tp3780I_ReadWriteDspIStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
+ void *pvBuffer, unsigned int uCount,
+ unsigned long ulDSPAddr);
+
+
+#endif
diff -u --recursive --new-file v2.4.10/linux/drivers/char/softdog.c linux/drivers/char/softdog.c
--- v2.4.10/linux/drivers/char/softdog.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/char/softdog.c Sun Sep 30 12:26:05 2001
@@ -46,6 +46,7 @@
static int soft_margin = TIMER_MARGIN; /* in seconds */
MODULE_PARM(soft_margin,"i");
+MODULE_LICENSE("GPL");
/*
* Our timer
diff -u --recursive --new-file v2.4.10/linux/drivers/char/sysrq.c linux/drivers/char/sysrq.c
--- v2.4.10/linux/drivers/char/sysrq.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/char/sysrq.c Tue Oct 2 09:20:37 2001
@@ -47,13 +47,13 @@
int i;
i = key - '0';
console_loglevel = 7;
- printk("%d\n", i);
+ printk("Loglevel set to %d\n", i);
console_loglevel = i;
}
static struct sysrq_key_op sysrq_loglevel_op = {
handler: sysrq_handle_loglevel,
help_msg: "loglevel0-8",
- action_msg: "Loglevel set to ",
+ action_msg: "Changing Loglevel",
};
@@ -68,7 +68,7 @@
static struct sysrq_key_op sysrq_SAK_op = {
handler: sysrq_handle_SAK,
help_msg: "saK",
- action_msg: "SAK\n",
+ action_msg: "SAK",
};
#endif
@@ -82,7 +82,7 @@
static struct sysrq_key_op sysrq_unraw_op = {
handler: sysrq_handle_unraw,
help_msg: "unRaw",
- action_msg: "Keyboard mode set to XLATE\n",
+ action_msg: "Keyboard mode set to XLATE",
};
@@ -94,7 +94,7 @@
static struct sysrq_key_op sysrq_reboot_op = {
handler: sysrq_handle_reboot,
help_msg: "reBoot",
- action_msg: "Resetting\n",
+ action_msg: "Resetting",
};
@@ -225,7 +225,7 @@
static struct sysrq_key_op sysrq_sync_op = {
handler: sysrq_handle_sync,
help_msg: "Sync",
- action_msg: "Emergency Sync\n",
+ action_msg: "Emergency Sync",
};
static void sysrq_handle_mountro(int key, struct pt_regs *pt_regs,
@@ -236,7 +236,7 @@
static struct sysrq_key_op sysrq_mountro_op = {
handler: sysrq_handle_mountro,
help_msg: "Unmount",
- action_msg: "Emergency Remount R/0\n",
+ action_msg: "Emergency Remount R/O",
};
/* END SYNC SYSRQ HANDLERS BLOCK */
@@ -252,7 +252,7 @@
static struct sysrq_key_op sysrq_showregs_op = {
handler: sysrq_handle_showregs,
help_msg: "showPc",
- action_msg: "Show Regs\n",
+ action_msg: "Show Regs",
};
@@ -263,7 +263,7 @@
static struct sysrq_key_op sysrq_showstate_op = {
handler: sysrq_handle_showstate,
help_msg: "showTasks",
- action_msg: "Show State\n",
+ action_msg: "Show State",
};
@@ -274,7 +274,7 @@
static struct sysrq_key_op sysrq_showmem_op = {
handler: sysrq_handle_showmem,
help_msg: "showMem",
- action_msg: "Show Memory\n",
+ action_msg: "Show Memory",
};
/* SHOW SYSRQ HANDLERS BLOCK */
@@ -307,7 +307,7 @@
static struct sysrq_key_op sysrq_term_op = {
handler: sysrq_handle_term,
help_msg: "tErm",
- action_msg: "Terminate All Tasks\n",
+ action_msg: "Terminate All Tasks",
};
static void sysrq_handle_kill(int key, struct pt_regs *pt_regs,
@@ -318,7 +318,7 @@
static struct sysrq_key_op sysrq_kill_op = {
handler: sysrq_handle_kill,
help_msg: "kIll",
- action_msg: "Kill All Tasks\n",
+ action_msg: "Kill All Tasks",
};
static void sysrq_handle_killall(int key, struct pt_regs *pt_regs,
@@ -329,7 +329,7 @@
static struct sysrq_key_op sysrq_killall_op = {
handler: sysrq_handle_killall,
help_msg: "killalL",
- action_msg: "Kill All Tasks (even init)\n",
+ action_msg: "Kill All Tasks (even init)",
};
/* END SIGNAL SYSRQ HANDLERS BLOCK */
@@ -462,8 +462,9 @@
op_p = __sysrq_get_key_op(key);
if (op_p) {
- printk ("%s", op_p->action_msg);
- op_p->handler(key, pt_regs, kbd, tty);
+ printk ("%s\n", op_p->action_msg);
+ console_loglevel = orig_log_level;
+ op_p->handler(key, pt_regs, kbd, tty);
} else {
printk("HELP : ");
/* Only print the help msg once per handler */
@@ -474,8 +475,8 @@
printk ("%s ", sysrq_key_table[i]->help_msg);
}
printk ("\n");
+ console_loglevel = orig_log_level;
}
- console_loglevel = orig_log_level;
}
EXPORT_SYMBOL(handle_sysrq);
diff -u --recursive --new-file v2.4.10/linux/drivers/i2c/i2c-adap-ite.c linux/drivers/i2c/i2c-adap-ite.c
--- v2.4.10/linux/drivers/i2c/i2c-adap-ite.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/i2c/i2c-adap-ite.c Sun Sep 30 12:26:05 2001
@@ -299,6 +299,7 @@
*/
MODULE_AUTHOR("MontaVista Software ");
MODULE_DESCRIPTION("I2C-Bus adapter routines for ITE IIC bus adapter");
+MODULE_LICENSE("GPL");
MODULE_PARM(base, "i");
MODULE_PARM(irq, "i");
diff -u --recursive --new-file v2.4.10/linux/drivers/i2c/i2c-algo-bit.c linux/drivers/i2c/i2c-algo-bit.c
--- v2.4.10/linux/drivers/i2c/i2c-algo-bit.c Tue Mar 6 19:44:34 2001
+++ linux/drivers/i2c/i2c-algo-bit.c Sun Sep 30 12:26:05 2001
@@ -621,6 +621,7 @@
#ifdef MODULE
MODULE_AUTHOR("Simon G. Vogl ");
MODULE_DESCRIPTION("I2C-Bus bit-banging algorithm");
+MODULE_LICENSE("GPL");
MODULE_PARM(bit_test, "i");
MODULE_PARM(bit_scan, "i");
diff -u --recursive --new-file v2.4.10/linux/drivers/i2c/i2c-algo-ite.c linux/drivers/i2c/i2c-algo-ite.c
--- v2.4.10/linux/drivers/i2c/i2c-algo-ite.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/i2c/i2c-algo-ite.c Sun Sep 30 12:26:05 2001
@@ -844,6 +844,7 @@
*/
MODULE_AUTHOR("MontaVista Software ");
MODULE_DESCRIPTION("ITE iic algorithm");
+MODULE_LICENSE("GPL");
MODULE_PARM(iic_test, "i");
MODULE_PARM(iic_scan, "i");
diff -u --recursive --new-file v2.4.10/linux/drivers/i2c/i2c-algo-pcf.c linux/drivers/i2c/i2c-algo-pcf.c
--- v2.4.10/linux/drivers/i2c/i2c-algo-pcf.c Fri Feb 9 11:30:23 2001
+++ linux/drivers/i2c/i2c-algo-pcf.c Sun Sep 30 12:26:05 2001
@@ -596,6 +596,7 @@
#ifdef MODULE
MODULE_AUTHOR("Hans Berglund ");
MODULE_DESCRIPTION("I2C-Bus PCF8584 algorithm");
+MODULE_LICENSE("GPL");
MODULE_PARM(pcf_test, "i");
MODULE_PARM(pcf_scan, "i");
diff -u --recursive --new-file v2.4.10/linux/drivers/i2c/i2c-core.c linux/drivers/i2c/i2c-core.c
--- v2.4.10/linux/drivers/i2c/i2c-core.c Fri Feb 9 11:40:02 2001
+++ linux/drivers/i2c/i2c-core.c Sun Sep 30 12:26:05 2001
@@ -1369,6 +1369,7 @@
MODULE_DESCRIPTION("I2C-Bus main module");
MODULE_PARM(i2c_debug, "i");
MODULE_PARM_DESC(i2c_debug,"debug level");
+MODULE_LICENSE("GPL");
int init_module(void)
{
diff -u --recursive --new-file v2.4.10/linux/drivers/i2c/i2c-dev.c linux/drivers/i2c/i2c-dev.c
--- v2.4.10/linux/drivers/i2c/i2c-dev.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/i2c/i2c-dev.c Sun Sep 30 12:26:05 2001
@@ -530,6 +530,7 @@
MODULE_AUTHOR("Frodo Looijaard and Simon G. Vogl ");
MODULE_DESCRIPTION("I2C /dev entries driver");
+MODULE_LICENSE("GPL");
int init_module(void)
{
diff -u --recursive --new-file v2.4.10/linux/drivers/i2c/i2c-elektor.c linux/drivers/i2c/i2c-elektor.c
--- v2.4.10/linux/drivers/i2c/i2c-elektor.c Fri Feb 9 11:30:23 2001
+++ linux/drivers/i2c/i2c-elektor.c Sun Sep 30 12:26:05 2001
@@ -277,6 +277,7 @@
#ifdef MODULE
MODULE_AUTHOR("Hans Berglund ");
MODULE_DESCRIPTION("I2C-Bus adapter routines for PCF8584 ISA bus adapter");
+MODULE_LICENSE("GPL");
MODULE_PARM(base, "i");
MODULE_PARM(irq, "i");
diff -u --recursive --new-file v2.4.10/linux/drivers/i2c/i2c-elv.c linux/drivers/i2c/i2c-elv.c
--- v2.4.10/linux/drivers/i2c/i2c-elv.c Fri Feb 9 11:30:23 2001
+++ linux/drivers/i2c/i2c-elv.c Sun Sep 30 12:26:05 2001
@@ -199,8 +199,9 @@
#ifdef MODULE
MODULE_AUTHOR("Simon G. Vogl ");
-MODULE_DESCRIPTION("I2C-Bus adapter routines for ELV parallel port adapter")
-;
+MODULE_DESCRIPTION("I2C-Bus adapter routines for ELV parallel port adapter");
+MODULE_LICENSE("GPL");
+
MODULE_PARM(base, "i");
diff -u --recursive --new-file v2.4.10/linux/drivers/i2c/i2c-philips-par.c linux/drivers/i2c/i2c-philips-par.c
--- v2.4.10/linux/drivers/i2c/i2c-philips-par.c Tue Jul 25 18:10:42 2000
+++ linux/drivers/i2c/i2c-philips-par.c Sun Sep 30 12:26:05 2001
@@ -291,6 +291,7 @@
MODULE_AUTHOR("Simon G. Vogl ");
MODULE_DESCRIPTION("I2C-Bus adapter routines for Philips parallel port adapter");
+MODULE_LICENSE("GPL");
MODULE_PARM(type, "i");
diff -u --recursive --new-file v2.4.10/linux/drivers/i2c/i2c-velleman.c linux/drivers/i2c/i2c-velleman.c
--- v2.4.10/linux/drivers/i2c/i2c-velleman.c Wed Feb 9 18:48:03 2000
+++ linux/drivers/i2c/i2c-velleman.c Sun Sep 30 12:26:05 2001
@@ -189,6 +189,7 @@
#ifdef MODULE
MODULE_AUTHOR("Simon G. Vogl ");
MODULE_DESCRIPTION("I2C-Bus adapter routines for Velleman K8000 adapter");
+MODULE_LICENSE("GPL");
MODULE_PARM(base, "i");
diff -u --recursive --new-file v2.4.10/linux/drivers/ide/ataraid.c linux/drivers/ide/ataraid.c
--- v2.4.10/linux/drivers/ide/ataraid.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/ide/ataraid.c Sun Sep 30 12:26:05 2001
@@ -63,12 +63,6 @@
/* Bitmap for the devices currently in use */
static unsigned int ataraiduse;
-/* structure for the splitting of bufferheads */
-
-struct ataraid_bh_private {
- struct buffer_head *parent;
- atomic_t count;
-};
/* stub fops functions */
@@ -121,7 +115,7 @@
return -EINVAL;
}
-static struct buffer_head *get_bhead(void)
+struct buffer_head *ataraid_get_bhead(void)
{
void *ptr = NULL;
while (!ptr) {
@@ -135,7 +129,9 @@
return ptr;
}
-static struct ataraid_bh_private *get_private(void)
+EXPORT_SYMBOL(ataraid_get_bhead);
+
+struct ataraid_bh_private *ataraid_get_private(void)
{
void *ptr = NULL;
while (!ptr) {
@@ -149,7 +145,9 @@
return ptr;
}
-static void ataraid_end_request(struct buffer_head *bh, int uptodate)
+EXPORT_SYMBOL(ataraid_get_private);
+
+void ataraid_end_request(struct buffer_head *bh, int uptodate)
{
struct ataraid_bh_private *private = bh->b_private;
@@ -164,17 +162,19 @@
kfree(bh);
}
+EXPORT_SYMBOL(ataraid_end_request);
+
static void ataraid_split_request(request_queue_t *q, int rw, struct buffer_head * bh)
{
struct buffer_head *bh1,*bh2;
struct ataraid_bh_private *private;
- bh1=get_bhead();
- bh2=get_bhead();
+ bh1=ataraid_get_bhead();
+ bh2=ataraid_get_bhead();
/* If either of those ever fails we're doomed */
if ((!bh1)||(!bh2))
BUG();
- private = get_private();
+ private = ataraid_get_private();
if (private==NULL)
BUG();
@@ -249,7 +249,7 @@
{
ataraid_hardsect_size[i] = 512;
ataraid_blksize_size[i] = 1024;
- ataraid_readahead[i] = 32;
+ ataraid_readahead[i] = 1023;
}
if (blksize_size[ATAMAJOR]==NULL)
@@ -317,4 +317,5 @@
EXPORT_SYMBOL(ataraid_release_device);
EXPORT_SYMBOL(ataraid_gendisk);
EXPORT_SYMBOL(ataraid_register_disk);
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.10/linux/drivers/ide/ataraid.h linux/drivers/ide/ataraid.h
--- v2.4.10/linux/drivers/ide/ataraid.h Sun Sep 23 11:40:57 2001
+++ linux/drivers/ide/ataraid.h Sun Sep 30 12:26:05 2001
@@ -49,6 +49,12 @@
unsigned char sectors;
};
+/* structure for the splitting of bufferheads */
+
+struct ataraid_bh_private {
+ struct buffer_head *parent;
+ atomic_t count;
+};
extern struct gendisk ataraid_gendisk;
@@ -56,4 +62,11 @@
extern void ataraid_release_device(int device);
extern int get_blocksize(kdev_t dev);
extern void ataraid_register_disk(int device,long size);
+extern struct buffer_head *ataraid_get_bhead(void);
+extern struct ataraid_bh_private *ataraid_get_private(void);
+extern void ataraid_end_request(struct buffer_head *bh, int uptodate);
+
+
+
+
diff -u --recursive --new-file v2.4.10/linux/drivers/ide/hptraid.c linux/drivers/ide/hptraid.c
--- v2.4.10/linux/drivers/ide/hptraid.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/ide/hptraid.c Sun Sep 30 12:26:05 2001
@@ -306,8 +306,8 @@
if (bdev && blkdev_get(bdev,FMODE_READ|FMODE_WRITE,0,BDEV_RAW) == 0) {
int j=0;
struct gendisk *gd;
-
raid[device].disk[i].bdev = bdev;
+ /* This is supposed to prevent others from stealing our underlying disks */
/* now blank the /proc/partitions table for the wrong partition table,
so that scripts don't accidentally mount it and crash the kernel */
/* XXX: the 0 is an utter hack --hch */
@@ -408,12 +408,12 @@
{
int i,device;
for (device = 0; device<16; device++) {
- for (i=0;i<8;i++) {
+ for (i=0;i<8;i++) {
struct block_device *bdev = raid[device].disk[i].bdev;
raid[device].disk[i].bdev = NULL;
if (bdev)
blkdev_put(bdev, BDEV_RAW);
- }
+ }
if (raid[device].sectors)
ataraid_release_device(device);
}
@@ -432,3 +432,4 @@
module_init(hptraid_init);
module_exit(hptraid_exit);
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.10/linux/drivers/ide/ide-cs.c linux/drivers/ide/ide-cs.c
--- v2.4.10/linux/drivers/ide/ide-cs.c Fri Feb 9 11:40:02 2001
+++ linux/drivers/ide/ide-cs.c Sun Sep 30 12:26:05 2001
@@ -74,6 +74,9 @@
MODULE_PARM(irq_mask, "i");
MODULE_PARM(irq_list, "1-4i");
+MODULE_LICENSE("GPL");
+
+
/*====================================================================*/
static const char ide_major[] = {
diff -u --recursive --new-file v2.4.10/linux/drivers/ide/ide-disk.c linux/drivers/ide/ide-disk.c
--- v2.4.10/linux/drivers/ide/ide-disk.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/ide/ide-disk.c Fri Sep 28 11:21:40 2001
@@ -481,7 +481,7 @@
static void idedisk_release (struct inode *inode, struct file *filp, ide_drive_t *drive)
{
if (drive->removable && !drive->usage) {
- invalidate_buffers(inode->i_rdev);
+ invalidate_bdev(inode->i_bdev, 0);
if (drive->doorlocking && ide_wait_cmd(drive, WIN_DOORUNLOCK, 0, 0, 0, NULL))
drive->doorlocking = 0;
}
diff -u --recursive --new-file v2.4.10/linux/drivers/ide/ide-floppy.c linux/drivers/ide/ide-floppy.c
--- v2.4.10/linux/drivers/ide/ide-floppy.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/ide/ide-floppy.c Fri Sep 28 11:21:40 2001
@@ -1750,7 +1750,7 @@
if (!drive->usage) {
idefloppy_floppy_t *floppy = drive->driver_data;
- invalidate_buffers (inode->i_rdev);
+ invalidate_bdev (inode->i_bdev, 0);
/* IOMEGA Clik! drives do not support lock/unlock commands */
if (!test_bit(IDEFLOPPY_CLIK_DRIVE, &floppy->flags)) {
diff -u --recursive --new-file v2.4.10/linux/drivers/ide/ide-pci.c linux/drivers/ide/ide-pci.c
--- v2.4.10/linux/drivers/ide/ide-pci.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/ide/ide-pci.c Sun Sep 30 12:26:05 2001
@@ -693,6 +693,8 @@
*/
if ((IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20265)) && (secondpdc++==1) && (port==1) )
goto controller_ok;
+ if ((IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20262)) && (secondpdc++==1) && (port==1) )
+ goto controller_ok;
if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || (tmp & e->mask) != e->val))
continue; /* port not enabled */
diff -u --recursive --new-file v2.4.10/linux/drivers/ide/ide-pmac.c linux/drivers/ide/ide-pmac.c
--- v2.4.10/linux/drivers/ide/ide-pmac.c Wed Jul 25 17:10:20 2001
+++ linux/drivers/ide/ide-pmac.c Tue Oct 2 09:08:40 2001
@@ -5,9 +5,7 @@
* These IDE interfaces are memory-mapped and have a DBDMA channel
* for doing DMA.
*
- * Copyright (C) 1998 Paul Mackerras.
- *
- * Bits from Benjamin Herrenschmidt
+ * Copyright (C) 1998-2001 Paul Mackerras & Ben. Herrenschmidt
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -99,13 +97,13 @@
/* allow up to 256 DBDMA commands per xfer */
#define MAX_DCMDS 256
-/* Wait 1.5s for disk to answer on IDE bus after
+/* 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
* line arg to override this delay for such cases.
*/
-#define IDE_WAKEUP_DELAY_MS 1500
+#define IDE_WAKEUP_DELAY_MS 2000
static void pmac_ide_setup_dma(struct device_node *np, int ix);
static int pmac_ide_dmaproc(ide_dma_action_t func, ide_drive_t *drive);
@@ -236,13 +234,21 @@
}
if((stat & ERR_STAT) || timeout <= 0) {
if (stat & ERR_STAT) {
- printk("ide_pmace: wait_for_ready, error status: %x\n", stat);
+ printk(KERN_ERR "ide_pmac: wait_for_ready, error status: %x\n", stat);
}
return 1;
}
return 0;
}
+/* Note: We don't use the generic routine here because some of Apple's
+ * controller seem to be very sensitive about how things are done.
+ * We should probably set the NIEN bit, but that's an example of thing
+ * that can cause the controller to hang under some circumstances when
+ * done on the media-bay CD-ROM during boot. We do get occasional
+ * spurrious interrupts because of that.
+ * --BenH
+ */
static int
pmac_ide_do_setfeature(ide_drive_t *drive, byte command)
{
@@ -256,7 +262,7 @@
SELECT_MASK(HWIF(drive), drive, 0);
udelay(1);
if(wait_for_ready(drive)) {
- printk("pmac_ide_do_setfeature disk not ready before SET_FEATURE!\n");
+ printk(KERN_ERR "pmac_ide_do_setfeature disk not ready before SET_FEATURE!\n");
goto out;
}
OUT_BYTE(SETFEATURES_XFER, IDE_FEATURE_REG);
@@ -265,7 +271,7 @@
udelay(1);
result = wait_for_ready(drive);
if (result)
- printk("pmac_ide_do_setfeature disk not ready after SET_FEATURE !\n");
+ printk(KERN_ERR "pmac_ide_do_setfeature disk not ready after SET_FEATURE !\n");
out:
restore_flags(flags);
@@ -311,7 +317,7 @@
}
#ifdef IDE_PMAC_DEBUG
- printk("ide_pmac: Set PIO timing for mode %d, reg: 0x%08x\n",
+ printk(KERN_ERR "ide_pmac: Set PIO timing for mode %d, reg: 0x%08x\n",
pio, *timings);
#endif
@@ -562,7 +568,7 @@
fixes in irq.c
*/
if (np->n_intrs == 0) {
- printk("ide: no intrs for device %s, using 13\n",
+ printk(KERN_WARNING "ide: no intrs for device %s, using 13\n",
np->full_name);
irq = 13;
} else {
@@ -598,7 +604,7 @@
feature_set(np, FEATURE_IDE0_enable);
} else {
/* This is necessary to enable IDE when net-booting */
- printk("pmac_ide: enabling IDE bus ID %d\n",
+ printk(KERN_INFO "pmac_ide: enabling IDE bus ID %d\n",
pmac_ide[i].aapl_bus_id);
switch(pmac_ide[i].aapl_bus_id) {
case 0:
@@ -732,7 +738,7 @@
unsigned int tc = (size < 0xfe00)? size: 0xfe00;
if (++count >= MAX_DCMDS) {
- printk("%s: DMA table too small\n",
+ printk(KERN_WARNING "%s: DMA table too small\n",
drive->name);
return 0; /* revert to PIO for this request */
}
@@ -804,10 +810,10 @@
int ret;
/* Set feature on drive */
- printk("%s: Enabling MultiWord DMA %d\n", drive->name, feature & 0xf);
+ printk(KERN_INFO "%s: Enabling MultiWord DMA %d\n", drive->name, feature & 0xf);
ret = pmac_ide_do_setfeature(drive, feature);
if (ret) {
- printk("%s: Failed !\n", drive->name);
+ printk(KERN_WARNING "%s: Failed !\n", drive->name);
return 0;
}
@@ -860,7 +866,7 @@
(accessTicks | (recTicks << 5) | (halfTick << 10)) << 11;
}
#ifdef IDE_PMAC_DEBUG
- printk("ide_pmac: Set MDMA timing for mode %d, reg: 0x%08x\n",
+ printk(KERN_INFO "ide_pmac: Set MDMA timing for mode %d, reg: 0x%08x\n",
feature & 0xf, *timings);
#endif
drive->current_speed = feature;
@@ -879,10 +885,10 @@
int ret;
/* Set feature on drive */
- printk("%s: Enabling Ultra DMA %d\n", drive->name, feature & 0xf);
+ printk(KERN_INFO "%s: Enabling Ultra DMA %d\n", drive->name, feature & 0xf);
ret = pmac_ide_do_setfeature(drive, feature);
if (ret) {
- printk("%s: Failed !\n", drive->name);
+ printk(KERN_WARNING "%s: Failed !\n", drive->name);
return 0;
}
@@ -953,7 +959,7 @@
int pmac_ide_dmaproc(ide_dma_action_t func, ide_drive_t *drive)
{
- int ix, dstat;
+ int ix, dstat, i;
volatile struct dbdma_regs *dma;
/* Can we stuff a pointer to our intf structure in config_data
@@ -966,7 +972,7 @@
switch (func) {
case ide_dma_off:
- printk("%s: DMA disabled\n", drive->name);
+ printk(KERN_INFO "%s: DMA disabled\n", drive->name);
case ide_dma_off_quietly:
drive->using_dma = 0;
break;
@@ -994,7 +1000,27 @@
/* verify good dma status */
return (dstat & (RUN|DEAD|ACTIVE)) != RUN;
case ide_dma_test_irq:
- return (in_le32(&dma->status) & (RUN|ACTIVE)) == RUN;
+ if ((in_le32(&dma->status) & (RUN|ACTIVE)) == RUN)
+ return 1;
+ /* That's a bit ugly and dangerous, but works in our case
+ * to workaround a problem with the channel status staying
+ * active if the drive returns an error
+ */
+ if (IDE_CONTROL_REG) {
+ byte stat;
+ stat = GET_ALTSTAT();
+ if (stat & ERR_STAT)
+ return 1;
+ }
+ /* In some edge cases, some datas may still be in the dbdma
+ * engine fifo, we wait a bit for dbdma to complete
+ */
+ while ((in_le32(&dma->status) & (RUN|ACTIVE)) != RUN) {
+ if (++i > 100)
+ return 0;
+ udelay(1);
+ }
+ return 1;
/* Let's implement tose just in case someone wants them */
case ide_dma_bad_drive:
@@ -1005,10 +1031,10 @@
case ide_dma_retune:
case ide_dma_lostirq:
case ide_dma_timeout:
- printk("ide_pmac_dmaproc: chipset supported %s func only: %d\n", ide_dmafunc_verbose(func), func);
+ printk(KERN_WARNING "ide_pmac_dmaproc: chipset supported %s func only: %d\n", ide_dmafunc_verbose(func), func);
return 1;
default:
- printk("ide_pmac_dmaproc: unsupported %s func: %d\n", ide_dmafunc_verbose(func), func);
+ printk(KERN_WARNING "ide_pmac_dmaproc: unsupported %s func: %d\n", ide_dmafunc_verbose(func), func);
return 1;
}
return 0;
@@ -1016,13 +1042,15 @@
#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
#ifdef CONFIG_PMAC_PBOOK
-static void idepmac_sleep_disk(int i, unsigned long base)
+static void idepmac_sleep_device(ide_drive_t *drive, int i, unsigned base)
{
- struct device_node* np = pmac_ide[i].node;
int j;
-
- /* FIXME: We only handle the master IDE */
- if (ide_hwifs[i].drives[0].media == ide_disk) {
+
+ /* FIXME: We only handle the master IDE disk, we shoud
+ * try to fix CD-ROMs here
+ */
+ switch (drive->media) {
+ case ide_disk:
/* Spin down the drive */
outb(0xa0, base+0x60);
outb(0x0, base+0x30);
@@ -1038,86 +1066,112 @@
if (!(status & BUSY_STAT) && (status & DRQ_STAT))
break;
}
- }
- feature_set(np, FEATURE_IDE0_reset);
- feature_clear(np, FEATURE_IDE0_enable);
- switch(pmac_ide[i].aapl_bus_id) {
- case 0:
- feature_set(np, FEATURE_IDE0_reset);
- feature_clear(np, FEATURE_IDE0_enable);
break;
- case 1:
- feature_set(np, FEATURE_IDE1_reset);
- feature_clear(np, FEATURE_IDE1_enable);
+ case ide_cdrom:
+ // todo
break;
- case 2:
- feature_set(np, FEATURE_IDE2_reset);
+ case ide_floppy:
+ // todo
break;
}
- pmac_ide[i].timings[0] = 0;
- pmac_ide[i].timings[1] = 0;
}
-static void idepmac_wake_disk(int i, unsigned long base)
+static void idepmac_wake_device(ide_drive_t *drive, int used_dma)
+ {
+ /* We force the IDE subdriver to check for a media change
+ * This must be done first or we may lost the condition
+ *
+ * Problem: This can schedule. I moved the block device
+ * wakeup almost late by priority because of that.
+ */
+ if (DRIVER(drive) && DRIVER(drive)->media_change)
+ DRIVER(drive)->media_change(drive);
+
+ /* We kick the VFS too (see fix in ide.c revalidate) */
+ check_disk_change(MKDEV(HWIF(drive)->major, (drive->select.b.unit) << PARTN_BITS));
+
+#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
+ /* We re-enable DMA on the drive if it was active. */
+ /* This doesn't work with the CD-ROM in the media-bay, probably
+ * because of a pending unit attention. The problem if that if I
+ * clear the error, the filesystem dies.
+ */
+ if (used_dma && !ide_spin_wait_hwgroup(drive)) {
+ /* Lock HW group */
+ HWGROUP(drive)->busy = 1;
+ pmac_ide_check_dma(drive);
+ HWGROUP(drive)->busy = 0;
+ spin_unlock_irq(&io_request_lock);
+ }
+#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
+}
+
+static void idepmac_sleep_interface(int i, unsigned base, int mediabay)
{
struct device_node* np = pmac_ide[i].node;
- int j;
- /* Revive IDE disk and controller */
+ /* We clear the timings */
+ pmac_ide[i].timings[0] = 0;
+ pmac_ide[i].timings[1] = 0;
+
+ /* The media bay will handle itself just fine */
+ if (mediabay)
+ return;
+
+ /* Disable and reset the bus */
+ feature_set(np, FEATURE_IDE0_reset);
+ feature_clear(np, FEATURE_IDE0_enable);
switch(pmac_ide[i].aapl_bus_id) {
case 0:
feature_set(np, FEATURE_IDE0_reset);
- mdelay(10);
- feature_set(np, FEATURE_IDE0_enable);
- mdelay(10);
- feature_clear(np, FEATURE_IDE0_reset);
+ feature_clear(np, FEATURE_IDE0_enable);
break;
case 1:
feature_set(np, FEATURE_IDE1_reset);
- mdelay(10);
- feature_set(np, FEATURE_IDE1_enable);
- mdelay(10);
- feature_clear(np, FEATURE_IDE1_reset);
+ feature_clear(np, FEATURE_IDE1_enable);
break;
case 2:
- /* This one exists only for KL, I don't know
- about any enable bit */
feature_set(np, FEATURE_IDE2_reset);
- mdelay(10);
- feature_clear(np, FEATURE_IDE2_reset);
break;
}
- mdelay(IDE_WAKEUP_DELAY_MS);
-
- /* Reset timings */
- pmac_ide_selectproc(&ide_hwifs[i].drives[0]);
- mdelay(10);
-
- /* Wait up to 10 seconds (enough for recent drives) */
- for (j = 0; j < 100; j++) {
- int status;
- mdelay(100);
- status = inb(base + 0x70);
- if (!(status & BUSY_STAT))
- break;
- }
}
-/* Here we handle media bay devices */
-static void
-idepmac_wake_bay(int i, unsigned long base)
+static void idepmac_wake_interface(int i, unsigned long base, int mediabay)
{
- int timeout;
+ struct device_node* np = pmac_ide[i].node;
+ if (!mediabay) {
+ /* Revive IDE disk and controller */
+ switch(pmac_ide[i].aapl_bus_id) {
+ case 0:
+ feature_set(np, FEATURE_IDE0_reset);
+ feature_set(np, FEATURE_IOBUS_enable);
+ mdelay(10);
+ feature_set(np, FEATURE_IDE0_enable);
+ mdelay(10);
+ feature_clear(np, FEATURE_IDE0_reset);
+ break;
+ case 1:
+ feature_set(np, FEATURE_IDE1_reset);
+ feature_set(np, FEATURE_IOBUS_enable);
+ mdelay(10);
+ feature_set(np, FEATURE_IDE1_enable);
+ mdelay(10);
+ feature_clear(np, FEATURE_IDE1_reset);
+ break;
+ case 2:
+ /* This one exists only for KL, I don't know
+ about any enable bit */
+ feature_set(np, FEATURE_IDE2_reset);
+ mdelay(10);
+ feature_clear(np, FEATURE_IDE2_reset);
+ break;
+ }
+ }
+
/* Reset timings */
pmac_ide_selectproc(&ide_hwifs[i].drives[0]);
mdelay(10);
-
- timeout = 10000;
- while ((inb(base + 0x70) & BUSY_STAT) && timeout) {
- mdelay(1);
- --timeout;
- }
}
/* Note: We support only master drives for now. This will have to be
@@ -1128,6 +1182,8 @@
{
int i, ret;
unsigned long base;
+ unsigned long flags;
+ int big_delay;
switch (when) {
case PBOOK_SLEEP_REQUEST:
@@ -1136,34 +1192,104 @@
break;
case PBOOK_SLEEP_NOW:
for (i = 0; i < pmac_ide_count; ++i) {
+ ide_hwif_t *hwif;
+ ide_drive_t *drive;
+ int unlock = 0;
+
if ((base = pmac_ide[i].regbase) == 0)
- continue;
+ continue;
+
+ hwif = &ide_hwifs[i];
+ drive = &hwif->drives[0];
+
+ if (drive->present) {
+ /* Wait for HW group to complete operations */
+ if (ide_spin_wait_hwgroup(drive)) {
+ // What can we do here ? Wake drive we had already
+ // put to sleep and return an error ?
+ } else {
+ unlock = 1;
+ /* Lock HW group */
+ HWGROUP(drive)->busy = 1;
+
+ /* Stop the device */
+ idepmac_sleep_device(drive, i, base);
+
+ }
+ }
/* Disable irq during sleep */
disable_irq(pmac_ide[i].irq);
+ if (unlock)
+ spin_unlock_irq(&io_request_lock);
+
+ /* Check if this is a media bay with an IDE device or not
+ * a media bay.
+ */
ret = check_media_bay_by_base(base, MB_CD);
- if ((ret == -ENODEV) && ide_hwifs[i].drives[0].present)
- /* not media bay - put the disk to sleep */
- idepmac_sleep_disk(i, base);
+ if ((ret == 0) || (ret == -ENODEV))
+ idepmac_sleep_interface(i, base, (ret == 0));
}
break;
case PBOOK_WAKE:
+ big_delay = 0;
+ for (i = 0; i < pmac_ide_count; ++i) {
+
+ if ((base = pmac_ide[i].regbase) == 0)
+ continue;
+
+ /* Check if this is a media bay with an IDE device or not
+ * a media bay
+ */
+ ret = check_media_bay_by_base(base, MB_CD);
+ if ((ret == 0) || (ret == -ENODEV)) {
+ idepmac_wake_interface(i, base, (ret == 0));
+ big_delay = 1;
+ }
+
+ }
+ /* Let hardware get up to speed */
+ if (big_delay)
+ mdelay(IDE_WAKEUP_DELAY_MS);
+
for (i = 0; i < pmac_ide_count; ++i) {
ide_hwif_t *hwif;
+ ide_drive_t *drive;
+ int j, used_dma;
+
if ((base = pmac_ide[i].regbase) == 0)
continue;
+
hwif = &ide_hwifs[i];
- /* We don't handle media bay devices this way */
- ret = check_media_bay_by_base(base, MB_CD);
- if ((ret == -ENODEV) && ide_hwifs[i].drives[0].present)
- idepmac_wake_disk(i, base);
- else if (ret == 0)
- idepmac_wake_bay(i, base);
- enable_irq(pmac_ide[i].irq);
+ drive = &hwif->drives[0];
-#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
- if (hwif->drives[0].present && hwif->drives[0].using_dma)
- pmac_ide_check_dma(&hwif->drives[0]);
-#endif
+ /* Wait for the drive to come up and set it's DMA */
+ if (drive->present) {
+ /* Wait up to 20 seconds */
+ for (j = 0; j < 200; j++) {
+ int status;
+ mdelay(100);
+ status = inb(base + 0x70);
+ if (!(status & BUSY_STAT))
+ break;
+ }
+ }
+
+ /* We don't have re-configured DMA yet */
+ used_dma = drive->using_dma;
+ drive->using_dma = 0;
+
+ /* We resume processing on the HW group */
+ spin_lock_irqsave(&io_request_lock, flags);
+ enable_irq(pmac_ide[i].irq);
+ if (drive->present)
+ HWGROUP(drive)->busy = 0;
+ spin_unlock_irqrestore(&io_request_lock, flags);
+
+ /* Wake the device
+ * We could handle the slave here
+ */
+ if (drive->present)
+ idepmac_wake_device(drive, used_dma);
}
break;
}
diff -u --recursive --new-file v2.4.10/linux/drivers/ide/pdcraid.c linux/drivers/ide/pdcraid.c
--- v2.4.10/linux/drivers/ide/pdcraid.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/ide/pdcraid.c Sun Sep 30 12:26:05 2001
@@ -36,14 +36,32 @@
static int pdcraid_open(struct inode * inode, struct file * filp);
static int pdcraid_release(struct inode * inode, struct file * filp);
static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
-static int pdcraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh);
+static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head * bh);
+static int pdcraid1_make_request (request_queue_t *q, int rw, struct buffer_head * bh);
+struct disk_dev {
+ int major;
+ int minor;
+ int device;
+};
+
+static struct disk_dev devlist[]= {
+ {IDE0_MAJOR, 0, -1 },
+ {IDE0_MAJOR, 64, -1 },
+ {IDE1_MAJOR, 0, -1 },
+ {IDE1_MAJOR, 64, -1 },
+ {IDE2_MAJOR, 0, -1 },
+ {IDE2_MAJOR, 64, -1 },
+ {IDE3_MAJOR, 0, -1 },
+ {IDE3_MAJOR, 64, -1 },
+};
struct pdcdisk {
kdev_t device;
unsigned long sectors;
struct block_device *bdev;
+ unsigned long last_pos;
};
struct pdcraid {
@@ -58,21 +76,31 @@
unsigned int cutoff_disks[8];
};
-static struct raid_device_operations pdcraid_ops = {
+static struct raid_device_operations pdcraid0_ops = {
open: pdcraid_open,
release: pdcraid_release,
ioctl: pdcraid_ioctl,
- make_request: pdcraid_make_request
+ make_request: pdcraid0_make_request
+};
+
+static struct raid_device_operations pdcraid1_ops = {
+ open: pdcraid_open,
+ release: pdcraid_release,
+ ioctl: pdcraid_ioctl,
+ make_request: pdcraid1_make_request
};
static struct pdcraid raid[16];
+
static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
{
unsigned int minor;
- unsigned long sectors;
+ unsigned long sectors,*larg;
- if (!inode || !inode->i_rdev)
+
+
+ if (!inode || !inode->i_rdev)
return -EINVAL;
minor = MINOR(inode->i_rdev)>>SHIFT;
@@ -121,6 +149,7 @@
return blk_ioctl(inode->i_rdev, cmd, arg);
default:
+ printk("Invalid ioctl \n");
return -EINVAL;
};
@@ -128,7 +157,49 @@
}
-static int pdcraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh)
+unsigned long partition_map_normal(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride)
+{
+ return block + partition_off;
+}
+
+unsigned long partition_map_linux(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride)
+{
+ unsigned long newblock;
+
+ newblock = stride - (partition_off%stride); if (newblock == stride) newblock = 0;
+ newblock += block;
+ newblock = newblock % partition_size;
+ newblock += partition_off;
+
+ return newblock;
+}
+
+static int funky_remap[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
+
+unsigned long partition_map_linux_raid0_4disk(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride)
+{
+ unsigned long newblock,temp,temp2;
+
+ newblock = stride - (partition_off%stride); if (newblock == stride) newblock = 0;
+
+ if (block < (partition_size / (8*stride))*8*stride ) {
+ temp = block % stride;
+ temp2 = block / stride;
+ temp2 = ((temp2>>3)<<3)|(funky_remap[temp2&7]);
+ block = temp2*stride+temp;
+ }
+
+
+ newblock += block;
+ newblock = newblock % partition_size;
+ newblock += partition_off;
+
+ return newblock;
+}
+
+
+
+static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head * bh)
{
unsigned long rsect;
unsigned long rsect_left,rsect_accum = 0;
@@ -159,7 +230,7 @@
/* Partitions need adding of the start sector of the partition to the requested sector */
- rsect += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect;
+ rsect = partition_map_normal(rsect, ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect, ataraid_gendisk.part[MINOR(bh->b_rdev)].nr_sects, thisraid->stride);
/* Woops we need to split the request to avoid crossing a stride barrier */
if ((rsect/thisraid->stride) != ((rsect+(bh->b_size/512)-1)/thisraid->stride)) {
@@ -208,9 +279,114 @@
* Let the main block layer submit the IO and resolve recursion:
*/
return 1;
+
+ outerr:
+ buffer_IO_error(bh);
+ return 0;
+}
+
+static int pdcraid1_write_request(request_queue_t *q, int rw, struct buffer_head * bh)
+{
+ struct buffer_head *bh1;
+ struct ataraid_bh_private *private;
+ int device;
+ int i;
+
+ device = (bh->b_rdev >> SHIFT)&MAJOR_MASK;
+ private = ataraid_get_private();
+ if (private==NULL)
+ BUG();
+
+ private->parent = bh;
+
+ atomic_set(&private->count,raid[device].disks);
+
+
+ for (i = 0; i< raid[device].disks; i++) {
+ bh1=ataraid_get_bhead();
+ /* If this ever fails we're doomed */
+ if (!bh1)
+ BUG();
+
+ /* dupe the bufferhead and update the parts that need to be different */
+ memcpy(bh1, bh, sizeof(*bh));
+
+ bh1->b_end_io = ataraid_end_request;
+ bh1->b_private = private;
+ bh1->b_rsector += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect; /* partition offset */
+ bh1->b_rdev = raid[device].disk[i].device;
+
+ /* update the last known head position for the drive */
+ raid[device].disk[i].last_pos = bh1->b_rsector+(bh1->b_size>>9);
+
+ generic_make_request(rw,bh1);
+ }
+ return 0;
+}
+
+static int pdcraid1_read_request (request_queue_t *q, int rw, struct buffer_head * bh)
+{
+ int device;
+ int dist;
+ int bestsofar,bestdist,i;
+ static int previous;
+
+ /* Reads are simple in principle. Pick a disk and go.
+ Initially I cheat by just picking the one which the last known
+ head position is closest by.
+ Later on, online/offline checking and performance needs adding */
+
+ device = (bh->b_rdev >> SHIFT)&MAJOR_MASK;
+ bh->b_rsector += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect;
+
+ bestsofar = 0;
+ bestdist = raid[device].disk[0].last_pos - bh->b_rsector;
+ if (bestdist<0)
+ bestdist=-bestdist;
+ if (bestdist>4095)
+ bestdist=4095;
+
+ for (i=1 ; ib_rsector;
+ if (dist<0)
+ dist = -dist;
+ if (dist>4095)
+ dist=4095;
+
+ if (bestdist==dist) { /* it's a tie; try to do some read balancing */
+ if ((previous>bestsofar)&&(previous<=i))
+ bestsofar = i;
+ previous = (previous + 1) % raid[device].disks;
+ } else if (bestdist>dist) {
+ bestdist = dist;
+ bestsofar = i;
+ }
+
+ }
+
+ bh->b_rdev = raid[device].disk[bestsofar].device;
+ raid[device].disk[bestsofar].last_pos = bh->b_rsector+(bh->b_size>>9);
+
+ /*
+ * Let the main block layer submit the IO and resolve recursion:
+ */
+
+ return 1;
}
+static int pdcraid1_make_request (request_queue_t *q, int rw, struct buffer_head * bh)
+{
+ /* Read and Write are totally different cases; split them totally here */
+ if (rw==READA)
+ rw = READ;
+
+ if (rw==READ)
+ return pdcraid1_read_request(q,rw,bh);
+ else
+ return pdcraid1_write_request(q,rw,bh);
+}
+
#include "pdcraid.h"
static unsigned long calc_pdcblock_offset (int major,int minor)
@@ -288,12 +464,22 @@
return sum;
}
-static void __init probedisk(int major, int minor,int device)
+static int cookie = 0;
+
+static void __init probedisk(int devindex,int device, int raidlevel)
{
int i;
+ int major, minor;
struct promise_raid_conf *prom;
static unsigned char block[4096];
+ struct block_device *bdev;
+
+ if (devlist[devindex].device!=-1) /* already assigned to another array */
+ return;
+ major = devlist[devindex].major;
+ minor = devlist[devindex].minor;
+
if (read_disk_sb(major,minor,(unsigned char*)&block,sizeof(block)))
return;
@@ -302,26 +488,23 @@
/* the checksums must match */
if (prom->checksum != calc_sb_csum((unsigned int*)prom))
return;
- if (prom->raid.type!=0x00) /* Only raid 0 is supported right now */
+ if (prom->raid.type!=raidlevel) /* different raidlevel */
+ return;
+
+ if ((cookie!=0) && (cookie != prom->raid.magic_1)) /* different array */
return;
+ cookie = prom->raid.magic_1;
/* This looks evil. But basically, we have to search for our adapternumber
in the arraydefinition, both of which are in the superblock */
for (i=0;(iraid.total_disks)&&(i<8);i++) {
if ( (prom->raid.disk[i].channel== prom->raid.channel) &&
(prom->raid.disk[i].device == prom->raid.device) ) {
- struct block_device *bdev = bdget(MKDEV(major,minor));
- if (bdev && blkdev_get(bdev,FMODE_READ|FMODE_WRITE,0,BDEV_RAW) == 0) {
- struct gendisk *gd;
- int j;
- /* This is supposed to prevent others from stealing our underlying disks */
+
+ bdev = bdget(MKDEV(major,minor));
+ if (bdev && blkdev_get(bdev, FMODE_READ|FMODE_WRITE, 0, BDEV_RAW) == 0) {
raid[device].disk[i].bdev = bdev;
- gd=get_gendisk(major);
- if (gd!=NULL) {
- for (j=1+(minor<minor_shift);j<((minor+1)<minor_shift);j++)
- gd->part[j].nr_sects=0;
- }
}
raid[device].disk[i].device = MKDEV(major,minor);
raid[device].disk[i].sectors = prom->raid.disk_secs;
@@ -331,7 +514,7 @@
raid[device].geom.heads = prom->raid.heads+1;
raid[device].geom.sectors = prom->raid.sectors;
raid[device].geom.cylinders = prom->raid.cylinders+1;
-
+ devlist[devindex].device=device;
}
}
@@ -362,62 +545,91 @@
}
}
-static __init int pdcraid_init_one(int device)
+static __init int pdcraid_init_one(int device,int raidlevel)
{
+ request_queue_t *q;
int i,count;
- probedisk(IDE0_MAJOR, 0, device);
- probedisk(IDE0_MAJOR, 64, device);
- probedisk(IDE1_MAJOR, 0, device);
- probedisk(IDE1_MAJOR, 64, device);
- probedisk(IDE2_MAJOR, 0, device);
- probedisk(IDE2_MAJOR, 64, device);
- probedisk(IDE3_MAJOR, 0, device);
- probedisk(IDE3_MAJOR, 64, device);
+ probedisk(0, device, raidlevel);
+ probedisk(1, device, raidlevel);
+ probedisk(2, device, raidlevel);
+ probedisk(3, device, raidlevel);
+ probedisk(4, device, raidlevel);
+ probedisk(5, device, raidlevel);
+ probedisk(6, device, raidlevel);
+ probedisk(7, device, raidlevel);
- fill_cutoff(device);
+ if (raidlevel==0)
+ fill_cutoff(device);
/* Initialize the gendisk structure */
ataraid_register_disk(device,raid[device].sectors);
count=0;
- printk(KERN_INFO "Promise Fasttrak(tm) Softwareraid driver for linux version 0.02\n");
for (i=0;i<8;i++) {
if (raid[device].disk[i].device!=0) {
- printk(KERN_INFO "Drive %i is %li Mb \n",
- i,raid[device].disk[i].sectors/2048);
+ printk(KERN_INFO "Drive %i is %li Mb (%i / %i) \n",
+ i,raid[device].disk[i].sectors/2048,MAJOR(raid[device].disk[i].device),MINOR(raid[device].disk[i].device));
count++;
}
}
if (count) {
- printk(KERN_INFO "Raid array consists of %i drives. \n",count);
+ printk(KERN_INFO "Raid%i array consists of %i drives. \n",raidlevel,count);
return 0;
} else {
- printk(KERN_INFO "No raid array found\n");
return -ENODEV;
}
}
static __init int pdcraid_init(void)
{
- int retval,device;
+ int i,retval,device,count=0;
+
+ do {
- device=ataraid_get_device(&pdcraid_ops);
- if (device<0)
- return -ENODEV;
- retval = pdcraid_init_one(device);
- if (retval)
- ataraid_release_device(device);
- return retval;
+ cookie = 0;
+ device=ataraid_get_device(&pdcraid0_ops);
+ if (device<0)
+ break;
+ retval = pdcraid_init_one(device,0);
+ if (retval) {
+ ataraid_release_device(device);
+ break;
+ } else {
+ count++;
+ }
+ } while (1);
+
+ do {
+
+ cookie = 0;
+ device=ataraid_get_device(&pdcraid1_ops);
+ if (device<0)
+ break;
+ retval = pdcraid_init_one(device,1);
+ if (retval) {
+ ataraid_release_device(device);
+ break;
+ } else {
+ count++;
+ }
+ } while (1);
+
+ if (count) {
+ printk(KERN_INFO "Promise Fasttrak(tm) Softwareraid driver for linux version 0.03beta\n");
+ return 0;
+ }
+ printk(KERN_DEBUG "Promise Fasttrak(tm) Softwareraid driver 0.03beta: No raid array found\n");
+ return -ENODEV;
}
static void __exit pdcraid_exit (void)
{
int i,device;
for (device = 0; device<16; device++) {
- for (i=0;i<8;i++) {
+ for (i=0;i<8;i++) {
struct block_device *bdev = raid[device].disk[i].bdev;
raid[device].disk[i].bdev = NULL;
if (bdev)
@@ -441,3 +653,4 @@
module_init(pdcraid_init);
module_exit(pdcraid_exit);
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/highlevel.c linux/drivers/ieee1394/highlevel.c
--- v2.4.10/linux/drivers/ieee1394/highlevel.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/ieee1394/highlevel.c Mon Oct 1 21:24:24 2001
@@ -154,21 +154,18 @@
}
-#define DEFINE_MULTIPLEXER(Function) \
-void highlevel_##Function(struct hpsb_host *host) \
-{ \
- struct list_head *entry,*next; \
- void (*funcptr)(struct hpsb_host*); \
- read_lock(&hl_drivers_lock); \
- entry = hl_drivers.next; \
- while (entry != &hl_drivers) { \
- next = entry->next; \
- funcptr = list_entry(entry, struct hpsb_highlevel, hl_list) \
- ->op->Function; \
- if (funcptr) funcptr(host); \
- entry = next; \
- } \
- read_unlock(&hl_drivers_lock); \
+#define DEFINE_MULTIPLEXER(Function) \
+void highlevel_##Function(struct hpsb_host *host) \
+{ \
+ struct list_head *lh; \
+ void (*funcptr)(struct hpsb_host*); \
+ read_lock(&hl_drivers_lock); \
+ list_for_each(lh, &hl_drivers) { \
+ funcptr = list_entry(lh, struct hpsb_highlevel, hl_list) \
+ ->op->Function; \
+ if (funcptr) funcptr(host); \
+ } \
+ read_unlock(&hl_drivers_lock); \
}
DEFINE_MULTIPLEXER(add_host)
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/hosts.c linux/drivers/ieee1394/hosts.c
--- v2.4.10/linux/drivers/ieee1394/hosts.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/hosts.c Mon Oct 1 21:24:24 2001
@@ -23,8 +23,8 @@
#include "highlevel.h"
-static struct hpsb_host_template *templates = NULL;
-spinlock_t templates_lock = SPIN_LOCK_UNLOCKED;
+static LIST_HEAD(templates);
+static spinlock_t templates_lock = SPIN_LOCK_UNLOCKED;
/*
* This function calls the add_host/remove_host hooks for every host currently
@@ -32,13 +32,16 @@
*/
void hl_all_hosts(struct hpsb_highlevel *hl, int init)
{
+ struct list_head *tlh, *hlh;
struct hpsb_host_template *tmpl;
struct hpsb_host *host;
spin_lock(&templates_lock);
- for (tmpl = templates; tmpl != NULL; tmpl = tmpl->next) {
- for (host = tmpl->hosts; host != NULL; host = host->next) {
+ list_for_each(tlh, &templates) {
+ tmpl = list_entry(tlh, struct hpsb_host_template, list);
+ list_for_each(hlh, &tmpl->hosts) {
+ host = list_entry(hlh, struct hpsb_host, list);
if (host->initialized) {
if (init) {
if (hl->op->add_host) {
@@ -58,21 +61,24 @@
int hpsb_inc_host_usage(struct hpsb_host *host)
{
+ struct list_head *tlh, *hlh;
struct hpsb_host_template *tmpl;
- struct hpsb_host *h;
int retval = 0;
unsigned long flags;
spin_lock_irqsave(&templates_lock, flags);
- for (tmpl = templates; (tmpl != NULL) && !retval; tmpl = tmpl->next) {
- for (h = tmpl->hosts; h != NULL; h = h->next) {
- if (h == host) {
- tmpl->devctl(h, MODIFY_USAGE, 1);
+ list_for_each(tlh, &templates) {
+ tmpl = list_entry(tlh, struct hpsb_host_template, list);
+ list_for_each(hlh, &tmpl->hosts) {
+ if (host == list_entry(hlh, struct hpsb_host, list)) {
+ tmpl->devctl(host, MODIFY_USAGE, 1);
retval = 1;
break;
}
}
+ if (retval)
+ break;
}
spin_unlock_irqrestore(&templates_lock, flags);
@@ -113,32 +119,22 @@
h->speed_map = (u8 *)(h->csr.speed_map + 2);
h->template = tmpl;
- if (hd_size) {
+ if (hd_size)
h->hostdata = &h->embedded_hostdata[0];
- }
-
- if (tmpl->hosts == NULL) {
- tmpl->hosts = h;
- } else {
- struct hpsb_host *last = tmpl->hosts;
- while (last->next != NULL) {
- last = last->next;
- }
- last->next = h;
- }
+ list_add_tail(&h->list, &tmpl->hosts);
return h;
}
static void free_all_hosts(struct hpsb_host_template *tmpl)
{
- struct hpsb_host *next, *host = tmpl->hosts;
+ struct list_head *hlh, *next;
+ struct hpsb_host *host;
- while (host) {
- next = host->next;
+ list_for_each_safe(hlh, next, &tmpl->hosts) {
+ host = list_entry(hlh, struct hpsb_host, list);
vfree(host);
- host = next;
}
}
@@ -146,11 +142,13 @@
static void init_hosts(struct hpsb_host_template *tmpl)
{
int count;
+ struct list_head *hlh;
struct hpsb_host *host;
count = tmpl->detect_hosts(tmpl);
- for (host = tmpl->hosts; host != NULL; host = host->next) {
+ list_for_each(hlh, &tmpl->hosts) {
+ host = list_entry(hlh, struct hpsb_host, list);
if (tmpl->initialize_host(host)) {
host->initialized = 1;
@@ -166,9 +164,11 @@
static void shutdown_hosts(struct hpsb_host_template *tmpl)
{
+ struct list_head *hlh;
struct hpsb_host *host;
- for (host = tmpl->hosts; host != NULL; host = host->next) {
+ list_for_each(hlh, &tmpl->hosts) {
+ host = list_entry(hlh, struct hpsb_host, list);
if (host->initialized) {
host->initialized = 0;
abort_requests(host);
@@ -188,68 +188,17 @@
}
-static int add_template(struct hpsb_host_template *new)
-{
- new->next = NULL;
- new->hosts = NULL;
- new->number_of_hosts = 0;
-
- spin_lock(&templates_lock);
- if (templates == NULL) {
- templates = new;
- } else {
- struct hpsb_host_template *last = templates;
- while (last->next != NULL) {
- last = last->next;
- }
- last->next = new;
- }
- spin_unlock(&templates_lock);
-
- return 0;
-}
-
-static int remove_template(struct hpsb_host_template *tmpl)
-{
- int retval = 0;
-
- if (tmpl->number_of_hosts) {
- HPSB_ERR("attempted to remove busy host template "
- "of %s at address 0x%p", tmpl->name, tmpl);
- return 1;
- }
-
- spin_lock(&templates_lock);
- if (templates == tmpl) {
- templates = tmpl->next;
- } else {
- struct hpsb_host_template *t;
-
- t = templates;
- while (t->next != tmpl && t->next != NULL) {
- t = t->next;
- }
-
- if (t->next == NULL) {
- HPSB_ERR("attempted to remove unregistered host template "
- "of %s at address 0x%p", tmpl->name, tmpl);
- retval = -1;
- } else {
- t->next = tmpl->next;
- }
- }
- spin_unlock(&templates_lock);
-
- return retval;
-}
-
-
/*
* The following two functions are exported symbols for module usage.
*/
int hpsb_register_lowlevel(struct hpsb_host_template *tmpl)
{
- add_template(tmpl);
+ INIT_LIST_HEAD(&tmpl->hosts);
+ tmpl->number_of_hosts = 0;
+
+ spin_lock(&templates_lock);
+ list_add_tail(&tmpl->list, &templates);
+ spin_unlock(&templates_lock);
/* PCI cards should be smart and use the PCI detection layer, and
* not this one shot deal. detect_hosts() will be obsoleted soon. */
@@ -265,7 +214,12 @@
{
shutdown_hosts(tmpl);
- if (remove_template(tmpl)) {
- HPSB_PANIC("remove_template failed on %s", tmpl->name);
- }
+ if (tmpl->number_of_hosts)
+ HPSB_PANIC("attempted to remove busy host template "
+ "of %s at address 0x%p", tmpl->name, tmpl);
+ else {
+ spin_lock(&templates_lock);
+ list_del(&tmpl->list);
+ spin_unlock(&templates_lock);
+ }
}
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/hosts.h linux/drivers/ieee1394/hosts.h
--- v2.4.10/linux/drivers/ieee1394/hosts.h Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/hosts.h Mon Oct 1 21:24:24 2001
@@ -3,6 +3,7 @@
#include
#include
+#include
#include
#include "ieee1394_types.h"
@@ -13,7 +14,7 @@
struct hpsb_host {
/* private fields (hosts, do not use them) */
- struct hpsb_host *next;
+ struct list_head list;
atomic_t generation;
@@ -109,9 +110,9 @@
};
struct hpsb_host_template {
- struct hpsb_host_template *next;
+ struct list_head list;
- struct hpsb_host *hosts;
+ struct list_head hosts;
int number_of_hosts;
/* fields above will be ignored and overwritten after registering */
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/ieee1394_core.c linux/drivers/ieee1394/ieee1394_core.c
--- v2.4.10/linux/drivers/ieee1394/ieee1394_core.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/ieee1394/ieee1394_core.c Mon Oct 1 21:24:24 2001
@@ -17,6 +17,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -30,6 +31,13 @@
#include "csr.h"
#include "nodemgr.h"
+/*
+ * Disable the nodemgr detection and config rom reading functionality.
+ */
+MODULE_PARM(disable_nodemgr, "i");
+MODULE_PARM_DESC(disable_nodemgr, "Disable nodemgr functionality.");
+static int disable_nodemgr = 0;
+
static kmem_cache_t *hpsb_packet_cache;
@@ -95,7 +103,7 @@
INIT_TQ_HEAD(packet->complete_tq);
INIT_LIST_HEAD(&packet->list);
sema_init(&packet->state_change, 0);
- packet->state = unused;
+ packet->state = hpsb_unused;
packet->generation = -1;
packet->data_be = 1;
@@ -352,14 +360,14 @@
}
if (ackcode != ACK_PENDING || !packet->expect_response) {
- packet->state = completed;
+ packet->state = hpsb_complete;
up(&packet->state_change);
up(&packet->state_change);
run_task_queue(&packet->complete_tq);
return;
}
- packet->state = pending;
+ packet->state = hpsb_pending;
packet->sendtime = jiffies;
spin_lock_irqsave(&host->pending_pkt_lock, flags);
@@ -393,9 +401,9 @@
return 0;
}
- packet->state = queued;
+ packet->state = hpsb_queued;
- if (packet->type == async && packet->node_id != ALL_NODES) {
+ if (packet->type == hpsb_async && packet->node_id != ALL_NODES) {
packet->speed_code =
host->speed_map[(host->node_id & NODE_MASK) * 64
+ (packet->node_id & NODE_MASK)];
@@ -503,14 +511,14 @@
break;
}
- packet->state = completed;
+ packet->state = hpsb_complete;
up(&packet->state_change);
run_task_queue(&packet->complete_tq);
}
-struct hpsb_packet *create_reply_packet(struct hpsb_host *host, quadlet_t *data,
- size_t dsize)
+static struct hpsb_packet *create_reply_packet(struct hpsb_host *host,
+ quadlet_t *data, size_t dsize)
{
struct hpsb_packet *p;
@@ -522,13 +530,15 @@
return NULL;
}
- p->type = async;
- p->state = unused;
+ p->type = hpsb_async;
+ p->state = hpsb_unused;
p->host = host;
p->node_id = data[1] >> 16;
p->tlabel = (data[0] >> 10) & 0x3f;
p->no_waiter = 1;
+ p->generation = get_hpsb_generation(host);
+
if (dsize % 4) {
p->data[dsize / 4] = 0;
}
@@ -540,8 +550,8 @@
packet = create_reply_packet(host, data, length); \
if (packet == NULL) break
-void handle_incoming_packet(struct hpsb_host *host, int tcode, quadlet_t *data,
- size_t size, int write_acked)
+static void handle_incoming_packet(struct hpsb_host *host, int tcode,
+ quadlet_t *data, size_t size, int write_acked)
{
struct hpsb_packet *packet;
int length, rcode, extcode;
@@ -720,7 +730,7 @@
list_for_each(lh, &llist) {
packet = list_entry(lh, struct hpsb_packet, list);
- packet->state = completed;
+ packet->state = hpsb_complete;
packet->ack_code = ACKX_ABORTED;
up(&packet->state_change);
run_task_queue(&packet->complete_tq);
@@ -732,7 +742,7 @@
unsigned long flags;
struct hpsb_packet *packet;
unsigned long expire;
- struct list_head *lh;
+ struct list_head *lh, *next;
LIST_HEAD(expiredlist);
spin_lock_irqsave(&host->csr.lock, flags);
@@ -746,8 +756,9 @@
spin_lock_irqsave(&host->pending_pkt_lock, flags);
- list_for_each(lh, &host->pending_packets) {
+ for (lh = host->pending_packets.next; lh != &host->pending_packets; lh = next) {
packet = list_entry(lh, struct hpsb_packet, list);
+ next = lh->next;
if (time_before(packet->sendtime + expire, jiffies)) {
list_del(&packet->list);
list_add(&packet->list, &expiredlist);
@@ -761,7 +772,7 @@
list_for_each(lh, &expiredlist) {
packet = list_entry(lh, struct hpsb_packet, list);
- packet->state = completed;
+ packet->state = hpsb_complete;
packet->ack_code = ACKX_TIMEOUT;
up(&packet->state_change);
run_task_queue(&packet->complete_tq);
@@ -775,13 +786,19 @@
0, 0, NULL, NULL);
init_hpsb_highlevel();
init_csr();
- init_ieee1394_nodemgr();
+ if (!disable_nodemgr)
+ init_ieee1394_nodemgr();
+ else
+ HPSB_INFO("nodemgr functionality disabled");
+
return 0;
}
static void __exit ieee1394_cleanup(void)
{
- cleanup_ieee1394_nodemgr();
+ if (!disable_nodemgr)
+ cleanup_ieee1394_nodemgr();
+
cleanup_csr();
kmem_cache_destroy(hpsb_packet_cache);
}
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/ieee1394_core.h linux/drivers/ieee1394/ieee1394_core.h
--- v2.4.10/linux/drivers/ieee1394/ieee1394_core.h Sun Sep 23 11:40:58 2001
+++ linux/drivers/ieee1394/ieee1394_core.h Mon Oct 1 21:24:24 2001
@@ -20,16 +20,16 @@
/* Async and Iso types should be clear, raw means send-as-is, do not
* CRC! Byte swapping shall still be done in this case. */
- enum { async, iso, raw } __attribute__((packed)) type;
+ enum { hpsb_async, hpsb_iso, hpsb_raw } __attribute__((packed)) type;
/* Okay, this is core internal and a no care for hosts.
* queued = queued for sending
* pending = sent, waiting for response
- * completed = processing completed, successful or not
+ * complete = processing completed, successful or not
* incoming = incoming packet
*/
enum {
- unused, queued, pending, completed, incoming
+ hpsb_unused, hpsb_queued, hpsb_pending, hpsb_complete, hpsb_incoming
} __attribute__((packed)) state;
/* These are core internal. */
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/ieee1394_hotplug.h linux/drivers/ieee1394/ieee1394_hotplug.h
--- v2.4.10/linux/drivers/ieee1394/ieee1394_hotplug.h Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/ieee1394_hotplug.h Mon Oct 1 21:24:24 2001
@@ -2,32 +2,75 @@
#define _IEEE1394_HOTPLUG_H
#include "ieee1394_core.h"
+#include "nodemgr.h"
-#define IEEE1394_DEVICE_ID_MATCH_VENDOR_ID 0x0001
-#define IEEE1394_DEVICE_ID_MATCH_MODEL_ID 0x0002
-#define IEEE1394_DEVICE_ID_MATCH_SW_SPECIFIER_ID 0x0004
-#define IEEE1394_DEVICE_ID_MATCH_SW_SPECIFIER_VERSION 0x0008
+#define IEEE1394_MATCH_VENDOR_ID 0x0001
+#define IEEE1394_MATCH_MODEL_ID 0x0002
+#define IEEE1394_MATCH_SPECIFIER_ID 0x0004
+#define IEEE1394_MATCH_VERSION 0x0008
struct ieee1394_device_id {
u32 match_flags;
u32 vendor_id;
u32 model_id;
- u32 sw_specifier_id;
- u32 sw_specifier_version;
+ u32 specifier_id;
+ u32 version;
+ void *driver_data;
};
-#define IEEE1394_PROTOCOL(id, version) { \
- match_flags: IEEE1394_DEVICE_ID_MATCH_SW_SPECIFIER_ID | \
- IEEE1394_DEVICE_ID_MATCH_SW_SPECIFIER_VERSION, \
- sw_specifier_id: id, \
- sw_specifier_version: version \
-}
-
-#define IEEE1394_DEVICE(vendor_id, model_id) { \
- match_flags: IEEE1394_DEVICE_ID_MATCH_VENDOR_ID | \
- IEEE1394_DEVICE_ID_MATCH_MODEL_ID, \
- vendor_id: vendor_id, \
- model_id: vendor_id, \
-}
+struct hpsb_protocol_driver {
+ /* The name of the driver, e.g. SBP2 or IP1394 */
+ const char *name;
+
+ /*
+ * The device id table describing the protocols and/or devices
+ * supported by this driver. This is used by the nodemgr to
+ * decide if a driver could support a given node, but the
+ * probe function below can implement further protocol
+ * dependent or vendor dependent checking.
+ */
+ struct ieee1394_device_id *id_table;
+
+ /*
+ * The probe function is called when a device is added to the
+ * bus and the nodemgr finds a matching entry in the drivers
+ * device id table or when registering this driver and a
+ * previously unhandled device can be handled. The driver may
+ * decline to handle the device based on further investigation
+ * of the device (or whatever reason) in which case a negative
+ * error code should be returned, otherwise 0 should be
+ * returned. The driver may use the driver_data field in the
+ * unit directory to store per device driver specific data.
+ */
+ int (*probe)(struct unit_directory *ud);
+
+ /*
+ * The disconnect function is called when a device is removed
+ * from the bus or if it wasn't possible to read the guid
+ * after the last bus reset.
+ */
+ void (*disconnect)(struct unit_directory *ud);
+
+ /*
+ * The update function is called when the node has just
+ * survived a bus reset, i.e. it is still present on the bus.
+ * However, it may be necessary to reestablish the connection
+ * or login into the node again, depending on the protocol.
+ */
+ void (*update)(struct unit_directory *ud);
+
+ /* Driver in list of all registered drivers */
+ struct list_head list;
+
+ /* The list of unit directories managed by this driver */
+ struct list_head unit_directories;
+};
+
+int hpsb_register_protocol(struct hpsb_protocol_driver *driver);
+void hpsb_unregister_protocol(struct hpsb_protocol_driver *driver);
+
+int hpsb_claim_unit_directory(struct unit_directory *ud,
+ struct hpsb_protocol_driver *driver);
+void hpsb_release_unit_directory(struct unit_directory *ud);
#endif /* _IEEE1394_HOTPLUG_H */
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/ieee1394_syms.c linux/drivers/ieee1394/ieee1394_syms.c
--- v2.4.10/linux/drivers/ieee1394/ieee1394_syms.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/ieee1394_syms.c Mon Oct 1 21:24:24 2001
@@ -18,6 +18,7 @@
#include "hosts.h"
#include "ieee1394_core.h"
#include "ieee1394_transactions.h"
+#include "ieee1394_hotplug.h"
#include "highlevel.h"
#include "nodemgr.h"
@@ -75,7 +76,12 @@
EXPORT_SYMBOL(highlevel_remove_host);
EXPORT_SYMBOL(highlevel_host_reset);
EXPORT_SYMBOL(highlevel_add_one_host);
+
EXPORT_SYMBOL(hpsb_guid_get_entry);
EXPORT_SYMBOL(hpsb_nodeid_get_entry);
EXPORT_SYMBOL(hpsb_get_host_by_ne);
EXPORT_SYMBOL(hpsb_guid_fill_packet);
+EXPORT_SYMBOL(hpsb_register_protocol);
+EXPORT_SYMBOL(hpsb_unregister_protocol);
+EXPORT_SYMBOL(hpsb_release_unit_directory);
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/ieee1394_transactions.c linux/drivers/ieee1394/ieee1394_transactions.c
--- v2.4.10/linux/drivers/ieee1394/ieee1394_transactions.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/ieee1394_transactions.c Mon Oct 1 21:24:24 2001
@@ -131,7 +131,7 @@
packet->header_size = 4;
packet->data_size = length;
- packet->type = iso;
+ packet->type = hpsb_iso;
packet->tcode = TCODE_ISO_DATA;
}
@@ -142,7 +142,7 @@
packet->header_size = 8;
packet->data_size = 0;
packet->expect_response = 0;
- packet->type = raw; /* No CRC added */
+ packet->type = hpsb_raw; /* No CRC added */
packet->speed_code = SPEED_100; /* Force speed to be 100Mbps */
}
@@ -488,7 +488,9 @@
if (!packet)
return NULL;
- if (length != 4)
+ /* Sometimes this may be called without data, just to allocate the
+ * packet. */
+ if (length != 4 && buffer)
memcpy(packet->data, buffer, length);
return packet;
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/ieee1394_types.h linux/drivers/ieee1394/ieee1394_types.h
--- v2.4.10/linux/drivers/ieee1394/ieee1394_types.h Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/ieee1394_types.h Mon Oct 1 21:24:24 2001
@@ -26,6 +26,13 @@
#include
#endif
+#ifndef list_for_each_safe
+#define list_for_each_safe(pos, n, head) \
+ for (pos = (head)->next, n = pos->next; pos != (head); \
+ pos = n, n = pos->next)
+
+#endif
+
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/nodemgr.c linux/drivers/ieee1394/nodemgr.c
--- v2.4.10/linux/drivers/ieee1394/nodemgr.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/ieee1394/nodemgr.c Mon Oct 1 21:24:24 2001
@@ -15,11 +15,13 @@
#include
#include
#include
+#include
#include "ieee1394_types.h"
#include "ieee1394.h"
#include "hosts.h"
#include "ieee1394_transactions.h"
+#include "ieee1394_hotplug.h"
#include "highlevel.h"
#include "csr.h"
#include "nodemgr.h"
@@ -47,6 +49,16 @@
static LIST_HEAD(node_list);
static rwlock_t node_lock = RW_LOCK_UNLOCKED;
+static LIST_HEAD(driver_list);
+static rwlock_t driver_lock = RW_LOCK_UNLOCKED;
+
+/* The rwlock unit_directory_lock is always held when manipulating the
+ * global unit_directory_list, but this also protects access to the
+ * lists of unit directories stored in the protocol drivers.
+ */
+static LIST_HEAD(unit_directory_list);
+static rwlock_t unit_directory_lock = RW_LOCK_UNLOCKED;
+
static LIST_HEAD(host_info_list);
static spinlock_t host_info_lock = SPIN_LOCK_UNLOCKED;
@@ -56,7 +68,12 @@
struct list_head list;
};
-static struct node_entry *create_node_entry(void)
+static void nodemgr_process_config_rom(struct node_entry *ne,
+ quadlet_t busoptions);
+
+
+static struct node_entry *nodemgr_create_node(octlet_t guid, quadlet_t busoptions,
+ struct hpsb_host *host, nodeid_t nodeid)
{
struct node_entry *ne;
unsigned long flags;
@@ -66,15 +83,21 @@
INIT_LIST_HEAD(&ne->list);
INIT_LIST_HEAD(&ne->unit_directories);
- ne->guid = (u64) -1;
- ne->host = NULL;
- ne->nodeid = 0;
- atomic_set(&ne->generation, -1);
+ ne->host = host;
+ ne->nodeid = nodeid;
+ ne->guid = guid;
+ atomic_set(&ne->generation, get_hpsb_generation(ne->host));
write_lock_irqsave(&node_lock, flags);
list_add_tail(&ne->list, &node_list);
write_unlock_irqrestore(&node_lock, flags);
+ nodemgr_process_config_rom (ne, busoptions);
+
+ HPSB_DEBUG("%s added: node " NODE_BUS_FMT ", GUID %016Lx",
+ (host->node_id == nodeid) ? "Local host" : "Device",
+ NODE_BUS_ARGS(nodeid), (unsigned long long)guid);
+
return ne;
}
@@ -104,16 +127,20 @@
return NULL;
}
-int nodemgr_read_quadlet(struct node_entry *ne,
+int nodemgr_read_quadlet(struct node_entry *ne,
octlet_t address, quadlet_t *quad)
{
- if (hpsb_read(ne->host, ne->nodeid, address, quad, 4)) {
- HPSB_DEBUG("read of address %Lx failed", address);
- return -EAGAIN;
+ int i;
+ int ret = 0;
+
+ for (i = 0; i < 3; i++) {
+ ret = hpsb_read(ne->host, ne->nodeid, address, quad, 4);
+ if (ret != -EAGAIN)
+ break;
}
*quad = be32_to_cpu(*quad);
- return 0;
+ return ret;
}
#define CONFIG_ROM_VENDOR_ID 0x03
@@ -137,13 +164,14 @@
octlet_t a;
quadlet_t quad;
int length, i;
-
if (!(ud = kmalloc (sizeof *ud, GFP_KERNEL)))
goto unit_directory_error;
memset (ud, 0, sizeof *ud);
+ ud->ne = ne;
ud->address = address;
+ ud->arb_count = 0;
if (nodemgr_read_quadlet(ne, address, &quad))
goto unit_directory_error;
@@ -151,7 +179,8 @@
a = address + 4;
for (i = 0; i < length; i++, a += 4) {
- int code, value;
+ int code;
+ quadlet_t value;
if (nodemgr_read_quadlet(ne, a, &quad))
goto unit_directory_error;
@@ -183,10 +212,20 @@
case CONFIG_ROM_DESCRIPTOR_DIRECTORY:
/* TODO: read strings... icons? */
break;
+
+ default:
+ if (ud->arb_count < 16) {
+ /* Place them in the arbitrary pairs */
+ ud->arb_keys[ud->arb_count] = code;
+ ud->arb_values[ud->arb_count] = value;
+ ud->arb_count++;
+ }
}
}
- list_add_tail (&ud->list, &ne->unit_directories);
+ list_add_tail(&ud->node_list, &ne->unit_directories);
+ list_add_tail(&ud->driver_list, &unit_directory_list);
+
return;
unit_directory_error:
@@ -194,27 +233,29 @@
kfree(ud);
}
-#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
static void dump_directories (struct node_entry *ne)
{
+#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
struct list_head *l;
HPSB_DEBUG("vendor_id=0x%06x, capabilities=0x%06x",
ne->vendor_id, ne->capabilities);
list_for_each (l, &ne->unit_directories) {
- struct unit_directory *ud = list_entry (l, struct unit_directory, list);
+ struct unit_directory *ud = list_entry (l, struct unit_directory, node_list);
HPSB_DEBUG("unit directory:");
if (ud->flags & UNIT_DIRECTORY_VENDOR_ID)
HPSB_DEBUG(" vendor_id=0x%06x ", ud->vendor_id);
if (ud->flags & UNIT_DIRECTORY_MODEL_ID)
HPSB_DEBUG(" model_id=0x%06x ", ud->model_id);
if (ud->flags & UNIT_DIRECTORY_SPECIFIER_ID)
- HPSB_DEBUG(" specifier_id=0x%06x ", ud->specifier_id);
+ HPSB_DEBUG(" sw_specifier_id=0x%06x ", ud->specifier_id);
if (ud->flags & UNIT_DIRECTORY_VERSION)
- HPSB_DEBUG(" version=0x%06x ", ud->version);
+ HPSB_DEBUG(" sw_version=0x%06x ", ud->version);
}
-}
+#else
+ return;
#endif
+}
static void nodemgr_process_root_directory(struct node_entry *ne)
{
@@ -260,86 +301,383 @@
break;
}
}
-#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
+
dump_directories(ne);
+}
+
+#ifdef CONFIG_HOTPLUG
+
+static void nodemgr_call_policy(char *verb, struct unit_directory *ud)
+{
+ char *argv [3], **envp, *buf, *scratch;
+ int i = 0, value;
+
+ if (!hotplug_path [0])
+ return;
+ if (!current->fs->root)
+ return;
+ if (!(envp = (char **) kmalloc(20 * sizeof (char *), GFP_KERNEL))) {
+ HPSB_DEBUG ("ENOMEM");
+ return;
+ }
+ if (!(buf = kmalloc(256, GFP_KERNEL))) {
+ kfree(envp);
+ HPSB_DEBUG("ENOMEM2");
+ return;
+ }
+
+ /* only one standardized param to hotplug command: type */
+ argv[0] = hotplug_path;
+ argv[1] = "ieee1394";
+ argv[2] = 0;
+
+ /* minimal command environment */
+ envp[i++] = "HOME=/";
+ envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
+
+#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
+ /* hint that policy agent should enter no-stdout debug mode */
+ envp[i++] = "DEBUG=kernel";
+#endif
+ /* extensible set of named bus-specific parameters,
+ * supporting multiple driver selection algorithms.
+ */
+ scratch = buf;
+
+ envp[i++] = scratch;
+ scratch += sprintf(scratch, "ACTION=%s", verb) + 1;
+ envp[i++] = scratch;
+ scratch += sprintf(scratch, "VENDOR_ID=%06x", ud->ne->vendor_id) + 1;
+ envp[i++] = scratch;
+ scratch += sprintf(scratch, "GUID=%016Lx", (long long unsigned)ud->ne->guid) + 1;
+ envp[i++] = scratch;
+ scratch += sprintf(scratch, "SPECIFIER_ID=%06x", ud->specifier_id) + 1;
+ envp[i++] = scratch;
+ scratch += sprintf(scratch, "VERSION=%06x", ud->version) + 1;
+ envp[i++] = 0;
+
+ /* NOTE: user mode daemons can call the agents too */
+#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
+ HPSB_DEBUG("NodeMgr: %s %s %016Lx", argv[0], verb, (long long unsigned)ud->ne->guid);
#endif
+ value = call_usermodehelper(argv[0], argv, envp);
+ kfree(buf);
+ kfree(envp);
+ if (value != 0)
+ HPSB_DEBUG("NodeMgr: hotplug policy returned 0x%x", value);
}
-static void register_node(struct hpsb_host *host, nodeid_t nodeid, u64 guid,
- quadlet_t busoptions)
+#else
+
+static inline void
+nodemgr_call_policy(char *verb, struct unit_directory *ud)
{
- struct node_entry *ne;
- unsigned long flags, new = 0;
+#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
+ HPSB_DEBUG("NodeMgr: nodemgr_call_policy(): hotplug not enabled");
+#else
+ return;
+#endif
+}
- read_lock_irqsave(&node_lock, flags);
- ne = find_entry_by_guid(guid);
- read_unlock_irqrestore(&node_lock, flags);
+#endif /* CONFIG_HOTPLUG */
- /* New entry */
- if (!ne) {
- if ((ne = create_node_entry()) == NULL)
- return;
+static void nodemgr_claim_unit_directory(struct unit_directory *ud,
+ struct hpsb_protocol_driver *driver)
+{
+ ud->driver = driver;
+ list_del(&ud->driver_list);
+ list_add_tail(&ud->driver_list, &driver->unit_directories);
+}
+
+static void nodemgr_release_unit_directory(struct unit_directory *ud)
+{
+ ud->driver = NULL;
+ list_del(&ud->driver_list);
+ list_add_tail(&ud->driver_list, &unit_directory_list);
+}
+
+void hpsb_release_unit_directory(struct unit_directory *ud)
+{
+ unsigned long flags;
+
+ write_lock_irqsave(&unit_directory_lock, flags);
+ nodemgr_release_unit_directory(ud);
+ write_unlock_irqrestore(&unit_directory_lock, flags);
+}
+
+static void nodemgr_free_unit_directories(struct node_entry *ne)
+{
+ struct list_head *lh;
+ struct unit_directory *ud;
+
+ lh = ne->unit_directories.next;
+ while (lh != &ne->unit_directories) {
+ ud = list_entry(lh, struct unit_directory, node_list);
+ lh = lh->next;
+ if (ud->driver && ud->driver->disconnect)
+ ud->driver->disconnect(ud);
+ nodemgr_release_unit_directory(ud);
+ nodemgr_call_policy("remove", ud);
+ list_del(&ud->driver_list);
+ kfree(ud);
+ }
+}
+
+static struct ieee1394_device_id *
+nodemgr_match_driver(struct hpsb_protocol_driver *driver,
+ struct unit_directory *ud)
+{
+ struct ieee1394_device_id *id;
+
+ for (id = driver->id_table; id->match_flags != 0; id++) {
+ if ((id->match_flags & IEEE1394_MATCH_VENDOR_ID) &&
+ id->vendor_id != ud->vendor_id)
+ continue;
+
+ if ((id->match_flags & IEEE1394_MATCH_MODEL_ID) &&
+ id->model_id != ud->model_id)
+ continue;
+
+ if ((id->match_flags & IEEE1394_MATCH_SPECIFIER_ID) &&
+ id->specifier_id != ud->specifier_id)
+ continue;
+
+ if ((id->match_flags & IEEE1394_MATCH_VERSION) &&
+ id->version != ud->version)
+ continue;
+
+ return id;
+ }
+
+ return NULL;
+}
+
+static struct hpsb_protocol_driver *
+nodemgr_find_driver(struct unit_directory *ud)
+{
+ struct list_head *l;
+ struct hpsb_protocol_driver *match, *driver;
+ struct ieee1394_device_id *device_id;
+
+ match = NULL;
+ list_for_each(l, &driver_list) {
+ driver = list_entry(l, struct hpsb_protocol_driver, list);
+ device_id = nodemgr_match_driver(driver, ud);
+
+ if (device_id != NULL) {
+ match = driver;
+ break;
+ }
+ }
+
+ return match;
+}
+
+static void nodemgr_bind_drivers (struct node_entry *ne)
+{
+ struct list_head *lh;
+ struct hpsb_protocol_driver *driver;
+ struct unit_directory *ud;
- HPSB_DEBUG("%s added: node " NODE_BUS_FMT
- ", GUID %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
- (host->node_id == nodeid) ? "Local host" : "Device",
- NODE_BUS_ARGS(nodeid), ((u8 *)&guid)[0],
- ((u8 *)&guid)[1], ((u8 *)&guid)[2], ((u8 *)&guid)[3],
- ((u8 *)&guid)[4], ((u8 *)&guid)[5], ((u8 *)&guid)[6],
- ((u8 *)&guid)[7]);
+ list_for_each(lh, &ne->unit_directories) {
+ ud = list_entry(lh, struct unit_directory, node_list);
+ driver = nodemgr_find_driver(ud);
+ if (driver != NULL && driver->probe(ud) == 0)
+ nodemgr_claim_unit_directory(ud, driver);
+ nodemgr_call_policy("add", ud);
+ }
+}
+
+int hpsb_register_protocol(struct hpsb_protocol_driver *driver)
+{
+ struct unit_directory *ud;
+ struct list_head *lh;
+ unsigned long flags;
+
+ write_lock_irqsave(&driver_lock, flags);
+ list_add_tail(&driver->list, &driver_list);
+ write_unlock_irqrestore(&driver_lock, flags);
+
+ write_lock_irqsave(&unit_directory_lock, flags);
+ INIT_LIST_HEAD(&driver->unit_directories);
+ lh = unit_directory_list.next;
+ while (lh != &unit_directory_list) {
+ ud = list_entry(lh, struct unit_directory, driver_list);
+ lh = lh->next;
+ if (nodemgr_match_driver(driver, ud) && driver->probe(ud) == 0)
+ nodemgr_claim_unit_directory(ud, driver);
+ }
+ write_unlock_irqrestore(&unit_directory_lock, flags);
+
+ /*
+ * Right now registration always succeeds, but maybe we should
+ * detect clashes in protocols handled by other drivers.
+ */
+
+ return 0;
+}
+
+void hpsb_unregister_protocol(struct hpsb_protocol_driver *driver)
+{
+ struct list_head *lh;
+ struct unit_directory *ud;
+ unsigned long flags;
- ne->guid = guid;
- new = 1;
+ write_lock_irqsave(&driver_lock, flags);
+ list_del(&driver->list);
+ write_unlock_irqrestore(&driver_lock, flags);
+
+ write_lock_irqsave(&unit_directory_lock, flags);
+ lh = driver->unit_directories.next;
+ while (lh != &driver->unit_directories) {
+ ud = list_entry(lh, struct unit_directory, driver_list);
+ lh = lh->next;
+ if (ud->driver && ud->driver->disconnect)
+ ud->driver->disconnect(ud);
+ nodemgr_release_unit_directory(ud);
}
+ write_unlock_irqrestore(&unit_directory_lock, flags);
+}
+
+static void nodemgr_process_config_rom(struct node_entry *ne,
+ quadlet_t busoptions)
+{
+ unsigned long flags;
+
+ ne->busopt.irmc = (busoptions >> 31) & 1;
+ ne->busopt.cmc = (busoptions >> 30) & 1;
+ ne->busopt.isc = (busoptions >> 29) & 1;
+ ne->busopt.bmc = (busoptions >> 28) & 1;
+ ne->busopt.pmc = (busoptions >> 27) & 1;
+ ne->busopt.cyc_clk_acc = (busoptions >> 16) & 0xff;
+ ne->busopt.max_rec = 1 << (((busoptions >> 12) & 0xf) + 1);
+ ne->busopt.generation = (busoptions >> 4) & 0xf;
+ ne->busopt.lnkspd = busoptions & 0x7;
- if (!new && ne->nodeid != nodeid)
+#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
+ HPSB_DEBUG("NodeMgr: raw=0x%08x irmc=%d cmc=%d isc=%d bmc=%d pmc=%d "
+ "cyc_clk_acc=%d max_rec=%d gen=%d lspd=%d",
+ busoptions, ne->busopt.irmc, ne->busopt.cmc,
+ ne->busopt.isc, ne->busopt.bmc, ne->busopt.pmc,
+ ne->busopt.cyc_clk_acc, ne->busopt.max_rec,
+ ne->busopt.generation, ne->busopt.lnkspd);
+#endif
+
+ /*
+ * When the config rom changes we disconnect all drivers and
+ * free the cached unit directories and reread the whole
+ * thing. If this was a new device, the call to
+ * nodemgr_disconnect_drivers is a no-op and all is well.
+ */
+ write_lock_irqsave(&unit_directory_lock, flags);
+ nodemgr_free_unit_directories(ne);
+ nodemgr_process_root_directory(ne);
+ nodemgr_bind_drivers(ne);
+ write_unlock_irqrestore(&unit_directory_lock, flags);
+}
+
+/*
+ * This function updates nodes that were present on the bus before the
+ * reset and still are after the reset. The nodeid and the config rom
+ * may have changed, and the drivers managing this device must be
+ * informed that this device just went through a bus reset, to allow
+ * the to take whatever actions required.
+ */
+static void nodemgr_update_node(struct node_entry *ne, quadlet_t busoptions,
+ struct hpsb_host *host, nodeid_t nodeid)
+{
+ struct list_head *lh;
+
+ if (ne->nodeid != nodeid)
HPSB_DEBUG("Node " NODE_BUS_FMT " changed to " NODE_BUS_FMT,
NODE_BUS_ARGS(ne->nodeid), NODE_BUS_ARGS(nodeid));
ne->host = host;
- ne->nodeid = nodeid;
+ ne->nodeid = nodeid;
- /* Now set the bus options. Only do all this crap if this is a new
- * node, or if the generation number has changed. */
- if (new || ne->busopt.generation != ((busoptions >> 6) & 0x3)) {
- ne->busopt.irmc = (busoptions >> 31) & 1;
- ne->busopt.cmc = (busoptions >> 30) & 1;
- ne->busopt.isc = (busoptions >> 29) & 1;
- ne->busopt.bmc = (busoptions >> 28) & 1;
- ne->busopt.pmc = (busoptions >> 27) & 1;
- ne->busopt.cyc_clk_acc = (busoptions >> 16) & 0xff;
- ne->busopt.max_rec = 1 << (((busoptions >> 12) & 0xf) + 1);
- ne->busopt.generation = (busoptions >> 6) & 0x3;
- ne->busopt.lnkspd = busoptions & 0x7;
+ if (ne->busopt.generation != ((busoptions >> 4) & 0xf))
+ nodemgr_process_config_rom (ne, busoptions);
- /* Now, process the rest of the tree */
- nodemgr_process_root_directory(ne);
+ /* Since that's done, we can declare this record current */
+ atomic_set(&ne->generation, get_hpsb_generation(ne->host));
+
+ list_for_each (lh, &ne->unit_directories) {
+ struct unit_directory *ud;
+
+ ud = list_entry (lh, struct unit_directory, node_list);
+ if (ud->driver != NULL && ud->driver->update != NULL)
+ ud->driver->update(ud);
}
+}
- /* Since that's done, we can declare this record current */
- atomic_set(&ne->generation, get_hpsb_generation(host));
+static int read_businfo_block(struct hpsb_host *host, nodeid_t nodeid,
+ quadlet_t *buffer, int buffer_length)
+{
+ octlet_t base = CSR_REGISTER_BASE + CSR_CONFIG_ROM;
+ int retries = 3;
+ int header_count;
+ unsigned header_size;
+ quadlet_t quad;
+
+retry_configrom:
+
+ if (!retries--) {
+ HPSB_ERR("Giving up on node " NODE_BUS_FMT
+ " for ConfigROM probe, too many errors",
+ NODE_BUS_ARGS(nodeid));
+ return -1;
+ }
+
+ header_count = 0;
+ header_size = 0;
#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
- HPSB_DEBUG("raw=0x%08x irmc=%d cmc=%d isc=%d bmc=%d pmc=%d cyc_clk_acc=%d "
- "max_rec=%d gen=%d lspd=%d", busoptions,
- ne->busopt.irmc, ne->busopt.cmc, ne->busopt.isc, ne->busopt.bmc,
- ne->busopt.pmc, ne->busopt.cyc_clk_acc, ne->busopt.max_rec,
- ne->busopt.generation, ne->busopt.lnkspd);
+ HPSB_INFO("Initiating ConfigROM request for node " NODE_BUS_FMT,
+ NODE_BUS_ARGS(nodeid));
#endif
- return;
+ /* Now, P1212 says that devices should support 64byte block
+ * reads, aligned on 64byte boundaries. That doesn't seem
+ * to work though, and we are forced to doing quadlet
+ * sized reads. */
+
+ if (hpsb_read(host, nodeid, base, &quad, 4)) {
+ HPSB_ERR("ConfigROM quadlet transaction error for node " NODE_BUS_FMT,
+ NODE_BUS_ARGS(nodeid));
+ goto retry_configrom;
+ }
+ buffer[header_count++] = be32_to_cpu(quad);
+
+ header_size = buffer[0] >> 24;
+
+ if (header_size < 4) {
+ HPSB_INFO("Node " NODE_BUS_FMT " has non-standard ROM format (%d quads), "
+ "cannot parse", NODE_BUS_ARGS(nodeid), header_size);
+ return -1;
+ }
+
+ while (header_count <= header_size && header_count < buffer_length) {
+ if (hpsb_read(host, nodeid, base + (header_count<<2), &quad, 4)) {
+ HPSB_ERR("ConfigROM quadlet transaction error for " NODE_BUS_FMT,
+ NODE_BUS_ARGS(nodeid));
+ goto retry_configrom;
+ }
+ buffer[header_count++] = be32_to_cpu(quad);
+ }
+
+ return 0;
}
static void nodemgr_remove_node(struct node_entry *ne)
{
- HPSB_DEBUG("Device removed: node " NODE_BUS_FMT ", GUID "
- "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
- NODE_BUS_ARGS(ne->nodeid),
- ((u8 *)&ne->guid)[0], ((u8 *)&ne->guid)[1],
- ((u8 *)&ne->guid)[2], ((u8 *)&ne->guid)[3],
- ((u8 *)&ne->guid)[4], ((u8 *)&ne->guid)[5],
- ((u8 *)&ne->guid)[6], ((u8 *)&ne->guid)[7]);
+ unsigned long flags;
+ HPSB_DEBUG("Device removed: node " NODE_BUS_FMT ", GUID %016Lx",
+ NODE_BUS_ARGS(ne->nodeid), (unsigned long long)ne->guid);
+
+ write_lock_irqsave(&unit_directory_lock, flags);
+ nodemgr_free_unit_directories(ne);
+ write_unlock_irqrestore(&unit_directory_lock, flags);
list_del(&ne->list);
kfree(ne);
@@ -352,82 +690,26 @@
{
struct hpsb_host *host = (struct hpsb_host *)data;
struct selfid *sid = (struct selfid *)host->topology_map;
- struct list_head *lh,*spare;
+ struct list_head *lh, *next;
struct node_entry *ne;
int nodecount = host->node_count;
nodeid_t nodeid = LOCAL_BUS;
- quadlet_t buffer[5], quad;
- octlet_t base = CSR_REGISTER_BASE + CSR_CONFIG_ROM;
+ quadlet_t buffer[5];
+ octlet_t guid;
unsigned long flags;
/* We need to detect when the ConfigROM's generation has changed,
* so we only update the node's info when it needs to be. */
for (; nodecount; nodecount--, nodeid++, sid++) {
- int retries = 3;
- int header_count;
- unsigned header_size;
- octlet_t guid;
-
/* Skip extended, and non-active node's */
while (sid->extended)
sid++;
if (!sid->link_active)
continue;
- /* Just use our local ROM */
- if (nodeid == host->node_id) {
- int i;
- for (i = 0; i < 5; i++)
- buffer[i] = be32_to_cpu(host->csr.rom[i]);
- goto set_options;
- }
-
-retry_configrom:
-
- if (!retries--) {
- HPSB_ERR("Giving up on node " NODE_BUS_FMT
- " for ConfigROM probe, too many errors",
- NODE_BUS_ARGS(nodeid));
+ if (read_businfo_block (host, nodeid, buffer, sizeof(buffer) >> 2))
continue;
- }
-
- header_count = 0;
- header_size = 0;
-
-#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
- HPSB_INFO("Initiating ConfigROM request for node " NODE_BUS_FMT,
- NODE_BUS_ARGS(nodeid));
-#endif
- /* Now, P1212 says that devices should support 64byte block
- * reads, aligned on 64byte boundaries. That doesn't seem
- * to work though, and we are forced to doing quadlet
- * sized reads. */
-
- if (hpsb_read(host, nodeid, base, &quad, 4)) {
- HPSB_ERR("ConfigROM quadlet transaction error for node " NODE_BUS_FMT,
- NODE_BUS_ARGS(nodeid));
- goto retry_configrom;
- }
- buffer[header_count++] = be32_to_cpu(quad);
-
- header_size = buffer[0] >> 24;
-
- if (header_size < 4) {
- HPSB_INFO("Node " NODE_BUS_FMT " has non-standard ROM format (%d quads), "
- "cannot parse", NODE_BUS_ARGS(nodeid), header_size);
- continue;
- }
-
- while (header_count <= header_size && (header_count<<2) < sizeof(buffer)) {
- if (hpsb_read(host, nodeid, base + (header_count<<2), &quad, 4)) {
- HPSB_ERR("ConfigROM quadlet transaction error for " NODE_BUS_FMT,
- NODE_BUS_ARGS(nodeid));
- goto retry_configrom;
- }
- buffer[header_count++] = be32_to_cpu(quad);
- }
-set_options:
if (buffer[1] != IEEE1394_BUSID_MAGIC) {
/* This isn't a 1394 device */
HPSB_ERR("Node " NODE_BUS_FMT " isn't an IEEE 1394 device",
@@ -435,15 +717,21 @@
continue;
}
- guid = be64_to_cpu(((u64)buffer[3] << 32) | buffer[4]);
- register_node(host, nodeid, guid, buffer[2]);
+ guid = ((u64)buffer[3] << 32) | buffer[4];
+ ne = hpsb_guid_get_entry(guid);
+
+ if (!ne)
+ nodemgr_create_node(guid, buffer[2], host, nodeid);
+ else
+ nodemgr_update_node(ne, buffer[2], host, nodeid);
}
/* Now check to see if we have any nodes that aren't referenced
* any longer. */
write_lock_irqsave(&node_lock, flags);
- list_for_each_safe(lh, spare, &node_list) {
+ for (lh = node_list.next; lh != &node_list; lh = next) {
ne = list_entry(lh, struct node_entry, list);
+ next = lh->next;
/* Only checking this host */
if (ne->host != host)
@@ -453,7 +741,7 @@
* node was removed, or it failed the above probe. Either
* way, we remove references to it, since they are
* invalid. */
- if (atomic_read(&ne->generation) != get_hpsb_generation(host))
+ if (!hpsb_node_entry_valid(ne))
nodemgr_remove_node(ne);
}
write_unlock_irqrestore(&node_lock, flags);
@@ -511,7 +799,7 @@
unsigned long flags;
if (!hi) {
- HPSB_ERR ("Out of memory in Node Manager");
+ HPSB_ERR ("NodeMgr: out of memory in add host");
return;
}
@@ -544,7 +832,7 @@
}
if (hi == NULL) {
- HPSB_ERR ("Could not process reset of non-existent host in Node Manager");
+ HPSB_ERR ("NodeMgr: could not process reset of non-existent host");
goto done_reset_host;
}
@@ -558,8 +846,7 @@
static void nodemgr_remove_host(struct hpsb_host *host)
{
- struct list_head *lh;
- struct host_info *hi = NULL;
+ struct list_head *lh, *next;
struct node_entry *ne;
unsigned long flags;
@@ -568,8 +855,10 @@
/* First remove all node entries for this host */
write_lock_irqsave(&node_lock, flags);
- list_for_each(lh, &node_list) {
+
+ for (lh = node_list.next; lh != &node_list; lh = next) {
ne = list_entry(lh, struct node_entry, list);
+ next = lh->next;
/* Only checking this host */
if (ne->host != host)
@@ -581,22 +870,17 @@
spin_lock_irqsave (&host_info_lock, flags);
list_for_each(lh, &host_info_list) {
- struct host_info *myhi = list_entry(lh, struct host_info, list);
- if (myhi->host == host) {
- hi = myhi;
+ struct host_info *hi = list_entry(lh, struct host_info, list);
+ if (hi->host == host) {
+ list_del(&hi->list);
+ kfree (hi);
break;
}
}
- if (hi == NULL) {
- HPSB_ERR ("Could not remove non-existent host in Node Manager");
- goto done_remove_host;
- }
-
- list_del(&hi->list);
- kfree (hi);
+ if (lh == host_info_list.next)
+ HPSB_ERR ("NodeMgr: could not remove non-existent host");
-done_remove_host:
spin_unlock_irqrestore (&host_info_lock, flags);
return;
@@ -614,7 +898,7 @@
{
hl = hpsb_register_highlevel("Node manager", &nodemgr_ops);
if (!hl) {
- HPSB_ERR("Out of memory during ieee1394 initialization");
+ HPSB_ERR("NodeMgr: out of memory during ieee1394 initialization");
}
}
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/nodemgr.h linux/drivers/ieee1394/nodemgr.h
--- v2.4.10/linux/drivers/ieee1394/nodemgr.h Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/nodemgr.h Mon Oct 1 21:24:24 2001
@@ -38,13 +38,23 @@
u16 max_rec; /* Maximum packet size node can receive */
};
-#define UNIT_DIRECTORY_VENDOR_ID 0x01
-#define UNIT_DIRECTORY_MODEL_ID 0x02
-#define UNIT_DIRECTORY_SPECIFIER_ID 0x04
-#define UNIT_DIRECTORY_VERSION 0x08
+#define UNIT_DIRECTORY_VENDOR_ID 0x01
+#define UNIT_DIRECTORY_MODEL_ID 0x02
+#define UNIT_DIRECTORY_SPECIFIER_ID 0x04
+#define UNIT_DIRECTORY_VERSION 0x08
+/*
+ * A unit directory corresponds to a protocol supported by the
+ * node. If a node supports eg. IP/1394 and AV/C, its config rom has a
+ * unit directory for each of these protocols.
+ *
+ * Unit directories appear on two types of lists: for each node we
+ * maintain a list of the unit directories found in its config rom and
+ * for each driver we maintain a list of the unit directories
+ * (ie. devices) the driver manages.
+ */
struct unit_directory {
- struct list_head list;
+ struct node_entry *ne; /* The node which this directory belongs to */
octlet_t address; /* Address of the unit directory on the node */
u8 flags; /* Indicates which entries were read */
quadlet_t vendor_id;
@@ -53,6 +63,20 @@
char *model_name;
quadlet_t specifier_id;
quadlet_t version;
+
+ /* Groupings for arbitrary key/value pairs */
+ int arb_count; /* Number of arbitrary key/values */
+ char arb_keys[16]; /* Up to 16 keys */
+ quadlet_t arb_values[16]; /* Same for values */
+
+ struct hpsb_protocol_driver *driver;
+ void *driver_data;
+
+ /* For linking the nodes managed by the driver, or unmanaged nodes */
+ struct list_head driver_list;
+
+ /* For linking directories belonging to a node */
+ struct list_head node_list;
};
struct node_entry {
@@ -68,6 +92,11 @@
u32 capabilities;
struct list_head unit_directories;
};
+
+static inline int hpsb_node_entry_valid(struct node_entry *ne)
+{
+ return atomic_read(&ne->generation) == get_hpsb_generation(ne->host);
+}
/*
* Returns a node entry (which has its reference count incremented) or NULL if
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/ohci1394.c linux/drivers/ieee1394/ohci1394.c
--- v2.4.10/linux/drivers/ieee1394/ohci1394.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/ohci1394.c Mon Oct 1 21:24:24 2001
@@ -105,6 +105,17 @@
#include
#include
+#ifdef CONFIG_ALL_PPC
+#include
+#include
+#include
+#endif
+
+/* Revert to old bus reset algorithm that works on my Pismo until
+ * the new one is fixed
+ */
+#undef BUSRESET_WORKAROUND
+
#include "ieee1394.h"
#include "ieee1394_types.h"
#include "hosts.h"
@@ -112,7 +123,6 @@
#include "highlevel.h"
#include "ohci1394.h"
-
#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
#define OHCI1394_DEBUG
#endif
@@ -123,17 +133,17 @@
#ifdef OHCI1394_DEBUG
#define DBGMSG(card, fmt, args...) \
-printk(KERN_INFO "ohci1394_%d: " fmt "\n" , card , ## args)
+printk(KERN_INFO "%s_%d: " fmt "\n" , OHCI1394_DRIVER_NAME, card , ## args)
#else
#define DBGMSG(card, fmt, args...)
#endif
#ifdef CONFIG_IEEE1394_OHCI_DMA_DEBUG
#define OHCI_DMA_ALLOC(fmt, args...) \
- HPSB_ERR("ohci1394("__FUNCTION__")alloc(%d): "fmt, \
+ HPSB_ERR("%s("__FUNCTION__")alloc(%d): "fmt, OHCI1394_DRIVER_NAME, \
++global_outstanding_dmas, ## args)
#define OHCI_DMA_FREE(fmt, args...) \
- HPSB_ERR("ohci1394("__FUNCTION__")free(%d): "fmt, \
+ HPSB_ERR("%s("__FUNCTION__")free(%d): "fmt, OHCI1394_DRIVER_NAME, \
--global_outstanding_dmas, ## args)
u32 global_outstanding_dmas = 0;
#else
@@ -143,18 +153,11 @@
/* print general (card independent) information */
#define PRINT_G(level, fmt, args...) \
-printk(level "ohci1394: " fmt "\n" , ## args)
+printk(level "%s: " fmt "\n" , OHCI1394_DRIVER_NAME , ## args)
/* print card specific information */
#define PRINT(level, card, fmt, args...) \
-printk(level "ohci1394_%d: " fmt "\n" , card , ## args)
-
-#define FAIL(fmt, args...) \
-do { \
- PRINT_G(KERN_ERR, fmt , ## args); \
- remove_card(ohci); \
- return 1; \
-} while(0)
+printk(level "%s_%d: " fmt "\n" , OHCI1394_DRIVER_NAME, card , ## args)
#define PCI_CLASS_FIREWIRE_OHCI ((PCI_CLASS_SERIAL_FIREWIRE << 8) | 0x10)
@@ -179,21 +182,48 @@
MODULE_PARM_DESC(attempt_root, "Attempt to make the host root.");
static int attempt_root = 0;
-#ifdef __LITTLE_ENDIAN
-/* Don't waste cycles on same sex byte swaps */
-#define packet_swab(w,x,y,z)
-#define block_swab32(x,y)
-#else
-static void packet_swab(quadlet_t *data, char tcode, int len, int payload_swap);
-static __inline__ void block_swab32(quadlet_t *data, size_t size);
-#endif
-
static unsigned int card_id_counter = 0;
static void dma_trm_tasklet(unsigned long data);
static void remove_card(struct ti_ohci *ohci);
static void dma_trm_reset(struct dma_trm_ctx *d);
+#ifndef __LITTLE_ENDIAN
+/* Swap a series of quads inplace. */
+static __inline__ void block_swab32(quadlet_t *data, size_t size) {
+ while (size--)
+ data[size] = swab32(data[size]);
+}
+
+static unsigned hdr_sizes[] =
+{
+ 3, /* TCODE_WRITEQ */
+ 4, /* TCODE_WRITEB */
+ 3, /* TCODE_WRITE_RESPONSE */
+ 0, /* ??? */
+ 3, /* TCODE_READQ */
+ 4, /* TCODE_READB */
+ 3, /* TCODE_READQ_RESPONSE */
+ 4, /* TCODE_READB_RESPONSE */
+ 1, /* TCODE_CYCLE_START (???) */
+ 4, /* TCODE_LOCK_REQUEST */
+ 2, /* TCODE_ISO_DATA */
+ 4, /* TCODE_LOCK_RESPONSE */
+};
+
+/* Swap headers */
+static inline void packet_swab(quadlet_t *data, int tcode, int len)
+{
+ if (tcode > TCODE_LOCK_RESPONSE || hdr_sizes[tcode] == 0)
+ return;
+ block_swab32(data, hdr_sizes[tcode]);
+}
+#else
+/* Don't waste cycles on same sex byte swaps */
+#define packet_swab(w,x,y)
+#define block_swab32(x,y)
+#endif /* !LITTLE_ENDIAN */
+
/***********************************
* IEEE-1394 functionality section *
***********************************/
@@ -230,7 +260,7 @@
{
int i;
unsigned long flags;
- u32 r;
+ u32 r = 0;
spin_lock_irqsave (&ohci->phy_reg_lock, flags);
@@ -376,7 +406,7 @@
}
/* Generate the dma receive prgs and start the context */
-static void initialize_dma_rcv_ctx(struct dma_rcv_ctx *d)
+static void initialize_dma_rcv_ctx(struct dma_rcv_ctx *d, int generate_irq)
{
struct ti_ohci *ohci = (struct ti_ohci*)(d->ohci);
int i;
@@ -384,12 +414,17 @@
ohci1394_stop_context(ohci, d->ctrlClear, NULL);
for (i=0; inum_desc; i++) {
+ u32 c;
- d->prg_cpu[i]->control =
- cpu_to_le32((0x280C << 16) | d->buf_size);
+ c = DMA_CTL_INPUT_MORE | DMA_CTL_UPDATE |
+ DMA_CTL_BRANCH;
+ if (generate_irq)
+ c |= DMA_CTL_IRQ;
+
+ d->prg_cpu[i]->control = cpu_to_le32(c | d->buf_size);
/* End of descriptor list? */
- if ((i+1) < d->num_desc) {
+ if (i + 1 < d->num_desc) {
d->prg_cpu[i]->branchAddress =
cpu_to_le32((d->prg_bus[i+1] & 0xfffffff0) | 0x1);
} else {
@@ -565,15 +600,15 @@
reg_write(ohci, OHCI1394_IRMultiChanMaskLoClear, 0xffffffff);
/* Initialize AR dma */
- initialize_dma_rcv_ctx(ohci->ar_req_context);
- initialize_dma_rcv_ctx(ohci->ar_resp_context);
+ initialize_dma_rcv_ctx(ohci->ar_req_context, 0);
+ initialize_dma_rcv_ctx(ohci->ar_resp_context, 0);
/* Initialize AT dma */
initialize_dma_trm_ctx(ohci->at_req_context);
initialize_dma_trm_ctx(ohci->at_resp_context);
/* Initialize IR dma */
- initialize_dma_rcv_ctx(ohci->ir_context);
+ initialize_dma_rcv_ctx(ohci->ir_context, 1);
/* Initialize IT dma */
initialize_dma_trm_ctx(ohci->it_context);
@@ -604,7 +639,6 @@
/* Enable interrupts */
reg_write(ohci, OHCI1394_IntMaskSet,
OHCI1394_masterIntEnable |
- OHCI1394_phyRegRcvd |
OHCI1394_busReset |
OHCI1394_selfIDComplete |
OHCI1394_RSPkt |
@@ -674,9 +708,9 @@
} else
d->prg_cpu[idx]->begin.status = 0;
- if ( (packet->type == async) || (packet->type == raw) ) {
+ if ( (packet->type == hpsb_async) || (packet->type == hpsb_raw) ) {
- if (packet->type == raw) {
+ if (packet->type == hpsb_raw) {
d->prg_cpu[idx]->data[0] = cpu_to_le32(OHCI1394_TCODE_PHY<<4);
d->prg_cpu[idx]->data[1] = packet->header[0];
d->prg_cpu[idx]->data[2] = packet->header[1];
@@ -689,14 +723,18 @@
d->prg_cpu[idx]->data[2] = packet->header[2];
d->prg_cpu[idx]->data[3] = packet->header[3];
packet_swab(d->prg_cpu[idx]->data, packet->tcode,
- packet->header_size>>2, ohci->payload_swap);
+ packet->header_size>>2);
}
if (packet->data_size) { /* block transmit */
d->prg_cpu[idx]->begin.control =
- cpu_to_le32(OUTPUT_MORE_IMMEDIATE | 0x10);
+ cpu_to_le32(DMA_CTL_OUTPUT_MORE |
+ DMA_CTL_IMMEDIATE | 0x10);
d->prg_cpu[idx]->end.control =
- cpu_to_le32(OUTPUT_LAST | packet->data_size);
+ cpu_to_le32(DMA_CTL_OUTPUT_LAST |
+ DMA_CTL_IRQ |
+ DMA_CTL_BRANCH |
+ packet->data_size);
/*
* Check that the packet data buffer
* does not cross a page boundary.
@@ -716,9 +754,6 @@
PCI_DMA_TODEVICE));
OHCI_DMA_ALLOC("single, block transmit packet");
- if (ohci->payload_swap)
- block_swab32(packet->data, packet->data_size >> 2);
-
d->prg_cpu[idx]->end.branchAddress = 0;
d->prg_cpu[idx]->end.status = 0;
if (d->branchAddrPtr)
@@ -727,14 +762,20 @@
d->branchAddrPtr =
&(d->prg_cpu[idx]->end.branchAddress);
} else { /* quadlet transmit */
- if (packet->type == raw)
- d->prg_cpu[idx]->begin.control = cpu_to_le32(
- OUTPUT_LAST_IMMEDIATE |
- (packet->header_size+4));
+ if (packet->type == hpsb_raw)
+ d->prg_cpu[idx]->begin.control =
+ cpu_to_le32(DMA_CTL_OUTPUT_LAST |
+ DMA_CTL_IMMEDIATE |
+ DMA_CTL_IRQ |
+ DMA_CTL_BRANCH |
+ (packet->header_size + 4));
else
- d->prg_cpu[idx]->begin.control = cpu_to_le32(
- OUTPUT_LAST_IMMEDIATE |
- packet->header_size);
+ d->prg_cpu[idx]->begin.control =
+ cpu_to_le32(DMA_CTL_OUTPUT_LAST |
+ DMA_CTL_IMMEDIATE |
+ DMA_CTL_IRQ |
+ DMA_CTL_BRANCH |
+ packet->header_size);
if (d->branchAddrPtr)
*(d->branchAddrPtr) =
@@ -747,20 +788,22 @@
d->prg_cpu[idx]->data[0] = packet->speed_code<<16 |
(packet->header[0] & 0xFFFF);
d->prg_cpu[idx]->data[1] = packet->header[0] & 0xFFFF0000;
- packet_swab(d->prg_cpu[idx]->data, packet->tcode, packet->header_size>>2,
- ohci->payload_swap);
+ packet_swab(d->prg_cpu[idx]->data, packet->tcode, packet->header_size>>2);
- d->prg_cpu[idx]->begin.control = cpu_to_le32(OUTPUT_MORE_IMMEDIATE | 0x8);
- d->prg_cpu[idx]->end.control = cpu_to_le32(
- OUTPUT_LAST | 0x08000000 | packet->data_size);
+ d->prg_cpu[idx]->begin.control =
+ cpu_to_le32(DMA_CTL_OUTPUT_MORE |
+ DMA_CTL_IMMEDIATE | 0x8);
+ d->prg_cpu[idx]->end.control =
+ cpu_to_le32(DMA_CTL_OUTPUT_LAST |
+ DMA_CTL_UPDATE |
+ DMA_CTL_IRQ |
+ DMA_CTL_BRANCH |
+ packet->data_size);
d->prg_cpu[idx]->end.address = cpu_to_le32(
pci_map_single(ohci->dev, packet->data,
packet->data_size, PCI_DMA_TODEVICE));
OHCI_DMA_ALLOC("single, iso transmit packet");
- if (ohci->payload_swap)
- block_swab32(packet->data, packet->data_size>>2);
-
d->prg_cpu[idx]->end.branchAddress = 0;
d->prg_cpu[idx]->end.status = 0;
DBGMSG(ohci->id, "Iso xmit context info: header[%08x %08x]\n"
@@ -947,7 +990,7 @@
if (arg<0 || arg>63) {
PRINT(KERN_ERR, ohci->id, __FUNCTION__
- "IS0 listne channel %d is out of range",
+ "IS0 listen channel %d is out of range",
arg);
return -EFAULT;
}
@@ -1083,13 +1126,16 @@
int phyid = -1, isroot = 0;
unsigned long flags;
- /* Read the interrupt event register. We don't clear the bus reset
- * here. We wait till we get a selfid complete interrupt and clear
- * it then, and _only_ then. */
+ /* Read and clear the interrupt event register. Don't clear
+ * the busReset event, though, this is done when we get the
+ * selfIDComplete interrupt. */
spin_lock_irqsave(&ohci->event_lock, flags);
event = reg_read(ohci, OHCI1394_IntEventClear);
- reg_write(ohci, OHCI1394_IntEventClear,
- event & ~(OHCI1394_selfIDComplete | OHCI1394_busReset));
+#ifdef BUSRESET_WORKAROUND
+ reg_write(ohci, OHCI1394_IntEventClear, event);
+#else
+ reg_write(ohci, OHCI1394_IntEventClear, event & ~OHCI1394_busReset);
+#endif
spin_unlock_irqrestore(&ohci->event_lock, flags);
if (!event) return;
@@ -1103,24 +1149,26 @@
return;
}
- /* Someone wants a bus reset. Better watch what you wish for... */
if (event & OHCI1394_busReset) {
+ /* The busReset event bit can't be cleared during the
+ * selfID phase, so we disable busReset interrupts, to
+ * avoid burying the cpu in interrupt requests. */
+ spin_lock_irqsave(&ohci->event_lock, flags);
+#ifdef BUSRESET_WORKAROUND
+ reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset);
+#else
+ reg_write(ohci, OHCI1394_IntMaskClear, OHCI1394_busReset);
+#endif
+ spin_unlock_irqrestore(&ohci->event_lock, flags);
if (!host->in_bus_reset) {
DBGMSG(ohci->id, "irq_handler: Bus reset requested%s",
((host->attempt_root || attempt_root) ?
" and attempting to become root" : ""));
-
- /* Wait for the AT fifo to be flushed */
- dma_trm_reset(ohci->at_req_context);
- dma_trm_reset(ohci->at_resp_context);
/* Subsystem call */
hpsb_bus_reset(ohci->host);
-
- ohci->NumBusResets++;
}
- /* Mask out everything except selfid */
- event &= OHCI1394_selfIDComplete;
+ event &= ~OHCI1394_busReset;
}
/* XXX: We need a way to also queue the OHCI1394_reqTxComplete,
@@ -1234,11 +1282,12 @@
handle_selfid(ohci, host,
phyid, isroot);
- } else
+ } else {
PRINT(KERN_ERR, ohci->id,
"SelfID interrupt received, but "
"NodeID is not valid: %08X",
node_id);
+ }
/* Accept Physical requests from all nodes. */
reg_write(ohci,OHCI1394_AsReqFilterHiSet,
@@ -1258,21 +1307,15 @@
PRINT(KERN_ERR, ohci->id,
"SelfID received outside of bus reset sequence");
- /* Clear everything, it's a new day */
+ /* Finally, we clear the busReset event and reenable
+ * the busReset interrupt. */
+#ifndef BUSRESET_WORKAROUND
spin_lock_irqsave(&ohci->event_lock, flags);
- reg_write(ohci, OHCI1394_IntEventClear, 0xffffffff);
+ reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset);
+ reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset);
spin_unlock_irqrestore(&ohci->event_lock, flags);
-
- event &= ~OHCI1394_selfIDComplete;
- }
- if (event & OHCI1394_phyRegRcvd) {
- if (host->in_bus_reset) {
- DBGMSG (ohci->id, "PhyControl: %08X",
- reg_read(ohci, OHCI1394_PhyControl));
- } else
- PRINT(KERN_ERR, ohci->id,
- "Physical register received outside of bus reset sequence");
- event &= ~OHCI1394_phyRegRcvd;
+#endif
+ event &= ~OHCI1394_selfIDComplete;
}
/* Make sure we handle everything, just in case we accidentally
@@ -1365,14 +1408,14 @@
dma_cache_wback_inv(buf_ptr, bytes_left);
while (bytes_left > 0) {
- tcode = (cond_le32_to_cpu(buf_ptr[0], ohci->payload_swap) >> 4) & 0xf;
+ tcode = (cond_le32_to_cpu(buf_ptr[0], ohci->no_swap_incoming) >> 4) & 0xf;
/* packet_length() will return < 4 for an error */
- length = packet_length(d, idx, buf_ptr, offset, tcode, ohci->payload_swap);
+ length = packet_length(d, idx, buf_ptr, offset, tcode, ohci->no_swap_incoming);
if (length < 4) { /* something is wrong */
sprintf(msg,"Unexpected tcode 0x%x(0x%08x) in AR ctx=%d, length=%d",
- tcode, cond_le32_to_cpu(buf_ptr[0], ohci->payload_swap),
+ tcode, cond_le32_to_cpu(buf_ptr[0], ohci->no_swap_incoming),
d->ctx, length);
ohci1394_stop_context(ohci, d->ctrlClear, msg);
spin_unlock_irqrestore(&d->lock, flags);
@@ -1448,19 +1491,18 @@
/* We get one phy packet to the async descriptor for each
* bus reset. We always ignore it. */
if (tcode != OHCI1394_TCODE_PHY) {
- if (!ohci->payload_swap)
- packet_swab(d->spb, tcode, (length - 4) >> 2, 0);
-
+ if (!ohci->no_swap_incoming)
+ packet_swab(d->spb, tcode, (length - 4) >> 2);
DBGMSG(ohci->id, "Packet received from node"
" %d ack=0x%02X spd=%d tcode=0x%X"
" length=%d ctx=%d tlabel=%d",
(d->spb[1]>>16)&0x3f,
- (cond_le32_to_cpu(d->spb[length/4-1], ohci->payload_swap)>>16)&0x1f,
- (cond_le32_to_cpu(d->spb[length/4-1], ohci->payload_swap)>>21)&0x3,
+ (cond_le32_to_cpu(d->spb[length/4-1], ohci->no_swap_incoming)>>16)&0x1f,
+ (cond_le32_to_cpu(d->spb[length/4-1], ohci->no_swap_incoming)>>21)&0x3,
tcode, length, d->ctx,
- (cond_le32_to_cpu(d->spb[length/4-1], ohci->payload_swap)>>10)&0x3f);
+ (cond_le32_to_cpu(d->spb[length/4-1], ohci->no_swap_incoming)>>10)&0x3f);
- ack = (((cond_le32_to_cpu(d->spb[length/4-1], ohci->payload_swap)>>16)&0x1f)
+ ack = (((cond_le32_to_cpu(d->spb[length/4-1], ohci->no_swap_incoming)>>16)&0x1f)
== 0x11) ? 1 : 0;
hpsb_packet_received(ohci->host, d->spb,
@@ -1510,7 +1552,7 @@
while (d->fifo_first) {
packet = d->fifo_first;
datasize = d->fifo_first->data_size;
- if (datasize && packet->type != raw)
+ if (datasize && packet->type != hpsb_raw)
ack = le32_to_cpu(
d->prg_cpu[d->sent_ind]->end.status) >> 16;
else
@@ -2032,6 +2074,14 @@
hw_csr_reg: ohci_hw_csr_reg,
};
+
+#define FAIL(fmt, args...) \
+do { \
+ PRINT_G(KERN_ERR, fmt , ## args); \
+ remove_card(ohci); \
+ return 1; \
+} while(0)
+
static int __devinit ohci1394_add_one(struct pci_dev *dev, const struct pci_device_id *ent)
{
struct ti_ohci *ohci; /* shortcut to currently handled device */
@@ -2075,10 +2125,10 @@
* noByteSwapData registers to see if they were not cleared to
* zero. Should this work? Obviously it's not defined what these
* registers will read when they aren't supported. Bleh! */
- if (dev->vendor == PCI_VENDOR_ID_APPLE) {
- ohci->payload_swap = 1;
- if (dev->device != PCI_DEVICE_ID_APPLE_UNI_N_FW)
- ohci->selfid_swap = 1;
+ if (dev->vendor == PCI_VENDOR_ID_APPLE &&
+ dev->device == PCI_DEVICE_ID_APPLE_UNI_N_FW) {
+ ohci->no_swap_incoming = 1;
+ ohci->selfid_swap = 0;
} else
ohci->selfid_swap = 1;
#endif
@@ -2248,6 +2298,23 @@
release_mem_region (pci_resource_start(ohci->dev, 0),
pci_resource_len(ohci->dev, 0));
+#ifdef CONFIG_ALL_PPC
+ /* On UniNorth, power down the cable and turn off the
+ * chip clock when the module is removed to save power
+ * on laptops. Turning it back ON is done by the arch
+ * code when pci_enable_device() is called
+ */
+ {
+ struct device_node* of_node;
+
+ of_node = pci_device_to_OF_node(ohci->dev);
+ if (of_node) {
+ feature_set_firewire_power(of_node, 0);
+ feature_set_firewire_cable_power(of_node, 0);
+ }
+ }
+#endif /* CONFIG_ALL_PPC */
+
pci_set_drvdata(ohci->dev, NULL);
}
@@ -2292,68 +2359,6 @@
}
}
-#ifndef __LITTLE_ENDIAN
-
-/* Swap a series of quads inplace. */
-static __inline__ void block_swab32(quadlet_t *data, size_t size) {
- while (size--)
- data[size] = swab32(data[size]);
-}
-
-/* Swap headers and sometimes data too */
-static void packet_swab(quadlet_t *data, char tcode, int len, int payload_swap)
-{
- if (payload_swap) {
- block_swab32(data, len);
- return;
- }
-
- switch(tcode)
- {
- /* 4 quad header */
- case TCODE_READB_RESPONSE:
- case TCODE_LOCK_RESPONSE:
- case TCODE_LOCK_REQUEST:
- case TCODE_WRITEB:
- case TCODE_READB:
- block_swab32(data, 4);
- break;
-
- /* 3 quad header, 1 quad payload */
- case TCODE_WRITEQ:
- case TCODE_READQ_RESPONSE:
- block_swab32(data, 3);
- break;
-
- /* 3 quad header */
- case TCODE_WRITE_RESPONSE:
- case TCODE_READQ:
- block_swab32(data, 3);
- break;
-
- /* 2 quad header */
- case TCODE_ISO_DATA:
- block_swab32(data, 2);
- break;
-
- case OHCI1394_TCODE_PHY:
- break; /* should never happen anyway */
-
- case TCODE_CYCLE_START:
- PRINT_G(KERN_ERR, "Unhandled tcode in packet_swab (0x%x)", tcode);
- /* Atleast swap one quad */
- block_swab32(data, 1);
- break;
- default:
- PRINT_G(KERN_ERR, "Invalid tcode in packet_swab (0x%x)", tcode);
- break;
- }
- return;
-}
-
-#endif /* !LITTLE_ENDIAN */
-
-
#if 0
int ohci1394_request_channel(struct ti_ohci *ohci, int channel)
{
@@ -2402,6 +2407,7 @@
MODULE_AUTHOR("Sebastien Rougeaux ");
MODULE_DESCRIPTION("Driver for PCI OHCI IEEE-1394 controllers");
+MODULE_LICENSE("GPL");
static void __devexit ohci1394_remove_one(struct pci_dev *pdev)
{
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/ohci1394.h linux/drivers/ieee1394/ohci1394.h
--- v2.4.10/linux/drivers/ieee1394/ohci1394.h Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/ohci1394.h Mon Oct 1 21:24:24 2001
@@ -191,15 +191,14 @@
spinlock_t event_lock;
int self_id_errors;
- int NumBusResets;
/* video device */
struct video_template *video_tmpl;
/* Swap the selfid buffer? */
unsigned int selfid_swap:1;
- /* Swap the payload? */
- unsigned int payload_swap:1;
+ /* Some Apple chipset seem to swap incoming headers for us */
+ unsigned int no_swap_incoming:1;
};
static inline int cross_bound(unsigned long addr, unsigned int size)
@@ -332,14 +331,16 @@
#define OHCI1394_phyRegRcvd 0x04000000
#define OHCI1394_masterIntEnable 0x80000000
-#define OUTPUT_MORE 0x00000000
-#define OUTPUT_MORE_IMMEDIATE 0x02000000
-#define OUTPUT_LAST 0x103c0000
-#define OUTPUT_LAST_IMMEDIATE 0x123c0000
-
-#define DMA_SPEED_100 0x0
-#define DMA_SPEED_200 0x1
-#define DMA_SPEED_400 0x2
+/* DMA Control flags */
+#define DMA_CTL_OUTPUT_MORE 0x00000000
+#define DMA_CTL_OUTPUT_LAST 0x10000000
+#define DMA_CTL_INPUT_MORE 0x20000000
+#define DMA_CTL_INPUT_LAST 0x30000000
+#define DMA_CTL_UPDATE 0x08000000
+#define DMA_CTL_IMMEDIATE 0x02000000
+#define DMA_CTL_IRQ 0x00300000
+#define DMA_CTL_BRANCH 0x000c0000
+#define DMA_CTL_WAIT 0x00030000
#define OHCI1394_TCODE_PHY 0xE
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/pcilynx.c linux/drivers/ieee1394/pcilynx.c
--- v2.4.10/linux/drivers/ieee1394/pcilynx.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/pcilynx.c Mon Oct 1 21:24:24 2001
@@ -38,6 +38,7 @@
#include "ieee1394_types.h"
#include "hosts.h"
#include "ieee1394_core.h"
+#include "highlevel.h"
#include "pcilynx.h"
@@ -393,7 +394,7 @@
struct lynx_send_data *d;
struct hpsb_packet *packet;
- d = (what == iso ? &lynx->iso_send : &lynx->async);
+ d = (what == hpsb_iso ? &lynx->iso_send : &lynx->async);
packet = d->queue;
d->header_dma = pci_map_single(lynx->dev, packet->header,
@@ -419,13 +420,13 @@
pcl.buffer[1].pointer = d->data_dma;
switch (packet->type) {
- case async:
+ case hpsb_async:
pcl.buffer[0].control |= PCL_CMD_XMT;
break;
- case iso:
+ case hpsb_iso:
pcl.buffer[0].control |= PCL_CMD_XMT | PCL_ISOMODE;
break;
- case raw:
+ case hpsb_raw:
pcl.buffer[0].control |= PCL_CMD_UNFXMT;
break;
}
@@ -606,11 +607,11 @@
}
switch (packet->type) {
- case async:
- case raw:
+ case hpsb_async:
+ case hpsb_raw:
d = &lynx->async;
break;
- case iso:
+ case hpsb_iso:
d = &lynx->iso_send;
break;
default:
@@ -1227,7 +1228,7 @@
}
if (lynx->async.queue != NULL) {
- send_next(lynx, async);
+ send_next(lynx, hpsb_async);
}
spin_unlock(&lynx->async.queue_lock);
@@ -1259,7 +1260,7 @@
}
if (lynx->iso_send.queue != NULL) {
- send_next(lynx, iso);
+ send_next(lynx, hpsb_iso);
}
spin_unlock(&lynx->iso_send.queue_lock);
@@ -1368,7 +1369,7 @@
FAIL("failed to allocate host structure");
lynx->state = have_host_struct;
-
+ lynx->host->hostdata = lynx;
lynx->id = num_of_cards-1;
lynx->dev = dev;
lynx->host->pdev = dev;
@@ -1501,6 +1502,9 @@
PRINT(KERN_INFO, lynx->id, "found old 1394 PHY");
}
+ /* Tell the highlevel this host is ready */
+ highlevel_add_one_host (lynx->host);
+
return 0;
#undef FAIL
}
@@ -1627,13 +1631,14 @@
MODULE_AUTHOR("Andreas E. Bombe ");
MODULE_DESCRIPTION("driver for Texas Instruments PCI Lynx IEEE-1394 controller");
+MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("pcilynx");
MODULE_DEVICE_TABLE(pci, pci_table);
static void __exit pcilynx_cleanup(void)
{
- pci_unregister_driver(&lynx_pcidriver);
hpsb_unregister_lowlevel(&lynx_template);
+ pci_unregister_driver(&lynx_pcidriver);
PRINT_G(KERN_INFO, "removed " PCILYNX_DRIVER_NAME " module");
}
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/raw1394.c linux/drivers/ieee1394/raw1394.c
--- v2.4.10/linux/drivers/ieee1394/raw1394.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/raw1394.c Mon Oct 1 21:24:24 2001
@@ -290,8 +290,11 @@
}
spin_unlock_irqrestore(&host_info_lock, flags);
- list_for_each(lh, &reqs) {
+ lh = reqs.next;
+ while (lh != &reqs) {
req = list_entry(lh, struct pending_request, list);
+ lh = lh->next;
+
queue_complete_req(req);
}
}
@@ -356,8 +359,11 @@
}
spin_unlock_irqrestore(&host_info_lock, flags);
- list_for_each(lh, &reqs) {
+ lh = reqs.next;
+ while (lh != &reqs) {
req = list_entry(lh, struct pending_request, list);
+ lh = lh->next;
+
queue_complete_req(req);
}
}
@@ -746,6 +752,8 @@
list_add_tail(&req->list, &fi->req_pending);
spin_unlock_irq(&fi->reqlists_lock);
+ packet->generation = req->req.generation;
+
if (!hpsb_send_packet(packet)) {
req->req.error = RAW1394_ERROR_SEND_ERROR;
req->req.length = 0;
@@ -766,7 +774,7 @@
fill_iso_packet(packet, req->req.length, channel & 0x3f,
(req->req.misc >> 16) & 0x3, req->req.misc & 0xf);
- packet->type = iso;
+ packet->type = hpsb_iso;
packet->speed_code = req->req.address & 0x3;
packet->host = fi->host;
@@ -787,6 +795,9 @@
list_add_tail(&req->list, &fi->req_pending);
spin_unlock_irq(&fi->reqlists_lock);
+ /* Update the generation of the packet just before sending. */
+ packet->generation = get_hpsb_generation(fi->host);
+
if (!hpsb_send_packet(packet)) {
req->req.error = RAW1394_ERROR_SEND_ERROR;
queue_complete_req(req);
@@ -1031,3 +1042,4 @@
module_init(init_raw1394);
module_exit(cleanup_raw1394);
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/sbp2.c linux/drivers/ieee1394/sbp2.c
--- v2.4.10/linux/drivers/ieee1394/sbp2.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/sbp2.c Mon Oct 1 21:24:25 2001
@@ -122,26 +122,14 @@
* are some stress issues under investigation with deserialized I/O. To enable
* deserialized I/O for testing, do "insmod sbp2 serialize_io=0"
*
- * - Hot-Plugging: Need to add procfs support and integration with linux
- * hot-plug support (http://linux-hotplug.sourceforge.net) for auto-mounting
- * of drives.
- *
* - Error Handling: SCSI aborts and bus reset requests are handled somewhat
* but the code needs additional debugging.
*
- * - IEEE-1394 Bus Management: There is currently little bus management
- * in the core IEEE-1394 stack. Because of this, the SBP-2 driver handles
- * detection of SBP-2 devices itself. This should be moved to the core
- * stack.
- *
* - The SBP-2 driver is currently only supported as a module. It would not take
* much work to allow it to be compiled into the kernel, but you'd have to
* add some init code to the kernel to support this... and modules are much
* more flexible anyway. ;-)
*
- * - Workaround for PPC pismo firewire chipset (enable SBP2_PPC_PISMO_WORKAROUND
- * define below).
- *
*
* History:
*
@@ -222,8 +210,18 @@
*
*/
+
+
/*
* Includes
*/
@@ -264,50 +262,26 @@
#include "sbp2.h"
/*
- * PPC firewire Pismo chipset workaround!!!
- *
- * This is a workaround for a bug in the firewire pismo chipset. For some odd reason the status
- * fifo address hi/lo must be byteswapped and the response address byteswapped, but no other
- * parts of the structure. Apple's drivers seem to specifically check for the pismo and do
- * the same workaround for sbp2. (Daniel Berlin)
- *
- * Please enable the following define if you're running on the PPC Pismo chipset.
- */
-
-#ifdef CONFIG_IEEE1394_SBP2_PISMO
-#define SBP2_NEED_LOGIN_DESCRIPTOR_WORKAROUND
-#endif
-
-/*
* Module load parameter definitions
*/
/*
- * Normally the sbp2 driver tries to catch the initial scsi bus scan to pick up any
- * attached sbp2 devices. Setting no_bus_scan to 1 tells the sbp2 driver not to catch
- * this initial scsi bus scan on module load. You can always either add or remove devices
- * later through the rescan-scsi-bus.sh script or scsi procfs.
- */
-MODULE_PARM(no_bus_scan,"i");
-MODULE_PARM_DESC(no_bus_scan, "Skip the initial scsi bus scan during module load");
-static int no_bus_scan = 0;
-
-/*
- * Set mode_sense_hack to 1 if you have some sort of unusual sbp2 device, like a 1394 memory
- * stick reader, compact flash reader, or MO drive that does not support mode sense. Allows
- * you to mount the media rw instead of ro.
+ * Set mode_sense_hack to 1 if you have some sort of unusual sbp2 device,
+ * like a 1394 memory stick reader, compact flash reader, or MO drive that
+ * does not support mode sense. Allows you to mount the media rw instead
+ * of ro.
*/
MODULE_PARM(mode_sense_hack,"i");
MODULE_PARM_DESC(mode_sense_hack, "Emulate mode sense for devices like 1394 memory stick readers");
static int mode_sense_hack = 0;
/*
- * Change max_speed on module load if you have a bad IEEE-1394 controller that has trouble running
- * 2KB packets at 400mb.
+ * Change max_speed on module load if you have a bad IEEE-1394 controller
+ * that has trouble running 2KB packets at 400mb.
*
- * NOTE: On certain OHCI parts I have seen short packets on async transmit (probably
- * due to PCI latency/throughput issues with the part). You can bump down the speed if
- * you are running into problems.
+ * NOTE: On certain OHCI parts I have seen short packets on async transmit
+ * (probably due to PCI latency/throughput issues with the part). You can
+ * bump down the speed if you are running into problems.
*
* Valid values:
* max_speed = 2 (default: max speed 400mb)
@@ -319,30 +293,37 @@
static int max_speed = SPEED_400;
/*
- * Set serialize_io to 1 if you'd like only one scsi command sent down to us at a time (debugging).
+ * Set serialize_io to 1 if you'd like only one scsi command sent down to
+ * us at a time (debugging).
*/
MODULE_PARM(serialize_io,"i");
MODULE_PARM_DESC(serialize_io, "Serialize all I/O coming down from the scsi drivers (debugging)");
static int serialize_io = 1; /* serialize I/O until stress issues are resolved */
/*
- * Set no_large_packets to 1 if you'd like to limit the size of requests sent down to us (normally
- * the sbp2 driver will break up any requests to any individual devices with 128KB transfer size limits).
- * Sets max s/g list elements to 0x1f in size and disables s/g clustering.
+ * Set no_large_packets to 1 if you'd like to limit the size of requests
+ * sent down to us (normally the sbp2 driver will break up any requests to
+ * any individual devices with 128KB transfer size limits). Sets max s/g
+ * list elements to 0x1f in size and disables s/g clustering.
*/
MODULE_PARM(no_large_packets,"i");
MODULE_PARM_DESC(no_large_packets, "Do not allow large transfers from scsi drivers (debugging)");
static int no_large_packets = 0;
/*
- * Export information about protocols/devices supported by this driver
+ * Export information about protocols/devices supported by this driver.
*/
static struct ieee1394_device_id sbp2_id_table[] = {
- IEEE1394_PROTOCOL(SBP2_UNIT_SPEC_ID_ENTRY, SBP2_SW_VERSION_ENTRY),
+ {
+ match_flags: IEEE1394_MATCH_SPECIFIER_ID |
+ IEEE1394_MATCH_VERSION,
+ specifier_id: SBP2_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ version: SBP2_SW_VERSION_ENTRY & 0xffffff
+ },
{ }
};
-MODULE_DEVICE_TABLE(ieee1394, sbp2_id_table);
+MODULE_DEVICE_TABLE(ieee1394, sbp2_id_table);
/*
* Debug levels, configured via kernel config.
@@ -372,6 +353,7 @@
#define SBP2_DMA_FREE(fmt, args...)
#endif
+
#if CONFIG_IEEE1394_SBP2_DEBUG >= 2
#define SBP2_DEBUG(fmt, args...) HPSB_ERR(fmt, ## args)
#define SBP2_INFO(fmt, args...) HPSB_ERR(fmt, ## args)
@@ -392,12 +374,14 @@
#define SBP2_ERR(fmt, args...) HPSB_ERR(fmt, ## args)
/*
- * Spinlock debugging stuff. I'm playing it safe until the driver has been debugged on SMP. (JSG)
+ * Spinlock debugging stuff. I'm playing it safe until the driver has been
+ * debugged on SMP. (JSG)
*/
/* #define SBP2_USE_REAL_SPINLOCKS */
#ifdef SBP2_USE_REAL_SPINLOCKS
#define sbp2_spin_lock(lock, flags) spin_lock_irqsave(lock, flags)
#define sbp2_spin_unlock(lock, flags) spin_unlock_irqrestore(lock, flags);
+static spinlock_t sbp2_host_info_lock = SPIN_LOCK_UNLOCKED;
#else
#define sbp2_spin_lock(lock, flags) do {save_flags(flags); cli();} while (0)
#define sbp2_spin_unlock(lock, flags) do {restore_flags(flags);} while (0)
@@ -411,28 +395,27 @@
static LIST_HEAD(sbp2_host_info_list);
static int sbp2_host_count = 0;
-static spinlock_t sbp2_host_info_lock = SPIN_LOCK_UNLOCKED;
static struct hpsb_highlevel *sbp2_hl_handle = NULL;
static struct hpsb_highlevel_ops sbp2_hl_ops = {
- sbp2_add_host,
- sbp2_remove_host,
- sbp2_host_reset,
- NULL,
- NULL
+ add_host: sbp2_add_host,
+ remove_host: sbp2_remove_host,
};
static struct hpsb_address_ops sbp2_ops = {
- write: sbp2_handle_status_write,
+ write: sbp2_handle_status_write
};
-#if 0
-static struct hpsb_address_ops sbp2_physdma_ops = {
- read: sbp2_handle_physdma_read,
- write: sbp2_handle_physdma_write,
+static struct hpsb_protocol_driver sbp2_driver = {
+ name: "SBP2 Driver",
+ id_table: sbp2_id_table,
+ probe: sbp2_probe,
+ disconnect: sbp2_disconnect,
+ update: sbp2_update
};
-#endif
+
+
/**************************************
* General utility functions
@@ -472,108 +455,29 @@
#endif
/*
- * This function does quadlet sized reads (used by detection code)
- */
-static int sbp2util_read_quadlet(struct sbp2scsi_host_info *hi, nodeid_t node, u64 addr,
- quadlet_t *buffer)
-{
- int retval = 0;
- int retry_count = 3;
-
- /*
- * Retry a couple times if needed (for slow devices)
- */
- do {
-
- retval = hpsb_read(hi->host, node, addr, buffer, 4);
-
- if (retval) {
- SBP2_DEBUG("sbp2: sbp2util_read_quadlet data packet error");
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(HZ/50); /* 20ms delay */
- }
-
- retry_count--;
-
- } while (retval && retry_count);
-
- return(retval);
-}
-
-/*
- * This function returns the address of the unit directory.
- */
-static int sbp2util_unit_directory(struct sbp2scsi_host_info *hi, nodeid_t node_id, u64 *unit_directory_addr)
-{
- quadlet_t root_directory_length, current_quadlet;
- u64 current_addr;
- int length, i;
-
- /*
- * First, read the first quadlet of the root directory to determine its size
- */
- if (sbp2util_read_quadlet(hi, LOCAL_BUS | node_id, CONFIG_ROM_ROOT_DIR_BASE,
- &root_directory_length)) {
- SBP2_DEBUG("sbp2: Error reading root directory length - bad status");
- return(-EIO);
- }
-
- current_addr = CONFIG_ROM_ROOT_DIR_BASE;
- length = be32_to_cpu(root_directory_length) >> 16;
-
- /*
- * Step through the root directory and look for the "Unit_Directory entry", which
- * contains the offset to the unit directory.
- */
- for (i=0; i < length; i++) {
-
- current_addr += 4;
-
- if (sbp2util_read_quadlet(hi, LOCAL_BUS | node_id, current_addr, ¤t_quadlet)) {
- SBP2_DEBUG("sbp2: Error reading at address 0x%08x%08x - bad status",
- (unsigned int) ((current_addr) >> 32), (unsigned int) ((current_addr) & 0xffffffff));
- return(-EIO);
- }
-
- /*
- * Check for unit directory offset tag
- */
- if ((be32_to_cpu(current_quadlet) >> 24) == SBP2_UNIT_DIRECTORY_OFFSET_KEY) {
- *unit_directory_addr = current_addr + 4 * ((be32_to_cpu(current_quadlet) & 0xffffff));
- SBP2_DEBUG("sbp2: unit_directory_addr = %lu", *unit_directory_addr);
- }
- }
-
- return(0);
-}
-
-/*
- * This function is called to initially create a packet pool for use in sbp2 I/O requests.
- * This packet pool is used when sending out sbp2 command and agent reset requests, and
- * allows us to remove all kmallocs/kfrees from the critical I/O paths.
+ * This function is called to initially create a packet pool for use in
+ * sbp2 I/O requests. This packet pool is used when sending out sbp2
+ * command and agent reset requests, and allows us to remove all
+ * kmallocs/kfrees from the critical I/O paths.
*/
static int sbp2util_create_request_packet_pool(struct sbp2scsi_host_info *hi)
{
struct hpsb_packet *packet;
int i;
- unsigned long flags;
- /*
- * Create SBP2_MAX_REQUEST_PACKETS number of request packets.
- */
- sbp2_spin_lock(&hi->sbp2_request_packet_lock, flags);
+ /* Create SBP2_MAX_REQUEST_PACKETS number of request packets. */
for (i=0; isbp2_request_packet_lock, flags);
return(-ENOMEM);
}
@@ -585,13 +489,13 @@
list_add_tail(&hi->request_packet[i].list, &hi->sbp2_req_free);
}
- sbp2_spin_unlock(&hi->sbp2_request_packet_lock, flags);
return(0);
}
/*
- * This function is called to remove the packet pool. It is called when the sbp2 driver is unloaded.
+ * This function is called to remove the packet pool. It is called when
+ * the sbp2 driver is unloaded.
*/
static void sbp2util_remove_request_packet_pool(struct sbp2scsi_host_info *hi)
{
@@ -624,15 +528,17 @@
}
/*
- * This function is called to retrieve a block write packet from our packet pool. This function is
- * used in place of calling alloc_hpsb_packet (which costs us three kmallocs). Instead we
- * just pull out a free request packet and re-initialize values in it. I'm sure this can still
- * stand some more optimization.
- */
-static struct sbp2_request_packet *sbp2util_allocate_write_request_packet(struct sbp2scsi_host_info *hi,
- nodeid_t node, u64 addr,
- size_t data_size,
- quadlet_t data) {
+ * This function is called to retrieve a block write packet from our
+ * packet pool. This function is used in place of calling
+ * alloc_hpsb_packet (which costs us three kmallocs). Instead we just pull
+ * out a free request packet and re-initialize values in it. I'm sure this
+ * can still stand some more optimization.
+ */
+static struct sbp2_request_packet *
+sbp2util_allocate_write_request_packet(struct sbp2scsi_host_info *hi,
+ nodeid_t node, u64 addr,
+ size_t data_size,
+ quadlet_t data) {
struct list_head *lh;
struct sbp2_request_packet *request_packet = NULL;
struct hpsb_packet *packet;
@@ -651,13 +557,14 @@
packet = request_packet->packet;
/*
- * Initialize the packet (this is really initialization the core 1394 stack should do,
- * but I'm doing it myself to avoid the overhead).
+ * Initialize the packet (this is really initialization
+ * the core 1394 stack should do, but I'm doing it myself
+ * to avoid the overhead).
*/
packet->data_size = data_size;
INIT_LIST_HEAD(&packet->list);
sema_init(&packet->state_change, 0);
- packet->state = unused;
+ packet->state = hpsb_unused;
packet->generation = get_hpsb_generation(hi->host);
packet->data_be = 1;
@@ -672,8 +579,8 @@
}
/*
- * Set up a task queue completion routine, which returns the packet to the free list
- * and releases the tlabel
+ * Set up a task queue completion routine, which returns
+ * the packet to the free list and releases the tlabel.
*/
request_packet->tq.routine = (void (*)(void*))sbp2util_free_request_packet;
request_packet->tq.data = request_packet;
@@ -681,7 +588,7 @@
queue_task(&request_packet->tq, &packet->complete_tq);
/*
- * Now, put the packet on the in-use list
+ * Now, put the packet on the in-use list.
*/
list_add_tail(&request_packet->list, &hi->sbp2_req_inuse);
@@ -694,8 +601,8 @@
}
/*
- * This function is called to return a packet to our packet pool. It is also called as a
- * completion routine when a request packet is completed.
+ * This function is called to return a packet to our packet pool. It is
+ * also called as a completion routine when a request packet is completed.
*/
static void sbp2util_free_request_packet(struct sbp2_request_packet *request_packet)
{
@@ -703,7 +610,7 @@
struct sbp2scsi_host_info *hi = request_packet->hi_context;
/*
- * Free the tlabel, and return the packet to the free pool
+ * Free the tlabel, and return the packet to the free pool.
*/
sbp2_spin_lock(&hi->sbp2_request_packet_lock, flags);
free_tlabel(hi->host, LOCAL_BUS | request_packet->packet->node_id,
@@ -716,8 +623,8 @@
}
/*
- * This function is called to create a pool of command orbs used for command processing. It is called
- * when a new sbp2 device is detected.
+ * This function is called to create a pool of command orbs used for
+ * command processing. It is called when a new sbp2 device is detected.
*/
static int sbp2util_create_command_orb_pool(struct scsi_id_instance_data *scsi_id,
struct sbp2scsi_host_info *hi)
@@ -785,10 +692,11 @@
}
/*
- * This functions finds the sbp2_command for a given outstanding
- * command orb. Only looks at the inuse list.
+ * This functions finds the sbp2_command for a given outstanding command
+ * orb. Only looks at the inuse list.
*/
-static struct sbp2_command_info *sbp2util_find_command_for_orb(struct scsi_id_instance_data *scsi_id, dma_addr_t orb)
+static struct sbp2_command_info *sbp2util_find_command_for_orb(
+ struct scsi_id_instance_data *scsi_id, dma_addr_t orb)
{
struct list_head *lh;
struct sbp2_command_info *command;
@@ -812,7 +720,8 @@
}
/*
- * This functions finds the sbp2_command for a given outstanding SCpnt. Only looks at the inuse list
+ * This functions finds the sbp2_command for a given outstanding SCpnt.
+ * Only looks at the inuse list.
*/
static struct sbp2_command_info *sbp2util_find_command_for_SCpnt(struct scsi_id_instance_data *scsi_id, void *SCpnt)
{
@@ -837,10 +746,11 @@
/*
* This function allocates a command orb used to send a scsi command.
*/
-static struct sbp2_command_info *sbp2util_allocate_command_orb(struct scsi_id_instance_data *scsi_id,
- Scsi_Cmnd *Current_SCpnt,
- void (*Current_done)(Scsi_Cmnd *),
- struct sbp2scsi_host_info *hi)
+static struct sbp2_command_info *sbp2util_allocate_command_orb(
+ struct scsi_id_instance_data *scsi_id,
+ Scsi_Cmnd *Current_SCpnt,
+ void (*Current_done)(Scsi_Cmnd *),
+ struct sbp2scsi_host_info *hi)
{
struct list_head *lh;
struct sbp2_command_info *command = NULL;
@@ -903,13 +813,15 @@
sbp2_spin_unlock(&scsi_id->sbp2_command_orb_lock, flags);
}
+
+
/*********************************************
* IEEE-1394 core driver stack related section
*********************************************/
/*
- * This function is called at SCSI init in order to register our driver with the
- * IEEE-1394 stack
+ * This function is called at SCSI init in order to register our driver
+ * with the IEEE-1394 stack.
*/
int sbp2_init(void)
{
@@ -931,26 +843,21 @@
hpsb_register_addrspace(sbp2_hl_handle, &sbp2_ops, SBP2_STATUS_FIFO_ADDRESS,
SBP2_STATUS_FIFO_ADDRESS + sizeof(struct sbp2_status_block));
- /*
- * Register physical dma address space... used for
- * adapters not supporting hardware phys dma.
- *
- * XXX: Disabled for now.
- */
- /* hpsb_register_addrspace(sbp2_hl_handle, &sbp2_physdma_ops,
- 0x0ULL, 0xfffffffcULL); */
+ hpsb_register_protocol(&sbp2_driver);
- return(0);
+ return 0;
}
/*
- * This function is called from cleanup module, or during shut-down, in order to
- * unregister our driver
+ * This function is called from cleanup module, or during shut-down, in
+ * order to unregister our driver.
*/
void sbp2_cleanup(void)
{
SBP2_DEBUG("sbp2: sbp2_cleanup");
+ hpsb_unregister_protocol(&sbp2_driver);
+
if (sbp2_hl_handle) {
hpsb_unregister_highlevel(sbp2_hl_handle);
sbp2_hl_handle = NULL;
@@ -958,73 +865,121 @@
return;
}
-/*
- * This function is called after registering our operations in sbp2_init. We go ahead and
- * allocate some memory for our host info structure, and init some structures.
- */
-static void sbp2_add_host(struct hpsb_host *host)
+static int sbp2_probe(struct unit_directory *ud)
{
struct sbp2scsi_host_info *hi;
- unsigned long flags;
- SBP2_DEBUG("sbp2: sbp2_add_host");
+ SBP2_DEBUG("sbp2: sbp2_probe");
+ hi = sbp2_find_host_info(ud->ne->host);
- /*
- * Allocate some memory for our host info structure
- */
- hi = (struct sbp2scsi_host_info *)kmalloc(sizeof(struct sbp2scsi_host_info), GFP_KERNEL);
+ return sbp2_start_device(hi, ud);
+}
- if (hi != NULL) {
+static void sbp2_disconnect(struct unit_directory *ud)
+{
+ struct sbp2scsi_host_info *hi;
+ struct scsi_id_instance_data *scsi_id = ud->driver_data;
- /*
- * Initialize some host stuff
- */
- memset(hi, 0, sizeof(struct sbp2scsi_host_info));
- INIT_LIST_HEAD(&hi->list);
- INIT_LIST_HEAD(&hi->sbp2_req_inuse);
- INIT_LIST_HEAD(&hi->sbp2_req_free);
- hi->host = host;
- hi->sbp2_command_lock = SPIN_LOCK_UNLOCKED;
- hi->sbp2_request_packet_lock = SPIN_LOCK_UNLOCKED;
+ SBP2_DEBUG("sbp2: sbp2_disconnect");
+ hi = sbp2_find_host_info(ud->ne->host);
- /*
- * Create our request packet pool (pool of packets for use in I/O)
+ if (hi != NULL)
+ sbp2_remove_device(hi, scsi_id);
+}
+
+static void sbp2_update(struct unit_directory *ud)
+{
+ struct sbp2scsi_host_info *hi;
+ struct scsi_id_instance_data *scsi_id = ud->driver_data;
+ unsigned long flags;
+
+ SBP2_DEBUG("sbp2: sbp2_update");
+ hi = sbp2_find_host_info(ud->ne->host);
+
+ if (sbp2_reconnect_device(hi, scsi_id)) {
+
+ /* Ok, reconnect has failed. Perhaps we didn't
+ * reconnect fast enough. Try doing a regular login.
*/
- if (sbp2util_create_request_packet_pool(hi)) {
- SBP2_ERR("sbp2: sbp2util_create_request_packet_pool failed!");
+ if (sbp2_login_device(hi, scsi_id)) {
+
+ /* Login failed too... so, just mark him as
+ * unvalidated, so that he gets cleaned up
+ * later.
+ */
+ SBP2_ERR("sbp2: sbp2_reconnect_device failed!");
+ sbp2_remove_device(hi, scsi_id);
return;
}
+ }
- sbp2_spin_lock(&sbp2_host_info_lock, flags);
- list_add_tail(&hi->list, &sbp2_host_info_list);
- sbp2_host_count++;
- sbp2_spin_unlock(&sbp2_host_info_lock, flags);
+ /* Set max retries to something large on the device. */
+ sbp2_set_busy_timeout(hi, scsi_id);
- /*
- * Initialize us to bus reset in progress
- */
- hi->bus_reset_in_progress = 1;
+ /* Do a SBP-2 fetch agent reset. */
+ sbp2_agent_reset(hi, scsi_id, 0);
+
+ /* Get the max speed and packet size that we can use. */
+ sbp2_max_speed_and_size(hi, scsi_id);
- /*
- * Register our host with the SCSI stack.
- */
- sbp2scsi_register_scsi_host(hi);
+ /* Complete any pending commands with busy (so they get
+ * retried) and remove them from our queue
+ */
+ sbp2_spin_lock(&hi->sbp2_command_lock, flags);
+ sbp2scsi_complete_all_commands(hi, scsi_id, DID_BUS_BUSY);
+ sbp2_spin_unlock(&hi->sbp2_command_lock, flags);
+}
- /*
- * Start our kernel thread to deal with sbp2 device detection
- */
- init_waitqueue_head(&hi->sbp2_detection_wait);
- hi->sbp2_detection_pid = 0;
- hi->sbp2_detection_pid = kernel_thread(sbp2_detection_thread, hi, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+/*
+ * This function is called after registering our operations in sbp2_init.
+ * We go ahead and allocate some memory for our host info structure, and
+ * init some structures.
+ */
+static void sbp2_add_host(struct hpsb_host *host)
+{
+ struct sbp2scsi_host_info *hi;
+ unsigned long flags;
+
+ SBP2_DEBUG("sbp2: sbp2_add_host");
+
+ /* Allocate some memory for our host info structure */
+ hi = (struct sbp2scsi_host_info *)kmalloc(sizeof(struct sbp2scsi_host_info),
+ GFP_KERNEL);
+ if (hi == NULL) {
+ SBP2_ERR("sbp2: out of memory in sbp2_add_host");
+ return;
+ }
+
+ /* Initialize some host stuff */
+ memset(hi, 0, sizeof(struct sbp2scsi_host_info));
+ INIT_LIST_HEAD(&hi->list);
+ INIT_LIST_HEAD(&hi->sbp2_req_inuse);
+ INIT_LIST_HEAD(&hi->sbp2_req_free);
+ hi->host = host;
+ hi->sbp2_command_lock = SPIN_LOCK_UNLOCKED;
+ hi->sbp2_request_packet_lock = SPIN_LOCK_UNLOCKED;
+
+ /* Create our request packet pool (pool of packets for use in I/O) */
+ if (sbp2util_create_request_packet_pool(hi)) {
+ SBP2_ERR("sbp2: sbp2util_create_request_packet_pool failed!");
+ return;
}
+ sbp2_spin_lock(&sbp2_host_info_lock, flags);
+ list_add_tail(&hi->list, &sbp2_host_info_list);
+ sbp2_host_count++;
+ sbp2_spin_unlock(&sbp2_host_info_lock, flags);
+
+ /* Register our host with the SCSI stack. */
+ sbp2scsi_register_scsi_host(hi);
+
return;
}
/*
- * This fuction returns a host info structure from the host structure,
- * in case we have multiple hosts
+ * This fuction returns a host info structure from the host structure, in
+ * case we have multiple hosts.
*/
static struct sbp2scsi_host_info *sbp2_find_host_info(struct hpsb_host *host)
{
@@ -1047,206 +1002,55 @@
static void sbp2_remove_host(struct hpsb_host *host)
{
struct sbp2scsi_host_info *hi;
- int i;
unsigned long flags;
+ int i;
SBP2_DEBUG("sbp2: sbp2_remove_host");
sbp2_spin_lock(&sbp2_host_info_lock, flags);
- hi = sbp2_find_host_info(host);
+ hi = sbp2_find_host_info(host);
if (hi != NULL) {
-
- /*
- * Need to remove any attached SBP-2 devices. Also make sure to logout of all devices.
+ /* Here's an annoying hack: we get a disconnect
+ * callback for each device, so this loop shouldn't be
+ * necessary. However, the sbp2 driver receives the
+ * remove_host callback before the nodemgr, so when we
+ * get the disconnect callback, we've already freed
+ * the host. Thus, we free the devices here...
*/
- for (i=0; iscsi_id[i]) {
+ for (i = 0; i < SBP2SCSI_MAX_SCSI_IDS; i++) {
+ if (hi->scsi_id[i] != NULL) {
sbp2_logout_device(hi, hi->scsi_id[i]);
- hi->scsi_id[i]->validated = 0;
+ sbp2_remove_device(hi, hi->scsi_id[i]);
}
}
-
- sbp2_remove_unvalidated_devices(hi);
-
- list_del(&hi->list);
+ sbp2util_remove_request_packet_pool(hi);
sbp2_host_count--;
+ list_del(&hi->list);
+ kfree(hi);
}
- sbp2_spin_unlock(&sbp2_host_info_lock, flags);
-
- if (hi == NULL) {
+ else
SBP2_ERR("sbp2: attempt to remove unknown host %p", host);
- return;
- }
-
- /*
- * Remove the packet pool (release the packets)
- */
- sbp2util_remove_request_packet_pool(hi);
-
- /*
- * Kill our detection thread
- */
- if (hi->sbp2_detection_pid >= 0) {
- kill_proc(hi->sbp2_detection_pid, SIGINT, 1);
- }
-
- /*
- * Give the detection thread a little time to exit
- */
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(HZ); /* 1 second delay */
-
- kfree(hi);
- hi = NULL;
-
- return;
-}
-/*
- * This is our sbp2 detection thread. It is signalled when bus resets occur
- * so that we can find and initialize any sbp2 devices.
- */
-static int sbp2_detection_thread(void *__hi)
-{
- struct sbp2scsi_host_info *hi = (struct sbp2scsi_host_info *)__hi;
-
- SBP2_DEBUG("sbp2: sbp2_detection_thread");
-
- lock_kernel();
-
- /*
- * This thread doesn't need any user-level access,
- * so get rid of all our resources
- */
-#if LINUX_VERSION_CODE > 0x20300
- daemonize();
-#endif
-
- /*
- * Set-up a nice name
- */
- strcpy(current->comm, SBP2_DEVICE_NAME);
-
- unlock_kernel();
-
- while ((!signal_pending(current)) && hi) {
-
- /*
- * Process our bus reset now
- */
- if (hi) {
- MOD_INC_USE_COUNT;
- sbp2_bus_reset_handler(hi);
- MOD_DEC_USE_COUNT;
- }
-
- /*
- * Sleep until next bus reset
- */
- if (hi) {
- interruptible_sleep_on(&hi->sbp2_detection_wait);
- }
- }
-
- return(0);
+ sbp2_spin_unlock(&sbp2_host_info_lock, flags);
}
/*
- * This function is where we first pull the node unique ids, and then allocate memory and register
- * a SBP-2 device
+ * This function is where we first pull the node unique ids, and then
+ * allocate memory and register a SBP-2 device.
*/
-static int sbp2_start_device(struct sbp2scsi_host_info *hi, int node_id)
+static int sbp2_start_device(struct sbp2scsi_host_info *hi, struct unit_directory *ud)
{
- u64 node_unique_id;
struct scsi_id_instance_data *scsi_id = NULL;
struct node_entry *ne;
int i;
SBP2_DEBUG("sbp2: sbp2_start_device");
-
- /* XXX: This will go away once we start using the nodemgr's
- * feature subscription API. */
- ne = hpsb_nodeid_get_entry(node_id|(hi->host->node_id & BUS_MASK));
- if (!ne) {
- HPSB_ERR("sbp2: Could not find device node");
- return -ENXIO;
- }
-
- node_unique_id = ne->guid;
+ ne = ud->ne;
/*
- * First, we need to find out whether this is a "new" SBP-2 device plugged in, or one that already
- * exists and is initialized. We do this by looping through our scsi id instance data structures
- * looking for matching node unique ids.
- */
- for (i=0; iscsi_id[i]) {
-
- if (hi->scsi_id[i]->node_unique_id == node_unique_id) {
-
- /*
- * Update our node id
- */
- hi->scsi_id[i]->node_id = node_id;
-
- /*
- * Mark the device as validated, since it still exists on the bus
- */
- hi->scsi_id[i]->validated = 1;
- SBP2_DEBUG("sbp2: SBP-2 device re-validated, SCSI ID = %x", (unsigned int) i);
-
- /*
- * Reconnect to the sbp-2 device
- */
- if (sbp2_reconnect_device(hi, hi->scsi_id[i])) {
-
- /*
- * Ok, reconnect has failed. Perhaps we didn't reconnect fast enough. Try
- * doing a regular login.
- */
- if (sbp2_login_device(hi, hi->scsi_id[i])) {
-
- /*
- * Login failed too... so, just mark him as unvalidated, so that he gets cleaned up
- * later
- */
- SBP2_ERR("sbp2: sbp2_reconnect_device failed!");
- hi->scsi_id[i]->validated = 0;
- }
- }
-
- if (hi->scsi_id[i]->validated) {
-
- /*
- * Set max retries to something large on the device
- */
- sbp2_set_busy_timeout(hi, hi->scsi_id[i]);
-
- /*
- * Do a SBP-2 fetch agent reset
- */
- sbp2_agent_reset(hi, hi->scsi_id[i], 0);
-
- /*
- * Get the max speed and packet size that we can use
- */
- sbp2_max_speed_and_size(hi, hi->scsi_id[i]);
-
- }
-
- /*
- * Nothing more to do, since we found the device
- */
- return(0);
-
- }
- }
- }
-
- /*
- * This really is a "new" device plugged in. Let's allocate memory for our scsi id instance data
+ * This really is a "new" device plugged in. Let's allocate memory
+ * for our scsi id instance data.
*/
scsi_id = (struct scsi_id_instance_data *)kmalloc(sizeof(struct scsi_id_instance_data),
GFP_KERNEL);
@@ -1292,509 +1096,195 @@
SBP2_DMA_FREE("logout ORB DMA");
}
- if (scsi_id->reconnect_orb) {
- pci_free_consistent(hi->host->pdev,
- sizeof(struct sbp2_reconnect_orb),
- scsi_id->reconnect_orb,
- scsi_id->reconnect_orb_dma);
- SBP2_DMA_FREE("reconnect ORB DMA");
- }
-
- if (scsi_id->login_response) {
- pci_free_consistent(hi->host->pdev,
- sizeof(struct sbp2_login_response),
- scsi_id->login_response,
- scsi_id->login_response_dma);
- SBP2_DMA_FREE("login FIFO DMA");
- }
-
- kfree(scsi_id);
-alloc_fail_first:
- SBP2_ERR ("sbp2: Could not allocate memory for scsi_id");
- return(-ENOMEM);
- }
- SBP2_DMA_ALLOC("consistent DMA region for login ORB");
-
- /*
- * Initialize some of the fields in this structure
- */
- scsi_id->node_id = node_id;
- scsi_id->node_unique_id = node_unique_id;
- scsi_id->validated = 1;
- scsi_id->speed_code = SPEED_100;
- scsi_id->max_payload_size = MAX_PAYLOAD_S100;
-
- init_waitqueue_head(&scsi_id->sbp2_login_wait);
-
- /*
- * Initialize structures needed for the command orb pool.
- */
- INIT_LIST_HEAD(&scsi_id->sbp2_command_orb_inuse);
- INIT_LIST_HEAD(&scsi_id->sbp2_command_orb_completed);
- scsi_id->sbp2_command_orb_lock = SPIN_LOCK_UNLOCKED;
- scsi_id->sbp2_total_command_orbs = 0;
-
- /*
- * Make sure that we've gotten ahold of the sbp2 management agent address. Also figure out the
- * command set being used (SCSI or RBC).
- */
- if (sbp2_parse_unit_directory(hi, scsi_id)) {
- SBP2_ERR("sbp2: Error while parsing sbp2 unit directory");
- hi->scsi_id[i]->validated = 0;
- return(-EIO);
- }
-
- scsi_id->sbp2_total_command_orbs = SBP2_MAX_COMMAND_ORBS;
-
- /*
- * Knock the total command orbs down if we are serializing I/O
- */
- if (serialize_io) {
- scsi_id->sbp2_total_command_orbs = 2; /* one extra for good measure */
- }
-
- /*
- * Allocate some extra command orb structures for devices with 128KB limit
- */
- if (scsi_id->sbp2_firmware_revision == SBP2_128KB_BROKEN_FIRMWARE) {
- scsi_id->sbp2_total_command_orbs *= 4;
- }
-
- /*
- * Create our command orb pool
- */
- if (sbp2util_create_command_orb_pool(scsi_id, hi)) {
- SBP2_ERR("sbp2: sbp2util_create_command_orb_pool failed!");
- hi->scsi_id[i]->validated = 0;
- return (-ENOMEM);
- }
-
- /*
- * Find an empty spot to stick our scsi id instance data.
- */
- for (i=0; iscsi_id[i]) {
- hi->scsi_id[i] = scsi_id;
- SBP2_DEBUG("sbp2: New SBP-2 device inserted, SCSI ID = %x", (unsigned int) i);
- break;
- }
- }
-
- /*
- * Make sure we are not out of space
- */
- if (i >= SBP2SCSI_MAX_SCSI_IDS) {
- SBP2_ERR("sbp2: No slots left for SBP-2 device");
- hi->scsi_id[i]->validated = 0;
- return(-EBUSY);
- }
-
- /*
- * Login to the sbp-2 device
- */
- if (sbp2_login_device(hi, hi->scsi_id[i])) {
-
- /*
- * Login failed... so, just mark him as unvalidated, so that he gets cleaned up later
- */
- SBP2_ERR("sbp2: sbp2_login_device failed");
- hi->scsi_id[i]->validated = 0;
- }
-
- if (hi->scsi_id[i]->validated) {
-
- /*
- * Set max retries to something large on the device
- */
- sbp2_set_busy_timeout(hi, hi->scsi_id[i]);
-
- /*
- * Do a SBP-2 fetch agent reset
- */
- sbp2_agent_reset(hi, hi->scsi_id[i], 0);
-
- /*
- * Get the max speed and packet size that we can use
- */
- sbp2_max_speed_and_size(hi, hi->scsi_id[i]);
-
- }
-
- return(0);
-}
-
-/*
- * This function tries to determine if a device is a valid SBP-2 device
- */
-static int sbp2_check_device(struct sbp2scsi_host_info *hi, int node_id)
-{
- quadlet_t unit_spec_id_data = 0, unit_sw_ver_data = 0;
- quadlet_t unit_directory_length, current_quadlet;
- u64 unit_directory_addr, current_addr;
- unsigned int i, length;
-
- SBP2_DEBUG("sbp2: sbp2_check_device");
-
- /*
- * Let's try and read the unit spec id and unit sw ver to determine if this is an SBP2 device...
- */
-
- if (sbp2util_unit_directory(hi, LOCAL_BUS | node_id, &unit_directory_addr)) {
- SBP2_DEBUG("sbp2: Error reading unit directory address - bad status");
- return(-EIO);
- }
-
- /*
- * Read the size of the unit directory
- */
- if (sbp2util_read_quadlet(hi, LOCAL_BUS | node_id, unit_directory_addr,
- &unit_directory_length)) {
- SBP2_DEBUG("sbp2: Error reading root directory length - bad status");
- return(-EIO);
- }
-
- current_addr = unit_directory_addr;
- length = be32_to_cpu(unit_directory_length) >> 16;
-
- /*
- * Now, step through the unit directory and look for the unit_spec_ID and the unit_sw_version
- */
- for (i=0; i < length; i++) {
-
- current_addr += 4;
-
- if (sbp2util_read_quadlet(hi, LOCAL_BUS | node_id, current_addr, ¤t_quadlet)) {
- SBP2_DEBUG("sbp2: Error reading at address 0x%08x%08x - bad status",
- (unsigned int) ((current_addr) >> 32), (unsigned int) ((current_addr) & 0xffffffff));
- return(-EIO);
- }
-
- /*
- * Check for unit_spec_ID tag
- */
- if ((be32_to_cpu(current_quadlet) >> 24) == SBP2_UNIT_SPEC_ID_KEY) {
- unit_spec_id_data = current_quadlet;
- SBP2_DEBUG("sbp2: Node %x, unit spec id = %x", (LOCAL_BUS | node_id),
- (unsigned int) be32_to_cpu(unit_spec_id_data));
- }
-
- /*
- * Check for unit_sw_version tag
- */
- if ((be32_to_cpu(current_quadlet) >> 24) == SBP2_UNIT_SW_VERSION_KEY) {
- unit_sw_ver_data = current_quadlet;
- SBP2_DEBUG("sbp2: Node %x, unit sw version = %x", (LOCAL_BUS | node_id),
- (unsigned int) be32_to_cpu(unit_sw_ver_data));
- }
- }
-
- /*
- * Validate unit spec id and unit sw ver to see if this is an SBP-2 device
- */
- if ((be32_to_cpu(unit_spec_id_data) != SBP2_UNIT_SPEC_ID_ENTRY) ||
- (be32_to_cpu(unit_sw_ver_data) != SBP2_SW_VERSION_ENTRY)) {
-
- /*
- * Not an sbp2 device
- */
- return(-ENXIO);
- }
-
- /*
- * This device is a valid SBP-2 device
- */
- SBP2_INFO("sbp2: Node 0x%04x, Found SBP-2 device", (LOCAL_BUS | node_id));
- return(0);
-}
-
-/*
- * This function removes (cleans-up after) any unvalidated sbp2 devices
- */
-static void sbp2_remove_unvalidated_devices(struct sbp2scsi_host_info *hi)
-{
- int i;
-
- /*
- * Loop through and free any unvalidated scsi id instance data structures
- */
- for (i=0; iscsi_id[i]) {
- if (!hi->scsi_id[i]->validated) {
-
- /*
- * Complete any pending commands with selection timeout
- */
- sbp2scsi_complete_all_commands(hi, hi->scsi_id[i], DID_NO_CONNECT);
-
- /*
- * Clean up any other structures
- */
- if (hi->scsi_id[i]->sbp2_total_command_orbs) {
- sbp2util_remove_command_orb_pool(hi->scsi_id[i], hi);
- }
- if (hi->scsi_id[i]->login_response) {
- pci_free_consistent(hi->host->pdev,
- sizeof(struct sbp2_login_response),
- hi->scsi_id[i]->login_response,
- hi->scsi_id[i]->login_response_dma);
- SBP2_DMA_FREE("single login FIFO");
- }
-
- if (hi->scsi_id[i]->login_orb) {
- pci_free_consistent(hi->host->pdev,
- sizeof(struct sbp2_login_orb),
- hi->scsi_id[i]->login_orb,
- hi->scsi_id[i]->login_orb_dma);
- SBP2_DMA_FREE("single login ORB");
- }
-
- if (hi->scsi_id[i]->reconnect_orb) {
- pci_free_consistent(hi->host->pdev,
- sizeof(struct sbp2_reconnect_orb),
- hi->scsi_id[i]->reconnect_orb,
- hi->scsi_id[i]->reconnect_orb_dma);
- SBP2_DMA_FREE("single reconnect orb");
- }
-
- if (hi->scsi_id[i]->logout_orb) {
- pci_free_consistent(hi->host->pdev,
- sizeof(struct sbp2_logout_orb),
- hi->scsi_id[i]->logout_orb,
- hi->scsi_id[i]->reconnect_orb_dma);
- SBP2_DMA_FREE("single logout orb");
- }
-
- kfree(hi->scsi_id[i]);
- hi->scsi_id[i] = NULL;
- SBP2_DEBUG("sbp2: Unvalidated SBP-2 device removed, SCSI ID = %x", (unsigned int) i);
- }
- }
- }
-
- return;
-}
-
-/*
- * This function is our reset handler. It is run out of a thread, since we get
- * notified of a bus reset from a bh (or interrupt).
- */
-static void sbp2_bus_reset_handler(void *context)
-{
- struct sbp2scsi_host_info *hi = context;
- quadlet_t signature_data;
- int i;
- unsigned long flags;
- struct scsi_id_instance_data *scsi_id;
-
- SBP2_DEBUG("sbp2: sbp2_bus_reset_handler");
-
- /*
- * TODO. Check and keep track of generation number of all requests, in case a
- * bus reset occurs while trying to find and login to SBP-2 devices.
- */
-
- /*
- * First thing to do. Invalidate all SBP-2 devices. This is needed so that
- * we stop sending down I/O requests to the device, and also so that we can
- * figure out which devices have disappeared after a bus reset.
- */
- for (i=0; iscsi_id[i]) {
- hi->scsi_id[i]->validated = 0;
+ if (scsi_id->reconnect_orb) {
+ pci_free_consistent(hi->host->pdev,
+ sizeof(struct sbp2_reconnect_orb),
+ scsi_id->reconnect_orb,
+ scsi_id->reconnect_orb_dma);
+ SBP2_DMA_FREE("reconnect ORB DMA");
+ }
+
+ if (scsi_id->login_response) {
+ pci_free_consistent(hi->host->pdev,
+ sizeof(struct sbp2_login_response),
+ scsi_id->login_response,
+ scsi_id->login_response_dma);
+ SBP2_DMA_FREE("login FIFO DMA");
}
+
+ kfree(scsi_id);
+alloc_fail_first:
+ SBP2_ERR ("sbp2: Could not allocate memory for scsi_id");
+ return(-ENOMEM);
}
+ SBP2_DMA_ALLOC("consistent DMA region for login ORB");
/*
- * Give the sbp2 devices a little time to recover after the bus reset
+ * Initialize some of the fields in this structure
*/
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(HZ/2); /* 1/2 second delay */
+ scsi_id->ne = ne;
+ scsi_id->ud = ud;
+ scsi_id->speed_code = SPEED_100;
+ scsi_id->max_payload_size = MAX_PAYLOAD_S100;
+ ud->driver_data = scsi_id;
- /*
- * Spit out what we know from the host
+ init_waitqueue_head(&scsi_id->sbp2_login_wait);
+
+ /*
+ * Initialize structures needed for the command orb pool.
*/
- SBP2_DEBUG("host: node_count = %x", (unsigned int) hi->host->node_count);
- SBP2_DEBUG("host: selfid_count = %x", (unsigned int) hi->host->selfid_count);
- SBP2_DEBUG("host: node_id = %x", (unsigned int) hi->host->node_id);
- SBP2_DEBUG("host: irm_id = %x", (unsigned int) hi->host->irm_id);
- SBP2_DEBUG("host: busmgr_id = %x", (unsigned int) hi->host->busmgr_id);
- SBP2_DEBUG("host: is_root = %x", (unsigned int) hi->host->is_root);
- SBP2_DEBUG("host: is_cycmst = %x", (unsigned int) hi->host->is_cycmst);
- SBP2_DEBUG("host: is_irm = %x", (unsigned int) hi->host->is_irm);
- SBP2_DEBUG("host: is_busmgr = %x", (unsigned int) hi->host->is_busmgr);
+ INIT_LIST_HEAD(&scsi_id->sbp2_command_orb_inuse);
+ INIT_LIST_HEAD(&scsi_id->sbp2_command_orb_completed);
+ scsi_id->sbp2_command_orb_lock = SPIN_LOCK_UNLOCKED;
+ scsi_id->sbp2_total_command_orbs = 0;
/*
- * Let's try and figure out which devices out there are SBP-2 devices! Loop through all
- * nodes out there.
+ * Make sure that we've gotten ahold of the sbp2 management agent
+ * address. Also figure out the command set being used (SCSI or
+ * RBC).
*/
- for (i=0; ihost->node_count; i++) {
-
- /*
- * Don't read from ourselves!
- */
- if (i != ((hi->host->node_id) & NODE_MASK)) {
-
- /*
- * Try and send a request for a config rom signature. This is expected to fail for
- * some nodes, as they might be repeater phys or not be initialized.
- */
- if (!sbp2util_read_quadlet(hi, LOCAL_BUS | i, CONFIG_ROM_SIGNATURE_ADDRESS, &signature_data)) {
+ sbp2_parse_unit_directory(scsi_id);
- if (be32_to_cpu(signature_data) == IEEE1394_CONFIG_ROM_SIGNATURE) {
-
- /*
- * Hey, we've got a valid responding IEEE1394 node. Need to now see if it's an SBP-2 device
- */
- if (!sbp2_check_device(hi, i)) {
+ scsi_id->sbp2_total_command_orbs = SBP2_MAX_COMMAND_ORBS;
- /*
- * Found an SBP-2 device. Now, actually start the device.
- */
- sbp2_start_device(hi, i);
- }
- }
- }
- }
+ /*
+ * Knock the total command orbs down if we are serializing I/O
+ */
+ if (serialize_io) {
+ scsi_id->sbp2_total_command_orbs = 2; /* one extra for good measure */
}
/*
- * This code needs protection
+ * Allocate some extra command orb structures for devices with
+ * 128KB limit.
*/
- sbp2_spin_lock(&hi->sbp2_command_lock, flags);
+ if (scsi_id->sbp2_firmware_revision == SBP2_128KB_BROKEN_FIRMWARE) {
+ scsi_id->sbp2_total_command_orbs *= 4;
+ }
/*
- * Ok, we've discovered and re-validated all SBP-2 devices out there. Let's remove structures of all
- * devices not re-validated (meaning they've been removed).
+ * Find an empty spot to stick our scsi id instance data.
*/
- sbp2_remove_unvalidated_devices(hi);
+ for (i = 0; i < SBP2SCSI_MAX_SCSI_IDS; i++) {
+ if (!hi->scsi_id[i]) {
+ hi->scsi_id[i] = scsi_id;
+ scsi_id->id = i;
+ SBP2_DEBUG("sbp2: New SBP-2 device inserted, SCSI ID = %x", (unsigned int) i);
+ break;
+ }
+ }
/*
- * Complete any pending commands with busy (so they get retried) and remove them from our queue
+ * Create our command orb pool
*/
- for (i=0; iscsi_id[i]) {
- sbp2scsi_complete_all_commands(hi, hi->scsi_id[i], DID_BUS_BUSY);
- }
+ if (sbp2util_create_command_orb_pool(scsi_id, hi)) {
+ SBP2_ERR("sbp2: sbp2util_create_command_orb_pool failed!");
+ sbp2_remove_device(hi, scsi_id);
+ return -ENOMEM;
}
/*
- * Now, note that the bus reset is complete (finally!)
+ * Make sure we are not out of space
*/
- hi->bus_reset_in_progress = 0;
+ if (i == SBP2SCSI_MAX_SCSI_IDS) {
+ SBP2_ERR("sbp2: No slots left for SBP-2 device");
+ sbp2_remove_device(hi, scsi_id);
+ return -EBUSY;
+ }
/*
- * Deal with the initial scsi bus scan if needed (since we only now know if there are
- * any sbp2 devices attached)
+ * Login to the sbp-2 device
*/
- if (!no_bus_scan && !hi->initial_scsi_bus_scan_complete && hi->bus_scan_SCpnt) {
+ if (sbp2_login_device(hi, scsi_id)) {
- hi->initial_scsi_bus_scan_complete = 1;
- scsi_id = hi->scsi_id[hi->bus_scan_SCpnt->target];
-
- /*
- * If the sbp2 device exists, then let's now execute the command.
- * If not, then just complete it as a selection time-out.
+ /*
+ * Login failed... so, just mark him as unvalidated, so
+ * that he gets cleaned up later.
*/
- if (scsi_id) {
- if (sbp2_send_command(hi, scsi_id, hi->bus_scan_SCpnt, hi->bus_scan_done)) {
- SBP2_ERR("sbp2: Error sending SCSI command");
- sbp2scsi_complete_command(hi, scsi_id, SBP2_SCSI_STATUS_SELECTION_TIMEOUT,
- hi->bus_scan_SCpnt, hi->bus_scan_done);
- }
- } else {
- void (*done)(Scsi_Cmnd *) = hi->bus_scan_done;
- hi->bus_scan_SCpnt->result = DID_NO_CONNECT << 16;
- done (hi->bus_scan_SCpnt);
- }
+ SBP2_ERR("sbp2: sbp2_login_device failed");
+ sbp2_remove_device(hi, scsi_id);
+ return -EBUSY;
}
- sbp2_spin_unlock(&hi->sbp2_command_lock, flags);
+ /*
+ * Set max retries to something large on the device
+ */
+ sbp2_set_busy_timeout(hi, scsi_id);
+
+ /*
+ * Do a SBP-2 fetch agent reset
+ */
+ sbp2_agent_reset(hi, scsi_id, 0);
+
+ /*
+ * Get the max speed and packet size that we can use
+ */
+ sbp2_max_speed_and_size(hi, scsi_id);
- return;
+ return 0;
}
-
/*
- * This is called from the host's bh when a bus reset is complete. We wake up our detection thread
- * to deal with the reset
+ * This function removes (cleans-up after) any unvalidated sbp2 devices
*/
-static void sbp2_host_reset(struct hpsb_host *host)
+static void sbp2_remove_device(struct sbp2scsi_host_info *hi,
+ struct scsi_id_instance_data *scsi_id)
{
- unsigned long flags;
- struct sbp2scsi_host_info *hi;
- int i;
-
- SBP2_INFO("sbp2: IEEE-1394 bus reset");
- sbp2_spin_lock(&sbp2_host_info_lock, flags);
- hi = sbp2_find_host_info(host);
-
- if (hi != NULL) {
-
- /*
- * Wake up our detection thread, only if it's not already handling a reset
- */
- if (!hi->bus_reset_in_progress) {
-
- /*
- * First thing to do. Invalidate all SBP-2 devices. This is needed so that
- * we stop sending down I/O requests to the device, and also so that we can
- * figure out which devices have disappeared after a bus reset.
- */
- for (i=0; iscsi_id[i]) {
- hi->scsi_id[i]->validated = 0;
- }
- }
+ /* Complete any pending commands with selection timeout */
+ sbp2scsi_complete_all_commands(hi, scsi_id, DID_NO_CONNECT);
+
+ /* Clean up any other structures */
+ if (scsi_id->sbp2_total_command_orbs) {
+ sbp2util_remove_command_orb_pool(scsi_id, hi);
+ }
- hi->bus_reset_in_progress = 1;
+ if (scsi_id->login_response) {
+ pci_free_consistent(hi->host->pdev,
+ sizeof(struct sbp2_login_response),
+ scsi_id->login_response,
+ scsi_id->login_response_dma);
+ SBP2_DMA_FREE("single login FIFO");
+ }
- wake_up(&hi->sbp2_detection_wait);
- }
+ if (scsi_id->login_orb) {
+ pci_free_consistent(hi->host->pdev,
+ sizeof(struct sbp2_login_orb),
+ scsi_id->login_orb,
+ scsi_id->login_orb_dma);
+ SBP2_DMA_FREE("single login ORB");
}
- sbp2_spin_unlock(&sbp2_host_info_lock, flags);
- return;
-}
-/* XXX: How best to handle these with DMA interface? */
+ if (scsi_id->reconnect_orb) {
+ pci_free_consistent(hi->host->pdev,
+ sizeof(struct sbp2_reconnect_orb),
+ scsi_id->reconnect_orb,
+ scsi_id->reconnect_orb_dma);
+ SBP2_DMA_FREE("single reconnect orb");
+ }
-#if 0
-/*
- * This function deals with physical dma write requests (for adapters that do not support
- * physical dma in hardware).
- */
-static int sbp2_handle_physdma_write(struct hpsb_host *host, int nodeid, quadlet_t *data,
- u64 addr, unsigned int length)
-{
+ if (scsi_id->logout_orb) {
+ pci_free_consistent(hi->host->pdev,
+ sizeof(struct sbp2_logout_orb),
+ scsi_id->logout_orb,
+ scsi_id->reconnect_orb_dma);
+ SBP2_DMA_FREE("single logout orb");
+ }
- /*
- * Manually put the data in the right place.
- */
- memcpy(bus_to_virt((u32)addr), data, length);
- return(RCODE_COMPLETE);
+ SBP2_DEBUG("sbp2: Unvalidated SBP-2 device removed, SCSI ID = %d",
+ scsi_id->id);
+ hi->scsi_id[scsi_id->id] = NULL;
+ kfree(scsi_id);
}
-/*
- * This function deals with physical dma read requests (for adapters that do not support
- * physical dma in hardware).
- */
-static int sbp2_handle_physdma_read(struct hpsb_host *host, int nodeid, quadlet_t *data,
- u64 addr, unsigned int length)
-{
-
- /*
- * Grab data from memory and send a read response.
- */
- memcpy(data, bus_to_virt((u32)addr), length);
- return(RCODE_COMPLETE);
-}
-#endif
+
/**************************************
* SBP-2 protocol related section
**************************************/
/*
- * This function is called in order to login to a particular SBP-2 device, after a bus reset
+ * This function is called in order to login to a particular SBP-2 device,
+ * after a bus reset.
*/
static int sbp2_login_device(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id)
{
@@ -1808,34 +1298,28 @@
return(-EIO);
}
- /*
- * Set-up login ORB
- */
- scsi_id->login_orb->password_hi = 0; /* Assume no password */
+ /* Set-up login ORB, assume no password */
+ scsi_id->login_orb->password_hi = 0;
scsi_id->login_orb->password_lo = 0;
SBP2_DEBUG("sbp2: sbp2_login_device: password_hi/lo initialized");
-#ifdef SBP2_NEED_LOGIN_DESCRIPTOR_WORKAROUND
- scsi_id->login_orb->login_response_lo = cpu_to_le32(scsi_id->login_response_dma);
- scsi_id->login_orb->login_response_hi = cpu_to_le32(ORB_SET_NODE_ID(hi->host->node_id));
-#else
+
scsi_id->login_orb->login_response_lo = scsi_id->login_response_dma;
scsi_id->login_orb->login_response_hi = ORB_SET_NODE_ID(hi->host->node_id);
-#endif
SBP2_DEBUG("sbp2: sbp2_login_device: login_response_hi/lo initialized");
+
scsi_id->login_orb->lun_misc = ORB_SET_FUNCTION(LOGIN_REQUEST);
scsi_id->login_orb->lun_misc |= ORB_SET_RECONNECT(0); /* One second reconnect time */
scsi_id->login_orb->lun_misc |= ORB_SET_EXCLUSIVE(1); /* Exclusive access to device */
scsi_id->login_orb->lun_misc |= ORB_SET_NOTIFY(1); /* Notify us of login complete */
SBP2_DEBUG("sbp2: sbp2_login_device: lun_misc initialized");
- scsi_id->login_orb->passwd_resp_lengths = ORB_SET_LOGIN_RESP_LENGTH(sizeof(struct sbp2_login_response));
+
+ scsi_id->login_orb->passwd_resp_lengths =
+ ORB_SET_LOGIN_RESP_LENGTH(sizeof(struct sbp2_login_response));
SBP2_DEBUG("sbp2: sbp2_login_device: passwd_resp_lengths initialized");
-#ifdef SBP2_NEED_LOGIN_DESCRIPTOR_WORKAROUND
- scsi_id->login_orb->status_FIFO_lo = cpu_to_le32((u32)SBP2_STATUS_FIFO_ADDRESS_LO);
- scsi_id->login_orb->status_FIFO_hi = (ORB_SET_NODE_ID(hi->host->node_id) | cpu_to_le16(SBP2_STATUS_FIFO_ADDRESS_HI));
-#else
+
scsi_id->login_orb->status_FIFO_lo = SBP2_STATUS_FIFO_ADDRESS_LO;
- scsi_id->login_orb->status_FIFO_hi = (ORB_SET_NODE_ID(hi->host->node_id) | SBP2_STATUS_FIFO_ADDRESS_HI);
-#endif
+ scsi_id->login_orb->status_FIFO_hi = (ORB_SET_NODE_ID(hi->host->node_id) |
+ SBP2_STATUS_FIFO_ADDRESS_HI);
SBP2_DEBUG("sbp2: sbp2_login_device: status FIFO initialized");
/*
@@ -1861,25 +1345,26 @@
sbp2util_cpu_to_be32_buffer(data, 8);
SBP2_DEBUG("sbp2: sbp2_login_device: prepared to write");
-
- hpsb_write(hi->host, LOCAL_BUS | scsi_id->node_id, scsi_id->sbp2_management_agent_addr, data, 8);
+ hpsb_write(hi->host, LOCAL_BUS | scsi_id->ne->nodeid, scsi_id->sbp2_management_agent_addr, data, 8);
+ SBP2_DEBUG("sbp2: sbp2_login_device: written");
/*
- * Wait for login status... but, only if the device has not already logged-in (some devices are fast)
+ * Wait for login status... but, only if the device has not
+ * already logged-in (some devices are fast)
*/
- SBP2_DEBUG("sbp2: sbp2_login_device: written");
save_flags(flags);
cli();
- if (scsi_id->status_block.ORB_offset_lo != scsi_id->login_orb_dma) {
- interruptible_sleep_on_timeout(&scsi_id->sbp2_login_wait, 10*HZ); /* 10 second timeout */
- }
+ /* 10 second timeout */
+ if (scsi_id->status_block.ORB_offset_lo != scsi_id->login_orb_dma)
+ sleep_on_timeout(&scsi_id->sbp2_login_wait, 10*HZ);
restore_flags(flags);
SBP2_DEBUG("sbp2: sbp2_login_device: initial check");
/*
- * Match status to the login orb. If they do not match, it's probably because the login timed-out
+ * Match status to the login orb. If they do not match, it's
+ * probably because the login timed-out.
*/
if (scsi_id->status_block.ORB_offset_lo != scsi_id->login_orb_dma) {
SBP2_ERR("sbp2: Error logging into SBP-2 device - login timed-out");
@@ -1900,17 +1385,21 @@
}
/*
- * Byte swap the login response, for use when reconnecting or logging out.
+ * Byte swap the login response, for use when reconnecting or
+ * logging out.
*/
sbp2util_cpu_to_be32_buffer(scsi_id->login_response, sizeof(struct sbp2_login_response));
/*
- * Grab our command block agent address from the login response
+ * Grab our command block agent address from the login response.
*/
- SBP2_DEBUG("sbp2: command_block_agent_hi = %x", (unsigned int)scsi_id->login_response->command_block_agent_hi);
- SBP2_DEBUG("sbp2: command_block_agent_lo = %x", (unsigned int)scsi_id->login_response->command_block_agent_lo);
+ SBP2_DEBUG("sbp2: command_block_agent_hi = %x",
+ (unsigned int)scsi_id->login_response->command_block_agent_hi);
+ SBP2_DEBUG("sbp2: command_block_agent_lo = %x",
+ (unsigned int)scsi_id->login_response->command_block_agent_lo);
- scsi_id->sbp2_command_block_agent_addr = ((u64)scsi_id->login_response->command_block_agent_hi) << 32;
+ scsi_id->sbp2_command_block_agent_addr =
+ ((u64)scsi_id->login_response->command_block_agent_hi) << 32;
scsi_id->sbp2_command_block_agent_addr |= ((u64)scsi_id->login_response->command_block_agent_lo);
scsi_id->sbp2_command_block_agent_addr &= 0x0000ffffffffffffULL;
@@ -1921,8 +1410,8 @@
}
/*
- * This function is called in order to logout from a particular SBP-2 device, usually called during driver
- * unload
+ * This function is called in order to logout from a particular SBP-2
+ * device, usually called during driver unload.
*/
static int sbp2_logout_device(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id)
{
@@ -1937,17 +1426,17 @@
scsi_id->logout_orb->reserved2 = 0x0;
scsi_id->logout_orb->reserved3 = 0x0;
scsi_id->logout_orb->reserved4 = 0x0;
+
scsi_id->logout_orb->login_ID_misc = ORB_SET_FUNCTION(LOGOUT_REQUEST);
scsi_id->logout_orb->login_ID_misc |= ORB_SET_LOGIN_ID(scsi_id->login_response->length_login_ID);
- scsi_id->logout_orb->login_ID_misc |= ORB_SET_NOTIFY(1); /* Notify us when complete */
+
+ /* Notify us when complete */
+ scsi_id->logout_orb->login_ID_misc |= ORB_SET_NOTIFY(1);
+
scsi_id->logout_orb->reserved5 = 0x0;
-#ifdef SBP2_NEED_LOGIN_DESCRIPTOR_WORKAROUND
- scsi_id->logout_orb->status_FIFO_lo = cpu_to_le32((u32)SBP2_STATUS_FIFO_ADDRESS_LO);
- scsi_id->logout_orb->status_FIFO_hi = (ORB_SET_NODE_ID(hi->host->node_id) | cpu_to_le16(SBP2_STATUS_FIFO_ADDRESS_HI));
-#else
scsi_id->logout_orb->status_FIFO_lo = SBP2_STATUS_FIFO_ADDRESS_LO;
- scsi_id->logout_orb->status_FIFO_hi = (ORB_SET_NODE_ID(hi->host->node_id) | SBP2_STATUS_FIFO_ADDRESS_HI);
-#endif
+ scsi_id->logout_orb->status_FIFO_hi = (ORB_SET_NODE_ID(hi->host->node_id) |
+ SBP2_STATUS_FIFO_ADDRESS_HI);
/*
* Byte swap ORB if necessary
@@ -1961,12 +1450,10 @@
data[1] = scsi_id->logout_orb_dma;
sbp2util_cpu_to_be32_buffer(data, 8);
- hpsb_write(hi->host, LOCAL_BUS | scsi_id->node_id, scsi_id->sbp2_management_agent_addr, data, 8);
+ hpsb_write(hi->host, LOCAL_BUS | scsi_id->ne->nodeid, scsi_id->sbp2_management_agent_addr, data, 8);
- /*
- * Wait for device to logout...
- */
- interruptible_sleep_on_timeout(&scsi_id->sbp2_login_wait, HZ); /* 1 second timeout */
+ /* Wait for device to logout...1 second. */
+ sleep_on_timeout(&scsi_id->sbp2_login_wait, HZ);
SBP2_INFO("sbp2: Logged out of SBP-2 device");
@@ -1975,7 +1462,8 @@
}
/*
- * This function is called in order to reconnect to a particular SBP-2 device, after a bus reset
+ * This function is called in order to reconnect to a particular SBP-2
+ * device, after a bus reset.
*/
static int sbp2_reconnect_device(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id)
{
@@ -1991,18 +1479,19 @@
scsi_id->reconnect_orb->reserved2 = 0x0;
scsi_id->reconnect_orb->reserved3 = 0x0;
scsi_id->reconnect_orb->reserved4 = 0x0;
+
scsi_id->reconnect_orb->login_ID_misc = ORB_SET_FUNCTION(RECONNECT_REQUEST);
- scsi_id->reconnect_orb->login_ID_misc |= ORB_SET_LOGIN_ID(scsi_id->login_response->length_login_ID);
- scsi_id->reconnect_orb->login_ID_misc |= ORB_SET_NOTIFY(1); /* Notify us when complete */
+ scsi_id->reconnect_orb->login_ID_misc |=
+ ORB_SET_LOGIN_ID(scsi_id->login_response->length_login_ID);
+
+ /* Notify us when complete */
+ scsi_id->reconnect_orb->login_ID_misc |= ORB_SET_NOTIFY(1);
+
scsi_id->reconnect_orb->reserved5 = 0x0;
-#ifdef SBP2_NEED_LOGIN_DESCRIPTOR_WORKAROUND
- scsi_id->reconnect_orb->status_FIFO_lo = cpu_to_le32((u32)SBP2_STATUS_FIFO_ADDRESS_LO);
- scsi_id->reconnect_orb->status_FIFO_hi = (ORB_SET_NODE_ID(hi->host->node_id) | cpu_to_le16(SBP2_STATUS_FIFO_ADDRESS_HI));
-#else
scsi_id->reconnect_orb->status_FIFO_lo = SBP2_STATUS_FIFO_ADDRESS_LO;
- scsi_id->reconnect_orb->status_FIFO_hi = (ORB_SET_NODE_ID(hi->host->node_id) | SBP2_STATUS_FIFO_ADDRESS_HI);
-#endif
-
+ scsi_id->reconnect_orb->status_FIFO_hi =
+ (ORB_SET_NODE_ID(hi->host->node_id) | SBP2_STATUS_FIFO_ADDRESS_HI);
+
/*
* Byte swap ORB if necessary
*/
@@ -2020,20 +1509,22 @@
data[1] = scsi_id->reconnect_orb_dma;
sbp2util_cpu_to_be32_buffer(data, 8);
- hpsb_write(hi->host, LOCAL_BUS | scsi_id->node_id, scsi_id->sbp2_management_agent_addr, data, 8);
+ hpsb_write(hi->host, LOCAL_BUS | scsi_id->ne->nodeid, scsi_id->sbp2_management_agent_addr, data, 8);
/*
- * Wait for reconnect status... but, only if the device has not already reconnected (some devices are fast)
+ * Wait for reconnect status... but, only if the device has not
+ * already reconnected (some devices are fast).
*/
save_flags(flags);
cli();
- if (scsi_id->status_block.ORB_offset_lo != scsi_id->reconnect_orb_dma) {
- interruptible_sleep_on_timeout(&scsi_id->sbp2_login_wait, HZ); /* one second timeout */
- }
+ /* One second timout */
+ if (scsi_id->status_block.ORB_offset_lo != scsi_id->reconnect_orb_dma)
+ sleep_on_timeout(&scsi_id->sbp2_login_wait, HZ);
restore_flags(flags);
/*
- * Match status to the reconnect orb. If they do not match, it's probably because the reconnect timed-out
+ * Match status to the reconnect orb. If they do not match, it's
+ * probably because the reconnect timed-out.
*/
if (scsi_id->status_block.ORB_offset_lo != scsi_id->reconnect_orb_dma) {
SBP2_ERR("sbp2: Error reconnecting to SBP-2 device - reconnect timed-out");
@@ -2058,7 +1549,8 @@
}
/*
- * This function is called in order to set the busy timeout (number of retries to attempt) on the sbp2 device.
+ * This function is called in order to set the busy timeout (number of
+ * retries to attempt) on the sbp2 device.
*/
static int sbp2_set_busy_timeout(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id)
{
@@ -2071,7 +1563,7 @@
*/
data = cpu_to_be32(SBP2_BUSY_TIMEOUT_VALUE);
- if (hpsb_write(hi->host, LOCAL_BUS | scsi_id->node_id, SBP2_BUSY_TIMEOUT_ADDRESS, &data, 4)) {
+ if (hpsb_write(hi->host, LOCAL_BUS | scsi_id->ne->nodeid, SBP2_BUSY_TIMEOUT_ADDRESS, &data, 4)) {
SBP2_ERR("sbp2: sbp2_set_busy_timeout error");
}
@@ -2079,158 +1571,100 @@
}
/*
- * This function is called to parse sbp2 device's config rom unit directory. Used to determine
- * things like sbp2 management agent offset, and command set used (SCSI or RBC).
+ * This function is called to parse sbp2 device's config rom unit
+ * directory. Used to determine things like sbp2 management agent offset,
+ * and command set used (SCSI or RBC).
*/
-static int sbp2_parse_unit_directory(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id)
+static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id)
{
- quadlet_t unit_directory_length, unit_directory_data;
- u64 unit_directory_addr;
- u32 i;
+ struct unit_directory *ud;
+ int i;
SBP2_DEBUG("sbp2: sbp2_parse_unit_directory");
- if (sbp2util_unit_directory(hi, LOCAL_BUS | scsi_id->node_id, &unit_directory_addr)) {
- SBP2_DEBUG("sbp2: Error reading unit directory address - bad status");
- return(-EIO);
- }
-
- /*
- * Read the size of the unit directory
- */
- if (sbp2util_read_quadlet(hi, LOCAL_BUS | scsi_id->node_id, unit_directory_addr,
- &unit_directory_length)) {
- SBP2_DEBUG("sbp2: Error reading unit directory length - bad status");
- return(-EIO);
- }
-
- unit_directory_length = ((be32_to_cpu(unit_directory_length)) >> 16);
-
- /*
- * Now, sweep through the unit directory looking for the management agent offset
- * Give up if we hit any error or somehow miss it...
- */
- for (i=0; inode_id, unit_directory_addr + (i<<2) + 4,
- &unit_directory_data)) {
- SBP2_DEBUG("sbp2: Error reading unit directory - bad status");
- return(-EIO);
- }
-
- /*
- * Handle different fields in the unit directory, based on keys
- */
- unit_directory_data = be32_to_cpu(unit_directory_data);
- switch (unit_directory_data >> 24) {
-
- case SBP2_CSR_OFFSET_KEY:
-
- /*
- * Save off the management agent address
- */
- scsi_id->sbp2_management_agent_addr = CONFIG_ROM_INITIAL_MEMORY_SPACE +
- ((unit_directory_data & 0x00ffffff) << 2);
-
- SBP2_DEBUG("sbp2: sbp2_management_agent_addr = %x", (unsigned int) scsi_id->sbp2_management_agent_addr);
- break;
-
- case SBP2_COMMAND_SET_SPEC_ID_KEY:
-
- /*
- * Command spec organization
- */
- scsi_id->sbp2_command_set_spec_id = unit_directory_data & 0xffffff;
- SBP2_DEBUG("sbp2: sbp2_command_set_spec_id = %x", (unsigned int) scsi_id->sbp2_command_set_spec_id);
- break;
-
- case SBP2_COMMAND_SET_KEY:
-
- /*
- * Command set used by sbp2 device
- */
- scsi_id->sbp2_command_set = unit_directory_data & 0xffffff;
- SBP2_DEBUG("sbp2: sbp2_command_set = %x", (unsigned int) scsi_id->sbp2_command_set);
- break;
-
- case SBP2_UNIT_CHARACTERISTICS_KEY:
-
- /*
- * Unit characterisitcs (orb related stuff that I'm not yet paying attention to)
- */
- scsi_id->sbp2_unit_characteristics = unit_directory_data & 0xffffff;
- SBP2_DEBUG("sbp2: sbp2_unit_characteristics = %x", (unsigned int) scsi_id->sbp2_unit_characteristics);
- break;
+ ud = scsi_id->ud;
- case SBP2_DEVICE_TYPE_AND_LUN_KEY:
+ /* Handle different fields in the unit directory, based on keys */
+ for (i = 0; i < ud->arb_count; i++) {
+ switch (ud->arb_keys[i]) {
+ case SBP2_CSR_OFFSET_KEY:
+ /* Save off the management agent address */
+ scsi_id->sbp2_management_agent_addr =
+ CONFIG_ROM_INITIAL_MEMORY_SPACE +
+ (ud->arb_values[i] << 2);
- /*
- * Device type and lun (used for detemining type of sbp2 device)
- */
- scsi_id->sbp2_device_type_and_lun = unit_directory_data & 0xffffff;
- SBP2_DEBUG("sbp2: sbp2_device_type_and_lun = %x", (unsigned int) scsi_id->sbp2_device_type_and_lun);
- break;
-
- case SBP2_UNIT_SPEC_ID_KEY:
+ SBP2_DEBUG("sbp2: sbp2_management_agent_addr = %x",
+ (unsigned int) scsi_id->sbp2_management_agent_addr);
+ break;
- /*
- * Unit spec id (used for protocol detection)
- */
- scsi_id->sbp2_unit_spec_id = unit_directory_data & 0xffffff;
- SBP2_DEBUG("sbp2: sbp2_unit_spec_id = %x", (unsigned int) scsi_id->sbp2_unit_spec_id);
- break;
+ case SBP2_COMMAND_SET_SPEC_ID_KEY:
+ /* Command spec organization */
+ scsi_id->sbp2_command_set_spec_id = ud->arb_values[i];
+ SBP2_DEBUG("sbp2: sbp2_command_set_spec_id = %x",
+ (unsigned int) scsi_id->sbp2_command_set_spec_id);
+ break;
- case SBP2_UNIT_SW_VERSION_KEY:
+ case SBP2_COMMAND_SET_KEY:
+ /* Command set used by sbp2 device */
+ scsi_id->sbp2_command_set = ud->arb_values[i];
+ SBP2_DEBUG("sbp2: sbp2_command_set = %x",
+ (unsigned int) scsi_id->sbp2_command_set);
+ break;
- /*
- * Unit sw version (used for protocol detection)
- */
- scsi_id->sbp2_unit_sw_version = unit_directory_data & 0xffffff;
- SBP2_DEBUG("sbp2: sbp2_unit_sw_version = %x", (unsigned int) scsi_id->sbp2_unit_sw_version);
- break;
+ case SBP2_UNIT_CHARACTERISTICS_KEY:
+ /*
+ * Unit characterisitcs (orb related stuff
+ * that I'm not yet paying attention to)
+ */
+ scsi_id->sbp2_unit_characteristics = ud->arb_values[i];
+ SBP2_DEBUG("sbp2: sbp2_unit_characteristics = %x",
+ (unsigned int) scsi_id->sbp2_unit_characteristics);
+ break;
- case SBP2_FIRMWARE_REVISION_KEY:
+ case SBP2_DEVICE_TYPE_AND_LUN_KEY:
+ /*
+ * Device type and lun (used for
+ * detemining type of sbp2 device)
+ */
+ scsi_id->sbp2_device_type_and_lun = ud->arb_values[i];
+ SBP2_DEBUG("sbp2: sbp2_device_type_and_lun = %x",
+ (unsigned int) scsi_id->sbp2_device_type_and_lun);
+ break;
- /*
- * Firmware revision (used to find broken devices). If the vendor id is 0xa0b8
- * (Symbios vendor id), then we have a bridge with 128KB max transfer size limitation.
- */
- scsi_id->sbp2_firmware_revision = unit_directory_data & 0xffff00;
- if (scsi_id->sbp2_firmware_revision == SBP2_128KB_BROKEN_FIRMWARE) {
- SBP2_WARN("sbp2: warning: Bridge chipset supports 128KB max transfer size");
- }
- break;
+ case SBP2_FIRMWARE_REVISION_KEY:
+ /*
+ * Firmware revision (used to find broken
+ * devices). If the vendor id is 0xa0b8
+ * (Symbios vendor id), then we have a
+ * bridge with 128KB max transfer size
+ * limitation.
+ */
+ scsi_id->sbp2_firmware_revision = ud->arb_values[i];
+ if (scsi_id->sbp2_firmware_revision ==
+ SBP2_128KB_BROKEN_FIRMWARE) {
+ SBP2_WARN("sbp2: warning: Bridge chipset supports 128KB max transfer size");
+ }
+ break;
- default:
- break;
+ default:
+ break;
}
-
}
-
- return(0);
}
/*
- * This function is called in order to determine the max speed and packet size we can use in our ORBs.
+ * This function is called in order to determine the max speed and packet
+ * size we can use in our ORBs.
*/
static int sbp2_max_speed_and_size(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id)
{
u8 speed_code;
- struct node_entry *ne;
+ unsigned int max_rec;
SBP2_DEBUG("sbp2: sbp2_max_speed_and_size");
- /* Get this nodes information */
- ne = hpsb_nodeid_get_entry(hi->host->node_id);
-
- if (!ne) {
- HPSB_ERR("sbp2: Unknown device, using S100, payload 512 bytes");
- scsi_id->speed_code = SPEED_100;
- scsi_id->max_payload_size = MAX_PAYLOAD_S100;
- return(0);
- }
-
- speed_code = ne->busopt.lnkspd;
+ speed_code = scsi_id->ne->busopt.lnkspd;
+ max_rec = scsi_id->ne->busopt.max_rec;
/* Bump down our speed if there is a module parameter forcing us slower */
if (speed_code > max_speed) {
@@ -2240,11 +1674,11 @@
/* Support the devices max_rec and max speed. We choose a setting
* that fits both values, since they may differ. */
- if (speed_code >= SPEED_400 && ne->busopt.max_rec >= MAX_REC_S400) {
+ if (speed_code >= SPEED_400 && max_rec >= MAX_REC_S400) {
HPSB_INFO("sbp2: SBP-2 device max speed S400 and payload 2KB");
scsi_id->speed_code = SPEED_400;
scsi_id->max_payload_size = MAX_PAYLOAD_S400;
- } else if (speed_code >= SPEED_200 && ne->busopt.max_rec >= MAX_REC_S200) {
+ } else if (speed_code >= SPEED_200 && max_rec >= MAX_REC_S200) {
HPSB_INFO("sbp2: SBP-2 device max speed S200 and payload 1KB");
scsi_id->speed_code = SPEED_200;
scsi_id->max_payload_size = MAX_PAYLOAD_S200;
@@ -2269,9 +1703,11 @@
/*
* Ok, let's write to the target's management agent register
*/
- agent_reset_request_packet = sbp2util_allocate_write_request_packet(hi, LOCAL_BUS | scsi_id->node_id,
- scsi_id->sbp2_command_block_agent_addr + SBP2_AGENT_RESET_OFFSET,
- 0, ntohl(SBP2_AGENT_RESET_DATA));
+ agent_reset_request_packet =
+ sbp2util_allocate_write_request_packet(hi, LOCAL_BUS | scsi_id->ne->nodeid,
+ scsi_id->sbp2_command_block_agent_addr +
+ SBP2_AGENT_RESET_OFFSET,
+ 0, ntohl(SBP2_AGENT_RESET_DATA));
if (!agent_reset_request_packet) {
SBP2_ERR("sbp2: sbp2util_allocate_write_request_packet failed");
@@ -2299,8 +1735,8 @@
}
/*
- * This function is called to create the actual command orb and s/g list out of the
- * scsi command itself.
+ * This function is called to create the actual command orb and s/g list
+ * out of the scsi command itself.
*/
static int sbp2_create_command_orb(struct sbp2scsi_host_info *hi,
struct scsi_id_instance_data *scsi_id,
@@ -2321,9 +1757,10 @@
/*
* Set-up our command ORB..
*
- * NOTE: We're doing unrestricted page tables (s/g), as this is best performance
- * (at least with the devices I have). This means that data_size becomes the number
- * of s/g elements, and page_size should be zero (for unrestricted).
+ * NOTE: We're doing unrestricted page tables (s/g), as this is
+ * best performance (at least with the devices I have). This means
+ * that data_size becomes the number of s/g elements, and
+ * page_size should be zero (for unrestricted).
*/
command_orb->next_ORB_hi = 0xffffffff;
command_orb->next_ORB_lo = 0xffffffff;
@@ -2332,8 +1769,8 @@
command_orb->misc |= ORB_SET_NOTIFY(1); /* Notify us when complete */
/*
- * Set-up our pagetable stuff... unfortunately, this has become messier than I'd like. Need to
- * clean this up a bit. ;-)
+ * Set-up our pagetable stuff... unfortunately, this has become
+ * messier than I'd like. Need to clean this up a bit. ;-)
*/
if (sbp2scsi_direction_table[*scsi_cmd] == ORB_DIRECTION_NO_DATA_TRANSFER) {
@@ -2405,13 +1842,15 @@
}
}
- command_orb->misc |= ORB_SET_DATA_SIZE(sg_count); /* number of page table (s/g) elements */
+ /* Number of page table (s/g) elements */
+ command_orb->misc |= ORB_SET_DATA_SIZE(sg_count);
/*
* Byte swap page tables if necessary
*/
sbp2util_cpu_to_be32_buffer(scatter_gather_element,
- (sizeof(struct sbp2_unrestricted_page_table)) * sg_count);
+ (sizeof(struct sbp2_unrestricted_page_table)) *
+ sg_count);
}
@@ -2427,8 +1866,8 @@
SBP2_DMA_ALLOC("single bulk");
/*
- * Handle case where we get a command w/o s/g enabled (but check
- * for transfers larger than 64K)
+ * Handle case where we get a command w/o s/g enabled (but
+ * check for transfers larger than 64K)
*/
if (scsi_request_bufflen <= SBP2_MAX_SG_ELEMENT_LENGTH) {
@@ -2438,7 +1877,8 @@
command_orb->misc |= ORB_SET_DIRECTION(sbp2scsi_direction_table[*scsi_cmd]);
/*
- * Sanity, in case our direction table is not up-to-date
+ * Sanity, in case our direction table is not
+ * up-to-date
*/
if (!scsi_request_bufflen) {
command_orb->data_descriptor_hi = 0xffffffff;
@@ -2448,15 +1888,19 @@
} else {
/*
- * Need to turn this into page tables, since the buffer is too large.
+ * Need to turn this into page tables, since the
+ * buffer is too large.
*/
command_orb->data_descriptor_hi = ORB_SET_NODE_ID(hi->host->node_id);
command_orb->data_descriptor_lo = command->sge_dma;
- command_orb->misc |= ORB_SET_PAGE_TABLE_PRESENT(0x1); /* use page tables (s/g) */
+
+ /* Use page tables (s/g) */
+ command_orb->misc |= ORB_SET_PAGE_TABLE_PRESENT(0x1);
command_orb->misc |= ORB_SET_DIRECTION(sbp2scsi_direction_table[*scsi_cmd]);
/*
- * fill out our sbp-2 page tables (and split up the large buffer)
+ * fill out our sbp-2 page tables (and split up
+ * the large buffer)
*/
sg_count = 0;
sg_len = scsi_request_bufflen;
@@ -2476,7 +1920,8 @@
sg_count++;
}
- command_orb->misc |= ORB_SET_DATA_SIZE(sg_count); /* number of page table (s/g) elements */
+ /* Number of page table (s/g) elements */
+ command_orb->misc |= ORB_SET_DATA_SIZE(sg_count);
/*
* Byte swap page tables if necessary
@@ -2524,11 +1969,12 @@
/*
* Ok, let's write to the target's management agent register
*/
- if (!hi->bus_reset_in_progress) {
+ if (hpsb_node_entry_valid(scsi_id->ne)) {
- command_request_packet = sbp2util_allocate_write_request_packet(hi, LOCAL_BUS | scsi_id->node_id,
- scsi_id->sbp2_command_block_agent_addr + SBP2_ORB_POINTER_OFFSET,
- 8, 0);
+ command_request_packet =
+ sbp2util_allocate_write_request_packet(hi, LOCAL_BUS | scsi_id->ne->nodeid,
+ scsi_id->sbp2_command_block_agent_addr +
+ SBP2_ORB_POINTER_OFFSET, 8, 0);
if (!command_request_packet) {
SBP2_ERR("sbp2: sbp2util_allocate_write_request_packet failed");
@@ -2561,16 +2007,19 @@
* modifying these next orb pointers, as they are accessed
* both by the sbp2 device and us.
*/
- scsi_id->last_orb->next_ORB_lo = cpu_to_be32(command->command_orb_dma);
- scsi_id->last_orb->next_ORB_hi = 0x0; /* Tells hardware that this pointer is valid */
-
+ scsi_id->last_orb->next_ORB_lo =
+ cpu_to_be32(command->command_orb_dma);
+ /* Tells hardware that this pointer is valid */
+ scsi_id->last_orb->next_ORB_hi = 0x0;
+
/*
- * Only ring the doorbell if we need to (first parts of linked orbs don't need this)
+ * Only ring the doorbell if we need to (first parts of
+ * linked orbs don't need this).
*/
- if (!command->linked && !hi->bus_reset_in_progress) {
+ if (!command->linked && hpsb_node_entry_valid(scsi_id->ne)) {
command_request_packet = sbp2util_allocate_write_request_packet(hi,
- LOCAL_BUS | scsi_id->node_id,
+ LOCAL_BUS | scsi_id->ne->nodeid,
scsi_id->sbp2_command_block_agent_addr + SBP2_DOORBELL_OFFSET,
0, cpu_to_be32(command->command_orb_dma));
@@ -2610,8 +2059,8 @@
SBP2_DEBUG("sbp2: SCSI s/g elements = %x", (unsigned int)SCpnt->use_sg);
/*
- * Check for broken devices that can't handle greater than 128K transfers, and deal with them in a
- * hacked ugly way.
+ * Check for broken devices that can't handle greater than 128K
+ * transfers, and deal with them in a hacked ugly way.
*/
if ((scsi_id->sbp2_firmware_revision == SBP2_128KB_BROKEN_FIRMWARE) &&
(SCpnt->request_bufflen > SBP2_BROKEN_FIRMWARE_MAX_TRANSFER) &&
@@ -2620,7 +2069,8 @@
(*cmd == 0x28 || *cmd == 0x2a || *cmd == 0x0a || *cmd == 0x08)) {
/*
- * Darn, a broken device. We'll need to split up the transfer ourselves
+ * Darn, a broken device. We'll need to split up the
+ * transfer ourselves.
*/
sbp2_send_split_command(hi, scsi_id, SCpnt, done);
return(0);
@@ -2637,13 +2087,12 @@
/*
* Now actually fill in the comamnd orb and sbp2 s/g list
*/
- sbp2_create_command_orb(hi, scsi_id, command, cmd, SCpnt->use_sg,
- SCpnt->request_bufflen, SCpnt->request_buffer,
- scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
-
+ sbp2_create_command_orb(hi, scsi_id, command, cmd, SCpnt->use_sg,
+ SCpnt->request_bufflen, SCpnt->request_buffer,
+ scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
/*
- * Update our cdb if necessary (to handle sbp2 RBC command set differences).
- * This is where the command set hacks go! =)
+ * Update our cdb if necessary (to handle sbp2 RBC command set
+ * differences). This is where the command set hacks go! =)
*/
if ((device_type == TYPE_DISK) ||
(device_type == TYPE_SDAD) ||
@@ -2665,7 +2114,8 @@
}
/*
- * This function is called for broken sbp2 device, where we have to break up large transfers.
+ * This function is called for broken sbp2 device, where we have to break
+ * up large transfers.
*/
static int sbp2_send_split_command(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id,
Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
@@ -2779,8 +2229,8 @@
}
/*
- * This function deals with command set differences between Linux scsi command set and sbp2 RBC
- * command set.
+ * This function deals with command set differences between Linux scsi
+ * command set and sbp2 RBC command set.
*/
static void sbp2_check_sbp2_command(unchar *cmd)
{
@@ -3001,9 +2451,9 @@
*/
for (i=0; iscsi_id[i]) {
- if (hi->scsi_id[i]->node_id == (nodeid & NODE_MASK)) {
+ if ((hi->scsi_id[i]->ne->nodeid & NODE_MASK) == (nodeid & NODE_MASK)) {
scsi_id = hi->scsi_id[i];
- SBP2_DEBUG("sbp2: SBP-2 status write from node %x", scsi_id->node_id);
+ SBP2_DEBUG("sbp2: SBP-2 status write from node %x", scsi_id->ne->nodeid);
break;
}
}
@@ -3089,6 +2539,7 @@
return(RCODE_COMPLETE);
}
+
/**************************************
* SCSI interface related section
@@ -3121,18 +2572,8 @@
scsi_id = hi->scsi_id[SCpnt->target];
/*
- * Save off the command if this is the initial bus scan... so that we can
- * complete it after we find all our sbp2 devices on the 1394 bus
- */
- if (!no_bus_scan && !hi->initial_scsi_bus_scan_complete) {
- hi->bus_scan_SCpnt = SCpnt;
- hi->bus_scan_done = done;
- return(0);
- }
-
- /*
- * If scsi_id is null, it means there is no device in this slot, so we should return
- * selection timeout.
+ * If scsi_id is null, it means there is no device in this slot,
+ * so we should return selection timeout.
*/
if (!scsi_id) {
SCpnt->result = DID_NO_CONNECT << 16;
@@ -3141,7 +2582,8 @@
}
/*
- * Until we handle multiple luns, just return selection time-out to any IO directed at non-zero LUNs
+ * Until we handle multiple luns, just return selection time-out
+ * to any IO directed at non-zero LUNs
*/
if (SCpnt->lun) {
SCpnt->result = DID_NO_CONNECT << 16;
@@ -3150,7 +2592,8 @@
}
/*
- * Check for request sense command, and handle it here (autorequest sense)
+ * Check for request sense command, and handle it here
+ * (autorequest sense)
*/
if (SCpnt->cmnd[0] == REQUEST_SENSE) {
SBP2_DEBUG("sbp2: REQUEST_SENSE");
@@ -3161,9 +2604,10 @@
}
/*
- * Check to see if there is a command in progress and just return busy (to be queued later)
+ * Check to see if there is a command in progress and just return
+ * busy (to be queued later)
*/
- if (hi->bus_reset_in_progress) {
+ if (!hpsb_node_entry_valid(scsi_id->ne)) {
SBP2_ERR("sbp2: Bus reset in progress - rejecting command");
SCpnt->result = DID_BUS_BUSY << 16;
done (SCpnt);
@@ -3184,9 +2628,11 @@
}
/*
- * This function is called in order to complete all outstanding SBP-2 commands (in case of resets, etc.).
+ * This function is called in order to complete all outstanding SBP-2
+ * commands (in case of resets, etc.).
*/
-static void sbp2scsi_complete_all_commands(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id,
+static void sbp2scsi_complete_all_commands(struct sbp2scsi_host_info *hi,
+ struct scsi_id_instance_data *scsi_id,
u32 status)
{
struct list_head *lh;
@@ -3210,7 +2656,7 @@
}
/*
- * This function is called in order to complete a regular SBP-2 command.
+ * This function is called in order to complete a regular SBP-2 command.
*/
static void sbp2scsi_complete_command(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id, u32 scsi_status,
Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
@@ -3226,10 +2672,11 @@
}
/*
- * If a bus reset is in progress and there was an error, don't complete the command,
- * just let it get retried at the end of the bus reset.
+ * If a bus reset is in progress and there was an error, don't
+ * complete the command, just let it get retried at the end of the
+ * bus reset.
*/
- if ((hi->bus_reset_in_progress) && (scsi_status != SBP2_SCSI_STATUS_GOOD)) {
+ if (!hpsb_node_entry_valid(scsi_id->ne) && (scsi_status != SBP2_SCSI_STATUS_GOOD)) {
SBP2_ERR("sbp2: Bus reset in progress - retry command later");
return;
}
@@ -3283,9 +2730,10 @@
}
/*
- * One more quick hack (not enabled by default). Some sbp2 devices do not support
- * mode sense. Turn-on this hack to allow the device to pass the sd driver's
- * write-protect test (so that you can mount the device rw).
+ * One more quick hack (not enabled by default). Some sbp2 devices
+ * do not support mode sense. Turn-on this hack to allow the
+ * device to pass the sd driver's write-protect test (so that you
+ * can mount the device rw).
*/
if (mode_sense_hack && SCpnt->result != DID_OK && SCpnt->cmnd[0] == MODE_SENSE) {
SBP2_INFO("sbp2: Returning success to mode sense command");
@@ -3295,17 +2743,18 @@
}
/*
- * If a bus reset is in progress and there was an error, complete the command
- * as busy so that it will get retried.
+ * If a bus reset is in progress and there was an error, complete
+ * the command as busy so that it will get retried.
*/
- if ((hi->bus_reset_in_progress) && (scsi_status != SBP2_SCSI_STATUS_GOOD)) {
+ if (!hpsb_node_entry_valid(scsi_id->ne) && (scsi_status != SBP2_SCSI_STATUS_GOOD)) {
SBP2_ERR("sbp2: Completing command with busy (bus reset)");
SCpnt->result = DID_BUS_BUSY << 16;
}
/*
- * If a unit attention occurs, return busy status so it gets retried... it could have happened because
- * of a 1394 bus reset or hot-plug...
+ * If a unit attention occurs, return busy status so it gets
+ * retried... it could have happened because of a 1394 bus reset
+ * or hot-plug...
*/
if ((scsi_status == SBP2_SCSI_STATUS_CHECK_CONDITION) && (SCpnt->sense_buffer[2] == UNIT_ATTENTION)) {
SBP2_INFO("sbp2: UNIT ATTENTION - return busy");
@@ -3321,8 +2770,8 @@
}
/*
- * Called by scsi stack when something has really gone wrong.
- * Usually called when a command has timed-out for some reason.
+ * Called by scsi stack when something has really gone wrong. Usually
+ * called when a command has timed-out for some reason.
*/
static int sbp2scsi_abort (Scsi_Cmnd *SCpnt)
{
@@ -3336,8 +2785,9 @@
if (scsi_id) {
/*
- * Right now, just return any matching command structures to the free pool (there may
- * be more than one because of broken up/linked commands).
+ * Right now, just return any matching command structures
+ * to the free pool (there may be more than one because of
+ * broken up/linked commands).
*/
sbp2_spin_lock(&hi->sbp2_command_lock, flags);
do {
@@ -3445,10 +2895,6 @@
global_scsi_tpnt->use_clustering = DISABLE_CLUSTERING;
}
- if (no_bus_scan) {
- SBP2_ERR("sbp2: Initial scsi bus scan deferred (no_bus_scan = 1)");
- }
-
if (mode_sense_hack) {
SBP2_ERR("sbp2: Mode sense emulation enabled (mode_sense_hack = 1)");
}
@@ -3457,21 +2903,19 @@
if (!sbp2_host_count) {
SBP2_ERR("sbp2: Please load the lower level IEEE-1394 driver (e.g. ohci1394) before sbp2...");
- if (sbp2_hl_handle) {
- hpsb_unregister_highlevel(sbp2_hl_handle);
- sbp2_hl_handle = NULL;
- }
+ sbp2_cleanup();
}
/*
- * Since we are returning this count, it means that sbp2 must be loaded "after" the
- * host adapter module...
+ * Since we are returning this count, it means that sbp2 must be
+ * loaded "after" the host adapter module...
*/
return(sbp2_host_count);
}
/*
- * This function is called from sbp2_add_host, and is where we register our scsi host
+ * This function is called from sbp2_add_host, and is where we register
+ * our scsi host
*/
static void sbp2scsi_register_scsi_host(struct sbp2scsi_host_info *hi)
{
@@ -3488,7 +2932,8 @@
shpnt = scsi_register (global_scsi_tpnt, sizeof(void *));
/*
- * If successful, save off a context (to be used when SCSI commands are received)
+ * If successful, save off a context (to be used when SCSI
+ * commands are received)
*/
if (shpnt) {
shpnt->hostdata[0] = (unsigned long)hi;
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/sbp2.h linux/drivers/ieee1394/sbp2.h
--- v2.4.10/linux/drivers/ieee1394/sbp2.h Mon Aug 27 12:41:41 2001
+++ linux/drivers/ieee1394/sbp2.h Mon Oct 1 21:24:25 2001
@@ -36,13 +36,6 @@
#define ORB_DIRECTION_READ_FROM_MEDIA 0x1
#define ORB_DIRECTION_NO_DATA_TRANSFER 0x2
-#define SPEED_S100 0x0
-#define SPEED_S200 0x1
-#define SPEED_S400 0x2
-#define SPEED_S800 0x3
-#define SPEED_S1600 0x4
-#define SPEED_S3200 0x5
-
/* 2^(MAX_PAYLOAD+1) = Maximum data transfer length */
#define MAX_PAYLOAD_S100 0x7
#define MAX_PAYLOAD_S200 0x8
@@ -232,8 +225,8 @@
* Unit spec id and sw version entry for SBP-2 devices
*/
-#define SBP2_UNIT_SPEC_ID_ENTRY 0x1200609e
-#define SBP2_SW_VERSION_ENTRY 0x13010483
+#define SBP2_UNIT_SPEC_ID_ENTRY 0x0000609e
+#define SBP2_SW_VERSION_ENTRY 0x00010483
/*
* Miscellaneous general config rom related defines
@@ -243,11 +236,8 @@
#define CONFIG_ROM_BASE_ADDRESS 0xfffff0000400ULL
#define CONFIG_ROM_ROOT_DIR_BASE 0xfffff0000414ULL
-#define CONFIG_ROM_SIGNATURE_ADDRESS 0xfffff0000404ULL
#define CONFIG_ROM_UNIT_DIRECTORY_OFFSET 0xfffff0000424ULL
-#define IEEE1394_CONFIG_ROM_SIGNATURE 0x31333934
-
#define SBP2_128KB_BROKEN_FIRMWARE 0xa0b800
#define SBP2_BROKEN_FIRMWARE_MAX_TRANSFER 0x20000
@@ -350,6 +340,8 @@
* Information needed on a per scsi id basis (one for each sbp2 device)
*/
struct scsi_id_instance_data {
+ /* SCSI ID */
+ int id;
/*
* Various sbp2 specific structures
@@ -368,18 +360,15 @@
/*
* Stuff we need to know about the sbp2 device itself
*/
- u64 node_unique_id;
u64 sbp2_management_agent_addr;
u64 sbp2_command_block_agent_addr;
- u32 node_id;
u32 speed_code;
u32 max_payload_size;
/*
* Values pulled from the device's unit directory
*/
- u32 sbp2_unit_spec_id;
- u32 sbp2_unit_sw_version;
+ struct unit_directory *ud;
u32 sbp2_command_set_spec_id;
u32 sbp2_command_set;
u32 sbp2_unit_characteristics;
@@ -391,12 +380,6 @@
*/
wait_queue_head_t sbp2_login_wait;
- /*
- * Flag noting whether the sbp2 device is currently validated (for use during
- * bus resets).
- */
- u32 validated;
-
/*
* Pool of command orbs, so we can have more than overlapped command per id
*/
@@ -405,6 +388,8 @@
struct list_head sbp2_command_orb_completed;
u32 sbp2_total_command_orbs;
+ /* Node entry, as retrieved from NodeMgr entries */
+ struct node_entry *ne;
};
/*
@@ -425,22 +410,6 @@
spinlock_t sbp2_request_packet_lock;
/*
- * Flag indicating if a bus reset (or device detection) is in progress
- */
- u32 bus_reset_in_progress;
-
- /*
- * We currently use a kernel thread for dealing with bus resets and sbp2
- * device detection. We use this to wake up the thread when needed.
- */
- wait_queue_head_t sbp2_detection_wait;
-
- /*
- * PID of sbp2 detection kernel thread
- */
- int sbp2_detection_pid;
-
- /*
* Lists keeping track of inuse/free sbp2_request_packets. These structures are
* used for sending out sbp2 command and agent reset packets. We initially create
* a pool of request packets so that we don't have to do any kmallocs while in critical
@@ -450,13 +419,6 @@
struct list_head sbp2_req_free;
/*
- * Stuff to keep track of the initial scsi bus scan (so that we don't miss it)
- */
- u32 initial_scsi_bus_scan_complete;
- Scsi_Cmnd *bus_scan_SCpnt;
- void (*bus_scan_done)(Scsi_Cmnd *);
-
- /*
* Here is the pool of request packets. All the hpsb packets (for 1394 bus transactions)
* are allocated at init and simply re-initialized when needed.
*/
@@ -476,9 +438,6 @@
/*
* Various utility prototypes
*/
-static int sbp2util_read_quadlet(struct sbp2scsi_host_info *hi, nodeid_t node, u64 addr,
- quadlet_t *buffer);
-static int sbp2util_unit_directory(struct sbp2scsi_host_info *hi, nodeid_t node, u64 *addr);
static int sbp2util_create_request_packet_pool(struct sbp2scsi_host_info *hi);
static void sbp2util_remove_request_packet_pool(struct sbp2scsi_host_info *hi);
static struct sbp2_request_packet *sbp2util_allocate_write_request_packet(struct sbp2scsi_host_info *hi,
@@ -500,23 +459,19 @@
/*
* IEEE-1394 core driver related prototypes
*/
-static void sbp2_remove_unvalidated_devices(struct sbp2scsi_host_info *hi);
-static int sbp2_start_device(struct sbp2scsi_host_info *hi, int node_id);
-static int sbp2_check_device(struct sbp2scsi_host_info *hi, int node_id);
-static void sbp2_bus_reset_handler(void *context);
static void sbp2_add_host(struct hpsb_host *host);
static struct sbp2scsi_host_info *sbp2_find_host_info(struct hpsb_host *host);
static void sbp2_remove_host(struct hpsb_host *host);
-static void sbp2_host_reset(struct hpsb_host *host);
-static int sbp2_detection_thread(void *__sbp2);
int sbp2_init(void);
void sbp2_cleanup(void);
-#if 0
-static int sbp2_handle_physdma_write(struct hpsb_host *host, int nodeid, quadlet_t *data,
- u64 addr, unsigned int length);
-static int sbp2_handle_physdma_read(struct hpsb_host *host, int nodeid, quadlet_t *data,
- u64 addr, unsigned int length);
-#endif
+static int sbp2_probe(struct unit_directory *ud);
+static void sbp2_disconnect(struct unit_directory *ud);
+static void sbp2_update(struct unit_directory *ud);
+static int sbp2_start_device(struct sbp2scsi_host_info *hi,
+ struct unit_directory *ud);
+static void sbp2_remove_device(struct sbp2scsi_host_info *hi,
+ struct scsi_id_instance_data *scsi_id);
+
/*
* SBP-2 protocol related prototypes
*/
@@ -543,7 +498,7 @@
static void sbp2_check_sbp2_command(unchar *cmd);
static void sbp2_check_sbp2_response(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id,
Scsi_Cmnd *SCpnt);
-static int sbp2_parse_unit_directory(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id);
+static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id);
static int sbp2_set_busy_timeout(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id);
static int sbp2_max_speed_and_size(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id);
diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/video1394.c linux/drivers/ieee1394/video1394.c
--- v2.4.10/linux/drivers/ieee1394/video1394.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/ieee1394/video1394.c Mon Oct 1 21:24:25 2001
@@ -103,7 +103,7 @@
int ctxMatch;
wait_queue_head_t waitq;
spinlock_t lock;
- unsigned int syt_offset;
+ unsigned int syt_offset;
int flags;
};
@@ -488,24 +488,27 @@
int i;
/* the first descriptor will read only 4 bytes */
- ir_prg[0].control = (0x280C << 16) | 4;
+ ir_prg[0].control = DMA_CTL_INPUT_MORE | DMA_CTL_UPDATE |
+ DMA_CTL_BRANCH | 4;
/* set the sync flag */
if (flags & VIDEO1394_SYNC_FRAMES)
- ir_prg[0].control |= 0x00030000;
+ ir_prg[0].control |= DMA_CTL_WAIT;
ir_prg[0].address = kvirt_to_bus(buf);
ir_prg[0].branchAddress = (virt_to_bus(&(ir_prg[1].control))
& 0xfffffff0) | 0x1;
/* the second descriptor will read PAGE_SIZE-4 bytes */
- ir_prg[1].control = (0x280C << 16) | (PAGE_SIZE-4);
+ ir_prg[1].control = DMA_CTL_INPUT_MORE | DMA_CTL_UPDATE |
+ DMA_CTL_BRANCH | (PAGE_SIZE-4);
ir_prg[1].address = kvirt_to_bus(buf+4);
ir_prg[1].branchAddress = (virt_to_bus(&(ir_prg[2].control))
& 0xfffffff0) | 0x1;
for (i=2;inb_cmd-1;i++) {
- ir_prg[i].control = (0x280C << 16) | PAGE_SIZE;
+ ir_prg[i].control = DMA_CTL_INPUT_MORE | DMA_CTL_UPDATE |
+ DMA_CTL_BRANCH | PAGE_SIZE;
ir_prg[i].address = kvirt_to_bus(buf+(i-1)*PAGE_SIZE);
ir_prg[i].branchAddress =
@@ -514,7 +517,8 @@
}
/* the last descriptor will generate an interrupt */
- ir_prg[i].control = (0x283C << 16) | d->left_size;
+ ir_prg[i].control = DMA_CTL_INPUT_MORE | DMA_CTL_UPDATE |
+ DMA_CTL_IRQ | DMA_CTL_BRANCH | d->left_size;
ir_prg[i].address = kvirt_to_bus(buf+(i-1)*PAGE_SIZE);
}
@@ -691,13 +695,14 @@
d->last_used_cmd[n] = d->nb_cmd - 1;
for (i=0;inb_cmd;i++) {
- it_prg[i].begin.control = OUTPUT_MORE_IMMEDIATE | 8 ;
+ it_prg[i].begin.control = DMA_CTL_OUTPUT_MORE |
+ DMA_CTL_IMMEDIATE | 8 ;
it_prg[i].begin.address = 0;
it_prg[i].begin.status = 0;
it_prg[i].data[0] =
- (DMA_SPEED_100 << 16)
+ (SPEED_100 << 16)
| (/* tag */ 1 << 14)
| (d->channel << 8)
| (TCODE_ISO_DATA << 4);
@@ -706,7 +711,7 @@
it_prg[i].data[2] = 0;
it_prg[i].data[3] = 0;
- it_prg[i].end.control = 0x100c0000;
+ it_prg[i].end.control = DMA_CTL_OUTPUT_LAST | DMA_CTL_BRANCH;
it_prg[i].end.address =
kvirt_to_bus(buf+i*d->packet_size);
@@ -721,7 +726,8 @@
}
else {
/* the last prg generates an interrupt */
- it_prg[i].end.control |= 0x08300000 | d->left_size;
+ it_prg[i].end.control |= DMA_CTL_UPDATE |
+ DMA_CTL_IRQ | d->left_size;
/* the last prg doesn't branch */
it_prg[i].begin.branchAddress = 0;
it_prg[i].end.branchAddress = 0;
@@ -761,7 +767,7 @@
size = packet_sizes[i];
}
it_prg[i].data[1] = size << 16;
- it_prg[i].end.control = 0x100c0000;
+ it_prg[i].end.control = DMA_CTL_OUTPUT_LAST | DMA_CTL_BRANCH;
if (i < d->nb_cmd-1 && packet_sizes[i+1] != 0) {
it_prg[i].end.control |= size;
@@ -773,7 +779,8 @@
& 0xfffffff0) | 0x3;
} else {
/* the last prg generates an interrupt */
- it_prg[i].end.control |= 0x08300000 | size;
+ it_prg[i].end.control |= DMA_CTL_UPDATE |
+ DMA_CTL_IRQ | size;
/* the last prg doesn't branch */
it_prg[i].begin.branchAddress = 0;
it_prg[i].end.branchAddress = 0;
@@ -1560,7 +1567,6 @@
static void remove_card(struct video_card *video)
{
int i;
- unsigned long flags;
ohci1394_unregister_video(video->ohci, &video_tmpl);
@@ -1581,9 +1587,7 @@
}
kfree(video->it_context);
}
- spin_lock_irqsave(&video1394_cards_lock, flags);
list_del(&video->list);
- spin_unlock_irqrestore(&video1394_cards_lock, flags);
kfree(video);
}
@@ -1607,7 +1611,7 @@
p = list_entry(lh, struct video_card, list);
if (p ->ohci == ohci) {
remove_card(p);
- return;
+ break;
}
}
}
@@ -1639,6 +1643,7 @@
MODULE_AUTHOR("Sebastien Rougeaux ");
MODULE_DESCRIPTION("driver for digital video on OHCI board");
MODULE_SUPPORTED_DEVICE(VIDEO1394_DRIVER_NAME);
+MODULE_LICENSE("GPL");
static void __exit video1394_exit_module (void)
{
diff -u --recursive --new-file v2.4.10/linux/drivers/input/evdev.c linux/drivers/input/evdev.c
--- v2.4.10/linux/drivers/input/evdev.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/input/evdev.c Sun Sep 30 12:26:05 2001
@@ -398,3 +398,5 @@
MODULE_AUTHOR("Vojtech Pavlik ");
MODULE_DESCRIPTION("Event character device driver");
+MODULE_LICENSE("GPL");
+
diff -u --recursive --new-file v2.4.10/linux/drivers/input/input.c linux/drivers/input/input.c
--- v2.4.10/linux/drivers/input/input.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/input/input.c Sun Sep 30 12:26:05 2001
@@ -37,6 +37,8 @@
MODULE_AUTHOR("Vojtech Pavlik ");
MODULE_DESCRIPTION("Input layer module");
+MODULE_LICENSE("GPL");
+
EXPORT_SYMBOL(input_register_device);
EXPORT_SYMBOL(input_unregister_device);
diff -u --recursive --new-file v2.4.10/linux/drivers/input/joydev.c linux/drivers/input/joydev.c
--- v2.4.10/linux/drivers/input/joydev.c Wed Apr 11 19:02:30 2001
+++ linux/drivers/input/joydev.c Sun Sep 30 12:26:05 2001
@@ -84,6 +84,7 @@
MODULE_AUTHOR("Vojtech Pavlik ");
MODULE_DESCRIPTION("Joystick device driver");
+MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("input/js");
static int joydev_correct(int value, struct js_corr *corr)
diff -u --recursive --new-file v2.4.10/linux/drivers/input/mousedev.c linux/drivers/input/mousedev.c
--- v2.4.10/linux/drivers/input/mousedev.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/input/mousedev.c Sun Sep 30 12:26:05 2001
@@ -314,9 +314,9 @@
case 0xf2: /* Get ID */
switch (list->mode) {
- case 0: list->ps2[1] = 0;
- case 1: list->ps2[1] = 3;
- case 2: list->ps2[1] = 4;
+ case 0: list->ps2[1] = 0; break;
+ case 1: list->ps2[1] = 3; break;
+ case 2: list->ps2[1] = 4; break;
}
list->bufsiz = 2;
break;
@@ -497,6 +497,8 @@
MODULE_AUTHOR("Vojtech Pavlik ");
MODULE_DESCRIPTION("Input driver to PS/2 or ImPS/2 device driver");
+MODULE_LICENSE("GPL");
+
MODULE_PARM(xres, "i");
MODULE_PARM_DESC(xres, "Horizontal screen resolution");
MODULE_PARM(yres, "i");
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/act2000/act2000.h linux/drivers/isdn/act2000/act2000.h
--- v2.4.10/linux/drivers/isdn/act2000/act2000.h Fri Mar 2 11:12:10 2001
+++ linux/drivers/isdn/act2000/act2000.h Sun Sep 30 12:26:05 2001
@@ -1,35 +1,19 @@
-/* $Id: act2000.h,v 1.8.6.2 2001/02/16 16:43:23 kai Exp $
+/* $Id: act2000.h,v 1.8.6.3 2001/09/23 22:24:32 kai Exp $
*
* ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
*
- * Copyright 1998 by Fritz Elfert (fritz@isdn4linux.de)
- * Thanks to Friedemann Baitinger and IBM Germany
- *
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * Author Fritz Elfert
+ * Copyright by Fritz Elfert
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Thanks to Friedemann Baitinger and IBM Germany
*
*/
#ifndef act2000_h
#define act2000_h
-
-#ifdef __KERNEL__
-/* Kernel includes */
-
-#include
-#include
-#endif
#define ACT2000_IOCTL_SETPORT 1
#define ACT2000_IOCTL_GETPORT 2
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/act2000/act2000_isa.c linux/drivers/isdn/act2000/act2000_isa.c
--- v2.4.10/linux/drivers/isdn/act2000/act2000_isa.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/act2000/act2000_isa.c Sun Sep 30 12:26:05 2001
@@ -1,23 +1,14 @@
-/* $Id: act2000_isa.c,v 1.11.6.2 2001/07/18 16:25:12 kai Exp $
+/* $Id: act2000_isa.c,v 1.11.6.3 2001/09/23 22:24:32 kai Exp $
*
* ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version).
*
- * Copyright 1998 by Fritz Elfert (fritz@isdn4linux.de)
- * Thanks to Friedemann Baitinger and IBM Germany
- *
- * 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, or (at your option)
- * any later version.
+ * Author Fritz Elfert
+ * Copyright by Fritz Elfert
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Thanks to Friedemann Baitinger and IBM Germany
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/act2000/act2000_isa.h linux/drivers/isdn/act2000/act2000_isa.h
--- v2.4.10/linux/drivers/isdn/act2000/act2000_isa.h Fri Nov 17 11:16:20 2000
+++ linux/drivers/isdn/act2000/act2000_isa.h Sun Sep 30 12:26:05 2001
@@ -1,23 +1,14 @@
-/* $Id: act2000_isa.h,v 1.4 2000/11/12 16:32:06 kai Exp $
+/* $Id: act2000_isa.h,v 1.4.6.1 2001/09/23 22:24:32 kai Exp $
*
* ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version).
*
- * Copyright 1998 by Fritz Elfert (fritz@isdn4linux.de)
- * Thanks to Friedemann Baitinger and IBM Germany
- *
- * 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, or (at your option)
- * any later version.
+ * Author Fritz Elfert
+ * Copyright by Fritz Elfert
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Thanks to Friedemann Baitinger and IBM Germany
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/act2000/capi.c linux/drivers/isdn/act2000/capi.c
--- v2.4.10/linux/drivers/isdn/act2000/capi.c Fri Mar 2 11:12:10 2001
+++ linux/drivers/isdn/act2000/capi.c Sun Sep 30 12:26:05 2001
@@ -1,24 +1,15 @@
-/* $Id: capi.c,v 1.9.6.1 2001/02/16 16:43:23 kai Exp $
+/* $Id: capi.c,v 1.9.6.2 2001/09/23 22:24:32 kai Exp $
*
* ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
- * CAPI encoder/decoder
+ * CAPI encoder/decoder
*
- * Copyright 1998 by Fritz Elfert (fritz@isdn4linux.de)
- * Thanks to Friedemann Baitinger and IBM Germany
- *
- * 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, or (at your option)
- * any later version.
+ * Author Fritz Elfert
+ * Copyright by Fritz Elfert
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Thanks to Friedemann Baitinger and IBM Germany
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/act2000/capi.h linux/drivers/isdn/act2000/capi.h
--- v2.4.10/linux/drivers/isdn/act2000/capi.h Fri Mar 2 11:12:10 2001
+++ linux/drivers/isdn/act2000/capi.h Sun Sep 30 12:26:05 2001
@@ -1,23 +1,14 @@
-/* $Id: capi.h,v 1.6.6.1 2001/02/16 16:43:23 kai Exp $
+/* $Id: capi.h,v 1.6.6.2 2001/09/23 22:24:32 kai Exp $
*
* ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
*
- * Copyright 1998 by Fritz Elfert (fritz@isdn4linux.de)
- * Thanks to Friedemann Baitinger and IBM Germany
- *
- * 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, or (at your option)
- * any later version.
+ * Author Fritz Elfert
+ * Copyright by Fritz Elfert
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Thanks to Friedemann Baitinger and IBM Germany
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/act2000/module.c linux/drivers/isdn/act2000/module.c
--- v2.4.10/linux/drivers/isdn/act2000/module.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/isdn/act2000/module.c Sun Sep 30 12:26:05 2001
@@ -1,29 +1,21 @@
-/* $Id: module.c,v 1.14.6.3 2001/07/13 09:20:11 kai Exp $
+/* $Id: module.c,v 1.14.6.4 2001/09/23 22:24:32 kai Exp $
*
* ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
*
- * Copyright 1998 by Fritz Elfert (fritz@isdn4linux.de)
- * Thanks to Friedemann Baitinger and IBM Germany
- *
- * 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, or (at your option)
- * any later version.
+ * Author Fritz Elfert
+ * Copyright by Fritz Elfert
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Thanks to Friedemann Baitinger and IBM Germany
*
*/
#include "act2000.h"
#include "act2000_isa.h"
#include "capi.h"
+#include
#include
static unsigned short act2000_isa_ports[] =
@@ -41,9 +33,9 @@
static int act_irq = -1;
static char *act_id = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
-MODULE_DESCRIPTION( "Driver for IBM Active 2000 ISDN card");
+MODULE_DESCRIPTION( "ISDN4Linux: Driver for IBM Active 2000 ISDN card");
MODULE_AUTHOR( "Fritz Elfert");
-MODULE_SUPPORTED_DEVICE( "ISDN subsystem");
+MODULE_LICENSE( "GPL");
MODULE_PARM_DESC(act_bus, "BusType of first card, 1=ISA, 2=MCA, 3=PCMCIA, currently only ISA");
MODULE_PARM_DESC(membase, "Base port address of first card");
MODULE_PARM_DESC(act_irq, "IRQ of first card");
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/avm_cs.c linux/drivers/isdn/avmb1/avm_cs.c
--- v2.4.10/linux/drivers/isdn/avmb1/avm_cs.c Fri Mar 2 11:12:07 2001
+++ linux/drivers/isdn/avmb1/avm_cs.c Sun Sep 30 12:26:05 2001
@@ -1,10 +1,13 @@
-/*======================================================================
-
- A PCMCIA client driver for AVM B1/M1/M2
-
- Written by Carsten Paeth, calle@calle.in-berlin.de
-
-======================================================================*/
+/* $Id: avm_cs.c,v 1.4.6.3 2001/09/23 22:24:33 kai Exp $
+ *
+ * A PCMCIA client driver for AVM B1/M1/M2
+ *
+ * Copyright 1999 by Carsten Paeth
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
#include
#include
@@ -32,6 +35,12 @@
#include
#include
#include
+
+/*====================================================================*/
+
+MODULE_DESCRIPTION("CAPI4Linux: PCMCIA client driver for AVM B1/M1/M2");
+MODULE_AUTHOR("Carsten Paeth");
+MODULE_LICENSE("GPL");
/*====================================================================*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/avmcard.h linux/drivers/isdn/avmb1/avmcard.h
--- v2.4.10/linux/drivers/isdn/avmb1/avmcard.h Sat May 19 17:54:14 2001
+++ linux/drivers/isdn/avmb1/avmcard.h Sun Sep 30 12:26:05 2001
@@ -1,7 +1,9 @@
-/*
- * $Id: avmcard.h,v 1.8.6.3 2001/05/17 21:15:33 kai Exp $
+/* $Id: avmcard.h,v 1.8.6.4 2001/09/23 22:24:33 kai Exp $
*
- * Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1999 by Carsten Paeth
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/b1.c linux/drivers/isdn/avmb1/b1.c
--- v2.4.10/linux/drivers/isdn/avmb1/b1.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/avmb1/b1.c Sun Sep 30 12:26:05 2001
@@ -1,9 +1,11 @@
-/*
- * $Id: b1.c,v 1.20.6.6 2001/05/17 21:15:33 kai Exp $
+/* $Id: b1.c,v 1.20.6.7 2001/09/23 22:24:33 kai Exp $
*
* Common module for AVM B1 cards.
*
- * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1999 by Carsten Paeth
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
@@ -25,11 +27,13 @@
#include "capicmd.h"
#include "capiutil.h"
-static char *revision = "$Revision: 1.20.6.6 $";
+static char *revision = "$Revision: 1.20.6.7 $";
/* ------------------------------------------------------------- */
-MODULE_AUTHOR("Carsten Paeth ");
+MODULE_DESCRIPTION("CAPI4Linux: Common support for active AVM cards");
+MODULE_AUTHOR("Carsten Paeth");
+MODULE_LICENSE("GPL");
/* ------------------------------------------------------------- */
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/b1dma.c linux/drivers/isdn/avmb1/b1dma.c
--- v2.4.10/linux/drivers/isdn/avmb1/b1dma.c Wed Jul 25 17:10:20 2001
+++ linux/drivers/isdn/avmb1/b1dma.c Sun Sep 30 12:26:05 2001
@@ -1,10 +1,12 @@
-/*
- * $Id: b1dma.c,v 1.11.6.7 2001/07/18 16:02:15 kai Exp $
+/* $Id: b1dma.c,v 1.11.6.8 2001/09/23 22:24: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)
+ * Copyright 2000 by Carsten Paeth
*
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
*/
#include
@@ -30,11 +32,13 @@
#error FIXME: driver requires 32-bit platform
#endif
-static char *revision = "$Revision: 1.11.6.7 $";
+static char *revision = "$Revision: 1.11.6.8 $";
/* ------------------------------------------------------------- */
-MODULE_AUTHOR("Carsten Paeth ");
+MODULE_DESCRIPTION("CAPI4Linux: DMA support for active AVM cards");
+MODULE_AUTHOR("Carsten Paeth");
+MODULE_LICENSE("GPL");
static int suppress_pollack = 0;
MODULE_PARM(suppress_pollack, "0-1i");
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/b1isa.c linux/drivers/isdn/avmb1/b1isa.c
--- v2.4.10/linux/drivers/isdn/avmb1/b1isa.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/avmb1/b1isa.c Sun Sep 30 12:26:05 2001
@@ -1,10 +1,12 @@
-/*
- * $Id: b1isa.c,v 1.10.6.5 2001/05/17 20:41:51 kai Exp $
+/* $Id: b1isa.c,v 1.10.6.6 2001/09/23 22:24:33 kai Exp $
*
* Module for AVM B1 ISA-card.
*
- * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1999 by Carsten Paeth
*
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
*/
#include
@@ -22,11 +24,13 @@
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.10.6.5 $";
+static char *revision = "$Revision: 1.10.6.6 $";
/* ------------------------------------------------------------- */
-MODULE_AUTHOR("Carsten Paeth ");
+MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM B1 ISA card");
+MODULE_AUTHOR("Carsten Paeth");
+MODULE_LICENSE("GPL");
/* ------------------------------------------------------------- */
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/b1pci.c linux/drivers/isdn/avmb1/b1pci.c
--- v2.4.10/linux/drivers/isdn/avmb1/b1pci.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/avmb1/b1pci.c Sun Sep 30 12:26:05 2001
@@ -1,10 +1,12 @@
-/*
- * $Id: b1pci.c,v 1.29.6.4 2001/05/17 20:41:51 kai Exp $
+/* $Id: b1pci.c,v 1.29.6.5 2001/09/23 22:24:33 kai Exp $
*
* Module for AVM B1 PCI-card.
*
- * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1999 by Carsten Paeth
*
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
*/
#include
@@ -24,7 +26,7 @@
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.29.6.4 $";
+static char *revision = "$Revision: 1.29.6.5 $";
/* ------------------------------------------------------------- */
@@ -34,7 +36,9 @@
};
MODULE_DEVICE_TABLE(pci, b1pci_pci_tbl);
-MODULE_AUTHOR("Carsten Paeth ");
+MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM B1 PCI card");
+MODULE_AUTHOR("Carsten Paeth");
+MODULE_LICENSE("GPL");
/* ------------------------------------------------------------- */
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/b1pcmcia.c linux/drivers/isdn/avmb1/b1pcmcia.c
--- v2.4.10/linux/drivers/isdn/avmb1/b1pcmcia.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/avmb1/b1pcmcia.c Sun Sep 30 12:26:05 2001
@@ -1,10 +1,12 @@
-/*
- * $Id: b1pcmcia.c,v 1.12.6.4 2001/05/17 20:41:51 kai Exp $
+/* $Id: b1pcmcia.c,v 1.12.6.5 2001/09/23 22:24:33 kai Exp $
*
* Module for AVM B1/M1/M2 PCMCIA-card.
*
- * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1999 by Carsten Paeth
*
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
*/
#include
@@ -23,11 +25,13 @@
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.12.6.4 $";
+static char *revision = "$Revision: 1.12.6.5 $";
/* ------------------------------------------------------------- */
-MODULE_AUTHOR("Carsten Paeth ");
+MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM PCMCIA cards");
+MODULE_AUTHOR("Carsten Paeth");
+MODULE_LICENSE("GPL");
/* ------------------------------------------------------------- */
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/c4.c linux/drivers/isdn/avmb1/c4.c
--- v2.4.10/linux/drivers/isdn/avmb1/c4.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/avmb1/c4.c Sun Sep 30 12:26:05 2001
@@ -1,9 +1,11 @@
-/*
- * $Id: c4.c,v 1.20.6.10 2001/06/09 15:14:15 kai Exp $
+/* $Id: c4.c,v 1.20.6.11 2001/09/23 22:24:33 kai Exp $
*
* Module for AVM C4 & C2 card.
*
- * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1999 by Carsten Paeth
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
@@ -27,7 +29,7 @@
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.20.6.10 $";
+static char *revision = "$Revision: 1.20.6.11 $";
#undef CONFIG_C4_DEBUG
#undef CONFIG_C4_POLLDEBUG
@@ -43,7 +45,9 @@
};
MODULE_DEVICE_TABLE(pci, c4_pci_tbl);
-MODULE_AUTHOR("Carsten Paeth ");
+MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM C2/C4 cards");
+MODULE_AUTHOR("Carsten Paeth");
+MODULE_LICENSE("GPL");
MODULE_PARM(suppress_pollack, "0-1i");
/* ------------------------------------------------------------- */
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/capi.c linux/drivers/isdn/avmb1/capi.c
--- v2.4.10/linux/drivers/isdn/avmb1/capi.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/isdn/avmb1/capi.c Sun Sep 30 12:26:05 2001
@@ -1,9 +1,11 @@
-/*
- * $Id: capi.c,v 1.44.6.13 2001/08/13 07:46:15 kai Exp $
+/* $Id: capi.c,v 1.44.6.15 2001/09/28 08:05:29 kai Exp $
*
* CAPI 2.0 Interface for Linux
*
- * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1996 by Carsten Paeth
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
@@ -43,9 +45,11 @@
#include "capifs.h"
#endif
-static char *revision = "$Revision: 1.44.6.13 $";
+static char *revision = "$Revision: 1.44.6.15 $";
-MODULE_AUTHOR("Carsten Paeth (calle@calle.in-berlin.de)");
+MODULE_DESCRIPTION("CAPI4Linux: Userspace /dev/capi20 interface");
+MODULE_AUTHOR("Carsten Paeth");
+MODULE_LICENSE("GPL");
#undef _DEBUG_REFCOUNT /* alloc/free and open/close debug */
#undef _DEBUG_TTYFUNCS /* call to tty_driver */
@@ -768,7 +772,7 @@
if ((retval = copy_from_user(skb_put(skb, count), buf, count))) {
kfree_skb(skb);
- return retval;
+ return -EFAULT;
}
mlen = CAPIMSG_LEN(skb->data);
if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) {
@@ -1182,7 +1186,7 @@
skb_reserve(skb, CAPI_DATA_B3_REQ_LEN);
if ((retval = copy_from_user(skb_put(skb, count), buf, count))) {
kfree_skb(skb);
- return retval;
+ return -EFAULT;
}
while (skb_queue_len(&mp->outqueue) > CAPINC_MAX_SENDQUEUE) {
@@ -1360,7 +1364,7 @@
#ifdef _DEBUG_TTYFUNCS
printk(KERN_DEBUG "capinc_tty_write: copy_from_user=%d\n", retval);
#endif
- return retval;
+ return -EFAULT;
}
} else {
memcpy(skb_put(skb, count), buf, count);
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/capicmd.h linux/drivers/isdn/avmb1/capicmd.h
--- v2.4.10/linux/drivers/isdn/avmb1/capicmd.h Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/avmb1/capicmd.h Sun Sep 30 12:26:05 2001
@@ -1,11 +1,14 @@
-/*
- * $Id: capicmd.h,v 1.2.6.1 2001/05/17 20:41:51 kai Exp $
+/* $Id: capicmd.h,v 1.2.6.2 2001/09/23 22:24:33 kai Exp $
*
* CAPI 2.0 Interface for Linux
*
- * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1997 by Carsten Paeth
*
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
*/
+
#ifndef __CAPICMD_H__
#define __CAPICMD_H__
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/capidev.h linux/drivers/isdn/avmb1/capidev.h
--- v2.4.10/linux/drivers/isdn/avmb1/capidev.h Sat May 19 17:54:14 2001
+++ linux/drivers/isdn/avmb1/capidev.h Sun Sep 30 12:26:05 2001
@@ -1,9 +1,11 @@
-/*
- * $Id: capidev.h,v 1.6.6.1 2001/05/17 20:41:51 kai Exp $
+/* $Id: capidev.h,v 1.6.6.2 2001/09/23 22:24:33 kai Exp $
*
* CAPI 2.0 Interface for Linux
*
- * (c) Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1996 by Carsten Paeth
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/capidrv.c linux/drivers/isdn/avmb1/capidrv.c
--- v2.4.10/linux/drivers/isdn/avmb1/capidrv.c Sat May 19 17:54:14 2001
+++ linux/drivers/isdn/avmb1/capidrv.c Sun Sep 30 12:26:05 2001
@@ -1,9 +1,11 @@
-/*
- * $Id: capidrv.c,v 1.39.6.6 2001/05/17 20:41:51 kai Exp $
+/* $Id: capidrv.c,v 1.39.6.7 2001/09/23 22:24:33 kai Exp $
*
* ISDN4Linux Driver, using capi20 interface (kernelcapi)
*
- * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1997 by Carsten Paeth
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
@@ -33,10 +35,12 @@
#include "capicmd.h"
#include "capidrv.h"
-static char *revision = "$Revision: 1.39.6.6 $";
+static char *revision = "$Revision: 1.39.6.7 $";
static int debugmode = 0;
-MODULE_AUTHOR("Carsten Paeth ");
+MODULE_DESCRIPTION("CAPI4Linux: Interface to ISDN4Linux");
+MODULE_AUTHOR("Carsten Paeth");
+MODULE_LICENSE("GPL");
MODULE_PARM(debugmode, "i");
/* -------- type definitions ----------------------------------------- */
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/capidrv.h linux/drivers/isdn/avmb1/capidrv.h
--- v2.4.10/linux/drivers/isdn/avmb1/capidrv.h Sat May 19 17:54:14 2001
+++ linux/drivers/isdn/avmb1/capidrv.h Sun Sep 30 12:26:05 2001
@@ -1,11 +1,14 @@
-/*
- * $Id: capidrv.h,v 1.2.8.1 2001/05/17 20:41:51 kai Exp $
+/* $Id: capidrv.h,v 1.2.8.2 2001/09/23 22:24:33 kai Exp $
*
* ISDN4Linux Driver, using capi20 interface (kernelcapi)
*
- * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1997 by Carsten Paeth
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
+
#ifndef __CAPIDRV_H__
#define __CAPIDRV_H__
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/capifs.c linux/drivers/isdn/avmb1/capifs.c
--- v2.4.10/linux/drivers/isdn/avmb1/capifs.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/avmb1/capifs.c Sun Sep 30 12:26:05 2001
@@ -1,10 +1,12 @@
-/*
- * $Id: capifs.c,v 1.14.6.7 2001/05/24 08:29:08 kai Exp $
+/* $Id: capifs.c,v 1.14.6.8 2001/09/23 22:24:33 kai Exp $
*
- * (c) Copyright 2000 by Carsten Paeth (calle@calle.de)
+ * Copyright 2000 by Carsten Paeth
*
* Heavily based on devpts filesystem from H. Peter Anvin
*
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
*/
#include
@@ -26,9 +28,11 @@
#include
#include
-MODULE_AUTHOR("Carsten Paeth ");
+MODULE_DESCRIPTION("CAPI4Linux: /dev/capi/ filesystem");
+MODULE_AUTHOR("Carsten Paeth");
+MODULE_LICENSE("GPL");
-static char *revision = "$Revision: 1.14.6.7 $";
+static char *revision = "$Revision: 1.14.6.8 $";
struct capifs_ncci {
struct inode *inode;
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/capifs.h linux/drivers/isdn/avmb1/capifs.h
--- v2.4.10/linux/drivers/isdn/avmb1/capifs.h Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/avmb1/capifs.h Sun Sep 30 12:26:05 2001
@@ -1,7 +1,9 @@
-/*
- * $Id: capifs.h,v 1.2.6.1 2001/05/17 20:41:51 kai Exp $
+/* $Id: capifs.h,v 1.2.6.2 2001/09/23 22:24:33 kai Exp $
*
- * (c) Copyright 2000 by Carsten Paeth (calle@calle.de)
+ * Copyright 2000 by Carsten Paeth
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/capilli.h linux/drivers/isdn/avmb1/capilli.h
--- v2.4.10/linux/drivers/isdn/avmb1/capilli.h Thu Aug 12 09:42:33 1999
+++ linux/drivers/isdn/avmb1/capilli.h Sun Sep 30 12:26:05 2001
@@ -1,11 +1,14 @@
-/*
- * $Id: capilli.h,v 1.4 1999/07/23 08:51:05 calle Exp $
+/* $Id: capilli.h,v 1.4.8.1 2001/09/23 22:24:33 kai Exp $
*
* Kernel CAPI 2.0 Driver Interface for Linux
*
- * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1999 by Carsten Paeth
*
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
*/
+
#ifndef __CAPILLI_H__
#define __CAPILLI_H__
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/capiutil.c linux/drivers/isdn/avmb1/capiutil.c
--- v2.4.10/linux/drivers/isdn/avmb1/capiutil.c Sat May 19 17:54:14 2001
+++ linux/drivers/isdn/avmb1/capiutil.c Sun Sep 30 12:26:05 2001
@@ -1,12 +1,15 @@
-/*
- * $Id: capiutil.c,v 1.13.6.3 2001/05/17 20:41:51 kai Exp $
+/* $Id: capiutil.c,v 1.13.6.4 2001/09/23 22:24:33 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)
+ * Rewritten for Linux 1996 by Carsten Paeth
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
+
#include
#include
#include
@@ -17,6 +20,10 @@
#include
#include
#include "capiutil.h"
+
+MODULE_DESCRIPTION("CAPI4Linux: CAPI message conversion support");
+MODULE_AUTHOR("Carsten Paeth");
+MODULE_LICENSE("GPL");
/* from CAPI2.0 DDK AVM Berlin GmbH */
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/capiutil.h linux/drivers/isdn/avmb1/capiutil.h
--- v2.4.10/linux/drivers/isdn/avmb1/capiutil.h Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/avmb1/capiutil.h Sun Sep 30 12:26:05 2001
@@ -1,12 +1,15 @@
-/*
- * $Id: capiutil.h,v 1.5.6.1 2001/05/17 20:41:51 kai Exp $
- *
+/* $Id: capiutil.h,v 1.5.6.2 2001/09/23 22:24:33 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)
- *
+ *
+ * From CAPI 2.0 Development Kit AVM 1995 (msg.c)
+ * Rewritten for Linux 1996 by Carsten Paeth
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
*/
+
#ifndef __CAPIUTIL_H__
#define __CAPIUTIL_H__
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/kcapi.c linux/drivers/isdn/avmb1/kcapi.c
--- v2.4.10/linux/drivers/isdn/avmb1/kcapi.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/avmb1/kcapi.c Sun Sep 30 12:26:05 2001
@@ -1,11 +1,14 @@
-/*
- * $Id: kcapi.c,v 1.21.6.7 2001/06/09 15:14:15 kai Exp $
+/* $Id: kcapi.c,v 1.21.6.8 2001/09/23 22:24:33 kai Exp $
*
* Kernel CAPI 2.0 Module
*
- * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1999 by Carsten Paeth
*
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
*/
+
#define CONFIG_AVMB1_COMPAT
#include
@@ -30,7 +33,7 @@
#include
#endif
-static char *revision = "$Revision: 1.21.6.7 $";
+static char *revision = "$Revision: 1.21.6.8 $";
/* ------------------------------------------------------------- */
@@ -41,10 +44,12 @@
/* ------------------------------------------------------------- */
-int showcapimsgs = 0;
+static int showcapimsgs = 0;
-MODULE_AUTHOR("Carsten Paeth ");
-MODULE_PARM(showcapimsgs, "0-4i");
+MODULE_DESCRIPTION("CAPI4Linux: kernel CAPI layer");
+MODULE_AUTHOR("Carsten Paeth");
+MODULE_LICENSE("GPL");
+MODULE_PARM(showcapimsgs, "i");
/* ------------------------------------------------------------- */
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/t1isa.c linux/drivers/isdn/avmb1/t1isa.c
--- v2.4.10/linux/drivers/isdn/avmb1/t1isa.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/avmb1/t1isa.c Sun Sep 30 12:26:05 2001
@@ -1,10 +1,12 @@
-/*
- * $Id: t1isa.c,v 1.16.6.6 2001/05/17 21:15:33 kai Exp $
+/* $Id: t1isa.c,v 1.16.6.7 2001/09/23 22:24:34 kai Exp $
*
* Module for AVM T1 HEMA-card.
*
- * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1999 by Carsten Paeth
*
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
*/
#include
@@ -23,11 +25,13 @@
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.16.6.6 $";
+static char *revision = "$Revision: 1.16.6.7 $";
/* ------------------------------------------------------------- */
-MODULE_AUTHOR("Carsten Paeth ");
+MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM T1 HEMA ISA card");
+MODULE_AUTHOR("Carsten Paeth");
+MODULE_LICENSE("GPL");
/* ------------------------------------------------------------- */
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/avmb1/t1pci.c linux/drivers/isdn/avmb1/t1pci.c
--- v2.4.10/linux/drivers/isdn/avmb1/t1pci.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/avmb1/t1pci.c Sun Sep 30 12:26:05 2001
@@ -1,10 +1,12 @@
-/*
- * $Id: t1pci.c,v 1.13.6.5 2001/05/17 20:41:51 kai Exp $
+/* $Id: t1pci.c,v 1.13.6.6 2001/09/23 22:24:34 kai Exp $
*
* Module for AVM T1 PCI-card.
*
- * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
+ * Copyright 1999 by Carsten Paeth
*
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
*/
#include
@@ -24,7 +26,7 @@
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.13.6.5 $";
+static char *revision = "$Revision: 1.13.6.6 $";
#undef CONFIG_T1PCI_DEBUG
#undef CONFIG_T1PCI_POLLDEBUG
@@ -37,7 +39,9 @@
};
MODULE_DEVICE_TABLE(pci, t1pci_pci_tbl);
-MODULE_AUTHOR("Carsten Paeth ");
+MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM T1 PCI card");
+MODULE_AUTHOR("Carsten Paeth");
+MODULE_LICENSE("GPL");
/* ------------------------------------------------------------- */
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/divert/divert_init.c linux/drivers/isdn/divert/divert_init.c
--- v2.4.10/linux/drivers/isdn/divert/divert_init.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/divert/divert_init.c Sun Sep 30 12:26:05 2001
@@ -1,23 +1,11 @@
-/*
- * $Id: divert_init.c,v 1.5.6.2 2001/01/24 22:18:17 kai Exp $
+/* $Id divert_init.c,v 1.5.6.2 2001/01/24 22:18:17 kai Exp $
*
* Module init for DSS1 diversion services for i4l.
*
* Copyright 1999 by Werner Cornelius (werner@isdn4linux.de)
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
@@ -26,6 +14,10 @@
#include
#include "isdn_divert.h"
+MODULE_DESCRIPTION("ISDN4Linux: Call diversion support");
+MODULE_AUTHOR("Werner Cornelius");
+MODULE_LICENSE("GPL");
+
/********************/
/* needed externals */
/********************/
@@ -70,7 +62,7 @@
/* Module deinit code */
/**********************/
static void __exit divert_exit(void)
-{ long flags;
+{ unsigned long flags;
int i;
save_flags(flags);
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/divert/divert_procfs.c linux/drivers/isdn/divert/divert_procfs.c
--- v2.4.10/linux/drivers/isdn/divert/divert_procfs.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/divert/divert_procfs.c Sun Sep 30 12:26:05 2001
@@ -1,23 +1,11 @@
-/*
- * $Id: divert_procfs.c,v 1.11.6.1 2001/08/13 07:46:15 kai Exp $
+/* $Id: divert_procfs.c,v 1.11.6.2 2001/09/23 22:24:36 kai Exp $
*
* Filesystem handling for the diversion supplementary services.
*
* Copyright 1998 by Werner Cornelius (werner@isdn4linux.de)
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
@@ -50,7 +38,7 @@
put_info_buffer(char *cp)
{
struct divert_info *ib;
- long flags;
+ unsigned long flags;
if (if_used <= 0)
return;
@@ -145,7 +133,7 @@
static int
isdn_divert_open(struct inode *ino, struct file *filep)
{
- long flags;
+ unsigned long flags;
lock_kernel();
save_flags(flags);
@@ -168,7 +156,7 @@
isdn_divert_close(struct inode *ino, struct file *filep)
{
struct divert_info *inf;
- long flags;
+ unsigned long flags;
lock_kernel();
save_flags(flags);
@@ -199,7 +187,7 @@
{
divert_ioctl dioctl;
int i;
- long flags;
+ unsigned long flags;
divert_rule *rulep;
char *cp;
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/divert/isdn_divert.c linux/drivers/isdn/divert/isdn_divert.c
--- v2.4.10/linux/drivers/isdn/divert/isdn_divert.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/divert/isdn_divert.c Sun Sep 30 12:26:05 2001
@@ -1,30 +1,14 @@
-/*
- * $Id: isdn_divert.c,v 1.6.6.2 2001/02/16 16:43:25 kai Exp $
+/* $Id: isdn_divert.c,v 1.6.6.3 2001/09/23 22:24:36 kai Exp $
*
* DSS1 main diversion supplementary handling for i4l.
*
* Copyright 1999 by Werner Cornelius (werner@isdn4linux.de)
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
-
-#define __NO_VERSION__
-#include
#include
#include
#include "isdn_divert.h"
@@ -67,7 +51,7 @@
/* timer callback function */
/***************************/
static void deflect_timer_expire(ulong arg)
-{ long flags;
+{ unsigned long flags;
struct call_struc *cs = (struct call_struc *) arg;
save_flags(flags);
@@ -125,7 +109,7 @@
int cf_command(int drvid, int mode,
u_char proc, char *msn,
u_char service, char *fwd_nr, ulong *procid)
-{ long flags;
+{ unsigned long flags;
int retval,msnlen;
int fwd_len;
char *p,*ielenp,tmp[60];
@@ -221,7 +205,7 @@
int deflect_extern_action(u_char cmd, ulong callid, char *to_nr)
{ struct call_struc *cs;
isdn_ctrl ic;
- long flags;
+ unsigned long flags;
int i;
if ((cmd & 0x7F) > 2) return(-EINVAL); /* invalid command */
@@ -292,7 +276,7 @@
/********************************/
int insertrule(int idx, divert_rule *newrule)
{ struct deflect_struc *ds,*ds1=NULL;
- long flags;
+ unsigned long flags;
if (!(ds = (struct deflect_struc *) kmalloc(sizeof(struct deflect_struc),
GFP_KERNEL)))
@@ -338,7 +322,7 @@
/***********************************/
int deleterule(int idx)
{ struct deflect_struc *ds,*ds1;
- long flags;
+ unsigned long flags;
if (idx < 0)
{ save_flags(flags);
@@ -406,7 +390,7 @@
/*************************************************/
int isdn_divert_icall(isdn_ctrl *ic)
{ int retval = 0;
- long flags;
+ unsigned long flags;
struct call_struc *cs = NULL;
struct deflect_struc *dv;
char *p,*p1;
@@ -558,7 +542,7 @@
void deleteprocs(void)
{ struct call_struc *cs, *cs1;
- long flags;
+ unsigned long flags;
save_flags(flags);
cli();
@@ -716,7 +700,7 @@
int prot_stat_callback(isdn_ctrl *ic)
{ struct call_struc *cs, *cs1;
int i;
- long flags;
+ unsigned long flags;
cs = divert_head; /* start of list */
cs1 = NULL;
@@ -807,7 +791,7 @@
/***************************/
int isdn_divert_stat_callback(isdn_ctrl *ic)
{ struct call_struc *cs, *cs1;
- long flags;
+ unsigned long flags;
int retval;
retval = -1;
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/divert/isdn_divert.h linux/drivers/isdn/divert/isdn_divert.h
--- v2.4.10/linux/drivers/isdn/divert/isdn_divert.h Fri Nov 17 11:16:20 2000
+++ linux/drivers/isdn/divert/isdn_divert.h Sun Sep 30 12:26:05 2001
@@ -1,26 +1,13 @@
-/*
- * $Id: isdn_divert.h,v 1.5 2000/11/13 22:51:47 kai Exp $
+/* $Id: isdn_divert.h,v 1.5.6.1 2001/09/23 22:24:36 kai Exp $
*
* Header for the diversion supplementary ioctl interface.
*
* Copyright 1998 by Werner Cornelius (werner@ikt.de)
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
#include
#include
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/Divas_mod.c linux/drivers/isdn/eicon/Divas_mod.c
--- v2.4.10/linux/drivers/isdn/eicon/Divas_mod.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/eicon/Divas_mod.c Sun Sep 30 12:26:05 2001
@@ -1,23 +1,9 @@
-
/*
- *
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
#include
#include
#include
@@ -35,6 +21,10 @@
#include "uxio.h"
+MODULE_DESCRIPTION("ISDN4Linux: Driver for Eicon Diva Server cards");
+MODULE_AUTHOR("Armin Schindler");
+MODULE_LICENSE("GPL");
+
#ifdef MODULE
#include "idi.h"
void DIVA_DIDD_Write(DESCRIPTOR *, int);
@@ -51,7 +41,6 @@
printk(KERN_DEBUG "DIVA Server Driver - initialising\n");
printk(KERN_DEBUG "DIVA Server Driver - Version 2.0.16\n");
-
#if !defined(CONFIG_PCI)
printk(KERN_WARNING "CONFIG_PCI is not defined!\n");
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/adapter.h linux/drivers/isdn/eicon/adapter.h
--- v2.4.10/linux/drivers/isdn/eicon/adapter.h Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/eicon/adapter.h Sun Sep 30 12:26:05 2001
@@ -1,28 +1,14 @@
-
/*
+ * Main internal include file for Diva Server driver
*
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.7
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
-
-/* Main internal include file for Diva Server driver */
#if !defined(ADAPTER_H)
#define ADAPTER_H
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/bri.c linux/drivers/isdn/eicon/bri.c
--- v2.4.10/linux/drivers/isdn/eicon/bri.c Sat May 19 17:43:06 2001
+++ linux/drivers/isdn/eicon/bri.c Sun Sep 30 12:26:05 2001
@@ -1,23 +1,10 @@
-
/*
- *
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.8
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/common.c linux/drivers/isdn/eicon/common.c
--- v2.4.10/linux/drivers/isdn/eicon/common.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/isdn/eicon/common.c Sun Sep 30 12:26:05 2001
@@ -1,26 +1,12 @@
-
/*
- *
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.15
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
#include "eicon.h"
#include "sys.h"
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/constant.h linux/drivers/isdn/eicon/constant.h
--- v2.4.10/linux/drivers/isdn/eicon/constant.h Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/eicon/constant.h Sun Sep 30 12:26:05 2001
@@ -1,27 +1,12 @@
-
/*
- *
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.0
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
-
/*------------------------------------------------------------------*/
/* Q.931 information elements maximum length */
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/divalog.h linux/drivers/isdn/eicon/divalog.h
--- v2.4.10/linux/drivers/isdn/eicon/divalog.h Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/eicon/divalog.h Sun Sep 30 12:26:05 2001
@@ -1,31 +1,15 @@
-
/*
+ * Include file for defining the kernel loggger messages
+ * These definitions are shared between the klog driver and the
+ * klogd daemon process
*
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.0
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- */
-
-
-/*
- * Include file for defining the kernel loggger messages
- * These definitions are shared between the klog driver and the
- * klogd daemon process
*/
#if !defined(_KLOGMSG_H)
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/divas.h linux/drivers/isdn/eicon/divas.h
--- v2.4.10/linux/drivers/isdn/eicon/divas.h Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/eicon/divas.h Sun Sep 30 12:26:05 2001
@@ -1,28 +1,14 @@
-
/*
+ * External Diva Server driver include file
*
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.5
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
-
-/* External Diva Server driver include file */
#if !defined(DIVAS_H)
#define DIVAS_H
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/dsp_defs.h linux/drivers/isdn/eicon/dsp_defs.h
--- v2.4.10/linux/drivers/isdn/eicon/dsp_defs.h Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/eicon/dsp_defs.h Sun Sep 30 12:26:05 2001
@@ -1,26 +1,12 @@
-
/*
- *
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.0
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
#ifndef DSP_DEFS_H_
#define DSP_DEFS_H_
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/dspdids.h linux/drivers/isdn/eicon/dspdids.h
--- v2.4.10/linux/drivers/isdn/eicon/dspdids.h Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/eicon/dspdids.h Sun Sep 30 12:26:05 2001
@@ -1,26 +1,12 @@
-
/*
- *
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.0
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
#ifndef DSPDIDS_H_
#define DSPDIDS_H_
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/eicon.h linux/drivers/isdn/eicon/eicon.h
--- v2.4.10/linux/drivers/isdn/eicon/eicon.h Wed Jul 25 17:10:20 2001
+++ linux/drivers/isdn/eicon/eicon.h Sun Sep 30 12:26:05 2001
@@ -1,27 +1,15 @@
-/* $Id: eicon.h,v 1.23.6.4 2001/06/09 15:14:16 kai Exp $
+/* $Id: eicon.h,v 1.23.6.5 2001/09/23 22:24:37 kai Exp $
*
* ISDN low-level module for Eicon active ISDN-Cards.
*
- * Copyright 1998 by Fritz Elfert (fritz@isdn4linux.de)
+ * Copyright 1998 by Fritz Elfert (fritz@isdn4linux.de)
* Copyright 1998-2000 by Armin Schindler (mac@melware.de)
* Copyright 1999,2000 Cytronics & Melware (info@melware.de)
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
#ifndef eicon_h
#define eicon_h
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/eicon_dsp.h linux/drivers/isdn/eicon/eicon_dsp.h
--- v2.4.10/linux/drivers/isdn/eicon/eicon_dsp.h Sun Aug 13 10:05:32 2000
+++ linux/drivers/isdn/eicon/eicon_dsp.h Sun Sep 30 12:26:05 2001
@@ -1,25 +1,13 @@
-/* $Id: eicon_dsp.h,v 1.7 2000/05/07 08:51:04 armin Exp $
+/* $Id: eicon_dsp.h,v 1.7.6.1 2001/09/23 22:24:37 kai Exp $
*
* ISDN lowlevel-module for Eicon active cards.
- * DSP definitions
+ * DSP definitions
*
* Copyright 1999,2000 by Armin Schindler (mac@melware.de)
* Copyright 1999,2000 Cytronics & Melware (info@melware.de)
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/eicon_idi.c linux/drivers/isdn/eicon/eicon_idi.c
--- v2.4.10/linux/drivers/isdn/eicon/eicon_idi.c Wed Apr 18 11:49:13 2001
+++ linux/drivers/isdn/eicon/eicon_idi.c Sun Sep 30 12:26:05 2001
@@ -1,7 +1,7 @@
-/* $Id: eicon_idi.c,v 1.41.6.2 2001/04/07 21:41:44 armin Exp $
+/* $Id: eicon_idi.c,v 1.41.6.3 2001/09/23 22:24:37 kai Exp $
*
* ISDN lowlevel-module for Eicon active cards.
- * IDI interface
+ * IDI interface
*
* Copyright 1998-2000 by Armin Schindler (mac@melware.de)
* Copyright 1999,2000 Cytronics & Melware (info@melware.de)
@@ -11,19 +11,8 @@
* capabilities with Diva Server cards.
* (dor@deutschemailbox.de)
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
@@ -36,7 +25,7 @@
#undef EICON_FULL_SERVICE_OKTETT
-char *eicon_idi_revision = "$Revision: 1.41.6.2 $";
+char *eicon_idi_revision = "$Revision: 1.41.6.3 $";
eicon_manifbuf *manbuf;
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/eicon_idi.h linux/drivers/isdn/eicon/eicon_idi.h
--- v2.4.10/linux/drivers/isdn/eicon/eicon_idi.h Sun Aug 13 10:05:32 2000
+++ linux/drivers/isdn/eicon/eicon_idi.h Sun Sep 30 12:26:05 2001
@@ -1,4 +1,4 @@
-/* $Id: eicon_idi.h,v 1.11 2000/05/07 08:51:04 armin Exp $
+/* $Id: eicon_idi.h,v 1.11.6.1 2001/09/23 22:24:37 kai Exp $
*
* ISDN lowlevel-module for the Eicon active cards.
* IDI-Interface
@@ -6,20 +6,8 @@
* Copyright 1998-2000 by Armin Schindler (mac@melware.de)
* Copyright 1999,2000 Cytronics & Melware (info@melware.de)
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/eicon_io.c linux/drivers/isdn/eicon/eicon_io.c
--- v2.4.10/linux/drivers/isdn/eicon/eicon_io.c Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/eicon/eicon_io.c Sun Sep 30 12:26:05 2001
@@ -1,4 +1,4 @@
-/* $Id: eicon_io.c,v 1.13.6.1 2001/02/16 09:09:50 armin Exp $
+/* $Id: eicon_io.c,v 1.13.6.2 2001/09/23 22:24:37 kai Exp $
*
* ISDN low-level module for Eicon active ISDN-Cards.
* Code for communicating with hardware.
@@ -6,25 +6,13 @@
* Copyright 1999,2000 by Armin Schindler (mac@melware.de)
* Copyright 1999,2000 Cytronics & Melware (info@melware.de)
*
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
* Thanks to Eicon Networks for
* documents, informations and hardware.
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
*/
-
#include
#include "eicon.h"
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/eicon_isa.c linux/drivers/isdn/eicon/eicon_isa.c
--- v2.4.10/linux/drivers/isdn/eicon/eicon_isa.c Sun Aug 13 10:05:32 2000
+++ linux/drivers/isdn/eicon/eicon_isa.c Sun Sep 30 12:26:05 2001
@@ -1,4 +1,4 @@
-/* $Id: eicon_isa.c,v 1.16 2000/06/12 12:44:02 armin Exp $
+/* $Id: eicon_isa.c,v 1.16.6.1 2001/09/23 22:24:37 kai Exp $
*
* ISDN low-level module for Eicon active ISDN-Cards.
* Hardware-specific code for old ISA cards.
@@ -7,19 +7,8 @@
* Copyright 1998-2000 by Armin Schindler (mac@melware.de)
* Copyright 1999,2000 Cytronics & Melware (info@melware.de)
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
@@ -31,7 +20,7 @@
#define release_shmem release_region
#define request_shmem request_region
-char *eicon_isa_revision = "$Revision: 1.16 $";
+char *eicon_isa_revision = "$Revision: 1.16.6.1 $";
#undef EICON_MCA_DEBUG
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/eicon_isa.h linux/drivers/isdn/eicon/eicon_isa.h
--- v2.4.10/linux/drivers/isdn/eicon/eicon_isa.h Sun Aug 13 10:05:32 2000
+++ linux/drivers/isdn/eicon/eicon_isa.h Sun Sep 30 12:26:05 2001
@@ -1,4 +1,4 @@
-/* $Id: eicon_isa.h,v 1.10 2000/05/07 08:51:04 armin Exp $
+/* $Id: eicon_isa.h,v 1.10.6.1 2001/09/23 22:24:37 kai Exp $
*
* ISDN low-level module for Eicon active ISDN-Cards.
*
@@ -6,19 +6,8 @@
* Copyright 1998-2000 by Armin Schindler (mac@melware.de)
* Copyright 1999,2000 Cytronics & Melware (info@melware.de)
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/eicon_mod.c linux/drivers/isdn/eicon/eicon_mod.c
--- v2.4.10/linux/drivers/isdn/eicon/eicon_mod.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/isdn/eicon/eicon_mod.c Sun Sep 30 12:26:05 2001
@@ -1,4 +1,4 @@
-/* $Id: eicon_mod.c,v 1.37.6.5 2001/07/17 19:42:31 armin Exp $
+/* $Id: eicon_mod.c,v 1.37.6.6 2001/09/23 22:24:37 kai Exp $
*
* ISDN lowlevel-module for Eicon active cards.
*
@@ -6,6 +6,9 @@
* Copyright 1998-2000 by Armin Schindler (mac@melware.de)
* Copyright 1999,2000 Cytronics & Melware (info@melware.de)
*
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
* Thanks to Eicon Networks for
* documents, informations and hardware.
*
@@ -14,20 +17,6 @@
* capabilities with Diva Server cards.
* (dor@deutschemailbox.de)
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
*/
#define DRIVERNAME "Eicon active ISDN driver"
@@ -55,7 +44,7 @@
static eicon_card *cards = (eicon_card *) NULL; /* glob. var , contains
start of card-list */
-static char *eicon_revision = "$Revision: 1.37.6.5 $";
+static char *eicon_revision = "$Revision: 1.37.6.6 $";
extern char *eicon_pci_revision;
extern char *eicon_isa_revision;
@@ -84,9 +73,9 @@
#endif
static char *id = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
-MODULE_DESCRIPTION( "Driver for Eicon active ISDN cards");
+MODULE_DESCRIPTION( "ISDN4Linux: Driver for Eicon active ISDN cards");
MODULE_AUTHOR( "Armin Schindler");
-MODULE_SUPPORTED_DEVICE( "ISDN subsystem");
+MODULE_LICENSE( "GPL");
MODULE_PARM_DESC(id, "ID-String of first card");
MODULE_PARM(id, "s");
#ifdef CONFIG_ISDN_DRV_EICON_ISA
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/eicon_pci.c linux/drivers/isdn/eicon/eicon_pci.c
--- v2.4.10/linux/drivers/isdn/eicon/eicon_pci.c Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/eicon/eicon_pci.c Sun Sep 30 12:26:05 2001
@@ -1,4 +1,4 @@
-/* $Id: eicon_pci.c,v 1.15.6.2 2001/02/16 09:09:50 armin Exp $
+/* $Id: eicon_pci.c,v 1.15.6.3 2001/09/23 22:24:37 kai Exp $
*
* ISDN low-level module for Eicon active ISDN-Cards.
* Hardware-specific code for PCI cards.
@@ -6,23 +6,12 @@
* Copyright 1998-2000 by Armin Schindler (mac@melware.de)
* Copyright 1999,2000 Cytronics & Melware (info@melware.de)
*
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
* Thanks to Eicon Networks for
* documents, informations and hardware.
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
*/
#include
@@ -35,7 +24,7 @@
#include "adapter.h"
#include "uxio.h"
-char *eicon_pci_revision = "$Revision: 1.15.6.2 $";
+char *eicon_pci_revision = "$Revision: 1.15.6.3 $";
#if CONFIG_PCI /* intire stuff is only for PCI */
#ifdef CONFIG_ISDN_DRV_EICON_PCI
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/eicon_pci.h linux/drivers/isdn/eicon/eicon_pci.h
--- v2.4.10/linux/drivers/isdn/eicon/eicon_pci.h Sun Aug 13 10:05:32 2000
+++ linux/drivers/isdn/eicon/eicon_pci.h Sun Sep 30 12:26:05 2001
@@ -1,23 +1,12 @@
-/* $Id: eicon_pci.h,v 1.6 2000/05/07 08:51:04 armin Exp $
+/* $Id: eicon_pci.h,v 1.6.6.1 2001/09/23 22:24:37 kai Exp $
*
* ISDN low-level module for Eicon active ISDN-Cards (PCI part).
*
* Copyright 1998-2000 by Armin Schindler (mac@melware.de)
* Copyright 1999,2000 Cytronics & Melware (info@melware.de)
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/fourbri.c linux/drivers/isdn/eicon/fourbri.c
--- v2.4.10/linux/drivers/isdn/eicon/fourbri.c Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/eicon/fourbri.c Sun Sep 30 12:26:05 2001
@@ -1,28 +1,15 @@
-
/*
+ * Diva Server 4BRI specific part of initialisation
*
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.7
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
-/* Diva Server 4BRI specific part of initialisation */
#include "sys.h"
#include "idi.h"
#include "divas.h"
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/fpga.c linux/drivers/isdn/eicon/fpga.c
--- v2.4.10/linux/drivers/isdn/eicon/fpga.c Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/eicon/fpga.c Sun Sep 30 12:26:05 2001
@@ -1,26 +1,12 @@
-
/*
- *
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.2
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
#include "sys.h"
#include "idi.h"
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/idi.c linux/drivers/isdn/eicon/idi.c
--- v2.4.10/linux/drivers/isdn/eicon/idi.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/eicon/idi.c Sun Sep 30 12:26:05 2001
@@ -1,30 +1,14 @@
-
/*
+ * Core driver for Diva Server cards
+ * Implements the IDI interface
*
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.8
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- */
-
-
-/*
- * Core driver for Diva Server cards
- * Implements the IDI interface
*/
#include "idi.h"
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/idi.h linux/drivers/isdn/eicon/idi.h
--- v2.4.10/linux/drivers/isdn/eicon/idi.h Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/eicon/idi.h Sun Sep 30 12:26:05 2001
@@ -1,28 +1,14 @@
-
/*
+ * External IDI interface
*
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.0
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
-
-/* External IDI interface */
#if !defined(IDI_H)
#define IDI_H
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/kprintf.c linux/drivers/isdn/eicon/kprintf.c
--- v2.4.10/linux/drivers/isdn/eicon/kprintf.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/eicon/kprintf.c Sun Sep 30 12:26:05 2001
@@ -1,31 +1,14 @@
-
/*
+ * Source file for kernel interface to kernel log facility
*
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.3
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
-
-/*
- * Source file for kernel interface to kernel log facility
- */
-
#include "eicon.h"
#include "sys.h"
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/lincfg.c linux/drivers/isdn/eicon/lincfg.c
--- v2.4.10/linux/drivers/isdn/eicon/lincfg.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/isdn/eicon/lincfg.c Sun Sep 30 12:26:05 2001
@@ -1,26 +1,12 @@
-
/*
- *
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.9
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
#include
#undef N_DATA /* Because we have our own definition */
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/linchr.c linux/drivers/isdn/eicon/linchr.c
--- v2.4.10/linux/drivers/isdn/eicon/linchr.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/isdn/eicon/linchr.c Sun Sep 30 12:26:05 2001
@@ -1,23 +1,10 @@
-
/*
- *
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.12
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/linio.c linux/drivers/isdn/eicon/linio.c
--- v2.4.10/linux/drivers/isdn/eicon/linio.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/eicon/linio.c Sun Sep 30 12:26:05 2001
@@ -1,26 +1,12 @@
-
/*
- *
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.16
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
#define N_DATA
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/linsys.c linux/drivers/isdn/eicon/linsys.c
--- v2.4.10/linux/drivers/isdn/eicon/linsys.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/isdn/eicon/linsys.c Sun Sep 30 12:26:05 2001
@@ -1,26 +1,12 @@
-
/*
- *
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.10
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
#include
#undef N_DATA
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/log.c linux/drivers/isdn/eicon/log.c
--- v2.4.10/linux/drivers/isdn/eicon/log.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/isdn/eicon/log.c Sun Sep 30 12:26:05 2001
@@ -1,29 +1,13 @@
-
/*
+ * Source file for diva log facility
*
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.5
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- */
-
-
-/*
- * Source file for diva log facility
*/
#include "sys.h"
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/pc.h linux/drivers/isdn/eicon/pc.h
--- v2.4.10/linux/drivers/isdn/eicon/pc.h Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/eicon/pc.h Sun Sep 30 12:26:05 2001
@@ -1,26 +1,12 @@
-
/*
- *
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.2
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
#ifndef PC_H_INCLUDED
#define PC_H_INCLUDED
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/pc_maint.h linux/drivers/isdn/eicon/pc_maint.h
--- v2.4.10/linux/drivers/isdn/eicon/pc_maint.h Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/eicon/pc_maint.h Sun Sep 30 12:26:05 2001
@@ -1,26 +1,12 @@
-
/*
- *
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.0
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
#ifndef PC_MAINT_H
#define PC_MAINT_H
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/pr_pc.h linux/drivers/isdn/eicon/pr_pc.h
--- v2.4.10/linux/drivers/isdn/eicon/pr_pc.h Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/eicon/pr_pc.h Sun Sep 30 12:26:05 2001
@@ -1,23 +1,10 @@
-
/*
- *
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.0
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/pri.c linux/drivers/isdn/eicon/pri.c
--- v2.4.10/linux/drivers/isdn/eicon/pri.c Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/eicon/pri.c Sun Sep 30 12:26:05 2001
@@ -1,28 +1,15 @@
-
/*
+ * Diva Server PRI specific part of initialisation
*
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.5
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
-/* Diva Server PRI specific part of initialisation */
#include "sys.h"
#include "idi.h"
#include "divas.h"
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/sys.h linux/drivers/isdn/eicon/sys.h
--- v2.4.10/linux/drivers/isdn/eicon/sys.h Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/eicon/sys.h Sun Sep 30 12:26:05 2001
@@ -1,28 +1,14 @@
-
/*
+ * Environment provided by system and miscellaneous definitions
*
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.2
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
-
-
-/* Environment provided by system and miscellaneous definitions */
#if !defined(SYS_H)
#define SYS_H
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/uxio.h linux/drivers/isdn/eicon/uxio.h
--- v2.4.10/linux/drivers/isdn/eicon/uxio.h Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/eicon/uxio.h Sun Sep 30 12:26:05 2001
@@ -1,29 +1,13 @@
-
/*
+ * Interface to Unix specific code for performing card I/O
*
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.6
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- */
-
-
-/*
- * Interface to Unix specific code for performing card I/O
*/
#if !defined(UXIO_H)
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/eicon/xlog.c linux/drivers/isdn/eicon/xlog.c
--- v2.4.10/linux/drivers/isdn/eicon/xlog.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/isdn/eicon/xlog.c Sun Sep 30 12:26:05 2001
@@ -1,30 +1,14 @@
-
/*
+ * Unix Eicon active card driver
+ * XLOG related functions
*
* Copyright (C) Eicon Technology Corporation, 2000.
*
* Eicon File Revision : 1.2
*
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- */
-
-
-/*
- * Unix Eicon active card driver
- * XLOG related functions
*/
#include "sys.h"
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/amd7930.c linux/drivers/isdn/hisax/amd7930.c
--- v2.4.10/linux/drivers/isdn/hisax/amd7930.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/hisax/amd7930.c Sun Sep 30 12:26:05 2001
@@ -1,8 +1,12 @@
-/* $Id: amd7930.c,v 1.5.6.3 2001/06/11 22:08:37 kai Exp $
+/* $Id: amd7930.c,v 1.5.6.4 2001/09/23 22:24:46 kai Exp $
*
* HiSax ISDN driver - chip specific routines for AMD 7930
*
- * Author Brent Baccala (baccala@FreeSoft.org)
+ * Author Brent Baccala
+ * Copyright by Brent Baccala
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
* - Existing ISDN HiSax driver provides all the smarts
* - it compiles, runs, talks to an isolated phone switch, connects
@@ -94,7 +98,7 @@
#include "rawhdlc.h"
#include
-static const char *amd7930_revision = "$Revision: 1.5.6.3 $";
+static const char *amd7930_revision = "$Revision: 1.5.6.4 $";
#define RCV_BUFSIZE 1024 /* Size of raw receive buffer in bytes */
#define RCV_BUFBLKS 4 /* Number of blocks to divide buffer into
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/arcofi.c linux/drivers/isdn/hisax/arcofi.c
--- v2.4.10/linux/drivers/isdn/hisax/arcofi.c Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/hisax/arcofi.c Sun Sep 30 12:26:05 2001
@@ -1,10 +1,12 @@
-/* $Id: arcofi.c,v 1.12.6.1 2001/02/16 16:43:25 kai Exp $
+/* $Id: arcofi.c,v 1.12.6.2 2001/09/23 22:24:46 kai Exp $
*
- * arcofi.c Ansteuerung ARCOFI 2165
+ * Ansteuerung ARCOFI 2165
*
- * Author Karsten Keil (keil@isdn4linux.de)
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
*
- * This file is (c) under GNU General Public License
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/arcofi.h linux/drivers/isdn/hisax/arcofi.h
--- v2.4.10/linux/drivers/isdn/hisax/arcofi.h Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/hisax/arcofi.h Sun Sep 30 12:26:05 2001
@@ -1,10 +1,12 @@
-/* $Id: arcofi.h,v 1.6.6.1 2001/02/16 16:43:25 kai Exp $
+/* $Id: arcofi.h,v 1.6.6.2 2001/09/23 22:24:46 kai Exp $
*
- * arcofi.h Ansteuerung ARCOFI 2165
+ * Ansteuerung ARCOFI 2165
*
- * Author Karsten Keil (keil@isdn4linux.de)
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
*
- * This file is (c) under GNU General Public License
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/asuscom.c linux/drivers/isdn/hisax/asuscom.c
--- v2.4.10/linux/drivers/isdn/hisax/asuscom.c Wed Jul 25 17:10:20 2001
+++ linux/drivers/isdn/hisax/asuscom.c Sun Sep 30 12:26:05 2001
@@ -1,12 +1,14 @@
-/* $Id: asuscom.c,v 1.11.6.2 2001/07/13 09:20:12 kai Exp $
+/* $Id: asuscom.c,v 1.11.6.3 2001/09/23 22:24:46 kai Exp $
*
- * asuscom.c low level stuff for ASUSCOM NETWORK INC. ISDNLink cards
+ * low level stuff for ASUSCOM NETWORK INC. ISDNLink cards
*
- * Author Karsten Keil (keil@isdn4linux.de)
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
*
- * Thanks to ASUSCOM NETWORK INC. Taiwan and Dynalink NL for informations
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- * This file is (c) under GNU General Public License
+ * Thanks to ASUSCOM NETWORK INC. Taiwan and Dynalink NL for information
*
*/
@@ -20,7 +22,7 @@
extern const char *CardType[];
-const char *Asuscom_revision = "$Revision: 1.11.6.2 $";
+const char *Asuscom_revision = "$Revision: 1.11.6.3 $";
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/avm_a1.c linux/drivers/isdn/hisax/avm_a1.c
--- v2.4.10/linux/drivers/isdn/hisax/avm_a1.c Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/hisax/avm_a1.c Sun Sep 30 12:26:05 2001
@@ -1,12 +1,15 @@
-/* $Id: avm_a1.c,v 2.13.6.1 2001/02/16 16:43:25 kai Exp $
+/* $Id: avm_a1.c,v 2.13.6.2 2001/09/23 22:24:46 kai Exp $
*
- * avm_a1.c low level stuff for AVM A1 (Fritz) isdn cards
+ * low level stuff for AVM A1 (Fritz) isdn cards
*
- * Author Karsten Keil (keil@isdn4linux.de)
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
*
- * This file is (c) under GNU General Public License
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
+
#define __NO_VERSION__
#include
#include "hisax.h"
@@ -15,7 +18,7 @@
#include "isdnl1.h"
extern const char *CardType[];
-static const char *avm_revision = "$Revision: 2.13.6.1 $";
+static const char *avm_revision = "$Revision: 2.13.6.2 $";
#define AVM_A1_STAT_ISAC 0x01
#define AVM_A1_STAT_HSCX 0x02
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/avm_a1p.c linux/drivers/isdn/hisax/avm_a1p.c
--- v2.4.10/linux/drivers/isdn/hisax/avm_a1p.c Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/hisax/avm_a1p.c Sun Sep 30 12:26:05 2001
@@ -1,14 +1,18 @@
-/* $Id: avm_a1p.c,v 2.7.6.1 2001/02/16 16:43:25 kai Exp $
+/* $Id: avm_a1p.c,v 2.7.6.2 2001/09/23 22:24:46 kai Exp $
*
- * avm_a1p.c low level stuff for the following AVM cards:
- * A1 PCMCIA
- * FRITZ!Card PCMCIA
- * FRITZ!Card PCMCIA 2.0
+ * low level stuff for the following AVM cards:
+ * A1 PCMCIA
+ * FRITZ!Card PCMCIA
+ * FRITZ!Card PCMCIA 2.0
*
- * Author Carsten Paeth (calle@calle.in-berlin.de)
+ * Author Carsten Paeth
+ * Copyright by Carsten Paeth
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- * This file is (c) under GNU General Public License
*/
+
#define __NO_VERSION__
#include
#include "hisax.h"
@@ -53,7 +57,7 @@
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
-static const char *avm_revision = "$Revision: 2.7.6.1 $";
+static const char *avm_revision = "$Revision: 2.7.6.2 $";
static inline u_char
ReadISAC(struct IsdnCardState *cs, u_char offset)
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/avm_pci.c linux/drivers/isdn/hisax/avm_pci.c
--- v2.4.10/linux/drivers/isdn/hisax/avm_pci.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/hisax/avm_pci.c Sun Sep 30 12:26:05 2001
@@ -1,13 +1,17 @@
-/* $Id: avm_pci.c,v 1.22.6.5 2001/06/09 15:14:16 kai Exp $
+/* $Id: avm_pci.c,v 1.22.6.6 2001/09/23 22:24:46 kai Exp $
*
- * avm_pci.c low level stuff for AVM Fritz!PCI and ISA PnP isdn cards
- * Thanks to AVM, Berlin for informations
+ * low level stuff for AVM Fritz!PCI and ISA PnP isdn cards
*
- * Author Karsten Keil (keil@isdn4linux.de)
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
*
- * This file is (c) under GNU General Public License
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ * Thanks to AVM, Berlin for information
*
*/
+
#define __NO_VERSION__
#include
#include
@@ -18,7 +22,7 @@
#include
extern const char *CardType[];
-static const char *avm_pci_rev = "$Revision: 1.22.6.5 $";
+static const char *avm_pci_rev = "$Revision: 1.22.6.6 $";
#define AVM_FRITZ_PCI 1
#define AVM_FRITZ_PNP 2
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/bkm_a4t.c linux/drivers/isdn/hisax/bkm_a4t.c
--- v2.4.10/linux/drivers/isdn/hisax/bkm_a4t.c Wed Jul 25 17:10:20 2001
+++ linux/drivers/isdn/hisax/bkm_a4t.c Sun Sep 30 12:26:05 2001
@@ -1,12 +1,12 @@
-/* $Id: bkm_a4t.c,v 1.13.6.5 2001/07/18 16:02:15 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
- * derived from the original file netjet.c
+/* $Id: bkm_a4t.c,v 1.13.6.6 2001/09/23 22:24:46 kai Exp $
*
- * Author Roland Klabunde (R.Klabunde@Berkom.de)
+ * low level stuff for T-Berkom A4T
*
- * This file is (c) under GNU General Public License
+ * Author Roland Klabunde
+ * Copyright by Roland Klabunde
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
@@ -24,7 +24,7 @@
extern const char *CardType[];
-const char *bkm_a4t_revision = "$Revision: 1.13.6.5 $";
+const char *bkm_a4t_revision = "$Revision: 1.13.6.6 $";
static inline u_char
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/bkm_a8.c linux/drivers/isdn/hisax/bkm_a8.c
--- v2.4.10/linux/drivers/isdn/hisax/bkm_a8.c Wed Jul 25 17:10:20 2001
+++ linux/drivers/isdn/hisax/bkm_a8.c Sun Sep 30 12:26:05 2001
@@ -1,14 +1,15 @@
-/* $Id: bkm_a8.c,v 1.14.6.6 2001/07/18 16:02:15 kai 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
- * derived from the original file netjet.c
+/* $Id: bkm_a8.c,v 1.14.6.7 2001/09/23 22:24:46 kai Exp $
*
- * Author Roland Klabunde (R.Klabunde@Berkom.de)
+ * low level stuff for Scitel Quadro (4*S0, passive)
*
- * This file is (c) under GNU General Public License
+ * Author Roland Klabunde
+ * Copyright by Roland Klabunde
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
+
#define __NO_VERSION__
#include
@@ -27,7 +28,7 @@
extern const char *CardType[];
-const char sct_quadro_revision[] = "$Revision: 1.14.6.6 $";
+const char sct_quadro_revision[] = "$Revision: 1.14.6.7 $";
static const char *sct_quadro_subtypes[] =
{
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/bkm_ax.h linux/drivers/isdn/hisax/bkm_ax.h
--- v2.4.10/linux/drivers/isdn/hisax/bkm_ax.h Fri Mar 2 18:38:37 2001
+++ linux/drivers/isdn/hisax/bkm_ax.h Sun Sep 30 12:26:05 2001
@@ -1,9 +1,12 @@
-/* $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)
+/* $Id: bkm_ax.h,v 1.5.6.3 2001/09/23 22:24:46 kai Exp $
*
- * Author Roland Klabunde (R.Klabunde@Berkom.de)
+ * low level decls for T-Berkom cards A4T and Scitel Quadro (4*S0, passive)
*
- * This file is (c) under GNU General Public License
+ * Author Roland Klabunde
+ * Copyright by Roland Klabunde
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/callc.c linux/drivers/isdn/hisax/callc.c
--- v2.4.10/linux/drivers/isdn/hisax/callc.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/hisax/callc.c Sun Sep 30 12:26:05 2001
@@ -1,17 +1,23 @@
-/* $Id: callc.c,v 2.51.6.5 2001/08/23 19:44:23 kai Exp $
+/* $Id: callc.c,v 2.51.6.6 2001/09/23 22:24:46 kai Exp $
*
- * Author Karsten Keil (keil@isdn4linux.de)
- * based on the teles driver from Jan den Ouden
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- * This file is (c) under GNU General Public License
- * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * For changes and modifications please read
+ * ../../../Documentation/isdn/HiSax.cert
+ *
+ * based on the teles driver from Jan den Ouden
*
* Thanks to Jan den Ouden
* Fritz Elfert
*
*/
+
#define __NO_VERSION__
+#include
#include
#include "hisax.h"
#include "../avmb1/capicmd.h" /* this should be moved in a common place */
@@ -20,7 +26,7 @@
#define MOD_USE_COUNT ( GET_USE_COUNT (&__this_module))
#endif /* MODULE */
-const char *lli_revision = "$Revision: 2.51.6.5 $";
+const char *lli_revision = "$Revision: 2.51.6.6 $";
extern struct IsdnCard cards[];
extern int nrcards;
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/cert.c linux/drivers/isdn/hisax/cert.c
--- v2.4.10/linux/drivers/isdn/hisax/cert.c Sun Aug 12 13:27:59 2001
+++ linux/drivers/isdn/hisax/cert.c Sun Sep 30 12:26:05 2001
@@ -1,10 +1,13 @@
-/* $Id: cert.c,v 2.3.6.2 2001/07/27 09:08:27 kai Exp $
+/* $Id: cert.c,v 2.3.6.3 2001/09/23 22:24:47 kai Exp $
*
- * Author Karsten Keil (keil@isdn4linux.de)
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- * This file is (c) under GNU General Public License
- * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * For changes and modifications please read
+ * ../../../Documentation/isdn/HiSax.cert
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/config.c linux/drivers/isdn/hisax/config.c
--- v2.4.10/linux/drivers/isdn/hisax/config.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/hisax/config.c Sun Sep 30 12:26:05 2001
@@ -1,11 +1,19 @@
-/* $Id: config.c,v 2.57.6.18 2001/08/27 22:19:05 kai Exp $
+/* $Id: config.c,v 2.57.6.20 2001/09/23 22:24:47 kai Exp $
*
- * Author Karsten Keil (keil@isdn4linux.de)
- * based on the teles driver from Jan den Ouden
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
+ * by Kai Germaschewski
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- * This file is (c) under GNU General Public License
+ * For changes and modifications please read
+ * ../../../Documentation/isdn/HiSax.cert
+ *
+ * based on the teles driver from Jan den Ouden
*
*/
+
#include
#include
#include
@@ -365,7 +373,9 @@
static int mem[8] __devinitdata = { 0, };
static char *id __devinitdata = HiSaxID;
+MODULE_DESCRIPTION("ISDN4Linux: Driver for passive ISDN cards");
MODULE_AUTHOR("Karsten Keil");
+MODULE_LICENSE("GPL");
MODULE_PARM(type, "1-8i");
MODULE_PARM(protocol, "1-8i");
MODULE_PARM(io, "1-8i");
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/diva.c linux/drivers/isdn/hisax/diva.c
--- v2.4.10/linux/drivers/isdn/hisax/diva.c Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/hisax/diva.c Sun Sep 30 12:26:05 2001
@@ -1,14 +1,17 @@
-/* $Id: diva.c,v 1.25.6.4 2001/02/16 16:43:25 kai Exp $
+/* $Id: diva.c,v 1.25.6.5 2001/09/23 22:24:47 kai Exp $
*
- * diva.c low level stuff for Eicon.Diehl Diva Family ISDN cards
+ * low level stuff for Eicon.Diehl Diva Family ISDN cards
*
- * Author Karsten Keil (keil@isdn4linux.de)
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- * This file is (c) under GNU General Public License
- * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * For changes and modifications please read
+ * ../../../Documentation/isdn/HiSax.cert
*
- * Thanks to Eicon Technology for documents and informations
+ * Thanks to Eicon Technology for documents and information
*
*/
@@ -24,7 +27,7 @@
extern const char *CardType[];
-const char *Diva_revision = "$Revision: 1.25.6.4 $";
+const char *Diva_revision = "$Revision: 1.25.6.5 $";
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/elsa.c linux/drivers/isdn/hisax/elsa.c
--- v2.4.10/linux/drivers/isdn/hisax/elsa.c Wed Jul 25 17:10:20 2001
+++ linux/drivers/isdn/hisax/elsa.c Sun Sep 30 12:26:05 2001
@@ -1,14 +1,17 @@
-/* $Id: elsa.c,v 2.26.6.5 2001/07/18 16:25:12 kai Exp $
+/* $Id: elsa.c,v 2.26.6.6 2001/09/23 22:24:47 kai Exp $
*
- * elsa.c low level stuff for Elsa isdn cards
+ * low level stuff for Elsa isdn cards
*
- * Author Karsten Keil (keil@isdn4linux.de)
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- * This file is (c) under GNU General Public License
- * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * For changes and modifications please read
+ * ../../../Documentation/isdn/HiSax.cert
*
- * Thanks to Elsa GmbH for documents and informations
+ * Thanks to Elsa GmbH for documents and information
*
* Klaus Lichtenwalder (Klaus.Lichtenwalder@WebForum.DE)
* for ELSA PCMCIA support
@@ -30,7 +33,7 @@
extern const char *CardType[];
-const char *Elsa_revision = "$Revision: 2.26.6.5 $";
+const char *Elsa_revision = "$Revision: 2.26.6.6 $";
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 --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/elsa_cs.c linux/drivers/isdn/hisax/elsa_cs.c
--- v2.4.10/linux/drivers/isdn/hisax/elsa_cs.c Wed Apr 18 11:49:13 2001
+++ linux/drivers/isdn/hisax/elsa_cs.c Sun Sep 30 12:26:05 2001
@@ -4,6 +4,7 @@
This driver is for the Elsa PCM ISDN Cards, i.e. the MicroLink
+
The contents of this file are subject to the Mozilla Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
@@ -21,6 +22,17 @@
Modifications from dummy_cs.c are Copyright (C) 1999-2001 Klaus
Lichtenwalder . All Rights Reserved.
+ Alternatively, the contents of this file may be used under the
+ terms of the GNU General Public License version 2 (the "GPL"), in
+ which case the provisions of the GPL are applicable instead of the
+ above. If you wish to allow the use of your version of this file
+ only under the terms of the GPL and not to allow others to use
+ your version of this file under the MPL, indicate your decision
+ by deleting the provisions above and replace them with the notice
+ and other provisions required by the GPL. If you do not delete
+ the provisions above, a recipient may use your version of this
+ file under either the MPL or the GPL.
+
======================================================================*/
#include
@@ -43,6 +55,10 @@
#include
#include
+MODULE_DESCRIPTION("ISDN4Linux: PCMCIA client driver for Elsa PCM cards");
+MODULE_AUTHOR("Klaus Lichtenwalder");
+MODULE_LICENSE("Dual MPL/GPL");
+
/*
All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
you do not define PCMCIA_DEBUG at all, all the debug code will be
@@ -56,7 +72,7 @@
MODULE_PARM(pc_debug, "i");
#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
static char *version =
-"elsa_cs.c $Revision: 1.1.2.1 $ $Date: 2001/04/15 08:01:34 $ (K.Lichtenwalder)";
+"elsa_cs.c $Revision: 1.1.2.2 $ $Date: 2001/09/23 22:24:47 $ (K.Lichtenwalder)";
#else
#define DEBUG(n, args...)
#endif
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/elsa_ser.c linux/drivers/isdn/hisax/elsa_ser.c
--- v2.4.10/linux/drivers/isdn/hisax/elsa_ser.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/hisax/elsa_ser.c Sun Sep 30 12:26:05 2001
@@ -1,10 +1,12 @@
-/* $Id: elsa_ser.c,v 2.10.6.3 2001/08/17 12:34:26 kai Exp $
+/* $Id: elsa_ser.c,v 2.10.6.4 2001/09/23 22:24:47 kai Exp $
*
* stuff for the serial modem on ELSA cards
*
- * This file is (c) under GNU General Public License
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
+
#include
#include
#include
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/fsm.c linux/drivers/isdn/hisax/fsm.c
--- v2.4.10/linux/drivers/isdn/hisax/fsm.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/hisax/fsm.c Sun Sep 30 12:26:05 2001
@@ -1,15 +1,21 @@
-/* $Id: fsm.c,v 1.14.6.3 2001/08/23 19:44:23 kai Exp $
+/* $Id: fsm.c,v 1.14.6.4 2001/09/23 22:24:47 kai Exp $
*
- * Author Karsten Keil (keil@isdn4linux.de)
- * based on the teles driver from Jan den Ouden
+ * Finite state machine
+ *
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
+ * by Kai Germaschewski
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
* Thanks to Jan den Ouden
* Fritz Elfert
*
- * This file is (c) under GNU General Public License
- *
*/
+
#define __NO_VERSION__
+#include
#include
#include "hisax.h"
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/fsm.h linux/drivers/isdn/hisax/fsm.h
--- v2.4.10/linux/drivers/isdn/hisax/fsm.h Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/hisax/fsm.h Sun Sep 30 12:26:05 2001
@@ -1,3 +1,16 @@
+/* $Id: fsm.h,v 1.3.2.2 2001/09/23 22:24:47 kai Exp $
+ *
+ * Finite state machine
+ *
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
+ * by Kai Germaschewski
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
#ifndef __FSM_H__
#define __FSM_H__
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/gazel.c linux/drivers/isdn/hisax/gazel.c
--- v2.4.10/linux/drivers/isdn/hisax/gazel.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/hisax/gazel.c Sun Sep 30 12:26:05 2001
@@ -1,13 +1,16 @@
-/* $Id: gazel.c,v 2.11.6.6 2001/06/08 08:48:46 kai Exp $
+/* $Id: gazel.c,v 2.11.6.7 2001/09/23 22:24:47 kai Exp $
*
- * gazel.c low level stuff for Gazel isdn cards
+ * low level stuff for Gazel isdn cards
*
* Author BeWan Systems
* based on source code from Karsten Keil
- *
- * This file is (c) under GNU General Public License
+ * Copyright by BeWan Systems
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
+
#include
#include
#define __NO_VERSION__
@@ -19,7 +22,7 @@
#include
extern const char *CardType[];
-const char *gazel_revision = "$Revision: 2.11.6.6 $";
+const char *gazel_revision = "$Revision: 2.11.6.7 $";
#define R647 1
#define R685 2
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/hfc_2bds0.c linux/drivers/isdn/hisax/hfc_2bds0.c
--- v2.4.10/linux/drivers/isdn/hisax/hfc_2bds0.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/hisax/hfc_2bds0.c Sun Sep 30 12:26:05 2001
@@ -1,12 +1,15 @@
-/* $Id: hfc_2bds0.c,v 1.15.6.2 2001/06/09 15:14:17 kai Exp $
+/* $Id: hfc_2bds0.c,v 1.15.6.3 2001/09/23 22:24:47 kai Exp $
*
- * specific routines for CCD's HFC 2BDS0
+ * specific routines for CCD's HFC 2BDS0
*
- * Author Karsten Keil (keil@isdn4linux.de)
- *
- * This file is (c) under GNU General Public License
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
+
#define __NO_VERSION__
#include
#include "hisax.h"
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/hfc_2bds0.h linux/drivers/isdn/hisax/hfc_2bds0.h
--- v2.4.10/linux/drivers/isdn/hisax/hfc_2bds0.h Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/hisax/hfc_2bds0.h Sun Sep 30 12:26:05 2001
@@ -1,10 +1,12 @@
-/* $Id: hfc_2bds0.h,v 1.4.6.1 2001/02/16 16:43:27 kai Exp $
+/* $Id: hfc_2bds0.h,v 1.4.6.2 2001/09/23 22:24:47 kai Exp $
*
- * specific defines for CCD's HFC 2BDS0
+ * specific defines for CCD's HFC 2BDS0
*
- * Author Karsten Keil (keil@isdn4linux.de)
- *
- * This file is (c) under GNU General Public License
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/hfc_2bs0.c linux/drivers/isdn/hisax/hfc_2bs0.c
--- v2.4.10/linux/drivers/isdn/hisax/hfc_2bs0.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/isdn/hisax/hfc_2bs0.c Sun Sep 30 12:26:05 2001
@@ -1,10 +1,12 @@
-/* $Id: hfc_2bs0.c,v 1.17.6.2 2001/06/09 15:14:17 kai Exp $
+/* $Id: hfc_2bs0.c,v 1.17.6.3 2001/09/23 22:24:47 kai Exp $
*
- * specific routines for CCD's HFC 2BS0
+ * specific routines for CCD's HFC 2BS0
*
- * Author Karsten Keil (keil@isdn4linux.de)
- *
- * This file is (c) under GNU General Public License
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/hfc_2bs0.h linux/drivers/isdn/hisax/hfc_2bs0.h
--- v2.4.10/linux/drivers/isdn/hisax/hfc_2bs0.h Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/hisax/hfc_2bs0.h Sun Sep 30 12:26:05 2001
@@ -1,10 +1,12 @@
-/* $Id: hfc_2bs0.h,v 1.3.6.1 2001/02/16 16:43:27 kai Exp $
+/* $Id: hfc_2bs0.h,v 1.3.6.2 2001/09/23 22:24:47 kai Exp $
*
- * specific defines for CCD's HFC 2BS0
+ * specific defines for CCD's HFC 2BS0
*
- * Author Karsten Keil (keil@isdn4linux.de)
- *
- * This file is (c) under GNU General Public License
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/hfc_pci.c linux/drivers/isdn/hisax/hfc_pci.c
--- v2.4.10/linux/drivers/isdn/hisax/hfc_pci.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/hisax/hfc_pci.c Sun Sep 30 12:26:05 2001
@@ -1,27 +1,17 @@
-/* $Id: hfc_pci.c,v 1.34.6.7 2001/07/27 09:08:27 kai Exp $
-
- * hfc_pci.c low level driver for CCD´s hfc-pci based cards
- *
- * Author Werner Cornelius (werner@isdn4linux.de)
- * based on existing driver for CCD hfc ISA cards
- * type approval valid for HFC-S PCI A based card
- *
- * Copyright 1999 by Werner Cornelius (werner@isdn-development.de)
- * Copyright 1999 by Karsten Keil (keil@isdn4linux.de)
+/* $Id: hfc_pci.c,v 1.34.6.8 2001/09/23 22:24:47 kai Exp $
*
- * 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, or (at your option)
- * any later version.
+ * low level driver for CCD´s hfc-pci based cards
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * Author Werner Cornelius
+ * based on existing driver for CCD hfc ISA cards
+ * Copyright by Werner Cornelius
+ * by Karsten Keil
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * For changes and modifications please read
+ * ../../../Documentation/isdn/HiSax.cert
*
*/
@@ -36,7 +26,7 @@
extern const char *CardType[];
-static const char *hfcpci_revision = "$Revision: 1.34.6.7 $";
+static const char *hfcpci_revision = "$Revision: 1.34.6.8 $";
/* table entry in the PCI devices list */
typedef struct {
@@ -84,7 +74,7 @@
void
release_io_hfcpci(struct IsdnCardState *cs)
{
- long flags;
+ unsigned long flags;
save_flags(flags);
cli();
@@ -299,7 +289,7 @@
u_char *ptr, *ptr1, new_f2;
struct sk_buff *skb;
struct IsdnCardState *cs = bcs->cs;
- long flags;
+ unsigned long flags;
int total, maxlen, new_z2;
z_type *zp;
@@ -634,7 +624,7 @@
hfcpci_fill_fifo(struct BCState *bcs)
{
struct IsdnCardState *cs = bcs->cs;
- long flags;
+ unsigned long flags;
int maxlen, fcnt;
int count, new_z1;
bzfifo_type *bz;
@@ -812,7 +802,7 @@
static int
hfcpci_auxcmd(struct IsdnCardState *cs, isdn_ctrl * ic)
{
- long flags;
+ unsigned long flags;
int i = *(unsigned int *) ic->parm.num;
if ((ic->arg == 98) &&
@@ -1162,7 +1152,7 @@
{
struct IsdnCardState *cs = (struct IsdnCardState *) st->l1.hardware;
struct sk_buff *skb = arg;
- long flags;
+ unsigned long flags;
switch (pr) {
case (PH_DATA | REQUEST):
@@ -1316,7 +1306,7 @@
mode_hfcpci(struct BCState *bcs, int mode, int bc)
{
struct IsdnCardState *cs = bcs->cs;
- long flags;
+ unsigned long flags;
int fifo2;
if (cs->debug & L1_DEB_HSCX)
@@ -1551,7 +1541,7 @@
static void
hfcpci_bh(struct IsdnCardState *cs)
{
- long flags;
+ unsigned long flags;
/* struct PStack *stptr;
*/
if (!cs)
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/hfc_pci.h linux/drivers/isdn/hisax/hfc_pci.h
--- v2.4.10/linux/drivers/isdn/hisax/hfc_pci.h Wed Apr 18 11:49:14 2001
+++ linux/drivers/isdn/hisax/hfc_pci.h Sun Sep 30 12:26:05 2001
@@ -1,24 +1,12 @@
-/* $Id: hfc_pci.h,v 1.8.6.1 2001/04/08 19:32:26 kai Exp $
+/* $Id: hfc_pci.h,v 1.8.6.2 2001/09/23 22:24:48 kai Exp $
*
- * specific defines for CCD's HFC 2BDS0 PCI chips
+ * specific defines for CCD's HFC 2BDS0 PCI chips
*
- * Author Werner Cornelius (werner@isdn4linux.de)
- *
- * Copyright 1999 by Werner Cornelius (werner@isdn4linux.de)
- *
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Author Werner Cornelius
+ * Copyright by Werner Cornelius
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/hfc_sx.c linux/drivers/isdn/hisax/hfc_sx.c
--- v2.4.10/linux/drivers/isdn/hisax/hfc_sx.c Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/hisax/hfc_sx.c Sun Sep 30 12:26:05 2001
@@ -1,25 +1,13 @@
-/* $Id: hfc_sx.c,v 1.9.6.2 2001/07/18 16:25:12 kai Exp $
-
- * hfc_sx.c low level driver for CCD´s hfc-s+/sp based cards
- *
- * Author Werner Cornelius (werner@isdn4linux.de)
- * based on existing driver for CCD HFC PCI cards
- *
- * Copyright 1999 by Werner Cornelius (werner@isdn4linux.de)
+/* $Id: hfc_sx.c,v 1.9.6.3 2001/09/23 22:24:48 kai Exp $
*
- * 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, or (at your option)
- * any later version.
+ * level driver for CCD´s hfc-s+/sp based cards
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Author Werner Cornelius
+ * based on existing driver for CCD HFC PCI cards
+ * Copyright by Werner Cornelius
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
@@ -32,7 +20,7 @@
extern const char *CardType[];
-static const char *hfcsx_revision = "$Revision: 1.9.6.2 $";
+static const char *hfcsx_revision = "$Revision: 1.9.6.3 $";
/***************************************/
/* IRQ-table for CCDs demo board */
@@ -73,7 +61,7 @@
/******************************/
static inline void
Write_hfc(struct IsdnCardState *cs, u_char regnum, u_char val)
-{ long flags;
+{ unsigned long flags;
save_flags(flags);
cli();
@@ -84,7 +72,7 @@
static inline u_char
Read_hfc(struct IsdnCardState *cs, u_char regnum)
-{ long flags;
+{ unsigned long flags;
u_char ret;
save_flags(flags);
@@ -101,7 +89,7 @@
/**************************************************/
static void
fifo_select(struct IsdnCardState *cs, u_char fifo)
-{ long flags;
+{ unsigned long flags;
if (fifo == cs->hw.hfcsx.last_fifo)
return; /* still valid */
@@ -123,7 +111,7 @@
/******************************************/
static void
reset_fifo(struct IsdnCardState *cs, u_char fifo)
-{ long flags;
+{ unsigned long flags;
save_flags(flags);
cli();
@@ -337,7 +325,7 @@
void
release_io_hfcsx(struct IsdnCardState *cs)
{
- long flags;
+ unsigned long flags;
save_flags(flags);
cli();
@@ -599,7 +587,7 @@
hfcsx_fill_fifo(struct BCState *bcs)
{
struct IsdnCardState *cs = bcs->cs;
- long flags;
+ unsigned long flags;
if (!bcs->tx_skb)
return;
@@ -670,7 +658,7 @@
static int
hfcsx_auxcmd(struct IsdnCardState *cs, isdn_ctrl * ic)
{
- long flags;
+ unsigned long flags;
int i = *(unsigned int *) ic->parm.num;
if ((ic->arg == 98) &&
@@ -729,7 +717,7 @@
static void
receive_emsg(struct IsdnCardState *cs)
{
- long flags;
+ unsigned long flags;
int count = 5;
u_char *ptr;
struct sk_buff *skb;
@@ -961,7 +949,7 @@
{
struct IsdnCardState *cs = (struct IsdnCardState *) st->l1.hardware;
struct sk_buff *skb = arg;
- long flags;
+ unsigned long flags;
switch (pr) {
case (PH_DATA | REQUEST):
@@ -1115,7 +1103,7 @@
mode_hfcsx(struct BCState *bcs, int mode, int bc)
{
struct IsdnCardState *cs = bcs->cs;
- long flags;
+ unsigned long flags;
int fifo2;
if (cs->debug & L1_DEB_HSCX)
@@ -1339,7 +1327,7 @@
static void
hfcsx_bh(struct IsdnCardState *cs)
{
- long flags;
+ unsigned long flags;
/* struct PStack *stptr;
*/
if (!cs)
@@ -1479,7 +1467,7 @@
{
struct IsdnCardState *cs = card->cs;
char tmp[64];
- long flags;
+ unsigned long flags;
strcpy(tmp, hfcsx_revision);
printk(KERN_INFO "HiSax: HFC-SX driver Rev. %s\n", HiSax_getrev(tmp));
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/hfc_sx.h linux/drivers/isdn/hisax/hfc_sx.h
--- v2.4.10/linux/drivers/isdn/hisax/hfc_sx.h Sun Aug 6 12:43:41 2000
+++ linux/drivers/isdn/hisax/hfc_sx.h Sun Sep 30 12:26:05 2001
@@ -1,24 +1,13 @@
-/* $Id: hfc_sx.h,v 1.2 2000/06/26 08:59:13 keil Exp $
+/* $Id: hfc_sx.h,v 1.2.6.1 2001/09/23 22:24:48 kai Exp $
*
- * specific defines for CCD's HFC 2BDS0 S+,SP chips
+ * specific defines for CCD's HFC 2BDS0 S+,SP chips
*
- * Author Werner Cornelius (werner@isdn4linux.de)
- *
- * Copyright 1999 by Werner Cornelius (werner@isdn4linux.de)
- *
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Author Werner Cornelius
+ * based on existing driver for CCD HFC PCI cards
+ * Copyright by Werner Cornelius
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/hfcscard.c linux/drivers/isdn/hisax/hfcscard.c
--- v2.4.10/linux/drivers/isdn/hisax/hfcscard.c Fri Mar 2 11:12:08 2001
+++ linux/drivers/isdn/hisax/hfcscard.c Sun Sep 30 12:26:05 2001
@@ -1,10 +1,12 @@
-/* $Id: hfcscard.c,v 1.8.6.1 2001/02/16 16:43:27 kai Exp $
+/* $Id: hfcscard.c,v 1.8.6.2 2001/09/23 22:24:48 kai Exp $
*
- * hfcscard.c low level stuff for hfcs based cards (Teles3c, ACER P10)
+ * low level stuff for hfcs based cards (Teles3c, ACER P10)
*
- * Author Karsten Keil (keil@isdn4linux.de)
- *
- * This file is (c) under GNU General Public License
+ * Author Karsten Keil
+ * Copyright by Karsten Keil
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
@@ -16,7 +18,7 @@
extern const char *CardType[];
-static const char *hfcs_revision = "$Revision: 1.8.6.1 $";
+static const char *hfcs_revision = "$Revision: 1.8.6.2 $";
static void
hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs)
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/hisax.h linux/drivers/isdn/hisax/hisax.h
--- v2.4.10/linux/drivers/isdn/hisax/hisax.h Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/hisax/hisax.h Sun Sep 30 12:26:05 2001
@@ -1,13 +1,12 @@
-/* $Id: hisax.h,v 2.52.6.8 2001/08/23 19:44:23 kai Exp $
+/* $Id: hisax.h,v 2.52.6.9 2001/09/23 22:24:48 kai Exp $
*
- * Basic declarations, defines and prototypes
+ * Basic declarations, defines and prototypes
*
- * This file is (c) under GNU General Public License
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
*
*/
#include
-#include
-#include
#include
#include
#include
diff -u --recursive --new-file v2.4.10/linux/drivers/isdn/hisax/hisax_debug.h linux/drivers/isdn/hisax/hisax_debug.h
--- v2.4.10/linux/drivers/isdn/hisax/hisax_debug.h Sun Sep 23 11:40:58 2001
+++ linux/drivers/isdn/hisax/hisax_debug.h Sun Sep 30 12:26:05 2001
@@ -3,13 +3,11 @@
*
* Author Frode Isaksen
* Copyright 2001 by Frode Isaksen