The current HAL exports two functions which appear to have gone unnoticed for quite some time.
This patch makes use of those functions and gives measured noise data from the HAL to the driver and stack instead of simply assuming -95dBm throughout.
Currently the noise level is retrived on every rx interrupt and stored in the softc for the device. It is then passed to the 802.11 stack during the rx tasklet where it is used by the wireless extensions code. It is also used by the monitor mode functions to record the current noise level.
Because the descriptors only have an RSSI value in them and not a noise value, there is some error. The noise can not be retrived per frame, only per interrupt, and we cannot be sure if the RSSI was calculated using the noise level we just retrieved or some "older" value.
The other problem is scanning. Currently we do not keep a list of channels and their
associated noise levels, we only keep a "current noise" value, which will end up being the last noise value retrieved. This means that all scan results will have the same noise level rather than individual levels for each channel. Presumably we could keep a list of channels, and then before we switch to the next channel to scan, get the noise and store it. The scan result list can then be made up using this information. For now however, scans simply report -95dBm as they always have.
In summary, this patch does the following:
- Gets the measured noise level per rx interrupt from the HAL
- Passes the noise level to wireless extensions (iwconfig, etc)
- Use this level to calculate signal strength of frames in monitor mode.
- Does not apply to scanning (working on it).
It would be nice to get some people testing this patch and providing feedback so that we could eventually have real noise information being exported by madwifi.