summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDARAM SUDHA <dsudha@qti.qualcomm.com>2014-09-12 17:17:56 +0530
committerAnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com>2014-10-07 17:38:29 +0530
commit63a2343b06e36a754e5293b830d14d1bce97f692 (patch)
treec1f70247c64e8fd77c7a738108246e3bfb6d044e
parent27ba832a5d233266a127122dee19991272a08576 (diff)
Add timer_initialization check for tx_flow_control_timer
in hdd_adapter, tx_flow_timer_initialized flag is used to check if the timer is initialized. Now add the timer initialization check before doing timer operations on tx_flow_control_timer. CRs-Fixed: 723710 Change-Id: I0942ffb161be8085eea3c297e85049f14a89ea5a
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c56
-rwxr-xr-xCORE/HDD/src/wlan_hdd_main.c38
-rw-r--r--CORE/HDD/src/wlan_hdd_softap_tx_rx.c16
-rw-r--r--CORE/HDD/src/wlan_hdd_tx_rx.c16
4 files changed, 69 insertions, 57 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 790b023afa21..8d7cf4f727b8 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -6796,11 +6796,13 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
return -EINVAL;
#ifdef QCA_LL_TX_FLOW_CT
- vos_timer_init(&pAdapter->tx_flow_control_timer,
- VOS_TIMER_TYPE_SW,
- hdd_tx_resume_timer_expired_handler,
- pAdapter);
- pAdapter->tx_flow_timer_initialized = VOS_TRUE;
+ if (pAdapter->tx_flow_timer_initialized == VOS_FALSE) {
+ vos_timer_init(&pAdapter->tx_flow_control_timer,
+ VOS_TIMER_TYPE_SW,
+ hdd_tx_resume_timer_expired_handler,
+ pAdapter);
+ pAdapter->tx_flow_timer_initialized = VOS_TRUE;
+ }
WLANTL_RegisterTXFlowControl(pHddCtx->pvosContext,
hdd_tx_resume_cb,
pAdapter->sessionId,
@@ -6923,11 +6925,13 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
hdd_set_conparam(1);
#ifdef QCA_LL_TX_FLOW_CT
- vos_timer_init(&pAdapter->tx_flow_control_timer,
- VOS_TIMER_TYPE_SW,
- hdd_softap_tx_resume_timer_expired_handler,
- pAdapter);
- pAdapter->tx_flow_timer_initialized = VOS_TRUE;
+ if (pAdapter->tx_flow_timer_initialized == VOS_FALSE) {
+ vos_timer_init(&pAdapter->tx_flow_control_timer,
+ VOS_TIMER_TYPE_SW,
+ hdd_softap_tx_resume_timer_expired_handler,
+ pAdapter);
+ pAdapter->tx_flow_timer_initialized = VOS_TRUE;
+ }
WLANTL_RegisterTXFlowControl(pHddCtx->pvosContext,
hdd_softap_tx_resume_cb,
pAdapter->sessionId,
@@ -6962,15 +6966,17 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
#ifdef QCA_LL_TX_FLOW_CT
if ((NL80211_IFTYPE_P2P_CLIENT == type) ||
(NL80211_IFTYPE_STATION == type)) {
- vos_timer_init(&pAdapter->tx_flow_control_timer,
- VOS_TIMER_TYPE_SW,
- hdd_tx_resume_timer_expired_handler,
- pAdapter);
- pAdapter->tx_flow_timer_initialized = VOS_TRUE;
- WLANTL_RegisterTXFlowControl(pHddCtx->pvosContext,
- hdd_tx_resume_cb,
- pAdapter->sessionId,
- (void *)pAdapter);
+ if (pAdapter->tx_flow_timer_initialized == VOS_FALSE) {
+ vos_timer_init(&pAdapter->tx_flow_control_timer,
+ VOS_TIMER_TYPE_SW,
+ hdd_tx_resume_timer_expired_handler,
+ pAdapter);
+ pAdapter->tx_flow_timer_initialized = VOS_TRUE;
+ }
+ WLANTL_RegisterTXFlowControl(pHddCtx->pvosContext,
+ hdd_tx_resume_cb,
+ pAdapter->sessionId,
+ (void *)pAdapter);
}
#endif /* QCA_LL_TX_FLOW_CT */
@@ -6990,11 +6996,13 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
pAdapter->device_mode = (type == NL80211_IFTYPE_AP) ?
WLAN_HDD_SOFTAP : WLAN_HDD_P2P_GO;
#ifdef QCA_LL_TX_FLOW_CT
- vos_timer_init(&pAdapter->tx_flow_control_timer,
- VOS_TIMER_TYPE_SW,
- hdd_softap_tx_resume_timer_expired_handler,
- pAdapter);
- pAdapter->tx_flow_timer_initialized = VOS_TRUE;
+ if (pAdapter->tx_flow_timer_initialized == VOS_FALSE) {
+ vos_timer_init(&pAdapter->tx_flow_control_timer,
+ VOS_TIMER_TYPE_SW,
+ hdd_softap_tx_resume_timer_expired_handler,
+ pAdapter);
+ pAdapter->tx_flow_timer_initialized = VOS_TRUE;
+ }
WLANTL_RegisterTXFlowControl(pHddCtx->pvosContext,
hdd_softap_tx_resume_cb,
pAdapter->sessionId,
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 4dc3511a3048..36b0171142ff 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -8865,11 +8865,13 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type,
/* SAT mode default TX Flow control instance
* This instance will be used for
* STA mode, IBSS mode and TDLS mode */
- vos_timer_init(&pAdapter->tx_flow_control_timer,
- VOS_TIMER_TYPE_SW,
- hdd_tx_resume_timer_expired_handler,
- pAdapter);
- pAdapter->tx_flow_timer_initialized = VOS_TRUE;
+ if (pAdapter->tx_flow_timer_initialized == VOS_FALSE) {
+ vos_timer_init(&pAdapter->tx_flow_control_timer,
+ VOS_TIMER_TYPE_SW,
+ hdd_tx_resume_timer_expired_handler,
+ pAdapter);
+ pAdapter->tx_flow_timer_initialized = VOS_TRUE;
+ }
WLANTL_RegisterTXFlowControl(pHddCtx->pvosContext,
hdd_tx_resume_cb,
pAdapter->sessionId,
@@ -9404,13 +9406,14 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter,
#ifdef QCA_LL_TX_FLOW_CT
WLANTL_DeRegisterTXFlowControl(pHddCtx->pvosContext, pAdapter->sessionId);
- if(VOS_TIMER_STATE_STOPPED !=
- vos_timer_getCurrentState(&pAdapter->tx_flow_control_timer))
- {
- vos_timer_stop(&pAdapter->tx_flow_control_timer);
+ if (pAdapter->tx_flow_timer_initialized == VOS_TRUE) {
+ if(VOS_TIMER_STATE_STOPPED !=
+ vos_timer_getCurrentState(&pAdapter->tx_flow_control_timer)) {
+ vos_timer_stop(&pAdapter->tx_flow_control_timer);
+ }
+ vos_timer_destroy(&pAdapter->tx_flow_control_timer);
+ pAdapter->tx_flow_timer_initialized = VOS_FALSE;
}
- vos_timer_destroy(&pAdapter->tx_flow_control_timer);
- pAdapter->tx_flow_timer_initialized = VOS_FALSE;
#endif /* QCA_LL_TX_FLOW_CT */
#ifdef WLAN_NS_OFFLOAD
@@ -9456,13 +9459,14 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter,
#ifdef QCA_LL_TX_FLOW_CT
WLANTL_DeRegisterTXFlowControl(pHddCtx->pvosContext, pAdapter->sessionId);
- if(VOS_TIMER_STATE_STOPPED !=
- vos_timer_getCurrentState(&pAdapter->tx_flow_control_timer))
- {
- vos_timer_stop(&pAdapter->tx_flow_control_timer);
+ if (pAdapter->tx_flow_timer_initialized == VOS_TRUE) {
+ if(VOS_TIMER_STATE_STOPPED !=
+ vos_timer_getCurrentState(&pAdapter->tx_flow_control_timer)) {
+ vos_timer_stop(&pAdapter->tx_flow_control_timer);
+ }
+ vos_timer_destroy(&pAdapter->tx_flow_control_timer);
+ pAdapter->tx_flow_timer_initialized = VOS_FALSE;
}
- vos_timer_destroy(&pAdapter->tx_flow_control_timer);
- pAdapter->tx_flow_timer_initialized = VOS_FALSE;
#endif /* QCA_LL_TX_FLOW_CT */
mutex_lock(&pHddCtx->sap_lock);
diff --git a/CORE/HDD/src/wlan_hdd_softap_tx_rx.c b/CORE/HDD/src/wlan_hdd_softap_tx_rx.c
index e169f13ed78e..ba8cffe030ee 100644
--- a/CORE/HDD/src/wlan_hdd_softap_tx_rx.c
+++ b/CORE/HDD/src/wlan_hdd_softap_tx_rx.c
@@ -318,14 +318,14 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
#ifdef QCA_LL_TX_FLOW_CT
- if (VOS_FALSE == WLANTL_GetTxResource((WLAN_HDD_GET_CTX(pAdapter))->pvosContext,
- pAdapter->sessionId,
- pAdapter->tx_flow_low_watermark,
- pAdapter->tx_flow_high_watermark_offset))
- {
- if (VOS_TIMER_STATE_STOPPED ==
- vos_timer_getCurrentState(&pAdapter->tx_flow_control_timer))
- {
+ if (VOS_FALSE ==
+ WLANTL_GetTxResource((WLAN_HDD_GET_CTX(pAdapter))->pvosContext,
+ pAdapter->sessionId,
+ pAdapter->tx_flow_low_watermark,
+ pAdapter->tx_flow_high_watermark_offset)) {
+ if ((pAdapter->tx_flow_timer_initialized == TRUE) &&
+ (VOS_TIMER_STATE_STOPPED ==
+ vos_timer_getCurrentState(&pAdapter->tx_flow_control_timer))) {
netif_tx_stop_all_queues(dev);
vos_timer_start(&pAdapter->tx_flow_control_timer,
WLAN_SAP_HDD_TX_FLOW_CONTROL_OS_Q_BLOCK_TIME);
diff --git a/CORE/HDD/src/wlan_hdd_tx_rx.c b/CORE/HDD/src/wlan_hdd_tx_rx.c
index 6a4a535e9c65..c3092f4ff6de 100644
--- a/CORE/HDD/src/wlan_hdd_tx_rx.c
+++ b/CORE/HDD/src/wlan_hdd_tx_rx.c
@@ -758,15 +758,15 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
#ifdef QCA_LL_TX_FLOW_CT
- if (VOS_FALSE == WLANTL_GetTxResource((WLAN_HDD_GET_CTX(pAdapter))->pvosContext,
- pAdapter->sessionId,
- pAdapter->tx_flow_low_watermark,
- pAdapter->tx_flow_high_watermark_offset))
- {
+ if (VOS_FALSE ==
+ WLANTL_GetTxResource((WLAN_HDD_GET_CTX(pAdapter))->pvosContext,
+ pAdapter->sessionId,
+ pAdapter->tx_flow_low_watermark,
+ pAdapter->tx_flow_high_watermark_offset)) {
netif_tx_stop_all_queues(dev);
- if (VOS_TIMER_STATE_STOPPED ==
- vos_timer_getCurrentState(&pAdapter->tx_flow_control_timer))
- {
+ if ((pAdapter->tx_flow_timer_initialized == TRUE) &&
+ (VOS_TIMER_STATE_STOPPED ==
+ vos_timer_getCurrentState(&pAdapter->tx_flow_control_timer))) {
vos_timer_start(&pAdapter->tx_flow_control_timer,
WLAN_HDD_TX_FLOW_CONTROL_OS_Q_BLOCK_TIME);
}