iwlwifi: keep the STATUS_EXIT_PENDING flag till the end of down flow
[safe/jmp/linux-2.6] / drivers / net / wireless / iwlwifi / iwl-calib.c
index beb9716..ef49440 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
 
-#include <linux/kernel.h>
 #include <net/mac80211.h>
 
 #include "iwl-dev.h"
 #include "iwl-core.h"
 #include "iwl-calib.h"
-#include "iwl-eeprom.h"
 
 /* "false alarms" are signals that our DSP tries to lock onto,
  *   but then determines that they are either noise, or transmissions
@@ -435,8 +433,6 @@ void iwl_init_sensitivity(struct iwl_priv *priv)
        data = &(priv->sensitivity_data);
 
        if (ranges == NULL)
-               /* can happen if IWLWIFI_RUN_TIME_CALIB is selected
-                * but no IWLXXXX_RUN_TIME_CALIB for specific is selected */
                return;
 
        memset(data, 0, sizeof(struct iwl_sensitivity_data));
@@ -474,7 +470,7 @@ void iwl_init_sensitivity(struct iwl_priv *priv)
 EXPORT_SYMBOL(iwl_init_sensitivity);
 
 void iwl_sensitivity_calibration(struct iwl_priv *priv,
-                                   struct iwl4965_notif_statistics *resp)
+                                   struct iwl_notif_statistics *resp)
 {
        u32 rx_enable_time;
        u32 fa_cck;
@@ -588,7 +584,7 @@ EXPORT_SYMBOL(iwl_sensitivity_calibration);
  * 2)  Differential rx gain settings to balance the 3 receivers.
  */
 void iwl_chain_noise_calibration(struct iwl_priv *priv,
-                             struct iwl4965_notif_statistics *stat_resp)
+                                struct iwl_notif_statistics *stat_resp)
 {
        struct iwl_chain_noise_data *data = NULL;
 
@@ -786,3 +782,21 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
 }
 EXPORT_SYMBOL(iwl_chain_noise_calibration);
 
+
+void iwl_reset_run_time_calib(struct iwl_priv *priv)
+{
+       int i;
+       memset(&(priv->sensitivity_data), 0,
+              sizeof(struct iwl_sensitivity_data));
+       memset(&(priv->chain_noise_data), 0,
+              sizeof(struct iwl_chain_noise_data));
+       for (i = 0; i < NUM_RX_CHAINS; i++)
+               priv->chain_noise_data.delta_gain_code[i] =
+                               CHAIN_NOISE_DELTA_GAIN_INIT_VAL;
+
+       /* Ask for statistics now, the uCode will send notification
+        * periodically after association */
+       iwl_send_statistics_request(priv, CMD_ASYNC);
+}
+EXPORT_SYMBOL(iwl_reset_run_time_calib);
+