[rdkb][common][bsp][Refactor ucode related parts]

[Description]
Refactor ucode related parts

[Release-log]

Change-Id: I76db3a59ea1a2c92441829e5911d078d6fab72a1
diff --git a/recipes-wifi/hostapd/files/wpa_supplicant.uc b/recipes-wifi/hostapd/files/wpa_supplicant.uc
index d624f27..e320330 100644
--- a/recipes-wifi/hostapd/files/wpa_supplicant.uc
+++ b/recipes-wifi/hostapd/files/wpa_supplicant.uc
@@ -246,6 +246,7 @@
 
 wpas.data.ubus = ubus;
 wpas.data.obj = ubus.publish("wpa_supplicant", main_obj);
+wpas.udebug_set("wpa_supplicant", wpas.data.ubus);
 
 function iface_event(type, name, data) {
 	let ubus = wpas.data.ubus;
@@ -262,6 +263,7 @@
 	let status = iface.status();
 	let msg = { phy: phy };
 
+	wpas.printf(`ucode: mtk: wpa_s in state ${state} notifies hostapd`);
 	switch (state) {
 	case "DISCONNECTED":
 	case "AUTHENTICATING":
@@ -276,6 +278,8 @@
 		msg.up = true;
 		msg.frequency = status.frequency;
 		msg.sec_chan_offset = status.sec_chan_offset;
+		msg.ch_width = status.ch_width;
+		msg.bw320_offset = status.bw320_offset;
 		break;
 	default:
 		return;
@@ -292,6 +296,8 @@
 		csa: true,
 		csa_count: info.csa_count ? info.csa_count - 1 : 0,
 		frequency: info.frequency,
+		ch_width: info.ch_width,
+		bw320_offset: info.bw320_offset,
 		sec_chan_offset: info.sec_chan_offset,
 	};
 	ubus.call("hostapd", "apsta_state", msg);