nfsd: move fsid_type choice out of fh_compose
[safe/jmp/linux-2.6] / net / mac80211 / rc80211_minstrel.c
index 70df3dc..37771ab 100644 (file)
@@ -66,7 +66,7 @@ rix_to_ndx(struct minstrel_sta_info *mi, int rix)
        for (i = rix; i >= 0; i--)
                if (mi->r[i].rix == rix)
                        break;
-       WARN_ON(mi->r[i].rix != rix);
+       WARN_ON(i < 0);
        return i;
 }
 
@@ -80,8 +80,7 @@ use_low_rate(struct sk_buff *skb)
        fc = le16_to_cpu(hdr->frame_control);
 
        return ((info->flags & IEEE80211_TX_CTL_NO_ACK) ||
-               (fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA ||
-               is_multicast_ether_addr(hdr->addr1));
+               (fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA);
 }
 
 
@@ -182,6 +181,9 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband,
                        break;
 
                ndx = rix_to_ndx(mi, ar[i].idx);
+               if (ndx < 0)
+                       continue;
+
                mi->r[ndx].attempts += ar[i].count;
 
                if ((i != IEEE80211_TX_MAX_RATES - 1) && (ar[i + 1].idx < 0))
@@ -216,7 +218,7 @@ minstrel_get_next_sample(struct minstrel_sta_info *mi)
        unsigned int sample_ndx;
        sample_ndx = SAMPLE_TBL(mi, mi->sample_idx, mi->sample_column);
        mi->sample_idx++;
-       if (mi->sample_idx > (mi->n_rates - 2)) {
+       if ((int) mi->sample_idx > (mi->n_rates - 2)) {
                mi->sample_idx = 0;
                mi->sample_column++;
                if (mi->sample_column >= SAMPLE_COLUMNS)
@@ -245,7 +247,10 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
 
        if (!sta || !mi || use_low_rate(skb)) {
                ar[0].idx = rate_lowest_index(sband, sta);
-               ar[0].count = mp->max_retry;
+               if (info->flags & IEEE80211_TX_CTL_NO_ACK)
+                       ar[0].count = 1;
+               else
+                       ar[0].count = mp->max_retry;
                return;
        }
 
@@ -477,7 +482,7 @@ minstrel_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
 
        for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
                sband = hw->wiphy->bands[i];
-               if (sband->n_bitrates > max_rates)
+               if (sband && sband->n_bitrates > max_rates)
                        max_rates = sband->n_bitrates;
        }