diff options
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 3eb096f0ae1..2aa2a0e0824 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 c59422aa8c3..e99bd81c403 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 6299b06ae00..931f916c9c2 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 4f541ef14f9..eda4741e3f2 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->buf.PofTime.DateTimeText); - break; + case TAG_TIMESTMP: + if (card->debug_flags & LOG_POF_RECORD) + hysdn_addlog(card, "POF created %s", boot->buf.PofTime.DateTimeText); + break; + + case TAG_CBOOTDTA: + DecryptBuf(boot, datlen); /* we need to encrypt the buffer */ + case TAG_BOOTDTA: + if (card->debug_flags & LOG_POF_RECORD) + hysdn_addlog(card, "POF got %s len=%d offs=0x%lx", + (boot->pof_recid == TAG_CBOOTDTA) ? "CBOOTDATA" : "BOOTDTA", + datlen, boot->pof_recoffset); + + if (boot->pof_reclen != POF_BOOT_LOADER_TOTAL_SIZE) { + boot->last_error = EPOF_BAD_IMG_SIZE; /* invalid length */ + return (boot->last_error); + } + imgp = boot->buf.BootBuf; /* start of buffer */ + img_len = datlen; /* maximum length to transfer */ + + l = POF_BOOT_LOADER_OFF_IN_PAGE - + (boot->pof_recoffset & (POF_BOOT_LOADER_PAGE_SIZE - 1)); + if (l > 0) { + /* buffer needs to be truncated */ + imgp += l; /* advance pointer */ + img_len -= l; /* adjust len */ + } + /* at this point no special handling for data wrapping over buffer */ + /* is necessary, because the boot image always will be adjusted to */ + /* match a page boundary inside the buffer. */ + /* The buffer for the boot image on the card is filled in 2 cycles */ + /* first the 1024 hi-words are put in the buffer, then the low 1024 */ + /* word are handled in the same way with different offset. */ + + if (img_len > 0) { + /* data available for copy */ + if ((boot->last_error = + card->writebootimg(card, imgp, + (boot->pof_recoffset > POF_BOOT_LOADER_PAGE_SIZE) ? 2 : 0)) < 0) + return (boot->last_error); + } + break; /* end of case boot image hi/lo */ - case TAG_CBOOTDTA: - DecryptBuf(boot, datlen); /* we need to encrypt the buffer */ - case TAG_BOOTDTA: - if (card->debug_flags & LOG_POF_RECORD) - hysdn_addlog(card, "POF got %s len=%d offs=0x%lx", - (boot->pof_recid == TAG_CBOOTDTA) ? "CBOOTDATA" : "BOOTDTA", - datlen, boot->pof_recoffset); + case TAG_CABSDATA: + DecryptBuf(boot, datlen); /* we need to encrypt the buffer */ + case TAG_ABSDATA: + if (card->debug_flags & LOG_POF_RECORD) + hysdn_addlog(card, "POF got %s len=%d offs=0x%lx", + (boot->pof_recid == TAG_CABSDATA) ? "CABSDATA" : "ABSDATA", + datlen, boot->pof_recoffset); - if (boot->pof_reclen != POF_BOOT_LOADER_TOTAL_SIZE) { - boot->last_error = EPOF_BAD_IMG_SIZE; /* invalid length */ - return (boot->last_error); - } - imgp = boot->buf.BootBuf; /* start of buffer */ - img_len = datlen; /* maximum length to transfer */ - - l = POF_BOOT_LOADER_OFF_IN_PAGE - - (boot->pof_recoffset & (POF_BOOT_LOADER_PAGE_SIZE - 1)); - if (l > 0) { - /* buffer needs to be truncated */ - imgp += l; /* advance pointer */ - img_len -= l; /* adjust len */ - } - /* at this point no special handling for data wrapping over buffer */ - /* is necessary, because the boot image always will be adjusted to */ - /* match a page boundary inside the buffer. */ - /* The buffer for the boot image on the card is filled in 2 cycles */ - /* first the 1024 hi-words are put in the buffer, then the low 1024 */ - /* word are handled in the same way with different offset. */ - - if (img_len > 0) { - /* data available for copy */ - if ((boot->last_error = - card->writebootimg(card, imgp, - (boot->pof_recoffset > POF_BOOT_LOADER_PAGE_SIZE) ? 2 : 0)) < 0) - return (boot->last_error); - } - break; /* end of case boot image hi/lo */ - - case TAG_CABSDATA: - DecryptBuf(boot, datlen); /* we need to encrypt the buffer */ - case TAG_ABSDATA: - if (card->debug_flags & LOG_POF_RECORD) - hysdn_addlog(card, "POF got %s len=%d offs=0x%lx", - (boot->pof_recid == TAG_CABSDATA) ? "CABSDATA" : "ABSDATA", - datlen, boot->pof_recoffset); - - if ((boot->last_error = card->writebootseq(card, boot->buf.BootBuf, datlen)) < 0) - return (boot->last_error); /* error writing data */ - - if (boot->pof_recoffset + datlen >= boot->pof_reclen) - return (card->waitpofready(card)); /* data completely spooled, wait for ready */ - - break; /* end of case boot seq data */ + if ((boot->last_error = card->writebootseq(card, boot->buf.BootBuf, datlen)) < 0) + return (boot->last_error); /* error writing data */ - default: - if (card->debug_flags & LOG_POF_RECORD) - hysdn_addlog(card, "POF got data(id=0x%lx) len=%d offs=0x%lx", boot->pof_recid, - datlen, boot->pof_recoffset); + if (boot->pof_recoffset + datlen >= boot->pof_reclen) + return (card->waitpofready(card)); /* data completely spooled, wait for ready */ + + break; /* end of case boot seq data */ + + default: + if (card->debug_flags & LOG_POF_RECORD) + hysdn_addlog(card, "POF got data(id=0x%lx) len=%d offs=0x%lx", boot->pof_recid, + datlen, boot->pof_recoffset); - break; /* simply skip record */ + break; /* simply skip record */ } /* switch boot->pof_recid */ return (0); @@ -171,7 +171,7 @@ pof_handle_data(hysdn_card * card, int datlen) /* occurred and booting must be aborted. */ /******************************************************************************/ int -pof_write_buffer(hysdn_card * card, int datlen) +pof_write_buffer(hysdn_card *card, int datlen) { struct boot_data *boot = card->boot; /* pointer to boot specific data */ @@ -184,77 +184,77 @@ pof_write_buffer(hysdn_card * card, int datlen) hysdn_addlog(card, "POF write: got %d bytes ", datlen); switch (boot->pof_state) { - case POF_READ_FILE_HEAD: - if (card->debug_flags & LOG_POF_WRITE) - hysdn_addlog(card, "POF write: checking file header"); - - if (datlen != sizeof(tPofFileHdr)) { - boot->last_error = -EPOF_INTERNAL; - break; - } - if (boot->buf.PofFileHdr.Magic != TAGFILEMAGIC) { - boot->last_error = -EPOF_BAD_MAGIC; - break; - } - /* Setup the new state and vars */ - boot->Nrecs = (unsigned short)(boot->buf.PofFileHdr.N_PofRecs); /* limited to 65535 */ - boot->pof_state = POF_READ_TAG_HEAD; /* now start with single tags */ - boot->last_error = sizeof(tPofRecHdr); /* new length */ + case POF_READ_FILE_HEAD: + if (card->debug_flags & LOG_POF_WRITE) + hysdn_addlog(card, "POF write: checking file header"); + + if (datlen != sizeof(tPofFileHdr)) { + boot->last_error = -EPOF_INTERNAL; + break; + } + if (boot->buf.PofFileHdr.Magic != TAGFILEMAGIC) { + boot->last_error = -EPOF_BAD_MAGIC; + break; + } + /* Setup the new state and vars */ + boot->Nrecs = (unsigned short)(boot->buf.PofFileHdr.N_PofRecs); /* limited to 65535 */ + boot->pof_state = POF_READ_TAG_HEAD; /* now start with single tags */ + boot->last_error = sizeof(tPofRecHdr); /* new length */ + break; + + case POF_READ_TAG_HEAD: + if (card->debug_flags & LOG_POF_WRITE) + hysdn_addlog(card, "POF write: checking tag header"); + + if (datlen != sizeof(tPofRecHdr)) { + boot->last_error = -EPOF_INTERNAL; break; + } + boot->pof_recid = boot->buf.PofRecHdr.PofRecId; /* actual pof recid */ + boot->pof_reclen = boot->buf.PofRecHdr.PofRecDataLen; /* total length */ + boot->pof_recoffset = 0; /* no starting offset */ - case POF_READ_TAG_HEAD: - if (card->debug_flags & LOG_POF_WRITE) - hysdn_addlog(card, "POF write: checking tag header"); - - if (datlen != sizeof(tPofRecHdr)) { - boot->last_error = -EPOF_INTERNAL; - break; - } - boot->pof_recid = boot->buf.PofRecHdr.PofRecId; /* actual pof recid */ - boot->pof_reclen = boot->buf.PofRecHdr.PofRecDataLen; /* total length */ - boot->pof_recoffset = 0; /* no starting offset */ - - if (card->debug_flags & LOG_POF_RECORD) - hysdn_addlog(card, "POF: got record id=0x%lx length=%ld ", - boot->pof_recid, boot->pof_reclen); - - boot->pof_state = POF_READ_TAG_DATA; /* now start with tag data */ - if (boot->pof_reclen < BOOT_BUF_SIZE) - boot->last_error = boot->pof_reclen; /* limit size */ - else - boot->last_error = BOOT_BUF_SIZE; /* maximum */ + if (card->debug_flags & LOG_POF_RECORD) + hysdn_addlog(card, "POF: got record id=0x%lx length=%ld ", + boot->pof_recid, boot->pof_reclen); - if (!boot->last_error) { /* no data inside record */ - boot->pof_state = POF_READ_TAG_HEAD; /* now start with single tags */ - boot->last_error = sizeof(tPofRecHdr); /* new length */ - } - break; + boot->pof_state = POF_READ_TAG_DATA; /* now start with tag data */ + if (boot->pof_reclen < BOOT_BUF_SIZE) + boot->last_error = boot->pof_reclen; /* limit size */ + else + boot->last_error = BOOT_BUF_SIZE; /* maximum */ - case POF_READ_TAG_DATA: - if (card->debug_flags & LOG_POF_WRITE) - hysdn_addlog(card, "POF write: getting tag data"); - - if (datlen != boot->last_error) { - boot->last_error = -EPOF_INTERNAL; - break; - } - if ((boot->last_error = pof_handle_data(card, datlen)) < 0) - return (boot->last_error); /* an error occurred */ - boot->pof_recoffset += datlen; - if (boot->pof_recoffset >= boot->pof_reclen) { - boot->pof_state = POF_READ_TAG_HEAD; /* now start with single tags */ - boot->last_error = sizeof(tPofRecHdr); /* new length */ - } else { - if (boot->pof_reclen - boot->pof_recoffset < BOOT_BUF_SIZE) - boot->last_error = boot->pof_reclen - boot->pof_recoffset; /* limit size */ - else - boot->last_error = BOOT_BUF_SIZE; /* maximum */ - } - break; + if (!boot->last_error) { /* no data inside record */ + boot->pof_state = POF_READ_TAG_HEAD; /* now start with single tags */ + boot->last_error = sizeof(tPofRecHdr); /* new length */ + } + break; - default: - boot->last_error = -EPOF_INTERNAL; /* unknown state */ + case POF_READ_TAG_DATA: + if (card->debug_flags & LOG_POF_WRITE) + hysdn_addlog(card, "POF write: getting tag data"); + + if (datlen != boot->last_error) { + boot->last_error = -EPOF_INTERNAL; break; + } + if ((boot->last_error = pof_handle_data(card, datlen)) < 0) + return (boot->last_error); /* an error occurred */ + boot->pof_recoffset += datlen; + if (boot->pof_recoffset >= boot->pof_reclen) { + boot->pof_state = POF_READ_TAG_HEAD; /* now start with single tags */ + boot->last_error = sizeof(tPofRecHdr); /* new length */ + } else { + if (boot->pof_reclen - boot->pof_recoffset < BOOT_BUF_SIZE) + boot->last_error = boot->pof_reclen - boot->pof_recoffset; /* limit size */ + else + boot->last_error = BOOT_BUF_SIZE; /* maximum */ + } + break; + + default: + boot->last_error = -EPOF_INTERNAL; /* unknown state */ + break; } /* switch (boot->pof_state) */ return (boot->last_error); @@ -268,7 +268,7 @@ pof_write_buffer(hysdn_card * card, int datlen) /* occurred. Additionally the pointer to the buffer data area is set on success */ /*******************************************************************************/ int -pof_write_open(hysdn_card * card, unsigned char **bufp) +pof_write_open(hysdn_card *card, unsigned char **bufp) { struct boot_data *boot; /* pointer to boot specific data */ @@ -310,7 +310,7 @@ pof_write_open(hysdn_card * card, unsigned char **bufp) /* The return value must be 0 if everything has happened as desired. */ /********************************************************************************/ int -pof_write_close(hysdn_card * card) +pof_write_close(hysdn_card *card) { struct boot_data *boot = card->boot; /* pointer to boot specific data */ @@ -367,27 +367,27 @@ EvalSysrTokData(hysdn_card *card, unsigned char *cp, int len) return (1); } switch (*cp) { - case SYSR_TOK_B_CHAN: /* 1 */ - if (*(cp + 1) != 1) - return (1); /* length invalid */ - card->bchans = *(cp + 2); - break; - - case SYSR_TOK_FAX_CHAN: /* 2 */ - if (*(cp + 1) != 1) - return (1); /* length invalid */ - card->faxchans = *(cp + 2); - break; - - case SYSR_TOK_MAC_ADDR: /* 3 */ - if (*(cp + 1) != 6) - return (1); /* length invalid */ - memcpy(card->mac_addr, cp + 2, 6); - break; - - default: - hysdn_addlog(card, "unknown token 0x%02x length %d", *cp, *(cp + 1)); - break; + case SYSR_TOK_B_CHAN: /* 1 */ + if (*(cp + 1) != 1) + return (1); /* length invalid */ + card->bchans = *(cp + 2); + break; + + case SYSR_TOK_FAX_CHAN: /* 2 */ + if (*(cp + 1) != 1) + return (1); /* length invalid */ + card->faxchans = *(cp + 2); + break; + + case SYSR_TOK_MAC_ADDR: /* 3 */ + if (*(cp + 1) != 6) + return (1); /* length invalid */ + memcpy(card->mac_addr, cp + 2, 6); + break; + + default: + hysdn_addlog(card, "unknown token 0x%02x length %d", *cp, *(cp + 1)); + break; } len -= (*(cp + 1) + 2); /* adjust len */ cp += (*(cp + 1) + 2); /* and pointer */ diff --git a/drivers/isdn/hysdn/hysdn_defs.h b/drivers/isdn/hysdn/hysdn_defs.h index 18b801ad97a..cdac46a2169 100644 --- a/drivers/isdn/hysdn/hysdn_defs.h +++ b/drivers/isdn/hysdn/hysdn_defs.h @@ -41,7 +41,7 @@ #define B1_PROT_64KBIT_HDLC 0x0001 #define B1_PROT_64KBIT_TRANSPARENT 0x0002 -#define B1_PROT_V110_ASYNCH 0x0004 +#define B1_PROT_V110_ASYNCH 0x0004 #define B1_PROT_V110_SYNCH 0x0008 #define B1_PROT_T30 0x0010 #define B1_PROT_64KBIT_INV_HDLC 0x0020 @@ -199,14 +199,14 @@ typedef struct HYSDN_CARD { char *version[HYSDN_MAXVERSION]; char infobuf[128]; /* for function procinfo */ - + struct HYSDN_CARD *card; struct capi_ctr capi_ctrl; struct sk_buff *skbs[HYSDN_MAX_CAPI_SKB]; int in_idx, out_idx; /* indexes to buffer ring */ int sk_count; /* number of buffers currently in ring */ struct sk_buff *tx_skb; /* buffer for tx operation */ - + struct list_head ncci_head; } *hyctrlinfo; #endif /* CONFIG_HYSDN_CAPI */ @@ -235,11 +235,11 @@ extern void hysdn_procconf_release(void); /* deinit proc config filesys */ /* hysdn_proclog.c */ extern int hysdn_proclog_init(hysdn_card *); /* init proc log entry */ extern void hysdn_proclog_release(hysdn_card *); /* deinit proc log entry */ -extern void hysdn_addlog(hysdn_card *, char *,...); /* output data to log */ +extern void hysdn_addlog(hysdn_card *, char *, ...); /* output data to log */ extern void hysdn_card_errlog(hysdn_card *, tErrLogEntry *, int); /* output card log */ /* boardergo.c */ -extern int ergo_inithardware(hysdn_card * card); /* get hardware -> module init */ +extern int ergo_inithardware(hysdn_card *card); /* get hardware -> module init */ /* hysdn_boot.c */ extern int pof_write_close(hysdn_card *); /* close proc file after writing pof */ @@ -249,31 +249,31 @@ extern int EvalSysrTokData(hysdn_card *, unsigned char *, int); /* Check Sysrea /* hysdn_sched.c */ extern int hysdn_sched_tx(hysdn_card *, unsigned char *, - unsigned short volatile *, unsigned short volatile *, - unsigned short); + unsigned short volatile *, unsigned short volatile *, + unsigned short); extern int hysdn_sched_rx(hysdn_card *, unsigned char *, unsigned short, - unsigned short); + unsigned short); extern int hysdn_tx_cfgline(hysdn_card *, unsigned char *, - unsigned short); /* send one cfg line */ + unsigned short); /* send one cfg line */ /* hysdn_net.c */ -extern unsigned int hynet_enable; +extern unsigned int hynet_enable; extern int hysdn_net_create(hysdn_card *); /* create a new net device */ extern int hysdn_net_release(hysdn_card *); /* delete the device */ extern char *hysdn_net_getname(hysdn_card *); /* get name of net interface */ extern void hysdn_tx_netack(hysdn_card *); /* acknowledge a packet tx */ extern struct sk_buff *hysdn_tx_netget(hysdn_card *); /* get next network packet */ extern void hysdn_rx_netpkt(hysdn_card *, unsigned char *, - unsigned short); /* rxed packet from network */ + unsigned short); /* rxed packet from network */ #ifdef CONFIG_HYSDN_CAPI -extern unsigned int hycapi_enable; +extern unsigned int hycapi_enable; extern int hycapi_capi_create(hysdn_card *); /* create a new capi device */ extern int hycapi_capi_release(hysdn_card *); /* delete the device */ extern int hycapi_capi_stop(hysdn_card *card); /* suspend */ -extern void hycapi_rx_capipkt(hysdn_card * card, unsigned char * buf, - unsigned short len); -extern void hycapi_tx_capiack(hysdn_card * card); +extern void hycapi_rx_capipkt(hysdn_card *card, unsigned char *buf, + unsigned short len); +extern void hycapi_tx_capiack(hysdn_card *card); extern struct sk_buff *hycapi_tx_capiget(hysdn_card *card); extern int hycapi_init(void); extern void hycapi_cleanup(void); diff --git a/drivers/isdn/hysdn/hysdn_init.c b/drivers/isdn/hysdn/hysdn_init.c index 0ab42ace169..b61bbb4bb52 100644 --- a/drivers/isdn/hysdn/hysdn_init.c +++ b/drivers/isdn/hysdn/hysdn_init.c @@ -169,8 +169,8 @@ hysdn_init(void) hysdn_have_procfs = 1; #ifdef CONFIG_HYSDN_CAPI - if(cardmax > 0) { - if(hycapi_init()) { + if (cardmax > 0) { + if (hycapi_init()) { printk(KERN_ERR "HYCAPI: init failed\n"); if (hysdn_have_procfs) diff --git a/drivers/isdn/hysdn/hysdn_net.c b/drivers/isdn/hysdn/hysdn_net.c index 11f2cce2600..a0efb4cefa1 100644 --- a/drivers/isdn/hysdn/hysdn_net.c +++ b/drivers/isdn/hysdn/hysdn_net.c @@ -23,7 +23,7 @@ #include "hysdn_defs.h" -unsigned int hynet_enable = 0xffffffff; +unsigned int hynet_enable = 0xffffffff; module_param(hynet_enable, uint, 0); #define MAX_SKB_BUFFERS 20 /* number of buffers for keeping TX-data */ @@ -155,7 +155,7 @@ net_send_packet(struct sk_buff *skb, struct net_device *dev) /* completion */ /***********************************************************************/ void -hysdn_tx_netack(hysdn_card * card) +hysdn_tx_netack(hysdn_card *card) { struct net_local *lp = card->netif; @@ -181,7 +181,7 @@ hysdn_tx_netack(hysdn_card * card) /* we got a packet from the network, go and queue it */ /*****************************************************/ void -hysdn_rx_netpkt(hysdn_card * card, unsigned char *buf, unsigned short len) +hysdn_rx_netpkt(hysdn_card *card, unsigned char *buf, unsigned short len) { struct net_local *lp = card->netif; struct net_device *dev; @@ -215,7 +215,7 @@ hysdn_rx_netpkt(hysdn_card * card, unsigned char *buf, unsigned short len) /* return the pointer to a network packet to be send */ /*****************************************************/ struct sk_buff * -hysdn_tx_netget(hysdn_card * card) +hysdn_tx_netget(hysdn_card *card) { struct net_local *lp = card->netif; @@ -229,11 +229,11 @@ hysdn_tx_netget(hysdn_card * card) } /* hysdn_tx_netget */ static const struct net_device_ops hysdn_netdev_ops = { - .ndo_open = net_open, + .ndo_open = net_open, .ndo_stop = net_close, .ndo_start_xmit = net_send_packet, .ndo_change_mtu = eth_change_mtu, - .ndo_set_mac_address = eth_mac_addr, + .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, }; @@ -244,13 +244,13 @@ static const struct net_device_ops hysdn_netdev_ops = { /* 0 announces success, else a negative error code will be returned. */ /*****************************************************************************/ int -hysdn_net_create(hysdn_card * card) +hysdn_net_create(hysdn_card *card) { struct net_device *dev; int i; struct net_local *lp; - if(!card) { + if (!card) { printk(KERN_WARNING "No card-pt in hysdn_net_create!\n"); return (-ENOMEM); } @@ -291,7 +291,7 @@ hysdn_net_create(hysdn_card * card) /* value 0 announces success, else a negative error code will be returned. */ /***************************************************************************/ int -hysdn_net_release(hysdn_card * card) +hysdn_net_release(hysdn_card *card) { struct net_device *dev = card->netif; @@ -316,7 +316,7 @@ hysdn_net_release(hysdn_card * card) /* if the interface is not existing, a "-" is returned. */ /*****************************************************************************/ char * -hysdn_net_getname(hysdn_card * card) +hysdn_net_getname(hysdn_card *card) { struct net_device *dev = card->netif; diff --git a/drivers/isdn/hysdn/hysdn_pof.h b/drivers/isdn/hysdn/hysdn_pof.h index 3a72b908900..f63f5fa59d7 100644 --- a/drivers/isdn/hysdn/hysdn_pof.h +++ b/drivers/isdn/hysdn/hysdn_pof.h @@ -16,9 +16,9 @@ #define BOOT_BUF_SIZE 0x1000 /* =4096, maybe moved to other h file */ #define CRYPT_FEEDTERM 0x8142 #define CRYPT_STARTTERM 0x81a5 - /* max. timeout time in seconds - * from end of booting to POF is ready - */ +/* max. timeout time in seconds + * from end of booting to POF is ready + */ #define POF_READY_TIME_OUT_SEC 10 /**********************************/ @@ -36,38 +36,38 @@ */ #define POF_BOOT_LOADER_PAGE_SIZE 0x4000 /* =16384U */ -#define POF_BOOT_LOADER_TOTAL_SIZE (2U*POF_BOOT_LOADER_PAGE_SIZE) +#define POF_BOOT_LOADER_TOTAL_SIZE (2U * POF_BOOT_LOADER_PAGE_SIZE) #define POF_BOOT_LOADER_CODE_SIZE 0x0800 /* =2KB =2048U */ - /* offset in boot page, where loader code may start */ - /* =0x3800= 14336U */ +/* offset in boot page, where loader code may start */ +/* =0x3800= 14336U */ #define POF_BOOT_LOADER_OFF_IN_PAGE (POF_BOOT_LOADER_PAGE_SIZE-POF_BOOT_LOADER_CODE_SIZE) /*--------------------------------------POF file record structs------------*/ typedef struct PofFileHdr_tag { /* Pof file header */ -/*00 */ unsigned long Magic __attribute__((packed)); -/*04 */ unsigned long N_PofRecs __attribute__((packed)); + /*00 */ unsigned long Magic __attribute__((packed)); + /*04 */ unsigned long N_PofRecs __attribute__((packed)); /*08 */ } tPofFileHdr; typedef struct PofRecHdr_tag { /* Pof record header */ -/*00 */ unsigned short PofRecId __attribute__((packed)); -/*02 */ unsigned long PofRecDataLen __attribute__((packed)); + /*00 */ unsigned short PofRecId __attribute__((packed)); + /*02 */ unsigned long PofRecDataLen __attribute__((packed)); /*06 */ } tPofRecHdr; typedef struct PofTimeStamp_tag { -/*00 */ unsigned long UnixTime __attribute__((packed)); + /*00 */ unsigned long UnixTime __attribute__((packed)); /*04 */ unsigned char DateTimeText[0x28]; /* =40 */ /*2C */ } tPofTimeStamp; - /* tPofFileHdr.Magic value: */ +/* tPofFileHdr.Magic value: */ #define TAGFILEMAGIC 0x464F501AUL - /* tPofRecHdr.PofRecId values: */ +/* tPofRecHdr.PofRecId values: */ #define TAG_ABSDATA 0x1000 /* abs. data */ #define TAG_BOOTDTA 0x1001 /* boot data */ #define TAG_COMMENT 0x0020 diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c index 5fe83bd4206..8023d2510fb 100644 --- a/drivers/isdn/hysdn/hysdn_procconf.c +++ b/drivers/isdn/hysdn/hysdn_procconf.c @@ -91,7 +91,7 @@ process_line(struct conf_writedata *cnf) /* write conf file -> boot or send cfg line to card */ /****************************************************/ static ssize_t -hysdn_conf_write(struct file *file, const char __user *buf, size_t count, loff_t * off) +hysdn_conf_write(struct file *file, const char __user *buf, size_t count, loff_t *off) { struct conf_writedata *cnf; int i; @@ -366,7 +366,7 @@ static const struct file_operations conf_fops = .read = hysdn_conf_read, .write = hysdn_conf_write, .open = hysdn_conf_open, - .release = hysdn_conf_close, + .release = hysdn_conf_close, }; /*****************************/ @@ -395,9 +395,9 @@ hysdn_procconf_init(void) sprintf(conf_name, "%s%d", PROC_CONF_BASENAME, card->myid); if ((card->procconf = (void *) proc_create(conf_name, - S_IFREG | S_IRUGO | S_IWUSR, - hysdn_proc_entry, - &conf_fops)) != NULL) { + S_IFREG | S_IRUGO | S_IWUSR, + hysdn_proc_entry, + &conf_fops)) != NULL) { hysdn_proclog_init(card); /* init the log file entry */ } card = card->next; /* next entry */ diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c index 236cc7dadfd..ba91333e3e4 100644 --- a/drivers/isdn/hysdn/hysdn_proclog.c +++ b/drivers/isdn/hysdn/hysdn_proclog.c @@ -24,7 +24,7 @@ extern struct proc_dir_entry *hysdn_proc_entry; static DEFINE_MUTEX(hysdn_log_mutex); -static void put_log_buffer(hysdn_card * card, char *cp); +static void put_log_buffer(hysdn_card *card, char *cp); /*************************************************/ /* structure keeping ascii log for device output */ @@ -54,7 +54,7 @@ struct procdata { /* log function for cards error log interface */ /**********************************************/ void -hysdn_card_errlog(hysdn_card * card, tErrLogEntry * logp, int maxsize) +hysdn_card_errlog(hysdn_card *card, tErrLogEntry *logp, int maxsize) { char buf[ERRLOG_TEXT_SIZE + 40]; @@ -66,7 +66,7 @@ hysdn_card_errlog(hysdn_card * card, tErrLogEntry * logp, int maxsize) /* Log function using format specifiers for output */ /***************************************************/ void -hysdn_addlog(hysdn_card * card, char *fmt,...) +hysdn_addlog(hysdn_card *card, char *fmt, ...) { struct procdata *pd = card->proclog; char *cp; @@ -98,7 +98,7 @@ hysdn_addlog(hysdn_card * card, char *fmt,...) /* Flushes buffers not longer in use. */ /********************************************/ static void -put_log_buffer(hysdn_card * card, char *cp) +put_log_buffer(hysdn_card *card, char *cp) { struct log_data *ib; struct procdata *pd = card->proclog; @@ -115,7 +115,7 @@ put_log_buffer(hysdn_card * card, char *cp) return; /* no open file for read */ if (!(ib = kmalloc(sizeof(struct log_data) + strlen(cp), GFP_ATOMIC))) - return; /* no memory */ + return; /* no memory */ strcpy(ib->log_start, cp); /* set output string */ ib->next = NULL; ib->proc_ctrl = pd; /* point to own control structure */ @@ -153,7 +153,7 @@ put_log_buffer(hysdn_card * card, char *cp) /* write log file -> set log level bits */ /****************************************/ static ssize_t -hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t * off) +hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t *off) { int rc; unsigned char valbuf[128]; @@ -177,7 +177,7 @@ hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t /* read log file */ /******************/ static ssize_t -hysdn_log_read(struct file *file, char __user *buf, size_t count, loff_t * off) +hysdn_log_read(struct file *file, char __user *buf, size_t count, loff_t *off) { struct log_data *inf; int len; @@ -324,7 +324,7 @@ hysdn_log_close(struct inode *ino, struct file *filep) /* select/poll routine to be able using select() */ /*************************************************/ static unsigned int -hysdn_log_poll(struct file *file, poll_table * wait) +hysdn_log_poll(struct file *file, poll_table *wait) { unsigned int mask = 0; struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); @@ -364,7 +364,7 @@ static const struct file_operations log_fops = .write = hysdn_log_write, .poll = hysdn_log_poll, .open = hysdn_log_open, - .release = hysdn_log_close, + .release = hysdn_log_close, }; @@ -373,7 +373,7 @@ static const struct file_operations log_fops = /* conf files. */ /***********************************************************************************/ int -hysdn_proclog_init(hysdn_card * card) +hysdn_proclog_init(hysdn_card *card) { struct procdata *pd; @@ -382,8 +382,8 @@ hysdn_proclog_init(hysdn_card * card) if ((pd = kzalloc(sizeof(struct procdata), GFP_KERNEL)) != NULL) { sprintf(pd->log_name, "%s%d", PROC_LOG_BASENAME, card->myid); pd->log = proc_create(pd->log_name, - S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry, - &log_fops); + S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry, + &log_fops); init_waitqueue_head(&(pd->rd_queue)); @@ -398,7 +398,7 @@ hysdn_proclog_init(hysdn_card * card) /* The module counter is assumed to be 0 ! */ /************************************************************************************/ void -hysdn_proclog_release(hysdn_card * card) +hysdn_proclog_release(hysdn_card *card) { struct procdata *pd; diff --git a/drivers/isdn/hysdn/hysdn_sched.c b/drivers/isdn/hysdn/hysdn_sched.c index 3674d30d6a0..31d7c141554 100644 --- a/drivers/isdn/hysdn/hysdn_sched.c +++ b/drivers/isdn/hysdn/hysdn_sched.c @@ -29,33 +29,33 @@ /*****************************************************************************/ int hysdn_sched_rx(hysdn_card *card, unsigned char *buf, unsigned short len, - unsigned short chan) + unsigned short chan) { switch (chan) { - case CHAN_NDIS_DATA: - if (hynet_enable & (1 << card->myid)) { - /* give packet to network handler */ - hysdn_rx_netpkt(card, buf, len); - } - break; - - case CHAN_ERRLOG: - hysdn_card_errlog(card, (tErrLogEntry *) buf, len); - if (card->err_log_state == ERRLOG_STATE_ON) - card->err_log_state = ERRLOG_STATE_START; /* start new fetch */ - break; + case CHAN_NDIS_DATA: + if (hynet_enable & (1 << card->myid)) { + /* give packet to network handler */ + hysdn_rx_netpkt(card, buf, len); + } + break; + + case CHAN_ERRLOG: + hysdn_card_errlog(card, (tErrLogEntry *) buf, len); + if (card->err_log_state == ERRLOG_STATE_ON) + card->err_log_state = ERRLOG_STATE_START; /* start new fetch */ + break; #ifdef CONFIG_HYSDN_CAPI - case CHAN_CAPI: + case CHAN_CAPI: /* give packet to CAPI handler */ - if (hycapi_enable & (1 << card->myid)) { - hycapi_rx_capipkt(card, buf, len); - } - break; + if (hycapi_enable & (1 << card->myid)) { + hycapi_rx_capipkt(card, buf, len); + } + break; #endif /* CONFIG_HYSDN_CAPI */ - default: - printk(KERN_INFO "irq message channel %d len %d unhandled \n", chan, len); - break; + default: + printk(KERN_INFO "irq message channel %d len %d unhandled \n", chan, len); + break; } /* switch rx channel */ @@ -72,8 +72,8 @@ hysdn_sched_rx(hysdn_card *card, unsigned char *buf, unsigned short len, /*****************************************************************************/ int hysdn_sched_tx(hysdn_card *card, unsigned char *buf, - unsigned short volatile *len, unsigned short volatile *chan, - unsigned short maxlen) + unsigned short volatile *len, unsigned short volatile *chan, + unsigned short maxlen) { struct sk_buff *skb; @@ -109,8 +109,8 @@ hysdn_sched_tx(hysdn_card *card, unsigned char *buf, return (1); /* tell that data should be send */ } /* error log start and able to send */ /* now handle network interface packets */ - if ((hynet_enable & (1 << card->myid)) && - (skb = hysdn_tx_netget(card)) != NULL) + if ((hynet_enable & (1 << card->myid)) && + (skb = hysdn_tx_netget(card)) != NULL) { if (skb->len <= maxlen) { /* copy the packet to the buffer */ @@ -123,8 +123,8 @@ hysdn_sched_tx(hysdn_card *card, unsigned char *buf, hysdn_tx_netack(card); /* aknowledge packet -> throw away */ } /* send a network packet if available */ #ifdef CONFIG_HYSDN_CAPI - if( ((hycapi_enable & (1 << card->myid))) && - ((skb = hycapi_tx_capiget(card)) != NULL) ) + if (((hycapi_enable & (1 << card->myid))) && + ((skb = hycapi_tx_capiget(card)) != NULL)) { if (skb->len <= maxlen) { skb_copy_from_linear_data(skb, buf, skb->len); diff --git a/drivers/isdn/hysdn/ince1pc.h b/drivers/isdn/hysdn/ince1pc.h index 7a36694df6d..cab68361de6 100644 --- a/drivers/isdn/hysdn/ince1pc.h +++ b/drivers/isdn/hysdn/ince1pc.h @@ -17,30 +17,30 @@ /* basic scalar definitions have same meanning, * but their declaration location depends on environment - */ + */ -/*--------------------------------------channel numbers---------------------*/ +/*--------------------------------------channel numbers---------------------*/ #define CHAN_SYSTEM 0x0001 /* system channel (spooler to spooler) */ #define CHAN_ERRLOG 0x0005 /* error logger */ #define CHAN_CAPI 0x0064 /* CAPI interface */ #define CHAN_NDIS_DATA 0x1001 /* NDIS data transfer */ -/*--------------------------------------POF ready msg-----------------------*/ - /* NOTE: after booting POF sends system ready message to PC: */ +/*--------------------------------------POF ready msg-----------------------*/ +/* NOTE: after booting POF sends system ready message to PC: */ #define RDY_MAGIC 0x52535953UL /* 'SYSR' reversed */ #define RDY_MAGIC_SIZE 4 /* size in bytes */ #define MAX_N_TOK_BYTES 255 #define MIN_RDY_MSG_SIZE RDY_MAGIC_SIZE -#define MAX_RDY_MSG_SIZE (RDY_MAGIC_SIZE+MAX_N_TOK_BYTES) +#define MAX_RDY_MSG_SIZE (RDY_MAGIC_SIZE + MAX_N_TOK_BYTES) #define SYSR_TOK_END 0 #define SYSR_TOK_B_CHAN 1 /* nr. of B-Channels; DataLen=1; def: 2 */ #define SYSR_TOK_FAX_CHAN 2 /* nr. of FAX Channels; DataLen=1; def: 0 */ #define SYSR_TOK_MAC_ADDR 3 /* MAC-Address; DataLen=6; def: auto */ #define SYSR_TOK_ESC 255 /* undefined data size yet */ - /* default values, if not corrected by token: */ +/* default values, if not corrected by token: */ #define SYSR_TOK_B_CHAN_DEF 2 /* assume 2 B-Channels */ #define SYSR_TOK_FAX_CHAN_DEF 1 /* assume 1 FAX Channel */ @@ -70,31 +70,31 @@ * * note: * - for 16-bit FIFO add padding 0 byte to achieve even token data bytes! - */ + */ -/*--------------------------------------error logger------------------------*/ - /* note: pof needs final 0 ! */ +/*--------------------------------------error logger------------------------*/ +/* note: pof needs final 0 ! */ #define ERRLOG_CMD_REQ "ERRLOG ON" #define ERRLOG_CMD_REQ_SIZE 10 /* with final 0 byte ! */ #define ERRLOG_CMD_STOP "ERRLOG OFF" #define ERRLOG_CMD_STOP_SIZE 11 /* with final 0 byte ! */ #define ERRLOG_ENTRY_SIZE 64 /* sizeof(tErrLogEntry) */ - /* remaining text size = 55 */ -#define ERRLOG_TEXT_SIZE (ERRLOG_ENTRY_SIZE-2*4-1) + /* remaining text size = 55 */ +#define ERRLOG_TEXT_SIZE (ERRLOG_ENTRY_SIZE - 2 * 4 - 1) typedef struct ErrLogEntry_tag { - -/*00 */ unsigned long ulErrType; - -/*04 */ unsigned long ulErrSubtype; - -/*08 */ unsigned char ucTextSize; - + + /*00 */ unsigned long ulErrType; + + /*04 */ unsigned long ulErrSubtype; + + /*08 */ unsigned char ucTextSize; + /*09 */ unsigned char ucText[ERRLOG_TEXT_SIZE]; /* ASCIIZ of len ucTextSize-1 */ - -/*40 */ + +/*40 */ } tErrLogEntry; @@ -104,30 +104,30 @@ typedef struct ErrLogEntry_tag { #endif /* */ #endif /* */ -/*--------------------------------------DPRAM boot spooler------------------*/ - /* this is the struture used between pc and - * hyperstone to exchange boot data - */ +/*--------------------------------------DPRAM boot spooler------------------*/ +/* this is the struture used between pc and + * hyperstone to exchange boot data + */ #define DPRAM_SPOOLER_DATA_SIZE 0x20 typedef struct DpramBootSpooler_tag { - -/*00 */ unsigned char Len; - -/*01 */ volatile unsigned char RdPtr; - -/*02 */ unsigned char WrPtr; - -/*03 */ unsigned char Data[DPRAM_SPOOLER_DATA_SIZE]; - -/*23 */ + + /*00 */ unsigned char Len; + + /*01 */ volatile unsigned char RdPtr; + + /*02 */ unsigned char WrPtr; + + /*03 */ unsigned char Data[DPRAM_SPOOLER_DATA_SIZE]; + +/*23 */ } tDpramBootSpooler; #define DPRAM_SPOOLER_MIN_SIZE 5 /* Len+RdPtr+Wrptr+2*data */ #define DPRAM_SPOOLER_DEF_SIZE 0x23 /* current default size */ -/*--------------------------------------HYCARD/ERGO DPRAM SoftUart----------*/ - /* at DPRAM offset 0x1C00: */ +/*--------------------------------------HYCARD/ERGO DPRAM SoftUart----------*/ +/* at DPRAM offset 0x1C00: */ #define SIZE_RSV_SOFT_UART 0x1B0 /* 432 bytes reserved for SoftUart */ |