qtnfmac: use per-band HT/VHT info from wireless device

HT/VHT capabilities must be reported per each band supported by a radio,
not for all bands on a radio. Furthermore, driver better not assume
any capabilities and just use whetever is reported by device itself.

To support this, convert "get channels" command into "get band info"
command. Difference is that it may also carry HT/VHT capabilities along
with channels information.

While at it, also add "num_bitrates" field to "get band info" command,
for future use.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
Igor Mitsyanko
2017-10-30 18:04:47 -07:00
committed by Kalle Valo
parent bd99a3013b
commit e294cbfda0
5 changed files with 84 additions and 59 deletions

View File

@@ -823,8 +823,7 @@ static void qtnf_cfg80211_reg_notifier(struct wiphy *wiphy_in,
if (!wiphy->bands[band])
continue;
ret = qtnf_cmd_get_mac_chan_info(mac,
wiphy->bands[band]);
ret = qtnf_cmd_band_info_get(mac, wiphy->bands[band]);
if (ret)
pr_err("failed to get chan info for mac %u band %u\n",
mac_idx, band);
@@ -832,33 +831,6 @@ static void qtnf_cfg80211_reg_notifier(struct wiphy *wiphy_in,
}
}
void qtnf_band_setup_htvht_caps(struct qtnf_mac_info *macinfo,
struct ieee80211_supported_band *band)
{
struct ieee80211_sta_ht_cap *ht_cap;
struct ieee80211_sta_vht_cap *vht_cap;
ht_cap = &band->ht_cap;
ht_cap->ht_supported = true;
memcpy(&ht_cap->cap, &macinfo->ht_cap.cap_info,
sizeof(u16));
ht_cap->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
ht_cap->ampdu_density = IEEE80211_HT_MPDU_DENSITY_NONE;
memcpy(&ht_cap->mcs, &macinfo->ht_cap.mcs,
sizeof(ht_cap->mcs));
if (macinfo->phymode_cap & QLINK_PHYMODE_AC) {
vht_cap = &band->vht_cap;
vht_cap->vht_supported = true;
memcpy(&vht_cap->cap,
&macinfo->vht_cap.vht_cap_info, sizeof(u32));
/* Update MCS support for VHT */
memcpy(&vht_cap->vht_mcs,
&macinfo->vht_cap.supp_mcs,
sizeof(struct ieee80211_vht_mcs_info));
}
}
struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus)
{
struct wiphy *wiphy;