}
#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
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);
{
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)
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
ndev_vif->stats.rx_packets++;
ndev_vif->stats.rx_bytes += (*skb)->len;
- /* dev->last_rx = jiffies; */
ndev_vif->rx_packets[trafic_q]++;
/* Intra BSS */
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;