From a636cb20b071383819e5cbde049f18aab0a75022 Mon Sep 17 00:00:00 2001 From: Saurav Babu Date: Mon, 4 Dec 2017 17:12:27 +0530 Subject: [PATCH] wifi-mesh: For softAP stations don't get mesh specific station info This patch returns WIFI_MESH_ERROR_INVALID_OPERATION when trying to get stations informations specific to mesh for softAP station Change-Id: Ib8d74ecc38c8bd1ca6be455f3ca2b079255c515e Signed-off-by: Saurav Babu --- src/wifi-mesh-internal.c | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/wifi-mesh-internal.c b/src/wifi-mesh-internal.c index 2ab9121..c6356af 100644 --- a/src/wifi-mesh-internal.c +++ b/src/wifi-mesh-internal.c @@ -436,6 +436,13 @@ EXPORT_API int wifi_mesh_get_sta_mesh_llid(wifi_mesh_station_info_h station, /* LCOV_EXCL_STOP */ } + if (psta->sta_type == MESH_STATION_TYPE_SOFTAP) { + /* LCOV_EXCL_START */ + LOGE("Invalid Station Type"); + return WIFI_MESH_ERROR_INVALID_OPERATION; + /* LCOV_EXCL_STOP */ + } + *mesh_llid = psta->mesh_llid; return rv; } @@ -455,6 +462,13 @@ EXPORT_API int wifi_mesh_get_sta_mesh_plid(wifi_mesh_station_info_h station, /* LCOV_EXCL_STOP */ } + if (psta->sta_type == MESH_STATION_TYPE_SOFTAP) { + /* LCOV_EXCL_START */ + LOGE("Invalid Station Type"); + return WIFI_MESH_ERROR_INVALID_OPERATION; + /* LCOV_EXCL_STOP */ + } + *mesh_plid = psta->mesh_plid; return rv; } @@ -474,6 +488,13 @@ EXPORT_API int wifi_mesh_get_sta_mesh_plink(wifi_mesh_station_info_h station, /* LCOV_EXCL_STOP */ } + if (psta->sta_type == MESH_STATION_TYPE_SOFTAP) { + /* LCOV_EXCL_START */ + LOGE("Invalid Station Type"); + return WIFI_MESH_ERROR_INVALID_OPERATION; + /* LCOV_EXCL_STOP */ + } + *mesh_plink = psta->mesh_plink; return rv; } @@ -493,6 +514,13 @@ EXPORT_API int wifi_mesh_get_sta_local_ps_mode(wifi_mesh_station_info_h station, /* LCOV_EXCL_STOP */ } + if (psta->sta_type == MESH_STATION_TYPE_SOFTAP) { + /* LCOV_EXCL_START */ + LOGE("Invalid Station Type"); + return WIFI_MESH_ERROR_INVALID_OPERATION; + /* LCOV_EXCL_STOP */ + } + *local_ps_mode = psta->local_ps_mode; return rv; } @@ -512,6 +540,13 @@ EXPORT_API int wifi_mesh_get_sta_peer_ps_mode(wifi_mesh_station_info_h station, /* LCOV_EXCL_STOP */ } + if (psta->sta_type == MESH_STATION_TYPE_SOFTAP) { + /* LCOV_EXCL_START */ + LOGE("Invalid Station Type"); + return WIFI_MESH_ERROR_INVALID_OPERATION; + /* LCOV_EXCL_STOP */ + } + *peer_ps_mode = psta->peer_ps_mode; return rv; } @@ -531,6 +566,13 @@ EXPORT_API int wifi_mesh_get_sta_non_peer_ps_mode( /* LCOV_EXCL_STOP */ } + if (psta->sta_type == MESH_STATION_TYPE_SOFTAP) { + /* LCOV_EXCL_START */ + LOGE("Invalid Station Type"); + return WIFI_MESH_ERROR_INVALID_OPERATION; + /* LCOV_EXCL_STOP */ + } + *non_peer_ps_mode = psta->non_peer_ps_mode; return rv; } -- 2.34.1