It is checked in add_interface, but there it is easily replaced with
a check of priv->vif.  If that information should become necessary,
it is available in vif->type anyway.
It is also checked in led_turn_on and led_turn_off, where I made the
substitutions as described above.  Of course, these checks seem to
have been incorrect since the driver was using NL80211_IFTYPE_MONITOR
to indicate no interface rather than NL80211_IFTYPE_UNSPECIFIED.
Anyway, I think these checks may be extraneous...?
Signed-off-by: John W. Linville <linville@tuxdriver.com>
        struct rtl818x_csr *map;
        const struct rtl818x_rf_ops *rf;
        struct ieee80211_vif *vif;
-       int mode;
+
        /* The mutex protects the TX loopback state.
         * Any attempt to set channels concurrently locks the device.
         */
 
        int ret = -EOPNOTSUPP;
 
        mutex_lock(&priv->conf_mutex);
-       if (priv->mode != NL80211_IFTYPE_MONITOR)
+       if (priv->vif)
                goto exit;
 
        switch (conf->type) {
        case NL80211_IFTYPE_STATION:
-               priv->mode = conf->type;
                break;
        default:
                goto exit;
 {
        struct rtl8187_priv *priv = dev->priv;
        mutex_lock(&priv->conf_mutex);
-       priv->mode = NL80211_IFTYPE_MONITOR;
        priv->vif = NULL;
        mutex_unlock(&priv->conf_mutex);
 }
        dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band;
 
 
-       priv->mode = NL80211_IFTYPE_MONITOR;
        dev->flags = IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
                     IEEE80211_HW_SIGNAL_DBM |
                     IEEE80211_HW_RX_INCLUDES_FCS;
 
        struct rtl8187_led *led = &priv->led_tx;
 
        /* Don't change the LED, when the device is down. */
-       if (priv->mode == NL80211_IFTYPE_UNSPECIFIED)
+       if (!priv->vif || priv->vif->type == NL80211_IFTYPE_UNSPECIFIED)
                return ;
 
        /* Skip if the LED is not registered. */
        struct rtl8187_led *led = &priv->led_tx;
 
        /* Don't change the LED, when the device is down. */
-       if (priv->mode == NL80211_IFTYPE_UNSPECIFIED)
+       if (!priv->vif || priv->vif->type == NL80211_IFTYPE_UNSPECIFIED)
                return ;
 
        /* Skip if the LED is not registered. */