The diff below changes the timeouts from using clock ticks to using
an actual measure of time. If you have rtw(4) hardware, please
test this diff, and make sure that the LEDs are still blinking
normally, and haven't begun attempting to signal the birth of
SkyNet via morse code.
Thanks.
- Bert
Index: sys/dev/ic/rtwvar.h
===================================================================
RCS file: /cvs/src/sys/dev/ic/rtwvar.h,v
retrieving revision 1.25
diff -u -p -r1.25 rtwvar.h
--- sys/dev/ic/rtwvar.h 10 Jun 2009 18:41:07 -0000 1.25
+++ sys/dev/ic/rtwvar.h 6 Jul 2009 07:07:38 -0000
@@ -338,6 +338,9 @@ union rtw_keys {
#define RTW_LED_SLOW_TICKS MAX(1, hz/2)
#define RTW_LED_FAST_TICKS MAX(1, hz/10)
+#define RTW_LED_SLOW_MSEC 500
+#define RTW_LED_FAST_MSEC 100
+
struct rtw_led_state {
#define RTW_LED0 0x1
#define RTW_LED1 0x2
Index: sys/dev/ic/rtw.c
===================================================================
RCS file: /cvs/src/sys/dev/ic/rtw.c,v
retrieving revision 1.73
diff -u -p -r1.73 rtw.c
--- sys/dev/ic/rtw.c 29 Mar 2009 21:53:52 -0000 1.73
+++ sys/dev/ic/rtw.c 6 Jul 2009 07:07:38 -0000
@@ -2498,8 +2498,8 @@ rtw_led_newstate(struct rtw_softc *sc, e
ls->ls_default = 0;
break;
case IEEE80211_S_SCAN:
- timeout_add(&ls->ls_slow_ch, RTW_LED_SLOW_TICKS);
- timeout_add(&ls->ls_fast_ch, RTW_LED_FAST_TICKS);
+ timeout_add_msec(&ls->ls_slow_ch, RTW_LED_SLOW_MSEC);
+ timeout_add_msec(&ls->ls_fast_ch, RTW_LED_FAST_MSEC);
/*FALLTHROUGH*/
case IEEE80211_S_AUTH:
case IEEE80211_S_ASSOC:
@@ -2587,7 +2587,7 @@ rtw_led_fastblink(void *arg)
rtw_led_set(ls, &sc->sc_regs, sc->sc_hwverid);
splx(s);
- timeout_add(&ls->ls_fast_ch, RTW_LED_FAST_TICKS);
+ timeout_add_msec(&ls->ls_fast_ch, RTW_LED_FAST_MSEC);
}
void
@@ -2601,7 +2601,7 @@ rtw_led_slowblink(void *arg)
ls->ls_state ^= RTW_LED_S_SLOW;
rtw_led_set(ls, &sc->sc_regs, sc->sc_hwverid);
splx(s);
- timeout_add(&ls->ls_slow_ch, RTW_LED_SLOW_TICKS);
+ timeout_add_msec(&ls->ls_slow_ch, RTW_LED_SLOW_MSEC);
}
void