[Feature][T8TSK-50][TCAM_T800_SW_262][wifi] missing file for connman 1.41

Change-Id: Ied233d8a90fa1df3c0dd306ebbb15811ba468494
diff --git a/meta/meta-mediatek-mt2735/recipes-connectivity/connman/connman/lynq_wifi_ap_sta.patch b/meta/meta-mediatek-mt2735/recipes-connectivity/connman/connman/lynq_wifi_ap_sta.patch
old mode 100644
new mode 100755
index 855cbf1..d8b7e76
--- a/meta/meta-mediatek-mt2735/recipes-connectivity/connman/connman/lynq_wifi_ap_sta.patch
+++ b/meta/meta-mediatek-mt2735/recipes-connectivity/connman/connman/lynq_wifi_ap_sta.patch
@@ -1,14 +1,14 @@
---- connman-1.35/plugins/wifi.c	2022-04-30 14:31:30.777805400 +0800
-+++ connman-1.35/plugins/wifi_new.c	2022-05-12 17:54:35.727120400 +0800
-@@ -153,6 +153,7 @@
+--- connman-1.41/plugins/wifi.c	2022-01-28 22:48:01.000000000 +0800
++++ connman-1.41/plugins/wifi_new.c	2022-05-12 09:03:27.544623700 +0800
+@@ -164,6 +164,7 @@
  	int servicing;
  	int disconnect_code;
  	int assoc_code;
 +	bool interface_create_flag;
  };
  
- static GList *iface_list = NULL;
-@@ -784,6 +785,7 @@
+ struct wifi_network {
+@@ -808,6 +809,7 @@
  	else
  		iface_list = g_list_append(iface_list, wifi);
  
@@ -16,9 +16,64 @@
  	return 0;
  }
  
