Bugfixes when unloading the hfcmulti module.

Some better debugging.
Minor source changes.

Modified Files:
	mISDN/drivers/isdn/hardware/mISDN/dsp_cmx.c
	mISDN/drivers/isdn/hardware/mISDN/hfc_multi.c
This commit is contained in:
Andreas Eversberg 2004-02-14 20:09:28 +00:00
parent e8fae00343
commit d32e9d4184
2 changed files with 24 additions and 12 deletions

View File

@ -182,7 +182,7 @@ dsp_cmx_debug(dsp_t *dsp)
member = conf->mlist;
while(member)
{
printk(KERN_DEBUG " - member = %s %s (slot_tx %d, bank_tx %d, slot_rx %d, bank_rx %d hfc_conf %d)\n", member->dsp->inst.name, (member->dsp==dsp)?" *this*":"", member->dsp->pcm_slot_tx, member->dsp->pcm_bank_tx, member->dsp->pcm_slot_rx, member->dsp->pcm_bank_rx, member->dsp->hfc_conf);
printk(KERN_DEBUG " - member = %s (slot_tx %d, bank_tx %d, slot_rx %d, bank_rx %d hfc_conf %d)%s\n", member->dsp->inst.name, member->dsp->pcm_slot_tx, member->dsp->pcm_bank_tx, member->dsp->pcm_slot_rx, member->dsp->pcm_bank_rx, member->dsp->hfc_conf, (member->dsp==dsp)?" *this*":"");
member = member->next;
}
conf = conf->next;
@ -874,7 +874,7 @@ dsp_cmx_conf(dsp_t *dsp, u32 conf_id)
/* now add us to conf */
if (dsp_debug & DEBUG_DSP_CMX)
printk(KERN_DEBUG "searching conference %d\n",
dsp->conf_id);
conf_id);
conf = dsp_cmx_search_conf(conf_id);
if (!conf) {
if (dsp_debug & DEBUG_DSP_CMX)

View File

@ -320,6 +320,7 @@ init_chip(hfc_multi_t *hc)
while (i < 256) {
HFC_outb_(hc, R_SLOT, i);
HFC_outb_(hc, A_SL_CFG, 0);
HFC_outb_(hc, A_CONF, 0);
i++;
}
@ -514,7 +515,8 @@ hfcmulti_dtmf(hfc_multi_t *hc)
if (debug & DEBUG_HFCMULTI_DTMF)
printk("\n");
if (hc->chan[ch].dtmf_skb) {
printk(KERN_WARNING "%s: dtmf_skb still exist\n", __FUNCTION__);
#warning remove when bug fixed
// printk(KERN_WARNING "%s: dtmf_skb still exist\n", __FUNCTION__);
ch++;
continue;
}
@ -631,6 +633,9 @@ next_frame:
if (z1 == z2) { /* empty */
/* if done with FIFO audio data during PCM connection */
if (!hdlc && txpending && slot_tx>=0) {
if (debug & DEBUG_HFCMULTI_MODE)
printk(KERN_DEBUG "%s: reconnecting PCM due to no more FIFO data: channel %d slot_tx %d\n", __FUNCTION__, ch, slot_tx);
/* connect slot */
HFC_outb(hc, A_CON_HDLC, 0xc0 | 0x00 | V_HDLC_TRP | V_IFF);
HFC_outb_(hc, R_FIFO, ch<<1 | 1);
@ -646,6 +651,8 @@ next_frame:
/* if audio data */
if (!hdlc && !txpending && slot_tx>=0) {
if (debug & DEBUG_HFCMULTI_MODE)
printk(KERN_DEBUG "%s: disconnecting PCM due to FIFO data: channel %d slot_tx %d\n", __FUNCTION__, ch, slot_tx);
/* disconnect slot */
HFC_outb(hc, A_CON_HDLC, 0x80 | 0x00 | V_HDLC_TRP | V_IFF);
HFC_outb_(hc, R_FIFO, ch<<1 | 1);
@ -1236,7 +1243,6 @@ mode_hfcmulti(hfc_multi_t *hc, int ch, int protocol, int slot_tx, int bank_tx, i
printk(KERN_DEBUG "%s: remove from slot %d (RX)\n", __FUNCTION__, oslot_rx);
HFC_outb(hc, R_SLOT, (oslot_rx<<1) | V_SL_DIR);
HFC_outb(hc, A_SL_CFG, 0);
HFC_outb(hc, A_CONF, 0);
}
if (slot_tx < 0) {
@ -1281,7 +1287,6 @@ mode_hfcmulti(hfc_multi_t *hc, int ch, int protocol, int slot_tx, int bank_tx, i
printk(KERN_DEBUG "%s: put to slot %d bank %d flow %02x routing %02x conf %d (RX)\n", __FUNCTION__, slot_rx, bank_rx, flow_rx, routing, conf);
HFC_outb(hc, R_SLOT, (slot_rx<<1) | V_SL_DIR);
HFC_outb(hc, A_SL_CFG, (ch<<1) | V_CH_DIR | routing);
HFC_outb(hc, A_CONF, 0);
hc->chan[ch].slot_rx = slot_rx;
hc->chan[ch].bank_rx = bank_rx;
}
@ -1457,14 +1462,13 @@ hfcmulti_splloop(hfc_multi_t *hc, int ch, u_char *data, int len)
HFC_outb_(hc, R_INC_RES_FIFO, V_RES_F);
HFC_wait_(hc);
/* loop fifo */
HFC_outb(hc, A_SUBCH_CFG, V_LOOP_FIFO);
/* if off */
if (len <= 0) {
HFC_outb_(hc, A_FIFO_DATA0_NOINC, silence);
HFC_outb(hc, A_SUBCH_CFG, 0);
if (hc->chan[ch].slot_tx>=0) {
if (debug & DEBUG_HFCMULTI_MODE)
printk(KERN_DEBUG "%s: connecting PCM due to no more TONE: channel %d slot_tx %d\n", __FUNCTION__, ch, hc->chan[ch].slot_tx);
/* connect slot */
HFC_outb(hc, A_CON_HDLC, 0xc0 | 0x00 | V_HDLC_TRP | V_IFF);
HFC_outb(hc, R_FIFO, ch<<1 | 1);
@ -1475,6 +1479,9 @@ hfcmulti_splloop(hfc_multi_t *hc, int ch, u_char *data, int len)
return;
}
/* loop fifo */
HFC_outb(hc, A_SUBCH_CFG, V_LOOP_FIFO);
/* set mode */
hc->chan[ch].txpending = 2;
@ -1502,14 +1509,14 @@ hfcmulti_splloop(hfc_multi_t *hc, int ch, u_char *data, int len)
/* disconnect slot */
if (hc->chan[ch].slot_tx>=0) {
if (debug & DEBUG_HFCMULTI_MODE)
printk(KERN_DEBUG "%s: disconnecting PCM due to TONE: channel %d slot_tx %d\n", __FUNCTION__, ch, hc->chan[ch].slot_tx);
HFC_outb(hc, A_CON_HDLC, 0x80 | 0x00 | V_HDLC_TRP | V_IFF);
HFC_outb(hc, R_FIFO, ch<<1 | 1);
HFC_wait(hc);
HFC_outb(hc, A_CON_HDLC, 0x80 | 0x00 | V_HDLC_TRP | V_IFF);
HFC_outb(hc, R_FIFO, ch<<1);
HFC_wait(hc);
} else {
HFC_outb(hc, A_CON_HDLC, 0x80 | 0x00 | V_HDLC_TRP | V_IFF);
// HFC_outb(hc, A_CON_HDLC, 0x80 | 0x00 | V_HDLC_TRP | V_IFF);
/* change fifo */
HFC_outb(hc, R_FIFO, ch<<1);
HFC_wait(hc);
@ -2651,10 +2658,15 @@ release_port(hfc_multi_t *hc, int port)
dev_kfree_skb(hc->chan[i].dtmf_skb);
hc->chan[i].dtmf_skb = NULL;
}
hc->created[hc->chan[i].port] = 0;
}
i++;
}
i = 0;
while(i < 8) {
if (i==port || all)
hc->created[i] = 0;
i++;
}
/* dimm leds */
if (hc->leds)