Use Linux 3.17 4-argument alloc_netdev(), provide compatibility code
authorPavel Roskin <proski@gnu.org>
Mon, 4 Aug 2014 19:16:13 +0000 (15:16 -0400)
committerPavel Roskin <proski@gnu.org>
Mon, 4 Aug 2014 19:16:13 +0000 (15:16 -0400)
ath/if_ath_ahb.c
ath/if_ath_pci.c
include/compat.h

index 7fa185db477f7e1210fc448a54f65e53f0df764c..59c6579671baff4aad836c57cbff7db932e1abae 100644 (file)
@@ -188,7 +188,8 @@ init_ath_wmac(u_int16_t devid, u_int16_t wlanNum, struct ar531x_config *config)
 
        ahb_enable_wmac(devid, wlanNum);
 
-       dev = alloc_netdev(sizeof(struct ath_softc), "wifi%d", ether_setup);
+       dev = alloc_netdev(sizeof(struct ath_softc), "wifi%d", NET_NAME_UNKNOWN,
+                          ether_setup);
        if (dev == NULL) {
                printk(KERN_ERR "%s: no memory for device state\n", dev_info);
                goto bad2;
index 6451f669035378071cde55aeb92a39678eff426c..1f5b96017668e6863b0e9b479e7ed599ab3cb5fd 100644 (file)
@@ -184,7 +184,8 @@ ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                goto bad1;
        }
 
-       dev = alloc_netdev(sizeof(struct ath_softc), "wifi%d", ether_setup);
+       dev = alloc_netdev(sizeof(struct ath_softc), "wifi%d", NET_NAME_UNKNOWN,
+                          ether_setup);
        if (dev == NULL) {
                printk(KERN_ERR "%s: no memory for device state\n", dev_info);
                goto bad2;
index db9d98f360d6fec404d8b75d6d52efdcf0292445..6348d7987cdfdf8ccbc21596a27308c324d3e69a 100644 (file)
 #define ath_ha_addr(ha) ha->addr
 #endif
 
+#ifndef NET_NAME_UNKNOWN
+#undef alloc_netdev
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
+       alloc_netdev(sizeof_priv, name, setup)
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
+#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
+       alloc_netdev_mq(sizeof_priv, name, setup, 1)
+#else
+#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
+       alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1)
+#endif
+#endif
+
 /*
  * BSD/Linux compatibility shims.  These are used mainly to
  * minimize differences when importing necessary BSD code.