fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / isdn / hisax / hfc_pci.c
index c2db526..8a48a3c 100644 (file)
@@ -16,7 +16,6 @@
  */
 
 #include <linux/init.h>
-#include <linux/config.h>
 #include "hisax.h"
 #include "hfc_pci.h"
 #include "isdnl1.h"
@@ -51,6 +50,8 @@ static const PCI_ENTRY id_list[] =
        {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00B, "Billion", "B00B"},
        {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00C, "Billion", "B00C"},
        {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B100, "Seyeon", "B100"},
+       {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B700, "Primux II S0", "B700"},
+       {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B701, "Primux II S0 NT", "B701"},
        {PCI_VENDOR_ID_ABOCOM, PCI_DEVICE_ID_ABOCOM_2BD1, "Abocom/Magitek", "2BD1"},
        {PCI_VENDOR_ID_ASUSTEK, PCI_DEVICE_ID_ASUSTEK_0675, "Asuscom/Askey", "675"},
        {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_T_CONCEPT, "German telekom", "T-Concept"},
@@ -61,6 +62,7 @@ static const PCI_ENTRY id_list[] =
        {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_E,"Digi International", "Digi DataFire Micro V (Europe)"},
        {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_IOM2_A,"Digi International", "Digi DataFire Micro V IOM2 (North America)"},
        {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_A,"Digi International", "Digi DataFire Micro V (North America)"},
+       {PCI_VENDOR_ID_SITECOM, PCI_DEVICE_ID_SITECOM_DC105V2, "Sitecom Europe", "DC-105 ISDN PCI"},
        {0, 0, NULL, NULL},
 };
 
@@ -70,7 +72,7 @@ static const PCI_ENTRY id_list[] =
 /******************************************/
 /* free hardware resources used by driver */
 /******************************************/
