From: Luciano Coelho <coelho@ti.com>
To: linux-wireless@vger.kernel.org
Subject: [PATCH 6/7] wl12xx: prevent sched_scan when not idle or not in station mode
Date: Thu, 12 May 2011 17:15:39 +0300 [thread overview]
Message-ID: <1305209740-30287-7-git-send-email-coelho@ti.com> (raw)
In-Reply-To: <1305209740-30287-1-git-send-email-coelho@ti.com>
The current firmware only supports scheduled scan in station mode and
when idle. To prevent the firmware from crashing, return -EOPNOTSUPP
when sched_scan start is called in an invalid state.
Signed-off-by: Luciano Coelho <coelho@ti.com>
---
drivers/net/wireless/wl12xx/scan.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c
index 668ff46..f37e5a3 100644
--- a/drivers/net/wireless/wl12xx/scan.c
+++ b/drivers/net/wireless/wl12xx/scan.c
@@ -505,6 +505,12 @@ int wl1271_scan_sched_scan_start(struct wl1271 *wl)
wl1271_debug(DEBUG_CMD, "cmd periodic scan start");
+ if (wl->bss_type != BSS_TYPE_STA_BSS)
+ return -EOPNOTSUPP;
+
+ if (!test_bit(WL1271_FLAG_IDLE, &wl->flags))
+ return -EBUSY;
+
start = kzalloc(sizeof(*start), GFP_KERNEL);
if (!start)
return -ENOMEM;
--
1.7.1
next prev parent reply other threads:[~2011-05-12 14:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-12 14:15 [PATCH 0/7] wl12xx: scheduled scan implementation Luciano Coelho
2011-05-12 14:15 ` [PATCH 1/7] wl12xx: add configuration values for scheduled scan Luciano Coelho
2011-05-12 14:15 ` [PATCH 2/7] wl12xx: listen to scheduled scan events Luciano Coelho
2011-05-12 14:15 ` [PATCH 3/7] wl12xx: add scheduled scan structures and commands Luciano Coelho
2011-05-12 14:15 ` [PATCH 4/7] wl12xx: implement scheduled scan driver operations and reporting Luciano Coelho
2011-05-12 14:15 ` [PATCH 5/7] wl12xx: export scheduled scan state in debugfs Luciano Coelho
2011-05-12 14:15 ` Luciano Coelho [this message]
2011-05-12 14:15 ` [PATCH 7/7] wl12xx: remove unused flag WL1271_FLAG_IDLE_REQUESTED Luciano Coelho
2011-05-12 21:29 ` [PATCH 0/7] wl12xx: scheduled scan implementation Luciano Coelho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1305209740-30287-7-git-send-email-coelho@ti.com \
--to=coelho@ti.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox