/* Make sure driver is not buggy or using the old API */ if (!spydata) return -EOPNOTSUPP;
/* Disable spy collection while we copy the addresses. *Whilewecopyaddresses,anycalltolibipw_spy_update()
* will NOP. This is OK, as anyway the addresses are changing. */
spydata->spy_number = 0;
/* We want to operate without locking, because libipw_spy_update() *mostlikelywillhappenintheinterrupthandler,andtherefore *haveitsownlockingconstraintsandneedsperformance. *Thertnl_lock()makesurewedon'tracewiththeotheriw_handlers. *Thismakesurelibipw_spy_update()"see"thatthespylist
* is temporarily disabled. */
smp_wmb();
/* Are there are addresses to copy? */ if (wrqu->data.length > 0) { int i;
/* Copy addresses */ for (i = 0; i < wrqu->data.length; i++)
memcpy(spydata->spy_address[i], address[i].sa_data,
ETH_ALEN); /* Reset stats */
memset(spydata->spy_stat, 0, sizeof(struct iw_quality) * IW_MAX_SPY);
}
/* Make sure above is updated before re-enabling */
smp_wmb();
/* Make sure driver is not buggy or using the old API */ if (!spydata) return;
/* Update all records that match */ for (i = 0; i < spydata->spy_number; i++) if (ether_addr_equal(address, spydata->spy_address[i])) {
memcpy(&(spydata->spy_stat[i]), wstats, sizeof(struct iw_quality));
match = i;
}
/* Generate an event if we cross the spy threshold. *Toavoideventstorms,wehaveasimplehysteresis:wegenerate *eventonlywhenwegounderthelowthresholdorabovethe
* high threshold. */ if (match >= 0) { if (spydata->spy_thr_under[match]) { if (wstats->level > spydata->spy_thr_high.level) {
spydata->spy_thr_under[match] = 0;
iw_send_thrspy_event(dev, spydata,
address, wstats);
}
} else { if (wstats->level < spydata->spy_thr_low.level) {
spydata->spy_thr_under[match] = 1;
iw_send_thrspy_event(dev, spydata,
address, wstats);
}
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-10-02)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.