nss-packages: convert modules to use wifili vs wifi

This commit is contained in:
Qosmio 2024-03-17 02:18:20 -04:00
parent 9a2a123a47
commit 952e573a71
4 changed files with 106 additions and 4 deletions

View File

@ -5,7 +5,7 @@
nss_tx_status_t nss_tx_status;
struct nss_ctx_instance *nss_ctx = nss_match_get_context();
- struct nss_ctx_instance *wifi_nss_ctx = nss_wifi_get_context();
+ struct nss_ctx_instance *wifili_nss_ctx = nss_wifi_get_context();
+ struct nss_ctx_instance *wifili_nss_ctx = nss_wifili_get_context();
- if (!nss_ctx || !wifi_nss_ctx) {
- pr_warn("%px: NSS Context not found. wifi_nss_ctx: %px. Reset nexthop failed", nss_ctx, wifi_nss_ctx);
@ -31,7 +31,7 @@
int table_id;
struct nss_ctx_instance *nss_ctx = nss_match_get_context();
- struct nss_ctx_instance *wifi_nss_ctx = nss_wifi_get_context();
+ struct nss_ctx_instance *wifili_nss_ctx = nss_wifi_get_context();
+ struct nss_ctx_instance *wifili_nss_ctx = nss_wifili_get_context();
char *dev_name, *nexthop_msg;
char *cmd_buf = NULL;
size_t count = *lenp;
@ -58,3 +58,36 @@
} else if (if_num < NSS_MAX_PHYSICAL_INTERFACES) {
nss_tx_status = nss_phys_if_set_nexthop(nss_ctx, if_num, nh_if_num);
} else {
--- a/gre/nss_connmgr_gre.c
+++ b/gre/nss_connmgr_gre.c
@@ -1672,7 +1672,7 @@ int nss_connmgr_gre_set_wifi_next_hop(st
return GRE_ERR_NEXT_NODE_UNREG_IN_AE;
}
- ctx = nss_wifi_get_context();
+ ctx = nss_wifili_get_context();
status = nss_wifi_vdev_set_next_hop(ctx, ifnumber, NSS_GRE_INTERFACE);
if (status != NSS_TX_SUCCESS) {
nss_connmgr_gre_info("%px: wifi drv api failed to set next hop\n", wifi_vdev);
--- a/mirror/nss_mirror_ctl.c
+++ b/mirror/nss_mirror_ctl.c
@@ -480,7 +480,7 @@ static int nss_mirror_ctl_parse_enable_i
type = nss_dynamic_interface_get_type(nss_ctx, if_num);
if (type == NSS_DYNAMIC_INTERFACE_TYPE_VAP) {
- status = nss_wifi_vdev_set_next_hop(nss_wifi_get_context(), if_num, mirror_if_num);
+ status = nss_wifi_vdev_set_next_hop(nss_wifili_get_context(), if_num, mirror_if_num);
} else if (if_num < NSS_MAX_PHYSICAL_INTERFACES) {
status = nss_phys_if_set_nexthop(nss_ctx, if_num, mirror_if_num);
} else {
--- a/netlink/nss_nlgre_redir_cmn.c
+++ b/netlink/nss_nlgre_redir_cmn.c
@@ -905,7 +905,7 @@ int nss_nlgre_redir_cmn_set_next_hop(uin
}
nss_nl_info("%px: next hop interface number is %d\n", nss_ctx, next_dev_ifnum);
- ctx = nss_wifi_get_context();
+ ctx = nss_wifili_get_context();
ret = nss_wifi_vdev_set_next_hop(ctx, ifnumber, next_dev_ifnum);
if (ret != NSS_TX_SUCCESS) {

View File

@ -5,7 +5,7 @@
nss_tx_status_t nss_tx_status;
struct nss_ctx_instance *nss_ctx = nss_match_get_context();
- struct nss_ctx_instance *wifi_nss_ctx = nss_wifi_get_context();
+ struct nss_ctx_instance *wifili_nss_ctx = nss_wifi_get_context();
+ struct nss_ctx_instance *wifili_nss_ctx = nss_wifili_get_context();
- if (!nss_ctx || !wifi_nss_ctx) {
- pr_warn("%px: NSS Context not found. wifi_nss_ctx: %px. Reset nexthop failed", nss_ctx, wifi_nss_ctx);
@ -31,7 +31,7 @@
int table_id;
struct nss_ctx_instance *nss_ctx = nss_match_get_context();
- struct nss_ctx_instance *wifi_nss_ctx = nss_wifi_get_context();
+ struct nss_ctx_instance *wifili_nss_ctx = nss_wifi_get_context();
+ struct nss_ctx_instance *wifili_nss_ctx = nss_wifili_get_context();
char *dev_name, *nexthop_msg;
char *cmd_buf = NULL;
size_t count = *lenp;
@ -58,3 +58,36 @@
} else if (if_num < NSS_MAX_PHYSICAL_INTERFACES) {
nss_tx_status = nss_phys_if_set_nexthop(nss_ctx, if_num, nh_if_num);
} else {
--- a/gre/nss_connmgr_gre.c
+++ b/gre/nss_connmgr_gre.c
@@ -1672,7 +1672,7 @@ int nss_connmgr_gre_set_wifi_next_hop(st
return GRE_ERR_NEXT_NODE_UNREG_IN_AE;
}
- ctx = nss_wifi_get_context();
+ ctx = nss_wifili_get_context();
status = nss_wifi_vdev_set_next_hop(ctx, ifnumber, NSS_GRE_INTERFACE);
if (status != NSS_TX_SUCCESS) {
nss_connmgr_gre_info("%px: wifi drv api failed to set next hop\n", wifi_vdev);
--- a/mirror/nss_mirror_ctl.c
+++ b/mirror/nss_mirror_ctl.c
@@ -480,7 +480,7 @@ static int nss_mirror_ctl_parse_enable_i
type = nss_dynamic_interface_get_type(nss_ctx, if_num);
if (type == NSS_DYNAMIC_INTERFACE_TYPE_VAP) {
- status = nss_wifi_vdev_set_next_hop(nss_wifi_get_context(), if_num, mirror_if_num);
+ status = nss_wifi_vdev_set_next_hop(nss_wifili_get_context(), if_num, mirror_if_num);
} else if (if_num < NSS_MAX_PHYSICAL_INTERFACES) {
status = nss_phys_if_set_nexthop(nss_ctx, if_num, mirror_if_num);
} else {
--- a/netlink/nss_nlgre_redir_cmn.c
+++ b/netlink/nss_nlgre_redir_cmn.c
@@ -905,7 +905,7 @@ int nss_nlgre_redir_cmn_set_next_hop(uin
}
nss_nl_info("%px: next hop interface number is %d\n", nss_ctx, next_dev_ifnum);
- ctx = nss_wifi_get_context();
+ ctx = nss_wifili_get_context();
ret = nss_wifi_vdev_set_next_hop(ctx, ifnumber, next_dev_ifnum);
if (ret != NSS_TX_SUCCESS) {

View File

@ -0,0 +1,18 @@
--- a/exports/nss_wifili_if.h
+++ b/exports/nss_wifili_if.h
@@ -699,6 +699,15 @@ struct nss_wifili_stats_notification {
struct nss_wifili_stats stats; /**< Wifili statistics. */
};
+/**
+ * nss_wifili_get_context
+ * Gets the Wi-Fi Li context used in NSS GRE transmit.
+ *
+ * @return
+ * Pointer to the NSS core context.
+ */
+extern struct nss_ctx_instance *nss_wifili_get_context(void);
+
#ifdef __KERNEL__ /* only kernel will use. */
/**

View File

@ -0,0 +1,18 @@
--- a/exports/nss_wifili_if.h
+++ b/exports/nss_wifili_if.h
@@ -699,6 +699,15 @@ struct nss_wifili_stats_notification {
struct nss_wifili_stats stats; /**< Wifili statistics. */
};
+/**
+ * nss_wifili_get_context
+ * Gets the Wi-Fi Li context used in NSS GRE transmit.
+ *
+ * @return
+ * Pointer to the NSS core context.
+ */
+extern struct nss_ctx_instance *nss_wifili_get_context(void);
+
#ifdef __KERNEL__ /* only kernel will use. */
/**