mac80211: Fix handling of retry count of NO_ACK frames in PID
[pandora-kernel.git] / net / mac80211 / rc80211_pid_algo.c
index 2328ba5..2b33e3a 100644 (file)
@@ -256,7 +256,7 @@ static void rate_control_pid_tx_status(void *priv, struct ieee80211_supported_ba
        if (!(info->flags & IEEE80211_TX_STAT_ACK)) {
                spinfo->tx_num_failed += 2;
                spinfo->tx_num_xmit++;
-       } else if (info->status.rates[0].count) {
+       } else if (info->status.rates[0].count > 1) {
                spinfo->tx_num_failed++;
                spinfo->tx_num_xmit++;
        }
@@ -289,13 +289,15 @@ rate_control_pid_get_rate(void *priv, struct ieee80211_sta *sta,
                info->control.rates[0].count =
                        txrc->hw->conf.short_frame_max_tx_count;
 
-       /* Send management frames and broadcast/multicast data using lowest
-        * rate. */
+       /* Send management frames and NO_ACK data using lowest rate. */
        fc = le16_to_cpu(hdr->frame_control);
        if (!sta || !spinfo ||
            (fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA ||
-           is_multicast_ether_addr(hdr->addr1)) {
+           info->flags & IEEE80211_TX_CTL_NO_ACK) {
                info->control.rates[0].idx = rate_lowest_index(sband, sta);
+               if (info->flags & IEEE80211_TX_CTL_NO_ACK)
+                       info->control.rates[0].count = 1;
+
                return;
        }
 
@@ -403,11 +405,11 @@ static void *rate_control_pid_alloc(struct ieee80211_hw *hw,
                                                 S_IRUSR | S_IWUSR, debugfsdir,
                                                 &pinfo->sampling_period);
        de->coeff_p = debugfs_create_u32("coeff_p", S_IRUSR | S_IWUSR,
-                                        debugfsdir, &pinfo->coeff_p);
+                                        debugfsdir, (u32 *)&pinfo->coeff_p);
        de->coeff_i = debugfs_create_u32("coeff_i", S_IRUSR | S_IWUSR,
-                                        debugfsdir, &pinfo->coeff_i);
+                                        debugfsdir, (u32 *)&pinfo->coeff_i);
        de->coeff_d = debugfs_create_u32("coeff_d", S_IRUSR | S_IWUSR,
-                                        debugfsdir, &pinfo->coeff_d);
+                                        debugfsdir, (u32 *)&pinfo->coeff_d);
        de->smoothing_shift = debugfs_create_u32("smoothing_shift",
                                                 S_IRUSR | S_IWUSR, debugfsdir,
                                                 &pinfo->smoothing_shift);