diff options
author | Luciano Coelho <coelho@ti.com> | 2011-05-12 10:07:55 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-05-12 17:06:33 -0400 |
commit | 683c002447c12742f5151691083f68524f33b13a (patch) | |
tree | 39e31fd84fbfd7d41af7358f817d376fa4149545 /drivers | |
parent | d3eff81de6048d8af8f95f52f0f06625980f2efb (diff) |
wl12xx: prevent sched_scan when not idle or not in station mode
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | 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 668ff46a6824..f37e5a391976 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) | |||
505 | 505 | ||
506 | wl1271_debug(DEBUG_CMD, "cmd periodic scan start"); | 506 | wl1271_debug(DEBUG_CMD, "cmd periodic scan start"); |
507 | 507 | ||
508 | if (wl->bss_type != BSS_TYPE_STA_BSS) | ||
509 | return -EOPNOTSUPP; | ||
510 | |||
511 | if (!test_bit(WL1271_FLAG_IDLE, &wl->flags)) | ||
512 | return -EBUSY; | ||
513 | |||
508 | start = kzalloc(sizeof(*start), GFP_KERNEL); | 514 | start = kzalloc(sizeof(*start), GFP_KERNEL); |
509 | if (!start) | 515 | if (!start) |
510 | return -ENOMEM; | 516 | return -ENOMEM; |