cfg80211: fix scheduled scan pointer access

Since rdev->sched_scan_req is dereferenced outside the
lock protecting it, this might be done at the wrong
time, causing crashes. Move the dereference to where
it should be - inside the RTNL locked section.

Cc: stable@vger.kernel.org [3.8+]
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 79845c662eeb95c9a180b9bd0d3ad848ee65b94c)
Signed-off-by: Paul Stewart <pstew@chromium.org>

Conflicts:
	net/wireless-3.8/scan.c

BUG=chrome-os-partner:28379
TEST=wifi_matfunc autotest suite

Change-Id: I9ab46b84babcd029fb938afdf4b609252c7d96f1
Reviewed-on: https://chromium-review.googlesource.com/199299
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
(cherry picked from commit baf45c66ae35c64ca2211ee788a9e6c435a95d12)
Reviewed-on: https://chromium-review.googlesource.com/199628
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-by: Bowgo Tsai <bowgotsai@chromium.org>
CHERRY-PICK: CHROMIUM: iwl7000: mac80211: fix suspend vs. authentication race

Since Stanislaw's patch removing the quiescing code, mac80211 had
a race regarding suspend vs. authentication: as cfg80211 doesn't
track authentication attempts, it can't abort them. Therefore the
attempts may be kept running while suspending, which can lead to
all kinds of issues, in at least some cases causing an error in
iwlmvm firmware.

Fix this by aborting the authentication attempt when suspending.

(iwlwifi commit a7c16e04bd3f21d7ced589f8faf1d9a78f3f8d2b)

BUG=chrome-os-partner:26697
TEST=didn't reproduce the SYSASSERT but a WARNING in this scenario,
the warning goes away with this patch and so should the SYSASSERT
(hitting the SYSASSERT is only due to races if we're past the WARN
point in the code)

Original-Change-Id: Ide62f42651eaafd7d72feadb41a3dbf63db288ec
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/190988
Reviewed-by: Paul Stewart <pstew@chromium.org>
(cherry picked from commit df749603dd34388d6ea60dc53e93380defbfd593)

Change-Id: I3fbea99d58db44d118ec74ea26aebb3b98fe1baf
Reviewed-on: https://chromium-review.googlesource.com/199655
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
CHERRY-PICK: CHROMIUM: iwl7000: fix suspend vs. association race

If the association is in progress while we suspend, the
stack will be in a messed up state. Clean it before we
suspend.

BUG=chrome-os-partner:28379
TEST=suspend while association is in progress

Change-Id: Ifcd378ff56f22635ecec2bb2795c61c05eed46a2
Original-Change-Id: I4a951a69a3e21ce292226aad0ae12a1052149722
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/199502
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/199656
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>