Cumulative patch from commit 37fd0be2d3ca50c9035e67041328099356a46860

37fd0be Add CTRL-EVENT-CHANNEL-SWITCH event to indicate channel changes
1574fa1 GAS: Fix double-free on an error path
d6e93d3 GAS: Remove unused gas_query_cancel()
ae2b482 GAS: Check protected/unprotected drop after action code check
9c21b2b GAS: Report GAS-QUERY-DONE event on initial req TX failure
e6804fe OpenSSL: Update to match the modified DH_get0_key() API
fc1e2c0 D-Bus: Make the CurrentAuthMode property getter more robust
82b9ec3 D-Bus: Add DeviceFoundProperties signal for discovered peers
4976618 mesh: Mark wpa_state COMPLETED when mesh join has been performed
b94fff1 wpa_supplicant: Configurable EAP fragment size in AP mode
617593c Assign vendor specific elements for early HE testing
4874b78 PAE: Use big endian version in current_peer_id.mn to be more consistent
ce256b4 PAE: Use sci->port more consistently
2f13e54 wired: Silence sparse warning on redefinition of IFNAMSIZ
82ffcba Move extern declarations for ext_password backends into a header file
affdd33 Move extern declarations for autoscan modules into a header file
9eece21 Move extern declarations for bgscan modules into a header file
39ab6a5 Move extern declarations for driver ops into a header file
4775471 nl80211: Mark wpa_driver_nl80211_get_macaddr() static
ebae413 Fix a debug print in p2p_manager_disconnect()
f367c08 Mark internal functions static
582121b OpenSSL: Silence sparse warnings in fips186_2_prf()
451e094 dhcp_snoop: Silence a sparse warning
bbae0f0 ndisc_snoop: Include ndisc_snoop.h to check prototypes
99a716a TNCS: Mark functions static
799a7ed PAE: Mark ieee802_1x_kay_deinit_data_key() static
4e7f5a4 PAE: Use be16/be32 instead of u16/u32 for spartse
ac36b13 TNCC: Mark functions static
fad6485 radiotap: Silence sparse warnings about byte order swapping
94c4d78 FST: Make fst_action_names static
82c734c FST: Fix byte order of couple of fields on big endian hosts
0dbe22b Mark wpas_data_test_rx() static
4d8d710 Fix byte order for CONFIG_VHT_OVERRIDES parameters
3787c91 OpenSSL: Pull in header files to check function prototypes
39cdd3a FST: Mark wpa_supplicant callback functions get_peer_{first,next} static
6013bbe TDLS: Declare tdls_testing as extern in a header file
0e672b8 trace: Define externs in a header file
6527b52 Undefine __bitwise before defining it for sparse
468b7b1 Fix hostapd_sta_add() call to use NULL as the pointer instead of 0
0558bec MBO: Mark verify_channel() static
9e080bf WNM: Use NULL instead of 0 as the pointer return value

Change-Id: Ia18f0c09fafb7bf0a3a91cd72dc81c370c2644ac
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 7040069..62bef18 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -25,6 +25,7 @@
 
 #include "utils/common.h"
 #include "utils/eloop.h"
+#include "utils/module_tests.h"
 #include "common/version.h"
 #include "common/ieee802_11_defs.h"
 #include "common/ctrl_iface_common.h"
@@ -1590,8 +1591,8 @@
 #define HWSIM_PACKETLEN 1500
 #define HWSIM_IP_LEN (HWSIM_PACKETLEN - sizeof(struct ether_header))
 
-void hostapd_data_test_rx(void *ctx, const u8 *src_addr, const u8 *buf,
-			  size_t len)
+static void hostapd_data_test_rx(void *ctx, const u8 *src_addr, const u8 *buf,
+				 size_t len)
 {
 	struct hostapd_data *hapd = ctx;
 	const struct ether_header *eth;
@@ -1778,8 +1779,6 @@
 static int hostapd_ctrl_test_alloc_fail(struct hostapd_data *hapd, char *cmd)
 {
 #ifdef WPA_TRACE_BFD
-	extern char wpa_trace_fail_func[256];
-	extern unsigned int wpa_trace_fail_after;
 	char *pos;
 
 	wpa_trace_fail_after = atoi(cmd);
@@ -1803,9 +1802,6 @@
 				       char *buf, size_t buflen)
 {
 #ifdef WPA_TRACE_BFD
-	extern char wpa_trace_fail_func[256];
-	extern unsigned int wpa_trace_fail_after;
-
 	return os_snprintf(buf, buflen, "%u:%s", wpa_trace_fail_after,
 			   wpa_trace_fail_func);
 #else /* WPA_TRACE_BFD */
@@ -1817,8 +1813,6 @@
 static int hostapd_ctrl_test_fail(struct hostapd_data *hapd, char *cmd)
 {
 #ifdef WPA_TRACE_BFD
-	extern char wpa_trace_test_fail_func[256];
-	extern unsigned int wpa_trace_test_fail_after;
 	char *pos;
 
 	wpa_trace_test_fail_after = atoi(cmd);
@@ -1842,9 +1836,6 @@
 				 char *buf, size_t buflen)
 {
 #ifdef WPA_TRACE_BFD
-	extern char wpa_trace_test_fail_func[256];
-	extern unsigned int wpa_trace_test_fail_after;
-
 	return os_snprintf(buf, buflen, "%u:%s", wpa_trace_test_fail_after,
 			   wpa_trace_test_fail_func);
 #else /* WPA_TRACE_BFD */
@@ -2087,7 +2078,7 @@
 }
 
 
-int hostapd_ctrl_iface_req_range(struct hostapd_data *hapd, char *cmd)
+static int hostapd_ctrl_iface_req_range(struct hostapd_data *hapd, char *cmd)
 {
 	u8 addr[ETH_ALEN];
 	char *token, *context = NULL;
@@ -3349,7 +3340,6 @@
 			reply_len = -1;
 #ifdef CONFIG_MODULE_TESTS
 	} else if (os_strcmp(buf, "MODULE_TESTS") == 0) {
-		int hapd_module_tests(void);
 		if (hapd_module_tests() < 0)
 			reply_len = -1;
 #endif /* CONFIG_MODULE_TESTS */