-@@ -1471,13 +1473,13 @@
+@@ -816,6 +818,7 @@
  {
+ 	GSList *list;
+ 
++	DBG("cy-remove_networks device %p, wifi %p", device, wifi);
+ 	for (list = wifi->networks; list; list = list->next) {
+ 		struct connman_network *network = list->data;
+ 
+@@ -1420,11 +1423,21 @@
+ {
+ 	struct wifi_data *wifi = connman_device_get_data(device);
+ 	struct autoscan_params *autoscan;
++	struct wifi_data *wifi2;
++	GList *list;
+ 
+ 	DBG("");
+ 
++	for (list = iface_list; list; list = list->next) {
++		wifi2 = list->data;
++
++		DBG("cy-wifi %p network %p interface %p", wifi2,
++			wifi2->network, wifi2->interface);
++	}
+ 	if (!wifi)
+ 		return;
++	else
++		return;
+ 
+ 	if (wifi->p2p_device)
+ 		return;
+@@ -1535,10 +1548,10 @@
+ 	if (wifi->p2p_device)
+ 		return;
+ 
+-	if (!wifi->autoscan)
+-		setup_autoscan(wifi);
++	// if (!wifi->autoscan)
++	// 	setup_autoscan(wifi);
+ 
+-	start_autoscan(wifi->device);
++	// start_autoscan(wifi->device);
+ }
+ 
+ static void interface_create_callback(int result,
+@@ -1548,14 +1561,24 @@
  	struct wifi_data *wifi = user_data;
+ 	char *bgscan_range_max;
+ 	long value;
++	struct wifi_data *wifi2=NULL;
++
++	GList *list;
++
++	for (list = iface_list; list; list = list->next) {
++		wifi2 = list->data;
++
++		DBG("cy-wifi %p network %p interface %p", wifi2,
++			wifi2->network, wifi2->interface);
++	}
  
 -	DBG("result %d ifname %s, wifi %p", result,
 +	DBG("cy-result %d ifname %s, wifi %p, %s", result,
@@ -34,8 +89,8 @@
  	wifi->interface = interface;
  	g_supplicant_interface_set_data(interface, wifi);
  
-@@ -1495,7 +1497,8 @@
- 	const char *driver = connman_option_get_string("wifi");
+@@ -1591,7 +1614,8 @@
+ 	const char *driver = connman_setting_get_string("wifi");
  	int ret;
  
 -	DBG("device %p %p", device, wifi);
@@ -44,7 +99,7 @@
  
  	index = connman_device_get_index(device);
  	if (!wifi || index < 0)
-@@ -1505,6 +1508,13 @@
+@@ -1601,14 +1625,24 @@
  		return -EINPROGRESS;
  
  	interface = connman_inet_ifname(index);
@@ -58,14 +113,68 @@
  	ret = g_supplicant_interface_create(interface, driver, NULL,
  						interface_create_callback,
  							wifi);
-@@ -3103,21 +3113,21 @@
+ 	g_free(interface);
+ 
+-	if (ret < 0)
++	if (ret < 0) {
++		DBG("cy-return not in progress %d", ret);
+ 		return ret;
++	}
+ 
++	DBG("cy-return -EINPROGRESS");
+ 	return -EINPROGRESS;
+ }
+ 
+@@ -2632,13 +2666,13 @@
+ 		}
+ 		wifi->disconnecting = false;
+ 
+-		start_autoscan(device);
++		// start_autoscan(device);
+ 
+ 		break;
+ 
+ 	case G_SUPPLICANT_STATE_INACTIVE:
+ 		connman_network_set_associating(network, false);
+-		start_autoscan(device);
++		// start_autoscan(device);
+ 
+ 		break;
+ 
+@@ -2674,8 +2708,8 @@
+ 	case G_SUPPLICANT_STATE_SCANNING:
+ 		wifi->connected = false;
+ 
+-		if (old_connected)
+-			start_autoscan(device);
++		// if (old_connected)
++		// 	start_autoscan(device);
+ 		break;
+ 	case G_SUPPLICANT_STATE_COMPLETED:
+ 		wifi->connected = true;
+@@ -3344,31 +3378,31 @@
+ 	if (!ap)
  		return NULL;
  
+-	ret = connman_technology_get_wifi_tethering(technology,
+-						&ssid, &passphrase,
+-						&freq);
+-	if (ret == false)
+-		return NULL;
++	// ret = connman_technology_get_wifi_tethering(technology,
++	// 					&ssid, &passphrase,
++	// 					&freq);
++	// if (ret == false)
++	// 	return NULL;
+ 
  	ap->mode = G_SUPPLICANT_MODE_MASTER;
 -	ap->ssid = ssid;
 -	ap->ssid_len = strlen(ssid);
 -	ap->scan_ssid = 0;
--	ap->freq = 2412;
+-	if (freq)
+-		ap->freq = freq;
+-	else
+-		ap->freq = 2412;
 -
 -	if (!passphrase || strlen(passphrase) == 0) {
 -		ap->security = G_SUPPLICANT_SECURITY_NONE;
@@ -80,7 +189,10 @@
 +	// ap->ssid = ssid;
 +	// ap->ssid_len = strlen(ssid);
 +	// ap->scan_ssid = 0;
-+	// ap->freq = 2412;
++	// if (freq)
++	// 	ap->freq = freq;
++	// else
++	// 	ap->freq = 2412;
 +
 +	// if (!passphrase || strlen(passphrase) == 0) {
 +	// 	ap->security = G_SUPPLICANT_SECURITY_NONE;
@@ -95,7 +207,7 @@
  
  	return ap;
  }
-@@ -3179,8 +3189,8 @@
+@@ -3430,8 +3464,8 @@
  	if (g_supplicant_interface_set_apscan(interface, 2) < 0)
  		connman_error("Failed to set interface ap_scan property");
  
@@ -106,7 +218,13 @@
  }
  
  static void sta_remove_callback(int result,
-@@ -3235,13 +3245,23 @@
+@@ -3480,18 +3514,28 @@
+ 	for (list = iface_list; list; list = list->next) {
+ 		wifi = list->data;
+ 
+-		DBG("wifi %p network %p pending_network %p", wifi,
++		DBG("cy-wifi %p network %p pending_network %p", wifi,
+ 			wifi->network, wifi->pending_network);
  
  		interface = wifi->interface;
  
@@ -133,7 +251,7 @@
  		if (wifi->ap_supported == WIFI_AP_NOT_SUPPORTED) {
  			DBG("%s does not support AP mode (detected)", ifname);
  			continue;
-@@ -3256,6 +3276,7 @@
+@@ -3506,6 +3550,7 @@
  
  		if (wifi->network && available)
  			continue;
@@ -141,7 +259,7 @@
  
  		info = g_try_malloc0(sizeof(struct wifi_tethering_info));
  		if (!info)
-@@ -3288,9 +3309,11 @@
+@@ -3538,9 +3583,11 @@
  		if (berr < 0)
  			goto failed;
  
@@ -156,9 +274,17 @@
  		if (err >= 0) {
  			DBG("tethering wifi %p ifname %s", wifi, ifname);
  			return 0;
---- connman-1.35/gsupplicant/supplicant.c	2017-08-11 02:56:43.000000000 +0800
-+++ connman-1.35/gsupplicant/supplicant_new.c	2022-05-12 15:36:33.433705200 +0800
-@@ -3869,6 +3869,15 @@
+--- connman-1.41/gsupplicant/supplicant.c	2022-01-28 22:48:01.000000000 +0800
++++ connman-1.41/gsupplicant/supplicant_new.c	2022-05-11 18:01:51.174203200 +0800
+@@ -3638,6 +3638,7 @@
+ 	if (!path)
+ 		return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ 
++	SUPPLICANT_DBG("cy- msg %s", path);
+ 	if (!dbus_message_iter_init(message, &iter))
+ 		return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ 
+@@ -4005,6 +4006,15 @@
  					DBUS_TYPE_STRING, &data->bridge);
  
  	config_file = g_hash_table_lookup(config_file_table, data->ifname);
@@ -174,3 +300,18 @@
  	if (config_file) {
  		SUPPLICANT_DBG("[%s] ConfigFile %s", data->ifname, config_file);
  
+--- connman-1.41/src/technology.c	2022-01-28 22:48:01.000000000 +0800
++++ connman-1.41/src/technology_new.c	2022-05-11 19:23:17.729723700 +0800
+@@ -261,9 +261,9 @@
+ 	if (!bridge)
+ 		return -EOPNOTSUPP;
+ 
+-	if (technology->type == CONNMAN_SERVICE_TYPE_WIFI &&
+-	    (!ident || !passphrase))
+-		return -EINVAL;
++	// if (technology->type == CONNMAN_SERVICE_TYPE_WIFI &&
++	//     (!ident || !passphrase))
++	// 	return -EINVAL;
+ 
+ 	for (tech_drivers = technology->driver_list; tech_drivers;
+ 	     tech_drivers = g_slist_next(tech_drivers)) {