summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backport-include/linux/export.h4
-rw-r--r--backport-include/linux/random.h3
-rw-r--r--backport-include/linux/thermal.h34
-rw-r--r--compat/backport-3.18.c2
-rw-r--r--compat/compat-3.5.c3
-rw-r--r--compat/compat-3.6.c2
-rw-r--r--compat/compat-3.8.c3
-rw-r--r--compat/drivers-base-devcoredump.c2
-rw-r--r--drivers/net/usb/cdc_ether.c2
-rw-r--r--drivers/net/usb/cdc_mbim.c2
-rw-r--r--drivers/net/usb/cdc_ncm.c2
-rw-r--r--drivers/net/usb/qmi_wwan.c2
-rw-r--r--drivers/net/usb/rndis_host.c2
-rw-r--r--drivers/net/usb/sierra_net.c2
-rw-r--r--drivers/net/wireless/ath/ath10k/mac.c8
-rw-r--r--drivers/net/wireless/ath/ath6kl/usb.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.c2
-rw-r--r--drivers/net/wireless/ath/carl9170/usb.c2
-rw-r--r--drivers/net/wireless/atmel/at76c50x-usb.c2
-rw-r--r--drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c2
-rw-r--r--drivers/net/wireless/intel/iwlwifi/pcie/rx.c26
-rw-r--r--drivers/net/wireless/intersil/orinoco/orinoco_usb.c2
-rw-r--r--drivers/net/wireless/intersil/p54/p54usb.c2
-rw-r--r--drivers/net/wireless/marvell/libertas/if_usb.c2
-rw-r--r--drivers/net/wireless/marvell/libertas_tf/if_usb.c2
-rw-r--r--drivers/net/wireless/marvell/mwifiex/Kconfig2
-rw-r--r--drivers/net/wireless/marvell/mwifiex/pcie.c6
-rw-r--r--drivers/net/wireless/mediatek/mt7601u/usb.c2
-rw-r--r--drivers/net/wireless/ralink/rt2x00/rt2500usb.c2
-rw-r--r--drivers/net/wireless/ralink/rt2x00/rt2800usb.c2
-rw-r--r--drivers/net/wireless/ralink/rt2x00/rt73usb.c2
-rw-r--r--drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c2
-rw-r--r--drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c4
-rw-r--r--drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c2
-rw-r--r--drivers/net/wireless/rndis_wlan.c2
-rw-r--r--drivers/net/wireless/zydas/zd1201.c2
-rw-r--r--drivers/net/wireless/zydas/zd1211rw/zd_usb.c2
-rw-r--r--drivers/nfc/nfcmrvl/usb.c2
-rw-r--r--drivers/usb/class/cdc-wdm.c2
-rw-r--r--net/mac80211/iface.c8
-rw-r--r--net/mac80211/rx.c2
-rw-r--r--net/mac80211/status.c2
-rw-r--r--net/mac80211/tx.c2
-rw-r--r--net/wireless/trace.c2
-rw-r--r--net/wireless/trace.h38
45 files changed, 179 insertions, 26 deletions
diff --git a/backport-include/linux/export.h b/backport-include/linux/export.h
index 6f6cb6a..a3c7799 100644
--- a/backport-include/linux/export.h
+++ b/backport-include/linux/export.h
@@ -3,7 +3,7 @@
#include <linux/version.h>
-#if LINUX_VERSION_IS_GEQ(3,2,0)
+#if LINUX_VERSION_IS_GEQ(3,1,0)
#include_next <linux/export.h>
#else
#ifndef pr_fmt
@@ -14,6 +14,6 @@
#undef pr_fmt
#undef backport_undef_pr_fmt
#endif
-#endif /* LINUX_VERSION_IS_GEQ(3,2,0) */
+#endif /* LINUX_VERSION_IS_GEQ(3,1,0) */
#endif /* _COMPAT_LINUX_EXPORT_H */
diff --git a/backport-include/linux/random.h b/backport-include/linux/random.h
index a9dda73..bf16bff 100644
--- a/backport-include/linux/random.h
+++ b/backport-include/linux/random.h
@@ -12,7 +12,8 @@ static inline void add_device_randomness(const void *buf, unsigned int size)
}
#endif
-#if LINUX_VERSION_IS_LESS(3,8,0)
+#if 0
+/* #if LINUX_VERSION_IS_LESS(3,8,0) */
/* backports 496f2f9 */
#define prandom_seed(_seed) srandom32(_seed)
#define prandom_u32() random32()
diff --git a/backport-include/linux/thermal.h b/backport-include/linux/thermal.h
index 108a8cf..b0dc643 100644
--- a/backport-include/linux/thermal.h
+++ b/backport-include/linux/thermal.h
@@ -5,6 +5,40 @@
#if LINUX_VERSION_IS_LESS(3,8,0)
#include <linux/errno.h>
+#include <linux/err.h>
+
+enum thermal_trend {
+ THERMAL_TREND_STABLE, /* temperature is stable */
+ THERMAL_TREND_RAISING, /* temperature is raising */
+ THERMAL_TREND_DROPPING, /* temperature is dropping */
+ THERMAL_TREND_RAISE_FULL, /* apply highest cooling action */
+ THERMAL_TREND_DROP_FULL, /* apply lowest cooling action */
+};
+
+struct backport_thermal_zone_device_ops {
+ int (*bind) (struct thermal_zone_device *,
+ struct thermal_cooling_device *);
+ int (*unbind) (struct thermal_zone_device *,
+ struct thermal_cooling_device *);
+ int (*get_temp) (struct thermal_zone_device *, int *);
+ int (*get_mode) (struct thermal_zone_device *,
+ enum thermal_device_mode *);
+ int (*set_mode) (struct thermal_zone_device *,
+ enum thermal_device_mode);
+ int (*get_trip_type) (struct thermal_zone_device *, int,
+ enum thermal_trip_type *);
+ int (*get_trip_temp) (struct thermal_zone_device *, int, int *);
+ int (*set_trip_temp) (struct thermal_zone_device *, int, int);
+ int (*get_trip_hyst) (struct thermal_zone_device *, int, int *);
+ int (*set_trip_hyst) (struct thermal_zone_device *, int, int);
+ int (*get_crit_temp) (struct thermal_zone_device *, int *);
+ int (*set_emul_temp) (struct thermal_zone_device *, int);
+ int (*get_trend) (struct thermal_zone_device *, int,
+ enum thermal_trend *);
+ int (*notify) (struct thermal_zone_device *, int,
+ enum thermal_trip_type);
+};
+#define thermal_zone_device_ops LINUX_BACKPORT(thermal_zone_device_ops)
struct thermal_bind_params {
struct thermal_cooling_device *cdev;
diff --git a/compat/backport-3.18.c b/compat/backport-3.18.c
index dbef343..00c097e 100644
--- a/compat/backport-3.18.c
+++ b/compat/backport-3.18.c
@@ -179,9 +179,11 @@ void skb_complete_wifi_ack(struct sk_buff *skb, bool acked)
int err;
#if LINUX_VERSION_IS_GEQ(3,3,0)
+#if LINUX_VERSION_IS_GEQ(3,3,0)
skb->wifi_acked_valid = 1;
skb->wifi_acked = acked;
#endif
+#endif
serr = SKB_EXT_ERR(skb);
memset(serr, 0, sizeof(*serr));
diff --git a/compat/compat-3.5.c b/compat/compat-3.5.c
index de31228..8146803 100644
--- a/compat/compat-3.5.c
+++ b/compat/compat-3.5.c
@@ -67,6 +67,8 @@ EXPORT_SYMBOL_GPL(overflowuid);
EXPORT_SYMBOL_GPL(overflowgid);
#endif
+#if 0
+/* backported to all of our kernels */
#if IS_ENABLED(CONFIG_PTP_1588_CLOCK)
int ptp_clock_index(struct ptp_clock *ptp)
{
@@ -74,6 +76,7 @@ int ptp_clock_index(struct ptp_clock *ptp)
}
EXPORT_SYMBOL(ptp_clock_index);
#endif /* CONFIG_PTP_1588_CLOCK */
+#endif
#ifdef CONFIG_GPIOLIB
static void devm_gpio_release(struct device *dev, void *res)
diff --git a/compat/compat-3.6.c b/compat/compat-3.6.c
index ef36485..9e593f5 100644
--- a/compat/compat-3.6.c
+++ b/compat/compat-3.6.c
@@ -14,6 +14,7 @@
/* whoopsie ! */
#ifndef CONFIG_COMMON_CLK
+#ifndef CONFIG_ARCH_TEGRA
int clk_enable(struct clk *clk)
{
return 0;
@@ -25,3 +26,4 @@ void clk_disable(struct clk *clk)
}
EXPORT_SYMBOL_GPL(clk_disable);
#endif
+#endif
diff --git a/compat/compat-3.8.c b/compat/compat-3.8.c
index ff9cd49..a457fdf 100644
--- a/compat/compat-3.8.c
+++ b/compat/compat-3.8.c
@@ -356,6 +356,8 @@ bool hid_ignore(struct hid_device *hdev)
}
EXPORT_SYMBOL_GPL(hid_ignore);
+#if 0
+/* backported to our kernel */
/**
* prandom_bytes - get the requested number of pseudo-random bytes
* @buf: where to copy the pseudo-random bytes to
@@ -386,6 +388,7 @@ void prandom_bytes(void *buf, int bytes)
}
}
EXPORT_SYMBOL_GPL(prandom_bytes);
+#endif
#ifdef CONFIG_OF
/**
diff --git a/compat/drivers-base-devcoredump.c b/compat/drivers-base-devcoredump.c
index 0c7b7d3..27be55a 100644
--- a/compat/drivers-base-devcoredump.c
+++ b/compat/drivers-base-devcoredump.c
@@ -184,7 +184,9 @@ static struct class devcd_class = {
#if LINUX_VERSION_IS_GEQ(3,11,0)
.dev_groups = devcd_dev_groups,
#endif
+#if LINUX_VERSION_IS_GEQ(4,10,0)
.class_groups = devcd_class_groups,
+#endif
};
static ssize_t devcd_readv(char *buffer, loff_t offset, size_t count,
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index 20376e8..76d1afa 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -860,7 +860,9 @@ static struct usb_driver cdc_driver = {
.resume = usbnet_resume,
.reset_resume = usbnet_resume,
.supports_autosuspend = 1,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(cdc_driver);
diff --git a/drivers/net/usb/cdc_mbim.c b/drivers/net/usb/cdc_mbim.c
index 7e7e10c..48e4bb4 100644
--- a/drivers/net/usb/cdc_mbim.c
+++ b/drivers/net/usb/cdc_mbim.c
@@ -690,7 +690,9 @@ static struct usb_driver cdc_mbim_driver = {
.resume = cdc_mbim_resume,
.reset_resume = cdc_mbim_resume,
.supports_autosuspend = 1,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(cdc_mbim_driver);
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 89f5bd8..f15a3b3 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -1719,7 +1719,9 @@ static struct usb_driver cdc_ncm_driver = {
.resume = usbnet_resume,
.reset_resume = usbnet_resume,
.supports_autosuspend = 1,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(cdc_ncm_driver);
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 2474618..9715e0c 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -1045,7 +1045,9 @@ static struct usb_driver qmi_wwan_driver = {
.resume = qmi_wwan_resume,
.reset_resume = qmi_wwan_resume,
.supports_autosuspend = 1,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(qmi_wwan_driver);
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index c5b2113..d605296 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -643,7 +643,9 @@ static struct usb_driver rndis_driver = {
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(rndis_driver);
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
index 7c92e08..a825fa6 100644
--- a/drivers/net/usb/sierra_net.c
+++ b/drivers/net/usb/sierra_net.c
@@ -997,7 +997,9 @@ static struct usb_driver sierra_net_driver = {
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.no_dynamic_id = 1,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(sierra_net_driver);
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 2c7bfa0..c0efde1 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -7902,7 +7902,7 @@ struct ath10k_vif *ath10k_get_arvif(struct ath10k *ar, u32 vdev_id)
#define WRD_METHOD "WRDD"
#define WRDD_WIFI (0x07)
-
+#ifdef CONFIG_ACPI
static u32 ath10k_mac_wrdd_get_mcc(struct ath10k *ar, union acpi_object *wrdd)
{
union acpi_object *mcc_pkg;
@@ -7986,6 +7986,12 @@ static int ath10k_mac_get_wrdd_regulatory(struct ath10k *ar, u16 *rd)
*rd |= COUNTRY_ERD_FLAG;
return 0;
}
+#else
+static int ath10k_mac_get_wrdd_regulatory(struct ath10k *ar, u16 *rd)
+{
+ return -EOPNOTSUPP;
+}
+#endif
static int ath10k_mac_init_rd(struct ath10k *ar)
{
diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c
index 9da3594..b164d00 100644
--- a/drivers/net/wireless/ath/ath6kl/usb.c
+++ b/drivers/net/wireless/ath/ath6kl/usb.c
@@ -1217,7 +1217,9 @@ static struct usb_driver ath6kl_usb_driver = {
.disconnect = ath6kl_usb_remove,
.id_table = ath6kl_usb_ids,
.supports_autosuspend = true,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(ath6kl_usb_driver);
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index f6922e9..2f05cf5 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -1428,7 +1428,9 @@ static struct usb_driver ath9k_hif_usb_driver = {
#endif
.id_table = ath9k_hif_usb_ids,
.soft_unbind = 1,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
int ath9k_hif_usb_init(void)
diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c
index 99ab203..b3bb548 100644
--- a/drivers/net/wireless/ath/carl9170/usb.c
+++ b/drivers/net/wireless/ath/carl9170/usb.c
@@ -1194,7 +1194,9 @@ static struct usb_driver carl9170_driver = {
.resume = carl9170_usb_resume,
.reset_resume = carl9170_usb_resume,
#endif /* CONFIG_PM */
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(carl9170_driver);
diff --git a/drivers/net/wireless/atmel/at76c50x-usb.c b/drivers/net/wireless/atmel/at76c50x-usb.c
index 0e18067..b7ef8d5 100644
--- a/drivers/net/wireless/atmel/at76c50x-usb.c
+++ b/drivers/net/wireless/atmel/at76c50x-usb.c
@@ -2567,7 +2567,9 @@ static struct usb_driver at76_driver = {
.probe = at76_probe,
.disconnect = at76_disconnect,
.id_table = dev_table,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
static int __init at76_mod_init(void)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
index d93ebbd..93e600e 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
@@ -1483,7 +1483,9 @@ static struct usb_driver brcmf_usbdrvr = {
.suspend = brcmf_usb_suspend,
.resume = brcmf_usb_resume,
.reset_resume = brcmf_usb_reset_resume,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
static int brcmf_usb_reset_device(struct device *dev, void *notused)
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
index de94dfd..971499c 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
@@ -37,6 +37,32 @@
#include "internal.h"
#include "iwl-op-mode.h"
+ #if LINUX_VERSION_IS_LESS(3,7,0)
+/*
+ * atomic_dec_if_positive - decrement by 1 if old value positive
+ * @v: pointer of type atomic_t
+ *
+ * The function returns the old value of *v minus 1, even if
+ * the atomic variable, v, was not decremented.
+ */
+#ifndef atomic_dec_if_positive
+static inline int atomic_dec_if_positive(atomic_t *v)
+{
+ int c, old, dec;
+ c = atomic_read(v);
+ for (;;) {
+ dec = c - 1;
+ if (unlikely(dec < 0))
+ break;
+ old = atomic_cmpxchg((v), c, dec);
+ if (likely(old == c))
+ break;
+ c = old;
+ }
+ return dec;
+}
+#endif
+#endif
/******************************************************************************
*
* RX path functions
diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c
index 98e1380..728f3e9 100644
--- a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c
+++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c
@@ -1734,7 +1734,9 @@ static struct usb_driver orinoco_driver = {
.probe = ezusb_probe,
.disconnect = ezusb_disconnect,
.id_table = ezusb_table,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(orinoco_driver);
diff --git a/drivers/net/wireless/intersil/p54/p54usb.c b/drivers/net/wireless/intersil/p54/p54usb.c
index 043bd1c..bc823d3 100644
--- a/drivers/net/wireless/intersil/p54/p54usb.c
+++ b/drivers/net/wireless/intersil/p54/p54usb.c
@@ -1143,7 +1143,9 @@ static struct usb_driver p54u_driver = {
.reset_resume = p54u_resume,
#endif /* CONFIG_PM */
.soft_unbind = 1,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(p54u_driver);
diff --git a/drivers/net/wireless/marvell/libertas/if_usb.c b/drivers/net/wireless/marvell/libertas/if_usb.c
index fc46d6b..7f4998a 100644
--- a/drivers/net/wireless/marvell/libertas/if_usb.c
+++ b/drivers/net/wireless/marvell/libertas/if_usb.c
@@ -1011,7 +1011,9 @@ static struct usb_driver if_usb_driver = {
.suspend = if_usb_suspend,
.resume = if_usb_resume,
.reset_resume = if_usb_resume,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(if_usb_driver);
diff --git a/drivers/net/wireless/marvell/libertas_tf/if_usb.c b/drivers/net/wireless/marvell/libertas_tf/if_usb.c
index e0ade40..b9ce043 100644
--- a/drivers/net/wireless/marvell/libertas_tf/if_usb.c
+++ b/drivers/net/wireless/marvell/libertas_tf/if_usb.c
@@ -912,7 +912,9 @@ static struct usb_driver if_usb_driver = {
.id_table = if_usb_table,
.suspend = if_usb_suspend,
.resume = if_usb_resume,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(if_usb_driver);
diff --git a/drivers/net/wireless/marvell/mwifiex/Kconfig b/drivers/net/wireless/marvell/mwifiex/Kconfig
index 7c1795b..24ba26d 100644
--- a/drivers/net/wireless/marvell/mwifiex/Kconfig
+++ b/drivers/net/wireless/marvell/mwifiex/Kconfig
@@ -10,7 +10,7 @@ config MWIFIEX
mwifiex.
config MWIFIEX_SDIO
- depends on !KERNEL_3_2
+ #depends on !KERNEL_3_2
tristate "Marvell WiFi-Ex Driver for SD8786/SD8787/SD8797/SD8887/SD8897/SD8997"
depends on m
depends on MWIFIEX && MMC
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index b8c990d..75d14f5 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -391,7 +391,11 @@ static void mwifiex_pcie_reset_notify(struct pci_dev *pdev, bool prepare)
}
static const struct pci_error_handlers mwifiex_pcie_err_handler[] = {
- { .reset_notify = mwifiex_pcie_reset_notify, },
+ {
+#if LINUX_VERSION_IS_GEQ(3,16,0)
+ .reset_notify = mwifiex_pcie_reset_notify,
+#endif
+ },
};
#ifdef CONFIG_PM_SLEEP
diff --git a/drivers/net/wireless/mediatek/mt7601u/usb.c b/drivers/net/wireless/mediatek/mt7601u/usb.c
index 416c604..4361007 100644
--- a/drivers/net/wireless/mediatek/mt7601u/usb.c
+++ b/drivers/net/wireless/mediatek/mt7601u/usb.c
@@ -357,6 +357,8 @@ static struct usb_driver mt7601u_driver = {
.resume = mt7601u_resume,
.reset_resume = mt7601u_resume,
.soft_unbind = 1,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(mt7601u_driver);
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2500usb.c b/drivers/net/wireless/ralink/rt2x00/rt2500usb.c
index faf56ee..0f139c7 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2500usb.c
@@ -1988,7 +1988,9 @@ static struct usb_driver rt2500usb_driver = {
.suspend = rt2x00usb_suspend,
.resume = rt2x00usb_resume,
.reset_resume = rt2x00usb_resume,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(rt2500usb_driver);
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
index 215b4c9..fbdf378 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
@@ -1411,7 +1411,9 @@ static struct usb_driver rt2800usb_driver = {
.suspend = rt2x00usb_suspend,
.resume = rt2x00usb_resume,
.reset_resume = rt2x00usb_resume,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(rt2800usb_driver);
diff --git a/drivers/net/wireless/ralink/rt2x00/rt73usb.c b/drivers/net/wireless/ralink/rt2x00/rt73usb.c
index 0f10f4f..1f04cca 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt73usb.c
@@ -2541,7 +2541,9 @@ static struct usb_driver rt73usb_driver = {
.suspend = rt2x00usb_suspend,
.resume = rt2x00usb_resume,
.reset_resume = rt2x00usb_resume,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(rt73usb_driver);
diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
index fa7214c..fcadcb9 100644
--- a/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
@@ -1678,7 +1678,9 @@ static struct usb_driver rtl8187_driver = {
.id_table = rtl8187_table,
.probe = rtl8187_probe,
.disconnect = rtl8187_disconnect,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(rtl8187_driver);
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index f435c44..1bc6b2b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -6361,6 +6361,8 @@ static struct usb_device_id dev_table[] = {
.driver_info = (unsigned long)&rtl8192eu_fops},
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x818c, 0xff, 0xff, 0xff),
.driver_info = (unsigned long)&rtl8192eu_fops},
+{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8179, 0xff, 0xff, 0xff),
+ .driver_info = (unsigned long)&rtl8192eu_fops},
#endif
{ }
};
@@ -6371,7 +6373,9 @@ static struct usb_driver rtl8xxxu_driver = {
.disconnect = rtl8xxxu_disconnect,
.id_table = dev_table,
.no_dynamic_id = 1,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
static int __init rtl8xxxu_module_init(void)
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c
index 96c923b..9ed6a03 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c
@@ -405,7 +405,9 @@ static struct usb_driver rtl8192cu_driver = {
/* .resume = rtl_usb_resume, */
/* .reset_resume = rtl8192c_resume, */
#endif /* CONFIG_PM */
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(rtl8192cu_driver);
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 785334f..c166271 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -3762,7 +3762,9 @@ static struct usb_driver rndis_wlan_driver = {
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(rndis_wlan_driver);
diff --git a/drivers/net/wireless/zydas/zd1201.c b/drivers/net/wireless/zydas/zd1201.c
index de7ff39..0d138ae 100644
--- a/drivers/net/wireless/zydas/zd1201.c
+++ b/drivers/net/wireless/zydas/zd1201.c
@@ -1906,7 +1906,9 @@ static struct usb_driver zd1201_usb = {
.id_table = zd1201_table,
.suspend = zd1201_suspend,
.resume = zd1201_resume,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(zd1201_usb);
diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c
index c5effd6..10e67b1 100644
--- a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c
@@ -1539,7 +1539,9 @@ static struct usb_driver driver = {
.disconnect = disconnect,
.pre_reset = pre_reset,
.post_reset = post_reset,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
struct workqueue_struct *zd_workqueue;
diff --git a/drivers/nfc/nfcmrvl/usb.c b/drivers/nfc/nfcmrvl/usb.c
index 585a0f2..68ec797 100644
--- a/drivers/nfc/nfcmrvl/usb.c
+++ b/drivers/nfc/nfcmrvl/usb.c
@@ -462,7 +462,9 @@ static struct usb_driver nfcmrvl_usb_driver = {
#endif
.id_table = nfcmrvl_table,
.supports_autosuspend = 1,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
.soft_unbind = 1,
};
module_usb_driver(nfcmrvl_usb_driver);
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 8fda45a..4b429ae 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -1199,7 +1199,9 @@ static struct usb_driver wdm_driver = {
.post_reset = wdm_post_reset,
.id_table = wdm_ids,
.supports_autosuspend = 1,
+#if LINUX_VERSION_IS_GEQ(3,5,0)
.disable_hub_initiated_lpm = 1,
+#endif
};
module_usb_driver(wdm_driver);
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 242a3c1..33ee381 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1137,6 +1137,7 @@ static u16 ieee80211_netdev_select_queue(struct net_device *dev,
static void
ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
{
+#if LINUX_VERSION_IS_GEQ(3,14,0)
int i;
for_each_possible_cpu(i) {
@@ -1159,6 +1160,7 @@ ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
stats->rx_bytes += rx_bytes;
stats->tx_bytes += tx_bytes;
}
+#endif
}
static const struct net_device_ops ieee80211_dataif_ops = {
@@ -1232,7 +1234,11 @@ static void ieee80211_if_setup(struct net_device *dev)
static void ieee80211_if_setup_no_queue(struct net_device *dev)
{
ieee80211_if_setup(dev);
+#if LINUX_VERSION_IS_GEQ(4,3,0)
dev->priv_flags |= IFF_NO_QUEUE;
+#else
+ dev->tx_queue_len = 0;
+#endif
}
static void ieee80211_iface_work(struct work_struct *work)
@@ -1913,9 +1919,11 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
netdev_set_default_ethtool_ops(ndev, &ieee80211_ethtool_ops);
+#if LINUX_VERSION_IS_GEQ(4,10,0)
/* MTU range: 256 - 2304 */
ndev->min_mtu = 256;
ndev->max_mtu = IEEE80211_MAX_DATA_LEN;
+#endif
ret = register_netdevice(ndev);
if (ret) {
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index b34bbb4..332fdc5 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -36,12 +36,14 @@
static inline void ieee80211_rx_stats(struct net_device *dev, u32 len)
{
+#if LINUX_VERSION_IS_GEQ(3,14,0)
struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
u64_stats_update_begin(&tstats->syncp);
tstats->rx_packets++;
tstats->rx_bytes += len;
u64_stats_update_end(&tstats->syncp);
+#endif
}
static u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len,
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 83b8b11..7d769a1 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -542,8 +542,10 @@ static void ieee80211_report_used_skb(struct ieee80211_local *local,
}
if (!dropped && skb->destructor) {
+#if LINUX_VERSION_IS_GEQ(3,3,0)
skb->wifi_acked_valid = 1;
skb->wifi_acked = acked;
+#endif
}
}
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 6e0a675..762ec66 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -43,12 +43,14 @@
static inline void ieee80211_tx_stats(struct net_device *dev, u32 len)
{
+#if LINUX_VERSION_IS_GEQ(3,14,0)
struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
u64_stats_update_begin(&tstats->syncp);
tstats->tx_packets++;
tstats->tx_bytes += len;
u64_stats_update_end(&tstats->syncp);
+#endif
}
static __le16 ieee80211_duration(struct ieee80211_tx_data *tx,
diff --git a/net/wireless/trace.c b/net/wireless/trace.c
index c435908..7f2f887 100644
--- a/net/wireless/trace.c
+++ b/net/wireless/trace.c
@@ -1,5 +1,5 @@
#include <linux/module.h>
-#if LINUX_VERSION_IS_LESS(3,1,0)
+#if LINUX_VERSION_IS_LESS(3,2,0)
#include <linux/interrupt.h>
#endif
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 9675c73..90ce475 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -11,6 +11,9 @@
#include <net/cfg80211.h>
#include "core.h"
+#ifndef BACKPORTS_TRACE
+#define BACKPORTS_TRACE
+
#define MAC_ENTRY(entry_mac) __array(u8, entry_mac, ETH_ALEN)
#define MAC_ASSIGN(entry_mac, given_mac) do { \
if (given_mac) \
@@ -212,6 +215,18 @@
/*************************************************************
* rdev->ops traces *
*************************************************************/
+#if LINUX_VERSION_IS_LESS(4,0,0)
+#undef TP_PROTO
+#define TP_PROTO(args...) args
+#undef DECLARE_TRACE
+#define DECLARE_TRACE(args...)
+#undef DEFINE_EVENT
+#define DEFINE_EVENT(skip,name,proto,args...) inline void trace_##name(proto){}
+#undef TRACE_EVENT
+#define TRACE_EVENT(name,proto,args...) inline void trace_##name(proto){}
+#endif
+DEFINE_EVENT(skip, rdev_set_multicast_to_unicast,
+ TP_PROTO(struct wiphy *wiphy, struct net_device *dev, bool ena), a);
TRACE_EVENT(rdev_suspend,
TP_PROTO(struct wiphy *wiphy, struct cfg80211_wowlan *wow),
@@ -277,6 +292,9 @@ TRACE_EVENT(rdev_scan,
TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)
);
+#undef DECLARE_EVENT_CLASS
+#define DECLARE_EVENT_CLASS(args...)
+
DECLARE_EVENT_CLASS(wiphy_only_evt,
TP_PROTO(struct wiphy *wiphy),
TP_ARGS(wiphy),
@@ -3051,25 +3069,7 @@ DEFINE_EVENT(wiphy_wdev_evt, rdev_abort_scan,
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
TP_ARGS(wiphy, wdev)
);
-
-TRACE_EVENT(rdev_set_multicast_to_unicast,
- TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
- const bool enabled),
- TP_ARGS(wiphy, netdev, enabled),
- TP_STRUCT__entry(
- WIPHY_ENTRY
- NETDEV_ENTRY
- __field(bool, enabled)
- ),
- TP_fast_assign(
- WIPHY_ASSIGN;
- NETDEV_ASSIGN;
- __entry->enabled = enabled;
- ),
- TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", unicast: %s",
- WIPHY_PR_ARG, NETDEV_PR_ARG,
- BOOL_TO_STR(__entry->enabled))
-);
+#endif /* BACKPORTS_TRACE */
#endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */
#undef TRACE_INCLUDE_PATH