aboutsummaryrefslogtreecommitdiff
path: root/drivers/isdn/hisax/isurf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/hisax/isurf.c')
-rw-r--r--drivers/isdn/hisax/isurf.c118
1 files changed, 59 insertions, 59 deletions
diff --git a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c
index ca4161798cd..ea271721529 100644
--- a/drivers/isdn/hisax/isurf.c
+++ b/drivers/isdn/hisax/isurf.c
@@ -4,7 +4,7 @@
*
* Author Karsten Keil
* Copyright by Karsten Keil <keil@isdn4linux.de>
- *
+ *
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
@@ -19,7 +19,7 @@
static const char *ISurf_revision = "$Revision: 1.12.2.4 $";
-#define byteout(addr,val) outb(val,addr)
+#define byteout(addr, val) outb(val, addr)
#define bytein(addr) inb(addr)
#define ISURF_ISAR_RESET 1
@@ -46,7 +46,7 @@ WriteISAC(struct IsdnCardState *cs, u_char offset, u_char value)
}
static void
-ReadISACfifo(struct IsdnCardState *cs, u_char * data, int size)
+ReadISACfifo(struct IsdnCardState *cs, u_char *data, int size)
{
register int i;
for (i = 0; i < size; i++)
@@ -54,11 +54,11 @@ ReadISACfifo(struct IsdnCardState *cs, u_char * data, int size)
}
static void
-WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size)
+WriteISACfifo(struct IsdnCardState *cs, u_char *data, int size)
{
register int i;
- for (i = 0; i < size; i++){
- writeb(data[i], cs->hw.isurf.isac);mb();
+ for (i = 0; i < size; i++) {
+ writeb(data[i], cs->hw.isurf.isac); mb();
}
}
@@ -67,17 +67,17 @@ WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size)
* mode = 1 access with IRQ off
* mode = 2 access with IRQ off and using last offset
*/
-
+
static u_char
ReadISAR(struct IsdnCardState *cs, int mode, u_char offset)
-{
- return(readb(cs->hw.isurf.isar + offset));
+{
+ return (readb(cs->hw.isurf.isar + offset));
}
static void
WriteISAR(struct IsdnCardState *cs, int mode, u_char offset, u_char value)
{
- writeb(value, cs->hw.isurf.isar + offset);mb();
+ writeb(value, cs->hw.isurf.isar + offset); mb();
}
static irqreturn_t
@@ -90,11 +90,11 @@ isurf_interrupt(int intno, void *dev_id)
spin_lock_irqsave(&cs->lock, flags);
val = readb(cs->hw.isurf.isar + ISAR_IRQBIT);
- Start_ISAR:
+Start_ISAR:
if (val & ISAR_IRQSTA)
isar_int_main(cs);
val = readb(cs->hw.isurf.isac + ISAC_ISTA);
- Start_ISAC:
+Start_ISAC:
if (val)
isac_interrupt(cs, val);
val = readb(cs->hw.isurf.isar + ISAR_IRQBIT);
@@ -113,8 +113,8 @@ isurf_interrupt(int intno, void *dev_id)
printk(KERN_WARNING "ISurf IRQ LOOP\n");
writeb(0, cs->hw.isurf.isar + ISAR_IRQBIT); mb();
- writeb(0xFF, cs->hw.isurf.isac + ISAC_MASK);mb();
- writeb(0, cs->hw.isurf.isac + ISAC_MASK);mb();
+ writeb(0xFF, cs->hw.isurf.isac + ISAC_MASK); mb();
+ writeb(0, cs->hw.isurf.isac + ISAC_MASK); mb();
writeb(ISAR_IRQMSK, cs->hw.isurf.isar + ISAR_IRQBIT); mb();
spin_unlock_irqrestore(&cs->lock, flags);
return IRQ_HANDLED;
@@ -145,31 +145,31 @@ ISurf_card_msg(struct IsdnCardState *cs, int mt, void *arg)
u_long flags;
switch (mt) {
- case CARD_RESET:
- spin_lock_irqsave(&cs->lock, flags);
- reset_isurf(cs, ISURF_RESET);
- spin_unlock_irqrestore(&cs->lock, flags);
- return(0);
- case CARD_RELEASE:
- release_io_isurf(cs);
- return(0);
- case CARD_INIT:
- spin_lock_irqsave(&cs->lock, flags);
- reset_isurf(cs, ISURF_RESET);
- clear_pending_isac_ints(cs);
- writeb(0, cs->hw.isurf.isar+ISAR_IRQBIT);mb();
- initisac(cs);
- initisar(cs);
- /* Reenable ISAC IRQ */
- cs->writeisac(cs, ISAC_MASK, 0);
- /* RESET Receiver and Transmitter */
- cs->writeisac(cs, ISAC_CMDR, 0x41);
- spin_unlock_irqrestore(&cs->lock, flags);
- return(0);
- case CARD_TEST:
- return(0);
+ case CARD_RESET:
+ spin_lock_irqsave(&cs->lock, flags);
+ reset_isurf(cs, ISURF_RESET);
+ spin_unlock_irqrestore(&cs->lock, flags);
+ return (0);
+ case CARD_RELEASE:
+ release_io_isurf(cs);
+ return (0);
+ case CARD_INIT:
+ spin_lock_irqsave(&cs->lock, flags);
+ reset_isurf(cs, ISURF_RESET);
+ clear_pending_isac_ints(cs);
+ writeb(0, cs->hw.isurf.isar + ISAR_IRQBIT); mb();
+ initisac(cs);
+ initisar(cs);
+ /* Reenable ISAC IRQ */
+ cs->writeisac(cs, ISAC_MASK, 0);
+ /* RESET Receiver and Transmitter */
+ cs->writeisac(cs, ISAC_CMDR, 0x41);
+ spin_unlock_irqrestore(&cs->lock, flags);
+ return (0);
+ case CARD_TEST:
+ return (0);
}
- return(0);
+ return (0);
}
static int
@@ -182,15 +182,15 @@ isurf_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) {
spin_lock_irqsave(&cs->lock, flags);
if (!ret) {
reset_isurf(cs, ISURF_ISAR_EA | ISURF_ISAC_RESET |
- ISURF_ARCOFI_RESET);
+ ISURF_ARCOFI_RESET);
initisac(cs);
cs->writeisac(cs, ISAC_MASK, 0);
cs->writeisac(cs, ISAC_CMDR, 0x41);
}
spin_unlock_irqrestore(&cs->lock, flags);
- return(ret);
+ return (ret);
}
- return(isar_auxcmd(cs, ic));
+ return (isar_auxcmd(cs, ic));
}
#ifdef __ISAPNP__
@@ -206,9 +206,9 @@ setup_isurf(struct IsdnCard *card)
strcpy(tmp, ISurf_revision);
printk(KERN_INFO "HiSax: ISurf driver Rev. %s\n", HiSax_getrev(tmp));
-
- if (cs->typ != ISDN_CTYPE_ISURF)
- return(0);
+
+ if (cs->typ != ISDN_CTYPE_ISURF)
+ return (0);
if (card->para[1] && card->para[2]) {
cs->hw.isurf.reset = card->para[1];
cs->hw.isurf.phymem = card->para[2];
@@ -221,11 +221,11 @@ setup_isurf(struct IsdnCard *card)
cs->subtyp = 0;
if ((pnp_c = pnp_find_card(
- ISAPNP_VENDOR('S', 'I', 'E'),
- ISAPNP_FUNCTION(0x0010), pnp_c))) {
+ ISAPNP_VENDOR('S', 'I', 'E'),
+ ISAPNP_FUNCTION(0x0010), pnp_c))) {
if (!(pnp_d = pnp_find_dev(pnp_c,
- ISAPNP_VENDOR('S', 'I', 'E'),
- ISAPNP_FUNCTION(0x0010), pnp_d))) {
+ ISAPNP_VENDOR('S', 'I', 'E'),
+ ISAPNP_FUNCTION(0x0010), pnp_d))) {
printk(KERN_ERR "ISurfPnP: PnP error card found, no device\n");
return (0);
}
@@ -236,17 +236,17 @@ setup_isurf(struct IsdnCard *card)
cs->irq = pnp_irq(pnp_d, 0);
if (!cs->irq || !cs->hw.isurf.reset || !cs->hw.isurf.phymem) {
printk(KERN_ERR "ISurfPnP:some resources are missing %d/%x/%lx\n",
- cs->irq, cs->hw.isurf.reset, cs->hw.isurf.phymem);
+ cs->irq, cs->hw.isurf.reset, cs->hw.isurf.phymem);
pnp_disable_dev(pnp_d);
- return(0);
+ return (0);
}
} else {
printk(KERN_INFO "ISurfPnP: no ISAPnP card found\n");
- return(0);
+ return (0);
}
} else {
printk(KERN_INFO "ISurfPnP: no ISAPnP bus found\n");
- return(0);
+ return (0);
}
#else
printk(KERN_WARNING "HiSax: Siemens I-Surf port/mem not set\n");
@@ -255,15 +255,15 @@ setup_isurf(struct IsdnCard *card)
}
if (!request_region(cs->hw.isurf.reset, 1, "isurf isdn")) {
printk(KERN_WARNING
- "HiSax: Siemens I-Surf config port %x already in use\n",
- cs->hw.isurf.reset);
- return (0);
+ "HiSax: Siemens I-Surf config port %x already in use\n",
+ cs->hw.isurf.reset);
+ return (0);
}
if (!request_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE, "isurf iomem")) {
printk(KERN_WARNING "HiSax: Siemens I-Surf memory region "
- "%lx-%lx already in use\n",
- cs->hw.isurf.phymem,
- cs->hw.isurf.phymem + ISURF_IOMEM_SIZE);
+ "%lx-%lx already in use\n",
+ cs->hw.isurf.phymem,
+ cs->hw.isurf.phymem + ISURF_IOMEM_SIZE);
release_region(cs->hw.isurf.reset, 1);
return (0);
}
@@ -293,7 +293,7 @@ setup_isurf(struct IsdnCard *card)
ver = ISARVersion(cs, "ISurf:");
if (ver < 0) {
printk(KERN_WARNING
- "ISurf: wrong ISAR version (ret = %d)\n", ver);
+ "ISurf: wrong ISAR version (ret = %d)\n", ver);
release_io_isurf(cs);
return (0);
}