aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/mISDN
diff options
context:
space:
mode:
authorKarsten Keil <kkeil@linux-pingi.de>2012-05-15 19:51:07 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-16 15:24:05 -0400
commit6d1ee48fd0d8d2586aaeda24dacffc426c2be44a (patch)
tree0a94204bfdf5ac0eb4d03885cb2f87ddb0e8eb1a /drivers/isdn/mISDN
parent034005a0119b9c2aabe0ac3953eb9a65ca937a69 (diff)
mISDN: Implement MISDN_CTRL_FILL_EMPTY for more drivers
MISDN_CTRL_FILL_EMPTY is a meachanism to send a fixed value (normally silence) as long no data from upper layers is available. It can be used when recording voice messages or with unidirectional protocols. Signed-off-by: Karsten Keil <kkeil@linux-pingi.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/mISDN')
-rw-r--r--drivers/isdn/mISDN/dsp_core.c1
-rw-r--r--drivers/isdn/mISDN/hwchannel.c12
2 files changed, 12 insertions, 1 deletions
diff --git a/drivers/isdn/mISDN/dsp_core.c b/drivers/isdn/mISDN/dsp_core.c
index 2ac2d7a25a9f..28c99c623bcd 100644
--- a/drivers/isdn/mISDN/dsp_core.c
+++ b/drivers/isdn/mISDN/dsp_core.c
@@ -268,6 +268,7 @@ dsp_fill_empty(struct dsp *dsp)
268 } 268 }
269 cq.op = MISDN_CTRL_FILL_EMPTY; 269 cq.op = MISDN_CTRL_FILL_EMPTY;
270 cq.p1 = 1; 270 cq.p1 = 1;
271 cq.p2 = dsp_silence;
271 if (dsp->ch.peer->ctrl(dsp->ch.peer, CONTROL_CHANNEL, &cq)) { 272 if (dsp->ch.peer->ctrl(dsp->ch.peer, CONTROL_CHANNEL, &cq)) {
272 printk(KERN_DEBUG "%s: CONTROL_CHANNEL failed\n", 273 printk(KERN_DEBUG "%s: CONTROL_CHANNEL failed\n",
273 __func__); 274 __func__);
diff --git a/drivers/isdn/mISDN/hwchannel.c b/drivers/isdn/mISDN/hwchannel.c
index d42ad0e98de3..e541b65f68ba 100644
--- a/drivers/isdn/mISDN/hwchannel.c
+++ b/drivers/isdn/mISDN/hwchannel.c
@@ -140,6 +140,8 @@ mISDN_clear_bchannel(struct bchannel *ch)
140 test_and_clear_bit(FLG_TX_BUSY, &ch->Flags); 140 test_and_clear_bit(FLG_TX_BUSY, &ch->Flags);
141 test_and_clear_bit(FLG_TX_NEXT, &ch->Flags); 141 test_and_clear_bit(FLG_TX_NEXT, &ch->Flags);
142 test_and_clear_bit(FLG_ACTIVE, &ch->Flags); 142 test_and_clear_bit(FLG_ACTIVE, &ch->Flags);
143 test_and_clear_bit(FLG_FILLEMPTY, &ch->Flags);
144 test_and_clear_bit(FLG_TX_EMPTY, &ch->Flags);
143 ch->minlen = ch->init_minlen; 145 ch->minlen = ch->init_minlen;
144 ch->next_minlen = ch->init_minlen; 146 ch->next_minlen = ch->init_minlen;
145 ch->maxlen = ch->init_maxlen; 147 ch->maxlen = ch->init_maxlen;
@@ -165,7 +167,15 @@ mISDN_ctrl_bchannel(struct bchannel *bch, struct mISDN_ctrl_req *cq)
165 167
166 switch (cq->op) { 168 switch (cq->op) {
167 case MISDN_CTRL_GETOP: 169 case MISDN_CTRL_GETOP:
168 cq->op = MISDN_CTRL_RX_BUFFER; 170 cq->op = MISDN_CTRL_RX_BUFFER | MISDN_CTRL_FILL_EMPTY;
171 break;
172 case MISDN_CTRL_FILL_EMPTY:
173 if (cq->p1) {
174 memset(bch->fill, cq->p2 & 0xff, MISDN_BCH_FILL_SIZE);
175 test_and_set_bit(FLG_FILLEMPTY, &bch->Flags);
176 } else {
177 test_and_clear_bit(FLG_FILLEMPTY, &bch->Flags);
178 }
169 break; 179 break;
170 case MISDN_CTRL_RX_BUFFER: 180 case MISDN_CTRL_RX_BUFFER:
171 if (cq->p2 > MISDN_CTRL_RX_SIZE_IGNORE) 181 if (cq->p2 > MISDN_CTRL_RX_SIZE_IGNORE)