[dahdi-commits] sruffell: branch linux/sruffell/dahdi-linux-cmdqueue r6037 - /linux/team/sruf...
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Tue Feb 24 17:06:22 CST 2009
Author: sruffell
Date: Tue Feb 24 17:06:22 2009
New Revision: 6037
URL: http://svn.digium.com/svn-view/dahdi?view=rev&rev=6037
Log:
Since the "yellow" is achieved by rapidly switching between red and green, I
needed to move the handling of just the leds back into the interrupt handler.
Modified:
linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/base.c
linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/wcte12xp.h
Modified: linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/base.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/base.c?view=diff&rev=6037&r1=6036&r2=6037
==============================================================================
--- linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/base.c Tue Feb 24 17:06:22 2009
@@ -1182,20 +1182,19 @@
led = wc->ledtestreg;
if (wc->span.alarms & (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE)) {
+ /* When we're in red alarm, blink the led once a second. */
if (time_after(jiffies, wc->blinktimer)) {
- wc->blinktimer = jiffies + 16*(HZ/100);
- led = (led & __LED_GREEN) ? UNSET_LED_REDGREEN(led) : SET_LED_RED(led);
+ wc->blinktimer = jiffies + HZ/2;
+ led = (led & __LED_GREEN) ? SET_LED_RED(led) : UNSET_LED_REDGREEN(led);
}
} else if (wc->span.alarms & DAHDI_ALARM_YELLOW) {
- if (time_after(jiffies, wc->blinktimer)) {
- wc->blinktimer = jiffies + HZ/100;
- led = (led & __LED_RED) ? SET_LED_GREEN(led) : SET_LED_RED(led);
- }
+ led = (led & __LED_RED) ? SET_LED_GREEN(led) : SET_LED_RED(led);
} else {
if (wc->span.maintstat != DAHDI_MAINT_NONE)
led = SET_LED_ORANGE(led);
else
led = UNSET_LED_ORANGE(led);
+
if (test_bit(DAHDI_FLAGBIT_RUNNING, &wc->span.flags))
led = SET_LED_GREEN(led);
else
@@ -1203,10 +1202,16 @@
}
if (led != wc->ledtestreg) {
- spin_lock_irqsave(&wc->reglock, flags);
- wc->ledtestreg = led;
- spin_unlock_irqrestore(&wc->reglock, flags);
- t1_setleds(wc, led);
+ struct command *cmd;
+ cmd = get_free_cmd(wc);
+ if (cmd) {
+ cmd->flags |= __CMD_LEDS;
+ cmd->address = ~led & 0x0E;
+ submit_cmd(wc, cmd);
+ spin_lock_irqsave(&wc->reglock, flags);
+ wc->ledtestreg = led;
+ spin_unlock_irqrestore(&wc->reglock, flags);
+ }
}
}
@@ -1311,6 +1316,7 @@
atomic_inc(&wc->txints);
t1_transmitprep(wc, vbb);
voicebus_transmit(wc->vb, vbb);
+ handle_leds(wc);
}
static void
@@ -1331,7 +1337,6 @@
#endif
/* Called once every 100ms */
if (unlikely(!atomic_read(&wc->initialized))) return;
- handle_leds(wc);
t1_do_counters(wc);
t1_check_alarms(wc);
t1_check_sigbits(wc);
Modified: linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/wcte12xp.h
URL: http://svn.digium.com/svn-view/dahdi/linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/wcte12xp.h?view=diff&rev=6037&r1=6036&r2=6037
==============================================================================
--- linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/wcte12xp.h (original)
+++ linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/wcte12xp.h Tue Feb 24 17:06:22 2009
@@ -56,15 +56,10 @@
#define NUM_EC 4
#define __CMD_VPM (1 << 16) /* flag for VPM action */
-#define __CMD_ISR (1 << 17) /* flag for ISR reads */
#define __CMD_PINS (1 << 18) /* CPLD pin read */
#define __CMD_LEDS (1 << 19) /* LED Operation */
#define __CMD_RD (1 << 20) /* Read Operation */
#define __CMD_WR (1 << 21) /* Write Operation */
-#if 0
-#define __CMD_FIN (1 << 22) /* Has finished receive */
-#define __CMD_TX (1 << 23) /* Has been transmitted */
-#endif
#define __LED_ORANGE (1<<3)
#define __LED_GREEN (1<<2)
More information about the dahdi-commits
mailing list