summaryrefslogtreecommitdiff
path: root/patches/collateral-evolutions/network/64-b44-32bit-stats/drivers_net_ethernet_broadcom_b44.patch
blob: bdda62c679e91700df76f1016145654167c384aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -29,6 +29,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/ssb/ssb.h>
 #include <linux/slab.h>
+#include <linux/u64_stats_sync.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -1646,10 +1647,17 @@ static int b44_close(struct net_device *
 	return 0;
 }
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
 static struct rtnl_link_stats64 *b44_get_stats64(struct net_device *dev,
 					struct rtnl_link_stats64 *nstat)
+#else
+static struct net_device_stats *b44_get_stats(struct net_device *dev)
+#endif
 {
 	struct b44 *bp = netdev_priv(dev);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
+	struct net_device_stats *nstat = &dev->stats;
+#endif
 	struct b44_hw_stats *hwstat = &bp->hw_stats;
 	unsigned int start;
 
@@ -2138,7 +2146,11 @@ static const struct net_device_ops b44_n
 	.ndo_open		= b44_open,
 	.ndo_stop		= b44_close,
 	.ndo_start_xmit		= b44_start_xmit,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
 	.ndo_get_stats64	= b44_get_stats64,
+#else
+	.ndo_get_stats		= b44_get_stats,
+#endif
 	.ndo_set_rx_mode	= b44_set_rx_mode,
 	.ndo_set_mac_address	= b44_set_mac_addr,
 	.ndo_validate_addr	= eth_validate_addr,