wlcore: protect wlcore_op_set_key with mutex
authorEliad Peller <eliad@wizery.com>
Mon, 3 Sep 2012 15:27:58 +0000 (18:27 +0300)
committerLuciano Coelho <luca@coelho.fi>
Thu, 27 Sep 2012 09:13:54 +0000 (12:13 +0300)
commitaf390f4dd35373b3ca32bafc12d7f2ad12840529
tree692652e15a9aed463e43f40aa351b4d640789faa
parentab2c4f37dcef5bd517a95a32da50d5ed0cc24cb5
wlcore: protect wlcore_op_set_key with mutex

wlcore_op_set_key() calls wl18xx_set_key(),
which in turn executes some of his function
calls without acquiring wl->mutex and making
sure the fw is awake.

Adding mutex_lock()/ps_elp_wakeup() calls is
not enough, as wl18xx_set_key() calls
wl1271_tx_flush() which can't be called while
the mutex is taken.

Add the required calls to wlcore_op_set_key,
but limit the queues_stop and flushing
to the only encryption types in which
a spare block might be needed (GEM and TKIP).

[Arik - move state != ON check]

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <luca@coelho.fi>
drivers/net/wireless/ti/wl18xx/main.c
drivers/net/wireless/ti/wlcore/main.c