diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 58 |
1 files changed, 43 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 7040cde8bc28..c1234ff4fc98 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -6144,6 +6144,24 @@ static void iwl3945_bg_rf_kill(struct work_struct *work) | |||
6144 | mutex_unlock(&priv->mutex); | 6144 | mutex_unlock(&priv->mutex); |
6145 | } | 6145 | } |
6146 | 6146 | ||
6147 | static void iwl3945_bg_set_monitor(struct work_struct *work) | ||
6148 | { | ||
6149 | struct iwl3945_priv *priv = container_of(work, | ||
6150 | struct iwl3945_priv, set_monitor); | ||
6151 | |||
6152 | IWL_DEBUG(IWL_DL_STATE, "setting monitor mode\n"); | ||
6153 | |||
6154 | mutex_lock(&priv->mutex); | ||
6155 | |||
6156 | if (!iwl3945_is_ready(priv)) | ||
6157 | IWL_DEBUG(IWL_DL_STATE, "leave - not ready\n"); | ||
6158 | else | ||
6159 | if (iwl3945_set_mode(priv, IEEE80211_IF_TYPE_MNTR) != 0) | ||
6160 | IWL_ERROR("iwl3945_set_mode() failed\n"); | ||
6161 | |||
6162 | mutex_unlock(&priv->mutex); | ||
6163 | } | ||
6164 | |||
6147 | #define IWL_SCAN_CHECK_WATCHDOG (7 * HZ) | 6165 | #define IWL_SCAN_CHECK_WATCHDOG (7 * HZ) |
6148 | 6166 | ||
6149 | static void iwl3945_bg_scan_check(struct work_struct *data) | 6167 | static void iwl3945_bg_scan_check(struct work_struct *data) |
@@ -6996,7 +7014,22 @@ static void iwl3945_configure_filter(struct ieee80211_hw *hw, | |||
6996 | * XXX: dummy | 7014 | * XXX: dummy |
6997 | * see also iwl3945_connection_init_rx_config | 7015 | * see also iwl3945_connection_init_rx_config |
6998 | */ | 7016 | */ |
6999 | *total_flags = 0; | 7017 | struct iwl3945_priv *priv = hw->priv; |
7018 | int new_flags = 0; | ||
7019 | if (changed_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) { | ||
7020 | if (*total_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) { | ||
7021 | IWL_DEBUG_MAC80211("Enter: type %d (0x%x, 0x%x)\n", | ||
7022 | IEEE80211_IF_TYPE_MNTR, | ||
7023 | changed_flags, *total_flags); | ||
7024 | /* queue work 'cuz mac80211 is holding a lock which | ||
7025 | * prevents us from issuing (synchronous) f/w cmds */ | ||
7026 | queue_work(priv->workqueue, &priv->set_monitor); | ||
7027 | new_flags &= FIF_PROMISC_IN_BSS | | ||
7028 | FIF_OTHER_BSS | | ||
7029 | FIF_ALLMULTI; | ||
7030 | } | ||
7031 | } | ||
7032 | *total_flags = new_flags; | ||
7000 | } | 7033 | } |
7001 | 7034 | ||
7002 | static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw, | 7035 | static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw, |
@@ -7054,9 +7087,10 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len) | |||
7054 | rc = -EAGAIN; | 7087 | rc = -EAGAIN; |
7055 | goto out_unlock; | 7088 | goto out_unlock; |
7056 | } | 7089 | } |
7057 | /* if we just finished scan ask for delay */ | 7090 | /* if we just finished scan ask for delay for a broadcast scan */ |
7058 | if (priv->last_scan_jiffies && time_after(priv->last_scan_jiffies + | 7091 | if ((len == 0) && priv->last_scan_jiffies && |
7059 | IWL_DELAY_NEXT_SCAN, jiffies)) { | 7092 | time_after(priv->last_scan_jiffies + IWL_DELAY_NEXT_SCAN, |
7093 | jiffies)) { | ||
7060 | rc = -EAGAIN; | 7094 | rc = -EAGAIN; |
7061 | goto out_unlock; | 7095 | goto out_unlock; |
7062 | } | 7096 | } |
@@ -7872,6 +7906,7 @@ static void iwl3945_setup_deferred_work(struct iwl3945_priv *priv) | |||
7872 | INIT_WORK(&priv->abort_scan, iwl3945_bg_abort_scan); | 7906 | INIT_WORK(&priv->abort_scan, iwl3945_bg_abort_scan); |
7873 | INIT_WORK(&priv->rf_kill, iwl3945_bg_rf_kill); | 7907 | INIT_WORK(&priv->rf_kill, iwl3945_bg_rf_kill); |
7874 | INIT_WORK(&priv->beacon_update, iwl3945_bg_beacon_update); | 7908 | INIT_WORK(&priv->beacon_update, iwl3945_bg_beacon_update); |
7909 | INIT_WORK(&priv->set_monitor, iwl3945_bg_set_monitor); | ||
7875 | INIT_DELAYED_WORK(&priv->post_associate, iwl3945_bg_post_associate); | 7910 | INIT_DELAYED_WORK(&priv->post_associate, iwl3945_bg_post_associate); |
7876 | INIT_DELAYED_WORK(&priv->init_alive_start, iwl3945_bg_init_alive_start); | 7911 | INIT_DELAYED_WORK(&priv->init_alive_start, iwl3945_bg_init_alive_start); |
7877 | INIT_DELAYED_WORK(&priv->alive_start, iwl3945_bg_alive_start); | 7912 | INIT_DELAYED_WORK(&priv->alive_start, iwl3945_bg_alive_start); |
@@ -7994,17 +8029,10 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
7994 | 8029 | ||
7995 | priv->ibss_beacon = NULL; | 8030 | priv->ibss_beacon = NULL; |
7996 | 8031 | ||
7997 | /* Tell mac80211 and its clients (e.g. Wireless Extensions) | 8032 | /* Tell mac80211 our characteristics */ |
7998 | * the range of signal quality values that we'll provide. | 8033 | hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE | |
7999 | * Negative values for level/noise indicate that we'll provide dBm. | 8034 | IEEE80211_HW_SIGNAL_DBM | |
8000 | * For WE, at least, non-0 values here *enable* display of values | 8035 | IEEE80211_HW_NOISE_DBM; |
8001 | * in app (iwconfig). */ | ||
8002 | hw->max_rssi = -20; /* signal level, negative indicates dBm */ | ||
8003 | hw->max_noise = -20; /* noise level, negative indicates dBm */ | ||
8004 | hw->max_signal = 100; /* link quality indication (%) */ | ||
8005 | |||
8006 | /* Tell mac80211 our Tx characteristics */ | ||
8007 | hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE; | ||
8008 | 8036 | ||
8009 | /* 4 EDCA QOS priorities */ | 8037 | /* 4 EDCA QOS priorities */ |
8010 | hw->queues = 4; | 8038 | hw->queues = 4; |