Commit eac74af9 authored by Karsten Keil's avatar Karsten Keil Committed by David S. Miller

mISDN: Cleanup debug messages

This patch make debug printk's KERN_DEBUG and also fix some
codestyle issues.
Signed-off-by: default avatarKarsten Keil <keil@b1-systems.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7245a2fe
...@@ -275,7 +275,7 @@ HFC_outb_pcimem(struct hfc_multi *hc, u_char reg, u_char val, ...@@ -275,7 +275,7 @@ HFC_outb_pcimem(struct hfc_multi *hc, u_char reg, u_char val,
HFC_outb_pcimem(struct hfc_multi *hc, u_char reg, u_char val) HFC_outb_pcimem(struct hfc_multi *hc, u_char reg, u_char val)
#endif #endif
{ {
writeb(val, (hc->pci_membase)+reg); writeb(val, hc->pci_membase + reg);
} }
static u_char static u_char
#ifdef HFC_REGISTER_DEBUG #ifdef HFC_REGISTER_DEBUG
...@@ -284,7 +284,7 @@ HFC_inb_pcimem(struct hfc_multi *hc, u_char reg, const char *function, int line) ...@@ -284,7 +284,7 @@ HFC_inb_pcimem(struct hfc_multi *hc, u_char reg, const char *function, int line)
HFC_inb_pcimem(struct hfc_multi *hc, u_char reg) HFC_inb_pcimem(struct hfc_multi *hc, u_char reg)
#endif #endif
{ {
return readb((hc->pci_membase)+reg); return readb(hc->pci_membase + reg);
} }
static u_short static u_short
#ifdef HFC_REGISTER_DEBUG #ifdef HFC_REGISTER_DEBUG
...@@ -293,7 +293,7 @@ HFC_inw_pcimem(struct hfc_multi *hc, u_char reg, const char *function, int line) ...@@ -293,7 +293,7 @@ HFC_inw_pcimem(struct hfc_multi *hc, u_char reg, const char *function, int line)
HFC_inw_pcimem(struct hfc_multi *hc, u_char reg) HFC_inw_pcimem(struct hfc_multi *hc, u_char reg)
#endif #endif
{ {
return readw((hc->pci_membase)+reg); return readw(hc->pci_membase + reg);
} }
static void static void
#ifdef HFC_REGISTER_DEBUG #ifdef HFC_REGISTER_DEBUG
...@@ -302,7 +302,8 @@ HFC_wait_pcimem(struct hfc_multi *hc, const char *function, int line) ...@@ -302,7 +302,8 @@ HFC_wait_pcimem(struct hfc_multi *hc, const char *function, int line)
HFC_wait_pcimem(struct hfc_multi *hc) HFC_wait_pcimem(struct hfc_multi *hc)
#endif #endif
{ {
while (readb((hc->pci_membase)+R_STATUS) & V_BUSY); while (readb(hc->pci_membase + R_STATUS) & V_BUSY)
cpu_relax();
} }
/* HFC_IO_MODE_REGIO */ /* HFC_IO_MODE_REGIO */
...@@ -314,7 +315,7 @@ HFC_outb_regio(struct hfc_multi *hc, u_char reg, u_char val, ...@@ -314,7 +315,7 @@ HFC_outb_regio(struct hfc_multi *hc, u_char reg, u_char val,
HFC_outb_regio(struct hfc_multi *hc, u_char reg, u_char val) HFC_outb_regio(struct hfc_multi *hc, u_char reg, u_char val)
#endif #endif
{ {
outb(reg, (hc->pci_iobase)+4); outb(reg, hc->pci_iobase + 4);
outb(val, hc->pci_iobase); outb(val, hc->pci_iobase);
} }
static u_char static u_char
...@@ -324,7 +325,7 @@ HFC_inb_regio(struct hfc_multi *hc, u_char reg, const char *function, int line) ...@@ -324,7 +325,7 @@ HFC_inb_regio(struct hfc_multi *hc, u_char reg, const char *function, int line)
HFC_inb_regio(struct hfc_multi *hc, u_char reg) HFC_inb_regio(struct hfc_multi *hc, u_char reg)
#endif #endif
{ {
outb(reg, (hc->pci_iobase)+4); outb(reg, hc->pci_iobase + 4);
return inb(hc->pci_iobase); return inb(hc->pci_iobase);
} }
static u_short static u_short
...@@ -334,7 +335,7 @@ HFC_inw_regio(struct hfc_multi *hc, u_char reg, const char *function, int line) ...@@ -334,7 +335,7 @@ HFC_inw_regio(struct hfc_multi *hc, u_char reg, const char *function, int line)
HFC_inw_regio(struct hfc_multi *hc, u_char reg) HFC_inw_regio(struct hfc_multi *hc, u_char reg)
#endif #endif
{ {
outb(reg, (hc->pci_iobase)+4); outb(reg, hc->pci_iobase + 4);
return inw(hc->pci_iobase); return inw(hc->pci_iobase);
} }
static void static void
...@@ -344,8 +345,9 @@ HFC_wait_regio(struct hfc_multi *hc, const char *function, int line) ...@@ -344,8 +345,9 @@ HFC_wait_regio(struct hfc_multi *hc, const char *function, int line)
HFC_wait_regio(struct hfc_multi *hc) HFC_wait_regio(struct hfc_multi *hc)
#endif #endif
{ {
outb(R_STATUS, (hc->pci_iobase)+4); outb(R_STATUS, hc->pci_iobase + 4);
while (inb(hc->pci_iobase) & V_BUSY); while (inb(hc->pci_iobase) & V_BUSY)
cpu_relax();
} }
#ifdef HFC_REGISTER_DEBUG #ifdef HFC_REGISTER_DEBUG
...@@ -364,14 +366,14 @@ HFC_outb_debug(struct hfc_multi *hc, u_char reg, u_char val, ...@@ -364,14 +366,14 @@ HFC_outb_debug(struct hfc_multi *hc, u_char reg, u_char val,
if (regname[0] == '\0') if (regname[0] == '\0')
strcpy(regname, "register"); strcpy(regname, "register");
bits[7] = '0'+(!!(val&1)); bits[7] = '0' + (!!(val & 1));
bits[6] = '0'+(!!(val&2)); bits[6] = '0' + (!!(val & 2));
bits[5] = '0'+(!!(val&4)); bits[5] = '0' + (!!(val & 4));
bits[4] = '0'+(!!(val&8)); bits[4] = '0' + (!!(val & 8));
bits[3] = '0'+(!!(val&16)); bits[3] = '0' + (!!(val & 16));
bits[2] = '0'+(!!(val&32)); bits[2] = '0' + (!!(val & 32));
bits[1] = '0'+(!!(val&64)); bits[1] = '0' + (!!(val & 64));
bits[0] = '0'+(!!(val&128)); bits[0] = '0' + (!!(val & 128));
printk(KERN_DEBUG printk(KERN_DEBUG
"HFC_outb(chip %d, %02x=%s, 0x%02x=%s); in %s() line %d\n", "HFC_outb(chip %d, %02x=%s, 0x%02x=%s); in %s() line %d\n",
hc->id, reg, regname, val, bits, function, line); 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,14 +396,14 @@ HFC_inb_debug(struct hfc_multi *hc, u_char reg, const char *function, int line)
if (regname[0] == '\0') if (regname[0] == '\0')
strcpy(regname, "register"); strcpy(regname, "register");
bits[7] = '0'+(!!(val&1)); bits[7] = '0' + (!!(val & 1));
bits[6] = '0'+(!!(val&2)); bits[6] = '0' + (!!(val & 2));
bits[5] = '0'+(!!(val&4)); bits[5] = '0' + (!!(val & 4));
bits[4] = '0'+(!!(val&8)); bits[4] = '0' + (!!(val & 8));
bits[3] = '0'+(!!(val&16)); bits[3] = '0' + (!!(val & 16));
bits[2] = '0'+(!!(val&32)); bits[2] = '0' + (!!(val & 32));
bits[1] = '0'+(!!(val&64)); bits[1] = '0' + (!!(val & 64));
bits[0] = '0'+(!!(val&128)); bits[0] = '0' + (!!(val & 128));
printk(KERN_DEBUG printk(KERN_DEBUG
"HFC_inb(chip %d, %02x=%s) = 0x%02x=%s; in %s() line %d\n", "HFC_inb(chip %d, %02x=%s) = 0x%02x=%s; in %s() line %d\n",
hc->id, reg, regname, val, bits, function, line); 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,6 +483,7 @@ write_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
len--; len--;
} }
} }
/* read fifo data (REGIO) */ /* read fifo data (REGIO) */
static void static void
read_fifo_regio(struct hfc_multi *hc, u_char *data, int len) read_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,7 +529,6 @@ read_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
} }
} }
static void static void
enable_hwirq(struct hfc_multi *hc) enable_hwirq(struct hfc_multi *hc)
{ {
...@@ -1011,7 +1013,7 @@ plxsd_checksync(struct hfc_multi *hc, int rm) ...@@ -1011,7 +1013,7 @@ plxsd_checksync(struct hfc_multi *hc, int rm)
if (hc->syncronized) { if (hc->syncronized) {
if (syncmaster == NULL) { if (syncmaster == NULL) {
if (debug & DEBUG_HFCMULTI_PLXSD) if (debug & DEBUG_HFCMULTI_PLXSD)
printk(KERN_WARNING "%s: GOT sync on card %d" printk(KERN_DEBUG "%s: GOT sync on card %d"
" (id=%d)\n", __func__, hc->id + 1, " (id=%d)\n", __func__, hc->id + 1,
hc->id); hc->id);
hfcmulti_resync(hc, hc, rm); hfcmulti_resync(hc, hc, rm);
...@@ -1019,7 +1021,7 @@ plxsd_checksync(struct hfc_multi *hc, int rm) ...@@ -1019,7 +1021,7 @@ plxsd_checksync(struct hfc_multi *hc, int rm)
} else { } else {
if (syncmaster == hc) { if (syncmaster == hc) {
if (debug & DEBUG_HFCMULTI_PLXSD) if (debug & DEBUG_HFCMULTI_PLXSD)
printk(KERN_WARNING "%s: LOST sync on card %d" printk(KERN_DEBUG "%s: LOST sync on card %d"
" (id=%d)\n", __func__, hc->id + 1, " (id=%d)\n", __func__, hc->id + 1,
hc->id); hc->id);
hfcmulti_resync(hc, NULL, rm); hfcmulti_resync(hc, NULL, rm);
...@@ -1068,7 +1070,7 @@ release_io_hfcmulti(struct hfc_multi *hc) ...@@ -1068,7 +1070,7 @@ release_io_hfcmulti(struct hfc_multi *hc)
pv &= ~PLX_DSP_RES_N; pv &= ~PLX_DSP_RES_N;
writel(pv, plx_acc_32); writel(pv, plx_acc_32);
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_WARNING "%s: PCM off: PLX_GPIO=%x\n", printk(KERN_DEBUG "%s: PCM off: PLX_GPIO=%x\n",
__func__, pv); __func__, pv);
spin_unlock_irqrestore(&plx_lock, plx_flags); spin_unlock_irqrestore(&plx_lock, plx_flags);
} }
...@@ -1119,8 +1121,8 @@ init_chip(struct hfc_multi *hc) ...@@ -1119,8 +1121,8 @@ init_chip(struct hfc_multi *hc)
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_DEBUG "%s: entered\n", __func__); printk(KERN_DEBUG "%s: entered\n", __func__);
val = HFC_inb(hc, R_CHIP_ID); val = HFC_inb(hc, R_CHIP_ID);
if ((val>>4) != 0x8 && (val>>4) != 0xc && (val>>4) != 0xe if ((val >> 4) != 0x8 && (val >> 4) != 0xc && (val >> 4) != 0xe &&
&& (val>>1) != 0x31) { (val >> 1) != 0x31) {
printk(KERN_INFO "HFC_multi: unknown CHIP_ID:%x\n", (u_int)val); printk(KERN_INFO "HFC_multi: unknown CHIP_ID:%x\n", (u_int)val);
err = -EIO; err = -EIO;
goto out; goto out;
...@@ -1202,7 +1204,7 @@ init_chip(struct hfc_multi *hc) ...@@ -1202,7 +1204,7 @@ init_chip(struct hfc_multi *hc)
writel(pv, plx_acc_32); writel(pv, plx_acc_32);
spin_unlock_irqrestore(&plx_lock, plx_flags); spin_unlock_irqrestore(&plx_lock, plx_flags);
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_WARNING "%s: slave/term: PLX_GPIO=%x\n", printk(KERN_DEBUG "%s: slave/term: PLX_GPIO=%x\n",
__func__, pv); __func__, pv);
/* /*
* If we are the 3rd PLXSD card or higher, we must turn * If we are the 3rd PLXSD card or higher, we must turn
...@@ -1230,8 +1232,9 @@ init_chip(struct hfc_multi *hc) ...@@ -1230,8 +1232,9 @@ init_chip(struct hfc_multi *hc)
writel(pv, plx_acc_32); writel(pv, plx_acc_32);
spin_unlock_irqrestore(&plx_lock, plx_flags); spin_unlock_irqrestore(&plx_lock, plx_flags);
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_WARNING "%s: term off: PLX_GPIO=%x\n", printk(KERN_DEBUG
__func__, pv); "%s: term off: PLX_GPIO=%x\n",
__func__, pv);
} }
spin_unlock_irqrestore(&HFClock, hfc_flags); spin_unlock_irqrestore(&HFClock, hfc_flags);
hc->hw.r_pcm_md0 = V_F0_LEN; /* shift clock for DSP */ hc->hw.r_pcm_md0 = V_F0_LEN; /* shift clock for DSP */
...@@ -1292,13 +1295,13 @@ init_chip(struct hfc_multi *hc) ...@@ -1292,13 +1295,13 @@ init_chip(struct hfc_multi *hc)
pv |= PLX_MASTER_EN | PLX_SLAVE_EN_N; pv |= PLX_MASTER_EN | PLX_SLAVE_EN_N;
pv |= PLX_SYNC_O_EN; pv |= PLX_SYNC_O_EN;
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_WARNING "%s: master: PLX_GPIO=%x\n", printk(KERN_DEBUG "%s: master: PLX_GPIO=%x\n",
__func__, pv); __func__, pv);
} else { } else {
pv &= ~(PLX_MASTER_EN | PLX_SLAVE_EN_N); pv &= ~(PLX_MASTER_EN | PLX_SLAVE_EN_N);
pv &= ~PLX_SYNC_O_EN; pv &= ~PLX_SYNC_O_EN;
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_WARNING "%s: slave: PLX_GPIO=%x\n", printk(KERN_DEBUG "%s: slave: PLX_GPIO=%x\n",
__func__, pv); __func__, pv);
} }
writel(pv, plx_acc_32); writel(pv, plx_acc_32);
...@@ -1410,8 +1413,8 @@ controller_fail: ...@@ -1410,8 +1413,8 @@ controller_fail:
writel(pv, plx_acc_32); writel(pv, plx_acc_32);
spin_unlock_irqrestore(&plx_lock, plx_flags); spin_unlock_irqrestore(&plx_lock, plx_flags);
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_WARNING "%s: master: PLX_GPIO" printk(KERN_DEBUG "%s: master: "
"=%x\n", __func__, pv); "PLX_GPIO=%x\n", __func__, pv);
} }
hc->hw.r_pcm_md0 |= V_PCM_MD; hc->hw.r_pcm_md0 |= V_PCM_MD;
HFC_outb(hc, R_PCM_MD0, hc->hw.r_pcm_md0 | 0x00); HFC_outb(hc, R_PCM_MD0, hc->hw.r_pcm_md0 | 0x00);
...@@ -1445,7 +1448,7 @@ controller_fail: ...@@ -1445,7 +1448,7 @@ controller_fail:
writel(pv, plx_acc_32); writel(pv, plx_acc_32);
spin_unlock_irqrestore(&plx_lock, plx_flags); spin_unlock_irqrestore(&plx_lock, plx_flags);
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_WARNING "%s: reset off: PLX_GPIO=%x\n", printk(KERN_DEBUG "%s: reset off: PLX_GPIO=%x\n",
__func__, pv); __func__, pv);
} }
...@@ -1878,7 +1881,7 @@ hfcmulti_dtmf(struct hfc_multi *hc) ...@@ -1878,7 +1881,7 @@ hfcmulti_dtmf(struct hfc_multi *hc)
hc->chan[ch].coeff_count = 0; hc->chan[ch].coeff_count = 0;
skb = mI_alloc_skb(512, GFP_ATOMIC); skb = mI_alloc_skb(512, GFP_ATOMIC);
if (!skb) { if (!skb) {
printk(KERN_WARNING "%s: No memory for skb\n", printk(KERN_DEBUG "%s: No memory for skb\n",
__func__); __func__);
continue; continue;
} }
...@@ -2104,7 +2107,7 @@ next_frame: ...@@ -2104,7 +2107,7 @@ next_frame:
printk(KERN_DEBUG "%s(card %d): fifo(%d) has %d bytes space " printk(KERN_DEBUG "%s(card %d): fifo(%d) has %d bytes space "
"left (z1=%04x, z2=%04x) sending %d of %d bytes %s\n", "left (z1=%04x, z2=%04x) sending %d of %d bytes %s\n",
__func__, hc->id + 1, ch, Zspace, z1, z2, ii-i, len-i, __func__, hc->id + 1, ch, Zspace, z1, z2, ii-i, len-i,
temp ? "HDLC":"TRANS"); temp ? "HDLC" : "TRANS");
/* Have to prep the audio data */ /* Have to prep the audio data */
hc->write_fifo(hc, d, ii - i); hc->write_fifo(hc, d, ii - i);
...@@ -2780,13 +2783,13 @@ hfcmulti_interrupt(int intno, void *dev_id) ...@@ -2780,13 +2783,13 @@ hfcmulti_interrupt(int intno, void *dev_id)
handle_timer_irq(hc); handle_timer_irq(hc);
} }
if (r_irq_misc & V_DTMF_IRQ) { if (r_irq_misc & V_DTMF_IRQ)
hfcmulti_dtmf(hc); hfcmulti_dtmf(hc);
}
if (r_irq_misc & V_IRQ_PROC) { if (r_irq_misc & V_IRQ_PROC) {
static int irq_proc_cnt; static int irq_proc_cnt;
if (!irq_proc_cnt++) if (!irq_proc_cnt++)
printk(KERN_WARNING "%s: got V_IRQ_PROC -" printk(KERN_DEBUG "%s: got V_IRQ_PROC -"
" this should not happen\n", __func__); " this should not happen\n", __func__);
} }
...@@ -2936,7 +2939,7 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx, ...@@ -2936,7 +2939,7 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,
else else
flow_rx = 0xc0; /* ST->(FIFO,PCM) */ flow_rx = 0xc0; /* ST->(FIFO,PCM) */
/* put on slot */ /* put on slot */
routing = bank_rx?0x80:0xc0; /* reversed */ routing = bank_rx ? 0x80 : 0xc0; /* reversed */
if (conf >= 0 || bank_rx > 1) if (conf >= 0 || bank_rx > 1)
routing = 0x40; /* loop */ routing = 0x40; /* loop */
if (debug & DEBUG_HFCMULTI_MODE) if (debug & DEBUG_HFCMULTI_MODE)
...@@ -2971,7 +2974,7 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx, ...@@ -2971,7 +2974,7 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,
HFC_wait(hc); HFC_wait(hc);
if (hc->chan[ch].bch && hc->ctype != HFC_TYPE_E1) { if (hc->chan[ch].bch && hc->ctype != HFC_TYPE_E1) {
hc->hw.a_st_ctrl0[hc->chan[ch].port] &= hc->hw.a_st_ctrl0[hc->chan[ch].port] &=
((ch & 0x3) == 0)? ~V_B1_EN: ~V_B2_EN; ((ch & 0x3) == 0) ? ~V_B1_EN : ~V_B2_EN;
HFC_outb(hc, R_ST_SEL, hc->chan[ch].port); HFC_outb(hc, R_ST_SEL, hc->chan[ch].port);
/* undocumented: delay after R_ST_SEL */ /* undocumented: delay after R_ST_SEL */
udelay(1); udelay(1);
...@@ -3505,9 +3508,9 @@ handle_bmsg(struct mISDNchannel *ch, struct sk_buff *skb) ...@@ -3505,9 +3508,9 @@ handle_bmsg(struct mISDNchannel *ch, struct sk_buff *skb)
switch (hh->id) { switch (hh->id) {
case HFC_SPL_LOOP_ON: /* set sample loop */ case HFC_SPL_LOOP_ON: /* set sample loop */
if (debug & DEBUG_HFCMULTI_MSG) if (debug & DEBUG_HFCMULTI_MSG)
printk(KERN_DEBUG printk(KERN_DEBUG
"%s: HFC_SPL_LOOP_ON (len = %d)\n", "%s: HFC_SPL_LOOP_ON (len = %d)\n",
__func__, skb->len); __func__, skb->len);
ret = 0; ret = 0;
break; break;
case HFC_SPL_LOOP_OFF: /* set silence */ case HFC_SPL_LOOP_OFF: /* set silence */
...@@ -3716,8 +3719,7 @@ ph_state_change(struct dchannel *dch) ...@@ -3716,8 +3719,7 @@ ph_state_change(struct dchannel *dch)
int ch, i; int ch, i;
if (!dch) { if (!dch) {
printk(KERN_WARNING "%s: ERROR given dch is NULL\n", printk(KERN_WARNING "%s: ERROR given dch is NULL\n", __func__);
__func__);
return; return;
} }
hc = dch->hw; hc = dch->hw;
...@@ -3738,14 +3740,15 @@ ph_state_change(struct dchannel *dch) ...@@ -3738,14 +3740,15 @@ ph_state_change(struct dchannel *dch)
switch (dch->state) { switch (dch->state) {
case (1): case (1):
if (hc->e1_state != 1) { if (hc->e1_state != 1) {
for (i = 1; i <= 31; i++) { for (i = 1; i <= 31; i++) {
/* reset fifos on e1 activation */ /* reset fifos on e1 activation */
HFC_outb_nodebug(hc, R_FIFO, (i << 1) | 1); HFC_outb_nodebug(hc, R_FIFO,
HFC_wait_nodebug(hc); (i << 1) | 1);
HFC_outb_nodebug(hc, HFC_wait_nodebug(hc);
R_INC_RES_FIFO, V_RES_F); HFC_outb_nodebug(hc, R_INC_RES_FIFO,
HFC_wait_nodebug(hc); V_RES_F);
} HFC_wait_nodebug(hc);
}
} }
test_and_set_bit(FLG_ACTIVE, &dch->Flags); test_and_set_bit(FLG_ACTIVE, &dch->Flags);
_queue_data(&dch->dev.D, PH_ACTIVATE_IND, _queue_data(&dch->dev.D, PH_ACTIVATE_IND,
...@@ -4045,12 +4048,12 @@ open_dchannel(struct hfc_multi *hc, struct dchannel *dch, ...@@ -4045,12 +4048,12 @@ open_dchannel(struct hfc_multi *hc, struct dchannel *dch,
return -EINVAL; return -EINVAL;
if ((dch->dev.D.protocol != ISDN_P_NONE) && if ((dch->dev.D.protocol != ISDN_P_NONE) &&
(dch->dev.D.protocol != rq->protocol)) { (dch->dev.D.protocol != rq->protocol)) {
if (debug & DEBUG_HFCMULTI_MODE) if (debug & DEBUG_HFCMULTI_MODE)
printk(KERN_WARNING "%s: change protocol %x to %x\n", printk(KERN_DEBUG "%s: change protocol %x to %x\n",
__func__, dch->dev.D.protocol, rq->protocol); __func__, dch->dev.D.protocol, rq->protocol);
} }
if ((dch->dev.D.protocol == ISDN_P_TE_S0) if ((dch->dev.D.protocol == ISDN_P_TE_S0) &&
&& (rq->protocol != ISDN_P_TE_S0)) (rq->protocol != ISDN_P_TE_S0))
l1_event(dch->l1, CLOSE_CHANNEL); l1_event(dch->l1, CLOSE_CHANNEL);
if (dch->dev.D.protocol != rq->protocol) { if (dch->dev.D.protocol != rq->protocol) {
if (rq->protocol == ISDN_P_TE_S0) { if (rq->protocol == ISDN_P_TE_S0) {
...@@ -4127,9 +4130,9 @@ channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq) ...@@ -4127,9 +4130,9 @@ channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq)
wd_cnt = cq->p1 & 0xf; wd_cnt = cq->p1 & 0xf;
wd_mode = !!(cq->p1 >> 4); wd_mode = !!(cq->p1 >> 4);
if (debug & DEBUG_HFCMULTI_MSG) if (debug & DEBUG_HFCMULTI_MSG)
printk(KERN_DEBUG printk(KERN_DEBUG "%s: MISDN_CTRL_HFC_WD_INIT mode %s"
"%s: MISDN_CTRL_HFC_WD_INIT mode %s counter 0x%x\n", ", counter 0x%x\n", __func__,
__func__, wd_mode ? "AUTO" : "MANUAL", wd_cnt); wd_mode ? "AUTO" : "MANUAL", wd_cnt);
/* set the watchdog timer */ /* set the watchdog timer */
HFC_outb(hc, R_TI_WD, poll_timer | (wd_cnt << 4)); HFC_outb(hc, R_TI_WD, poll_timer | (wd_cnt << 4));
hc->hw.r_bert_wd_md = (wd_mode ? V_AUTO_WD_RES : 0); 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,8 +4142,8 @@ channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq)
HFC_outb(hc, R_BERT_WD_MD, hc->hw.r_bert_wd_md | V_WD_RES); HFC_outb(hc, R_BERT_WD_MD, hc->hw.r_bert_wd_md | V_WD_RES);
if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) { if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) {
/* enable the watchdog output for Speech-Design */ /* enable the watchdog output for Speech-Design */
HFC_outb(hc, R_GPIO_SEL, V_GPIO_SEL7); HFC_outb(hc, R_GPIO_SEL, V_GPIO_SEL7);
HFC_outb(hc, R_GPIO_EN1, V_GPIO_EN15); HFC_outb(hc, R_GPIO_EN1, V_GPIO_EN15);
HFC_outb(hc, R_GPIO_OUT1, 0); HFC_outb(hc, R_GPIO_OUT1, 0);
HFC_outb(hc, R_GPIO_OUT1, V_GPIO_OUT15); HFC_outb(hc, R_GPIO_OUT1, V_GPIO_OUT15);
} }
...@@ -4319,7 +4322,7 @@ error: ...@@ -4319,7 +4322,7 @@ error:
} }
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_WARNING "%s: free irq %d\n", __func__, hc->irq); printk(KERN_DEBUG "%s: free irq %d\n", __func__, hc->irq);
if (hc->irq) { if (hc->irq) {
free_irq(hc->irq, hc); free_irq(hc->irq, hc);
hc->irq = 0; hc->irq = 0;
...@@ -4624,7 +4627,7 @@ release_card(struct hfc_multi *hc) ...@@ -4624,7 +4627,7 @@ release_card(struct hfc_multi *hc)
int ch; int ch;
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_WARNING "%s: release card (%d) entered\n", printk(KERN_DEBUG "%s: release card (%d) entered\n",
__func__, hc->id); __func__, hc->id);
/* unregister clock source */ /* unregister clock source */
...@@ -4653,7 +4656,7 @@ release_card(struct hfc_multi *hc) ...@@ -4653,7 +4656,7 @@ release_card(struct hfc_multi *hc)
/* release hardware & irq */ /* release hardware & irq */
if (hc->irq) { if (hc->irq) {
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_WARNING "%s: free irq %d\n", printk(KERN_DEBUG "%s: free irq %d\n",
__func__, hc->irq); __func__, hc->irq);
free_irq(hc->irq, hc); free_irq(hc->irq, hc);
hc->irq = 0; hc->irq = 0;
...@@ -4662,17 +4665,17 @@ release_card(struct hfc_multi *hc) ...@@ -4662,17 +4665,17 @@ release_card(struct hfc_multi *hc)
release_io_hfcmulti(hc); release_io_hfcmulti(hc);
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_WARNING "%s: remove instance from list\n", printk(KERN_DEBUG "%s: remove instance from list\n",
__func__); __func__);
list_del(&hc->list); list_del(&hc->list);
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_WARNING "%s: delete instance\n", __func__); printk(KERN_DEBUG "%s: delete instance\n", __func__);
if (hc == syncmaster) if (hc == syncmaster)
syncmaster = NULL; syncmaster = NULL;
kfree(hc); kfree(hc);
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_WARNING "%s: card successfully removed\n", printk(KERN_DEBUG "%s: card successfully removed\n",
__func__); __func__);
} }
...@@ -4695,7 +4698,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m) ...@@ -4695,7 +4698,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m)
(1 << (ISDN_P_B_HDLC & ISDN_P_B_MASK)); (1 << (ISDN_P_B_HDLC & ISDN_P_B_MASK));
dch->dev.D.send = handle_dmsg; dch->dev.D.send = handle_dmsg;
dch->dev.D.ctrl = hfcm_dctrl; dch->dev.D.ctrl = hfcm_dctrl;
dch->dev.nrbchan = (hc->dslot)?30:31; dch->dev.nrbchan = (hc->dslot) ? 30 : 31;
dch->slot = hc->dslot; dch->slot = hc->dslot;
hc->chan[hc->dslot].dch = dch; hc->chan[hc->dslot].dch = dch;
hc->chan[hc->dslot].port = 0; hc->chan[hc->dslot].port = 0;
...@@ -4937,7 +4940,7 @@ init_multi_port(struct hfc_multi *hc, int pt) ...@@ -4937,7 +4940,7 @@ init_multi_port(struct hfc_multi *hc, int pt)
} }
/* disable E-channel */ /* disable E-channel */
if (port[Port_cnt] & 0x004) { if (port[Port_cnt] & 0x004) {
if (debug & DEBUG_HFCMULTI_INIT) if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_DEBUG printk(KERN_DEBUG
"%s: PROTOCOL disable E-channel: " "%s: PROTOCOL disable E-channel: "
"card(%d) port(%d)\n", "card(%d) port(%d)\n",
...@@ -5222,7 +5225,7 @@ static void __devexit hfc_remove_pci(struct pci_dev *pdev) ...@@ -5222,7 +5225,7 @@ static void __devexit hfc_remove_pci(struct pci_dev *pdev)
spin_unlock_irqrestore(&HFClock, flags); spin_unlock_irqrestore(&HFClock, flags);
} else { } else {
if (debug) if (debug)
printk(KERN_WARNING "%s: drvdata allready removed\n", printk(KERN_DEBUG "%s: drvdata allready removed\n",
__func__); __func__);
} }
} }
......
...@@ -257,7 +257,7 @@ reset_hfcpci(struct hfc_pci *hc) ...@@ -257,7 +257,7 @@ reset_hfcpci(struct hfc_pci *hc)
Write_hfc(hc, HFCPCI_INT_M1, hc->hw.int_m1); Write_hfc(hc, HFCPCI_INT_M1, hc->hw.int_m1);
/* Clear already pending ints */ /* Clear already pending ints */
if (Read_hfc(hc, HFCPCI_INT_S1)); val = Read_hfc(hc, HFCPCI_INT_S1);
/* set NT/TE mode */ /* set NT/TE mode */
hfcpci_setmode(hc); hfcpci_setmode(hc);
...@@ -499,7 +499,8 @@ receive_dmsg(struct hfc_pci *hc) ...@@ -499,7 +499,8 @@ receive_dmsg(struct hfc_pci *hc)
df->f2 = ((df->f2 + 1) & MAX_D_FRAMES) | df->f2 = ((df->f2 + 1) & MAX_D_FRAMES) |
(MAX_D_FRAMES + 1); /* next buffer */ (MAX_D_FRAMES + 1); /* next buffer */
df->za[df->f2 & D_FREG_MASK].z2 = df->za[df->f2 & D_FREG_MASK].z2 =
cpu_to_le16((le16_to_cpu(zp->z2) + rcnt) & (D_FIFO_SIZE - 1)); cpu_to_le16((le16_to_cpu(zp->z2) + rcnt) &
(D_FIFO_SIZE - 1));
} else { } else {
dch->rx_skb = mI_alloc_skb(rcnt - 3, GFP_ATOMIC); dch->rx_skb = mI_alloc_skb(rcnt - 3, GFP_ATOMIC);
if (!dch->rx_skb) { if (!dch->rx_skb) {
...@@ -966,6 +967,7 @@ static void ...@@ -966,6 +967,7 @@ static void
ph_state_nt(struct dchannel *dch) ph_state_nt(struct dchannel *dch)
{ {
struct hfc_pci *hc = dch->hw; struct hfc_pci *hc = dch->hw;
u_char val;
if (dch->debug) if (dch->debug)
printk(KERN_DEBUG "%s: NT newstate %x\n", printk(KERN_DEBUG "%s: NT newstate %x\n",
...@@ -979,7 +981,7 @@ ph_state_nt(struct dchannel *dch) ...@@ -979,7 +981,7 @@ ph_state_nt(struct dchannel *dch)
hc->hw.int_m1 &= ~HFCPCI_INTS_TIMER; hc->hw.int_m1 &= ~HFCPCI_INTS_TIMER;
Write_hfc(hc, HFCPCI_INT_M1, hc->hw.int_m1); Write_hfc(hc, HFCPCI_INT_M1, hc->hw.int_m1);
/* Clear already pending ints */ /* Clear already pending ints */
if (Read_hfc(hc, HFCPCI_INT_S1)); val = Read_hfc(hc, HFCPCI_INT_S1);
Write_hfc(hc, HFCPCI_STATES, 4 | HFCPCI_LOAD_STATE); Write_hfc(hc, HFCPCI_STATES, 4 | HFCPCI_LOAD_STATE);
udelay(10); udelay(10);
Write_hfc(hc, HFCPCI_STATES, 4); Write_hfc(hc, HFCPCI_STATES, 4);
...@@ -1268,8 +1270,7 @@ mode_hfcpci(struct bchannel *bch, int bc, int protocol) ...@@ -1268,8 +1270,7 @@ mode_hfcpci(struct bchannel *bch, int bc, int protocol)
rx_slot = (bc>>8) & 0xff; rx_slot = (bc>>8) & 0xff;
tx_slot = (bc>>16) & 0xff; tx_slot = (bc>>16) & 0xff;
bc = bc & 0xff; bc = bc & 0xff;
} else if (test_bit(HFC_CFG_PCM, &hc->cfg) && } else if (test_bit(HFC_CFG_PCM, &hc->cfg) && (protocol > ISDN_P_NONE))
(protocol > ISDN_P_NONE))
printk(KERN_WARNING "%s: no pcm channel id but HFC_CFG_PCM\n", printk(KERN_WARNING "%s: no pcm channel id but HFC_CFG_PCM\n",
__func__); __func__);
if (hc->chanlimit > 1) { if (hc->chanlimit > 1) {
...@@ -1327,8 +1328,8 @@ mode_hfcpci(struct bchannel *bch, int bc, int protocol) ...@@ -1327,8 +1328,8 @@ mode_hfcpci(struct bchannel *bch, int bc, int protocol)
case (ISDN_P_B_RAW): case (ISDN_P_B_RAW):
bch->state = protocol; bch->state = protocol;
bch->nr = bc; bch->nr = bc;
hfcpci_clear_fifo_rx(hc, (fifo2 & 2)?1:0); hfcpci_clear_fifo_rx(hc, (fifo2 & 2) ? 1 : 0);
hfcpci_clear_fifo_tx(hc, (fifo2 & 2)?1:0); hfcpci_clear_fifo_tx(hc, (fifo2 & 2) ? 1 : 0);
if (bc & 2) { if (bc & 2) {
hc->hw.sctrl |= SCTRL_B2_ENA; hc->hw.sctrl |= SCTRL_B2_ENA;
hc->hw.sctrl_r |= SCTRL_B2_ENA; hc->hw.sctrl_r |= SCTRL_B2_ENA;
...@@ -1362,8 +1363,8 @@ mode_hfcpci(struct bchannel *bch, int bc, int protocol) ...@@ -1362,8 +1363,8 @@ mode_hfcpci(struct bchannel *bch, int bc, int protocol)
case (ISDN_P_B_HDLC): case (ISDN_P_B_HDLC):
bch->state = protocol; bch->state = protocol;
bch->nr = bc; bch->nr = bc;
hfcpci_clear_fifo_rx(hc, (fifo2 & 2)?1:0); hfcpci_clear_fifo_rx(hc, (fifo2 & 2) ? 1 : 0);
hfcpci_clear_fifo_tx(hc, (fifo2 & 2)?1:0); hfcpci_clear_fifo_tx(hc, (fifo2 & 2) ? 1 : 0);
if (bc & 2) { if (bc & 2) {
hc->hw.sctrl |= SCTRL_B2_ENA; hc->hw.sctrl |= SCTRL_B2_ENA;
hc->hw.sctrl_r |= SCTRL_B2_ENA; hc->hw.sctrl_r |= SCTRL_B2_ENA;
...@@ -1457,7 +1458,7 @@ set_hfcpci_rxtest(struct bchannel *bch, int protocol, int chan) ...@@ -1457,7 +1458,7 @@ set_hfcpci_rxtest(struct bchannel *bch, int protocol, int chan)
switch (protocol) { switch (protocol) {
case (ISDN_P_B_RAW): case (ISDN_P_B_RAW):
bch->state = protocol; bch->state = protocol;
hfcpci_clear_fifo_rx(hc, (chan & 2)?1:0); hfcpci_clear_fifo_rx(hc, (chan & 2) ? 1 : 0);
if (chan & 2) { if (chan & 2) {
hc->hw.sctrl_r |= SCTRL_B2_ENA; hc->hw.sctrl_r |= SCTRL_B2_ENA;
hc->hw.fifo_en |= HFCPCI_FIFOEN_B2RX; hc->hw.fifo_en |= HFCPCI_FIFOEN_B2RX;
...@@ -1482,7 +1483,7 @@ set_hfcpci_rxtest(struct bchannel *bch, int protocol, int chan) ...@@ -1482,7 +1483,7 @@ set_hfcpci_rxtest(struct bchannel *bch, int protocol, int chan)
break; break;
case (ISDN_P_B_HDLC): case (ISDN_P_B_HDLC):
bch->state = protocol; bch->state = protocol;
hfcpci_clear_fifo_rx(hc, (chan & 2)?1:0); hfcpci_clear_fifo_rx(hc, (chan & 2) ? 1 : 0);
if (chan & 2) { if (chan & 2) {
hc->hw.sctrl_r |= SCTRL_B2_ENA; hc->hw.sctrl_r |= SCTRL_B2_ENA;
hc->hw.last_bfifo_cnt[1] = 0; hc->hw.last_bfifo_cnt[1] = 0;
...@@ -2047,7 +2048,8 @@ setup_hw(struct hfc_pci *hc) ...@@ -2047,7 +2048,8 @@ setup_hw(struct hfc_pci *hc)
printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n"); printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
return 1; return 1;
} }
hc->hw.pci_io = (char __iomem *)(unsigned long)hc->pdev->resource[1].start; hc->hw.pci_io =
(char __iomem *)(unsigned long)hc->pdev->resource[1].start;
if (!hc->hw.pci_io) { if (!hc->hw.pci_io) {
printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n"); 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,7 +2291,7 @@ hfc_remove_pci(struct pci_dev *pdev)
release_card(card); release_card(card);
else else
if (debug) if (debug)
printk(KERN_WARNING "%s: drvdata already removed\n", printk(KERN_DEBUG "%s: drvdata already removed\n",
__func__); __func__);
} }
......
...@@ -210,9 +210,8 @@ dsp_audio_generate_seven(void) ...@@ -210,9 +210,8 @@ dsp_audio_generate_seven(void)
j = 0; j = 0;
for (k = 0; k < 256; k++) { for (k = 0; k < 256; k++) {
if (dsp_audio_alaw_to_s32[k] if (dsp_audio_alaw_to_s32[k]
< dsp_audio_alaw_to_s32[i]) { < dsp_audio_alaw_to_s32[i])
j++; j++;
}
} }
sorted_alaw[j] = i; sorted_alaw[j] = i;
} }
......
...@@ -238,7 +238,7 @@ dsp_cmx_add_conf_member(struct dsp *dsp, struct dsp_conf *conf) ...@@ -238,7 +238,7 @@ dsp_cmx_add_conf_member(struct dsp *dsp, struct dsp_conf *conf)
member = kzalloc(sizeof(struct dsp_conf_member), GFP_ATOMIC); member = kzalloc(sizeof(struct dsp_conf_member), GFP_ATOMIC);
if (!member) { if (!member) {
printk(KERN_ERR "kmalloc struct dsp_conf_member failed\n"); printk(KERN_ERR "kzalloc struct dsp_conf_member failed\n");
return -ENOMEM; return -ENOMEM;
} }
member->dsp = dsp; member->dsp = dsp;
...@@ -317,7 +317,7 @@ static struct dsp_conf ...@@ -317,7 +317,7 @@ static struct dsp_conf
conf = kzalloc(sizeof(struct dsp_conf), GFP_ATOMIC); conf = kzalloc(sizeof(struct dsp_conf), GFP_ATOMIC);
if (!conf) { if (!conf) {
printk(KERN_ERR "kmalloc struct dsp_conf failed\n"); printk(KERN_ERR "kzalloc struct dsp_conf failed\n");
return NULL; return NULL;
} }
INIT_LIST_HEAD(&conf->mlist); INIT_LIST_HEAD(&conf->mlist);
...@@ -1389,7 +1389,8 @@ dsp_cmx_send_member(struct dsp *dsp, int len, s32 *c, int members) ...@@ -1389,7 +1389,8 @@ dsp_cmx_send_member(struct dsp *dsp, int len, s32 *c, int members)
while (r != rr && t != tt) { while (r != rr && t != tt) {
#ifdef CMX_TX_DEBUG #ifdef CMX_TX_DEBUG
if (strlen(debugbuf) < 48) if (strlen(debugbuf) < 48)
sprintf(debugbuf+strlen(debugbuf), " %02x", p[t]); sprintf(debugbuf+strlen(debugbuf), " %02x",
p[t]);
#endif #endif
*d++ = p[t]; /* write tx_buff */ *d++ = p[t]; /* write tx_buff */
t = (t+1) & CMX_BUFF_MASK; t = (t+1) & CMX_BUFF_MASK;
......
...@@ -280,7 +280,7 @@ dsp_fill_empty(struct dsp *dsp) ...@@ -280,7 +280,7 @@ dsp_fill_empty(struct dsp *dsp)
static int static int
dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb) dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb)
{ {
struct sk_buff *nskb; struct sk_buff *nskb;
int ret = 0; int ret = 0;
int cont; int cont;
u8 *data; u8 *data;
...@@ -558,7 +558,7 @@ tone_off: ...@@ -558,7 +558,7 @@ tone_off:
dsp->pipeline.inuse = 1; dsp->pipeline.inuse = 1;
dsp_cmx_hardware(dsp->conf, dsp); dsp_cmx_hardware(dsp->conf, dsp);
ret = dsp_pipeline_build(&dsp->pipeline, ret = dsp_pipeline_build(&dsp->pipeline,
len > 0 ? (char *)data : NULL); len > 0 ? data : NULL);
dsp_cmx_hardware(dsp->conf, dsp); dsp_cmx_hardware(dsp->conf, dsp);
dsp_rx_off(dsp); dsp_rx_off(dsp);
} }
...@@ -720,7 +720,7 @@ dsp_function(struct mISDNchannel *ch, struct sk_buff *skb) ...@@ -720,7 +720,7 @@ dsp_function(struct mISDNchannel *ch, struct sk_buff *skb)
/* check if dtmf soft decoding is turned on */ /* check if dtmf soft decoding is turned on */
if (dsp->dtmf.software) { if (dsp->dtmf.software) {
digits = dsp_dtmf_goertzel_decode(dsp, skb->data, digits = dsp_dtmf_goertzel_decode(dsp, skb->data,
skb->len, (dsp_options&DSP_OPT_ULAW)?1:0); skb->len, (dsp_options&DSP_OPT_ULAW) ? 1 : 0);
} }
/* we need to process receive data if software */ /* we need to process receive data if software */
if (dsp->conf && dsp->conf->software) { if (dsp->conf && dsp->conf->software) {
...@@ -952,7 +952,7 @@ dsp_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg) ...@@ -952,7 +952,7 @@ dsp_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg)
int err = 0; int err = 0;
if (debug & DEBUG_DSP_CTRL) if (debug & DEBUG_DSP_CTRL)
printk(KERN_DEBUG "%s:(%x)\n", __func__, cmd); printk(KERN_DEBUG "%s:(%x)\n", __func__, cmd);
switch (cmd) { switch (cmd) {
case OPEN_CHANNEL: case OPEN_CHANNEL:
...@@ -1175,9 +1175,9 @@ static int dsp_init(void) ...@@ -1175,9 +1175,9 @@ static int dsp_init(void)
/* init conversion tables */ /* init conversion tables */
dsp_audio_generate_law_tables(); dsp_audio_generate_law_tables();
dsp_silence = (dsp_options&DSP_OPT_ULAW)?0xff:0x2a; dsp_silence = (dsp_options&DSP_OPT_ULAW) ? 0xff : 0x2a;
dsp_audio_law_to_s32 = (dsp_options&DSP_OPT_ULAW)?dsp_audio_ulaw_to_s32: dsp_audio_law_to_s32 = (dsp_options&DSP_OPT_ULAW) ?
dsp_audio_alaw_to_s32; dsp_audio_ulaw_to_s32 : dsp_audio_alaw_to_s32;
dsp_audio_generate_s2law_table(); dsp_audio_generate_s2law_table();
dsp_audio_generate_seven(); dsp_audio_generate_seven();
dsp_audio_generate_mix_table(); dsp_audio_generate_mix_table();
......
...@@ -91,7 +91,7 @@ int16_t amp) ...@@ -91,7 +91,7 @@ int16_t amp)
&& det->tone_cycle_duration <= 475*8) { && det->tone_cycle_duration <= 475*8) {
det->good_cycles++; det->good_cycles++;
if (det->good_cycles > 2) if (det->good_cycles > 2)
det->hit = TRUE; det->hit = TRUE;
} }
det->tone_cycle_duration = 0; det->tone_cycle_duration = 0;
} }
......
...@@ -253,18 +253,24 @@ static struct pattern { ...@@ -253,18 +253,24 @@ static struct pattern {
{8000, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, {8000, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
{TONE_GERMAN_DIALPBX, {TONE_GERMAN_DIALPBX,
{DATA_GA, DATA_S, DATA_GA, DATA_S, DATA_GA, DATA_S, NULL, NULL, NULL, NULL}, {DATA_GA, DATA_S, DATA_GA, DATA_S, DATA_GA, DATA_S, NULL, NULL, NULL,
{SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL}, NULL},
{SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, NULL, NULL, NULL,
NULL},
{2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} },
{TONE_GERMAN_OLDDIALPBX, {TONE_GERMAN_OLDDIALPBX,
{DATA_GO, DATA_S, DATA_GO, DATA_S, DATA_GO, DATA_S, NULL, NULL, NULL, NULL}, {DATA_GO, DATA_S, DATA_GO, DATA_S, DATA_GO, DATA_S, NULL, NULL, NULL,
{SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL}, NULL},
{SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, NULL, NULL, NULL,
NULL},
{2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} },
{TONE_AMERICAN_DIALPBX, {TONE_AMERICAN_DIALPBX,
{DATA_DT, DATA_S, DATA_DT, DATA_S, DATA_DT, DATA_S, NULL, NULL, NULL, NULL}, {DATA_DT, DATA_S, DATA_DT, DATA_S, DATA_DT, DATA_S, NULL, NULL, NULL,
{SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, NULL, NULL, NULL, NULL}, NULL},
{SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, NULL, NULL, NULL,
NULL},
{2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} },
{TONE_GERMAN_RINGING, {TONE_GERMAN_RINGING,
...@@ -434,7 +440,7 @@ dsp_tone_hw_message(struct dsp *dsp, u8 *sample, int len) ...@@ -434,7 +440,7 @@ dsp_tone_hw_message(struct dsp *dsp, u8 *sample, int len)
/* unlocking is not required, because we don't expect a response */ /* unlocking is not required, because we don't expect a response */
nskb = _alloc_mISDN_skb(PH_CONTROL_REQ, nskb = _alloc_mISDN_skb(PH_CONTROL_REQ,
(len)?HFC_SPL_LOOP_ON:HFC_SPL_LOOP_OFF, len, sample, (len) ? HFC_SPL_LOOP_ON : HFC_SPL_LOOP_OFF, len, sample,
GFP_ATOMIC); GFP_ATOMIC);
if (nskb) { if (nskb) {
if (dsp->ch.peer) { if (dsp->ch.peer) {
...@@ -498,8 +504,7 @@ dsp_tone(struct dsp *dsp, int tone) ...@@ -498,8 +504,7 @@ dsp_tone(struct dsp *dsp, int tone)
/* we turn off the tone */ /* we turn off the tone */
if (!tone) { if (!tone) {
if (dsp->features.hfc_loops) if (dsp->features.hfc_loops && timer_pending(&tonet->tl))
if (timer_pending(&tonet->tl))
del_timer(&tonet->tl); del_timer(&tonet->tl);
if (dsp->features.hfc_loops) if (dsp->features.hfc_loops)
dsp_tone_hw_message(dsp, NULL, 0); dsp_tone_hw_message(dsp, NULL, 0);
......
...@@ -308,8 +308,8 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask, ...@@ -308,8 +308,8 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask,
/* assemble frame */ /* assemble frame */
*p++ = (L1OIP_VERSION<<6) /* version and coding */ *p++ = (L1OIP_VERSION<<6) /* version and coding */
| (hc->pri?0x20:0x00) /* type */ | (hc->pri ? 0x20 : 0x00) /* type */
| (hc->id?0x10:0x00) /* id */ | (hc->id ? 0x10 : 0x00) /* id */
| localcodec; | localcodec;
if (hc->id) { if (hc->id) {
*p++ = hc->id>>24; /* id */ *p++ = hc->id>>24; /* id */
...@@ -317,7 +317,7 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask, ...@@ -317,7 +317,7 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask,
*p++ = hc->id>>8; *p++ = hc->id>>8;
*p++ = hc->id; *p++ = hc->id;
} }
*p++ = (multi == 1)?0x80:0x00 + channel; /* m-flag, channel */ *p++ = (multi == 1) ? 0x80 : 0x00 + channel; /* m-flag, channel */
if (multi == 1) if (multi == 1)
*p++ = len; /* length */ *p++ = len; /* length */
*p++ = timebase>>8; /* time base */ *p++ = timebase>>8; /* time base */
...@@ -401,12 +401,12 @@ l1oip_socket_recv(struct l1oip *hc, u8 remotecodec, u8 channel, u16 timebase, ...@@ -401,12 +401,12 @@ l1oip_socket_recv(struct l1oip *hc, u8 remotecodec, u8 channel, u16 timebase,
} }
/* prepare message */ /* prepare message */
nskb = mI_alloc_skb((remotecodec == 3)?(len<<1):len, GFP_ATOMIC); nskb = mI_alloc_skb((remotecodec == 3) ? (len<<1) : len, GFP_ATOMIC);
if (!nskb) { if (!nskb) {
printk(KERN_ERR "%s: No mem for skb.\n", __func__); printk(KERN_ERR "%s: No mem for skb.\n", __func__);
return; return;
} }
p = skb_put(nskb, (remotecodec == 3)?(len<<1):len); p = skb_put(nskb, (remotecodec == 3) ? (len<<1) : len);
if (remotecodec == 1 && ulaw) if (remotecodec == 1 && ulaw)
l1oip_alaw_to_ulaw(buf, len, p); l1oip_alaw_to_ulaw(buf, len, p);
...@@ -458,7 +458,7 @@ l1oip_socket_recv(struct l1oip *hc, u8 remotecodec, u8 channel, u16 timebase, ...@@ -458,7 +458,7 @@ l1oip_socket_recv(struct l1oip *hc, u8 remotecodec, u8 channel, u16 timebase,
hc->chan[channel].disorder_flag ^= 1; hc->chan[channel].disorder_flag ^= 1;
if (nskb) if (nskb)
#endif #endif
queue_ch_frame(&bch->ch, PH_DATA_IND, rx_counter, nskb); queue_ch_frame(&bch->ch, PH_DATA_IND, rx_counter, nskb);
} }
} }
...@@ -749,8 +749,8 @@ l1oip_socket_thread(void *data) ...@@ -749,8 +749,8 @@ l1oip_socket_thread(void *data)
l1oip_socket_parse(hc, &sin_rx, recvbuf, recvlen); l1oip_socket_parse(hc, &sin_rx, recvbuf, recvlen);
} else { } else {
if (debug & DEBUG_L1OIP_SOCKET) if (debug & DEBUG_L1OIP_SOCKET)
printk(KERN_WARNING "%s: broken pipe on socket\n", printk(KERN_WARNING
__func__); "%s: broken pipe on socket\n", __func__);
} }
} }
...@@ -925,7 +925,7 @@ handle_dmsg(struct mISDNchannel *ch, struct sk_buff *skb) ...@@ -925,7 +925,7 @@ handle_dmsg(struct mISDNchannel *ch, struct sk_buff *skb)
p = skb->data; p = skb->data;
l = skb->len; l = skb->len;
while (l) { while (l) {
ll = (l < L1OIP_MAX_PERFRAME)?l:L1OIP_MAX_PERFRAME; ll = (l < L1OIP_MAX_PERFRAME) ? l : L1OIP_MAX_PERFRAME;
l1oip_socket_send(hc, 0, dch->slot, 0, l1oip_socket_send(hc, 0, dch->slot, 0,
hc->chan[dch->slot].tx_counter++, p, ll); hc->chan[dch->slot].tx_counter++, p, ll);
p += ll; p += ll;
...@@ -1173,7 +1173,7 @@ handle_bmsg(struct mISDNchannel *ch, struct sk_buff *skb) ...@@ -1173,7 +1173,7 @@ handle_bmsg(struct mISDNchannel *ch, struct sk_buff *skb)
p = skb->data; p = skb->data;
l = skb->len; l = skb->len;
while (l) { while (l) {
ll = (l < L1OIP_MAX_PERFRAME)?l:L1OIP_MAX_PERFRAME; ll = (l < L1OIP_MAX_PERFRAME) ? l : L1OIP_MAX_PERFRAME;
l1oip_socket_send(hc, hc->codec, bch->slot, 0, l1oip_socket_send(hc, hc->codec, bch->slot, 0,
hc->chan[bch->slot].tx_counter, p, ll); hc->chan[bch->slot].tx_counter, p, ll);
hc->chan[bch->slot].tx_counter += ll; hc->chan[bch->slot].tx_counter += ll;
...@@ -1331,8 +1331,8 @@ init_card(struct l1oip *hc, int pri, int bundle) ...@@ -1331,8 +1331,8 @@ init_card(struct l1oip *hc, int pri, int bundle)
spin_lock_init(&hc->socket_lock); spin_lock_init(&hc->socket_lock);
hc->idx = l1oip_cnt; hc->idx = l1oip_cnt;
hc->pri = pri; hc->pri = pri;
hc->d_idx = pri?16:3; hc->d_idx = pri ? 16 : 3;
hc->b_num = pri?30:2; hc->b_num = pri ? 30 : 2;
hc->bundle = bundle; hc->bundle = bundle;
if (hc->pri) if (hc->pri)
sprintf(hc->name, "l1oip-e1.%d", l1oip_cnt + 1); sprintf(hc->name, "l1oip-e1.%d", l1oip_cnt + 1);
...@@ -1517,9 +1517,9 @@ l1oip_init(void) ...@@ -1517,9 +1517,9 @@ l1oip_init(void)
if (debug & DEBUG_L1OIP_INIT) if (debug & DEBUG_L1OIP_INIT)
printk(KERN_DEBUG "%s: interface %d is %s with %s.\n", printk(KERN_DEBUG "%s: interface %d is %s with %s.\n",
__func__, l1oip_cnt, pri?"PRI":"BRI", __func__, l1oip_cnt, pri ? "PRI" : "BRI",
bundle?"bundled IP packet for all B-channels" bundle ? "bundled IP packet for all B-channels" :
:"seperate IP packets for every B-channel"); "seperate IP packets for every B-channel");
hc = kzalloc(sizeof(struct l1oip), GFP_ATOMIC); hc = kzalloc(sizeof(struct l1oip), GFP_ATOMIC);
if (!hc) { if (!hc) {
......
...@@ -222,7 +222,7 @@ mISDN_sock_sendmsg(struct kiocb *iocb, struct socket *sock, ...@@ -222,7 +222,7 @@ mISDN_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
} else { /* use default for L2 messages */ } else { /* use default for L2 messages */
if ((sk->sk_protocol == ISDN_P_LAPD_TE) || if ((sk->sk_protocol == ISDN_P_LAPD_TE) ||
(sk->sk_protocol == ISDN_P_LAPD_NT)) (sk->sk_protocol == ISDN_P_LAPD_NT))
mISDN_HEAD_ID(skb) = _pms(sk)->ch.nr; mISDN_HEAD_ID(skb) = _pms(sk)->ch.nr;
} }
if (*debug & DEBUG_SOCKET) if (*debug & DEBUG_SOCKET)
......
...@@ -872,7 +872,6 @@ ph_data_ind(struct manager *mgr, struct sk_buff *skb) ...@@ -872,7 +872,6 @@ ph_data_ind(struct manager *mgr, struct sk_buff *skb)
__func__, skb->len); __func__, skb->len);
goto done; goto done;
} }
if (*debug & DEBUG_L2_TEI)
if ((skb->data[0] >> 2) != TEI_SAPI) /* not for us */ if ((skb->data[0] >> 2) != TEI_SAPI) /* not for us */
goto done; goto done;
......
...@@ -259,7 +259,7 @@ mISDN_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, ...@@ -259,7 +259,7 @@ mISDN_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
return ret; return ret;
} }
static struct file_operations mISDN_fops = { static const struct file_operations mISDN_fops = {
.read = mISDN_read, .read = mISDN_read,
.poll = mISDN_poll, .poll = mISDN_poll,
.ioctl = mISDN_ioctl, .ioctl = mISDN_ioctl,
......
...@@ -292,19 +292,19 @@ struct mISDN_devrename { ...@@ -292,19 +292,19 @@ struct mISDN_devrename {
/* MPH_INFORMATION_REQ payload */ /* MPH_INFORMATION_REQ payload */
struct ph_info_ch { struct ph_info_ch {
__u32 protocol; __u32 protocol;
__u64 Flags; __u64 Flags;
}; };
struct ph_info_dch { struct ph_info_dch {
struct ph_info_ch ch; struct ph_info_ch ch;
__u16 state; __u16 state;
__u16 num_bch; __u16 num_bch;
}; };
struct ph_info { struct ph_info {
struct ph_info_dch dch; struct ph_info_dch dch;
struct ph_info_ch bch[]; struct ph_info_ch bch[];
}; };
/* timer device ioctl */ /* timer device ioctl */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment