瀏覽代碼

qcacmn: Add support for Green AP SMPS feature

Add feature support for GAP SMPS mode

Change-Id: I40b9efb6ef22fe4bebdb30939f19d8d112065344
Aakanksha Doda 4 年之前
父節點
當前提交
03d2eeb345

+ 4 - 1
umac/green_ap/core/src/wlan_green_ap_main.c

@@ -388,9 +388,12 @@ void wlan_green_ap_check_mode(struct wlan_objmgr_pdev *pdev,
 {
 	struct wlan_objmgr_vdev *vdev = (struct wlan_objmgr_vdev *)object;
 	uint8_t *flag = (uint8_t *)arg;
+	enum QDF_OPMODE mode = QDF_MAX_NO_OF_MODE;
 
 	wlan_vdev_obj_lock(vdev);
-	if (wlan_vdev_mlme_get_opmode(vdev) != QDF_SAP_MODE)
+	mode = wlan_vdev_mlme_get_opmode(vdev);
+
+	if (mode != QDF_SAP_MODE && mode != QDF_STA_MODE)
 		*flag = 1;
 
 	wlan_vdev_obj_unlock(vdev);

+ 11 - 1
umac/green_ap/dispatcher/inc/wlan_green_ap_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -168,4 +168,14 @@ void wlan_green_ap_suspend_handle(struct wlan_objmgr_pdev *pdev);
  * Return: Appropriate status
  */
 QDF_STATUS wlan_green_ap_get_capab(struct wlan_objmgr_pdev *pdev);
+
+/**
+ * wlan_green_ap_is_ps_waiting() - is power save in wait state
+ * @pdev: pdev pointer
+ *
+ * Check if power save is in wait state
+ *
+ * Return: Success or Failure
+ */
+bool wlan_green_ap_is_ps_waiting(struct wlan_objmgr_pdev *pdev);
 #endif /* _WLAN_GREEN_AP_API_H_ */

+ 24 - 0
umac/green_ap/dispatcher/src/wlan_green_ap_api.c

@@ -498,3 +498,27 @@ void wlan_green_ap_suspend_handle(struct wlan_objmgr_pdev *pdev)
 
 	green_ap_ctx->ps_enable = WLAN_GREEN_AP_PS_SUSPEND;
 }
+
+bool wlan_green_ap_is_ps_waiting(struct wlan_objmgr_pdev *pdev)
+{
+	struct wlan_pdev_green_ap_ctx *green_ap_ctx;
+
+	if (!pdev) {
+		green_ap_err("pdev context passed is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	green_ap_ctx = wlan_objmgr_pdev_get_comp_private_obj(
+			pdev, WLAN_UMAC_COMP_GREEN_AP);
+	if (!green_ap_ctx) {
+		green_ap_err("green ap context obtained is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if ((green_ap_ctx->ps_state == WLAN_GREEN_AP_PS_WAIT_STATE) &&
+	    (green_ap_ctx->ps_enable)) {
+		return true;
+	}
+
+	return false;
+}

+ 2 - 2
umac/green_ap/dispatcher/src/wlan_green_ap_ucfg_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -197,7 +197,7 @@ QDF_STATUS ucfg_green_ap_config(struct wlan_objmgr_pdev *pdev, uint8_t val)
 					wlan_green_ap_check_mode,
 					&flag, 0, WLAN_GREEN_AP_ID);
 		if (flag == 1) {
-			green_ap_err("Radio not in AP mode."
+			green_ap_err("Radio not in AP/RE mode."
 					"Feature not supported");
 			return QDF_STATUS_E_NOSUPPORT;
 		}