1: 270da1e3ee5f ! 1: af019dfd3231 wifi: rtw88: program the beacon interval @@ Commit message wifi: rtw88: program the beacon interval  The driver never writes the beacon interval register, so the hardware - keeps its default of 100 TU. An AP started with another interval says - that interval in its beacons and sends them 100 TU apart. + keeps its default of 100 TU. An AP or IBSS started with another + interval says that interval in its beacons and sends them 100 TU apart.  With beacon_int=200 in hostapd the beacons of an RTL8822CE, RTL8822CU, - RTL8822BU and RTL8821CU are 102.4 ms apart on the air. + RTL8822BU and RTL8821CU are 102.4 ms apart on the air. The same holds + for an IBSS joined with a beacon interval of 200 on an RTL8822CE and + RTL8822BU.  - Write the interval when mac80211 sets it. The beaconing interface is - always on port 0: rtw_core_port_switch() moves an AP there. + Write the interval when mac80211 sets it for an AP or IBSS interface. + Both beacon from port 0: rtw_core_port_switch() moves an AP there, and + an IBSS interface is never combined with another one.  Reported-by: Luka Gejak  Closes: https://lore.kernel.org/linux-wireless/1D396970-35B7-4B0B-82E9-24B523AD69C2@linux.dev/ @@ drivers/net/wireless/realtek/rtw88/mac80211.c: static void rtw_ops_bss_info_chan if (changed & BSS_CHANGED_BEACON_INT) { if (ieee80211_vif_type_p2p(vif) == NL80211_IFTYPE_STATION) coex_stat->wl_beacon_interval = conf->beacon_int; -+ else if (vif->type != NL80211_IFTYPE_STATION && ++ else if ((vif->type == NL80211_IFTYPE_AP || ++ vif->type == NL80211_IFTYPE_ADHOC) &&  + rtwvif->port == RTW_PORT_0)  + rtw_write16(rtwdev, REG_MBSSID_BCN_SPACE,  + conf->beacon_int);