Skip to content

Commit

Permalink
wlcore: support short and long interval in sched scan (INTERNAL)
Browse files Browse the repository at this point in the history
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
Eyal Shapira authored and ariknem committed Nov 30, 2012
1 parent 45fa619 commit 6921bde
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/wireless/ti/wlcore/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3551,6 +3551,13 @@ static int wl1271_op_sched_scan_start(struct ieee80211_hw *hw,

wl1271_debug(DEBUG_MAC80211, "wl1271_op_sched_scan_start");

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;
}

mutex_lock(&wl->mutex);

if (unlikely(wl->state != WLCORE_STATE_ON)) {
Expand Down Expand Up @@ -5717,6 +5724,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;
Expand Down
6 changes: 6 additions & 0 deletions drivers/net/wireless/ti/wlcore/scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ struct wl1271_cmd_trigger_scan_to {
#define MAX_CHANNELS_5GHZ 42

#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 {
Expand Down

0 comments on commit 6921bde

Please sign in to comment.