+ rssi = 0;
+ if ((wl_ioctl(dev, WLC_GET_AP, &ap, sizeof(ap)) < 0) || ap) {
+ if (wl_ioctl(dev, WLC_GET_PHY_NOISE, &noise, sizeof(noise)) < 0)
+ noise = 0;
+ } else {
+ // somehow the structure doesn't fit here
+ rssi = buf[82];
+ noise = buf[84];
+ }
+ rssi = (rssi == 0 ? 1 : rssi);
+ wstats.qual.updated = 0x10;
+ if (rssi <= 1)
+ wstats.qual.updated |= 0x20;
+ if (noise <= 1)
+ wstats.qual.updated |= 0x40;
+
+ if ((wstats.qual.updated & 0x60) == 0x60)
+ return NULL;