fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / isdn / hisax / elsa.c
index b336781..fab3e4e 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 #include <linux/init.h>
-#include <linux/config.h>
 #include "hisax.h"
 #include "arcofi.h"
 #include "isac.h"
 
 extern const char *CardType[];
 
-const char *Elsa_revision = "$Revision: 2.32.2.4 $";
-const char *Elsa_Types[] =
+static const char *Elsa_revision = "$Revision: 2.32.2.4 $";
+static const char *Elsa_Types[] =
 {"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro",
  "PCMCIA", "QS 1000", "QS 3000", "Microlink PCI", "QS 3000 PCI", 
  "PCMCIA-IPAC" };
 
-const char *ITACVer[] =
+static const char *ITACVer[] =
 {"?0?", "?1?", "?2?", "?3?", "?4?", "V2.2",
  "B1", "A1"};
 
@@ -86,8 +85,8 @@ const char *ITACVer[] =
  ***                                                                    ***/
 
 /* Config-Register (Read) */
-#define ELSA_TIMER_RUN       0x02      /* Bit 1 des Config-Reg     */
-#define ELSA_TIMER_RUN_PCC8  0x01      /* Bit 0 des Config-Reg  bei PCC */
+#define ELIRQF_TIMER_RUN       0x02    /* Bit 1 des Config-Reg     */
+#define ELIRQF_TIMER_RUN_PCC8  0x01    /* Bit 0 des Config-Reg  bei PCC */
 #define ELSA_IRQ_IDX       0x38        /* Bit 3,4,5 des Config-Reg */
 #define ELSA_IRQ_IDX_PCC8  0x30        /* Bit 4,5 des Config-Reg */
 #define ELSA_IRQ_IDX_PC    0x0c        /* Bit 2,3 des Config-Reg */
@@ -103,12 +102,11 @@ const char *ITACVer[] =
 #define ELSA_S0_POWER_BAD    0x08      /* Bit 3 S0-Bus Spannung fehlt */
 
 /* Status Flags */
-#define ELSA_TIMER_AKTIV 1
+#define ELIRQF_TIMER_AKTIV 1
 #define ELSA_BAD_PWR     2
 #define ELSA_ASSIGN      4
 
 #define RS_ISR_PASS_LIMIT 256
-#define _INLINE_ inline
 #define FLG_MODEM_ACTIVE 1
 /* IPAC AUX */
 #define ELSA_IPAC_LINE_LED     0x40    /* Bit 6 Gelbe LED */
@@ -261,10 +259,10 @@ TimerRun(struct IsdnCardState *cs)
 
        v = bytein(cs->hw.elsa.cfg);
        if ((cs->subtyp == ELSA_QS1000) || (cs->subtyp == ELSA_QS3000))
-               return (0 == (v & ELSA_TIMER_RUN));
+               return (0 == (v & ELIRQF_TIMER_RUN));
        else if (cs->subtyp == ELSA_PCC8)
-               return (v & ELSA_TIMER_RUN_PCC8);
-       return (v & ELSA_TIMER_RUN);
+               return (v & ELIRQF_TIMER_RUN_PCC8);
+       return (v & ELIRQF_TIMER_RUN);
 }
 /*
  * fast interrupt HSCX stuff goes here
@@ -284,7 +282,7 @@ TimerRun(struct IsdnCardState *cs)
 #include "hscx_irq.c"
 
 static irqreturn_t
-elsa_interrupt(int intno, void *dev_id, struct pt_regs *regs)
+elsa_interrupt(int intno, void *dev_id)
 {
        struct IsdnCardState *cs = dev_id;
        u_long flags;
@@ -336,7 +334,7 @@ elsa_interrupt(int intno, void *dev_id, struct pt_regs *regs)
        writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK, 0xFF);
        writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK + 0x40, 0xFF);
        writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_MASK, 0xFF);
-       if (cs->hw.elsa.status & ELSA_TIMER_AKTIV) {
+       if (cs->hw.elsa.status & ELIRQF_TIMER_AKTIV) {
                if (!TimerRun(cs)) {
                        /* Timer Restart */
                        byteout(cs->hw.elsa.timer, 0);
