aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/isdn/hardware/mISDN/hfcmulti.c159
-rw-r--r--drivers/isdn/hardware/mISDN/hfcpci.c28
-rw-r--r--drivers/isdn/mISDN/dsp_audio.c5
-rw-r--r--drivers/isdn/mISDN/dsp_cmx.c7
-rw-r--r--drivers/isdn/mISDN/dsp_core.c14
-rw-r--r--drivers/isdn/mISDN/dsp_ecdis.h2
-rw-r--r--drivers/isdn/mISDN/dsp_tones.c23
-rw-r--r--drivers/isdn/mISDN/l1oip_core.c30
-rw-r--r--drivers/isdn/mISDN/socket.c2
-rw-r--r--drivers/isdn/mISDN/tei.c1
-rw-r--r--drivers/isdn/mISDN/timerdev.c2
11 files changed, 141 insertions, 132 deletions
diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c
index 50e9f4d88f48..d60f5b7a41d0 100644
--- a/drivers/isdn/hardware/mISDN/hfcmulti.c
+++ b/drivers/isdn/hardware/mISDN/hfcmulti.c
@@ -275,7 +275,7 @@ HFC_outb_pcimem(struct hfc_multi *hc, u_char reg, u_char val,
275HFC_outb_pcimem(struct hfc_multi *hc, u_char reg, u_char val) 275HFC_outb_pcimem(struct hfc_multi *hc, u_char reg, u_char val)
276#endif 276#endif
277{ 277{
278 writeb(val, (hc->pci_membase)+reg); 278 writeb(val, hc->pci_membase + reg);
279} 279}
280static u_char 280static u_char
281#ifdef HFC_REGISTER_DEBUG 281#ifdef HFC_REGISTER_DEBUG
@@ -284,7 +284,7 @@ HFC_inb_pcimem(struct hfc_multi *hc, u_char reg, const char *function, int line)
284HFC_inb_pcimem(struct hfc_multi *hc, u_char reg) 284HFC_inb_pcimem(struct hfc_multi *hc, u_char reg)
285#endif 285#endif
286{ 286{
287 return readb((hc->pci_membase)+reg); 287 return readb(hc->pci_membase + reg);
288} 288}
289static u_short 289static u_short
290#ifdef HFC_REGISTER_DEBUG 290#ifdef HFC_REGISTER_DEBUG
@@ -293,7 +293,7 @@ HFC_inw_pcimem(struct hfc_multi *hc, u_char reg, const char *function, int line)
293HFC_inw_pcimem(struct hfc_multi *hc, u_char reg) 293HFC_inw_pcimem(struct hfc_multi *hc, u_char reg)
294#endif 294#endif
295{ 295{
296 return readw((hc->pci_membase)+reg); 296 return readw(hc->pci_membase + reg);
297} 297}
298static void 298static void
299#ifdef HFC_REGISTER_DEBUG 299#ifdef HFC_REGISTER_DEBUG
@@ -302,7 +302,8 @@ HFC_wait_pcimem(struct hfc_multi *hc, const char *function, int line)
302HFC_wait_pcimem(struct hfc_multi *hc) 302HFC_wait_pcimem(struct hfc_multi *hc)
303#endif 303#endif
304{ 304{
305 while (readb((hc->pci_membase)+R_STATUS) & V_BUSY); 305 while (readb(hc->pci_membase + R_STATUS) & V_BUSY)
306 cpu_relax();
306} 307}
307 308
308/* HFC_IO_MODE_REGIO */ 309/* HFC_IO_MODE_REGIO */
@@ -314,7 +315,7 @@ HFC_outb_regio(struct hfc_multi *hc, u_char reg, u_char val,
314HFC_outb_regio(struct hfc_multi *hc, u_char reg, u_char val) 315HFC_outb_regio(struct hfc_multi *hc, u_char reg, u_char val)
315#endif 316#endif
316{ 317{
317 outb(reg, (hc->pci_iobase)+4); 318 outb(reg, hc->pci_iobase + 4);
318 outb(val, hc->pci_iobase); 319 outb(val, hc->pci_iobase);
319} 320}
320static u_char 321static u_char
@@ -324,7 +325,7 @@ HFC_inb_regio(struct hfc_multi *hc, u_char reg, const char *function, int line)
324HFC_inb_regio(struct hfc_multi *hc, u_char reg) 325HFC_inb_regio(struct hfc_multi *hc, u_char reg)
325#endif 326#endif
326{ 327{
327 outb(reg, (hc->pci_iobase)+4); 328 outb(reg, hc->pci_iobase + 4);
328 return inb(hc->pci_iobase); 329 return inb(hc->pci_iobase);
329} 330}
330static u_short 331static u_short
@@ -334,7 +335,7 @@ HFC_inw_regio(struct hfc_multi *hc, u_char reg, const char *function, int line)
334HFC_inw_regio(struct hfc_multi *hc, u_char reg) 335HFC_inw_regio(struct hfc_multi *hc, u_char reg)
335#endif 336#endif
336{ 337{
337 outb(reg, (hc->pci_iobase)+4); 338 outb(reg, hc->pci_iobase + 4);
338 return inw(hc->pci_iobase); 339 return inw(hc->pci_iobase);
339} 340}
340static void 341static void
@@ -344,8 +345,9 @@ HFC_wait_regio(struct hfc_multi *hc, const char *function, int line)
344HFC_wait_regio(struct hfc_multi *hc) 345HFC_wait_regio(struct hfc_multi *hc)
345#endif 346#endif
346{ 347{
347 outb(R_STATUS, (hc->pci_iobase)+4); 348 outb(R_STATUS, hc->pci_iobase + 4);
348 while (inb(hc->pci_iobase) & V_BUSY); 349 while (inb(hc->pci_iobase) & V_BUSY)
350 cpu_relax();
349} 351}
350 352
351#ifdef HFC_REGISTER_DEBUG 353#ifdef HFC_REGISTER_DEBUG
@@ -364,14 +366,14 @@ HFC_outb_debug(struct hfc_multi *hc, u_char reg, u_char val,
364 if (regname[0] == '\0') 366 if (regname[0] == '\0')
365 strcpy(regname, "register"); 367 strcpy(regname, "register");
366 368
367 bits[7] = '0'+(!!(val&1)); 369 bits[7] = '0' + (!!(val & 1));
368 bits[6] = '0'+(!!(val&2)); 370 bits[6] = '0' + (!!(val & 2));
369 bits[5] = '0'+(!!(val&4)); 371 bits[5] = '0' + (!!(val & 4));
370 bits[4] = '0'+(!!(val&8)); 372 bits[4] = '0' + (!!(val & 8));
371 bits[3] = '0'+(!!(val&16)); 373 bits[3] = '0' + (!!(val & 16));
372 bits[2] = '0'+(!!(val&32)); 374 bits[2] = '0' + (!!(val & 32));
373 bits[1] = '0'+(!!(val&64)); 375 bits[1] = '0' + (!!(val & 64));
374 bits[0] = '0'+(!!(val&128)); 376 bits[0] = '0' + (!!(val & 128));
375 printk(KERN_DEBUG 377 printk(KERN_DEBUG
376 "HFC_outb(chip %d, %02x=%s, 0x%02x=%s); in %s() line %d\n", 378 "HFC_outb(chip %d, %02x=%s, 0x%02x=%s); in %s() line %d\n",
377 hc->id, reg, regname, val, bits, function, line); 379 hc->id, reg, regname, val, bits, function, line);
@@ -394,14 +396,14 @@ HFC_inb_debug(struct hfc_multi *hc, u_char reg, const char *function, int line)
394 if (regname[0] == '\0') 396 if (regname[0] == '\0')
395 strcpy(regname, "register"); 397 strcpy(regname, "register");
396 398
397 bits[7] = '0'+(!!(val&1)); 399 bits[7] = '0' + (!!(val & 1));
398 bits[6] = '0'+(!!(val&2)); 400 bits[6] = '0' + (!!(val & 2));
399 bits[5] = '0'+(!!(val&4)); 401 bits[5] = '0' + (!!(val & 4));
400 bits[4] = '0'+(!!(val&8)); 402 bits[4] = '0' + (!!(val & 8));
401 bits[3] = '0'+(!!(val&16)); 403 bits[3] = '0' + (!!(val & 16));
402 bits[2] = '0'+(!!(val&32)); 404 bits[2] = '0' + (!!(val & 32));
403 bits[1] = '0'+(!!(val&64)); 405 bits[1] = '0' + (!!(val & 64));
404 bits[0] = '0'+(!!(val&128)); 406 bits[0] = '0' + (!!(val & 128));
405 printk(KERN_DEBUG 407 printk(KERN_DEBUG
406 "HFC_inb(chip %d, %02x=%s) = 0x%02x=%s; in %s() line %d\n", 408 "HFC_inb(chip %d, %02x=%s) = 0x%02x=%s; in %s() line %d\n",
407 hc->id, reg, regname, val, bits, function, line); 409 hc->id, reg, regname, val, bits, function, line);
@@ -481,6 +483,7 @@ write_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
481 len--; 483 len--;
482 } 484 }
483} 485}
486
484/* read fifo data (REGIO) */ 487/* read fifo data (REGIO) */
485static void 488static void
486read_fifo_regio(struct hfc_multi *hc, u_char *data, int len) 489read_fifo_regio(struct hfc_multi *hc, u_char *data, int len)
@@ -526,7 +529,6 @@ read_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
526 } 529 }
527} 530}
528 531
529
530static void 532static void
531enable_hwirq(struct hfc_multi *hc) 533enable_hwirq(struct hfc_multi *hc)
532{ 534{
@@ -1011,7 +1013,7 @@ plxsd_checksync(struct hfc_multi *hc, int rm)
1011 if (hc->syncronized) { 1013 if (hc->syncronized) {
1012 if (syncmaster == NULL) { 1014 if (syncmaster == NULL) {
1013 if (debug & DEBUG_HFCMULTI_PLXSD) 1015 if (debug & DEBUG_HFCMULTI_PLXSD)
1014 printk(KERN_WARNING "%s: GOT sync on card %d" 1016 printk(KERN_DEBUG "%s: GOT sync on card %d"
1015 " (id=%d)\n", __func__, hc->id + 1, 1017 " (id=%d)\n", __func__, hc->id + 1,
1016 hc->id); 1018 hc->id);
1017 hfcmulti_resync(hc, hc, rm); 1019 hfcmulti_resync(hc, hc, rm);
@@ -1019,7 +1021,7 @@ plxsd_checksync(struct hfc_multi *hc, int rm)
1019 } else { 1021 } else {
1020 if (syncmaster == hc) { 1022 if (syncmaster == hc) {
1021 if (debug & DEBUG_HFCMULTI_PLXSD) 1023 if (debug & DEBUG_HFCMULTI_PLXSD)
1022 printk(KERN_WARNING "%s: LOST sync on card %d" 1024 printk(KERN_DEBUG "%s: LOST sync on card %d"
1023 " (id=%d)\n", __func__, hc->id + 1, 1025 " (id=%d)\n", __func__, hc->id + 1,
1024 hc->id); 1026 hc->id);
1025 hfcmulti_resync(hc, NULL, rm); 1027 hfcmulti_resync(hc, NULL, rm);
@@ -1068,7 +1070,7 @@ release_io_hfcmulti(struct hfc_multi *hc)
1068 pv &= ~PLX_DSP_RES_N; 1070 pv &= ~PLX_DSP_RES_N;
1069 writel(pv, plx_acc_32); 1071 writel(pv, plx_acc_32);
1070 if (debug & DEBUG_HFCMULTI_INIT) 1072 if (debug & DEBUG_HFCMULTI_INIT)
1071 printk(KERN_WARNING "%s: PCM off: PLX_GPIO=%x\n", 1073 printk(KERN_DEBUG "%s: PCM off: PLX_GPIO=%x\n",
1072 __func__, pv); 1074 __func__, pv);
1073 spin_unlock_irqrestore(&plx_lock, plx_flags); 1075 spin_unlock_irqrestore(&plx_lock, plx_flags);
1074 } 1076 }
@@ -1119,8 +1121,8 @@ init_chip(struct hfc_multi *hc)
1119 if (debug & DEBUG_HFCMULTI_INIT) 1121 if (debug & DEBUG_HFCMULTI_INIT)
1120 printk(KERN_DEBUG "%s: entered\n", __func__); 1122 printk(KERN_DEBUG "%s: entered\n", __func__);
1121 val = HFC_inb(hc, R_CHIP_ID); 1123 val = HFC_inb(hc, R_CHIP_ID);
1122 if ((val>>4) != 0x8 && (val>>4) != 0xc && (val>>4) != 0xe 1124 if ((val >> 4) != 0x8 && (val >> 4) != 0xc && (val >> 4) != 0xe &&
1123 && (val>>1) != 0x31) { 1125 (val >> 1) != 0x31) {
1124 printk(KERN_INFO "HFC_multi: unknown CHIP_ID:%x\n", (u_int)val); 1126 printk(KERN_INFO "HFC_multi: unknown CHIP_ID:%x\n", (u_int)val);
1125 err = -EIO; 1127 err = -EIO;
1126 goto out; 1128 goto out;
@@ -1202,7 +1204,7 @@ init_chip(struct hfc_multi *hc)
1202 writel(pv, plx_acc_32); 1204 writel(pv, plx_acc_32);
1203 spin_unlock_irqrestore(&plx_lock, plx_flags); 1205 spin_unlock_irqrestore(&plx_lock, plx_flags);
1204 if (debug & DEBUG_HFCMULTI_INIT) 1206 if (debug & DEBUG_HFCMULTI_INIT)
1205 printk(KERN_WARNING "%s: slave/term: PLX_GPIO=%x\n", 1207 printk(KERN_DEBUG "%s: slave/term: PLX_GPIO=%x\n",
1206 __func__, pv); 1208 __func__, pv);
1207 /* 1209 /*
1208 * If we are the 3rd PLXSD card or higher, we must turn 1210 * If we are the 3rd PLXSD card or higher, we must turn
@@ -1230,8 +1232,9 @@ init_chip(struct hfc_multi *hc)
1230 writel(pv, plx_acc_32); 1232 writel(pv, plx_acc_32);
1231 spin_unlock_irqrestore(&plx_lock, plx_flags); 1233 spin_unlock_irqrestore(&plx_lock, plx_flags);
1232 if (debug & DEBUG_HFCMULTI_INIT) 1234 if (debug & DEBUG_HFCMULTI_INIT)
1233 printk(KERN_WARNING "%s: term off: PLX_GPIO=%x\n", 1235 printk(KERN_DEBUG
1234 __func__, pv); 1236 "%s: term off: PLX_GPIO=%x\n",
1237 __func__, pv);
1235 } 1238 }
1236 spin_unlock_irqrestore(&HFClock, hfc_flags); 1239 spin_unlock_irqrestore(&HFClock, hfc_flags);
1237 hc->hw.r_pcm_md0 = V_F0_LEN; /* shift clock for DSP */ 1240 hc->hw.r_pcm_md0 = V_F0_LEN; /* shift clock for DSP */
@@ -1292,13 +1295,13 @@ init_chip(struct hfc_multi *hc)
1292 pv |= PLX_MASTER_EN | PLX_SLAVE_EN_N; 1295 pv |= PLX_MASTER_EN | PLX_SLAVE_EN_N;
1293 pv |= PLX_SYNC_O_EN; 1296 pv |= PLX_SYNC_O_EN;
1294 if (debug & DEBUG_HFCMULTI_INIT) 1297 if (debug & DEBUG_HFCMULTI_INIT)
1295 printk(KERN_WARNING "%s: master: PLX_GPIO=%x\n", 1298 printk(KERN_DEBUG "%s: master: PLX_GPIO=%x\n",
1296 __func__, pv); 1299 __func__, pv);
1297 } else { 1300 } else {
1298 pv &= ~(PLX_MASTER_EN | PLX_SLAVE_EN_N); 1301 pv &= ~(PLX_MASTER_EN | PLX_SLAVE_EN_N);
1299 pv &= ~PLX_SYNC_O_EN; 1302 pv &= ~PLX_SYNC_O_EN;
1300 if (debug & DEBUG_HFCMULTI_INIT) 1303 if (debug & DEBUG_HFCMULTI_INIT)
1301 printk(KERN_WARNING "%s: slave: PLX_GPIO=%x\n", 1304 printk(KERN_DEBUG "%s: slave: PLX_GPIO=%x\n",
1302 __func__, pv); 1305 __func__, pv);
1303 } 1306 }
1304 writel(pv, plx_acc_32); 1307 writel(pv, plx_acc_32);
@@ -1410,8 +1413,8 @@ controller_fail:
1410 writel(pv, plx_acc_32); 1413 writel(pv, plx_acc_32);
1411 spin_unlock_irqrestore(&plx_lock, plx_flags); 1414 spin_unlock_irqrestore(&plx_lock, plx_flags);
1412 if (debug & DEBUG_HFCMULTI_INIT) 1415 if (debug & DEBUG_HFCMULTI_INIT)
1413 printk(KERN_WARNING "%s: master: PLX_GPIO" 1416 printk(KERN_DEBUG "%s: master: "
1414 "=%x\n", __func__, pv); 1417 "PLX_GPIO=%x\n", __func__, pv);
1415 } 1418 }
1416 hc->hw.r_pcm_md0 |= V_PCM_MD; 1419 hc->hw.r_pcm_md0 |= V_PCM_MD;
1417 HFC_outb(hc, R_PCM_MD0, hc->hw.r_pcm_md0 | 0x00); 1420 HFC_outb(hc, R_PCM_MD0, hc->hw.r_pcm_md0 | 0x00);
@@ -1445,7 +1448,7 @@ controller_fail:
1445 writel(pv, plx_acc_32); 1448 writel(pv, plx_acc_32);
1446 spin_unlock_irqrestore(&plx_lock, plx_flags); 1449 spin_unlock_irqrestore(&plx_lock, plx_flags);
1447 if (debug & DEBUG_HFCMULTI_INIT) 1450 if (debug & DEBUG_HFCMULTI_INIT)
1448 printk(KERN_WARNING "%s: reset off: PLX_GPIO=%x\n", 1451 printk(KERN_DEBUG "%s: reset off: PLX_GPIO=%x\n",
1449 __func__, pv); 1452 __func__, pv);
1450 } 1453 }
1451 1454
@@ -1878,7 +1881,7 @@ hfcmulti_dtmf(struct hfc_multi *hc)
1878 hc->chan[ch].coeff_count = 0; 1881 hc->chan[ch].coeff_count = 0;
1879 skb = mI_alloc_skb(512, GFP_ATOMIC); 1882 skb = mI_alloc_skb(512, GFP_ATOMIC);
1880 if (!skb) { 1883 if (!skb) {
1881 printk(KERN_WARNING "%s: No memory for skb\n", 1884 printk(KERN_DEBUG "%s: No memory for skb\n",
1882 __func__); 1885 __func__);
1883 continue; 1886 continue;
1884 } 1887 }
@@ -2104,7 +2107,7 @@ next_frame:
2104 printk(KERN_DEBUG "%s(card %d): fifo(%d) has %d bytes space " 2107 printk(KERN_DEBUG "%s(card %d): fifo(%d) has %d bytes space "
2105 "left (z1=%04x, z2=%04x) sending %d of %d bytes %s\n", 2108 "left (z1=%04x, z2=%04x) sending %d of %d bytes %s\n",
2106 __func__, hc->id + 1, ch, Zspace, z1, z2, ii-i, len-i, 2109 __func__, hc->id + 1, ch, Zspace, z1, z2, ii-i, len-i,
2107 temp ? "HDLC":"TRANS"); 2110 temp ? "HDLC" : "TRANS");
2108 2111
2109 /* Have to prep the audio data */ 2112 /* Have to prep the audio data */
2110 hc->write_fifo(hc, d, ii - i); 2113 hc->write_fifo(hc, d, ii - i);
@@ -2780,13 +2783,13 @@ hfcmulti_interrupt(int intno, void *dev_id)
2780 handle_timer_irq(hc); 2783 handle_timer_irq(hc);
2781 } 2784 }
2782 2785
2783 if (r_irq_misc & V_DTMF_IRQ) { 2786 if (r_irq_misc & V_DTMF_IRQ)
2784 hfcmulti_dtmf(hc); 2787 hfcmulti_dtmf(hc);
2785 } 2788
2786 if (r_irq_misc & V_IRQ_PROC) { 2789 if (r_irq_misc & V_IRQ_PROC) {
2787 static int irq_proc_cnt; 2790 static int irq_proc_cnt;
2788 if (!irq_proc_cnt++) 2791 if (!irq_proc_cnt++)
2789 printk(KERN_WARNING "%s: got V_IRQ_PROC -" 2792 printk(KERN_DEBUG "%s: got V_IRQ_PROC -"
2790 " this should not happen\n", __func__); 2793 " this should not happen\n", __func__);
2791 } 2794 }
2792 2795
@@ -2936,7 +2939,7 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,
2936 else 2939 else
2937 flow_rx = 0xc0; /* ST->(FIFO,PCM) */ 2940 flow_rx = 0xc0; /* ST->(FIFO,PCM) */
2938 /* put on slot */ 2941 /* put on slot */
2939 routing = bank_rx?0x80:0xc0; /* reversed */ 2942 routing = bank_rx ? 0x80 : 0xc0; /* reversed */
2940 if (conf >= 0 || bank_rx > 1) 2943 if (conf >= 0 || bank_rx > 1)
2941 routing = 0x40; /* loop */ 2944 routing = 0x40; /* loop */
2942 if (debug & DEBUG_HFCMULTI_MODE) 2945 if (debug & DEBUG_HFCMULTI_MODE)
@@ -2971,7 +2974,7 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,
2971 HFC_wait(hc); 2974 HFC_wait(hc);
2972 if (hc->chan[ch].bch && hc->ctype != HFC_TYPE_E1) { 2975 if (hc->chan[ch].bch && hc->ctype != HFC_TYPE_E1) {
2973 hc->hw.a_st_ctrl0[hc->chan[ch].port] &= 2976 hc->hw.a_st_ctrl0[hc->chan[ch].port] &=
2974 ((ch & 0x3) == 0)? ~V_B1_EN: ~V_B2_EN; 2977 ((ch & 0x3) == 0) ? ~V_B1_EN : ~V_B2_EN;
2975 HFC_outb(hc, R_ST_SEL, hc->chan[ch].port); 2978 HFC_outb(hc, R_ST_SEL, hc->chan[ch].port);
2976 /* undocumented: delay after R_ST_SEL */ 2979 /* undocumented: delay after R_ST_SEL */
2977 udelay(1); 2980 udelay(1);
@@ -3505,9 +3508,9 @@ handle_bmsg(struct mISDNchannel *ch, struct sk_buff *skb)
3505 switch (hh->id) { 3508 switch (hh->id) {
3506 case HFC_SPL_LOOP_ON: /* set sample loop */ 3509 case HFC_SPL_LOOP_ON: /* set sample loop */
3507 if (debug & DEBUG_HFCMULTI_MSG) 3510 if (debug & DEBUG_HFCMULTI_MSG)
3508 printk(KERN_DEBUG 3511 printk(KERN_DEBUG
3509 "%s: HFC_SPL_LOOP_ON (len = %d)\n", 3512 "%s: HFC_SPL_LOOP_ON (len = %d)\n",
3510 __func__, skb->len); 3513 __func__, skb->len);
3511 ret = 0; 3514 ret = 0;
3512 break; 3515 break;
3513 case HFC_SPL_LOOP_OFF: /* set silence */ 3516 case HFC_SPL_LOOP_OFF: /* set silence */
@@ -3716,8 +3719,7 @@ ph_state_change(struct dchannel *dch)
3716 int ch, i; 3719 int ch, i;
3717 3720
3718 if (!dch) { 3721 if (!dch) {
3719 printk(KERN_WARNING "%s: ERROR given dch is NULL\n", 3722 printk(KERN_WARNING "%s: ERROR given dch is NULL\n", __func__);
3720 __func__);
3721 return; 3723 return;
3722 } 3724 }
3723 hc = dch->hw; 3725 hc = dch->hw;
@@ -3738,14 +3740,15 @@ ph_state_change(struct dchannel *dch)
3738 switch (dch->state) { 3740 switch (dch->state) {
3739 case (1): 3741 case (1):
3740 if (hc->e1_state != 1) { 3742 if (hc->e1_state != 1) {
3741 for (i = 1; i <= 31; i++) { 3743 for (i = 1; i <= 31; i++) {
3742 /* reset fifos on e1 activation */ 3744 /* reset fifos on e1 activation */
3743 HFC_outb_nodebug(hc, R_FIFO, (i << 1) | 1); 3745 HFC_outb_nodebug(hc, R_FIFO,
3744 HFC_wait_nodebug(hc); 3746 (i << 1) | 1);
3745 HFC_outb_nodebug(hc, 3747 HFC_wait_nodebug(hc);
3746 R_INC_RES_FIFO, V_RES_F); 3748 HFC_outb_nodebug(hc, R_INC_RES_FIFO,
3747 HFC_wait_nodebug(hc); 3749 V_RES_F);
3748 } 3750 HFC_wait_nodebug(hc);
3751 }
3749 } 3752 }
3750 test_and_set_bit(FLG_ACTIVE, &dch->Flags); 3753 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
3751 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, 3754 _queue_data(&dch->dev.D, PH_ACTIVATE_IND,
@@ -4045,12 +4048,12 @@ open_dchannel(struct hfc_multi *hc, struct dchannel *dch,
4045 return -EINVAL; 4048 return -EINVAL;
4046 if ((dch->dev.D.protocol != ISDN_P_NONE) && 4049 if ((dch->dev.D.protocol != ISDN_P_NONE) &&
4047 (dch->dev.D.protocol != rq->protocol)) { 4050 (dch->dev.D.protocol != rq->protocol)) {
4048 if (debug & DEBUG_HFCMULTI_MODE) 4051 if (debug & DEBUG_HFCMULTI_MODE)
4049 printk(KERN_WARNING "%s: change protocol %x to %x\n", 4052 printk(KERN_DEBUG "%s: change protocol %x to %x\n",
4050 __func__, dch->dev.D.protocol, rq->protocol); 4053 __func__, dch->dev.D.protocol, rq->protocol);
4051 } 4054 }
4052 if ((dch->dev.D.protocol == ISDN_P_TE_S0) 4055 if ((dch->dev.D.protocol == ISDN_P_TE_S0) &&
4053 && (rq->protocol != ISDN_P_TE_S0)) 4056 (rq->protocol != ISDN_P_TE_S0))
4054 l1_event(dch->l1, CLOSE_CHANNEL); 4057 l1_event(dch->l1, CLOSE_CHANNEL);
4055 if (dch->dev.D.protocol != rq->protocol) { 4058 if (dch->dev.D.protocol != rq->protocol) {
4056 if (rq->protocol == ISDN_P_TE_S0) { 4059 if (rq->protocol == ISDN_P_TE_S0) {
@@ -4127,9 +4130,9 @@ channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq)
4127 wd_cnt = cq->p1 & 0xf; 4130 wd_cnt = cq->p1 & 0xf;
4128 wd_mode = !!(cq->p1 >> 4); 4131 wd_mode = !!(cq->p1 >> 4);
4129 if (debug & DEBUG_HFCMULTI_MSG) 4132 if (debug & DEBUG_HFCMULTI_MSG)
4130 printk(KERN_DEBUG 4133 printk(KERN_DEBUG "%s: MISDN_CTRL_HFC_WD_INIT mode %s"
4131 "%s: MISDN_CTRL_HFC_WD_INIT mode %s counter 0x%x\n", 4134 ", counter 0x%x\n", __func__,
4132 __func__, wd_mode ? "AUTO" : "MANUAL", wd_cnt); 4135 wd_mode ? "AUTO" : "MANUAL", wd_cnt);
4133 /* set the watchdog timer */ 4136 /* set the watchdog timer */
4134 HFC_outb(hc, R_TI_WD, poll_timer | (wd_cnt << 4)); 4137 HFC_outb(hc, R_TI_WD, poll_timer | (wd_cnt << 4));
4135 hc->hw.r_bert_wd_md = (wd_mode ? V_AUTO_WD_RES : 0); 4138 hc->hw.r_bert_wd_md = (wd_mode ? V_AUTO_WD_RES : 0);
@@ -4139,8 +4142,8 @@ channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq)
4139 HFC_outb(hc, R_BERT_WD_MD, hc->hw.r_bert_wd_md | V_WD_RES); 4142 HFC_outb(hc, R_BERT_WD_MD, hc->hw.r_bert_wd_md | V_WD_RES);
4140 if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) { 4143 if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) {
4141 /* enable the watchdog output for Speech-Design */ 4144 /* enable the watchdog output for Speech-Design */
4142 HFC_outb(hc, R_GPIO_SEL, V_GPIO_SEL7); 4145 HFC_outb(hc, R_GPIO_SEL, V_GPIO_SEL7);
4143 HFC_outb(hc, R_GPIO_EN1, V_GPIO_EN15); 4146 HFC_outb(hc, R_GPIO_EN1, V_GPIO_EN15);
4144 HFC_outb(hc, R_GPIO_OUT1, 0); 4147 HFC_outb(hc, R_GPIO_OUT1, 0);
4145 HFC_outb(hc, R_GPIO_OUT1, V_GPIO_OUT15); 4148 HFC_outb(hc, R_GPIO_OUT1, V_GPIO_OUT15);
4146 } 4149 }
@@ -4319,7 +4322,7 @@ error:
4319 } 4322 }
4320 4323
4321 if (debug & DEBUG_HFCMULTI_INIT) 4324 if (debug & DEBUG_HFCMULTI_INIT)
4322 printk(KERN_WARNING "%s: free irq %d\n", __func__, hc->irq); 4325 printk(KERN_DEBUG "%s: free irq %d\n", __func__, hc->irq);
4323 if (hc->irq) { 4326 if (hc->irq) {
4324 free_irq(hc->irq, hc); 4327 free_irq(hc->irq, hc);
4325 hc->irq = 0; 4328 hc->irq = 0;
@@ -4624,7 +4627,7 @@ release_card(struct hfc_multi *hc)
4624 int ch; 4627 int ch;
4625 4628
4626 if (debug & DEBUG_HFCMULTI_INIT) 4629 if (debug & DEBUG_HFCMULTI_INIT)
4627 printk(KERN_WARNING "%s: release card (%d) entered\n", 4630 printk(KERN_DEBUG "%s: release card (%d) entered\n",
4628 __func__, hc->id); 4631 __func__, hc->id);
4629 4632
4630 /* unregister clock source */ 4633 /* unregister clock source */
@@ -4653,7 +4656,7 @@ release_card(struct hfc_multi *hc)
4653 /* release hardware & irq */ 4656 /* release hardware & irq */
4654 if (hc->irq) { 4657 if (hc->irq) {
4655 if (debug & DEBUG_HFCMULTI_INIT) 4658 if (debug & DEBUG_HFCMULTI_INIT)
4656 printk(KERN_WARNING "%s: free irq %d\n", 4659 printk(KERN_DEBUG "%s: free irq %d\n",
4657 __func__, hc->irq); 4660 __func__, hc->irq);
4658 free_irq(hc->irq, hc); 4661 free_irq(hc->irq, hc);
4659 hc->irq = 0; 4662 hc->irq = 0;
@@ -4662,17 +4665,17 @@ release_card(struct hfc_multi *hc)
4662 release_io_hfcmulti(hc); 4665 release_io_hfcmulti(hc);
4663 4666
4664 if (debug & DEBUG_HFCMULTI_INIT) 4667 if (debug & DEBUG_HFCMULTI_INIT)
4665 printk(KERN_WARNING "%s: remove instance from list\n", 4668 printk(KERN_DEBUG "%s: remove instance from list\n",
4666 __func__); 4669 __func__);
4667 list_del(&hc->list); 4670 list_del(&hc->list);
4668 4671
4669 if (debug & DEBUG_HFCMULTI_INIT) 4672 if (debug & DEBUG_HFCMULTI_INIT)
4670 printk(KERN_WARNING "%s: delete instance\n", __func__); 4673 printk(KERN_DEBUG "%s: delete instance\n", __func__);
4671 if (hc == syncmaster) 4674 if (hc == syncmaster)
4672 syncmaster = NULL; 4675 syncmaster = NULL;
4673 kfree(hc); 4676 kfree(hc);
4674 if (debug & DEBUG_HFCMULTI_INIT) 4677 if (debug & DEBUG_HFCMULTI_INIT)
4675 printk(KERN_WARNING "%s: card successfully removed\n", 4678 printk(KERN_DEBUG "%s: card successfully removed\n",
4676 __func__); 4679 __func__);
4677} 4680}
4678 4681
@@ -4695,7 +4698,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m)
4695 (1 << (ISDN_P_B_HDLC & ISDN_P_B_MASK)); 4698 (1 << (ISDN_P_B_HDLC & ISDN_P_B_MASK));
4696 dch->dev.D.send = handle_dmsg; 4699 dch->dev.D.send = handle_dmsg;
4697 dch->dev.D.ctrl = hfcm_dctrl; 4700 dch->dev.D.ctrl = hfcm_dctrl;
4698 dch->dev.nrbchan = (hc->dslot)?30:31; 4701 dch->dev.nrbchan = (hc->dslot) ? 30 : 31;
4699 dch->slot = hc->dslot; 4702 dch->slot = hc->dslot;
4700 hc->chan[hc->dslot].dch = dch; 4703 hc->chan[hc->dslot].dch = dch;
4701 hc->chan[hc->dslot].port = 0; 4704 hc->chan[hc->dslot].port = 0;
@@ -4937,7 +4940,7 @@ init_multi_port(struct hfc_multi *hc, int pt)
4937 } 4940 }
4938 /* disable E-channel */ 4941 /* disable E-channel */
4939 if (port[Port_cnt] & 0x004) { 4942 if (port[Port_cnt] & 0x004) {
4940 if (debug & DEBUG_HFCMULTI_INIT) 4943 if (debug & DEBUG_HFCMULTI_INIT)
4941 printk(KERN_DEBUG 4944 printk(KERN_DEBUG
4942 "%s: PROTOCOL disable E-channel: " 4945 "%s: PROTOCOL disable E-channel: "
4943 "card(%d) port(%d)\n", 4946 "card(%d) port(%d)\n",
@@ -5222,7 +5225,7 @@ static void __devexit hfc_remove_pci(struct pci_dev *pdev)
5222 spin_unlock_irqrestore(&HFClock, flags); 5225 spin_unlock_irqrestore(&HFClock, flags);
5223 } else { 5226 } else {
5224 if (debug) 5227 if (debug)
5225 printk(KERN_WARNING "%s: drvdata allready removed\n", 5228 printk(KERN_DEBUG "%s: drvdata allready removed\n",
5226 __func__); 5229 __func__);
5227 } 5230 }
5228} 5231}
diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c
index 60dc92562c6d..776afc8c9270 100644
--- a/drivers/isdn/hardware/mISDN/hfcpci.c
+++ b/drivers/isdn/hardware/mISDN/hfcpci.c
@@ -257,7 +257,7 @@ reset_hfcpci(struct hfc_pci *hc)
257 Write_hfc(hc, HFCPCI_INT_M1, hc->hw.int_m1); 257 Write_hfc(hc, HFCPCI_INT_M1, hc->hw.int_m1);
258 258
259 /* Clear already pending ints */ 259 /* Clear already pending ints */
260 if (Read_hfc(hc, HFCPCI_INT_S1)); 260 val = Read_hfc(hc, HFCPCI_INT_S1);
261 261
262 /* set NT/TE mode */ 262 /* set NT/TE mode */
263 hfcpci_setmode(hc); 263 hfcpci_setmode(hc);
@@ -499,7 +499,8 @@ receive_dmsg(struct hfc_pci *hc)
499 df->f2 = ((df->f2 + 1) & MAX_D_FRAMES) | 499 df->f2 = ((df->f2 + 1) & MAX_D_FRAMES) |
500 (MAX_D_FRAMES + 1); /* next buffer */ 500 (MAX_D_FRAMES + 1); /* next buffer */
501 df->za[df->f2 & D_FREG_MASK].z2 = 501 df->za[df->f2 & D_FREG_MASK].z2 =
502 cpu_to_le16((le16_to_cpu(zp->z2) + rcnt) & (D_FIFO_SIZE - 1)); 502 cpu_to_le16((le16_to_cpu(zp->z2) + rcnt) &
503 (D_FIFO_SIZE - 1));
503 } else { 504 } else {
504 dch->rx_skb = mI_alloc_skb(rcnt - 3, GFP_ATOMIC); 505 dch->rx_skb = mI_alloc_skb(rcnt - 3, GFP_ATOMIC);
505 if (!dch->rx_skb) { 506 if (!dch->rx_skb) {
@@ -966,6 +967,7 @@ static void
966ph_state_nt(struct dchannel *dch) 967ph_state_nt(struct dchannel *dch)
967{ 968{
968 struct hfc_pci *hc = dch->hw; 969 struct hfc_pci *hc = dch->hw;
970 u_char val;
969 971
970 if (dch->debug) 972 if (dch->debug)
971 printk(KERN_DEBUG "%s: NT newstate %x\n", 973 printk(KERN_DEBUG "%s: NT newstate %x\n",
@@ -979,7 +981,7 @@ ph_state_nt(struct dchannel *dch)
979 hc->hw.int_m1 &= ~HFCPCI_INTS_TIMER; 981 hc->hw.int_m1 &= ~HFCPCI_INTS_TIMER;
980 Write_hfc(hc, HFCPCI_INT_M1, hc->hw.int_m1); 982 Write_hfc(hc, HFCPCI_INT_M1, hc->hw.int_m1);
981 /* Clear already pending ints */ 983 /* Clear already pending ints */
982 if (Read_hfc(hc, HFCPCI_INT_S1)); 984 val = Read_hfc(hc, HFCPCI_INT_S1);
983 Write_hfc(hc, HFCPCI_STATES, 4 | HFCPCI_LOAD_STATE); 985 Write_hfc(hc, HFCPCI_STATES, 4 | HFCPCI_LOAD_STATE);
984 udelay(10); 986 udelay(10);
985 Write_hfc(hc, HFCPCI_STATES, 4); 987 Write_hfc(hc, HFCPCI_STATES, 4);
@@ -1268,8 +1270,7 @@ mode_hfcpci(struct bchannel *bch, int bc, int protocol)
1268 rx_slot = (bc>>8) & 0xff; 1270 rx_slot = (bc>>8) & 0xff;
1269 tx_slot = (bc>>16) & 0xff; 1271 tx_slot = (bc>>16) & 0xff;
1270 bc = bc & 0xff; 1272 bc = bc & 0xff;
1271 } else if (test_bit(HFC_CFG_PCM, &hc->cfg) && 1273 } else if (test_bit(HFC_CFG_PCM, &hc->cfg) && (protocol > ISDN_P_NONE))
1272 (protocol > ISDN_P_NONE))
1273 printk(KERN_WARNING "%s: no pcm channel id but HFC_CFG_PCM\n", 1274 printk(KERN_WARNING "%s: no pcm channel id but HFC_CFG_PCM\n",
1274 __func__); 1275 __func__);
1275 if (hc->chanlimit > 1) { 1276 if (hc->chanlimit > 1) {
@@ -1327,8 +1328,8 @@ mode_hfcpci(struct bchannel *bch, int bc, int protocol)
1327 case (ISDN_P_B_RAW): 1328 case (ISDN_P_B_RAW):
1328 bch->state = protocol; 1329 bch->state = protocol;
1329 bch->nr = bc; 1330 bch->nr = bc;
1330 hfcpci_clear_fifo_rx(hc, (fifo2 & 2)?1:0); 1331 hfcpci_clear_fifo_rx(hc, (fifo2 & 2) ? 1 : 0);
1331 hfcpci_clear_fifo_tx(hc, (fifo2 & 2)?1:0); 1332 hfcpci_clear_fifo_tx(hc, (fifo2 & 2) ? 1 : 0);
1332 if (bc & 2) { 1333 if (bc & 2) {
1333 hc->hw.sctrl |= SCTRL_B2_ENA; 1334 hc->hw.sctrl |= SCTRL_B2_ENA;
1334 hc->hw.sctrl_r |= SCTRL_B2_ENA; 1335 hc->hw.sctrl_r |= SCTRL_B2_ENA;
@@ -1362,8 +1363,8 @@ mode_hfcpci(struct bchannel *bch, int bc, int protocol)
1362 case (ISDN_P_B_HDLC): 1363 case (ISDN_P_B_HDLC):
1363 bch->state = protocol; 1364 bch->state = protocol;
1364 bch->nr = bc; 1365 bch->nr = bc;
1365 hfcpci_clear_fifo_rx(hc, (fifo2 & 2)?1:0); 1366 hfcpci_clear_fifo_rx(hc, (fifo2 & 2) ? 1 : 0);
1366 hfcpci_clear_fifo_tx(hc, (fifo2 & 2)?1:0); 1367 hfcpci_clear_fifo_tx(hc, (fifo2 & 2) ? 1 : 0);
1367 if (bc & 2) { 1368 if (bc & 2) {
1368 hc->hw.sctrl |= SCTRL_B2_ENA; 1369 hc->hw.sctrl |= SCTRL_B2_ENA;
1369 hc->hw.sctrl_r |= SCTRL_B2_ENA; 1370 hc->hw.sctrl_r |= SCTRL_B2_ENA;
@@ -1457,7 +1458,7 @@ set_hfcpci_rxtest(struct bchannel *bch, int protocol, int chan)
1457 switch (protocol) { 1458 switch (protocol) {
1458 case (ISDN_P_B_RAW): 1459 case (ISDN_P_B_RAW):
1459 bch->state = protocol; 1460 bch->state = protocol;
1460 hfcpci_clear_fifo_rx(hc, (chan & 2)?1:0); 1461 hfcpci_clear_fifo_rx(hc, (chan & 2) ? 1 : 0);
1461 if (chan & 2) { 1462 if (chan & 2) {
1462 hc->hw.sctrl_r |= SCTRL_B2_ENA; 1463 hc->hw.sctrl_r |= SCTRL_B2_ENA;
1463 hc->hw.fifo_en |= HFCPCI_FIFOEN_B2RX; 1464 hc->hw.fifo_en |= HFCPCI_FIFOEN_B2RX;
@@ -1482,7 +1483,7 @@ set_hfcpci_rxtest(struct bchannel *bch, int protocol, int chan)
1482 break; 1483 break;
1483 case (ISDN_P_B_HDLC): 1484 case (ISDN_P_B_HDLC):
1484 bch->state = protocol; 1485 bch->state = protocol;
1485 hfcpci_clear_fifo_rx(hc, (chan & 2)?1:0); 1486 hfcpci_clear_fifo_rx(hc, (chan & 2) ? 1 : 0);
1486 if (chan & 2) { 1487 if (chan & 2) {
1487 hc->hw.sctrl_r |= SCTRL_B2_ENA; 1488 hc->hw.sctrl_r |= SCTRL_B2_ENA;
1488 hc->hw.last_bfifo_cnt[1] = 0; 1489 hc->hw.last_bfifo_cnt[1] = 0;
@@ -2047,7 +2048,8 @@ setup_hw(struct hfc_pci *hc)
2047 printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n"); 2048 printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
2048 return 1; 2049 return 1;
2049 } 2050 }
2050 hc->hw.pci_io = (char __iomem *)(unsigned long)hc->pdev->resource[1].start; 2051 hc->hw.pci_io =
2052 (char __iomem *)(unsigned long)hc->pdev->resource[1].start;
2051 2053
2052 if (!hc->hw.pci_io) { 2054 if (!hc->hw.pci_io) {
2053 printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n"); 2055 printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n");
@@ -2289,7 +2291,7 @@ hfc_remove_pci(struct pci_dev *pdev)
2289 release_card(card); 2291 release_card(card);
2290 else 2292 else
2291 if (debug) 2293 if (debug)
2292 printk(KERN_WARNING "%s: drvdata already removed\n", 2294 printk(KERN_DEBUG "%s: drvdata already removed\n",
2293 __func__); 2295 __func__);
2294} 2296}
2295 2297
diff --git a/drivers/isdn/mISDN/dsp_audio.c b/drivers/isdn/mISDN/dsp_audio.c
index de3795e3f432..9c7c6451bf3d 100644
--- a/drivers/isdn/mISDN/dsp_audio.c
+++ b/drivers/isdn/mISDN/dsp_audio.c
@@ -210,9 +210,8 @@ dsp_audio_generate_seven(void)
210 j = 0; 210 j = 0;
211 for (k = 0; k < 256; k++) { 211 for (k = 0; k < 256; k++) {
212 if (dsp_audio_alaw_to_s32[k] 212 if (dsp_audio_alaw_to_s32[k]
213 < dsp_audio_alaw_to_s32[i]) { 213 < dsp_audio_alaw_to_s32[i])
214 j++; 214 j++;
215 }
216 } 215 }
217 sorted_alaw[j] = i; 216 sorted_alaw[j] = i;
218 } 217 }
diff --git a/drivers/isdn/mISDN/dsp_cmx.c b/drivers/isdn/mISDN/dsp_cmx.c
index 05866184ba23..9c7c0d1ba55f 100644
--- a/drivers/isdn/mISDN/dsp_cmx.c
+++ b/drivers/isdn/mISDN/dsp_cmx.c
@@ -238,7 +238,7 @@ dsp_cmx_add_conf_member(struct dsp *dsp, struct dsp_conf *conf)
238 238
239 member = kzalloc(sizeof(struct dsp_conf_member), GFP_ATOMIC); 239 member = kzalloc(sizeof(struct dsp_conf_member), GFP_ATOMIC);
240 if (!member) { 240 if (!member) {
241 printk(KERN_ERR "kmalloc struct dsp_conf_member failed\n"); 241 printk(KERN_ERR "kzalloc struct dsp_conf_member failed\n");
242 return -ENOMEM; 242 return -ENOMEM;
243 } 243 }
244 member->dsp = dsp; 244 member->dsp = dsp;
@@ -317,7 +317,7 @@ static struct dsp_conf
317 317
318 conf = kzalloc(sizeof(struct dsp_conf), GFP_ATOMIC); 318 conf = kzalloc(sizeof(struct dsp_conf), GFP_ATOMIC);
319 if (!conf) { 319 if (!conf) {
320 printk(KERN_ERR "kmalloc struct dsp_conf failed\n"); 320 printk(KERN_ERR "kzalloc struct dsp_conf failed\n");
321 return NULL; 321 return NULL;
322 } 322 }
323 INIT_LIST_HEAD(&conf->mlist); 323 INIT_LIST_HEAD(&conf->mlist);
@@ -1389,7 +1389,8 @@ dsp_cmx_send_member(struct dsp *dsp, int len, s32 *c, int members)
1389 while (r != rr && t != tt) { 1389 while (r != rr && t != tt) {
1390#ifdef CMX_TX_DEBUG 1390#ifdef CMX_TX_DEBUG
1391 if (strlen(debugbuf) < 48) 1391 if (strlen(debugbuf) < 48)
1392 sprintf(debugbuf+strlen(debugbuf), " %02x", p[t]); 1392 sprintf(debugbuf+strlen(debugbuf), " %02x",
1393 p[t]);
1393#endif 1394#endif
1394 *d++ = p[t]; /* write tx_buff */ 1395 *d++ = p[t]; /* write tx_buff */
1395 t = (t+1) & CMX_BUFF_MASK; 1396 t = (t+1) & CMX_BUFF_MASK;
diff --git a/drivers/isdn/mISDN/dsp_core.c b/drivers/isdn/mISDN/dsp_core.c
index a0e0af81eb2e..c35750647c66 100644
--- a/drivers/isdn/mISDN/dsp_core.c
+++ b/drivers/isdn/mISDN/dsp_core.c
@@ -280,7 +280,7 @@ dsp_fill_empty(struct dsp *dsp)
280static int 280static int
281dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb) 281dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb)
282{ 282{
283 struct sk_buff *nskb; 283 struct sk_buff *nskb;
284 int ret = 0; 284 int ret = 0;
285 int cont; 285 int cont;
286 u8 *data; 286 u8 *data;
@@ -558,7 +558,7 @@ tone_off:
558 dsp->pipeline.inuse = 1; 558 dsp->pipeline.inuse = 1;
559 dsp_cmx_hardware(dsp->conf, dsp); 559 dsp_cmx_hardware(dsp->conf, dsp);
560 ret = dsp_pipeline_build(&dsp->pipeline, 560 ret = dsp_pipeline_build(&dsp->pipeline,
561 len > 0 ? (char *)data : NULL); 561 len > 0 ? data : NULL);
562 dsp_cmx_hardware(dsp->conf, dsp); 562 dsp_cmx_hardware(dsp->conf, dsp);
563 dsp_rx_off(dsp); 563 dsp_rx_off(dsp);
564 } 564 }
@@ -720,7 +720,7 @@ dsp_function(struct mISDNchannel *ch, struct sk_buff *skb)
720 /* check if dtmf soft decoding is turned on */ 720 /* check if dtmf soft decoding is turned on */
721 if (dsp->dtmf.software) { 721 if (dsp->dtmf.software) {
722 digits = dsp_dtmf_goertzel_decode(dsp, skb->data, 722 digits = dsp_dtmf_goertzel_decode(dsp, skb->data,
723 skb->len, (dsp_options&DSP_OPT_ULAW)?1:0); 723 skb->len, (dsp_options&DSP_OPT_ULAW) ? 1 : 0);
724 } 724 }
725 /* we need to process receive data if software */ 725 /* we need to process receive data if software */
726 if (dsp->conf && dsp->conf->software) { 726 if (dsp->conf && dsp->conf->software) {
@@ -952,7 +952,7 @@ dsp_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg)
952 int err = 0; 952 int err = 0;
953 953
954 if (debug & DEBUG_DSP_CTRL) 954 if (debug & DEBUG_DSP_CTRL)
955 printk(KERN_DEBUG "%s:(%x)\n", __func__, cmd); 955 printk(KERN_DEBUG "%s:(%x)\n", __func__, cmd);
956 956
957 switch (cmd) { 957 switch (cmd) {
958 case OPEN_CHANNEL: 958 case OPEN_CHANNEL:
@@ -1175,9 +1175,9 @@ static int dsp_init(void)
1175 1175
1176 /* init conversion tables */ 1176 /* init conversion tables */
1177 dsp_audio_generate_law_tables(); 1177 dsp_audio_generate_law_tables();
1178 dsp_silence = (dsp_options&DSP_OPT_ULAW)?0xff:0x2a; 1178 dsp_silence = (dsp_options&DSP_OPT_ULAW) ? 0xff : 0x2a;
1179 dsp_audio_law_to_s32 = (dsp_options&DSP_OPT_ULAW)?dsp_audio_ulaw_to_s32: 1179 dsp_audio_law_to_s32 = (dsp_options&DSP_OPT_ULAW) ?
1180 dsp_audio_alaw_to_s32; 1180 dsp_audio_ulaw_to_s32 : dsp_audio_alaw_to_s32;
1181 dsp_audio_generate_s2law_table(); 1181 dsp_audio_generate_s2law_table();
1182 dsp_audio_generate_seven(); 1182 dsp_audio_generate_seven();
1183 dsp_audio_generate_mix_table(); 1183 dsp_audio_generate_mix_table();
diff --git a/drivers/isdn/mISDN/dsp_ecdis.h b/drivers/isdn/mISDN/dsp_ecdis.h
index 8a20af43308b..21dbd153ee26 100644
--- a/drivers/isdn/mISDN/dsp_ecdis.h
+++ b/drivers/isdn/mISDN/dsp_ecdis.h
@@ -91,7 +91,7 @@ int16_t amp)
91 && det->tone_cycle_duration <= 475*8) { 91 && det->tone_cycle_duration <= 475*8) {
92 det->good_cycles++; 92 det->good_cycles++;
93 if (det->good_cycles > 2) 93 if (det->good_cycles > 2)
94 det->hit = TRUE; 94 det->hit = TRUE;
95 } 95 }
96 det->tone_cycle_duration = 0; 96 det->tone_cycle_duration = 0;
97 } 97 }
diff --git a/drivers/isdn/mISDN/dsp_tones.c b/drivers/isdn/mISDN/dsp_tones.c
index 7a9af66f4b19..1debf53670de 100644
--- a/drivers/isdn/mISDN/dsp_tones.c
+++ b/drivers/isdn/mISDN/dsp_tones.c
@@ -253,18 +253,24 @@ static struct pattern {
253 {8000, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 253 {8000, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
254 254
255 {TONE_GERMAN_DIALPBX, 255 {TONE_GERMAN_DIALPBX,
256 {DATA_GA, DATA_S, DATA_GA, DATA_S, DATA_GA, DATA_S, NULL, NULL, NULL, NULL}, 256 {DATA_GA, DATA_S, DATA_GA, DATA_S, DATA_GA, DATA_S, NULL, NULL, NULL,
257 {SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL}, 257 NULL},
258 {SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, NULL, NULL, NULL,
259 NULL},
258 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, 260 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} },
259 261
260 {TONE_GERMAN_OLDDIALPBX, 262 {TONE_GERMAN_OLDDIALPBX,
261 {DATA_GO, DATA_S, DATA_GO, DATA_S, DATA_GO, DATA_S, NULL, NULL, NULL, NULL}, 263 {DATA_GO, DATA_S, DATA_GO, DATA_S, DATA_GO, DATA_S, NULL, NULL, NULL,
262 {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL}, 264 NULL},
265 {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, NULL, NULL, NULL,
266 NULL},
263 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, 267 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} },
264 268
265 {TONE_AMERICAN_DIALPBX, 269 {TONE_AMERICAN_DIALPBX,
266 {DATA_DT, DATA_S, DATA_DT, DATA_S, DATA_DT, DATA_S, NULL, NULL, NULL, NULL}, 270 {DATA_DT, DATA_S, DATA_DT, DATA_S, DATA_DT, DATA_S, NULL, NULL, NULL,
267 {SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, NULL, NULL, NULL, NULL}, 271 NULL},
272 {SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, NULL, NULL, NULL,
273 NULL},
268 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, 274 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} },
269 275
270 {TONE_GERMAN_RINGING, 276 {TONE_GERMAN_RINGING,
@@ -434,7 +440,7 @@ dsp_tone_hw_message(struct dsp *dsp, u8 *sample, int len)
434 440
435 /* unlocking is not required, because we don't expect a response */ 441 /* unlocking is not required, because we don't expect a response */
436 nskb = _alloc_mISDN_skb(PH_CONTROL_REQ, 442 nskb = _alloc_mISDN_skb(PH_CONTROL_REQ,
437 (len)?HFC_SPL_LOOP_ON:HFC_SPL_LOOP_OFF, len, sample, 443 (len) ? HFC_SPL_LOOP_ON : HFC_SPL_LOOP_OFF, len, sample,
438 GFP_ATOMIC); 444 GFP_ATOMIC);
439 if (nskb) { 445 if (nskb) {
440 if (dsp->ch.peer) { 446 if (dsp->ch.peer) {
@@ -498,8 +504,7 @@ dsp_tone(struct dsp *dsp, int tone)
498 504
499 /* we turn off the tone */ 505 /* we turn off the tone */
500 if (!tone) { 506 if (!tone) {
501 if (dsp->features.hfc_loops) 507 if (dsp->features.hfc_loops && timer_pending(&tonet->tl))
502 if (timer_pending(&tonet->tl))
503 del_timer(&tonet->tl); 508 del_timer(&tonet->tl);
504 if (dsp->features.hfc_loops) 509 if (dsp->features.hfc_loops)
505 dsp_tone_hw_message(dsp, NULL, 0); 510 dsp_tone_hw_message(dsp, NULL, 0);
diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c
index ea3c3aa2004b..d9cf83b17e3c 100644
--- a/drivers/isdn/mISDN/l1oip_core.c
+++ b/drivers/isdn/mISDN/l1oip_core.c
@@ -308,8 +308,8 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask,
308 308
309 /* assemble frame */ 309 /* assemble frame */
310 *p++ = (L1OIP_VERSION<<6) /* version and coding */ 310 *p++ = (L1OIP_VERSION<<6) /* version and coding */
311 | (hc->pri?0x20:0x00) /* type */ 311 | (hc->pri ? 0x20 : 0x00) /* type */
312 | (hc->id?0x10:0x00) /* id */ 312 | (hc->id ? 0x10 : 0x00) /* id */
313 | localcodec; 313 | localcodec;
314 if (hc->id) { 314 if (hc->id) {
315 *p++ = hc->id>>24; /* id */ 315 *p++ = hc->id>>24; /* id */
@@ -317,7 +317,7 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask,
317 *p++ = hc->id>>8; 317 *p++ = hc->id>>8;
318 *p++ = hc->id; 318 *p++ = hc->id;
319 } 319 }
320 *p++ = (multi == 1)?0x80:0x00 + channel; /* m-flag, channel */ 320 *p++ = (multi == 1) ? 0x80 : 0x00 + channel; /* m-flag, channel */
321 if (multi == 1) 321 if (multi == 1)
322 *p++ = len; /* length */ 322 *p++ = len; /* length */
323 *p++ = timebase>>8; /* time base */ 323 *p++ = timebase>>8; /* time base */
@@ -401,12 +401,12 @@ l1oip_socket_recv(struct l1oip *hc, u8 remotecodec, u8 channel, u16 timebase,
401 } 401 }
402 402
403 /* prepare message */ 403 /* prepare message */
404 nskb = mI_alloc_skb((remotecodec == 3)?(len<<1):len, GFP_ATOMIC); 404 nskb = mI_alloc_skb((remotecodec == 3) ? (len<<1) : len, GFP_ATOMIC);
405 if (!nskb) { 405 if (!nskb) {
406 printk(KERN_ERR "%s: No mem for skb.\n", __func__); 406 printk(KERN_ERR "%s: No mem for skb.\n", __func__);
407 return; 407 return;
408 } 408 }
409 p = skb_put(nskb, (remotecodec == 3)?(len<<1):len); 409 p = skb_put(nskb, (remotecodec == 3) ? (len<<1) : len);
410 410
411 if (remotecodec == 1 && ulaw) 411 if (remotecodec == 1 && ulaw)
412 l1oip_alaw_to_ulaw(buf, len, p); 412 l1oip_alaw_to_ulaw(buf, len, p);
@@ -458,7 +458,7 @@ l1oip_socket_recv(struct l1oip *hc, u8 remotecodec, u8 channel, u16 timebase,
458 hc->chan[channel].disorder_flag ^= 1; 458 hc->chan[channel].disorder_flag ^= 1;
459 if (nskb) 459 if (nskb)
460#endif 460#endif
461 queue_ch_frame(&bch->ch, PH_DATA_IND, rx_counter, nskb); 461 queue_ch_frame(&bch->ch, PH_DATA_IND, rx_counter, nskb);
462 } 462 }
463} 463}
464 464
@@ -749,8 +749,8 @@ l1oip_socket_thread(void *data)
749 l1oip_socket_parse(hc, &sin_rx, recvbuf, recvlen); 749 l1oip_socket_parse(hc, &sin_rx, recvbuf, recvlen);
750 } else { 750 } else {
751 if (debug & DEBUG_L1OIP_SOCKET) 751 if (debug & DEBUG_L1OIP_SOCKET)
752 printk(KERN_WARNING "%s: broken pipe on socket\n", 752 printk(KERN_WARNING
753 __func__); 753 "%s: broken pipe on socket\n", __func__);
754 } 754 }
755 } 755 }
756 756
@@ -925,7 +925,7 @@ handle_dmsg(struct mISDNchannel *ch, struct sk_buff *skb)
925 p = skb->data; 925 p = skb->data;
926 l = skb->len; 926 l = skb->len;
927 while (l) { 927 while (l) {
928 ll = (l < L1OIP_MAX_PERFRAME)?l:L1OIP_MAX_PERFRAME; 928 ll = (l < L1OIP_MAX_PERFRAME) ? l : L1OIP_MAX_PERFRAME;
929 l1oip_socket_send(hc, 0, dch->slot, 0, 929 l1oip_socket_send(hc, 0, dch->slot, 0,
930 hc->chan[dch->slot].tx_counter++, p, ll); 930 hc->chan[dch->slot].tx_counter++, p, ll);
931 p += ll; 931 p += ll;
@@ -1173,7 +1173,7 @@ handle_bmsg(struct mISDNchannel *ch, struct sk_buff *skb)
1173 p = skb->data; 1173 p = skb->data;
1174 l = skb->len; 1174 l = skb->len;
1175 while (l) { 1175 while (l) {
1176 ll = (l < L1OIP_MAX_PERFRAME)?l:L1OIP_MAX_PERFRAME; 1176 ll = (l < L1OIP_MAX_PERFRAME) ? l : L1OIP_MAX_PERFRAME;
1177 l1oip_socket_send(hc, hc->codec, bch->slot, 0, 1177 l1oip_socket_send(hc, hc->codec, bch->slot, 0,
1178 hc->chan[bch->slot].tx_counter, p, ll); 1178 hc->chan[bch->slot].tx_counter, p, ll);
1179 hc->chan[bch->slot].tx_counter += ll; 1179 hc->chan[bch->slot].tx_counter += ll;
@@ -1331,8 +1331,8 @@ init_card(struct l1oip *hc, int pri, int bundle)
1331 spin_lock_init(&hc->socket_lock); 1331 spin_lock_init(&hc->socket_lock);
1332 hc->idx = l1oip_cnt; 1332 hc->idx = l1oip_cnt;
1333 hc->pri = pri; 1333 hc->pri = pri;
1334 hc->d_idx = pri?16:3; 1334 hc->d_idx = pri ? 16 : 3;
1335 hc->b_num = pri?30:2; 1335 hc->b_num = pri ? 30 : 2;
1336 hc->bundle = bundle; 1336 hc->bundle = bundle;
1337 if (hc->pri) 1337 if (hc->pri)
1338 sprintf(hc->name, "l1oip-e1.%d", l1oip_cnt + 1); 1338 sprintf(hc->name, "l1oip-e1.%d", l1oip_cnt + 1);
@@ -1517,9 +1517,9 @@ l1oip_init(void)
1517 1517
1518 if (debug & DEBUG_L1OIP_INIT) 1518 if (debug & DEBUG_L1OIP_INIT)
1519 printk(KERN_DEBUG "%s: interface %d is %s with %s.\n", 1519 printk(KERN_DEBUG "%s: interface %d is %s with %s.\n",
1520 __func__, l1oip_cnt, pri?"PRI":"BRI", 1520 __func__, l1oip_cnt, pri ? "PRI" : "BRI",
1521 bundle?"bundled IP packet for all B-channels" 1521 bundle ? "bundled IP packet for all B-channels" :
1522 :"seperate IP packets for every B-channel"); 1522 "seperate IP packets for every B-channel");
1523 1523
1524 hc = kzalloc(sizeof(struct l1oip), GFP_ATOMIC); 1524 hc = kzalloc(sizeof(struct l1oip), GFP_ATOMIC);
1525 if (!hc) { 1525 if (!hc) {
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index 2a2c30a9438f..c36f52137456 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -222,7 +222,7 @@ mISDN_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
222 } else { /* use default for L2 messages */ 222 } else { /* use default for L2 messages */
223 if ((sk->sk_protocol == ISDN_P_LAPD_TE) || 223 if ((sk->sk_protocol == ISDN_P_LAPD_TE) ||
224 (sk->sk_protocol == ISDN_P_LAPD_NT)) 224 (sk->sk_protocol == ISDN_P_LAPD_NT))
225 mISDN_HEAD_ID(skb) = _pms(sk)->ch.nr; 225 mISDN_HEAD_ID(skb) = _pms(sk)->ch.nr;
226 } 226 }
227 227
228 if (*debug & DEBUG_SOCKET) 228 if (*debug & DEBUG_SOCKET)
diff --git a/drivers/isdn/mISDN/tei.c b/drivers/isdn/mISDN/tei.c
index 778b660f0672..bfcdd97df95d 100644
--- a/drivers/isdn/mISDN/tei.c
+++ b/drivers/isdn/mISDN/tei.c
@@ -872,7 +872,6 @@ ph_data_ind(struct manager *mgr, struct sk_buff *skb)
872 __func__, skb->len); 872 __func__, skb->len);
873 goto done; 873 goto done;
874 } 874 }
875 if (*debug & DEBUG_L2_TEI)
876 875
877 if ((skb->data[0] >> 2) != TEI_SAPI) /* not for us */ 876 if ((skb->data[0] >> 2) != TEI_SAPI) /* not for us */
878 goto done; 877 goto done;
diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c
index bbd99d3282c0..5b7e9bf514f1 100644
--- a/drivers/isdn/mISDN/timerdev.c
+++ b/drivers/isdn/mISDN/timerdev.c
@@ -259,7 +259,7 @@ mISDN_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
259 return ret; 259 return ret;
260} 260}
261 261
262static struct file_operations mISDN_fops = { 262static const struct file_operations mISDN_fops = {
263 .read = mISDN_read, 263 .read = mISDN_read,
264 .poll = mISDN_poll, 264 .poll = mISDN_poll,
265 .ioctl = mISDN_ioctl, 265 .ioctl = mISDN_ioctl,