Use hostapd HIDL and control iface socket simultaneously

If support for HIDL IPC in hostapd is enabled, socket based
control interface can't be used. Since it's convenient for
e.g. debugging through hostapd_cli, this patch enables both
mechanisms simultaneously.

Bug: 73419160
Test: hostapd_cli -i wlan0 -p /data/vendor/wifi/hostapd/ctrl
Test: Manual check that softAp works
Signed-off-by: Huajun Tong <huajun.x.tong@sony.com>
Change-Id: I8d57765670f5de0564e295ddcac53cc5bc0c40c0
diff --git a/hostapd/main.c b/hostapd/main.c
index 8d90b38..6c0490f 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -661,14 +661,8 @@
 	interfaces.reload_config = hostapd_reload_config;
 	interfaces.config_read_cb = hostapd_config_read;
 	interfaces.for_each_interface = hostapd_for_each_interface;
-#ifdef CONFIG_CTRL_IFACE_HIDL
-	// No per-netdev setup for HIDL control interface.
-	interfaces.ctrl_iface_init = NULL;
-	interfaces.ctrl_iface_deinit = NULL;
-#else /* CONFIG_CTRL_IFACE_HIDL */
 	interfaces.ctrl_iface_init = hostapd_ctrl_iface_init;
 	interfaces.ctrl_iface_deinit = hostapd_ctrl_iface_deinit;
-#endif /* CONFIG_CTRL_IFACE_HIDL */
 	interfaces.driver_init = hostapd_driver_init;
 	interfaces.global_iface_path = NULL;
 	interfaces.global_iface_name = NULL;
@@ -908,9 +902,8 @@
 		wpa_printf(MSG_ERROR, "Failed to initialize HIDL interface");
 		goto out;
 	}
-#else /* CONFIG_CTRL_IFACE_HIDL */
-	hostapd_global_ctrl_iface_init(&interfaces);
 #endif /* CONFIG_CTRL_IFACE_HIDL */
+	hostapd_global_ctrl_iface_init(&interfaces);
 
 	if (hostapd_global_run(&interfaces, daemonize, pid_file)) {
 		wpa_printf(MSG_ERROR, "Failed to start eloop");
@@ -922,9 +915,8 @@
  out:
 #ifdef CONFIG_CTRL_IFACE_HIDL
 	hostapd_hidl_deinit(&interfaces);
-#else /* CONFIG_CTRL_IFACE_HIDL */
-	hostapd_global_ctrl_iface_deinit(&interfaces);
 #endif /* CONFIG_CTRL_IFACE_HIDL */
+	hostapd_global_ctrl_iface_deinit(&interfaces);
 	/* Deinitialize all interfaces */
 	for (i = 0; i < interfaces.count; i++) {
 		if (!interfaces.iface[i])