Subject: must use usb_callout()
To: None <current-users@netbsd.org>
From: KIYOHARA Takashi <kiyohara@kk.iij4u.or.jp>
List: current-users
Date: 06/05/2007 01:04:11
----Next_Part(Tue_Jun__5_01_04_12_2007_319)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi! all,


We must use usb_callout() onto ural(4) and rum(4).

Thanks,
--
kiyohara


----Next_Part(Tue_Jun__5_01_04_12_2007_319)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="ural-callout.diff"

Index: if_ural.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/if_ural.c,v
retrieving revision 1.21
diff -u -r1.21 if_ural.c
--- if_ural.c	7 May 2007 07:29:03 -0000	1.21
+++ if_ural.c	4 Jun 2007 09:34:46 -0000
@@ -423,10 +423,10 @@
 	}
 
 	usb_init_task(&sc->sc_task, ural_task, sc);
-	callout_init(&sc->scan_ch);
+	usb_callout_init(sc->sc_scan_ch);
 	sc->amrr.amrr_min_success_threshold = 1;
 	sc->amrr.amrr_min_success_threshold = 15;
-	callout_init(&sc->amrr_ch);
+	usb_callout_init(sc->sc_amrr_ch);
 
 	/* retrieve RT2570 rev. no */
 	sc->asic_rev = ural_read(sc, RAL_MAC_CSR0);
@@ -538,8 +538,8 @@
 
 	ural_stop(ifp, 1);
 	usb_rem_task(sc->sc_udev, &sc->sc_task);
-	callout_stop(&sc->scan_ch);
-	callout_stop(&sc->amrr_ch);
+	usb_uncallout(sc->sc_scan_ch, ural_next_scan, sc);
+	usb_uncallout(sc->sc_amrr_ch, ural_amrr_timeout, sc);
 
 	if (sc->amrr_xfer != NULL) {
 		usbd_free_xfer(sc->amrr_xfer);
@@ -756,7 +756,7 @@
 
 	case IEEE80211_S_SCAN:
 		ural_set_chan(sc, ic->ic_curchan);
-		callout_reset(&sc->scan_ch, hz / 5, ural_next_scan, sc);
+		usb_callout(sc->sc_scan_ch, hz / 5, ural_next_scan, sc);
 		break;
 
 	case IEEE80211_S_AUTH:
@@ -823,8 +823,8 @@
 	struct ural_softc *sc = ic->ic_ifp->if_softc;
 
 	usb_rem_task(sc->sc_udev, &sc->sc_task);
-	callout_stop(&sc->scan_ch);
-	callout_stop(&sc->amrr_ch);
+	usb_uncallout(sc->sc_scan_ch, ural_next_scan, sc);
+	usb_uncallout(sc->sc_amrr_ch, ural_amrr_timeout, sc);
 
 	/* do it in a process context */
 	sc->sc_state = nstate;
@@ -2318,7 +2318,7 @@
 	     i--);
 	ni->ni_txrate = i;
 
-	callout_reset(&sc->amrr_ch, hz, ural_amrr_timeout, sc);
+	usb_callout(sc->sc_amrr_ch, hz, ural_amrr_timeout, sc);
 }
 
 Static void
@@ -2375,5 +2375,5 @@
 
 	ieee80211_amrr_choose(&sc->amrr, sc->sc_ic.ic_bss, &sc->amn);
 
-	callout_reset(&sc->amrr_ch, hz, ural_amrr_timeout, sc);
+	usb_callout(sc->sc_amrr_ch, hz, ural_amrr_timeout, sc);
 }
Index: if_uralvar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/if_uralvar.h,v
retrieving revision 1.7
diff -u -r1.7 if_uralvar.h
--- if_uralvar.h	4 Mar 2007 06:02:48 -0000	1.7
+++ if_uralvar.h	4 Jun 2007 09:36:44 -0000
@@ -104,8 +104,8 @@
 
 	struct ieee80211_beacon_offsets sc_bo;
 
