From e5b29dea3af8f5fb444ee0e489ce3637d71cff5e Mon Sep 17 00:00:00 2001 From: yunjie Date: Tue, 12 Jul 2022 18:14:16 +0000 Subject: [PATCH] Author: Meet Patel Date: Mon, 11 Jul 2022 19:34:18 +0530 Subject: [PATCH 2/2] Issue: WCSWREL-352 index limiting to avoid kernel BRK exception This is work around for kernel BRK exception, here processing further if index value is less than 4. Signed-off-by: Meet Patel --- mxm_wifiex/wlan_src/mlinux/moal_shim.c | 30 +++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/mxm_wifiex/wlan_src/mlinux/moal_shim.c b/mxm_wifiex/wlan_src/mlinux/moal_shim.c index cce2571..dce331b 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_shim.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_shim.c @@ -1139,19 +1139,25 @@ mlan_status moal_send_packet_complete(t_void *pmoal, pmlan_buffer pmbuf, } #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 29) index = skb_get_queue_mapping(skb); - atomic_dec(&handle->tx_pending); - if (atomic_dec_return( - &priv->wmm_tx_pending[index]) == - LOW_TX_PENDING) { - struct netdev_queue *txq = - netdev_get_tx_queue( - priv->netdev, index); - if (netif_tx_queue_stopped(txq)) { - netif_tx_wake_queue(txq); - PRINTM(MINFO, - "Wakeup Kernel Queue:%d\n", - index); + if(index < 4) + { + atomic_dec(&handle->tx_pending); + if (atomic_dec_return( + &priv->wmm_tx_pending[index]) == + LOW_TX_PENDING) { + struct netdev_queue *txq = + netdev_get_tx_queue( + priv->netdev, index); + if (netif_tx_queue_stopped(txq)) { + netif_tx_wake_queue(txq); + PRINTM(MINFO, + "Wakeup Kernel Queue:%d\n", + index); + } } + } + else { + PRINTM(MERROR,"Wakeup invalid Kernel Queue\n"); } #else /*#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)*/ if (atomic_dec_return(&handle->tx_pending) <