static spinlock_t hwsim_radio_lock;
static struct list_head hwsim_radios;
+static int hwsim_radio_idx;
struct mac80211_hwsim_data {
struct list_head list;
}
};
-static int __init mac80211_hwsim_create_radio(int idx)
+static int __init mac80211_hwsim_create_radio(void)
{
int err;
u8 addr[ETH_ALEN];
struct ieee80211_hw *hw;
enum ieee80211_band band;
const struct ieee80211_ops *ops = &mac80211_hwsim_ops;
+ int idx;
+
+ spin_lock_bh(&hwsim_radio_lock);
+ idx = hwsim_radio_idx++;
+ spin_unlock_bh(&hwsim_radio_lock);
if (channels > 1)
ops = &mac80211_hwsim_mchan_ops;
}
for (i = 0; i < radios; i++) {
- err = mac80211_hwsim_create_radio(i);
+ err = mac80211_hwsim_create_radio();
if (err)
goto out_free_radios;
}