summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/bmi/src/ol_fw.c16
-rw-r--r--core/cds/inc/cds_regdomain.h2
-rw-r--r--core/cds/src/cds_regdomain.c41
-rw-r--r--core/dp/htt/htt_rx.c2
-rw-r--r--core/dp/txrx/ol_tx_desc.c11
-rw-r--r--core/dp/txrx/ol_tx_queue.c11
-rw-r--r--core/dp/txrx/ol_txrx_flow_control.c7
-rw-r--r--core/hdd/inc/wlan_hdd_cfg.h4
-rw-r--r--core/hdd/inc/wlan_hdd_main.h2
-rw-r--r--core/hdd/src/wlan_hdd_cfg.c8
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c10
-rw-r--r--core/hdd/src/wlan_hdd_ioctl.c15
-rw-r--r--core/hdd/src/wlan_hdd_ipa.c41
-rw-r--r--core/hdd/src/wlan_hdd_main.c25
-rw-r--r--core/hdd/src/wlan_hdd_nan_datapath.c6
-rw-r--r--core/hdd/src/wlan_hdd_ocb.c6
-rw-r--r--core/hdd/src/wlan_hdd_tx_rx.c5
-rw-r--r--core/mac/inc/qwlan_version.h6
-rw-r--r--core/mac/inc/sir_mac_prot_def.h4
-rw-r--r--core/mac/src/cfg/cfgUtil/dot11f.frms1
-rw-r--r--core/mac/src/include/dot11f.h3
-rw-r--r--core/mac/src/pe/lim/lim_send_management_frames.c46
-rw-r--r--core/mac/src/pe/lim/lim_utils.h8
-rw-r--r--core/mac/src/sys/common/src/wlan_qct_sys.c3
-rw-r--r--core/mac/src/sys/legacy/src/utils/src/dot11f.c5
-rw-r--r--core/sap/src/sap_fsm.c1
-rw-r--r--core/sme/inc/sme_api.h12
-rw-r--r--core/sme/src/common/sme_api.c10
-rw-r--r--core/sme/src/csr/csr_api_roam.c103
-rw-r--r--core/sme/src/csr/csr_util.c30
-rw-r--r--core/sme/src/rrm/sme_rrm.c5
-rw-r--r--core/wma/src/wma_scan_roam.c2
32 files changed, 375 insertions, 76 deletions
diff --git a/core/bmi/src/ol_fw.c b/core/bmi/src/ol_fw.c
index 398b795c1bb7..2f8abdc9f947 100644
--- a/core/bmi/src/ol_fw.c
+++ b/core/bmi/src/ol_fw.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -367,18 +367,22 @@ __ol_transfer_bin_file(struct ol_context *ol_ctx, enum ATH_BIN_FILE file,
|| chip_id == AR6320_REV1_3_VERSION
|| chip_id == AR6320_REV2_1_VERSION)) {
+ bin_off = sizeof(SIGN_HEADER_T);
status = bmi_sign_stream_start(address,
(uint8_t *)fw_entry->data,
- sizeof(SIGN_HEADER_T), ol_ctx);
+ bin_off, ol_ctx);
if (status != EOK) {
BMI_ERR("unable to start sign stream");
status = -EINVAL;
goto end;
}
- bin_off = sizeof(SIGN_HEADER_T);
- bin_len = sign_header->rampatch_len
- - sizeof(SIGN_HEADER_T);
+ bin_len = sign_header->rampatch_len - bin_off;
+ if (bin_len <= 0 || bin_len > fw_entry_size - bin_off) {
+ BMI_ERR("Invalid sign header");
+ status = -EINVAL;
+ goto end;
+ }
} else {
bin_sign = false;
bin_off = 0;
@@ -409,7 +413,7 @@ __ol_transfer_bin_file(struct ol_context *ol_ctx, enum ATH_BIN_FILE file,
bin_off += bin_len;
bin_len = sign_header->total_len - sign_header->rampatch_len;
- if (bin_len > 0) {
+ if (bin_len > 0 && bin_len <= fw_entry_size - bin_off) {
status = bmi_sign_stream_start(0,
(uint8_t *)fw_entry->data +
bin_off, bin_len, ol_ctx);
diff --git a/core/cds/inc/cds_regdomain.h b/core/cds/inc/cds_regdomain.h
index 6f9a88989768..dc90727e9df0 100644
--- a/core/cds/inc/cds_regdomain.h
+++ b/core/cds/inc/cds_regdomain.h
@@ -560,6 +560,8 @@ void cds_set_wma_dfs_region(uint8_t dfs_region);
uint16_t cds_reg_dmn_get_opclass_from_channel(uint8_t *country,
uint8_t channel,
uint8_t offset);
+void cds_reg_dmn_get_channel_from_opclass(uint8_t *country,
+ uint8_t op_class);
uint16_t cds_reg_dmn_get_chanwidth_from_opclass(uint8_t *country,
uint8_t channel,
uint8_t opclass);
diff --git a/core/cds/src/cds_regdomain.c b/core/cds/src/cds_regdomain.c
index 21c61b563c0a..e6013f0563b5 100644
--- a/core/cds/src/cds_regdomain.c
+++ b/core/cds/src/cds_regdomain.c
@@ -916,6 +916,47 @@ uint16_t cds_reg_dmn_get_opclass_from_channel(uint8_t *country, uint8_t channel,
}
/**
+ * cds_reg_dmn_get_channel_from_opclass() - get channel from operating class
+ * @country: the country code
+ * @op_class: operating class
+ *
+ * Return: none
+ */
+void cds_reg_dmn_get_channel_from_opclass(uint8_t *country, uint8_t op_class)
+{
+ const struct reg_dmn_op_class_map_t *class = NULL;
+ uint16_t i = 0;
+
+ if (!qdf_mem_cmp(country, "US", 2)) {
+ class = us_op_class;
+ } else if (!qdf_mem_cmp(country, "EU", 2)) {
+ class = euro_op_class;
+ } else if (!qdf_mem_cmp(country, "JP", 2)) {
+ class = japan_op_class;
+ } else {
+ class = global_op_class;
+ }
+
+ while (class->op_class) {
+ if (class->op_class == op_class) {
+ for (i = 0;
+ (i < MAX_CHANNELS_PER_OPERATING_CLASS &&
+ class->channels[i]); i++) {
+ QDF_TRACE(QDF_MODULE_ID_QDF,
+ QDF_TRACE_LEVEL_ERROR,
+ "Valid channel(%d) in requested RC(%d)",
+ class->channels[i], op_class);
+ }
+ break;
+ }
+ class++;
+ }
+ if (!class->op_class)
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+ "Invalid requested RC (%d)", op_class);
+}
+
+/**
* cds_reg_dmn_set_curr_opclasses() - set the current operating class
* @num_classes: number of classes
* @class: operating class
diff --git a/core/dp/htt/htt_rx.c b/core/dp/htt/htt_rx.c
index 94b3e01e8e0b..afcb4107f8c3 100644
--- a/core/dp/htt/htt_rx.c
+++ b/core/dp/htt/htt_rx.c
@@ -798,7 +798,7 @@ void htt_rx_detach(struct htt_pdev_t *pdev)
memctx));
qdf_mem_free_consistent(pdev->osdev, pdev->osdev->dev,
- pdev->rx_ring.size * sizeof(qdf_dma_addr_t),
+ pdev->rx_ring.size * sizeof(target_paddr_t),
pdev->rx_ring.buf.paddrs_ring,
pdev->rx_ring.base_paddr,
qdf_get_dma_mem_context((&pdev->rx_ring.buf),
diff --git a/core/dp/txrx/ol_tx_desc.c b/core/dp/txrx/ol_tx_desc.c
index 0f94e7f27152..7b7bab9d20e6 100644
--- a/core/dp/txrx/ol_tx_desc.c
+++ b/core/dp/txrx/ol_tx_desc.c
@@ -738,9 +738,14 @@ void ol_tx_desc_frame_list_free(struct ol_txrx_pdev_t *pdev,
* DMA mapped address. In such case, there's no need for WLAN
* driver to DMA unmap the skb.
*/
- if ((qdf_nbuf_get_users(msdu) <= 1) &&
- !qdf_nbuf_ipa_owned_get(msdu))
- qdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_TO_DEVICE);
+ if (qdf_nbuf_get_users(msdu) <= 1) {
+ if (!qdf_nbuf_ipa_owned_get(msdu))
+ qdf_nbuf_unmap(pdev->osdev, msdu,
+ QDF_DMA_TO_DEVICE);
+ else if (qdf_mem_smmu_s1_enabled(pdev->osdev))
+ qdf_nbuf_unmap(pdev->osdev, msdu,
+ QDF_DMA_TO_DEVICE);
+ }
/* free the tx desc */
ol_tx_desc_free(pdev, tx_desc);
diff --git a/core/dp/txrx/ol_tx_queue.c b/core/dp/txrx/ol_tx_queue.c
index e35ab046a421..bc4825aba89a 100644
--- a/core/dp/txrx/ol_tx_queue.c
+++ b/core/dp/txrx/ol_tx_queue.c
@@ -1768,9 +1768,14 @@ void ol_txrx_vdev_flush(ol_txrx_vdev_handle vdev)
qdf_nbuf_next(vdev->ll_pause.txq.head);
qdf_nbuf_set_next(vdev->ll_pause.txq.head, NULL);
if (QDF_NBUF_CB_PADDR(vdev->ll_pause.txq.head)) {
- qdf_nbuf_unmap(vdev->pdev->osdev,
- vdev->ll_pause.txq.head,
- QDF_DMA_TO_DEVICE);
+ if (!qdf_nbuf_ipa_owned_get(vdev->ll_pause.txq.head))
+ qdf_nbuf_unmap(vdev->pdev->osdev,
+ vdev->ll_pause.txq.head,
+ QDF_DMA_TO_DEVICE);
+ else if (qdf_mem_smmu_s1_enabled(vdev->pdev->osdev))
+ qdf_nbuf_unmap(vdev->pdev->osdev,
+ vdev->ll_pause.txq.head,
+ QDF_DMA_TO_DEVICE);
}
qdf_nbuf_tx_free(vdev->ll_pause.txq.head,
QDF_NBUF_PKT_ERROR);
diff --git a/core/dp/txrx/ol_txrx_flow_control.c b/core/dp/txrx/ol_txrx_flow_control.c
index d2480040baa6..d1c39b6f6fcf 100644
--- a/core/dp/txrx/ol_txrx_flow_control.c
+++ b/core/dp/txrx/ol_txrx_flow_control.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -446,6 +446,11 @@ ol_tx_distribute_descs_to_deficient_pools(struct ol_tx_flow_pool_t *src_pool)
pdev->pause_cb(dst_pool->member_flow_id,
WLAN_WAKE_ALL_NETIF_QUEUE,
WLAN_DATA_FLOW_CONTROL);
+
+ pdev->pause_cb(dst_pool->member_flow_id,
+ WLAN_NETIF_PRIORITY_QUEUE_ON,
+ WLAN_DATA_FLOW_CONTROL_PRIORITY);
+
dst_pool->status =
FLOW_POOL_ACTIVE_UNPAUSED;
}
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 2c9eb8082c06..e24c68f29eda 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -11280,7 +11280,7 @@ enum restart_beaconing_on_ch_avoid_rule {
* gAutoBmpsTimerValue - Set Auto BMPS Timer value
* @Min: 0
* @Max: 120
- * @Default: 5
+ * @Default: 30
*
* This ini is used to set Auto BMPS Timer value in seconds
*
@@ -11295,7 +11295,7 @@ enum restart_beaconing_on_ch_avoid_rule {
#define CFG_AUTO_PS_ENABLE_TIMER_NAME "gAutoBmpsTimerValue"
#define CFG_AUTO_PS_ENABLE_TIMER_MIN (0)
#define CFG_AUTO_PS_ENABLE_TIMER_MAX (120)
-#define CFG_AUTO_PS_ENABLE_TIMER_DEFAULT (5)
+#define CFG_AUTO_PS_ENABLE_TIMER_DEFAULT (30)
#ifdef WLAN_ICMP_DISABLE_PS
/*
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index 8a31dc087341..3521a2889769 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -2713,7 +2713,7 @@ static inline void hdd_set_tso_flags(hdd_context_t *hdd_ctx,
* We want to enable TSO only if IP/UDP/TCP TX checksum flag is
* enabled.
*/
- hdd_info("TSO Enabled");
+ hdd_debug("TSO Enabled");
wlan_dev->features |=
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG;
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index 44b17dba80fd..5937c0480acb 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -7796,10 +7796,15 @@ QDF_STATUS hdd_update_mac_config(hdd_context_t *pHddCtx)
status = request_firmware(&fw, WLAN_MAC_FILE, pHddCtx->parent_dev);
if (status) {
- hdd_alert("request_firmware failed %d", status);
+ /*
+ * request_firmware "fails" if the file is not found, which is a
+ * valid setup for us, so log using debug instead of error
+ */
+ hdd_debug("request_firmware failed; status:%d", status);
qdf_status = QDF_STATUS_E_FAILURE;
return qdf_status;
}
+
if (!fw || !fw->data || !fw->size) {
hdd_alert("invalid firmware");
qdf_status = QDF_STATUS_E_INVAL;
@@ -7853,6 +7858,7 @@ QDF_STATUS hdd_update_mac_config(hdd_context_t *pHddCtx)
}
buffer = line;
}
+
if (i <= QDF_MAX_CONCURRENCY_PERSONA) {
hdd_debug("%d Mac addresses provided", i);
} else {
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index d0ad19e1f54d..26d16b9ffa81 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -15679,6 +15679,11 @@ static int __wlan_hdd_cfg80211_get_key(struct wiphy *wiphy,
return -EINVAL;
}
+ if (wlan_hdd_validate_session_id(pAdapter->sessionId)) {
+ hdd_err("Invalid session id: %d", pAdapter->sessionId);
+ return -EINVAL;
+ }
+
hdd_debug("Device_mode %s(%d)",
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode);
@@ -15690,6 +15695,11 @@ static int __wlan_hdd_cfg80211_get_key(struct wiphy *wiphy,
return -EINVAL;
}
+ if (pRoamProfile == NULL) {
+ hdd_err("Get roam profile failed!");
+ return -EINVAL;
+ }
+
switch (pRoamProfile->EncryptionType.encryptionType[0]) {
case eCSR_ENCRYPT_TYPE_NONE:
params.cipher = IW_AUTH_CIPHER_NONE;
diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c
index add22dc65888..aa988bd4b7a0 100644
--- a/core/hdd/src/wlan_hdd_ioctl.c
+++ b/core/hdd/src/wlan_hdd_ioctl.c
@@ -853,9 +853,20 @@ int hdd_reassoc(hdd_adapter_t *adapter, const uint8_t *bssid,
pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
- /* if not associated, no need to proceed with reassoc */
- if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) {
+ /*
+ * pHddStaCtx->conn_info.connState is set to disconnected only
+ * after the disconnect done indication from SME. If the SME is
+ * in the process of disconnecting, the SME Connection state is
+ * set to disconnected and the pHddStaCtx->conn_info.connState
+ * will still be associated till the disconnect is done.
+ * So check both the HDD state and SME state here.
+ * If not associated, no need to proceed with reassoc
+ */
+ if ((eConnectionState_Associated != pHddStaCtx->conn_info.connState) ||
+ (!sme_is_conn_state_connected(WLAN_HDD_GET_HAL_CTX(adapter),
+ adapter->sessionId))) {
hdd_warn("Not associated");
+ hdd_debug("HDD Con state %d", pHddStaCtx->conn_info.connState);
ret = -EINVAL;
goto exit;
}
diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c
index fa60b41cbea6..3c4cc3d9efee 100644
--- a/core/hdd/src/wlan_hdd_ipa.c
+++ b/core/hdd/src/wlan_hdd_ipa.c
@@ -5952,6 +5952,9 @@ static void hdd_ipa_send_pkt_to_tl(
hdd_adapter_t *adapter = NULL;
qdf_nbuf_t skb;
struct hdd_ipa_tx_desc *tx_desc;
+ qdf_device_t osdev;
+ qdf_dma_addr_t paddr;
+ QDF_STATUS status;
qdf_spin_lock_bh(&iface_context->interface_lock);
adapter = iface_context->adapter;
@@ -5979,6 +5982,15 @@ static void hdd_ipa_send_pkt_to_tl(
}
}
+ osdev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
+ if (!osdev) {
+ ipa_free_skb(ipa_tx_desc);
+ iface_context->stats.num_tx_drop++;
+ qdf_spin_unlock_bh(&iface_context->interface_lock);
+ hdd_ipa_wdi_rm_try_release(hdd_ipa);
+ return;
+ }
+
++adapter->stats.tx_packets;
qdf_spin_unlock_bh(&iface_context->interface_lock);
@@ -5989,15 +6001,34 @@ static void hdd_ipa_send_pkt_to_tl(
/* Store IPA Tx buffer ownership into SKB CB */
qdf_nbuf_ipa_owned_set(skb);
+
+ if (hdd_ipa_wdi_is_smmu_enabled(hdd_ipa, osdev)) {
+ status = qdf_nbuf_map(osdev, skb, QDF_DMA_TO_DEVICE);
+ if (QDF_IS_STATUS_SUCCESS(status)) {
+ paddr = qdf_nbuf_get_frag_paddr(skb, 0);
+ } else {
+ ipa_free_skb(ipa_tx_desc);
+ qdf_spin_lock_bh(&iface_context->interface_lock);
+ iface_context->stats.num_tx_drop++;
+ qdf_spin_unlock_bh(&iface_context->interface_lock);
+ hdd_ipa_wdi_rm_try_release(hdd_ipa);
+ return;
+ }
+ } else {
+ paddr = ipa_tx_desc->dma_addr;
+ }
+
if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx)) {
qdf_nbuf_mapped_paddr_set(skb,
- ipa_tx_desc->dma_addr
- + HDD_IPA_WLAN_FRAG_HEADER
- + HDD_IPA_WLAN_IPA_HEADER);
+ paddr +
+ HDD_IPA_WLAN_FRAG_HEADER +
+ HDD_IPA_WLAN_IPA_HEADER);
+
ipa_tx_desc->skb->len -=
HDD_IPA_WLAN_FRAG_HEADER + HDD_IPA_WLAN_IPA_HEADER;
- } else
- qdf_nbuf_mapped_paddr_set(skb, ipa_tx_desc->dma_addr);
+ } else {
+ qdf_nbuf_mapped_paddr_set(skb, paddr);
+ }
qdf_spin_lock_bh(&hdd_ipa->q_lock);
/* get free Tx desc and assign ipa_tx_desc pointer */
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 9d6ffcb6a6cb..c43b19b1c03c 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -1115,8 +1115,8 @@ static void hdd_update_wiphy_vhtcap(hdd_context_t *hdd_ctx)
band_5g->vht_cap.cap |=
(val << IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT);
- hdd_info("Updated wiphy vhtcap:0x%x, CSNAntSupp:%d, NumSoundDim:%d",
- band_5g->vht_cap.cap, hdd_ctx->config->txBFCsnValue, val);
+ hdd_debug("Updated wiphy vhtcap:0x%x, CSNAntSupp:%d, NumSoundDim:%d",
+ band_5g->vht_cap.cap, hdd_ctx->config->txBFCsnValue, val);
}
/**
@@ -4411,7 +4411,7 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type,
* STA
*/
WLAN_HDD_RESET_LOCALLY_ADMINISTERED_BIT(macAddr);
- hdd_info("locally administered bit reset in sta mode: "
+ hdd_debug("locally administered bit reset in sta mode: "
MAC_ADDRESS_STR, MAC_ADDR_ARRAY(macAddr));
}
/* fall through */
@@ -9792,10 +9792,8 @@ static int hdd_platform_wlan_mac(hdd_context_t *hdd_ctx)
addr = hdd_get_platform_wlan_mac_buff(dev, &no_of_mac_addr);
- if (no_of_mac_addr == 0 || !addr) {
- hdd_err("Platform Driver doesn't have provisioned mac addr");
+ if (no_of_mac_addr == 0 || !addr)
return -EINVAL;
- }
hdd_free_mac_address_lists(hdd_ctx);
@@ -9894,19 +9892,22 @@ static int hdd_initialize_mac_address(hdd_context_t *hdd_ctx)
bool update_mac_addr_to_fw = true;
ret = hdd_platform_wlan_mac(hdd_ctx);
- if (hdd_ctx->config->mac_provision || !ret)
+ if (hdd_ctx->config->mac_provision || !ret) {
+ hdd_info("using MAC address from platform driver");
return ret;
+ }
hdd_info("MAC is not programmed in platform driver ret: %d, use wlan_mac.bin",
ret);
status = hdd_update_mac_config(hdd_ctx);
- if (QDF_IS_STATUS_SUCCESS(status))
+ if (QDF_IS_STATUS_SUCCESS(status)) {
+ hdd_info("using MAC address from wlan_mac.bin");
return 0;
+ }
- hdd_info("MAC is not programmed in wlan_mac.bin ret %d, use default MAC",
- status);
+ hdd_info("using default MAC address");
/* Use fw provided MAC */
if (!qdf_is_macaddr_zero(&hdd_ctx->hw_macaddr)) {
@@ -9927,10 +9928,8 @@ static int hdd_initialize_mac_address(hdd_context_t *hdd_ctx)
if (update_mac_addr_to_fw) {
ret = hdd_update_mac_addr_to_fw(hdd_ctx);
- if (ret != 0) {
+ if (ret)
hdd_err("MAC address out-of-sync, ret:%d", ret);
- QDF_ASSERT(ret);
- }
}
return 0;
}
diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c
index a2033660dfb3..0356e9c2895e 100644
--- a/core/hdd/src/wlan_hdd_nan_datapath.c
+++ b/core/hdd/src/wlan_hdd_nan_datapath.c
@@ -103,7 +103,11 @@ void hdd_nan_datapath_target_config(hdd_context_t *hdd_ctx,
hdd_ctx->nan_datapath_enabled =
hdd_ctx->config->enable_nan_datapath &&
cfg->nan_datapath_enabled;
- hdd_info("enable_nan_datapath: %d", hdd_ctx->nan_datapath_enabled);
+
+ hdd_debug("final: %d, host: %d, fw: %d",
+ hdd_ctx->nan_datapath_enabled,
+ hdd_ctx->config->enable_nan_datapath,
+ cfg->nan_datapath_enabled);
}
/**
diff --git a/core/hdd/src/wlan_hdd_ocb.c b/core/hdd/src/wlan_hdd_ocb.c
index 847762fe3abb..9ca0327927c2 100644
--- a/core/hdd/src/wlan_hdd_ocb.c
+++ b/core/hdd/src/wlan_hdd_ocb.c
@@ -1647,6 +1647,12 @@ static int __wlan_hdd_cfg80211_dcc_get_stats(struct wiphy *wiphy,
request_array = nla_data(
tb[QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_REQUEST_ARRAY]);
+ /* Check channel count. Per 11p spec, max 2 channels allowed */
+ if (!channel_count || channel_count > TGT_NUM_OCB_CHANNELS) {
+ hdd_err("Invalid channel_count %d", channel_count);
+ return -EINVAL;
+ }
+
hdd_request = hdd_request_alloc(&params);
if (!hdd_request) {
hdd_err("Request allocation failure");
diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c
index 1367eca44ffb..b99ee753da58 100644
--- a/core/hdd/src/wlan_hdd_tx_rx.c
+++ b/core/hdd/src/wlan_hdd_tx_rx.c
@@ -2054,6 +2054,7 @@ const char *hdd_reason_type_to_string(enum netif_reason_type reason)
CASE_RETURN_STRING(WLAN_VDEV_STOP);
CASE_RETURN_STRING(WLAN_PEER_UNAUTHORISED);
CASE_RETURN_STRING(WLAN_THERMAL_MITIGATION);
+ CASE_RETURN_STRING(WLAN_DATA_FLOW_CONTROL_PRIORITY);
default:
return "Invalid";
}
@@ -2079,6 +2080,8 @@ const char *hdd_action_type_to_string(enum netif_action_type action)
CASE_RETURN_STRING(WLAN_START_ALL_NETIF_QUEUE_N_CARRIER);
CASE_RETURN_STRING(WLAN_NETIF_CARRIER_ON);
CASE_RETURN_STRING(WLAN_NETIF_CARRIER_OFF);
+ CASE_RETURN_STRING(WLAN_NETIF_PRIORITY_QUEUE_ON);
+ CASE_RETURN_STRING(WLAN_NETIF_PRIORITY_QUEUE_OFF);
default:
return "Invalid";
}
@@ -2096,11 +2099,13 @@ static void wlan_hdd_update_queue_oper_stats(hdd_adapter_t *adapter,
switch (action) {
case WLAN_STOP_ALL_NETIF_QUEUE:
case WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER:
+ case WLAN_NETIF_PRIORITY_QUEUE_OFF:
adapter->queue_oper_stats[reason].pause_count++;
break;
case WLAN_START_ALL_NETIF_QUEUE:
case WLAN_WAKE_ALL_NETIF_QUEUE:
case WLAN_START_ALL_NETIF_QUEUE_N_CARRIER:
+ case WLAN_NETIF_PRIORITY_QUEUE_ON:
adapter->queue_oper_stats[reason].unpause_count++;
break;
default:
diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h
index 0d7a0678303c..07ebe9b65457 100644
--- a/core/mac/inc/qwlan_version.h
+++ b/core/mac/inc/qwlan_version.h
@@ -32,9 +32,9 @@
#define QWLAN_VERSION_MAJOR 5
#define QWLAN_VERSION_MINOR 1
#define QWLAN_VERSION_PATCH 1
-#define QWLAN_VERSION_EXTRA "W"
-#define QWLAN_VERSION_BUILD 65
+#define QWLAN_VERSION_EXTRA "M"
+#define QWLAN_VERSION_BUILD 66
-#define QWLAN_VERSIONSTR "5.1.1.65W"
+#define QWLAN_VERSIONSTR "5.1.1.66M"
#endif /* QWLAN_VERSION_H */
diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h
index 9096b361dabd..18e064e104db 100644
--- a/core/mac/inc/sir_mac_prot_def.h
+++ b/core/mac/inc/sir_mac_prot_def.h
@@ -462,6 +462,10 @@
#define SIR_MAC_QCN_OUI_TYPE "\x8c\xfd\xf0\x01"
#define SIR_MAC_QCN_OUI_TYPE_SIZE 4
+/* MBO OUI definitions */
+#define SIR_MAC_MBO_OUI "\x50\x6f\x9a\x16"
+#define SIR_MAC_MBO_OUI_SIZE 4
+
/* min size of wme oui header: oui(3) + type + subtype + version */
#define SIR_MAC_OUI_WME_HDR_MIN 6
diff --git a/core/mac/src/cfg/cfgUtil/dot11f.frms b/core/mac/src/cfg/cfgUtil/dot11f.frms
index d6c59ef1f9c0..eeee2b051c5c 100644
--- a/core/mac/src/cfg/cfgUtil/dot11f.frms
+++ b/core/mac/src/cfg/cfgUtil/dot11f.frms
@@ -3399,7 +3399,6 @@ FRAME AssocRequest // 7.2.3.4
OPTIE WFDIEOpaque;
OPTIE vendor_vht_ie;
OPTIE hs20vendor_ie;
- OPTIE MBO_IE;
OPTIE QCN_IE;
OPTIE osen_ie;
} // End frame AssocRequest.
diff --git a/core/mac/src/include/dot11f.h b/core/mac/src/include/dot11f.h
index ec18de2565ac..2be3a3883eee 100644
--- a/core/mac/src/include/dot11f.h
+++ b/core/mac/src/include/dot11f.h
@@ -26,7 +26,7 @@
*
*
* This file was automatically generated by 'framesc'
- * Mon Aug 27 19:26:46 2018 from the following file(s):
+ * Tue Sep 18 11:47:29 2018 from the following file(s):
*
* dot11f.frms
*
@@ -9007,7 +9007,6 @@ typedef struct sDot11fAssocRequest{
tDot11fIEWFDIEOpaque WFDIEOpaque;
tDot11fIEvendor_vht_ie vendor_vht_ie;
tDot11fIEhs20vendor_ie hs20vendor_ie;
- tDot11fIEMBO_IE MBO_IE;
tDot11fIEQCN_IE QCN_IE;
tDot11fIEosen_ie osen_ie;
} tDot11fAssocRequest;
diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c
index abfaeb83ee09..6b511869818e 100644
--- a/core/mac/src/pe/lim/lim_send_management_frames.c
+++ b/core/mac/src/pe/lim/lim_send_management_frames.c
@@ -1630,6 +1630,8 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
uint32_t bcn_ie_len = 0;
uint32_t aes_block_size_len = 0;
enum rateid min_rid = RATEID_DEFAULT;
+ uint8_t *mbo_ie = NULL;
+ uint8_t mbo_ie_len = 0;
if (NULL == pe_session) {
pe_err("pe_session is NULL");
@@ -1914,6 +1916,37 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
}
/*
+ * MBO IE needs to be appendded at the end of the assoc request
+ * frame and is not parsed and unpacked by the frame parser
+ * as the supplicant can send multiple TLVs with same Attribute
+ * in the MBO IE and the frame parser does not support multiple
+ * TLVs with same attribute in a single IE.
+ * Strip off the MBO IE from add_ie and append it at the end.
+ */
+ if (cfg_get_vendor_ie_ptr_from_oui(mac_ctx, SIR_MAC_MBO_OUI,
+ SIR_MAC_MBO_OUI_SIZE, add_ie, add_ie_len)) {
+ mbo_ie = qdf_mem_malloc(DOT11F_IE_MBO_IE_MAX_LEN + 2);
+ if (!mbo_ie) {
+ pe_err("Failed to allocate mbo_ie");
+ goto end;
+ }
+
+ sir_status = lim_strip_ie(mac_ctx, add_ie, &add_ie_len,
+ SIR_MAC_EID_VENDOR, ONE_BYTE,
+ SIR_MAC_MBO_OUI,
+ SIR_MAC_MBO_OUI_SIZE,
+ mbo_ie, DOT11F_IE_MBO_IE_MAX_LEN);
+ if (sir_status != eSIR_SUCCESS) {
+ pe_err("Failed to strip MBO IE");
+ goto free_mbo_ie;
+ }
+
+ /* Include the EID and length fields */
+ mbo_ie_len = mbo_ie[1] + 2;
+ pe_debug("Stripped MBO IE of length %d", mbo_ie_len);
+ }
+
+ /*
* Do unpack to populate the add_ie buffer to frm structure
* before packing the frm structure. In this way, the IE ordering
* which the latest 802.11 spec mandates is maintained.
@@ -1939,7 +1972,7 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
}
bytes = payload + sizeof(tSirMacMgmtHdr) +
- aes_block_size_len;
+ aes_block_size_len + mbo_ie_len;
qdf_status = cds_packet_alloc((uint16_t) bytes, (void **)&frame,
(void **)&packet);
@@ -1979,6 +2012,11 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
pe_warn("Assoc request pack warning (0x%08x)", status);
}
+ /* Copy the MBO IE to the end of the frame */
+ qdf_mem_copy(frame + sizeof(tSirMacMgmtHdr) + payload,
+ mbo_ie, mbo_ie_len);
+ payload = payload + mbo_ie_len;
+
if (pe_session->assocReq != NULL) {
qdf_mem_free(pe_session->assocReq);
pe_session->assocReq = NULL;
@@ -2051,6 +2089,10 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
goto end;
}
+free_mbo_ie:
+ if (mbo_ie)
+ qdf_mem_free(mbo_ie);
+
end:
/* Free up buffer allocated for mlm_assoc_req */
qdf_mem_free(mlm_assoc_req);
@@ -3556,6 +3598,8 @@ lim_send_extended_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
(uint8_t *) session_entry->bssId,
sizeof(tSirMacAddr));
+ lim_set_protected_bit(mac_ctx, session_entry, peer, mac_hdr);
+
status = dot11f_pack_ext_channel_switch_action_frame(mac_ctx, &frm,
frame + sizeof(tSirMacMgmtHdr), n_payload, &n_payload);
if (DOT11F_FAILED(status)) {
diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h
index ae8b389ec259..2a6b5a633850 100644
--- a/core/mac/src/pe/lim/lim_utils.h
+++ b/core/mac/src/pe/lim/lim_utils.h
@@ -609,14 +609,14 @@ bool lim_check_disassoc_deauth_ack_pending(tpAniSirGlobal pMac,
#ifdef WLAN_FEATURE_11W
void lim_pmf_sa_query_timer_handler(void *pMacGlobal, uint32_t param);
-#endif
-
void lim_set_protected_bit(tpAniSirGlobal pMac,
tpPESession psessionEntry,
tSirMacAddr peer, tpSirMacMgmtHdr pMacHdr);
-
-#ifdef WLAN_FEATURE_11W
void lim_pmf_comeback_timer_callback(void *context);
+#else
+static inline void lim_set_protected_bit(tpAniSirGlobal pMac,
+ tpPESession psessionEntry,
+ tSirMacAddr peer, tpSirMacMgmtHdr pMacHdr) {}
#endif /* WLAN_FEATURE_11W */
void lim_set_ht_caps(tpAniSirGlobal p_mac,
diff --git a/core/mac/src/sys/common/src/wlan_qct_sys.c b/core/mac/src/sys/common/src/wlan_qct_sys.c
index d870adc7b0cd..c0d762007cda 100644
--- a/core/mac/src/sys/common/src/wlan_qct_sys.c
+++ b/core/mac/src/sys/common/src/wlan_qct_sys.c
@@ -111,8 +111,7 @@ QDF_STATUS umac_stop(v_CONTEXT_t p_cds_context)
if (!QDF_IS_STATUS_SUCCESS(qdf_status))
qdf_status = QDF_STATUS_E_BADMSG;
- qdf_status = qdf_wait_for_event_completion(&g_stop_evt,
- SYS_STOP_TIMEOUT);
+ qdf_status = qdf_wait_single_event(&g_stop_evt, SYS_STOP_TIMEOUT);
QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
qdf_status = qdf_event_destroy(&g_stop_evt);
diff --git a/core/mac/src/sys/legacy/src/utils/src/dot11f.c b/core/mac/src/sys/legacy/src/utils/src/dot11f.c
index 1131a6d99fda..65d29ae9a82d 100644
--- a/core/mac/src/sys/legacy/src/utils/src/dot11f.c
+++ b/core/mac/src/sys/legacy/src/utils/src/dot11f.c
@@ -24,7 +24,7 @@
*
*
* This file was automatically generated by 'framesc'
- * Mon Aug 27 19:26:46 2018 from the following file(s):
+ * Tue Sep 18 11:47:29 2018 from the following file(s):
*
* dot11f.frms
*
@@ -9013,9 +9013,6 @@ static const tIEDefn IES_AssocRequest[] = {
offsetof(tDot11fIEhs20vendor_ie, present), 0, "hs20vendor_ie",
0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 16, 0},
4, DOT11F_EID_HS20VENDOR_IE, 0, 0, },
- { offsetof(tDot11fAssocRequest, MBO_IE), offsetof(tDot11fIEMBO_IE,
- present), 0, "MBO_IE", 0, 6, 295, SigIeMBO_IE, {80, 111, 154, 22, 0},
- 4, DOT11F_EID_MBO_IE, 0, 0, },
{ offsetof(tDot11fAssocRequest, QCN_IE), offsetof(tDot11fIEQCN_IE,
present), 0, "QCN_IE", 0, 10, 10, SigIeQCN_IE, {140, 253, 240, 1, 0},
4, DOT11F_EID_QCN_IE, 0, 0, },
diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c
index aca25fd7a45d..aa8e5c6e4145 100644
--- a/core/sap/src/sap_fsm.c
+++ b/core/sap/src/sap_fsm.c
@@ -3991,6 +3991,7 @@ static QDF_STATUS sap_fsm_state_dfs_cac_wait(ptSapContext sap_ctx,
continue;
/* SAP to be moved to DISCONNECTING state */
t_sap_ctx->sapsMachine = eSAP_DISCONNECTING;
+ t_sap_ctx->is_chan_change_inprogress = true;
/*
* eSAP_DFS_CHANNEL_CAC_RADAR_FOUND:
* A Radar is found on current DFS Channel
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index d2a2a416c19d..9a290b772295 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.h
@@ -2213,6 +2213,18 @@ QDF_STATUS sme_send_limit_off_channel_params(tHalHandle hal, uint8_t vdev_id,
uint32_t rest_time, bool skip_dfs_chan);
/**
+ * sme_is_conn_state_connected() -- check if SME connection state is connected
+ * @hal: global hal handle
+ * @session_id: current Session Id
+ *
+ * This API checks if the current SME connection state is connected for the
+ * given session id.
+ *
+ * Return: True if connected, false if any other state.
+ */
+bool sme_is_conn_state_connected(tHalHandle hal, uint8_t session_id);
+
+/**
* sme_fast_reassoc() - invokes FAST REASSOC command
* @hal: handle returned by mac_open
* @profile: current connected profile
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index 0f5b31260983..265de1e717df 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -19293,6 +19293,15 @@ sme_get_roam_scan_stats(tHalHandle hal, roam_scan_stats_cb cb, void *context,
return status;
}
+bool sme_is_conn_state_connected(tHalHandle hal, uint8_t session_id)
+{
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+
+ return csr_is_conn_state_connected(mac_ctx, session_id);
+}
+
+
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
QDF_STATUS sme_fast_reassoc(tHalHandle hal, tCsrRoamProfile *profile,
const tSirMacAddr bssid, int channel,
uint8_t vdev_id, const tSirMacAddr connected_bssid)
@@ -19373,6 +19382,7 @@ QDF_STATUS sme_fast_reassoc(tHalHandle hal, tCsrRoamProfile *profile,
return status;
}
+#endif
void sme_enable_roaming_on_connected_sta(tHalHandle hal)
{
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 799b7552f597..e5611fb880fe 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -15794,6 +15794,7 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId,
uint32_t value = 0, value1 = 0;
QDF_STATUS packetdump_timer_status;
enum hw_mode_dbs_capab hw_mode_to_use;
+ tDot11fIEVHTCaps *vht_caps = NULL;
bool is_vendor_ap_present;
struct vdev_type_nss *vdev_type_nss;
@@ -16432,8 +16433,12 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId,
csr_join_req->vht_config.su_beam_formee = value;
+ if (pIes->VHTCaps.present)
+ vht_caps = &pIes->VHTCaps;
+ else if (pIes->vendor_vht_ie.VHTCaps.present)
+ vht_caps = &pIes->vendor_vht_ie.VHTCaps;
/* Set BF CSN value only if SU Bformee is enabled */
- if (csr_join_req->vht_config.su_beam_formee) {
+ if (vht_caps && csr_join_req->vht_config.su_beam_formee) {
txBFCsnValue = (uint8_t)value1;
/*
* Certain commercial AP display a bad behavior when
@@ -16443,18 +16448,11 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId,
* CSN cap of less than 4. To avoid such issues, take a
* min of self and peer CSN while sending ASSOC request.
*/
- if (txBFCsnValue < 4) {
- if (IS_BSS_VHT_CAPABLE(pIes->VHTCaps) &&
- pIes->VHTCaps.csnofBeamformerAntSup)
+ if (pIes->Vendor1IE.present &&
+ vht_caps->csnofBeamformerAntSup < 4) {
+ if (vht_caps->csnofBeamformerAntSup)
txBFCsnValue = QDF_MIN(txBFCsnValue,
- pIes->VHTCaps.csnofBeamformerAntSup);
- else if (IS_BSS_VHT_CAPABLE(
- pIes->vendor_vht_ie.VHTCaps)
- && pIes->vendor_vht_ie.VHTCaps.
- csnofBeamformerAntSup)
- txBFCsnValue = QDF_MIN(txBFCsnValue,
- pIes->vendor_vht_ie.
- VHTCaps.csnofBeamformerAntSup);
+ vht_caps->csnofBeamformerAntSup);
}
}
csr_join_req->vht_config.csnof_beamformer_antSup = txBFCsnValue;
@@ -19096,6 +19094,40 @@ QDF_STATUS csr_roam_set_key_mgmt_offload(tpAniSirGlobal mac_ctx,
}
/**
+ * csr_update_roam_scan_ese_params() - Update ESE related params in RSO request
+ * @req_buf: Roam Scan Offload Request buffer
+ * @session: Current Roam Session
+ *
+ * This API will set the KRK and BTK required in case of Auth Type is CCKM.
+ * It will also clear the PMK Len as CCKM PMK Caching is not supported
+ *
+ * Return: None
+ */
+#ifdef FEATURE_WLAN_ESE
+static
+void csr_update_roam_scan_ese_params(tSirRoamOffloadScanReq *req_buf,
+ tCsrRoamSession *session)
+{
+ if (csr_is_auth_type_ese(req_buf->ConnectedNetwork.authentication)) {
+ qdf_mem_copy(req_buf->KRK, session->eseCckmInfo.krk,
+ SIR_KRK_KEY_LEN);
+ qdf_mem_copy(req_buf->BTK, session->eseCckmInfo.btk,
+ SIR_BTK_KEY_LEN);
+ req_buf->pmkid_modes.fw_okc = 0;
+ req_buf->pmkid_modes.fw_pmksa_cache = 0;
+ req_buf->pmk_len = 0;
+ qdf_mem_zero(&req_buf->PSK_PMK[0], sizeof(req_buf->PSK_PMK));
+ }
+}
+#else
+static inline
+void csr_update_roam_scan_ese_params(tSirRoamOffloadScanReq *req_buf,
+ tCsrRoamSession *session)
+{
+}
+#endif
+
+/**
* csr_update_roam_scan_offload_request() - updates req msg with roam offload
* paramters
* @pMac: mac global context
@@ -19139,14 +19171,9 @@ csr_update_roam_scan_offload_request(tpAniSirGlobal mac_ctx,
req_buf->ReassocFailureTimeout =
DEFAULT_REASSOC_FAILURE_TIMEOUT;
}
-#ifdef FEATURE_WLAN_ESE
- if (csr_is_auth_type_ese(req_buf->ConnectedNetwork.authentication)) {
- qdf_mem_copy(req_buf->KRK, session->eseCckmInfo.krk,
- SIR_KRK_KEY_LEN);
- qdf_mem_copy(req_buf->BTK, session->eseCckmInfo.btk,
- SIR_BTK_KEY_LEN);
- }
-#endif
+
+ csr_update_roam_scan_ese_params(req_buf, session);
+
req_buf->AcUapsd.acbe_uapsd = SIR_UAPSD_GET(ACBE, session->uapsd_mask);
req_buf->AcUapsd.acbk_uapsd = SIR_UAPSD_GET(ACBK, session->uapsd_mask);
req_buf->AcUapsd.acvi_uapsd = SIR_UAPSD_GET(ACVI, session->uapsd_mask);
@@ -22606,6 +22633,8 @@ static QDF_STATUS csr_process_roam_sync_callback(tpAniSirGlobal mac_ctx,
sme_QosAssocInfo assoc_info;
tpAddBssParams add_bss_params;
QDF_STATUS status = QDF_STATUS_SUCCESS;
+ tPmkidCacheInfo pmkid_cache;
+ uint32_t pmkid_index;
uint16_t len;
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
tSirSmeHTProfile *src_profile = NULL;
@@ -22761,6 +22790,40 @@ static QDF_STATUS csr_process_roam_sync_callback(tpAniSirGlobal mac_ctx,
FL("LFR3:Don't start waitforkey timer"));
csr_roam_substate_change(mac_ctx,
eCSR_ROAM_SUBSTATE_NONE, session_id);
+ /*
+ * If authStatus is AUTHENTICATED, then we have done successful
+ * 4 way handshake in FW using the cached PMKID.
+ * However, the session->psk_pmk has the PMK of the older AP
+ * as set_key is not received from supplicant.
+ * When any RSO command is sent for the current AP, the older
+ * AP's PMK is sent to the FW which leads to incorrect PMK and
+ * leads to 4 way handshake failure when roaming happens to
+ * this AP again.
+ * Check if a PMK cache exists for the roamed AP and update
+ * it into the session pmk.
+ */
+ qdf_mem_zero(&pmkid_cache, sizeof(pmkid_cache));
+ qdf_copy_macaddr(&pmkid_cache.BSSID,
+ &session->connectedProfile.bssid);
+ sme_debug("Trying to find PMKID for "QDF_MAC_ADDRESS_STR,
+ QDF_MAC_ADDR_ARRAY(pmkid_cache.BSSID.bytes));
+ if (csr_lookup_pmkid_using_bssid(mac_ctx, session,
+ &pmkid_cache,
+ &pmkid_index)) {
+ session->pmk_len =
+ session->PmkidCacheInfo[pmkid_index].pmk_len;
+ qdf_mem_zero(session->psk_pmk,
+ sizeof(session->psk_pmk));
+ qdf_mem_copy(session->psk_pmk,
+ session->PmkidCacheInfo[pmkid_index].pmk,
+ session->pmk_len);
+ sme_debug("pmkid found for "QDF_MAC_ADDRESS_STR" at %d len %d",
+ QDF_MAC_ADDR_ARRAY(pmkid_cache.BSSID.bytes),
+ pmkid_index, (uint32_t)session->pmk_len);
+ } else {
+ sme_debug("PMKID Not found in cache for "QDF_MAC_ADDRESS_STR,
+ QDF_MAC_ADDR_ARRAY(pmkid_cache.BSSID.bytes));
+ }
} else {
roam_info->fAuthRequired = true;
csr_roam_substate_change(mac_ctx,
diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c
index 9e24f7668e36..76b4aa5aae56 100644
--- a/core/sme/src/csr/csr_util.c
+++ b/core/sme/src/csr/csr_util.c
@@ -3615,6 +3615,28 @@ static inline void csr_update_pmksa_to_profile(tCsrRoamProfile *profile,
}
#endif
+/**
+ * csr_update_session_pmk() - Update the pmk len and pmk in the roam session
+ * @session: pointer to the CSR Roam session
+ * @pmkid_cache: pointer to the pmkid cache
+ *
+ * Return: None
+ */
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+static void csr_update_session_pmk(tCsrRoamSession *session,
+ tPmkidCacheInfo *pmkid_cache)
+{
+ session->pmk_len = pmkid_cache->pmk_len;
+ qdf_mem_zero(session->psk_pmk, sizeof(session->psk_pmk));
+ qdf_mem_copy(session->psk_pmk, pmkid_cache->pmk, session->pmk_len);
+}
+#else
+static inline void csr_update_session_pmk(tCsrRoamSession *session,
+ tPmkidCacheInfo *pmkid_cache)
+{
+}
+#endif
+
uint8_t csr_construct_rsn_ie(tHalHandle hHal, uint32_t sessionId,
tCsrRoamProfile *pProfile,
tSirBssDescription *pSirBssDesc,
@@ -3747,6 +3769,14 @@ uint8_t csr_construct_rsn_ie(tHalHandle hHal, uint32_t sessionId,
qdf_mem_copy(pPMK->PMKIDList[0].PMKID,
pmkid_cache.PMKID,
CSR_RSN_PMKID_SIZE);
+
+ /*
+ * If a PMK cache is found for the BSSID, then
+ * update the PMK in CSR session also as this
+ * will be sent to the FW during RSO.
+ */
+ csr_update_session_pmk(session, &pmkid_cache);
+
csr_update_pmksa_to_profile(pProfile, &pmkid_cache);
} else {
pPMK->cPMKIDs = 0;
diff --git a/core/sme/src/rrm/sme_rrm.c b/core/sme/src/rrm/sme_rrm.c
index f595e06b8de4..e256270159ec 100644
--- a/core/sme/src/rrm/sme_rrm.c
+++ b/core/sme/src/rrm/sme_rrm.c
@@ -683,6 +683,7 @@ static QDF_STATUS sme_rrm_issue_scan_req(tpAniSirGlobal mac_ctx)
if ((sme_rrm_ctx->currentIndex) >=
sme_rrm_ctx->channelList.numOfChannels) {
+ sme_rrm_send_beacon_report_xmit_ind(mac_ctx, NULL, true, 0);
sme_debug("done with the complete ch lt. finish and fee now");
goto free_ch_lst;
}
@@ -886,6 +887,10 @@ QDF_STATUS sme_rrm_process_beacon_report_req_ind(tpAniSirGlobal pMac,
}
csr_get_cfg_valid_channels(pMac, pSmeRrmContext->channelList.
ChannelList, &len);
+ /* List all the channels in the requested RC */
+ cds_reg_dmn_get_channel_from_opclass(
+ pMac->scan.countryCodeCurrent,
+ pBeaconReq->channelInfo.regulatoryClass);
for (i = 0; i < len; i++) {
if (cds_reg_dmn_get_opclass_from_channel(
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index c695d71dcdd3..5b9e765648f0 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -1161,6 +1161,7 @@ QDF_STATUS wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
return status;
}
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
static const char *wma_roam_reason_to_string(uint32_t roam_reason)
{
switch (roam_reason) {
@@ -1182,6 +1183,7 @@ static const char *wma_roam_reason_to_string(uint32_t roam_reason)
return "unknown";
}
}
+#endif
static const char *wma_roam_event_to_string(uint32_t roam_reason)
{