mirror of
https://github.com/breeze303/nss-packages.git
synced 2025-12-16 16:57:29 +00:00
239 lines
10 KiB
Diff
239 lines
10 KiB
Diff
--- a/wifi_meshmgr/nss_wifi_meshmgr.c
|
|
+++ b/wifi_meshmgr/nss_wifi_meshmgr.c
|
|
@@ -49,7 +49,7 @@ static bool nss_wifi_meshmgr_verify_if_n
|
|
*/
|
|
static nss_wifi_meshmgr_status_t nss_wifi_meshmgr_tx_msg(struct nss_wifi_mesh_msg *msg)
|
|
{
|
|
- return nss_wifi_mesh_tx_msg(wmgr_ctx.nss_ctx, msg);
|
|
+ return (nss_wifi_meshmgr_status_t)nss_wifi_mesh_tx_msg(wmgr_ctx.nss_ctx, msg);
|
|
}
|
|
|
|
/*
|
|
@@ -126,7 +126,7 @@ static void nss_wifi_meshmgr_cleanup(str
|
|
* Unregister and dealloc decap DI.
|
|
*/
|
|
nss_unregister_wifi_mesh_if(decap_ifnum);
|
|
- nss_status = nss_dynamic_interface_dealloc_node(decap_ifnum, NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER);
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)nss_dynamic_interface_dealloc_node(decap_ifnum, NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER);
|
|
if (nss_status != NSS_WIFI_MESHMGR_SUCCESS) {
|
|
nss_wifi_meshmgr_warn("%px: Failed to dealloc decap: %d\n", &wmgr_ctx, nss_status);
|
|
}
|
|
@@ -135,7 +135,7 @@ static void nss_wifi_meshmgr_cleanup(str
|
|
* Unregister and dealloc encap DI.
|
|
*/
|
|
nss_unregister_wifi_mesh_if(encap_ifnum);
|
|
- nss_status = nss_dynamic_interface_dealloc_node(encap_ifnum, NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER);
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)nss_dynamic_interface_dealloc_node(encap_ifnum, NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER);
|
|
if (nss_status != NSS_WIFI_MESHMGR_SUCCESS) {
|
|
nss_wifi_meshmgr_warn("%px: Failed to dealloc encap: %d\n", &wmgr_ctx, nss_status);
|
|
}
|
|
@@ -257,10 +257,10 @@ static void nss_wifi_meshmgr_tx_msg_cb(v
|
|
/*
|
|
* FIXME: The wmesh_ctx can be invalid if the memory goes away with the caller being timedout.
|
|
*/
|
|
- wmesh_ctx->response = NSS_WIFI_MESHMGR_SUCCESS;
|
|
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_SUCCESS;
|
|
if (ncm->response != NSS_CMN_RESPONSE_ACK) {
|
|
nss_wifi_meshmgr_warn("%px: WiFi-Mesh error response %d error_code: %u\n", &wmgr_ctx, ncm->response, error_code);
|
|
- wmesh_ctx->response = nss_wifi_meshmgr_remap_error(error_code);
|
|
+ wmesh_ctx->response = (nss_tx_status_t)nss_wifi_meshmgr_remap_error(error_code);
|
|
}
|
|
|
|
complete(&wmesh_ctx->complete);
|
|
@@ -289,10 +289,10 @@ static nss_wifi_meshmgr_status_t nss_wif
|
|
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
|
if (!ret) {
|
|
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
|
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
}
|
|
|
|
- status = wmesh_ctx->response;
|
|
+ status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
|
up(&wmesh_ctx->sem);
|
|
return status;
|
|
}
|
|
@@ -324,7 +324,7 @@ nss_wifi_meshmgr_status_t nss_wifi_meshm
|
|
return NSS_WIFI_MESHMGR_FAILURE;
|
|
}
|
|
|
|
- nss_status = nss_wifi_mesh_tx_buf(wmgr_ctx.nss_ctx, os_buf, encap_ifnum);
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)nss_wifi_mesh_tx_buf(wmgr_ctx.nss_ctx, os_buf, encap_ifnum);
|
|
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
|
return nss_status;
|
|
}
|
|
@@ -548,10 +548,10 @@ nss_wifi_meshmgr_dump_mesh_path_sync(nss
|
|
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
|
if (!ret) {
|
|
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
|
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
}
|
|
|
|
- nss_status = wmesh_ctx->response;
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
|
up(&wmesh_ctx->sem);
|
|
|
|
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
|
@@ -643,10 +643,10 @@ nss_wifi_meshmgr_dump_mesh_proxy_path_sy
|
|
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
|
if (!ret) {
|
|
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
|
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
}
|
|
|
|
- nss_status = wmesh_ctx->response;
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
|
up(&wmesh_ctx->sem);
|
|
|
|
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
|
@@ -715,7 +715,7 @@ nss_wifi_meshmgr_assoc_link_vap(nss_wifi
|
|
/*
|
|
* Send the link vap mesage to the NSS synchronously.
|
|
*/
|
|
- nss_status = nss_wifi_vdev_tx_msg(wmgr_ctx.nss_ctx, wifivdevmsg);
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)nss_wifi_vdev_tx_msg(wmgr_ctx.nss_ctx, wifivdevmsg);
|
|
if (nss_status != NSS_WIFI_MESHMGR_SUCCESS) {
|
|
nss_wifi_meshmgr_warn("%px: Mesh link vap association failed: %d.\n", &wmgr_ctx, nss_status);
|
|
}
|
|
@@ -761,10 +761,10 @@ nss_wifi_meshmgr_assoc_link_vap_sync(nss
|
|
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
|
if (!ret) {
|
|
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
|
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
}
|
|
|
|
- nss_status = wmesh_ctx->response;
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
|
up(&wmesh_ctx->sem);
|
|
|
|
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
|
@@ -886,10 +886,10 @@ nss_wifi_meshmgr_mesh_config_update_sync
|
|
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
|
if (!ret) {
|
|
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
|
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
}
|
|
|
|
- nss_status = wmesh_ctx->response;
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
|
up(&wmesh_ctx->sem);
|
|
|
|
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
|
@@ -985,10 +985,10 @@ nss_wifi_meshmgr_mesh_proxy_path_delete_
|
|
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
|
if (!ret) {
|
|
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
|
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
}
|
|
|
|
- nss_status = wmesh_ctx->response;
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
|
up(&wmesh_ctx->sem);
|
|
|
|
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
|
@@ -1084,10 +1084,10 @@ nss_wifi_meshmgr_mesh_proxy_path_update_
|
|
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
|
if (!ret) {
|
|
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
|
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
}
|
|
|
|
- nss_status = wmesh_ctx->response;
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
|
up(&wmesh_ctx->sem);
|
|
|
|
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
|
@@ -1183,10 +1183,10 @@ nss_wifi_meshmgr_mesh_proxy_path_add_syn
|
|
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
|
if (!ret) {
|
|
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
|
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
}
|
|
|
|
- nss_status = wmesh_ctx->response;
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
|
up(&wmesh_ctx->sem);
|
|
|
|
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
|
@@ -1282,10 +1282,10 @@ nss_wifi_meshmgr_mesh_path_delete_sync(n
|
|
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
|
if (!ret) {
|
|
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
|
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
}
|
|
|
|
- nss_status = wmesh_ctx->response;
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
|
up(&wmesh_ctx->sem);
|
|
|
|
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
|
@@ -1381,10 +1381,10 @@ nss_wifi_meshmgr_mesh_path_add_sync(nss_
|
|
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
|
if (!ret) {
|
|
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
|
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
}
|
|
|
|
- nss_status = wmesh_ctx->response;
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
|
up(&wmesh_ctx->sem);
|
|
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
|
return nss_status;
|
|
@@ -1479,10 +1479,10 @@ nss_wifi_meshmgr_mesh_path_update_sync(n
|
|
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
|
if (!ret) {
|
|
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
|
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
}
|
|
|
|
- nss_status = wmesh_ctx->response;
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
|
up(&wmesh_ctx->sem);
|
|
|
|
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
|
@@ -1578,10 +1578,10 @@ nss_wifi_meshmgr_mesh_path_exception_syn
|
|
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
|
if (!ret) {
|
|
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
|
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
}
|
|
|
|
- nss_status = wmesh_ctx->response;
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
|
up(&wmesh_ctx->sem);
|
|
|
|
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
|
@@ -1702,10 +1702,10 @@ nss_wifi_meshmgr_config_mesh_exception_s
|
|
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
|
if (!ret) {
|
|
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
|
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
|
}
|
|
|
|
- nss_status = wmesh_ctx->response;
|
|
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
|
up(&wmesh_ctx->sem);
|
|
|
|
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
|
@@ -1795,7 +1795,7 @@ nss_wifi_mesh_handle_t nss_wifi_meshmgr_
|
|
int32_t encap_ifnum, decap_ifnum;
|
|
uint32_t features = 0;
|
|
nss_wifi_mesh_handle_t mesh_handle;
|
|
- nss_wifi_meshmgr_status_t nss_status;
|
|
+ nss_wifi_meshmgr_status_t nss_status = NSS_WIFI_MESHMGR_SUCCESS;
|
|
struct nss_wifi_meshmgr_mesh_ctx *wmesh_ctx;
|
|
|
|
spin_lock_bh(&wmgr_ctx.ref_lock);
|