FreeBSD Bugzilla – Attachment 156176 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]
Fix pause scan time calculation (the remainder must be less than beacon interval)
patch-wpi85.diff (text/plain), 2.17 KB, created by
Andriy Voskoboinyk
on 2015-04-30 21:14:18 UTC
(
hide
)
Description:
Fix pause scan time calculation (the remainder must be less than beacon interval)
Filename:
MIME Type:
Creator:
Andriy Voskoboinyk
Created:
2015-04-30 21:14:18 UTC
Size:
2.17 KB
patch
obsolete
>Index: sys/dev/wpi/if_wpi.c >=================================================================== >--- sys/dev/wpi/if_wpi.c (revision 281839) >+++ sys/dev/wpi/if_wpi.c (working copy) >@@ -228,6 +228,7 @@ > static uint16_t wpi_limit_dwell(struct wpi_softc *, uint16_t); > static uint16_t wpi_get_passive_dwell_time(struct wpi_softc *, > struct ieee80211_channel *); >+static uint32_t wpi_get_scan_pause_time(uint32_t, uint16_t); > static int wpi_scan(struct wpi_softc *, struct ieee80211_channel *); > static int wpi_auth(struct wpi_softc *, struct ieee80211vap *); > static int wpi_config_beacon(struct wpi_vap *); >@@ -3864,6 +3865,18 @@ > return (wpi_limit_dwell(sc, passive)); > } > >+static uint32_t >+wpi_get_scan_pause_time(uint32_t time, uint16_t bintval) >+{ >+ uint32_t mod = (time % bintval) * IEEE80211_DUR_TU; >+ uint32_t nbeacons = time / bintval; >+ >+ if (mod > WPI_PAUSE_MAX_TIME) >+ mod = WPI_PAUSE_MAX_TIME; >+ >+ return WPI_PAUSE_SCAN(nbeacons, mod); >+} >+ > /* > * Send a scan request to the firmware. > */ >@@ -3921,13 +3934,17 @@ > */ > hdr->quiet_time = htole16(WPI_QUIET_TIME_DEFAULT); > hdr->quiet_threshold = htole16(1); >- /* >- * Max needs to be greater than active and passive and quiet! >- * It's also in microseconds! >- */ >- hdr->max_svc = htole32(250 * IEEE80211_DUR_TU); >- hdr->pause_svc = htole32((4 << 24) | >- (100 * IEEE80211_DUR_TU)); /* Hardcode for now */ >+ >+ if (bgscan != 0) { >+ /* >+ * Max needs to be greater than active and passive and quiet! >+ * It's also in microseconds! >+ */ >+ hdr->max_svc = htole32(250 * IEEE80211_DUR_TU); >+ hdr->pause_svc = htole32(wpi_get_scan_pause_time(100, >+ bintval)); >+ } >+ > hdr->filter = htole32(WPI_FILTER_MULTICAST | WPI_FILTER_BEACON); > > tx = (struct wpi_cmd_data *)(hdr + 1); >Index: sys/dev/wpi/if_wpireg.h >=================================================================== >--- sys/dev/wpi/if_wpireg.h (revision 281839) >+++ sys/dev/wpi/if_wpireg.h (working copy) >@@ -619,6 +619,9 @@ > uint16_t reserved2; > uint32_t max_svc; /* background scans */ > uint32_t pause_svc; /* background scans */ >+#define WPI_PAUSE_MAX_TIME ((1 << 20) - 1) >+#define WPI_PAUSE_SCAN(nbeacons, time) ((nbeacons << 24) | time) >+ > uint32_t flags; > uint32_t filter; >
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