wl1251: only call ieee80211_beacon_loss in managed mode
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 4 Aug 2012 23:51:18 +0000 (02:51 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Mon, 6 Aug 2012 22:13:21 +0000 (01:13 +0300)
commit0c8317659cf5482682be922686cab9673fa5b04a
treed50185d72b8ef2691c307adcae2756bb3a0d199f
parent4fd4d7697482cf40daf1729ead827fdd8474deb4
wl1251: only call ieee80211_beacon_loss in managed mode

It seems the firmware can send SYNCHRONIZATION_TIMEOUT_EVENT at any
time, while ieee80211_beacon_loss() can only be called in managed
mode, so we need to do appropriate checks. Otherwise BUG() can be
seen triggered while attempting to set up adhoc mode:

kernel BUG at kernel/workqueue.c:1040!
...
[<c0049e90>] (__queue_work+0x17c/0x238) from [<c0049f98>] (queue_work_on+0x2c/0x34)
[<c0049f98>] (queue_work_on+0x2c/0x34) from [<bf2098b4>] (wl1251_event_handle+0xb8/0x158 [wl1251])
[<bf2098b4>] (wl1251_event_handle+0xb8/0x158 [wl1251]) from [<bf2095a4>] (wl1251_irq_work+0x128/0x188 [wl1251])
[<bf2095a4>] (wl1251_irq_work+0x128/0x188 [wl1251]) from [<c004a2d0>] (process_one_work+0x1e0/0x30c)
...

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
drivers/net/wireless/wl1251/event.c