]> Pileus Git - ~andy/linux/commitdiff
iwlwifi: put use_rts_for_aggregation into hw_params
authorJohannes Berg <johannes.berg@intel.com>
Tue, 6 Mar 2012 21:30:55 +0000 (13:30 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 Mar 2012 18:56:31 +0000 (13:56 -0500)
The hardware config ht_params shouldn't be modified,
so copy the use_rts_for_aggregation parameter into
hw_params and use/modify it there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
drivers/net/wireless/iwlwifi/iwl-agn-tx.c
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-debugfs.c
drivers/net/wireless/iwlwifi/iwl-mac80211.c
drivers/net/wireless/iwlwifi/iwl-shared.h

index 2c5e7ec697e98fbfbb92d611cc8144b3724823c8..e191d394cfa0df758d5f87c83cfdccc007748e52 100644 (file)
@@ -436,8 +436,7 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
         * force CTS-to-self frames protection if RTS-CTS is not preferred
         * one aggregation protection method
         */
-       if (!(cfg(priv)->ht_params &&
-             cfg(priv)->ht_params->use_rts_for_aggregation))
+       if (!hw_params(priv).use_rts_for_aggregation)
                ctx->staging.flags |= RXON_FLG_SELF_CTS_EN;
 
        if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) ||
index dd28785e1a5ce6172f04065baca24cd3ee4c071f..151400cf51e0c54061e416a11919b19ab9d98bf8 100644 (file)
@@ -594,8 +594,7 @@ int iwlagn_tx_agg_oper(struct iwl_priv *priv, struct ieee80211_vif *vif,
        sta_priv->max_agg_bufsize =
                min(sta_priv->max_agg_bufsize, buf_size);
 
-       if (cfg(priv)->ht_params &&
-           cfg(priv)->ht_params->use_rts_for_aggregation) {
+       if (hw_params(priv).use_rts_for_aggregation) {
                /*
                 * switch to RTS/CTS if it is the prefer protection
                 * method for HT traffic
index ac23aa3dd6d788211eb53d6bd95dac8d3c2ed414..ce62a2fcd67ff0f1ce6d14a3bcc5fd353caebace 100644 (file)
@@ -1119,6 +1119,10 @@ static void iwl_uninit_drv(struct iwl_priv *priv)
 
 static void iwl_set_hw_params(struct iwl_priv *priv)
 {
+       if (cfg(priv)->ht_params)
+               hw_params(priv).use_rts_for_aggregation =
+                       cfg(priv)->ht_params->use_rts_for_aggregation;
+
        if (iwlagn_mod_params.amsdu_size_8K)
                hw_params(priv).rx_page_order =
                        get_order(IWL_RX_BUF_SIZE_8K);
index 116c7851f3b1607512d94a0c3a72c85fd72fa741..0a898c54c733de4454ef125a3eb653ee2f9fe4ff 100644 (file)
@@ -2431,7 +2431,7 @@ static ssize_t iwl_dbgfs_protection_mode_read(struct file *file,
        if (cfg(priv)->ht_params)
                pos += scnprintf(buf + pos, bufsz - pos,
                         "use %s for aggregation\n",
-                        (cfg(priv)->ht_params->use_rts_for_aggregation) ?
+                        (hw_params(priv).use_rts_for_aggregation) ?
                                "rts/cts" : "cts-to-self");
        else
                pos += scnprintf(buf + pos, bufsz - pos, "N/A");
@@ -2458,9 +2458,9 @@ static ssize_t iwl_dbgfs_protection_mode_write(struct file *file,
        if (sscanf(buf, "%d", &rts) != 1)
                return -EINVAL;
        if (rts)
-               cfg(priv)->ht_params->use_rts_for_aggregation = true;
+               hw_params(priv).use_rts_for_aggregation = true;
        else
-               cfg(priv)->ht_params->use_rts_for_aggregation = false;
+               hw_params(priv).use_rts_for_aggregation = false;
        return count;
 }
 
index 30861765b5125614f56a937c4af549103f27d0c2..d2c1d714c89c402b518420a44cca7ef9492a217f 100644 (file)
@@ -660,8 +660,8 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
                        IWL_DEBUG_HT(priv, "priv->agg_tids_count = %u\n",
                                     priv->agg_tids_count);
                }
-               if (!priv->agg_tids_count && cfg(priv)->ht_params &&
-                   cfg(priv)->ht_params->use_rts_for_aggregation) {
+               if (!priv->agg_tids_count &&
+                   hw_params(priv).use_rts_for_aggregation) {
                        /*
                         * switch off RTS/CTS if it was previously enabled
                         */
index ab2e1f771a11016f3dada2705f985794735b76b2..7c9502703e825a1caeedca37c1a896bfba80504f 100644 (file)
@@ -174,6 +174,7 @@ struct iwl_mod_params {
  *     relevant for 1000, 6000 and up
  * @wd_timeout: TX queues watchdog timeout
  * @struct iwl_sensitivity_ranges: range of sensitivity values
+ * @use_rts_for_aggregation: use rts/cts protection for HT traffic
  */
 struct iwl_hw_params {
        u8  max_txq_num;
@@ -183,6 +184,7 @@ struct iwl_hw_params {
        u8  valid_tx_ant;
        u8  valid_rx_ant;
        u8  ht40_channel;
+       bool use_rts_for_aggregation;
        u16 sku;
        u32 rx_page_order;
        u32 ct_kill_threshold;