Răsfoiți Sursa

qcacmn: Green AP framework

Add APIs for green AP convergence framework.

Change-Id: Icd4e676af1296843b0f64957e1d55db9b32f3e55
CRs-Fixed: 2142183
Soumya Bhat 7 ani în urmă
părinte
comite
f4cb93c5e7

+ 44 - 0
target_if/green_ap/inc/target_if_green_ap.h

@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2017 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
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: offload lmac interface APIs for green ap
+ */
+#ifndef __TARGET_IF_GREEN_AP_H__
+#define __TARGET_IF_GREEN_AP_H__
+
+#include <wlan_objmgr_pdev_obj.h>
+
+/**
+ * target_if_green_ap_enable_egap() - Enable egap
+ * @pdev: pdev pointer
+ *
+ * @Return: None
+ */
+void target_if_green_ap_enable_egap(struct wlan_objmgr_pdev *pdev);
+
+/**
+ * target_if_green_ap_set_ps_on_off() - PS toggle
+ * @pdev: pdev pointer
+ * @value: Value to send PS on/off to FW
+ *
+ * @Return: None
+ */
+void target_if_green_ap_set_ps_on_off(struct wlan_objmgr_pdev *pdev,
+				     uint32_t value);
+#endif

+ 36 - 0
target_if/green_ap/src/target_if_green_ap.c

@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017 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
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: offload lmac interface APIs definitions for Green ap
+ */
+
+#include <target_if_green_ap.h>
+#include <wlan_objmgr_pdev_obj.h>
+#include <target_if.h>
+
+void target_if_green_ap_enable_egap(struct wlan_objmgr_pdev *pdev)
+{
+
+}
+
+void target_if_green_ap_set_ps_on_off(struct wlan_objmgr_pdev *pdev,
+				     uint32_t value)
+{
+
+}

+ 44 - 0
umac/green_ap/core/src/wlan_green_ap_main.c

@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2017 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
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: This file contains main green ap function definitions
+ */
+
+#include <wlan_objmgr_pdev_obj.h>
+#include "wlan_green_ap_main_i.h"
+
+void wlan_green_ap_state_mc(struct wlan_objmgr_pdev *pdev,
+			   enum wlan_green_ap_ps_event event)
+{
+
+}
+
+void wlan_green_ap_ps_event_state_update(struct wlan_objmgr_pdev *pdev,
+			 enum wlan_green_ap_ps_state state,
+			 enum wlan_green_ap_ps_event event)
+{
+
+}
+
+int wlan_green_ap_timer_fn(struct wlan_objmgr_pdev *pdev)
+{
+
+	return 0;
+}
+

+ 112 - 0
umac/green_ap/core/src/wlan_green_ap_main_i.h

@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2017 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
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+/**
+ * DOC: This file has main green ap structures.
+ */
+
+#ifndef _WLAN_GREEN_AP_MAIN_I_H_
+#define _WLAN_GREEN_AP_MAIN_I_H_
+
+/**
+ * enum wlan_green_ap_ps_state - PS states
+ * @WLAN_GREEN_AP_PS_IDLE_STATE - Idle
+ * @WLAN_GREEN_AP_PS_OFF_STATE  - Off
+ * @WLAN_GREEN_AP_PS_WAIT_STATE - Wait
+ * @WLAN_GREEN_AP_PS_ON_STATE   - On
+ */
+enum wlan_green_ap_ps_state {
+	WLAN_GREEN_AP_PS_IDLE_STATE = 1,
+	WLAN_GREEN_AP_PS_OFF_STATE,
+	WLAN_GREEN_AP_PS_WAIT_STATE,
+	WLAN_GREEN_AP_PS_ON_STATE,
+};
+
+/**
+ * enum wlan_green_ap_ps_event   - PS event
+ * @WLAN_GREEN_AP_PS_START_EVENT - Start
+ * @WLAN_GREEN_AP_PS_STOP_EVENT  - Stop
+ * @WLAN_GREEN_AP_ADD_STA_EVENT  - Sta assoc
+ * @WLAN_GREEN_AP_DEL_STA_EVENT  - Sta disassoc
+ * @WLAN_GREEN_AP_PS_ON_EVENT    - PS on
+ * @WLAN_GREEN_AP_PS_OFF_EVENT   - PS off
+ */
+enum wlan_green_ap_ps_event {
+	WLAN_GREEN_AP_PS_START_EVENT = 1,
+	WLAN_GREEN_AP_PS_STOP_EVENT,
+	WLAN_GREEN_AP_ADD_STA_EVENT,
+	WLAN_GREEN_AP_DEL_STA_EVENT,
+	WLAN_GREEN_AP_PS_ON_EVENT,
+	WLAN_GREEN_AP_PS_WAIT_EVENT,
+};
+
+/**
+ * struct wlan_pdev_green_ap_ctx - green ap context
+ * @pdev - Pdev pointer
+ * @green_ap_ps_enable  - Enable PS
+ * @green_ap_ps_on_time - PS on time, once enabled
+ * @green_ap_ps_trans_time - PS transition time
+ * @green_ap_num_node - Number of nodes associated to radio
+ * @ps_state - PS state
+ * @ps_event - PS event
+ * @green_ap_ps_timer - Timer
+ * @green_ap_egap_support - Enhanced green ap support
+ */
+struct wlan_pdev_green_ap_ctx {
+	struct wlan_objmgr_pdev *pdev;
+	uint8_t green_ap_ps_enable;
+	uint8_t green_ap_ps_on_time;
+	uint32_t green_ap_ps_trans_time;
+	uint32_t green_ap_num_nodes;
+	enum wlan_green_ap_ps_state ps_state;
+	enum wlan_green_ap_ps_event ps_event;
+	qdf_timer_t green_ap_ps_timer;
+	bool green_ap_egap_support;
+};
+
+/**
+ * wlan_green_ap_state_mc() - Green ap state machine
+ * @pdev: pdev pointer
+ * @event: ps event
+ *
+ * @Return: None
+ */
+void wlan_green_ap_state_mc(struct wlan_objmgr_pdev *pdev,
+			   enum wlan_green_ap_ps_event event);
+
+/**
+ * wlan_green_ap_ps_event_state_update() - Update PS state and event
+ * @pdev: pdev pointer
+ * @state: ps state
+ * @event: ps event
+ *
+ * @Return: None
+ */
+void wlan_green_ap_ps_event_state_update(struct wlan_objmgr_pdev *pdev,
+			 enum wlan_green_ap_ps_state state,
+			 enum wlan_green_ap_ps_event event);
+
+/**
+ * wlan_green_ap_timer_fn() - Green ap timer callback
+ * @pdev: pdev pointer
+ *
+ * @Return: status
+ */
+int wlan_green_ap_timer_fn(struct wlan_objmgr_pdev *pdev);
+#endif  /* _WLAN_GREEN_AP_MAIN_I_H_ */

