FreeBSD Bugzilla – Attachment 154369 Details for
Bug 197143
[wpi] [patch]: sync with iwn / OpenBSD wpi
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Split TX and scan timers
patch-wpi57.diff (text/plain), 3.66 KB, created by
Andriy Voskoboinyk
on 2015-03-15 13:55:02 UTC
(
hide
)
Description:
Split TX and scan timers
Filename:
MIME Type:
Creator:
Andriy Voskoboinyk
Created:
2015-03-15 13:55:02 UTC
Size:
3.66 KB
patch
obsolete
>Index: sys/dev/wpi/if_wpi.c >=================================================================== >--- sys/dev/wpi/if_wpi.c (revision 279775) >+++ sys/dev/wpi/if_wpi.c (working copy) >@@ -200,6 +200,7 @@ > static void wpi_start(struct ifnet *); > static void wpi_start_task(void *, int); > static void wpi_watchdog_rfkill(void *); >+static void wpi_scan_timeout(void *); > static void wpi_watchdog(void *); > static int wpi_ioctl(struct ifnet *, u_long, caddr_t); > static int wpi_cmd(struct wpi_softc *, int, const void *, size_t, int); >@@ -520,6 +521,7 @@ > wpi_radiotap_attach(sc); > > callout_init_mtx(&sc->calib_to, &sc->sc_mtx, 0); >+ callout_init_mtx(&sc->scan_timeout, &sc->sc_mtx, 0); > callout_init_mtx(&sc->watchdog_to, &sc->sc_mtx, 0); > callout_init_mtx(&sc->watchdog_rfkill, &sc->sc_mtx, 0); > TASK_INIT(&sc->sc_reinittask, 0, wpi_hw_reset, sc); >@@ -683,8 +685,9 @@ > > wpi_stop(sc); > >+ callout_drain(&sc->watchdog_rfkill); > callout_drain(&sc->watchdog_to); >- callout_drain(&sc->watchdog_rfkill); >+ callout_drain(&sc->scan_timeout); > callout_drain(&sc->calib_to); > ieee80211_ifdetach(ic); > } >@@ -2163,7 +2166,7 @@ > "scan finished nchan=%d status=%d chan=%d\n", > scan->nchan, scan->status, scan->chan); > #endif >- sc->sc_scan_timer = 0; >+ callout_stop(&sc->scan_timeout); > WPI_UNLOCK(sc); > ieee80211_scan_next(vap); > WPI_LOCK(sc); >@@ -2925,6 +2928,17 @@ > ieee80211_runtask(ic, &sc->sc_radioon_task); > } > >+static void >+wpi_scan_timeout(void *arg) >+{ >+ struct wpi_softc *sc = arg; >+ struct ifnet *ifp = sc->sc_ifp; >+ struct ieee80211com *ic = ifp->if_l2com; >+ >+ if_printf(ifp, "scan timeout\n"); >+ ieee80211_runtask(ic, &sc->sc_reinittask); >+} >+ > /** > * Called every second, wpi_watchdog used by the watch dog timer > * to check that the card is still alive >@@ -2946,15 +2960,6 @@ > } > } > >- if (sc->sc_scan_timer > 0) { >- struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); >- if (--sc->sc_scan_timer == 0 && vap != NULL) { >- if_printf(ifp, "scan timeout\n"); >- ieee80211_cancel_scan(vap); >- ieee80211_runtask(ic, &sc->sc_reinittask); >- } >- } >- > if (ifp->if_drv_flags & IFF_DRV_RUNNING) > callout_reset(&sc->watchdog_to, hz, wpi_watchdog, sc); > } >@@ -3873,7 +3878,7 @@ > * We are absolutely not allowed to send a scan command when another > * scan command is pending. > */ >- if (sc->sc_scan_timer) { >+ if (callout_pending(&sc->scan_timeout)) { > device_printf(sc->sc_dev, "%s: called whilst scanning!\n", > __func__); > >@@ -4016,7 +4021,7 @@ > if (error != 0) > goto fail; > >- sc->sc_scan_timer = 5; >+ callout_reset(&sc->scan_timeout, 5*hz, wpi_scan_timeout, sc); > > DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); > >@@ -5270,9 +5275,9 @@ > sc->txq_active = 0; > WPI_TXQ_UNLOCK(sc); > >- sc->sc_scan_timer = 0; > sc->sc_tx_timer = 0; > callout_stop(&sc->watchdog_to); >+ callout_stop(&sc->scan_timeout); > callout_stop(&sc->calib_to); > > IF_LOCK(&ifp->if_snd); >@@ -5404,6 +5409,9 @@ > > DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_DOING, __func__); > >+ if (vap != NULL && (ic->ic_flags & IEEE80211_F_SCAN)) >+ ieee80211_cancel_scan(vap); >+ > wpi_stop(sc); > if (vap != NULL) > ieee80211_stop(vap); >Index: sys/dev/wpi/if_wpivar.h >=================================================================== >--- sys/dev/wpi/if_wpivar.h (revision 279775) >+++ sys/dev/wpi/if_wpivar.h (working copy) >@@ -180,6 +180,8 @@ > struct callout calib_to; > int calib_cnt; > >+ struct callout scan_timeout; >+ > /* Watch dog timers. */ > struct callout watchdog_to; > struct callout watchdog_rfkill; >@@ -204,7 +206,6 @@ > struct mtx nt_mtx; > > int sc_tx_timer; >- int sc_scan_timer; > > void (*sc_node_free)(struct ieee80211_node *); > void (*sc_scan_curchan)(struct ieee80211_scan_state *,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 197143
:
152282
|
152662
|
152977
|
153911
|
153977
|
153983
|
153985
|
153999
|
154000
|
154002
|
154006
|
154007
|
154009
|
154010
|
154011
|
154013
|
154015
|
154016
|
154017
|
154019
|
154020
|
154021
|
154022
|
154024
|
154026
|
154030
|
154032
|
154033
|
154328
|
154329
|
154330
|
154332
|
154334
|
154335
|
154336
|
154337
|
154338
|
154340
|
154341
|
154343
|
154346
|
154347
|
154348
|
154349
|
154350
|
154351
|
154352
|
154353
|
154354
|
154355
|
154356
|
154357
|
154358
|
154359
|
154360
|
154361
|
154362
|
154363
|
154364
|
154365
|
154366
|
154368
| 154369 |
154370
|
154371
|
154372
|
154373
|
154374
|
154375
|
154378
|
154379
|
154380
|
154381
|
154382
|
154383
|
154384
|
155332
|
155333
|
156164
|
156165
|
156166
|
156167
|
156168
|
156169
|
156170
|
156171
|
156172
|
156173
|
156174
|
156175
|
156176
|
156177
|
156178
|
156179
|
156180
|
156181
|
156182
|
156183
|
156184
|
156185
|
156186
|
156187
|
156188
|
156189
|
156190
|
156191
|
156192
|
156193
|
156194
|
156195