Commit 635cb010 authored by Felix Fietkau's avatar Felix Fietkau

mt76: mt7615: disable hw/sched scan ops for non-offload firmware

Avoid having to attempt hw scan and fall back to software for every scan
on devices/firmware without hw scan support
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 6bcfdabb
...@@ -143,6 +143,13 @@ static void mt7615_init_work(struct work_struct *work) ...@@ -143,6 +143,13 @@ static void mt7615_init_work(struct work_struct *work)
mt7615_mac_init(dev); mt7615_mac_init(dev);
mt7615_phy_init(dev); mt7615_phy_init(dev);
mt7615_mcu_del_wtbl_all(dev); mt7615_mcu_del_wtbl_all(dev);
if (!mt7615_firmware_offload(dev)) {
dev->ops->hw_scan = NULL;
dev->ops->cancel_hw_scan = NULL;
dev->ops->sched_scan_start = NULL;
dev->ops->sched_scan_stop = NULL;
}
} }
static int mt7615_init_hardware(struct mt7615_dev *dev) static int mt7615_init_hardware(struct mt7615_dev *dev)
......
...@@ -139,11 +139,16 @@ int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base, ...@@ -139,11 +139,16 @@ int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base,
.sta_remove = mt7615_mac_sta_remove, .sta_remove = mt7615_mac_sta_remove,
.update_survey = mt7615_update_channel, .update_survey = mt7615_update_channel,
}; };
struct ieee80211_ops *ops;
struct mt7615_dev *dev; struct mt7615_dev *dev;
struct mt76_dev *mdev; struct mt76_dev *mdev;
int ret; int ret;
mdev = mt76_alloc_device(pdev, sizeof(*dev), &mt7615_ops, &drv_ops); ops = devm_kmemdup(pdev, &mt7615_ops, sizeof(mt7615_ops), GFP_KERNEL);
if (!ops)
return -ENOMEM;
mdev = mt76_alloc_device(pdev, sizeof(*dev), ops, &drv_ops);
if (!mdev) if (!mdev)
return -ENOMEM; return -ENOMEM;
...@@ -151,6 +156,7 @@ int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base, ...@@ -151,6 +156,7 @@ int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base,
mt76_mmio_init(&dev->mt76, mem_base); mt76_mmio_init(&dev->mt76, mem_base);
dev->reg_map = map; dev->reg_map = map;
dev->ops = ops;
mdev->rev = (mt76_rr(dev, MT_HW_CHIPID) << 16) | mdev->rev = (mt76_rr(dev, MT_HW_CHIPID) << 16) |
(mt76_rr(dev, MT_HW_REV) & 0xff); (mt76_rr(dev, MT_HW_REV) & 0xff);
dev_dbg(mdev->dev, "ASIC revision: %04x\n", mdev->rev); dev_dbg(mdev->dev, "ASIC revision: %04x\n", mdev->rev);
......
...@@ -235,6 +235,7 @@ struct mt7615_dev { ...@@ -235,6 +235,7 @@ struct mt7615_dev {
u16 chainmask; u16 chainmask;
struct ieee80211_ops *ops;
const struct mt7615_mcu_ops *mcu_ops; const struct mt7615_mcu_ops *mcu_ops;
struct regmap *infracfg; struct regmap *infracfg;
const u32 *reg_map; const u32 *reg_map;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment