qcacld-3.0: Fix compiler error on UP target
QCA_CONFIG_SMP defined to support some thread scheduling features on SMP target, while some variants defined only for SMP purpose are referred out of this MACRO, like is_ol_rx_thread_suspended, ol_rx_event_flag and ol_suspend_rx_event. Defines separate functions for SMP/UP target to avoid it. Change-Id: I01884644b7b77e55514cf00426609643386480e8 CRs-Fixed: 2344683
This commit is contained in:
parent
c725a06d80
commit
f5e8cc2dba
@ -301,6 +301,14 @@ void cds_free_ol_rx_pkt(p_cds_sched_context pSchedContext,
|
||||
-------------------------------------------------------------------------*/
|
||||
void cds_free_ol_rx_pkt_freeq(p_cds_sched_context pSchedContext);
|
||||
#else
|
||||
/**
|
||||
* cds_set_rx_thread_cpu_mask() - Rx_thread affinity from INI
|
||||
* @cpu_affinity_mask: CPU affinity bitmap
|
||||
*
|
||||
* Return:None
|
||||
*/
|
||||
static inline void cds_set_rx_thread_cpu_mask(uint8_t cpu_affinity_mask) {}
|
||||
|
||||
/**
|
||||
* cds_drop_rxpkt_by_staid() - api to drop pending rx packets for a sta
|
||||
* @pSchedContext: Pointer to the global CDS Sched Context
|
||||
|
@ -748,6 +748,19 @@ static int cds_ol_rx_thread(void *arg)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cds_resume_rx_thread(void)
|
||||
{
|
||||
p_cds_sched_context cds_sched_context;
|
||||
|
||||
cds_sched_context = get_cds_sched_ctxt();
|
||||
if (NULL == cds_sched_context) {
|
||||
cds_err("cds_sched_context is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
complete(&cds_sched_context->ol_resume_rx_event);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -1106,15 +1119,3 @@ int cds_get_gfp_flags(void)
|
||||
return flags;
|
||||
}
|
||||
|
||||
void cds_resume_rx_thread(void)
|
||||
{
|
||||
p_cds_sched_context cds_sched_context = NULL;
|
||||
|
||||
cds_sched_context = get_cds_sched_ctxt();
|
||||
if (NULL == cds_sched_context) {
|
||||
cds_err("cds_sched_context is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
complete(&cds_sched_context->ol_resume_rx_event);
|
||||
}
|
||||
|
@ -522,4 +522,33 @@ hdd_wlan_fake_apps_suspend(struct wiphy *wiphy, struct net_device *dev,
|
||||
}
|
||||
#endif /* WLAN_SUSPEND_RESUME_TEST */
|
||||
|
||||
#ifdef QCA_CONFIG_SMP
|
||||
/**
|
||||
* wlan_hdd_rx_thread_resume() - Resume RX thread
|
||||
* @hdd_ctx: HDD context
|
||||
*
|
||||
* Check if RX thread suspended, and resume if yes.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void wlan_hdd_rx_thread_resume(struct hdd_context *hdd_ctx);
|
||||
|
||||
/**
|
||||
* wlan_hdd_rx_thread_suspend() - Suspend RX thread
|
||||
* @hdd_ctx: HDD context
|
||||
*
|
||||
* To suspend RX thread
|
||||
*
|
||||
* Return: 0 for success
|
||||
*/
|
||||
int wlan_hdd_rx_thread_suspend(struct hdd_context *hdd_ctx);
|
||||
|
||||
#else
|
||||
static inline void wlan_hdd_rx_thread_resume(struct hdd_context *hdd_ctx) {}
|
||||
static inline int wlan_hdd_rx_thread_suspend(struct hdd_context *hdd_ctx)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __WLAN_HDD_POWER_H */
|
||||
|
@ -87,9 +87,6 @@
|
||||
#define HDD_SSR_BRING_UP_TIME 30000
|
||||
#endif
|
||||
|
||||
/* timeout in msec to wait for RX_THREAD to suspend */
|
||||
#define HDD_RXTHREAD_SUSPEND_TIMEOUT 200
|
||||
|
||||
/* Type declarations */
|
||||
|
||||
#ifdef FEATURE_WLAN_DIAG_SUPPORT
|
||||
@ -124,6 +121,47 @@ void hdd_wlan_offload_event(uint8_t type, uint8_t state)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef QCA_CONFIG_SMP
|
||||
|
||||
/* timeout in msec to wait for RX_THREAD to suspend */
|
||||
#define HDD_RXTHREAD_SUSPEND_TIMEOUT 200
|
||||
|
||||
void wlan_hdd_rx_thread_resume(struct hdd_context *hdd_ctx)
|
||||
{
|
||||
if (hdd_ctx->is_ol_rx_thread_suspended) {
|
||||
cds_resume_rx_thread();
|
||||
hdd_ctx->is_ol_rx_thread_suspended = false;
|
||||
}
|
||||
}
|
||||
|
||||
int wlan_hdd_rx_thread_suspend(struct hdd_context *hdd_ctx)
|
||||
{
|
||||
p_cds_sched_context cds_sched_context = get_cds_sched_ctxt();
|
||||
int rc;
|
||||
|
||||
if (!cds_sched_context)
|
||||
return 0;
|
||||
|
||||
/* Suspend tlshim rx thread */
|
||||
set_bit(RX_SUSPEND_EVENT, &cds_sched_context->ol_rx_event_flag);
|
||||
wake_up_interruptible(&cds_sched_context->ol_rx_wait_queue);
|
||||
rc = wait_for_completion_timeout(&cds_sched_context->
|
||||
ol_suspend_rx_event,
|
||||
msecs_to_jiffies
|
||||
(HDD_RXTHREAD_SUSPEND_TIMEOUT)
|
||||
);
|
||||
if (!rc) {
|
||||
clear_bit(RX_SUSPEND_EVENT,
|
||||
&cds_sched_context->ol_rx_event_flag);
|
||||
hdd_err("Failed to stop tl_shim rx thread");
|
||||
return -EINVAL;
|
||||
}
|
||||
hdd_ctx->is_ol_rx_thread_suspended = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* QCA_CONFIG_SMP */
|
||||
|
||||
/**
|
||||
* hdd_enable_gtk_offload() - enable GTK offload
|
||||
* @adapter: pointer to the adapter
|
||||
@ -1216,10 +1254,7 @@ QDF_STATUS hdd_wlan_shutdown(void)
|
||||
hdd_ctx->is_wiphy_suspended = false;
|
||||
}
|
||||
|
||||
if (hdd_ctx->is_ol_rx_thread_suspended) {
|
||||
cds_resume_rx_thread();
|
||||
hdd_ctx->is_ol_rx_thread_suspended = false;
|
||||
}
|
||||
wlan_hdd_rx_thread_resume(hdd_ctx);
|
||||
|
||||
/*
|
||||
* After SSR, FW clear its txrx stats. In host,
|
||||
@ -1543,7 +1578,6 @@ static int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
|
||||
struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
int exit_code;
|
||||
p_cds_sched_context cds_sched_context = get_cds_sched_ctxt();
|
||||
|
||||
hdd_enter();
|
||||
|
||||
@ -1588,10 +1622,8 @@ static int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
|
||||
}
|
||||
|
||||
/* Resume tlshim Rx thread */
|
||||
if (hdd_ctx->enable_rxthread && hdd_ctx->is_ol_rx_thread_suspended) {
|
||||
complete(&cds_sched_context->ol_resume_rx_event);
|
||||
hdd_ctx->is_ol_rx_thread_suspended = false;
|
||||
}
|
||||
if (hdd_ctx->enable_rxthread)
|
||||
wlan_hdd_rx_thread_resume(hdd_ctx);
|
||||
|
||||
if (hdd_ctx->enable_dp_rx_threads)
|
||||
dp_txrx_resume(cds_get_context(QDF_MODULE_ID_SOC));
|
||||
@ -1647,7 +1679,6 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
|
||||
struct cfg80211_wowlan *wow)
|
||||
{
|
||||
struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
|
||||
p_cds_sched_context cds_sched_context = get_cds_sched_ctxt();
|
||||
struct hdd_adapter *adapter;
|
||||
struct hdd_scan_info *scan_info;
|
||||
mac_handle_t mac_handle;
|
||||
@ -1765,21 +1796,8 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
|
||||
hdd_ctx->is_scheduler_suspended = true;
|
||||
|
||||
if (hdd_ctx->enable_rxthread) {
|
||||
/* Suspend tlshim rx thread */
|
||||
set_bit(RX_SUSPEND_EVENT, &cds_sched_context->ol_rx_event_flag);
|
||||
wake_up_interruptible(&cds_sched_context->ol_rx_wait_queue);
|
||||
rc = wait_for_completion_timeout(&cds_sched_context->
|
||||
ol_suspend_rx_event,
|
||||
msecs_to_jiffies
|
||||
(HDD_RXTHREAD_SUSPEND_TIMEOUT)
|
||||
);
|
||||
if (!rc) {
|
||||
clear_bit(RX_SUSPEND_EVENT,
|
||||
&cds_sched_context->ol_rx_event_flag);
|
||||
hdd_err("Failed to stop tl_shim rx thread");
|
||||
if (wlan_hdd_rx_thread_suspend(hdd_ctx))
|
||||
goto resume_ol_rx;
|
||||
}
|
||||
hdd_ctx->is_ol_rx_thread_suspended = true;
|
||||
}
|
||||
|
||||
if (hdd_ctx->enable_dp_rx_threads)
|
||||
@ -1806,10 +1824,7 @@ resume_dp_thread:
|
||||
|
||||
resume_ol_rx:
|
||||
/* Resume tlshim Rx thread */
|
||||
if (hdd_ctx->is_ol_rx_thread_suspended) {
|
||||
cds_resume_rx_thread();
|
||||
hdd_ctx->is_ol_rx_thread_suspended = false;
|
||||
}
|
||||
wlan_hdd_rx_thread_resume(hdd_ctx);
|
||||
scheduler_resume();
|
||||
hdd_ctx->is_scheduler_suspended = false;
|
||||
resume_tx:
|
||||
|
Loading…
Reference in New Issue
Block a user