mt76: mt7615: introduce mt7615_eeprom_parse_hw_band_cap routine
Introduce mt7615_eeprom_parse_hw_band_cap routine in order to configure supported band for mt7663e and mt7622 devices since they do not rely on eeprom data to enable 2GHz/5GHz bands Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
c321a3d7e3
commit
b3d95f0968
@ -91,11 +91,23 @@ static int mt7615_check_eeprom(struct mt76_dev *dev)
|
||||
}
|
||||
}
|
||||
|
||||
static void mt7615_eeprom_parse_hw_cap(struct mt7615_dev *dev)
|
||||
static void
|
||||
mt7615_eeprom_parse_hw_band_cap(struct mt7615_dev *dev)
|
||||
{
|
||||
u8 *eeprom = dev->mt76.eeprom.data;
|
||||
u8 tx_mask, max_nss;
|
||||
u32 val;
|
||||
u8 val, *eeprom = dev->mt76.eeprom.data;
|
||||
|
||||
if (is_mt7663(&dev->mt76)) {
|
||||
/* dual band */
|
||||
dev->mt76.cap.has_2ghz = true;
|
||||
dev->mt76.cap.has_5ghz = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_mt7622(&dev->mt76)) {
|
||||
/* 2GHz only */
|
||||
dev->mt76.cap.has_2ghz = true;
|
||||
return;
|
||||
}
|
||||
|
||||
val = FIELD_GET(MT_EE_NIC_WIFI_CONF_BAND_SEL,
|
||||
eeprom[MT_EE_WIFI_CONF]);
|
||||
@ -111,9 +123,15 @@ static void mt7615_eeprom_parse_hw_cap(struct mt7615_dev *dev)
|
||||
dev->mt76.cap.has_5ghz = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_mt7622(&dev->mt76))
|
||||
dev->mt76.cap.has_5ghz = false;
|
||||
static void mt7615_eeprom_parse_hw_cap(struct mt7615_dev *dev)
|
||||
{
|
||||
u8 *eeprom = dev->mt76.eeprom.data;
|
||||
u8 tx_mask, max_nss;
|
||||
u32 val;
|
||||
|
||||
mt7615_eeprom_parse_hw_band_cap(dev);
|
||||
|
||||
/* read tx-rx mask from eeprom */
|
||||
val = mt76_rr(dev, MT_TOP_STRAP_STA);
|
||||
|
Loading…
x
Reference in New Issue
Block a user