/*
* The lock only protects the list, hash, timer and counter
* against manipulation, reads are done in RCU. Additionally,
- * the lock protects each BSS's TIM bitmap, a few items in
- * STA info structures and various key pointers.
+ * the lock protects each BSS's TIM bitmap.
*/
spinlock_t sta_lock;
unsigned long num_sta;
struct list_head interfaces;
+ /*
+ * Key lock, protects sdata's key_list and sta_info's
+ * key pointers (write access, they're RCU.)
+ */
+ spinlock_t key_lock;
+
+
bool sta_sw_scanning;
bool sta_hw_scanning;
int scan_channel_idx;
{
unsigned long flags;
- spin_lock_irqsave(&sdata->local->sta_lock, flags);
+ spin_lock_irqsave(&sdata->local->key_lock, flags);
__ieee80211_set_default_key(sdata, idx);
- spin_unlock_irqrestore(&sdata->local->sta_lock, flags);
+ spin_unlock_irqrestore(&sdata->local->key_lock, flags);
}
}
}
- spin_lock_irqsave(&sdata->local->sta_lock, flags);
+ spin_lock_irqsave(&sdata->local->key_lock, flags);
if (sta)
old_key = sta->key;
__ieee80211_key_replace(sdata, sta, old_key, key);
- spin_unlock_irqrestore(&sdata->local->sta_lock, flags);
+ spin_unlock_irqrestore(&sdata->local->key_lock, flags);
/* free old key later */
add_todo(old_key, KEY_FLAG_TODO_DELETE);
if (!key)
return;
- spin_lock_irqsave(&key->sdata->local->sta_lock, flags);
+ spin_lock_irqsave(&key->sdata->local->key_lock, flags);
__ieee80211_key_free(key);
- spin_unlock_irqrestore(&key->sdata->local->sta_lock, flags);
+ spin_unlock_irqrestore(&key->sdata->local->key_lock, flags);
}
/*
might_sleep();
- spin_lock_irqsave(&sdata->local->sta_lock, flags);
+ spin_lock_irqsave(&sdata->local->key_lock, flags);
list_for_each_entry(key, &sdata->key_list, list)
add_todo(key, todo_flags);
- spin_unlock_irqrestore(&sdata->local->sta_lock, flags);
+ spin_unlock_irqrestore(&sdata->local->key_lock, flags);
ieee80211_key_todo();
}
ieee80211_debugfs_key_remove_default(sdata);
- spin_lock_irqsave(&sdata->local->sta_lock, flags);
+ spin_lock_irqsave(&sdata->local->key_lock, flags);
list_for_each_entry_safe(key, tmp, &sdata->key_list, list)
__ieee80211_key_free(key);
- spin_unlock_irqrestore(&sdata->local->sta_lock, flags);
+ spin_unlock_irqrestore(&sdata->local->key_lock, flags);
__ieee80211_key_todo();