-void
+static void
 release_io_hfcpci(struct IsdnCardState *cs)
 {
        printk(KERN_INFO "HiSax: release hfcpci at %p\n",
@@ -394,7 +396,7 @@ receive_dmsg(struct IsdnCardState *cs)
 /*******************************************************************************/
 /* check for transparent receive data and read max one threshold size if avail */
 /*******************************************************************************/
-int
+static int
 hfcpci_empty_fifo_trans(struct BCState *bcs, bzfifo_type * bz, u_char * bdata)
 {
        unsigned short *z1r, *z2r;
@@ -446,7 +448,7 @@ hfcpci_empty_fifo_trans(struct BCState *bcs, bzfifo_type * bz, u_char * bdata)
 /**********************************/
 /* B-channel main receive routine */
 /**********************************/
-void
+static void
 main_rec_hfcpci(struct BCState *bcs)
 {
        struct IsdnCardState *cs = bcs->cs;
@@ -929,7 +931,7 @@ receive_emsg(struct IsdnCardState *cs)
 /* Interrupt handler */
 /*********************/
 static irqreturn_t
-hfcpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
+hfcpci_interrupt(int intno, void *dev_id)
 {
        u_long flags;
        struct IsdnCardState *cs = dev_id;
@@ -1209,7 +1211,7 @@ HFCPCI_l1hw(struct PStack *st, int pr, void *arg)
                        break;
                case (HW_TESTLOOP | REQUEST):
                        spin_lock_irqsave(&cs->lock, flags);
-                       switch ((int) arg) {
+                       switch ((long) arg) {
                                case (1):
                                        Write_hfc(cs, HFCPCI_B1_SSL, 0x80);     /* tx slot */
                                        Write_hfc(cs, HFCPCI_B1_RSL, 0x80);     /* rx slot */
@@ -1227,7 +1229,7 @@ HFCPCI_l1hw(struct PStack *st, int pr, void *arg)
                                default:
                                        spin_unlock_irqrestore(&cs->lock, flags);
                                        if (cs->debug & L1_DEB_WARN)
-                                               debugl1(cs, "hfcpci_l1hw loop invalid %4x", (int) arg);
+                                               debugl1(cs, "hfcpci_l1hw loop invalid %4lx", (long) arg);
                                        return;
                        }
                        cs->hw.hfcpci.trm |= 0x80;      /* enable IOM-loop */
@@ -1244,7 +1246,7 @@ HFCPCI_l1hw(struct PStack *st, int pr, void *arg)
 /***********************************************/
 /* called during init setting l1 stack pointer */
 /***********************************************/
-void
+static void
 setstack_hfcpci(struct PStack *st, struct IsdnCardState *cs)
 {
        st->l1.l1hw = HFCPCI_l1hw;
@@ -1268,7 +1270,7 @@ hfcpci_send_data(struct BCState *bcs)
 /***************************************************************/
 /* activate/deactivate hardware for selected channels and mode */
 /***************************************************************/
-void
+static void
 mode_hfcpci(struct BCState *bcs, int mode, int bc)
 {
        struct IsdnCardState *cs = bcs->cs;
@@ -1504,8 +1506,10 @@ setstack_2b(struct PStack *st, struct BCState *bcs)
 /* handle L1 state changes */
 /***************************/
 static void
-hfcpci_bh(struct IsdnCardState *cs)
+hfcpci_bh(struct work_struct *work)
 {
+       struct IsdnCardState *cs =
+               container_of(work, struct IsdnCardState, tqueue);
        u_long  flags;
 //      struct PStack *stptr;
 
@@ -1579,7 +1583,7 @@ hfcpci_bh(struct IsdnCardState *cs)
 /********************************/
 /* called for card init message */
 /********************************/
-void __init
+static void
 inithfcpci(struct IsdnCardState *cs)
 {
        cs->bcs[0].BC_SetStack = setstack_2b;
@@ -1636,11 +1640,11 @@ hfcpci_card_msg(struct IsdnCardState *cs, int mt, void *arg)
 
 
 /* this variable is used as card index when more than one cards are present */
-static struct pci_dev *dev_hfcpci __initdata = NULL;
+static struct pci_dev *dev_hfcpci __devinitdata = NULL;
 
 #endif                         /* CONFIG_PCI */
 
-int __init
+int __devinit
 setup_hfcpci(struct IsdnCard *card)
 {
        u_long flags;
@@ -1685,7 +1689,7 @@ setup_hfcpci(struct IsdnCard *card)
                                printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
                                return (0);
                        }
-                       cs->hw.hfcpci.pci_io = (char *) dev_hfcpci->resource[ 1].start;
+                       cs->hw.hfcpci.pci_io = (char *)(unsigned long)dev_hfcpci->resource[1].start;
                        printk(KERN_INFO "HiSax: HFC-PCI card manufacturer: %s card name: %s\n", id_list[i].vendor_name, id_list[i].card_name);
                } else {
                        printk(KERN_WARNING "HFC-PCI: No PCI card found\n");
@@ -1707,9 +1711,9 @@ setup_hfcpci(struct IsdnCard *card)
                pci_write_config_dword(cs->hw.hfcpci.dev, 0x80, (u_int) virt_to_bus(cs->hw.hfcpci.fifos));
                cs->hw.hfcpci.pci_io = ioremap((ulong) cs->hw.hfcpci.pci_io, 256);
                printk(KERN_INFO
-                      "HFC-PCI: defined at mem %#x fifo %#x(%#x) IRQ %d HZ %d\n",
-                      (u_int) cs->hw.hfcpci.pci_io,
-                      (u_int) cs->hw.hfcpci.fifos,
+                      "HFC-PCI: defined at mem %p fifo %p(%#x) IRQ %d HZ %d\n",
+                      cs->hw.hfcpci.pci_io,
+                      cs->hw.hfcpci.fifos,
                       (u_int) virt_to_bus(cs->hw.hfcpci.fifos),
                       cs->irq, HZ);
                spin_lock_irqsave(&cs->lock, flags);
@@ -1720,7 +1724,7 @@ setup_hfcpci(struct IsdnCard *card)
                Write_hfc(cs, HFCPCI_INT_M2, cs->hw.hfcpci.int_m2);
                /* At this point the needed PCI config is done */
                /* fifos are still not enabled */
-               INIT_WORK(&cs->tqueue, (void *)(void *) hfcpci_bh, cs);
+               INIT_WORK(&cs->tqueue,  hfcpci_bh);
                cs->setstack_d = setstack_hfcpci;
                cs->BC_Send_Data = &hfcpci_send_data;
                cs->readisac = NULL;
@@ -1730,7 +1734,7 @@ setup_hfcpci(struct IsdnCard *card)
                cs->BC_Read_Reg = NULL;
                cs->BC_Write_Reg = NULL;
                cs->irq_func = &hfcpci_interrupt;
-               cs->irq_flags |= SA_SHIRQ;
+               cs->irq_flags |= IRQF_SHARED;
                cs->hw.hfcpci.timer.function = (void *) hfcpci_Timer;
                cs->hw.hfcpci.timer.data = (long) cs;
                init_timer(&cs->hw.hfcpci.timer);