fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / isdn / hardware / eicon / divasmain.c
index f00f6ba..91fc92c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: divasmain.c,v 1.55.4.1 2004/05/21 12:15:00 armin Exp $
+/* $Id: divasmain.c,v 1.55.4.6 2005/02/09 19:28:20 armin Exp $
  *
  * Low level driver for Eicon DIVA Server ISDN cards.
  *
@@ -9,12 +9,10 @@
  * of the GNU General Public License, incorporated herein by reference.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
-#include <linux/devfs_fs_kernel.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <linux/ioport.h>
@@ -41,7 +39,7 @@
 #include "diva_dma.h"
 #include "diva_pci.h"
 
-static char *main_revision = "$Revision: 1.55.4.1 $";
+static char *main_revision = "$Revision: 1.55.4.6 $";
 
 static int major;
 
@@ -51,7 +49,7 @@ MODULE_DESCRIPTION("Kernel driver for Eicon DIVA Server cards");
 MODULE_AUTHOR("Cytronics & Melware, Eicon Networks");
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(dbgmask, "i");
+module_param(dbgmask, int, 0);
 MODULE_PARM_DESC(dbgmask, "initial debug mask");
 
 static char *DRIVERNAME =
@@ -60,8 +58,7 @@ static char *DRIVERLNAME = "divas";
 static char *DEVNAME = "Divas";
 char *DRIVERRELEASE_DIVAS = "2.0";
 
-extern irqreturn_t diva_os_irq_wrapper(int irq, void *context,
-                               struct pt_regs *regs);
+extern irqreturn_t diva_os_irq_wrapper(int irq, void *context);
 extern int create_divas_proc(void);
 extern void remove_divas_proc(void);
 extern void diva_get_vserial_number(PISDN_ADAPTER IoAdapter, char *buf);
@@ -188,7 +185,7 @@ void diva_log_info(unsigned char *format, ...)
        unsigned char line[160];
 
        va_start(args, format);
-       vsprintf(line, format, args);
+       vsnprintf(line, sizeof(line), format, args);
        va_end(args);
 
        printk(KERN_INFO "%s: %s\n", DRIVERLNAME, line);
@@ -435,16 +432,14 @@ diva_os_register_io_port(void *adapter, int on, unsigned long port,
        return (0);
 }
 
-void *divasa_remap_pci_bar(diva_os_xdi_adapter_t *a, int id, unsigned long bar, unsigned long area_length)
+void __iomem *divasa_remap_pci_bar(diva_os_xdi_adapter_t *a, int id, unsigned long bar, unsigned long area_length)
 {
-       void *ret;
-
-       ret = (void *) ioremap(bar, area_length);
-       DBG_TRC(("remap(%08x)->%08x", bar, ret));
+       void __iomem *ret = ioremap(bar, area_length);
+       DBG_TRC(("remap(%08x)->%p", bar, ret));
        return (ret);
 }
 
-void divasa_unmap_pci_bar(void *bar)
+void divasa_unmap_pci_bar(void __iomem *bar)
 {
        if (bar) {
                iounmap(bar);
@@ -454,32 +449,32 @@ void divasa_unmap_pci_bar(void *bar)
 /*********************************************************
  ** I/O port access 
  *********************************************************/
-byte __inline__ inpp(void *addr)
+byte __inline__ inpp(void __iomem *addr)
 {
        return (inb((unsigned long) addr));
 }
 
-word __inline__ inppw(void *addr)
+word __inline__ inppw(void __iomem *addr)
 {
        return (inw((unsigned long) addr));
 }
 
-void __inline__ inppw_buffer(void *addr, void *P, int length)
+void __inline__ inppw_buffer(void __iomem *addr, void *P, int length)
 {
        insw((unsigned long) addr, (word *) P, length >> 1);
 }
 
-void __inline__ outppw_buffer(void *addr, void *P, int length)
+void __inline__ outppw_buffer(void __iomem *addr, void *P, int length)
 {
        outsw((unsigned long) addr, (word *) P, length >> 1);
 }
 
