]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/mac80211/rate.c
Merge tag 'v2.6.37' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / net / mac80211 / rate.c
index be04d46110fe8cdccc5e07eb810b67ee39c5c20f..33f76993da081fcd73c10cad2bf1328c46d83299 100644 (file)
@@ -145,6 +145,7 @@ static ssize_t rcname_read(struct file *file, char __user *userbuf,
 static const struct file_operations rcname_ops = {
        .read = rcname_read,
        .open = mac80211_open_file_generic,
+       .llseek = default_llseek,
 };
 #endif
 
@@ -207,7 +208,7 @@ static bool rc_no_data_or_no_ack(struct ieee80211_tx_rate_control *txrc)
 
        fc = hdr->frame_control;
 
-       return ((info->flags & IEEE80211_TX_CTL_NO_ACK) || !ieee80211_is_data(fc));
+       return (info->flags & IEEE80211_TX_CTL_NO_ACK) || !ieee80211_is_data(fc);
 }
 
 static void rc_send_low_broadcast(s8 *idx, u32 basic_rates, u8 max_rate_idx)
@@ -328,6 +329,9 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata,
                 * if needed.
                 */
                for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) {
+                       /* Skip invalid rates */
+                       if (info->control.rates[i].idx < 0)
+                               break;
                        /* Rate masking supports only legacy rates for now */
                        if (info->control.rates[i].flags & IEEE80211_TX_RC_MCS)
                                continue;
@@ -368,8 +372,8 @@ int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local,
 
        ref = rate_control_alloc(name, local);
        if (!ref) {
-               printk(KERN_WARNING "%s: Failed to select rate control "
-                      "algorithm\n", wiphy_name(local->hw.wiphy));
+               wiphy_warn(local->hw.wiphy,
+                          "Failed to select rate control algorithm\n");
                return -ENOENT;
        }
 
@@ -380,9 +384,8 @@ int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local,
                sta_info_flush(local, NULL);
        }
 
-       printk(KERN_DEBUG "%s: Selected rate control "
-              "algorithm '%s'\n", wiphy_name(local->hw.wiphy),
-              ref->ops->name);
+       wiphy_debug(local->hw.wiphy, "Selected rate control algorithm '%s'\n",
+                   ref->ops->name);
 
        return 0;
 }