summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAgrawal Ashish <ashishka@qti.qualcomm.com>2015-08-12 18:39:11 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2015-08-17 15:44:19 +0530
commit7554e3e15efbe0eb0f35ae5e806aa351bb97cd81 (patch)
treed5020bb974a93f44f3c92580c633133970a6d723
parent9b551daa25dc2e058843bcd6ac5887bafa31c549 (diff)
qcacld-2.0: P2P is using wrong ROC work for de-queue handler.
wlan_hdd_roc_request_dequeue using rocReqWork from hdd_context_t but the work which is being passed is delayed roc_work from pAdapter. wlan_hdd_roc_request_enqueue will itself will be called in hdd_ctx only. There is no need for roc_work as rocReqWork already available from hdd_context_t. rocReqWork also will be used defer the back to back p2p_listen with delayed work. CRs-Fixed: 883248 Change-Id: I57d62ffc94bf884d7d715ce0ff52ce9926562742
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h5
-rw-r--r--CORE/HDD/inc/wlan_hdd_p2p.h2
-rw-r--r--CORE/HDD/src/wlan_hdd_assoc.c4
-rwxr-xr-xCORE/HDD/src/wlan_hdd_main.c36
-rw-r--r--CORE/HDD/src/wlan_hdd_p2p.c32
5 files changed, 8 insertions, 71 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index 63e37ce75287..ad34d899224b 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -1046,9 +1046,6 @@ struct hdd_adapter_s
/* Time stamp for last completed RoC request */
v_TIME_t lastRocTs;
- /* work queue to defer the back to back p2p_listen */
- struct delayed_work roc_work;
-
/* Time stamp for start RoC request */
v_TIME_t startRocTs;
@@ -1510,7 +1507,7 @@ struct hdd_context_s
v_U64_t wifi_turn_on_time_since_boot;
/* RoC request queue and work */
- struct work_struct rocReqWork;
+ struct delayed_work rocReqWork;
hdd_list_t hdd_roc_req_q;
bool mcc_mode;
unsigned long g_event_flags;
diff --git a/CORE/HDD/inc/wlan_hdd_p2p.h b/CORE/HDD/inc/wlan_hdd_p2p.h
index 7ceafa1facfd..7d9f01b7b716 100644
--- a/CORE/HDD/inc/wlan_hdd_p2p.h
+++ b/CORE/HDD/inc/wlan_hdd_p2p.h
@@ -193,6 +193,4 @@ void wlan_hdd_cleanup_remain_on_channel_ctx(hdd_adapter_t *pAdapter);
#define MAX_ROC_REQ_QUEUE_ENTRY 10
void wlan_hdd_roc_request_dequeue(struct work_struct *work);
-void hdd_p2p_roc_work_queue(struct work_struct *work);
-
#endif // __P2P_H
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index 14101a5335ce..f7c28ceddb70 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -126,7 +126,7 @@ hdd_connSetAuthenticated(hdd_adapter_t *pAdapter, v_U8_t authState)
pHddStaCtx->conn_info.uIsAuthenticated = authState;
/* Check is pending ROC request or not when auth state changed */
- schedule_work(&pHddCtx->rocReqWork);
+ schedule_delayed_work(&pHddCtx->rocReqWork, 0);
}
v_VOID_t hdd_connSetConnectionState( hdd_adapter_t *pAdapter,
@@ -141,7 +141,7 @@ v_VOID_t hdd_connSetConnectionState( hdd_adapter_t *pAdapter,
pHddStaCtx->conn_info.connState = connState;
/* Check is pending ROC request or not when connection state changed */
- schedule_work(&pHddCtx->rocReqWork);
+ schedule_delayed_work(&pHddCtx->rocReqWork, 0);
}
// returns FALSE if not connected.
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 5635c8963166..9395772b1aec 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -8623,20 +8623,6 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type,
//netif_tx_disable(pWlanDev);
netif_carrier_off(pAdapter->dev);
- if (WLAN_HDD_P2P_CLIENT == session_type ||
- WLAN_HDD_P2P_DEVICE == session_type) {
- /* Initialize the work queue to defer the
- * back to back RoC request */
-#ifdef CONFIG_CNSS
- cnss_init_delayed_work(&pAdapter->roc_work,
- hdd_p2p_roc_work_queue);
-#else
-#ifdef WLAN_OPEN_SOURCE
- INIT_DELAYED_WORK(&pAdapter->roc_work, hdd_p2p_roc_work_queue);
-#endif
-#endif
- }
-
#ifdef QCA_LL_TX_FLOW_CT
/* SAT mode default TX Flow control instance
* This instance will be used for
@@ -8689,18 +8675,6 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type,
netif_carrier_off(pAdapter->dev);
hdd_set_conparam( 1 );
- if (WLAN_HDD_P2P_GO == session_type) {
- /* Initialize the work queue to
- * defer the back to back RoC request */
-#ifdef CONFIG_CNSS
- cnss_init_delayed_work(&pAdapter->roc_work,
- hdd_p2p_roc_work_queue);
-#else
-#ifdef WLAN_OPEN_SOURCE
- INIT_DELAYED_WORK(&pAdapter->roc_work, hdd_p2p_roc_work_queue);
-#endif
-#endif
- }
break;
}
@@ -9204,9 +9178,6 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter,
}
if (pAdapter->device_mode != WLAN_HDD_INFRA_STATION) {
wlan_hdd_cleanup_remain_on_channel_ctx(pAdapter);
-#ifdef WLAN_OPEN_SOURCE
- cancel_delayed_work_sync(&pAdapter->roc_work);
-#endif
}
#ifdef WLAN_OPEN_SOURCE
@@ -9270,9 +9241,6 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter,
//Any softap specific cleanup here...
if (pAdapter->device_mode == WLAN_HDD_P2P_GO) {
wlan_hdd_cleanup_remain_on_channel_ctx(pAdapter);
-#ifdef WLAN_OPEN_SOURCE
- cancel_delayed_work_sync(&pAdapter->roc_work);
-#endif
}
hdd_set_sap_auth_offload(pAdapter, FALSE);
@@ -12354,9 +12322,9 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc)
/* Initialize the RoC Request queue and work. */
hdd_list_init((&pHddCtx->hdd_roc_req_q), MAX_ROC_REQ_QUEUE_ENTRY);
#ifdef CONFIG_CNSS
- cnss_init_work(&pHddCtx->rocReqWork, wlan_hdd_roc_request_dequeue);
+ cnss_init_delayed_work(&pHddCtx->rocReqWork, wlan_hdd_roc_request_dequeue);
#else
- INIT_WORK(&pHddCtx->rocReqWork, wlan_hdd_roc_request_dequeue);
+ INIT_DELAYED_WORK(&pHddCtx->rocReqWork, wlan_hdd_roc_request_dequeue);
#endif
wlan_hdd_dcc_register_for_dcc_stats_event(pHddCtx);
diff --git a/CORE/HDD/src/wlan_hdd_p2p.c b/CORE/HDD/src/wlan_hdd_p2p.c
index f31dd3d36e65..c15f5b9932f0 100644
--- a/CORE/HDD/src/wlan_hdd_p2p.c
+++ b/CORE/HDD/src/wlan_hdd_p2p.c
@@ -693,7 +693,7 @@ void wlan_hdd_roc_request_dequeue(struct work_struct *work)
int ret = 0;
hdd_roc_req_t *hdd_roc_req;
hdd_context_t *hdd_ctx =
- container_of(work, hdd_context_t, rocReqWork);
+ container_of(work, hdd_context_t, rocReqWork.work);
if (0 != (wlan_hdd_validate_context(hdd_ctx)))
return;
@@ -812,7 +812,7 @@ static int wlan_hdd_request_remain_on_channel( struct wiphy *wiphy,
pRemainChanCtx->duration = HDD_P2P_MAX_ROC_DURATION;
wlan_hdd_roc_request_enqueue(pAdapter, pRemainChanCtx);
- schedule_delayed_work(&pAdapter->roc_work,
+ schedule_delayed_work(&pHddCtx->rocReqWork,
msecs_to_jiffies(pHddCtx->cfg_ini->p2p_listen_defer_interval));
hddLog(LOG1, "Defer interval is %hu, pAdapter %p",
pHddCtx->cfg_ini->p2p_listen_defer_interval, pAdapter);
@@ -847,7 +847,7 @@ static int wlan_hdd_request_remain_on_channel( struct wiphy *wiphy,
* schedule the RoC work directly.
*/
if (isBusy == VOS_FALSE) {
- schedule_work(&pHddCtx->rocReqWork);
+ schedule_delayed_work(&pHddCtx->rocReqWork, 0);
}
return 0;
@@ -1787,32 +1787,6 @@ static void hdd_wlan_tx_complete( hdd_adapter_t* pAdapter,
netif_tx_start_all_queues( pAdapter->dev );
}
-/**
- * __hdd_p2p_roc_work_queue() - roc delayed work queue handler
- * @work: Pointer to work queue struct
- *
- * Return: none
- */
-static void __hdd_p2p_roc_work_queue(struct work_struct *work)
-{
- wlan_hdd_roc_request_dequeue(work);
-}
-
-/**
- * hdd_p2p_roc_work_queue() - roc delayed work queue handler
- * @work: Pointer to work queue struct
- *
- * Return: none
- */
-void hdd_p2p_roc_work_queue(struct work_struct *work)
-{
- vos_ssr_protect(__func__);
- __hdd_p2p_roc_work_queue(work);
- vos_ssr_unprotect(__func__);
-
- return;
-}
-
void hdd_sendActionCnf( hdd_adapter_t *pAdapter, tANI_BOOLEAN actionSendSuccess )
{
hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter );