Forums - monitor mode: is setMonChan throttled and queued?

1 post / 0 new
monitor mode: is setMonChan throttled and queued?
matthew2
Join Date: 21 Sep 23
Posts: 1
Posted: Thu, 2023-09-21 12:03

Hello,

We are using the https://github.com/8devices/qcacld-2.0 driver, creating a wifi monitor feature.

We have a new feature request, which requires precise wifi channel changing and and associated timing.

In other words, when we request a channel change, it should be processed immediately.

Currently we are seeing an odd "throttling" and "queueing" behavior, such that the driver or the qualcomm chip are only honoring 'setMonChan' requests every 3 seconds AND queuing up the requests. i.e. if we change channels faster than 3 seconds, we do not see packets with radiotap headers for the channel immediately, it is delayed about 3 seconds. However, if we wait more than 3 seconds to issue a channel change request, then we do get packets with the expected radiotap header almost immediately.

We use the command:
iwpriv wlan0 setMonChan XX YY

to request a monitor channel change.

We use the driver only in monitor mode via con_mode=4.

The embedded platform is ARM based, Debian 11, Kernel 5.15.99.

I created a minimal application that reveals this issue, using Qt5 + libpcap.  pcap is setup for immediate packet delivery.

The test app will issue setMonChan commands every 500ms, switching between channels 1 and 11.

The test app performs the minimal radiotap header parsing to determine the frequency of the incoming packet, and will log anytime it sees a new frequency in the incoming packets radiotap header. My results look like this:

