Skip to content

Commit 62e72c9

Browse files
committed
quectel_QMI_WWAN: fix 6.18: Convert tasklet API to new bottom half workqueue mechanism
1 parent bb85a0b commit 62e72c9

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

driver/quectel_QMI_WWAN/src/qmi_wwan_q.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,13 @@ typedef struct sQmiWwanQmap
184184

185185
#if defined(QUECTEL_UL_DATA_AGG)
186186
struct tx_agg_ctx tx_ctx;
187-
struct tasklet_struct txq;
187+
struct tasklet_struct txq;
188+
#if LINUX_VERSION_CODE > KERNEL_VERSION(6,17,0)
189+
struct work_struct usbnet_bh_work;
190+
#else
188191
struct tasklet_struct usbnet_bh;
189192
#endif
193+
#endif
190194

191195
#ifdef QUECTEL_BRIDGE_MODE
192196
uint bridge_mode;
@@ -879,6 +883,17 @@ static struct rtnl_link_stats64 *rmnet_vnd_get_stats64(struct net_device *net, s
879883
#endif
880884

881885
#if defined(QUECTEL_UL_DATA_AGG)
886+
#if LINUX_VERSION_CODE > KERNEL_VERSION(6,17,0)
887+
static void usbnet_bh_work(struct work_struct *work) {
888+
sQmiWwanQmap *pQmapDev = container_of(work, sQmiWwanQmap, usbnet_bh_work);
889+
890+
queue_work(system_bh_wq, &pQmapDev->mpNetDev->bh_work);
891+
892+
if (!netif_queue_stopped(pQmapDev->mpNetDev->net)) {
893+
qmap_wake_queue((sQmiWwanQmap *)pQmapDev);
894+
}
895+
}
896+
#else
882897
static void usbnet_bh(unsigned long data) {
883898
sQmiWwanQmap *pQmapDev = (sQmiWwanQmap *)data;
884899
struct tasklet_struct *t = &pQmapDev->usbnet_bh;
@@ -897,6 +912,7 @@ static void usbnet_bh(unsigned long data) {
897912
qmap_wake_queue((sQmiWwanQmap *)data);
898913
}
899914
}
915+
#endif
900916

901917
static void rmnet_usb_tx_wake_queue(unsigned long data) {
902918
qmap_wake_queue((sQmiWwanQmap *)data);
@@ -2267,8 +2283,13 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
22672283
}
22682284

22692285
if (pQmapDev->use_rmnet_usb && !one_card_mode) {
2286+
#if LINUX_VERSION_CODE > KERNEL_VERSION(6,17,0)
2287+
pQmapDev->usbnet_bh_work = dev->bh_work;
2288+
INIT_WORK(&dev->bh_work, usbnet_bh_work);
2289+
#else
22702290
pQmapDev->usbnet_bh = dev->bh;
22712291
tasklet_init(&dev->bh, usbnet_bh, (unsigned long)pQmapDev);
2292+
#endif
22722293
}
22732294
}
22742295
}

0 commit comments

Comments
 (0)