Make hostapd start/stop more flexibile for hwsim test cases

These changes allow sigma_dut to be tested as part of hostap.git hwsim
test framework.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
diff --git a/sigma_dut.c b/sigma_dut.c
index fa9ea72..9ac044a 100644
--- a/sigma_dut.c
+++ b/sigma_dut.c
@@ -765,7 +765,7 @@
 
 	for (;;) {
 		c = getopt(argc, argv,
-			   "aAb:Bc:C:dDE:e:fghH:i:Ik:l:L:m:M:nN:o:O:p:P:qr:R:s:S:tT:uv:VWw:x:y:");
+			   "aAb:Bc:C:dDE:e:fF:gGhH:j:i:Ik:l:L:m:M:nN:o:O:p:P:qr:R:s:S:tT:uv:VWw:x:y:");
 		if (c < 0)
 			break;
 		switch (c) {
@@ -800,11 +800,17 @@
 			/* Disable writing stats */
 			sigma_dut.write_stats = 0;
 			break;
+		case 'F':
+			sigma_dut.hostapd_bin = optarg;
+			break;
 		case 'g':
 			/* Enable internal processing of P2P group formation
 			 * events to start/stop DHCP server/client. */
 			internal_dhcp_enabled = 1;
 			break;
+		case 'G':
+			sigma_dut.use_hostapd_pid_file = 1;
+			break;
 		case 'H':
 			sigma_dut.hostapd_debug_log = optarg;
 			break;
@@ -812,6 +818,9 @@
 			print_license();
 			exit(0);
 			break;
+		case 'j':
+			sigma_dut.hostapd_ifname = optarg;
+			break;
 		case 'l':
 			local_cmd = optarg;
 			break;
@@ -939,7 +948,7 @@
 #endif /* MIRACAST */
 		case 'h':
 		default:
-			printf("usage: sigma_dut [-aABdfqDIntuVW] [-p<port>] "
+			printf("usage: sigma_dut [-aABdfGqDIntuVW] [-p<port>] "
 			       "[-s<sniffer>] [-m<set_maccaddr.sh>] \\\n"
 				"       [-M<main ifname>] [-R<radio ifname>] "
 			       "[-S<station ifname>] [-P<p2p_ifname>]\\\n"
@@ -947,6 +956,8 @@
 			       "       [-w<wpa_supplicant/hostapd ctrl_iface "
 			       "dir>] \\\n"
 			       "       [-H <hostapd log file>] \\\n"
+			       "       [-F <hostapd binary path>] \\\n"
+			       "       [-j <hostapd ifname>] \\\n"
 			       "       [-C <certificate path>] \\\n"
 			       "       [-v <version string>] \\\n"
 			       "       [-L <summary log>] \\\n"