Sep 21 15:37:43.952020 qcaWifiTestApp[1809]: 2023-09-21T15:37:43.951: wlan module found ok
Sep 21 15:37:43.962226 qcaWifiTestApp[1809]: 2023-09-21T15:37:43.961: Device Found At  "wlan0"
Sep 21 15:37:43.962594 qcaWifiTestApp[1809]: 2023-09-21T15:37:43.962: void ChannelChanger::Start()
Sep 21 15:37:43.962939 qcaWifiTestApp[1809]: 2023-09-21T15:37:43.962: bool PcapReader::Start()
Sep 21 15:37:43.963238 qcaWifiTestApp[1809]: 2023-09-21T15:37:43.963: InitPcap using pcap lib version: libpcap version 1.10.0 (with TPACKET_V3)
Sep 21 15:37:44.031028 qcaWifiTestApp[1809]: 2023-09-21T15:37:44.030: Changed to:  1 0
Sep 21 15:37:44.042226 qcaWifiTestApp[1809]: 2023-09-21T15:37:44.041: At frame count:  1 , new frequency detected:  2412
Sep 21 15:37:44.565027 qcaWifiTestApp[1809]: 2023-09-21T15:37:44.564: Changed to:  11 0
Sep 21 15:37:45.098442 qcaWifiTestApp[1809]: 2023-09-21T15:37:45.098: Changed to:  1 0
Sep 21 15:37:45.631981 qcaWifiTestApp[1809]: 2023-09-21T15:37:45.631: Changed to:  11 0
Sep 21 15:37:46.166022 qcaWifiTestApp[1809]: 2023-09-21T15:37:46.165: Changed to:  1 0
Sep 21 15:37:46.699574 qcaWifiTestApp[1809]: 2023-09-21T15:37:46.699: Changed to:  11 0
Sep 21 15:37:47.185968 qcaWifiTestApp[1809]: 2023-09-21T15:37:47.185: At frame count:  450 , new frequency detected:  2462
Sep 21 15:37:47.232199 qcaWifiTestApp[1809]: 2023-09-21T15:37:47.231: Changed to:  1 0
Sep 21 15:37:47.750125 qcaWifiTestApp[1809]: 2023-09-21T15:37:47.749: Changed to:  11 0
Sep 21 15:37:48.249979 qcaWifiTestApp[1809]: 2023-09-21T15:37:48.249: Changed to:  1 0
Sep 21 15:37:48.749585 qcaWifiTestApp[1809]: 2023-09-21T15:37:48.749: Changed to:  11 0
Sep 21 15:37:49.249241 qcaWifiTestApp[1809]: 2023-09-21T15:37:49.248: Changed to:  1 0
Sep 21 15:37:49.749974 qcaWifiTestApp[1809]: 2023-09-21T15:37:49.749: Changed to:  11 0
Sep 21 15:37:50.249919 qcaWifiTestApp[1809]: 2023-09-21T15:37:50.249: Changed to:  1 0
Sep 21 15:37:50.257730 qcaWifiTestApp[1809]: 2023-09-21T15:37:50.257: At frame count:  517 , new frequency detected:  2412
Sep 21 15:37:50.749780 qcaWifiTestApp[1809]: 2023-09-21T15:37:50.749: Changed to:  11 0
Sep 21 15:37:51.249680 qcaWifiTestApp[1809]: 2023-09-21T15:37:51.249: Changed to:  1 0
Sep 21 15:37:51.749270 qcaWifiTestApp[1809]: 2023-09-21T15:37:51.748: Changed to:  11 0
Sep 21 15:37:52.249989 qcaWifiTestApp[1809]: 2023-09-21T15:37:52.249: Changed to:  1 0
Sep 21 15:37:52.749657 qcaWifiTestApp[1809]: 2023-09-21T15:37:52.749: Changed to:  11 0
Sep 21 15:37:53.249858 qcaWifiTestApp[1809]: 2023-09-21T15:37:53.249: Changed to:  1 0
Sep 21 15:37:53.381544 qcaWifiTestApp[1809]: 2023-09-21T15:37:53.381: At frame count:  1416 , new frequency detected:  2462
Sep 21 15:37:53.741656 qcaWifiTestApp[1809]: 2023-09-21T15:37:53.741: void ChannelChanger::Stop()
Sep 21 15:37:56.592186 qcaWifiTestApp[1809]: 2023-09-21T15:37:56.591: At frame count:  1480 , new frequency detected:  2412
Sep 21 15:37:59.730160 qcaWifiTestApp[1809]: 2023-09-21T15:37:59.729: At frame count:  2134 , new frequency detected:  2462
Sep 21 15:38:03.917908 qcaWifiTestApp[1809]: 2023-09-21T15:38:03.917: At frame count:  2225 , new frequency detected:  2412
Sep 21 15:38:07.544766 qcaWifiTestApp[1809]: 2023-09-21T15:38:07.544: At frame count:  2752 , new frequency detected:  2462
Sep 21 15:38:12.171266 qcaWifiTestApp[1809]: 2023-09-21T15:38:12.171: At frame count:  2841 , new frequency detected:  2412
Sep 21 15:38:17.240922 qcaWifiTestApp[1809]: 2023-09-21T15:38:17.240: At frame count:  3759 , new frequency detected:  2462
Sep 21 15:38:20.333458 qcaWifiTestApp[1809]: 2023-09-21T15:38:20.333: At frame count:  3808 , new frequency detected:  2412
Sep 21 15:38:23.897625 qcaWifiTestApp[1809]: 2023-09-21T15:38:23.897: At frame count:  4356 , new frequency detected:  2462
Sep 21 15:38:29.517974 qcaWifiTestApp[1809]: 2023-09-21T15:38:29.517: At frame count:  4457 , new frequency detected:  2412
Sep 21 15:38:32.601081 qcaWifiTestApp[1809]: 2023-09-21T15:38:32.600: At frame count:  4935 , new frequency detected:  2462
Sep 21 15:38:37.580055 qcaWifiTestApp[1809]: 2023-09-21T15:38:37.579: At frame count:  5036 , new frequency detected:  2412
Sep 21 15:38:40.885909 qcaWifiTestApp[1809]: 2023-09-21T15:38:40.885: At frame count:  5355 , new frequency detected:  2462
Sep 21 15:38:45.721540 qcaWifiTestApp[1809]: 2023-09-21T15:38:45.721: At frame count:  5484 , new frequency detected:  2412
Sep 21 15:38:49.190851 qcaWifiTestApp[1809]: 2023-09-21T15:38:49.190: At frame count:  5790 , new frequency detected:  2462
...


Note the long delays. After 10 seconds, the sample project automatically stops channel changing, yet it still takes a long time to see channel changing behavior settle down to the final channel. Basically it appears to be throttling and queuing up the 'setMonChan' commands, at a rate of about 3 seconds.

We need to be able to have immediate effect on 'setMonChan'. We are seeing the same issue in our official production code too.

How do we get an immediate channel change when in monitor mode? 

Thank you,

Matthew Eshleman

  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.