diff options
author | Wei Ni <wni@nvidia.com> | 2012-11-02 13:40:04 +0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 12:42:30 -0700 |
commit | 5839bcf606d928fd080c017a3939abc85adb9ddf (patch) | |
tree | b28bb29ae0cb9bcf78e55f83b542413666b227d4 /net/mac80211 | |
parent | a5d72b0adf7e8aba8a220bf3a5bdf9152f572e5a (diff) |
mac80211&nl80211: support to abort a scan request on tx
mac80211 & nl80211: add support to abort a scan request on tx
The original issue is the chromium issue:
http://code.google.com/p/chromium-os/issues/detail?id=11485
This fix comes from:
https://gerrit.chromium.org/gerrit/#change,5744
https://gerrit.chromium.org/gerrit/#change,5745
Since this change is for ChromeOs and will affect Android P2P function,
so we add config option MAC80211_SCAN_ABORT for it.
Bug 1051830
Change-Id: I77504f4d279f3f3d99b5e5f9d734480888d62193
Signed-off-by: Wei Ni <wni@nvidia.com>
Reviewed-on: http://git-master/r/160777
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Rhyland Klein <rklein@nvidia.com>
Reviewed-by: Bibhay Ranjan <bibhayr@nvidia.com>
Tested-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/Kconfig | 9 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 3 | ||||
-rw-r--r-- | net/mac80211/scan.c | 14 |
3 files changed, 26 insertions, 0 deletions
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index 62535fe9f570..3d533f1a1f27 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig @@ -291,3 +291,12 @@ config MAC80211_DEBUG_COUNTERS and show them in debugfs. If unsure, say N. + +config MAC80211_SCAN_ABORT + bool "Support to abort a scan request on tx" + depends on MAC80211 + depends on WIRELESS + default n + ---help--- + Add support for aborting scan requests. + This is only for ChromeOs, because it will affect Android P2P. diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 9ca8e3278cc0..9f48d84ae633 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -863,6 +863,8 @@ enum { * send out data * @SCAN_RESUME: Resume the scan and scan the next channel * @SCAN_ABORT: Abort the scan and go back to operating channel + * @SCAN_SUSPEND_ABORT: Return to the operating channel then + * terminate the scan operation. */ enum mac80211_scan_state { SCAN_DECISION, @@ -871,6 +873,7 @@ enum mac80211_scan_state { SCAN_SUSPEND, SCAN_RESUME, SCAN_ABORT, + SCAN_SUSPEND_ABORT, }; struct ieee80211_local { diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 99b103921a4b..5d8b2e7b8f9f 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -656,9 +656,20 @@ static void ieee80211_scan_state_suspend(struct ieee80211_local *local, /* disable PS */ ieee80211_offchannel_return(local); +#ifndef CONFIG_MAC80211_SCAN_ABORT *next_delay = HZ / 5; /* afterwards, resume scan & go to next channel */ local->next_scan_state = SCAN_RESUME; +#else + if (local->next_scan_state == SCAN_SUSPEND) { + *next_delay = HZ / 5; + /* afterwards, resume scan & go to next channel */ + local->next_scan_state = SCAN_RESUME; + } else { + *next_delay = 0; + local->next_scan_state = SCAN_ABORT; + } +#endif } static void ieee80211_scan_state_resume(struct ieee80211_local *local, @@ -757,6 +768,9 @@ void ieee80211_scan_work(struct work_struct *work) ieee80211_scan_state_send_probe(local, &next_delay); break; case SCAN_SUSPEND: +#ifdef CONFIG_MAC80211_SCAN_ABORT + case SCAN_SUSPEND_ABORT: +#endif ieee80211_scan_state_suspend(local, &next_delay); break; case SCAN_RESUME: |