summaryrefslogtreecommitdiff
path: root/drivers/isdn/hisax/hisax_fcpcipnp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/hisax/hisax_fcpcipnp.c')
-rw-r--r--drivers/isdn/hisax/hisax_fcpcipnp.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c
index 478ebab54ca4..e4f47fe3f7fd 100644
--- a/drivers/isdn/hisax/hisax_fcpcipnp.c
+++ b/drivers/isdn/hisax/hisax_fcpcipnp.c
@@ -4,7 +4,7 @@
* Author Kai Germaschewski
* Copyright 2001 by Kai Germaschewski <kai.germaschewski@gmx.de>
* 2001 by Karsten Keil <keil@isdn4linux.de>
- *
+ *
* based upon Karsten Keil's original avm_pci.c driver
*
* This software may be used and distributed according to the terms
@@ -71,7 +71,7 @@ MODULE_DEVICE_TABLE(pci, fcpci_ids);
#ifdef CONFIG_PNP
static struct pnp_device_id fcpnp_ids[] __devinitdata = {
- {
+ {
.id = "AVM0900",
.driver_data = (unsigned long) "Fritz!Card PnP",
},
@@ -153,7 +153,7 @@ MODULE_LICENSE("GPL");
static unsigned char fcpci_read_isac(struct isac *isac, unsigned char offset)
{
struct fritz_adapter *adapter = isac->priv;
- unsigned char idx = (offset > 0x2f) ?
+ unsigned char idx = (offset > 0x2f) ?
AVM_IDX_ISAC_REG_HIGH : AVM_IDX_ISAC_REG_LOW;
unsigned char val;
unsigned long flags;
@@ -161,7 +161,7 @@ static unsigned char fcpci_read_isac(struct isac *isac, unsigned char offset)
spin_lock_irqsave(&adapter->hw_lock, flags);
outb(idx, adapter->io + AVM_INDEX);
val = inb(adapter->io + AVM_DATA + (offset & 0xf));
- spin_unlock_irqrestore(&adapter->hw_lock, flags);
+ spin_unlock_irqrestore(&adapter->hw_lock, flags);
DBG(0x1000, " port %#x, value %#x",
offset, val);
return val;
@@ -171,7 +171,7 @@ static void fcpci_write_isac(struct isac *isac, unsigned char offset,
unsigned char value)
{
struct fritz_adapter *adapter = isac->priv;
- unsigned char idx = (offset > 0x2f) ?
+ unsigned char idx = (offset > 0x2f) ?
AVM_IDX_ISAC_REG_HIGH : AVM_IDX_ISAC_REG_LOW;
unsigned long flags;
@@ -180,10 +180,10 @@ static void fcpci_write_isac(struct isac *isac, unsigned char offset,
spin_lock_irqsave(&adapter->hw_lock, flags);
outb(idx, adapter->io + AVM_INDEX);
outb(value, adapter->io + AVM_DATA + (offset & 0xf));
- spin_unlock_irqrestore(&adapter->hw_lock, flags);
+ spin_unlock_irqrestore(&adapter->hw_lock, flags);
}
-static void fcpci_read_isac_fifo(struct isac *isac, unsigned char * data,
+static void fcpci_read_isac_fifo(struct isac *isac, unsigned char *data,
int size)
{
struct fritz_adapter *adapter = isac->priv;
@@ -192,10 +192,10 @@ static void fcpci_read_isac_fifo(struct isac *isac, unsigned char * data,
spin_lock_irqsave(&adapter->hw_lock, flags);
outb(AVM_IDX_ISAC_FIFO, adapter->io + AVM_INDEX);
insb(adapter->io + AVM_DATA, data, size);
- spin_unlock_irqrestore(&adapter->hw_lock, flags);
+ spin_unlock_irqrestore(&adapter->hw_lock, flags);
}
-static void fcpci_write_isac_fifo(struct isac *isac, unsigned char * data,
+static void fcpci_write_isac_fifo(struct isac *isac, unsigned char *data,
int size)
{
struct fritz_adapter *adapter = isac->priv;
@@ -204,7 +204,7 @@ static void fcpci_write_isac_fifo(struct isac *isac, unsigned char * data,
spin_lock_irqsave(&adapter->hw_lock, flags);
outb(AVM_IDX_ISAC_FIFO, adapter->io + AVM_INDEX);
outsb(adapter->io + AVM_DATA, data, size);
- spin_unlock_irqrestore(&adapter->hw_lock, flags);
+ spin_unlock_irqrestore(&adapter->hw_lock, flags);
}
static u32 fcpci_read_hdlc_status(struct fritz_adapter *adapter, int nr)
@@ -254,14 +254,14 @@ static unsigned char fcpci2_read_isac(struct isac *isac, unsigned char offset)
spin_lock_irqsave(&adapter->hw_lock, flags);
outl(offset, adapter->io + AVM_ISACSX_INDEX);
val = inl(adapter->io + AVM_ISACSX_DATA);
- spin_unlock_irqrestore(&adapter->hw_lock, flags);
+ spin_unlock_irqrestore(&adapter->hw_lock, flags);
DBG(0x1000, " port %#x, value %#x",
offset, val);
return val;
}
-static void fcpci2_write_isac(struct isac *isac, unsigned char offset,
+static void fcpci2_write_isac(struct isac *isac, unsigned char offset,
unsigned char value)
{
struct fritz_adapter *adapter = isac->priv;
@@ -272,10 +272,10 @@ static void fcpci2_write_isac(struct isac *isac, unsigned char offset,
spin_lock_irqsave(&adapter->hw_lock, flags);
outl(offset, adapter->io + AVM_ISACSX_INDEX);
outl(value, adapter->io + AVM_ISACSX_DATA);
- spin_unlock_irqrestore(&adapter->hw_lock, flags);
+ spin_unlock_irqrestore(&adapter->hw_lock, flags);
}
-static void fcpci2_read_isac_fifo(struct isac *isac, unsigned char * data,
+static void fcpci2_read_isac_fifo(struct isac *isac, unsigned char *data,
int size)
{
struct fritz_adapter *adapter = isac->priv;
@@ -286,10 +286,10 @@ static void fcpci2_read_isac_fifo(struct isac *isac, unsigned char * data,
outl(0, adapter->io + AVM_ISACSX_INDEX);
for (i = 0; i < size; i++)
data[i] = inl(adapter->io + AVM_ISACSX_DATA);
- spin_unlock_irqrestore(&adapter->hw_lock, flags);
+ spin_unlock_irqrestore(&adapter->hw_lock, flags);
}
-static void fcpci2_write_isac_fifo(struct isac *isac, unsigned char * data,
+static void fcpci2_write_isac_fifo(struct isac *isac, unsigned char *data,
int size)
{
struct fritz_adapter *adapter = isac->priv;
@@ -300,7 +300,7 @@ static void fcpci2_write_isac_fifo(struct isac *isac, unsigned char * data,
outl(0, adapter->io + AVM_ISACSX_INDEX);
for (i = 0; i < size; i++)
outl(data[i], adapter->io + AVM_ISACSX_DATA);
- spin_unlock_irqrestore(&adapter->hw_lock, flags);
+ spin_unlock_irqrestore(&adapter->hw_lock, flags);
}
static u32 fcpci2_read_hdlc_status(struct fritz_adapter *adapter, int nr)
@@ -349,10 +349,10 @@ static void __fcpnp_write_ctrl(struct fritz_bcs *bcs, int which)
outb(idx, adapter->io + AVM_INDEX);
if (which & 4)
- outb(bcs->ctrl.sr.mode,
+ outb(bcs->ctrl.sr.mode,
adapter->io + AVM_DATA + HDLC_STATUS + 2);
if (which & 2)
- outb(bcs->ctrl.sr.xml,
+ outb(bcs->ctrl.sr.xml,
adapter->io + AVM_DATA + HDLC_STATUS + 1);
if (which & 1)
outb(bcs->ctrl.sr.cmd,
@@ -416,7 +416,7 @@ static void hdlc_fill_fifo(struct fritz_bcs *bcs)
break;
case AVM_FRITZ_PCIV2:
fcpci2_write_ctrl(bcs, 3);
- outsl(adapter->io +
+ outsl(adapter->io +
(bcs->channel ? AVM_HDLC_FIFO_2 : AVM_HDLC_FIFO_1),
p, (count + 3) / 4);
break;
@@ -447,12 +447,12 @@ static inline void hdlc_empty_fifo(struct fritz_bcs *bcs, int count)
case AVM_FRITZ_PCI:
spin_lock(&adapter->hw_lock);
outl(idx, adapter->io + AVM_INDEX);
- insl(adapter->io + AVM_DATA + HDLC_FIFO,
+ insl(adapter->io + AVM_DATA + HDLC_FIFO,
p, (count + 3) / 4);
spin_unlock(&adapter->hw_lock);
break;
case AVM_FRITZ_PCIV2:
- insl(adapter->io +
+ insl(adapter->io +
(bcs->channel ? AVM_HDLC_FIFO_2 : AVM_HDLC_FIFO_1),
p, (count + 3) / 4);
break;
@@ -489,7 +489,7 @@ static inline void hdlc_rpr_irq(struct fritz_bcs *bcs, u32 stat)
hdlc_empty_fifo(bcs, len);
if ((stat & HDLC_STAT_RME) || (bcs->mode == L1_MODE_TRANS)) {
- if (((stat & HDLC_STAT_CRCVFRRAB)== HDLC_STAT_CRCVFR) ||
+ if (((stat & HDLC_STAT_CRCVFRRAB) == HDLC_STAT_CRCVFR) ||
(bcs->mode == L1_MODE_TRANS)) {
skb = dev_alloc_skb(bcs->rcvidx);
if (!skb) {
@@ -512,7 +512,7 @@ static inline void hdlc_rpr_irq(struct fritz_bcs *bcs, u32 stat)
static inline void hdlc_xdu_irq(struct fritz_bcs *bcs)
{
struct fritz_adapter *adapter = bcs->adapter;
-
+
/* Here we lost an TX interrupt, so
* restart transmitting the whole frame.
@@ -587,7 +587,7 @@ static inline void hdlc_irq(struct fritz_adapter *adapter)
static void modehdlc(struct fritz_bcs *bcs, int mode)
{
struct fritz_adapter *adapter = bcs->adapter;
-
+
DBG(0x40, "hdlc %c mode %d --> %d",
'A' + bcs->channel, bcs->mode, mode);
@@ -638,12 +638,12 @@ static void fritz_b_l2l1(struct hisax_if *ifc, int pr, void *arg)
break;
case PH_ACTIVATE | REQUEST:
mode = (long) arg;
- DBG(4,"B%d,PH_ACTIVATE_REQUEST %d", bcs->channel + 1, mode);
+ DBG(4, "B%d,PH_ACTIVATE_REQUEST %d", bcs->channel + 1, mode);
modehdlc(bcs, mode);
B_L1L2(bcs, PH_ACTIVATE | INDICATION, NULL);
break;
case PH_DEACTIVATE | REQUEST:
- DBG(4,"B%d,PH_DEACTIVATE_REQUEST", bcs->channel + 1);
+ DBG(4, "B%d,PH_DEACTIVATE_REQUEST", bcs->channel + 1);
modehdlc(bcs, L1_MODE_NULL);
B_L1L2(bcs, PH_DEACTIVATE | INDICATION, NULL);
break;
@@ -702,10 +702,10 @@ static inline void fcpci2_init(struct fritz_adapter *adapter)
static inline void fcpci_init(struct fritz_adapter *adapter)
{
- outb(AVM_STATUS0_DIS_TIMER | AVM_STATUS0_RES_TIMER |
+ outb(AVM_STATUS0_DIS_TIMER | AVM_STATUS0_RES_TIMER |
AVM_STATUS0_ENA_IRQ, adapter->io + AVM_STATUS0);
- outb(AVM_STATUS1_ENA_IOM | adapter->irq,
+ outb(AVM_STATUS1_ENA_IOM | adapter->irq,
adapter->io + AVM_STATUS1);
mdelay(10);
}
@@ -717,7 +717,7 @@ static int __devinit fcpcipnp_setup(struct fritz_adapter *adapter)
u32 val = 0;
int retval;
- DBG(1,"");
+ DBG(1, "");
isac_init(&adapter->isac); // FIXME is this okay now
@@ -737,7 +737,7 @@ static int __devinit fcpcipnp_setup(struct fritz_adapter *adapter)
}
DBG(1, "stat %#x Class %X Rev %d",
- val, val & 0xff, (val>>8) & 0xff);
+ val, val & 0xff, (val >> 8) & 0xff);
spin_lock_init(&adapter->hw_lock);
adapter->isac.priv = adapter;
@@ -819,15 +819,15 @@ static int __devinit fcpcipnp_setup(struct fritz_adapter *adapter)
return 0;
- err_region:
+err_region:
release_region(adapter->io, 32);
- err:
+err:
return retval;
}
static void __devexit fcpcipnp_release(struct fritz_adapter *adapter)
{
- DBG(1,"");
+ DBG(1, "");
outb(0, adapter->io + AVM_STATUS0);
free_irq(adapter->irq, adapter);
@@ -836,7 +836,7 @@ static void __devexit fcpcipnp_release(struct fritz_adapter *adapter)
// ----------------------------------------------------------------------
-static struct fritz_adapter * __devinit
+static struct fritz_adapter * __devinit
new_adapter(void)
{
struct fritz_adapter *adapter;
@@ -850,7 +850,7 @@ new_adapter(void)
adapter->isac.hisax_d_if.owner = THIS_MODULE;
adapter->isac.hisax_d_if.ifc.priv = &adapter->isac;
adapter->isac.hisax_d_if.ifc.l2l1 = isac_d_l2l1;
-
+
for (i = 0; i < 2; i++) {
adapter->bcs[i].adapter = adapter;
adapter->bcs[i].channel = i;
@@ -862,7 +862,7 @@ new_adapter(void)
b_if[i] = &adapter->bcs[i].b_if;
if (hisax_register(&adapter->isac.hisax_d_if, b_if, "fcpcipnp",
- protocol) != 0) {
+ protocol) != 0) {
kfree(adapter);
adapter = NULL;
}
@@ -889,7 +889,7 @@ static int __devinit fcpci_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, adapter);
- if (pdev->device == PCI_DEVICE_ID_AVM_A1_V2)
+ if (pdev->device == PCI_DEVICE_ID_AVM_A1_V2)
adapter->type = AVM_FRITZ_PCIV2;
else
adapter->type = AVM_FRITZ_PCI;
@@ -909,10 +909,10 @@ static int __devinit fcpci_probe(struct pci_dev *pdev,
goto err_free;
return 0;
-
- err_free:
+
+err_free:
delete_adapter(adapter);
- err:
+err:
return retval;
}
@@ -923,7 +923,7 @@ static int __devinit fcpnp_probe(struct pnp_dev *pdev, const struct pnp_device_i
int retval;
if (!pdev)
- return(-ENODEV);
+ return (-ENODEV);
retval = -ENOMEM;
adapter = new_adapter();
@@ -938,7 +938,7 @@ static int __devinit fcpnp_probe(struct pnp_dev *pdev, const struct pnp_device_i
retval = pnp_activate_dev(pdev);
if (retval < 0) {
printk(KERN_WARNING "%s: pnp_activate_dev(%s) ret(%d)\n", __func__,
- (char *)dev_id->driver_data, retval);
+ (char *)dev_id->driver_data, retval);
goto err_free;
}
adapter->io = pnp_port_start(pdev, 0);
@@ -952,10 +952,10 @@ static int __devinit fcpnp_probe(struct pnp_dev *pdev, const struct pnp_device_i
goto err_free;
return 0;
-
- err_free:
+
+err_free:
delete_adapter(adapter);
- err:
+err:
return retval;
}