void mt76_set_stream_caps(struct mt76_phy *phy, bool vht)
{
- if (phy->dev->cap.has_2ghz)
+ if (phy->cap.has_2ghz)
mt76_init_stream_cap(phy, &phy->sband_2g.sband, false);
- if (phy->dev->cap.has_5ghz)
+ if (phy->cap.has_5ghz)
mt76_init_stream_cap(phy, &phy->sband_5g.sband, vht);
}
EXPORT_SYMBOL_GPL(mt76_set_stream_caps);
dev_set_drvdata(dev->dev, dev);
mt76_phy_init(dev, hw);
- if (dev->cap.has_2ghz) {
+ if (phy->cap.has_2ghz) {
ret = mt76_init_sband_2g(dev, rates, n_rates);
if (ret)
return ret;
}
- if (dev->cap.has_5ghz) {
+ if (phy->cap.has_5ghz) {
ret = mt76_init_sband_5g(dev, rates + 4, n_rates - 4, vht);
if (ret)
return ret;
struct mt76_channel_state *chan_state;
ktime_t survey_time;
+ struct mt76_hw_cap cap;
struct mt76_sband sband_2g;
struct mt76_sband sband_5g;
struct debugfs_blob_wrapper eeprom;
struct debugfs_blob_wrapper otp;
- struct mt76_hw_cap cap;
struct mt76_rate_power rate_power;
}
eeprom = (u8 *)dev->mt76.eeprom.data;
- dev->mt76.cap.has_2ghz = true;
+ dev->mphy.cap.has_2ghz = true;
memcpy(dev->mt76.macaddr, eeprom + MT_EE_MAC_ADDR, ETH_ALEN);
/* Check for 1SS devices */
int ret;
/* Increase buffer size to receive large VHT MPDUs */
- if (dev->mt76.cap.has_5ghz)
+ if (dev->mphy.cap.has_5ghz)
rx_buf_size *= 2;
mt76_dma_attach(&dev->mt76);
if (is_mt7663(&dev->mt76)) {
/* dual band */
- dev->mt76.cap.has_2ghz = true;
- dev->mt76.cap.has_5ghz = true;
+ dev->mphy.cap.has_2ghz = true;
+ dev->mphy.cap.has_5ghz = true;
return;
}
if (is_mt7622(&dev->mt76)) {
/* 2GHz only */
- dev->mt76.cap.has_2ghz = true;
+ dev->mphy.cap.has_2ghz = true;
return;
}
if (is_mt7611(&dev->mt76)) {
/* 5GHz only */
- dev->mt76.cap.has_5ghz = true;
+ dev->mphy.cap.has_5ghz = true;
return;
}
eeprom[MT_EE_WIFI_CONF]);
switch (val) {
case MT_EE_5GHZ:
- dev->mt76.cap.has_5ghz = true;
+ dev->mphy.cap.has_5ghz = true;
break;
case MT_EE_2GHZ:
- dev->mt76.cap.has_2ghz = true;
+ dev->mphy.cap.has_2ghz = true;
break;
case MT_EE_DBDC:
dev->dbdc_support = true;
/* fall through */
default:
- dev->mt76.cap.has_2ghz = true;
- dev->mt76.cap.has_5ghz = true;
+ dev->mphy.cap.has_2ghz = true;
+ dev->mphy.cap.has_5ghz = true;
break;
}
}
mt76x02_eeprom_parse_hw_cap(dev);
dev_dbg(dev->mt76.dev, "2GHz %d 5GHz %d\n",
- dev->mt76.cap.has_2ghz, dev->mt76.cap.has_5ghz);
+ dev->mphy.cap.has_2ghz, dev->mphy.cap.has_5ghz);
if (dev->no_2ghz) {
- dev->mt76.cap.has_2ghz = false;
+ dev->mphy.cap.has_2ghz = false;
dev_dbg(dev->mt76.dev, "mask out 2GHz support\n");
}
if (is_mt7630(dev)) {
- dev->mt76.cap.has_5ghz = false;
+ dev->mphy.cap.has_5ghz = false;
dev_dbg(dev->mt76.dev, "mask out 5GHz support\n");
}
if (ret)
return ret;
- if (dev->mt76.cap.has_5ghz) {
+ if (dev->mphy.cap.has_5ghz) {
struct ieee80211_supported_band *sband;
sband = &dev->mphy.sband_5g.sband;
mt76x0_init_txpower(dev, sband);
}
- if (dev->mt76.cap.has_2ghz)
+ if (dev->mphy.cap.has_2ghz)
mt76x0_init_txpower(dev, &dev->mphy.sband_2g.sband);
mt76x02_init_debugfs(dev);
else
coex3 |= BIT(4);
coex3 |= BIT(3);
- if (dev->mt76.cap.has_2ghz)
+ if (dev->mphy.cap.has_2ghz)
wlan |= BIT(6);
} else {
/* sigle antenna mode */
- if (dev->mt76.cap.has_5ghz) {
+ if (dev->mphy.cap.has_5ghz) {
coex3 |= BIT(3) | BIT(4);
} else {
wlan |= BIT(6);
switch (FIELD_GET(MT_EE_NIC_CONF_0_BOARD_TYPE, val)) {
case BOARD_TYPE_5GHZ:
- dev->mt76.cap.has_5ghz = true;
+ dev->mphy.cap.has_5ghz = true;
break;
case BOARD_TYPE_2GHZ:
- dev->mt76.cap.has_2ghz = true;
+ dev->mphy.cap.has_2ghz = true;
break;
default:
- dev->mt76.cap.has_2ghz = true;
- dev->mt76.cap.has_5ghz = true;
+ dev->mphy.cap.has_2ghz = true;
+ dev->mphy.cap.has_5ghz = true;
break;
}
}
val = FIELD_GET(MT_EE_WIFI_CONF_BAND_SEL, val);
switch (val) {
case MT_EE_5GHZ:
- dev->mt76.cap.has_5ghz = true;
+ dev->mphy.cap.has_5ghz = true;
break;
case MT_EE_2GHZ:
- dev->mt76.cap.has_2ghz = true;
+ dev->mphy.cap.has_2ghz = true;
break;
default:
- dev->mt76.cap.has_2ghz = true;
- dev->mt76.cap.has_5ghz = true;
+ dev->mphy.cap.has_2ghz = true;
+ dev->mphy.cap.has_5ghz = true;
break;
}
{
struct ieee80211_sband_iftype_data *data;
struct ieee80211_supported_band *band;
- struct mt76_dev *mdev = &phy->dev->mt76;
int n;
- if (mdev->cap.has_2ghz) {
+ if (phy->mt76->cap.has_2ghz) {
data = phy->iftype[NL80211_BAND_2GHZ];
n = mt7915_init_he_caps(phy, NL80211_BAND_2GHZ, data);
band->n_iftype_data = n;
}
- if (mdev->cap.has_5ghz) {
+ if (phy->mt76->cap.has_5ghz) {
data = phy->iftype[NL80211_BAND_5GHZ];
n = mt7915_init_he_caps(phy, NL80211_BAND_5GHZ, data);