summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-03-02 13:09:04 -0600
committerShaun Ruffell <sruffell@digium.com>2011-04-15 14:19:01 -0500
commitb57b085aaa1882241ab88335b4b2db691b1714bd (patch)
treedcc5e0dab8e7750eb79b904a9655e9f4339eaad3
parent7bd29f1d446c26bce1add5e3da0e50de3daf44ae (diff)
wctdm24xxp: Use fact that handle_transmit/receive are called in hard-irq
We can save on saving and restoring the local interrupt state. Signed-off-by: Shaun Ruffell <sruffell@digium.com>
-rw-r--r--drivers/dahdi/wctdm24xxp/base.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index 59aca50..07c2627 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -1063,7 +1063,6 @@ static void insert_tdm_data(const struct wctdm *wc, u8 *sframe)
static inline void wctdm_transmitprep(struct wctdm *wc, unsigned char *sframe)
{
- unsigned long flags;
int x, y;
struct dahdi_span *s;
unsigned char *eframe = sframe;
@@ -1073,7 +1072,7 @@ static inline void wctdm_transmitprep(struct wctdm *wc, unsigned char *sframe)
for (x = 0; x < MAX_SPANS; x++) {
if (wc->spans[x]) {
s = &wc->spans[x]->span;
- dahdi_transmit(s);
+ _dahdi_transmit(s);
}
}
insert_tdm_data(wc, sframe);
@@ -1086,7 +1085,7 @@ static inline void wctdm_transmitprep(struct wctdm *wc, unsigned char *sframe)
#endif
}
- spin_lock_irqsave(&wc->reglock, flags);
+ spin_lock(&wc->reglock);
for (x = 0; x < DAHDI_CHUNKSIZE; x++) {
/* Send a sample, as a 32-bit word */
@@ -1116,7 +1115,7 @@ static inline void wctdm_transmitprep(struct wctdm *wc, unsigned char *sframe)
}
eframe += (EFRAME_SIZE + EFRAME_GAP);
}
- spin_unlock_irqrestore(&wc->reglock, flags);
+ spin_unlock(&wc->reglock);
}
/* Must be called with wc.reglock held and local interrupts disabled */
@@ -1324,7 +1323,6 @@ static void extract_tdm_data(struct wctdm *wc, const u8 *sframe)
static inline void wctdm_receiveprep(struct wctdm *wc, const u8 *sframe)
{
- unsigned long flags;
int x, y;
bool irqmiss = false;
unsigned char expected;
@@ -1336,7 +1334,7 @@ static inline void wctdm_receiveprep(struct wctdm *wc, const u8 *sframe)
if (likely(wc->initialized))
extract_tdm_data(wc, sframe);
- spin_lock_irqsave(&wc->reglock, flags);
+ spin_lock(&wc->reglock);
for (x = 0; x < DAHDI_CHUNKSIZE; x++) {
if (x < DAHDI_CHUNKSIZE - 1) {
expected = wc->rxident + 1;
@@ -1354,7 +1352,7 @@ static inline void wctdm_receiveprep(struct wctdm *wc, const u8 *sframe)
eframe += (EFRAME_SIZE + EFRAME_GAP);
}
- spin_unlock_irqrestore(&wc->reglock, flags);
+ spin_unlock(&wc->reglock);
/* XXX We're wasting 8 taps. We should get closer :( */
if (likely(wc->initialized)) {
@@ -1364,9 +1362,9 @@ static inline void wctdm_receiveprep(struct wctdm *wc, const u8 *sframe)
unsigned char buffer[DAHDI_CHUNKSIZE];
__dahdi_fifo_get(wc->ec_reference[x], buffer,
ARRAY_SIZE(buffer));
- dahdi_ec_chunk(c, c->readchunk, buffer);
+ _dahdi_ec_chunk(c, c->readchunk, buffer);
#else
- dahdi_ec_chunk(c, c->readchunk, c->writechunk);
+ _dahdi_ec_chunk(c, c->readchunk, c->writechunk);
#endif
}
@@ -1382,7 +1380,7 @@ static inline void wctdm_receiveprep(struct wctdm *wc, const u8 *sframe)
}
#endif
- dahdi_receive(s);
+ _dahdi_receive(s);
if (unlikely(irqmiss))
++s->irqmisses;
}