[rdk-b][common][bsp][Add iwinfo into filogic wifi bsp]

[Description]
Add iwinfo into filogic wifi bsp

[Release-log]
N/A

diff --git a/recipes-wifi/iwinfo/iwinfo/0002-fix-order-of-linker-cmdline-to-help-linking.patch b/recipes-wifi/iwinfo/iwinfo/0002-fix-order-of-linker-cmdline-to-help-linking.patch
new file mode 100644
index 0000000..6d9a852
--- /dev/null
+++ b/recipes-wifi/iwinfo/iwinfo/0002-fix-order-of-linker-cmdline-to-help-linking.patch
@@ -0,0 +1,31 @@
+From 3db058a1d3a8a948c36f9faec2f9328149e6f46d Mon Sep 17 00:00:00 2001
+From: Kas User <kas@example.com>
+Date: Tue, 4 Oct 2022 22:43:34 +0300
+Subject: [PATCH] fix-order-of-linker-cmdline-to-help-linking
+
+---
+ Makefile | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index b52db6e..abe17b7 100644
+--- a/Makefile
++++ b/Makefile
+@@ -46,14 +46,12 @@ compile: clean $(IWINFO_LIB) $(IWINFO_LUA) $(IWINFO_CLI)
+ 	$(CC) $(IWINFO_CFLAGS) $(FPIC) -c -o $@ $<
+ 
+ $(IWINFO_LIB): $(IWINFO_LIB_OBJ)
+-	$(CC) $(IWINFO_LDFLAGS) $(IWINFO_LIB_LDFLAGS) -o $(IWINFO_LIB).$(IWINFO_SOVERSION) $(IWINFO_LIB_OBJ) && \
++	$(CC) $(IWINFO_LIB_OBJ) $(IWINFO_LDFLAGS) $(IWINFO_LIB_LDFLAGS) -o $(IWINFO_LIB).$(IWINFO_SOVERSION) && \
+ 	ln -sf $(IWINFO_LIB).$(IWINFO_SOVERSION) $(IWINFO_LIB)
+ 
+ $(IWINFO_LUA): $(IWINFO_LUA_OBJ)
+-	$(CC) $(IWINFO_LDFLAGS) $(IWINFO_LUA_LDFLAGS) -o $(IWINFO_LUA) $(IWINFO_LUA_OBJ)
+-
++	$(CC) $(IWINFO_LUA_OBJ) $(IWINFO_LDFLAGS) $(IWINFO_LUA_LDFLAGS) -o $(IWINFO_LUA) 
+ $(IWINFO_CLI): $(IWINFO_CLI_OBJ)
+-	$(CC) $(IWINFO_LDFLAGS) $(IWINFO_CLI_LDFLAGS) -o $(IWINFO_CLI) $(IWINFO_CLI_OBJ)
+-
++	$(CC) $(IWINFO_CLI_OBJ) $(IWINFO_LDFLAGS) $(IWINFO_CLI_LDFLAGS) -o $(IWINFO_CLI) 
+ clean:
+ 	rm -f *.o $(IWINFO_LIB) $(IWINFO_LUA) $(IWINFO_CLI)
diff --git a/recipes-wifi/iwinfo/iwinfo/0003-Replace-typedef-loaL_reg-with-luaL_Reg.patch b/recipes-wifi/iwinfo/iwinfo/0003-Replace-typedef-loaL_reg-with-luaL_Reg.patch
new file mode 100644
index 0000000..4a9fdba
--- /dev/null
+++ b/recipes-wifi/iwinfo/iwinfo/0003-Replace-typedef-loaL_reg-with-luaL_Reg.patch
@@ -0,0 +1,58 @@
+From 0dbefc4fa4fc1292fa2c940304a5ec0df204cf98 Mon Sep 17 00:00:00 2001
+From: Kas User <kas@example.com>
+Date: Tue, 4 Oct 2022 22:59:16 +0300
+Subject: [PATCH] Replace loaL_reg with luaL_Reg according to lua5.1
+
+---
+ iwinfo_lua.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/iwinfo_lua.c b/iwinfo_lua.c
+index 996f291..39ac2af 100644
+--- a/iwinfo_lua.c
++++ b/iwinfo_lua.c
+@@ -807,7 +807,7 @@ LUA_WRAP_STRUCT_OP(wext,hardware_id)
+
+ #ifdef USE_WL
+ /* Broadcom table */
+-static const luaL_reg R_wl[] = {
++static const luaL_Reg R_wl[] = {
+ 	LUA_REG(wl,channel),
+ 	LUA_REG(wl,frequency),
+ 	LUA_REG(wl,frequency_offset),
+@@ -840,7 +840,7 @@ static const luaL_reg R_wl[] = {
+
+ #ifdef USE_MADWIFI
+ /* Madwifi table */
+-static const luaL_reg R_madwifi[] = {
++static const luaL_Reg R_madwifi[] = {
+ 	LUA_REG(madwifi,channel),
+ 	LUA_REG(madwifi,frequency),
+ 	LUA_REG(madwifi,frequency_offset),
+@@ -873,7 +873,7 @@ static const luaL_reg R_madwifi[] = {
+
+ #ifdef USE_NL80211
+ /* NL80211 table */
+-static const luaL_reg R_nl80211[] = {
++static const luaL_Reg R_nl80211[] = {
+ 	LUA_REG(nl80211,channel),
+ 	LUA_REG(nl80211,frequency),
+ 	LUA_REG(nl80211,frequency_offset),
+@@ -906,7 +906,7 @@ static const luaL_reg R_nl80211[] = {
+
+ /* Wext table */
+ #ifdef USE_WEXT
+-static const luaL_reg R_wext[] = {
++static const luaL_Reg R_wext[] = {
+ 	LUA_REG(wext,channel),
+ 	LUA_REG(wext,frequency),
+ 	LUA_REG(wext,frequency_offset),
+@@ -938,7 +938,7 @@ static const luaL_reg R_wext[] = {
+ #endif
+
+ /* Common */
+-static const luaL_reg R_common[] = {
++static const luaL_Reg R_common[] = {
+ 	{ "type", iwinfo_L_type },
+ 	{ "__gc", iwinfo_L__gc  },
+ 	{ NULL, NULL }
diff --git a/recipes-wifi/iwinfo/iwinfo_git.bb b/recipes-wifi/iwinfo/iwinfo_git.bb
new file mode 100644
index 0000000..9f39380
--- /dev/null
+++ b/recipes-wifi/iwinfo/iwinfo_git.bb
@@ -0,0 +1,39 @@
+# Copyright (C) 2015 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Library for accessing wireless device drivers"
+HOMEPAGE = "http://git.openwrt.org/?p=project/iwinfo.git;a=summary"
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+SECTION = "base"
+DEPENDS += "uci lua ubus libnl-tiny"
+
+SRCREV = "00aab871c50d944fd83269e460e69124cb11adb7"
+
+SRC_URI = "git://git.openwrt.org/project/iwinfo.git;branch=master \
+           file://0002-fix-order-of-linker-cmdline-to-help-linking.patch \
+           file://0003-Replace-typedef-loaL_reg-with-luaL_Reg.patch \
+           "
+
+S = "${WORKDIR}/git"
+
+CFLAGS += "-fPIC -D_GNU_SOURCE"
+CFLAGS += " -I=${includedir}/libnl-tiny "
+# iwinfo breaks with parallel make
+PARALLEL_MAKE = ""
+
+EXTRA_OEMAKE = "\
+    'BACKENDS=nl80211' \
+    'SOVERSION=openwrt' \
+"
+
+do_install() {
+	install -D -m 0755 ${B}/libiwinfo.so ${D}${libdir}/libiwinfo.so
+        install -D -m 0755 ${B}/iwinfo.so ${D}${libdir}/lua/iwinfo.so
+        install -D -m 0755 ${B}/iwinfo ${D}${bindir}/iwinfo
+	install -D -m 0644 ${S}/include/iwinfo.h ${D}${includedir}/iwinfo.h
+	install -D -m 0644 ${S}/include/iwinfo/utils.h ${D}${includedir}/iwinfo/utils.h
+}
+
+FILES_SOLIBSDEV = ""
+FILES_${PN} += "${libdir}/libiwinfo.so"