diff --git a/htc/htc_api.h b/htc/htc_api.h index 8e64537f6116..0fcc2c9b213d 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 4e6e6e2b95ad..6a73480ba231 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; }