]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wireless/iwlwifi/iwl-5000.c
iwlwifi: fixes RTS / CTS support
[linux-2.6-omap-h63xx.git] / drivers / net / wireless / iwlwifi / iwl-5000.c
index 099983f7306a7b045bbcd45cdb12182db73d767b..b518792c7231ddb9337e5254debed2012aca7de8 100644 (file)
@@ -370,6 +370,16 @@ static void iwl5000_chain_noise_reset(struct iwl_priv *priv)
        }
 }
 
+static void iwl5000_rts_tx_cmd_flag(struct ieee80211_tx_info *info,
+                       __le32 *tx_flags)
+{
+       if ((info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) ||
+           (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT))
+               *tx_flags |= TX_CMD_FLG_RTS_CTS_MSK;
+       else
+               *tx_flags &= ~TX_CMD_FLG_RTS_CTS_MSK;
+}
+
 static struct iwl_sensitivity_ranges iwl5000_sensitivity = {
        .min_nrg_cck = 95,
        .max_nrg_cck = 0,
@@ -807,11 +817,8 @@ static int iwl5000_alive_notify(struct iwl_priv *priv)
 
        iwl5000_send_Xtal_calib(priv);
 
-       if (priv->ucode_type == UCODE_RT) {
+       if (priv->ucode_type == UCODE_RT)
                iwl5000_send_calib_results(priv);
-               set_bit(STATUS_READY, &priv->status);
-               priv->is_open = 1;
-       }
 
        return 0;
 }
@@ -1281,9 +1288,9 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv,
 
                iwl5000_tx_status_reply_tx(priv, agg, tx_resp, txq_id, index);
 
-               if ((tx_resp->frame_count == 1) && !iwl_is_tx_success(status)) {
-                       /* TODO: send BAR */
-               }
+               /* check if BAR is needed */
+               if ((tx_resp->frame_count == 1) && !iwl_is_tx_success(status))
+                       info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
 
                if (txq->q.read_ptr != (scd_ssn & 0xff)) {
                        int freed, ampdu_q;
@@ -1425,11 +1432,10 @@ static int  iwl5000_send_tx_power(struct iwl_priv *priv)
                                       NULL);
 }
 
-static void iwl5000_temperature(struct iwl_priv *priv,
-                               struct iwl_notif_statistics *stats)
+static void iwl5000_temperature(struct iwl_priv *priv)
 {
        /* store temperature from statistics (in Celsius) */
-       priv->temperature = le32_to_cpu(stats->general.temperature);
+       priv->temperature = le32_to_cpu(priv->statistics.general.temperature);
 }
 
 static struct iwl_hcmd_ops iwl5000_hcmd = {
@@ -1441,6 +1447,7 @@ static struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = {
        .build_addsta_hcmd = iwl5000_build_addsta_hcmd,
        .gain_computation = iwl5000_gain_computation,
        .chain_noise_reset = iwl5000_chain_noise_reset,
+       .rts_tx_cmd_flag = iwl5000_rts_tx_cmd_flag,
 };
 
 static struct iwl_lib_ops iwl5000_lib = {
@@ -1510,6 +1517,24 @@ struct iwl_cfg iwl5300_agn_cfg = {
        .mod_params = &iwl50_mod_params,
 };
 
+struct iwl_cfg iwl5100_bg_cfg = {
+       .name = "5100BG",
+       .fw_name = "iwlwifi-5000" IWL5000_UCODE_API ".ucode",
+       .sku = IWL_SKU_G,
+       .ops = &iwl5000_ops,
+       .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
+       .mod_params = &iwl50_mod_params,
+};
+
+struct iwl_cfg iwl5100_abg_cfg = {
+       .name = "5100ABG",
+       .fw_name = "iwlwifi-5000" IWL5000_UCODE_API ".ucode",
+       .sku = IWL_SKU_A|IWL_SKU_G,
+       .ops = &iwl5000_ops,
+       .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
+       .mod_params = &iwl50_mod_params,
+};
+
 struct iwl_cfg iwl5100_agn_cfg = {
        .name = "5100AGN",
        .fw_name = "iwlwifi-5000" IWL5000_UCODE_API ".ucode",