mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
164 lines
4.7 KiB
Diff
164 lines
4.7 KiB
Diff
diff --git a/Makefile b/Makefile
|
|
index 690da51..478cfa7 100644
|
|
--- a/Makefile
|
|
+++ b/Makefile
|
|
@@ -30,6 +30,19 @@ ifneq ($(filter qcawifi,$(IWINFO_BACKENDS)),)
|
|
IWINFO_LIB_OBJ += iwinfo_qcawifi.o
|
|
endif
|
|
|
|
+ifneq ($(filter qtnawifi,$(IWINFO_BACKENDS)),)
|
|
+ IWINFO_CFLAGS += -DUSE_QTNAWIFI -DATH_SUPPORT_EXT_STAT
|
|
+ IWINFO_CFLAGS += -I./libqcsapi_client -DPCIE_RPC_TYPE=RPC_TYPE_QCSAPI_PCIE
|
|
+ IWINFO_CLI_LDFLAGS += -ltirpc
|
|
+ IWINFO_LIB_LDFLAGS += -ltirpc
|
|
+ IWINFO_LIB_OBJ += iwinfo_qtnawifi.o \
|
|
+ libqcsapi_client/qcsapi_rpc/generated/qcsapi_rpc_xdr.o \
|
|
+ libqcsapi_client/qcsapi_rpc/generated/qcsapi_rpc_clnt_adapter.o \
|
|
+ libqcsapi_client/qcsapi_rpc_common/client/rpc_pci_clnt.o
|
|
+
|
|
+endif
|
|
+
|
|
+
|
|
ifneq ($(filter nl80211,$(IWINFO_BACKENDS)),)
|
|
IWINFO_CFLAGS += -DUSE_NL80211
|
|
IWINFO_CLI_LDFLAGS += -lnl-tiny
|
|
diff --git a/include/iwinfo.h b/include/iwinfo.h
|
|
index f98203a..1cfe70b 100644
|
|
--- a/include/iwinfo.h
|
|
+++ b/include/iwinfo.h
|
|
@@ -227,6 +227,7 @@ void sort_by_signal(char *buf, int *len);
|
|
void iwinfo_finish(void);
|
|
|
|
extern const struct iwinfo_ops wext_ops;
|
|
+extern const struct iwinfo_ops qtnawifi_ops;
|
|
extern const struct iwinfo_ops madwifi_ops;
|
|
extern const struct iwinfo_ops wl_ops;
|
|
extern const struct iwinfo_ops ra_ops;
|
|
diff --git a/include/iwinfo/lua.h b/include/iwinfo/lua.h
|
|
index 917e18b..ebb4079 100644
|
|
--- a/include/iwinfo/lua.h
|
|
+++ b/include/iwinfo/lua.h
|
|
@@ -45,6 +45,10 @@
|
|
#define IWINFO_QCAWIFI_META "iwinfo.qcawifi"
|
|
#endif
|
|
|
|
+#ifdef USE_QTNAWIFI
|
|
+#define IWINFO_QTNAWIFI_META "iwinfo.qtnawifi"
|
|
+#endif
|
|
+
|
|
#ifdef USE_NL80211
|
|
#define IWINFO_NL80211_META "iwinfo.nl80211"
|
|
#endif
|
|
diff --git a/iwinfo_lib.c b/iwinfo_lib.c
|
|
index c226a76..1f94bb6 100644
|
|
--- a/iwinfo_lib.c
|
|
+++ b/iwinfo_lib.c
|
|
@@ -333,6 +333,9 @@ static const struct iwinfo_ops *backends[] = {
|
|
#ifdef USE_QCAWIFI
|
|
&qcawifi_ops,
|
|
#endif
|
|
+#ifdef USE_QTNAWIFI
|
|
+ &qtnawifi_ops,
|
|
+#endif
|
|
#ifdef USE_WL
|
|
&wl_ops,
|
|
#endif
|
|
diff --git a/iwinfo_lua.c b/iwinfo_lua.c
|
|
index 3ab1e19..55001c7 100644
|
|
--- a/iwinfo_lua.c
|
|
+++ b/iwinfo_lua.c
|
|
@@ -769,6 +769,36 @@ LUA_WRAP_STRUCT_OP(qcawifi,mbssid_support)
|
|
LUA_WRAP_STRUCT_OP(qcawifi,hardware_id)
|
|
#endif
|
|
|
|
+#ifdef USE_QTNAWIFI
|
|
+/* QCAwifi */
|
|
+LUA_WRAP_INT_OP(qtnawifi,channel)
|
|
+LUA_WRAP_INT_OP(qtnawifi,frequency)
|
|
+LUA_WRAP_INT_OP(qtnawifi,frequency_offset)
|
|
+LUA_WRAP_INT_OP(qtnawifi,txpower)
|
|
+LUA_WRAP_INT_OP(qtnawifi,txpower_offset)
|
|
+LUA_WRAP_INT_OP(qtnawifi,bitrate)
|
|
+LUA_WRAP_INT_OP(qtnawifi,signal)
|
|
+LUA_WRAP_INT_OP(qtnawifi,noise)
|
|
+LUA_WRAP_INT_OP(qtnawifi,quality)
|
|
+LUA_WRAP_INT_OP(qtnawifi,quality_max)
|
|
+LUA_WRAP_STRING_OP(qtnawifi,ssid)
|
|
+LUA_WRAP_STRING_OP(qtnawifi,bssid)
|
|
+LUA_WRAP_STRING_OP(qtnawifi,country)
|
|
+LUA_WRAP_STRING_OP(qtnawifi,hardware_name)
|
|
+LUA_WRAP_STRING_OP(qtnawifi,phyname)
|
|
+LUA_WRAP_STRUCT_OP(qtnawifi,mode)
|
|
+LUA_WRAP_STRUCT_OP(qtnawifi,assoclist)
|
|
+LUA_WRAP_STRUCT_OP(qtnawifi,txpwrlist)
|
|
+LUA_WRAP_STRUCT_OP(qtnawifi,scanlist)
|
|
+LUA_WRAP_STRUCT_OP(qtnawifi,freqlist)
|
|
+LUA_WRAP_STRUCT_OP(qtnawifi,countrylist)
|
|
+LUA_WRAP_STRUCT_OP(qtnawifi,hwmodelist)
|
|
+LUA_WRAP_STRUCT_OP(qtnawifi,htmodelist)
|
|
+LUA_WRAP_STRUCT_OP(qtnawifi,encryption)
|
|
+LUA_WRAP_STRUCT_OP(qtnawifi,mbssid_support)
|
|
+LUA_WRAP_STRUCT_OP(qtnawifi,hardware_id)
|
|
+#endif
|
|
+
|
|
#ifdef USE_NL80211
|
|
/* NL80211 */
|
|
LUA_WRAP_INT_OP(nl80211,channel)
|
|
@@ -959,6 +989,39 @@ static const luaL_reg R_qcawifi[] = {
|
|
};
|
|
#endif
|
|
|
|
+#ifdef USE_QTNAWIFI
|
|
+/* QCAwifi table */
|
|
+static const luaL_reg R_qtnawifi[] = {
|
|
+ LUA_REG(qtnawifi,channel),
|
|
+ LUA_REG(qtnawifi,frequency),
|
|
+ LUA_REG(qtnawifi,frequency_offset),
|
|
+ LUA_REG(qtnawifi,txpower),
|
|
+ LUA_REG(qtnawifi,txpower_offset),
|
|
+ LUA_REG(qtnawifi,bitrate),
|
|
+ LUA_REG(qtnawifi,signal),
|
|
+ LUA_REG(qtnawifi,noise),
|
|
+ LUA_REG(qtnawifi,quality),
|
|
+ LUA_REG(qtnawifi,quality_max),
|
|
+ LUA_REG(qtnawifi,mode),
|
|
+ LUA_REG(qtnawifi,ssid),
|
|
+ LUA_REG(qtnawifi,bssid),
|
|
+ LUA_REG(qtnawifi,country),
|
|
+ LUA_REG(qtnawifi,assoclist),
|
|
+ LUA_REG(qtnawifi,txpwrlist),
|
|
+ LUA_REG(qtnawifi,scanlist),
|
|
+ LUA_REG(qtnawifi,freqlist),
|
|
+ LUA_REG(qtnawifi,countrylist),
|
|
+ LUA_REG(qtnawifi,hwmodelist),
|
|
+ LUA_REG(qtnawifi,htmodelist),
|
|
+ LUA_REG(qtnawifi,encryption),
|
|
+ LUA_REG(qtnawifi,mbssid_support),
|
|
+ LUA_REG(qtnawifi,hardware_id),
|
|
+ LUA_REG(qtnawifi,hardware_name),
|
|
+ LUA_REG(qtnawifi,phyname),
|
|
+ { NULL, NULL }
|
|
+};
|
|
+#endif
|
|
+
|
|
#ifdef USE_NL80211
|
|
/* NL80211 table */
|
|
static const luaL_reg R_nl80211[] = {
|
|
@@ -1070,6 +1133,16 @@ LUALIB_API int luaopen_iwinfo(lua_State *L) {
|
|
lua_setfield(L, -2, "qcawifi");
|
|
#endif
|
|
|
|
+#ifdef USE_QTNAWIFI
|
|
+ luaL_newmetatable(L, IWINFO_QTNAWIFI_META);
|
|
+ luaL_register(L, NULL, R_common);
|
|
+ luaL_register(L, NULL, R_qtnawifi);
|
|
+ lua_pushvalue(L, -1);
|
|
+ lua_setfield(L, -2, "__index");
|
|
+ lua_setfield(L, -2, "qtnawifi");
|
|
+#endif
|
|
+
|
|
+
|
|
#ifdef USE_NL80211
|
|
luaL_newmetatable(L, IWINFO_NL80211_META);
|
|
luaL_register(L, NULL, R_common);
|