aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1251_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1251_main.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1251_main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c
index d03a07e1be7c..601c43070296 100644
--- a/drivers/net/wireless/wl12xx/wl1251_main.c
+++ b/drivers/net/wireless/wl12xx/wl1251_main.c
@@ -509,6 +509,12 @@ static int wl1251_op_add_interface(struct ieee80211_hw *hw,
509 conf->type, conf->mac_addr); 509 conf->type, conf->mac_addr);
510 510
511 mutex_lock(&wl->mutex); 511 mutex_lock(&wl->mutex);
512 if (wl->vif) {
513 ret = -EBUSY;
514 goto out;
515 }
516
517 wl->vif = conf->vif;
512 518
513 switch (conf->type) { 519 switch (conf->type) {
514 case NL80211_IFTYPE_STATION: 520 case NL80211_IFTYPE_STATION:
@@ -538,7 +544,12 @@ out:
538static void wl1251_op_remove_interface(struct ieee80211_hw *hw, 544static void wl1251_op_remove_interface(struct ieee80211_hw *hw,
539 struct ieee80211_if_init_conf *conf) 545 struct ieee80211_if_init_conf *conf)
540{ 546{
547 struct wl1251 *wl = hw->priv;
548
549 mutex_lock(&wl->mutex);
541 wl1251_debug(DEBUG_MAC80211, "mac80211 remove interface"); 550 wl1251_debug(DEBUG_MAC80211, "mac80211 remove interface");
551 wl->vif = NULL;
552 mutex_unlock(&wl->mutex);
542} 553}
543 554
544static int wl1251_build_null_data(struct wl1251 *wl) 555static int wl1251_build_null_data(struct wl1251 *wl)
@@ -1372,6 +1383,7 @@ struct ieee80211_hw *wl1251_alloc_hw(void)
1372 wl->power_level = WL1251_DEFAULT_POWER_LEVEL; 1383 wl->power_level = WL1251_DEFAULT_POWER_LEVEL;
1373 wl->beacon_int = WL1251_DEFAULT_BEACON_INT; 1384 wl->beacon_int = WL1251_DEFAULT_BEACON_INT;
1374 wl->dtim_period = WL1251_DEFAULT_DTIM_PERIOD; 1385 wl->dtim_period = WL1251_DEFAULT_DTIM_PERIOD;
1386 wl->vif = NULL;
1375 1387
1376 for (i = 0; i < FW_TX_CMPLT_BLOCK_SIZE; i++) 1388 for (i = 0; i < FW_TX_CMPLT_BLOCK_SIZE; i++)
1377 wl->tx_frames[i] = NULL; 1389 wl->tx_frames[i] = NULL;