|
@@ -141,7 +141,7 @@ QDF_STATUS ucfg_p2p_roc_req(struct wlan_objmgr_psoc *soc,
|
|
|
}
|
|
|
|
|
|
status = qdf_idr_alloc(&p2p_soc_obj->p2p_idr, roc_ctx, &id);
|
|
|
- if (status != QDF_STATUS_SUCCESS) {
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
qdf_mem_free(roc_ctx);
|
|
|
p2p_err("failed to alloc idr, status %d", status);
|
|
|
return status;
|
|
@@ -159,12 +159,18 @@ QDF_STATUS ucfg_p2p_roc_req(struct wlan_objmgr_psoc *soc,
|
|
|
msg.type = P2P_ROC_REQ;
|
|
|
msg.bodyptr = roc_ctx;
|
|
|
msg.callback = p2p_process_cmd;
|
|
|
- scheduler_post_message(QDF_MODULE_ID_HDD,
|
|
|
- QDF_MODULE_ID_P2P,
|
|
|
- QDF_MODULE_ID_OS_IF, &msg);
|
|
|
+ status = scheduler_post_message(QDF_MODULE_ID_HDD,
|
|
|
+ QDF_MODULE_ID_P2P,
|
|
|
+ QDF_MODULE_ID_OS_IF,
|
|
|
+ &msg);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
+ qdf_mem_free(roc_ctx);
|
|
|
+ qdf_idr_remove(&p2p_soc_obj->p2p_idr, id);
|
|
|
+ p2p_err("post msg fail:%d", status);
|
|
|
+ }
|
|
|
p2p_debug("cookie = 0x%llx", *cookie);
|
|
|
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
+ return status;
|
|
|
}
|
|
|
|
|
|
QDF_STATUS ucfg_p2p_roc_cancel_req(struct wlan_objmgr_psoc *soc,
|
|
@@ -174,6 +180,7 @@ QDF_STATUS ucfg_p2p_roc_cancel_req(struct wlan_objmgr_psoc *soc,
|
|
|
struct p2p_soc_priv_obj *p2p_soc_obj;
|
|
|
struct cancel_roc_context *cancel_roc;
|
|
|
void *roc_ctx = NULL;
|
|
|
+ QDF_STATUS status;
|
|
|
|
|
|
p2p_debug("soc:%pK, cookie:0x%llx", soc, cookie);
|
|
|
|
|
@@ -189,8 +196,9 @@ QDF_STATUS ucfg_p2p_roc_cancel_req(struct wlan_objmgr_psoc *soc,
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
|
- if (QDF_STATUS_SUCCESS != qdf_idr_find(&p2p_soc_obj->p2p_idr,
|
|
|
- cookie, &roc_ctx)) {
|
|
|
+ status = qdf_idr_find(&p2p_soc_obj->p2p_idr,
|
|
|
+ cookie, &roc_ctx);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
p2p_err("invalid id");
|
|
|
return QDF_STATUS_E_INVAL;
|
|
|
}
|
|
@@ -206,11 +214,17 @@ QDF_STATUS ucfg_p2p_roc_cancel_req(struct wlan_objmgr_psoc *soc,
|
|
|
msg.type = P2P_CANCEL_ROC_REQ;
|
|
|
msg.bodyptr = cancel_roc;
|
|
|
msg.callback = p2p_process_cmd;
|
|
|
- scheduler_post_message(QDF_MODULE_ID_HDD,
|
|
|
- QDF_MODULE_ID_P2P,
|
|
|
- QDF_MODULE_ID_OS_IF, &msg);
|
|
|
+ status = scheduler_post_message(QDF_MODULE_ID_HDD,
|
|
|
+ QDF_MODULE_ID_P2P,
|
|
|
+ QDF_MODULE_ID_OS_IF,
|
|
|
+ &msg);
|
|
|
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
+ qdf_mem_free(cancel_roc);
|
|
|
+ p2p_err("post msg fail:%d", status);
|
|
|
+ }
|
|
|
+
|
|
|
+ return status;
|
|
|
}
|
|
|
|
|
|
QDF_STATUS ucfg_p2p_cleanup_roc_by_vdev(struct wlan_objmgr_vdev *vdev)
|
|
@@ -342,7 +356,7 @@ QDF_STATUS ucfg_p2p_mgmt_tx(struct wlan_objmgr_psoc *soc,
|
|
|
else {
|
|
|
status = qdf_idr_alloc(&p2p_soc_obj->p2p_idr,
|
|
|
tx_action, &id);
|
|
|
- if (status != QDF_STATUS_SUCCESS) {
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
qdf_mem_free(tx_action);
|
|
|
p2p_err("failed to alloc idr, status :%d", status);
|
|
|
return status;
|
|
@@ -373,11 +387,20 @@ QDF_STATUS ucfg_p2p_mgmt_tx(struct wlan_objmgr_psoc *soc,
|
|
|
msg.type = P2P_MGMT_TX;
|
|
|
msg.bodyptr = tx_action;
|
|
|
msg.callback = p2p_process_cmd;
|
|
|
- scheduler_post_message(QDF_MODULE_ID_HDD,
|
|
|
- QDF_MODULE_ID_P2P,
|
|
|
- QDF_MODULE_ID_OS_IF, &msg);
|
|
|
+ msg.flush_callback = p2p_msg_flush_callback;
|
|
|
+ status = scheduler_post_message(QDF_MODULE_ID_HDD,
|
|
|
+ QDF_MODULE_ID_P2P,
|
|
|
+ QDF_MODULE_ID_OS_IF,
|
|
|
+ &msg);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
+ if (id)
|
|
|
+ qdf_idr_remove(&p2p_soc_obj->p2p_idr, id);
|
|
|
+ qdf_mem_free(tx_action->buf);
|
|
|
+ qdf_mem_free(tx_action);
|
|
|
+ p2p_err("post msg fail:%d", status);
|
|
|
+ }
|
|
|
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
+ return status;
|
|
|
}
|
|
|
|
|
|
QDF_STATUS ucfg_p2p_mgmt_tx_cancel(struct wlan_objmgr_psoc *soc,
|
|
@@ -387,6 +410,7 @@ QDF_STATUS ucfg_p2p_mgmt_tx_cancel(struct wlan_objmgr_psoc *soc,
|
|
|
struct p2p_soc_priv_obj *p2p_soc_obj;
|
|
|
struct cancel_roc_context *cancel_tx;
|
|
|
void *tx_ctx;
|
|
|
+ QDF_STATUS status;
|
|
|
|
|
|
p2p_debug("soc:%pK, cookie:0x%llx", soc, cookie);
|
|
|
|
|
@@ -402,8 +426,9 @@ QDF_STATUS ucfg_p2p_mgmt_tx_cancel(struct wlan_objmgr_psoc *soc,
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
|
- if (QDF_STATUS_SUCCESS != qdf_idr_find(&p2p_soc_obj->p2p_idr,
|
|
|
- (int32_t)cookie, &tx_ctx)) {
|
|
|
+ status = qdf_idr_find(&p2p_soc_obj->p2p_idr,
|
|
|
+ (int32_t)cookie, &tx_ctx);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
p2p_debug("invalid id");
|
|
|
return QDF_STATUS_E_INVAL;
|
|
|
}
|
|
@@ -420,11 +445,16 @@ QDF_STATUS ucfg_p2p_mgmt_tx_cancel(struct wlan_objmgr_psoc *soc,
|
|
|
msg.type = P2P_MGMT_TX_CANCEL;
|
|
|
msg.bodyptr = cancel_tx;
|
|
|
msg.callback = p2p_process_cmd;
|
|
|
- scheduler_post_message(QDF_MODULE_ID_HDD,
|
|
|
- QDF_MODULE_ID_P2P,
|
|
|
- QDF_MODULE_ID_OS_IF, &msg);
|
|
|
+ status = scheduler_post_message(QDF_MODULE_ID_HDD,
|
|
|
+ QDF_MODULE_ID_P2P,
|
|
|
+ QDF_MODULE_ID_OS_IF,
|
|
|
+ &msg);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
+ qdf_mem_free(cancel_tx);
|
|
|
+ p2p_err("post msg fail: %d", status);
|
|
|
+ }
|
|
|
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
+ return status;
|
|
|
}
|
|
|
|
|
|
bool ucfg_p2p_check_random_mac(struct wlan_objmgr_psoc *soc, uint32_t vdev_id,
|