[9610] wlbt: Patch from Debrata (Android P)
authorTarun Karela <t.karela@samsung.com>
Wed, 30 May 2018 11:17:15 +0000 (12:17 +0100)
committerYoungsoo Kim <youngss.kim@samsung.com>
Fri, 15 Jun 2018 22:52:01 +0000 (07:52 +0900)
Kernel 4.14 patches

Change-Id: Icc987c1e91fb978bfb1d11b24ab3e68efa6d83f8
SCSC-Bug-Id: SSB-40175
Signed-off-by: Tarun Karela <t.karela@samsung.com>
drivers/net/wireless/scsc/netif.c
drivers/net/wireless/scsc/sap_ma.c
drivers/net/wireless/scsc/udi.c

index a813568e74f30fa6ef3d81ab64043e4c1a984a56..a0708701cfff1c3c86d369b9f4a76c7dc0c2c37d 100755 (executable)
@@ -822,7 +822,11 @@ static netdev_tx_t slsi_net_hw_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
 #ifdef CONFIG_SCSC_WLAN_DEBUG
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0))
        known_users = refcount_read(&skb->users);
+#else
+       known_users = atomic_read(&skb->users);
+#endif
 #endif
 
 #ifndef CONFIG_ARM
@@ -883,8 +887,11 @@ evaluate:
                        r = NETDEV_TX_BUSY;
                } else {
 #ifdef CONFIG_SCSC_WLAN_DEBUG
-                       WARN_ON(known_users &&
-                               refcount_read(&skb->users) != known_users);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0))
+                       WARN_ON(known_users && refcount_read(&skb->users) != known_users);
+#else
+                       WARN_ON(known_users && atomic_read(&skb->users) != known_users);
+#endif
 #endif
                        if (original_skb)
                                slsi_kfree_skb(original_skb);
@@ -1028,7 +1035,11 @@ static void slsi_if_setup(struct net_device *dev)
 {
        ether_setup(dev);
        dev->netdev_ops = &slsi_netdev_ops;
-       dev->priv_destructor = free_netdev;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 9))
+       dev->needs_free_netdev = true;
+#else
+        dev->destructor = free_netdev;
+#endif 
 }
 
 static int slsi_netif_add_locked(struct slsi_dev *sdev, const char *name, int ifnum)
index dd949c0cb38f6d1da2aa12b92ce88b12a3627fbc..38ddd7a75199fbf80af6bf1efd4c63abd2a01583 100755 (executable)
@@ -177,7 +177,6 @@ static int slsi_rx_amsdu_deaggregate(struct net_device *dev, struct sk_buff *skb
                ndev_vif->stats.rx_bytes += subframe->len;
                ndev_vif->stats.rx_packets++;
 
-               /* dev->last_rx = jiffies; */
                SCSC_HIP4_SAMPLER_TCP_DECODE(ndev_vif->sdev, dev, skb->data, true);
                subframe->protocol = eth_type_trans(subframe, dev);
 #ifdef CONFIG_SCSC_WLAN_RX_NAPI
@@ -344,7 +343,6 @@ static int slsi_rx_data_process_skb(struct slsi_dev *sdev, struct net_device *de
 
        ndev_vif->stats.rx_packets++;
        ndev_vif->stats.rx_bytes += (*skb)->len;
-       /* dev->last_rx = jiffies; */
        ndev_vif->rx_packets[trafic_q]++;
 
        /* Intra BSS */
index 1cfd011c098281a460b1f2278088b2884270bb07..571a03820cf29f2e4a216c274087a95324e0257f 100755 (executable)
@@ -1096,11 +1096,17 @@ static void slsi_cdev_destroy(struct slsi_dev *sdev)
 
        kobj = &pdev->cdev.kobj;
        kref = &kobj->kref;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0))
        while (refcount_read(&kref->refcount) > 1) {
                SLSI_WARN(sdev, "UDI client File op release not completed yet! (count=%d)\n", refcount_read(&kref->refcount));
                msleep(50);
        }
-
+#else
+       while (atomic_read(&kref->refcount) > 1) {
+               SLSI_WARN(sdev, "UDI client File op release not completed yet! (count=%d)\n", atomic_read(&kref->refcount));
+               msleep(50);
+       }
+#endif
        device_destroy(class, pdev->cdev.dev);
        cdev_del(&pdev->cdev);
        sdev->uf_cdev = NULL;