-	struct callout		scan_ch;
-	struct callout		amrr_ch;
+	usb_callout_t		sc_scan_ch;
+	usb_callout_t		sc_amrr_ch;
 
 	int			sc_tx_timer;
 

----Next_Part(Tue_Jun__5_01_04_12_2007_319)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="rum-callout.diff"

Index: if_rum.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/if_rum.c,v
retrieving revision 1.11
diff -u -r1.11 if_rum.c
--- if_rum.c	7 May 2007 07:14:58 -0000	1.11
+++ if_rum.c	4 Jun 2007 09:13:18 -0000
@@ -351,11 +351,11 @@
 	}
 
 	usb_init_task(&sc->sc_task, rum_task, sc);
-	callout_init(&sc->scan_ch);
+	usb_callout_init(sc->sc_scan_ch);
 
 	sc->amrr.amrr_min_success_threshold =  1;
 	sc->amrr.amrr_max_success_threshold = 10;
-	callout_init(&sc->amrr_ch);
+	usb_callout_init(sc->sc_amrr_ch);
 
 	/* retrieve RT2573 rev. no */
 	for (ntries = 0; ntries < 1000; ntries++) {
@@ -481,8 +481,8 @@
 
 	rum_stop(ifp, 1);
 	usb_rem_task(sc->sc_udev, &sc->sc_task);
-	callout_stop(&sc->scan_ch);
-	callout_stop(&sc->amrr_ch);
+	usb_uncallout(sc->sc_scan_ch, rum_next_scan, sc);
+	usb_uncallout(sc->sc_amrr_ch, rum_amrr_timeout, sc);
 
 	if (sc->amrr_xfer != NULL) {
 		usbd_free_xfer(sc->amrr_xfer);
@@ -700,7 +700,7 @@
 
 	case IEEE80211_S_SCAN:
 		rum_set_chan(sc, ic->ic_curchan);
-		callout_reset(&sc->scan_ch, hz / 5, rum_next_scan, sc);
+		usb_callout(sc->sc_scan_ch, hz / 5, rum_next_scan, sc);
 		break;
 
 	case IEEE80211_S_AUTH:
@@ -748,8 +748,8 @@
 	struct rum_softc *sc = ic->ic_ifp->if_softc;
 
 	usb_rem_task(sc->sc_udev, &sc->sc_task);
-	callout_stop(&sc->scan_ch);
-	callout_stop(&sc->amrr_ch);
+	usb_uncallout(sc->sc_scan_ch, rum_next_scan, sc);
+	usb_uncallout(sc->sc_amrr_ch, rum_amrr_timeout, sc);
 
 	/* do it in a process context */
 	sc->sc_state = nstate;
@@ -2185,7 +2185,7 @@
 	     i--);
 	ni->ni_txrate = i;
 
-	callout_reset(&sc->amrr_ch, hz, rum_amrr_timeout, sc);
+	usb_callout(sc->sc_amrr_ch, hz, rum_amrr_timeout, sc);
 }
 
 Static void
@@ -2241,7 +2241,7 @@
 
 	ieee80211_amrr_choose(&sc->amrr, sc->sc_ic.ic_bss, &sc->amn);
 
-	callout_reset(&sc->amrr_ch, hz, rum_amrr_timeout, sc);
+	usb_callout(sc->sc_amrr_ch, hz, rum_amrr_timeout, sc);
 }
 
 int
Index: if_rumvar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/if_rumvar.h,v
retrieving revision 1.2
diff -u -r1.2 if_rumvar.h
--- if_rumvar.h	4 Mar 2007 06:02:48 -0000	1.2
+++ if_rumvar.h	4 Jun 2007 09:31:35 -0000
@@ -108,8 +108,8 @@
 
 	struct ieee80211_beacon_offsets	sc_bo;
 
-	struct callout			scan_ch;
-	struct callout			amrr_ch;
+	usb_callout_t			sc_scan_ch;
+	usb_callout_t			sc_amrr_ch;
 
 	int				sc_tx_timer;
 

----Next_Part(Tue_Jun__5_01_04_12_2007_319)----