]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorJohn W. Linville <linville@tuxdriver.com>
Mon, 16 May 2011 18:21:02 +0000 (14:21 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 16 May 2011 18:21:02 +0000 (14:21 -0400)
1  2 
drivers/net/wireless/iwlwifi/iwl-agn-rs.c

index 91f26556ac23880ca98461d5fa9b1975f1688d18,c38ba7c9cfd4e76506d52b15a420905aaf091b13..fec0df016d68b1f3ef66d276c850752c87148465
@@@ -335,6 -335,32 +335,32 @@@ static u8 rs_tl_add_packet(struct iwl_l
        return tid;
  }
  
+ #if defined(CONFIG_MAC80211_DEBUGFS) || defined(CONFIG_IWLWIFI_DEVICE_SVTOOL)
+ static void rs_program_fix_rate(struct iwl_priv *priv,
+                               struct iwl_lq_sta *lq_sta)
+ {
+       struct iwl_station_priv *sta_priv =
+               container_of(lq_sta, struct iwl_station_priv, lq_sta);
+       struct iwl_rxon_context *ctx = sta_priv->common.ctx;
+       lq_sta->active_legacy_rate = 0x0FFF;    /* 1 - 54 MBits, includes CCK */
+       lq_sta->active_siso_rate   = 0x1FD0;    /* 6 - 60 MBits, no 9, no CCK */
+       lq_sta->active_mimo2_rate  = 0x1FD0;    /* 6 - 60 MBits, no 9, no CCK */
+       lq_sta->active_mimo3_rate  = 0x1FD0;    /* 6 - 60 MBits, no 9, no CCK */
+       lq_sta->dbg_fixed_rate = priv->dbg_fixed_rate;
+       IWL_DEBUG_RATE(priv, "sta_id %d rate 0x%X\n",
+               lq_sta->lq.sta_id, priv->dbg_fixed_rate);
+       if (priv->dbg_fixed_rate) {
+               rs_fill_link_cmd(NULL, lq_sta, priv->dbg_fixed_rate);
+               iwl_send_lq_cmd(lq_sta->drv, ctx, &lq_sta->lq, CMD_ASYNC,
+                               false);
+       }
+ }
+ #endif
  /*
        get the traffic load value for tid
  */
@@@ -1046,7 -1072,10 +1072,10 @@@ done
        /* See if there's a better rate or modulation mode to try. */
        if (sta && sta->supp_rates[sband->band])
                rs_rate_scale_perform(priv, skb, sta, lq_sta);
+ #ifdef CONFIG_IWLWIFI_DEVICE_SVTOOL
+       if (priv->dbg_fixed_rate != lq_sta->dbg_fixed_rate)
+               rs_program_fix_rate(priv, lq_sta);
+ #endif
        if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist)
                rs_bt_update_lq(priv, ctx, lq_sta);
  }
@@@ -2170,11 -2199,11 +2199,11 @@@ static void rs_stay_in_table(struct iwl
   * setup rate table in uCode
   * return rate_n_flags as used in the table
   */
- static u32 rs_update_rate_tbl(struct iwl_priv *priv,
-                             struct iwl_rxon_context *ctx,
-                               struct iwl_lq_sta *lq_sta,
-                               struct iwl_scale_tbl_info *tbl,
-                               int index, u8 is_green)
+ static void rs_update_rate_tbl(struct iwl_priv *priv,
+                              struct iwl_rxon_context *ctx,
+                              struct iwl_lq_sta *lq_sta,
+                              struct iwl_scale_tbl_info *tbl,
+                              int index, u8 is_green)
  {
        u32 rate;
  
        rate = rate_n_flags_from_tbl(priv, tbl, index, is_green);
        rs_fill_link_cmd(priv, lq_sta, rate);
        iwl_send_lq_cmd(priv, ctx, &lq_sta->lq, CMD_ASYNC, false);
-       return rate;
  }
  
  /*
@@@ -2212,7 -2239,6 +2239,6 @@@ static void rs_rate_scale_perform(struc
        u8 update_lq = 0;
        struct iwl_scale_tbl_info *tbl, *tbl1;
        u16 rate_scale_index_msk = 0;
-       u32 rate;
        u8 is_green = 0;
        u8 active_tbl = 0;
        u8 done_search = 0;
                        tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
                        /* get "active" rate info */
                        index = iwl_hwrate_to_plcp_idx(tbl->current_rate);
-                       rate = rs_update_rate_tbl(priv, ctx, lq_sta,
-                                                 tbl, index, is_green);
+                       rs_update_rate_tbl(priv, ctx, lq_sta, tbl,
+                                          index, is_green);
                }
                return;
        }
  lq_update:
        /* Replace uCode's rate table for the destination station. */
        if (update_lq)
