]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wireless/iwlwifi/iwl-4965-rs.c
iwlwifi: fix various spelling and typos
[linux-2.6-omap-h63xx.git] / drivers / net / wireless / iwlwifi / iwl-4965-rs.c
index 287c75705c44db0a72729dad2f0833294e5ac1ff..2227ee4ad1affbb4ff72ce870d7012bee18791d0 100644 (file)
@@ -36,9 +36,6 @@
 
 #include <linux/workqueue.h>
 
-#include <net/mac80211.h>
-#include <linux/wireless.h>
-
 #define IWL 4965
 
 #include "../net/mac80211/ieee80211_rate.h"
@@ -501,7 +498,7 @@ static u16 rs_get_adjacent_rate(u8 index, u16 rate_mask, int rate_type)
        u8 high = IWL_RATE_INVALID;
        u8 low = IWL_RATE_INVALID;
 
-       /* 802.11A or ht walks to the next literal adjascent rate in
+       /* 802.11A or ht walks to the next literal adjacent rate in
         * the rate table */
        if (is_a_band(rate_type) || !is_legacy(rate_type)) {
                int i;
@@ -1416,7 +1413,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
                index = IWL_INVALID_VALUE;
                update_lq = 1;
 
-               /* get the lowest availabe rate */
+               /* get the lowest available rate */
                for (i = 0; i <= IWL_RATE_COUNT; i++) {
                        if ((1 << i) & rate_scale_index_msk)
                                index = i;
@@ -1696,55 +1693,27 @@ static void rs_initialize_lq(struct iwl_priv *priv,
        return;
 }
 
-static struct ieee80211_rate *rs_get_lowest_rate(struct ieee80211_local
-                                                *local)
-{
-       struct ieee80211_hw_mode *mode = local->oper_hw_mode;
-       int i;
-
-       for (i = 0; i < mode->num_rates; i++) {
-               struct ieee80211_rate *rate = &mode->rates[i];
-
-               if (rate->flags & IEEE80211_RATE_SUPPORTED)
-                       return rate;
-       }
-
-       return &mode->rates[0];
-}
-
-static struct ieee80211_rate *rs_get_rate(void *priv_rate,
-                                              struct net_device *dev,
-                                              struct sk_buff *skb,
-                                              struct rate_control_extra
-                                              *extra)
+static void rs_get_rate(void *priv_rate, struct net_device *dev,
+                       struct ieee80211_hw_mode *mode, struct sk_buff *skb,
+                       struct rate_selection *sel)
 {
 
        int i;
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
        struct sta_info *sta;
-       u16 fc;
        struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
        struct iwl_rate_scale_priv *lq;
 
        IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n");
 
-       memset(extra, 0, sizeof(*extra));
-
-       fc = le16_to_cpu(hdr->frame_control);
-       if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1)) {
-               /* Send management frames and broadcast/multicast data using
-                * lowest rate. */
-               /* TODO: this could probably be improved.. */
-               return rs_get_lowest_rate(local);
-       }
-
        sta = sta_info_get(local, hdr->addr1);
 
        if (!sta || !sta->rate_ctrl_priv) {
+               sel->rate = rate_lowest(local, local->oper_hw_mode, sta);
                if (sta)
                        sta_info_put(sta);
-               return rs_get_lowest_rate(local);
+               return;
        }
 
        lq = (struct iwl_rate_scale_priv *)sta->rate_ctrl_priv;
@@ -1771,11 +1740,13 @@ static struct ieee80211_rate *rs_get_rate(void *priv_rate,
        }
 
  done:
+       if ((i < 0) || (i > IWL_RATE_COUNT)) {
+               sel->rate = rate_lowest(local, local->oper_hw_mode, sta);
+               return;
+       }
        sta_info_put(sta);
-       if ((i < 0) || (i > IWL_RATE_COUNT))
-               return rs_get_lowest_rate(local);
 
-       return &priv->ieee_rates[i];
+       sel->rate = &priv->ieee_rates[i];
 }
 
 static void *rs_alloc_sta(void *priv, gfp_t gfp)
@@ -2024,12 +1995,18 @@ static int open_file_generic(struct inode *inode, struct file *file)
 static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
                                struct iwl_rate *mcs, int index)
 {
-       const u32 cck_rate = 0x820A;
+       u32 base_rate;
+
+       if (rs_priv->phymode == (u8) MODE_IEEE80211A)
+               base_rate = 0x800D;
+       else
+               base_rate = 0x820A;
+
        if (rs_priv->dbg_fixed.rate_n_flags) {
                if (index < 12)
                        mcs->rate_n_flags = rs_priv->dbg_fixed.rate_n_flags;
                else
-                       mcs->rate_n_flags = cck_rate;
+                       mcs->rate_n_flags = base_rate;
                IWL_DEBUG_RATE("Fixed rate ON\n");
                return;
        }
@@ -2268,7 +2245,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
                         max_time, good * 100 / samples, good, samples);
        else
                count += sprintf(&buf[count], "\nAverage rate: 0Mbs\n");
-       count += sprintf(&buf[count], "\nrate scale type %d anntena %d "
+       count += sprintf(&buf[count], "\nrate scale type %d antenna %d "
                         "active_search %d rate index %d\n", lq_type, antenna,
                         rs_priv->search_better_tbl, sta->last_txrate);