mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: introduce mt792x_config_mac_addr_list routine
Add mt792x_config_mac_addr_list routine in order to set the mac address list supported by the driver. Initialize wiphy->addresses/n_addresses for mt792x driver Signed-off-by: Hao Zhang <[email protected]> Signed-off-by: Leon Yen <[email protected]> Signed-off-by: Allan Wang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
eb85bb3fd5
commit
83e4d4a82e
@@ -227,6 +227,7 @@ static void mt7921_init_work(struct work_struct *work)
|
|||||||
|
|
||||||
mt76_set_stream_caps(&dev->mphy, true);
|
mt76_set_stream_caps(&dev->mphy, true);
|
||||||
mt7921_set_stream_he_caps(&dev->phy);
|
mt7921_set_stream_he_caps(&dev->phy);
|
||||||
|
mt792x_config_mac_addr_list(dev);
|
||||||
|
|
||||||
ret = mt76_register_device(&dev->mt76, true, mt76_rates,
|
ret = mt76_register_device(&dev->mt76, true, mt76_rates,
|
||||||
ARRAY_SIZE(mt76_rates));
|
ARRAY_SIZE(mt76_rates));
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ static void mt7925_init_work(struct work_struct *work)
|
|||||||
|
|
||||||
mt76_set_stream_caps(&dev->mphy, true);
|
mt76_set_stream_caps(&dev->mphy, true);
|
||||||
mt7925_set_stream_he_eht_caps(&dev->phy);
|
mt7925_set_stream_he_eht_caps(&dev->phy);
|
||||||
|
mt792x_config_mac_addr_list(dev);
|
||||||
|
|
||||||
ret = mt7925_init_mlo_caps(&dev->phy);
|
ret = mt7925_init_mlo_caps(&dev->phy);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|||||||
@@ -206,6 +206,8 @@ struct mt792x_dev {
|
|||||||
struct mt76_phy mphy;
|
struct mt76_phy mphy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct mac_address macaddr_list[8];
|
||||||
|
|
||||||
const struct mt76_bus_ops *bus_ops;
|
const struct mt76_bus_ops *bus_ops;
|
||||||
struct mt792x_phy phy;
|
struct mt792x_phy phy;
|
||||||
|
|
||||||
@@ -414,6 +416,7 @@ int mt792x_mcu_fw_pmctrl(struct mt792x_dev *dev);
|
|||||||
void mt792x_mac_link_bss_remove(struct mt792x_dev *dev,
|
void mt792x_mac_link_bss_remove(struct mt792x_dev *dev,
|
||||||
struct mt792x_bss_conf *mconf,
|
struct mt792x_bss_conf *mconf,
|
||||||
struct mt792x_link_sta *mlink);
|
struct mt792x_link_sta *mlink);
|
||||||
|
void mt792x_config_mac_addr_list(struct mt792x_dev *dev);
|
||||||
|
|
||||||
static inline char *mt792x_ram_name(struct mt792x_dev *dev)
|
static inline char *mt792x_ram_name(struct mt792x_dev *dev)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -916,6 +916,28 @@ int mt792x_load_firmware(struct mt792x_dev *dev)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(mt792x_load_firmware);
|
EXPORT_SYMBOL_GPL(mt792x_load_firmware);
|
||||||
|
|
||||||
|
void mt792x_config_mac_addr_list(struct mt792x_dev *dev)
|
||||||
|
{
|
||||||
|
struct ieee80211_hw *hw = mt76_hw(dev);
|
||||||
|
struct wiphy *wiphy = hw->wiphy;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_SIZE(dev->macaddr_list); i++) {
|
||||||
|
u8 *addr = dev->macaddr_list[i].addr;
|
||||||
|
|
||||||
|
memcpy(addr, dev->mphy.macaddr, ETH_ALEN);
|
||||||
|
|
||||||
|
if (!i)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
addr[0] |= BIT(1);
|
||||||
|
addr[0] ^= ((i - 1) << 2);
|
||||||
|
}
|
||||||
|
wiphy->addresses = dev->macaddr_list;
|
||||||
|
wiphy->n_addresses = ARRAY_SIZE(dev->macaddr_list);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(mt792x_config_mac_addr_list);
|
||||||
|
|
||||||
MODULE_DESCRIPTION("MediaTek MT792x core driver");
|
MODULE_DESCRIPTION("MediaTek MT792x core driver");
|
||||||
MODULE_LICENSE("Dual BSD/GPL");
|
MODULE_LICENSE("Dual BSD/GPL");
|
||||||
MODULE_AUTHOR("Lorenzo Bianconi <[email protected]>");
|
MODULE_AUTHOR("Lorenzo Bianconi <[email protected]>");
|
||||||
|
|||||||
Reference in New Issue
Block a user