|
| 1 | +From 835f385dbf3a47727181e73063a433e5c7113eca Mon Sep 17 00:00:00 2001 |
| 2 | +From: Stefan Kalscheuer <stefan@stklcode.de> |
| 3 | +Date: Fri, 3 Apr 2026 16:52:44 +0200 |
| 4 | +Subject: [PATCH] replace init_dummy_netdev() with alloc_netdev_dummy() for |
| 5 | + kernel 6.14+ |
| 6 | + |
| 7 | +init_dummy_netdev() was removed in kernel 6.14. Un-embed the net_device |
| 8 | +from the private struct by converting it into a pointer and use |
| 9 | +alloc_netdev_dummy() for initialization of the dummy device. |
| 10 | + |
| 11 | +Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de> |
| 12 | +--- |
| 13 | + hif/pcie/dev.h | 4 ++++ |
| 14 | + hif/pcie/pcie.c | 17 +++++++++++++++-- |
| 15 | + 2 files changed, 19 insertions(+), 2 deletions(-) |
| 16 | + |
| 17 | +--- a/hif/pcie/dev.h |
| 18 | ++++ b/hif/pcie/dev.h |
| 19 | +@@ -583,7 +583,11 @@ struct pcie_priv { |
| 20 | + struct tasklet_struct tx_task; |
| 21 | + struct tasklet_struct tx_done_task; |
| 22 | + /* NAPI */ |
| 23 | ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,14,0) |
| 24 | + struct net_device napi_dev; |
| 25 | ++#else |
| 26 | ++ struct net_device *napi_dev; |
| 27 | ++#endif |
| 28 | + struct napi_struct napi; |
| 29 | + struct tasklet_struct rx_task; |
| 30 | + unsigned int tx_head_room; |
| 31 | +--- a/hif/pcie/pcie.c |
| 32 | ++++ b/hif/pcie/pcie.c |
| 33 | +@@ -215,9 +215,15 @@ static int pcie_init_8997(struct ieee802 |
| 34 | + (void *)pcie_8997_tx_done_task, (unsigned long)hw); |
| 35 | + tasklet_disable(&pcie_priv->tx_done_task); |
| 36 | + spin_lock_init(&pcie_priv->tx_desc_lock); |
| 37 | ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,15,0) |
| 38 | + init_dummy_netdev(&pcie_priv->napi_dev); |
| 39 | +- netif_napi_add(&pcie_priv->napi_dev, &pcie_priv->napi, |
| 40 | +- pcie_8997_poll_napi); |
| 41 | ++ netif_napi_add(&pcie_priv->napi_dev, &pcie_priv->napi, pcie_8997_poll_napi); |
| 42 | ++#else |
| 43 | ++ pcie_priv->napi_dev = alloc_netdev_dummy(0); |
| 44 | ++ if (!pcie_priv->napi_dev) |
| 45 | ++ return -ENOMEM; |
| 46 | ++ netif_napi_add(pcie_priv->napi_dev, &pcie_priv->napi, pcie_8997_poll_napi); |
| 47 | ++#endif |
| 48 | + pcie_priv->txq_limit = PCIE_TX_QUEUE_LIMIT; |
| 49 | + pcie_priv->txq_wake_threshold = PCIE_TX_WAKE_Q_THRESHOLD; |
| 50 | + pcie_priv->recv_limit = PCIE_RECEIVE_LIMIT; |
| 51 | +@@ -310,8 +316,15 @@ static int pcie_init_8864(struct ieee802 |
| 52 | + tasklet_init(&pcie_priv->tx_done_task, (void *)pcie_8864_tx_done_task, (unsigned long)hw); |
| 53 | + tasklet_disable(&pcie_priv->tx_done_task); |
| 54 | + spin_lock_init(&pcie_priv->tx_desc_lock); |
| 55 | ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,14,0) |
| 56 | + init_dummy_netdev(&pcie_priv->napi_dev); |
| 57 | + netif_napi_add(&pcie_priv->napi_dev, &pcie_priv->napi, pcie_8864_poll_napi); |
| 58 | ++#else |
| 59 | ++ pcie_priv->napi_dev = alloc_netdev_dummy(0); |
| 60 | ++ if (!pcie_priv->napi_dev) |
| 61 | ++ return -ENOMEM; |
| 62 | ++ netif_napi_add(pcie_priv->napi_dev, &pcie_priv->napi, pcie_8864_poll_napi); |
| 63 | ++#endif |
| 64 | + pcie_priv->txq_limit = PCIE_TX_QUEUE_LIMIT; |
| 65 | + pcie_priv->txq_wake_threshold = PCIE_TX_WAKE_Q_THRESHOLD; |
| 66 | + pcie_priv->recv_limit = PCIE_RECEIVE_LIMIT; |
0 commit comments