From 514201712a9bb17304d1dab6df96e03312d902c9 Mon Sep 17 00:00:00 2001 From: Mukul Sharma Date: Mon, 6 Mar 2017 14:28:56 +0530 Subject: [PATCH] qcacmn: Add callback context for wake up / suspend ack callback's Currently, Host initial wake up, suspend ack callback do not register callback context with host-to-target communication layer. As now PMO is handling now these callback, objmgr psoc is required as callback context. Hence as part of the fix, Add supports for callback context for these API's. Change-Id: I83d513764792b800a8540cdbe847aad552df0ab1 CRs-Fixed: 2015229 --- htc/htc_api.h | 3 ++- htc/htc_recv.c | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/htc/htc_api.h b/htc/htc_api.h index 8e64537f61..0fcc2c9b21 100644 --- a/htc/htc_api.h +++ b/htc/htc_api.h @@ -57,7 +57,8 @@ typedef struct _HTC_INIT_INFO { void *pContext; /* context for target notifications */ void (*TargetFailure)(void *Instance, QDF_STATUS Status); void (*TargetSendSuspendComplete)(void *ctx, bool is_nack); - void (*target_initial_wakeup_cb)(void); + void (*target_initial_wakeup_cb)(void *cb_ctx); + void *target_psoc; } HTC_INIT_INFO; /* Struct for HTC layer packet stats*/ diff --git a/htc/htc_recv.c b/htc/htc_recv.c index 4e6e6e2b95..6a73480ba2 100644 --- a/htc/htc_recv.c +++ b/htc/htc_recv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -275,6 +275,7 @@ QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf, uint16_t payloadLen; uint32_t trailerlen = 0; uint8_t htc_ep_id; + HTC_INIT_INFO *info; #ifdef RX_SG_SUPPORT LOCK_HTC_RX(target); @@ -450,8 +451,10 @@ QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf, HTC_PACKET_QUEUE_DEPTH( &pEndpoint->TxQueue)); UNLOCK_HTC_CREDIT(target); - if (target->HTCInitInfo.target_initial_wakeup_cb) - target->HTCInitInfo.target_initial_wakeup_cb(); + info = &target->HTCInitInfo; + if (info && info->target_initial_wakeup_cb) + info->target_initial_wakeup_cb( + info->target_psoc); else AR_DEBUG_PRINTF(ATH_DEBUG_ANY, ("No initial wake up cb")); @@ -466,7 +469,7 @@ QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf, &pEndpoint->TxQueue)); UNLOCK_HTC_CREDIT(target); target->HTCInitInfo.TargetSendSuspendComplete( - target->HTCInitInfo.pContext, + target->HTCInitInfo.target_psoc, wow_nack); break; @@ -480,7 +483,7 @@ QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf, UNLOCK_HTC_CREDIT(target); target->HTCInitInfo.TargetSendSuspendComplete( - target->HTCInitInfo.pContext, + target->HTCInitInfo.target_psoc, wow_nack); break; }