mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: add init_wiphy callback
Add an optional callback for drivers to finalize wiphy state after mt76 has initialized the supported bands and before registration. Co-developed-by: Stella Liu <[email protected]> Signed-off-by: Stella Liu <[email protected]> Co-developed-by: Jeremy Yu <[email protected]> Signed-off-by: Jeremy Yu <[email protected]> Signed-off-by: Sean Wang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -681,6 +681,7 @@ mt76_alloc_device(struct device *pdev, unsigned int size,
|
||||
dev = hw->priv;
|
||||
dev->hw = hw;
|
||||
dev->dev = pdev;
|
||||
dev->init_wiphy = NULL;
|
||||
dev->drv = drv_ops;
|
||||
dev->dma_dev = pdev;
|
||||
|
||||
@@ -779,6 +780,12 @@ int mt76_register_device(struct mt76_dev *dev, bool vht,
|
||||
mt76_check_sband(&dev->phy, &phy->sband_5g, NL80211_BAND_5GHZ);
|
||||
mt76_check_sband(&dev->phy, &phy->sband_6g, NL80211_BAND_6GHZ);
|
||||
|
||||
if (dev->init_wiphy) {
|
||||
ret = dev->init_wiphy(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_MT76_LEDS)) {
|
||||
ret = mt76_led_init(phy);
|
||||
if (ret)
|
||||
|
||||
Reference in New Issue
Block a user