+ 82 - 0
umac/green_ap/dispatcher/inc/wlan_green_ap_api.h

@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2017 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
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: Contains green ap north bound interface definitions
+ */
+
+#ifndef _WLAN_GREEN_AP_API_H_
+#define _WLAN_GREEN_AP_API_H_
+
+#include <wlan_objmgr_pdev_obj.h>
+
+/**
+ * wlan_green_ap_init() - initialize green ap component
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS wlan_green_ap_init(void);
+
+/**
+ * wlan_green_ap_deinit() - De-initialize green ap component
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS wlan_green_ap_deinit(void);
+
+/**
+ * wlan_green_ap_start() - Start green ap
+ * @pdev: pdev pointer
+ *
+ * Call this function when the first vdev comes up
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS wlan_green_ap_start(struct wlan_objmgr_pdev *pdev);
+
+/**
+ * wlan_green_ap_stop() - Stop green ap
+ * @pdev: pdev pointer
+ *
+ * Call this function when the last vdev goes down
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS wlan_green_ap_stop(struct wlan_objmgr_pdev *pdev);
+
+/**
+ * wlan_green_ap_add_sta() - On association
+ * @pdev: pdev pointer
+ *
+ * Call this function when new node is associated
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS wlan_green_ap_add_sta(struct wlan_objmgr_pdev *pdev);
+
+/**
+ * wlan_green_ap_del_sta() - On disassociation
+ * @pdev: pdev pointer
+ *
+ * Call this function when new node is associated
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS wlan_green_ap_del_sta(struct wlan_objmgr_pdev *pdev);
+
+#endif /* _WLAN_GREEN_AP_API_H_ */

+ 29 - 0
umac/green_ap/dispatcher/inc/wlan_green_ap_ucfg_api.h

@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 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
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: Contains green ap north bound interface definitions
+ */
+
+#ifndef _WLAN_GREEN_AP_UCFG_API_H_
+#define _WLAN_GREEN_AP_UCFG_API_H_
+
+#include <wlan_objmgr_pdev_obj.h>
+
+
+#endif /* _WLAN_GREEN_AP_UCFG_API_H_ */

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

@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2017 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
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: This file contains green ap north bound interface definitions
+ */
+
+#include <qdf_status.h>
+#include <wlan_green_ap_api.h>
+
+QDF_STATUS wlan_green_ap_init(void)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	return status;
+}
+
+QDF_STATUS wlan_green_ap_deinit(void)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	return status;
+}
+
+QDF_STATUS wlan_green_ap_start(struct wlan_objmgr_pdev *pdev)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	return status;
+}
+
+QDF_STATUS wlan_green_ap_stop(struct wlan_objmgr_pdev *pdev)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	return status;
+}
+
+QDF_STATUS wlan_green_ap_add_sta(struct wlan_objmgr_pdev *pdev)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	return status;
+}
+
+QDF_STATUS wlan_green_ap_del_sta(struct wlan_objmgr_pdev *pdev)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	return status;
+}

+ 25 - 0
umac/green_ap/dispatcher/src/wlan_green_ap_ucfg_api.c

@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2017 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
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: This file contains green ap north bound interface definitions
+ */
+
+#include <qdf_status.h>
+#include <wlan_green_ap_ucfg_api.h>
+