diff options
author | Dominik Sliwa <dominik.sliwa@toradex.com> | 2017-07-04 11:53:51 +0200 |
---|---|---|
committer | Dominik Sliwa <dominik.sliwa@toradex.com> | 2017-08-21 17:21:16 +0200 |
commit | 84d6642e4d1609562abb421341c9a90c023247a1 (patch) | |
tree | ffcc2b23e887c7d5615303067978e185e67072cc /net/mac80211 | |
parent | 52409fae3e4b8d16b68b61902fc09075cd97b75d (diff) |
backports:fix compilation with toradex kernels
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/iface.c | 8 | ||||
-rw-r--r-- | net/mac80211/rx.c | 2 | ||||
-rw-r--r-- | net/mac80211/status.c | 2 | ||||
-rw-r--r-- | net/mac80211/tx.c | 2 |
4 files changed, 14 insertions, 0 deletions
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, |