wifi-mesh: For softAP stations don't get mesh specific station info 18/162618/1
authorSaurav Babu <saurav.babu@samsung.com>
Mon, 4 Dec 2017 11:42:27 +0000 (17:12 +0530)
committerSaurav Babu <saurav.babu@samsung.com>
Mon, 4 Dec 2017 11:42:27 +0000 (17:12 +0530)
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 <saurav.babu@samsung.com>
src/wifi-mesh-internal.c

index 2ab9121..c6356af 100644 (file)
@@ -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;
 }