summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-01-03 18:27:44 +0000
committerShaun Ruffell <sruffell@digium.com>2011-01-03 18:27:44 +0000
commit40e0183721b4dd08ff25b14cc4dd088577436280 (patch)
tree748593e8e13b54fdd121a10815aa92e811d3b07f /drivers
parent15c113b01ef824460f4cd98c685feaf6d7349b08 (diff)
dahdi: Only check for NOSTDTXRX once in dahdi_receive.
There is no need to check the flag on the master channel when processing all the slave channels. Originally part of a patch kpfleming had floating around. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Signed-off-by: Kevin P. Fleming <kpfleming@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9602 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dahdi/dahdi-base.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index c27d28f..d40408e 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -8849,8 +8849,12 @@ int dahdi_receive(struct dahdi_span *span)
for (x = 0; x < span->channels; x++) {
struct dahdi_chan *const chan = span->chans[x];
+ spin_lock(&chan->lock);
+ if (unlikely(chan->flags & DAHDI_FLAG_NOSTDTXRX)) {
+ spin_unlock(&chan->lock);
+ continue;
+ }
if (chan->master == chan) {
- spin_lock(&chan->lock);
if (chan->nextslave) {
/* Must process each slave at the same time */
u_char data[DAHDI_CHUNKSIZE];
@@ -8862,16 +8866,14 @@ int dahdi_receive(struct dahdi_span *span)
for (z = chan; z; z = z->nextslave) {
data[pos++] = z->readchunk[y];
if (pos == DAHDI_CHUNKSIZE) {
- if (!(chan->flags & DAHDI_FLAG_NOSTDTXRX))
- __dahdi_receive_chunk(chan, data);
+ __dahdi_receive_chunk(chan, data);
pos = 0;
}
}
}
} else {
/* Process a normal channel */
- if (!(chan->flags & DAHDI_FLAG_NOSTDTXRX))
- __dahdi_real_receive(chan);
+ __dahdi_real_receive(chan);
}
if (chan->itimer) {
chan->itimer -= DAHDI_CHUNKSIZE;
@@ -8916,8 +8918,8 @@ int dahdi_receive(struct dahdi_span *span)
#ifdef BUFFER_DEBUG
chan->statcount -= DAHDI_CHUNKSIZE;
#endif
- spin_unlock(&chan->lock);
}
+ spin_unlock(&chan->lock);
}
local_irq_restore(flags);