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>
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;