On 3/12/2025 7:01 PM, Nithyanantham Paramasivam wrote: > Currently, in NO_VIRTUAL_MONITOR mode, when creating an > AP/STA + monitor, there is a restriction: if the AP/STA is running, > setting the channel for the monitor is not allowed. For example, > in a scenario with three supported radios where the AP uses only the > 2 GHz and 5 GHz bands, the 6 GHz band remains available. However, > due to the restriction that rdev->num_running_ifaces must equal > rdev->num_running_monitor_ifaces in cfg80211_has_monitors_only(), > we are unable to create the monitor interface. > > cfg80211_set_monitor_channel -> cfg80211_has_monitors_only() > > static inline bool cfg80211_has_monitors_only() { > ... > return rdev->num_running_ifaces == rdev->num_running_monitor_ifaces > && rdev->num_running_ifaces > 0; > } > > To address this issue, bypass the cfg80211_has_monitors_only() call > for NO_VIRTUAL_MONITOR to allow monitor creation. In the mac80211 > layer, no additional changes are required. It follows the same > sequence as standalone monitor creation in NO_VIRTUAL_MONITOR mode. > > Refer link to Felix's NO_VIRTUAL_MONITOR mode patch series. > https://lore.kernel.org/linux-wireless/cover.bd168805c299851d01269473eb64e7b05edc41d6.1728372192.git-series.nbd@xxxxxxxx/ > > Tested various scenarios with the cfg80211_has_monitors_only() bypass > modification > > standalone monitor creation case > ******************************** > 1. Create multiple standalone monitor interfaces with > different radios > - Allowed one channel per radio but multiple interfaces > can be created with the same channel/radio. > > AP+Monitor case > *************** > 1. Create monitor interface with same channel used by AP > - allowed > 2. Create a monitor interface on a different channel (ch-6) > on the same radio that the AP uses (ch-1) - not allowed > 3. If the system supports three radios (2 GHz, 5 GHz, and 6 GHz) > and the AP uses 5 GHz and 6 GHz - allowed to create a monitor on > the 2 GHz radio > > > Please share your thoughts on the following query > > In the virtual monitor mode design, only a single monitor interface > per radio was supported and subsquent monitor creation shares the same > vif. However, in NO_VIRTUAL_MONITOR mode(multi-wiphy scenario), there > is no limitation on the number of interfaces that can be created (due > to separate SDATA for each interface) and notified to the driver. > For example, the ath driver can handle up to 16 interfaces per radio. > Should we impose any limitations in cfg80211/mac80211 ? > > V2: > - Rebased patches > - Flag renamed to WIPHY_FLAG_SUPPORTS_CONCUR_MONITOR_N_OTHER_VIF > - Patch(2/2) renamed > - updated all the patch comments > > Nithyanantham Paramasivam (2): > wifi: cfg80211: Allow monitor creation in NO_VIRTUAL_MONITOR mode with > active AP > wifi: mac80211: Set the WIPHY_FLAG_SUPPORTS_CONCUR_MONITOR_N_OTHER_VIF > flag > > include/net/cfg80211.h | 55 ++++++++++++++++++++++-------------------- > net/mac80211/main.c | 4 +++ > net/wireless/chan.c | 4 ++- > 3 files changed, 36 insertions(+), 27 deletions(-) > > > base-commit: 42aa76e608ca845c98e79f9e23af0bdb07b2eb1d Still looking for feedback on this series...