summaryrefslogtreecommitdiff
path: root/packages/zd1211/zd1211-4916/get-stats.patch
blob: 0525522b43ec73de00b1b0d58ce7ffdcc6d57810 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
--- zd1211-4916-r0/src/zd1205.h.orig	2005-01-28 22:55:15.000000000 -0800
+++ zd1211-4916-r0/src/zd1205.h	2005-03-04 13:41:16.879006208 -0800
@@ -611,6 +611,9 @@
 ***************************************************************************/
 struct driver_stats {
 	struct net_device_stats net_stats;
+#ifdef CONFIG_NET_WIRELESS
+        struct iw_statistics    iw_stats;
+#endif
 	unsigned long tx_late_col;
 	unsigned long tx_ok_defrd;
 	unsigned long tx_one_retry;
--- zd1211-4916-r0/src/zd1205.c.orig	2005-03-03 18:43:48.000000000 -0800
+++ zd1211-4916-r0/src/zd1205.c	2005-03-04 13:45:07.134002128 -0800
@@ -4196,6 +4196,42 @@
 	return &(macp->drv_stats.net_stats);
 }
 
+/**
+ * zd1205wext_iw_get_stats - get driver statistics
+
+ * @dev: adapter's net_device struct
+ *
+ * This routine is called when the OS wants the adapter's wireless
+ * stats returned.  It returns the address of the iw_statistics
+ * stucture for the device.  If the statistics are currently being
+ * updated, then they might be incorrect for a short while. However,
+ * since this cannot actually cause damage, no locking is used.
+ */
+#if WIRELESS_EXT > 12
+struct iw_statistics *
+zd1205wext_iw_get_stats(struct net_device *dev)
+{
+	struct zd1205_private *macp = dev->priv;
+	struct iw_statistics *iw_stats = &macp->drv_stats.iw_stats;
+
+	iw_stats->qual.noise = 161;
+	iw_stats->qual.qual = 0;//macp->rxInfo.rxSignalQuality;
+	iw_stats->qual.level = 0;//macp->rxInfo.rxSignalStrength;
+	iw_stats->qual.updated = 7;
+
+        iw_stats->discard.nwid = 0;
+        iw_stats->discard.code = 0;
+        iw_stats->discard.fragment = 0;
+        iw_stats->discard.retries = macp->retryFailCnt;
+        iw_stats->discard.misc = macp->DropFirstFragCnt + macp->ErrLongFrmCnt +
+		macp->ErrShortFrmCnt + macp->ErrZeroLenFrmCnt;
+
+        iw_stats->miss.beacon = 0;
+
+	return iw_stats;
+}
+#endif
+
 
 /**
  * zd1205_set_mac - set the MAC address
--- zd1211-4916-r0/src/zd1211.c.orig	2005-03-03 18:43:49.000000000 -0800
+++ zd1211-4916-r0/src/zd1211.c	2005-03-04 13:44:31.122476712 -0800
@@ -1873,6 +1873,9 @@
 #define	ZD1211_TX_TIMEOUT	(HZ*10)
 #define	ZD1211_MTU			1500
 extern struct iw_handler_def p80211wext_handler_def;
+#ifdef CONFIG_NET_WIRELESS
+extern  struct iw_statistics *zd1205wext_iw_get_stats(struct net_device *);
+#endif
 
 u8 zd1211_InitSetup(struct net_device *dev, struct zd1205_private *macp)
 
@@ -1964,6 +1967,7 @@
 
 #if WIRELESS_EXT > 12
     dev->wireless_handlers = (struct iw_handler_def *)&p80211wext_handler_def;
+    dev->get_wireless_stats = &zd1205wext_iw_get_stats;
 #endif
     
 	dev->hard_start_xmit = zd1205_xmit_frame;