Permalink
Browse files

wlcore: support short and long interval in sched scan (INTERNAL)

Configure sched scan in FW to use a short interval
for the first X cycles and the switch to a longer interval.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
  • Loading branch information...
1 parent 59bfc5a commit 730245c9ad92c13a26b994b814749c11dbeb8bd8 @eyalsh eyalsh committed with ariknem Jan 18, 2012
@@ -5274,6 +5274,7 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP) |
BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO);
+ wl->hw->wiphy->features |= NL80211_FEATURE_SCHED_SCAN_INTERVALS;
wl->hw->wiphy->max_scan_ssids = 1;
wl->hw->wiphy->max_sched_scan_ssids = 16;
wl->hw->wiphy->max_match_sets = 16;
@@ -704,6 +704,13 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
wl1271_debug(DEBUG_CMD, "cmd sched_scan scan config");
+ if (req->n_short_intervals > SCAN_MAX_SHORT_INTERVALS) {
+ wl1271_warning("Number of short intervals requested (%d)"
+ "exceeds limit (%d)", req->n_short_intervals,
+ SCAN_MAX_SHORT_INTERVALS);
+ return -EINVAL;
+ }
+
cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
if (!cfg)
return -ENOMEM;
@@ -721,9 +728,13 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
cfg->tag = WL1271_SCAN_DEFAULT_TAG;
/* don't filter on BSS type */
cfg->bss_type = SCAN_BSS_TYPE_ANY;
- /* currently NL80211 supports only a single interval */
- for (i = 0; i < SCAN_MAX_CYCLE_INTERVALS; i++)
- cfg->intervals[i] = cpu_to_le32(req->long_interval);
+
+ for (i = 1; i < SCAN_MAX_CYCLE_INTERVALS; i++) {
+ if (i <= req->n_short_intervals)
+ cfg->intervals[i] = cpu_to_le32(req->short_interval);
+ else
+ cfg->intervals[i] = cpu_to_le32(req->long_interval);
+ }
cfg->ssid_len = 0;
ret = wl12xx_scan_sched_scan_ssid_list(wl, wlvif, req);
@@ -127,6 +127,12 @@ struct wl1271_cmd_trigger_scan_to {
#define MAX_CHANNELS_4GHZ 4
#define SCAN_MAX_CYCLE_INTERVALS 16
+
+/* The FW intervals can take up to 16 entries.
+ * The 1st entry isn't used (scan is immediate). The last
+ * entry should be used for the long_interval
+ */
+#define SCAN_MAX_SHORT_INTERVALS (SCAN_MAX_CYCLE_INTERVALS - 2)
#define SCAN_MAX_BANDS 3
enum {

0 comments on commit 730245c

Please sign in to comment.