FreeBSD Bugzilla – Attachment 154372 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]
Turn sc_tx_timer into callout parameter
patch-wpi60.diff (text/plain), 3.82 KB, created by
Andriy Voskoboinyk
on 2015-03-15 14:03:19 UTC
(
hide
)
Description:
Turn sc_tx_timer into callout parameter
Filename:
MIME Type:
Creator:
Andriy Voskoboinyk
Created:
2015-03-15 14:03:19 UTC
Size:
3.82 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) >@@ -201,7 +201,7 @@ > 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 void wpi_tx_timeout(void *); > static int wpi_ioctl(struct ifnet *, u_long, caddr_t); > static int wpi_cmd(struct wpi_softc *, int, const void *, size_t, int); > static int wpi_mrr_setup(struct wpi_softc *); >@@ -523,7 +523,7 @@ > > callout_init_mtx(&sc->calib_to, &sc->rxon_mtx, 0); > callout_init_mtx(&sc->scan_timeout, &sc->rxon_mtx, 0); >- callout_init_mtx(&sc->watchdog_to, &sc->sc_mtx, 0); >+ callout_init_mtx(&sc->tx_timeout, &sc->sc_mtx, 0); > callout_init_mtx(&sc->watchdog_rfkill, &sc->sc_mtx, 0); > TASK_INIT(&sc->sc_reinittask, 0, wpi_hw_reset, sc); > TASK_INIT(&sc->sc_radiooff_task, 0, wpi_radio_off, sc); >@@ -687,7 +687,7 @@ > wpi_stop(sc); > > callout_drain(&sc->watchdog_rfkill); >- callout_drain(&sc->watchdog_to); >+ callout_drain(&sc->tx_timeout); > callout_drain(&sc->scan_timeout); > callout_drain(&sc->calib_to); > ieee80211_ifdetach(ic); >@@ -1970,8 +1970,13 @@ > ieee80211_tx_complete(ni, m, (status & 0xff) != 1); > WPI_LOCK(sc); > >- sc->sc_tx_timer = 0; >- if (--ring->queued < WPI_TX_RING_LOMARK) { >+ ring->queued -= 1; >+ if (ring->queued > 0) >+ callout_reset(&sc->tx_timeout, 5*hz, wpi_tx_timeout, sc); >+ else >+ callout_stop(&sc->tx_timeout); >+ >+ if (ring->queued < WPI_TX_RING_LOMARK) { > sc->qfullmsk &= ~(1 << ring->qid); > IF_LOCK(&ifp->if_snd); > if (sc->qfullmsk == 0 && >@@ -2520,7 +2525,7 @@ > if (++ring->queued > WPI_TX_RING_HIMARK) > sc->qfullmsk |= 1 << ring->qid; > >- sc->sc_tx_timer = 5; >+ callout_reset(&sc->tx_timeout, 5*hz, wpi_tx_timeout, sc); > } > > DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); >@@ -2940,29 +2945,16 @@ > 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 >- */ > static void >-wpi_watchdog(void *arg) >+wpi_tx_timeout(void *arg) > { > struct wpi_softc *sc = arg; > struct ifnet *ifp = sc->sc_ifp; > struct ieee80211com *ic = ifp->if_l2com; > >- DPRINTF(sc, WPI_DEBUG_WATCHDOG, "Watchdog: tick\n"); >- >- if (sc->sc_tx_timer > 0) { >- if (--sc->sc_tx_timer == 0) { >- if_printf(ifp, "device timeout\n"); >- if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); >- ieee80211_runtask(ic, &sc->sc_reinittask); >- } >- } >- >- if (ifp->if_drv_flags & IFF_DRV_RUNNING) >- callout_reset(&sc->watchdog_to, hz, wpi_watchdog, sc); >+ if_printf(ifp, "device timeout\n"); >+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); >+ ieee80211_runtask(ic, &sc->sc_reinittask); > } > > static int >@@ -5260,8 +5252,6 @@ > ifp->if_drv_flags |= IFF_DRV_RUNNING; > IF_UNLOCK(&ifp->if_snd); > >- callout_reset(&sc->watchdog_to, hz, wpi_watchdog, sc); >- > DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); > > WPI_UNLOCK(sc); >@@ -5286,8 +5276,7 @@ > sc->txq_active = 0; > WPI_TXQ_UNLOCK(sc); > >- sc->sc_tx_timer = 0; >- callout_stop(&sc->watchdog_to); >+ callout_stop(&sc->tx_timeout); > > WPI_RXON_LOCK(sc); > callout_stop(&sc->scan_timeout); >Index: sys/dev/wpi/if_wpivar.h >=================================================================== >--- sys/dev/wpi/if_wpivar.h (revision 279775) >+++ sys/dev/wpi/if_wpivar.h (working copy) >@@ -181,9 +181,9 @@ > int calib_cnt; > > struct callout scan_timeout; >+ struct callout tx_timeout; > >- /* Watch dog timers. */ >- struct callout watchdog_to; >+ /* Watch dog timer. */ > struct callout watchdog_rfkill; > > /* Firmware image. */ >@@ -207,8 +207,6 @@ > uint32_t nodesmsk; > struct mtx nt_mtx; > >- int sc_tx_timer; >- > void (*sc_node_free)(struct ieee80211_node *); > void (*sc_scan_curchan)(struct ieee80211_scan_state *, > unsigned long);
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