Update hw mode after acs selects the channel

Hostapd based automatic channel selection doesn't update
the hardware mode after the channel is selected.
This change specifically helps channel 14 which
can operate only in 11b mode.

Bug: 238714623
Test: Manual - Confirmed that with the fix, hostapd based
      ACS algorithm can bring up SoftAp in channel 14.

Signed-off-by: Sunil Ravi <sunilravi@google.com>
Change-Id: I6621e50f1db9720835521c4e6b49943b1df0f622
diff --git a/src/ap/acs.c b/src/ap/acs.c
index 7708bc2..57fc6da 100644
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
@@ -994,6 +994,14 @@
 	if (iface->conf->ieee80211ac || iface->conf->ieee80211ax)
 		acs_adjust_center_freq(iface);
 
+	err = hostapd_select_hw_mode(iface);
+	if (err) {
+		wpa_printf(MSG_ERROR, "ACS: Could not (err: %d) select hw_mode for freq=%d channel=%d",
+			err, iface->freq, iface->conf->channel);
+		err = -1;
+		goto fail;
+	}
+
 	err = 0;
 fail:
 	/*