++static void
++minstrel_ht_update_cap(struct minstrel_ht_sta *mi, struct ieee80211_sta *sta,
++ enum nl80211_channel_type oper_chan_type)
++{
++ struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
++ u16 sta_cap = sta->ht_cap.cap;
++ int i;
++
++ if (oper_chan_type != NL80211_CHAN_HT40MINUS &&
++ oper_chan_type != NL80211_CHAN_HT40PLUS)
++ sta_cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
++
++ for (i = 0; i < ARRAY_SIZE(mi->groups); i++) {
++ u16 req = 0;
++
++ mi->groups[i].supported = 0;
++ if (minstrel_mcs_groups[i].flags & IEEE80211_TX_RC_SHORT_GI) {
++ if (minstrel_mcs_groups[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
++ req |= IEEE80211_HT_CAP_SGI_40;
++ else
++ req |= IEEE80211_HT_CAP_SGI_20;
++ }
++
++ if (minstrel_mcs_groups[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
++ req |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
++
++ if ((sta_cap & req) != req)
++ continue;
++
++ mi->groups[i].supported =
++ mcs->rx_mask[minstrel_mcs_groups[i].streams - 1];
++ }
++}