qcacmn: Featurize P2P Listen Offload
P2P Listen offload is not a requirement for Genoa, hence featurize P2P listen offload code to save memory foot-print for Genoa. Change-Id: I3c32b4ee2b37421e49acee4bd20d36e7a8a3bf77 CRs-Fixed: 2304555
This commit is contained in:
@@ -789,6 +789,20 @@ QDF_STATUS p2p_psoc_object_close(struct wlan_objmgr_psoc *soc)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
||||
static inline void p2p_init_lo_event(struct p2p_start_param *start_param,
|
||||
struct p2p_start_param *req)
|
||||
{
|
||||
start_param->lo_event_cb = req->lo_event_cb;
|
||||
start_param->lo_event_cb_data = req->lo_event_cb_data;
|
||||
}
|
||||
#else
|
||||
static inline void p2p_init_lo_event(struct p2p_start_param *start_param,
|
||||
struct p2p_start_param *req)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS p2p_psoc_start(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_start_param *req)
|
||||
{
|
||||
@@ -818,8 +832,7 @@ QDF_STATUS p2p_psoc_start(struct wlan_objmgr_psoc *soc,
|
||||
start_param->event_cb_data = req->event_cb_data;
|
||||
start_param->tx_cnf_cb = req->tx_cnf_cb;
|
||||
start_param->tx_cnf_cb_data = req->tx_cnf_cb_data;
|
||||
start_param->lo_event_cb = req->lo_event_cb;
|
||||
start_param->lo_event_cb_data = req->lo_event_cb_data;
|
||||
p2p_init_lo_event(start_param, req);
|
||||
p2p_soc_obj->start_param = start_param;
|
||||
|
||||
wlan_p2p_init_connection_status(p2p_soc_obj);
|
||||
@@ -995,6 +1008,7 @@ QDF_STATUS p2p_process_evt(struct scheduler_msg *msg)
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
||||
QDF_STATUS p2p_process_lo_stop(
|
||||
struct p2p_lo_stop_event *lo_stop_event)
|
||||
{
|
||||
@@ -1034,6 +1048,7 @@ QDF_STATUS p2p_process_lo_stop(
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS p2p_process_noa(struct p2p_noa_event *noa_event)
|
||||
{
|
||||
|
@@ -354,6 +354,7 @@ QDF_STATUS p2p_process_cmd(struct scheduler_msg *msg);
|
||||
*/
|
||||
QDF_STATUS p2p_process_evt(struct scheduler_msg *msg);
|
||||
|
||||
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
||||
/**
|
||||
* p2p_process_lo_stop() - Process lo stop event
|
||||
* @lo_stop_event: listen offload stop event information
|
||||
@@ -365,7 +366,13 @@ QDF_STATUS p2p_process_evt(struct scheduler_msg *msg);
|
||||
*/
|
||||
QDF_STATUS p2p_process_lo_stop(
|
||||
struct p2p_lo_stop_event *lo_stop_event);
|
||||
|
||||
#else
|
||||
static inline QDF_STATUS p2p_process_lo_stop(
|
||||
struct p2p_lo_stop_event *lo_stop_event)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
/**
|
||||
* p2p_process_noa() - Process noa event
|
||||
* @noa_event: noa event information
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2018 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
|
||||
@@ -34,6 +34,20 @@ struct p2p_lo_event;
|
||||
struct mgmt_rx_event_params;
|
||||
enum mgmt_frame_type;
|
||||
|
||||
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
||||
|
||||
/**
|
||||
* tgt_p2p_lo_event_cb() - Listen offload stop request
|
||||
* @psoc: soc object
|
||||
* @event_info: lo stop event buffer
|
||||
*
|
||||
* This function gets called from target interface.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_lo_event_cb(struct wlan_objmgr_psoc *psoc,
|
||||
struct p2p_lo_event *event_info);
|
||||
|
||||
/**
|
||||
* tgt_p2p_register_lo_ev_handler() - register lo event
|
||||
* @psoc: soc object
|
||||
@@ -45,17 +59,6 @@ enum mgmt_frame_type;
|
||||
QDF_STATUS tgt_p2p_register_lo_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* tgt_p2p_register_noa_ev_handler() - register noa event
|
||||
* @psoc: soc object
|
||||
*
|
||||
* p2p tgt api to register noa event handler.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_register_noa_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* tgt_p2p_unregister_lo_ev_handler() - unregister lo event
|
||||
* @psoc: soc object
|
||||
@@ -66,6 +69,30 @@ QDF_STATUS tgt_p2p_register_noa_ev_handler(
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_unregister_lo_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
#else
|
||||
static inline QDF_STATUS tgt_p2p_register_lo_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline QDF_STATUS tgt_p2p_unregister_lo_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* tgt_p2p_register_noa_ev_handler() - register noa event
|
||||
* @psoc: soc object
|
||||
*
|
||||
* p2p tgt api to register noa event handler.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_register_noa_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* tgt_p2p_unregister_noa_ev_handler() - unregister noa event
|
||||
@@ -151,16 +178,4 @@ QDF_STATUS tgt_p2p_mgmt_frame_rx_cb(struct wlan_objmgr_psoc *psoc,
|
||||
QDF_STATUS tgt_p2p_noa_event_cb(struct wlan_objmgr_psoc *psoc,
|
||||
struct p2p_noa_info *event_info);
|
||||
|
||||
/**
|
||||
* tgt_p2p_lo_event_cb() - Listen offload stop request
|
||||
* @psoc: soc object
|
||||
* @event_info: lo stop event buffer
|
||||
*
|
||||
* This function gets called from target interface.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_lo_event_cb(struct wlan_objmgr_psoc *psoc,
|
||||
struct p2p_lo_event *event_info);
|
||||
|
||||
#endif /* _WLAN_P2P_TGT_API_H_ */
|
||||
|
@@ -110,8 +110,10 @@ struct p2p_start_param {
|
||||
void *event_cb_data;
|
||||
p2p_action_tx_cnf_callback tx_cnf_cb;
|
||||
void *tx_cnf_cb_data;
|
||||
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
||||
p2p_lo_event_callback lo_event_cb;
|
||||
void *lo_event_cb_data;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -277,6 +279,7 @@ QDF_STATUS ucfg_p2p_mgmt_tx_cancel(struct wlan_objmgr_psoc *soc,
|
||||
QDF_STATUS ucfg_p2p_set_ps(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_ps_config *ps_config);
|
||||
|
||||
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
||||
/**
|
||||
* ucfg_p2p_lo_start() - Listen offload start request
|
||||
* @soc: soc context
|
||||
@@ -301,6 +304,7 @@ QDF_STATUS ucfg_p2p_lo_start(struct wlan_objmgr_psoc *soc,
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_lo_stop(struct wlan_objmgr_psoc *soc,
|
||||
uint32_t vdev_id);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* p2p_peer_authorized() - Process peer authorized event
|
||||
|
@@ -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,21 +59,6 @@ QDF_STATUS tgt_p2p_register_lo_ev_handler(
|
||||
return status;
|
||||
}
|
||||
|
||||
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->reg_noa_ev_handler) {
|
||||
status = p2p_ops->reg_noa_ev_handler(psoc, NULL);
|
||||
p2p_debug("register noa event, status:%d", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_p2p_unregister_lo_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
@@ -88,6 +74,69 @@ QDF_STATUS tgt_p2p_unregister_lo_ev_handler(
|
||||
return status;
|
||||
}
|
||||
|
||||
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->reg_noa_ev_handler) {
|
||||
status = p2p_ops->reg_noa_ev_handler(psoc, NULL);
|
||||
p2p_debug("register noa event, status:%d", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_p2p_unregister_noa_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
@@ -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;
|
||||
}
|
||||
|
@@ -463,6 +463,7 @@ QDF_STATUS ucfg_p2p_set_ps(struct wlan_objmgr_psoc *soc,
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
||||
QDF_STATUS ucfg_p2p_lo_start(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_lo_start *p2p_lo_start)
|
||||
{
|
||||
@@ -511,6 +512,7 @@ QDF_STATUS ucfg_p2p_lo_stop(struct wlan_objmgr_psoc *soc,
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS ucfg_p2p_set_noa(struct wlan_objmgr_psoc *soc,
|
||||
uint32_t vdev_id, bool disable_noa)
|
||||
|
Reference in New Issue
Block a user