diff options
| author | Service qcabuildsw <qcabuildsw@localhost> | 2016-07-21 15:30:50 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-07-21 15:30:50 -0700 |
| commit | b7ae7a0963743afba331c10319e7218a7e1ec974 (patch) | |
| tree | 3a96e65550df88c873b9a1b45109b1005b735a60 | |
| parent | 2f869155cf7a22a71d3ecffce92f30cff8c9d41c (diff) | |
| parent | 1969ec8bc94bc8967e38fd690c3e6325392c5496 (diff) | |
Merge "qcacld-3.0: change dfs_radar_found to atomic variable" into wlan-cld3.driver.lnx.1.1-dev
| -rw-r--r-- | core/hdd/inc/wlan_hdd_main.h | 9 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_hostapd.c | 27 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 7 |
3 files changed, 12 insertions, 31 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 7730006e6441..bc5dd3d002e9 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1323,7 +1323,7 @@ struct hdd_context_s { /* defining the firmware version */ uint32_t target_fw_version; - uint32_t dfs_radar_found; + qdf_atomic_t dfs_radar_found; /* defining the chip/rom version */ uint32_t target_hw_version; @@ -1415,12 +1415,7 @@ struct hdd_context_s { uint16_t hdd_txrx_hist_idx; struct hdd_tx_rx_histogram *hdd_txrx_hist; - /* - * Dfs lock used to syncronize on sap channel switch during - * radar found indication and application triggered channel - * switch. - */ - qdf_spinlock_t dfs_lock; + /* * place to store FTM capab of target. This allows changing of FTM capab * at runtime and intersecting it with target capab before updating. diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index c17461656c2f..bb0ab6110ee0 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -119,7 +119,7 @@ int hdd_sap_context_init(hdd_context_t *hdd_ctx) qdf_wake_lock_create(&hdd_ctx->sap_wake_lock, "qcom_sap_wakelock"); qdf_spinlock_create(&hdd_ctx->sap_update_info_lock); - qdf_spinlock_create(&hdd_ctx->dfs_lock); + qdf_atomic_init(&hdd_ctx->dfs_radar_found); return 0; } @@ -220,8 +220,6 @@ void hdd_sap_context_destroy(hdd_context_t *hdd_ctx) mutex_destroy(&hdd_ctx->sap_lock); qdf_wake_lock_destroy(&hdd_ctx->sap_wake_lock); - qdf_spinlock_destroy(&hdd_ctx->dfs_lock); - qdf_spinlock_destroy(&hdd_ctx->sap_update_info_lock); } @@ -986,9 +984,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, } } - qdf_spin_lock_bh(&pHddCtx->dfs_lock); - pHddCtx->dfs_radar_found = false; - qdf_spin_unlock_bh(&pHddCtx->dfs_lock); + qdf_atomic_set(&pHddCtx->dfs_radar_found, 0); wlansap_get_dfs_ignore_cac(pHddCtx->hHal, &ignoreCAC); @@ -1102,9 +1098,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, hdd_info("Sent CAC start to user space"); } - qdf_spin_lock_bh(&pHddCtx->dfs_lock); - pHddCtx->dfs_radar_found = false; - qdf_spin_unlock_bh(&pHddCtx->dfs_lock); + qdf_atomic_set(&pHddCtx->dfs_radar_found, 0); break; case eSAP_DFS_CAC_INTERRUPTED: /* @@ -1977,9 +1971,7 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel, } } - qdf_spin_lock_bh(&pHddCtx->dfs_lock); - if (pHddCtx->dfs_radar_found == true) { - qdf_spin_unlock_bh(&pHddCtx->dfs_lock); + if (qdf_atomic_read(&pHddCtx->dfs_radar_found)) { hdd_err("Channel switch in progress!!"); return -EBUSY; } @@ -1992,8 +1984,7 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel, * once the channel change is completed and SAP will * post eSAP_START_BSS_EVENT success event to HDD. */ - pHddCtx->dfs_radar_found = true; - qdf_spin_unlock_bh(&pHddCtx->dfs_lock); + qdf_atomic_set(&pHddCtx->dfs_radar_found, 1); /* * Post the Channel Change request to SAP. */ @@ -2016,9 +2007,7 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel, * radar found flag and also restart the netif * queues. */ - qdf_spin_lock_bh(&pHddCtx->dfs_lock); - pHddCtx->dfs_radar_found = false; - qdf_spin_unlock_bh(&pHddCtx->dfs_lock); + qdf_atomic_set(&pHddCtx->dfs_radar_found, 0); ret = -EINVAL; } @@ -2811,13 +2800,13 @@ static __iw_softap_setparam(struct net_device *dev, hdd_notice("Set QCASAP_SET_RADAR_CMD val %d", set_value); - if (!pHddCtx->dfs_radar_found && isDfsch) { + if (!qdf_atomic_read(&pHddCtx->dfs_radar_found) && isDfsch) { ret = wma_cli_set_command(pHostapdAdapter->sessionId, WMA_VDEV_DFS_CONTROL_CMDID, set_value, VDEV_CMD); } else { hdd_err("Ignore, radar_found: %d, dfs_channel: %d", - pHddCtx->dfs_radar_found, isDfsch); + qdf_atomic_read(&pHddCtx->dfs_radar_found), isDfsch); } break; } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 411982e2177f..efe11c71335d 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1425,18 +1425,15 @@ bool hdd_dfs_indicate_radar(void *context, void *param) return true; if (true == hdd_radar_event->dfs_radar_status) { - qdf_spin_lock_bh(&hdd_ctx->dfs_lock); - if (hdd_ctx->dfs_radar_found) { + if (qdf_atomic_read(&hdd_ctx->dfs_radar_found)) { /* * Application already triggered channel switch * on current channel, so return here. */ - qdf_spin_unlock_bh(&hdd_ctx->dfs_lock); return false; } - hdd_ctx->dfs_radar_found = true; - qdf_spin_unlock_bh(&hdd_ctx->dfs_lock); + qdf_atomic_set(&hdd_ctx->dfs_radar_found, 1); status = hdd_get_front_adapter(hdd_ctx, &adapterNode); while (NULL != adapterNode && QDF_STATUS_SUCCESS == status) { |