@@ -363,7 +361,7 @@ elsa_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 }
 
 static irqreturn_t
-elsa_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs)
+elsa_interrupt_ipac(int intno, void *dev_id)
 {
        struct IsdnCardState *cs = dev_id;
        u_long flags;
@@ -425,7 +423,7 @@ Start_IPAC:
        return IRQ_HANDLED;
 }
 
-void
+static void
 release_io_elsa(struct IsdnCardState *cs)
 {
        int bytecnt = 8;
@@ -687,16 +685,15 @@ Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg)
                                spin_lock_irqsave(&cs->lock, flags);
                                cs->hw.elsa.counter = 0;
                                cs->hw.elsa.ctrl_reg |= ELSA_ENA_TIMER_INT;
-                               cs->hw.elsa.status |= ELSA_TIMER_AKTIV;
+                               cs->hw.elsa.status |= ELIRQF_TIMER_AKTIV;
                                byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg);
                                byteout(cs->hw.elsa.timer, 0);
                                spin_unlock_irqrestore(&cs->lock, flags);
-                               set_current_state(TASK_UNINTERRUPTIBLE);
-                               schedule_timeout((110*HZ)/1000);
+                               msleep(110);
                                spin_lock_irqsave(&cs->lock, flags);
                                cs->hw.elsa.ctrl_reg &= ~ELSA_ENA_TIMER_INT;
                                byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg);
-                               cs->hw.elsa.status &= ~ELSA_TIMER_AKTIV;
+                               cs->hw.elsa.status &= ~ELIRQF_TIMER_AKTIV;
                                spin_unlock_irqrestore(&cs->lock, flags);
                                printk(KERN_INFO "Elsa: %d timer tics in 110 msek\n",
                                       cs->hw.elsa.counter);
@@ -839,7 +836,7 @@ static      struct pci_dev *dev_qs1000 __devinitdata = NULL;
 static         struct pci_dev *dev_qs3000 __devinitdata = NULL;
 
 #ifdef __ISAPNP__
-static struct isapnp_device_id elsa_ids[] __initdata = {
+static struct isapnp_device_id elsa_ids[] __devinitdata = {
        { ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
          ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133), 
          (unsigned long) "Elsa QS1000" },
@@ -849,7 +846,7 @@ static struct isapnp_device_id elsa_ids[] __initdata = {
        { 0, }
 };
 
-static struct isapnp_device_id *ipid __initdata = &elsa_ids[0];
+static struct isapnp_device_id *ipid __devinitdata = &elsa_ids[0];
 static struct pnp_card *pnp_c __devinitdata = NULL;
 #endif
 
@@ -1015,14 +1012,14 @@ setup_elsa(struct IsdnCard *card)
                cs->hw.elsa.timer = 0;
                cs->hw.elsa.trig = 0;
                cs->hw.elsa.ctrl = 0;
-               cs->irq_flags |= SA_SHIRQ;
+               cs->irq_flags |= IRQF_SHARED;
                printk(KERN_INFO
                       "Elsa: %s defined at %#lx IRQ %d\n",
                       Elsa_Types[cs->subtyp],
                       cs->hw.elsa.base,
                       cs->irq);
        } else if (cs->typ == ISDN_CTYPE_ELSA_PCI) {
-#if CONFIG_PCI
+#ifdef CONFIG_PCI
                cs->subtyp = 0;
                if ((dev_qs1000 = pci_find_device(PCI_VENDOR_ID_ELSA,
                        PCI_DEVICE_ID_ELSA_MICROLINK, dev_qs1000))) {
@@ -1064,7 +1061,7 @@ setup_elsa(struct IsdnCard *card)
                test_and_set_bit(HW_IPAC, &cs->HW_Flags);
                cs->hw.elsa.timer = 0;
                cs->hw.elsa.trig  = 0;
-               cs->irq_flags |= SA_SHIRQ;
+               cs->irq_flags |= IRQF_SHARED;
                printk(KERN_INFO
                       "Elsa: %s defined at %#lx/0x%x IRQ %d\n",
                       Elsa_Types[cs->subtyp],