Go study the driver - here’s a hint…

the ath9k-htc driver exposes more info… The ath9k-htc driver is interesting to many, as it exposes some of the firmware that isn’t exposed by the kernel ath9k - htc has a lot of firmware hints here.

Anyways - choices there are HT20 and HT20_40 - from hostapd’s perspective, ether we program the ath9k for HT20 only, or we allow HT20_40, as this is what the driver allows - there is no HT40 only.

no_scan and ht_coex in hostapd.conf actually have no bearing here, as this is all the driver and the baseband.

Getting more into the why (as I explained the how from hostapd and driver already) - only the baseband/digital PHY can make decisions in real time if the PHY is running in HT20_40 - so the baseband does the CCA for the secondary, and if conditions are met, then it uses it in an opportunistic manner.

From a client STA - program it for 20/40, as the AP makes the decision based on the association handshake, and can do an 802.11 action message if conditions change.

Back in the Kernel 2.6 days, there was a real problem with the ath - if the baseband was operating in one mode - let’s say HT40, and conditions forced a switch to HT20 and still rx’ed HT40, it would crash the baseband. But that was back before ath9k was opensourced…