-@@ -482,6 +482,38 @@ init_sample_table(struct minstrel_sta_in
- }
-
- static void
-+minstrel_init_cck_rates(struct minstrel_priv *mp,
-+ struct cfg80211_chan_def *chandef)
-+{
-+ static const int bitrates[4] = { 10, 20, 55, 110 };
-+ struct ieee80211_supported_band *sband;
-+ u32 rate_flags = ieee80211_chandef_rate_flags(chandef);
-+ int i, j;
-+
-+ sband = mp->hw->wiphy->bands[NL80211_BAND_2GHZ];
-+ if (!sband)
-+ return;
-+
-+ for (i = 0, j = 0; i < sband->n_bitrates; i++) {
-+ struct ieee80211_rate *rate = &sband->bitrates[i];
-+
-+ if (rate->flags & IEEE80211_RATE_ERP_G)
-+ continue;
-+
-+ if ((rate_flags & sband->bitrates[i].flags) != rate_flags)
-+ continue;
-+
-+ for (j = 0; j < ARRAY_SIZE(bitrates); j++) {
-+ if (rate->bitrate != bitrates[j])
-+ continue;
-+
-+ mp->cck_rates[j] = i;
-+ break;
-+ }
-+ }
-+}
-+
-+static void
- minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
- struct cfg80211_chan_def *chandef,
- struct ieee80211_sta *sta, void *priv_sta)
-@@ -493,6 +525,8 @@ minstrel_rate_init(void *priv, struct ie
- unsigned int t_slot = 9; /* FIXME: get real slot time */
- u32 rate_flags;
-
-+ minstrel_init_cck_rates(mp, chandef);
-+
- mi->sta = sta;
- mi->lowest_rix = rate_lowest_index(sband, sta);
- ctl_rate = &sband->bitrates[mi->lowest_rix];
-@@ -572,138 +606,6 @@ minstrel_rate_init(void *priv, struct ie