]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/zd1211/zd1211-4916/get-stats.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / zd1211 / zd1211-4916 / get-stats.patch
1 --- zd1211-4916-r0/src/zd1205.h.orig    2005-01-28 22:55:15.000000000 -0800
2 +++ zd1211-4916-r0/src/zd1205.h 2005-03-04 13:41:16.879006208 -0800
3 @@ -611,6 +611,9 @@
4  ***************************************************************************/\r
5  struct driver_stats {\r
6         struct net_device_stats net_stats;\r
7 +#ifdef CONFIG_NET_WIRELESS
8 +        struct iw_statistics    iw_stats;
9 +#endif
10         unsigned long tx_late_col;\r
11         unsigned long tx_ok_defrd;\r
12         unsigned long tx_one_retry;\r
13 --- zd1211-4916-r0/src/zd1205.c.orig    2005-03-03 18:43:48.000000000 -0800
14 +++ zd1211-4916-r0/src/zd1205.c 2005-03-04 13:45:07.134002128 -0800
15 @@ -4196,6 +4196,42 @@
16         return &(macp->drv_stats.net_stats);\r
17  }\r
18  \r
19 +/**
20 + * zd1205wext_iw_get_stats - get driver statistics
21 +
22 + * @dev: adapter's net_device struct
23 + *
24 + * This routine is called when the OS wants the adapter's wireless
25 + * stats returned.  It returns the address of the iw_statistics
26 + * stucture for the device.  If the statistics are currently being
27 + * updated, then they might be incorrect for a short while. However,
28 + * since this cannot actually cause damage, no locking is used.
29 + */
30 +#if WIRELESS_EXT > 12
31 +struct iw_statistics *
32 +zd1205wext_iw_get_stats(struct net_device *dev)
33 +{
34 +       struct zd1205_private *macp = dev->priv;
35 +       struct iw_statistics *iw_stats = &macp->drv_stats.iw_stats;
36 +
37 +       iw_stats->qual.noise = 161;
38 +       iw_stats->qual.qual = 0;//macp->rxInfo.rxSignalQuality;
39 +       iw_stats->qual.level = 0;//macp->rxInfo.rxSignalStrength;
40 +       iw_stats->qual.updated = 7;
41 +
42 +        iw_stats->discard.nwid = 0;
43 +        iw_stats->discard.code = 0;
44 +        iw_stats->discard.fragment = 0;
45 +        iw_stats->discard.retries = macp->retryFailCnt;
46 +        iw_stats->discard.misc = macp->DropFirstFragCnt + macp->ErrLongFrmCnt +
47 +               macp->ErrShortFrmCnt + macp->ErrZeroLenFrmCnt;
48 +
49 +        iw_stats->miss.beacon = 0;
50 +
51 +       return iw_stats;
52 +}
53 +#endif
54 +
55  \r
56  /**\r
57   * zd1205_set_mac - set the MAC address\r
58 --- zd1211-4916-r0/src/zd1211.c.orig    2005-03-03 18:43:49.000000000 -0800
59 +++ zd1211-4916-r0/src/zd1211.c 2005-03-04 13:44:31.122476712 -0800
60 @@ -1873,6 +1873,9 @@
61  #define        ZD1211_TX_TIMEOUT       (HZ*10)\r
62  #define        ZD1211_MTU                      1500\r
63  extern struct iw_handler_def p80211wext_handler_def;\r
64 +#ifdef CONFIG_NET_WIRELESS
65 +extern  struct iw_statistics *zd1205wext_iw_get_stats(struct net_device *);
66 +#endif
67  \r
68  u8 zd1211_InitSetup(struct net_device *dev, struct zd1205_private *macp)\r
69  \r
70 @@ -1964,6 +1967,7 @@
71  \r
72  #if WIRELESS_EXT > 12\r
73      dev->wireless_handlers = (struct iw_handler_def *)&p80211wext_handler_def;\r
74 +    dev->get_wireless_stats = &zd1205wext_iw_get_stats;
75  #endif\r
76      \r
77         dev->hard_start_xmit = zd1205_xmit_frame;\r