-void __inline__ outppw(void *addr, word w)
+void __inline__ outppw(void __iomem *addr, word w)
 {
        outw(w, (unsigned long) addr);
 }
 
-void __inline__ outpp(void *addr, word p)
+void __inline__ outpp(void __iomem *addr, word p)
 {
        outb(p, (unsigned long) addr);
 }
@@ -490,7 +485,7 @@ void __inline__ outpp(void *addr, word p)
 int diva_os_register_irq(void *context, byte irq, const char *name)
 {
        int result = request_irq(irq, diva_os_irq_wrapper,
-                                SA_INTERRUPT | SA_SHIRQ, name, context);
+                                IRQF_DISABLED | IRQF_SHARED, name, context);
        return (result);
 }
 
@@ -556,7 +551,7 @@ void diva_os_remove_soft_isr(diva_os_soft_isr_t * psoft_isr)
                tasklet_kill(&pdpc->divas_task);
                flush_scheduled_work();
                mem = psoft_isr->object;
-               psoft_isr->object = 0;
+               psoft_isr->object = NULL;
                diva_os_free(0, mem);
        }
 }
@@ -565,7 +560,7 @@ void diva_os_remove_soft_isr(diva_os_soft_isr_t * psoft_isr)
  * kernel/user space copy functions
  */
 static int
-xdi_copy_to_user(void *os_handle, void *dst, const void *src, int length)
+xdi_copy_to_user(void *os_handle, void __user *dst, const void *src, int length)
 {
        if (copy_to_user(dst, src, length)) {
                return (-EFAULT);
@@ -574,7 +569,7 @@ xdi_copy_to_user(void *os_handle, void *dst, const void *src, int length)
 }
 
 static int
-xdi_copy_from_user(void *os_handle, void *dst, const void *src, int length)
+xdi_copy_from_user(void *os_handle, void *dst, const void __user *src, int length)
 {
        if (copy_from_user(dst, src, length)) {
                return (-EFAULT);
@@ -598,7 +593,7 @@ static int divas_release(struct inode *inode, struct file *file)
        return (0);
 }
 
-static ssize_t divas_write(struct file *file, const char *buf,
+static ssize_t divas_write(struct file *file, const char __user *buf,
                           size_t count, loff_t * ppos)
 {
        int ret = -EINVAL;
@@ -629,7 +624,7 @@ static ssize_t divas_write(struct file *file, const char *buf,
        return (ret);
 }
 
-static ssize_t divas_read(struct file *file, char *buf,
+static ssize_t divas_read(struct file *file, char __user *buf,
                          size_t count, loff_t * ppos)
 {
        int ret = -EINVAL;
@@ -680,7 +675,6 @@ static struct file_operations divas_fops = {
 
 static void divas_unregister_chrdev(void)
 {
-       devfs_remove(DEVNAME);
        unregister_chrdev(major, DEVNAME);
 }
 
@@ -692,7 +686,6 @@ static int DIVA_INIT_FUNCTION divas_register_chrdev(void)
                       DRIVERLNAME);
                return (0);
        }
-       devfs_mk_cdev(MKDEV(major, 0), S_IFCHR|S_IRUSR|S_IWUSR, DEVNAME);
 
        return (1);
 }
@@ -703,7 +696,7 @@ static int DIVA_INIT_FUNCTION divas_register_chrdev(void)
 static int __devinit divas_init_one(struct pci_dev *pdev,
                                    const struct pci_device_id *ent)
 {
-       void *pdiva = 0;
+       void *pdiva = NULL;
        u8 pci_latency;
        u8 new_latency = 32;
 
@@ -825,7 +818,7 @@ static int DIVA_INIT_FUNCTION divas_init(void)
                goto out;
        }
 
-       if ((ret = pci_module_init(&diva_pci_driver))) {
+       if ((ret = pci_register_driver(&diva_pci_driver))) {
 #ifdef MODULE
                remove_divas_proc();
                divas_unregister_chrdev();