|
@@ -43,6 +43,7 @@ wlan_psoc_get_p2p_tx_ops(struct wlan_objmgr_psoc *psoc)
|
|
|
return &(psoc->soc_cb.tx_ops.p2p);
|
|
|
}
|
|
|
|
|
|
+#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
|
|
QDF_STATUS tgt_p2p_register_lo_ev_handler(
|
|
|
struct wlan_objmgr_psoc *psoc)
|
|
|
{
|
|
@@ -58,31 +59,79 @@ QDF_STATUS tgt_p2p_register_lo_ev_handler(
|
|
|
return status;
|
|
|
}
|
|
|
|
|
|
-QDF_STATUS tgt_p2p_register_noa_ev_handler(
|
|
|
+QDF_STATUS tgt_p2p_unregister_lo_ev_handler(
|
|
|
struct wlan_objmgr_psoc *psoc)
|
|
|
{
|
|
|
struct wlan_lmac_if_p2p_tx_ops *p2p_ops;
|
|
|
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
|
|
|
|
|
p2p_ops = wlan_psoc_get_p2p_tx_ops(psoc);
|
|
|
- if (p2p_ops && p2p_ops->reg_noa_ev_handler) {
|
|
|
- status = p2p_ops->reg_noa_ev_handler(psoc, NULL);
|
|
|
- p2p_debug("register noa event, status:%d", status);
|
|
|
+ if (p2p_ops && p2p_ops->unreg_lo_ev_handler) {
|
|
|
+ status = p2p_ops->unreg_lo_ev_handler(psoc, NULL);
|
|
|
+ p2p_debug("unregister lo event, status:%d", status);
|
|
|
}
|
|
|
|
|
|
return status;
|
|
|
}
|
|
|
|
|
|
-QDF_STATUS tgt_p2p_unregister_lo_ev_handler(
|
|
|
+QDF_STATUS tgt_p2p_lo_event_cb(struct wlan_objmgr_psoc *psoc,
|
|
|
+ struct p2p_lo_event *event_info)
|
|
|
+{
|
|
|
+ struct p2p_lo_stop_event *lo_stop_event;
|
|
|
+ struct scheduler_msg msg = {0};
|
|
|
+ struct p2p_soc_priv_obj *p2p_soc_obj;
|
|
|
+
|
|
|
+ p2p_debug("soc:%pK, event_info:%pK", psoc, event_info);
|
|
|
+
|
|
|
+ if (!psoc) {
|
|
|
+ p2p_err("psoc context passed is NULL");
|
|
|
+ if (event_info)
|
|
|
+ qdf_mem_free(event_info);
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ p2p_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
|
|
+ WLAN_UMAC_COMP_P2P);
|
|
|
+ if (!p2p_soc_obj) {
|
|
|
+ p2p_err("p2p soc object is NULL");
|
|
|
+ if (event_info)
|
|
|
+ qdf_mem_free(event_info);
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!event_info) {
|
|
|
+ p2p_err("invalid lo stop event information");
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ lo_stop_event = qdf_mem_malloc(sizeof(*lo_stop_event));
|
|
|
+ if (!lo_stop_event) {
|
|
|
+ p2p_err("Failed to allocate p2p lo stop event");
|
|
|
+ qdf_mem_free(event_info);
|
|
|
+ return QDF_STATUS_E_NOMEM;
|
|
|
+ }
|
|
|
+
|
|
|
+ lo_stop_event->p2p_soc_obj = p2p_soc_obj;
|
|
|
+ lo_stop_event->lo_event = event_info;
|
|
|
+ msg.type = P2P_EVENT_LO_STOPPED;
|
|
|
+ msg.bodyptr = lo_stop_event;
|
|
|
+ msg.callback = p2p_process_evt;
|
|
|
+ scheduler_post_msg(QDF_MODULE_ID_TARGET_IF, &msg);
|
|
|
+
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|
|
|
+#endif /* FEATURE_P2P_LISTEN_OFFLOAD */
|
|
|
+
|
|
|
+QDF_STATUS tgt_p2p_register_noa_ev_handler(
|
|
|
struct wlan_objmgr_psoc *psoc)
|
|
|
{
|
|
|
struct wlan_lmac_if_p2p_tx_ops *p2p_ops;
|
|
|
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
|
|
|
|
|
p2p_ops = wlan_psoc_get_p2p_tx_ops(psoc);
|
|
|
- if (p2p_ops && p2p_ops->unreg_lo_ev_handler) {
|
|
|
- status = p2p_ops->unreg_lo_ev_handler(psoc, NULL);
|
|
|
- p2p_debug("unregister lo event, status:%d", status);
|
|
|
+ if (p2p_ops && p2p_ops->reg_noa_ev_handler) {
|
|
|
+ status = p2p_ops->reg_noa_ev_handler(psoc, NULL);
|
|
|
+ p2p_debug("register noa event, status:%d", status);
|
|
|
}
|
|
|
|
|
|
return status;
|
|
@@ -288,50 +337,3 @@ QDF_STATUS tgt_p2p_noa_event_cb(struct wlan_objmgr_psoc *psoc,
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
-
|
|
|
-QDF_STATUS tgt_p2p_lo_event_cb(struct wlan_objmgr_psoc *psoc,
|
|
|
- struct p2p_lo_event *event_info)
|
|
|
-{
|
|
|
- struct p2p_lo_stop_event *lo_stop_event;
|
|
|
- struct scheduler_msg msg = {0};
|
|
|
- struct p2p_soc_priv_obj *p2p_soc_obj;
|
|
|
-
|
|
|
- p2p_debug("soc:%pK, event_info:%pK", psoc, event_info);
|
|
|
-
|
|
|
- if (!psoc) {
|
|
|
- p2p_err("psoc context passed is NULL");
|
|
|
- if (event_info)
|
|
|
- qdf_mem_free(event_info);
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
-
|
|
|
- p2p_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
|
|
- WLAN_UMAC_COMP_P2P);
|
|
|
- if (!p2p_soc_obj) {
|
|
|
- p2p_err("p2p soc object is NULL");
|
|
|
- if (event_info)
|
|
|
- qdf_mem_free(event_info);
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
-
|
|
|
- if (!event_info) {
|
|
|
- p2p_err("invalid lo stop event information");
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
-
|
|
|
- lo_stop_event = qdf_mem_malloc(sizeof(*lo_stop_event));
|
|
|
- if (!lo_stop_event) {
|
|
|
- p2p_err("Failed to allocate p2p lo stop event");
|
|
|
- qdf_mem_free(event_info);
|
|
|
- return QDF_STATUS_E_NOMEM;
|
|
|
- }
|
|
|
-
|
|
|
- lo_stop_event->p2p_soc_obj = p2p_soc_obj;
|
|
|
- lo_stop_event->lo_event = event_info;
|
|
|
- msg.type = P2P_EVENT_LO_STOPPED;
|
|
|
- msg.bodyptr = lo_stop_event;
|
|
|
- msg.callback = p2p_process_evt;
|
|
|
- scheduler_post_msg(QDF_MODULE_ID_TARGET_IF, &msg);
|
|
|
-
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
-}
|