Commit 126859b9 authored by Colin Ian King's avatar Colin Ian King Committed by David S. Miller

mISDN: remove DSP_NEVER_DEFINED and adjust code identation

The DSP_NEVER_DEFINED #ifdef is confusing, it slips in an
extra } which is not required because the previous code is
indented incorrectly.  Correct the identation and remove the
extraneous DSP_NEVER_DEFINED
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cea6aeb6
...@@ -1454,66 +1454,63 @@ dsp_cmx_send_member(struct dsp *dsp, int len, s32 *c, int members) ...@@ -1454,66 +1454,63 @@ dsp_cmx_send_member(struct dsp *dsp, int len, s32 *c, int members)
#ifdef CMX_CONF_DEBUG #ifdef CMX_CONF_DEBUG
if (0) { if (0) {
#else #else
if (members == 2) { if (members == 2) {
#endif #endif
/* "other" becomes other party */ /* "other" becomes other party */
other = (list_entry(conf->mlist.next, other = (list_entry(conf->mlist.next,
struct dsp_conf_member, list))->dsp; struct dsp_conf_member, list))->dsp;
if (other == member) if (other == member)
other = (list_entry(conf->mlist.prev, other = (list_entry(conf->mlist.prev,
struct dsp_conf_member, list))->dsp; struct dsp_conf_member, list))->dsp;
o_q = other->rx_buff; /* received data */ o_q = other->rx_buff; /* received data */
o_rr = (other->rx_R + len) & CMX_BUFF_MASK; o_rr = (other->rx_R + len) & CMX_BUFF_MASK;
/* end of rx-pointer */ /* end of rx-pointer */
o_r = (o_rr - rr + r) & CMX_BUFF_MASK; o_r = (o_rr - rr + r) & CMX_BUFF_MASK;
/* start rx-pointer at current read position*/ /* start rx-pointer at current read position*/
/* -> if echo is NOT enabled */ /* -> if echo is NOT enabled */
if (!dsp->echo.software) { if (!dsp->echo.software) {
/* /*
* -> copy other member's rx-data, * -> copy other member's rx-data,
* if tx-data is available, mix * if tx-data is available, mix
*/ */
while (o_r != o_rr && t != tt) { while (o_r != o_rr && t != tt) {
*d++ = dsp_audio_mix_law[(p[t] << 8) | o_q[o_r]]; *d++ = dsp_audio_mix_law[(p[t] << 8) | o_q[o_r]];
t = (t + 1) & CMX_BUFF_MASK; t = (t + 1) & CMX_BUFF_MASK;
o_r = (o_r + 1) & CMX_BUFF_MASK; o_r = (o_r + 1) & CMX_BUFF_MASK;
} }
while (o_r != o_rr) { while (o_r != o_rr) {
*d++ = o_q[o_r]; *d++ = o_q[o_r];
o_r = (o_r + 1) & CMX_BUFF_MASK; o_r = (o_r + 1) & CMX_BUFF_MASK;
} }
/* -> if echo is enabled */ /* -> if echo is enabled */
} else { } else {
/* /*
* -> mix other member's rx-data with echo, * -> mix other member's rx-data with echo,
* if tx-data is available, mix * if tx-data is available, mix
*/ */
while (r != rr && t != tt) { while (r != rr && t != tt) {
sample = dsp_audio_law_to_s32[p[t]] + sample = dsp_audio_law_to_s32[p[t]] +
dsp_audio_law_to_s32[q[r]] + dsp_audio_law_to_s32[q[r]] +
dsp_audio_law_to_s32[o_q[o_r]]; dsp_audio_law_to_s32[o_q[o_r]];
if (sample < -32768) if (sample < -32768)
sample = -32768; sample = -32768;
else if (sample > 32767) else if (sample > 32767)
sample = 32767; sample = 32767;
*d++ = dsp_audio_s16_to_law[sample & 0xffff]; *d++ = dsp_audio_s16_to_law[sample & 0xffff];
/* tx-data + rx_data + echo */ /* tx-data + rx_data + echo */
t = (t + 1) & CMX_BUFF_MASK; t = (t + 1) & CMX_BUFF_MASK;
r = (r + 1) & CMX_BUFF_MASK; r = (r + 1) & CMX_BUFF_MASK;
o_r = (o_r + 1) & CMX_BUFF_MASK; o_r = (o_r + 1) & CMX_BUFF_MASK;
} }
while (r != rr) { while (r != rr) {
*d++ = dsp_audio_mix_law[(q[r] << 8) | o_q[o_r]]; *d++ = dsp_audio_mix_law[(q[r] << 8) | o_q[o_r]];
r = (r + 1) & CMX_BUFF_MASK; r = (r + 1) & CMX_BUFF_MASK;
o_r = (o_r + 1) & CMX_BUFF_MASK; o_r = (o_r + 1) & CMX_BUFF_MASK;
}
} }
dsp->tx_R = t;
goto send_packet;
} }
#ifdef DSP_NEVER_DEFINED dsp->tx_R = t;
goto send_packet;
} }
#endif
/* PROCESS DATA (three or more members) */ /* PROCESS DATA (three or more members) */
/* -> if echo is NOT enabled */ /* -> if echo is NOT enabled */
if (!dsp->echo.software) { if (!dsp->echo.software) {
......
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