aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl818x
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rtl818x')
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187.h2
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_dev.c5
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_leds.c4
3 files changed, 4 insertions, 7 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8187.h b/drivers/net/wireless/rtl818x/rtl8187.h
index 6af0f3f71f3..6bb32112e65 100644
--- a/drivers/net/wireless/rtl818x/rtl8187.h
+++ b/drivers/net/wireless/rtl818x/rtl8187.h
@@ -92,7 +92,7 @@ struct rtl8187_priv {
92 struct rtl818x_csr *map; 92 struct rtl818x_csr *map;
93 const struct rtl818x_rf_ops *rf; 93 const struct rtl818x_rf_ops *rf;
94 struct ieee80211_vif *vif; 94 struct ieee80211_vif *vif;
95 int mode; 95
96 /* The mutex protects the TX loopback state. 96 /* The mutex protects the TX loopback state.
97 * Any attempt to set channels concurrently locks the device. 97 * Any attempt to set channels concurrently locks the device.
98 */ 98 */
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c
index bc5726dd5fe..1cb0eff4622 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
@@ -1025,12 +1025,11 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev,
1025 int ret = -EOPNOTSUPP; 1025 int ret = -EOPNOTSUPP;
1026 1026
1027 mutex_lock(&priv->conf_mutex); 1027 mutex_lock(&priv->conf_mutex);
1028 if (priv->mode != NL80211_IFTYPE_MONITOR) 1028 if (priv->vif)
1029 goto exit; 1029 goto exit;
1030 1030
1031 switch (conf->type) { 1031 switch (conf->type) {
1032 case NL80211_IFTYPE_STATION: 1032 case NL80211_IFTYPE_STATION:
1033 priv->mode = conf->type;
1034 break; 1033 break;
1035 default: 1034 default:
1036 goto exit; 1035 goto exit;
@@ -1055,7 +1054,6 @@ static void rtl8187_remove_interface(struct ieee80211_hw *dev,
1055{ 1054{
1056 struct rtl8187_priv *priv = dev->priv; 1055 struct rtl8187_priv *priv = dev->priv;
1057 mutex_lock(&priv->conf_mutex); 1056 mutex_lock(&priv->conf_mutex);
1058 priv->mode = NL80211_IFTYPE_MONITOR;
1059 priv->vif = NULL; 1057 priv->vif = NULL;
1060 mutex_unlock(&priv->conf_mutex); 1058 mutex_unlock(&priv->conf_mutex);
1061} 1059}
@@ -1365,7 +1363,6 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
1365 dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band; 1363 dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band;
1366 1364
1367 1365
1368 priv->mode = NL80211_IFTYPE_MONITOR;
1369 dev->flags = IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | 1366 dev->flags = IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
1370 IEEE80211_HW_SIGNAL_DBM | 1367 IEEE80211_HW_SIGNAL_DBM |
1371 IEEE80211_HW_RX_INCLUDES_FCS; 1368 IEEE80211_HW_RX_INCLUDES_FCS;
diff --git a/drivers/net/wireless/rtl818x/rtl8187_leds.c b/drivers/net/wireless/rtl818x/rtl8187_leds.c
index ded44c045eb..f82aa8b4bdd 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_leds.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_leds.c
@@ -33,7 +33,7 @@ static void led_turn_on(struct work_struct *work)
33 struct rtl8187_led *led = &priv->led_tx; 33 struct rtl8187_led *led = &priv->led_tx;
34 34
35 /* Don't change the LED, when the device is down. */ 35 /* Don't change the LED, when the device is down. */
36 if (priv->mode == NL80211_IFTYPE_UNSPECIFIED) 36 if (!priv->vif || priv->vif->type == NL80211_IFTYPE_UNSPECIFIED)
37 return ; 37 return ;
38 38
39 /* Skip if the LED is not registered. */ 39 /* Skip if the LED is not registered. */
@@ -71,7 +71,7 @@ static void led_turn_off(struct work_struct *work)
71 struct rtl8187_led *led = &priv->led_tx; 71 struct rtl8187_led *led = &priv->led_tx;
72 72
73 /* Don't change the LED, when the device is down. */ 73 /* Don't change the LED, when the device is down. */
74 if (priv->mode == NL80211_IFTYPE_UNSPECIFIED) 74 if (!priv->vif || priv->vif->type == NL80211_IFTYPE_UNSPECIFIED)
75 return ; 75 return ;
76 76
77 /* Skip if the LED is not registered. */ 77 /* Skip if the LED is not registered. */