-               rate = rs_update_rate_tbl(priv, ctx, lq_sta,
-                                         tbl, index, is_green);
+               rs_update_rate_tbl(priv, ctx, lq_sta, tbl, index, is_green);
  
        if (iwl_tx_ant_restriction(priv) == IWL_ANT_OK_MULTI) {
                /* Should we stay with this modulation mode,
@@@ -2871,6 -2896,7 +2896,7 @@@ void iwl_rs_rate_init(struct iwl_priv *
                lq_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE;
        lq_sta->is_agg = 0;
  
+       priv->dbg_fixed_rate = 0;
  #ifdef CONFIG_MAC80211_DEBUGFS
        lq_sta->dbg_fixed_rate = 0;
  #endif
@@@ -3045,7 -3071,6 +3071,6 @@@ static void rs_free_sta(void *priv_r, s
        IWL_DEBUG_RATE(priv, "leave\n");
  }
  
  #ifdef CONFIG_MAC80211_DEBUGFS
  static int open_file_generic(struct inode *inode, struct file *file)
  {
@@@ -3070,6 -3095,7 +3095,7 @@@ static void rs_dbgfs_set_mcs(struct iwl
                        IWL_DEBUG_RATE(priv, "Fixed rate ON\n");
                } else {
                        lq_sta->dbg_fixed_rate = 0;
+                       priv->dbg_fixed_rate = 0;
                        IWL_ERR(priv,
                            "Invalid antenna selection 0x%X, Valid is 0x%X\n",
                            ant_sel_tx, valid_tx_ant);
@@@ -3086,11 -3112,9 +3112,9 @@@ static ssize_t rs_sta_dbgfs_scale_table
        struct iwl_lq_sta *lq_sta = file->private_data;
        struct iwl_priv *priv;
        char buf[64];
 -      int buf_size;
 +      size_t buf_size;
        u32 parsed_rate;
-       struct iwl_station_priv *sta_priv =
-               container_of(lq_sta, struct iwl_station_priv, lq_sta);
-       struct iwl_rxon_context *ctx = sta_priv->common.ctx;
  
        priv = lq_sta->drv;
        memset(buf, 0, sizeof(buf));
                return -EFAULT;
  
        if (sscanf(buf, "%x", &parsed_rate) == 1)
-               lq_sta->dbg_fixed_rate = parsed_rate;
+               priv->dbg_fixed_rate = lq_sta->dbg_fixed_rate = parsed_rate;
        else
-               lq_sta->dbg_fixed_rate = 0;
-       lq_sta->active_legacy_rate = 0x0FFF;    /* 1 - 54 MBits, includes CCK */
-       lq_sta->active_siso_rate   = 0x1FD0;    /* 6 - 60 MBits, no 9, no CCK */
-       lq_sta->active_mimo2_rate  = 0x1FD0;    /* 6 - 60 MBits, no 9, no CCK */
-       lq_sta->active_mimo3_rate  = 0x1FD0;    /* 6 - 60 MBits, no 9, no CCK */
-       IWL_DEBUG_RATE(priv, "sta_id %d rate 0x%X\n",
-               lq_sta->lq.sta_id, lq_sta->dbg_fixed_rate);
+               priv->dbg_fixed_rate = lq_sta->dbg_fixed_rate = 0;
  
-       if (lq_sta->dbg_fixed_rate) {
-               rs_fill_link_cmd(NULL, lq_sta, lq_sta->dbg_fixed_rate);
-               iwl_send_lq_cmd(lq_sta->drv, ctx, &lq_sta->lq, CMD_ASYNC,
-                               false);
-       }
+       rs_program_fix_rate(priv, lq_sta);
  
        return count;
  }
@@@ -3143,7 -3155,7 +3155,7 @@@ static ssize_t rs_sta_dbgfs_scale_table
                        lq_sta->total_failed, lq_sta->total_success,
                        lq_sta->active_legacy_rate);
        desc += sprintf(buff+desc, "fixed rate 0x%X\n",
-                       lq_sta->dbg_fixed_rate);
+                       priv->dbg_fixed_rate);
        desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n",
            (priv->hw_params.valid_tx_ant & ANT_A) ? "ANT_A," : "",
            (priv->hw_params.valid_tx_ant & ANT_B) ? "ANT_B," : "",
@@@ -3254,14 -3266,10 +3266,10 @@@ static const struct file_operations rs_
  static ssize_t rs_sta_dbgfs_rate_scale_data_read(struct file *file,
                        char __user *user_buf, size_t count, loff_t *ppos)
  {
-       char buff[120];
-       int desc = 0;
        struct iwl_lq_sta *lq_sta = file->private_data;
-       struct iwl_priv *priv;
        struct iwl_scale_tbl_info *tbl = &lq_sta->lq_info[lq_sta->active_tbl];
-       priv = lq_sta->drv;
+       char buff[120];
+       int desc = 0;
  
        if (is_Ht(tbl->lq_type))
                desc += sprintf(buff+desc,