qcacld-3.0: Cleanup mscanpending flag

cleanup mscanpending flag and replace it
with scan component API's to get the
status of pending scans.

Change-Id: I87c3d18f4da35800d1c2a323bdd5be88a71bccca
CRs-Fixed: 2136149
This commit is contained in:
Sandeep Puligilla 2017-10-29 14:58:53 -07:00 • committed by snandini
commit 5f86d9986b
5 changed files with 8 additions and 38 deletions

View file

@ -868,14 +868,12 @@ struct hdd_ap_ctx {
/**
* struct hdd_scan_info - Per-adapter scan information
* @mScanPending: is a scan pending on this adapter?
* @scan_add_ie: Additional IE for scan
* @default_scan_ies: Default scan IEs
* @default_scan_ies_len: Length of @default_scan_ies
* @scan_mode: Scan mode
*/
struct hdd_scan_info {
uint32_t mScanPending;
tSirAddie scan_add_ie;
uint8_t *default_scan_ies;
uint16_t default_scan_ies_len;

View file

@ -17665,7 +17665,6 @@ static int __wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy,
(sta_ctx->conn_info.connState == eConnectionState_Connecting)) {
eCsrRoamDisconnectReason reasonCode =
eCSR_DISCONNECT_REASON_UNSPECIFIED;
struct hdd_scan_info *scan_info;
switch (reason) {
case WLAN_REASON_MIC_FAILURE:
@ -17700,8 +17699,8 @@ static int __wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy,
reasonCode = eCSR_DISCONNECT_REASON_UNSPECIFIED;
break;
}
scan_info = &adapter->scan_info;
if (scan_info->mScanPending) {
if (ucfg_scan_get_vdev_status(adapter->hdd_vdev) !=
SCAN_NOT_IN_PROGRESS) {
hdd_debug("Disconnect is in progress, Aborting Scan");
wlan_abort_scan(hdd_ctx->hdd_pdev, INVAL_PDEV_ID,
adapter->session_id, INVALID_SCAN_ID, false);

View file

@ -1533,7 +1533,6 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
uint8_t we_custom_start_event[64];
char *startBssEvent;
struct hdd_context *hdd_ctx;
struct hdd_scan_info *scan_info = NULL;
struct iw_michaelmicfailure msg;
uint8_t ignoreCAC = 0;
struct hdd_config *cfg = NULL;
@ -2135,9 +2134,9 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
}
qdf_mem_free(sta_info);
}
scan_info = &adapter->scan_info;
/* Lets abort scan to ensure smooth authentication for client */
if ((scan_info != NULL) && scan_info->mScanPending) {
if (ucfg_scan_get_vdev_status(adapter->hdd_vdev) !=
SCAN_NOT_IN_PROGRESS) {
wlan_abort_scan(hdd_ctx->hdd_pdev, INVAL_PDEV_ID,
adapter->session_id, INVALID_SCAN_ID, false);
}
@ -8182,15 +8181,11 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
{
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
struct hdd_scan_info *scan_info = NULL;
struct hdd_adapter *staAdapter = NULL;
QDF_STATUS status = QDF_STATUS_E_FAILURE;
QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
tSirUpdateIE updateIE;
struct hdd_beacon_data *old;
int ret;
hdd_adapter_list_node_t *pAdapterNode = NULL;
hdd_adapter_list_node_t *pNext = NULL;
ENTER();
@ -8237,26 +8232,6 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
hdd_green_ap_stop_bss(hdd_ctx);
}
status = hdd_get_front_adapter(hdd_ctx, &pAdapterNode);
while (NULL != pAdapterNode && QDF_STATUS_SUCCESS == status) {
staAdapter = pAdapterNode->adapter;
if (QDF_STA_MODE == staAdapter->device_mode ||
(QDF_P2P_CLIENT_MODE == staAdapter->device_mode) ||
(QDF_P2P_GO_MODE == staAdapter->device_mode)) {
scan_info = &staAdapter->scan_info;
if (scan_info && scan_info->mScanPending) {
hdd_debug("Aborting pending scan for device mode:%d",
staAdapter->device_mode);
wlan_abort_scan(hdd_ctx->hdd_pdev, INVAL_PDEV_ID,
staAdapter->session_id, INVALID_SCAN_ID, true);
}
}
status = hdd_get_next_adapter(hdd_ctx, pAdapterNode, &pNext);
pAdapterNode = pNext;
}
cds_flush_work(&adapter->sap_stop_bss_work);
/*
* When ever stop ap adapter gets called, we need to check

View file

@ -544,7 +544,8 @@ static int __hdd_netdev_notifier_call(struct notifier_block *nb,
break;
case NETDEV_GOING_DOWN:
if (adapter->scan_info.mScanPending != false) {
if (ucfg_scan_get_vdev_status(adapter->hdd_vdev) !=
SCAN_NOT_IN_PROGRESS) {
wlan_abort_scan(hdd_ctx->hdd_pdev, INVAL_PDEV_ID,
adapter->session_id, INVALID_SCAN_ID, true);
} else {
@ -5172,8 +5173,6 @@ QDF_STATUS hdd_start_all_adapters(struct hdd_context *hdd_ctx)
hdd_wmm_init(adapter);
adapter->scan_info.mScanPending = false;
switch (adapter->device_mode) {
case QDF_STA_MODE:
case QDF_P2P_CLIENT_MODE:

View file

@ -562,7 +562,6 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
{
struct hdd_context *hdd_ctx = (struct hdd_context *) wiphy_priv(wiphy);
struct hdd_adapter *adapter = NULL;
struct hdd_scan_info *scan_info = NULL;
int ret;
uint8_t session_type;
@ -598,8 +597,8 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
adapter = hdd_get_adapter(hdd_ctx, QDF_STA_MODE);
if ((adapter != NULL) &&
!(wlan_hdd_validate_session_id(adapter->session_id))) {
scan_info = &adapter->scan_info;
if (scan_info->mScanPending) {
if (ucfg_scan_get_vdev_status(adapter->hdd_vdev) !=
SCAN_NOT_IN_PROGRESS) {
wlan_abort_scan(hdd_ctx->hdd_pdev, INVAL_PDEV_ID,
adapter->session_id, INVALID_SCAN_ID, false);
hdd_debug("Abort Scan while adding virtual interface");