[Xiaomi Redmi Note 5 Pro ROMs, Kernels, Recoveries,] Aqq123:
5GHz works

5GHz does work but the channel it's on may be out of reach due to the regulatory domain set on the client. For me it always seems to pick channel 169 (5845 MHz):

hostapd : nl80211: ACS Results: PCH: 169 SCH: 165 BW: 40 VHT0: 0 VHT1: 0 HW_MODE: 2

hostapd : wlan1: ACS-COMPLETED freq=5845 channel=169

hostapd : wlan1: interface state UNINITIALIZED->HT_SCAN

wificond: New channel on frequency: 5845 with bandwidth: 40MHz

SoftApManager: Channel switched. Frequency: 5845 Bandwidth: 3

hostapd : wlan1: interface state HT_SCAN->ENABLED

hostapd : wlan1: AP-ENABLED

hostapd : wlan1: IEEE 802.11 driver had channel switch: freq=5845, ht=1, vht_ch=0x0, offset=-1, width=2 (40 MHz), cf1=5835, cf2=0

hostapd : wlan1: AP-CSA-FINISHED freq=5845 dfs=0

And since the Wi-Fi card in my computer defaults to the US regulatory domain it can't even see such a network.

The easiest way is probably to change it on the other end. There is no UI to set it manually on the phone. The regulatory domain should be guessed automatically based on the mobile phone network or the SIM card. In principle, this seems to work (with a caveat, mentioned below). For a manual adjustment, a string resource can be put inside the framework overlay file /vendor/overlay/framework-res__auto_generated_rro_vendor.diff to restrict the channels used by the hotspot (it's the same file I mentioned earlier because of Qualcomm location). For example:

<string name="config_wifi_softap_acs_supported_channel_list">32-165</string>

It can be a comma-separated list of individual channels or ranges. Wikipedia has a list of what's allowed where.

The caveat is that there is indeed something funny about the regulatory domain on the phone. It defaults to CN:

% iw reg get

global
country CN: DFS-FCC
(2402 - 2482 @ 40), (N/A, 20), (N/A)
(5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
(5735 - 5835 @ 80), (N/A, 33), (N/A)
(59400 - 63720 @ 2160), (N/A, 44), (N/A)

phy#0
country CN: DFS-FCC
(2402 - 2482 @ 40), (N/A, 20), (N/A)
(5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
(5735 - 5835 @ 80), (N/A, 33), (N/A)
(59400 - 63720 @ 2160), (N/A, 44), (N/A)

And while the global setting is adjusted automatically by the OS once it connects to a network, and can also be modified manually with:

iw reg set US - or -

wpa_cli -i wlan0 DRIVER COUNTRY US (note: this binary is not part of LOS but if you have it from elsewhere, it works)

The phy#0 (physical) part stays set to CN no matter what. I expected it'd respond to an entry in /system/build.prop for:

ro.boot.wificountrycode=US

Or a change in the driver configuration, /vendor/etc/wifi/WCNSS_qcom_cfg.ini:

gAPCntryCode=US
gStaCountryCode=US

But neither of these changes brings any effect (and yeah, it's really supposed to be "Cntry" for AP mode and "Country" for STA mode, that's not a typo). And the driver config is being processed because setting:

gRegulatoryChangeCountry=0

Made the hotspot switch from channel 169 to 149 (5745 MHz). (This change would mean user-space settings should not be allowed to override the regulatory domain in the driver configuration, I don't recommend changing this permanently - I did it only as a test. It's better, although more cumbersome, to change the framework overlay because that only affects the hotspot, and this settings applies to client-mode Wi-Fi as well.)

So for the moment I'm out of ideas how to change the regulatory domain for phy#0. And not sure how much it matters in practice. The worst-case scenario would be that the phone can only use an intersection of what's allowed in China and locally and that would be a huge limitation. However, since my phone was choosing channel 169 (5485 MHz) even before any changes, and that is outside of what's allowed in China, the CN regulatory domain doesn't seem to be strictly enforced. Yet again, when I set the channels to 52-64,100-144 using the framework overlay trick above, the hotspot refused to start at all with an error that "hardware does not support configured channel." Not sure if this was because of the phy#0 domain being set to CN (these ranges are not allowed there) or because of the DFS requirement (perhaps there is another setting to control that, or a hardware limitation).

I don't really use hotspot that much so I'm probably going to stop at this point but if anyone wants to look into it further, there is a good article documenting how the regulatory domain is being set by different layers of Android: https://blog.csdn.net/zhangdaxia2/article/details/90545175 and it is surprisingly complicated. (A slight drawback is also that the article is in Chinese.)