+struct iw_statistics *wlcompat_get_wireless_stats(struct net_device *dev)
+{
+ wl_bss_info_t *bss_info = (wl_bss_info_t *) buf;
+ get_pktcnt_t pkt;
+ int rssi, noise;
+
+ memset(&wstats, 0, sizeof(wstats));
+ memset(&pkt, 0, sizeof(pkt));
+ memset(buf, 0, sizeof(buf));
+ bss_info->version = 0x2000;
+ wl_ioctl(dev, WLC_GET_BSS_INFO, bss_info, WLC_IOCTL_MAXLEN);
+ wl_ioctl(dev, WLC_GET_PKTCNTS, &pkt, sizeof(pkt));
+
+ // somehow the structure doesn't fit here
+ noise = buf[0x50];
+ rssi = buf[0x52];
+
+ wstats.qual.level = rssi;
+ wstats.qual.noise = -100 + noise;
+ wstats.discard.misc = pkt.rx_bad_pkt;
+ wstats.discard.retries = pkt.tx_bad_pkt;
+
+ return &wstats;
+}
+