bas_gigaset: correctly allocate USB interrupt transfer buffer
[safe/jmp/linux-2.6] / drivers / isdn / hisax / bkm_a8.c
index 5f21b82..e1ff471 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include "hisax.h"
 #include "isac.h"
 #include <linux/pci.h>
 #include "bkm_ax.h"
 
-#ifdef CONFIG_PCI
-
 #define        ATTEMPT_PCI_REMAPPING   /* Required for PLX rev 1 */
 
-extern const char *CardType[];
-
 static const char sct_quadro_revision[] = "$Revision: 1.22.2.4 $";
 
 static const char *sct_quadro_subtypes[] =
@@ -141,7 +136,7 @@ set_ipac_active(struct IsdnCardState *cs, u_int active)
 #include "hscx_irq.c"
 
 static irqreturn_t
-bkm_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs)
+bkm_interrupt_ipac(int intno, void *dev_id)
 {
        struct IsdnCardState *cs = dev_id;
        u_char ista, val, icnt = 5;
@@ -184,8 +179,7 @@ bkm_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs)
                goto Start_IPAC;
        }
        if (!icnt)
-               printk(KERN_WARNING "HiSax: %s (%s) IRQ LOOP\n",
-                      CardType[cs->typ],
+               printk(KERN_WARNING "HiSax: Scitel Quadro (%s) IRQ LOOP\n",
                       sct_quadro_subtypes[cs->subtyp]);
        writereg(cs->hw.ax.base, cs->hw.ax.data_adr, IPAC_MASK, 0xFF);
        writereg(cs->hw.ax.base, cs->hw.ax.data_adr, IPAC_MASK, 0xC0);
@@ -261,7 +255,7 @@ BKM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
        return (0);
 }
 
