spinlock semaphore question 2.6.32 mac80211
I am trying to cut in a function in the mac80211 layer in the 2.6.32 kernel and am stuck I was hoping someone can help.
The issue is that I need to call msleep() or schedule() or down() inside multiple layers of existing spinlock and rcu_lock critical sections, when I attempt this I get the "scheduling while atomic" or "scheduling from idle thread" error.
This is using 2.6.32 non-SMP. I have tried both preempt and not preempt as kernel options.
I have read around that if you are non-SMP the spin locks shouldn't do anything and I found an option to let the RCU's be preemptable.
Is there an obvious way to tackle this problem?
I am trying to cut in this fcn :
void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch,
u8 *data, size_t data_len,
u8 *cdata, u8 *mic)
with a blocking version, without rewriting the kernel
Any help or 411 on spinlocks,interrupts and rcu_locks in the networking layer will help a ton