From b46655aaa0b8620ce03939cabaa449384c559530 Mon Sep 17 00:00:00 2001 From: Goetz Goerisch Date: Thu, 11 Sep 2025 07:18:34 +0200 Subject: [PATCH 01/87] kernel: bump 6.6 to 6.6.105 removed upstreamed patches: generic/backport-6.6/621-proc-fix-missing-pde_set_flags.patch [1] generic/pending-6.6/742-net-ethernet-mtk_eth_soc-fix-tx-vlan-tag-for-llc-pac.patch [2] manually rebase patches: bcm27xx/patches-6.6/950-0518-net-macb-Also-set-DMA-coherent-mask.patch [3] all other patches autorefreshed. [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.105&id=698abcf08818cb7bafb978f4c9f6674d6a825d10 [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.105&id=61b80fbdc0726317f72f9074e10126e0eb0e49c5 [3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.105&id=5430388a81113e62a2d48b5d7dc1e76231908ebf Signed-off-by: Goetz Goerisch Link: https://github.com/openwrt/openwrt/pull/20013 (cherry picked from commit 67c5ec70926621e2145796e7d1f4715809385d82) Signed-off-by: Goetz Goerisch Link: https://github.com/openwrt/openwrt/pull/20036 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 +- ...-net-macb-Also-set-DMA-coherent-mask.patch | 28 ++-- ...port-for-Raspberry-Pi-RP1-ethernet-c.patch | 4 +- .../621-proc-fix-missing-pde_set_flags.patch | 121 ------------------ ...iatek-split-tx-and-rx-fields-in-mtk_.patch | 66 +++++----- ...iatek-use-QDMA-instead-of-ADMAv2-on-.patch | 12 +- ..._eth_soc-handle-dma-buffer-size-soc-.patch | 38 +++--- ..._eth_soc-ppe-add-support-for-multipl.patch | 28 ++-- ...ediatek-Allow-gaps-in-MAC-allocation.patch | 2 +- ..._eth_soc-implement-.-get-set-_pausep.patch | 4 +- ...net-mtk_eth_soc-enable-threaded-NAPI.patch | 2 +- ..._eth_soc-work-around-issue-with-send.patch | 4 +- ...ernet-mtk_eth_soc-use-napi_build_skb.patch | 4 +- ...-mediatek-enlarge-DMA-reserve-buffer.patch | 2 +- ..._eth_soc-add-paths-and-SerDes-modes-.patch | 18 +-- ...th_soc-reduce-rx-ring-size-for-older.patch | 16 +-- ..._eth_soc-do-not-enable-page-pool-sta.patch | 4 +- ..._eth_soc-fix-tx-vlan-tag-for-llc-pac.patch | 39 ------ .../0001-MIPS-lantiq-add-pcie-driver.patch | 2 +- ...vert-to-platform-remove-callback-ret.patch | 6 +- ...mediatek-lvts_thermal-Make-coeff-con.patch | 30 ++--- ...mediatek-lvts_thermal-Add-mt7988-sup.patch | 10 +- ...mediatek-lvts_thermal-Fix-error-chec.patch | 2 +- ...mediatek-lvts_thermal-Add-suspend-an.patch | 4 +- ...mediatek-lvts_thermal-Add-mt8192-sup.patch | 8 +- ...mediatek-lvts_thermal-Update-calibra.patch | 4 +- 26 files changed, 151 insertions(+), 311 deletions(-) delete mode 100644 target/linux/generic/backport-6.6/621-proc-fix-missing-pde_set_flags.patch delete mode 100644 target/linux/generic/pending-6.6/742-net-ethernet-mtk_eth_soc-fix-tx-vlan-tag-for-llc-pac.patch diff --git a/include/kernel-6.6 b/include/kernel-6.6 index 70decb6786..a411ab0aff 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .104 -LINUX_KERNEL_HASH-6.6.104 = 2a772f9d661afabaaddcdfd1116239acb2d943377aceab9e0baed2b7a915e36a +LINUX_VERSION-6.6 = .105 +LINUX_KERNEL_HASH-6.6.105 = 3f916e664f1872980b436614cba1d8b10246033435e0312ea0d8cc16599e1a1d diff --git a/target/linux/bcm27xx/patches-6.6/950-0518-net-macb-Also-set-DMA-coherent-mask.patch b/target/linux/bcm27xx/patches-6.6/950-0518-net-macb-Also-set-DMA-coherent-mask.patch index 9abdb37960..e164a7b683 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0518-net-macb-Also-set-DMA-coherent-mask.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0518-net-macb-Also-set-DMA-coherent-mask.patch @@ -199,7 +199,7 @@ Signed-off-by: Jonathan Bell snprintf(bp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", bp->pdev->name, bp->pdev->id); bp->mii_bus->priv = bp; -@@ -1641,6 +1658,11 @@ static int macb_rx(struct macb_queue *qu +@@ -1642,6 +1659,11 @@ static int macb_rx(struct macb_queue *qu macb_init_rx_ring(queue); queue_writel(queue, RBQP, queue->rx_ring_dma); @@ -211,7 +211,7 @@ Signed-off-by: Jonathan Bell macb_writel(bp, NCR, ctrl | MACB_BIT(RE)); -@@ -1941,8 +1963,9 @@ static irqreturn_t macb_interrupt(int ir +@@ -1944,8 +1966,9 @@ static irqreturn_t macb_interrupt(int ir queue_writel(queue, ISR, MACB_BIT(TCOMP) | MACB_BIT(TXUBR)); @@ -222,19 +222,19 @@ Signed-off-by: Jonathan Bell wmb(); // ensure softirq can see update } -@@ -2397,6 +2420,11 @@ static netdev_tx_t macb_start_xmit(struc +@@ -2401,6 +2424,11 @@ static netdev_tx_t macb_start_xmit(struc skb_tx_timestamp(skb); - spin_lock_irq(&bp->lock); + spin_lock(&bp->lock); + + /* TSTART write might get dropped, so make the IRQ retrigger a buffer read */ + if (macb_readl(bp, TSR) & MACB_BIT(TGO)) + queue->tx_pending = 1; + macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TSTART)); - spin_unlock_irq(&bp->lock); + spin_unlock(&bp->lock); -@@ -2771,6 +2799,37 @@ static void macb_configure_dma(struct ma +@@ -2775,6 +2803,37 @@ static void macb_configure_dma(struct ma } } @@ -272,7 +272,7 @@ Signed-off-by: Jonathan Bell static void macb_init_hw(struct macb *bp) { u32 config; -@@ -2799,6 +2858,11 @@ static void macb_init_hw(struct macb *bp +@@ -2803,6 +2862,11 @@ static void macb_init_hw(struct macb *bp if (bp->caps & MACB_CAPS_JUMBO) bp->rx_frm_len_mask = MACB_RX_JFRMLEN_MASK; @@ -284,7 +284,7 @@ Signed-off-by: Jonathan Bell macb_configure_dma(bp); /* Enable RX partial store and forward and set watermark */ -@@ -3163,6 +3227,52 @@ static void gem_get_ethtool_strings(stru +@@ -3167,6 +3231,52 @@ static void gem_get_ethtool_strings(stru } } @@ -337,7 +337,7 @@ Signed-off-by: Jonathan Bell static struct net_device_stats *macb_get_stats(struct net_device *dev) { struct macb *bp = netdev_priv(dev); -@@ -3757,6 +3867,8 @@ static const struct ethtool_ops macb_eth +@@ -3761,6 +3871,8 @@ static const struct ethtool_ops macb_eth }; static const struct ethtool_ops gem_ethtool_ops = { @@ -346,7 +346,7 @@ Signed-off-by: Jonathan Bell .get_regs_len = macb_get_regs_len, .get_regs = macb_get_regs, .get_wol = macb_get_wol, -@@ -3766,6 +3878,8 @@ static const struct ethtool_ops gem_etht +@@ -3770,6 +3882,8 @@ static const struct ethtool_ops gem_etht .get_ethtool_stats = gem_get_ethtool_stats, .get_strings = gem_get_ethtool_strings, .get_sset_count = gem_get_sset_count, @@ -355,7 +355,7 @@ Signed-off-by: Jonathan Bell .get_link_ksettings = macb_get_link_ksettings, .set_link_ksettings = macb_set_link_ksettings, .get_ringparam = macb_get_ringparam, -@@ -5062,6 +5176,11 @@ static int macb_probe(struct platform_de +@@ -5066,6 +5180,11 @@ static int macb_probe(struct platform_de } } } @@ -367,7 +367,7 @@ Signed-off-by: Jonathan Bell spin_lock_init(&bp->lock); spin_lock_init(&bp->stats_lock); -@@ -5122,6 +5241,21 @@ static int macb_probe(struct platform_de +@@ -5126,6 +5245,21 @@ static int macb_probe(struct platform_de else bp->phy_interface = interface; @@ -389,7 +389,7 @@ Signed-off-by: Jonathan Bell /* IP specific init */ err = init(pdev); if (err) -@@ -5198,6 +5332,19 @@ static int macb_remove(struct platform_d +@@ -5202,6 +5336,19 @@ static int macb_remove(struct platform_d return 0; } @@ -409,7 +409,7 @@ Signed-off-by: Jonathan Bell static int __maybe_unused macb_suspend(struct device *dev) { struct net_device *netdev = dev_get_drvdata(dev); -@@ -5412,6 +5559,7 @@ static const struct dev_pm_ops macb_pm_o +@@ -5416,6 +5563,7 @@ static const struct dev_pm_ops macb_pm_o static struct platform_driver macb_driver = { .probe = macb_probe, .remove = macb_remove, diff --git a/target/linux/bcm27xx/patches-6.6/950-1423-net-macb-Add-support-for-Raspberry-Pi-RP1-ethernet-c.patch b/target/linux/bcm27xx/patches-6.6/950-1423-net-macb-Add-support-for-Raspberry-Pi-RP1-ethernet-c.patch index 6a9b7b36bd..14220b754e 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1423-net-macb-Add-support-for-Raspberry-Pi-RP1-ethernet-c.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1423-net-macb-Add-support-for-Raspberry-Pi-RP1-ethernet-c.patch @@ -15,7 +15,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c -@@ -5023,6 +5023,17 @@ static const struct macb_config versal_c +@@ -5027,6 +5027,17 @@ static const struct macb_config versal_c .usrio = &macb_default_usrio, }; @@ -33,7 +33,7 @@ Signed-off-by: Dave Stevenson static const struct of_device_id macb_dt_ids[] = { { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config }, { .compatible = "cdns,macb" }, -@@ -5043,6 +5054,7 @@ static const struct of_device_id macb_dt +@@ -5047,6 +5058,7 @@ static const struct of_device_id macb_dt { .compatible = "microchip,mpfs-macb", .data = &mpfs_config }, { .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config }, { .compatible = "microchip,sama7g5-emac", .data = &sama7g5_emac_config }, diff --git a/target/linux/generic/backport-6.6/621-proc-fix-missing-pde_set_flags.patch b/target/linux/generic/backport-6.6/621-proc-fix-missing-pde_set_flags.patch deleted file mode 100644 index ba026b9c3a..0000000000 --- a/target/linux/generic/backport-6.6/621-proc-fix-missing-pde_set_flags.patch +++ /dev/null @@ -1,121 +0,0 @@ -From: wangzijie -To: , , - , , - , , - , , - -Cc: , , - , , - wangzijie -Subject: [PATCH v3] proc: fix missing pde_set_flags() for net proc files -Date: Thu, 21 Aug 2025 18:58:06 +0800 [thread overview] -Message-ID: <20250821105806.1453833-1-wangzijie1@honor.com> (raw) - -To avoid potential UAF issues during module removal races, we use pde_set_flags() -to save proc_ops flags in PDE itself before proc_register(), and then use -pde_has_proc_*() helpers instead of directly dereferencing pde->proc_ops->*. - -However, the pde_set_flags() call was missing when creating net related proc files. -This omission caused incorrect behavior which FMODE_LSEEK was being cleared -inappropriately in proc_reg_open() for net proc files. Lars reported it in this link[1]. - -Fix this by ensuring pde_set_flags() is called when register proc entry, and add -NULL check for proc_ops in pde_set_flags(). - -[1]: https://lore.kernel.org/all/20250815195616.64497967@chagall.paradoxon.rec/ - -Fixes: ff7ec8dc1b64 ("proc: use the same treatment to check proc_lseek as ones for proc_read_iter et.al") -Cc: stable@vger.kernel.org -Reported-by: Lars Wendler -Signed-off-by: wangzijie ---- -v3: -- followed by Christian's suggestion to stash pde->proc_ops in a local const variable -v2: -- followed by Jiri's suggestion to refractor code and reformat commit message ---- - fs/proc/generic.c | 38 +++++++++++++++++++++----------------- - 1 file changed, 21 insertions(+), 17 deletions(-) - ---- a/fs/proc/generic.c -+++ b/fs/proc/generic.c -@@ -362,6 +362,25 @@ static const struct inode_operations pro - .setattr = proc_notify_change, - }; - -+static void pde_set_flags(struct proc_dir_entry *pde) -+{ -+ const struct proc_ops *proc_ops = pde->proc_ops; -+ -+ if (!proc_ops) -+ return; -+ -+ if (proc_ops->proc_flags & PROC_ENTRY_PERMANENT) -+ pde->flags |= PROC_ENTRY_PERMANENT; -+ if (proc_ops->proc_read_iter) -+ pde->flags |= PROC_ENTRY_proc_read_iter; -+#ifdef CONFIG_COMPAT -+ if (proc_ops->proc_compat_ioctl) -+ pde->flags |= PROC_ENTRY_proc_compat_ioctl; -+#endif -+ if (proc_ops->proc_lseek) -+ pde->flags |= PROC_ENTRY_proc_lseek; -+} -+ - /* returns the registered entry, or frees dp and returns NULL on failure */ - struct proc_dir_entry *proc_register(struct proc_dir_entry *dir, - struct proc_dir_entry *dp) -@@ -369,6 +388,8 @@ struct proc_dir_entry *proc_register(str - if (proc_alloc_inum(&dp->low_ino)) - goto out_free_entry; - -+ pde_set_flags(dp); -+ - write_lock(&proc_subdir_lock); - dp->parent = dir; - if (pde_subdir_insert(dir, dp) == false) { -@@ -557,20 +578,6 @@ struct proc_dir_entry *proc_create_reg(c - return p; - } - --static void pde_set_flags(struct proc_dir_entry *pde) --{ -- if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) -- pde->flags |= PROC_ENTRY_PERMANENT; -- if (pde->proc_ops->proc_read_iter) -- pde->flags |= PROC_ENTRY_proc_read_iter; --#ifdef CONFIG_COMPAT -- if (pde->proc_ops->proc_compat_ioctl) -- pde->flags |= PROC_ENTRY_proc_compat_ioctl; --#endif -- if (pde->proc_ops->proc_lseek) -- pde->flags |= PROC_ENTRY_proc_lseek; --} -- - struct proc_dir_entry *proc_create_data(const char *name, umode_t mode, - struct proc_dir_entry *parent, - const struct proc_ops *proc_ops, void *data) -@@ -581,7 +588,6 @@ struct proc_dir_entry *proc_create_data( - if (!p) - return NULL; - p->proc_ops = proc_ops; -- pde_set_flags(p); - return proc_register(parent, p); - } - EXPORT_SYMBOL(proc_create_data); -@@ -632,7 +638,6 @@ struct proc_dir_entry *proc_create_seq_p - p->proc_ops = &proc_seq_ops; - p->seq_ops = ops; - p->state_size = state_size; -- pde_set_flags(p); - return proc_register(parent, p); - } - EXPORT_SYMBOL(proc_create_seq_private); -@@ -663,7 +668,6 @@ struct proc_dir_entry *proc_create_singl - return NULL; - p->proc_ops = &proc_single_ops; - p->single_show = show; -- pde_set_flags(p); - return proc_register(parent, p); - } - EXPORT_SYMBOL(proc_create_single_data); diff --git a/target/linux/generic/backport-6.6/751-01-v6.8-net-ethernet-mediatek-split-tx-and-rx-fields-in-mtk_.patch b/target/linux/generic/backport-6.6/751-01-v6.8-net-ethernet-mediatek-split-tx-and-rx-fields-in-mtk_.patch index 7d232563ca..8369007dd1 100644 --- a/target/linux/generic/backport-6.6/751-01-v6.8-net-ethernet-mediatek-split-tx-and-rx-fields-in-mtk_.patch +++ b/target/linux/generic/backport-6.6/751-01-v6.8-net-ethernet-mediatek-split-tx-and-rx-fields-in-mtk_.patch @@ -104,7 +104,7 @@ Signed-off-by: Jakub Kicinski } } else { nfrags += skb_shinfo(skb)->nr_frags; -@@ -1650,7 +1650,7 @@ static struct mtk_rx_ring *mtk_get_rx_ri +@@ -1658,7 +1658,7 @@ static struct mtk_rx_ring *mtk_get_rx_ri ring = ð->rx_ring[i]; idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size); @@ -113,7 +113,7 @@ Signed-off-by: Jakub Kicinski if (rxd->rxd2 & RX_DMA_DONE) { ring->calc_idx_update = true; return ring; -@@ -1818,7 +1818,7 @@ static int mtk_xdp_submit_frame(struct m +@@ -1826,7 +1826,7 @@ static int mtk_xdp_submit_frame(struct m } htxd = txd; @@ -122,7 +122,7 @@ Signed-off-by: Jakub Kicinski memset(tx_buf, 0, sizeof(*tx_buf)); htx_buf = tx_buf; -@@ -1837,7 +1837,7 @@ static int mtk_xdp_submit_frame(struct m +@@ -1845,7 +1845,7 @@ static int mtk_xdp_submit_frame(struct m goto unmap; tx_buf = mtk_desc_to_tx_buf(ring, txd, @@ -131,7 +131,7 @@ Signed-off-by: Jakub Kicinski memset(tx_buf, 0, sizeof(*tx_buf)); n_desc++; } -@@ -1875,7 +1875,7 @@ static int mtk_xdp_submit_frame(struct m +@@ -1883,7 +1883,7 @@ static int mtk_xdp_submit_frame(struct m } else { int idx; @@ -140,7 +140,7 @@ Signed-off-by: Jakub Kicinski mtk_w32(eth, NEXT_DESP_IDX(idx, ring->dma_size), MT7628_TX_CTX_IDX0); } -@@ -1886,7 +1886,7 @@ static int mtk_xdp_submit_frame(struct m +@@ -1894,7 +1894,7 @@ static int mtk_xdp_submit_frame(struct m unmap: while (htxd != txd) { @@ -149,7 +149,7 @@ Signed-off-by: Jakub Kicinski mtk_tx_unmap(eth, tx_buf, NULL, false); htxd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU; -@@ -2017,7 +2017,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -2025,7 +2025,7 @@ static int mtk_poll_rx(struct napi_struc goto rx_done; idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size); @@ -158,7 +158,7 @@ Signed-off-by: Jakub Kicinski data = ring->data[idx]; if (!mtk_rx_get_desc(eth, &trxd, rxd)) -@@ -2152,7 +2152,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -2160,7 +2160,7 @@ static int mtk_poll_rx(struct napi_struc rxdcsum = &trxd.rxd4; } @@ -167,7 +167,7 @@ Signed-off-by: Jakub Kicinski skb->ip_summed = CHECKSUM_UNNECESSARY; else skb_checksum_none_assert(skb); -@@ -2280,7 +2280,7 @@ static int mtk_poll_tx_qdma(struct mtk_e +@@ -2288,7 +2288,7 @@ static int mtk_poll_tx_qdma(struct mtk_e break; tx_buf = mtk_desc_to_tx_buf(ring, desc, @@ -176,7 +176,7 @@ Signed-off-by: Jakub Kicinski if (!tx_buf->data) break; -@@ -2331,7 +2331,7 @@ static int mtk_poll_tx_pdma(struct mtk_e +@@ -2339,7 +2339,7 @@ static int mtk_poll_tx_pdma(struct mtk_e } mtk_tx_unmap(eth, tx_buf, &bq, true); @@ -185,7 +185,7 @@ Signed-off-by: Jakub Kicinski ring->last_free = desc; atomic_inc(&ring->free_count); -@@ -2421,7 +2421,7 @@ static int mtk_napi_rx(struct napi_struc +@@ -2429,7 +2429,7 @@ static int mtk_napi_rx(struct napi_struc do { int rx_done; @@ -194,7 +194,7 @@ Signed-off-by: Jakub Kicinski reg_map->pdma.irq_status); rx_done = mtk_poll_rx(napi, budget - rx_done_total, eth); rx_done_total += rx_done; -@@ -2437,10 +2437,10 @@ static int mtk_napi_rx(struct napi_struc +@@ -2445,10 +2445,10 @@ static int mtk_napi_rx(struct napi_struc return budget; } while (mtk_r32(eth, reg_map->pdma.irq_status) & @@ -207,7 +207,7 @@ Signed-off-by: Jakub Kicinski return rx_done_total; } -@@ -2449,7 +2449,7 @@ static int mtk_tx_alloc(struct mtk_eth * +@@ -2457,7 +2457,7 @@ static int mtk_tx_alloc(struct mtk_eth * { const struct mtk_soc_data *soc = eth->soc; struct mtk_tx_ring *ring = ð->tx_ring; @@ -216,7 +216,7 @@ Signed-off-by: Jakub Kicinski struct mtk_tx_dma_v2 *txd; int ring_size; u32 ofs, val; -@@ -2572,14 +2572,14 @@ static void mtk_tx_clean(struct mtk_eth +@@ -2580,14 +2580,14 @@ static void mtk_tx_clean(struct mtk_eth } if (!MTK_HAS_CAPS(soc->caps, MTK_SRAM) && ring->dma) { dma_free_coherent(eth->dma_dev, @@ -233,7 +233,7 @@ Signed-off-by: Jakub Kicinski ring->dma_pdma, ring->phys_pdma); ring->dma_pdma = NULL; } -@@ -2634,15 +2634,15 @@ static int mtk_rx_alloc(struct mtk_eth * +@@ -2642,15 +2642,15 @@ static int mtk_rx_alloc(struct mtk_eth * if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SRAM) || rx_flag != MTK_RX_FLAGS_NORMAL) { ring->dma = dma_alloc_coherent(eth->dma_dev, @@ -253,7 +253,7 @@ Signed-off-by: Jakub Kicinski } if (!ring->dma) -@@ -2653,7 +2653,7 @@ static int mtk_rx_alloc(struct mtk_eth * +@@ -2661,7 +2661,7 @@ static int mtk_rx_alloc(struct mtk_eth * dma_addr_t dma_addr; void *data; @@ -262,7 +262,7 @@ Signed-off-by: Jakub Kicinski if (ring->page_pool) { data = mtk_page_pool_get_buff(ring->page_pool, &dma_addr, GFP_KERNEL); -@@ -2744,7 +2744,7 @@ static void mtk_rx_clean(struct mtk_eth +@@ -2752,7 +2752,7 @@ static void mtk_rx_clean(struct mtk_eth if (!ring->data[i]) continue; @@ -271,7 +271,7 @@ Signed-off-by: Jakub Kicinski if (!rxd->rxd1) continue; -@@ -2761,7 +2761,7 @@ static void mtk_rx_clean(struct mtk_eth +@@ -2769,7 +2769,7 @@ static void mtk_rx_clean(struct mtk_eth if (!in_sram && ring->dma) { dma_free_coherent(eth->dma_dev, @@ -280,7 +280,7 @@ Signed-off-by: Jakub Kicinski ring->dma, ring->phys); ring->dma = NULL; } -@@ -3132,7 +3132,7 @@ static void mtk_dma_free(struct mtk_eth +@@ -3140,7 +3140,7 @@ static void mtk_dma_free(struct mtk_eth if (!MTK_HAS_CAPS(soc->caps, MTK_SRAM) && eth->scratch_ring) { dma_free_coherent(eth->dma_dev, @@ -289,7 +289,7 @@ Signed-off-by: Jakub Kicinski eth->scratch_ring, eth->phy_scratch_ring); eth->scratch_ring = NULL; eth->phy_scratch_ring = 0; -@@ -3182,7 +3182,7 @@ static irqreturn_t mtk_handle_irq_rx(int +@@ -3190,7 +3190,7 @@ static irqreturn_t mtk_handle_irq_rx(int eth->rx_events++; if (likely(napi_schedule_prep(ð->rx_napi))) { @@ -298,7 +298,7 @@ Signed-off-by: Jakub Kicinski __napi_schedule(ð->rx_napi); } -@@ -3208,9 +3208,9 @@ static irqreturn_t mtk_handle_irq(int ir +@@ -3216,9 +3216,9 @@ static irqreturn_t mtk_handle_irq(int ir const struct mtk_reg_map *reg_map = eth->soc->reg_map; if (mtk_r32(eth, reg_map->pdma.irq_mask) & @@ -310,7 +310,7 @@ Signed-off-by: Jakub Kicinski mtk_handle_irq_rx(irq, _eth); } if (mtk_r32(eth, reg_map->tx_irq_mask) & MTK_TX_DONE_INT) { -@@ -3228,10 +3228,10 @@ static void mtk_poll_controller(struct n +@@ -3236,10 +3236,10 @@ static void mtk_poll_controller(struct n struct mtk_eth *eth = mac->hw; mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); @@ -323,7 +323,7 @@ Signed-off-by: Jakub Kicinski } #endif -@@ -3395,7 +3395,7 @@ static int mtk_open(struct net_device *d +@@ -3403,7 +3403,7 @@ static int mtk_open(struct net_device *d napi_enable(ð->tx_napi); napi_enable(ð->rx_napi); mtk_tx_irq_enable(eth, MTK_TX_DONE_INT); @@ -332,7 +332,7 @@ Signed-off-by: Jakub Kicinski refcount_set(ð->dma_refcnt, 1); } else -@@ -3479,7 +3479,7 @@ static int mtk_stop(struct net_device *d +@@ -3487,7 +3487,7 @@ static int mtk_stop(struct net_device *d mtk_gdm_config(eth, MTK_GDMA_DROP_ALL); mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); @@ -341,7 +341,7 @@ Signed-off-by: Jakub Kicinski napi_disable(ð->tx_napi); napi_disable(ð->rx_napi); -@@ -3955,9 +3955,9 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3963,9 +3963,9 @@ static int mtk_hw_init(struct mtk_eth *e /* FE int grouping */ mtk_w32(eth, MTK_TX_DONE_INT, reg_map->pdma.int_grp); @@ -353,7 +353,7 @@ Signed-off-by: Jakub Kicinski mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); if (mtk_is_netsys_v3_or_greater(eth)) { -@@ -5065,11 +5065,15 @@ static const struct mtk_soc_data mt2701_ +@@ -5073,11 +5073,15 @@ static const struct mtk_soc_data mt2701_ .required_clks = MT7623_CLKS_BITMAP, .required_pctl = true, .version = 1, @@ -374,7 +374,7 @@ Signed-off-by: Jakub Kicinski .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5085,11 +5089,15 @@ static const struct mtk_soc_data mt7621_ +@@ -5093,11 +5097,15 @@ static const struct mtk_soc_data mt7621_ .offload_version = 1, .hash_offset = 2, .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, @@ -395,7 +395,7 @@ Signed-off-by: Jakub Kicinski .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5107,11 +5115,15 @@ static const struct mtk_soc_data mt7622_ +@@ -5115,11 +5123,15 @@ static const struct mtk_soc_data mt7622_ .hash_offset = 2, .has_accounting = true, .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, @@ -416,7 +416,7 @@ Signed-off-by: Jakub Kicinski .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5128,11 +5140,15 @@ static const struct mtk_soc_data mt7623_ +@@ -5136,11 +5148,15 @@ static const struct mtk_soc_data mt7623_ .hash_offset = 2, .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, .disable_pll_modes = true, @@ -437,7 +437,7 @@ Signed-off-by: Jakub Kicinski .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5147,11 +5163,15 @@ static const struct mtk_soc_data mt7629_ +@@ -5155,11 +5171,15 @@ static const struct mtk_soc_data mt7629_ .required_pctl = false, .has_accounting = true, .version = 1, @@ -458,7 +458,7 @@ Signed-off-by: Jakub Kicinski .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5169,11 +5189,15 @@ static const struct mtk_soc_data mt7981_ +@@ -5177,11 +5197,15 @@ static const struct mtk_soc_data mt7981_ .hash_offset = 4, .has_accounting = true, .foe_entry_size = MTK_FOE_ENTRY_V2_SIZE, @@ -479,7 +479,7 @@ Signed-off-by: Jakub Kicinski .dma_max_len = MTK_TX_DMA_BUF_LEN_V2, .dma_len_offset = 8, }, -@@ -5191,11 +5215,15 @@ static const struct mtk_soc_data mt7986_ +@@ -5199,11 +5223,15 @@ static const struct mtk_soc_data mt7986_ .hash_offset = 4, .has_accounting = true, .foe_entry_size = MTK_FOE_ENTRY_V2_SIZE, @@ -500,7 +500,7 @@ Signed-off-by: Jakub Kicinski .dma_max_len = MTK_TX_DMA_BUF_LEN_V2, .dma_len_offset = 8, }, -@@ -5213,11 +5241,15 @@ static const struct mtk_soc_data mt7988_ +@@ -5221,11 +5249,15 @@ static const struct mtk_soc_data mt7988_ .hash_offset = 4, .has_accounting = true, .foe_entry_size = MTK_FOE_ENTRY_V3_SIZE, @@ -521,7 +521,7 @@ Signed-off-by: Jakub Kicinski .dma_max_len = MTK_TX_DMA_BUF_LEN_V2, .dma_len_offset = 8, }, -@@ -5230,11 +5262,15 @@ static const struct mtk_soc_data rt5350_ +@@ -5238,11 +5270,15 @@ static const struct mtk_soc_data rt5350_ .required_clks = MT7628_CLKS_BITMAP, .required_pctl = false, .version = 1, diff --git a/target/linux/generic/backport-6.6/751-02-v6.8-net-ethernet-mediatek-use-QDMA-instead-of-ADMAv2-on-.patch b/target/linux/generic/backport-6.6/751-02-v6.8-net-ethernet-mediatek-use-QDMA-instead-of-ADMAv2-on-.patch index 3531399b83..4a868fad43 100644 --- a/target/linux/generic/backport-6.6/751-02-v6.8-net-ethernet-mediatek-use-QDMA-instead-of-ADMAv2-on-.patch +++ b/target/linux/generic/backport-6.6/751-02-v6.8-net-ethernet-mediatek-use-QDMA-instead-of-ADMAv2-on-.patch @@ -58,7 +58,7 @@ Signed-off-by: Jakub Kicinski rxd->rxd5 = READ_ONCE(dma_rxd->rxd5); rxd->rxd6 = READ_ONCE(dma_rxd->rxd6); } -@@ -2024,7 +2024,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -2032,7 +2032,7 @@ static int mtk_poll_rx(struct napi_struc break; /* find out which mac the packet come from. values start at 1 */ @@ -67,7 +67,7 @@ Signed-off-by: Jakub Kicinski u32 val = RX_DMA_GET_SPORT_V2(trxd.rxd5); switch (val) { -@@ -2136,7 +2136,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -2144,7 +2144,7 @@ static int mtk_poll_rx(struct napi_struc skb->dev = netdev; bytes += skb->len; @@ -76,7 +76,7 @@ Signed-off-by: Jakub Kicinski reason = FIELD_GET(MTK_RXD5_PPE_CPU_REASON, trxd.rxd5); hash = trxd.rxd5 & MTK_RXD5_FOE_ENTRY; if (hash != MTK_RXD5_FOE_ENTRY) -@@ -2690,7 +2690,7 @@ static int mtk_rx_alloc(struct mtk_eth * +@@ -2698,7 +2698,7 @@ static int mtk_rx_alloc(struct mtk_eth * rxd->rxd3 = 0; rxd->rxd4 = 0; @@ -85,7 +85,7 @@ Signed-off-by: Jakub Kicinski rxd->rxd5 = 0; rxd->rxd6 = 0; rxd->rxd7 = 0; -@@ -3901,7 +3901,7 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3909,7 +3909,7 @@ static int mtk_hw_init(struct mtk_eth *e else mtk_hw_reset(eth); @@ -94,7 +94,7 @@ Signed-off-by: Jakub Kicinski /* Set FE to PDMAv2 if necessary */ val = mtk_r32(eth, MTK_FE_GLO_MISC); mtk_w32(eth, val | BIT(4), MTK_FE_GLO_MISC); -@@ -5195,11 +5195,11 @@ static const struct mtk_soc_data mt7981_ +@@ -5203,11 +5203,11 @@ static const struct mtk_soc_data mt7981_ .dma_len_offset = 8, }, .rx = { @@ -110,7 +110,7 @@ Signed-off-by: Jakub Kicinski }, }; -@@ -5221,11 +5221,11 @@ static const struct mtk_soc_data mt7986_ +@@ -5229,11 +5229,11 @@ static const struct mtk_soc_data mt7986_ .dma_len_offset = 8, }, .rx = { diff --git a/target/linux/generic/backport-6.6/752-25-v6.10-net-ethernet-mtk_eth_soc-handle-dma-buffer-size-soc-.patch b/target/linux/generic/backport-6.6/752-25-v6.10-net-ethernet-mtk_eth_soc-handle-dma-buffer-size-soc-.patch index 0df5a680b3..9b70b3b0cc 100644 --- a/target/linux/generic/backport-6.6/752-25-v6.10-net-ethernet-mtk_eth_soc-handle-dma-buffer-size-soc-.patch +++ b/target/linux/generic/backport-6.6/752-25-v6.10-net-ethernet-mtk_eth_soc-handle-dma-buffer-size-soc-.patch @@ -123,7 +123,7 @@ Signed-off-by: David S. Miller } } -@@ -2461,7 +2467,7 @@ static int mtk_tx_alloc(struct mtk_eth * +@@ -2469,7 +2475,7 @@ static int mtk_tx_alloc(struct mtk_eth * if (MTK_HAS_CAPS(soc->caps, MTK_QDMA)) ring_size = MTK_QDMA_RING_SIZE; else @@ -132,7 +132,7 @@ Signed-off-by: David S. Miller ring->buf = kcalloc(ring_size, sizeof(*ring->buf), GFP_KERNEL); -@@ -2469,8 +2475,8 @@ static int mtk_tx_alloc(struct mtk_eth * +@@ -2477,8 +2483,8 @@ static int mtk_tx_alloc(struct mtk_eth * goto no_tx_mem; if (MTK_HAS_CAPS(soc->caps, MTK_SRAM)) { @@ -143,7 +143,7 @@ Signed-off-by: David S. Miller } else { ring->dma = dma_alloc_coherent(eth->dma_dev, ring_size * sz, &ring->phys, GFP_KERNEL); -@@ -2592,6 +2598,7 @@ static void mtk_tx_clean(struct mtk_eth +@@ -2600,6 +2606,7 @@ static void mtk_tx_clean(struct mtk_eth static int mtk_rx_alloc(struct mtk_eth *eth, int ring_no, int rx_flag) { const struct mtk_reg_map *reg_map = eth->soc->reg_map; @@ -151,7 +151,7 @@ Signed-off-by: David S. Miller struct mtk_rx_ring *ring; int rx_data_len, rx_dma_size, tx_ring_size; int i; -@@ -2599,7 +2606,7 @@ static int mtk_rx_alloc(struct mtk_eth * +@@ -2607,7 +2614,7 @@ static int mtk_rx_alloc(struct mtk_eth * if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) tx_ring_size = MTK_QDMA_RING_SIZE; else @@ -160,7 +160,7 @@ Signed-off-by: David S. Miller if (rx_flag == MTK_RX_FLAGS_QDMA) { if (ring_no) -@@ -2614,7 +2621,7 @@ static int mtk_rx_alloc(struct mtk_eth * +@@ -2622,7 +2629,7 @@ static int mtk_rx_alloc(struct mtk_eth * rx_dma_size = MTK_HW_LRO_DMA_SIZE; } else { rx_data_len = ETH_DATA_LEN; @@ -169,7 +169,7 @@ Signed-off-by: David S. Miller } ring->frag_size = mtk_max_frag_size(rx_data_len); -@@ -3151,7 +3158,10 @@ static void mtk_dma_free(struct mtk_eth +@@ -3159,7 +3166,10 @@ static void mtk_dma_free(struct mtk_eth mtk_rx_clean(eth, ð->rx_ring[i], false); } @@ -181,7 +181,7 @@ Signed-off-by: David S. Miller } static bool mtk_hw_reset_check(struct mtk_eth *eth) -@@ -5073,11 +5083,14 @@ static const struct mtk_soc_data mt2701_ +@@ -5081,11 +5091,14 @@ static const struct mtk_soc_data mt2701_ .desc_size = sizeof(struct mtk_tx_dma), .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, @@ -196,7 +196,7 @@ Signed-off-by: David S. Miller .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5097,11 +5110,14 @@ static const struct mtk_soc_data mt7621_ +@@ -5105,11 +5118,14 @@ static const struct mtk_soc_data mt7621_ .desc_size = sizeof(struct mtk_tx_dma), .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, @@ -211,7 +211,7 @@ Signed-off-by: David S. Miller .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5123,11 +5139,14 @@ static const struct mtk_soc_data mt7622_ +@@ -5131,11 +5147,14 @@ static const struct mtk_soc_data mt7622_ .desc_size = sizeof(struct mtk_tx_dma), .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, @@ -226,7 +226,7 @@ Signed-off-by: David S. Miller .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5148,11 +5167,14 @@ static const struct mtk_soc_data mt7623_ +@@ -5156,11 +5175,14 @@ static const struct mtk_soc_data mt7623_ .desc_size = sizeof(struct mtk_tx_dma), .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, @@ -241,7 +241,7 @@ Signed-off-by: David S. Miller .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5171,11 +5193,14 @@ static const struct mtk_soc_data mt7629_ +@@ -5179,11 +5201,14 @@ static const struct mtk_soc_data mt7629_ .desc_size = sizeof(struct mtk_tx_dma), .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, @@ -256,7 +256,7 @@ Signed-off-by: David S. Miller .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5197,6 +5222,8 @@ static const struct mtk_soc_data mt7981_ +@@ -5205,6 +5230,8 @@ static const struct mtk_soc_data mt7981_ .desc_size = sizeof(struct mtk_tx_dma_v2), .dma_max_len = MTK_TX_DMA_BUF_LEN_V2, .dma_len_offset = 8, @@ -265,7 +265,7 @@ Signed-off-by: David S. Miller }, .rx = { .desc_size = sizeof(struct mtk_rx_dma), -@@ -5204,6 +5231,7 @@ static const struct mtk_soc_data mt7981_ +@@ -5212,6 +5239,7 @@ static const struct mtk_soc_data mt7981_ .dma_l4_valid = RX_DMA_L4_VALID_V2, .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, @@ -273,7 +273,7 @@ Signed-off-by: David S. Miller }, }; -@@ -5223,6 +5251,8 @@ static const struct mtk_soc_data mt7986_ +@@ -5231,6 +5259,8 @@ static const struct mtk_soc_data mt7986_ .desc_size = sizeof(struct mtk_tx_dma_v2), .dma_max_len = MTK_TX_DMA_BUF_LEN_V2, .dma_len_offset = 8, @@ -282,7 +282,7 @@ Signed-off-by: David S. Miller }, .rx = { .desc_size = sizeof(struct mtk_rx_dma), -@@ -5230,6 +5260,7 @@ static const struct mtk_soc_data mt7986_ +@@ -5238,6 +5268,7 @@ static const struct mtk_soc_data mt7986_ .dma_l4_valid = RX_DMA_L4_VALID_V2, .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, @@ -290,7 +290,7 @@ Signed-off-by: David S. Miller }, }; -@@ -5249,6 +5280,8 @@ static const struct mtk_soc_data mt7988_ +@@ -5257,6 +5288,8 @@ static const struct mtk_soc_data mt7988_ .desc_size = sizeof(struct mtk_tx_dma_v2), .dma_max_len = MTK_TX_DMA_BUF_LEN_V2, .dma_len_offset = 8, @@ -299,7 +299,7 @@ Signed-off-by: David S. Miller }, .rx = { .desc_size = sizeof(struct mtk_rx_dma_v2), -@@ -5256,6 +5289,7 @@ static const struct mtk_soc_data mt7988_ +@@ -5264,6 +5297,7 @@ static const struct mtk_soc_data mt7988_ .dma_l4_valid = RX_DMA_L4_VALID_V2, .dma_max_len = MTK_TX_DMA_BUF_LEN_V2, .dma_len_offset = 8, @@ -307,7 +307,7 @@ Signed-off-by: David S. Miller }, }; -@@ -5270,6 +5304,7 @@ static const struct mtk_soc_data rt5350_ +@@ -5278,6 +5312,7 @@ static const struct mtk_soc_data rt5350_ .desc_size = sizeof(struct mtk_tx_dma), .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, @@ -315,7 +315,7 @@ Signed-off-by: David S. Miller }, .rx = { .desc_size = sizeof(struct mtk_rx_dma), -@@ -5277,6 +5312,7 @@ static const struct mtk_soc_data rt5350_ +@@ -5285,6 +5320,7 @@ static const struct mtk_soc_data rt5350_ .dma_l4_valid = RX_DMA_L4_VALID_PDMA, .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, diff --git a/target/linux/generic/backport-6.6/752-26-v6.10-net-ethernet-mtk_eth_soc-ppe-add-support-for-multipl.patch b/target/linux/generic/backport-6.6/752-26-v6.10-net-ethernet-mtk_eth_soc-ppe-add-support-for-multipl.patch index 47478802f9..c75b40fd04 100644 --- a/target/linux/generic/backport-6.6/752-26-v6.10-net-ethernet-mtk_eth_soc-ppe-add-support-for-multipl.patch +++ b/target/linux/generic/backport-6.6/752-26-v6.10-net-ethernet-mtk_eth_soc-ppe-add-support-for-multipl.patch @@ -60,7 +60,7 @@ Signed-off-by: Jakub Kicinski .ppe_base = 0x2000, .wdma_base = { [0] = 0x4800, -@@ -2015,6 +2024,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -2023,6 +2032,7 @@ static int mtk_poll_rx(struct napi_struc struct mtk_rx_dma_v2 *rxd, trxd; int done = 0, bytes = 0; dma_addr_t dma_addr = DMA_MAPPING_ERROR; @@ -68,7 +68,7 @@ Signed-off-by: Jakub Kicinski while (done < budget) { unsigned int pktlen, *rxdcsum; -@@ -2058,6 +2068,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -2066,6 +2076,7 @@ static int mtk_poll_rx(struct napi_struc goto release_desc; netdev = eth->netdev[mac]; @@ -76,7 +76,7 @@ Signed-off-by: Jakub Kicinski if (unlikely(test_bit(MTK_RESETTING, ð->state))) goto release_desc; -@@ -2181,7 +2192,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -2189,7 +2200,7 @@ static int mtk_poll_rx(struct napi_struc } if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED) @@ -85,7 +85,7 @@ Signed-off-by: Jakub Kicinski skb_record_rx_queue(skb, 0); napi_gro_receive(napi, skb); -@@ -3288,37 +3299,27 @@ static int mtk_start_dma(struct mtk_eth +@@ -3296,37 +3307,27 @@ static int mtk_start_dma(struct mtk_eth return 0; } @@ -134,7 +134,7 @@ Signed-off-by: Jakub Kicinski } -@@ -3378,7 +3379,10 @@ static int mtk_open(struct net_device *d +@@ -3386,7 +3387,10 @@ static int mtk_open(struct net_device *d { struct mtk_mac *mac = netdev_priv(dev); struct mtk_eth *eth = mac->hw; @@ -146,7 +146,7 @@ Signed-off-by: Jakub Kicinski err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0); if (err) { -@@ -3402,18 +3406,38 @@ static int mtk_open(struct net_device *d +@@ -3410,18 +3414,38 @@ static int mtk_open(struct net_device *d for (i = 0; i < ARRAY_SIZE(eth->ppe); i++) mtk_ppe_start(eth->ppe[i]); @@ -190,7 +190,7 @@ Signed-off-by: Jakub Kicinski phylink_start(mac->phylink); netif_tx_start_all_queues(dev); -@@ -3490,7 +3514,8 @@ static int mtk_stop(struct net_device *d +@@ -3498,7 +3522,8 @@ static int mtk_stop(struct net_device *d if (!refcount_dec_and_test(ð->dma_refcnt)) return 0; @@ -200,7 +200,7 @@ Signed-off-by: Jakub Kicinski mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); mtk_rx_irq_disable(eth, eth->soc->rx.irq_done_mask); -@@ -4985,23 +5010,24 @@ static int mtk_probe(struct platform_dev +@@ -4993,23 +5018,24 @@ static int mtk_probe(struct platform_dev } if (eth->soc->offload_version) { @@ -233,7 +233,7 @@ Signed-off-by: Jakub Kicinski } for (i = 0; i < MTK_MAX_DEVS; i++) { -@@ -5104,6 +5130,7 @@ static const struct mtk_soc_data mt7621_ +@@ -5112,6 +5138,7 @@ static const struct mtk_soc_data mt7621_ .required_pctl = false, .version = 1, .offload_version = 1, @@ -241,7 +241,7 @@ Signed-off-by: Jakub Kicinski .hash_offset = 2, .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, .tx = { -@@ -5132,6 +5159,7 @@ static const struct mtk_soc_data mt7622_ +@@ -5140,6 +5167,7 @@ static const struct mtk_soc_data mt7622_ .required_pctl = false, .version = 1, .offload_version = 2, @@ -249,7 +249,7 @@ Signed-off-by: Jakub Kicinski .hash_offset = 2, .has_accounting = true, .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, -@@ -5160,6 +5188,7 @@ static const struct mtk_soc_data mt7623_ +@@ -5168,6 +5196,7 @@ static const struct mtk_soc_data mt7623_ .required_pctl = true, .version = 1, .offload_version = 1, @@ -257,7 +257,7 @@ Signed-off-by: Jakub Kicinski .hash_offset = 2, .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, .disable_pll_modes = true, -@@ -5215,6 +5244,7 @@ static const struct mtk_soc_data mt7981_ +@@ -5223,6 +5252,7 @@ static const struct mtk_soc_data mt7981_ .required_pctl = false, .version = 2, .offload_version = 2, @@ -265,7 +265,7 @@ Signed-off-by: Jakub Kicinski .hash_offset = 4, .has_accounting = true, .foe_entry_size = MTK_FOE_ENTRY_V2_SIZE, -@@ -5244,6 +5274,7 @@ static const struct mtk_soc_data mt7986_ +@@ -5252,6 +5282,7 @@ static const struct mtk_soc_data mt7986_ .required_pctl = false, .version = 2, .offload_version = 2, @@ -273,7 +273,7 @@ Signed-off-by: Jakub Kicinski .hash_offset = 4, .has_accounting = true, .foe_entry_size = MTK_FOE_ENTRY_V2_SIZE, -@@ -5273,6 +5304,7 @@ static const struct mtk_soc_data mt7988_ +@@ -5281,6 +5312,7 @@ static const struct mtk_soc_data mt7988_ .required_pctl = false, .version = 3, .offload_version = 2, diff --git a/target/linux/generic/backport-6.6/752-28-v6.10-net-ethernet-mediatek-Allow-gaps-in-MAC-allocation.patch b/target/linux/generic/backport-6.6/752-28-v6.10-net-ethernet-mediatek-Allow-gaps-in-MAC-allocation.patch index 27ad9dca2c..e387b69f49 100644 --- a/target/linux/generic/backport-6.6/752-28-v6.10-net-ethernet-mediatek-Allow-gaps-in-MAC-allocation.patch +++ b/target/linux/generic/backport-6.6/752-28-v6.10-net-ethernet-mediatek-Allow-gaps-in-MAC-allocation.patch @@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3408,7 +3408,7 @@ static int mtk_open(struct net_device *d +@@ -3416,7 +3416,7 @@ static int mtk_open(struct net_device *d for (i = 0; i < MTK_MAX_DEVS; i++) { if (!eth->netdev[i]) diff --git a/target/linux/generic/backport-6.6/752-30-v6.10-net-ethernet-mtk_eth_soc-implement-.-get-set-_pausep.patch b/target/linux/generic/backport-6.6/752-30-v6.10-net-ethernet-mtk_eth_soc-implement-.-get-set-_pausep.patch index b16910e18e..6db2901cd0 100644 --- a/target/linux/generic/backport-6.6/752-30-v6.10-net-ethernet-mtk_eth_soc-implement-.-get-set-_pausep.patch +++ b/target/linux/generic/backport-6.6/752-30-v6.10-net-ethernet-mtk_eth_soc-implement-.-get-set-_pausep.patch @@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4490,6 +4490,20 @@ static int mtk_set_rxnfc(struct net_devi +@@ -4498,6 +4498,20 @@ static int mtk_set_rxnfc(struct net_devi return ret; } @@ -41,7 +41,7 @@ Signed-off-by: Jakub Kicinski static u16 mtk_select_queue(struct net_device *dev, struct sk_buff *skb, struct net_device *sb_dev) { -@@ -4518,8 +4532,10 @@ static const struct ethtool_ops mtk_etht +@@ -4526,8 +4540,10 @@ static const struct ethtool_ops mtk_etht .get_strings = mtk_get_strings, .get_sset_count = mtk_get_sset_count, .get_ethtool_stats = mtk_get_ethtool_stats, diff --git a/target/linux/generic/pending-6.6/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch b/target/linux/generic/pending-6.6/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch index cd3c9df2bb..63435530c1 100644 --- a/target/linux/generic/pending-6.6/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch +++ b/target/linux/generic/pending-6.6/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -5064,6 +5064,8 @@ static int mtk_probe(struct platform_dev +@@ -5072,6 +5072,8 @@ static int mtk_probe(struct platform_dev * for NAPI to work */ init_dummy_netdev(ð->dummy_dev); diff --git a/target/linux/generic/pending-6.6/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch b/target/linux/generic/pending-6.6/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch index 6e3e409290..c4f78631bb 100644 --- a/target/linux/generic/pending-6.6/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch +++ b/target/linux/generic/pending-6.6/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch @@ -53,7 +53,7 @@ Signed-off-by: Felix Fietkau bool gso = false; int tx_num; -@@ -1623,6 +1640,18 @@ static netdev_tx_t mtk_start_xmit(struct +@@ -1630,6 +1647,18 @@ static netdev_tx_t mtk_start_xmit(struct return NETDEV_TX_BUSY; } @@ -72,7 +72,7 @@ Signed-off-by: Felix Fietkau /* TSO: fill MSS info in tcp checksum field */ if (skb_is_gso(skb)) { if (skb_cow_head(skb, 0)) { -@@ -1638,8 +1667,14 @@ static netdev_tx_t mtk_start_xmit(struct +@@ -1645,8 +1674,14 @@ static netdev_tx_t mtk_start_xmit(struct } } diff --git a/target/linux/generic/pending-6.6/733-01-net-ethernet-mtk_eth_soc-use-napi_build_skb.patch b/target/linux/generic/pending-6.6/733-01-net-ethernet-mtk_eth_soc-use-napi_build_skb.patch index 82ba768fd5..dcf33bd419 100644 --- a/target/linux/generic/pending-6.6/733-01-net-ethernet-mtk_eth_soc-use-napi_build_skb.patch +++ b/target/linux/generic/pending-6.6/733-01-net-ethernet-mtk_eth_soc-use-napi_build_skb.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2140,7 +2140,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -2148,7 +2148,7 @@ static int mtk_poll_rx(struct napi_struc if (ret != XDP_PASS) goto skip_rx; @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau if (unlikely(!skb)) { page_pool_put_full_page(ring->page_pool, page, true); -@@ -2178,7 +2178,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -2186,7 +2186,7 @@ static int mtk_poll_rx(struct napi_struc dma_unmap_single(eth->dma_dev, ((u64)trxd.rxd1 | addr64), ring->buf_size, DMA_FROM_DEVICE); diff --git a/target/linux/generic/pending-6.6/734-net-ethernet-mediatek-enlarge-DMA-reserve-buffer.patch b/target/linux/generic/pending-6.6/734-net-ethernet-mediatek-enlarge-DMA-reserve-buffer.patch index c97df557c6..8f2f9d3951 100644 --- a/target/linux/generic/pending-6.6/734-net-ethernet-mediatek-enlarge-DMA-reserve-buffer.patch +++ b/target/linux/generic/pending-6.6/734-net-ethernet-mediatek-enlarge-DMA-reserve-buffer.patch @@ -25,7 +25,7 @@ Signed-off-by: Chad Monroe /* QDMA Flow Control Register */ --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3313,12 +3313,14 @@ static int mtk_start_dma(struct mtk_eth +@@ -3321,12 +3321,14 @@ static int mtk_start_dma(struct mtk_eth MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO | MTK_RX_2B_OFFSET | MTK_TX_WB_DDONE; diff --git a/target/linux/generic/pending-6.6/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch b/target/linux/generic/pending-6.6/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch index 4d718f9fa0..379df48308 100644 --- a/target/linux/generic/pending-6.6/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch +++ b/target/linux/generic/pending-6.6/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch @@ -490,7 +490,7 @@ Signed-off-by: Daniel Golle .mac_finish = mtk_mac_finish, .mac_link_down = mtk_mac_link_down, .mac_link_up = mtk_mac_link_up, -@@ -3421,6 +3562,9 @@ static int mtk_open(struct net_device *d +@@ -3429,6 +3570,9 @@ static int mtk_open(struct net_device *d ppe_num = eth->soc->ppe_num; @@ -500,7 +500,7 @@ Signed-off-by: Daniel Golle err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0); if (err) { netdev_err(dev, "%s: could not attach PHY: %d\n", __func__, -@@ -3571,6 +3715,9 @@ static int mtk_stop(struct net_device *d +@@ -3579,6 +3723,9 @@ static int mtk_stop(struct net_device *d for (i = 0; i < ARRAY_SIZE(eth->ppe); i++) mtk_ppe_stop(eth->ppe[i]); @@ -510,7 +510,7 @@ Signed-off-by: Daniel Golle return 0; } -@@ -4600,6 +4747,7 @@ static const struct net_device_ops mtk_n +@@ -4608,6 +4755,7 @@ static const struct net_device_ops mtk_n static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) { const __be32 *_id = of_get_property(np, "reg", NULL); @@ -518,7 +518,7 @@ Signed-off-by: Daniel Golle phy_interface_t phy_mode; struct phylink *phylink; struct mtk_mac *mac; -@@ -4636,16 +4784,41 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4644,16 +4792,41 @@ static int mtk_add_mac(struct mtk_eth *e mac->id = id; mac->hw = eth; mac->of_node = np; @@ -568,7 +568,7 @@ Signed-off-by: Daniel Golle } memset(mac->hwlro_ip, 0, sizeof(mac->hwlro_ip)); -@@ -4728,8 +4901,21 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4736,8 +4909,21 @@ static int mtk_add_mac(struct mtk_eth *e phy_interface_zero(mac->phylink_config.supported_interfaces); __set_bit(PHY_INTERFACE_MODE_INTERNAL, mac->phylink_config.supported_interfaces); @@ -590,7 +590,7 @@ Signed-off-by: Daniel Golle phylink = phylink_create(&mac->phylink_config, of_fwnode_handle(mac->of_node), phy_mode, &mtk_phylink_ops); -@@ -4780,6 +4966,26 @@ free_netdev: +@@ -4788,6 +4974,26 @@ free_netdev: return err; } @@ -617,7 +617,7 @@ Signed-off-by: Daniel Golle void mtk_eth_set_dma_device(struct mtk_eth *eth, struct device *dma_dev) { struct net_device *dev, *tmp; -@@ -4926,7 +5132,8 @@ static int mtk_probe(struct platform_dev +@@ -4934,7 +5140,8 @@ static int mtk_probe(struct platform_dev regmap_write(cci, 0, 3); } @@ -627,7 +627,7 @@ Signed-off-by: Daniel Golle err = mtk_sgmii_init(eth); if (err) -@@ -5037,6 +5244,24 @@ static int mtk_probe(struct platform_dev +@@ -5045,6 +5252,24 @@ static int mtk_probe(struct platform_dev } } @@ -652,7 +652,7 @@ Signed-off-by: Daniel Golle if (MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_INT)) { err = devm_request_irq(eth->dev, eth->irq[0], mtk_handle_irq, 0, -@@ -5140,6 +5365,11 @@ static int mtk_remove(struct platform_de +@@ -5148,6 +5373,11 @@ static int mtk_remove(struct platform_de mtk_stop(eth->netdev[i]); mac = netdev_priv(eth->netdev[i]); phylink_disconnect_phy(mac->phylink); diff --git a/target/linux/generic/pending-6.6/738-01-net-ethernet-mtk_eth_soc-reduce-rx-ring-size-for-older.patch b/target/linux/generic/pending-6.6/738-01-net-ethernet-mtk_eth_soc-reduce-rx-ring-size-for-older.patch index 7b49f0e2b7..2a9ae9647a 100644 --- a/target/linux/generic/pending-6.6/738-01-net-ethernet-mtk_eth_soc-reduce-rx-ring-size-for-older.patch +++ b/target/linux/generic/pending-6.6/738-01-net-ethernet-mtk_eth_soc-reduce-rx-ring-size-for-older.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -5401,7 +5401,7 @@ static const struct mtk_soc_data mt2701_ +@@ -5409,7 +5409,7 @@ static const struct mtk_soc_data mt2701_ .desc_size = sizeof(struct mtk_rx_dma), .irq_done_mask = MTK_RX_DONE_INT, .dma_l4_valid = RX_DMA_L4_VALID, @@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5429,7 +5429,7 @@ static const struct mtk_soc_data mt7621_ +@@ -5437,7 +5437,7 @@ static const struct mtk_soc_data mt7621_ .desc_size = sizeof(struct mtk_rx_dma), .irq_done_mask = MTK_RX_DONE_INT, .dma_l4_valid = RX_DMA_L4_VALID, @@ -48,7 +48,7 @@ Signed-off-by: Felix Fietkau .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5459,7 +5459,7 @@ static const struct mtk_soc_data mt7622_ +@@ -5467,7 +5467,7 @@ static const struct mtk_soc_data mt7622_ .desc_size = sizeof(struct mtk_rx_dma), .irq_done_mask = MTK_RX_DONE_INT, .dma_l4_valid = RX_DMA_L4_VALID, @@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5488,7 +5488,7 @@ static const struct mtk_soc_data mt7623_ +@@ -5496,7 +5496,7 @@ static const struct mtk_soc_data mt7623_ .desc_size = sizeof(struct mtk_rx_dma), .irq_done_mask = MTK_RX_DONE_INT, .dma_l4_valid = RX_DMA_L4_VALID, @@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5514,7 +5514,7 @@ static const struct mtk_soc_data mt7629_ +@@ -5522,7 +5522,7 @@ static const struct mtk_soc_data mt7629_ .desc_size = sizeof(struct mtk_rx_dma), .irq_done_mask = MTK_RX_DONE_INT, .dma_l4_valid = RX_DMA_L4_VALID, @@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5546,7 +5546,7 @@ static const struct mtk_soc_data mt7981_ +@@ -5554,7 +5554,7 @@ static const struct mtk_soc_data mt7981_ .dma_l4_valid = RX_DMA_L4_VALID_V2, .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, @@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau }, }; -@@ -5576,7 +5576,7 @@ static const struct mtk_soc_data mt7986_ +@@ -5584,7 +5584,7 @@ static const struct mtk_soc_data mt7986_ .dma_l4_valid = RX_DMA_L4_VALID_V2, .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, @@ -93,7 +93,7 @@ Signed-off-by: Felix Fietkau }, }; -@@ -5629,7 +5629,7 @@ static const struct mtk_soc_data rt5350_ +@@ -5637,7 +5637,7 @@ static const struct mtk_soc_data rt5350_ .dma_l4_valid = RX_DMA_L4_VALID_PDMA, .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, diff --git a/target/linux/generic/pending-6.6/738-02-net-ethernet-mtk_eth_soc-do-not-enable-page-pool-sta.patch b/target/linux/generic/pending-6.6/738-02-net-ethernet-mtk_eth_soc-do-not-enable-page-pool-sta.patch index 3ca41b2a03..431ddf6dd6 100644 --- a/target/linux/generic/pending-6.6/738-02-net-ethernet-mtk_eth_soc-do-not-enable-page-pool-sta.patch +++ b/target/linux/generic/pending-6.6/738-02-net-ethernet-mtk_eth_soc-do-not-enable-page-pool-sta.patch @@ -25,7 +25,7 @@ Signed-off-by: Felix Fietkau help --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4572,6 +4572,7 @@ static int mtk_get_sset_count(struct net +@@ -4580,6 +4580,7 @@ static int mtk_get_sset_count(struct net static void mtk_ethtool_pp_stats(struct mtk_eth *eth, u64 *data) { @@ -33,7 +33,7 @@ Signed-off-by: Felix Fietkau struct page_pool_stats stats = {}; int i; -@@ -4584,6 +4585,7 @@ static void mtk_ethtool_pp_stats(struct +@@ -4592,6 +4593,7 @@ static void mtk_ethtool_pp_stats(struct page_pool_get_stats(ring->page_pool, &stats); } page_pool_ethtool_stats_get(data, &stats); diff --git a/target/linux/generic/pending-6.6/742-net-ethernet-mtk_eth_soc-fix-tx-vlan-tag-for-llc-pac.patch b/target/linux/generic/pending-6.6/742-net-ethernet-mtk_eth_soc-fix-tx-vlan-tag-for-llc-pac.patch deleted file mode 100644 index 4876d858fd..0000000000 --- a/target/linux/generic/pending-6.6/742-net-ethernet-mtk_eth_soc-fix-tx-vlan-tag-for-llc-pac.patch +++ /dev/null @@ -1,39 +0,0 @@ -From: Felix Fietkau -Date: Sun, 31 Aug 2025 20:05:13 +0200 -Subject: [PATCH] net: ethernet: mtk_eth_soc: fix tx vlan tag for llc packets - -When sending llc packets with vlan tx offload, the hardware fails to -actually add the tag. Deal with this by fixing it up in software. - -Fixes: 656e705243fd ("net-next: mediatek: add support for MT7623 ethernet") -Reported-by: Thibaut VARENE -Signed-off-by: Felix Fietkau ---- - ---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c -+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1763,6 +1763,13 @@ static netdev_tx_t mtk_start_xmit(struct - bool gso = false; - int tx_num; - -+ if (skb_vlan_tag_present(skb) && -+ !eth_proto_is_802_3(eth_hdr(skb)->h_proto)) { -+ skb = __vlan_hwaccel_push_inside(skb); -+ if (!skb) -+ goto dropped; -+ } -+ - /* normally we can rely on the stack not calling this more than once, - * however we have 2 queues running on the same ring so we need to lock - * the ring access -@@ -1826,8 +1833,9 @@ static netdev_tx_t mtk_start_xmit(struct - - drop: - spin_unlock(ð->page_lock); -- stats->tx_dropped++; - dev_kfree_skb_any(skb); -+dropped: -+ stats->tx_dropped++; - return NETDEV_TX_OK; - } - diff --git a/target/linux/lantiq/patches-6.6/0001-MIPS-lantiq-add-pcie-driver.patch b/target/linux/lantiq/patches-6.6/0001-MIPS-lantiq-add-pcie-driver.patch index ab6d2a1486..4ba92226ac 100644 --- a/target/linux/lantiq/patches-6.6/0001-MIPS-lantiq-add-pcie-driver.patch +++ b/target/linux/lantiq/patches-6.6/0001-MIPS-lantiq-add-pcie-driver.patch @@ -5524,7 +5524,7 @@ Signed-off-by: John Crispin (transaction layer end-to-end CRC checking). --- a/include/linux/pci.h +++ b/include/linux/pci.h -@@ -1610,6 +1610,8 @@ void pci_walk_bus_locked(struct pci_bus +@@ -1612,6 +1612,8 @@ void pci_walk_bus_locked(struct pci_bus void *userdata); int pci_cfg_space_size(struct pci_dev *dev); unsigned char pci_bus_max_busnr(struct pci_bus *bus); diff --git a/target/linux/mediatek/patches-6.6/830-v6.7-39-thermal-lvts-Convert-to-platform-remove-callback-ret.patch b/target/linux/mediatek/patches-6.6/830-v6.7-39-thermal-lvts-Convert-to-platform-remove-callback-ret.patch index 2793f3857f..ed5e71f25b 100644 --- a/target/linux/mediatek/patches-6.6/830-v6.7-39-thermal-lvts-Convert-to-platform-remove-callback-ret.patch +++ b/target/linux/mediatek/patches-6.6/830-v6.7-39-thermal-lvts-Convert-to-platform-remove-callback-ret.patch @@ -29,7 +29,7 @@ Signed-off-by: Rafael J. Wysocki --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c -@@ -1249,7 +1249,7 @@ static int lvts_probe(struct platform_de +@@ -1271,7 +1271,7 @@ static int lvts_probe(struct platform_de return 0; } @@ -38,7 +38,7 @@ Signed-off-by: Rafael J. Wysocki { struct lvts_domain *lvts_td; int i; -@@ -1260,8 +1260,6 @@ static int lvts_remove(struct platform_d +@@ -1282,8 +1282,6 @@ static int lvts_remove(struct platform_d lvts_ctrl_set_enable(&lvts_td->lvts_ctrl[i], false); lvts_debugfs_exit(lvts_td); @@ -47,7 +47,7 @@ Signed-off-by: Rafael J. Wysocki } static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = { -@@ -1362,7 +1360,7 @@ MODULE_DEVICE_TABLE(of, lvts_of_match); +@@ -1384,7 +1382,7 @@ MODULE_DEVICE_TABLE(of, lvts_of_match); static struct platform_driver lvts_driver = { .probe = lvts_probe, diff --git a/target/linux/mediatek/patches-6.6/830-v6.7-40-thermal-drivers-mediatek-lvts_thermal-Make-coeff-con.patch b/target/linux/mediatek/patches-6.6/830-v6.7-40-thermal-drivers-mediatek-lvts_thermal-Make-coeff-con.patch index a9f84a4c7d..723fe39bbe 100644 --- a/target/linux/mediatek/patches-6.6/830-v6.7-40-thermal-drivers-mediatek-lvts_thermal-Make-coeff-con.patch +++ b/target/linux/mediatek/patches-6.6/830-v6.7-40-thermal-drivers-mediatek-lvts_thermal-Make-coeff-con.patch @@ -25,7 +25,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c -@@ -80,8 +80,8 @@ +@@ -84,8 +84,8 @@ #define LVTS_SENSOR_MAX 4 #define LVTS_GOLDEN_TEMP_MAX 62 #define LVTS_GOLDEN_TEMP_DEFAULT 50 @@ -36,7 +36,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de #define LVTS_MSR_IMMEDIATE_MODE 0 #define LVTS_MSR_FILTERED_MODE 1 -@@ -94,7 +94,7 @@ +@@ -98,7 +98,7 @@ #define LVTS_MINIMUM_THRESHOLD 20000 static int golden_temp = LVTS_GOLDEN_TEMP_DEFAULT; @@ -45,7 +45,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de struct lvts_sensor_data { int dt_id; -@@ -112,6 +112,8 @@ struct lvts_ctrl_data { +@@ -116,6 +116,8 @@ struct lvts_ctrl_data { struct lvts_data { const struct lvts_ctrl_data *lvts_ctrl; int num_lvts_ctrl; @@ -54,7 +54,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de }; struct lvts_sensor { -@@ -126,6 +128,7 @@ struct lvts_sensor { +@@ -130,6 +132,7 @@ struct lvts_sensor { struct lvts_ctrl { struct lvts_sensor sensors[LVTS_SENSOR_MAX]; @@ -62,7 +62,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de u32 calibration[LVTS_SENSOR_MAX]; u32 hw_tshut_raw_temp; int num_lvts_sensor; -@@ -247,21 +250,21 @@ static void lvts_debugfs_exit(struct lvt +@@ -251,21 +254,21 @@ static void lvts_debugfs_exit(struct lvt #endif @@ -90,7 +90,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de return raw_temp; } -@@ -269,6 +272,9 @@ static u32 lvts_temp_to_raw(int temperat +@@ -273,6 +276,9 @@ static u32 lvts_temp_to_raw(int temperat static int lvts_get_temp(struct thermal_zone_device *tz, int *temp) { struct lvts_sensor *lvts_sensor = thermal_zone_device_priv(tz); @@ -100,7 +100,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de void __iomem *msr = lvts_sensor->msr; u32 value; int rc; -@@ -301,7 +307,7 @@ static int lvts_get_temp(struct thermal_ +@@ -305,7 +311,7 @@ static int lvts_get_temp(struct thermal_ if (rc) return -EAGAIN; @@ -109,7 +109,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de return 0; } -@@ -348,10 +354,13 @@ static bool lvts_should_update_thresh(st +@@ -370,10 +376,13 @@ static bool lvts_should_update_thresh(st static int lvts_set_trips(struct thermal_zone_device *tz, int low, int high) { struct lvts_sensor *lvts_sensor = thermal_zone_device_priv(tz); @@ -126,7 +126,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de bool should_update_thresh; lvts_sensor->low_thresh = low; -@@ -694,7 +703,7 @@ static int lvts_calibration_read(struct +@@ -716,7 +725,7 @@ static int lvts_calibration_read(struct return 0; } @@ -135,7 +135,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de { u32 gt; -@@ -707,7 +716,7 @@ static int lvts_golden_temp_init(struct +@@ -729,7 +738,7 @@ static int lvts_golden_temp_init(struct if (gt < LVTS_GOLDEN_TEMP_MAX) golden_temp = gt; @@ -144,7 +144,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de return 0; } -@@ -730,7 +739,7 @@ static int lvts_ctrl_init(struct device +@@ -752,7 +761,7 @@ static int lvts_ctrl_init(struct device * The golden temp information is contained in the first chunk * of efuse data. */ @@ -153,7 +153,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de if (ret) return ret; -@@ -741,6 +750,7 @@ static int lvts_ctrl_init(struct device +@@ -763,6 +772,7 @@ static int lvts_ctrl_init(struct device for (i = 0; i < lvts_data->num_lvts_ctrl; i++) { lvts_ctrl[i].base = lvts_td->base + lvts_data->lvts_ctrl[i].offset; @@ -161,7 +161,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de ret = lvts_sensor_init(dev, &lvts_ctrl[i], &lvts_data->lvts_ctrl[i]); -@@ -764,7 +774,8 @@ static int lvts_ctrl_init(struct device +@@ -786,7 +796,8 @@ static int lvts_ctrl_init(struct device * after initializing the calibration. */ lvts_ctrl[i].hw_tshut_raw_temp = @@ -171,7 +171,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de lvts_ctrl[i].low_thresh = INT_MIN; lvts_ctrl[i].high_thresh = INT_MIN; -@@ -1231,6 +1242,8 @@ static int lvts_probe(struct platform_de +@@ -1253,6 +1264,8 @@ static int lvts_probe(struct platform_de if (irq < 0) return irq; @@ -180,7 +180,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de ret = lvts_domain_init(dev, lvts_td, lvts_data); if (ret) return dev_err_probe(dev, ret, "Failed to initialize the lvts domain\n"); -@@ -1344,11 +1357,15 @@ static const struct lvts_ctrl_data mt819 +@@ -1366,11 +1379,15 @@ static const struct lvts_ctrl_data mt819 static const struct lvts_data mt8195_lvts_mcu_data = { .lvts_ctrl = mt8195_lvts_mcu_data_ctrl, .num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_mcu_data_ctrl), diff --git a/target/linux/mediatek/patches-6.6/830-v6.7-42-thermal-drivers-mediatek-lvts_thermal-Add-mt7988-sup.patch b/target/linux/mediatek/patches-6.6/830-v6.7-42-thermal-drivers-mediatek-lvts_thermal-Add-mt7988-sup.patch index a32d950fc9..8e36fb7727 100644 --- a/target/linux/mediatek/patches-6.6/830-v6.7-42-thermal-drivers-mediatek-lvts_thermal-Add-mt7988-sup.patch +++ b/target/linux/mediatek/patches-6.6/830-v6.7-42-thermal-drivers-mediatek-lvts_thermal-Add-mt7988-sup.patch @@ -16,7 +16,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c -@@ -82,6 +82,8 @@ +@@ -86,6 +86,8 @@ #define LVTS_GOLDEN_TEMP_DEFAULT 50 #define LVTS_COEFF_A_MT8195 -250460 #define LVTS_COEFF_B_MT8195 250460 @@ -25,7 +25,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de #define LVTS_MSR_IMMEDIATE_MODE 0 #define LVTS_MSR_FILTERED_MODE 1 -@@ -89,6 +91,7 @@ +@@ -93,6 +95,7 @@ #define LVTS_MSR_READ_TIMEOUT_US 400 #define LVTS_MSR_READ_WAIT_US (LVTS_MSR_READ_TIMEOUT_US / 2) @@ -33,7 +33,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de #define LVTS_HW_SHUTDOWN_MT8195 105000 #define LVTS_MINIMUM_THRESHOLD 20000 -@@ -1275,6 +1278,33 @@ static void lvts_remove(struct platform_ +@@ -1297,6 +1300,33 @@ static void lvts_remove(struct platform_ lvts_debugfs_exit(lvts_td); } @@ -67,7 +67,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = { { .cal_offset = { 0x04, 0x07 }, -@@ -1354,6 +1384,13 @@ static const struct lvts_ctrl_data mt819 +@@ -1376,6 +1406,13 @@ static const struct lvts_ctrl_data mt819 } }; @@ -81,7 +81,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de static const struct lvts_data mt8195_lvts_mcu_data = { .lvts_ctrl = mt8195_lvts_mcu_data_ctrl, .num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_mcu_data_ctrl), -@@ -1369,6 +1406,7 @@ static const struct lvts_data mt8195_lvt +@@ -1391,6 +1428,7 @@ static const struct lvts_data mt8195_lvt }; static const struct of_device_id lvts_of_match[] = { diff --git a/target/linux/mediatek/patches-6.6/830-v6.7-43-thermal-drivers-mediatek-lvts_thermal-Fix-error-chec.patch b/target/linux/mediatek/patches-6.6/830-v6.7-43-thermal-drivers-mediatek-lvts_thermal-Fix-error-chec.patch index 5b212a2a37..023f9c6b53 100644 --- a/target/linux/mediatek/patches-6.6/830-v6.7-43-thermal-drivers-mediatek-lvts_thermal-Fix-error-chec.patch +++ b/target/linux/mediatek/patches-6.6/830-v6.7-43-thermal-drivers-mediatek-lvts_thermal-Fix-error-chec.patch @@ -19,7 +19,7 @@ Link: https://lore.kernel.org/r/20230921091057.3812-1-duminjie@vivo.com --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c -@@ -219,7 +219,7 @@ static int lvts_debugfs_init(struct devi +@@ -223,7 +223,7 @@ static int lvts_debugfs_init(struct devi sprintf(name, "controller%d", i); dentry = debugfs_create_dir(name, lvts_td->dom_dentry); diff --git a/target/linux/mediatek/patches-6.6/830-v6.7-45-thermal-drivers-mediatek-lvts_thermal-Add-suspend-an.patch b/target/linux/mediatek/patches-6.6/830-v6.7-45-thermal-drivers-mediatek-lvts_thermal-Add-suspend-an.patch index 46e1eeb239..81bc2018c6 100644 --- a/target/linux/mediatek/patches-6.6/830-v6.7-45-thermal-drivers-mediatek-lvts_thermal-Add-suspend-an.patch +++ b/target/linux/mediatek/patches-6.6/830-v6.7-45-thermal-drivers-mediatek-lvts_thermal-Add-suspend-an.patch @@ -24,7 +24,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-3-bero@baylibre.com --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c -@@ -1305,6 +1305,38 @@ static const struct lvts_ctrl_data mt798 +@@ -1327,6 +1327,38 @@ static const struct lvts_ctrl_data mt798 } }; @@ -63,7 +63,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-3-bero@baylibre.com static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = { { .cal_offset = { 0x04, 0x07 }, -@@ -1413,12 +1445,17 @@ static const struct of_device_id lvts_of +@@ -1435,12 +1467,17 @@ static const struct of_device_id lvts_of }; MODULE_DEVICE_TABLE(of, lvts_of_match); diff --git a/target/linux/mediatek/patches-6.6/830-v6.7-47-thermal-drivers-mediatek-lvts_thermal-Add-mt8192-sup.patch b/target/linux/mediatek/patches-6.6/830-v6.7-47-thermal-drivers-mediatek-lvts_thermal-Add-mt8192-sup.patch index 3b7d9489f2..6623d8a2f4 100644 --- a/target/linux/mediatek/patches-6.6/830-v6.7-47-thermal-drivers-mediatek-lvts_thermal-Add-mt8192-sup.patch +++ b/target/linux/mediatek/patches-6.6/830-v6.7-47-thermal-drivers-mediatek-lvts_thermal-Add-mt8192-sup.patch @@ -26,7 +26,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-4-bero@baylibre.com --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c -@@ -92,6 +92,7 @@ +@@ -96,6 +96,7 @@ #define LVTS_MSR_READ_WAIT_US (LVTS_MSR_READ_TIMEOUT_US / 2) #define LVTS_HW_SHUTDOWN_MT7988 105000 @@ -34,7 +34,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-4-bero@baylibre.com #define LVTS_HW_SHUTDOWN_MT8195 105000 #define LVTS_MINIMUM_THRESHOLD 20000 -@@ -1337,6 +1338,88 @@ static int lvts_resume(struct device *de +@@ -1359,6 +1360,88 @@ static int lvts_resume(struct device *de return 0; } @@ -123,7 +123,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-4-bero@baylibre.com static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = { { .cal_offset = { 0x04, 0x07 }, -@@ -1423,6 +1506,16 @@ static const struct lvts_data mt7988_lvt +@@ -1445,6 +1528,16 @@ static const struct lvts_data mt7988_lvt .temp_offset = LVTS_COEFF_B_MT7988, }; @@ -140,7 +140,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-4-bero@baylibre.com static const struct lvts_data mt8195_lvts_mcu_data = { .lvts_ctrl = mt8195_lvts_mcu_data_ctrl, .num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_mcu_data_ctrl), -@@ -1439,6 +1532,8 @@ static const struct lvts_data mt8195_lvt +@@ -1461,6 +1554,8 @@ static const struct lvts_data mt8195_lvt static const struct of_device_id lvts_of_match[] = { { .compatible = "mediatek,mt7988-lvts-ap", .data = &mt7988_lvts_ap_data }, diff --git a/target/linux/mediatek/patches-6.6/830-v6.7-48-thermal-drivers-mediatek-lvts_thermal-Update-calibra.patch b/target/linux/mediatek/patches-6.6/830-v6.7-48-thermal-drivers-mediatek-lvts_thermal-Update-calibra.patch index c20c0b5f2e..62c4297857 100644 --- a/target/linux/mediatek/patches-6.6/830-v6.7-48-thermal-drivers-mediatek-lvts_thermal-Update-calibra.patch +++ b/target/linux/mediatek/patches-6.6/830-v6.7-48-thermal-drivers-mediatek-lvts_thermal-Update-calibra.patch @@ -23,7 +23,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-6-bero@baylibre.com --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c -@@ -616,7 +616,34 @@ static int lvts_sensor_init(struct devic +@@ -638,7 +638,34 @@ static int lvts_sensor_init(struct devic * The efuse blob values follows the sensor enumeration per thermal * controller. The decoding of the stream is as follow: * @@ -59,7 +59,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-6-bero@baylibre.com * * <-----mcu-tc#0-----> <-----sensor#0-----> <-----sensor#1-----> * 0x01 | 0x02 | 0x03 | 0x04 | 0x05 | 0x06 | 0x07 | 0x08 | 0x09 -@@ -627,7 +654,7 @@ static int lvts_sensor_init(struct devic +@@ -649,7 +676,7 @@ static int lvts_sensor_init(struct devic * <-----mcu-tc#2-----> <-----sensor#4-----> <-----sensor#5-----> <-----sensor#6-----> <-----sensor#7-----> * 0x13 | 0x14 | 0x15 | 0x16 | 0x17 | 0x18 | 0x19 | 0x1A | 0x1B | 0x1C | 0x1D | 0x1E | 0x1F | 0x20 | 0x21 * From 6af8e20b45d7ac12b2dc49c6cb7ea999c1bda9fa Mon Sep 17 00:00:00 2001 From: John Audia Date: Thu, 11 Sep 2025 15:37:51 -0400 Subject: [PATCH 02/87] x86: config: add CONFIG_MITIGATION_VMSCAPE=y Introduced in the 6.6.106 update, set this new mitigation option to be enabled. See: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/arch/x86/Kconfig?id=v6.6.106&id2=v6.6.105 Signed-off-by: John Audia (cherry picked from commit 221eaf1339429e2dd3fe7cffe307240f87c4e032) Signed-off-by: Goetz Goerisch Link: https://github.com/openwrt/openwrt/pull/20036 Signed-off-by: Hauke Mehrtens --- target/linux/x86/config-6.6 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/x86/config-6.6 b/target/linux/x86/config-6.6 index 4a852287e7..17a12ba97b 100644 --- a/target/linux/x86/config-6.6 +++ b/target/linux/x86/config-6.6 @@ -247,6 +247,7 @@ CONFIG_MITIGATION_ITS=y CONFIG_MITIGATION_TSA=y CONFIG_MITIGATION_RFDS=y CONFIG_MITIGATION_SPECTRE_BHI=y +CONFIG_MITIGATION_VMSCAPE=y # CONFIG_MK6 is not set # CONFIG_MK7 is not set # CONFIG_MK8 is not set From 1dc947ac69f2624f8dda7c58d1e1cddc5d53f056 Mon Sep 17 00:00:00 2001 From: Goetz Goerisch Date: Fri, 12 Sep 2025 06:09:17 +0200 Subject: [PATCH 03/87] kernel: bump 6.6 to 6.6.106 All patches autorefreshed. Signed-off-by: Goetz Goerisch Link: https://github.com/openwrt/openwrt/pull/20013 (cherry picked from commit 8cbbcda1d9d7f4ae614a5181c7e16cd2205e6ca4) Link: https://github.com/openwrt/openwrt/pull/20036 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 ++-- ...p-Avoid-setup_max_cpus_namespace_collision_shadowing.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/kernel-6.6 b/include/kernel-6.6 index a411ab0aff..e6fa78c5d7 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .105 -LINUX_KERNEL_HASH-6.6.105 = 3f916e664f1872980b436614cba1d8b10246033435e0312ea0d8cc16599e1a1d +LINUX_VERSION-6.6 = .106 +LINUX_KERNEL_HASH-6.6.106 = 0c3180e2d8dcd0b70fe83554d9c440e31bab17873e360b89c4ab62a4fd26a8a0 diff --git a/target/linux/generic/backport-6.6/0080-v6.9-smp-Avoid-setup_max_cpus_namespace_collision_shadowing.patch b/target/linux/generic/backport-6.6/0080-v6.9-smp-Avoid-setup_max_cpus_namespace_collision_shadowing.patch index f5459aaccd..a9ac399bcb 100644 --- a/target/linux/generic/backport-6.6/0080-v6.9-smp-Avoid-setup_max_cpus_namespace_collision_shadowing.patch +++ b/target/linux/generic/backport-6.6/0080-v6.9-smp-Avoid-setup_max_cpus_namespace_collision_shadowing.patch @@ -21,7 +21,7 @@ Cc: linux-kernel@vger.kernel.org --- a/include/linux/cpu.h +++ b/include/linux/cpu.h -@@ -112,7 +112,7 @@ void notify_cpu_starting(unsigned int cp +@@ -113,7 +113,7 @@ void notify_cpu_starting(unsigned int cp extern void cpu_maps_update_begin(void); extern void cpu_maps_update_done(void); int bringup_hibernate_cpu(unsigned int sleep_cpu); From bb14c607a371adf6b79a6f17191429765956f113 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 9 Sep 2025 22:20:49 +0800 Subject: [PATCH 04/87] uboot-mediatek: update Airoha EN8811H driver Use the version sent to upstream U-Boot[1], which has much better code quality and also works better (without packet loss). The `en8811h_read_fw` func is adapted to use current read logic. 1. https://lore.kernel.org/u-boot/20250720122852.22563-1-lucienzx159@gmail.com/ Signed-off-by: Tianling Shen Link: https://github.com/openwrt/openwrt/pull/20000 (cherry picked from commit b63a48b012b7af0da14ea04ff345512254dc69d6) Link: https://github.com/openwrt/openwrt/pull/20146 Signed-off-by: Robert Marko --- ...pport-for-Airoha-ethernet-PHY-driver.patch | 1623 ++++++++--------- .../patches/442-add-bpi-r3-mini.patch | 2 +- 2 files changed, 800 insertions(+), 825 deletions(-) diff --git a/package/boot/uboot-mediatek/patches/160-net-phy-add-support-for-Airoha-ethernet-PHY-driver.patch b/package/boot/uboot-mediatek/patches/160-net-phy-add-support-for-Airoha-ethernet-PHY-driver.patch index 2a71a4eb92..cb7ef3089e 100644 --- a/package/boot/uboot-mediatek/patches/160-net-phy-add-support-for-Airoha-ethernet-PHY-driver.patch +++ b/package/boot/uboot-mediatek/patches/160-net-phy-add-support-for-Airoha-ethernet-PHY-driver.patch @@ -1015,26 +1015,31 @@ Signed-off-by: Weijie Gao +#endif /* __EN8801S_H */ --- /dev/null +++ b/drivers/net/phy/air_en8811h.c -@@ -0,0 +1,725 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/************************************************* -+ * FILE NAME: air_en8811h.c -+ * PURPOSE: -+ * EN8811H PHY Driver for Uboot -+ * NOTES: +@@ -0,0 +1,886 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Driver for the Airoha EN8811H 2.5 Gigabit PHY. + * -+ * Copyright (C) 2023 Airoha Technology Corp. -+ *************************************************/ -+ -+/* INCLUDE FILE DECLARATIONS -+*/ -+#include -+#include ++ * Limitations of the EN8811H: ++ * - Only full duplex supported ++ * - Forced speed (AN off) is not supported by hardware (100Mbps) ++ * ++ * Source originated from linux air_en8811h.c ++ * ++ * Copyright (C) 2025 Airoha Technology Corp. ++ */ +#include +#include ++#include ++#include +#include -+#include -+#include "air_en8811h.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include + +#ifdef CONFIG_PHY_AIROHA_FW_IN_UBI +#include @@ -1048,882 +1053,852 @@ Signed-off-by: Weijie Gao +#include +#endif + -+#if AIR_UBOOT_REVISION > 0x202004 -+#include -+#endif ++#define EN8811H_PHY_ID 0x03a2a411 + -+/************************** -+ * GPIO5 <-> BASE_T_LED0, -+ * GPIO4 <-> BASE_T_LED1, -+ * GPIO3 <-> BASE_T_LED2, -+ **************************/ -+/* User-defined.B */ -+#define AIR_LED_SUPPORT -+#ifdef AIR_LED_SUPPORT -+static const struct air_base_t_led_cfg_s led_cfg[3] = { -+/********************************************************************* -+ *Enable, GPIO, LED Polarity, LED ON, LED Blink -+**********************************************************************/ -+ {1, AIR_LED0_GPIO5, AIR_ACTIVE_HIGH, AIR_LED0_ON, AIR_LED0_BLK}, -+ {1, AIR_LED1_GPIO4, AIR_ACTIVE_HIGH, AIR_LED1_ON, AIR_LED1_BLK}, -+ {1, AIR_LED2_GPIO3, AIR_ACTIVE_HIGH, AIR_LED2_ON, AIR_LED2_BLK}, ++#define AIR_FW_ADDR_DM 0x00000000 ++#define AIR_FW_ADDR_DSP 0x00100000 ++ ++#define EN8811H_MD32_DM_SIZE 0x4000 ++#define EN8811H_MD32_DSP_SIZE 0x20000 ++ ++ #define EN8811H_FW_CTRL_1 0x0f0018 ++ #define EN8811H_FW_CTRL_1_START 0x0 ++ #define EN8811H_FW_CTRL_1_FINISH 0x1 ++ #define EN8811H_FW_CTRL_2 0x800000 ++ #define EN8811H_FW_CTRL_2_LOADING BIT(11) ++ ++ /* MII Registers */ ++ #define AIR_AUX_CTRL_STATUS 0x1d ++ #define AIR_AUX_CTRL_STATUS_SPEED_MASK GENMASK(4, 2) ++ #define AIR_AUX_CTRL_STATUS_SPEED_100 0x4 ++ #define AIR_AUX_CTRL_STATUS_SPEED_1000 0x8 ++ #define AIR_AUX_CTRL_STATUS_SPEED_2500 0xc ++ ++#define AIR_EXT_PAGE_ACCESS 0x1f ++#define AIR_PHY_PAGE_STANDARD 0x0000 ++#define AIR_PHY_PAGE_EXTENDED_4 0x0004 ++ ++/* MII Registers Page 4*/ ++#define AIR_BPBUS_MODE 0x10 ++#define AIR_BPBUS_MODE_ADDR_FIXED 0x0000 ++#define AIR_BPBUS_MODE_ADDR_INCR BIT(15) ++#define AIR_BPBUS_WR_ADDR_HIGH 0x11 ++#define AIR_BPBUS_WR_ADDR_LOW 0x12 ++#define AIR_BPBUS_WR_DATA_HIGH 0x13 ++#define AIR_BPBUS_WR_DATA_LOW 0x14 ++#define AIR_BPBUS_RD_ADDR_HIGH 0x15 ++#define AIR_BPBUS_RD_ADDR_LOW 0x16 ++#define AIR_BPBUS_RD_DATA_HIGH 0x17 ++#define AIR_BPBUS_RD_DATA_LOW 0x18 ++ ++/* Registers on MDIO_MMD_VEND1 */ ++#define EN8811H_PHY_FW_STATUS 0x8009 ++#define EN8811H_PHY_READY 0x02 ++ ++/* Registers on MDIO_MMD_VEND2 */ ++#define AIR_PHY_LED_BCR 0x021 ++#define AIR_PHY_LED_BCR_MODE_MASK GENMASK(1, 0) ++#define AIR_PHY_LED_BCR_TIME_TEST BIT(2) ++#define AIR_PHY_LED_BCR_CLK_EN BIT(3) ++#define AIR_PHY_LED_BCR_EXT_CTRL BIT(15) ++ ++#define AIR_PHY_LED_DUR_ON 0x022 ++ ++#define AIR_PHY_LED_DUR_BLINK 0x023 ++ ++#define AIR_PHY_LED_ON(i) (0x024 + ((i) * 2)) ++#define AIR_PHY_LED_ON_MASK (GENMASK(6, 0) | BIT(8)) ++#define AIR_PHY_LED_ON_LINK1000 BIT(0) ++#define AIR_PHY_LED_ON_LINK100 BIT(1) ++#define AIR_PHY_LED_ON_LINK10 BIT(2) ++#define AIR_PHY_LED_ON_LINKDOWN BIT(3) ++#define AIR_PHY_LED_ON_FDX BIT(4) /* Full duplex */ ++#define AIR_PHY_LED_ON_HDX BIT(5) /* Half duplex */ ++#define AIR_PHY_LED_ON_FORCE_ON BIT(6) ++#define AIR_PHY_LED_ON_LINK2500 BIT(8) ++#define AIR_PHY_LED_ON_POLARITY BIT(14) ++#define AIR_PHY_LED_ON_ENABLE BIT(15) ++ ++#define AIR_PHY_LED_BLINK(i) (0x025 + ((i) * 2)) ++#define AIR_PHY_LED_BLINK_1000TX BIT(0) ++#define AIR_PHY_LED_BLINK_1000RX BIT(1) ++#define AIR_PHY_LED_BLINK_100TX BIT(2) ++#define AIR_PHY_LED_BLINK_100RX BIT(3) ++#define AIR_PHY_LED_BLINK_10TX BIT(4) ++#define AIR_PHY_LED_BLINK_10RX BIT(5) ++#define AIR_PHY_LED_BLINK_COLLISION BIT(6) ++#define AIR_PHY_LED_BLINK_RX_CRC_ERR BIT(7) ++#define AIR_PHY_LED_BLINK_RX_IDLE_ERR BIT(8) ++#define AIR_PHY_LED_BLINK_FORCE_BLINK BIT(9) ++#define AIR_PHY_LED_BLINK_2500TX BIT(10) ++#define AIR_PHY_LED_BLINK_2500RX BIT(11) ++ ++#define EN8811H_FW_VERSION 0x3b3c ++ ++#define EN8811H_POLARITY 0xca0f8 ++#define EN8811H_POLARITY_TX_NORMAL BIT(0) ++#define EN8811H_POLARITY_RX_REVERSE BIT(1) ++ ++#define EN8811H_CLK_CGM 0xcf958 ++#define EN8811H_CLK_CGM_CKO BIT(26) ++#define EN8811H_HWTRAP1 0xcf914 ++#define EN8811H_HWTRAP1_CKO BIT(12) ++ ++#define air_upper_16_bits(n) ((u16)((n) >> 16)) ++#define air_lower_16_bits(n) ((u16)((n) & 0xffff)) ++#define clear_bit(bit, bitmap) __clear_bit(bit, bitmap) ++ ++/* Led definitions */ ++#define EN8811H_LED_COUNT 3 ++ ++struct led { ++ unsigned long rules; ++ unsigned long state; +}; -+static const u16 led_dur = UNIT_LED_BLINK_DURATION << AIR_LED_BLK_DUR_64M; -+#endif -+/* User-defined.E */ -+/************************************************************* -+ * F U N C T I O N S -+ **************************************************************/ -+/* Airoha MII read function */ -+static int air_mii_cl22_read(struct mii_dev *bus, int phy_addr, int phy_register) -+{ -+ int read_data = bus->read(bus, phy_addr, MDIO_DEVAD_NONE, phy_register); + -+ if (read_data < 0) -+ return -EIO; -+ return read_data; ++enum { ++ AIR_PHY_LED_STATE_FORCE_ON, ++ AIR_PHY_LED_STATE_FORCE_BLINK, ++}; ++ ++enum { ++ AIR_PHY_LED_DUR_BLINK_32MS, ++ AIR_PHY_LED_DUR_BLINK_64MS, ++ AIR_PHY_LED_DUR_BLINK_128MS, ++ AIR_PHY_LED_DUR_BLINK_256MS, ++ AIR_PHY_LED_DUR_BLINK_512MS, ++ AIR_PHY_LED_DUR_BLINK_1024MS, ++}; ++ ++enum { ++ AIR_LED_DISABLE, ++ AIR_LED_ENABLE, ++}; ++ ++enum { ++ AIR_ACTIVE_LOW, ++ AIR_ACTIVE_HIGH, ++}; ++ ++enum { ++ AIR_LED_MODE_DISABLE, ++ AIR_LED_MODE_USER_DEFINE, ++}; ++ ++/* Trigger specific enum */ ++enum air_led_trigger_netdev_modes { ++ AIR_TRIGGER_NETDEV_LINK = 0, ++ AIR_TRIGGER_NETDEV_LINK_10, ++ AIR_TRIGGER_NETDEV_LINK_100, ++ AIR_TRIGGER_NETDEV_LINK_1000, ++ AIR_TRIGGER_NETDEV_LINK_2500, ++ AIR_TRIGGER_NETDEV_LINK_5000, ++ AIR_TRIGGER_NETDEV_LINK_10000, ++ AIR_TRIGGER_NETDEV_HALF_DUPLEX, ++ AIR_TRIGGER_NETDEV_FULL_DUPLEX, ++ AIR_TRIGGER_NETDEV_TX, ++ AIR_TRIGGER_NETDEV_RX, ++ AIR_TRIGGER_NETDEV_TX_ERR, ++ AIR_TRIGGER_NETDEV_RX_ERR, ++ ++ /* Keep last */ ++ __AIR_TRIGGER_NETDEV_MAX, ++}; ++ ++/* Default LED setup: ++ * GPIO5 <-> LED0 On: Link detected, blink Rx/Tx ++ * GPIO4 <-> LED1 On: Link detected at 2500 and 1000 Mbps ++ * GPIO3 <-> LED2 On: Link detected at 2500 and 100 Mbps ++ */ ++#define AIR_DEFAULT_TRIGGER_LED0 (BIT(AIR_TRIGGER_NETDEV_LINK) | \ ++ BIT(AIR_TRIGGER_NETDEV_RX) | \ ++ BIT(AIR_TRIGGER_NETDEV_TX)) ++#define AIR_DEFAULT_TRIGGER_LED1 (BIT(AIR_TRIGGER_NETDEV_LINK_2500) | \ ++ BIT(AIR_TRIGGER_NETDEV_LINK_1000)) ++#define AIR_DEFAULT_TRIGGER_LED2 (BIT(AIR_TRIGGER_NETDEV_LINK_2500) | \ ++ BIT(AIR_TRIGGER_NETDEV_LINK_100)) ++ ++#define AIR_PHY_LED_DUR_UNIT 781 ++#define AIR_PHY_LED_DUR (AIR_PHY_LED_DUR_UNIT << AIR_PHY_LED_DUR_BLINK_64MS) ++ ++struct en8811h_priv { ++ int firmware_version; ++ bool mcu_needs_restart; ++ struct led led[EN8811H_LED_COUNT]; ++}; ++ ++static int air_phy_read_page(struct phy_device *phydev) ++{ ++ return phy_read(phydev, MDIO_DEVAD_NONE, AIR_EXT_PAGE_ACCESS); +} + -+/* Airoha MII write function */ -+static int air_mii_cl22_write(struct mii_dev *bus, int phy_addr, int phy_register, int write_data) ++static int air_phy_write_page(struct phy_device *phydev, int page) +{ -+ int ret = 0; -+ -+ ret = bus->write(bus, phy_addr, MDIO_DEVAD_NONE, phy_register, write_data); -+ if (ret < 0) { -+ printf("bus->write, ret: %d\n", ret); -+ return ret; -+ } -+ return ret; ++ return phy_write(phydev, MDIO_DEVAD_NONE, AIR_EXT_PAGE_ACCESS, page); +} + -+static int air_mii_cl45_read(struct phy_device *phydev, int devad, u16 reg) ++int air_phy_select_page(struct phy_device *phydev, int page) +{ -+ int ret = 0; -+ int data; ++ int ret, oldpage; + -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, MII_MMD_ACC_CTL_REG, devad); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return INVALID_DATA; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, MII_MMD_ADDR_DATA_REG, reg); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return INVALID_DATA; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, MII_MMD_ACC_CTL_REG, MMD_OP_MODE_DATA | devad); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return INVALID_DATA; -+ } -+ data = phy_read(phydev, MDIO_DEVAD_NONE, MII_MMD_ADDR_DATA_REG); -+ return data; ++ oldpage = air_phy_read_page(phydev); ++ if (oldpage < 0) ++ return oldpage; ++ ++ if (oldpage != page) { ++ ret = air_phy_write_page(phydev, page); ++ if (ret < 0) ++ return ret; ++ } ++ ++ return oldpage; +} + -+static int air_mii_cl45_write(struct phy_device *phydev, int devad, u16 reg, u16 write_data) ++int air_phy_restore_page(struct phy_device *phydev, int oldpage, int ret) +{ -+ int ret = 0; ++ int r; + -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, MII_MMD_ACC_CTL_REG, devad); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, MII_MMD_ADDR_DATA_REG, reg); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, MII_MMD_ACC_CTL_REG, MMD_OP_MODE_DATA | devad); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, MII_MMD_ADDR_DATA_REG, write_data); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ return 0; -+} -+/* Use default PBUS_PHY_ID */ -+/* EN8811H PBUS write function */ -+static int air_pbus_reg_write(struct phy_device *phydev, unsigned long pbus_address, unsigned long pbus_data) -+{ -+ int ret = 0; -+ struct mii_dev *mbus = phydev->bus; ++ if (oldpage < 0) ++ return oldpage; + -+ ret = air_mii_cl22_write(mbus, ((phydev->addr) + 8), 0x1F, (unsigned int)(pbus_address >> 6)); -+ if (ret < 0) -+ return ret; -+ ret = air_mii_cl22_write(mbus, ((phydev->addr) + 8), (unsigned int)((pbus_address >> 2) & 0xf), (unsigned int)(pbus_data & 0xFFFF)); -+ if (ret < 0) -+ return ret; -+ ret = air_mii_cl22_write(mbus, ((phydev->addr) + 8), 0x10, (unsigned int)(pbus_data >> 16)); -+ if (ret < 0) -+ return ret; -+ return 0; ++ r = air_phy_write_page(phydev, oldpage); ++ if (ret >= 0 && r < 0) ++ ret = r; ++ ++ return ret; +} + -+/* EN8811H BUCK write function */ -+static int air_buckpbus_reg_write(struct phy_device *phydev, unsigned long pbus_address, unsigned int pbus_data) ++static int air_buckpbus_reg_write(struct phy_device *phydev, ++ u32 pbus_address, u32 pbus_data) +{ -+ int ret = 0; ++ int ret, saved_page; + -+ /* page 4 */ -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x1F, (unsigned int)4); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x10, (unsigned int)0); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x11, (unsigned int)((pbus_address >> 16) & 0xffff)); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x12, (unsigned int)(pbus_address & 0xffff)); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x13, (unsigned int)((pbus_data >> 16) & 0xffff)); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x14, (unsigned int)(pbus_data & 0xffff)); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ return 0; ++ saved_page = air_phy_select_page(phydev, AIR_PHY_PAGE_EXTENDED_4); ++ if (saved_page < 0) ++ return saved_page; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_MODE, ++ AIR_BPBUS_MODE_ADDR_FIXED); ++ if (ret < 0) ++ goto restore_page; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_WR_ADDR_HIGH, ++ air_upper_16_bits(pbus_address)); ++ if (ret < 0) ++ goto restore_page; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_WR_ADDR_LOW, ++ air_lower_16_bits(pbus_address)); ++ if (ret < 0) ++ goto restore_page; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_WR_DATA_HIGH, ++ air_upper_16_bits(pbus_data)); ++ if (ret < 0) ++ goto restore_page; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_WR_DATA_LOW, ++ air_lower_16_bits(pbus_data)); ++ if (ret < 0) ++ goto restore_page; ++ ++restore_page: ++ if (ret < 0) ++ printf("%s 0x%08x failed: %d\n", __func__, ++ pbus_address, ret); ++ ++ return air_phy_restore_page(phydev, saved_page, ret); +} + -+/* EN8811H BUCK read function */ -+static unsigned int air_buckpbus_reg_read(struct phy_device *phydev, unsigned long pbus_address) ++static int air_buckpbus_reg_read(struct phy_device *phydev, ++ u32 pbus_address, u32 *pbus_data) +{ -+ unsigned int pbus_data = 0, pbus_data_low, pbus_data_high; -+ int ret = 0; ++ int pbus_data_low, pbus_data_high; ++ int ret = 0, saved_page; + -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x1F, (unsigned int)4); /* page 4 */ -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return PBUS_INVALID_DATA; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x10, (unsigned int)0); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return PBUS_INVALID_DATA; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x15, (unsigned int)((pbus_address >> 16) & 0xffff)); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return PBUS_INVALID_DATA; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x16, (unsigned int)(pbus_address & 0xffff)); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return PBUS_INVALID_DATA; -+ } ++ saved_page = air_phy_select_page(phydev, AIR_PHY_PAGE_EXTENDED_4); ++ if (saved_page < 0) ++ return saved_page; + -+ pbus_data_high = phy_read(phydev, MDIO_DEVAD_NONE, 0x17); -+ pbus_data_low = phy_read(phydev, MDIO_DEVAD_NONE, 0x18); -+ pbus_data = (pbus_data_high << 16) + pbus_data_low; -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x1F, (unsigned int)0); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ return pbus_data; ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_MODE, ++ AIR_BPBUS_MODE_ADDR_FIXED); ++ if (ret < 0) ++ goto restore_page; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_RD_ADDR_HIGH, ++ air_upper_16_bits(pbus_address)); ++ if (ret < 0) ++ goto restore_page; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_RD_ADDR_LOW, ++ air_lower_16_bits(pbus_address)); ++ if (ret < 0) ++ goto restore_page; ++ ++ pbus_data_high = phy_read(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_RD_DATA_HIGH); ++ if (pbus_data_high < 0) { ++ ret = pbus_data_high; ++ goto restore_page; ++ } ++ ++ pbus_data_low = phy_read(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_RD_DATA_LOW); ++ if (pbus_data_low < 0) { ++ ret = pbus_data_low; ++ goto restore_page; ++ } ++ ++ *pbus_data = pbus_data_low | (pbus_data_high << 16); ++ ++restore_page: ++ if (ret < 0) ++ printf("%s 0x%08x failed: %d\n", __func__, ++ pbus_address, ret); ++ ++ return air_phy_restore_page(phydev, saved_page, ret); +} + -+static int MDIOWriteBuf(struct phy_device *phydev, unsigned long address, unsigned long array_size, const unsigned char *buffer) ++static int air_buckpbus_reg_modify(struct phy_device *phydev, ++ u32 pbus_address, u32 mask, u32 set) +{ -+ unsigned int write_data, offset ; -+ int ret = 0; ++ int pbus_data_low, pbus_data_high; ++ u32 pbus_data_old, pbus_data_new; ++ int ret = 0, saved_page; + -+ /* page 4 */ -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x1F, (unsigned int)4); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ /* address increment*/ -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x10, (unsigned int)0x8000); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x11, (unsigned int)((address >> 16) & 0xffff)); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x12, (unsigned int)(address & 0xffff)); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } ++ saved_page = air_phy_select_page(phydev, AIR_PHY_PAGE_EXTENDED_4); ++ if (saved_page < 0) ++ return saved_page; + -+ for (offset = 0; offset < array_size; offset += 4) { -+ write_data = (buffer[offset + 3] << 8) | buffer[offset + 2]; -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x13, write_data); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ write_data = (buffer[offset + 1] << 8) | buffer[offset]; -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x14, write_data); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ } -+ ret = phy_write(phydev, MDIO_DEVAD_NONE, 0x1F, (unsigned int)0); -+ if (ret < 0) { -+ printf("phy_write, ret: %d\n", ret); -+ return ret; -+ } -+ return 0; ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_MODE, ++ AIR_BPBUS_MODE_ADDR_FIXED); ++ if (ret < 0) ++ goto restore_page; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_RD_ADDR_HIGH, ++ air_upper_16_bits(pbus_address)); ++ if (ret < 0) ++ goto restore_page; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_RD_ADDR_LOW, ++ air_lower_16_bits(pbus_address)); ++ if (ret < 0) ++ goto restore_page; ++ ++ pbus_data_high = phy_read(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_RD_DATA_HIGH); ++ if (pbus_data_high < 0) ++ return pbus_data_high; ++ ++ pbus_data_low = phy_read(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_RD_DATA_LOW); ++ if (pbus_data_low < 0) ++ return pbus_data_low; ++ ++ pbus_data_old = pbus_data_low | (pbus_data_high << 16); ++ pbus_data_new = (pbus_data_old & ~mask) | set; ++ if (pbus_data_new == pbus_data_old) ++ return 0; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_WR_ADDR_HIGH, ++ air_upper_16_bits(pbus_address)); ++ if (ret < 0) ++ goto restore_page; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_WR_ADDR_LOW, ++ air_lower_16_bits(pbus_address)); ++ if (ret < 0) ++ goto restore_page; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_WR_DATA_HIGH, ++ air_upper_16_bits(pbus_data_new)); ++ if (ret < 0) ++ goto restore_page; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_WR_DATA_LOW, ++ air_lower_16_bits(pbus_data_new)); ++ if (ret < 0) ++ goto restore_page; ++ ++restore_page: ++ if (ret < 0) ++ printf("%s 0x%08x failed: %d\n", __func__, ++ pbus_address, ret); ++ ++ return air_phy_restore_page(phydev, saved_page, ret); +} + -+#ifdef AIR_LED_SUPPORT -+static int airoha_led_set_usr_def(struct phy_device *phydev, u8 entity, int polar, -+ u16 on_evt, u16 blk_evt) ++static int air_write_buf(struct phy_device *phydev, unsigned long address, ++ unsigned long array_size, const unsigned char *buffer) +{ -+ int ret = 0; ++ unsigned int offset; ++ int ret, saved_page; ++ u16 val; + -+ if (AIR_ACTIVE_HIGH == polar) -+ on_evt |= LED_ON_POL; -+ else -+ on_evt &= ~LED_ON_POL; ++ saved_page = air_phy_select_page(phydev, AIR_PHY_PAGE_EXTENDED_4); ++ if (saved_page < 0) ++ return saved_page; + -+ ret = air_mii_cl45_write(phydev, 0x1f, LED_ON_CTRL(entity), on_evt | LED_ON_EN); -+ if (ret < 0) -+ return ret; -+ ret = air_mii_cl45_write(phydev, 0x1f, LED_BLK_CTRL(entity), blk_evt); -+ if (ret < 0) -+ return ret; -+ return 0; ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_MODE, ++ AIR_BPBUS_MODE_ADDR_INCR); ++ if (ret < 0) ++ goto restore_page; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_WR_ADDR_HIGH, ++ air_upper_16_bits(address)); ++ if (ret < 0) ++ goto restore_page; ++ ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_WR_ADDR_LOW, ++ air_lower_16_bits(address)); ++ if (ret < 0) ++ goto restore_page; ++ ++ for (offset = 0; offset < array_size; offset += 4) { ++ val = get_unaligned_le16(&buffer[offset + 2]); ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_WR_DATA_HIGH, val); ++ if (ret < 0) ++ goto restore_page; ++ ++ val = get_unaligned_le16(&buffer[offset]); ++ ret = phy_write(phydev, MDIO_DEVAD_NONE, AIR_BPBUS_WR_DATA_LOW, val); ++ if (ret < 0) ++ goto restore_page; ++ } ++ ++restore_page: ++ if (ret < 0) ++ printf("%s 0x%08lx failed: %d\n", __func__, ++ address, ret); ++ ++ return air_phy_restore_page(phydev, saved_page, ret); +} + -+static int airoha_led_set_mode(struct phy_device *phydev, u8 mode) ++static int en8811h_wait_mcu_ready(struct phy_device *phydev) +{ -+ u16 cl45_data; -+ int err = 0; ++ int ret, reg_value; + -+ cl45_data = air_mii_cl45_read(phydev, 0x1f, LED_BCR); -+ switch (mode) { -+ case AIR_LED_MODE_DISABLE: -+ cl45_data &= ~LED_BCR_EXT_CTRL; -+ cl45_data &= ~LED_BCR_MODE_MASK; -+ cl45_data |= LED_BCR_MODE_DISABLE; -+ break; -+ case AIR_LED_MODE_USER_DEFINE: -+ cl45_data |= LED_BCR_EXT_CTRL; -+ cl45_data |= LED_BCR_CLK_EN; -+ break; -+ default: -+ printf("LED mode%d is not supported!\n", mode); -+ return -EINVAL; -+ } -+ err = air_mii_cl45_write(phydev, 0x1f, LED_BCR, cl45_data); -+ if (err < 0) -+ return err; -+ return 0; ++ /* Because of mdio-lock, may have to wait for multiple loads */ ++ ret = phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1, ++ EN8811H_PHY_FW_STATUS, reg_value, ++ reg_value == EN8811H_PHY_READY, ++ 20000, 7500000, true); ++ if (ret) { ++ printf("MCU not ready: 0x%x\n", reg_value); ++ return -ENODEV; ++ } ++ ++ return 0; +} + -+static int airoha_led_set_state(struct phy_device *phydev, u8 entity, u8 state) ++__weak int en8811h_read_fw(void **addr) +{ -+ u16 cl45_data; -+ int err; ++ u32 ca_crc32; ++ void *buffer; ++ int ret; + -+ cl45_data = air_mii_cl45_read(phydev, 0x1f, LED_ON_CTRL(entity)); -+ if (LED_ENABLE == state) -+ cl45_data |= LED_ON_EN; -+ else -+ cl45_data &= ~LED_ON_EN; -+ -+ err = air_mii_cl45_write(phydev, 0x1f, LED_ON_CTRL(entity), cl45_data); -+ if (err < 0) -+ return err; -+ return 0; -+} -+ -+static int en8811h_led_init(struct phy_device *phydev) -+{ -+ unsigned int led_gpio = 0, reg_value = 0; -+ u16 cl45_data = led_dur; -+ int ret, led_id; -+ -+ cl45_data = UNIT_LED_BLINK_DURATION << AIR_LED_BLK_DUR_64M; -+ ret = air_mii_cl45_write(phydev, 0x1f, LED_BLK_DUR, cl45_data); -+ if (ret < 0) -+ return ret; -+ cl45_data >>= 1; -+ ret = air_mii_cl45_write(phydev, 0x1f, LED_ON_DUR, cl45_data); -+ if (ret < 0) -+ return ret; -+ -+ ret = airoha_led_set_mode(phydev, AIR_LED_MODE_USER_DEFINE); -+ if (ret != 0) { -+ printf("LED fail to set mode, ret %d !\n", ret); -+ return ret; -+ } -+ for(led_id = 0; led_id < EN8811H_LED_COUNT; led_id++) -+ { -+ /* LED0 <-> GPIO5, LED1 <-> GPIO4, LED0 <-> GPIO3 */ -+ if ( led_cfg[led_id].gpio != (led_id + (AIR_LED0_GPIO5 - (2 * led_id)))) { -+ printf("LED%d uses incorrect GPIO%d !\n", led_id, led_cfg[led_id].gpio); -+ return -EINVAL; -+ } -+ reg_value = 0; -+ if (led_cfg[led_id].en == LED_ENABLE) -+ { -+ led_gpio |= BIT(led_cfg[led_id].gpio); -+ ret = airoha_led_set_state(phydev, led_id, led_cfg[led_id].en); -+ if (ret != 0) { -+ printf("LED fail to set state, ret %d !\n", ret); -+ return ret; -+ } -+ ret = airoha_led_set_usr_def(phydev, led_id, led_cfg[led_id].pol, led_cfg[led_id].on_cfg, led_cfg[led_id].blk_cfg); -+ if (ret != 0) { -+ printf("LED fail to set default, ret %d !\n", ret); -+ return ret; -+ } -+ } -+ } -+ ret = air_buckpbus_reg_write(phydev, 0xcf8b8, led_gpio); -+ if (ret < 0) -+ return ret; -+ printf("LED initialize OK !\n"); -+ return 0; -+} -+#endif /* AIR_LED_SUPPORT */ -+ -+static char *firmware_buf; -+static int en8811h_load_firmware(struct phy_device *phydev) -+{ -+ u32 pbus_value; -+ int ret = 0; -+ -+ if (!firmware_buf) { -+ firmware_buf = malloc(EN8811H_MD32_DM_SIZE + EN8811H_MD32_DSP_SIZE); -+ if (!firmware_buf) { -+ printf("[Airoha] cannot allocated buffer for firmware.\n"); -+ return -ENOMEM; -+ } ++ /* Allocate memory to store both DM and DSP firmware */ ++ buffer = malloc(EN8811H_MD32_DM_SIZE + EN8811H_MD32_DSP_SIZE); ++ if (!buffer) { ++ printf("Failed to allocate memory for firmware\n"); ++ return -ENOMEM; ++ } + +#ifdef CONFIG_PHY_AIROHA_FW_IN_UBI -+ ret = ubi_volume_read("en8811h-fw", firmware_buf, 0, EN8811H_MD32_DM_SIZE + EN8811H_MD32_DSP_SIZE); -+ if (ret) { -+ printf("[Airoha] read firmware from UBI failed.\n"); -+ free(firmware_buf); -+ firmware_buf = NULL; -+ return ret; -+ } ++ ret = ubi_volume_read("en8811h-fw", buffer, 0, EN8811H_MD32_DM_SIZE + EN8811H_MD32_DSP_SIZE); ++ if (ret) { ++ printf("[Airoha] read firmware from UBI failed.\n"); ++ free(buffer); ++ buffer = NULL; ++ return ret; ++ } +#elif defined(CONFIG_PHY_AIROHA_FW_IN_MMC) -+ struct mmc *mmc = find_mmc_device(0); -+ if (!mmc) { -+ printf("[Airoha] opening MMC device failed.\n"); -+ free(firmware_buf); -+ firmware_buf = NULL; -+ return -ENODEV; -+ } -+ if (mmc_init(mmc)) { -+ printf("[Airoha] initializing MMC device failed.\n"); -+ free(firmware_buf); -+ firmware_buf = NULL; -+ return -ENODEV; -+ } -+ if (IS_SD(mmc)) { -+ printf("[Airoha] SD card is not supported.\n"); -+ free(firmware_buf); -+ firmware_buf = NULL; -+ return -EINVAL; -+ } -+ ret = mmc_set_part_conf(mmc, 1, 2, 2); -+ if (ret) { -+ printf("[Airoha] cannot access eMMC boot1 hw partition.\n"); -+ free(firmware_buf); -+ firmware_buf = NULL; -+ return ret; -+ } -+ ret = blk_dread(mmc_get_blk_desc(mmc), 0, 0x120, firmware_buf); -+ mmc_set_part_conf(mmc, 1, 1, 0); -+ if (ret != 0x120) { -+ printf("[Airoha] cannot read firmware from eMMC.\n"); -+ free(firmware_buf); -+ firmware_buf = NULL; -+ return -EIO; -+ } ++ struct mmc *mmc = find_mmc_device(0); ++ if (!mmc) { ++ printf("[Airoha] opening MMC device failed.\n"); ++ free(buffer); ++ buffer = NULL; ++ return -ENODEV; ++ } ++ if (mmc_init(mmc)) { ++ printf("[Airoha] initializing MMC device failed.\n"); ++ free(buffer); ++ buffer = NULL; ++ return -ENODEV; ++ } ++ if (IS_SD(mmc)) { ++ printf("[Airoha] SD card is not supported.\n"); ++ free(buffer); ++ buffer = NULL; ++ return -EINVAL; ++ } ++ ret = mmc_set_part_conf(mmc, 1, 2, 2); ++ if (ret) { ++ printf("[Airoha] cannot access eMMC boot1 hw partition.\n"); ++ free(buffer); ++ buffer = NULL; ++ return ret; ++ } ++ ret = blk_dread(mmc_get_blk_desc(mmc), 0, 0x120, buffer); ++ mmc_set_part_conf(mmc, 1, 1, 0); ++ if (ret != 0x120) { ++ printf("[Airoha] cannot read firmware from eMMC.\n"); ++ free(buffer); ++ buffer = NULL; ++ return -EIO; ++ } +#else +#warning EN8811H firmware loading not implemented -+ free(firmware_buf); -+ firmware_buf = NULL; -+ return -EOPNOTSUPP; ++ free(buffer); ++ buffer = NULL; ++ return -EOPNOTSUPP; +#endif -+ } + -+ ret = air_buckpbus_reg_write(phydev, 0x0f0018, 0x0); -+ if (ret < 0) -+ return ret; -+ pbus_value = air_buckpbus_reg_read(phydev, 0x800000); -+ pbus_value |= BIT(11); -+ ret = air_buckpbus_reg_write(phydev, 0x800000, pbus_value); -+ if (ret < 0) -+ return ret; -+ /* Download DM */ -+ ret = MDIOWriteBuf(phydev, 0x00000000, EN8811H_MD32_DM_SIZE, firmware_buf); -+ if (ret < 0) { -+ printf("[Airoha] MDIOWriteBuf 0x00000000 fail.\n"); -+ return ret; -+ } -+ /* Download PM */ -+ ret = MDIOWriteBuf(phydev, 0x00100000, EN8811H_MD32_DSP_SIZE, firmware_buf + EN8811H_MD32_DM_SIZE); -+ if (ret < 0) { -+ printf("[Airoha] MDIOWriteBuf 0x00100000 fail.\n"); -+ return ret; -+ } -+ pbus_value = air_buckpbus_reg_read(phydev, 0x800000); -+ pbus_value &= ~BIT(11); -+ ret = air_buckpbus_reg_write(phydev, 0x800000, pbus_value); -+ if (ret < 0) -+ return ret; -+ ret = air_buckpbus_reg_write(phydev, 0x0f0018, 0x01); -+ if (ret < 0) -+ return ret; -+ return 0; ++ /* Calculate CRC32 of DM firmware for verification */ ++ ca_crc32 = crc32(0, (unsigned char *)buffer, EN8811H_MD32_DM_SIZE); ++ debug("DM crc32: 0x%x\n", ca_crc32); ++ ++ /* Calculate CRC32 of DSP firmware for verification */ ++ ca_crc32 = crc32(0, (unsigned char *)buffer + EN8811H_MD32_DM_SIZE, ++ EN8811H_MD32_DSP_SIZE); ++ debug("DSP crc32: 0x%x\n", ca_crc32); ++ ++ *addr = buffer; ++ debug("Found Airoha Firmware.\n"); ++ ++ return 0; ++} ++ ++static int en8811h_load_firmware(struct phy_device *phydev) ++{ ++ struct en8811h_priv *priv = phydev->priv; ++ void *buffer; ++ int ret; ++ ++ ret = en8811h_read_fw(&buffer); ++ if (ret < 0) ++ goto en8811h_load_firmware_out; ++ ++ ret = air_buckpbus_reg_write(phydev, EN8811H_FW_CTRL_1, ++ EN8811H_FW_CTRL_1_START); ++ if (ret < 0) ++ goto en8811h_load_firmware_out; ++ ++ ret = air_buckpbus_reg_modify(phydev, EN8811H_FW_CTRL_2, ++ EN8811H_FW_CTRL_2_LOADING, ++ EN8811H_FW_CTRL_2_LOADING); ++ if (ret < 0) ++ goto en8811h_load_firmware_out; ++ ++ ret = air_write_buf(phydev, AIR_FW_ADDR_DM, EN8811H_MD32_DM_SIZE, ++ (unsigned char *)buffer); ++ if (ret < 0) ++ goto en8811h_load_firmware_out; ++ ++ ret = air_write_buf(phydev, AIR_FW_ADDR_DSP, EN8811H_MD32_DSP_SIZE, ++ (unsigned char *)buffer + EN8811H_MD32_DM_SIZE); ++ if (ret < 0) ++ goto en8811h_load_firmware_out; ++ ++ ret = air_buckpbus_reg_modify(phydev, EN8811H_FW_CTRL_2, ++ EN8811H_FW_CTRL_2_LOADING, 0); ++ if (ret < 0) ++ goto en8811h_load_firmware_out; ++ ++ ret = air_buckpbus_reg_write(phydev, EN8811H_FW_CTRL_1, ++ EN8811H_FW_CTRL_1_FINISH); ++ if (ret < 0) ++ goto en8811h_load_firmware_out; ++ ++ ret = en8811h_wait_mcu_ready(phydev); ++ ++ air_buckpbus_reg_read(phydev, EN8811H_FW_VERSION, ++ &priv->firmware_version); ++ printf("MD32 firmware version: %08x\n", ++ priv->firmware_version); ++ ++en8811h_load_firmware_out: ++ free(buffer); ++ if (ret < 0) ++ printf("Firmware loading failed: %d\n", ret); ++ ++ return ret; ++} ++ ++static int en8811h_restart_mcu(struct phy_device *phydev) ++{ ++ int ret; ++ ++ ret = phy_write_mmd(phydev, 0x1e, 0x8009, 0x0); ++ if (ret < 0) ++ return ret; ++ ++ ret = air_buckpbus_reg_write(phydev, EN8811H_FW_CTRL_1, ++ EN8811H_FW_CTRL_1_START); ++ if (ret < 0) ++ return ret; ++ ++ return air_buckpbus_reg_write(phydev, EN8811H_FW_CTRL_1, ++ EN8811H_FW_CTRL_1_FINISH); ++} ++ ++static int air_led_hw_control_set(struct phy_device *phydev, u8 index, ++ unsigned long rules) ++{ ++ struct en8811h_priv *priv = phydev->priv; ++ u16 on = 0, blink = 0; ++ int ret; ++ ++ if (index >= EN8811H_LED_COUNT) ++ return -EINVAL; ++ ++ priv->led[index].rules = rules; ++ ++ if (rules & BIT(AIR_TRIGGER_NETDEV_FULL_DUPLEX)) ++ on |= AIR_PHY_LED_ON_FDX; ++ ++ if (rules & (BIT(AIR_TRIGGER_NETDEV_LINK_10) | BIT(AIR_TRIGGER_NETDEV_LINK))) ++ on |= AIR_PHY_LED_ON_LINK10; ++ ++ if (rules & (BIT(AIR_TRIGGER_NETDEV_LINK_100) | BIT(AIR_TRIGGER_NETDEV_LINK))) ++ on |= AIR_PHY_LED_ON_LINK100; ++ ++ if (rules & (BIT(AIR_TRIGGER_NETDEV_LINK_1000) | BIT(AIR_TRIGGER_NETDEV_LINK))) ++ on |= AIR_PHY_LED_ON_LINK1000; ++ ++ if (rules & (BIT(AIR_TRIGGER_NETDEV_LINK_2500) | BIT(AIR_TRIGGER_NETDEV_LINK))) ++ on |= AIR_PHY_LED_ON_LINK2500; ++ ++ if (rules & BIT(AIR_TRIGGER_NETDEV_RX)) { ++ blink |= AIR_PHY_LED_BLINK_10RX | ++ AIR_PHY_LED_BLINK_100RX | ++ AIR_PHY_LED_BLINK_1000RX | ++ AIR_PHY_LED_BLINK_2500RX; ++ } ++ ++ if (rules & BIT(AIR_TRIGGER_NETDEV_TX)) { ++ blink |= AIR_PHY_LED_BLINK_10TX | ++ AIR_PHY_LED_BLINK_100TX | ++ AIR_PHY_LED_BLINK_1000TX | ++ AIR_PHY_LED_BLINK_2500TX; ++ } ++ ++ if (blink || on) { ++ /* switch hw-control on, so led-on and led-blink are off */ ++ clear_bit(AIR_PHY_LED_STATE_FORCE_ON, ++ &priv->led[index].state); ++ clear_bit(AIR_PHY_LED_STATE_FORCE_BLINK, ++ &priv->led[index].state); ++ } else { ++ priv->led[index].rules = 0; ++ } ++ ++ ret = phy_modify_mmd(phydev, MDIO_MMD_VEND2, AIR_PHY_LED_ON(index), ++ AIR_PHY_LED_ON_MASK, on); ++ ++ if (ret < 0) ++ return ret; ++ ++ return phy_write_mmd(phydev, MDIO_MMD_VEND2, AIR_PHY_LED_BLINK(index), ++ blink); ++}; ++ ++static int air_led_init(struct phy_device *phydev, u8 index, u8 state, u8 pol) ++{ ++ int val = 0; ++ int err; ++ ++ if (index >= EN8811H_LED_COUNT) ++ return -EINVAL; ++ ++ if (state == AIR_LED_ENABLE) ++ val |= AIR_PHY_LED_ON_ENABLE; ++ else ++ val &= ~AIR_PHY_LED_ON_ENABLE; ++ ++ if (pol == AIR_ACTIVE_HIGH) ++ val |= AIR_PHY_LED_ON_POLARITY; ++ else ++ val &= ~AIR_PHY_LED_ON_POLARITY; ++ ++ err = phy_write_mmd(phydev, 0x1f, AIR_PHY_LED_ON(index), val); ++ if (err < 0) ++ return err; ++ ++ return 0; ++} ++ ++static int air_leds_init(struct phy_device *phydev, int num, u16 dur, int mode) ++{ ++ struct en8811h_priv *priv = phydev->priv; ++ int ret, i; ++ ++ ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, AIR_PHY_LED_DUR_BLINK, ++ dur); ++ if (ret < 0) ++ return ret; ++ ++ ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, AIR_PHY_LED_DUR_ON, ++ dur >> 1); ++ if (ret < 0) ++ return ret; ++ ++ switch (mode) { ++ case AIR_LED_MODE_DISABLE: ++ ret = phy_modify_mmd(phydev, MDIO_MMD_VEND2, AIR_PHY_LED_BCR, ++ AIR_PHY_LED_BCR_EXT_CTRL | ++ AIR_PHY_LED_BCR_MODE_MASK, 0); ++ break; ++ case AIR_LED_MODE_USER_DEFINE: ++ ret = phy_modify_mmd(phydev, MDIO_MMD_VEND2, AIR_PHY_LED_BCR, ++ AIR_PHY_LED_BCR_EXT_CTRL | ++ AIR_PHY_LED_BCR_CLK_EN, ++ AIR_PHY_LED_BCR_EXT_CTRL | ++ AIR_PHY_LED_BCR_CLK_EN); ++ if (ret < 0) ++ return ret; ++ break; ++ default: ++ printf("LED mode %d is not supported\n", mode); ++ return -EINVAL; ++ } ++ ++ for (i = 0; i < num; ++i) { ++ ret = air_led_init(phydev, i, AIR_LED_ENABLE, AIR_ACTIVE_HIGH); ++ if (ret < 0) { ++ printf("LED%d init failed: %d\n", i, ret); ++ return ret; ++ } ++ air_led_hw_control_set(phydev, i, priv->led[i].rules); ++ } ++ ++ return 0; +} + +static int en8811h_config(struct phy_device *phydev) +{ -+ int ret = 0; -+ int pid1 = 0, pid2 = 0; ++ struct en8811h_priv *priv = phydev->priv; ++ ofnode node = phy_get_ofnode(phydev); ++ u32 pbus_value = 0; ++ int ret = 0; + -+ ret = air_pbus_reg_write(phydev, 0xcf928 , 0x0); -+ if (ret < 0) -+ return ret; ++ /* If restart happened in .probe(), no need to restart now */ ++ if (priv->mcu_needs_restart) { ++ ret = en8811h_restart_mcu(phydev); ++ if (ret < 0) ++ return ret; ++ } else { ++ ret = en8811h_load_firmware(phydev); ++ if (ret) { ++ printf("Load firmware fail.\n"); ++ return ret; ++ } ++ /* Next calls to .config() mcu needs to restart */ ++ priv->mcu_needs_restart = true; ++ } + -+ pid1 = phy_read(phydev, MDIO_DEVAD_NONE, MII_PHYSID1); -+ pid2 = phy_read(phydev, MDIO_DEVAD_NONE, MII_PHYSID2); -+ if ((EN8811H_PHY_ID1 != pid1) || (EN8811H_PHY_ID2 != pid2)) { -+ printf("EN8811H does not exist !\n"); -+ return -ENODEV; -+ } ++ ret = phy_write_mmd(phydev, 0x1e, 0x800c, 0x0); ++ if (ret < 0) ++ return ret; ++ ret = phy_write_mmd(phydev, 0x1e, 0x800d, 0x0); ++ if (ret < 0) ++ return ret; ++ ret = phy_write_mmd(phydev, 0x1e, 0x800e, 0x1101); ++ if (ret < 0) ++ return ret; ++ ret = phy_write_mmd(phydev, 0x1e, 0x800f, 0x0002); ++ if (ret < 0) ++ return ret; + -+ return 0; ++ /* Serdes polarity */ ++ pbus_value = 0; ++ if (ofnode_read_bool(node, "airoha,pnswap-rx")) ++ pbus_value |= EN8811H_POLARITY_RX_REVERSE; ++ else ++ pbus_value &= ~EN8811H_POLARITY_RX_REVERSE; ++ if (ofnode_read_bool(node, "airoha,pnswap-tx")) ++ pbus_value &= ~EN8811H_POLARITY_TX_NORMAL; ++ else ++ pbus_value |= EN8811H_POLARITY_TX_NORMAL; ++ ret = air_buckpbus_reg_modify(phydev, EN8811H_POLARITY, ++ EN8811H_POLARITY_RX_REVERSE | ++ EN8811H_POLARITY_TX_NORMAL, pbus_value); ++ if (ret < 0) ++ return ret; ++ ++ ret = air_leds_init(phydev, EN8811H_LED_COUNT, AIR_PHY_LED_DUR, ++ AIR_LED_MODE_USER_DEFINE); ++ if (ret < 0) { ++ printf("Failed to disable leds: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; +} + -+static int en8811h_get_autonego(struct phy_device *phydev, int *an) ++static int en8811h_parse_status(struct phy_device *phydev) +{ -+ int reg; -+ reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR); -+ if (reg < 0) -+ return -EINVAL; -+ if (reg & BMCR_ANENABLE) -+ *an = AUTONEG_ENABLE; -+ else -+ *an = AUTONEG_DISABLE; -+ return 0; ++ int ret = 0, reg_value; ++ ++ phydev->duplex = DUPLEX_FULL; ++ ++ reg_value = phy_read(phydev, MDIO_DEVAD_NONE, AIR_AUX_CTRL_STATUS); ++ if (reg_value < 0) ++ return reg_value; ++ ++ switch (reg_value & AIR_AUX_CTRL_STATUS_SPEED_MASK) { ++ case AIR_AUX_CTRL_STATUS_SPEED_2500: ++ phydev->speed = SPEED_2500; ++ break; ++ case AIR_AUX_CTRL_STATUS_SPEED_1000: ++ phydev->speed = SPEED_1000; ++ break; ++ case AIR_AUX_CTRL_STATUS_SPEED_100: ++ phydev->speed = SPEED_100; ++ break; ++ default: ++ printf("Auto-neg error, defaulting to 100M/FD\n"); ++ phydev->speed = SPEED_100; ++ break; ++ } ++ ++ return ret; +} + +static int en8811h_startup(struct phy_device *phydev) +{ -+ ofnode node = phy_get_ofnode(phydev); -+ int ret = 0, lpagb = 0, lpa = 0, common_adv_gb = 0, common_adv = 0, advgb = 0, adv = 0, reg = 0, an = AUTONEG_DISABLE, bmcr = 0, reg_value; -+ int old_link = phydev->link; -+ u32 pbus_value = 0, retry; ++ int ret = 0; + -+ eth_phy_reset(phydev->dev, 1); -+ mdelay(10); -+ eth_phy_reset(phydev->dev, 0); -+ mdelay(1); ++ ret = genphy_update_link(phydev); ++ if (ret) ++ return ret; + -+ ret = en8811h_load_firmware(phydev); -+ if (ret) { -+ printf("EN8811H load firmware fail.\n"); -+ return ret; -+ } -+ retry = MAX_RETRY; -+ do { -+ mdelay(300); -+ reg_value = air_mii_cl45_read(phydev, 0x1e, 0x8009); -+ if (EN8811H_PHY_READY == reg_value) { -+ printf("EN8811H PHY ready!\n"); -+ break; -+ } -+ retry--; -+ } while (retry); -+ if (0 == retry) { -+ printf("EN8811H PHY is not ready. (MD32 FW Status reg: 0x%x)\n", reg_value); -+ pbus_value = air_buckpbus_reg_read(phydev, 0x3b3c); -+ printf("Check MD32 FW Version(0x3b3c) : %08x\n", pbus_value); -+ printf("EN8811H initialize fail!\n"); -+ return 0; -+ } -+ /* Mode selection*/ -+ printf("EN8811H Mode 1 !\n"); -+ ret = air_mii_cl45_write(phydev, 0x1e, 0x800c, 0x0); -+ if (ret < 0) -+ return ret; -+ ret = air_mii_cl45_write(phydev, 0x1e, 0x800d, 0x0); -+ if (ret < 0) -+ return ret; -+ ret = air_mii_cl45_write(phydev, 0x1e, 0x800e, 0x1101); -+ if (ret < 0) -+ return ret; -+ ret = air_mii_cl45_write(phydev, 0x1e, 0x800f, 0x0002); -+ if (ret < 0) -+ return ret; -+ -+ /* Serdes polarity */ -+ pbus_value = air_buckpbus_reg_read(phydev, 0xca0f8); -+ pbus_value &= 0xfffffffc; -+ pbus_value |= ofnode_read_bool(node, "airoha,rx-pol-reverse") ? -+ EN8811H_RX_POLARITY_REVERSE : EN8811H_RX_POLARITY_NORMAL; -+ pbus_value |= ofnode_read_bool(node, "airoha,tx-pol-reverse") ? -+ EN8811H_TX_POLARITY_REVERSE : EN8811H_TX_POLARITY_NORMAL; -+ ret = air_buckpbus_reg_write(phydev, 0xca0f8, pbus_value); -+ if (ret < 0) -+ return ret; -+ pbus_value = air_buckpbus_reg_read(phydev, 0xca0f8); -+ printf("Tx, Rx Polarity(0xca0f8): %08x\n", pbus_value); -+ pbus_value = air_buckpbus_reg_read(phydev, 0x3b3c); -+ printf("MD32 FW Version(0x3b3c) : %08x\n", pbus_value); -+#if defined(AIR_LED_SUPPORT) -+ ret = en8811h_led_init(phydev); -+ if (ret < 0) { -+ printf("en8811h_led_init fail\n"); -+ } -+#endif -+ printf("EN8811H initialize OK ! (%s)\n", EN8811H_DRIVER_VERSION); -+ -+ ret = genphy_update_link(phydev); -+ if (ret) -+ { -+ printf("ret %d!\n", ret); -+ return ret; -+ } -+ -+ ret = genphy_parse_link(phydev); -+ if (ret) -+ { -+ printf("ret %d!\n", ret); -+ return ret; -+ } -+ -+ if (old_link && phydev->link) -+ return 0; -+ -+ phydev->speed = SPEED_100; -+ phydev->duplex = DUPLEX_FULL; -+ phydev->pause = 0; -+ phydev->asym_pause = 0; -+ -+ reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR); -+ if (reg < 0) -+ { -+ printf("MII_BMSR reg %d!\n", reg); -+ return reg; -+ } -+ reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR); -+ if (reg < 0) -+ { -+ printf("MII_BMSR reg %d!\n", reg); -+ return reg; -+ } -+ if(reg & BMSR_LSTATUS) -+ { -+ pbus_value = air_buckpbus_reg_read(phydev, 0x109D4); -+ if (0x10 & pbus_value) { -+ phydev->speed = SPEED_2500; -+ phydev->duplex = DUPLEX_FULL; -+ } -+ else -+ { -+ ret = en8811h_get_autonego(phydev, &an); -+ if ((AUTONEG_ENABLE == an) && (0 == ret)) -+ { -+ printf("AN mode!\n"); -+ printf("SPEED 1000/100!\n"); -+ lpagb = phy_read(phydev, MDIO_DEVAD_NONE, MII_STAT1000); -+ if (lpagb < 0 ) -+ return lpagb; -+ advgb = phy_read(phydev, MDIO_DEVAD_NONE, MII_CTRL1000); -+ if (adv < 0 ) -+ return adv; -+ common_adv_gb = (lpagb & (advgb << 2)); -+ -+ lpa = phy_read(phydev, MDIO_DEVAD_NONE, MII_LPA); -+ if (lpa < 0 ) -+ return lpa; -+ adv = phy_read(phydev, MDIO_DEVAD_NONE, MII_ADVERTISE); -+ if (adv < 0 ) -+ return adv; -+ common_adv = (lpa & adv); -+ -+ phydev->speed = SPEED_10; -+ phydev->duplex = DUPLEX_HALF; -+ if (common_adv_gb & (LPA_1000FULL | LPA_1000HALF)) -+ { -+ phydev->speed = SPEED_1000; -+ if (common_adv_gb & LPA_1000FULL) -+ -+ phydev->duplex = DUPLEX_FULL; -+ } -+ else if (common_adv & (LPA_100FULL | LPA_100HALF)) -+ { -+ phydev->speed = SPEED_100; -+ if (common_adv & LPA_100FULL) -+ phydev->duplex = DUPLEX_FULL; -+ } -+ else -+ { -+ if (common_adv & LPA_10FULL) -+ phydev->duplex = DUPLEX_FULL; -+ } -+ } -+ else -+ { -+ printf("Force mode!\n"); -+ bmcr = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR); -+ -+ if (bmcr < 0) -+ return bmcr; -+ -+ if (bmcr & BMCR_FULLDPLX) -+ phydev->duplex = DUPLEX_FULL; -+ else -+ phydev->duplex = DUPLEX_HALF; -+ -+ if (bmcr & BMCR_SPEED1000) -+ phydev->speed = SPEED_1000; -+ else if (bmcr & BMCR_SPEED100) -+ phydev->speed = SPEED_100; -+ else -+ phydev->speed = SPEED_100; -+ } -+ } -+ } -+ -+ return ret; ++ return en8811h_parse_status(phydev); +} + -+#if AIR_UBOOT_REVISION > 0x202303 -+U_BOOT_PHY_DRIVER(en8811h) = { -+ .name = "Airoha EN8811H", -+ .uid = EN8811H_PHY_ID, -+ .mask = 0x0ffffff0, -+ .config = &en8811h_config, -+ .startup = &en8811h_startup, -+ .shutdown = &genphy_shutdown, -+}; -+#else -+static struct phy_driver AIR_EN8811H_driver = { -+ .name = "Airoha EN8811H", -+ .uid = EN8811H_PHY_ID, -+ .mask = 0x0ffffff0, -+ .config = &en8811h_config, -+ .startup = &en8811h_startup, -+ .shutdown = &genphy_shutdown, -+}; -+ -+int phy_air_en8811h_init(void) ++static int en8811h_probe(struct phy_device *phydev) +{ -+ phy_register(&AIR_EN8811H_driver); -+ return 0; ++ struct en8811h_priv *priv; ++ ++ priv = malloc(sizeof(*priv)); ++ if (!priv) ++ return -ENOMEM; ++ memset(priv, 0, sizeof(*priv)); ++ ++ priv->led[0].rules = AIR_DEFAULT_TRIGGER_LED0; ++ priv->led[1].rules = AIR_DEFAULT_TRIGGER_LED1; ++ priv->led[2].rules = AIR_DEFAULT_TRIGGER_LED2; ++ ++ /* mcu has just restarted after firmware load */ ++ priv->mcu_needs_restart = false; ++ ++ phydev->priv = priv; ++ ++ return 0; +} -+#endif ---- /dev/null -+++ b/drivers/net/phy/air_en8811h.h -@@ -0,0 +1,163 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+/************************************************* -+ * FILE NAME: air_en8811h.h -+ * PURPOSE: -+ * EN8811H PHY Driver for Uboot -+ * NOTES: -+ * -+ * Copyright (C) 2023 Airoha Technology Corp. -+ *************************************************/ + -+#ifndef __EN8811H_H -+#define __EN8811H_H -+ -+#define AIR_UBOOT_REVISION ((((U_BOOT_VERSION_NUM / 1000) % 10) << 20) | \ -+ (((U_BOOT_VERSION_NUM / 100) % 10) << 16) | \ -+ (((U_BOOT_VERSION_NUM / 10) % 10) << 12) | \ -+ ((U_BOOT_VERSION_NUM % 10) << 8) | \ -+ (((U_BOOT_VERSION_NUM_PATCH / 10) % 10) << 4) | \ -+ ((U_BOOT_VERSION_NUM_PATCH % 10) << 0)) -+ -+#define EN8811H_PHY_ID1 0x03a2 -+#define EN8811H_PHY_ID2 0xa411 -+#define EN8811H_PHY_ID ((EN8811H_PHY_ID1 << 16) | EN8811H_PHY_ID2) -+#define EN8811H_SPEED_2500 0x03 -+#define EN8811H_PHY_READY 0x02 -+#define MAX_RETRY 5 -+ -+#define EN8811H_MD32_DM_SIZE 0x4000 -+#define EN8811H_MD32_DSP_SIZE 0x20000 -+ -+#define EN8811H_TX_POLARITY_NORMAL 0x1 -+#define EN8811H_TX_POLARITY_REVERSE 0x0 -+ -+#define EN8811H_RX_POLARITY_NORMAL (0x0 << 1) -+#define EN8811H_RX_POLARITY_REVERSE (0x1 << 1) -+ -+#ifndef BIT -+#define BIT(nr) (1UL << (nr)) -+#endif -+ -+/* CL45 MDIO control */ -+#define MII_MMD_ACC_CTL_REG 0x0d -+#define MII_MMD_ADDR_DATA_REG 0x0e -+#define MMD_OP_MODE_DATA BIT(14) -+/* MultiGBASE-T AN register */ -+#define MULTIG_ANAR_2500M (0x0080) -+#define MULTIG_LPAR_2500M (0x0020) -+ -+#define EN8811H_DRIVER_VERSION "v1.0.4" -+ -+/************************************************************ -+ * For reference only -+ * LED0 Link 2500/Blink 2500 TxRx (GPIO5) <-> BASE_T_LED0, -+ * LED1 Link 1000/Blink 1000 TxRx (GPIO4) <-> BASE_T_LED1, -+ * LED2 Link 100/Blink 100 TxRx (GPIO3) <-> BASE_T_LED2, -+ ************************************************************/ -+/* User-defined.B */ -+#define AIR_LED0_ON (LED_ON_EVT_LINK_2500M) -+#define AIR_LED0_BLK (LED_BLK_EVT_2500M_TX_ACT | LED_BLK_EVT_2500M_RX_ACT) -+#define AIR_LED1_ON (LED_ON_EVT_LINK_1000M) -+#define AIR_LED1_BLK (LED_BLK_EVT_1000M_TX_ACT | LED_BLK_EVT_1000M_RX_ACT) -+#define AIR_LED2_ON (LED_ON_EVT_LINK_100M) -+#define AIR_LED2_BLK (LED_BLK_EVT_100M_TX_ACT | LED_BLK_EVT_100M_RX_ACT) -+/* User-defined.E */ -+ -+#define LED_ON_CTRL(i) (0x024 + ((i)*2)) -+#define LED_ON_EN (1 << 15) -+#define LED_ON_POL (1 << 14) -+#define LED_ON_EVT_MASK (0x1ff) -+/* LED ON Event Option.B */ -+#define LED_ON_EVT_LINK_2500M (1 << 8) -+#define LED_ON_EVT_FORCE (1 << 6) -+#define LED_ON_EVT_HDX (1 << 5) -+#define LED_ON_EVT_FDX (1 << 4) -+#define LED_ON_EVT_LINK_DOWN (1 << 3) -+#define LED_ON_EVT_LINK_100M (1 << 1) -+#define LED_ON_EVT_LINK_1000M (1 << 0) -+/* LED ON Event Option.E */ -+ -+#define LED_BLK_CTRL(i) (0x025 + ((i)*2)) -+#define LED_BLK_EVT_MASK (0xfff) -+/* LED Blinking Event Option.B*/ -+#define LED_BLK_EVT_2500M_RX_ACT (1 << 11) -+#define LED_BLK_EVT_2500M_TX_ACT (1 << 10) -+#define LED_BLK_EVT_FORCE (1 << 9) -+#define LED_BLK_EVT_100M_RX_ACT (1 << 3) -+#define LED_BLK_EVT_100M_TX_ACT (1 << 2) -+#define LED_BLK_EVT_1000M_RX_ACT (1 << 1) -+#define LED_BLK_EVT_1000M_TX_ACT (1 << 0) -+/* LED Blinking Event Option.E*/ -+#define LED_ENABLE 1 -+#define LED_DISABLE 0 -+ -+#define EN8811H_LED_COUNT 3 -+ -+#define LED_BCR (0x021) -+#define LED_BCR_EXT_CTRL (1 << 15) -+#define LED_BCR_CLK_EN (1 << 3) -+#define LED_BCR_TIME_TEST (1 << 2) -+#define LED_BCR_MODE_MASK (3) -+#define LED_BCR_MODE_DISABLE (0) -+#define LED_BCR_MODE_2LED (1) -+#define LED_BCR_MODE_3LED_1 (2) -+#define LED_BCR_MODE_3LED_2 (3) -+ -+#define LED_ON_DUR (0x022) -+#define LED_ON_DUR_MASK (0xffff) -+ -+#define LED_BLK_DUR (0x023) -+#define LED_BLK_DUR_MASK (0xffff) -+ -+#define LED_GPIO_SEL_MASK 0x7FFFFFF -+ -+#define UNIT_LED_BLINK_DURATION 1024 -+ -+#define INVALID_DATA 0xffff -+#define PBUS_INVALID_DATA 0xffffffff -+ -+struct air_base_t_led_cfg_s { -+ u16 en; -+ u16 gpio; -+ u16 pol; -+ u16 on_cfg; -+ u16 blk_cfg; ++U_BOOT_PHY_DRIVER(en8811h) = { ++ .name = "Airoha EN8811H", ++ .uid = EN8811H_PHY_ID, ++ .mask = 0x0ffffff0, ++ .config = &en8811h_config, ++ .probe = &en8811h_probe, ++ .startup = &en8811h_startup, ++ .shutdown = &genphy_shutdown, +}; -+ -+enum { -+ AIR_LED2_GPIO3 = 3, -+ AIR_LED1_GPIO4, -+ AIR_LED0_GPIO5, -+ AIR_LED_LAST -+}; -+ -+enum { -+ AIR_BASE_T_LED0, -+ AIR_BASE_T_LED1, -+ AIR_BASE_T_LED2, -+ AIR_BASE_T_LED3 -+}; -+ -+enum { -+ AIR_LED_BLK_DUR_32M, -+ AIR_LED_BLK_DUR_64M, -+ AIR_LED_BLK_DUR_128M, -+ AIR_LED_BLK_DUR_256M, -+ AIR_LED_BLK_DUR_512M, -+ AIR_LED_BLK_DUR_1024M, -+ AIR_LED_BLK_DUR_LAST -+}; -+ -+enum { -+ AIR_ACTIVE_LOW, -+ AIR_ACTIVE_HIGH, -+}; -+ -+enum { -+ AIR_LED_MODE_DISABLE, -+ AIR_LED_MODE_USER_DEFINE, -+ AIR_LED_MODE_LAST -+}; -+ -+#endif /* End of __EN8811H_MD32_H */ -+ ---- a/drivers/net/eth-phy-uclass.c -+++ b/drivers/net/eth-phy-uclass.c -@@ -154,7 +154,7 @@ static int eth_phy_of_to_plat(struct ude - return 0; - } - --static void eth_phy_reset(struct udevice *dev, int value) -+void eth_phy_reset(struct udevice *dev, int value) - { - struct eth_phy_device_priv *uc_priv = dev_get_uclass_priv(dev); - u32 delay; ---- a/include/eth_phy.h -+++ b/include/eth_phy.h -@@ -14,5 +14,6 @@ int eth_phy_binds_nodes(struct udevice * - int eth_phy_set_mdio_bus(struct udevice *eth_dev, struct mii_dev *mdio_bus); - struct mii_dev *eth_phy_get_mdio_bus(struct udevice *eth_dev); - int eth_phy_get_addr(struct udevice *dev); -+void eth_phy_reset(struct udevice *dev, int value); - - #endif diff --git a/package/boot/uboot-mediatek/patches/442-add-bpi-r3-mini.patch b/package/boot/uboot-mediatek/patches/442-add-bpi-r3-mini.patch index ad556b7d82..fd01261624 100644 --- a/package/boot/uboot-mediatek/patches/442-add-bpi-r3-mini.patch +++ b/package/boot/uboot-mediatek/patches/442-add-bpi-r3-mini.patch @@ -503,7 +503,7 @@ + compatible = "ethernet-phy-id03a2.a411"; + reg = <14>; + -+ airoha,rx-pol-reverse; ++ airoha,pnswap-rx; + + reset-gpios = <&gpio 49 GPIO_ACTIVE_LOW>; + reset-assert-us = <10000>; From 58bd949e349caf238ed7f3d40a463dc2bd7de362 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Tue, 16 Sep 2025 17:19:23 +0200 Subject: [PATCH 05/87] ipq-wifi: update to Git HEAD (2025-09-16) c40198780e44 qca9888: add BDF for TP-Link Archer C60 v1 65d951610e0c QCA9888: added TP-Link Archer C60 v2 (US) BDF Link: https://github.com/openwrt/firmware_qca-wireless/pull/67 Signed-off-by: Robert Marko (cherry picked from commit 86f58731ef6ab200c1c1f051b5a01a8b8c98eded) Link: https://github.com/openwrt/openwrt/pull/20157 Signed-off-by: Hauke Mehrtens --- package/firmware/ipq-wifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 94ac729aee..fe1c4fb7c0 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2025-08-25 -PKG_SOURCE_VERSION:=a510502e7922b0a61e455e43479a62e7d27cf3ba -PKG_MIRROR_HASH:=0b8120ce09fdd9176e77b65f2c0866e14aa580ba7e6dd9440f37011418346be7 +PKG_SOURCE_DATE:=2025-09-16 +PKG_SOURCE_VERSION:=65d951610e0c32be4512275018490616cd9334b5 +PKG_MIRROR_HASH:=e6beb7648263ba70551adf302a5bf0108d281e16d87a94675e38f2a98b406b57 PKG_FLAGS:=nonshared include $(INCLUDE_DIR)/package.mk From c3b19ebc6882cc2bd7bf7ee83b0078b261b8dc29 Mon Sep 17 00:00:00 2001 From: Christoph Krapp Date: Mon, 8 Sep 2025 22:04:49 +0200 Subject: [PATCH 06/87] ipq-wifi: Add entry for TP-Link Archer C60 v1 Add IPQ Wifi entry for ath79 TP-Link Archer C60 v1. Signed-off-by: Christoph Krapp Link: https://github.com/openwrt/openwrt/pull/19993 (cherry picked from commit a7ca19962b3a406cf253f593b6cf2f0565d5a132) Link: https://github.com/openwrt/openwrt/pull/20157 Signed-off-by: Hauke Mehrtens --- package/firmware/ipq-wifi/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index fe1c4fb7c0..319dc98e37 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -56,6 +56,7 @@ ALLWIFIBOARDS:= \ spectrum_sax1v1k \ tplink_eap660hd-v1 \ tplink_archer-c6-v2 \ + tplink_archer-c60-v1 \ wallys_dr40x9 \ xiaomi_aiot-ac2350 \ xiaomi_ax3600 \ @@ -188,6 +189,7 @@ $(eval $(call generate-ipq-wifi-package,skspruce_wia3300-20,SKSpruce WIA3300-20) $(eval $(call generate-ipq-wifi-package,spectrum_sax1v1k,Spectrum SAX1V1K)) $(eval $(call generate-ipq-wifi-package,tplink_eap660hd-v1,TP-Link EAP660 HD v1)) $(eval $(call generate-ipq-wifi-package,tplink_archer-c6-v2,TP-Link Archer C6 V2)) +$(eval $(call generate-ipq-wifi-package,tplink_archer-c60-v1,TP-Link Archer C60 V1)) $(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9)) $(eval $(call generate-ipq-wifi-package,xiaomi_aiot-ac2350,Xiaomi AIoT AC2350)) $(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600)) From 406b980d97b5223e7d1158818d599ae007313280 Mon Sep 17 00:00:00 2001 From: Christoph Krapp Date: Mon, 8 Sep 2025 22:18:05 +0200 Subject: [PATCH 07/87] ath79: add calibtation variant for TP-Link Archer C60 v1 Now that we have a board file, add calibration variant for TP-Link Archer C60 v1 and add ipq-wifi package for it. Signed-off-by: Christoph Krapp Link: https://github.com/openwrt/openwrt/pull/19993 (cherry picked from commit 9401b8b86d9b3a441555311542fa42fb90e0b170) Link: https://github.com/openwrt/openwrt/pull/20157 Signed-off-by: Hauke Mehrtens --- target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts | 1 + target/linux/ath79/image/generic-tp-link.mk | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts index b64f8c7cec..c0fa7eec5c 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts @@ -33,6 +33,7 @@ reg = <0x0000 0 0 0 0>; nvmem-cells = <&precal_art_5000>, <&macaddr_info_8 (-1)>; nvmem-cell-names = "pre-calibration", "mac-address"; + qcom,ath10k-calibration-variant = "TP-Link-Archer-c60-v1"; }; }; diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index 9c1cf90a91..6055c724d9 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -129,7 +129,7 @@ define Device/tplink_archer-c60-v1 DEVICE_MODEL := Archer C60 DEVICE_VARIANT := v1 TPLINK_BOARD_ID := ARCHER-C60-V1 - DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca9888-ct + DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca9888-ct ipq-wifi-tplink_archer-c60-v1 SUPPORTED_DEVICES += archer-c60-v1 endef TARGET_DEVICES += tplink_archer-c60-v1 From c8d2201f82c83ac978d9341dbb9ff65ff759139d Mon Sep 17 00:00:00 2001 From: Goetz Goerisch Date: Fri, 19 Sep 2025 19:27:46 +0200 Subject: [PATCH 08/87] kernel: bump 6.6 to 6.6.107 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.107 All patches auto-refreshed. Signed-off-by: Goetz Goerisch Link: https://github.com/openwrt/openwrt/pull/20095 (cherry picked from commit 2f61f77fb0e069aac38e6ed80e69431ea9b53636) Signed-off-by: Goetz Goerisch Link: https://github.com/openwrt/openwrt/pull/20237 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 ++-- ...75-serial-sc16is7xx-Read-modem-line-state-at-startup.patch | 2 +- ...serial-sc16is7xx-announce-support-for-SER_RS485_RTS_.patch | 2 +- ...net-phy-add-support-for-scanning-PHY-in-PHY-packages.patch | 4 ++-- target/linux/generic/hack-6.6/901-debloat_sock_diag.patch | 2 +- target/linux/generic/hack-6.6/902-debloat_proc.patch | 2 +- ...net-remove-NETIF_F_GSO_FRAGLIST-from-NETIF_F_GSO_SOF.patch | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/kernel-6.6 b/include/kernel-6.6 index e6fa78c5d7..ecfe1f667e 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .106 -LINUX_KERNEL_HASH-6.6.106 = 0c3180e2d8dcd0b70fe83554d9c440e31bab17873e360b89c4ab62a4fd26a8a0 +LINUX_VERSION-6.6 = .107 +LINUX_KERNEL_HASH-6.6.107 = c9b73017d3c7867b9c69a542e5318620cf2b14ed23d52f6aeaaee8aded9ee447 diff --git a/target/linux/bcm27xx/patches-6.6/950-0475-serial-sc16is7xx-Read-modem-line-state-at-startup.patch b/target/linux/bcm27xx/patches-6.6/950-0475-serial-sc16is7xx-Read-modem-line-state-at-startup.patch index 0149501e77..932e4264b0 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0475-serial-sc16is7xx-Read-modem-line-state-at-startup.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0475-serial-sc16is7xx-Read-modem-line-state-at-startup.patch @@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c -@@ -1210,6 +1210,9 @@ static int sc16is7xx_startup(struct uart +@@ -1200,6 +1200,9 @@ static int sc16is7xx_startup(struct uart SC16IS7XX_IER_MSI_BIT; sc16is7xx_port_write(port, SC16IS7XX_IER_REG, val); diff --git a/target/linux/bcm27xx/patches-6.6/950-1464-serial-sc16is7xx-announce-support-for-SER_RS485_RTS_.patch b/target/linux/bcm27xx/patches-6.6/950-1464-serial-sc16is7xx-announce-support-for-SER_RS485_RTS_.patch index 2f52823afc..2d408eddfd 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1464-serial-sc16is7xx-announce-support-for-SER_RS485_RTS_.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1464-serial-sc16is7xx-announce-support-for-SER_RS485_RTS_.patch @@ -31,7 +31,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c -@@ -1480,7 +1480,7 @@ static int sc16is7xx_setup_mctrl_ports(s +@@ -1470,7 +1470,7 @@ static int sc16is7xx_setup_mctrl_ports(s } static const struct serial_rs485 sc16is7xx_rs485_supported = { diff --git a/target/linux/generic/backport-6.6/716-v6.9-02-net-phy-add-support-for-scanning-PHY-in-PHY-packages.patch b/target/linux/generic/backport-6.6/716-v6.9-02-net-phy-add-support-for-scanning-PHY-in-PHY-packages.patch index 81f2d1d8e6..9a2b082001 100644 --- a/target/linux/generic/backport-6.6/716-v6.9-02-net-phy-add-support-for-scanning-PHY-in-PHY-packages.patch +++ b/target/linux/generic/backport-6.6/716-v6.9-02-net-phy-add-support-for-scanning-PHY-in-PHY-packages.patch @@ -143,7 +143,7 @@ Signed-off-by: David S. Miller } --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c -@@ -455,19 +455,34 @@ EXPORT_SYMBOL(of_mdio_find_bus); +@@ -456,19 +456,34 @@ EXPORT_SYMBOL(of_mdio_find_bus); * found, set the of_node pointer for the mdio device. This allows * auto-probed phy devices to be supplied with information passed in * via DT. @@ -185,7 +185,7 @@ Signed-off-by: David S. Miller addr = of_mdio_parse_addr(dev, child); if (addr < 0) continue; -@@ -477,9 +492,22 @@ static void of_mdiobus_link_mdiodev(stru +@@ -478,9 +493,22 @@ static void of_mdiobus_link_mdiodev(stru /* The refcount on "child" is passed to the mdio * device. Do _not_ use of_node_put(child) here. */ diff --git a/target/linux/generic/hack-6.6/901-debloat_sock_diag.patch b/target/linux/generic/hack-6.6/901-debloat_sock_diag.patch index 157f8f76e3..ed1dd85e31 100644 --- a/target/linux/generic/hack-6.6/901-debloat_sock_diag.patch +++ b/target/linux/generic/hack-6.6/901-debloat_sock_diag.patch @@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau INDIRECT_CALLABLE_DECLARE(struct dst_entry *ip6_dst_check(struct dst_entry *, u32)); INDIRECT_CALLABLE_DECLARE(struct dst_entry *ipv4_dst_check(struct dst_entry *, -@@ -2258,9 +2275,11 @@ static void __sk_free(struct sock *sk) +@@ -2263,9 +2280,11 @@ static void __sk_free(struct sock *sk) if (likely(sk->sk_net_refcnt)) sock_inuse_add(sock_net(sk), -1); diff --git a/target/linux/generic/hack-6.6/902-debloat_proc.patch b/target/linux/generic/hack-6.6/902-debloat_proc.patch index 6c41d39d40..ed6b751e1c 100644 --- a/target/linux/generic/hack-6.6/902-debloat_proc.patch +++ b/target/linux/generic/hack-6.6/902-debloat_proc.patch @@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -4160,6 +4160,8 @@ static __net_initdata struct pernet_oper +@@ -4165,6 +4165,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/pending-6.6/681-net-remove-NETIF_F_GSO_FRAGLIST-from-NETIF_F_GSO_SOF.patch b/target/linux/generic/pending-6.6/681-net-remove-NETIF_F_GSO_FRAGLIST-from-NETIF_F_GSO_SOF.patch index 126ee5e520..d7d654e49f 100644 --- a/target/linux/generic/pending-6.6/681-net-remove-NETIF_F_GSO_FRAGLIST-from-NETIF_F_GSO_SOF.patch +++ b/target/linux/generic/pending-6.6/681-net-remove-NETIF_F_GSO_FRAGLIST-from-NETIF_F_GSO_SOF.patch @@ -96,7 +96,7 @@ Signed-off-by: Felix Fietkau return features; --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -2461,7 +2461,7 @@ void sk_setup_caps(struct sock *sk, stru +@@ -2466,7 +2466,7 @@ void sk_setup_caps(struct sock *sk, stru if (sk_is_tcp(sk)) sk->sk_route_caps |= NETIF_F_GSO; if (sk->sk_route_caps & NETIF_F_GSO) From bf7a4d9d5ae58a4df5101287682bfb113b5e5cc6 Mon Sep 17 00:00:00 2001 From: Goetz Goerisch Date: Sat, 27 Sep 2025 15:40:19 +0000 Subject: [PATCH 09/87] kernel: bump 6.6 to 6.6.108 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.108 Signed-off-by: Goetz Goerisch Link: https://github.com/openwrt/openwrt/pull/20214 (cherry picked from commit 7114446523da2b4e4f8e2f9531d03764121c174c) Signed-off-by: Goetz Goerisch Link: https://github.com/openwrt/openwrt/pull/20237 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 ++-- ...950-0065-cgroup-Disable-cgroup-memory-by-default.patch | 8 ++++---- ...up-Use-kernel-command-line-to-disable-memory-cgr.patch | 8 ++++---- ...p-cgroup-Use-kernel-command-line-to-disable-memo.patch | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/kernel-6.6 b/include/kernel-6.6 index ecfe1f667e..b1eaea13b2 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .107 -LINUX_KERNEL_HASH-6.6.107 = c9b73017d3c7867b9c69a542e5318620cf2b14ed23d52f6aeaaee8aded9ee447 +LINUX_VERSION-6.6 = .108 +LINUX_KERNEL_HASH-6.6.108 = 601cd332aa695d16607b353feff369b4a0b36d111be077e8af54bdd41e1968a6 diff --git a/target/linux/bcm27xx/patches-6.6/950-0065-cgroup-Disable-cgroup-memory-by-default.patch b/target/linux/bcm27xx/patches-6.6/950-0065-cgroup-Disable-cgroup-memory-by-default.patch index 5600e85734..eb29af01c1 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0065-cgroup-Disable-cgroup-memory-by-default.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0065-cgroup-Disable-cgroup-memory-by-default.patch @@ -17,7 +17,7 @@ Signed-off-by: Phil Elwell --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c -@@ -6059,6 +6059,9 @@ int __init cgroup_init_early(void) +@@ -6082,6 +6082,9 @@ int __init cgroup_init_early(void) return 0; } @@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell /** * cgroup_init - cgroup initialization * -@@ -6092,6 +6095,12 @@ int __init cgroup_init(void) +@@ -6115,6 +6118,12 @@ int __init cgroup_init(void) cgroup_unlock(); @@ -40,7 +40,7 @@ Signed-off-by: Phil Elwell for_each_subsys(ss, ssid) { if (ss->early_init) { struct cgroup_subsys_state *css = -@@ -6740,6 +6749,10 @@ static int __init cgroup_disable(char *s +@@ -6769,6 +6778,10 @@ static int __init cgroup_disable(char *s strcmp(token, ss->legacy_name)) continue; @@ -51,7 +51,7 @@ Signed-off-by: Phil Elwell static_branch_disable(cgroup_subsys_enabled_key[i]); pr_info("Disabling %s control group subsystem\n", ss->name); -@@ -6758,6 +6771,31 @@ static int __init cgroup_disable(char *s +@@ -6787,6 +6800,31 @@ static int __init cgroup_disable(char *s } __setup("cgroup_disable=", cgroup_disable); diff --git a/target/linux/bcm27xx/patches-6.6/950-1349-cgroup-Use-kernel-command-line-to-disable-memory-cgr.patch b/target/linux/bcm27xx/patches-6.6/950-1349-cgroup-Use-kernel-command-line-to-disable-memory-cgr.patch index b1ceaad71d..7946586d40 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1349-cgroup-Use-kernel-command-line-to-disable-memory-cgr.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1349-cgroup-Use-kernel-command-line-to-disable-memory-cgr.patch @@ -148,7 +148,7 @@ Signed-off-by: Maíra Canal --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c -@@ -6059,9 +6059,6 @@ int __init cgroup_init_early(void) +@@ -6082,9 +6082,6 @@ int __init cgroup_init_early(void) return 0; } @@ -158,7 +158,7 @@ Signed-off-by: Maíra Canal /** * cgroup_init - cgroup initialization * -@@ -6095,12 +6092,6 @@ int __init cgroup_init(void) +@@ -6118,12 +6115,6 @@ int __init cgroup_init(void) cgroup_unlock(); @@ -171,7 +171,7 @@ Signed-off-by: Maíra Canal for_each_subsys(ss, ssid) { if (ss->early_init) { struct cgroup_subsys_state *css = -@@ -6749,10 +6740,6 @@ static int __init cgroup_disable(char *s +@@ -6778,10 +6769,6 @@ static int __init cgroup_disable(char *s strcmp(token, ss->legacy_name)) continue; @@ -182,7 +182,7 @@ Signed-off-by: Maíra Canal static_branch_disable(cgroup_subsys_enabled_key[i]); pr_info("Disabling %s control group subsystem\n", ss->name); -@@ -6786,7 +6773,7 @@ static int __init cgroup_enable(char *st +@@ -6815,7 +6802,7 @@ static int __init cgroup_enable(char *st strcmp(token, ss->legacy_name)) continue; diff --git a/target/linux/bcm27xx/patches-6.6/950-1445-fixup-cgroup-Use-kernel-command-line-to-disable-memo.patch b/target/linux/bcm27xx/patches-6.6/950-1445-fixup-cgroup-Use-kernel-command-line-to-disable-memo.patch index b3a73945f6..5241744b2c 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1445-fixup-cgroup-Use-kernel-command-line-to-disable-memo.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1445-fixup-cgroup-Use-kernel-command-line-to-disable-memo.patch @@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c -@@ -6773,11 +6773,19 @@ static int __init cgroup_enable(char *st +@@ -6802,11 +6802,19 @@ static int __init cgroup_enable(char *st strcmp(token, ss->legacy_name)) continue; From c1d14f27348f10308f8d87d39255f39a503e3d23 Mon Sep 17 00:00:00 2001 From: Florian Maurer Date: Mon, 29 Sep 2025 00:38:03 +0200 Subject: [PATCH 10/87] mac80211: ath: improve ath10k "failed to flush transmit queue" errors Currently, in busy environments, ath10k logs "failed to flush transmit queue" errors and have a spiking CPU usage, making the wireless barely usable. With this patch, taken from https://patchwork.kernel.org/project/linux-wireless/patch/20250806070005.1429-1-hujy652@gmail.com/ this does not occur in normal operation and the wifi is much more stable Supersedes #19427 Ref: https://github.com/openwrt/openwrt/issues/15929#issuecomment-2227391307 Ref: https://github.com/openwrt/openwrt/issues/14965 Signed-off-by: Florian Maurer Link: https://github.com/openwrt/openwrt/pull/19529 (cherry picked from commit ab50b9a56148767a5e364ad41b79e186c7eea8f4) Link: https://github.com/openwrt/openwrt/pull/20266 Signed-off-by: Hauke Mehrtens --- .../991-ath10k-support-flush_sta-method.patch | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 package/kernel/mac80211/patches/ath10k/991-ath10k-support-flush_sta-method.patch diff --git a/package/kernel/mac80211/patches/ath10k/991-ath10k-support-flush_sta-method.patch b/package/kernel/mac80211/patches/ath10k/991-ath10k-support-flush_sta-method.patch new file mode 100644 index 0000000000..a0f6eed7cd --- /dev/null +++ b/package/kernel/mac80211/patches/ath10k/991-ath10k-support-flush_sta-method.patch @@ -0,0 +1,70 @@ +From: Zhi-Jun You +Date: Wed, 6 Aug 2025 15:00:05 +0800 +Subject: [RFC PATCH] wifi: ath10k: support flush_sta method + + +When a STA is marked as no longer authorized, if the driver doesn't +implement flush_sta(), mac80211 calls ieee80211_flush_queues() to +flush hardware queues to avoid sending unencrypted frames. + +This has became a problem for ath10k because ieee80211_flush_queues() +will stop all traffic and call ath10k_flush, which waits until the +whole HW queue is empty. In a busy environment this will trigger a +timeout warning and stalls other STAs. + +Fix this by implementing flush_sta method using WMI command to flush +frames of a specific STA. +Flushed frames will be marked as discard in tx complete indication. + +ops->flush_sta will be set to NULL if htt.disable_tx_comp is set to +true. + +Tested-on: QCA9984 hw1.0 PCI 10.4-3.9.0.2-00157 + +Signed-off-by: Zhi-Jun You +Tested-by: Florian Maurer +--- + drivers/net/wireless/ath/ath10k/mac.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +--- a/drivers/net/wireless/ath/ath10k/mac.c ++++ b/drivers/net/wireless/ath/ath10k/mac.c +@@ -8166,6 +8166,20 @@ static void ath10k_flush(struct ieee8021 + mutex_unlock(&ar->conf_mutex); + } + ++static void ath10k_mac_op_flush_sta(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ++ struct ieee80211_sta *sta) ++{ ++ struct ath10k_vif *arvif = (void *)vif->drv_priv; ++ struct ath10k *ar = hw->priv; ++ u32 bitmap = 0xFFFFFFFF; ++ int ret = 0; ++ ++ ret = ath10k_wmi_peer_flush(ar, arvif->vdev_id, sta->addr, bitmap); ++ if (ret) ++ ath10k_warn(ar, "failed to flush sta (sta %pM)\n", ++ sta->addr); ++} ++ + /* TODO: Implement this function properly + * For now it is needed to reply to Probe Requests in IBSS mode. + * Probably we need this information from FW. +@@ -9513,6 +9527,7 @@ static const struct ieee80211_ops ath10k + .set_rts_threshold = ath10k_set_rts_threshold, + .set_frag_threshold = ath10k_mac_op_set_frag_threshold, + .flush = ath10k_flush, ++ .flush_sta = ath10k_mac_op_flush_sta, + .tx_last_beacon = ath10k_tx_last_beacon, + .set_antenna = ath10k_set_antenna, + .get_antenna = ath10k_get_antenna, +@@ -10334,6 +10349,9 @@ int ath10k_mac_register(struct ath10k *a + if (!ar->hw_params.hw_ops->set_coverage_class) + ar->ops->set_coverage_class = NULL; + ++ if (ar->htt.disable_tx_comp) ++ ar->ops->flush_sta = NULL; ++ + ret = ath_regd_init(&ar->ath_common.regulatory, ar->hw->wiphy, + ath10k_reg_notifier); + if (ret) { From 3c04d09336e363c2489c15b57b119ee6d1aa4127 Mon Sep 17 00:00:00 2001 From: Ondrej Cierny Date: Thu, 26 Jun 2025 19:39:37 -0700 Subject: [PATCH 11/87] download: improve rawgit tar reliability Packages that depend on rawgit can fail on systems with the tar UID issue (https://bugzilla.redhat.com/show_bug.cgi?id=913406). Fix this by adding tar flags to overwrite UID/GID, as in the dl_tar_pack method. Signed-off-by: Ondrej Cierny Link: https://github.com/openwrt/openwrt/pull/19243 (cherry picked from commit d4d5fbd375a7d7e2fddb667afc21c221cb966130) Link: https://github.com/openwrt/openwrt/pull/20185 Signed-off-by: Robert Marko --- include/download.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/download.mk b/include/download.mk index 7f34302773..518a14e035 100644 --- a/include/download.mk +++ b/include/download.mk @@ -232,7 +232,9 @@ define DownloadMethod/rawgit echo "Generating formal git archive (apply .gitattributes rules)" && \ (cd $(SUBDIR) && git config core.abbrev 8 && \ git archive --format=tar HEAD --output=../$(SUBDIR).tar.git) && \ - $(if $(filter skip,$(SUBMODULES)),true,$(TAR) --ignore-failed-read -C $(SUBDIR) -f $(SUBDIR).tar.git -r .git .gitmodules 2>/dev/null) && \ + $(if $(filter skip,$(SUBMODULES)),true, \ + $(TAR) --numeric-owner --owner=0 --group=0 --ignore-failed-read -C $(SUBDIR) -f $(SUBDIR).tar.git -r .git .gitmodules 2>/dev/null \ + ) && \ rm -rf $(SUBDIR) && mkdir $(SUBDIR) && \ $(TAR) -C $(SUBDIR) -xf $(SUBDIR).tar.git && \ (cd $(SUBDIR) && $(if $(filter skip,$(SUBMODULES)),true,git submodule update --init --recursive -- $(SUBMODULES) && \ From 10363b5e264d60461b10e9858714609ec5ef35cb Mon Sep 17 00:00:00 2001 From: Matthew Bilker Date: Wed, 14 May 2025 00:12:53 -0400 Subject: [PATCH 12/87] mediatek: filogic: fix for new GL.iNet GL-MT2500/GL-MT2500A hardware revision GL.iNet shipped a hardware change of the WAN PHY going from the MaxLinear GPY211C to the Airoha EN8811H. Signed-off-by: Matthew Bilker Link: https://github.com/openwrt/openwrt/pull/18799 (cherry picked from commit 8d30e07180367cdeb4affd79adead6e1025355c9) Link: https://github.com/openwrt/openwrt/pull/20307 Signed-off-by: Hauke Mehrtens --- .../dts/mt7981b-glinet-gl-mt2500-v1.dts | 15 +++++++++++++++ .../dts/mt7981b-glinet-gl-mt2500-v2.dts | 15 +++++++++++++++ ...2500.dts => mt7981b-glinet-gl-mt2500.dtsi} | 6 ------ target/linux/mediatek/image/filogic.mk | 19 +++++++++++++++++-- 4 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500-v1.dts create mode 100644 target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500-v2.dts rename target/linux/mediatek/dts/{mt7981b-glinet-gl-mt2500.dts => mt7981b-glinet-gl-mt2500.dtsi} (96%) diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500-v1.dts b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500-v1.dts new file mode 100644 index 0000000000..fc7524c5c0 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500-v1.dts @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; +#include "mt7981b-glinet-gl-mt2500.dtsi" + +&gmac0 { + phy-handle = <&phy5>; +}; + +&mdio_bus { + phy5: ethernet-phy@5 { + reg = <5>; + compatible = "ethernet-phy-ieee802.3-c45"; + }; +}; diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500-v2.dts b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500-v2.dts new file mode 100644 index 0000000000..6f6c11427c --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500-v2.dts @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; +#include "mt7981b-glinet-gl-mt2500.dtsi" + +&gmac0 { + phy-handle = <&phy13>; +}; + +&mdio_bus { + phy13: ethernet-phy@13 { + reg = <13>; + compatible = "ethernet-phy-ieee802.3-c45"; + }; +}; diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dtsi similarity index 96% rename from target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts rename to target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dtsi index 0bd3ac0a29..2465216dc5 100644 --- a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts +++ b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dtsi @@ -108,7 +108,6 @@ reg = <0>; phy-mode = "2500base-x"; - phy-handle = <&phy5>; }; gmac1: mac@1 { @@ -125,11 +124,6 @@ reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>; reset-delay-us = <600>; reset-post-delay-us = <20000>; - - phy5: ethernet-phy@5 { - reg = <5>; - compatible = "ethernet-phy-ieee802.3-c45"; - }; }; &usb_phy { diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 6a18adaa7b..6369586736 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -927,16 +927,31 @@ TARGET_DEVICES += gatonetworks_gdsp define Device/glinet_gl-mt2500 DEVICE_VENDOR := GL.iNet DEVICE_MODEL := GL-MT2500 - DEVICE_DTS := mt7981b-glinet-gl-mt2500 + DEVICE_VARIANT := MaxLinear PHY + DEVICE_DTS := mt7981b-glinet-gl-mt2500-v1 DEVICE_DTS_DIR := ../dts DEVICE_DTS_LOADADDR := 0x47000000 DEVICE_PACKAGES := -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3 - SUPPORTED_DEVICES += glinet,mt2500-emmc + SUPPORTED_DEVICES += glinet,mt2500-emmc glinet,gl-mt2500-airoha IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata endef TARGET_DEVICES += glinet_gl-mt2500 +define Device/glinet_gl-mt2500-airoha + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-MT2500 + DEVICE_VARIANT := Airoha PHY + DEVICE_DTS := mt7981b-glinet-gl-mt2500-v2 + DEVICE_DTS_DIR := ../dts + DEVICE_DTS_LOADADDR := 0x47000000 + DEVICE_PACKAGES := -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3 kmod-phy-airoha-en8811h airoha-en8811h-firmware + SUPPORTED_DEVICES += glinet,mt2500-emmc glinet,gl-mt2500 + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata +endef +TARGET_DEVICES += glinet_gl-mt2500-airoha + define Device/glinet_gl-mt3000 DEVICE_VENDOR := GL.iNet DEVICE_MODEL := GL-MT3000 From 28bb6f73e62b772923ba620671385e5c2f4bf8f4 Mon Sep 17 00:00:00 2001 From: Goetz Goerisch Date: Thu, 2 Oct 2025 14:47:12 +0200 Subject: [PATCH 13/87] kernel: bump 6.6 to 6.6.109 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.109 Removed upstreamed patch: lantiq/patches-6.6/0736-v6.11-net-dsa-lantiq_gswip-do-also-enable-or-disable-cpu-p.patch [1] All other patches autorefreshed. [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.109&id=a7a2b29c1ee44b8d379ab> Signed-off-by: Goetz Goerisch Link: https://github.com/openwrt/openwrt/pull/20277 (cherry picked from commit bb1779cdc53baa099ef5c4b379d3e951814aee2a) Signed-off-by: Goetz Goerisch Link: https://github.com/openwrt/openwrt/pull/20299 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 +- ...all-the-downstream-rpi-sound-card-dr.patch | 2 +- ...ci_sync-Add-fallback-bd-address-prop.patch | 4 +- ...th-hci_sync-Fix-crash-on-NULL-parent.patch | 2 +- ...include-asm-rwonce.h-for-kernel-code.patch | 2 +- ...ow-phy-mode-internal-on-the-CPU-port.patch | 4 +- ...swip-add-terminating-n-where-missing.patch | 14 ++-- ...swip-Use-dev_err_probe-where-appropr.patch | 18 ++--- ...swip-Don-t-manually-call-gswip_port_.patch | 2 +- ...swip-do-also-enable-or-disable-cpu-p.patch | 73 ------------------- ...swip-Use-dsa_is_cpu_port-in-gswip_po.patch | 2 +- ...q_gswip-Change-literal-6-to-ETH_ALEN.patch | 2 +- ...swip-Consistently-use-macros-for-the.patch | 6 +- ...p-Update-comments-in-gswip_port_vlan.patch | 4 +- ...swip-Improve-error-message-in-gswip_.patch | 2 +- 15 files changed, 34 insertions(+), 107 deletions(-) delete mode 100644 target/linux/lantiq/patches-6.6/0736-v6.11-net-dsa-lantiq_gswip-do-also-enable-or-disable-cpu-p.patch diff --git a/include/kernel-6.6 b/include/kernel-6.6 index b1eaea13b2..990ef3dfd1 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .108 -LINUX_KERNEL_HASH-6.6.108 = 601cd332aa695d16607b353feff369b4a0b36d111be077e8af54bdd41e1968a6 +LINUX_VERSION-6.6 = .109 +LINUX_KERNEL_HASH-6.6.109 = 7731cd99778cfdeedd63aa1b5aa8379511b97ec7df8c9eca44baed4e401730f4 diff --git a/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch b/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch index 58aa944087..e3ca201449 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch @@ -17583,7 +17583,7 @@ Signed-off-by: Phil Elwell * For devices with more than one control interface, we assume the --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c -@@ -2260,6 +2260,8 @@ static const struct usb_audio_quirk_flag +@@ -2278,6 +2278,8 @@ static const struct usb_audio_quirk_flag QUIRK_FLAG_ALIGN_TRANSFER), DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */ QUIRK_FLAG_ALIGN_TRANSFER), diff --git a/target/linux/bcm27xx/patches-6.6/950-0441-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch b/target/linux/bcm27xx/patches-6.6/950-0441-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch index 27acfe21b7..5f532aa9fc 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0441-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0441-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch @@ -20,7 +20,7 @@ Signed-off-by: Phil Elwell --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c -@@ -4927,6 +4927,7 @@ static const struct { +@@ -4934,6 +4934,7 @@ static const struct { */ static int hci_dev_setup_sync(struct hci_dev *hdev) { @@ -28,7 +28,7 @@ Signed-off-by: Phil Elwell int ret = 0; bool invalid_bdaddr; size_t i; -@@ -4955,7 +4956,8 @@ static int hci_dev_setup_sync(struct hci +@@ -4962,7 +4963,8 @@ static int hci_dev_setup_sync(struct hci test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); if (!ret) { if (test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks) && diff --git a/target/linux/bcm27xx/patches-6.6/950-1218-Bluetooth-hci_sync-Fix-crash-on-NULL-parent.patch b/target/linux/bcm27xx/patches-6.6/950-1218-Bluetooth-hci_sync-Fix-crash-on-NULL-parent.patch index d40b127927..50b09c744e 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1218-Bluetooth-hci_sync-Fix-crash-on-NULL-parent.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1218-Bluetooth-hci_sync-Fix-crash-on-NULL-parent.patch @@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c -@@ -4927,7 +4927,8 @@ static const struct { +@@ -4934,7 +4934,8 @@ static const struct { */ static int hci_dev_setup_sync(struct hci_dev *hdev) { diff --git a/target/linux/generic/pending-6.6/100-compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch b/target/linux/generic/pending-6.6/100-compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch index 09442a9bfc..e32735e6b4 100644 --- a/target/linux/generic/pending-6.6/100-compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch +++ b/target/linux/generic/pending-6.6/100-compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau #endif /* __KERNEL__ */ /** -@@ -250,6 +252,4 @@ static inline void *offset_to_ptr(const +@@ -259,6 +261,4 @@ static inline void *offset_to_ptr(const */ #define prevent_tail_call_optimization() mb() diff --git a/target/linux/lantiq/patches-6.6/0732-v6.11-net-dsa-lantiq_gswip-Only-allow-phy-mode-internal-on-the-CPU-port.patch b/target/linux/lantiq/patches-6.6/0732-v6.11-net-dsa-lantiq_gswip-Only-allow-phy-mode-internal-on-the-CPU-port.patch index 305ad4c42c..bfd06228fa 100644 --- a/target/linux/lantiq/patches-6.6/0732-v6.11-net-dsa-lantiq_gswip-Only-allow-phy-mode-internal-on-the-CPU-port.patch +++ b/target/linux/lantiq/patches-6.6/0732-v6.11-net-dsa-lantiq_gswip-Only-allow-phy-mode-internal-on-the-CPU-port.patch @@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c -@@ -1509,6 +1509,7 @@ static void gswip_xrx200_phylink_get_cap +@@ -1511,6 +1511,7 @@ static void gswip_xrx200_phylink_get_cap case 2: case 3: case 4: @@ -28,7 +28,7 @@ Signed-off-by: Jakub Kicinski __set_bit(PHY_INTERFACE_MODE_INTERNAL, config->supported_interfaces); break; -@@ -1540,6 +1541,7 @@ static void gswip_xrx300_phylink_get_cap +@@ -1542,6 +1543,7 @@ static void gswip_xrx300_phylink_get_cap case 2: case 3: case 4: diff --git a/target/linux/lantiq/patches-6.6/0733-v6.11-net-dsa-lantiq_gswip-add-terminating-n-where-missing.patch b/target/linux/lantiq/patches-6.6/0733-v6.11-net-dsa-lantiq_gswip-add-terminating-n-where-missing.patch index 55adfe021f..cb0235e584 100644 --- a/target/linux/lantiq/patches-6.6/0733-v6.11-net-dsa-lantiq_gswip-add-terminating-n-where-missing.patch +++ b/target/linux/lantiq/patches-6.6/0733-v6.11-net-dsa-lantiq_gswip-add-terminating-n-where-missing.patch @@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c -@@ -829,7 +829,7 @@ static int gswip_setup(struct dsa_switch +@@ -830,7 +830,7 @@ static int gswip_setup(struct dsa_switch err = gswip_pce_load_microcode(priv); if (err) { @@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski return err; } -@@ -1780,7 +1780,7 @@ static u32 gswip_bcm_ram_entry_read(stru +@@ -1782,7 +1782,7 @@ static u32 gswip_bcm_ram_entry_read(stru err = gswip_switch_r_timeout(priv, GSWIP_BM_RAM_CTRL, GSWIP_BM_RAM_CTRL_BAS); if (err) { @@ -35,7 +35,7 @@ Signed-off-by: Jakub Kicinski table, index); return 0; } -@@ -2009,7 +2009,7 @@ static void gswip_gphy_fw_remove(struct +@@ -2012,7 +2012,7 @@ static void gswip_gphy_fw_remove(struct ret = regmap_write(priv->rcu_regmap, gphy_fw->fw_addr_offset, 0); if (ret) @@ -44,7 +44,7 @@ Signed-off-by: Jakub Kicinski clk_disable_unprepare(gphy_fw->clk_gate); -@@ -2038,7 +2038,7 @@ static int gswip_gphy_fw_list(struct gsw +@@ -2041,7 +2041,7 @@ static int gswip_gphy_fw_list(struct gsw priv->gphy_fw_name_cfg = &xrx200a2x_gphy_data; break; default: @@ -53,7 +53,7 @@ Signed-off-by: Jakub Kicinski return -ENOENT; } } -@@ -2048,7 +2048,7 @@ static int gswip_gphy_fw_list(struct gsw +@@ -2051,7 +2051,7 @@ static int gswip_gphy_fw_list(struct gsw priv->gphy_fw_name_cfg = match->data; if (!priv->gphy_fw_name_cfg) { @@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski return -ENOENT; } -@@ -2150,7 +2150,7 @@ static int gswip_probe(struct platform_d +@@ -2153,7 +2153,7 @@ static int gswip_probe(struct platform_d return -EINVAL; break; default: @@ -71,7 +71,7 @@ Signed-off-by: Jakub Kicinski return -ENOENT; } -@@ -2181,7 +2181,7 @@ static int gswip_probe(struct platform_d +@@ -2184,7 +2184,7 @@ static int gswip_probe(struct platform_d goto mdio_bus; } if (!dsa_is_cpu_port(priv->ds, priv->hw_info->cpu_port)) { diff --git a/target/linux/lantiq/patches-6.6/0734-v6.11-net-dsa-lantiq_gswip-Use-dev_err_probe-where-appropr.patch b/target/linux/lantiq/patches-6.6/0734-v6.11-net-dsa-lantiq_gswip-Use-dev_err_probe-where-appropr.patch index 7894979707..a5a443c7a7 100644 --- a/target/linux/lantiq/patches-6.6/0734-v6.11-net-dsa-lantiq_gswip-Use-dev_err_probe-where-appropr.patch +++ b/target/linux/lantiq/patches-6.6/0734-v6.11-net-dsa-lantiq_gswip-Use-dev_err_probe-where-appropr.patch @@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c -@@ -1919,11 +1919,9 @@ static int gswip_gphy_fw_load(struct gsw +@@ -1922,11 +1922,9 @@ static int gswip_gphy_fw_load(struct gsw msleep(200); ret = request_firmware(&fw, gphy_fw->fw_name, dev); @@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski /* GPHY cores need the firmware code in a persistent and contiguous * memory area with a 16 kB boundary aligned start address. -@@ -1936,9 +1934,9 @@ static int gswip_gphy_fw_load(struct gsw +@@ -1939,9 +1937,9 @@ static int gswip_gphy_fw_load(struct gsw dev_addr = ALIGN(dma_addr, XRX200_GPHY_FW_ALIGN); memcpy(fw_addr, fw->data, fw->size); } else { @@ -48,7 +48,7 @@ Signed-off-by: Jakub Kicinski } release_firmware(fw); -@@ -1965,8 +1963,8 @@ static int gswip_gphy_fw_probe(struct gs +@@ -1968,8 +1966,8 @@ static int gswip_gphy_fw_probe(struct gs gphy_fw->clk_gate = devm_clk_get(dev, gphyname); if (IS_ERR(gphy_fw->clk_gate)) { @@ -59,7 +59,7 @@ Signed-off-by: Jakub Kicinski } ret = of_property_read_u32(gphy_fw_np, "reg", &gphy_fw->fw_addr_offset); -@@ -1986,8 +1984,8 @@ static int gswip_gphy_fw_probe(struct gs +@@ -1989,8 +1987,8 @@ static int gswip_gphy_fw_probe(struct gs gphy_fw->fw_name = priv->gphy_fw_name_cfg->ge_firmware_name; break; default: @@ -70,7 +70,7 @@ Signed-off-by: Jakub Kicinski } gphy_fw->reset = of_reset_control_array_get_exclusive(gphy_fw_np); -@@ -2038,8 +2036,9 @@ static int gswip_gphy_fw_list(struct gsw +@@ -2041,8 +2039,9 @@ static int gswip_gphy_fw_list(struct gsw priv->gphy_fw_name_cfg = &xrx200a2x_gphy_data; break; default: @@ -82,7 +82,7 @@ Signed-off-by: Jakub Kicinski } } -@@ -2047,10 +2046,9 @@ static int gswip_gphy_fw_list(struct gsw +@@ -2050,10 +2049,9 @@ static int gswip_gphy_fw_list(struct gsw if (match && match->data) priv->gphy_fw_name_cfg = match->data; @@ -96,7 +96,7 @@ Signed-off-by: Jakub Kicinski priv->num_gphy_fw = of_get_available_child_count(gphy_fw_list_np); if (!priv->num_gphy_fw) -@@ -2150,8 +2148,8 @@ static int gswip_probe(struct platform_d +@@ -2153,8 +2151,8 @@ static int gswip_probe(struct platform_d return -EINVAL; break; default: @@ -107,7 +107,7 @@ Signed-off-by: Jakub Kicinski } /* bring up the mdio bus */ -@@ -2159,10 +2157,9 @@ static int gswip_probe(struct platform_d +@@ -2162,10 +2160,9 @@ static int gswip_probe(struct platform_d if (gphy_fw_np) { err = gswip_gphy_fw_list(priv, gphy_fw_np, version); of_node_put(gphy_fw_np); @@ -121,7 +121,7 @@ Signed-off-by: Jakub Kicinski } /* bring up the mdio bus */ -@@ -2170,20 +2167,20 @@ static int gswip_probe(struct platform_d +@@ -2173,20 +2170,20 @@ static int gswip_probe(struct platform_d if (mdio_np) { err = gswip_mdio(priv, mdio_np); if (err) { diff --git a/target/linux/lantiq/patches-6.6/0735-v6.11-net-dsa-lantiq_gswip-Don-t-manually-call-gswip_port_.patch b/target/linux/lantiq/patches-6.6/0735-v6.11-net-dsa-lantiq_gswip-Don-t-manually-call-gswip_port_.patch index b7de069c5f..96ac8b5307 100644 --- a/target/linux/lantiq/patches-6.6/0735-v6.11-net-dsa-lantiq_gswip-Don-t-manually-call-gswip_port_.patch +++ b/target/linux/lantiq/patches-6.6/0735-v6.11-net-dsa-lantiq_gswip-Don-t-manually-call-gswip_port_.patch @@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c -@@ -891,8 +891,6 @@ static int gswip_setup(struct dsa_switch +@@ -892,8 +892,6 @@ static int gswip_setup(struct dsa_switch ds->mtu_enforcement_ingress = true; diff --git a/target/linux/lantiq/patches-6.6/0736-v6.11-net-dsa-lantiq_gswip-do-also-enable-or-disable-cpu-p.patch b/target/linux/lantiq/patches-6.6/0736-v6.11-net-dsa-lantiq_gswip-do-also-enable-or-disable-cpu-p.patch deleted file mode 100644 index 0baca3d7c2..0000000000 --- a/target/linux/lantiq/patches-6.6/0736-v6.11-net-dsa-lantiq_gswip-do-also-enable-or-disable-cpu-p.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 86b9ea6412af41914ef6549f85a849c3b987f4f3 Mon Sep 17 00:00:00 2001 -From: Martin Schiller -Date: Tue, 11 Jun 2024 15:54:28 +0200 -Subject: net: dsa: lantiq_gswip: do also enable or disable cpu port - -Before commit 74be4babe72f ("net: dsa: do not enable or disable non user -ports"), gswip_port_enable/disable() were also executed for the cpu port -in gswip_setup() which disabled the cpu port during initialization. - -Let's restore this by removing the dsa_is_user_port checks. Also, let's -clean up the gswip_port_enable() function so that we only have to check -for the cpu port once. The operation reordering done here is safe. - -Signed-off-by: Martin Schiller -Acked-by: Hauke Mehrtens -Reviewed-by: Vladimir Oltean -Link: https://lore.kernel.org/r/20240611135434.3180973-7-ms@dev.tdt.de -Signed-off-by: Jakub Kicinski ---- - drivers/net/dsa/lantiq_gswip.c | 24 ++++++++---------------- - 1 file changed, 8 insertions(+), 16 deletions(-) - ---- a/drivers/net/dsa/lantiq_gswip.c -+++ b/drivers/net/dsa/lantiq_gswip.c -@@ -688,13 +688,18 @@ static int gswip_port_enable(struct dsa_ - struct gswip_priv *priv = ds->priv; - int err; - -- if (!dsa_is_user_port(ds, port)) -- return 0; -- - if (!dsa_is_cpu_port(ds, port)) { -+ u32 mdio_phy = 0; -+ - err = gswip_add_single_port_br(priv, port, true); - if (err) - return err; -+ -+ if (phydev) -+ mdio_phy = phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK; -+ -+ gswip_mdio_mask(priv, GSWIP_MDIO_PHY_ADDR_MASK, mdio_phy, -+ GSWIP_MDIO_PHYp(port)); - } - - /* RMON Counter Enable for port */ -@@ -707,16 +712,6 @@ static int gswip_port_enable(struct dsa_ - gswip_switch_mask(priv, 0, GSWIP_SDMA_PCTRL_EN, - GSWIP_SDMA_PCTRLp(port)); - -- if (!dsa_is_cpu_port(ds, port)) { -- u32 mdio_phy = 0; -- -- if (phydev) -- mdio_phy = phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK; -- -- gswip_mdio_mask(priv, GSWIP_MDIO_PHY_ADDR_MASK, mdio_phy, -- GSWIP_MDIO_PHYp(port)); -- } -- - return 0; - } - -@@ -724,9 +719,6 @@ static void gswip_port_disable(struct ds - { - struct gswip_priv *priv = ds->priv; - -- if (!dsa_is_user_port(ds, port)) -- return; -- - gswip_switch_mask(priv, GSWIP_FDMA_PCTRL_EN, 0, - GSWIP_FDMA_PCTRLp(port)); - gswip_switch_mask(priv, GSWIP_SDMA_PCTRL_EN, 0, diff --git a/target/linux/lantiq/patches-6.6/0737-v6.11-net-dsa-lantiq_gswip-Use-dsa_is_cpu_port-in-gswip_po.patch b/target/linux/lantiq/patches-6.6/0737-v6.11-net-dsa-lantiq_gswip-Use-dsa_is_cpu_port-in-gswip_po.patch index 493aea4295..30d3efcca6 100644 --- a/target/linux/lantiq/patches-6.6/0737-v6.11-net-dsa-lantiq_gswip-Use-dsa_is_cpu_port-in-gswip_po.patch +++ b/target/linux/lantiq/patches-6.6/0737-v6.11-net-dsa-lantiq_gswip-Use-dsa_is_cpu_port-in-gswip_po.patch @@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c -@@ -1457,12 +1457,11 @@ static int gswip_port_max_mtu(struct dsa +@@ -1467,12 +1467,11 @@ static int gswip_port_max_mtu(struct dsa static int gswip_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu) { struct gswip_priv *priv = ds->priv; diff --git a/target/linux/lantiq/patches-6.6/0738-v6.11-net-dsa-lantiq_gswip-Change-literal-6-to-ETH_ALEN.patch b/target/linux/lantiq/patches-6.6/0738-v6.11-net-dsa-lantiq_gswip-Change-literal-6-to-ETH_ALEN.patch index 773d43ee19..73206e050a 100644 --- a/target/linux/lantiq/patches-6.6/0738-v6.11-net-dsa-lantiq_gswip-Change-literal-6-to-ETH_ALEN.patch +++ b/target/linux/lantiq/patches-6.6/0738-v6.11-net-dsa-lantiq_gswip-Change-literal-6-to-ETH_ALEN.patch @@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c -@@ -1406,7 +1406,7 @@ static int gswip_port_fdb_dump(struct ds +@@ -1416,7 +1416,7 @@ static int gswip_port_fdb_dump(struct ds { struct gswip_priv *priv = ds->priv; struct gswip_pce_table_entry mac_bridge = {0,}; diff --git a/target/linux/lantiq/patches-6.6/0739-v6.11-net-dsa-lantiq_gswip-Consistently-use-macros-for-the.patch b/target/linux/lantiq/patches-6.6/0739-v6.11-net-dsa-lantiq_gswip-Consistently-use-macros-for-the.patch index 31f2e60bfb..22371ff180 100644 --- a/target/linux/lantiq/patches-6.6/0739-v6.11-net-dsa-lantiq_gswip-Consistently-use-macros-for-the.patch +++ b/target/linux/lantiq/patches-6.6/0739-v6.11-net-dsa-lantiq_gswip-Consistently-use-macros-for-the.patch @@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski #define XRX200_GPHY_FW_ALIGN (16 * 1024) -@@ -1297,10 +1299,11 @@ static void gswip_port_fast_age(struct d +@@ -1306,10 +1308,11 @@ static void gswip_port_fast_age(struct d if (!mac_bridge.valid) continue; @@ -50,7 +50,7 @@ Signed-off-by: Jakub Kicinski continue; mac_bridge.valid = false; -@@ -1375,9 +1378,9 @@ static int gswip_port_fdb(struct dsa_swi +@@ -1385,9 +1388,9 @@ static int gswip_port_fdb(struct dsa_swi mac_bridge.key[0] = addr[5] | (addr[4] << 8); mac_bridge.key[1] = addr[3] | (addr[2] << 8); mac_bridge.key[2] = addr[1] | (addr[0] << 8); @@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski mac_bridge.valid = add; err = gswip_pce_table_entry_write(priv, &mac_bridge); -@@ -1431,14 +1434,15 @@ static int gswip_port_fdb_dump(struct ds +@@ -1441,14 +1444,15 @@ static int gswip_port_fdb_dump(struct ds addr[2] = (mac_bridge.key[1] >> 8) & 0xff; addr[1] = mac_bridge.key[2] & 0xff; addr[0] = (mac_bridge.key[2] >> 8) & 0xff; diff --git a/target/linux/lantiq/patches-6.6/0741-v6.11-net-dsa-lantiq_gswip-Update-comments-in-gswip_port_vlan.patch b/target/linux/lantiq/patches-6.6/0741-v6.11-net-dsa-lantiq_gswip-Update-comments-in-gswip_port_vlan.patch index 16702c9356..d95b3c8ca1 100644 --- a/target/linux/lantiq/patches-6.6/0741-v6.11-net-dsa-lantiq_gswip-Update-comments-in-gswip_port_vlan.patch +++ b/target/linux/lantiq/patches-6.6/0741-v6.11-net-dsa-lantiq_gswip-Update-comments-in-gswip_port_vlan.patch @@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c -@@ -773,7 +773,7 @@ static int gswip_port_vlan_filtering(str +@@ -782,7 +782,7 @@ static int gswip_port_vlan_filtering(str } if (vlan_filtering) { @@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski gswip_switch_mask(priv, GSWIP_PCE_VCTRL_VSR, GSWIP_PCE_VCTRL_UVR | GSWIP_PCE_VCTRL_VIMR | -@@ -782,7 +782,7 @@ static int gswip_port_vlan_filtering(str +@@ -791,7 +791,7 @@ static int gswip_port_vlan_filtering(str gswip_switch_mask(priv, GSWIP_PCE_PCTRL_0_TVM, 0, GSWIP_PCE_PCTRL_0p(port)); } else { diff --git a/target/linux/lantiq/patches-6.6/0742-v6.11-net-dsa-lantiq_gswip-Improve-error-message-in-gswip_.patch b/target/linux/lantiq/patches-6.6/0742-v6.11-net-dsa-lantiq_gswip-Improve-error-message-in-gswip_.patch index 56d882c9f9..a56d036edc 100644 --- a/target/linux/lantiq/patches-6.6/0742-v6.11-net-dsa-lantiq_gswip-Improve-error-message-in-gswip_.patch +++ b/target/linux/lantiq/patches-6.6/0742-v6.11-net-dsa-lantiq_gswip-Improve-error-message-in-gswip_.patch @@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c -@@ -1363,7 +1363,8 @@ static int gswip_port_fdb(struct dsa_swi +@@ -1373,7 +1373,8 @@ static int gswip_port_fdb(struct dsa_swi } if (fid == -1) { From 0f095274fc682e386a49e89561a4b816cfb388bd Mon Sep 17 00:00:00 2001 From: Coia Prant Date: Wed, 1 Oct 2025 15:55:57 +0800 Subject: [PATCH 14/87] ramips: Fix Hongdian H7920 v40 pinctrl default state According to the MT7628 hardware datasheet: - GPIO/4 was originally used for I2C, but is now used as the Modem Power. - GPIO/5 was originally used for I2C, but is now used as the SIM card select. (n/a for this device) - GPIO/6 was originally used for SPI CS1, but is now used as the Serial mode switch. - GPIO/36 was originally used for PERST, but is now used as the GPS OE. (n/a for this device) - GPIO/38 was originally used for WDT, but is now used as the Modem2 Power. (n/a for this device) - GPIO/44 was used for WLED_AN, but is now controlled by `gpio-leds`. Corrected pinctrl to ensure it works properly in the future. Signed-off-by: Coia Prant Link: https://github.com/openwrt/openwrt/pull/20256 (cherry picked from commit 44c79d094f4e3b3cd716a61783a0e2fde7ede976) Link: https://github.com/openwrt/openwrt/pull/20257 Signed-off-by: Hauke Mehrtens --- target/linux/ramips/dts/mt7628an_hongdian_h7920-v40.dts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/target/linux/ramips/dts/mt7628an_hongdian_h7920-v40.dts b/target/linux/ramips/dts/mt7628an_hongdian_h7920-v40.dts index 76c395c382..6c165fc3bf 100644 --- a/target/linux/ramips/dts/mt7628an_hongdian_h7920-v40.dts +++ b/target/linux/ramips/dts/mt7628an_hongdian_h7920-v40.dts @@ -140,7 +140,7 @@ &state_default { gpio { - groups = "i2s", "gpio", "refclk"; + groups = "i2s", "i2c", "spi cs1", "gpio", "perst", "refclk", "wdt", "wled_an"; function = "gpio"; }; }; @@ -166,6 +166,3 @@ status = "okay"; }; -&pcie { - status = "okay"; -}; From 7632dfa8433ad94dfabdec5950cd36458b28d4e7 Mon Sep 17 00:00:00 2001 From: Coia Prant Date: Wed, 1 Oct 2025 17:09:32 +0800 Subject: [PATCH 15/87] ramips: Fix Hongdian H7920 v40 mac address After extracting the EEPROMs of different devices, only the 0x4 address is unique. Use the 0x4 address as the LAN address, and the LAN+1 address as the WAN address. Signed-off-by: Coia Prant Link: https://github.com/openwrt/openwrt/pull/20256 (cherry picked from commit c907c7c9b3f0b66bbafc75a2ae1111fbf873a1c3) Link: https://github.com/openwrt/openwrt/pull/20257 Signed-off-by: Hauke Mehrtens --- target/linux/ramips/dts/mt7628an_hongdian_h7920-v40.dts | 6 +++--- .../linux/ramips/mt76x8/base-files/etc/board.d/02_network | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/ramips/dts/mt7628an_hongdian_h7920-v40.dts b/target/linux/ramips/dts/mt7628an_hongdian_h7920-v40.dts index 6c165fc3bf..d29b131aa6 100644 --- a/target/linux/ramips/dts/mt7628an_hongdian_h7920-v40.dts +++ b/target/linux/ramips/dts/mt7628an_hongdian_h7920-v40.dts @@ -123,8 +123,8 @@ reg = <0x0 0x400>; }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; }; }; }; @@ -146,7 +146,7 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_28>; + nvmem-cells = <&macaddr_factory_4>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 372821c3b8..a7adc2d712 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -257,6 +257,7 @@ ramips_setup_macs() label_mac=$(mtd_get_mac_binary factory 0x4) ;; duzun,dm06|\ + hongdian,h7920-v40|\ netgear,r6020|\ netgear,r6080|\ netgear,r6120|\ @@ -278,7 +279,6 @@ ramips_setup_macs() totolink,a3) wan_mac=$(mtd_get_mac_binary u-boot 0x1fc40) ;; - hongdian,h7920-v40|\ jotale,js76x8-8m|\ jotale,js76x8-16m|\ jotale,js76x8-32m|\ From 39d87fd2fe9d2516296723583b262b351bb8c5e2 Mon Sep 17 00:00:00 2001 From: Nickolay Goppen Date: Sat, 6 Sep 2025 16:40:31 +0300 Subject: [PATCH 16/87] ramips: add support for Zbtlink ZBT-WG108 Specification: CPU: MediaTek MT7621 (880 MHz) Flash size: 16 MB NOR SPI RAM size: 128 MB Bootloader: Breed Wireless: MT7612EN 2x2 802.11an+ac(5 GHz) Wireless: MT7603EN 2x2 bgn(2.4 GHz) Ethernet: 1 x WAN (10/100/1000Mbps) and 4 x LAN (10/100/1000 Mbps) USB: 1x 2.0 Type-A port External storage: 1x microSD (SDXC) slot UART: console (115200 baud) LEDs: Power, Wan, Lan 1-4, WiFi 2.4G, WiFi 5G Buttons: Reset How to install: The original firmware is OpenWrt, so sysupgrade can be used. Signed-off-by: Nickolay Goppen Link: https://github.com/openwrt/openwrt/pull/19966 (cherry picked from commit 8dd3ee205a41324e06df656cc0b11b2166f50928) Link: https://github.com/openwrt/openwrt/pull/20124 Signed-off-by: Hauke Mehrtens --- .../ramips/dts/mt7621_zbtlink_zbt-wg108.dts | 181 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 10 + .../mt7621/base-files/etc/board.d/02_network | 1 + 3 files changed, 192 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_zbtlink_zbt-wg108.dts diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg108.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg108.dts new file mode 100644 index 0000000000..0e17e164a8 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg108.dts @@ -0,0 +1,181 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "zbtlink,zbt-wg108", "mediatek,mt7621-soc"; + model = "Zbtlink ZBT-WG108"; + + aliases { + label-mac-device = &wifi1; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&state_default { + gpio + { + groups = "wdt"; + function = "gpio"; + }; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_factory_e006>; + nvmem-cell-names = "mac-address"; +}; + +ðphy4 { + /delete-property/ interrupts; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi0: wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-sources = <2>; + led-active-low; + }; + }; +}; + +&pcie1 { + wifi1: wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + ieee80211-freq-limit = <2400000 2500000>; + + led { + led-sources = <0>; + led-active-low; + }; + }; +}; + +&sdhci { + status = "okay"; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan4"; + }; + }; +}; + diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index f6a05db8d3..adaa27908f 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -3378,6 +3378,16 @@ define Device/zbtlink_zbt-we3526 endef TARGET_DEVICES += zbtlink_zbt-we3526 +define Device/zbtlink_zbt-wg108 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WG108 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb2 kmod-usb3 \ + kmod-mmc-mtk -uboot-envtools + SUPPORTED_DEVICES += zbt-wg108 +endef +TARGET_DEVICES += zbtlink_zbt-wg108 + define Device/zbtlink_zbt-wg1602-16m $(Device/dsa-migration) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 9e4f139a4c..337d3ad904 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -199,6 +199,7 @@ ramips_setup_macs() wavlink,wl-wn533a8|\ winstars,ws-wn583a6|\ zbtlink,zbt-we1326|\ + zbtlink,zbt-wg108|\ zbtlink,zbt-wg3526-16m|\ zbtlink,zbt-wg3526-32m) label_mac=$(mtd_get_mac_binary factory 0x4) From b9382cb73352f97c231c20bb9dd5a22123d10344 Mon Sep 17 00:00:00 2001 From: Coia Prant Date: Tue, 10 Dec 2024 23:18:13 +0800 Subject: [PATCH 17/87] ramips: add support for Qding QC202 This is a smart door lock device equipped with OpenWrt 14.07 OEM modified version Qdwrt The OEM has closed down, This commit is intended to maximize the remaining value of these devices. It can flash OpenWrt to become an AP Specification: - SoC: MediaTek MT7628NN - Flash: 8 MB - RAM: 64 MB - Power: DC 5V - 25V - Ethernet: 1 x RJ45 (10/100 Mbps) - Wireless radio: 802.11n 2.4g-only - On-Board LED: Status 1: GPIO/43 active-low Status 2: GPIO/44 active-low Power: AlwaysOn - Button: WPS / RESET: GPIO/14 active-low - Bluetooth: CC2541 via UART1 (ttyS1) and GPIO/26-29 - RFID: MF RC522 on I2C@28 - RTC: DS1339 on I2C@68 - Shell (via CON1 cable) - LED (Swipe card area): - Green GPIO/3 active-high - Red GPIO/11 active-high - Matrix keypad: (active-low) GPIO/20 GPIO/21 GPIO/19 (Rows) GPIO/24 1 2 3 GPIO/25 4 5 6 GPIO/22 7 8 9 GPIO/23 BACK 0 ENTER (Cols) - UART: 1 x UART on PCB - 57600 8N1 - GPIO Relay: GPIO/42 active-high - GPIO Buzzer: GPIO/15 active-high Warning: The original firmware does not use the device tree. This device tree is written based on the content of /sys/devices/platform and has been tested Note: - On the device, matrix keypad rows actually are columns, and the columns actually are rows - The key code of the CLEAR key of the matrix keypad is BACK in the original firmware. Issue: - No drivers in mainline kernel for RFID and Bluetooth. Flash Instruction: Using SSH/Telnet: 1. Connect the board to the computer via RJ45 Ethernet 2. Login 10.10.10.1 with root password "szqdingnet123" (SSH Port 22, Telnet Port 9900) 3. Download openwrt firmware on the computer. 4. Setup a http server on computer. And use wget download openwrt firmware from computer 5. Use command "mtd -r write openwrt-ramips-mt76x8-qding_qc202-squashfs-sysupgrade.bin firmware" to flash Using U-Boot WebUI: 1. Configure PC with a static IP address 10.10.10.2/24. 2. Open http://10.10.10.1 3. Use "mkqdimg -B qc202 -f openwrt-ramips-mt76x8-qding_qc202-squashfs-sysupgrade.bin" to make image. 4. Upload factory.bin via U-Boot WebUI. Original Firmware Dump / More details: https://blog.gov.cooking/archives/research-qianding-smart-locker-and-flash.html Original U-Boot firmware image tools: https://gitlab.com/CoiaPrant/mkqdimg Signed-off-by: Coia Prant Tested-by: Coia Prant Link: https://github.com/openwrt/openwrt/pull/17471 (cherry picked from commit b2f814fed469f435fbb6b5ec9f79e1012caabc3f) Link: https://github.com/openwrt/openwrt/pull/20159 Signed-off-by: Hauke Mehrtens --- package/boot/uboot-envtools/files/ramips | 1 + .../linux/ramips/dts/mt7628an_qding_qc202.dts | 242 ++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 8 + .../mt76x8/base-files/etc/board.d/02_network | 1 + 4 files changed, 252 insertions(+) create mode 100644 target/linux/ramips/dts/mt7628an_qding_qc202.dts diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index b0f8c1c168..08f8faa7dc 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -22,6 +22,7 @@ engenius,esr600h|\ hongdian,h8922-v30|\ linksys,re7000|\ meig,slt866|\ +qding,qc202|\ sitecom,wlr-4100-v1-002|\ zyxel,keenetic-lite-iii-a) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000" diff --git a/target/linux/ramips/dts/mt7628an_qding_qc202.dts b/target/linux/ramips/dts/mt7628an_qding_qc202.dts new file mode 100644 index 0000000000..a187f19b54 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_qding_qc202.dts @@ -0,0 +1,242 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an.dtsi" + +#include +#include +#include + +/ { + compatible = "qding,qc202", "mediatek,mt7628an-soc"; + model = "Qding QC202"; + + aliases { + led-boot = &led_status_1; + led-failsafe = &led_status_1; + led-running = &led_status_1; + led-upgrade = &led_status_1; + label-mac-device = &wmac; + }; + + leds { + compatible = "gpio-leds"; + + led-indicator-green { + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_INDICATOR; + }; + + led-indicator-red { + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_INDICATOR; + }; + + led_status_1: led-status-1 { + gpios = <&gpio 43 GPIO_ACTIVE_LOW>; + color = ; + function-enumerator = <1>; + function = LED_FUNCTION_STATUS; + }; + + led-status-2 { + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + color = ; + function-enumerator = <2>; + function = LED_FUNCTION_STATUS; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + beeper { + compatible = "gpio-beeper"; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + + gpio-export { + compatible = "gpio-export"; + + // When device is disassembled, GPIO will be activated + disassemble { + gpio-export,name = "disassemble"; + gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; + }; + + cc2541-boot { + gpio-export,name = "cc2541-boot"; + gpio-export,output = <0>; + gpios = <&gpio 26 GPIO_ACTIVE_LOW>; + }; + + cc2541-reset { + gpio-export,name = "cc2541-reset"; + gpio-export,output = <0>; + gpios = <&gpio 27 GPIO_ACTIVE_HIGH>; + }; + + cc2541-clk { + gpio-export,name = "cc2541-clk"; + gpio-export,output = <0>; + gpios = <&gpio 28 GPIO_ACTIVE_HIGH>; + }; + + cc2541-data { + gpio-export,name = "cc2541-data"; + gpio-export,direction_may_change; + gpios = <&gpio 29 GPIO_ACTIVE_HIGH>; + }; + + /* + When "OPEN THE DOOR" button is pressed + GPIO will be activated via the KEY signal cable + */ + key { + gpio-export,name = "key"; + gpios = <&gpio 37 GPIO_ACTIVE_HIGH>; + }; + + // Activate GPIO to control the relay to open the door + relay { + gpio-export,name = "relay"; + gpio-export,output = <0>; + gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; + }; + }; + + matrix-keypad { + compatible = "gpio-matrix-keypad"; + debounce-delay-ms = <10>; + col-scan-delay-us = <10>; + gpio-activelow; + wakeup-source; + + row-gpios = <&gpio 20 GPIO_ACTIVE_LOW + &gpio 21 GPIO_ACTIVE_LOW + &gpio 19 GPIO_ACTIVE_LOW>; + + col-gpios = <&gpio 24 GPIO_ACTIVE_LOW + &gpio 25 GPIO_ACTIVE_LOW + &gpio 22 GPIO_ACTIVE_LOW + &gpio 23 GPIO_ACTIVE_LOW>; + + linux,keymap = ; + }; +}; + +&state_default { + gpio { + groups = "i2s", "gpio", "spis", "pwm1", "uart2", "sdmode", "refclk", "p1led_an", "p0led_an", "wled_an"; + function = "gpio"; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + }; + }; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_4 (-1)>; + nvmem-cell-names = "mac-address"; +}; + +&esw { + mediatek,portmap = <0x3f>; + mediatek,portdisable = <0x3e>; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; +}; + +&i2c { + status = "okay"; + + rfid@28 { + compatible = "mfrc522"; + reg = <0x28>; + }; + + rtc@68 { + compatible = "dallas,ds1339"; + reg = <0x68>; + }; +}; + +&uart1 { + status = "okay"; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 314f8e1e9f..5930d62a0b 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -533,6 +533,14 @@ define Device/oraybox_x1 endef TARGET_DEVICES += oraybox_x1 +define Device/qding_qc202 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Qding + DEVICE_MODEL := QC202 + DEVICE_PACKAGES := kmod-i2c-mt7628 kmod-gpio-beeper kmod-input-matrix-keypad kmod-input-evdev uboot-envtools +endef +TARGET_DEVICES += qding_qc202 + define Device/rakwireless_rak633 IMAGE_SIZE := 7872k DEVICE_VENDOR := Rakwireless diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index a7adc2d712..31cb38091b 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -21,6 +21,7 @@ ramips_setup_interfaces() minew,g1-c|\ onion,omega2p|\ onion,omega2|\ + qding,qc202|\ ravpower,rp-wd009|\ tama,w06|\ tplink,re200-v2|\ From e8df99cf7c9e966376bc355599d8ead76070f26c Mon Sep 17 00:00:00 2001 From: Coia Prant Date: Sat, 20 Sep 2025 17:54:10 +0800 Subject: [PATCH 18/87] ramips: Add factory image for Qding QC202 Added factory image using mkqdimg. Signed-off-by: Coia Prant Link: https://github.com/openwrt/openwrt/pull/20102 (cherry picked from commit d0383bb17522f1d307d07c4c4b31085c4a495fd9) Link: https://github.com/openwrt/openwrt/pull/20159 Signed-off-by: Hauke Mehrtens --- target/linux/ramips/image/mt76x8.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 5930d62a0b..3573d16a45 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -21,6 +21,12 @@ define Build/elecom-header mv $@.new $@ endef +define Build/qding-header + $(STAGING_DIR_HOST)/bin/mkqdimg \ + -B $(1) -f $@ -o $@.new + mv $@.new $@ +endef + define Build/ravpower-wd009-factory mkimage -A mips -T standalone -C none -a 0x80010000 -e 0x80010000 \ -n "OpenWrt Bootloader" -d $(UBOOT_PATH) $@.new @@ -538,6 +544,8 @@ define Device/qding_qc202 DEVICE_VENDOR := Qding DEVICE_MODEL := QC202 DEVICE_PACKAGES := kmod-i2c-mt7628 kmod-gpio-beeper kmod-input-matrix-keypad kmod-input-evdev uboot-envtools + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | qding-header qc202 endef TARGET_DEVICES += qding_qc202 From ade81ff85a47ef3ae7cf90a71b51b2fc595e5a55 Mon Sep 17 00:00:00 2001 From: Goetz Goerisch Date: Wed, 8 Oct 2025 19:32:20 +0200 Subject: [PATCH 19/87] kernel: bump 6.6 to 6.6.110 All patches auto-refreshed. Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.110 Signed-off-by: Goetz Goerisch Link: https://github.com/openwrt/openwrt/pull/20320 (cherry picked from commit 7a793724b1cb28c2a3d0d7594ed2aeda1f6d4933) Signed-off-by: Goetz Goerisch Link: https://github.com/openwrt/openwrt/pull/20348 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 ++-- .../patches-6.6/810-uvc-add-iPassion-iP2970-support.patch | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/kernel-6.6 b/include/kernel-6.6 index 990ef3dfd1..d6270b06ef 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .109 -LINUX_KERNEL_HASH-6.6.109 = 7731cd99778cfdeedd63aa1b5aa8379511b97ec7df8c9eca44baed4e401730f4 +LINUX_VERSION-6.6 = .110 +LINUX_KERNEL_HASH-6.6.110 = 1bf20daf5543b8759f325e55fb0da4913715e68741627a13380e66aaf219fb1d diff --git a/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch b/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch index c121690786..9122652337 100644 --- a/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch +++ b/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c -@@ -3310,6 +3310,18 @@ static const struct usb_device_id uvc_id +@@ -3329,6 +3329,18 @@ static const struct usb_device_id uvc_id .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = UVC_INFO_META(V4L2_META_FMT_D4XX) }, @@ -225,7 +225,7 @@ Signed-off-by: John Crispin for_each_uvc_urb(uvc_urb, stream) { --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h -@@ -77,6 +77,8 @@ +@@ -79,6 +79,8 @@ #define UVC_QUIRK_DISABLE_AUTOSUSPEND 0x00008000 #define UVC_QUIRK_INVALID_DEVICE_SOF 0x00010000 #define UVC_QUIRK_MJPEG_NO_EOF 0x00020000 @@ -234,7 +234,7 @@ Signed-off-by: John Crispin /* Format flags */ #define UVC_FMT_FLAG_COMPRESSED 0x00000001 -@@ -591,6 +593,7 @@ struct uvc_device { +@@ -593,6 +595,7 @@ struct uvc_device { struct input_dev *input; char input_phys[64]; From 6e068b7052cccadc7e3543ca6741ece26333097e Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 5 Oct 2025 19:43:22 +0200 Subject: [PATCH 20/87] openssl: Update to version 3.0.18 OpenSSL 3.0.18 is a security patch release. The most severe CVE fixed in this release is Moderate. This release incorporates the following bug fixes and mitigations: * Fix Out-of-bounds read & write in RFC 3211 KEK Unwrap. (CVE-2025-9230) * Fix Out-of-bounds read in HTTP client no_proxy handling. (CVE-2025-9232) The removed patch is included upstream: https://github.com/openssl/openssl/commit/c0d968f0ac56ad507ab0101e537e7d530e9f0448 Link: https://github.com/openwrt/openwrt/pull/20312 Signed-off-by: Hauke Mehrtens --- package/libs/openssl/Makefile | 6 +- ...p-the-store-open-in-by_store_ctrl_ex.patch | 127 ------------------ 2 files changed, 3 insertions(+), 130 deletions(-) delete mode 100644 package/libs/openssl/patches/0001-Don-t-keep-the-store-open-in-by_store_ctrl_ex.patch diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 267419613f..70d64d6711 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl -PKG_VERSION:=3.0.17 -PKG_RELEASE:=3 +PKG_VERSION:=3.0.18 +PKG_RELEASE:=1 PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto PKG_BUILD_PARALLEL:=1 @@ -21,7 +21,7 @@ PKG_SOURCE_URL:= \ https://www.openssl.org/source/old/$(PKG_BASE)/ \ https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/ -PKG_HASH:=dfdd77e4ea1b57ff3a6dbde6b0bdc3f31db5ac99e7fdd4eaf9e1fbb6ec2db8ce +PKG_HASH:=d80c34f5cf902dccf1f1b5df5ebb86d0392e37049e5d73df1b3abae72e4ffe8b PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE.txt diff --git a/package/libs/openssl/patches/0001-Don-t-keep-the-store-open-in-by_store_ctrl_ex.patch b/package/libs/openssl/patches/0001-Don-t-keep-the-store-open-in-by_store_ctrl_ex.patch deleted file mode 100644 index 18b26fa6c3..0000000000 --- a/package/libs/openssl/patches/0001-Don-t-keep-the-store-open-in-by_store_ctrl_ex.patch +++ /dev/null @@ -1,127 +0,0 @@ -From c0d968f0ac56ad507ab0101e537e7d530e9f0448 Mon Sep 17 00:00:00 2001 -From: Matt Caswell -Date: Thu, 7 Aug 2025 17:50:17 +0100 -Subject: [PATCH] Don't keep the store open in by_store_ctrl_ex -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Previously #27529 made a change to `by_store_ctrl_ex` in order to open -the OSSL_STORE early. The reason given in that PR is: - -"This way, we can call OSSL_STORE_open_ex() in by_store_ctrl_ex(), and -get to see possible errors when the URI is loaded" - -That PR then kept the store open until cache_objects is called and then -reused it. Unfortunately by the time cache_objects() is called we could be -in a multi-threaded scenario where the X509_STORE is being shared by -multiple threads. We then get a race condition where multiple threads are -all using (and ultimately closing) the same `OSSL_STORE_CTX`. - -The purpose of keeping the `OSSL_STORE` object between by_store_ctrl_ex() -and `cache_objects` is presumably an optimisation to avoid having to open -the store twice. But this does not work because of the above issue. - -We just take the hit and open it again. - -Fixes #28171 - -Reviewed-by: Tomas Mraz -Reviewed-by: Saša Nedvědický -(Merged from https://github.com/openssl/openssl/pull/28385) ---- - crypto/x509/by_store.c | 26 +++++++++++++------------- - 1 file changed, 13 insertions(+), 13 deletions(-) - ---- a/crypto/x509/by_store.c -+++ b/crypto/x509/by_store.c -@@ -17,7 +17,6 @@ typedef struct cached_store_st { - char *uri; - OSSL_LIB_CTX *libctx; - char *propq; -- OSSL_STORE_CTX *ctx; - } CACHED_STORE; - - DEFINE_STACK_OF(CACHED_STORE) -@@ -27,14 +26,12 @@ static int cache_objects(X509_LOOKUP *lc - const OSSL_STORE_SEARCH *criterion, int depth) - { - int ok = 0; -- OSSL_STORE_CTX *ctx = store->ctx; -+ OSSL_STORE_CTX *ctx; - X509_STORE *xstore = X509_LOOKUP_get_store(lctx); - -- if (ctx == NULL -- && (ctx = OSSL_STORE_open_ex(store->uri, store->libctx, store->propq, -- NULL, NULL, NULL, NULL, NULL)) == NULL) -+ if ((ctx = OSSL_STORE_open_ex(store->uri, store->libctx, store->propq, -+ NULL, NULL, NULL, NULL, NULL)) == NULL) - return 0; -- store->ctx = ctx; - - /* - * We try to set the criterion, but don't care if it was valid or not. -@@ -79,7 +76,6 @@ static int cache_objects(X509_LOOKUP *lc - substore.uri = (char *)OSSL_STORE_INFO_get0_NAME(info); - substore.libctx = store->libctx; - substore.propq = store->propq; -- substore.ctx = NULL; - ok = cache_objects(lctx, &substore, criterion, depth - 1); - } - } else { -@@ -105,7 +101,6 @@ static int cache_objects(X509_LOOKUP *lc - break; - } - OSSL_STORE_close(ctx); -- store->ctx = NULL; - - return ok; - } -@@ -114,7 +109,6 @@ static int cache_objects(X509_LOOKUP *lc - static void free_store(CACHED_STORE *store) - { - if (store != NULL) { -- OSSL_STORE_close(store->ctx); - OPENSSL_free(store->uri); - OPENSSL_free(store->propq); - OPENSSL_free(store); -@@ -148,6 +142,7 @@ static int by_store_ctrl_ex(X509_LOOKUP - { - STACK_OF(CACHED_STORE) *stores = X509_LOOKUP_get_method_data(ctx); - CACHED_STORE *store = OPENSSL_zalloc(sizeof(*store)); -+ OSSL_STORE_CTX *sctx; - - if (store == NULL) { - return 0; -@@ -157,14 +152,20 @@ static int by_store_ctrl_ex(X509_LOOKUP - store->libctx = libctx; - if (propq != NULL) - store->propq = OPENSSL_strdup(propq); -- store->ctx = OSSL_STORE_open_ex(argp, libctx, propq, NULL, NULL, -- NULL, NULL, NULL); -- if (store->ctx == NULL -+ /* -+ * We open this to check for errors now - so we can report those -+ * errors early. -+ */ -+ sctx = OSSL_STORE_open_ex(argp, libctx, propq, NULL, NULL, -+ NULL, NULL, NULL); -+ if (sctx == NULL - || (propq != NULL && store->propq == NULL) - || store->uri == NULL) { -+ OSSL_STORE_close(sctx); - free_store(store); - return use_default; - } -+ OSSL_STORE_close(sctx); - - if (stores == NULL) { - stores = sk_CACHED_STORE_new_null(); -@@ -184,7 +185,6 @@ static int by_store_ctrl_ex(X509_LOOKUP - store.uri = (char *)argp; - store.libctx = libctx; - store.propq = (char *)propq; -- store.ctx = NULL; - return cache_objects(ctx, &store, NULL, 0); - } - default: From 07c7dae498a3d931771994d6e4644694bdd57888 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sun, 12 Oct 2025 11:49:16 +0200 Subject: [PATCH 21/87] ipq-wifi: update to Git HEAD (2025-10-09) 20e5a5a32656 qca4019: add Linksys MR6350 BDF Signed-off-by: Robert Marko (cherry picked from commit 8ef2c4e88185fec5b27239a9dbb9b496d0c43eef) Link: https://github.com/openwrt/openwrt/pull/20407 Signed-off-by: Hauke Mehrtens --- package/firmware/ipq-wifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 319dc98e37..a63e92a019 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2025-09-16 -PKG_SOURCE_VERSION:=65d951610e0c32be4512275018490616cd9334b5 -PKG_MIRROR_HASH:=e6beb7648263ba70551adf302a5bf0108d281e16d87a94675e38f2a98b406b57 +PKG_SOURCE_DATE:=2025-10-09 +PKG_SOURCE_VERSION:=20e5a5a3265679c7367f2857214c3691bd75bea0 +PKG_MIRROR_HASH:=697ae289bbcff6d1c077c3086ce9bcca670728cfbc7da5b52ae1bcad838d0225 PKG_FLAGS:=nonshared include $(INCLUDE_DIR)/package.mk From db4efd2e2dd3166894baca905b518200b13ab947 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Tue, 14 Oct 2025 13:17:43 +0200 Subject: [PATCH 22/87] ipq-wifi: update to Git HEAD (2025-10-14) 821d27b582c1 qca9888: add BDF for TP-Link Archer C59 v1 Signed-off-by: Robert Marko (cherry picked from commit bef0bf8efc34362c9917d0c5bc195fd4a044e10b) Link: https://github.com/openwrt/openwrt/pull/20407 Signed-off-by: Hauke Mehrtens --- package/firmware/ipq-wifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index a63e92a019..bf774f1b17 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2025-10-09 -PKG_SOURCE_VERSION:=20e5a5a3265679c7367f2857214c3691bd75bea0 -PKG_MIRROR_HASH:=697ae289bbcff6d1c077c3086ce9bcca670728cfbc7da5b52ae1bcad838d0225 +PKG_SOURCE_DATE:=2025-10-14 +PKG_SOURCE_VERSION:=821d27b582c130ab65b7d20d0dfcbade7cdaf623 +PKG_MIRROR_HASH:=1e2959037baa5cfb24d931f9ad9b8f9a732d93810fce91a836ca7ed4d46ad7b0 PKG_FLAGS:=nonshared include $(INCLUDE_DIR)/package.mk From 467924878bc30f933d8e1ba7ac5000ca68710fb7 Mon Sep 17 00:00:00 2001 From: Christoph Krapp Date: Thu, 25 Sep 2025 09:29:22 +0200 Subject: [PATCH 23/87] ipq-wifi: Add entry for TP-Link Archer C59 v1 Add IPQ Wifi entry for ath79 TP-Link Archer C59 v1. Signed-off-by: Christoph Krapp Link: https://github.com/openwrt/openwrt/pull/20401 Signed-off-by: Robert Marko (cherry picked from commit 8ea1396fd29f8c3a509570be49e0298fc30266a1) Link: https://github.com/openwrt/openwrt/pull/20407 Signed-off-by: Hauke Mehrtens --- package/firmware/ipq-wifi/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index bf774f1b17..7608cfbf48 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -55,6 +55,7 @@ ALLWIFIBOARDS:= \ skspruce_wia3300-20 \ spectrum_sax1v1k \ tplink_eap660hd-v1 \ + tplink_archer-c59-v1 \ tplink_archer-c6-v2 \ tplink_archer-c60-v1 \ wallys_dr40x9 \ @@ -188,6 +189,7 @@ $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6)) $(eval $(call generate-ipq-wifi-package,skspruce_wia3300-20,SKSpruce WIA3300-20)) $(eval $(call generate-ipq-wifi-package,spectrum_sax1v1k,Spectrum SAX1V1K)) $(eval $(call generate-ipq-wifi-package,tplink_eap660hd-v1,TP-Link EAP660 HD v1)) +$(eval $(call generate-ipq-wifi-package,tplink_archer-c59-v1,TP-Link Archer C59 V1)) $(eval $(call generate-ipq-wifi-package,tplink_archer-c6-v2,TP-Link Archer C6 V2)) $(eval $(call generate-ipq-wifi-package,tplink_archer-c60-v1,TP-Link Archer C60 V1)) $(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9)) From 0c1ff934eca71e149ab80c9c250598e01226100e Mon Sep 17 00:00:00 2001 From: Christoph Krapp Date: Thu, 25 Sep 2025 09:30:27 +0200 Subject: [PATCH 24/87] ath79: add calibtation variant for TP-Link Archer C59 v1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that we have a board file, add calibration variant for TP-Link Archer C59 v1 and add ipq-wifi package for it. Tested-by: Mateusz Jończyk Signed-off-by: Christoph Krapp Link: https://github.com/openwrt/openwrt/pull/20401 Signed-off-by: Robert Marko i(cherry picked from commit 2a44808374497b83edb76b4e384f280546a62dbe) Link: https://github.com/openwrt/openwrt/pull/20407 Signed-off-by: Hauke Mehrtens --- target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts | 1 + target/linux/ath79/image/generic-tp-link.mk | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts index 4e6e90a8c3..4c8938f6fd 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts @@ -37,6 +37,7 @@ reg = <0x0000 0 0 0 0>; nvmem-cells = <&precal_art_5000>, <&macaddr_info_8 (-1)>; nvmem-cell-names = "pre-calibration", "mac-address"; + qcom,ath10k-calibration-variant = "TP-Link-Archer-c59-v1"; }; }; diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index 6055c724d9..b5b2ec8c7c 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -79,7 +79,7 @@ define Device/tplink_archer-c59-v1 DEVICE_VARIANT := v1 TPLINK_BOARD_ID := ARCHER-C59-V1 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct \ - ath10k-firmware-qca9888-ct + ath10k-firmware-qca9888-ct ipq-wifi-tplink_archer-c59-v1 SUPPORTED_DEVICES += archer-c59-v1 endef TARGET_DEVICES += tplink_archer-c59-v1 From 8554e22ace65d8fb98871c8d7670b4713a7060ea Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 5 Oct 2025 19:31:09 +0200 Subject: [PATCH 25/87] mac80211: Update to version 6.12.52 This includes the following commits from upstream Linux between 6.12.44 and 6.12.52: ``` $ git log --reverse --oneline v6.12.44...v6.12.52 -- drivers/net/wireless/ net/mac80211/ net/wireless/ 5b7ae04969f8 wifi: cfg80211: fix use-after-free in cmp_bss() 3e789f8475f6 wifi: brcmfmac: fix use-after-free when rescheduling brcmf_btcoex_info work d9f2fb6a2ac8 wifi: mt76: mt7925: fix locking in mt7925_change_vif_links() 1fb26fd3f601 wifi: mt76: prevent non-offchannel mgmt tx during scan/roc 2aef3667e6b0 wifi: mt76: free pending offchannel tx frames on wcid cleanup e4d5a5fc61fd wifi: mt76: fix linked list corruption c2e32ac3f107 wifi: iwlwifi: uefi: check DSM item validity 609a8ffff5a0 wifi: ath11k: fix group data packet drops during rekey cedbbba8a8e8 wifi: cw1200: cap SSID length in cw1200_do_join() 92bedee7168d wifi: libertas: cap SSID len in lbs_associate() 31229145e6ba wifi: cfg80211: sme: cap SSID length in __cfg80211_connect_result() 06616410a3e5 wifi: mwifiex: Initialize the chan_stats array to zero a001c2f6a40c wifi: mt76: mt7925u: use connac3 tx aggr check in tx complete eefa2ad9009b wifi: mt76: mt7996: Initialize hdr before passing to skb_put_data() 089fd41902ee wifi: mt76: mt7925: fix the wrong bss cleanup for SAP 26618c039b78 wifi: ath11k: update channel list in reg notifier instead reg worker fa4abd439f27 wifi: ath11k: update channel list in worker when wait flag is set 2203ef417044 wifi: wilc1000: avoid buffer overflow in WID string configuration 32adb020b0c3 wifi: mac80211: increase scan_ies_len for S1G 8df33f4d4a0b wifi: mac80211: fix incorrect type for ret 79dc6d4932de wifi: virt_wifi: Fix page fault on connect 1f52119809b7 wifi: ath11k: fix NULL dereference in ath11k_qmi_m3_load() 895cccf639ac wifi: rtw89: fix use-after-free in rtw89_core_tx_kick_off_and_wait() 914d02595ba6 wifi: rtlwifi: rtl8192cu: Don't claim USB ID 07b8:8188 1713796d6538 wifi: rtl8xxxu: Don't claim USB ID 07b8:8188 ``` Removed ath11k/940-ath11k-Revert-clear-the-keys-properly-when-DISABLE_K.patch This problem is fixed by: 609a8ffff5a0 wifi: ath11k: fix group data packet drops during rekey Link: https://github.com/openwrt/openwrt/pull/20311 Signed-off-by: Hauke Mehrtens --- package/kernel/mac80211/Makefile | 6 +-- .../991-ath10k-support-flush_sta-method.patch | 6 +-- ...upport-setting-FW-memory-mode-via-DT.patch | 4 +- ...tersection-support-for-regulatory-ru.patch | 24 ++++++---- ...ear-the-keys-properly-when-DISABLE_K.patch | 48 ------------------- .../801-libertas-configure-sysfs-links.patch | 2 +- .../802-libertas-set-wireless-macaddr.patch | 2 +- .../patches/subsys/130-disable_auto_vif.patch | 2 +- ...11-add-option-for-vif-allowed-radios.patch | 2 +- ...pport-EHT-1024-aggregation-size-in-T.patch | 39 +++++---------- 10 files changed, 39 insertions(+), 96 deletions(-) delete mode 100644 package/kernel/mac80211/patches/ath11k/940-ath11k-Revert-clear-the-keys-properly-when-DISABLE_K.patch diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index c93f177aec..80ffb9f598 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,13 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=6.12.44 -PKG_RELEASE:=2 +PKG_VERSION:=6.12.52 +PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/ -PKG_HASH:=85a9f92ddba3bf2970a089e7af576c1135217c387205f4481ea9131c0c45c509 +PKG_HASH:=ed6ef4c67e08b294ed1101c7cc5ae584a5f338c99ef95362fa3921eb6d207f5d PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/patches/ath10k/991-ath10k-support-flush_sta-method.patch b/package/kernel/mac80211/patches/ath10k/991-ath10k-support-flush_sta-method.patch index a0f6eed7cd..c426d4b6a8 100644 --- a/package/kernel/mac80211/patches/ath10k/991-ath10k-support-flush_sta-method.patch +++ b/package/kernel/mac80211/patches/ath10k/991-ath10k-support-flush_sta-method.patch @@ -29,7 +29,7 @@ Tested-by: Florian Maurer --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -8166,6 +8166,20 @@ static void ath10k_flush(struct ieee8021 +@@ -8135,6 +8135,20 @@ static void ath10k_flush(struct ieee8021 mutex_unlock(&ar->conf_mutex); } @@ -50,7 +50,7 @@ Tested-by: Florian Maurer /* TODO: Implement this function properly * For now it is needed to reply to Probe Requests in IBSS mode. * Probably we need this information from FW. -@@ -9513,6 +9527,7 @@ static const struct ieee80211_ops ath10k +@@ -9486,6 +9500,7 @@ static const struct ieee80211_ops ath10k .set_rts_threshold = ath10k_set_rts_threshold, .set_frag_threshold = ath10k_mac_op_set_frag_threshold, .flush = ath10k_flush, @@ -58,7 +58,7 @@ Tested-by: Florian Maurer .tx_last_beacon = ath10k_tx_last_beacon, .set_antenna = ath10k_set_antenna, .get_antenna = ath10k_get_antenna, -@@ -10334,6 +10349,9 @@ int ath10k_mac_register(struct ath10k *a +@@ -10307,6 +10322,9 @@ int ath10k_mac_register(struct ath10k *a if (!ar->hw_params.hw_ops->set_coverage_class) ar->ops->set_coverage_class = NULL; diff --git a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch index e747738b81..2bc1ca3c7d 100644 --- a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch +++ b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch @@ -31,7 +31,7 @@ Signed-off-by: Robert Marko { .hw_rev = ATH11K_HW_IPQ8074, .name = "ipq8074 hw2.0", -@@ -2200,7 +2200,8 @@ static void ath11k_core_reset(struct wor +@@ -2201,7 +2201,8 @@ static void ath11k_core_reset(struct wor static int ath11k_init_hw_params(struct ath11k_base *ab) { const struct ath11k_hw_params *hw_params = NULL; @@ -41,7 +41,7 @@ Signed-off-by: Robert Marko for (i = 0; i < ARRAY_SIZE(ath11k_hw_params); i++) { hw_params = &ath11k_hw_params[i]; -@@ -2216,7 +2217,31 @@ static int ath11k_init_hw_params(struct +@@ -2217,7 +2218,31 @@ static int ath11k_init_hw_params(struct ab->hw_params = *hw_params; diff --git a/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch b/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch index f30e03475f..59a2165c0c 100644 --- a/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch +++ b/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch @@ -23,7 +23,7 @@ Signed-off-by: Aditya Kumar Singh --- a/drivers/net/wireless/ath/ath11k/reg.c +++ b/drivers/net/wireless/ath/ath11k/reg.c -@@ -361,134 +361,6 @@ static u32 ath11k_map_fw_phy_flags(u32 p +@@ -353,134 +353,6 @@ static u32 ath11k_map_fw_phy_flags(u32 p return flags; } @@ -158,7 +158,7 @@ Signed-off-by: Aditya Kumar Singh static const char * ath11k_reg_get_regdom_str(enum nl80211_dfs_regions dfs_region) { -@@ -639,11 +511,11 @@ ath11k_reg_ap_pwr_convert(enum ieee80211 +@@ -631,11 +503,11 @@ ath11k_reg_ap_pwr_convert(enum ieee80211 struct ieee80211_regdomain * ath11k_reg_build_regd(struct ath11k_base *ab, @@ -172,7 +172,7 @@ Signed-off-by: Aditya Kumar Singh struct cur_reg_rule *reg_rule, *reg_rule_6ghz; u8 i = 0, j = 0, k = 0; u8 num_rules; -@@ -686,26 +558,26 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -678,26 +550,26 @@ ath11k_reg_build_regd(struct ath11k_base } if (!num_rules) @@ -206,7 +206,7 @@ Signed-off-by: Aditya Kumar Singh reg_info->dfs_region, num_rules); /* Update reg_rules[] below. Firmware is expected to * send these rules in order(2 GHz rules first and then 5 GHz) -@@ -744,7 +616,7 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -736,7 +608,7 @@ ath11k_reg_build_regd(struct ath11k_base flags |= ath11k_map_fw_reg_flags(reg_rule->flags); flags |= ath11k_map_fw_phy_flags(reg_info->phybitmap); @@ -215,7 +215,7 @@ Signed-off-by: Aditya Kumar Singh reg_rule->start_freq, reg_rule->end_freq, max_bw, reg_rule->ant_gain, reg_rule->reg_power, -@@ -759,7 +631,7 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -751,7 +623,7 @@ ath11k_reg_build_regd(struct ath11k_base reg_info->dfs_region == ATH11K_DFS_REG_ETSI && (reg_rule->end_freq > ETSI_WEATHER_RADAR_BAND_LOW && reg_rule->start_freq < ETSI_WEATHER_RADAR_BAND_HIGH)){ @@ -224,7 +224,7 @@ Signed-off-by: Aditya Kumar Singh reg_rule, &i, flags, max_bw); continue; -@@ -770,51 +642,23 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -762,37 +634,20 @@ ath11k_reg_build_regd(struct ath11k_base "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d) (%d, %d)\n", i + 1, reg_rule->start_freq, reg_rule->end_freq, max_bw, reg_rule->ant_gain, reg_rule->reg_power, @@ -265,6 +265,10 @@ Signed-off-by: Aditya Kumar Singh return new_regd; } +@@ -844,17 +699,6 @@ void ath11k_regd_update_chan_list_work(s + } + } + -static bool ath11k_reg_is_world_alpha(char *alpha) -{ - if (alpha[0] == '0' && alpha[1] == '0') @@ -279,7 +283,7 @@ Signed-off-by: Aditya Kumar Singh static enum wmi_vdev_type ath11k_reg_get_ar_vdev_type(struct ath11k *ar) { struct ath11k_vif *arvif; -@@ -837,7 +681,6 @@ int ath11k_reg_handle_chan_list(struct a +@@ -877,7 +721,6 @@ int ath11k_reg_handle_chan_list(struct a enum ieee80211_ap_reg_power power_type) { struct ieee80211_regdomain *regd; @@ -287,7 +291,7 @@ Signed-off-by: Aditya Kumar Singh int pdev_idx; struct ath11k *ar; enum wmi_vdev_type vdev_type; -@@ -889,24 +732,14 @@ int ath11k_reg_handle_chan_list(struct a +@@ -929,24 +772,14 @@ int ath11k_reg_handle_chan_list(struct a (char *)reg_info->alpha2, 2)) goto retfail; @@ -317,8 +321,8 @@ Signed-off-by: Aditya Kumar Singh goto fallback; --- a/drivers/net/wireless/ath/ath11k/reg.h +++ b/drivers/net/wireless/ath/ath11k/reg.h -@@ -35,7 +35,7 @@ void ath11k_reg_free(struct ath11k_base - void ath11k_regd_update_work(struct work_struct *work); +@@ -36,7 +36,7 @@ void ath11k_regd_update_work(struct work + void ath11k_regd_update_chan_list_work(struct work_struct *work); struct ieee80211_regdomain * ath11k_reg_build_regd(struct ath11k_base *ab, - struct cur_regulatory_info *reg_info, bool intersect, diff --git a/package/kernel/mac80211/patches/ath11k/940-ath11k-Revert-clear-the-keys-properly-when-DISABLE_K.patch b/package/kernel/mac80211/patches/ath11k/940-ath11k-Revert-clear-the-keys-properly-when-DISABLE_K.patch deleted file mode 100644 index ec2dc222b6..0000000000 --- a/package/kernel/mac80211/patches/ath11k/940-ath11k-Revert-clear-the-keys-properly-when-DISABLE_K.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 52393e2ae12f18fb1a60578c24c46ebab292ddb6 Mon Sep 17 00:00:00 2001 -From: Rameshkumar Sundaram -Date: Mon, 28 Mar 2022 13:21:04 +0530 -Subject: [PATCH] ath11k: Revert: clear the keys properly when DISABLE_KEY -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Reverting the Upstream clear key change added as a part of -436a4e886598 ("ath11k: clear the keys properly -when DISABLE_KEY") -This change exposed a race in WLAN Firmware where target asserts -are seen frequently due FW not synchronizing ath11k host’s clear -key commands(CIPHER changes to NONE) with frames in TX queue. -Hence reverting this change untill FW fixes to synchronize -ath11k host’s clear key command are available. - -Signed-off-by: Rameshkumar Sundaram ---- - drivers/net/wireless/ath/ath11k/mac.c | 4 +++- - drivers/net/wireless/ath/ath11k/wmi.c | 3 +-- - 2 files changed, 4 insertions(+), 3 deletions(-) - ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -4222,7 +4222,9 @@ static int ath11k_install_key(struct ath - return 0; - - if (cmd == DISABLE_KEY) { -- arg.key_cipher = WMI_CIPHER_NONE; -+ /* TODO: Check if FW expects value other than NONE for del */ -+ /* arg.key_cipher = WMI_CIPHER_NONE; */ -+ arg.key_len = 0; - arg.key_data = NULL; - goto install; - } ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -1854,8 +1854,7 @@ int ath11k_wmi_vdev_install_key(struct a - tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd)); - tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | - FIELD_PREP(WMI_TLV_LEN, key_len_aligned); -- if (arg->key_data) -- memcpy(tlv->value, (u8 *)arg->key_data, key_len_aligned); -+ memcpy(tlv->value, (u8 *)arg->key_data, key_len_aligned); - - ret = ath11k_wmi_cmd_send(wmi, skb, WMI_VDEV_INSTALL_KEY_CMDID); - if (ret) { diff --git a/package/kernel/mac80211/patches/mwl/801-libertas-configure-sysfs-links.patch b/package/kernel/mac80211/patches/mwl/801-libertas-configure-sysfs-links.patch index e6111871c0..bc9f81384e 100644 --- a/package/kernel/mac80211/patches/mwl/801-libertas-configure-sysfs-links.patch +++ b/package/kernel/mac80211/patches/mwl/801-libertas-configure-sysfs-links.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/marvell/libertas/cfg.c +++ b/drivers/net/wireless/marvell/libertas/cfg.c -@@ -2102,6 +2102,8 @@ struct wireless_dev *lbs_cfg_alloc(struc +@@ -2105,6 +2105,8 @@ struct wireless_dev *lbs_cfg_alloc(struc goto err_wiphy_new; } diff --git a/package/kernel/mac80211/patches/mwl/802-libertas-set-wireless-macaddr.patch b/package/kernel/mac80211/patches/mwl/802-libertas-set-wireless-macaddr.patch index 97ddd66b32..9aa4d05473 100644 --- a/package/kernel/mac80211/patches/mwl/802-libertas-set-wireless-macaddr.patch +++ b/package/kernel/mac80211/patches/mwl/802-libertas-set-wireless-macaddr.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/marvell/libertas/cfg.c +++ b/drivers/net/wireless/marvell/libertas/cfg.c -@@ -2179,6 +2179,8 @@ int lbs_cfg_register(struct lbs_private +@@ -2182,6 +2182,8 @@ int lbs_cfg_register(struct lbs_private wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); wdev->wiphy->reg_notifier = lbs_reg_notifier; diff --git a/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch b/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch index b56531435c..466eee61ed 100644 --- a/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch +++ b/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -1585,24 +1585,6 @@ int ieee80211_register_hw(struct ieee802 +@@ -1590,24 +1590,6 @@ int ieee80211_register_hw(struct ieee802 ieee80211_check_wbrf_support(local); diff --git a/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch b/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch index dca56f8680..4ecbc514fc 100644 --- a/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch +++ b/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch @@ -246,7 +246,7 @@ Signed-off-by: Felix Fietkau continue; for (i = 0; i < rdev_req->n_channels; i++) { -@@ -3512,9 +3513,12 @@ int cfg80211_wext_siwscan(struct net_dev +@@ -3513,9 +3514,12 @@ int cfg80211_wext_siwscan(struct net_dev continue; for (j = 0; j < wiphy->bands[band]->n_channels; j++) { diff --git a/package/kernel/mac80211/patches/subsys/342-wifi-mac80211-Support-EHT-1024-aggregation-size-in-T.patch b/package/kernel/mac80211/patches/subsys/342-wifi-mac80211-Support-EHT-1024-aggregation-size-in-T.patch index 2771f5eac7..e4159d2b3d 100644 --- a/package/kernel/mac80211/patches/subsys/342-wifi-mac80211-Support-EHT-1024-aggregation-size-in-T.patch +++ b/package/kernel/mac80211/patches/subsys/342-wifi-mac80211-Support-EHT-1024-aggregation-size-in-T.patch @@ -26,11 +26,9 @@ Signed-off-by: Johannes Berg net/mac80211/ieee80211_i.h | 9 +++- 5 files changed, 90 insertions(+), 48 deletions(-) -diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h -index 456bca45ff05..05dedc45505c 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h -@@ -1445,6 +1445,8 @@ struct ieee80211_mgmt { +@@ -1492,6 +1492,8 @@ struct ieee80211_mgmt { __le16 status; __le16 capab; __le16 timeout; @@ -39,11 +37,9 @@ index 456bca45ff05..05dedc45505c 100644 } __packed addba_resp; struct{ u8 action_code; -diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c -index fe7eab4b681b..f3fbe5a4395e 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c -@@ -170,28 +170,63 @@ static void sta_rx_agg_reorder_timer_expired(struct timer_list *t) +@@ -170,28 +170,63 @@ static void sta_rx_agg_reorder_timer_exp rcu_read_unlock(); } @@ -117,7 +113,7 @@ index fe7eab4b681b..f3fbe5a4395e 100644 { struct ieee80211_sub_if_data *sdata = sta->sdata; struct ieee80211_local *local = sdata->local; -@@ -223,8 +258,8 @@ static void ieee80211_send_addba_resp(struct sta_info *sta, u8 *da, u16 tid, +@@ -223,8 +258,8 @@ static void ieee80211_send_addba_resp(st mgmt->u.action.u.addba_resp.timeout = cpu_to_le16(timeout); mgmt->u.action.u.addba_resp.status = cpu_to_le16(status); @@ -128,7 +124,7 @@ index fe7eab4b681b..f3fbe5a4395e 100644 ieee80211_tx_skb(sdata, skb); } -@@ -233,7 +268,7 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta, +@@ -233,7 +268,7 @@ void __ieee80211_start_rx_ba_session(str u8 dialog_token, u16 timeout, u16 start_seq_num, u16 ba_policy, u16 tid, u16 buf_size, bool tx, bool auto_seq, @@ -137,7 +133,7 @@ index fe7eab4b681b..f3fbe5a4395e 100644 { struct ieee80211_local *local = sta->sdata->local; struct tid_ampdu_rx *tid_agg_rx; -@@ -419,7 +454,7 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta, +@@ -419,7 +454,7 @@ end: if (tx) ieee80211_send_addba_resp(sta, sta->sta.addr, tid, dialog_token, status, 1, buf_size, @@ -146,7 +142,7 @@ index fe7eab4b681b..f3fbe5a4395e 100644 } void ieee80211_process_addba_request(struct ieee80211_local *local, -@@ -428,9 +463,7 @@ void ieee80211_process_addba_request(struct ieee80211_local *local, +@@ -428,9 +463,7 @@ void ieee80211_process_addba_request(str size_t len) { u16 capab, tid, timeout, ba_policy, buf_size, start_seq_num; @@ -157,7 +153,7 @@ index fe7eab4b681b..f3fbe5a4395e 100644 /* extract session parameters from addba request frame */ dialog_token = mgmt->u.action.u.addba_req.dialog_token; -@@ -443,28 +476,17 @@ void ieee80211_process_addba_request(struct ieee80211_local *local, +@@ -443,28 +476,17 @@ void ieee80211_process_addba_request(str tid = (capab & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2; buf_size = (capab & IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK) >> 6; @@ -194,8 +190,6 @@ index fe7eab4b681b..f3fbe5a4395e 100644 } void ieee80211_manage_rx_ba_offl(struct ieee80211_vif *vif, -diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c -index 04cb45cfb310..61f2cac37728 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c @@ -58,23 +58,24 @@ @@ -228,7 +222,7 @@ index 04cb45cfb310..61f2cac37728 100644 skb_put(skb, 1 + sizeof(mgmt->u.action.u.addba_req)); -@@ -93,6 +94,9 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata, +@@ -93,6 +94,9 @@ static void ieee80211_send_addba_request mgmt->u.action.u.addba_req.start_seq_num = cpu_to_le16(start_seq_num << 4); @@ -238,7 +232,7 @@ index 04cb45cfb310..61f2cac37728 100644 ieee80211_tx_skb_tid(sdata, skb, tid, -1); } -@@ -460,8 +464,11 @@ static void ieee80211_send_addba_with_timeout(struct sta_info *sta, +@@ -460,8 +464,11 @@ static void ieee80211_send_addba_with_ti sta->ampdu_mlme.addba_req_num[tid]++; spin_unlock_bh(&sta->lock); @@ -251,7 +245,7 @@ index 04cb45cfb310..61f2cac37728 100644 } else { /* * We really should use what the driver told us it will -@@ -473,9 +480,8 @@ static void ieee80211_send_addba_with_timeout(struct sta_info *sta, +@@ -473,9 +480,8 @@ static void ieee80211_send_addba_with_ti } /* send AddBA request */ @@ -263,7 +257,7 @@ index 04cb45cfb310..61f2cac37728 100644 WARN_ON(test_and_set_bit(HT_AGG_STATE_SENT_ADDBA, &tid_tx->state)); } -@@ -970,6 +976,13 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, +@@ -970,6 +976,13 @@ void ieee80211_process_addba_resp(struct amsdu = capab & IEEE80211_ADDBA_PARAM_AMSDU_MASK; tid = u16_get_bits(capab, IEEE80211_ADDBA_PARAM_TID_MASK); buf_size = u16_get_bits(capab, IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK); @@ -277,11 +271,9 @@ index 04cb45cfb310..61f2cac37728 100644 buf_size = min(buf_size, local->hw.max_tx_aggregation_subframes); txq = sta->sta.txq[tid]; -diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c -index 1c2b7dd8976a..32390d8a9d75 100644 --- a/net/mac80211/ht.c +++ b/net/mac80211/ht.c -@@ -379,7 +379,7 @@ void ieee80211_ba_session_work(struct wiphy *wiphy, struct wiphy_work *work) +@@ -379,7 +379,7 @@ void ieee80211_ba_session_work(struct wi sta->ampdu_mlme.tid_rx_manage_offl)) __ieee80211_start_rx_ba_session(sta, 0, 0, 0, 1, tid, IEEE80211_MAX_AMPDU_BUF_HT, @@ -290,11 +282,9 @@ index 1c2b7dd8976a..32390d8a9d75 100644 if (test_and_clear_bit(tid + IEEE80211_NUM_TIDS, sta->ampdu_mlme.tid_rx_manage_offl)) -diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h -index 7dcb46120abc..752297bcde76 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -2111,14 +2111,19 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata, +@@ -2131,14 +2131,19 @@ int ieee80211_send_smps_action(struct ie const u8 *bssid, int link_id); bool ieee80211_smps_is_restrictive(enum ieee80211_smps_mode smps_mode_old, enum ieee80211_smps_mode smps_mode_new); @@ -316,6 +306,3 @@ index 7dcb46120abc..752297bcde76 100644 void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta, enum ieee80211_agg_stop_reason reason); void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata, --- -2.39.5 - From e0478edeedccd10164b99cdba915776fcc6843c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Owoc?= Date: Sat, 24 Feb 2024 20:25:43 +0100 Subject: [PATCH 26/87] base-files: sysupgrade: Add new option -s to perform upgrade on current partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add new option to be able to perform upgrade on current partition for dual firmware devices: "-s stay on current partition (for dual firmware devices)" Signed-off-by: Paweł Owoc Link: https://github.com/openwrt/openwrt/pull/14720 Link: https://github.com/openwrt/openwrt/pull/20086 Signed-off-by: Robert Marko --- package/base-files/files/sbin/sysupgrade | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 611d8830bf..f31c4bc2e9 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -20,6 +20,7 @@ CONF_IMAGE= CONF_BACKUP_LIST=0 CONF_BACKUP= CONF_RESTORE= +USE_CURR_PART=0 NEED_IMAGE= HELP=0 TEST=0 @@ -50,6 +51,7 @@ while [ -n "$1" ]; do -r|--restore-backup) CONF_RESTORE="$2" NEED_IMAGE=1; shift;; -l|--list-backup) CONF_BACKUP_LIST=1;; -f) CONF_IMAGE="$2"; shift;; + -s) USE_CURR_PART=1;; -F|--force) export FORCE=1;; -T|--test) TEST=1;; -h|--help) HELP=1; break;; @@ -79,6 +81,7 @@ upgrade-option: -p do not attempt to restore the partition table after flash. -k include in backup a list of current installed packages at $INSTALLED_PACKAGES + -s stay on current partition (for dual firmware devices) -T | --test Verify image and config .tar.gz but do not actually flash. -F | --force @@ -416,6 +419,7 @@ else json_add_string command "$COMMAND" json_add_object options json_add_int save_partitions "$SAVE_PARTITIONS" + [ $USE_CURR_PART -eq 1 ] && json_add_boolean use_curr_part 1 json_close_object ubus call system sysupgrade "$(json_dump)" From f84fde7fb96ecfd63ae568a764641a15bb11f65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Owoc?= Date: Sat, 24 Feb 2024 20:47:58 +0100 Subject: [PATCH 27/87] qualcommax: ipq807x: Add ability to perform upgrade on current partition for Linksys MX devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dual firmware devices like Linksys MX4200, MX4300, MX5300 and MX8500 use separate rootfs partition. This option helps to keep all configuration during upgrade. Signed-off-by: Paweł Owoc Link: https://github.com/openwrt/openwrt/pull/14720 Link: https://github.com/openwrt/openwrt/pull/20086 Signed-off-by: Robert Marko --- .../base-files/lib/upgrade/platform.sh | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index 7e9401d95e..e3cf4a1160 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -108,6 +108,28 @@ tplink_do_upgrade() { nand_do_upgrade "$1" } +linksys_mx_do_upgrade() { + CI_UBIPART="rootfs" + boot_part="$(fw_printenv -n boot_part)" + if [ -n "$UPGRADE_OPT_USE_CURR_PART" ]; then + if [ "$boot_part" -eq "2" ]; then + CI_KERNPART="alt_kernel" + CI_UBIPART="alt_rootfs" + fi + else + if [ "$boot_part" -eq "1" ]; then + fw_setenv boot_part 2 + CI_KERNPART="alt_kernel" + CI_UBIPART="alt_rootfs" + else + fw_setenv boot_part 1 + fi + fi + fw_setenv boot_part_ready 3 + fw_setenv auto_recovery yes + nand_do_upgrade "$1" +} + platform_check_image() { return 0; } @@ -176,18 +198,7 @@ platform_do_upgrade() { linksys,mx4300|\ linksys,mx5300|\ linksys,mx8500) - boot_part="$(fw_printenv -n boot_part)" - if [ "$boot_part" -eq "1" ]; then - fw_setenv boot_part 2 - CI_KERNPART="alt_kernel" - CI_UBIPART="alt_rootfs" - else - fw_setenv boot_part 1 - CI_UBIPART="rootfs" - fi - fw_setenv boot_part_ready 3 - fw_setenv auto_recovery yes - nand_do_upgrade "$1" + linksys_mx_do_upgrade "$1" ;; prpl,haze|\ qnap,301w) From d63824f78f1f1ebea7134646575f5574d2bbec5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Owoc?= Date: Thu, 12 Dec 2024 19:51:27 +0100 Subject: [PATCH 28/87] qualcommax: ipq807x: Update u-boot env only when changes for Linksys MX devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update u-boot env variables only when changes are made. Applies to Linksys MX4200/MX4300/MX5300/MX8500. Signed-off-by: Paweł Owoc Link: https://github.com/openwrt/openwrt/pull/14720 Link: https://github.com/openwrt/openwrt/pull/20086 Signed-off-by: Robert Marko --- .../base-files/lib/upgrade/platform.sh | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index e3cf4a1160..3deb102a8f 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -109,6 +109,8 @@ tplink_do_upgrade() { } linksys_mx_do_upgrade() { + local setenv_script="/tmp/fw_env_upgrade" + CI_UBIPART="rootfs" boot_part="$(fw_printenv -n boot_part)" if [ -n "$UPGRADE_OPT_USE_CURR_PART" ]; then @@ -118,15 +120,30 @@ linksys_mx_do_upgrade() { fi else if [ "$boot_part" -eq "1" ]; then - fw_setenv boot_part 2 + echo "boot_part 2" >> $setenv_script CI_KERNPART="alt_kernel" CI_UBIPART="alt_rootfs" else - fw_setenv boot_part 1 + echo "boot_part 1" >> $setenv_script fi fi - fw_setenv boot_part_ready 3 - fw_setenv auto_recovery yes + + boot_part_ready="$(fw_printenv -n boot_part_ready)" + if [ "$boot_part_ready" -ne "3" ]; then + echo "boot_part_ready 3" >> $setenv_script + fi + + auto_recovery="$(fw_printenv -n auto_recovery)" + if [ "$auto_recovery" != "yes" ]; then + echo "auto_recovery yes" >> $setenv_script + fi + + if [ -f "$setenv_script" ]; then + fw_setenv -s $setenv_script || { + echo "failed to update U-Boot environment" + return 1 + } + fi nand_do_upgrade "$1" } From e301921ae383ebb81b33af59a802fb4ffdc14c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Owoc?= Date: Thu, 2 Jan 2025 22:31:33 +0100 Subject: [PATCH 29/87] qualcommax: ipq807x: Remove OEM UBI volume before upgrade for Linksys MX devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use 'remove_oem_ubi_volume' function to remove OEM UBI volume before upgrade. This allows to upgrade even if we have OEM firmware on the second partition. Applies to Linksys MX4200/MX4300/MX5300/MX8500. Signed-off-by: Paweł Owoc Link: https://github.com/openwrt/openwrt/pull/14720 Link: https://github.com/openwrt/openwrt/pull/20086 Signed-off-by: Robert Marko --- .../qualcommax/ipq807x/base-files/lib/upgrade/platform.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index 3deb102a8f..438cfdc613 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -212,9 +212,13 @@ platform_do_upgrade() { ;; linksys,mx4200v1|\ linksys,mx4200v2|\ - linksys,mx4300|\ + linksys,mx4300) + remove_oem_ubi_volume squashfs + linksys_mx_do_upgrade "$1" + ;; linksys,mx5300|\ linksys,mx8500) + remove_oem_ubi_volume ubifs linksys_mx_do_upgrade "$1" ;; prpl,haze|\ From 0c4f3b1246dae22d8cb299907fb200a212a4719a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Owoc?= Date: Mon, 24 Feb 2025 13:18:46 +0100 Subject: [PATCH 30/87] qualcommax: fix upgrade function for Linksys MX dual boot devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Function remove_oem_ubi_volume was called before CI_UBIPART variable was defined. Fixes: https://github.com/openwrt/openwrt/commit/df1f6e1e186a99b2180abac5da87f071b7f6b3fa (qualcommax: ipq807x: Remove OEM UBI volume before upgrade for Linksys MX devices) Signed-off-by: Paweł Owoc Link: https://github.com/openwrt/openwrt/pull/18090 Signed-off-by: Paweł Owoc Link: https://github.com/openwrt/openwrt/pull/20086 Signed-off-by: Robert Marko --- .../ipq807x/base-files/lib/upgrade/platform.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index 438cfdc613..871f29e902 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -108,7 +108,7 @@ tplink_do_upgrade() { nand_do_upgrade "$1" } -linksys_mx_do_upgrade() { +linksys_mx_pre_upgrade() { local setenv_script="/tmp/fw_env_upgrade" CI_UBIPART="rootfs" @@ -144,7 +144,6 @@ linksys_mx_do_upgrade() { return 1 } fi - nand_do_upgrade "$1" } platform_check_image() { @@ -213,13 +212,15 @@ platform_do_upgrade() { linksys,mx4200v1|\ linksys,mx4200v2|\ linksys,mx4300) + linksys_mx_pre_upgrade "$1" remove_oem_ubi_volume squashfs - linksys_mx_do_upgrade "$1" + nand_do_upgrade "$1" ;; linksys,mx5300|\ linksys,mx8500) + linksys_mx_pre_upgrade "$1" remove_oem_ubi_volume ubifs - linksys_mx_do_upgrade "$1" + nand_do_upgrade "$1" ;; prpl,haze|\ qnap,301w) From a8afcd8fc26fa7b348867f03ed3821167a9e68a8 Mon Sep 17 00:00:00 2001 From: Stefan Kalscheuer Date: Sat, 31 May 2025 17:07:40 +0200 Subject: [PATCH 31/87] mwlwifi: add pending patch to fix compilation with kernel 6.6.109+ Building against recent kernel versions (noticed with 6.12) and -Werror can fail because a macro MAX(a,b) is already defined in minmax.h or kernel.h before 5.10. Initially noticed on 6.12, but it now happens after the kernel bump to 6.6.109 as well (upstream commit 6183c65) In file included from ../mwlwifi-2025.02.06~db97edf2/hif/fwcmd.h:23, from ../mwlwifi-2025.02.06~db97edf2/core.c:25: ../mwlwifi-2025.02.06~db97edf2/hif/hostcmd.h:1124: error: "MAX" redefined [-Werror] 1124 | #define MAX(a, b) (((a) > (b)) ? (a) : (b)) | ^~~ In file included from usr/include/mac80211-backport/linux/minmax.h:4, from ./include/linux/kernel.h:27, from usr/include/mac80211-backport/linux/kernel.h:3, from ./include/linux/skbuff.h:13, from usr/include/mac80211-backport/linux/skbuff.h:3, from ./include/linux/if_ether.h:19, from usr/include/mac80211-backport/linux/if_ether.h:3, from ./include/linux/etherdevice.h:20, from usr/include/mac80211-backport/linux/etherdevice.h:3, from ../mwlwifi-2025.02.06~db97edf2/core.c:18: ./include/linux/minmax.h:315: note: this is the location of the previous definition 315 | #define MAX(a, b) __cmp(max, a, b) | ^~~ Add a pending upstream patch which replaces the MAX(a,b) macro to avoid conflicts and allow compilation with 6.12 backports (cherry picked from commit 822bceb1d12bdb08688051ead06e0c4462e7d123) Signed-off-by: Stefan Kalscheuer Link: https://github.com/openwrt/openwrt/pull/20420 Signed-off-by: Robert Marko --- package/kernel/mwlwifi/Makefile | 2 +- ...acro-to-avoid-conflict-with-kernel.h.patch | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 package/kernel/mwlwifi/patches/030-remove-MAX-a-b-macro-to-avoid-conflict-with-kernel.h.patch diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index 07c3acc5f9..38b1db439b 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwlwifi -PKG_RELEASE=1 +PKG_RELEASE=2 PKG_LICENSE:=ISC PKG_LICENSE_FILES:= diff --git a/package/kernel/mwlwifi/patches/030-remove-MAX-a-b-macro-to-avoid-conflict-with-kernel.h.patch b/package/kernel/mwlwifi/patches/030-remove-MAX-a-b-macro-to-avoid-conflict-with-kernel.h.patch new file mode 100644 index 0000000000..79bb0ebab6 --- /dev/null +++ b/package/kernel/mwlwifi/patches/030-remove-MAX-a-b-macro-to-avoid-conflict-with-kernel.h.patch @@ -0,0 +1,51 @@ +From 8c19700558b154b4898e49014b9a9725dabadddb Mon Sep 17 00:00:00 2001 +From: Stefan Kalscheuer +Date: Sat, 31 May 2025 16:52:23 +0200 +Subject: [PATCH] remove MAX(a,b) macro to avoid conflict with + kernel.h/minmax.h + +Building against recent kernel versions (noticed with 6.12) and -Werror +can fail because a macro MAX(a,b) is already defined in minmax.h or +kernel.h before 5.10. + +In file included from ../mwlwifi-2025.02.06~db97edf2/hif/fwcmd.h:23, + from ../mwlwifi-2025.02.06~db97edf2/core.c:25: +../mwlwifi-2025.02.06~db97edf2/hif/hostcmd.h:1124:9: error: "MAX" redefined [-Werror] + 1124 | #define MAX(a, b) (((a) > (b)) ? (a) : (b)) + | ^~~ +In file included from usr/include/mac80211-backport/linux/minmax.h:4, + from ./include/linux/kernel.h:28, + from usr/include/mac80211-backport/linux/kernel.h:3, + from ./include/linux/skbuff.h:13, + from usr/include/mac80211-backport/linux/skbuff.h:3, + from ./include/linux/if_ether.h:19, + from usr/include/mac80211-backport/linux/if_ether.h:3, + from ./include/linux/etherdevice.h:20, + from usr/include/mac80211-backport/linux/etherdevice.h:3, + from ../mwlwifi-2025.02.06~db97edf2/core.c:18: +./include/linux/minmax.h:330:9: note: this is the location of the previous definition + 330 | #define MAX(a,b) __cmp(max,a,b) + | ^~~ + +This macro is not used anywhere else but in the very next line, so +instead of adding conditionals, let's expand MAX_GROUP_PER_CHANNEL_RATE +and drop the definition of MAX. + +Signed-off-by: Stefan Kalscheuer +--- + hif/hostcmd.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/hif/hostcmd.h ++++ b/hif/hostcmd.h +@@ -1121,9 +1121,8 @@ struct hostcmd_cmd_get_fw_region_code_sc + #define HAL_TRPC_ID_MAX_SC4 32 + #define MAX_GROUP_PER_CHANNEL_5G 39 + #define MAX_GROUP_PER_CHANNEL_2G 21 +-#define MAX(a, b) (((a) > (b)) ? (a) : (b)) + #define MAX_GROUP_PER_CHANNEL_RATE \ +- MAX(MAX_GROUP_PER_CHANNEL_5G, MAX_GROUP_PER_CHANNEL_2G) ++ ((MAX_GROUP_PER_CHANNEL_5G > MAX_GROUP_PER_CHANNEL_2G) ? MAX_GROUP_PER_CHANNEL_5G : MAX_GROUP_PER_CHANNEL_2G) + + struct channel_power_tbl_sc4 { + u8 channel; From d8f764ce810c9adc0a4488438b6eac3283d1aa52 Mon Sep 17 00:00:00 2001 From: Timothy Feierabend Date: Tue, 14 Oct 2025 20:44:32 -0500 Subject: [PATCH 32/87] rockchip: backport pcie fix for rk3399 This patch resolves the LAN port not initializing on the FriendlyElec NanoPI R4S, especially during warm reboots. Upstream commit patch is based on: https://github.com/torvalds/linux/commit/c3fe7071e196e25789ecf90dbc9e8491a98884d7 I've experienced the LAN port failing to initialize from a cold boot and after a reboot. Other users have reported this issue on https://forum.openwrt.org/t/nanopi-r4s-rk3399-is-a-great-new-openwrt-device/79143. The NanoPI R4S has its LAN port connected to the RK3399 via PCIE. Since the PCIE lanes don't initialize correctly after reboot, the LAN port doesn't initialize. Signed-off-by: Timothy Feierabend Link: https://github.com/openwrt/openwrt/pull/20406 Signed-off-by: Nick Hainke (cherry picked from commit 7ef19bb9cd59f5018fc96b01a5465ed84038cfe8) Link: https://github.com/openwrt/openwrt/pull/20418 Signed-off-by: Robert Marko --- ...ie-Enable-all-four-lanes-if-required.patch | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 target/linux/rockchip/patches-6.6/032-06-v6.17-phy-rockchip-pcie-Enable-all-four-lanes-if-required.patch diff --git a/target/linux/rockchip/patches-6.6/032-06-v6.17-phy-rockchip-pcie-Enable-all-four-lanes-if-required.patch b/target/linux/rockchip/patches-6.6/032-06-v6.17-phy-rockchip-pcie-Enable-all-four-lanes-if-required.patch new file mode 100644 index 0000000000..de91ce1795 --- /dev/null +++ b/target/linux/rockchip/patches-6.6/032-06-v6.17-phy-rockchip-pcie-Enable-all-four-lanes-if-required.patch @@ -0,0 +1,50 @@ +From c3fe7071e196e25789ecf90dbc9e8491a98884d7 Mon Sep 17 00:00:00 2001 +From: Valmantas Paliksa +Date: Mon, 30 Jun 2025 19:25:14 -0300 +Subject: [PATCH] phy: rockchip-pcie: Enable all four lanes if required + +Current code enables only Lane 0 because pwr_cnt will be incremented on +first call to the function. Let's reorder the enablement code to enable +all 4 lanes through GRF. + +Reviewed-by: Neil Armstrong +Reviewed-by: Robin Murphy + +Signed-off-by: Valmantas Paliksa +Signed-off-by: Geraldo Nascimento +Reviewed-by: Robin Murphy +Reviewed-by: Neil Armstrong +Link: https://lore.kernel.org/r/16b610aab34e069fd31d9f57260c10df2a968f80.1751322015.git.geraldogabriel@gmail.com +Signed-off-by: Vinod Koul +--- + drivers/phy/rockchip/phy-rockchip-pcie.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/drivers/phy/rockchip/phy-rockchip-pcie.c ++++ b/drivers/phy/rockchip/phy-rockchip-pcie.c +@@ -165,6 +165,12 @@ static int rockchip_pcie_phy_power_on(st + + mutex_lock(&rk_phy->pcie_mutex); + ++ regmap_write(rk_phy->reg_base, ++ rk_phy->phy_data->pcie_laneoff, ++ HIWORD_UPDATE(!PHY_LANE_IDLE_OFF, ++ PHY_LANE_IDLE_MASK, ++ PHY_LANE_IDLE_A_SHIFT + inst->index)); ++ + if (rk_phy->pwr_cnt++) + goto err_out; + +@@ -179,12 +185,6 @@ static int rockchip_pcie_phy_power_on(st + PHY_CFG_ADDR_MASK, + PHY_CFG_ADDR_SHIFT)); + +- regmap_write(rk_phy->reg_base, +- rk_phy->phy_data->pcie_laneoff, +- HIWORD_UPDATE(!PHY_LANE_IDLE_OFF, +- PHY_LANE_IDLE_MASK, +- PHY_LANE_IDLE_A_SHIFT + inst->index)); +- + /* + * No documented timeout value for phy operation below, + * so we make it large enough here. And we use loop-break From 8a0b30db513fd4f15a83cf34628d3c5518a36ce7 Mon Sep 17 00:00:00 2001 From: Pawel Dembicki Date: Tue, 14 Oct 2025 11:36:01 +0200 Subject: [PATCH 33/87] mpc85xx: p1010: kernel: add missing symbol CONFIG_MTD_CFI was disabled in p1010 subtarget. It causes problem with Aerohive BR200-WP router. This patch enables CONFIG_MTD_CFI in p1010 config-default file. Fixes: e9dd6da91661 ("mpc85xx: p1010: add missing symbols") Signed-off-by: Pawel Dembicki Link: https://github.com/openwrt/openwrt/pull/20419 (cherry picked from commit f21e8158fbff16ede6ee814929dc0f2738c0c3c2) Link: https://github.com/openwrt/openwrt/pull/20428 Signed-off-by: Nick Hainke --- target/linux/mpc85xx/p1010/config-default | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/mpc85xx/p1010/config-default b/target/linux/mpc85xx/p1010/config-default index 22801b9c2b..69e2763c6f 100644 --- a/target/linux/mpc85xx/p1010/config-default +++ b/target/linux/mpc85xx/p1010/config-default @@ -14,6 +14,7 @@ CONFIG_GRO_CELLS=y CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y CONFIG_MEMORY=y +CONFIG_MTD_CFI=y CONFIG_MTD_NAND_FSL_IFC=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPLIT_TPLINK_FW=y From 4e81893953c8721aefc45e7053b85f20b621eaa8 Mon Sep 17 00:00:00 2001 From: Christoph Krapp Date: Tue, 14 Oct 2025 20:22:29 +0200 Subject: [PATCH 34/87] mediatek: filogic: add ASUS RT-AX52 factory-initramfs image generation This adds the required image receipt to generate a vendor ui compatible initramfs-factory image, that can be used to flash the final sysupgrade image. Signed-off-by: Christoph Krapp Link: https://github.com/openwrt/openwrt/pull/20409 Signed-off-by: Robert Marko --- target/linux/mediatek/image/Makefile | 5 +++++ target/linux/mediatek/image/filogic.mk | 3 +++ 2 files changed, 8 insertions(+) diff --git a/target/linux/mediatek/image/Makefile b/target/linux/mediatek/image/Makefile index d4f79ec974..668d9a8cb0 100644 --- a/target/linux/mediatek/image/Makefile +++ b/target/linux/mediatek/image/Makefile @@ -33,6 +33,11 @@ define Device/Default pad-rootfs | append-metadata endef +define Build/asus-trx + $(STAGING_DIR_HOST)/bin/asusuimage $(wordlist 1,$(words $(1)),$(1)) -i $@ -o $@.new + mv $@.new $@ +endef + include $(SUBTARGET).mk define Image/Build diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 6369586736..d062a47e4a 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -270,6 +270,9 @@ define Device/asus_rt-ax52 KERNEL_INITRAMFS := kernel-bin | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + ARTIFACTS := initramfs.trx + ARTIFACT/initramfs.trx := append-image-stage initramfs-kernel.bin | \ + uImage none | asus-trx -v 3 -n $$(DEVICE_MODEL) endef TARGET_DEVICES += asus_rt-ax52 From 9687d14c07d841b7f05bd13d15fb600e9bdff01b Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Fri, 17 Oct 2025 12:09:40 +0200 Subject: [PATCH 35/87] ipq-wifi: update to Git HEAD (2025-10-17) d818fb10428f qca4019: Add Meraki MR30H a1529e183333 qca4019: Add Meraki Z3 Signed-off-by: Robert Marko --- package/firmware/ipq-wifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 7608cfbf48..f939f65c89 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2025-10-14 -PKG_SOURCE_VERSION:=821d27b582c130ab65b7d20d0dfcbade7cdaf623 -PKG_MIRROR_HASH:=1e2959037baa5cfb24d931f9ad9b8f9a732d93810fce91a836ca7ed4d46ad7b0 +PKG_SOURCE_DATE:=2025-10-17 +PKG_SOURCE_VERSION:=a1529e183333e38bdc95dc8d9317b7af2bec0dcd +PKG_MIRROR_HASH:=30ce8f808424602cba556e106cb16080ef29d6d45a9d9018e04664598460eb2f PKG_FLAGS:=nonshared include $(INCLUDE_DIR)/package.mk From 1ba8af8c1cb902d62d48b650ffb91098d87494fe Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 36/87] vrx518_ep: fix compilation error with kernel 6.12 PCI_IRQ_LEGACY was renamed to PCI_IRQ_INTX for kernel 6.10. Fix compilation error: /home/db/owrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/vrx518_ep-2.1.0/ep.c:469:69: error: 'PCI_IRQ_LEGACY' undeclared (first use in this function); did you mean 'NR_IRQS_LEGACY'? 469 | err = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_MSI | PCI_IRQ_LEGACY); | ^~~~~~~~~~~~~~ | NR_IRQS_LEGACY Signed-off-by: Andre Heider Co-authored-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit e80dfdb6c5e2040e055bf14308af53da8792a596) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- .../lantiq/vrx518_ep/patches/100-compat.patch | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/package/kernel/lantiq/vrx518_ep/patches/100-compat.patch b/package/kernel/lantiq/vrx518_ep/patches/100-compat.patch index a139c7a862..3457779776 100644 --- a/package/kernel/lantiq/vrx518_ep/patches/100-compat.patch +++ b/package/kernel/lantiq/vrx518_ep/patches/100-compat.patch @@ -1,6 +1,14 @@ --- a/ep.c +++ b/ep.c -@@ -373,23 +373,23 @@ int dc_ep_dev_info_req(int dev_idx, enum +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #include "ep.h" + #include "aca.h" +@@ -373,23 +374,23 @@ int dc_ep_dev_info_req(int dev_idx, enum switch (module) { case DC_EP_INT_PPE: @@ -31,18 +39,22 @@ break; } -@@ -466,8 +466,8 @@ static int dc_ep_msi_enable(struct pci_d +@@ -466,8 +467,12 @@ static int dc_ep_msi_enable(struct pci_d return -EIO; } - err = pci_enable_msi_exact(pdev, nvec); - if (err) { ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)) + err = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_MSI | PCI_IRQ_LEGACY); ++#else ++ err = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_MSI | PCI_IRQ_INTX); ++#endif + if (err < 0) { dev_err(&pdev->dev, "%s: Failed to enable MSI interrupts error code: %d\n", __func__, err); -@@ -589,15 +589,15 @@ static int dc_ep_probe(struct pci_dev *p +@@ -589,15 +594,15 @@ static int dc_ep_probe(struct pci_dev *p /* Target structures have a limit of 32 bit DMA pointers. * DMA pointers can be wider than 32 bits by default on some systems. */ @@ -61,7 +73,7 @@ goto err_region; } -@@ -654,7 +654,7 @@ static int dc_ep_probe(struct pci_dev *p +@@ -654,7 +659,7 @@ static int dc_ep_probe(struct pci_dev *p goto err_iomap; spin_lock(&dc_ep_lock); @@ -70,7 +82,7 @@ spin_unlock(&dc_ep_lock); #ifndef CONFIG_OF -@@ -715,7 +715,7 @@ static void dc_ep_remove(struct pci_dev +@@ -715,7 +720,7 @@ static void dc_ep_remove(struct pci_dev dc_ep_icu_disable(priv); pci_iounmap(pdev, priv->mem); pci_release_region(pdev, DC_EP_BAR_NUM); From f2fa99a452c1d6ba2bcbe6e610c5124c7488746b Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 37/87] vrx518_ep: fix macro redefined build error on 6.12 kernel Add LANTIQ prefix to avoid name conflicts. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 8f80acfac027622ca88945c34067ea68aadc0faa) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...o-definition-conflicts-on-6.12-kerne.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 package/kernel/lantiq/vrx518_ep/patches/101-Fix-version-macro-definition-conflicts-on-6.12-kerne.patch diff --git a/package/kernel/lantiq/vrx518_ep/patches/101-Fix-version-macro-definition-conflicts-on-6.12-kerne.patch b/package/kernel/lantiq/vrx518_ep/patches/101-Fix-version-macro-definition-conflicts-on-6.12-kerne.patch new file mode 100644 index 0000000000..3b108e613b --- /dev/null +++ b/package/kernel/lantiq/vrx518_ep/patches/101-Fix-version-macro-definition-conflicts-on-6.12-kerne.patch @@ -0,0 +1,34 @@ +From: Shiji Yang +Date: Wed, 7 May 2025 19:16:16 +0800 +Subject: [PATCH] fix version macro definition conflicts on 6.12 kernel + +Add LANTIQ prefix to version variable names to fix: + +/home/db/owrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/vrx518_ep-2.1.0/ep.c:45:9: error: "MIN" redefined [-Werror] + 45 | #define MIN 1 + | ^~~ +./include/linux/minmax.h:329:9: note: this is the location of the previous definition + 329 | #define MIN(a,b) __cmp(min,a,b) + | ^~~ + +Signed-off-by: Shiji Yang +--- + ep.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/ep.c ++++ b/ep.c +@@ -42,10 +42,10 @@ + + #define DC_EP_DBG + +-#define MAJ 2 +-#define MIN 1 ++#define LANTIQ_MAJ 2 ++#define LANTIQ_MIN 1 + #define BUILD 0 +-#define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \ ++#define DRV_VERSION __stringify(LANTIQ_MAJ) "." __stringify(LANTIQ_MIN) "." \ + __stringify(BUILD) "-k" + + static bool pcie_switch_exist; From e8639f57c51c676f7a84fbbd632737ccdaf28438 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 38/87] ltq-ifxos: fix missing-prototypes build warning Add prototype definition for exported function IFX_Var_Fifo_getRoom(). Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit e9d3e0f1dacc8a8052db3e45562ca6c71a496f09) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...g-prototype-for-IFX_Var_Fifo_getRoom.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 package/kernel/lantiq/ltq-ifxos/patches/101-add-missing-prototype-for-IFX_Var_Fifo_getRoom.patch diff --git a/package/kernel/lantiq/ltq-ifxos/patches/101-add-missing-prototype-for-IFX_Var_Fifo_getRoom.patch b/package/kernel/lantiq/ltq-ifxos/patches/101-add-missing-prototype-for-IFX_Var_Fifo_getRoom.patch new file mode 100644 index 0000000000..0d35f63df3 --- /dev/null +++ b/package/kernel/lantiq/ltq-ifxos/patches/101-add-missing-prototype-for-IFX_Var_Fifo_getRoom.patch @@ -0,0 +1,26 @@ +From: Shiji Yang +Date: Wed, 7 May 2025 20:24:34 +0800 +Subject: [PATCH] add missing prototype for IFX_Var_Fifo_getRoom() + +Fix build warning on 6.12 kernel: + +/home/db/owrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/ifxos-ugw_8.5.2.10/src/common/ifx_fifo.c:532:14: error: no previous prototype for 'IFX_Var_Fifo_getRoom' [-Werror=missing-prototypes] + 532 | IFX_uint32_t IFX_Var_Fifo_getRoom (IFX_VFIFO *pFifo) + | ^~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Shiji Yang +--- + src/include/ifx_fifo.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/src/include/ifx_fifo.h ++++ b/src/include/ifx_fifo.h +@@ -104,6 +104,8 @@ extern IFX_int8_t IFX_Var_Fifo_isFull + IFX_VFIFO *pFifo); + extern IFX_uint32_t IFX_Var_Fifo_getCount( + IFX_VFIFO *pFifo); ++extern IFX_uint32_t IFX_Var_Fifo_getRoom( ++ IFX_VFIFO *pFifo); + + #ifdef __cplusplus + } From 73571ef4f4adf895d11e90e8b021ecdcbfe7198b Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 39/87] ltq-vdsl-vr11-mei: fix missing-prototypes build warnings Add prototype definition for exported function ifx_mei_atm_led_blink(). Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit eb18b602da639577573930fd4e800ed716928b4f) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...-prototype-for-ifx_mei_atm_led_blink.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/132-add-missing-prototype-for-ifx_mei_atm_led_blink.patch diff --git a/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/132-add-missing-prototype-for-ifx_mei_atm_led_blink.patch b/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/132-add-missing-prototype-for-ifx_mei_atm_led_blink.patch new file mode 100644 index 0000000000..e2f77ba75b --- /dev/null +++ b/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/132-add-missing-prototype-for-ifx_mei_atm_led_blink.patch @@ -0,0 +1,24 @@ +From: Shiji Yang +Date: Wed, 7 May 2025 21:57:39 +0800 +Subject: [PATCH] add missing prototype for ifx_mei_atm_led_blink() + +Fix build warning on 6.12 kernel: +/home/db/owrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_api_atm_ptm_intern.c:658:5: error: no previous prototype for 'ifx_mei_atm_led_blink' [-Werror=missing-prototypes] + 658 | int ifx_mei_atm_led_blink(void) + | ^~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Shiji Yang +--- + src/drv_mei_cpe_api_atm_ptm_intern.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/src/drv_mei_cpe_api_atm_ptm_intern.h ++++ b/src/drv_mei_cpe_api_atm_ptm_intern.h +@@ -91,6 +91,7 @@ extern IFX_int32_t MEI_InternalLineTCMod + IFX_int8_t nInstance, + IFX_boolean_t bPowerUp, + IFX_boolean_t bKillMEIControlThread); ++int ifx_mei_atm_led_blink(void); + + #ifdef PPA_SUPPORTS_CALLBACKS + extern int ppa_callback_set(e_ltq_mei_cb_type type, void *func); From e59f6aff5542a996a935c6402bce0cf1f1d33a85 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 40/87] ltq-vdsl-vr11-mei: improve compatibility with the 6.12 kernel. Convert .remove to .remove_new so that it can be compatible with both 6.6 and 6.12 kernels. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 0d045a287afedaa1630aaf1b6853b599cec459ee) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...atform-driver-.remove-to-.remove_new.patch | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/133-convert-platform-driver-.remove-to-.remove_new.patch diff --git a/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/133-convert-platform-driver-.remove-to-.remove_new.patch b/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/133-convert-platform-driver-.remove-to-.remove_new.patch new file mode 100644 index 0000000000..0ad2ab72b0 --- /dev/null +++ b/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/133-convert-platform-driver-.remove-to-.remove_new.patch @@ -0,0 +1,43 @@ +From: Shiji Yang +Date: Wed, 7 May 2025 22:07:16 +0800 +Subject: [PATCH] convert platform driver .remove to .remove_new + +Fix build error on 6.12 kernel: + +/home/db/owrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_linux.c:2270:14: error: initialization of 'void (*)(struct platform_device *)' from incompatible pointer type 'int (*)(struct platform_device *)' [-Wincompatible-pointer-types] + 2270 | .remove = ltq_dsl_cpe_mei_remove, + | ^~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Shiji Yang +--- + src/drv_mei_cpe_linux.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/src/drv_mei_cpe_linux.c ++++ b/src/drv_mei_cpe_linux.c +@@ -2234,7 +2234,7 @@ static int dev_found = 0; + /* containt the number of devices registered in module_init */ + static int dev_registered = 0; + +-static int ltq_dsl_cpe_mei_remove(struct platform_device *pdev) ++static void ltq_dsl_cpe_mei_remove(struct platform_device *pdev) + { + /* clear platform */ + MEI_DEVICE_CFG_VALUE_SET(platform, e_MEI_DEV_PLATFORM_CONFIG_UNKNOWN); +@@ -2244,7 +2244,6 @@ static int ltq_dsl_cpe_mei_remove(struct + dev_registered--; + } + #endif +- return 0; + } + + static const struct of_device_id ltq_dsl_cpe_mei_match[] = { +@@ -2267,7 +2266,7 @@ static struct platform_driver ltq_dsl_cp + .owner = THIS_MODULE, + .of_match_table = ltq_dsl_cpe_mei_match, + }, +- .remove = ltq_dsl_cpe_mei_remove, ++ .remove_new = ltq_dsl_cpe_mei_remove, + }; + + static int ltq_dsl_cpe_mei_reboot_notifier(struct notifier_block *nb, From 7ddd410a9c100d428ffb81f4082b82ae057e9484 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 41/87] ltq-vdsl-vr11-mei: fix ignored-qualifiers build warnings These functions return the register memory addresses. Usually they are fixed values, hence I think it's safe to remove the qualifier "volatile". Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit c3cb6a8725c8bd4c4948854bf54f5683d9d741b7) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...fix-ignored-qualifiers-build-warning.patch | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/134-fix-ignored-qualifiers-build-warning.patch diff --git a/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/134-fix-ignored-qualifiers-build-warning.patch b/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/134-fix-ignored-qualifiers-build-warning.patch new file mode 100644 index 0000000000..87bd38a08d --- /dev/null +++ b/package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/134-fix-ignored-qualifiers-build-warning.patch @@ -0,0 +1,50 @@ +From: Shiji Yang +Date: Wed, 7 May 2025 22:53:48 +0800 +Subject: [PATCH] fix ignored-qualifiers build warnings + +This patch fixes the following build warnings: + +/home/db/owrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_mei_access_vrx.c:41:15: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers] + 41 | static inline volatile IFX_uint32_t MEI_RCU_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) + | ^~~~~~~~ +/home/db/owrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_mei_access_vrx.c:55:15: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers] + 55 | static inline volatile IFX_uint32_t MEI_CGU_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) + | ^~~~~~~~ +/home/db/owrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_mei_access_vrx.c:63:15: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers] + 63 | static inline volatile IFX_uint32_t MEI_RCU_Slave_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) + | ^~~~~~~~ + +Signed-off-by: Shiji Yang +--- + src/drv_mei_cpe_mei_access_vrx.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/src/drv_mei_cpe_mei_access_vrx.c ++++ b/src/drv_mei_cpe_mei_access_vrx.c +@@ -38,7 +38,7 @@ + Local macro definition + ========================================================================= */ + +-static inline volatile IFX_uint32_t MEI_RCU_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) ++static inline IFX_uint32_t MEI_RCU_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) + { + IFX_uint32_t ret = 0; + if (MEI_DEVICE_CFG_IS_PLATFORM(e_MEI_DEV_PLATFORM_CONFIG_VR9)) +@@ -52,7 +52,7 @@ static inline volatile IFX_uint32_t MEI_ + return ret; + } + #if (MEI_SUPPORT_DEVICE_VR11 == 1) +-static inline volatile IFX_uint32_t MEI_CGU_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) ++static inline IFX_uint32_t MEI_CGU_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) + { + IFX_uint32_t ret = 0; + ret = (MEI_DRV_PCIE_VIRT_MEMBASE_GET(pMeiDrvCntrl) | MEI_CGU_OFFSET); +@@ -60,7 +60,7 @@ static inline volatile IFX_uint32_t MEI_ + } + #endif + +-static inline volatile IFX_uint32_t MEI_RCU_Slave_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) ++static inline IFX_uint32_t MEI_RCU_Slave_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) + { + IFX_uint32_t ret = 0; + if (MEI_DEVICE_CFG_IS_PLATFORM(e_MEI_DEV_PLATFORM_CONFIG_VR9)) From 406efebc5a9eb5ea522394bf1b744ccaee06295b Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 42/87] ltq-vdsl-vr11: fix missing-prototypes build warnings * Mark some functions as static. * Include function prototypes header file. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit b219c749b723821b96dc181a17240ab943744b95) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- .../301-fix-missing-prototypes-warnings.patch | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 package/kernel/lantiq/ltq-vdsl-vr11/patches/301-fix-missing-prototypes-warnings.patch diff --git a/package/kernel/lantiq/ltq-vdsl-vr11/patches/301-fix-missing-prototypes-warnings.patch b/package/kernel/lantiq/ltq-vdsl-vr11/patches/301-fix-missing-prototypes-warnings.patch new file mode 100644 index 0000000000..609ebbc72e --- /dev/null +++ b/package/kernel/lantiq/ltq-vdsl-vr11/patches/301-fix-missing-prototypes-warnings.patch @@ -0,0 +1,172 @@ +From: Shiji Yang +Date: Wed, 7 May 2025 23:22:11 +0800 +Subject: [PATCH] fix missing prototypes warnings + +This patch fixes various missing-prototypes build warnings on +6.12 kernel. + +Signed-off-by: Shiji Yang +--- + src/bnd/drv_dsl_cpe_api_bnd_vrx.c | 2 +- + src/common/drv_dsl_cpe_api.c | 16 ++++++++-------- + src/common/drv_dsl_cpe_os_linux.c | 4 ++-- + src/device/drv_dsl_cpe_device_vrx.c | 2 +- + src/g997/drv_dsl_cpe_api_g997_vrx.c | 1 + + src/include/drv_dsl_cpe_intern.h | 6 +++--- + 6 files changed, 16 insertions(+), 15 deletions(-) + +--- a/src/bnd/drv_dsl_cpe_api_bnd_vrx.c ++++ b/src/bnd/drv_dsl_cpe_api_bnd_vrx.c +@@ -75,7 +75,7 @@ static DSL_Error_t DSL_DRV_BND_VRX_HsCon + - DSL_SUCCESS in case of success + - DSL_ERROR if operation failed + */ +-DSL_Error_t DSL_DRV_BND_VRX_PafHsStatusGet( ++static DSL_Error_t DSL_DRV_BND_VRX_PafHsStatusGet( + DSL_Context_t *pContext, + DSL_BND_VRX_PafHsStatus_t *pData) + { +--- a/src/common/drv_dsl_cpe_api.c ++++ b/src/common/drv_dsl_cpe_api.c +@@ -3873,7 +3873,7 @@ DSL_Error_t DSL_DRV_LoopLengthStatusGet( + return nErrCode; + } + +-DSL_Error_t DSL_DRV_RetxStatisticsGet( ++static DSL_Error_t DSL_DRV_RetxStatisticsGet( + DSL_IN DSL_Context_t *pContext, + DSL_IN_OUT DSL_ReTxStatistics_t *pData) + { +@@ -4053,7 +4053,7 @@ DSL_Error_t DSL_DRV_SystemInterfaceConfi + \ref DSL_FIO_SYSTEM_INTERFACE_STATUS_GET + */ + #ifdef INCLUDE_DSL_SYSTEM_INTERFACE +-DSL_Error_t DSL_DRV_SystemInterfaceStatusGet( ++static DSL_Error_t DSL_DRV_SystemInterfaceStatusGet( + DSL_Context_t *pContext, + DSL_SystemInterfaceStatus_t *pData) + { +@@ -5593,7 +5593,7 @@ DSL_Error_t DSL_DRV_DBG_DebugFeatureConf + #endif /* DSL_DEBUG_DISABLE*/ + + #ifdef INCLUDE_DSL_FILTER_DETECTION +-DSL_Error_t DSL_DRV_FilterDetectionDataGet( ++static DSL_Error_t DSL_DRV_FilterDetectionDataGet( + DSL_IN DSL_Context_t *pContext, + DSL_OUT DSL_FilterDetection_t *pData) + { +@@ -5742,7 +5742,7 @@ DSL_Error_t DSL_DRV_FilterDetectionBasic + } + #endif /* INCLUDE_DSL_FILTER_DETECTION */ + +-DSL_Error_t DSL_DRV_HybridSelectionDataGet( ++static DSL_Error_t DSL_DRV_HybridSelectionDataGet( + DSL_IN DSL_Context_t *pContext, + DSL_OUT DSL_HybridSelection_t *pData) + { +@@ -5804,7 +5804,7 @@ DSL_Error_t DSL_DRV_HybridSelectionDataG + return nErrCode; + } + +-DSL_Error_t DSL_DRV_OlrStatisticsGet( ++static DSL_Error_t DSL_DRV_OlrStatisticsGet( + DSL_IN DSL_Context_t *pContext, + DSL_OUT DSL_OlrStatistics_t *pData) + { +@@ -5932,7 +5932,7 @@ DSL_void_t DSL_DRV_InitDataFree( + #endif /* INCLUDE_DSL_INIT_DATA_PREPARE*/ + } + +-DSL_Error_t DSL_DRV_IoctlHandleHelperCall( ++static DSL_Error_t DSL_DRV_IoctlHandleHelperCall( + DSL_OpenContext_t *pOpenCtx, + DSL_Context_t *pContext, + DSL_boolean_t bIsInKernel, +@@ -6573,7 +6573,7 @@ DSL_Error_t DSL_DRV_T1413_XTUR_VendorRev + return nErrCode; + } + +-DSL_Error_t DSL_DRV_PSDCalibrationConfigGet( ++static DSL_Error_t DSL_DRV_PSDCalibrationConfigGet( + DSL_IN DSL_Context_t *pContext, + DSL_IN_OUT DSL_PSDCalibration_t *pData) + { +@@ -6608,7 +6608,7 @@ DSL_Error_t DSL_DRV_PSDCalibrationConfig + return nErrCode; + } + +-DSL_Error_t DSL_DRV_PSDCalibrationConfigSet( ++static DSL_Error_t DSL_DRV_PSDCalibrationConfigSet( + DSL_IN DSL_Context_t *pContext, + DSL_IN_OUT DSL_PSDCalibration_t *pData) + { +--- a/src/common/drv_dsl_cpe_os_linux.c ++++ b/src/common/drv_dsl_cpe_os_linux.c +@@ -1341,7 +1341,7 @@ static void DSL_DRV_NlSendMsg(DSL_char_t + #endif + + /* Entry point of driver */ +-int __init DSL_ModuleInit(void) ++static int __init DSL_ModuleInit(void) + { + DSL_int_t i; + +@@ -1457,7 +1457,7 @@ void DSL_ModuleCleanup(void) + return; + } + +-void __exit DSL_ModuleExit(void) ++static void __exit DSL_ModuleExit(void) + { + printk("DSL: Unloading module" DSL_DRV_CRLF); + +--- a/src/device/drv_dsl_cpe_device_vrx.c ++++ b/src/device/drv_dsl_cpe_device_vrx.c +@@ -6914,7 +6914,7 @@ DSL_Error_t DSL_DRV_VRX_ShowtimeMeasurem + return nErrCode; + } + +-DSL_Error_t DSL_DRV_VRX_ShowtimeBasicMFDMeasurementUpdate(DSL_Context_t *pContext) ++static DSL_Error_t DSL_DRV_VRX_ShowtimeBasicMFDMeasurementUpdate(DSL_Context_t *pContext) + { + DSL_Error_t nErrCode = DSL_SUCCESS; + ACK_MFD_InitResultsGet_t sInitResultAck = { 0 }; +--- a/src/g997/drv_dsl_cpe_api_g997_vrx.c ++++ b/src/g997/drv_dsl_cpe_api_g997_vrx.c +@@ -11,6 +11,7 @@ + #define DSL_INTERN + + #include "drv_dsl_cpe_api.h" ++#include "drv_dsl_cpe_device_g997.h" + + #ifdef INCLUDE_DSL_CPE_API_VRX + +--- a/src/include/drv_dsl_cpe_intern.h ++++ b/src/include/drv_dsl_cpe_intern.h +@@ -1151,7 +1151,7 @@ DSL_Error_t DSL_DRV_InteropFeatureConfig + For a detailed description please refer to the equivalent ioctl + \ref DSL_FIO_RETX_STATISTICS_GET + */ +-#ifdef INCLUDE_DSL_CPE_API_DANUBE ++#if defined(INCLUDE_DSL_CPE_API_DANUBE) && 0 + #ifndef SWIG_TMP + DSL_Error_t DSL_DRV_RetxStatisticsGet( + DSL_IN DSL_Context_t *pContext, +@@ -1436,7 +1436,7 @@ DSL_Error_t DSL_DRV_SystemInterfaceConfi + For a detailed description please refer to the equivalent ioctl + \ref DSL_FIO_FILTER_DETECTION_DATA_GET + */ +-#if defined(INCLUDE_DSL_CPE_API_DANUBE) && defined(INCLUDE_DSL_FILTER_DETECTION) ++#if defined(INCLUDE_DSL_CPE_API_DANUBE) && defined(INCLUDE_DSL_FILTER_DETECTION) && 0 + #ifndef SWIG_TMP + DSL_Error_t DSL_DRV_FilterDetectionDataGet( + DSL_IN DSL_Context_t *pContext, +@@ -1462,7 +1462,7 @@ DSL_Error_t DSL_DRV_FilterDetectionBasic + For a detailed description please refer to the equivalent ioctl + \ref DSL_FIO_HYBRID_SELECTION_DATA_GET + */ +-#ifdef INCLUDE_DSL_CPE_API_DANUBE ++#if defined(INCLUDE_DSL_CPE_API_DANUBE) && 0 + #ifndef SWIG_TMP + DSL_Error_t DSL_DRV_HybridSelectionDataGet( + DSL_IN DSL_Context_t *pContext, From d136e3ca07edeada90e500e4ed25eaefc3c2092e Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 43/87] vrx518_tc: fix missing-prototypes build warnings * Mark some functions as static. * Include function prototypes header file. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit f6e7225039d953529fdba71405f476040d56c24a) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...-allow-larger-mtu-to-support-rfc4638.patch | 6 +- .../300-fix-missing-prototypes-warnings.patch | 66 +++++++++++++++++++ 2 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 package/kernel/lantiq/vrx518_tc/patches/300-fix-missing-prototypes-warnings.patch diff --git a/package/kernel/lantiq/vrx518_tc/patches/206-dcdp-ptm_tc-allow-larger-mtu-to-support-rfc4638.patch b/package/kernel/lantiq/vrx518_tc/patches/206-dcdp-ptm_tc-allow-larger-mtu-to-support-rfc4638.patch index 35a709e9fa..54a21187ff 100644 --- a/package/kernel/lantiq/vrx518_tc/patches/206-dcdp-ptm_tc-allow-larger-mtu-to-support-rfc4638.patch +++ b/package/kernel/lantiq/vrx518_tc/patches/206-dcdp-ptm_tc-allow-larger-mtu-to-support-rfc4638.patch @@ -22,9 +22,9 @@ Signed-off-by: Andrew MacIntyre dcdp/ptm_tc.c | 1 + 1 file changed, 1 insertion(+) ---- a/dcdp/ptm_tc.c 2023-12-17 16:11:22.503500398 +1100 -+++ b/dcdp/ptm_tc.c 2024-01-26 16:48:49.881623474 +1100 -@@ -657,6 +657,7 @@ static void ptm_setup(struct net_device +--- a/dcdp/ptm_tc.c ++++ b/dcdp/ptm_tc.c +@@ -666,6 +666,7 @@ static void ptm_setup(struct net_device ether_setup(dev); dev->watchdog_timeo = 10 * HZ; dev->netdev_ops = &g_ptm_netdev_ops; diff --git a/package/kernel/lantiq/vrx518_tc/patches/300-fix-missing-prototypes-warnings.patch b/package/kernel/lantiq/vrx518_tc/patches/300-fix-missing-prototypes-warnings.patch new file mode 100644 index 0000000000..562e349786 --- /dev/null +++ b/package/kernel/lantiq/vrx518_tc/patches/300-fix-missing-prototypes-warnings.patch @@ -0,0 +1,66 @@ +From: Shiji Yang +Date: Thu, 8 May 2025 7:43:51 +0800 +Subject: [PATCH] fix missing prototypes warnings + +This patch fixes various missing-prototypes build warnings on +6.12 kernel. + +Signed-off-by: Shiji Yang +--- + dcdp/atm_tc.c | 2 +- + dcdp/inc/platform.h | 1 + + dcdp/platform/sw_plat.c | 1 + + dcdp/tc_proc.c | 4 ++-- + 4 files changed, 5 insertions(+), 3 deletions(-) + +--- a/dcdp/atm_tc.c ++++ b/dcdp/atm_tc.c +@@ -279,7 +279,7 @@ unsigned int find_vpi(unsigned int vpi) + * success: 0 + * failed: -1 + */ +-unsigned int find_vpivci_from_queue_id( ++static unsigned int find_vpivci_from_queue_id( + unsigned int queue_id, + unsigned int *vpi, + unsigned int *vci) +--- a/dcdp/inc/platform.h ++++ b/dcdp/inc/platform.h +@@ -20,6 +20,7 @@ + the file called "COPYING". + + *******************************************************************************/ ++struct tc_priv; + extern size_t plat_priv_sz(void); + extern int platform_init(struct tc_priv *, const char *); + extern void platform_exit(void); +--- a/dcdp/platform/sw_plat.c ++++ b/dcdp/platform/sw_plat.c +@@ -38,6 +38,7 @@ + #include + #include "../inc/dsl_tc.h" + ++#include "../inc/platform.h" + #include "../inc/tc_main.h" + #include "../inc/reg_addr.h" + #include "../inc/tc_common.h" +--- a/dcdp/tc_proc.c ++++ b/dcdp/tc_proc.c +@@ -1945,7 +1945,7 @@ static void fwdbg_help(struct tc_comm *p + if (!cmds[i].cmd) + fwdbg_help(priv, NULL, 0, result); + } +-int fw_dbg_start(struct tc_comm *priv, ++static int fw_dbg_start(struct tc_comm *priv, + char *commands[], int num, char *result) + { + int i; +@@ -1964,7 +1964,7 @@ int fw_dbg_start(struct tc_comm *priv, + return 0; + } + +-ssize_t proc_write_fwdbg_seq( ++static ssize_t proc_write_fwdbg_seq( + struct file *file, + const char __user *buf, + size_t count, From 7d9670039d0236c1604c19e3f7e40c50f34a6ddf Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 44/87] ltq-tapi: fix missing-prototypes build warnings Mark some functions as static. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit e130308299da810dfba46e04458d2845ca7df278) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- .../616-fix-missing-prototypes-warnings.patch | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 package/kernel/lantiq/ltq-tapi/patches/616-fix-missing-prototypes-warnings.patch diff --git a/package/kernel/lantiq/ltq-tapi/patches/616-fix-missing-prototypes-warnings.patch b/package/kernel/lantiq/ltq-tapi/patches/616-fix-missing-prototypes-warnings.patch new file mode 100644 index 0000000000..c0ecb42116 --- /dev/null +++ b/package/kernel/lantiq/ltq-tapi/patches/616-fix-missing-prototypes-warnings.patch @@ -0,0 +1,56 @@ +From: Shiji Yang +Date: Thu, 8 May 2025 23:30:39 +0800 +Subject: [PATCH] fix missing prototypes warnings + +This patch fixes various missing-prototypes build warnings on +6.12 kernel: + +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_tapi-3.13.0/src/drv_tapi_event.c:2815:13: error: no previous prototype for 'IFX_TAPI_EventWrpBufferPool_ElementCountGet' [-Werror=missing-prototypes] + 2815 | IFX_int32_t IFX_TAPI_EventWrpBufferPool_ElementCountGet(IFX_void_t) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_tapi-3.13.0/src/drv_tapi_event.c:2844:13: error: no previous prototype for 'IFX_TAPI_EventWrpBufferPool_ElementAvailCountGet' [-Werror=missing-prototypes] + 2844 | IFX_int32_t IFX_TAPI_EventWrpBufferPool_ElementAvailCountGet(IFX_void_t) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_tapi-3.13.0/src/drv_tapi_fxo.c:145:13: error: no previous prototype for 'TAPI_FXO_DAA_Ioctl' [-Werror=missing-prototypes] + 145 | IFX_int32_t TAPI_FXO_DAA_Ioctl (TAPI_CHANNEL *pChannel, + | ^~~~~~~~~~~~~~~~~~ +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_tapi-3.13.0/src/drv_tapi_fxo.c:291:13: error: no previous prototype for 'TAPI_FXO_SmartSlic_Ioctl' [-Werror=missing-prototypes] + 291 | IFX_int32_t TAPI_FXO_SmartSlic_Ioctl(TAPI_CHANNEL *pChannel, + | ^~~~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Shiji Yang +--- + src/drv_tapi_event.h | 3 +++ + src/drv_tapi_fxo.c | 4 ++-- + 2 files changed, 5 insertions(+), 2 deletions(-) + +--- a/src/drv_tapi_event.h ++++ b/src/drv_tapi_event.h +@@ -24,4 +24,7 @@ + #define IFX_EVENT_DISABLE 1 + #define IFX_EVENT_ENABLE 0 + ++IFX_int32_t IFX_TAPI_EventWrpBufferPool_ElementCountGet(IFX_void_t); ++IFX_int32_t IFX_TAPI_EventWrpBufferPool_ElementAvailCountGet(IFX_void_t); ++ + #endif /* _DRV_TAPIEVENT_H */ +--- a/src/drv_tapi_fxo.c ++++ b/src/drv_tapi_fxo.c +@@ -142,7 +142,7 @@ IFX_return_t IFX_TAPI_FXO_Event_Dispatch + \remarks + This function is called if DAA TAPI plugin is used for FXO handling. + */ +-IFX_int32_t TAPI_FXO_DAA_Ioctl (TAPI_CHANNEL *pChannel, ++static IFX_int32_t TAPI_FXO_DAA_Ioctl (TAPI_CHANNEL *pChannel, + IFX_uint32_t cmd, + IFX_ulong_t arg) + { +@@ -288,7 +288,7 @@ IFX_int32_t TAPI_FXO_DAA_Ioctl (TAPI_CHA + This function is called if LL driver is used for FXO ioctl handling. + Used on systems which have SmartSLIC with fused FXO line(s). + */ +-IFX_int32_t TAPI_FXO_SmartSlic_Ioctl(TAPI_CHANNEL *pChannel, ++static IFX_int32_t TAPI_FXO_SmartSlic_Ioctl(TAPI_CHANNEL *pChannel, + IFX_uint32_t cmd, + IFX_ulong_t arg) + { From af8fc7ceabfe204a03386acf820b76e35d0bfee6 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 45/87] ltq-atm: apply local patch to the source files This package is maintained by the OpenWrt local repository. There is no need to modify it with the patch file. Just apply all patches to the source files. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 491764f0f07dc601e1671940d3d3ae41801ae736) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- .../100-ltq_atm-fix-compillation-warning.patch | 12 ------------ package/kernel/lantiq/ltq-atm/src/ltq_atm.c | 3 ++- 2 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 package/kernel/lantiq/ltq-atm/patches/100-ltq_atm-fix-compillation-warning.patch diff --git a/package/kernel/lantiq/ltq-atm/patches/100-ltq_atm-fix-compillation-warning.patch b/package/kernel/lantiq/ltq-atm/patches/100-ltq_atm-fix-compillation-warning.patch deleted file mode 100644 index c74cfcb6b4..0000000000 --- a/package/kernel/lantiq/ltq-atm/patches/100-ltq_atm-fix-compillation-warning.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/ltq_atm.c -+++ b/ltq_atm.c -@@ -338,7 +338,8 @@ static int ppe_ioctl(struct atm_dev *dev - break; - - case PPE_ATM_MIB_VCC: /* VCC related MIB */ -- copy_from_user(&mib_vcc, arg, sizeof(mib_vcc)); -+ if (copy_from_user(&mib_vcc, arg, sizeof(mib_vcc))) -+ return -EFAULT; - conn = find_vpivci(mib_vcc.vpi, mib_vcc.vci); - if (conn >= 0) { - mib_vcc.mib_vcc.aal5VccCrcErrors = g_atm_priv_data.conn[conn].aal5_vcc_crc_err; diff --git a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c index 6b1e0321b3..dc2361be75 100644 --- a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c +++ b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c @@ -338,7 +338,8 @@ static int ppe_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg) break; case PPE_ATM_MIB_VCC: /* VCC related MIB */ - copy_from_user(&mib_vcc, arg, sizeof(mib_vcc)); + if (copy_from_user(&mib_vcc, arg, sizeof(mib_vcc))) + return -EFAULT; conn = find_vpivci(mib_vcc.vpi, mib_vcc.vci); if (conn >= 0) { mib_vcc.mib_vcc.aal5VccCrcErrors = g_atm_priv_data.conn[conn].aal5_vcc_crc_err; From 37af07700a691d84c96a7adf412769eb7d0cac6b Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 46/87] ltq-atm: add missing header mod_devicetable.h fix undefined type error: /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ltq-atm-vr9/ltq-atm/ltq_atm.c:1776:43: error: invalid use of undefined type 'const struct of_device_id' 1776 | ops = (struct ltq_atm_ops *) match->data; | ^~ Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 02e9f3be51c9ec8551263ce6306c34ece5288a55) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- package/kernel/lantiq/ltq-atm/src/ltq_atm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c index dc2361be75..3bc9a0769d 100644 --- a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c +++ b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include From b5884358b00457d5a26108be31bfc59d9260766a Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 47/87] ltq-atm: fix build warnings on lantiq/xway Mark some functions as static to fix various missing-prototypes build warnings on 6.12 kernel. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit ac18f03bd97c85ece73503115f2b9ac7de3b63e3) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c | 10 +++++----- package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c index d786557682..b1e911915e 100644 --- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c +++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c @@ -185,7 +185,7 @@ static inline int pp32_download_code(u32 *code_src, unsigned int code_dword_len, return 0; } -void ar9_fw_ver(unsigned int *major, unsigned int *minor) +static void ar9_fw_ver(unsigned int *major, unsigned int *minor) { ASSERT(major != NULL, "pointer is NULL"); ASSERT(minor != NULL, "pointer is NULL"); @@ -194,7 +194,7 @@ void ar9_fw_ver(unsigned int *major, unsigned int *minor) *minor = FW_VER_ID->minor; } -int ar9_init(struct platform_device *pdev) +static int ar9_init(struct platform_device *pdev) { init_pmu(); reset_ppe(pdev); @@ -205,7 +205,7 @@ int ar9_init(struct platform_device *pdev) return 0; } -void ar9_shutdown(void) +static void ar9_shutdown(void) { ltq_pmu_disable(IFX_PMU_MODULE_PPE_SLL01 | IFX_PMU_MODULE_PPE_TC | @@ -215,7 +215,7 @@ void ar9_shutdown(void) IFX_PMU_MODULE_DSL_DFE); } -int ar9_start(int pp32) +static int ar9_start(int pp32) { int ret; @@ -231,7 +231,7 @@ int ar9_start(int pp32) return 0; } -void ar9_stop(int pp32) +static void ar9_stop(int pp32) { IFX_REG_W32(DBG_CTRL_STOP, PP32_DBG_CTRL(0)); } diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c index 3ff21fa03e..d32e888272 100644 --- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c +++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c @@ -198,7 +198,7 @@ static void danube_shutdown(void) { } -int danube_start(int pp32) +static int danube_start(int pp32) { int ret; @@ -218,7 +218,7 @@ int danube_start(int pp32) return 0; } -void danube_stop(int pp32) +static void danube_stop(int pp32) { IFX_REG_W32(DBG_CTRL_STOP_SET(1), PP32_DBG_CTRL); } From 95edff3cc38c0e10f1790cdd250360bfdd97de70 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 48/87] ltq-atm: fix missing-prototypes warnings for lantiq/ase This patch fixes various missing-prototypes build warnings on 6.12 kernel. /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_ase/ltq-atm-ase/ltq-atm/ifxmips_atm_amazon_se.c:257:13: error: no previous prototype for 'ase_fw_ver' [-Werror=missing-prototypes] 257 | extern void ase_fw_ver(unsigned int *major, unsigned int *minor) | ^~~~~~~~~~ /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_ase/ltq-atm-ase/ltq-atm/ifxmips_atm_amazon_se.c:266:5: error: no previous prototype for 'ase_init' [-Werror=missing-prototypes] 266 | int ase_init(struct platform_device *pdev) | ^~~~~~~~ /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_ase/ltq-atm-ase/ltq-atm/ifxmips_atm_amazon_se.c:283:6: error: no previous prototype for 'ase_shutdown' [-Werror=missing-prototypes] 283 | void ase_shutdown(void) | ^~~~~~~~~~~~ /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_ase/ltq-atm-ase/ltq-atm/ifxmips_atm_amazon_se.c:297:5: error: no previous prototype for 'ase_start' [-Werror=missing-prototypes] 297 | int ase_start(int pp32) | ^~~~~~~~~ /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_ase/ltq-atm-ase/ltq-atm/ifxmips_atm_amazon_se.c:323:6: error: no previous prototype for 'ase_stop' [-Werror=missing-prototypes] 323 | void ase_stop(int pp32) | ^~~~~~~~ Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit e839da1911c6988783096a64fd1e5beb3b3beb31) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- .../kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c index 0c6d9c101a..c51f34dda3 100644 --- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c +++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c @@ -254,7 +254,7 @@ static inline int pp32_download_code(u32 *code_src, unsigned int code_dword_len, * #################################### */ -extern void ase_fw_ver(unsigned int *major, unsigned int *minor) +static void ase_fw_ver(unsigned int *major, unsigned int *minor) { ASSERT(major != NULL, "pointer is NULL"); ASSERT(minor != NULL, "pointer is NULL"); @@ -263,7 +263,7 @@ extern void ase_fw_ver(unsigned int *major, unsigned int *minor) *minor = FW_VER_ID->minor; } -int ase_init(struct platform_device *pdev) +static int ase_init(struct platform_device *pdev) { init_pmu(); @@ -280,7 +280,7 @@ int ase_init(struct platform_device *pdev) return 0; } -void ase_shutdown(void) +static void ase_shutdown(void) { uninit_pmu(); } @@ -294,7 +294,7 @@ void ase_shutdown(void) * int --- 0: Success * else: Error Code */ -int ase_start(int pp32) +static int ase_start(int pp32) { int ret; @@ -320,7 +320,7 @@ int ase_start(int pp32) * Output: * none */ -void ase_stop(int pp32) +static void ase_stop(int pp32) { /* halt PP32 */ IFX_REG_W32(DBG_CTRL_STOP, PP32_DBG_CTRL); From b73d6d4b8a40cd9b888a2e5ead8e76796f4f113c Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 49/87] ltq-deu: fix 6.12 kernel build warnings on lantiq/xrx200 This patch fixes various missing-prototypes build warnings by: * Mark some functions as static. * Add missing prototypes. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit d81f8e159a338318c690a1b9720a33544cfa612d) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- .../kernel/lantiq/ltq-deu/src/ifxmips_aes.c | 64 +++++++++---------- .../kernel/lantiq/ltq-deu/src/ifxmips_des.c | 34 ++++++---- .../lantiq/ltq-deu/src/ifxmips_deu_vr9.h | 3 + 3 files changed, 55 insertions(+), 46 deletions(-) diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c index 3be7461108..85234dd7a8 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c @@ -148,7 +148,7 @@ extern int disable_multiblock; * \param key_len key lengths of 16, 24 and 32 bytes supported * \return -EINVAL - bad key length, 0 - SUCCESS */ -int aes_set_key (struct crypto_tfm *tfm, const u8 *in_key, unsigned int key_len) +static int aes_set_key (struct crypto_tfm *tfm, const u8 *in_key, unsigned int key_len) { struct aes_ctx *ctx = crypto_tfm_ctx(tfm); @@ -177,7 +177,7 @@ int aes_set_key (struct crypto_tfm *tfm, const u8 *in_key, unsigned int key_len) * \param key_len key lengths of 16, 24 and 32 bytes supported * \return -EINVAL - bad key length, 0 - SUCCESS */ -int aes_set_key_skcipher (struct crypto_skcipher *tfm, const u8 *in_key, unsigned int key_len) +static int aes_set_key_skcipher (struct crypto_skcipher *tfm, const u8 *in_key, unsigned int key_len) { return aes_set_key(crypto_skcipher_tfm(tfm), in_key, key_len); } @@ -189,7 +189,7 @@ int aes_set_key_skcipher (struct crypto_skcipher *tfm, const u8 *in_key, unsigne * \param ctx_arg crypto algo context * \return */ -void aes_set_key_hw (void *ctx_arg) +static void aes_set_key_hw (void *ctx_arg) { /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ volatile struct aes_t *aes = (volatile struct aes_t *) AES_START; @@ -343,7 +343,7 @@ void ifx_deu_aes (void *ctx_arg, u8 *out_arg, const u8 *in_arg, * \return 0 - SUCCESS * -EINVAL - bad key length */ -int ctr_rfc3686_aes_set_key (struct crypto_tfm *tfm, const uint8_t *in_key, unsigned int key_len) +static int ctr_rfc3686_aes_set_key (struct crypto_tfm *tfm, const uint8_t *in_key, unsigned int key_len) { struct aes_ctx *ctx = crypto_tfm_ctx(tfm); @@ -376,7 +376,7 @@ int ctr_rfc3686_aes_set_key (struct crypto_tfm *tfm, const uint8_t *in_key, unsi * \return 0 - SUCCESS * -EINVAL - bad key length */ -int ctr_rfc3686_aes_set_key_skcipher (struct crypto_skcipher *tfm, const uint8_t *in_key, unsigned int key_len) +static int ctr_rfc3686_aes_set_key_skcipher (struct crypto_skcipher *tfm, const uint8_t *in_key, unsigned int key_len) { return ctr_rfc3686_aes_set_key(crypto_skcipher_tfm(tfm), in_key, key_len); } @@ -413,7 +413,7 @@ int ctr_rfc3686_aes_set_key_skcipher (struct crypto_skcipher *tfm, const uint8_t * \param encdec 1 for encrypt; 0 for decrypt * \param inplace not used */ -void ifx_deu_aes_ecb (void *ctx, uint8_t *dst, const uint8_t *src, +static void ifx_deu_aes_ecb (void *ctx, uint8_t *dst, const uint8_t *src, uint8_t *iv, size_t nbytes, int encdec, int inplace) { ifx_deu_aes (ctx, dst, src, NULL, nbytes, encdec, 0); @@ -430,7 +430,7 @@ void ifx_deu_aes_ecb (void *ctx, uint8_t *dst, const uint8_t *src, * \param encdec 1 for encrypt; 0 for decrypt * \param inplace not used */ -void ifx_deu_aes_cbc (void *ctx, uint8_t *dst, const uint8_t *src, +static void ifx_deu_aes_cbc (void *ctx, uint8_t *dst, const uint8_t *src, uint8_t *iv, size_t nbytes, int encdec, int inplace) { ifx_deu_aes (ctx, dst, src, iv, nbytes, encdec, 1); @@ -447,7 +447,7 @@ void ifx_deu_aes_cbc (void *ctx, uint8_t *dst, const uint8_t *src, * \param encdec 1 for encrypt; 0 for decrypt * \param inplace not used */ -void ifx_deu_aes_ofb (void *ctx, uint8_t *dst, const uint8_t *src, +static void ifx_deu_aes_ofb (void *ctx, uint8_t *dst, const uint8_t *src, uint8_t *iv, size_t nbytes, int encdec, int inplace) { ifx_deu_aes (ctx, dst, src, iv, nbytes, encdec, 2); @@ -464,7 +464,7 @@ void ifx_deu_aes_ofb (void *ctx, uint8_t *dst, const uint8_t *src, * \param encdec 1 for encrypt; 0 for decrypt * \param inplace not used */ -void ifx_deu_aes_cfb (void *ctx, uint8_t *dst, const uint8_t *src, +static void ifx_deu_aes_cfb (void *ctx, uint8_t *dst, const uint8_t *src, uint8_t *iv, size_t nbytes, int encdec, int inplace) { ifx_deu_aes (ctx, dst, src, iv, nbytes, encdec, 3); @@ -481,7 +481,7 @@ void ifx_deu_aes_cfb (void *ctx, uint8_t *dst, const uint8_t *src, * \param encdec 1 for encrypt; 0 for decrypt * \param inplace not used */ -void ifx_deu_aes_ctr (void *ctx, uint8_t *dst, const uint8_t *src, +static void ifx_deu_aes_ctr (void *ctx, uint8_t *dst, const uint8_t *src, uint8_t *iv, size_t nbytes, int encdec, int inplace) { ifx_deu_aes (ctx, dst, src, iv, nbytes, encdec, 4); @@ -494,7 +494,7 @@ void ifx_deu_aes_ctr (void *ctx, uint8_t *dst, const uint8_t *src, * \param out output bytestream * \param in input bytestream */ -void ifx_deu_aes_encrypt (struct crypto_tfm *tfm, uint8_t *out, const uint8_t *in) +static void ifx_deu_aes_encrypt (struct crypto_tfm *tfm, uint8_t *out, const uint8_t *in) { struct aes_ctx *ctx = crypto_tfm_ctx(tfm); ifx_deu_aes (ctx, out, in, NULL, AES_BLOCK_SIZE, @@ -508,7 +508,7 @@ void ifx_deu_aes_encrypt (struct crypto_tfm *tfm, uint8_t *out, const uint8_t *i * \param out output bytestream * \param in input bytestream */ -void ifx_deu_aes_decrypt (struct crypto_tfm *tfm, uint8_t *out, const uint8_t *in) +static void ifx_deu_aes_decrypt (struct crypto_tfm *tfm, uint8_t *out, const uint8_t *in) { struct aes_ctx *ctx = crypto_tfm_ctx(tfm); ifx_deu_aes (ctx, out, in, NULL, AES_BLOCK_SIZE, @@ -544,7 +544,7 @@ struct crypto_alg ifxdeu_aes_alg = { * \param req skcipher request * \return err */ -int ecb_aes_encrypt(struct skcipher_request *req) +static int ecb_aes_encrypt(struct skcipher_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -570,7 +570,7 @@ int ecb_aes_encrypt(struct skcipher_request *req) * \param req skcipher request * \return err */ -int ecb_aes_decrypt(struct skcipher_request *req) +static int ecb_aes_decrypt(struct skcipher_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -615,7 +615,7 @@ struct skcipher_alg ifxdeu_ecb_aes_alg = { * \param req skcipher request * \return err */ -int cbc_aes_encrypt(struct skcipher_request *req) +static int cbc_aes_encrypt(struct skcipher_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -642,7 +642,7 @@ int cbc_aes_encrypt(struct skcipher_request *req) * \param req skcipher request * \return err */ -int cbc_aes_decrypt(struct skcipher_request *req) +static int cbc_aes_decrypt(struct skcipher_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -694,7 +694,7 @@ struct skcipher_alg ifxdeu_cbc_aes_alg = { * \param encdec 1 for encrypt; 0 for decrypt * */ -void ifx_deu_aes_xts (void *ctx_arg, u8 *out_arg, const u8 *in_arg, +static void ifx_deu_aes_xts (void *ctx_arg, u8 *out_arg, const u8 *in_arg, u8 *iv_arg, size_t nbytes, int encdec) { /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ @@ -797,7 +797,7 @@ void ifx_deu_aes_xts (void *ctx_arg, u8 *out_arg, const u8 *in_arg, * \param req skcipher request * \return err */ -int xts_aes_encrypt(struct skcipher_request *req) +static int xts_aes_encrypt(struct skcipher_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -853,7 +853,7 @@ int xts_aes_encrypt(struct skcipher_request *req) * \param req skcipher request * \return err */ -int xts_aes_decrypt(struct skcipher_request *req) +static int xts_aes_decrypt(struct skcipher_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -911,7 +911,7 @@ int xts_aes_decrypt(struct skcipher_request *req) * \param key_len key lengths of 16, 24 and 32 bytes supported * \return -EINVAL - bad key length, 0 - SUCCESS */ -int xts_aes_set_key_skcipher (struct crypto_skcipher *tfm, const u8 *in_key, unsigned int key_len) +static int xts_aes_set_key_skcipher (struct crypto_skcipher *tfm, const u8 *in_key, unsigned int key_len) { struct aes_ctx *ctx = crypto_tfm_ctx(crypto_skcipher_tfm(tfm)); unsigned int keylen = (key_len / 2); @@ -958,7 +958,7 @@ struct skcipher_alg ifxdeu_xts_aes_alg = { * \param req skcipher request * \return err */ -int ofb_aes_encrypt(struct skcipher_request *req) +static int ofb_aes_encrypt(struct skcipher_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -991,7 +991,7 @@ int ofb_aes_encrypt(struct skcipher_request *req) * \param req skcipher request * \return err */ -int ofb_aes_decrypt(struct skcipher_request *req) +static int ofb_aes_decrypt(struct skcipher_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -1046,7 +1046,7 @@ struct skcipher_alg ifxdeu_ofb_aes_alg = { * \param req skcipher request * \return err */ -int cfb_aes_encrypt(struct skcipher_request *req) +static int cfb_aes_encrypt(struct skcipher_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -1079,7 +1079,7 @@ int cfb_aes_encrypt(struct skcipher_request *req) * \param req skcipher request * \return err */ -int cfb_aes_decrypt(struct skcipher_request *req) +static int cfb_aes_decrypt(struct skcipher_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -1134,7 +1134,7 @@ struct skcipher_alg ifxdeu_cfb_aes_alg = { * \param req skcipher request * \return err */ -int ctr_basic_aes_encrypt(struct skcipher_request *req) +static int ctr_basic_aes_encrypt(struct skcipher_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -1167,7 +1167,7 @@ int ctr_basic_aes_encrypt(struct skcipher_request *req) * \param req skcipher request * \return err */ -int ctr_basic_aes_decrypt(struct skcipher_request *req) +static int ctr_basic_aes_decrypt(struct skcipher_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -1221,7 +1221,7 @@ struct skcipher_alg ifxdeu_ctr_basic_aes_alg = { * \param req skcipher request * \return err */ -int ctr_rfc3686_aes_encrypt(struct skcipher_request *req) +static int ctr_rfc3686_aes_encrypt(struct skcipher_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -1264,7 +1264,7 @@ int ctr_rfc3686_aes_encrypt(struct skcipher_request *req) * \param req skcipher request * \return err */ -int ctr_rfc3686_aes_decrypt(struct skcipher_request *req) +static int ctr_rfc3686_aes_decrypt(struct skcipher_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -1576,7 +1576,7 @@ static struct shash_alg ifxdeu_cbcmac_aes_alg = { * \param key_len key lengths of 16, 24 and 32 bytes supported * \return -EINVAL - bad key length, 0 - SUCCESS */ -int aes_set_key_aead (struct crypto_aead *aead, const u8 *in_key, unsigned int key_len) +static int aes_set_key_aead (struct crypto_aead *aead, const u8 *in_key, unsigned int key_len) { struct aes_ctx *ctx = crypto_aead_ctx(aead); int err; @@ -1601,7 +1601,7 @@ int aes_set_key_aead (struct crypto_aead *aead, const u8 *in_key, unsigned int k * \param in_key input authsize * \return -EINVAL - bad authsize length, 0 - SUCCESS */ -int gcm_aes_setauthsize (struct crypto_aead *aead, unsigned int authsize) +static int gcm_aes_setauthsize (struct crypto_aead *aead, unsigned int authsize) { return crypto_gcm_check_authsize(authsize); } @@ -1612,7 +1612,7 @@ int gcm_aes_setauthsize (struct crypto_aead *aead, unsigned int authsize) * \param req aead request * \return err */ -int gcm_aes_encrypt(struct aead_request *req) +static int gcm_aes_encrypt(struct aead_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -1726,7 +1726,7 @@ int gcm_aes_encrypt(struct aead_request *req) * \param req aead request * \return err */ -int gcm_aes_decrypt(struct aead_request *req) +static int gcm_aes_decrypt(struct aead_request *req) { struct aes_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_des.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_des.c index 953c3feddc..fc376c4d89 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_des.c +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_des.c @@ -126,7 +126,7 @@ extern int disable_deudma; * \param key input key * \param keylen key length */ -int des_setkey(struct crypto_tfm *tfm, const u8 *key, +static int des_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) { struct ifx_deu_des_ctx *dctx = crypto_tfm_ctx(tfm); @@ -161,7 +161,7 @@ int des_setkey(struct crypto_tfm *tfm, const u8 *key, * \param key_len key lengths of 16, 24 and 32 bytes supported * \return -EINVAL - bad key length, 0 - SUCCESS */ -int des_setkey_skcipher (struct crypto_skcipher *tfm, const u8 *in_key, unsigned int key_len) +static int des_setkey_skcipher (struct crypto_skcipher *tfm, const u8 *in_key, unsigned int key_len) { return des_setkey(crypto_skcipher_tfm(tfm), in_key, key_len); } @@ -296,7 +296,7 @@ void ifx_deu_des (void *ctx_arg, u8 *out_arg, const u8 *in_arg, * \param encdec 1 for encrypt; 0 for decrypt * \param inplace not used */ -void ifx_deu_des_ecb (void *ctx, uint8_t *dst, const uint8_t *src, +static void ifx_deu_des_ecb (void *ctx, uint8_t *dst, const uint8_t *src, uint8_t *iv, size_t nbytes, int encdec, int inplace) { ifx_deu_des (ctx, dst, src, NULL, nbytes, encdec, 0); @@ -313,7 +313,7 @@ void ifx_deu_des_ecb (void *ctx, uint8_t *dst, const uint8_t *src, * \param encdec 1 for encrypt; 0 for decrypt * \param inplace not used */ -void ifx_deu_des_cbc (void *ctx, uint8_t *dst, const uint8_t *src, +static void ifx_deu_des_cbc (void *ctx, uint8_t *dst, const uint8_t *src, uint8_t *iv, size_t nbytes, int encdec, int inplace) { ifx_deu_des (ctx, dst, src, iv, nbytes, encdec, 1); @@ -330,11 +330,13 @@ void ifx_deu_des_cbc (void *ctx, uint8_t *dst, const uint8_t *src, * \param encdec 1 for encrypt; 0 for decrypt * \param inplace not used */ -void ifx_deu_des_ofb (void *ctx, uint8_t *dst, const uint8_t *src, +/* +static void ifx_deu_des_ofb (void *ctx, uint8_t *dst, const uint8_t *src, uint8_t *iv, size_t nbytes, int encdec, int inplace) { ifx_deu_des (ctx, dst, src, iv, nbytes, encdec, 2); } +*/ /*! \fn void ifx_deu_des_cfb (void *ctx, uint8_t *dst, const uint8_t *src, uint8_t *iv, size_t nbytes, int encdec, int inplace) \ingroup IFX_DES_FUNCTIONS @@ -347,11 +349,13 @@ void ifx_deu_des_ofb (void *ctx, uint8_t *dst, const uint8_t *src, \param encdec 1 for encrypt; 0 for decrypt \param inplace not used */ -void ifx_deu_des_cfb (void *ctx, uint8_t *dst, const uint8_t *src, +/* +static void ifx_deu_des_cfb (void *ctx, uint8_t *dst, const uint8_t *src, uint8_t *iv, size_t nbytes, int encdec, int inplace) { ifx_deu_des (ctx, dst, src, iv, nbytes, encdec, 3); } +*/ /*! \fn void ifx_deu_des_ctr (void *ctx, uint8_t *dst, const uint8_t *src, uint8_t *iv, size_t nbytes, int encdec, int inplace) * \ingroup IFX_DES_FUNCTIONS @@ -364,11 +368,13 @@ void ifx_deu_des_cfb (void *ctx, uint8_t *dst, const uint8_t *src, * \param encdec 1 for encrypt; 0 for decrypt * \param inplace not used */ +/* void ifx_deu_des_ctr (void *ctx, uint8_t *dst, const uint8_t *src, uint8_t *iv, size_t nbytes, int encdec, int inplace) { ifx_deu_des (ctx, dst, src, iv, nbytes, encdec, 4); } +*/ /*! \fn void ifx_deu_des_encrypt (struct crypto_tfm *tfm, uint8_t *out, const uint8_t *in) * \ingroup IFX_DES_FUNCTIONS @@ -377,7 +383,7 @@ void ifx_deu_des_ctr (void *ctx, uint8_t *dst, const uint8_t *src, * \param out output bytestream * \param in input bytestream */ -void ifx_deu_des_encrypt (struct crypto_tfm *tfm, uint8_t * out, const uint8_t * in) +static void ifx_deu_des_encrypt (struct crypto_tfm *tfm, uint8_t * out, const uint8_t * in) { struct ifx_deu_des_ctx *ctx = crypto_tfm_ctx(tfm); ifx_deu_des (ctx, out, in, NULL, DES_BLOCK_SIZE, @@ -392,7 +398,7 @@ void ifx_deu_des_encrypt (struct crypto_tfm *tfm, uint8_t * out, const uint8_t * * \param out output bytestream * \param in input bytestream */ -void ifx_deu_des_decrypt (struct crypto_tfm *tfm, uint8_t * out, const uint8_t * in) +static void ifx_deu_des_decrypt (struct crypto_tfm *tfm, uint8_t * out, const uint8_t * in) { struct ifx_deu_des_ctx *ctx = crypto_tfm_ctx(tfm); ifx_deu_des (ctx, out, in, NULL, DES_BLOCK_SIZE, @@ -420,7 +426,7 @@ void ifx_deu_des_decrypt (struct crypto_tfm *tfm, uint8_t * out, const uint8_t * * \param key input key * \param keylen key length */ -int des3_ede_setkey(struct crypto_tfm *tfm, const u8 *key, +static int des3_ede_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) { struct ifx_deu_des_ctx *dctx = crypto_tfm_ctx(tfm); @@ -454,7 +460,7 @@ int des3_ede_setkey(struct crypto_tfm *tfm, const u8 *key, * \param key input key * \param keylen key length */ -int des3_ede_setkey_skcipher(struct crypto_skcipher *tfm, const u8 *key, +static int des3_ede_setkey_skcipher(struct crypto_skcipher *tfm, const u8 *key, unsigned int keylen) { return des3_ede_setkey(crypto_skcipher_tfm(tfm), key, keylen); @@ -508,7 +514,7 @@ struct crypto_alg ifxdeu_des3_ede_alg = { * \param req skcipher request * \return err */ -int ecb_des_encrypt(struct skcipher_request *req) +static int ecb_des_encrypt(struct skcipher_request *req) { struct ifx_deu_des_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -534,7 +540,7 @@ int ecb_des_encrypt(struct skcipher_request *req) * \param req skcipher request * \return err */ -int ecb_des_decrypt(struct skcipher_request *req) +static int ecb_des_decrypt(struct skcipher_request *req) { struct ifx_deu_des_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -599,7 +605,7 @@ struct skcipher_alg ifxdeu_ecb_des3_ede_alg = { * \param req skcipher request * \return err */ -int cbc_des_encrypt(struct skcipher_request *req) +static int cbc_des_encrypt(struct skcipher_request *req) { struct ifx_deu_des_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; @@ -627,7 +633,7 @@ int cbc_des_encrypt(struct skcipher_request *req) * \param req skcipher request * \return err */ -int cbc_des_decrypt(struct skcipher_request *req) +static int cbc_des_decrypt(struct skcipher_request *req) { struct ifx_deu_des_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct skcipher_walk walk; diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_vr9.h b/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_vr9.h index fcbda40159..235a393e7f 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_vr9.h +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_vr9.h @@ -321,4 +321,7 @@ struct deu_dma_t { } controlr; }; +u32 input_swap(u32 input); +void chip_version(void); + #endif /* IFXMIPS_DEU_VR9_H */ From 7f3088e82dff4cfe695df5e348d6ba3d354854f1 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 50/87] ltq-deu: fix 6.12 kernel build warnings on lantiq/xway This patch fixes the following build warnings by adding missing prototypes: /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_deu_danube.c:100:5: error: no previous prototype for 'input_swap' [-Werror=missing-prototypes] 100 | u32 input_swap(u32 input) | ^~~~~~~~~~ /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-deu-ar9/ltq-deu/ifxmips_deu_ar9.c:91:5: error: no previous prototype for 'input_swap' [-Werror=missing-prototypes] 91 | u32 input_swap(u32 input) | ^~~~~~~~~~ /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-deu-ar9/ltq-deu/ifxmips_deu_ar9.c:131:6: error: no previous prototype for 'chip_version' [-Werror=missing-prototypes] 131 | void chip_version(void) | ^~~~~~~~~~~~ Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit fdc2d8d07bbddec698823816cb0cfc88f7df7fa2) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- package/kernel/lantiq/ltq-deu/src/ifxmips_deu_ar9.h | 3 +++ package/kernel/lantiq/ltq-deu/src/ifxmips_deu_danube.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_ar9.h b/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_ar9.h index 2f373589a5..324d20012b 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_ar9.h +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_ar9.h @@ -304,4 +304,7 @@ struct deu_dma_t { } controlr; }; +u32 input_swap(u32 input); +void chip_version(void); + #endif /* IFXMIPS_DEU_AR9_H */ diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_danube.h b/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_danube.h index 25561cf6e0..eb2f749bb3 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_danube.h +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_deu_danube.h @@ -255,4 +255,6 @@ struct deu_dma_t { } controlr; }; +u32 input_swap(u32 input); + #endif /* IFXMIPS_DEU_DANUBE_H */ From 3f9c57b813bab498f7b7c6d919ff663c351fa242 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 51/87] ltq-ptm: fix missing-prototypes warning Mark cgu_get_pp32_clock() as static. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 621a1c9b56143a7445cffb750bad730acc2eafa1) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- .../102-fix-missing-prototypes-warning.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 package/kernel/lantiq/ltq-ptm/patches/102-fix-missing-prototypes-warning.patch diff --git a/package/kernel/lantiq/ltq-ptm/patches/102-fix-missing-prototypes-warning.patch b/package/kernel/lantiq/ltq-ptm/patches/102-fix-missing-prototypes-warning.patch new file mode 100644 index 0000000000..faa5784fca --- /dev/null +++ b/package/kernel/lantiq/ltq-ptm/patches/102-fix-missing-prototypes-warning.patch @@ -0,0 +1,26 @@ +From: Shiji Yang +Date: Fri, 9 May 2025 02:34:14 +0800 +Subject: [PATCH] fix missing-prototypes warning + +Fix the build warning on 6.12 kernel: + +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ltq-ptm-vr9/ltq-ptm/ifxmips_ptm_vdsl.c:64:15: error: no previous prototype for 'cgu_get_pp32_clock' [-Werror=missing-prototypes] + 64 | unsigned long cgu_get_pp32_clock(void) + | ^~~~~~~~~~~~~~~~~~ + +Signed-off-by: Shiji Yang +--- + ifxmips_ptm_vdsl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/ifxmips_ptm_vdsl.c ++++ b/ifxmips_ptm_vdsl.c +@@ -61,7 +61,7 @@ static void *g_xdata_addr = NULL; + + #define ENABLE_TMP_DBG 0 + +-unsigned long cgu_get_pp32_clock(void) ++static unsigned long cgu_get_pp32_clock(void) + { + struct clk *c = clk_get_ppe(); + unsigned long rate = clk_get_rate(c); From 67d7504660d1cce83b42341d16110ab43cefd212 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 52/87] ltq-ptm: vdsl: fix 6.12 kernel build errors on lantiq/xrx200 Add missing header to fix the build errors on 6.12 kernel. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit b48ed6d19c3a72b203faf3b62432026f2ce48d0a) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...add-missing-header-mod_devicetable.h.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 package/kernel/lantiq/ltq-ptm/patches/103-add-missing-header-mod_devicetable.h.patch diff --git a/package/kernel/lantiq/ltq-ptm/patches/103-add-missing-header-mod_devicetable.h.patch b/package/kernel/lantiq/ltq-ptm/patches/103-add-missing-header-mod_devicetable.h.patch new file mode 100644 index 0000000000..530f62dda4 --- /dev/null +++ b/package/kernel/lantiq/ltq-ptm/patches/103-add-missing-header-mod_devicetable.h.patch @@ -0,0 +1,26 @@ +From: Shiji Yang +Date: Fri, 9 May 2025 02:36:31 +0800 +Subject: [PATCH] add missing header mod_devicetable.h + +Fix compilation error: + +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ltq-ptm-vr9/ltq-ptm/ifxmips_ptm_vdsl.c:969:34: error: array type has incomplete element type 'struct of_device_id' + 969 | static const struct of_device_id ltq_ptm_match[] = { + | ^~~~~~~~~~~~~ +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ltq-ptm-vr9/ltq-ptm/ifxmips_ptm_vdsl.c:969:34: error: 'ltq_ptm_match' defined but not used [-Werror=unused-variable] + +Signed-off-by: Shiji Yang +--- + ifxmips_ptm_vdsl.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/ifxmips_ptm_vdsl.c ++++ b/ifxmips_ptm_vdsl.c +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + #include + + #include "ifxmips_ptm_vdsl.h" From 0d02cf9e3464c9f415877bf0a7ce6416a498cd18 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 53/87] ltq-ptm: adsl: fix 6.12 kernel build errors on lantiq/xway Fix incomplete type error by including the correct header. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 2e00140e63c97f469d472212189cec1c0c28ebc4) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...add-missing-header-mod_devicetable.h.patch | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 package/kernel/lantiq/ltq-ptm/patches/104-add-missing-header-mod_devicetable.h.patch diff --git a/package/kernel/lantiq/ltq-ptm/patches/104-add-missing-header-mod_devicetable.h.patch b/package/kernel/lantiq/ltq-ptm/patches/104-add-missing-header-mod_devicetable.h.patch new file mode 100644 index 0000000000..7e6d845def --- /dev/null +++ b/package/kernel/lantiq/ltq-ptm/patches/104-add-missing-header-mod_devicetable.h.patch @@ -0,0 +1,25 @@ +From: Shiji Yang +Date: Fri, 9 May 2025 21:16:08 +0800 +Subject: [PATCH] add missing header "mod_devicetable.h" + +Fix compilation error: + +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-ptm-danube/ltq-ptm/ifxmips_ptm_adsl.c:1433:34: error: array type has incomplete element type 'struct of_device_id' + 1433 | static const struct of_device_id ltq_ptm_match[] = { + | ^~~~~~~~~~~~~ + +Signed-off-by: Shiji Yang +--- + ifxmips_ptm_adsl.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/ifxmips_ptm_adsl.c ++++ b/ifxmips_ptm_adsl.c +@@ -43,6 +43,7 @@ + #include + #include + #include ++#include + #include + #include + #include From 5e095c87e254c93102f5906fa149672a0961ce2b Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 54/87] ltq-vmmc: fix ignored-qualifiers warning NULL and fixed addresses are constant, const qualifier are useless. /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_vmmc-1.9.0/src/mps/drv_mps_vmmc_ar9.c:47:1: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers] 47 | const void (*ifx_bsp_basic_mps_decrypt)(unsigned int addr, int n) = NULL; | ^~~~~ /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_vmmc-1.9.0/src/mps/drv_mps_vmmc_ar9.c:246:49: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers] 246 | ifx_bsp_basic_mps_decrypt = (const void (*)(unsigned int, int))0xbf0017c4; | ^~~~~ /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_vmmc-1.9.0/src/mps/drv_mps_vmmc_ar9.c:249:49: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers] 249 | ifx_bsp_basic_mps_decrypt = (const void (*)(unsigned int, int))0xbf001ea4; | ^~~~~ /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_vmmc-1.9.0/src/mps/drv_mps_vmmc_ar9.c:252:49: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers] 252 | ifx_bsp_basic_mps_decrypt = (const void (*)(unsigned int, int))0xbf001f38; | ^~~~~ Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit ac8e876a6e15ee6ea0724c824feea23c79f1a444) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- package/kernel/lantiq/ltq-vmmc/patches/500-ar9_vr9.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/kernel/lantiq/ltq-vmmc/patches/500-ar9_vr9.patch b/package/kernel/lantiq/ltq-vmmc/patches/500-ar9_vr9.patch index 76fc863c35..24cd3f7ca8 100644 --- a/package/kernel/lantiq/ltq-vmmc/patches/500-ar9_vr9.patch +++ b/package/kernel/lantiq/ltq-vmmc/patches/500-ar9_vr9.patch @@ -18,7 +18,7 @@ #include "drv_mps_vmmc_dbg.h" #include "drv_mps_vmmc_device.h" -+const void (*ifx_bsp_basic_mps_decrypt)(unsigned int addr, int n) = NULL; ++void (*ifx_bsp_basic_mps_decrypt)(unsigned int addr, int n) = NULL; + +#define IFX_MPS_SRAM IFXMIPS_MPS_SRAM + @@ -106,13 +106,13 @@ pFWDwnld->length -= sizeof(IFX_uint32_t); + switch(ltq_soc_type()) { + case SOC_TYPE_AR9: -+ ifx_bsp_basic_mps_decrypt = (const void (*)(unsigned int, int))0xbf0017c4; ++ ifx_bsp_basic_mps_decrypt = (void (*)(unsigned int, int))0xbf0017c4; + break; + case SOC_TYPE_VR9: -+ ifx_bsp_basic_mps_decrypt = (const void (*)(unsigned int, int))0xbf001ea4; ++ ifx_bsp_basic_mps_decrypt = (void (*)(unsigned int, int))0xbf001ea4; + break; + case SOC_TYPE_VR9_2: -+ ifx_bsp_basic_mps_decrypt = (const void (*)(unsigned int, int))0xbf001f38; ++ ifx_bsp_basic_mps_decrypt = (void (*)(unsigned int, int))0xbf001f38; + break; + } + if (ifx_bsp_basic_mps_decrypt) From b35acddeb4cfc95b6f5da59593dc0117208fae82 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 55/87] ltq-vmmc: silence missing-prototypes warnings There are a lot of missing-prototypes warnings, It's not worth to fix them one by one. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 144228d61898df387b186a7768df0e4bade868f9) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...21-ignore-missing-prototypes-warning.patch | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 package/kernel/lantiq/ltq-vmmc/patches/021-ignore-missing-prototypes-warning.patch diff --git a/package/kernel/lantiq/ltq-vmmc/patches/021-ignore-missing-prototypes-warning.patch b/package/kernel/lantiq/ltq-vmmc/patches/021-ignore-missing-prototypes-warning.patch new file mode 100644 index 0000000000..c36edc4b4b --- /dev/null +++ b/package/kernel/lantiq/ltq-vmmc/patches/021-ignore-missing-prototypes-warning.patch @@ -0,0 +1,29 @@ +From: Shiji Yang +Date: Fri, 9 May 2025 08:22:25 +0800 +Subject: [PATCH] ignore missing-prototypes warning + +Signed-off-by: Shiji Yang +--- + src/Makefile.am | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -226,6 +226,8 @@ install-exec-hook: $(bin_PROGRAMS) + if KERNEL_2_6 + drv_vmmc_OBJS = "$(subst .c,.o, $(drv_vmmc_SOURCES) $(nodist_drv_vmmc_SOURCES))" + ++PKGFIX_CFLAGS = -Wno-error=missing-prototypes ++ + drv_vmmc.ko: $(drv_vmmc_SOURCES) $(EXTRA_DIST) + @echo "Making Linux 2.6.x kernel object" + @for f in $(drv_vmmc_SOURCES) $(nodist_drv_vmmc_SOURCES) ; do \ +@@ -238,7 +240,7 @@ drv_vmmc.ko: $(drv_vmmc_SOURCES) $(EXTRA + @echo "# drv_vmmc: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild + @echo "obj-m := $(subst .ko,.o,$@)" >> $(PWD)/Kbuild + @echo "$(subst .ko,,$@)-y := $(drv_vmmc_OBJS)" >> $(PWD)/Kbuild +- @echo "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(drv_vmmc_CFLAGS) $(INCLUDES)" >> $(PWD)/Kbuild ++ @echo "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(drv_vmmc_CFLAGS) $(PKGFIX_CFLAGS) $(INCLUDES)" >> $(PWD)/Kbuild + $(MAKE) ARCH=@KERNEL_ARCH@ -C @KERNEL_BUILD_PATH@ O=@KERNEL_BUILD_PATH@ M=$(PWD) modules + + clean-generic: From 3fd6351335d55b84b886276cd224d834795a9213 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:18 +0800 Subject: [PATCH 56/87] ltq-vmmc: fix macro definition conflicts Add LANTIQ prefix to workaround the build warnings. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 18aa58f2002829e3354c83feec4a2ea3736a3f90) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...o-definition-conflicts-on-6.12-kerne.patch | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 package/kernel/lantiq/ltq-vmmc/patches/606-fix-version-macro-definition-conflicts-on-6.12-kerne.patch diff --git a/package/kernel/lantiq/ltq-vmmc/patches/606-fix-version-macro-definition-conflicts-on-6.12-kerne.patch b/package/kernel/lantiq/ltq-vmmc/patches/606-fix-version-macro-definition-conflicts-on-6.12-kerne.patch new file mode 100644 index 0000000000..f6ab6792ec --- /dev/null +++ b/package/kernel/lantiq/ltq-vmmc/patches/606-fix-version-macro-definition-conflicts-on-6.12-kerne.patch @@ -0,0 +1,143 @@ +From: Shiji Yang +Date: Thu, 8 May 2025 23:53:01 +0800 +Subject: [PATCH] fix version macro definition conflicts on 6.12 kernel + +Add LANTIQ prefix before MIN/MAX to fix: + +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_vmmc-1.9.0/src/drv_vmmc_init.c:91:9: error: "MAX" redefined [-Werror] + 91 | #define MAX(x,y) ((x) > (y) ? (x) : (y)) + | ^~~ +./include/linux/minmax.h:330:9: note: this is the location of the previous definition + 330 | #define MAX(a,b) __cmp(max,a,b) + | ^~~ +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_vmmc-1.9.0/src/drv_vmmc_init_cap.c:42:9: error: "MIN" redefined [-Werror] + 42 | #define MIN(x,y) ({ (x) < (y) ? (x) : (y); }) + | ^~~ +./include/linux/minmax.h:329:9: note: this is the location of the previous definition + 329 | #define MIN(a,b) __cmp(min,a,b) + | ^~~ +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_vmmc-1.9.0/src/drv_vmmc_sig_cptd.c:41:9: error: "MAX" redefined [-Werror] + 41 | #define MAX(x,y) ((x) > (y) ? (x) : (y)) + | ^~~ +./include/linux/minmax.h:330:9: note: this is the location of the previous definition + 330 | #define MAX(a,b) __cmp(max,a,b) + | ^~~ + +Signed-off-by: Shiji Yang +--- + src/drv_vmmc_init.c | 12 ++++++------ + src/drv_vmmc_init_cap.c | 4 ++-- + src/drv_vmmc_sig_cptd.c | 4 ++-- + 3 files changed, 10 insertions(+), 10 deletions(-) + +--- a/src/drv_vmmc_init.c ++++ b/src/drv_vmmc_init.c +@@ -88,7 +88,7 @@ CREATE_TRACE_GROUP(VMMC); + /** what compatible driver version */ + #define DRV_VMMC_WHAT_STR "@(#)Lantiq VMMC device driver, version " DRV_VMMC_VER_STR + +-#define MAX(x,y) ((x) > (y) ? (x) : (y)) ++#define LANTIQ_MAX(x,y) ((x) > (y) ? (x) : (y)) + + #define MPS_CH_VALID(mpsCh) ((mpsCh >= 1 && mpsCh <= 7) ? 1 : 0) + +@@ -927,17 +927,17 @@ static IFX_int32_t VMMC_TAPI_LL_FW_Init( + + /* Maximum number of resources, is the maximum of: + nALI, nPCM, nCOD, nSIG, nDECT, nLIN and nAudioCnt. */ +- tmp1 = MAX (pDev->caps.nALI, pDev->caps.nPCM); +- tmp2 = MAX (pDev->caps.nCOD, pDev->caps.nSIG); +- pDev->caps.nMaxRes = MAX(tmp1, tmp2); ++ tmp1 = LANTIQ_MAX(pDev->caps.nALI, pDev->caps.nPCM); ++ tmp2 = LANTIQ_MAX(pDev->caps.nCOD, pDev->caps.nSIG); ++ pDev->caps.nMaxRes = LANTIQ_MAX(tmp1, tmp2); + #ifdef DECT_SUPPORT +- pDev->caps.nMaxRes = MAX(pDev->caps.nMaxRes, pDev->caps.nDECT); ++ pDev->caps.nMaxRes = LANTIQ_MAX(pDev->caps.nMaxRes, pDev->caps.nDECT); + #endif /* LIN_SUPPORT */ + #ifdef LIN_SUPPORT +- pDev->caps.nMaxRes = MAX(pDev->caps.nMaxRes, pDev->caps.nLIN); ++ pDev->caps.nMaxRes = LANTIQ_MAX(pDev->caps.nMaxRes, pDev->caps.nLIN); + #endif /* LIN_SUPPORT */ + #if (VMMC_CFG_FEATURES & VMMC_FEAT_AUDIO) +- pDev->caps.nMaxRes = MAX(pDev->caps.nMaxRes, pDev->caps.nAudioCnt); ++ pDev->caps.nMaxRes = LANTIQ_MAX(pDev->caps.nMaxRes, pDev->caps.nAudioCnt); + #endif /* (VMMC_CFG_FEATURES & VMMC_FEAT_AUDIO) */ + + if (pDev->caps.nMaxRes > VMMC_MAX_CH_NR) +@@ -977,7 +977,7 @@ static IFX_int32_t VMMC_TAPI_LL_FW_Init( + nResource.DTMFRCount = pDev->caps.nDTMFD; + nResource.FSKGCount = pDev->caps.nCIDS; + nResource.FSKRCount = pDev->caps.nCIDR; +- nResource.ToneCount = MAX(pDev->caps.nSIG, pDev->caps.nDECT); ++ nResource.ToneCount = LANTIQ_MAX(pDev->caps.nSIG, pDev->caps.nDECT); + nResource.HdlcCount = pDev->caps.nHDLC; + IFX_TAPI_ReportResources (pDev->pTapiDev,&nResource); + +--- a/src/drv_vmmc_init_cap.c ++++ b/src/drv_vmmc_init_cap.c +@@ -39,7 +39,7 @@ + /* ============================= */ + /* Local Macros & Definitions */ + /* ============================= */ +-#define MIN(x,y) ({ (x) < (y) ? (x) : (y); }) ++#define LANTIQ_MIN(x,y) ({ (x) < (y) ? (x) : (y); }) + + /* ============================= */ + /* Local function declaration */ +@@ -392,7 +392,7 @@ IFX_return_t VMMC_Get_FwCap(VMMC_DEVICE + /* Read the maximum length of the message that we can interpret but + not more than the firmware can provide. */ + /* BLEN is the length including the header that the fw reports. */ +- capCmd.LENGTH = MIN (capCmd.BLEN, sizeof(SYS_CAP_t)); ++ capCmd.LENGTH = LANTIQ_MIN(capCmd.BLEN, sizeof(SYS_CAP_t)); + /* Subtract the length of the header. */ + capCmd.LENGTH -= CMD_HDR_CNT; + /* Read capability once more - this time with maximum length. */ +@@ -479,7 +479,7 @@ IFX_return_t VMMC_Get_FwCap(VMMC_DEVICE + pDev->caps.FEAT = capCmd.FEAT; + /* Number of UTG resources per channel (== SIG module), either 1 or 2 */ + pDev->caps.nUtgPerCh = (capCmd.FEAT & EDSP_CAP_FEAT_UTGUD) ? 2 : 1; +- pDev->caps.nUtgPerCh = MIN(pDev->caps.nUtgPerCh, LL_TAPI_TONE_MAXRES); ++ pDev->caps.nUtgPerCh = LANTIQ_MIN(pDev->caps.nUtgPerCh, LL_TAPI_TONE_MAXRES); + /* Number of AudioChannels */ + pDev->caps.nAudioCnt = (pDev->caps.FEAT & EDSP_CAP_FEAT_CHAUD) ? 1 : 0; + /* Overlays */ +--- a/src/drv_vmmc_sig_cptd.c ++++ b/src/drv_vmmc_sig_cptd.c +@@ -38,7 +38,7 @@ + /** define which constant is taken for cpt level calculation */ + #define CONST_CPT CONST_CPT_BLACKMAN + /* return the maximum of two scalar values */ +-#define MAX(x,y) ((x) > (y) ? (x) : (y)) ++#define LANTIQ_MAX(x,y) ((x) > (y) ? (x) : (y)) + + /* ============================= */ + /* Local function declaration */ +@@ -511,7 +511,7 @@ static IFX_int32_t vmmc_sig_CPTD_SetCoef + if (nTenPercentTimeTolerance > nMaxTenPercentTimeTolerance) + nMaxTenPercentTimeTolerance = nTenPercentTimeTolerance; + +- val = (IFX_uint16_t) (pTone->cadence[i] - MAX(nAbsoluteTimeTolerance, ++ val = (IFX_uint16_t) (pTone->cadence[i] - LANTIQ_MAX(nAbsoluteTimeTolerance, + nTenPercentTimeTolerance)); + switch (i) + { +@@ -578,7 +578,7 @@ static IFX_int32_t vmmc_sig_CPTD_SetCoef + { + /* set tolerance +TIM_TOL */ + pCmd->TIM_TOL = +- (2 * MAX (nAbsoluteTimeTolerance, nMaxTenPercentTimeTolerance)); ++ (2 * LANTIQ_MAX(nAbsoluteTimeTolerance, nMaxTenPercentTimeTolerance)); + /* return because nothing more to do */ + return IFX_SUCCESS; + } +@@ -605,7 +605,7 @@ static IFX_int32_t vmmc_sig_CPTD_SetCoef + /* set tolerance +TIM_TOL and NR of successfully fulfilled timing + requirement steps required to pass */ + pCmd->TIM_TOL = +- (2 * MAX (nAbsoluteTimeTolerance, nMaxTenPercentTimeTolerance)); ++ (2 * LANTIQ_MAX(nAbsoluteTimeTolerance, nMaxTenPercentTimeTolerance)); + pCmd->NR = nr; + + return IFX_SUCCESS; From e52c85ee5d484964124d9375c3d4a818bdc319d5 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:19 +0800 Subject: [PATCH 57/87] ltq-vmmc: fix unknown type name errors Include missing header "drv_vmmc_api.h" to fix the compilation errors. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 1f909e9f6d839939c2c7e6f212077d3fc0a265e3) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- .../607-fix-unknown-type-name-errors.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 package/kernel/lantiq/ltq-vmmc/patches/607-fix-unknown-type-name-errors.patch diff --git a/package/kernel/lantiq/ltq-vmmc/patches/607-fix-unknown-type-name-errors.patch b/package/kernel/lantiq/ltq-vmmc/patches/607-fix-unknown-type-name-errors.patch new file mode 100644 index 0000000000..4e1ad1b5eb --- /dev/null +++ b/package/kernel/lantiq/ltq-vmmc/patches/607-fix-unknown-type-name-errors.patch @@ -0,0 +1,28 @@ +From: Shiji Yang +Date: Fri, 9 May 2025 01:31:44 +0800 +Subject: [PATCH] fix unknown type name errors + +Fix compilation errors: + +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_vmmc-1.9.0/src/drv_vmmc_sig.h:41:45: error: unknown type name 'IFX_TAPI_DRV_CTX_SIG_t' + 41 | extern IFX_void_t VMMC_SIG_Func_Register (IFX_TAPI_DRV_CTX_SIG_t *pSig); + | ^~~~~~~~~~~~~~~~~~~~~~ +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_vmmc-1.9.0/src/drv_vmmc_sig.h:43:54: error: unknown type name 'VMMC_CHANNEL' + 43 | extern IFX_int32_t VMMC_SIG_Allocate_Ch_Structures (VMMC_CHANNEL *pCh); + | ^~~~~~~~~~~~ + +Signed-off-by: Shiji Yang +--- + src/drv_vmmc_sig.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/src/drv_vmmc_sig.h ++++ b/src/drv_vmmc_sig.h +@@ -20,6 +20,7 @@ + /* ============================= */ + /* Includes */ + /* ============================= */ ++#include "drv_vmmc_api.h" + #include "ifx_types.h" + + /* ============================= */ From 116c26120e5bf7160f92c32fc96ccf57f0274366 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:19 +0800 Subject: [PATCH 58/87] ltq-vmmc: fix 'inline' declaration warning Adjust the 'inline' declaration order to fix the build warning. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 86e5b777889cea94dbdf6f1f5b94cb0cd9173002) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...e-is-not-at-beginning-of-declaration.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 package/kernel/lantiq/ltq-vmmc/patches/608-fix-inline-is-not-at-beginning-of-declaration.patch diff --git a/package/kernel/lantiq/ltq-vmmc/patches/608-fix-inline-is-not-at-beginning-of-declaration.patch b/package/kernel/lantiq/ltq-vmmc/patches/608-fix-inline-is-not-at-beginning-of-declaration.patch new file mode 100644 index 0000000000..4444360182 --- /dev/null +++ b/package/kernel/lantiq/ltq-vmmc/patches/608-fix-inline-is-not-at-beginning-of-declaration.patch @@ -0,0 +1,26 @@ +From: Shiji Yang +Date: Fri, 9 May 2025 01:43:41 +0800 +Subject: [PATCH] fix 'inline' is not at beginning of declaration + +Fix build warning on 6.12 kernel: + +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_vmmc-1.9.0/src/mps/drv_mps_vmmc_common.c:58:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration] + 58 | static void inline bsp_mask_and_ack_irq(int x) + | ^~~~~~ + +Signed-off-by: Shiji Yang +--- + src/mps/drv_mps_vmmc_common.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/mps/drv_mps_vmmc_common.c ++++ b/src/mps/drv_mps_vmmc_common.c +@@ -55,7 +55,7 @@ + # define bsp_mask_and_ack_irq ltq_mask_and_ack_irq + #else + extern void ltq_mask_and_ack_irq(struct irq_data *d); +-static void inline bsp_mask_and_ack_irq(int x) ++static inline void bsp_mask_and_ack_irq(int x) + { + struct irq_data d; + d.hwirq = x; From 13b81e124ccad72e9ba12012e04d0dd997ef8b67 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:19 +0800 Subject: [PATCH 59/87] ltq-vdsl-vr9: fix missing-prototypes warnings * Mark some functions as static. * Include function prototypes header file. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 262917ef347fed2c7622fd813c32368bced41133) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- .../303-fix-missing-prototypes-warning.patch | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 package/kernel/lantiq/ltq-vdsl-vr9/patches/303-fix-missing-prototypes-warning.patch diff --git a/package/kernel/lantiq/ltq-vdsl-vr9/patches/303-fix-missing-prototypes-warning.patch b/package/kernel/lantiq/ltq-vdsl-vr9/patches/303-fix-missing-prototypes-warning.patch new file mode 100644 index 0000000000..013dffcb87 --- /dev/null +++ b/package/kernel/lantiq/ltq-vdsl-vr9/patches/303-fix-missing-prototypes-warning.patch @@ -0,0 +1,100 @@ +From: Shiji Yang +Date: Fri, 9 May 2025 02:48:52 +0800 +Subject: [PATCH] fix missing-prototypes warning + +This patch fixes various missing-prototypes build warnings on +6.12 kernel. + +Signed-off-by: Shiji Yang +--- + src/common/drv_dsl_cpe_api.c | 12 ++++++------ + src/common/drv_dsl_cpe_os_linux.c | 4 ++-- + src/g997/drv_dsl_cpe_api_g997_vrx.c | 1 + + 3 files changed, 9 insertions(+), 8 deletions(-) + +--- a/src/common/drv_dsl_cpe_api.c ++++ b/src/common/drv_dsl_cpe_api.c +@@ -2871,7 +2871,7 @@ DSL_Error_t DSL_DRV_LoopLengthStatusGet( + return nErrCode; + } + +-DSL_Error_t DSL_DRV_RetxStatisticsGet( ++static DSL_Error_t DSL_DRV_RetxStatisticsGet( + DSL_IN DSL_Context_t *pContext, + DSL_IN_OUT DSL_ReTxStatistics_t *pData) + { +@@ -3044,7 +3044,7 @@ DSL_Error_t DSL_DRV_SystemInterfaceConfi + \ref DSL_FIO_SYSTEM_INTERFACE_STATUS_GET + */ + #ifdef INCLUDE_DSL_SYSTEM_INTERFACE +-DSL_Error_t DSL_DRV_SystemInterfaceStatusGet( ++static DSL_Error_t DSL_DRV_SystemInterfaceStatusGet( + DSL_Context_t *pContext, + DSL_SystemInterfaceStatus_t *pData) + { +@@ -4372,7 +4372,7 @@ DSL_Error_t DSL_DRV_DBG_DebugFeatureConf + #endif /* DSL_DEBUG_DISABLE*/ + + #ifdef INCLUDE_DSL_FILTER_DETECTION +-DSL_Error_t DSL_DRV_FilterDetectionDataGet( ++static DSL_Error_t DSL_DRV_FilterDetectionDataGet( + DSL_IN DSL_Context_t *pContext, + DSL_OUT DSL_FilterDetection_t *pData) + { +@@ -4422,7 +4422,7 @@ DSL_Error_t DSL_DRV_FilterDetectionDataG + } + #endif /* INCLUDE_DSL_FILTER_DETECTION */ + +-DSL_Error_t DSL_DRV_HybridSelectionDataGet( ++static DSL_Error_t DSL_DRV_HybridSelectionDataGet( + DSL_IN DSL_Context_t *pContext, + DSL_OUT DSL_HybridSelection_t *pData) + { +@@ -4476,7 +4476,7 @@ DSL_Error_t DSL_DRV_HybridSelectionDataG + return nErrCode; + } + +-DSL_Error_t DSL_DRV_OlrStatisticsGet( ++static DSL_Error_t DSL_DRV_OlrStatisticsGet( + DSL_IN DSL_Context_t *pContext, + DSL_OUT DSL_OlrStatistics_t *pData) + { +@@ -4596,7 +4596,7 @@ DSL_void_t DSL_DRV_InitDataFree( + #endif /* INCLUDE_DSL_INIT_DATA_PREPARE*/ + } + +-DSL_Error_t DSL_DRV_IoctlHandleHelperCall( ++static DSL_Error_t DSL_DRV_IoctlHandleHelperCall( + DSL_OpenContext_t *pOpenCtx, + DSL_Context_t *pContext, + DSL_boolean_t bIsInKernel, +--- a/src/common/drv_dsl_cpe_os_linux.c ++++ b/src/common/drv_dsl_cpe_os_linux.c +@@ -1214,7 +1214,7 @@ static struct class *dsl_class; + static dev_t dsl_devt; + + /* Entry point of driver */ +-int __init DSL_ModuleInit(void) ++static int __init DSL_ModuleInit(void) + { + DSL_int_t i; + +@@ -1262,7 +1262,7 @@ int __init DSL_ModuleInit(void) + return 0; + } + +-void __exit DSL_ModuleCleanup(void) ++static void __exit DSL_ModuleCleanup(void) + { + printk("Module will be unloaded"DSL_DRV_CRLF); + +--- a/src/g997/drv_dsl_cpe_api_g997_vrx.c ++++ b/src/g997/drv_dsl_cpe_api_g997_vrx.c +@@ -11,6 +11,7 @@ + #define DSL_INTERN + + #include "drv_dsl_cpe_api.h" ++#include "drv_dsl_cpe_device_g997.h" + + #ifdef INCLUDE_DSL_CPE_API_VRX + From fc58c9481e77daa747171ca4c582b345c5e03a0f Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:19 +0800 Subject: [PATCH 60/87] ltq-vdsl-vr9-mei: convert platform driver .remove to .remove_new Convert .remove to .remove_new so that it can be compatible with both 6.6 and 6.12 kernels. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 7d6ee4e415de12daa6be56279b686c64c6606353) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...atform-driver-.remove-to-.remove_new.patch | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/405-convert-platform-driver-.remove-to-.remove_new.patch diff --git a/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/405-convert-platform-driver-.remove-to-.remove_new.patch b/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/405-convert-platform-driver-.remove-to-.remove_new.patch new file mode 100644 index 0000000000..9e64e689b6 --- /dev/null +++ b/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/405-convert-platform-driver-.remove-to-.remove_new.patch @@ -0,0 +1,41 @@ +From: Shiji Yang +Date: Fri, 9 May 2025 00:54:48 +0800 +Subject: [PATCH] convert platform driver .remove to .remove_new + +Fix compilation error on 6.12 kernel: + +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_mei_cpe-1.5.17.6/src/drv_mei_cpe_linux.c:2073:23: error: initialization of 'void (*)(struct platform_device *)' from incompatible pointer type 'int (*)(struct platform_device *)' [-Wincompatible-pointer-types] + 2073 | .remove = __exit_p(ltq_dsl_cpe_mei_remove), + | ^~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Shiji Yang +--- + src/drv_mei_cpe_linux.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/src/drv_mei_cpe_linux.c ++++ b/src/drv_mei_cpe_linux.c +@@ -2048,13 +2048,12 @@ static int MEI_InstallProcEntry(unsigned + #endif + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) +-static int __exit ltq_dsl_cpe_mei_remove(struct platform_device *pdev) ++static void __exit ltq_dsl_cpe_mei_remove(struct platform_device *pdev) + { + MEI_module_exit(); + + /* clear platform */ + MEI_DEVICE_CFG_VALUE_SET(platform, e_MEI_DEV_PLATFORM_CONFIG_UNKNOWN); +- return 0; + } + + static const struct of_device_id ltq_dsl_cpe_mei_match[] = { +@@ -2070,7 +2069,7 @@ static struct platform_driver ltq_dsl_cp + .owner = THIS_MODULE, + .of_match_table = ltq_dsl_cpe_mei_match, + }, +- .remove = __exit_p(ltq_dsl_cpe_mei_remove), ++ .remove_new = __exit_p(ltq_dsl_cpe_mei_remove), + }; + + static int __init ltq_dsl_cpe_mei_probe(struct platform_device *pdev) From 045f0bf2e671f3fc1fc52f7702011e78dee47b5a Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:19 +0800 Subject: [PATCH 61/87] ltq-vdsl-vr9-mei: fix ignored-qualifiers build warnings These functions return the register memory addresses. Usually they are fixed values, hence I think it's safe to remove the qualifier "volatile". Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit bcf3f96c024872d2ab67b5f0e36f650e0993d1d8) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...ix-ignored-qualifiers-build-warnings.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/406-fix-ignored-qualifiers-build-warnings.patch diff --git a/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/406-fix-ignored-qualifiers-build-warnings.patch b/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/406-fix-ignored-qualifiers-build-warnings.patch new file mode 100644 index 0000000000..a573dac7be --- /dev/null +++ b/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/406-fix-ignored-qualifiers-build-warnings.patch @@ -0,0 +1,38 @@ +From: Shiji Yang +Date: Fri, 9 May 2025 00:58:00 +0800 +Subject: [PATCH] fix ignored-qualifiers build warnings + +This patch fixes the following build warnings: + +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_mei_cpe-1.5.17.6/src/drv_mei_cpe_mei_access_vrx.c:41:15: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers] + 41 | static inline volatile IFX_uint32_t MEI_RCU_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) + | ^~~~~~~~ +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_mei_cpe-1.5.17.6/src/drv_mei_cpe_mei_access_vrx.c:56:15: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers] + 56 | static inline volatile IFX_uint32_t MEI_RCU_Slave_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) + | ^~~~~~~~ + +Signed-off-by: Shiji Yang +--- + src/drv_mei_cpe_mei_access_vrx.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/src/drv_mei_cpe_mei_access_vrx.c ++++ b/src/drv_mei_cpe_mei_access_vrx.c +@@ -38,7 +38,7 @@ + Local macro definition + ========================================================================= */ + +-static inline volatile IFX_uint32_t MEI_RCU_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) ++static inline IFX_uint32_t MEI_RCU_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) + { + IFX_uint32_t ret = 0; + if (MEI_DEVICE_CFG_IS_PLATFORM(e_MEI_DEV_PLATFORM_CONFIG_VR9)) +@@ -53,7 +53,7 @@ static inline volatile IFX_uint32_t MEI_ + return ret; + } + +-static inline volatile IFX_uint32_t MEI_RCU_Slave_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) ++static inline IFX_uint32_t MEI_RCU_Slave_get(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl) + { + IFX_uint32_t ret = 0; + if (MEI_DEVICE_CFG_IS_PLATFORM(e_MEI_DEV_PLATFORM_CONFIG_VR9)) From a9fde24cbc3cacd4fd8771212f154935fda505d8 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:19 +0800 Subject: [PATCH 62/87] ltq-vdsl-vr9-mei: fix missing prototypes warnings * Mark some functions as static. * Add missing prototypes. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 58e9780f4ce597cb38fdc5bfde865b1b944ce7ef) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- .../ltq-vdsl-vr9-mei/patches/100-compat.patch | 11 ++-- .../407-fix-missing-prototypes-warnings.patch | 53 +++++++++++++++++++ 2 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/407-fix-missing-prototypes-warnings.patch diff --git a/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/100-compat.patch b/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/100-compat.patch index 7e7381a346..e061e68934 100644 --- a/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/100-compat.patch +++ b/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/100-compat.patch @@ -313,17 +313,22 @@ #if (MEI_EXPORT_INTERNAL_API == 1) && (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1) -@@ -59,8 +58,21 @@ extern IFX_int32_t MEI_InternalTcReset( +@@ -58,9 +57,26 @@ extern IFX_int32_t MEI_InternalTcRequest + extern IFX_int32_t MEI_InternalTcReset( MEI_DYN_CNTRL_T *pMeiDynCntrl, MEI_TC_Reset_t *pArgTcReset); - ++struct port_cell_info; ++extern int ifx_mei_atm_showtime_check(int *is_showtime, ++ struct port_cell_info *port_cell, ++ void **xdata_addr); ++ +#if 1 +#include +typedef enum { + LTQ_MEI_SHOWTIME_ENTER, + LTQ_MEI_SHOWTIME_EXIT +} e_ltq_mei_cb_type; -+ + +typedef void (*ltq_mei_atm_showtime_enter_t)(IFX_uint8_t, struct port_cell_info *, void *); +typedef void (*ltq_mei_atm_showtime_exit_t)(IFX_uint8_t); + diff --git a/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/407-fix-missing-prototypes-warnings.patch b/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/407-fix-missing-prototypes-warnings.patch new file mode 100644 index 0000000000..f909e9802a --- /dev/null +++ b/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/407-fix-missing-prototypes-warnings.patch @@ -0,0 +1,53 @@ +From: Shiji Yang +Date: Fri, 9 May 2025 01:10:32 +0800 +Subject: [PATCH] fix missing prototypes warnings + +This patch fixes various missing-prototypes build warnings on +6.12 kernel. + +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_mei_cpe-1.5.17.6/src/drv_mei_cpe_api_atm_ptm_intern.c:314:5: error: no previous prototype for 'ifx_mei_atm_led_blink' [-Werror=missing-prototypes] + 314 | int ifx_mei_atm_led_blink(void) + | ^~~~~~~~~~~~~~~~~~~~~ +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_mei_cpe-1.5.17.6/src/drv_mei_cpe_api_atm_ptm_intern.c:325:5: error: no previous prototype for 'ltq_ifx_mei_atm_showtime_enter_compat' [-Werror=missing-prototypes] + 325 | int ltq_ifx_mei_atm_showtime_enter_compat(IFX_uint8_t dslLineNum, + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/drv_mei_cpe-1.5.17.6/src/drv_mei_cpe_api_atm_ptm_intern.c:334:5: error: no previous prototype for 'ltq_ifx_mei_atm_showtime_exit_compat' [-Werror=missing-prototypes] + 334 | int ltq_ifx_mei_atm_showtime_exit_compat(IFX_uint8_t dslLineNum) { + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Shiji Yang +--- + src/drv_mei_cpe_api_atm_ptm_intern.c | 4 ++-- + src/drv_mei_cpe_api_atm_ptm_intern.h | 1 + + 2 files changed, 3 insertions(+), 2 deletions(-) + +--- a/src/drv_mei_cpe_api_atm_ptm_intern.c ++++ b/src/drv_mei_cpe_api_atm_ptm_intern.c +@@ -322,7 +322,7 @@ int ifx_mei_atm_led_blink(void) + int (*ifx_mei_atm_showtime_enter)(struct port_cell_info *, void *) = NULL; + int (*ifx_mei_atm_showtime_exit)(void) = NULL; + +-int ltq_ifx_mei_atm_showtime_enter_compat(IFX_uint8_t dslLineNum, ++static int ltq_ifx_mei_atm_showtime_enter_compat(IFX_uint8_t dslLineNum, + struct port_cell_info *cellInfo, + void *xdata) { + if (ifx_mei_atm_showtime_enter) +@@ -331,7 +331,7 @@ int ltq_ifx_mei_atm_showtime_enter_compa + return -e_MEI_ERR_OP_FAILED; + } + +-int ltq_ifx_mei_atm_showtime_exit_compat(IFX_uint8_t dslLineNum) { ++static int ltq_ifx_mei_atm_showtime_exit_compat(IFX_uint8_t dslLineNum) { + if (ifx_mei_atm_showtime_exit) + return ifx_mei_atm_showtime_exit(); + +--- a/src/drv_mei_cpe_api_atm_ptm_intern.h ++++ b/src/drv_mei_cpe_api_atm_ptm_intern.h +@@ -61,6 +61,7 @@ struct port_cell_info; + extern int ifx_mei_atm_showtime_check(int *is_showtime, + struct port_cell_info *port_cell, + void **xdata_addr); ++extern int ifx_mei_atm_led_blink(void); + + #if 1 + #include From c9f2a60797c863a36ed3d751b18efbac0fce2f50 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:19 +0800 Subject: [PATCH 63/87] ltq-adsl: add missing header platform_device.h Fix incomplete type error by including the correct header. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 29987d44bb3fb7d3cbe0fd2a4ce1519ceccd6c58) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...add-missing-header-platform_device.h.patch | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 package/kernel/lantiq/ltq-adsl/patches/411-add-missing-header-platform_device.h.patch diff --git a/package/kernel/lantiq/ltq-adsl/patches/411-add-missing-header-platform_device.h.patch b/package/kernel/lantiq/ltq-adsl/patches/411-add-missing-header-platform_device.h.patch new file mode 100644 index 0000000000..b5cd9541f0 --- /dev/null +++ b/package/kernel/lantiq/ltq-adsl/patches/411-add-missing-header-platform_device.h.patch @@ -0,0 +1,25 @@ +From: Shiji Yang +Date: Fri, 9 May 2025 20:01:14 +0800 +Subject: [PATCH] add missing header platform_device.h + +Fix compilation error: + +/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-dsl-danube/drv_dsl_cpe_api-3.24.4.4/src/common/drv_dsl_cpe_os_linux.c:1155:15: error: variable 'ltq_adsl_driver' has initializer but incomplete type + 1155 | static struct platform_driver ltq_adsl_driver = { + | ^~~~~~~~~~~~~~~ + +Signed-off-by: Shiji Yang +--- + src/common/drv_dsl_cpe_os_linux.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/src/common/drv_dsl_cpe_os_linux.c ++++ b/src/common/drv_dsl_cpe_os_linux.c +@@ -13,6 +13,7 @@ + #define DSL_INTERN + #include + #include ++#include + + #include "drv_dsl_cpe_api.h" + #include "drv_dsl_cpe_api_ioctl.h" From 5e196ba5489d5a612d9878816f1efc6e6d705530 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:19 +0800 Subject: [PATCH 64/87] ltq-adsl: silence missing-prototypes warnings There are a lot of missing-prototypes warnings, It's not worth to fix them one by one. Let us just ignore them. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit fb4aa6248f4264b75997ecae5b6d7feb3f8c0fab) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- ...-silence-missing-prototypes-warnings.patch | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 package/kernel/lantiq/ltq-adsl/patches/412-silence-missing-prototypes-warnings.patch diff --git a/package/kernel/lantiq/ltq-adsl/patches/412-silence-missing-prototypes-warnings.patch b/package/kernel/lantiq/ltq-adsl/patches/412-silence-missing-prototypes-warnings.patch new file mode 100644 index 0000000000..8792140055 --- /dev/null +++ b/package/kernel/lantiq/ltq-adsl/patches/412-silence-missing-prototypes-warnings.patch @@ -0,0 +1,32 @@ +From: Shiji Yang +Date: Fri, 9 May 2025 20:58:09 +0800 +Subject: [PATCH] silence missing-prototypes warnings + +This patch silences various missing-prototypes build warnings on +6.12 kernel. + +Signed-off-by: Shiji Yang +--- + src/Makefile.am | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -299,6 +299,8 @@ if KERNEL_2_6 + + drv_dsl_cpe_api_OBJS = "$(subst .c,.o,$(filter %.c,$(drv_dsl_cpe_api_SOURCES)))" + ++PKGFIX_CFLAGS = -Wno-error=missing-prototypes ++ + drv_dsl_cpe_api.ko: $(drv_dsl_cpe_api_SOURCES) + @echo "drv_dsl_cpe_api: Making Linux 2.6.x kernel object" + if test ! -e common/drv_dsl_cpe_api.c ; then \ +@@ -311,7 +313,7 @@ drv_dsl_cpe_api.ko: $(drv_dsl_cpe_api_SO + @echo "# drv_dsl_cpe_api: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild + @echo "obj-m := $(subst .ko,.o,$@)" >> $(PWD)/Kbuild + @echo "$(subst .ko,,$@)-y := $(drv_dsl_cpe_api_OBJS)" >> $(PWD)/Kbuild +- @echo "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(drv_dsl_cpe_api_CFLAGS) $(DSL_DRIVER_INCL_PATH) $(IFXOS_INCLUDE_PATH) -I@abs_srcdir@/include -I$(PWD)/include" >> $(PWD)/Kbuild ++ @echo "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(drv_dsl_cpe_api_CFLAGS) $(PKGFIX_CFLAGS) $(DSL_DRIVER_INCL_PATH) $(IFXOS_INCLUDE_PATH) -I@abs_srcdir@/include -I$(PWD)/include" >> $(PWD)/Kbuild + $(MAKE) ARCH=@KERNEL_ARCH@ -C @KERNEL_BUILD_PATH@ O=@KERNEL_BUILD_PATH@ M=$(PWD) modules + + clean-generic: From 6a54d623f2cfa5dfb5b8f758c8a7b543815e4784 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:19 +0800 Subject: [PATCH 65/87] ltq-adsl-mei: fix 'inline' declaration warning Adjust the 'inline' declaration order to fix the build warning: /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-adsl-mei-danube/ltq-adsl-mei/drv_mei_cpe.c:188:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration] 188 | static void inline MEI_MASK_AND_ACK_IRQ(int x) | ^~~~~~ Signed-off-by: Shiji Yang fix inline declaration warning Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 335a88df64694dd297a49a89fd38ac8d45c48079) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c b/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c index 5ee5b70b47..0add7ea2dc 100644 --- a/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c +++ b/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c @@ -185,7 +185,7 @@ static void *g_xdata_addr = NULL; static u32 *mei_arc_swap_buff = NULL; // holding swap pages extern void ltq_mask_and_ack_irq(struct irq_data *d); -static void inline MEI_MASK_AND_ACK_IRQ(int x) +static inline void MEI_MASK_AND_ACK_IRQ(int x) { struct irq_data d; d.hwirq = x; From fe50cfded0a6f10c871f543eefa8f197d0f9038f Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 10 May 2025 17:19:19 +0800 Subject: [PATCH 66/87] ltq-adsl-mei: fix missing-prototypes warnings * Mark some functions as static. * Add missing prototypes. This patch fixes the following build warnings: /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-adsl-mei-danube/ltq-adsl-mei/drv_mei_cpe.c:1182:1: error: no previous prototype for 'makeCMV' [-Werror=missing-prototypes] 1182 | makeCMV (u8 opcode, u8 group, u16 address, u16 index, int size, u16 * data, u16 *CMVMSG) | ^~~~~~~ /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-adsl-mei-danube/ltq-adsl-mei/drv_mei_cpe.c:1855:1: error: no previous prototype for 'DSL_BSP_ATMLedCBUnregister' [-Werror=missing-prototypes] 1855 | DSL_BSP_ATMLedCBUnregister (int (*ifx_adsl_ledcallback) (void)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-adsl-mei-danube/ltq-adsl-mei/drv_mei_cpe.c:2448:1: error: no previous prototype for 'IFX_MEI_Ioctls' [-Werror=missing-prototypes] 2448 | IFX_MEI_Ioctls (DSL_DEV_Device_t * pDev, int from_kernel, unsigned int command, unsigned long lon) | ^~~~~~~~~~~~~~ /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-adsl-mei-danube/ltq-adsl-mei/drv_mei_cpe.c:2699:5: error: no previous prototype for 'ifx_mei_atm_led_blink' [-Werror=missing-prototypes] 2699 | int ifx_mei_atm_led_blink(void) | ^~~~~~~~~~~~~~~~~~~~~ /home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-adsl-mei-danube/ltq-adsl-mei/drv_mei_cpe.c:2705:5: error: no previous prototype for 'ifx_mei_atm_showtime_check' [-Werror=missing-prototypes] 2705 | int ifx_mei_atm_showtime_check(int *is_showtime, struct port_cell_info *port_cell, void **xdata_addr) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko (cherry picked from commit 8cf0c810fb168d0bdb33715caf0fc05ef10cb3f0) Signed-off-by: Nora Matthias Schiffer Link: https://github.com/openwrt/openwrt/pull/20440 Signed-off-by: Hauke Mehrtens --- package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c | 4 ++-- .../kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c b/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c index 0add7ea2dc..05d1efd6f7 100644 --- a/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c +++ b/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c @@ -1178,7 +1178,7 @@ DSL_BSP_AdslLedSet (DSL_DEV_Device_t * dev, DSL_DEV_LedId_t led_number, DSL_DEV_ * \param CMVMSG The pointer to message buffer. * \ingroup Internal */ -void +static void makeCMV (u8 opcode, u8 group, u16 address, u16 index, int size, u16 * data, u16 *CMVMSG) { memset (CMVMSG, 0, MSG_LENGTH * 2); @@ -2451,7 +2451,7 @@ IFX_MEI_IoctlCopyTo (int from_kernel, char *dest, char *from, int size) return ret; } -int +static int IFX_MEI_Ioctls (DSL_DEV_Device_t * pDev, int from_kernel, unsigned int command, unsigned long lon) { int i = 0; diff --git a/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h b/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h index c591bdfb22..ec4c4429ba 100644 --- a/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h +++ b/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h @@ -618,6 +618,9 @@ extern DSL_DEV_MeiError_t DSL_BSP_Showtime(DSL_DEV_Device_t *, DSL_uint32_t, DSL extern int DSL_BSP_ATMLedCBRegister( int (*ifx_adsl_ledcallback)(void)); extern DSL_DEV_MeiError_t DSL_BSP_MemoryDebugAccess(DSL_DEV_Device_t *, DSL_BSP_MemoryAccessType_t, DSL_uint32_t, DSL_uint32_t *, DSL_uint32_t); extern volatile DSL_DEV_Device_t *adsl_dev; +extern int DSL_BSP_ATMLedCBUnregister (int (*ifx_adsl_ledcallback) (void)); +extern int ifx_mei_atm_led_blink(void); +extern int ifx_mei_atm_showtime_check(int *is_showtime, struct port_cell_info *port_cell, void **xdata_addr); /** * Dummy structure by now to show mechanism of extended data that will be From e001b31163a77683ee741d169f794cfa50926f37 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Tue, 14 Oct 2025 00:32:26 +0200 Subject: [PATCH 67/87] ltq-ptm: Fix unprivileged local user memory read and write Use the copy_from_user() and copy_to_user() functions for accessing memory provided by the user in the ptm netdev iotls. In addition also check for root permission before executing ioctl. Suggested-by: Stanislav Fort from Aisle Research Reported-by: Stanislav Fort from Aisle Research Signed-off-by: Hauke Mehrtens (cherry picked from commit 2a76abc5442e3f74d95b4caa9bb57e5488fc132e) --- .../100-fix-compilation-warning-debugfs.patch | 6 +- ...fix-more-compilation-warning-debugfs.patch | 8 +- .../lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c | 105 ++++++++++++------ .../lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c | 62 +++++++---- 4 files changed, 117 insertions(+), 64 deletions(-) diff --git a/package/kernel/lantiq/ltq-ptm/patches/100-fix-compilation-warning-debugfs.patch b/package/kernel/lantiq/ltq-ptm/patches/100-fix-compilation-warning-debugfs.patch index 7317d51163..94de9a67b3 100644 --- a/package/kernel/lantiq/ltq-ptm/patches/100-fix-compilation-warning-debugfs.patch +++ b/package/kernel/lantiq/ltq-ptm/patches/100-fix-compilation-warning-debugfs.patch @@ -1,6 +1,6 @@ --- a/ifxmips_ptm_adsl.c +++ b/ifxmips_ptm_adsl.c -@@ -175,9 +175,11 @@ static INLINE void mailbox_signal(unsign +@@ -177,9 +177,11 @@ static INLINE void mailbox_signal(unsign */ static INLINE void proc_file_create(void); static INLINE void proc_file_delete(void); @@ -12,7 +12,7 @@ #if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC static int proc_read_genconf(char *, char **, off_t, int, int *, void *); #endif -@@ -896,6 +898,7 @@ static INLINE void proc_file_delete(void +@@ -927,6 +929,7 @@ static INLINE void proc_file_delete(void remove_proc_entry("driver/ifx_ptm", NULL); } @@ -20,7 +20,7 @@ static int proc_read_version(char *buf, char **start, off_t offset, int count, int *eof, void *data) { int len = 0; -@@ -970,8 +973,9 @@ static int proc_write_wanmib(struct file +@@ -1001,8 +1004,9 @@ static int proc_write_wanmib(struct file return count; } diff --git a/package/kernel/lantiq/ltq-ptm/patches/101-fix-more-compilation-warning-debugfs.patch b/package/kernel/lantiq/ltq-ptm/patches/101-fix-more-compilation-warning-debugfs.patch index 538d569cbe..a42dc9d56a 100644 --- a/package/kernel/lantiq/ltq-ptm/patches/101-fix-more-compilation-warning-debugfs.patch +++ b/package/kernel/lantiq/ltq-ptm/patches/101-fix-more-compilation-warning-debugfs.patch @@ -1,6 +1,6 @@ --- a/ifxmips_ptm_adsl.c +++ b/ifxmips_ptm_adsl.c -@@ -180,7 +180,7 @@ static int proc_read_version(char *, cha +@@ -182,7 +182,7 @@ static int proc_read_version(char *, cha static int proc_read_wanmib(char *, char **, off_t, int, int *, void *); static int proc_write_wanmib(struct file *, const char *, unsigned long, void *); #endif @@ -9,7 +9,7 @@ static int proc_read_genconf(char *, char **, off_t, int, int *, void *); #endif #if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC -@@ -191,8 +191,8 @@ static int proc_write_wanmib(struct file +@@ -193,8 +193,8 @@ static int proc_write_wanmib(struct file /* * Proc Help Functions */ @@ -19,7 +19,7 @@ static INLINE int strincmp(const char *, const char *, int); #endif static INLINE int ifx_ptm_version(char *); -@@ -1166,8 +1166,6 @@ static int proc_write_dbg(struct file *f +@@ -1197,8 +1197,6 @@ static int proc_write_dbg(struct file *f return count; } @@ -28,7 +28,7 @@ static INLINE int stricmp(const char *p1, const char *p2) { int c1, c2; -@@ -1185,7 +1183,6 @@ static INLINE int stricmp(const char *p1 +@@ -1216,7 +1214,6 @@ static INLINE int stricmp(const char *p1 return *p1 - *p2; } diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c index 5e5535348d..05e8106984 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c @@ -46,6 +46,8 @@ #include #include #include +#include +#include #include /* @@ -463,56 +465,85 @@ static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, void __user *dat { int ndev; + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + for ( ndev = 0; ndev < ARRAY_SIZE(g_net_dev) && g_net_dev[ndev] != dev; ndev++ ); ASSERT(ndev >= 0 && ndev < ARRAY_SIZE(g_net_dev), "ndev = %d (wrong value)", ndev); switch ( cmd ) { case IFX_PTM_MIB_CW_GET: - ((PTM_CW_IF_ENTRY_T *)data)->ifRxNoIdleCodewords = WAN_MIB_TABLE[ndev].wrx_nonidle_cw; - ((PTM_CW_IF_ENTRY_T *)data)->ifRxIdleCodewords = WAN_MIB_TABLE[ndev].wrx_idle_cw; - ((PTM_CW_IF_ENTRY_T *)data)->ifRxCodingViolation = WAN_MIB_TABLE[ndev].wrx_err_cw; - ((PTM_CW_IF_ENTRY_T *)data)->ifTxNoIdleCodewords = 0; - ((PTM_CW_IF_ENTRY_T *)data)->ifTxIdleCodewords = 0; + { + PTM_CW_IF_ENTRY_T tmp = {0}; + + tmp.ifRxNoIdleCodewords = WAN_MIB_TABLE[ndev].wrx_nonidle_cw; + tmp.ifRxIdleCodewords = WAN_MIB_TABLE[ndev].wrx_idle_cw; + tmp.ifRxCodingViolation = WAN_MIB_TABLE[ndev].wrx_err_cw; + tmp.ifTxNoIdleCodewords = 0; + tmp.ifTxIdleCodewords = 0; + + if (copy_to_user(data, &tmp, sizeof(tmp))) + return -EFAULT; + } break; case IFX_PTM_MIB_FRAME_GET: - ((PTM_FRAME_MIB_T *)data)->RxCorrect = WAN_MIB_TABLE[ndev].wrx_correct_pdu; - ((PTM_FRAME_MIB_T *)data)->TC_CrcError = WAN_MIB_TABLE[ndev].wrx_tccrc_err_pdu; - ((PTM_FRAME_MIB_T *)data)->RxDropped = WAN_MIB_TABLE[ndev].wrx_nodesc_drop_pdu + WAN_MIB_TABLE[ndev].wrx_len_violation_drop_pdu; - ((PTM_FRAME_MIB_T *)data)->TxSend = WAN_MIB_TABLE[ndev].wtx_total_pdu; + { + PTM_FRAME_MIB_T tmp = {0}; + + tmp.RxCorrect = WAN_MIB_TABLE[ndev].wrx_correct_pdu; + tmp.TC_CrcError = WAN_MIB_TABLE[ndev].wrx_tccrc_err_pdu; + tmp.RxDropped = WAN_MIB_TABLE[ndev].wrx_nodesc_drop_pdu + WAN_MIB_TABLE[ndev].wrx_len_violation_drop_pdu; + tmp.TxSend = WAN_MIB_TABLE[ndev].wtx_total_pdu; + if (copy_to_user(data, &tmp, sizeof(tmp))) + return -EFAULT; + } break; case IFX_PTM_CFG_GET: - ((IFX_PTM_CFG_T *)data)->RxEthCrcPresent = CFG_ETH_EFMTC_CRC->rx_eth_crc_present; - ((IFX_PTM_CFG_T *)data)->RxEthCrcCheck = CFG_ETH_EFMTC_CRC->rx_eth_crc_check; - ((IFX_PTM_CFG_T *)data)->RxTcCrcCheck = CFG_ETH_EFMTC_CRC->rx_tc_crc_check; - ((IFX_PTM_CFG_T *)data)->RxTcCrcLen = CFG_ETH_EFMTC_CRC->rx_tc_crc_len; - ((IFX_PTM_CFG_T *)data)->TxEthCrcGen = CFG_ETH_EFMTC_CRC->tx_eth_crc_gen; - ((IFX_PTM_CFG_T *)data)->TxTcCrcGen = CFG_ETH_EFMTC_CRC->tx_tc_crc_gen; - ((IFX_PTM_CFG_T *)data)->TxTcCrcLen = CFG_ETH_EFMTC_CRC->tx_tc_crc_len; + { + IFX_PTM_CFG_T tmp = {0}; + + tmp.RxEthCrcPresent = CFG_ETH_EFMTC_CRC->rx_eth_crc_present; + tmp.RxEthCrcCheck = CFG_ETH_EFMTC_CRC->rx_eth_crc_check; + tmp.RxTcCrcCheck = CFG_ETH_EFMTC_CRC->rx_tc_crc_check; + tmp.RxTcCrcLen = CFG_ETH_EFMTC_CRC->rx_tc_crc_len; + tmp.TxEthCrcGen = CFG_ETH_EFMTC_CRC->tx_eth_crc_gen; + tmp.TxTcCrcGen = CFG_ETH_EFMTC_CRC->tx_tc_crc_gen; + tmp.TxTcCrcLen = CFG_ETH_EFMTC_CRC->tx_tc_crc_len; + if (copy_to_user(data, &tmp, sizeof(tmp))) + return -EFAULT; + } break; case IFX_PTM_CFG_SET: - CFG_ETH_EFMTC_CRC->rx_eth_crc_present = ((IFX_PTM_CFG_T *)data)->RxEthCrcPresent ? 1 : 0; - CFG_ETH_EFMTC_CRC->rx_eth_crc_check = ((IFX_PTM_CFG_T *)data)->RxEthCrcCheck ? 1 : 0; - if ( ((IFX_PTM_CFG_T *)data)->RxTcCrcCheck && (((IFX_PTM_CFG_T *)data)->RxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)data)->RxTcCrcLen == 32) ) { - CFG_ETH_EFMTC_CRC->rx_tc_crc_check = 1; - CFG_ETH_EFMTC_CRC->rx_tc_crc_len = ((IFX_PTM_CFG_T *)data)->RxTcCrcLen; - } - else - { - CFG_ETH_EFMTC_CRC->rx_tc_crc_check = 0; - CFG_ETH_EFMTC_CRC->rx_tc_crc_len = 0; - } - CFG_ETH_EFMTC_CRC->tx_eth_crc_gen = ((IFX_PTM_CFG_T *)data)->TxEthCrcGen ? 1 : 0; - if ( ((IFX_PTM_CFG_T *)data)->TxTcCrcGen && (((IFX_PTM_CFG_T *)data)->TxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)data)->TxTcCrcLen == 32) ) - { - CFG_ETH_EFMTC_CRC->tx_tc_crc_gen = 1; - CFG_ETH_EFMTC_CRC->tx_tc_crc_len = ((IFX_PTM_CFG_T *)data)->TxTcCrcLen; - } - else - { - CFG_ETH_EFMTC_CRC->tx_tc_crc_gen = 0; - CFG_ETH_EFMTC_CRC->tx_tc_crc_len = 0; + IFX_PTM_CFG_T cfg = {0}; + + if (copy_from_user(&cfg, data, sizeof(cfg))) + return -EFAULT; + + CFG_ETH_EFMTC_CRC->rx_eth_crc_present = cfg.RxEthCrcPresent ? 1 : 0; + CFG_ETH_EFMTC_CRC->rx_eth_crc_check = cfg.RxEthCrcCheck ? 1 : 0; + if ( cfg.RxTcCrcCheck && (cfg.RxTcCrcLen == 16 || cfg.RxTcCrcLen == 32) ) + { + CFG_ETH_EFMTC_CRC->rx_tc_crc_check = 1; + CFG_ETH_EFMTC_CRC->rx_tc_crc_len = cfg.RxTcCrcLen; + } + else + { + CFG_ETH_EFMTC_CRC->rx_tc_crc_check = 0; + CFG_ETH_EFMTC_CRC->rx_tc_crc_len = 0; + } + CFG_ETH_EFMTC_CRC->tx_eth_crc_gen = cfg.TxEthCrcGen ? 1 : 0; + if ( cfg.TxTcCrcGen && (cfg.TxTcCrcLen == 16 || cfg.TxTcCrcLen == 32) ) + { + CFG_ETH_EFMTC_CRC->tx_tc_crc_gen = 1; + CFG_ETH_EFMTC_CRC->tx_tc_crc_len = cfg.TxTcCrcLen; + } + else + { + CFG_ETH_EFMTC_CRC->tx_tc_crc_gen = 0; + CFG_ETH_EFMTC_CRC->tx_tc_crc_len = 0; + } } break; default: diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c index c5bbd9fd87..edd4108de1 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c @@ -381,14 +381,24 @@ static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, void __user *dat { ASSERT(dev == g_net_dev[0], "incorrect device"); + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + switch ( cmd ) { case IFX_PTM_MIB_CW_GET: - ((PTM_CW_IF_ENTRY_T *)data)->ifRxNoIdleCodewords = IFX_REG_R32(DREG_AR_CELL0) + IFX_REG_R32(DREG_AR_CELL1); - ((PTM_CW_IF_ENTRY_T *)data)->ifRxIdleCodewords = IFX_REG_R32(DREG_AR_IDLE_CNT0) + IFX_REG_R32(DREG_AR_IDLE_CNT1); - ((PTM_CW_IF_ENTRY_T *)data)->ifRxCodingViolation = IFX_REG_R32(DREG_AR_CVN_CNT0) + IFX_REG_R32(DREG_AR_CVN_CNT1) + IFX_REG_R32(DREG_AR_CVNP_CNT0) + IFX_REG_R32(DREG_AR_CVNP_CNT1); - ((PTM_CW_IF_ENTRY_T *)data)->ifTxNoIdleCodewords = IFX_REG_R32(DREG_AT_CELL0) + IFX_REG_R32(DREG_AT_CELL1); - ((PTM_CW_IF_ENTRY_T *)data)->ifTxIdleCodewords = IFX_REG_R32(DREG_AT_IDLE_CNT0) + IFX_REG_R32(DREG_AT_IDLE_CNT1); + { + PTM_CW_IF_ENTRY_T tmp = {0}; + + tmp.ifRxNoIdleCodewords = IFX_REG_R32(DREG_AR_CELL0) + IFX_REG_R32(DREG_AR_CELL1); + tmp.ifRxIdleCodewords = IFX_REG_R32(DREG_AR_IDLE_CNT0) + IFX_REG_R32(DREG_AR_IDLE_CNT1); + tmp.ifRxCodingViolation = IFX_REG_R32(DREG_AR_CVN_CNT0) + IFX_REG_R32(DREG_AR_CVN_CNT1) + IFX_REG_R32(DREG_AR_CVNP_CNT0) + IFX_REG_R32(DREG_AR_CVNP_CNT1); + tmp.ifTxNoIdleCodewords = IFX_REG_R32(DREG_AT_CELL0) + IFX_REG_R32(DREG_AT_CELL1); + tmp.ifTxIdleCodewords = IFX_REG_R32(DREG_AT_IDLE_CNT0) + IFX_REG_R32(DREG_AT_IDLE_CNT1); + + if (copy_to_user(data, &tmp, sizeof(tmp))) + return -EFAULT; + } break; case IFX_PTM_MIB_FRAME_GET: { @@ -401,38 +411,50 @@ static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, void __user *dat for ( i = 0; i < 8; i++ ) tmp.TxSend += WAN_TX_MIB_TABLE(i)->wtx_total_pdu; - *((PTM_FRAME_MIB_T *)data) = tmp; + if (copy_to_user(data, &tmp, sizeof(tmp))) + return -EFAULT; } break; case IFX_PTM_CFG_GET: - // use bear channel 0 preemption gamma interface settings - ((IFX_PTM_CFG_T *)data)->RxEthCrcPresent = 1; - ((IFX_PTM_CFG_T *)data)->RxEthCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_eth_fcs_ver_dis == 0 ? 1 : 0; - ((IFX_PTM_CFG_T *)data)->RxTcCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis == 0 ? 1 : 0;; - ((IFX_PTM_CFG_T *)data)->RxTcCrcLen = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size == 0 ? 0 : (RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size * 16); - ((IFX_PTM_CFG_T *)data)->TxEthCrcGen = TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis == 0 ? 1 : 0; - ((IFX_PTM_CFG_T *)data)->TxTcCrcGen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : 1; - ((IFX_PTM_CFG_T *)data)->TxTcCrcLen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : (TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size * 16); + { + IFX_PTM_CFG_T tmp = {0}; + + // use bear channel 0 preemption gamma interface settings + tmp.RxEthCrcPresent = 1; + tmp.RxEthCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_eth_fcs_ver_dis == 0 ? 1 : 0; + tmp.RxTcCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis == 0 ? 1 : 0; + tmp.RxTcCrcLen = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size == 0 ? 0 : (RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size * 16); + tmp.TxEthCrcGen = TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis == 0 ? 1 : 0; + tmp.TxTcCrcGen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : 1; + tmp.TxTcCrcLen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : (TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size * 16); + + if (copy_to_user(data, &tmp, sizeof(tmp))) + return -EFAULT; + } break; case IFX_PTM_CFG_SET: { + IFX_PTM_CFG_T cfg; int i; + if (copy_from_user(&cfg, data, sizeof(cfg))) + return -EFAULT; + for ( i = 0; i < 4; i++ ) { - RX_GAMMA_ITF_CFG(i)->rx_eth_fcs_ver_dis = ((IFX_PTM_CFG_T *)data)->RxEthCrcCheck ? 0 : 1; + RX_GAMMA_ITF_CFG(i)->rx_eth_fcs_ver_dis = cfg.RxEthCrcCheck ? 0 : 1; - RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis = ((IFX_PTM_CFG_T *)data)->RxTcCrcCheck ? 0 : 1; + RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis = cfg.RxTcCrcCheck ? 0 : 1; - switch ( ((IFX_PTM_CFG_T *)data)->RxTcCrcLen ) { + switch ( cfg.RxTcCrcLen ) { case 16: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 1; break; case 32: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 2; break; default: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 0; } - TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis = ((IFX_PTM_CFG_T *)data)->TxEthCrcGen ? 0 : 1; + TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis = cfg.TxEthCrcGen ? 0 : 1; - if ( ((IFX_PTM_CFG_T *)data)->TxTcCrcGen ) { - switch ( ((IFX_PTM_CFG_T *)data)->TxTcCrcLen ) { + if ( cfg.TxTcCrcGen ) { + switch ( cfg.TxTcCrcLen ) { case 16: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 1; break; case 32: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 2; break; default: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 0; From 1a8d3ea89c3ee4c8e109672debe6a70b94522cba Mon Sep 17 00:00:00 2001 From: Magnus Kroken Date: Thu, 16 Oct 2025 16:11:11 +0200 Subject: [PATCH 68/87] mbedtls: update to 3.6.5 This release includes fixes for security issues. Mbed TLS 3.6 is a long-term support (LTS) branch. It will be supported with bug-fixes and security fixes until at least March 2027. The two issues fixed were timing side channels: * Padding oracle through timing of cipher error reporting (CVE-2025-59438) [1] * Side channel in RSA key generation and operations (SSBleed, M-Step) (CVE-2025-54764) [2] Bug fixes: * Fix potential CMake parallel build failure when building both the static and shared libraries. * Fix a build error or incorrect TLS session lifetime on platforms where mbedtls_time_t is not time_t. [1]: https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2025-10-invalid-padding-error/ [2]: https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2025-10-ssbleed-mstep/ Full release announcement: https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.5 Tested-by: Edoardo Pinci Signed-off-by: Magnus Kroken Link: https://github.com/openwrt/openwrt/pull/20425 Signed-off-by: Hauke Mehrtens (cherry picked from commit eb370a7d0230cc2824685d19f28548d81726f2cd) --- package/libs/mbedtls/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index d6dc0f7805..cc5c2b78f0 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mbedtls -PKG_VERSION:=3.6.4 +PKG_VERSION:=3.6.5 PKG_RELEASE:=1 PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL=https://github.com/Mbed-TLS/$(PKG_NAME)/releases/download/$(PKG_NAME)-$(PKG_VERSION) -PKG_HASH:=ec35b18a6c593cf98c3e30db8b98ff93e8940a8c4e690e66b41dfc011d678110 +PKG_HASH:=4a11f1777bb95bf4ad96721cac945a26e04bf19f57d905f241fe77ebeddf46d8 PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=LICENSE From 225b6724cdf1de73ca6fba1d598efafd841f5bf5 Mon Sep 17 00:00:00 2001 From: Andrea Pesaresi Date: Sat, 11 Oct 2025 10:07:42 +0200 Subject: [PATCH 69/87] kernel: ksmbd: browse-interfaces-list-on-FSCTL_QUERY_INTERFACE_INFO backport from kernel 6.12 ksmbd.mount will give each interfaces list and bind_interfaces_only flags to ksmbd server. Previously, the interfaces list was sent only when bind_interfaces_only was enabled. ksmbd server browse only interfaces list given from ksmbd.conf on FSCTL_QUERY_INTERFACE_INFO IOCTL. Signed-off-by: Andrea Pesaresi Link: https://github.com/openwrt/openwrt/pull/20377 (cherry picked from commit 711e14af799c126f7be93228c395e4ac9518f131) Link: https://github.com/openwrt/openwrt/pull/20442 Signed-off-by: Hauke Mehrtens --- ...s-list-on-FSCTL_QUERY_INTERFACE_INFO.patch | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 target/linux/generic/backport-6.6/540-v6.12-ksmbd-browse-interfaces-list-on-FSCTL_QUERY_INTERFACE_INFO.patch diff --git a/target/linux/generic/backport-6.6/540-v6.12-ksmbd-browse-interfaces-list-on-FSCTL_QUERY_INTERFACE_INFO.patch b/target/linux/generic/backport-6.6/540-v6.12-ksmbd-browse-interfaces-list-on-FSCTL_QUERY_INTERFACE_INFO.patch new file mode 100644 index 0000000000..3c24f6315c --- /dev/null +++ b/target/linux/generic/backport-6.6/540-v6.12-ksmbd-browse-interfaces-list-on-FSCTL_QUERY_INTERFACE_INFO.patch @@ -0,0 +1,35 @@ +From 0fc403192dcc8def1f6284959141608ac4c86699 Mon Sep 17 00:00:00 2001 +From: Namjae Jeon +Date: Fri, 10 Jan 2025 13:37:05 +0900 +Subject: ksmbd: browse interfaces list on FSCTL_QUERY_INTERFACE_INFO IOCTL + +[ Upstream commit b2d99376c5d61eb60ffdb6c503e4b6c8f9712ddd ] + +ksmbd.mount will give each interfaces list and bind_interfaces_only flags +to ksmbd server. Previously, the interfaces list was sent only +when bind_interfaces_only was enabled. +ksmbd server browse only interfaces list given from ksmbd.conf on +FSCTL_QUERY_INTERFACE_INFO IOCTL. + +Signed-off-by: Namjae Jeon +Signed-off-by: Steve French +Stable-dep-of: 21a4e47578d4 ("ksmbd: fix use-after-free in __smb2_lease_break_noti()") +Signed-off-by: Sasha Levin +--- + fs/smb/server/ksmbd_netlink.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +(limited to 'fs/smb/server/ksmbd_netlink.h') + +--- a/fs/smb/server/ksmbd_netlink.h ++++ b/fs/smb/server/ksmbd_netlink.h +@@ -108,7 +108,8 @@ struct ksmbd_startup_request { + __u32 smb2_max_credits; /* MAX credits */ + __u32 smbd_max_io_size; /* smbd read write size */ + __u32 max_connections; /* Number of maximum simultaneous connections */ +- __u32 reserved[126]; /* Reserved room */ ++ __s8 bind_interfaces_only; ++ __s8 reserved[503]; /* Reserved room */ + __u32 ifc_list_sz; /* interfaces list size */ + __s8 ____payload[]; + }; From d6f72e0cbba91a9979348ec71236b477ea6bff54 Mon Sep 17 00:00:00 2001 From: Andrea Pesaresi Date: Sat, 11 Oct 2025 10:10:29 +0200 Subject: [PATCH 70/87] kernel: ksmbd: add max ip connection parameter With this patch is set the maximum number of connections per ip address instead of no control. The default is 8. Signed-off-by: Andrea Pesaresi Link: https://github.com/openwrt/openwrt/pull/20377 (cherry picked from commit e78f000869f1858b9bdf2a72daf2c7e27bfb4b82) Link: https://github.com/openwrt/openwrt/pull/20442 Signed-off-by: Hauke Mehrtens --- ...mbd-add-max-ip-connections-parameter.patch | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 target/linux/generic/backport-6.6/541-v6.18-ksmbd-add-max-ip-connections-parameter.patch diff --git a/target/linux/generic/backport-6.6/541-v6.18-ksmbd-add-max-ip-connections-parameter.patch b/target/linux/generic/backport-6.6/541-v6.18-ksmbd-add-max-ip-connections-parameter.patch new file mode 100644 index 0000000000..473bfd2f15 --- /dev/null +++ b/target/linux/generic/backport-6.6/541-v6.18-ksmbd-add-max-ip-connections-parameter.patch @@ -0,0 +1,119 @@ +From d8b6dc9256762293048bf122fc11c4e612d0ef5d Mon Sep 17 00:00:00 2001 +From: Namjae Jeon +Date: Wed, 1 Oct 2025 09:25:35 +0900 +Subject: ksmbd: add max ip connections parameter + +This parameter set the maximum number of connections per ip address. +The default is 8. + +Cc: stable@vger.kernel.org +Fixes: c0d41112f1a5 ("ksmbd: extend the connection limiting mechanism to support IPv6") +Signed-off-by: Namjae Jeon +Signed-off-by: Steve French +--- + fs/smb/server/ksmbd_netlink.h | 5 +++-- + fs/smb/server/server.h | 1 + + fs/smb/server/transport_ipc.c | 3 +++ + fs/smb/server/transport_tcp.c | 27 ++++++++++++++++----------- + 4 files changed, 23 insertions(+), 13 deletions(-) + +(limited to 'fs/smb') + +--- a/fs/smb/server/ksmbd_netlink.h ++++ b/fs/smb/server/ksmbd_netlink.h +@@ -109,10 +109,11 @@ struct ksmbd_startup_request { + __u32 smbd_max_io_size; /* smbd read write size */ + __u32 max_connections; /* Number of maximum simultaneous connections */ + __s8 bind_interfaces_only; +- __s8 reserved[503]; /* Reserved room */ ++ __u32 max_ip_connections; /* Number of maximum connection per ip address */ ++ __s8 reserved[499]; /* Reserved room */ + __u32 ifc_list_sz; /* interfaces list size */ + __s8 ____payload[]; +-}; ++} __packed; + + #define KSMBD_STARTUP_CONFIG_INTERFACES(s) ((s)->____payload) + +--- a/fs/smb/server/server.h ++++ b/fs/smb/server/server.h +@@ -43,6 +43,7 @@ struct ksmbd_server_config { + unsigned int auth_mechs; + unsigned int max_connections; + unsigned int max_inflight_req; ++ unsigned int max_ip_connections; + + char *conf[SERVER_CONF_WORK_GROUP + 1]; + }; +--- a/fs/smb/server/transport_ipc.c ++++ b/fs/smb/server/transport_ipc.c +@@ -321,6 +321,9 @@ static int ipc_server_config_on_startup( + if (req->max_connections) + server_conf.max_connections = req->max_connections; + ++ if (req->max_ip_connections) ++ server_conf.max_ip_connections = req->max_ip_connections; ++ + ret = ksmbd_set_netbios_name(req->netbios_name); + ret |= ksmbd_set_server_string(req->server_string); + ret |= ksmbd_set_work_group(req->work_group); +--- a/fs/smb/server/transport_tcp.c ++++ b/fs/smb/server/transport_tcp.c +@@ -240,6 +240,7 @@ static int ksmbd_kthread_fn(void *p) + struct interface *iface = (struct interface *)p; + struct ksmbd_conn *conn; + int ret; ++ unsigned int max_ip_conns; + + while (!kthread_should_stop()) { + mutex_lock(&iface->sock_release_lock); +@@ -257,34 +258,38 @@ static int ksmbd_kthread_fn(void *p) + continue; + } + ++ if (!server_conf.max_ip_connections) ++ goto skip_max_ip_conns_limit; ++ + /* + * Limits repeated connections from clients with the same IP. + */ ++ max_ip_conns = 0; + down_read(&conn_list_lock); +- list_for_each_entry(conn, &conn_list, conns_list) ++ list_for_each_entry(conn, &conn_list, conns_list) { + #if IS_ENABLED(CONFIG_IPV6) + if (client_sk->sk->sk_family == AF_INET6) { + if (memcmp(&client_sk->sk->sk_v6_daddr, +- &conn->inet6_addr, 16) == 0) { +- ret = -EAGAIN; +- break; +- } ++ &conn->inet6_addr, 16) == 0) ++ max_ip_conns++; + } else if (inet_sk(client_sk->sk)->inet_daddr == +- conn->inet_addr) { +- ret = -EAGAIN; +- break; +- } ++ conn->inet_addr) ++ max_ip_conns++; + #else + if (inet_sk(client_sk->sk)->inet_daddr == +- conn->inet_addr) { ++ conn->inet_addr) ++ max_ip_conns++; ++#endif ++ if (server_conf.max_ip_connections <= max_ip_conns) { + ret = -EAGAIN; + break; + } +-#endif ++ } + up_read(&conn_list_lock); + if (ret == -EAGAIN) + continue; + ++skip_max_ip_conns_limit: + if (server_conf.max_connections && + atomic_inc_return(&active_num_conn) >= server_conf.max_connections) { + pr_info_ratelimited("Limit the maximum number of connections(%u)\n", From 0d3076aa19a0f5ebdaa63abb30864cebafbb16bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Mon, 6 Oct 2025 19:41:03 +0000 Subject: [PATCH 71/87] ebtables: fix PKG_MIRROR_HASH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Current PKG_MIRROR_HASH is wrong, but it went unnoticed, because the tarball is being fetched from @OPENWRT project mirrors. Can be reproduced with: make package/ebtables/{download,check} FIXUP=1 DL_DIR=/tmp PKG_MIRROR_HASH='' Signed-off-by: Petr Štetiar Link: https://github.com/openwrt/openwrt/pull/20322 Signed-off-by: Robert Marko (cherry picked from commit 7d4edb21b62a84a3a9442263b3080c3d443e12f7) --- package/network/utils/ebtables/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/utils/ebtables/Makefile b/package/network/utils/ebtables/Makefile index 1eae868d7a..55df72b654 100644 --- a/package/network/utils/ebtables/Makefile +++ b/package/network/utils/ebtables/Makefile @@ -12,9 +12,9 @@ PKG_SOURCE_DATE:=2018-06-27 PKG_RELEASE:=2 PKG_SOURCE_URL:=https://git.netfilter.org/ebtables +PKG_MIRROR_HASH:=3039d73b167c41025b1b401b647743b9c6d786613c693eef34de325b30de6d47 PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=48cff25dfea5b37e16ba5dc6601e98ab140f5f99 -PKG_MIRROR_HASH:=1ee560498e1a047b329eab3dad8425ae51e7f0527e4495efb99481ca11206b37 PKG_LICENSE:=GPL-2.0 PKG_CPE_ID:=cpe:/a:netfilter:ebtables From a46d2efad232cebec2a8aea90234018ce59fe0ae Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 4 Oct 2025 00:08:56 +0200 Subject: [PATCH 72/87] ubus: update to Git HEAD (2025-10-04) 2b69c9859946 examples: CMakeLists: update cmake minimum required version to 3.10 Signed-off-by: Christian Marangi (cherry picked from commit 88fe81bb0caaab8d159805f1f639261f105a7c2a) --- package/system/ubus/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 7e23beb232..4df96e2e86 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -5,10 +5,10 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git -PKG_SOURCE_DATE:=2025-07-02 +PKG_SOURCE_DATE:=2025-10-04 PKG_SOURCE_DATE_ABI:=2025-01-02 -PKG_SOURCE_VERSION:=5952b48e251c0ea76dfce97f129da6f18d889eda -PKG_MIRROR_HASH:=60edfc101eaa85976d243febc368fc419fe44283bd3a743851a6bc7975e881f0 +PKG_SOURCE_VERSION:=2b69c9859946af32cbe89173b71bcecbd1761734 +PKG_MIRROR_HASH:=55170a73d1047fa8785d5e935a279e4ab317196fd3262d329c18593c7a6493da PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE_ABI)) CMAKE_INSTALL:=1 From c8ccf4c6a74f5d98bde3e93b6edac60c725d58ba Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 4 Oct 2025 12:12:52 +0200 Subject: [PATCH 73/87] ubus: update to Git HEAD (2025-10-04) ad2768bbc166 lua: build: require CMake >= 3.10 due to dropped legacy support Signed-off-by: Hauke Mehrtens (cherry picked from commit b00fcf3614d06e5bac3cee3373271be7b9309b86) --- package/system/ubus/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 4df96e2e86..469b0e45f8 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -7,8 +7,8 @@ PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git PKG_SOURCE_DATE:=2025-10-04 PKG_SOURCE_DATE_ABI:=2025-01-02 -PKG_SOURCE_VERSION:=2b69c9859946af32cbe89173b71bcecbd1761734 -PKG_MIRROR_HASH:=55170a73d1047fa8785d5e935a279e4ab317196fd3262d329c18593c7a6493da +PKG_SOURCE_VERSION:=ad2768bbc166b4dcb32665d7b3434d54150b2abc +PKG_MIRROR_HASH:=10e901abdb622c095d0f3199775b2a0e61ff588a3dda31a3a606e2e5ebd82cde PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE_ABI)) CMAKE_INSTALL:=1 From a7901969932a175cded3c93bdeb65f32ed3705e6 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 17 Oct 2025 13:28:52 +0200 Subject: [PATCH 74/87] ubus: update to Git HEAD (2025-10-17) b462895d3157 lua: CMakeLists: drop redundant cmake_minimum_required f247c18f8a55 examples: CMakeLists: drop redundant cmake_minimum_required 83a70399030d github: add CI build d31effb4277b ubusd: Fix out of bounds access in event register message d95837b1b143 ubusd: acl: compare uid/gid instead of user/group strings b81257bb20dd ubusd: load extra group IDs for a client process 7d7b45fea05b add debian/ directory aa4a7ee1d341 ubusd: fix more instances of missing length checks for patterns 60e04048a0e2 ubusd: fix ACL check for receiving events Signed-off-by: Felix Fietkau (cherry picked from commit 4b907e69ea58fc0ba35fd1755dc4ba22262af3a4) --- package/system/ubus/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 469b0e45f8..8e0a3a9e30 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -5,10 +5,10 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git -PKG_SOURCE_DATE:=2025-10-04 +PKG_SOURCE_DATE:=2025-10-17 PKG_SOURCE_DATE_ABI:=2025-01-02 -PKG_SOURCE_VERSION:=ad2768bbc166b4dcb32665d7b3434d54150b2abc -PKG_MIRROR_HASH:=10e901abdb622c095d0f3199775b2a0e61ff588a3dda31a3a606e2e5ebd82cde +PKG_SOURCE_VERSION:=60e04048a0e2f3e33651c19e62861b41be4c290f +PKG_MIRROR_HASH:=2db028305ae58afe184bb01e51d3635898d84ffcd04308a73ce143c05fc7b2db PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE_ABI)) CMAKE_INSTALL:=1 From 39510c21a0025b75240f32e37fa5f4fceb6570a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20H=C3=A4rdeman?= Date: Thu, 11 Sep 2025 23:38:11 +0200 Subject: [PATCH 75/87] odhcpd: update to Git HEAD (2025-08-26) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2859741d971e dhcpv4: store reqopts as uint8_t 6d342cc03bf7 odhcpd: add DNR (RFC 9463) support c89b8b3f2ff3 odhcpd: make the IPv6 RA DNR lifetime configurable 066b3dc6ec1a netlink: fix a memory leak 171140e90b6a odhcpd: add a helper function for addr6/prefix parsing 5585b969c18f router: move pref64 calculations to the config stage 4308384748be dhcpv6: add ipv6 pxe support 6e1ad492cef5 router: replace ssize_t with size_t Signed-off-by: David Härdeman Link: https://github.com/openwrt/openwrt/pull/20022 Signed-off-by: Robert Marko Signed-off-by: Álvaro Fernández Rojas (cherry picked from commit a6da0e0d376bac4c75a3b1401bd52d49e608b891) --- package/network/services/odhcpd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 4092588353..b52757974a 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_MIRROR_HASH:=f6e1c18551a00e01229fa12caa7b3fe33ad82785150fedcbe615fcc651ba2876 -PKG_SOURCE_DATE:=2024-05-08 -PKG_SOURCE_VERSION:=a29882318a4ccb3ae26f7cc0145e06ad4ead224b +PKG_MIRROR_HASH:=16628f3ef435e0157a673740aeb8114476ae29ad248d6f62719b603c63126c35 +PKG_SOURCE_DATE:=2025-08-26 +PKG_SOURCE_VERSION:=6e1ad492cef509649e84cdedd1a3618f04d87e46 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From 81dfcefb41bef2888f7cbe1725da678c44b51b6a Mon Sep 17 00:00:00 2001 From: Ted Hess Date: Thu, 18 Sep 2025 13:01:14 -0400 Subject: [PATCH 76/87] odhcpd: update to Git HEAD (2025-09-16) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit c9816de148cc odhcpd: support multiple per-client MAC addresses Signed-off-by: Ted Hess Signed-off-by: Álvaro Fernández Rojas (cherry picked from commit 9939ebc7fc0ca3a31eddeba5715884cb307fdcad) --- package/network/services/odhcpd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index b52757974a..6bfce48931 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_MIRROR_HASH:=16628f3ef435e0157a673740aeb8114476ae29ad248d6f62719b603c63126c35 -PKG_SOURCE_DATE:=2025-08-26 -PKG_SOURCE_VERSION:=6e1ad492cef509649e84cdedd1a3618f04d87e46 +PKG_MIRROR_HASH:=3bbc3be7bec0336ef50042f7722b580066c31b2d536d335dd2eecf4a1876d2ec +PKG_SOURCE_DATE:=2025-09-16 +PKG_SOURCE_VERSION:=c9816de148cc3e8096e67519d2c081ffeb9b4857 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From 82d31a02b7cf9eb66d246ee4b620efe7fcf2e40e Mon Sep 17 00:00:00 2001 From: Ted Hess Date: Sat, 27 Sep 2025 21:49:12 -0400 Subject: [PATCH 77/87] odhcpd: update to Git HEAD (2025-09-27) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bc9f9d93d4d6 dhcpv4: allow lease takeover (bugfix) b1547922257e odhcpd: bump minimum cmake version 86c0200f8067 odhcpd: apply RFC9096 recommended lifetimes Signed-off-by: Ted Hess Signed-off-by: Álvaro Fernández Rojas (cherry picked from commit 9b7d0c0d168edd5156a06b21e59b8379c270bdc9) --- package/network/services/odhcpd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 6bfce48931..3e7ec61831 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_MIRROR_HASH:=3bbc3be7bec0336ef50042f7722b580066c31b2d536d335dd2eecf4a1876d2ec -PKG_SOURCE_DATE:=2025-09-16 -PKG_SOURCE_VERSION:=c9816de148cc3e8096e67519d2c081ffeb9b4857 +PKG_MIRROR_HASH:=4745093b58a221252fd092a40f2902e2a45a8ec972bcaa8592602f20acf26aa2 +PKG_SOURCE_DATE:=2025-09-27 +PKG_SOURCE_VERSION:=bc9f9d93d4d6b8feb7b19235d7f0371480fc679d PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From be32ab85cff01370da77ec88925edefa97ced1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Thu, 2 Oct 2025 15:53:39 +0200 Subject: [PATCH 78/87] odhcpd: update to Git HEAD (2025-10-02) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit b14cf98 router: log “Sending a RA on lan” at LOG_DEBUG c2810fe odhcpd: update cmake file 8c2c065 odhcpd: convert README to markdown 3b96480 odhcpd: allow the use of an alternative cfg file 7328bfe odhcpd: remove confusing #defines cdb9e5b odhcpd: improve RFC9096 § 3.5 SLAAC compliance RFC9096 § 3.5 SLAAC compliance introduces a new config option (odhcpd piofolder), which may wear out the flash under certain conditions (for example: ISPs with dynamic IPv6 prefixes which disconnect the clients every X hours). Therefore, setting "dhcp.odhcpd.piofolder" to persistent storage in the router flash is not advisable and should be set to other kinds of persistent storage such as USBs, SDs, NVMEs... In order to prevent wearing out the router flash it's set to ephemeral storage by default (tmp): uci set dhcp.odhcpd.piofolder="/tmp/odhcpd-piofolder" Signed-off-by: Álvaro Fernández Rojas (cherry picked from commit ea79b5875af8ead522050d16850264b01166e8a8) --- package/network/services/odhcpd/Makefile | 8 ++++---- .../network/services/odhcpd/files/odhcpd.defaults | 12 +++++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 3e7ec61831..44fb25de6c 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_MIRROR_HASH:=4745093b58a221252fd092a40f2902e2a45a8ec972bcaa8592602f20acf26aa2 -PKG_SOURCE_DATE:=2025-09-27 -PKG_SOURCE_VERSION:=bc9f9d93d4d6b8feb7b19235d7f0371480fc679d +PKG_MIRROR_HASH:=1ad44323f7803fdb5d1b2492d47e4b4b0fbc3d4c7c171b270422b10535c2a284 +PKG_SOURCE_DATE:=2025-10-02 +PKG_SOURCE_VERSION:=b14cf98c914d8582f18c7b263814797366fa185d PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 @@ -29,7 +29,7 @@ define Package/odhcpd/default SECTION:=net CATEGORY:=Network TITLE:=OpenWrt DHCPv6(-PD)/RA Server & Relay - DEPENDS:=+libubox +libuci +libubus +libnl-tiny + DEPENDS:=+libjson-c +libubox +libuci +libubus +libnl-tiny endef define Package/odhcpd/default/description diff --git a/package/network/services/odhcpd/files/odhcpd.defaults b/package/network/services/odhcpd/files/odhcpd.defaults index 1350636ba4..f64bf9bb0c 100644 --- a/package/network/services/odhcpd/files/odhcpd.defaults +++ b/package/network/services/odhcpd/files/odhcpd.defaults @@ -1,5 +1,14 @@ #!/bin/sh -uci -q get dhcp.odhcpd && exit 0 + +if [ -n "$(uci -q get dhcp.odhcpd)" ]; then + if [ -z "$(uci -q get dhcp.odhcpd.piofolder)" ]; then + uci set dhcp.odhcpd.piofolder=/tmp/odhcpd-piofolder + uci commit dhcp + fi + + exit 0 +fi + touch /etc/config/dhcp . /usr/share/libubox/jshn.sh @@ -42,6 +51,7 @@ set dhcp.odhcpd.maindhcp=$ODHCPDONLY set dhcp.odhcpd.leasefile=/tmp/hosts/odhcpd set dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update set dhcp.odhcpd.loglevel=4 +set dhcp.odhcpd.piofolder=/tmp/odhcpd-piofolder set dhcp.lan.dhcpv4=$V4MODE set dhcp.lan.dhcpv6=$V6MODE set dhcp.lan.ra=$V6MODE From 180646ce4b012c721e3cb33f9dca92e5234a739b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sat, 18 Oct 2025 19:27:27 +0200 Subject: [PATCH 79/87] odhcpd: backport fixes from Git HEAD (2025-10-10) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A lot of recent commits in odhcpd main branch are structural/semantic changes, so instead of adding those changes to 24.10 branch it's better to focus on the fixes. Signed-off-by: Álvaro Fernández Rojas --- ...p-Allow-NS-loopback-for-master-iface.patch | 61 ++++ .../0002-router-fix-SLAAC-on-subnets-64.patch | 86 ++++++ ...by-using-link-local-source-addresses.patch | 285 ++++++++++++++++++ .../0004-odhcpd-fix-a-compilation-error.patch | 44 +++ 4 files changed, 476 insertions(+) create mode 100644 package/network/services/odhcpd/patches/0001-ndp-Allow-NS-loopback-for-master-iface.patch create mode 100644 package/network/services/odhcpd/patches/0002-router-fix-SLAAC-on-subnets-64.patch create mode 100644 package/network/services/odhcpd/patches/0003-ndp-fix-macOS-IPv6-compatibility-by-using-link-local-source-addresses.patch create mode 100644 package/network/services/odhcpd/patches/0004-odhcpd-fix-a-compilation-error.patch diff --git a/package/network/services/odhcpd/patches/0001-ndp-Allow-NS-loopback-for-master-iface.patch b/package/network/services/odhcpd/patches/0001-ndp-Allow-NS-loopback-for-master-iface.patch new file mode 100644 index 0000000000..1251dc3958 --- /dev/null +++ b/package/network/services/odhcpd/patches/0001-ndp-Allow-NS-loopback-for-master-iface.patch @@ -0,0 +1,61 @@ +From f0d855358b86a36efbfeb5a9de5a1d2a4d9d80fe Mon Sep 17 00:00:00 2001 +From: Haoyi Ci +Date: Thu, 2 Oct 2025 16:14:05 +0800 +Subject: [PATCH] ndp: Allow NS loopback for master iface +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This commit modifies handle_solicit() in ndp.c to correct IPv6 relay +handling of Neighbor Solicitation (NS) requests when no upstream +solicitation is received. + +Background: In IPv6 relay mode, odhcpd discovers local devices only upon +receiving upstream NS packets. If no upstream NS arrives (e.g. because the +upstream router’s neighbor cache is still valid or no solicitation was +ever sent), OpenWrt may attempt neighbor resolution via the master (WAN) +interface instead of the LAN, leaving local devices undiscoverable and +breaking connectivity. + +- When an NS packet is sent by the host's master interface, do not + immediately return; instead continue searching slave interfaces for the + target neighbor. +- When odhcpd responds to NS packets, add a check to prevent replying to + NS packets that were sent by the host itself. + +Signed-off-by: Haoyi Ci cihaoyi@outlook.com +Link: https://github.com/openwrt/odhcpd/pull/240 +Signed-off-by: Álvaro Fernández Rojas +--- + src/ndp.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/src/ndp.c ++++ b/src/ndp.c +@@ -332,6 +332,7 @@ static void handle_solicit(void *addr, v + struct interface *c; + char ipbuf[INET6_ADDRSTRLEN]; + uint8_t mac[6]; ++ bool is_self_sent; + + /* Solicitation is for duplicate address detection */ + bool ns_is_dad = IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src); +@@ -354,7 +355,8 @@ static void handle_solicit(void *addr, v + syslog(LOG_DEBUG, "Got a NS for %s on %s", ipbuf, iface->name); + + odhcpd_get_mac(iface, mac); +- if (!memcmp(ll->sll_addr, mac, sizeof(mac))) ++ is_self_sent = !memcmp(ll->sll_addr, mac, sizeof(mac)); ++ if (is_self_sent && !iface->master) + return; /* Looped back */ + + avl_for_each_element(&interfaces, c, avl) { +@@ -366,7 +368,7 @@ static void handle_solicit(void *addr, v + /* Catch global-addressed NS and answer them manually. + * The kernel won't answer these and cannot route them either. */ + if (!IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) && +- IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src)) { ++ IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src) && !is_self_sent) { + bool is_proxy_neigh = netlink_get_interface_proxy_neigh(iface->ifindex, + &req->nd_ns_target) == 1; + diff --git a/package/network/services/odhcpd/patches/0002-router-fix-SLAAC-on-subnets-64.patch b/package/network/services/odhcpd/patches/0002-router-fix-SLAAC-on-subnets-64.patch new file mode 100644 index 0000000000..67f1486bc4 --- /dev/null +++ b/package/network/services/odhcpd/patches/0002-router-fix-SLAAC-on-subnets-64.patch @@ -0,0 +1,86 @@ +From 5eac9c56ff3b0a013c5241f449ca144f70bf4c02 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Tue, 7 Oct 2025 10:30:15 +0200 +Subject: [PATCH] router: fix SLAAC on subnets > 64 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Álvaro Fernández Rojas +--- + src/router.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +--- a/src/router.c ++++ b/src/router.c +@@ -448,13 +448,13 @@ struct nd_opt_dnr_info { + + /* IPv6 RA PIOs */ + static struct ra_pio *router_find_ra_pio(struct interface *iface, +- struct nd_opt_prefix_info *p) ++ struct odhcpd_ipaddr *addr) + { + for (size_t i = 0; i < iface->pio_cnt; i++) { + struct ra_pio *cur_pio = &iface->pios[i]; + +- if (p->nd_opt_pi_prefix_len == cur_pio->length && +- !odhcpd_bmemcmp(&p->nd_opt_pi_prefix, &cur_pio->prefix, cur_pio->length)) ++ if (addr->prefix == cur_pio->length && ++ !odhcpd_bmemcmp(&addr->addr.in6, &cur_pio->prefix, cur_pio->length)) + return cur_pio; + } + +@@ -462,12 +462,12 @@ static struct ra_pio *router_find_ra_pio + } + + static void router_add_ra_pio(struct interface *iface, +- struct nd_opt_prefix_info *p) ++ struct odhcpd_ipaddr *addr) + { + char ipv6_str[INET6_ADDRSTRLEN]; + struct ra_pio *new_pios, *pio; + +- pio = router_find_ra_pio(iface, p); ++ pio = router_find_ra_pio(iface, addr); + if (pio) { + if (pio->lifetime) { + pio->lifetime = 0; +@@ -490,8 +490,8 @@ static void router_add_ra_pio(struct int + pio = &iface->pios[iface->pio_cnt]; + iface->pio_cnt++; + +- memcpy(&pio->prefix, &p->nd_opt_pi_prefix, sizeof(pio->prefix)); +- pio->length = p->nd_opt_pi_prefix_len; ++ memcpy(&pio->prefix, &addr->addr.in6, sizeof(pio->prefix)); ++ pio->length = addr->prefix; + pio->lifetime = 0; + + iface->pio_update = true; +@@ -538,10 +538,10 @@ static void router_clear_ra_pio(time_t n + } + + static void router_stale_ra_pio(struct interface *iface, +- struct nd_opt_prefix_info *p, ++ struct odhcpd_ipaddr *addr, + time_t now) + { +- struct ra_pio *pio = router_find_ra_pio(iface, p); ++ struct ra_pio *pio = router_find_ra_pio(iface, addr); + char ipv6_str[INET6_ADDRSTRLEN]; + + if (!pio || pio->lifetime) +@@ -774,12 +774,12 @@ static int send_router_advert(struct int + p->nd_opt_pi_preferred_time = 0; + p->nd_opt_pi_valid_time = 0; + +- router_stale_ra_pio(iface, p, now); ++ router_stale_ra_pio(iface, addr, now); + } else { + p->nd_opt_pi_preferred_time = htonl(preferred_lt); + p->nd_opt_pi_valid_time = htonl(valid_lt); + +- router_add_ra_pio(iface, p); ++ router_add_ra_pio(iface, addr); + } + } + diff --git a/package/network/services/odhcpd/patches/0003-ndp-fix-macOS-IPv6-compatibility-by-using-link-local-source-addresses.patch b/package/network/services/odhcpd/patches/0003-ndp-fix-macOS-IPv6-compatibility-by-using-link-local-source-addresses.patch new file mode 100644 index 0000000000..b3c240afe6 --- /dev/null +++ b/package/network/services/odhcpd/patches/0003-ndp-fix-macOS-IPv6-compatibility-by-using-link-local-source-addresses.patch @@ -0,0 +1,285 @@ +From d402cdae431668f55f9d82b7072b0afa3b8090df Mon Sep 17 00:00:00 2001 +From: Stephen Groat +Date: Wed, 8 Oct 2025 11:54:51 -0700 +Subject: [PATCH] ndp: fix macOS IPv6 compatibility by using link-local source + addresses +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +macOS ignores NDP packets that don't originate from link-local addresses, +causing IPv6 connectivity issues with odhcpd. This change ensures NDP +packets (Neighbor Advertisements and ICMP Echo Requests) are sent using +link-local source addresses for RFC 4861 compliance. + +Changes: +* Add ndp_from_link_local configuration flag (defaults to true) +* Add odhcpd_send_with_src() to allow explicit source address control +* Add odhcpd_try_send_with_src() helper to eliminate code duplication +* Add odhcpd_get_interface_linklocal_addr() with caching for performance +* Update send_na() and ping6() to use link-local source addresses when + enabled +* Add RFC 4861, §4.2 comments explaining the mandated behavior +* Maintain backward compatibility with fallback behavior + +Fixes: openwrt/openwrt#7561 #202 +Signed-off-by: Stephen Groat +Link: https://github.com/openwrt/odhcpd/pull/242 +Signed-off-by: Álvaro Fernández Rojas +--- + README.md | 1 + + src/config.c | 7 ++++ + src/ndp.c | 12 ++++--- + src/odhcpd.c | 91 ++++++++++++++++++++++++++++++++++++++++------------ + src/odhcpd.h | 11 +++++++ + 5 files changed, 97 insertions(+), 25 deletions(-) + +--- a/README.md ++++ b/README.md +@@ -114,6 +114,7 @@ and may also receive information from ub + | ra_pref64 |string | - | Announce PREF64 option for NAT64 prefix (RFC8781) [IPv6 prefix] | + | ndproxy_routing |bool | 1 | Learn routes from NDP | + | ndproxy_slave |bool | 0 | NDProxy external slave | ++| ndp_from_link_local |bool | 1 | Use link-local source addresses for NDP operations (RFC 4861, §4.2 compliance) and macOS compatibility | + | prefix_filter |string |`::/0` | Only advertise on-link prefixes within the provided IPv6 prefix; others are filtered out. [IPv6 prefix] | + | ntp |list |``| NTP servers to announce accepts IPv4 and IPv6 | + +--- a/src/config.c ++++ b/src/config.c +@@ -117,6 +117,7 @@ enum { + IFACE_ATTR_PD_CER, + IFACE_ATTR_NDPROXY_ROUTING, + IFACE_ATTR_NDPROXY_SLAVE, ++ IFACE_ATTR_NDP_FROM_LINK_LOCAL, + IFACE_ATTR_PREFIX_FILTER, + IFACE_ATTR_MAX_PREFERRED_LIFETIME, + IFACE_ATTR_MAX_VALID_LIFETIME, +@@ -171,6 +172,7 @@ static const struct blobmsg_policy iface + [IFACE_ATTR_RA_PREF64] = { .name = "ra_pref64", .type = BLOBMSG_TYPE_STRING }, + [IFACE_ATTR_NDPROXY_ROUTING] = { .name = "ndproxy_routing", .type = BLOBMSG_TYPE_BOOL }, + [IFACE_ATTR_NDPROXY_SLAVE] = { .name = "ndproxy_slave", .type = BLOBMSG_TYPE_BOOL }, ++ [IFACE_ATTR_NDP_FROM_LINK_LOCAL] = { .name = "ndp_from_link_local", .type = BLOBMSG_TYPE_BOOL }, + [IFACE_ATTR_PREFIX_FILTER] = { .name = "prefix_filter", .type = BLOBMSG_TYPE_STRING }, + [IFACE_ATTR_MAX_PREFERRED_LIFETIME] = { .name = "max_preferred_lifetime", .type = BLOBMSG_TYPE_STRING }, + [IFACE_ATTR_MAX_VALID_LIFETIME] = { .name = "max_valid_lifetime", .type = BLOBMSG_TYPE_STRING }, +@@ -271,6 +273,8 @@ static void set_interface_defaults(struc + iface->ra = MODE_DISABLED; + iface->ndp = MODE_DISABLED; + iface->learn_routes = 1; ++ iface->ndp_from_link_local = true; ++ iface->cached_linklocal_valid = false; + iface->dhcp_leasetime = 43200; + iface->max_preferred_lifetime = ND_PREFERRED_LIMIT; + iface->max_valid_lifetime = ND_VALID_LIMIT; +@@ -1451,6 +1455,9 @@ int config_parse_interface(void *data, s + if ((c = tb[IFACE_ATTR_NDPROXY_SLAVE])) + iface->external = blobmsg_get_bool(c); + ++ if ((c = tb[IFACE_ATTR_NDP_FROM_LINK_LOCAL])) ++ iface->ndp_from_link_local = blobmsg_get_bool(c); ++ + if ((c = tb[IFACE_ATTR_PREFIX_FILTER])) + odhcpd_parse_addr6_prefix(blobmsg_get_string(c), + &iface->pio_filter_addr, +--- a/src/ndp.c ++++ b/src/ndp.c +@@ -280,7 +280,7 @@ static void ndp_netevent_cb(unsigned lon + /* Send an ICMP-ECHO. This is less for actually pinging but for the + * neighbor cache to be kept up-to-date. */ + static void ping6(struct in6_addr *addr, +- const struct interface *iface) ++ struct interface *iface) + { + struct sockaddr_in6 dest = { .sin6_family = AF_INET6, .sin6_addr = *addr , }; + struct icmp6_hdr echo = { .icmp6_type = ICMP6_ECHO_REQUEST }; +@@ -291,13 +291,16 @@ static void ping6(struct in6_addr *addr, + syslog(LOG_DEBUG, "Pinging for %s on %s", ipbuf, iface->name); + + netlink_setup_route(addr, 128, iface->ifindex, NULL, 128, true); +- odhcpd_send(iface->ndp_ping_fd, &dest, &iov, 1, iface); ++ ++ /* Use link-local address as source for RFC 4861 compliance and macOS compatibility */ ++ odhcpd_try_send_with_src(iface->ndp_ping_fd, &dest, &iov, 1, iface); ++ + netlink_setup_route(addr, 128, iface->ifindex, NULL, 128, false); + } + + /* Send a Neighbor Advertisement. */ + static void send_na(struct in6_addr *to_addr, +- const struct interface *iface, struct in6_addr *for_addr, ++ struct interface *iface, struct in6_addr *for_addr, + const uint8_t *mac) + { + struct sockaddr_in6 dest = { .sin6_family = AF_INET6, .sin6_addr = *to_addr }; +@@ -319,7 +322,8 @@ static void send_na(struct in6_addr *to_ + inet_ntop(AF_INET6, to_addr, ipbuf, sizeof(ipbuf)); + syslog(LOG_DEBUG, "Answering NS to %s on %s", ipbuf, iface->ifname); + +- odhcpd_send(iface->ndp_ping_fd, &dest, &iov, 1, iface); ++ /* Use link-local address as source for RFC 4861 compliance and macOS compatibility */ ++ odhcpd_try_send_with_src(iface->ndp_ping_fd, &dest, &iov, 1, iface); + } + + /* Handle solicitations */ +--- a/src/odhcpd.c ++++ b/src/odhcpd.c +@@ -189,10 +189,10 @@ int odhcpd_get_flags(const struct interf + } + + +-/* Forwards a packet on a specific interface */ +-ssize_t odhcpd_send(int socket, struct sockaddr_in6 *dest, ++/* Forwards a packet on a specific interface with optional source address */ ++ssize_t odhcpd_send_with_src(int socket, struct sockaddr_in6 *dest, + struct iovec *iov, size_t iov_len, +- const struct interface *iface) ++ const struct interface *iface, const struct in6_addr *src_addr) + { + /* Construct headers */ + uint8_t cmsg_buf[CMSG_SPACE(sizeof(struct in6_pktinfo))] = {0}; +@@ -214,6 +214,10 @@ ssize_t odhcpd_send(int socket, struct s + struct in6_pktinfo *pktinfo = (struct in6_pktinfo*)CMSG_DATA(chdr); + pktinfo->ipi6_ifindex = iface->ifindex; + ++ /* Set source address if provided */ ++ if (src_addr) ++ pktinfo->ipi6_addr = *src_addr; ++ + /* Also set scope ID if link-local */ + if (IN6_IS_ADDR_LINKLOCAL(&dest->sin6_addr) + || IN6_IS_ADDR_MC_LINKLOCAL(&dest->sin6_addr)) +@@ -232,30 +236,75 @@ ssize_t odhcpd_send(int socket, struct s + return sent; + } + ++/* Forwards a packet on a specific interface */ ++ssize_t odhcpd_send(int socket, struct sockaddr_in6 *dest, ++ struct iovec *iov, size_t iov_len, ++ const struct interface *iface) ++{ ++ return odhcpd_send_with_src(socket, dest, iov, iov_len, iface, NULL); ++} ++ + +-static int odhcpd_get_linklocal_interface_address(int ifindex, struct in6_addr *lladdr) ++int odhcpd_get_interface_linklocal_addr(struct interface *iface, struct in6_addr *addr) + { +- int ret = -1; +- struct sockaddr_in6 addr; +- socklen_t alen = sizeof(addr); +- int sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6); ++ /* Return cached address if valid */ ++ if (iface->cached_linklocal_valid) { ++ *addr = iface->cached_linklocal_addr; ++ return 0; ++ } + +- if (sock < 0) +- return -1; ++ /* First try to get link-local address from interface addresses */ ++ for (size_t i = 0; i < iface->addr6_len; ++i) { ++ if (IN6_IS_ADDR_LINKLOCAL(&iface->addr6[i].addr.in6)) { ++ *addr = iface->addr6[i].addr.in6; ++ /* Cache the result for future use */ ++ iface->cached_linklocal_addr = *addr; ++ iface->cached_linklocal_valid = true; ++ return 0; ++ } ++ } + +- memset(&addr, 0, sizeof(addr)); +- addr.sin6_family = AF_INET6; +- inet_pton(AF_INET6, ALL_IPV6_ROUTERS, &addr.sin6_addr); +- addr.sin6_scope_id = ifindex; +- +- if (!connect(sock, (struct sockaddr*)&addr, sizeof(addr)) && +- !getsockname(sock, (struct sockaddr*)&addr, &alen)) { +- *lladdr = addr.sin6_addr; +- ret = 0; ++ /* Fallback to socket-based method */ ++ struct sockaddr_in6 sockaddr; ++ socklen_t alen = sizeof(sockaddr); ++ int sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6); ++ ++ if (sock >= 0) { ++ memset(&sockaddr, 0, sizeof(sockaddr)); ++ sockaddr.sin6_family = AF_INET6; ++ inet_pton(AF_INET6, ALL_IPV6_ROUTERS, &sockaddr.sin6_addr); ++ sockaddr.sin6_scope_id = iface->ifindex; ++ ++ if (!connect(sock, (struct sockaddr*)&sockaddr, sizeof(sockaddr)) && ++ !getsockname(sock, (struct sockaddr*)&sockaddr, &alen)) { ++ *addr = sockaddr.sin6_addr; ++ /* Cache the result for future use */ ++ iface->cached_linklocal_addr = *addr; ++ iface->cached_linklocal_valid = true; ++ close(sock); ++ return 0; ++ } ++ close(sock); + } + +- close(sock); +- return ret; ++ return -1; ++} ++ ++/* Try to send with link-local source address for RFC 4861 compliance and macOS compatibility. ++ * RFC 4861, §4.2 mandates that Neighbor Advertisement source address MUST be ++ * the link-local address assigned to the interface from which this message is sent. */ ++ssize_t odhcpd_try_send_with_src(int socket, struct sockaddr_in6 *dest, ++ struct iovec *iov, size_t iov_len, ++ struct interface *iface) ++{ ++ struct in6_addr src_addr; ++ ++ if (iface->ndp_from_link_local && odhcpd_get_interface_linklocal_addr(iface, &src_addr) == 0) { ++ return odhcpd_send_with_src(socket, dest, iov, iov_len, iface, &src_addr); ++ } else { ++ /* Fall back to default behavior if no link-local address is available or flag is disabled */ ++ return odhcpd_send(socket, dest, iov, iov_len, iface); ++ } + } + + /* +@@ -303,7 +352,7 @@ int odhcpd_get_interface_dns_addr(const + return 0; + } + +- return odhcpd_get_linklocal_interface_address(iface->ifindex, addr); ++ return odhcpd_get_interface_linklocal_addr(iface, addr); + } + + struct interface* odhcpd_get_interface_by_index(int ifindex) +--- a/src/odhcpd.h ++++ b/src/odhcpd.h +@@ -333,6 +333,9 @@ struct interface { + + // NDP + int learn_routes; ++ bool ndp_from_link_local; ++ struct in6_addr cached_linklocal_addr; ++ bool cached_linklocal_valid; + + // RA + uint8_t ra_flags; +@@ -469,11 +472,19 @@ int odhcpd_register(struct odhcpd_event + int odhcpd_deregister(struct odhcpd_event *event); + void odhcpd_process(struct odhcpd_event *event); + ++ssize_t odhcpd_send_with_src(int socket, struct sockaddr_in6 *dest, ++ struct iovec *iov, size_t iov_len, ++ const struct interface *iface, const struct in6_addr *src_addr); + ssize_t odhcpd_send(int socket, struct sockaddr_in6 *dest, + struct iovec *iov, size_t iov_len, + const struct interface *iface); ++ssize_t odhcpd_try_send_with_src(int socket, struct sockaddr_in6 *dest, ++ struct iovec *iov, size_t iov_len, ++ struct interface *iface); + int odhcpd_get_interface_dns_addr(const struct interface *iface, + struct in6_addr *addr); ++int odhcpd_get_interface_linklocal_addr(struct interface *iface, ++ struct in6_addr *addr); + int odhcpd_get_interface_config(const char *ifname, const char *what); + int odhcpd_get_mac(const struct interface *iface, uint8_t mac[6]); + int odhcpd_get_flags(const struct interface *iface); diff --git a/package/network/services/odhcpd/patches/0004-odhcpd-fix-a-compilation-error.patch b/package/network/services/odhcpd/patches/0004-odhcpd-fix-a-compilation-error.patch new file mode 100644 index 0000000000..00f108e11e --- /dev/null +++ b/package/network/services/odhcpd/patches/0004-odhcpd-fix-a-compilation-error.patch @@ -0,0 +1,44 @@ +From 30780debd691aee7567784daf1fdfd8db500a485 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?David=20H=C3=A4rdeman?= +Date: Thu, 9 Oct 2025 11:08:14 +0200 +Subject: [PATCH] odhcpd: fix a compilation error +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +odhcpd_get_interface_dns_addr() calls odhcpd_get_interface_linklocal_addr(), +the former takes a const struct interface ptr, the latter takes a non-const +struct interface ptr. + +The end result is an unhappy compiler. + +Signed-off-by: David Härdeman +Link: https://github.com/openwrt/odhcpd/pull/272 +Signed-off-by: Álvaro Fernández Rojas +--- + src/odhcpd.c | 2 +- + src/odhcpd.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/src/odhcpd.c ++++ b/src/odhcpd.c +@@ -314,7 +314,7 @@ ssize_t odhcpd_try_send_with_src(int soc + * - use an IPv6 ULA address if the already selected IPv6 address is not an ULA address + * - use the IPv6 address with the longest preferred lifetime + */ +-int odhcpd_get_interface_dns_addr(const struct interface *iface, struct in6_addr *addr) ++int odhcpd_get_interface_dns_addr(struct interface *iface, struct in6_addr *addr) + { + time_t now = odhcpd_time(); + ssize_t m = -1; +--- a/src/odhcpd.h ++++ b/src/odhcpd.h +@@ -481,7 +481,7 @@ ssize_t odhcpd_send(int socket, struct s + ssize_t odhcpd_try_send_with_src(int socket, struct sockaddr_in6 *dest, + struct iovec *iov, size_t iov_len, + struct interface *iface); +-int odhcpd_get_interface_dns_addr(const struct interface *iface, ++int odhcpd_get_interface_dns_addr(struct interface *iface, + struct in6_addr *addr); + int odhcpd_get_interface_linklocal_addr(struct interface *iface, + struct in6_addr *addr); From efd444537dec1bb3f222fc4db859edaab5a102f0 Mon Sep 17 00:00:00 2001 From: Goetz Goerisch Date: Fri, 10 Oct 2025 07:32:41 +0200 Subject: [PATCH 80/87] bcm53xx: modify 180-usb-xhci-add-support-for-performing-fake-doorbell.patch upstream changes to the xhci_free_virt_device() [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/usb/host?h=v6.6.103&id=e600de541c37f97482fea2a7a26f186141e7ddea The xhci_fake_doorbell() function should only free the device and not deactivate it too. It just has to revert the call to xhci_alloc_virt_device() Fixes: #20153 Fixes: 1c92e468d544 ("kernel: bump 6.6 to 6.6.103") Signed-off-by: Goetz Goerisch Link: https://github.com/openwrt/openwrt/pull/20362 [Update description and removed some unnecessary changes] Signed-off-by: Hauke Mehrtens (cherry picked from commit 84b2a987fc3d1808f20350064f40bbfb548ed8ce) --- ...80-usb-xhci-add-support-for-performing-fake-doorbell.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/bcm53xx/patches-6.6/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-6.6/180-usb-xhci-add-support-for-performing-fake-doorbell.patch index 378d1467ed..9484546935 100644 --- a/target/linux/bcm53xx/patches-6.6/180-usb-xhci-add-support-for-performing-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-6.6/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -23,7 +23,7 @@ it on BCM4708 family. static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci) { struct xhci_plat_priv *priv = xhci_to_priv(xhci); -+ struct platform_device*pdev = to_platform_device(dev); ++ struct platform_device *pdev = to_platform_device(dev); + struct device_node *node = pdev->dev.of_node; xhci->quirks |= priv->quirks; @@ -73,7 +73,7 @@ it on BCM4708 family. + } + + /* Free virt device */ -+ xhci_disable_and_free_slot(xhci, slot_id); ++ xhci_free_virt_device(xhci, xhci->devs[slot_id], slot_id); + + /* We're done if controller is already running */ + if (readl(&xhci->op_regs->command) & CMD_RUN) From 50f98c53353088e4ec6fdad1a966753e95ea499c Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 30 Sep 2025 14:48:36 +0200 Subject: [PATCH 81/87] kernel: add missing cpe id for linux No 'PKG_CPE_ID' is stored for the kernel package Makefile. This commit adds this. Signed-off-by: Florian Eckert (cherry picked from commit 112f594042581a7b1886452886bb704f7f0e5a69) --- package/kernel/linux/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/package/kernel/linux/Makefile b/package/kernel/linux/Makefile index 8dfb01ad66..f524e21483 100644 --- a/package/kernel/linux/Makefile +++ b/package/kernel/linux/Makefile @@ -18,6 +18,7 @@ SCAN_DEPS=modules/*.mk $(SUBTARGET_MODULES) $(TOPDIR)/include/netfilter.mk PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/o:linux:linux_kernel export SHELL:=/bin/sh .ONESHELL: From c416b8c44cd5fd70d8ae20dd11169c300104ddee Mon Sep 17 00:00:00 2001 From: Christoph Krapp Date: Sat, 18 Oct 2025 00:23:35 +0200 Subject: [PATCH 82/87] ipq40xx: add label-mac-device alias for Linksys WHW01 Set the label-mac-device to be able to easily fetch the mac-address of the device, which is printed on the bottom of the case. While at it, remove the TODO - the ethernet0 alias is needed to get the mac from bootloader. Signed-off-by: Christoph Krapp Link: https://github.com/openwrt/openwrt/pull/20441 Signed-off-by: Robert Marko (cherry picked from commit deca8fd24bcd039a3784bf83db5541b297def8ff) Link: https://github.com/openwrt/openwrt/pull/20454 Signed-off-by: Hauke Mehrtens --- .../files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-whw01.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-whw01.dts b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-whw01.dts index fe6e8626ea..f8c9003632 100644 --- a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-whw01.dts +++ b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-whw01.dts @@ -10,11 +10,11 @@ compatible = "linksys,whw01"; aliases { - // TODO: Verify if the ethernet0 alias is needed ethernet0 = &gmac; serial0 = &blsp1_uart1; led-boot = &led_system_blue; led-running = &led_system_blue; + label-mac-device = &gmac; }; chosen { From b2119bbaa2fec757801a3b1627a13584c16188c2 Mon Sep 17 00:00:00 2001 From: Christoph Krapp Date: Sat, 18 Oct 2025 00:43:10 +0200 Subject: [PATCH 83/87] ipq40xx: add led aliases for Linksys WHW01 This adds led aliases for failsafe and upgrade. Before this change the leds stayed dark in both situations. Signed-off-by: Christoph Krapp Link: https://github.com/openwrt/openwrt/pull/20441 Signed-off-by: Robert Marko (cherry picked from commit 1afe4ba623936fa42daba5b88d33687ef551ed11) Link: https://github.com/openwrt/openwrt/pull/20454 Signed-off-by: Hauke Mehrtens --- .../files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-whw01.dts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-whw01.dts b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-whw01.dts index f8c9003632..926a2345af 100644 --- a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-whw01.dts +++ b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-whw01.dts @@ -13,7 +13,9 @@ ethernet0 = &gmac; serial0 = &blsp1_uart1; led-boot = &led_system_blue; + led-failsafe = &led_system_red; led-running = &led_system_blue; + led-upgrade = &led_system_red; label-mac-device = &gmac; }; @@ -56,7 +58,7 @@ reg = <0x62>; /* RGB? */ - led@0 { + led_system_red: led@0 { reg = <0>; color = ; function = LED_FUNCTION_POWER; From c5892fe8c566521db3fddabe55f74ccb1331f0eb Mon Sep 17 00:00:00 2001 From: Christoph Krapp Date: Sat, 18 Oct 2025 00:58:37 +0200 Subject: [PATCH 84/87] ipq40xx: fix Linksys WHW0x sorting whw01 was incorrectly placed below whw03 definitions. Signed-off-by: Christoph Krapp Link: https://github.com/openwrt/openwrt/pull/20441 Signed-off-by: Robert Marko (cherry picked from commit 1fecbaf3d86ad8ce8bbc4a9504c73e943da323e1) Link: https://github.com/openwrt/openwrt/pull/20454 Signed-off-by: Hauke Mehrtens --- target/linux/ipq40xx/image/generic.mk | 34 +++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index 21841f4bf1..86bcaf8406 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -731,6 +731,23 @@ define Device/linksys_mr8300 endef TARGET_DEVICES += linksys_mr8300 +define Device/linksys_whw01 + $(call Device/FitzImage) + DEVICE_VENDOR := Linksys + DEVICE_MODEL := WHW01 + KERNEL_SIZE := 6144k + IMAGE_SIZE := 75776k + NAND_SIZE := 256m + SOC := qcom-ipq4018 + BLOCKSIZE := 128k + PAGESIZE := 2048 + UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=WHW01 + DEVICE_PACKAGES := uboot-envtools kmod-leds-pca963x +endef +TARGET_DEVICES += linksys_whw01 + define Device/linksys_whw03 $(call Device/FitzImage) DEVICE_VENDOR := Linksys @@ -763,23 +780,6 @@ define Device/linksys_whw03v2 endef TARGET_DEVICES += linksys_whw03v2 -define Device/linksys_whw01 - $(call Device/FitzImage) - DEVICE_VENDOR := Linksys - DEVICE_MODEL := WHW01 - KERNEL_SIZE := 6144k - IMAGE_SIZE := 75776k - NAND_SIZE := 256m - SOC := qcom-ipq4018 - BLOCKSIZE := 128k - PAGESIZE := 2048 - UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF - IMAGES += factory.bin - IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=WHW01 - DEVICE_PACKAGES := uboot-envtools kmod-leds-pca963x -endef -TARGET_DEVICES += linksys_whw01 - define Device/luma_wrtq-329acn $(call Device/FitImage) DEVICE_VENDOR := Luma Home From 29397011ccef8cca2b26ebf8e2189224a88228bd Mon Sep 17 00:00:00 2001 From: Eric Fahlgren Date: Wed, 8 Oct 2025 09:42:21 -0700 Subject: [PATCH 85/87] targetwide: imagebuilder: add explicit guards around initramfs rules The imagebuilder is not intended to build initramfs images. Some profiles attempt to do this and succeed, due to buildroot leaking the initramfs-kernel into staging_dir; others attempt it, but fail due to not having initramfs binaries present in the imagebuilder. Fix this by adding an explict guard around the unsupported generation of the initramfs images. This saves space and time during imagebuilder runs, fixes those that are currently broken and protects against future breakage for profiles that inadvertently work now. Fixes: https://github.com/openwrt/openwrt/issues/20151 Signed-off-by: Eric Fahlgren Link: https://github.com/openwrt/openwrt/pull/20347 Signed-off-by: Robert Marko (cherry picked from commit f6e0f57be0afd1baae8376c8c58535f9a9fe6e4d) Signed-off-by: Hauke Mehrtens --- target/linux/ath79/image/common-nec.mk | 2 ++ target/linux/ath79/image/generic.mk | 4 ++++ target/linux/mediatek/image/filogic.mk | 20 ++++++++++++++++++++ target/linux/qualcommax/image/ipq807x.mk | 4 ++++ target/linux/ramips/image/mt7620.mk | 4 ++++ target/linux/ramips/image/mt7621.mk | 10 ++++++++++ 6 files changed, 44 insertions(+) diff --git a/target/linux/ath79/image/common-nec.mk b/target/linux/ath79/image/common-nec.mk index 23671e215d..d18ec25f69 100644 --- a/target/linux/ath79/image/common-nec.mk +++ b/target/linux/ath79/image/common-nec.mk @@ -12,6 +12,7 @@ define Device/nec-netbsd-aterm KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | uImage none KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel | uImage none ARTIFACTS := uboot.bin +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) COMPILE := loader-$(1).bin COMPILE/loader-$(1).bin := loader-okli-compile @@ -19,6 +20,7 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACT/initramfs-factory.bin := append-image-stage initramfs-kernel.bin | \ pad-to 4 skip=16 | \ nec-usbaterm-fw -f 0x0003 -d $$(KDIR)/loader-$(1).bin -d $$$$@ | check-size +endif endif UBOOT_PATH := $$(STAGING_DIR_IMAGE)/$$(SOC)_nec_aterm-u-boot.bin ARTIFACT/uboot.bin := append-uboot | check-size 128k diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index e7aed14bd3..59c64e716d 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1370,11 +1370,13 @@ define Device/elecom_wrc-1750ghbk2-i DEVICE_VENDOR := ELECOM DEVICE_MODEL := WRC-1750GHBK2-I/C IMAGE_SIZE := 15808k +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS := initramfs-factory.bin ARTIFACT/initramfs-factory.bin := append-image initramfs-kernel.bin | \ pad-to 2 | edimax-header -b -s CSYS -m RN68 -f 0x70000 -S 0x01100000 | \ elecom-product-header WRC-1750GHBK2 | check-size +endif endif DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct endef @@ -1385,12 +1387,14 @@ define Device/elecom_wrc-300ghbk2-i DEVICE_VENDOR := ELECOM DEVICE_MODEL := WRC-300GHBK2-I IMAGE_SIZE := 7616k +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS := initramfs-factory.bin ARTIFACT/initramfs-factory.bin := append-image initramfs-kernel.bin | \ pad-to 2 | edimax-header -b -s CSYS -m RN51 -f 0x70000 -S 0x01100000 | \ elecom-product-header WRC-300GHBK2-I | check-size endif +endif endef TARGET_DEVICES += elecom_wrc-300ghbk2-i diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index d062a47e4a..acf956e8ec 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -270,9 +270,11 @@ define Device/asus_rt-ax52 KERNEL_INITRAMFS := kernel-bin | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +ifeq ($(IB),) ARTIFACTS := initramfs.trx ARTIFACT/initramfs.trx := append-image-stage initramfs-kernel.bin | \ uImage none | asus-trx -v 3 -n $$(DEVICE_MODEL) +endif endef TARGET_DEVICES += asus_rt-ax52 @@ -865,10 +867,12 @@ define Device/dlink_aquila-pro-ai-m30-a1 IMAGES += recovery.bin IMAGE_SIZE := 51200k IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) IMAGE/recovery.bin := append-image-stage initramfs-kernel.bin | sysupgrade-tar kernel=$$$$@ |\ pad-to $$(IMAGE_SIZE) | dlink-ai-recovery-header DLK6E6110001 \x6A\x28\xEE\x0B \x00\x00\x2C\x00 \x00\x00\x20\x03 \x61\x6E endif +endif endef TARGET_DEVICES += dlink_aquila-pro-ai-m30-a1 @@ -882,10 +886,12 @@ define Device/dlink_aquila-pro-ai-m60-a1 IMAGES += recovery.bin IMAGE_SIZE := 51200k IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) IMAGE/recovery.bin := append-image-stage initramfs-kernel.bin | sysupgrade-tar kernel=$$$$@ |\ pad-to $$(IMAGE_SIZE) | dlink-ai-recovery-header DLK6E8202001 \x30\x6C\x19\x0C \x00\x00\x2C\x00 \x00\x00\x20\x03 \x82\x6E endif +endif endef TARGET_DEVICES += dlink_aquila-pro-ai-m60-a1 @@ -1821,9 +1827,11 @@ define Device/xiaomi_mi-router-ax3000t BLOCKSIZE := 128k PAGESIZE := 2048 DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS := initramfs-factory.ubi ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-kernel.bin | ubinize-kernel +endif endif IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef @@ -1850,10 +1858,12 @@ define Device/xiaomi_mi-router-ax3000t-ubootmod ARTIFACTS := preloader.bin bl31-uboot.fip ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3 ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot xiaomi_mi-router-ax3000t +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS += initramfs-factory.ubi ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel endif +endif endef TARGET_DEVICES += xiaomi_mi-router-ax3000t-ubootmod @@ -1866,9 +1876,11 @@ define Device/xiaomi_mi-router-wr30u-stock BLOCKSIZE := 128k PAGESIZE := 2048 DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS := initramfs-factory.ubi ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-kernel.bin | ubinize-kernel +endif endif IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef @@ -1895,10 +1907,12 @@ define Device/xiaomi_mi-router-wr30u-ubootmod ARTIFACTS := preloader.bin bl31-uboot.fip ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3 ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot xiaomi_mi-router-wr30u +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS += initramfs-factory.ubi ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel endif +endif endef TARGET_DEVICES += xiaomi_mi-router-wr30u-ubootmod @@ -1911,9 +1925,11 @@ define Device/xiaomi_redmi-router-ax6000-stock UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS := initramfs-factory.ubi ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-kernel.bin | ubinize-kernel +endif endif IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef @@ -1940,10 +1956,12 @@ define Device/xiaomi_redmi-router-ax6000-ubootmod ARTIFACTS := preloader.bin bl31-uboot.fip ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr4 ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot xiaomi_redmi-router-ax6000 +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS += initramfs-factory.ubi ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel endif +endif endef TARGET_DEVICES += xiaomi_redmi-router-ax6000-ubootmod @@ -2069,10 +2087,12 @@ define Device/zyxel_ex5601-t0-ubootmod ARTIFACTS := preloader.bin bl31-uboot.fip ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-4k-ddr4 ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot zyxel_ex5601-t0 +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS += initramfs-factory.ubi ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel endif +endif endef TARGET_DEVICES += zyxel_ex5601-t0-ubootmod diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index e934ce31ba..d72d72a372 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -62,6 +62,7 @@ define Device/asus_rt-ax89x append-kernel | asus-fake-ramdisk |\ multiImage gzip $$(KDIR)/tmp/fakerd $$(KDIR)/image-$$(DEVICE_DTS).dtb |\ sysupgrade-tar kernel=$$$$@ | append-metadata +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS := initramfs-factory.trx initramfs-uImage.itb ARTIFACT/initramfs-uImage.itb := \ @@ -72,6 +73,7 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) multiImage gzip $$(KDIR)/tmp/fakehsqs $$(KDIR)/image-$$(DEVICE_DTS).dtb |\ asus-trx -v 2 -n RT-AX89U -b 388 -e 49000 endif +endif endef TARGET_DEVICES += asus_rt-ax89x @@ -246,11 +248,13 @@ define Device/netgear_rax120v2 NETGEAR_HW_ID := 29765589+0+512+1024+4x4+8x8 DEVICE_PACKAGES := ipq-wifi-netgear_rax120v2 kmod-spi-gpio \ kmod-spi-bitbang kmod-gpio-nxp-74hc164 kmod-hwmon-g762 +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) IMAGES += web-ui-factory.img IMAGE/web-ui-factory.img := append-image initramfs-uImage.itb | \ pad-offset $$$$(BLOCKSIZE) 64 | append-uImage-fakehdr filesystem | \ netgear-dni +endif endif IMAGE/sysupgrade.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \ append-uImage-fakehdr filesystem | sysupgrade-tar kernel=$$$$@ | \ diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 310cff692e..2ae329e096 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -1129,10 +1129,12 @@ define Device/rostelecom_rt-fl-1 $(Device/sercomm_cpj) DEVICE_MODEL := RT-FL-1 DEVICE_ALT0_MODEL := RT-FL-1 +ifeq ($(IB),) ARTIFACT/initramfs-factory.img := \ append-image-stage initramfs-kernel.bin | check-size | \ sercomm-factory-cpj | gzip | sercomm-payload | \ sercomm-pid-setbit 0x11 | sercomm-crypto +endif endef TARGET_DEVICES += rostelecom_rt-fl-1 @@ -1140,9 +1142,11 @@ define Device/rostelecom_s1010 $(Device/sercomm_cpj) DEVICE_MODEL := S1010 DEVICE_ALT0_MODEL := S1010.RT +ifeq ($(IB),) ARTIFACT/initramfs-factory.img := \ append-image-stage initramfs-kernel.bin | check-size | \ sercomm-factory-cpj | gzip | sercomm-payload | sercomm-crypto +endif endef TARGET_DEVICES += rostelecom_s1010 diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index adaa27908f..44aa7dda7f 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1178,11 +1178,13 @@ define Device/elecom_wmc-x1800gst KERNEL_LOADADDR := 0x82000000 KERNEL := kernel-bin | relocate-kernel $(loadaddr-y) | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS := initramfs-factory.bin ARTIFACT/initramfs-factory.bin := append-image-stage initramfs-kernel.bin | \ check-size $$$$(KERNEL_SIZE) | elecom-wrc-gs-factory WMC-2LX 0.00 -N | \ append-string MT7621_ELECOM_WMC-2LX +endif endif DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools endef @@ -1311,11 +1313,13 @@ define Device/elecom_wrc-x1800gs fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb KERNEL_SIZE := 8192k IMAGE_SIZE := 51456k +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS := initramfs-factory.bin ARTIFACT/initramfs-factory.bin := append-image-stage initramfs-kernel.bin | \ znet-header 4.04(XVF.1)b90 COMC 0x68 | elecom-product-header WRC-X1800GS | \ check-size +endif endif DEVICE_PACKAGES := kmod-mt7915-firmware endef @@ -1329,11 +1333,13 @@ define Device/elecom_wsc-x1800gs KERNEL_LOADADDR := 0x82000000 KERNEL := kernel-bin | relocate-kernel $(loadaddr-y) | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS := initramfs-factory.bin ARTIFACT/initramfs-factory.bin := append-image-stage initramfs-kernel.bin | \ check-size $$$$(KERNEL_SIZE) | elecom-wrc-gs-factory WMC-2LX 0.00 -N | \ append-string MT7621_ELECOM_WMC-2LX +endif endif DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools endef @@ -1406,10 +1412,12 @@ define Device/genexis_pulse-ex400/common --log-lebs=2 --space-fixup --squash-uids KERNEL := kernel-bin | lzma | uImage lzma KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) IMAGES += factory.bin IMAGE/factory.bin := append-image-stage initramfs-kernel.bin | \ inteno-bootfs | inteno-y3-header EX400 | append-md5sum-ascii-salted +endif endif IMAGE/sysupgrade.bin := append-kernel | inteno-bootfs | pad-to 10M | \ sysupgrade-tar kernel=$$$$@ | check-size | append-metadata @@ -1503,10 +1511,12 @@ define Device/haier-sim_wr1800k KERNEL_LOADADDR := 0x82000000 KERNEL := kernel-bin | relocate-kernel $(loadaddr-y) | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb +ifeq ($(IB),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS := initramfs-factory.bin ARTIFACT/initramfs-factory.bin := append-image-stage initramfs-kernel.bin | \ haier-sim_wr1800k-factory +endif endif DEVICE_PACKAGES := kmod-mt7915-firmware endef From 78b23a26c4c98938d549e7ff5876508544e33d4d Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Tue, 21 Oct 2025 00:00:21 +0200 Subject: [PATCH 86/87] OpenWrt v24.10.4: adjust config defaults Signed-off-by: Hauke Mehrtens --- feeds.conf.default | 8 ++++---- include/version.mk | 6 +++--- package/base-files/image-config.in | 4 ++-- version | 1 + version.date | 1 + 5 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 version create mode 100644 version.date diff --git a/feeds.conf.default b/feeds.conf.default index 581de056c4..27669bacff 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git packages https://git.openwrt.org/feed/packages.git;openwrt-24.10 -src-git luci https://git.openwrt.org/project/luci.git;openwrt-24.10 -src-git routing https://git.openwrt.org/feed/routing.git;openwrt-24.10 -src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-24.10 +src-git packages https://git.openwrt.org/feed/packages.git^f1470815f41fe199bfdafe9a91ad115bc2e91203 +src-git luci https://git.openwrt.org/project/luci.git^75e41cba5160281b2d1dca922719efef29f7ffd8 +src-git routing https://git.openwrt.org/feed/routing.git^3eb59e9471858c83891979793f1dd29cca156919 +src-git telephony https://git.openwrt.org/feed/telephony.git^2a4541d46199ac96fac214d02c908402831c4dc6 diff --git a/include/version.mk b/include/version.mk index a6ebe58779..3c70170287 100644 --- a/include/version.mk +++ b/include/version.mk @@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \ sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) -VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10-SNAPSHOT) +VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.4) VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) -VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) +VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r28959-29397011cc) VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) -VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10-SNAPSHOT) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10.4) VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index 80db993d46..4c2b7a8b29 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -190,7 +190,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "https://downloads.openwrt.org/releases/24.10-SNAPSHOT" + default "https://downloads.openwrt.org/releases/24.10.4" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -266,7 +266,7 @@ if VERSIONOPT config VERSION_CODE_FILENAMES bool prompt "Revision code in filenames" - default y + default n help Enable this to include the revision identifier or the configured version code into the firmware image, SDK- and Image Builder archive diff --git a/version b/version new file mode 100644 index 0000000000..64fcc8c7bc --- /dev/null +++ b/version @@ -0,0 +1 @@ +r28959-29397011cc diff --git a/version.date b/version.date new file mode 100644 index 0000000000..34bb0171d9 --- /dev/null +++ b/version.date @@ -0,0 +1 @@ +1760891865 From 859ff7a978aea150588e7e21a1333884ab85739f Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Tue, 21 Oct 2025 00:00:26 +0200 Subject: [PATCH 87/87] OpenWrt v24.10.4: revert to branch defaults Signed-off-by: Hauke Mehrtens --- feeds.conf.default | 8 ++++---- include/version.mk | 6 +++--- package/base-files/image-config.in | 4 ++-- version | 1 - version.date | 1 - 5 files changed, 9 insertions(+), 11 deletions(-) delete mode 100644 version delete mode 100644 version.date diff --git a/feeds.conf.default b/feeds.conf.default index 27669bacff..581de056c4 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git packages https://git.openwrt.org/feed/packages.git^f1470815f41fe199bfdafe9a91ad115bc2e91203 -src-git luci https://git.openwrt.org/project/luci.git^75e41cba5160281b2d1dca922719efef29f7ffd8 -src-git routing https://git.openwrt.org/feed/routing.git^3eb59e9471858c83891979793f1dd29cca156919 -src-git telephony https://git.openwrt.org/feed/telephony.git^2a4541d46199ac96fac214d02c908402831c4dc6 +src-git packages https://git.openwrt.org/feed/packages.git;openwrt-24.10 +src-git luci https://git.openwrt.org/project/luci.git;openwrt-24.10 +src-git routing https://git.openwrt.org/feed/routing.git;openwrt-24.10 +src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-24.10 diff --git a/include/version.mk b/include/version.mk index 3c70170287..a6ebe58779 100644 --- a/include/version.mk +++ b/include/version.mk @@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \ sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) -VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.4) +VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10-SNAPSHOT) VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) -VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r28959-29397011cc) +VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) -VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10.4) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10-SNAPSHOT) VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index 4c2b7a8b29..80db993d46 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -190,7 +190,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "https://downloads.openwrt.org/releases/24.10.4" + default "https://downloads.openwrt.org/releases/24.10-SNAPSHOT" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -266,7 +266,7 @@ if VERSIONOPT config VERSION_CODE_FILENAMES bool prompt "Revision code in filenames" - default n + default y help Enable this to include the revision identifier or the configured version code into the firmware image, SDK- and Image Builder archive diff --git a/version b/version deleted file mode 100644 index 64fcc8c7bc..0000000000 --- a/version +++ /dev/null @@ -1 +0,0 @@ -r28959-29397011cc diff --git a/version.date b/version.date deleted file mode 100644 index 34bb0171d9..0000000000 --- a/version.date +++ /dev/null @@ -1 +0,0 @@ -1760891865