-static int __init
+static int __devinit
 sct_alloc_io(u_int adr, u_int len)
 {
        if (!request_region(adr, len, "scitel")) {
@@ -273,22 +267,18 @@ sct_alloc_io(u_int adr, u_int len)
        return(0);
 }
 
-static struct pci_dev *dev_a8 __initdata = NULL;
-static u16  sub_vendor_id __initdata = 0;
-static u16  sub_sys_id __initdata = 0;
-static u_char pci_bus __initdata = 0;
-static u_char pci_device_fn __initdata = 0;
-static u_char pci_irq __initdata = 0;
-
-#endif /* CONFIG_PCI */
+static struct pci_dev *dev_a8 __devinitdata = NULL;
+static u16  sub_vendor_id __devinitdata = 0;
+static u16  sub_sys_id __devinitdata = 0;
+static u_char pci_bus __devinitdata = 0;
+static u_char pci_device_fn __devinitdata = 0;
+static u_char pci_irq __devinitdata = 0;
 
-int __init
+int __devinit
 setup_sct_quadro(struct IsdnCard *card)
 {
-#ifdef CONFIG_PCI
        struct IsdnCardState *cs = card->cs;
        char tmp[64];
-       u_char pci_rev_id;
        u_int found = 0;
        u_int pci_ioaddr1, pci_ioaddr2, pci_ioaddr3, pci_ioaddr4, pci_ioaddr5;
 
@@ -303,8 +293,8 @@ setup_sct_quadro(struct IsdnCard *card)
        if (card->para[0] >= SCT_1 && card->para[0] <= SCT_4)
                cs->subtyp = card->para[0];
        else {
-               printk(KERN_WARNING "HiSax: %s: Invalid subcontroller in configuration, default to 1\n",
-                       CardType[card->typ]);
+               printk(KERN_WARNING "HiSax: Scitel Quadro: Invalid "
+                      "subcontroller in configuration, default to 1\n");
                return (0);
        }
        if ((cs->subtyp != SCT_1) && ((sub_sys_id != PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO) ||
@@ -329,17 +319,16 @@ setup_sct_quadro(struct IsdnCard *card)
                        }
                }
                if (!found) {
-                       printk(KERN_WARNING "HiSax: %s (%s): Card not found\n",
-                               CardType[card->typ],
+                       printk(KERN_WARNING "HiSax: Scitel Quadro (%s): "
+                               "Card not found\n",
                                sct_quadro_subtypes[cs->subtyp]);
                        return (0);
                }
 #ifdef ATTEMPT_PCI_REMAPPING
 /* HACK: PLX revision 1 bug: PLX address bit 7 must not be set */
-               pci_read_config_byte(dev_a8, PCI_REVISION_ID, &pci_rev_id);
-               if ((pci_ioaddr1 & 0x80) && (pci_rev_id == 1)) {
-                       printk(KERN_WARNING "HiSax: %s (%s): PLX rev 1, remapping required!\n",
-                               CardType[card->typ],
+               if ((pci_ioaddr1 & 0x80) && (dev_a8->revision == 1)) {
+                       printk(KERN_WARNING "HiSax: Scitel Quadro (%s): "
+                               "PLX rev 1, remapping required!\n",
                                sct_quadro_subtypes[cs->subtyp]);
                        /* Restart PCI negotiation */
                        pci_write_config_dword(dev_a8, PCI_BASE_ADDRESS_1, (u_int) - 1);
@@ -352,8 +341,7 @@ setup_sct_quadro(struct IsdnCard *card)
 #endif /* End HACK */
        }
        if (!pci_irq) {         /* IRQ range check ?? */
-               printk(KERN_WARNING "HiSax: %s (%s): No IRQ\n",
-                      CardType[card->typ],
+               printk(KERN_WARNING "HiSax: Scitel Quadro (%s): No IRQ\n",
                       sct_quadro_subtypes[cs->subtyp]);
                return (0);
        }
@@ -363,8 +351,8 @@ setup_sct_quadro(struct IsdnCard *card)
        pci_read_config_dword(dev_a8, PCI_BASE_ADDRESS_4, &pci_ioaddr4);
        pci_read_config_dword(dev_a8, PCI_BASE_ADDRESS_5, &pci_ioaddr5);
        if (!pci_ioaddr1 || !pci_ioaddr2 || !pci_ioaddr3 || !pci_ioaddr4 || !pci_ioaddr5) {
-               printk(KERN_WARNING "HiSax: %s (%s): No IO base address(es)\n",
-                      CardType[card->typ],
+               printk(KERN_WARNING "HiSax: Scitel Quadro (%s): "
+                      "No IO base address(es)\n",
                       sct_quadro_subtypes[cs->subtyp]);
                return (0);
        }
@@ -375,7 +363,7 @@ setup_sct_quadro(struct IsdnCard *card)
        pci_ioaddr5 &= PCI_BASE_ADDRESS_IO_MASK;
        /* Take over */
        cs->irq = pci_irq;
-       cs->irq_flags |= SA_SHIRQ;
+       cs->irq_flags |= IRQF_SHARED;
        /* pci_ioaddr1 is unique to all subdevices */
        /* pci_ioaddr2 is for the fourth subdevice only */
        /* pci_ioaddr3 is for the third subdevice only */
@@ -419,8 +407,8 @@ setup_sct_quadro(struct IsdnCard *card)
        /* For isac and hscx data path */
        cs->hw.ax.data_adr = cs->hw.ax.base + 4;
 
-       printk(KERN_INFO "HiSax: %s (%s) configured at 0x%.4lX, 0x%.4lX, 0x%.4lX and IRQ %d\n",
-              CardType[card->typ],
+       printk(KERN_INFO "HiSax: Scitel Quadro (%s) configured at "
+              "0x%.4lX, 0x%.4lX, 0x%.4lX and IRQ %d\n",
               sct_quadro_subtypes[cs->subtyp],
               cs->hw.ax.plx_adr,
               cs->hw.ax.base,
@@ -440,12 +428,8 @@ setup_sct_quadro(struct IsdnCard *card)
        cs->cardmsg = &BKM_card_msg;
        cs->irq_func = &bkm_interrupt_ipac;
 
-       printk(KERN_INFO "HiSax: %s (%s): IPAC Version %d\n",
-               CardType[card->typ],
+       printk(KERN_INFO "HiSax: Scitel Quadro (%s): IPAC Version %d\n",
                sct_quadro_subtypes[cs->subtyp],
                readreg(cs->hw.ax.base, cs->hw.ax.data_adr, IPAC_ID));
        return (1);
-#else
-       printk(KERN_ERR "HiSax: bkm_a8 only supported on PCI Systems\n");
-#endif /* CONFIG_PCI */
 }