View | Details | Raw Unified | Return to bug 197143 | Differences between
and this patch

Collapse All | Expand All

(-)sys/dev/wpi/if_wpi.c (-7 / +24 lines)
Lines 228-233 Link Here
228
static uint16_t	wpi_limit_dwell(struct wpi_softc *, uint16_t);
228
static uint16_t	wpi_limit_dwell(struct wpi_softc *, uint16_t);
229
static uint16_t	wpi_get_passive_dwell_time(struct wpi_softc *,
229
static uint16_t	wpi_get_passive_dwell_time(struct wpi_softc *,
230
		    struct ieee80211_channel *);
230
		    struct ieee80211_channel *);
231
static uint32_t	wpi_get_scan_pause_time(uint32_t, uint16_t);
231
static int	wpi_scan(struct wpi_softc *, struct ieee80211_channel *);
232
static int	wpi_scan(struct wpi_softc *, struct ieee80211_channel *);
232
static int	wpi_auth(struct wpi_softc *, struct ieee80211vap *);
233
static int	wpi_auth(struct wpi_softc *, struct ieee80211vap *);
233
static int	wpi_config_beacon(struct wpi_vap *);
234
static int	wpi_config_beacon(struct wpi_vap *);
Lines 3864-3869 Link Here
3864
	return (wpi_limit_dwell(sc, passive));
3865
	return (wpi_limit_dwell(sc, passive));
3865
}
3866
}
3866
3867
3868
static uint32_t
3869
wpi_get_scan_pause_time(uint32_t time, uint16_t bintval)
3870
{
3871
	uint32_t mod = (time % bintval) * IEEE80211_DUR_TU;
3872
	uint32_t nbeacons = time / bintval;
3873
3874
	if (mod > WPI_PAUSE_MAX_TIME)
3875
		mod = WPI_PAUSE_MAX_TIME;
3876
3877
	return WPI_PAUSE_SCAN(nbeacons, mod);
3878
}
3879
3867
/*
3880
/*
3868
 * Send a scan request to the firmware.
3881
 * Send a scan request to the firmware.
3869
 */
3882
 */
Lines 3921-3933 Link Here
3921
	 */
3934
	 */
3922
	hdr->quiet_time = htole16(WPI_QUIET_TIME_DEFAULT);
3935
	hdr->quiet_time = htole16(WPI_QUIET_TIME_DEFAULT);
3923
	hdr->quiet_threshold = htole16(1);
3936
	hdr->quiet_threshold = htole16(1);
3924
	/*
3937
3925
	 * Max needs to be greater than active and passive and quiet!
3938
	if (bgscan != 0) {
3926
	 * It's also in microseconds!
3939
		/*
3927
	 */
3940
		 * Max needs to be greater than active and passive and quiet!
3928
	hdr->max_svc = htole32(250 * IEEE80211_DUR_TU);
3941
		 * It's also in microseconds!
3929
	hdr->pause_svc = htole32((4 << 24) |
3942
		 */
3930
	    (100 * IEEE80211_DUR_TU));	/* Hardcode for now */
3943
		hdr->max_svc = htole32(250 * IEEE80211_DUR_TU);
3944
		hdr->pause_svc = htole32(wpi_get_scan_pause_time(100,
3945
		    bintval));
3946
	}
3947
3931
	hdr->filter = htole32(WPI_FILTER_MULTICAST | WPI_FILTER_BEACON);
3948
	hdr->filter = htole32(WPI_FILTER_MULTICAST | WPI_FILTER_BEACON);
3932
3949
3933
	tx = (struct wpi_cmd_data *)(hdr + 1);
3950
	tx = (struct wpi_cmd_data *)(hdr + 1);
(-)sys/dev/wpi/if_wpireg.h (+3 lines)
Lines 619-624 Link Here
619
	uint16_t	reserved2;
619
	uint16_t	reserved2;
620
	uint32_t	max_svc;	/* background scans */
620
	uint32_t	max_svc;	/* background scans */
621
	uint32_t	pause_svc;	/* background scans */
621
	uint32_t	pause_svc;	/* background scans */
622
#define WPI_PAUSE_MAX_TIME		((1 << 20) - 1)
623
#define WPI_PAUSE_SCAN(nbeacons, time)	((nbeacons << 24) | time)
624
622
	uint32_t	flags;
625
	uint32_t	flags;
623
	uint32_t	filter;
626
	uint32_t	filter;
624
627

Return to bug 197143