Skip to content

Commit

Permalink
wl12xx: prevent sched_scan when not idle or not in station mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Luciano Coelho committed May 12, 2011
1 parent d3eff81 commit 683c002
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/wireless/wl12xx/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 683c002

Please sign in to comment.