diff options
author | Joe Perches <joe@perches.com> | 2012-02-19 19:52:38 -0800 |
---|---|---|
committer | Joe Perches <joe@perches.com> | 2012-02-21 09:04:01 -0800 |
commit | 475be4d85a274d0961593db41cf85689db1d583c (patch) | |
tree | b2b8931eb747794730522c3cf1898e46948527b9 /drivers/isdn/hysdn | |
parent | 0b0a635f79f91f3755b6518627ea06dd0dbfd523 (diff) |
isdn: whitespace coding style cleanup
isdn source code uses a not-current coding style.
Update the coding style used on a per-line basis
so that git diff -w shows only elided blank lines
at EOF.
Done with emacs and some scripts and some typing.
Built x86 allyesconfig.
No detected change in objdump -d or size.
Signed-off-by: Joe Perches <joe@perches.com>
Diffstat (limited to 'drivers/isdn/hysdn')
-rw-r--r-- | drivers/isdn/hysdn/boardergo.c | 28 | ||||
-rw-r--r-- | drivers/isdn/hysdn/boardergo.h | 30 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hycapi.c | 374 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_boot.c | 302 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_defs.h | 30 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_init.c | 4 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_net.c | 20 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_pof.h | 26 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_procconf.c | 10 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_proclog.c | 26 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_sched.c | 54 | ||||
-rw-r--r-- | drivers/isdn/hysdn/ince1pc.h | 72 |
12 files changed, 488 insertions, 488 deletions
diff --git a/drivers/isdn/hysdn/boardergo.c b/drivers/isdn/hysdn/boardergo.c index 3eb096f0ae1b..2aa2a0e08247 100644 --- a/drivers/isdn/hysdn/boardergo.c +++ b/drivers/isdn/hysdn/boardergo.c @@ -25,7 +25,7 @@ #include "hysdn_defs.h" #include "boardergo.h" -#define byteout(addr,val) outb(val,addr) +#define byteout(addr, val) outb(val, addr) #define bytein(addr) inb(addr) /***************************************************/ @@ -73,7 +73,7 @@ ergo_interrupt(int intno, void *dev_id) static void ergo_irq_bh(struct work_struct *ugli_api) { - hysdn_card * card = container_of(ugli_api, hysdn_card, irq_queue); + hysdn_card *card = container_of(ugli_api, hysdn_card, irq_queue); tErgDpram *dpr; int again; unsigned long flags; @@ -125,7 +125,7 @@ ergo_irq_bh(struct work_struct *ugli_api) /* stop the card (hardware reset) and disable interrupts */ /*********************************************************/ static void -ergo_stopcard(hysdn_card * card) +ergo_stopcard(hysdn_card *card) { unsigned long flags; unsigned char val; @@ -150,7 +150,7 @@ ergo_stopcard(hysdn_card * card) /* enable or disable the cards error log. The event is queued if possible */ /**************************************************************************/ static void -ergo_set_errlog_state(hysdn_card * card, int on) +ergo_set_errlog_state(hysdn_card *card, int on) { unsigned long flags; @@ -180,7 +180,7 @@ ergo_set_errlog_state(hysdn_card * card, int on) static const char TestText[36] = "This Message is filler, why read it"; static int -ergo_testram(hysdn_card * card) +ergo_testram(hysdn_card *card) { tErgDpram *dpr = card->dpram; @@ -212,12 +212,12 @@ ergo_testram(hysdn_card * card) /*****************************************************************************/ static int ergo_writebootimg(struct HYSDN_CARD *card, unsigned char *buf, - unsigned long offs) + unsigned long offs) { unsigned char *dst; tErgDpram *dpram; int cnt = (BOOT_IMG_SIZE >> 2); /* number of words to move and swap (byte order!) */ - + if (card->debug_flags & LOG_POF_CARD) hysdn_addlog(card, "ERGO: write bootldr offs=0x%lx ", offs); @@ -355,7 +355,7 @@ ergo_waitpofready(struct HYSDN_CARD *card) /* enable the cards interrupt */ byteout(card->iobase + PCI9050_INTR_REG, bytein(card->iobase + PCI9050_INTR_REG) | - (PCI9050_INTR_REG_ENPCI | PCI9050_INTR_REG_EN1)); + (PCI9050_INTR_REG_ENPCI | PCI9050_INTR_REG_EN1)); card->irq_enabled = 1; /* we are ready to receive interrupts */ dpr->ToPcFlag = 0; /* reset data indicator */ @@ -363,15 +363,15 @@ ergo_waitpofready(struct HYSDN_CARD *card) dpr->ToPcInt = 1; /* interrupt to E1 for all cards */ spin_unlock_irqrestore(&card->hysdn_lock, flags); - if ((hynet_enable & (1 << card->myid)) - && (i = hysdn_net_create(card))) + if ((hynet_enable & (1 << card->myid)) + && (i = hysdn_net_create(card))) { ergo_stopcard(card); card->state = CARD_STATE_BOOTERR; return (i); } #ifdef CONFIG_HYSDN_CAPI - if((i = hycapi_capi_create(card))) { + if ((i = hycapi_capi_create(card))) { printk(KERN_WARNING "HYSDN: failed to create capi-interface.\n"); } #endif /* CONFIG_HYSDN_CAPI */ @@ -393,7 +393,7 @@ ergo_waitpofready(struct HYSDN_CARD *card) /* Use only during module release. */ /************************************************************************************/ static void -ergo_releasehardware(hysdn_card * card) +ergo_releasehardware(hysdn_card *card) { ergo_stopcard(card); /* first stop the card if not already done */ free_irq(card->irq, card); /* release interrupt */ @@ -410,9 +410,9 @@ ergo_releasehardware(hysdn_card * card) /* Use only during module init. */ /*********************************************************************************/ int -ergo_inithardware(hysdn_card * card) +ergo_inithardware(hysdn_card *card) { - if (!request_region(card->iobase + PCI9050_INTR_REG, 1, "HYSDN")) + if (!request_region(card->iobase + PCI9050_INTR_REG, 1, "HYSDN")) return (-1); if (!request_region(card->iobase + PCI9050_USER_IO, 1, "HYSDN")) { release_region(card->iobase + PCI9050_INTR_REG, 1); diff --git a/drivers/isdn/hysdn/boardergo.h b/drivers/isdn/hysdn/boardergo.h index c59422aa8c3f..e99bd81c4034 100644 --- a/drivers/isdn/hysdn/boardergo.h +++ b/drivers/isdn/hysdn/boardergo.h @@ -23,8 +23,8 @@ /* following DPRAM layout copied from OS2-driver boarderg.h */ typedef struct ErgDpram_tag { -/*0000 */ unsigned char ToHyBuf[ERG_TO_HY_BUF_SIZE]; -/*0E00 */ unsigned char ToPcBuf[ERG_TO_PC_BUF_SIZE]; + /*0000 */ unsigned char ToHyBuf[ERG_TO_HY_BUF_SIZE]; + /*0E00 */ unsigned char ToPcBuf[ERG_TO_PC_BUF_SIZE]; /*1C00 */ unsigned char bSoftUart[SIZE_RSV_SOFT_UART]; /* size 0x1B0 */ @@ -37,22 +37,22 @@ typedef struct ErgDpram_tag { /*1DB9 unsigned long ucText[ERRLOG_TEXT_SIZE]; *//* ASCIIZ of len ucTextSize-1 */ /*1DF0 */ -/*1DF0 */ unsigned short volatile ToHyChannel; -/*1DF2 */ unsigned short volatile ToHySize; + /*1DF0 */ unsigned short volatile ToHyChannel; + /*1DF2 */ unsigned short volatile ToHySize; /*1DF4 */ unsigned char volatile ToHyFlag; /* !=0: msg for Hy waiting */ /*1DF5 */ unsigned char volatile ToPcFlag; /* !=0: msg for PC waiting */ -/*1DF6 */ unsigned short volatile ToPcChannel; -/*1DF8 */ unsigned short volatile ToPcSize; + /*1DF6 */ unsigned short volatile ToPcChannel; + /*1DF8 */ unsigned short volatile ToPcSize; /*1DFA */ unsigned char bRes1DBA[0x1E00 - 0x1DFA]; /* 6 bytes */ -/*1E00 */ unsigned char bRestOfEntryTbl[0x1F00 - 0x1E00]; -/*1F00 */ unsigned long TrapTable[62]; + /*1E00 */ unsigned char bRestOfEntryTbl[0x1F00 - 0x1E00]; + /*1F00 */ unsigned long TrapTable[62]; /*1FF8 */ unsigned char bRes1FF8[0x1FFB - 0x1FF8]; /* low part of reset vetor */ -/*1FFB */ unsigned char ToPcIntMetro; + /*1FFB */ unsigned char ToPcIntMetro; /* notes: * - metro has 32-bit boot ram - accessing * ToPcInt and ToHyInt would be the same; @@ -65,13 +65,13 @@ typedef struct ErgDpram_tag { * so E1 side should NOT change this byte * when writing! */ -/*1FFC */ unsigned char volatile ToHyNoDpramErrLog; + /*1FFC */ unsigned char volatile ToHyNoDpramErrLog; /* note: ToHyNoDpramErrLog is used to inform * boot loader, not to use DPRAM based * ErrLog; when DOS driver is rewritten * this becomes obsolete */ -/*1FFD */ unsigned char bRes1FFD; + /*1FFD */ unsigned char bRes1FFD; /*1FFE */ unsigned char ToPcInt; /* E1_intclear; on CHAMP2: E1_intset */ /*1FFF */ unsigned char ToHyInt; @@ -85,16 +85,16 @@ typedef struct ErgDpram_tag { #define PCI9050_INTR_REG 0x4C /* Interrupt register */ #define PCI9050_USER_IO 0x51 /* User I/O register */ - /* bitmask for PCI9050_INTR_REG: */ +/* bitmask for PCI9050_INTR_REG: */ #define PCI9050_INTR_REG_EN1 0x01 /* 1= enable (def.), 0= disable */ #define PCI9050_INTR_REG_POL1 0x02 /* 1= active high (def.), 0= active low */ #define PCI9050_INTR_REG_STAT1 0x04 /* 1= intr. active, 0= intr. not active (def.) */ #define PCI9050_INTR_REG_ENPCI 0x40 /* 1= PCI interrupts enable (def.) */ - /* bitmask for PCI9050_USER_IO: */ +/* bitmask for PCI9050_USER_IO: */ #define PCI9050_USER_IO_EN3 0x02 /* 1= disable , 0= enable (def.) */ #define PCI9050_USER_IO_DIR3 0x04 /* 1= output (def.), 0= input */ #define PCI9050_USER_IO_DAT3 0x08 /* 1= high (def.) , 0= low */ -#define PCI9050_E1_RESET ( PCI9050_USER_IO_DIR3) /* 0x04 */ -#define PCI9050_E1_RUN (PCI9050_USER_IO_DAT3|PCI9050_USER_IO_DIR3) /* 0x0C */ +#define PCI9050_E1_RESET (PCI9050_USER_IO_DIR3) /* 0x04 */ +#define PCI9050_E1_RUN (PCI9050_USER_IO_DAT3 | PCI9050_USER_IO_DIR3) /* 0x0C */ diff --git a/drivers/isdn/hysdn/hycapi.c b/drivers/isdn/hysdn/hycapi.c index 6299b06ae009..931f916c9c23 100644 --- a/drivers/isdn/hysdn/hycapi.c +++ b/drivers/isdn/hysdn/hycapi.c @@ -31,9 +31,9 @@ #include "hysdn_defs.h" #include <linux/kernelcapi.h> -static char hycapi_revision[]="$Revision: 1.8.6.4 $"; +static char hycapi_revision[] = "$Revision: 1.8.6.4 $"; -unsigned int hycapi_enable = 0xffffffff; +unsigned int hycapi_enable = 0xffffffff; module_param(hycapi_enable, uint, 0); typedef struct _hycapi_appl { @@ -48,18 +48,18 @@ static u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb); static inline int _hycapi_appCheck(int app_id, int ctrl_no) { - if((ctrl_no <= 0) || (ctrl_no > CAPI_MAXCONTR) || (app_id <= 0) || + if ((ctrl_no <= 0) || (ctrl_no > CAPI_MAXCONTR) || (app_id <= 0) || (app_id > CAPI_MAXAPPL)) { printk(KERN_ERR "HYCAPI: Invalid request app_id %d for controller %d", app_id, ctrl_no); return -1; } - return ((hycapi_applications[app_id-1].ctrl_mask & (1 << (ctrl_no-1))) != 0); + return ((hycapi_applications[app_id - 1].ctrl_mask & (1 << (ctrl_no-1))) != 0); } /****************************** Kernel-Capi callback reset_ctr -******************************/ +******************************/ static void hycapi_reset_ctr(struct capi_ctr *ctrl) @@ -75,7 +75,7 @@ hycapi_reset_ctr(struct capi_ctr *ctrl) /****************************** Kernel-Capi callback remove_ctr -******************************/ +******************************/ static void hycapi_remove_ctr(struct capi_ctr *ctrl) @@ -85,25 +85,25 @@ hycapi_remove_ctr(struct capi_ctr *ctrl) hysdn_card *card = NULL; #ifdef HYCAPI_PRINTFNAMES printk(KERN_NOTICE "HYCAPI hycapi_remove_ctr\n"); -#endif +#endif cinfo = (hycapictrl_info *)(ctrl->driverdata); - if(!cinfo) { + if (!cinfo) { printk(KERN_ERR "No hycapictrl_info set!"); return; - } + } card = cinfo->card; capi_ctr_suspend_output(ctrl); - for(i=0; i<CAPI_MAXAPPL;i++) { - if(hycapi_applications[i].listen_req[ctrl->cnr-1]) { - kfree_skb(hycapi_applications[i].listen_req[ctrl->cnr-1]); - hycapi_applications[i].listen_req[ctrl->cnr-1] = NULL; + for (i = 0; i < CAPI_MAXAPPL; i++) { + if (hycapi_applications[i].listen_req[ctrl->cnr - 1]) { + kfree_skb(hycapi_applications[i].listen_req[ctrl->cnr - 1]); + hycapi_applications[i].listen_req[ctrl->cnr - 1] = NULL; } } detach_capi_ctr(ctrl); ctrl->driverdata = NULL; kfree(card->hyctrlinfo); - + card->hyctrlinfo = NULL; } @@ -121,7 +121,7 @@ hycapi_sendmsg_internal(struct capi_ctr *ctrl, struct sk_buff *skb) spin_lock_irq(&cinfo->lock); #ifdef HYCAPI_PRINTFNAMES - printk(KERN_NOTICE "hycapi_send_message\n"); + printk(KERN_NOTICE "hycapi_send_message\n"); #endif cinfo->skbs[cinfo->in_idx++] = skb; /* add to buffer list */ if (cinfo->in_idx >= HYSDN_MAX_CAPI_SKB) @@ -130,7 +130,7 @@ hycapi_sendmsg_internal(struct capi_ctr *ctrl, struct sk_buff *skb) if (cinfo->sk_count >= HYSDN_MAX_CAPI_SKB) { /* inform upper layers we're full */ printk(KERN_ERR "HYSDN Card%d: CAPI-buffer overrun!\n", - card->myid); + card->myid); capi_ctr_suspend_output(ctrl); } cinfo->tx_skb = skb; @@ -147,7 +147,7 @@ re-register any applications in the private list. ************************************************************/ -static void +static void hycapi_register_internal(struct capi_ctr *ctrl, __u16 appl, capi_register_params *rp) { @@ -161,9 +161,9 @@ hycapi_register_internal(struct capi_ctr *ctrl, __u16 appl, __u16 MessageBufferSize = 0; int slen = strlen(ExtFeatureDefaults); #ifdef HYCAPI_PRINTFNAMES - printk(KERN_NOTICE "hycapi_register_appl\n"); + printk(KERN_NOTICE "hycapi_register_appl\n"); #endif - MessageBufferSize = rp->level3cnt * rp->datablkcnt * rp->datablklen; + MessageBufferSize = rp->level3cnt * rp->datablkcnt * rp->datablklen; len = CAPI_MSG_BASELEN + 8 + slen + 1; if (!(skb = alloc_skb(len, GFP_ATOMIC))) { @@ -171,18 +171,18 @@ hycapi_register_internal(struct capi_ctr *ctrl, __u16 appl, card->myid); return; } - memcpy(skb_put(skb,sizeof(__u16)), &len, sizeof(__u16)); - memcpy(skb_put(skb,sizeof(__u16)), &appl, sizeof(__u16)); - memcpy(skb_put(skb,sizeof(__u8)), &_command, sizeof(_command)); - memcpy(skb_put(skb,sizeof(__u8)), &_subcommand, sizeof(_subcommand)); - memcpy(skb_put(skb,sizeof(__u16)), &MessageNumber, sizeof(__u16)); - memcpy(skb_put(skb,sizeof(__u16)), &MessageBufferSize, sizeof(__u16)); - memcpy(skb_put(skb,sizeof(__u16)), &(rp->level3cnt), sizeof(__u16)); - memcpy(skb_put(skb,sizeof(__u16)), &(rp->datablkcnt), sizeof(__u16)); - memcpy(skb_put(skb,sizeof(__u16)), &(rp->datablklen), sizeof(__u16)); - memcpy(skb_put(skb,slen), ExtFeatureDefaults, slen); - hycapi_applications[appl-1].ctrl_mask |= (1 << (ctrl->cnr-1)); - hycapi_send_message(ctrl, skb); + memcpy(skb_put(skb, sizeof(__u16)), &len, sizeof(__u16)); + memcpy(skb_put(skb, sizeof(__u16)), &appl, sizeof(__u16)); + memcpy(skb_put(skb, sizeof(__u8)), &_command, sizeof(_command)); + memcpy(skb_put(skb, sizeof(__u8)), &_subcommand, sizeof(_subcommand)); + memcpy(skb_put(skb, sizeof(__u16)), &MessageNumber, sizeof(__u16)); + memcpy(skb_put(skb, sizeof(__u16)), &MessageBufferSize, sizeof(__u16)); + memcpy(skb_put(skb, sizeof(__u16)), &(rp->level3cnt), sizeof(__u16)); + memcpy(skb_put(skb, sizeof(__u16)), &(rp->datablkcnt), sizeof(__u16)); + memcpy(skb_put(skb, sizeof(__u16)), &(rp->datablklen), sizeof(__u16)); + memcpy(skb_put(skb, slen), ExtFeatureDefaults, slen); + hycapi_applications[appl - 1].ctrl_mask |= (1 << (ctrl->cnr - 1)); + hycapi_send_message(ctrl, skb); } /************************************************************ @@ -200,12 +200,12 @@ static void hycapi_restart_internal(struct capi_ctr *ctrl) #ifdef HYCAPI_PRINTFNAMES printk(KERN_WARNING "HYSDN: hycapi_restart_internal"); #endif - for(i=0; i<CAPI_MAXAPPL; i++) { - if(_hycapi_appCheck(i+1, ctrl->cnr) == 1) { - hycapi_register_internal(ctrl, i+1, + for (i = 0; i < CAPI_MAXAPPL; i++) { + if (_hycapi_appCheck(i + 1, ctrl->cnr) == 1) { + hycapi_register_internal(ctrl, i + 1, &hycapi_applications[i].rp); - if(hycapi_applications[i].listen_req[ctrl->cnr-1]) { - skb = skb_copy(hycapi_applications[i].listen_req[ctrl->cnr-1], GFP_ATOMIC); + if (hycapi_applications[i].listen_req[ctrl->cnr - 1]) { + skb = skb_copy(hycapi_applications[i].listen_req[ctrl->cnr - 1], GFP_ATOMIC); hycapi_sendmsg_internal(ctrl, skb); } } @@ -220,35 +220,35 @@ The application is recorded in the internal list. *************************************************************/ static void -hycapi_register_appl(struct capi_ctr *ctrl, __u16 appl, +hycapi_register_appl(struct capi_ctr *ctrl, __u16 appl, capi_register_params *rp) { int MaxLogicalConnections = 0, MaxBDataBlocks = 0, MaxBDataLen = 0; hycapictrl_info *cinfo = (hycapictrl_info *)(ctrl->driverdata); hysdn_card *card = cinfo->card; int chk = _hycapi_appCheck(appl, ctrl->cnr); - if(chk < 0) { + if (chk < 0) { return; } - if(chk == 1) { + if (chk == 1) { printk(KERN_INFO "HYSDN: apl %d already registered\n", appl); return; } MaxBDataBlocks = rp->datablkcnt > CAPI_MAXDATAWINDOW ? CAPI_MAXDATAWINDOW : rp->datablkcnt; rp->datablkcnt = MaxBDataBlocks; - MaxBDataLen = rp->datablklen < 1024 ? 1024 : rp->datablklen ; + MaxBDataLen = rp->datablklen < 1024 ? 1024 : rp->datablklen; rp->datablklen = MaxBDataLen; - + MaxLogicalConnections = rp->level3cnt; if (MaxLogicalConnections < 0) { - MaxLogicalConnections = card->bchans * -MaxLogicalConnections; + MaxLogicalConnections = card->bchans * -MaxLogicalConnections; } if (MaxLogicalConnections == 0) { MaxLogicalConnections = card->bchans; } - + rp->level3cnt = MaxLogicalConnections; - memcpy(&hycapi_applications[appl-1].rp, + memcpy(&hycapi_applications[appl - 1].rp, rp, sizeof(capi_register_params)); } @@ -279,19 +279,19 @@ static void hycapi_release_internal(struct capi_ctr *ctrl, __u16 appl) card->myid); return; } - memcpy(skb_put(skb,sizeof(__u16)), &len, sizeof(__u16)); - memcpy(skb_put(skb,sizeof(__u16)), &appl, sizeof(__u16)); - memcpy(skb_put(skb,sizeof(__u8)), &_command, sizeof(_command)); - memcpy(skb_put(skb,sizeof(__u8)), &_subcommand, sizeof(_subcommand)); - memcpy(skb_put(skb,sizeof(__u16)), &MessageNumber, sizeof(__u16)); - hycapi_send_message(ctrl, skb); - hycapi_applications[appl-1].ctrl_mask &= ~(1 << (ctrl->cnr-1)); + memcpy(skb_put(skb, sizeof(__u16)), &len, sizeof(__u16)); + memcpy(skb_put(skb, sizeof(__u16)), &appl, sizeof(__u16)); + memcpy(skb_put(skb, sizeof(__u8)), &_command, sizeof(_command)); + memcpy(skb_put(skb, sizeof(__u8)), &_subcommand, sizeof(_subcommand)); + memcpy(skb_put(skb, sizeof(__u16)), &MessageNumber, sizeof(__u16)); + hycapi_send_message(ctrl, skb); + hycapi_applications[appl - 1].ctrl_mask &= ~(1 << (ctrl->cnr - 1)); } /****************************************************************** hycapi_release_appl -Release the application from the internal list an remove it's +Release the application from the internal list an remove it's registration at controller-level ******************************************************************/ @@ -301,15 +301,15 @@ hycapi_release_appl(struct capi_ctr *ctrl, __u16 appl) int chk; chk = _hycapi_appCheck(appl, ctrl->cnr); - if(chk<0) { + if (chk < 0) { printk(KERN_ERR "HYCAPI: Releasing invalid appl %d on controller %d\n", appl, ctrl->cnr); return; } - if(hycapi_applications[appl-1].listen_req[ctrl->cnr-1]) { - kfree_skb(hycapi_applications[appl-1].listen_req[ctrl->cnr-1]); - hycapi_applications[appl-1].listen_req[ctrl->cnr-1] = NULL; + if (hycapi_applications[appl - 1].listen_req[ctrl->cnr - 1]) { + kfree_skb(hycapi_applications[appl - 1].listen_req[ctrl->cnr - 1]); + hycapi_applications[appl - 1].listen_req[ctrl->cnr - 1] = NULL; } - if(chk == 1) + if (chk == 1) { hycapi_release_internal(ctrl, appl); } @@ -327,7 +327,7 @@ int hycapi_capi_release(hysdn_card *card) #ifdef HYCAPI_PRINTFNAMES printk(KERN_NOTICE "hycapi_capi_release\n"); #endif - if(cinfo) { + if (cinfo) { ctrl = &cinfo->capi_ctrl; hycapi_remove_ctr(ctrl); } @@ -347,7 +347,7 @@ int hycapi_capi_stop(hysdn_card *card) #ifdef HYCAPI_PRINTFNAMES printk(KERN_NOTICE "hycapi_capi_stop\n"); #endif - if(cinfo) { + if (cinfo) { ctrl = &cinfo->capi_ctrl; /* ctrl->suspend_output(ctrl); */ capi_ctr_down(ctrl); @@ -377,59 +377,59 @@ static u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) u16 retval = CAPI_NOERROR; appl_id = CAPIMSG_APPID(skb->data); - switch(_hycapi_appCheck(appl_id, ctrl->cnr)) + switch (_hycapi_appCheck(appl_id, ctrl->cnr)) { - case 0: + case 0: /* printk(KERN_INFO "Need to register\n"); */ - hycapi_register_internal(ctrl, - appl_id, - &(hycapi_applications[appl_id-1].rp)); - break; - case 1: - break; - default: - printk(KERN_ERR "HYCAPI: Controller mixup!\n"); - retval = CAPI_ILLAPPNR; - goto out; + hycapi_register_internal(ctrl, + appl_id, + &(hycapi_applications[appl_id - 1].rp)); + break; + case 1: + break; + default: + printk(KERN_ERR "HYCAPI: Controller mixup!\n"); + retval = CAPI_ILLAPPNR; + goto out; } - switch(CAPIMSG_CMD(skb->data)) { - case CAPI_DISCONNECT_B3_RESP: - capilib_free_ncci(&cinfo->ncci_head, appl_id, - CAPIMSG_NCCI(skb->data)); - break; - case CAPI_DATA_B3_REQ: - _len = CAPIMSG_LEN(skb->data); - if (_len > 22) { - _len2 = _len - 22; - skb_copy_from_linear_data(skb, msghead, 22); - skb_copy_to_linear_data_offset(skb, _len2, - msghead, 22); - skb_pull(skb, _len2); - CAPIMSG_SETLEN(skb->data, 22); - retval = capilib_data_b3_req(&cinfo->ncci_head, - CAPIMSG_APPID(skb->data), - CAPIMSG_NCCI(skb->data), - CAPIMSG_MSGID(skb->data)); - } - break; - case CAPI_LISTEN_REQ: - if(hycapi_applications[appl_id-1].listen_req[ctrl->cnr-1]) - { - kfree_skb(hycapi_applications[appl_id-1].listen_req[ctrl->cnr-1]); - hycapi_applications[appl_id-1].listen_req[ctrl->cnr-1] = NULL; - } - if (!(hycapi_applications[appl_id-1].listen_req[ctrl->cnr-1] = skb_copy(skb, GFP_ATOMIC))) - { - printk(KERN_ERR "HYSDN: memory squeeze in private_listen\n"); - } - break; - default: - break; + switch (CAPIMSG_CMD(skb->data)) { + case CAPI_DISCONNECT_B3_RESP: + capilib_free_ncci(&cinfo->ncci_head, appl_id, + CAPIMSG_NCCI(skb->data)); + break; + case CAPI_DATA_B3_REQ: + _len = CAPIMSG_LEN(skb->data); + if (_len > 22) { + _len2 = _len - 22; + skb_copy_from_linear_data(skb, msghead, 22); + skb_copy_to_linear_data_offset(skb, _len2, + msghead, 22); + skb_pull(skb, _len2); + CAPIMSG_SETLEN(skb->data, 22); + retval = capilib_data_b3_req(&cinfo->ncci_head, + CAPIMSG_APPID(skb->data), + CAPIMSG_NCCI(skb->data), + CAPIMSG_MSGID(skb->data)); + } + break; + case CAPI_LISTEN_REQ: + if (hycapi_applications[appl_id - 1].listen_req[ctrl->cnr - 1]) + { + kfree_skb(hycapi_applications[appl_id - 1].listen_req[ctrl->cnr - 1]); + hycapi_applications[appl_id - 1].listen_req[ctrl->cnr - 1] = NULL; + } + if (!(hycapi_applications[appl_id -1].listen_req[ctrl->cnr - 1] = skb_copy(skb, GFP_ATOMIC))) + { + printk(KERN_ERR "HYSDN: memory squeeze in private_listen\n"); + } + break; + default: + break; } - out: +out: if (retval == CAPI_NOERROR) hycapi_sendmsg_internal(ctrl, skb); - else + else dev_kfree_skb_any(skb); return retval; @@ -445,14 +445,14 @@ static int hycapi_proc_show(struct seq_file *m, void *v) seq_printf(m, "%-16s %s\n", "name", cinfo->cardname); seq_printf(m, "%-16s 0x%x\n", "io", card->iobase); seq_printf(m, "%-16s %d\n", "irq", card->irq); - + switch (card->brdtype) { - case BD_PCCARD: s = "HYSDN Hycard"; break; - case BD_ERGO: s = "HYSDN Ergo2"; break; - case BD_METRO: s = "HYSDN Metro4"; break; - case BD_CHAMP2: s = "HYSDN Champ2"; break; - case BD_PLEXUS: s = "HYSDN Plexus30"; break; - default: s = "???"; break; + case BD_PCCARD: s = "HYSDN Hycard"; break; + case BD_ERGO: s = "HYSDN Ergo2"; break; + case BD_METRO: s = "HYSDN Metro4"; break; + case BD_CHAMP2: s = "HYSDN Champ2"; break; + case BD_PLEXUS: s = "HYSDN Plexus30"; break; + default: s = "???"; break; } seq_printf(m, "%-16s %s\n", "type", s); if ((s = cinfo->version[VER_DRIVER]) != NULL) @@ -461,9 +461,9 @@ static int hycapi_proc_show(struct seq_file *m, void *v) seq_printf(m, "%-16s %s\n", "ver_cardtype", s); if ((s = cinfo->version[VER_SERIAL]) != NULL) seq_printf(m, "%-16s %s\n", "ver_serial", s); - + seq_printf(m, "%-16s %s\n", "cardname", cinfo->cardname); - + return 0; } @@ -491,7 +491,7 @@ on capi-interface registration. static int hycapi_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) { #ifdef HYCAPI_PRINTFNAMES - printk(KERN_NOTICE "hycapi_load_firmware\n"); + printk(KERN_NOTICE "hycapi_load_firmware\n"); #endif return 0; } @@ -501,7 +501,7 @@ static char *hycapi_procinfo(struct capi_ctr *ctrl) { hycapictrl_info *cinfo = (hycapictrl_info *)(ctrl->driverdata); #ifdef HYCAPI_PRINTFNAMES - printk(KERN_NOTICE "hycapi_proc_info\n"); + printk(KERN_NOTICE "hycapi_proc_info\n"); #endif if (!cinfo) return ""; @@ -525,7 +525,7 @@ New nccis are created if necessary. *******************************************************************/ void -hycapi_rx_capipkt(hysdn_card * card, unsigned char *buf, unsigned short len) +hycapi_rx_capipkt(hysdn_card *card, unsigned char *buf, unsigned short len) { struct sk_buff *skb; hycapictrl_info *cinfo = card->hyctrlinfo; @@ -533,24 +533,24 @@ hycapi_rx_capipkt(hysdn_card * card, unsigned char *buf, unsigned short len) __u16 ApplId; __u16 MsgLen, info; __u16 len2, CapiCmd; - __u32 CP64[2] = {0,0}; + __u32 CP64[2] = {0, 0}; #ifdef HYCAPI_PRINTFNAMES - printk(KERN_NOTICE "hycapi_rx_capipkt\n"); + printk(KERN_NOTICE "hycapi_rx_capipkt\n"); #endif - if(!cinfo) { + if (!cinfo) { return; } ctrl = &cinfo->capi_ctrl; - if(len < CAPI_MSG_BASELEN) { + if (len < CAPI_MSG_BASELEN) { printk(KERN_ERR "HYSDN Card%d: invalid CAPI-message, length %d!\n", card->myid, len); return; - } + } MsgLen = CAPIMSG_LEN(buf); ApplId = CAPIMSG_APPID(buf); CapiCmd = CAPIMSG_CMD(buf); - - if((CapiCmd == CAPI_DATA_B3_IND) && (MsgLen < 30)) { + + if ((CapiCmd == CAPI_DATA_B3_IND) && (MsgLen < 30)) { len2 = len + (30 - MsgLen); if (!(skb = alloc_skb(len2, GFP_ATOMIC))) { printk(KERN_ERR "HYSDN Card%d: incoming packet dropped\n", @@ -558,7 +558,7 @@ hycapi_rx_capipkt(hysdn_card * card, unsigned char *buf, unsigned short len) return; } memcpy(skb_put(skb, MsgLen), buf, MsgLen); - memcpy(skb_put(skb, 2*sizeof(__u32)), CP64, 2* sizeof(__u32)); + memcpy(skb_put(skb, 2 * sizeof(__u32)), CP64, 2 * sizeof(__u32)); memcpy(skb_put(skb, len - MsgLen), buf + MsgLen, len - MsgLen); CAPIMSG_SETLEN(skb->data, 30); @@ -570,54 +570,54 @@ hycapi_rx_capipkt(hysdn_card * card, unsigned char *buf, unsigned short len) } memcpy(skb_put(skb, len), buf, len); } - switch(CAPIMSG_CMD(skb->data)) + switch (CAPIMSG_CMD(skb->data)) { - case CAPI_CONNECT_B3_CONF: + case CAPI_CONNECT_B3_CONF: /* Check info-field for error-indication: */ - info = CAPIMSG_U16(skb->data, 12); - switch(info) - { - case 0: - capilib_new_ncci(&cinfo->ncci_head, ApplId, CAPIMSG_NCCI(skb->data), - hycapi_applications[ApplId-1].rp.datablkcnt); - - break; - case 0x0001: - printk(KERN_ERR "HYSDN Card%d: NCPI not supported by current " - "protocol. NCPI ignored.\n", card->myid); - break; - case 0x2001: - printk(KERN_ERR "HYSDN Card%d: Message not supported in" - " current state\n", card->myid); - break; - case 0x2002: - printk(KERN_ERR "HYSDN Card%d: invalid PLCI\n", card->myid); - break; - case 0x2004: - printk(KERN_ERR "HYSDN Card%d: out of NCCI\n", card->myid); - break; - case 0x3008: - printk(KERN_ERR "HYSDN Card%d: NCPI not supported\n", - card->myid); - break; - default: - printk(KERN_ERR "HYSDN Card%d: Info in CONNECT_B3_CONF: %d\n", - card->myid, info); - break; - } + info = CAPIMSG_U16(skb->data, 12); + switch (info) + { + case 0: + capilib_new_ncci(&cinfo->ncci_head, ApplId, CAPIMSG_NCCI(skb->data), + hycapi_applications[ApplId - 1].rp.datablkcnt); + + break; + case 0x0001: + printk(KERN_ERR "HYSDN Card%d: NCPI not supported by current " + "protocol. NCPI ignored.\n", card->myid); break; - case CAPI_CONNECT_B3_IND: - capilib_new_ncci(&cinfo->ncci_head, ApplId, - CAPIMSG_NCCI(skb->data), - hycapi_applications[ApplId-1].rp.datablkcnt); + case 0x2001: + printk(KERN_ERR "HYSDN Card%d: Message not supported in" + " current state\n", card->myid); break; - case CAPI_DATA_B3_CONF: - capilib_data_b3_conf(&cinfo->ncci_head, ApplId, - CAPIMSG_NCCI(skb->data), - CAPIMSG_MSGID(skb->data)); + case 0x2002: + printk(KERN_ERR "HYSDN Card%d: invalid PLCI\n", card->myid); + break; + case 0x2004: + printk(KERN_ERR "HYSDN Card%d: out of NCCI\n", card->myid); + break; + case 0x3008: + printk(KERN_ERR "HYSDN Card%d: NCPI not supported\n", + card->myid); break; default: + printk(KERN_ERR "HYSDN Card%d: Info in CONNECT_B3_CONF: %d\n", + card->myid, info); break; + } + break; + case CAPI_CONNECT_B3_IND: + capilib_new_ncci(&cinfo->ncci_head, ApplId, + CAPIMSG_NCCI(skb->data), + hycapi_applications[ApplId - 1].rp.datablkcnt); + break; + case CAPI_DATA_B3_CONF: + capilib_data_b3_conf(&cinfo->ncci_head, ApplId, + CAPIMSG_NCCI(skb->data), + CAPIMSG_MSGID(skb->data)); + break; + default: + break; } capi_ctr_handle_message(ctrl, ApplId, skb); } @@ -630,13 +630,13 @@ internal queue. *******************************************************************/ -void hycapi_tx_capiack(hysdn_card * card) +void hycapi_tx_capiack(hysdn_card *card) { hycapictrl_info *cinfo = card->hyctrlinfo; #ifdef HYCAPI_PRINTFNAMES - printk(KERN_NOTICE "hycapi_tx_capiack\n"); + printk(KERN_NOTICE "hycapi_tx_capiack\n"); #endif - if(!cinfo) { + if (!cinfo) { return; } spin_lock_irq(&cinfo->lock); @@ -661,7 +661,7 @@ struct sk_buff * hycapi_tx_capiget(hysdn_card *card) { hycapictrl_info *cinfo = card->hyctrlinfo; - if(!cinfo) { + if (!cinfo) { return (struct sk_buff *)NULL; } if (!cinfo->sk_count) @@ -681,10 +681,10 @@ attach the capi-driver to the kernel-capi. int hycapi_init(void) { int i; - for(i=0;i<CAPI_MAXAPPL;i++) { + for (i = 0; i < CAPI_MAXAPPL; i++) { memset(&(hycapi_applications[i]), 0, sizeof(hycapi_appl)); } - return(0); + return (0); } /************************************************************** @@ -694,7 +694,7 @@ detach the capi-driver to the kernel-capi. Actually this should free some more ressources. Do that later. **************************************************************/ -void +void hycapi_cleanup(void) { } @@ -710,9 +710,9 @@ static void hycapi_fill_profile(hysdn_card *card) hycapictrl_info *cinfo = NULL; struct capi_ctr *ctrl = NULL; cinfo = card->hyctrlinfo; - if(!cinfo) return; + if (!cinfo) return; ctrl = &cinfo->capi_ctrl; - strcpy(ctrl->manu, "Hypercope"); + strcpy(ctrl->manu, "Hypercope"); ctrl->version.majorversion = 2; ctrl->version.minorversion = 0; ctrl->version.majormanuversion = 3; @@ -732,18 +732,18 @@ static void hycapi_fill_profile(hysdn_card *card) (card->faxchans ? B3_PROT_T30 : 0) | (card->faxchans ? B3_PROT_T30EXT : 0) | B3_PROT_ISO8208; -} +} -int +int hycapi_capi_create(hysdn_card *card) { hycapictrl_info *cinfo = NULL; struct capi_ctr *ctrl = NULL; int retval; #ifdef HYCAPI_PRINTFNAMES - printk(KERN_NOTICE "hycapi_capi_create\n"); + printk(KERN_NOTICE "hycapi_capi_create\n"); #endif - if((hycapi_enable & (1 << card->myid)) == 0) { + if ((hycapi_enable & (1 << card->myid)) == 0) { return 1; } if (!card->hyctrlinfo) { @@ -758,12 +758,12 @@ hycapi_capi_create(hysdn_card *card) INIT_LIST_HEAD(&cinfo->ncci_head); switch (card->brdtype) { - case BD_PCCARD: strcpy(cinfo->cardname,"HYSDN Hycard"); break; - case BD_ERGO: strcpy(cinfo->cardname,"HYSDN Ergo2"); break; - case BD_METRO: strcpy(cinfo->cardname,"HYSDN Metro4"); break; - case BD_CHAMP2: strcpy(cinfo->cardname,"HYSDN Champ2"); break; - case BD_PLEXUS: strcpy(cinfo->cardname,"HYSDN Plexus30"); break; - default: strcpy(cinfo->cardname,"HYSDN ???"); break; + case BD_PCCARD: strcpy(cinfo->cardname, "HYSDN Hycard"); break; + case BD_ERGO: strcpy(cinfo->cardname, "HYSDN Ergo2"); break; + case BD_METRO: strcpy(cinfo->cardname, "HYSDN Metro4"); break; + case BD_CHAMP2: strcpy(cinfo->cardname, "HYSDN Champ2"); break; + case BD_PLEXUS: strcpy(cinfo->cardname, "HYSDN Plexus30"); break; + default: strcpy(cinfo->cardname, "HYSDN ???"); break; } ctrl = &cinfo->capi_ctrl; @@ -792,7 +792,7 @@ hycapi_capi_create(hysdn_card *card) ctrl = &card->hyctrlinfo->capi_ctrl; hycapi_fill_profile(card); capi_ctr_ready(ctrl); - hycapi_restart_internal(ctrl); + hycapi_restart_internal(ctrl); /* ctrl->resume_output(ctrl); */ } return 0; diff --git a/drivers/isdn/hysdn/hysdn_boot.c b/drivers/isdn/hysdn/hysdn_boot.c index 4f541ef14f9e..eda4741e3f2f 100644 --- a/drivers/isdn/hysdn/hysdn_boot.c +++ b/drivers/isdn/hysdn/hysdn_boot.c @@ -82,7 +82,7 @@ DecryptBuf(struct boot_data *boot, int cnt) /* id. If successful 0 is returned, a negative value shows an error. */ /********************************************************************************/ static int -pof_handle_data(hysdn_card * card, int datlen) +pof_handle_data(hysdn_card *card, int datlen) { struct boot_data *boot = card->boot; /* pointer to boot specific data */ long l; @@ -92,71 +92,71 @@ pof_handle_data(hysdn_card * card, int datlen) /* handle the different record types */ switch (boot->pof_recid) { - case TAG_TIMESTMP: - if (card->debug_flags & LOG_POF_RECORD) - hysdn_addlog(card, "POF created %s", boot->b |