[rdkb][common][bsp][Refactor and sync wifi from openwrt]

[Description]
1776d62e [MAC80211][WiFi6/7][app][Fix atenl sync eeprom all issue]
f27a8bc9 [MAC80211][WiFi6][misc][Add coredump support for MT7981]
8ae764db [mac80211][netifd][wifi7][Fix patch fail]
db2ba4ea [mac80211][netifd][wifi7][Fix patch fail]
1671230e [MAC80211][WiFi6][mt76][Fix dump PFMU tag kernel calltrace]
537408c4 [MAC80211][WiFi6][Rebase][Fix patch error]
9a4c64fa [mac80211][wifi6][mt76][Fix txpower sku issues]
8276145f [MAC80211][WiFi6][mt76][not send RTS before sending BSRP]
2c6e3189 [MAC80211][WiFi6][Rebase Patches][Fix patch error]
6b529b8c [[MAC80211][WiFi6][mt76][add per-bss counter for mt7915]
95df57b3 [MAC80211][WiFi6][app][Add atenl support for cheetah]
94705cb2 [MAC80211][WiFi6][mt76][Add support for cheetah]
4ff10eee [mac80211][wifi6][mt76][Add debugfs address map for Cheetah MT76]
85af3247 [MAC80211[WiFi6]][hostapd][Add extender behavior log]
04302ac4 [MAC80211[WiFi7]][hostapd][Add eht_bw320_offset configuration option]
88013859 [MAC80211][WiFi6/7][app][Fix atenl cannot support binfile mode precal issue]
c1cad928 [MAC80211][WiFi6][mt76][Fix binfile cannot sync precal data to atenl]
8fd441fb [MAC80211][WiFi6/7][misc][remove internal patch for ucode package]
4653100b [MAC80211][WiFi6][mt76][rename bf debug cmd to align connac3]
9edd5444 [MAC80211][WiFi6][mt76][Fixed null pointer dereference issue]

[Release-log]

Change-Id: Ia7013b21497826cdf4d9c6192d6812aff5f948ae
diff --git a/recipes-wifi/hostapd/files/common.uc b/recipes-wifi/hostapd/files/common.uc
index ccffe3e..4c33779 100644
--- a/recipes-wifi/hostapd/files/common.uc
+++ b/recipes-wifi/hostapd/files/common.uc
@@ -10,6 +10,36 @@
 	monitor: nl80211.const.NL80211_IFTYPE_MONITOR,
 };
 
+const mesh_params = {
+	mesh_retry_timeout: "retry_timeout",
+	mesh_confirm_timeout: "confirm_timeout",
+	mesh_holding_timeout: "holding_timeout",
+	mesh_max_peer_links: "max_peer_links",
+	mesh_max_retries: "max_retries",
+	mesh_ttl: "ttl",
+	mesh_element_ttl: "element_ttl",
+	mesh_auto_open_plinks: "auto_open_plinks",
+	mesh_hwmp_max_preq_retries: "hwmp_max_preq_retries",
+	mesh_path_refresh_time: "path_refresh_time",
+	mesh_min_discovery_timeout: "min_discovery_timeout",
+	mesh_hwmp_active_path_timeout: "hwmp_active_path_timeout",
+	mesh_hwmp_preq_min_interval: "hwmp_preq_min_interval",
+	mesh_hwmp_net_diameter_traversal_time: "hwmp_net_diam_trvs_time",
+	mesh_hwmp_rootmode: "hwmp_rootmode",
+	mesh_hwmp_rann_interval: "hwmp_rann_interval",
+	mesh_gate_announcements: "gate_announcements",
+	mesh_sync_offset_max_neighor: "sync_offset_max_neighbor",
+	mesh_rssi_threshold: "rssi_threshold",
+	mesh_hwmp_active_path_to_root_timeout: "hwmp_path_to_root_timeout",
+	mesh_hwmp_root_interval: "hwmp_root_interval",
+	mesh_hwmp_confirmation_interval: "hwmp_confirmation_interval",
+	mesh_awake_window: "awake_window",
+	mesh_plink_timeout: "plink_timeout",
+	mesh_fwding: "forwarding",
+	mesh_power_mode: "power_mode",
+	mesh_nolearn: "nolearn"
+};
+
 function wdev_remove(name)
 {
 	nl80211.request(nl80211.const.NL80211_CMD_DEL_INTERFACE, 0, { dev: name });
@@ -94,6 +124,31 @@
 	return null;
 }
 
+function wdev_set_mesh_params(name, data)
+{
+	let mesh_cfg = {};
+
+	for (let key in mesh_params) {
+		let val = data[key];
+		if (val == null)
+			continue;
+		mesh_cfg[mesh_params[key]] = int(val);
+	}
+
+	if (!length(mesh_cfg))
+		return null;
+
+	nl80211.request(nl80211.const.NL80211_CMD_SET_MESH_CONFIG, 0,
+		{ dev: name, mesh_params: mesh_cfg });
+
+	return nl80211.error();
+}
+
+function wdev_set_up(name, up)
+{
+	rtnl.request(rtnl.const.RTM_SETLINK, 0, { dev: name, change: 1, flags: up ? 1 : 0 });
+}
+
 function phy_sysfs_file(phy, name)
 {
 	return trim(readfile(`/sys/class/ieee80211/${phy}/${name}`));
@@ -315,4 +370,4 @@
 		}, vlist_proto);
 }
 
-export { wdev_remove, wdev_create, is_equal, vlist_new, phy_is_fullmac, phy_open };
+export { wdev_remove, wdev_create, wdev_set_mesh_params, wdev_set_up, is_equal, vlist_new, phy_is_fullmac, phy_open };