Page MenuHomeFreeBSD

rtwn: add radar detection support for RTL8821AU (disabled by default)

Authored by avos on Dec 25 2016, 6:53 PM.



The register access sequence is the same as in the 4.3.22-beta rtlwifi driver (core/rtw_odm.c file, code under CONFIG_DFS_MASTER ifdef); actually it was tested only in AP mode with no STAs.

By default it is disabled; to enable it, dev.rtwn.%d.radar_detection tunable need to be set to a nonzero value.

Test Plan

No radar events were seen - so, I have no idea if it is really correct / working.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

avos retitled this revision from to rtwn: add radar detection support for RTL8821AU (disabled by default).
avos updated this object.
avos edited the test plan for this revision. (Show Details)
avos added reviewers: adrian, kevlo, ivadasz.
avos set the repository for this revision to rS FreeBSD src repository - subversion.

Hm, so does the firmware do the DFS radar detection and return "radar found", or is it like the atheros chips and just returning pulses, and some userland detector has to fire?

This is something the USB NIC does, right? Maybe I can set up next week here to see. I can generate FCC pulses at the very least.

What's the vendor code doing?


Yes, this is USB NIC.

As I can see, the vendor code:

  1. when channel is selected and radar detection is required - calls rtw_odm_radar_detect_enable() (writes some values into few undocumented registers).
  2. when AP is started - starts a timer with 100 ms period, where checks 17th bit from another undocumented register.
  3. if the bit is set (== radar is detected):
    • resets radar detection;
    • refreshes non-occupancy list
    • recreates the BSS.

P.S. BTW, the 'radar event' is ignored if there was too much data (Tx + Rx) during last timer period; this is not implemented here yet.

adrian edited edge metadata.

interesting, ok. I bet it's just detecting a pulse. I'll go look at it on the scope next week.

This revision is now accepted and ready to land.Dec 26 2016, 12:07 AM
This revision was automatically updated to reflect the committed changes.