diff options
author | Eliad Peller <eliad@wizery.com> | 2012-02-02 10:44:55 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-06 14:55:51 -0500 |
commit | 885bd8eca6ac172e299750d99bd5c9fddbed89b9 (patch) | |
tree | 7ce2265d4738f6ea1f40f13d86d96c150bef73cf | |
parent | 3dc5e1751803e812806d7aa46150af92f91ef489 (diff) |
mac80211: support hw scan while idle
Currently, mac80211 goes to idle-off before starting a scan.
However, some devices that implement hw scan might not
need going idle-off in order to perform a hw scan, and
thus saving some energy and simplifying their state machine.
(Note that this is also the case for sched scan - it
currently doesn't make mac80211 go idle-off)
Add a new flag to indicate support for hw scan while idle.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | include/net/mac80211.h | 5 | ||||
-rw-r--r-- | net/mac80211/debugfs.c | 2 | ||||
-rw-r--r-- | net/mac80211/iface.c | 3 | ||||
-rw-r--r-- | net/mac80211/main.c | 3 |
4 files changed, 12 insertions, 1 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 922313f0b39b..cbff4f94a200 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -1164,6 +1164,10 @@ enum sta_notify_cmd { | |||
1164 | * @IEEE80211_HW_TX_AMPDU_SETUP_IN_HW: The device handles TX A-MPDU session | 1164 | * @IEEE80211_HW_TX_AMPDU_SETUP_IN_HW: The device handles TX A-MPDU session |
1165 | * setup strictly in HW. mac80211 should not attempt to do this in | 1165 | * setup strictly in HW. mac80211 should not attempt to do this in |
1166 | * software. | 1166 | * software. |
1167 | * | ||
1168 | * @IEEE80211_HW_SCAN_WHILE_IDLE: The device can do hw scan while | ||
1169 | * being idle (i.e. mac80211 doesn't have to go idle-off during the | ||
1170 | * the scan). | ||
1167 | */ | 1171 | */ |
1168 | enum ieee80211_hw_flags { | 1172 | enum ieee80211_hw_flags { |
1169 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | 1173 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, |
@@ -1190,6 +1194,7 @@ enum ieee80211_hw_flags { | |||
1190 | IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, | 1194 | IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, |
1191 | IEEE80211_HW_AP_LINK_PS = 1<<22, | 1195 | IEEE80211_HW_AP_LINK_PS = 1<<22, |
1192 | IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, | 1196 | IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, |
1197 | IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24, | ||
1193 | }; | 1198 | }; |
1194 | 1199 | ||
1195 | /** | 1200 | /** |
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c index affe64be9092..483e96ed95c1 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c | |||
@@ -263,6 +263,8 @@ static ssize_t hwflags_read(struct file *file, char __user *user_buf, | |||
263 | sf += snprintf(buf + sf, mxln - sf, "AP_LINK_PS\n"); | 263 | sf += snprintf(buf + sf, mxln - sf, "AP_LINK_PS\n"); |
264 | if (local->hw.flags & IEEE80211_HW_TX_AMPDU_SETUP_IN_HW) | 264 | if (local->hw.flags & IEEE80211_HW_TX_AMPDU_SETUP_IN_HW) |
265 | sf += snprintf(buf + sf, mxln - sf, "TX_AMPDU_SETUP_IN_HW\n"); | 265 | sf += snprintf(buf + sf, mxln - sf, "TX_AMPDU_SETUP_IN_HW\n"); |
266 | if (local->hw.flags & IEEE80211_HW_SCAN_WHILE_IDLE) | ||
267 | sf += snprintf(buf + sf, mxln - sf, "SCAN_WHILE_IDLE\n"); | ||
266 | 268 | ||
267 | rv = simple_read_from_buffer(user_buf, count, ppos, buf, strlen(buf)); | 269 | rv = simple_read_from_buffer(user_buf, count, ppos, buf, strlen(buf)); |
268 | kfree(buf); | 270 | kfree(buf); |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 19f0818eba78..6b3cd65d1e07 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -1332,7 +1332,8 @@ u32 __ieee80211_recalc_idle(struct ieee80211_local *local) | |||
1332 | wk->sdata->vif.bss_conf.idle = false; | 1332 | wk->sdata->vif.bss_conf.idle = false; |
1333 | } | 1333 | } |
1334 | 1334 | ||
1335 | if (local->scan_sdata) { | 1335 | if (local->scan_sdata && |
1336 | !(local->hw.flags & IEEE80211_HW_SCAN_WHILE_IDLE)) { | ||
1336 | scanning = true; | 1337 | scanning = true; |
1337 | local->scan_sdata->vif.bss_conf.idle = false; | 1338 | local->scan_sdata->vif.bss_conf.idle = false; |
1338 | } | 1339 | } |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 362e89d6d467..831a5bd44fd0 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -697,6 +697,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
697 | ) | 697 | ) |
698 | return -EINVAL; | 698 | return -EINVAL; |
699 | 699 | ||
700 | if ((hw->flags & IEEE80211_HW_SCAN_WHILE_IDLE) && !local->ops->hw_scan) | ||
701 | return -EINVAL; | ||
702 | |||
700 | if (hw->max_report_rates == 0) | 703 | if (hw->max_report_rates == 0) |
701 | hw->max_report_rates = hw->max_rates; | 704 | hw->max_report_rates = hw->max_rates; |
702 | 705 | ||