summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/cds/src/cds_concurrency.c5
-rw-r--r--core/dp/htt/htt_t2h.c77
-rw-r--r--core/dp/txrx/ol_txrx.c38
-rw-r--r--core/dp/txrx/ol_txrx.h13
-rw-r--r--core/hdd/inc/wlan_hdd_main.h2
-rw-r--r--core/hdd/src/wlan_hdd_ext_scan.c6
-rw-r--r--core/hdd/src/wlan_hdd_main.c9
-rw-r--r--core/hdd/src/wlan_hdd_p2p.c1
-rw-r--r--core/hdd/src/wlan_hdd_power.c1
-rw-r--r--core/mac/inc/qwlan_version.h4
-rw-r--r--core/mac/inc/sir_api.h8
-rw-r--r--core/mac/src/include/sir_params.h4
-rw-r--r--core/mac/src/sys/legacy/src/utils/src/mac_trace.c4
-rw-r--r--core/sap/src/sap_fsm.c4
-rw-r--r--core/sme/inc/csr_support.h4
-rw-r--r--core/sme/src/csr/csr_api_roam.c136
-rw-r--r--core/wma/inc/wma.h17
-rw-r--r--core/wma/inc/wma_api.h12
-rw-r--r--core/wma/inc/wma_types.h2
-rw-r--r--core/wma/src/wma_data.c18
-rw-r--r--core/wma/src/wma_main.c9
-rw-r--r--core/wma/src/wma_mgmt.c60
-rw-r--r--core/wma/src/wma_scan_roam.c104
-rw-r--r--core/wma/src/wma_utils.c30
24 files changed, 451 insertions, 117 deletions
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index b3b500b38692..d4e2a8fc6298 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -3036,6 +3036,11 @@ bool cds_is_connection_in_progress(uint8_t *session_id,
}
if (hdd_ctx->connection_in_progress) {
cds_debug("AP/GO: connection is in progress");
+ if (session_id && reason) {
+ *session_id = adapter->sessionId;
+ *reason =
+ eHDD_SAP_CONNECTION_IN_PROGRESS;
+ }
return true;
}
}
diff --git a/core/dp/htt/htt_t2h.c b/core/dp/htt/htt_t2h.c
index ff5c6e281b68..2548ea72ebbf 100644
--- a/core/dp/htt/htt_t2h.c
+++ b/core/dp/htt/htt_t2h.c
@@ -186,6 +186,12 @@ static void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg,
uint16_t seq_num_start, seq_num_end;
enum htt_rx_flush_action action;
+ if (qdf_nbuf_len(htt_t2h_msg) < HTT_RX_FLUSH_BYTES) {
+ qdf_print("invalid nbuff len");
+ WARN_ON(1);
+ break;
+ }
+
peer_id = HTT_RX_FLUSH_PEER_ID_GET(*msg_word);
tid = HTT_RX_FLUSH_TID_GET(*msg_word);
seq_num_start =
@@ -228,7 +234,13 @@ static void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg,
{
uint16_t peer_id;
uint8_t tid;
+ int msg_len = qdf_nbuf_len(htt_t2h_msg);
+ if (msg_len < HTT_RX_FRAG_IND_BYTES) {
+ qdf_print("invalid nbuff len");
+ WARN_ON(1);
+ break;
+ }
peer_id = HTT_RX_FRAG_IND_PEER_ID_GET(*msg_word);
tid = HTT_RX_FRAG_IND_EXT_TID_GET(*msg_word);
htt_rx_frag_set_last_msdu(pdev, htt_t2h_msg);
@@ -289,6 +301,12 @@ static void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg,
uint16_t peer_id;
uint8_t vdev_id;
+ if (qdf_nbuf_len(htt_t2h_msg) < HTT_RX_PEER_MAP_BYTES) {
+ qdf_print("invalid nbuff len");
+ WARN_ON(1);
+ break;
+ }
+
peer_id = HTT_RX_PEER_MAP_PEER_ID_GET(*msg_word);
vdev_id = HTT_RX_PEER_MAP_VDEV_ID_GET(*msg_word);
peer_mac_addr = htt_t2h_mac_addr_deswizzle(
@@ -312,6 +330,12 @@ static void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg,
{
uint16_t peer_id;
+ if (qdf_nbuf_len(htt_t2h_msg) < HTT_RX_PEER_UNMAP_BYTES) {
+ qdf_print("invalid nbuff len");
+ WARN_ON(1);
+ break;
+ }
+
peer_id = HTT_RX_PEER_UNMAP_PEER_ID_GET(*msg_word);
if (peer_id > ol_cfg_max_peer_id(pdev->ctrl_pdev)) {
qdf_print("%s: HTT_T2H_MSG_TYPE_PEER_UNMAP,"
@@ -330,6 +354,12 @@ static void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg,
enum htt_sec_type sec_type;
int is_unicast;
+ if (qdf_nbuf_len(htt_t2h_msg) < HTT_SEC_IND_BYTES) {
+ qdf_print("invalid nbuff len");
+ WARN_ON(1);
+ break;
+ }
+
peer_id = HTT_SEC_IND_PEER_ID_GET(*msg_word);
sec_type = HTT_SEC_IND_SEC_TYPE_GET(*msg_word);
is_unicast = HTT_SEC_IND_UNICAST_GET(*msg_word);
@@ -417,6 +447,13 @@ static void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg,
uint32_t htt_credit_delta_abs;
int32_t htt_credit_delta;
int sign, old_credit;
+ int msg_len = qdf_nbuf_len(htt_t2h_msg);
+
+ if (msg_len < HTT_TX_CREDIT_MSG_BYTES) {
+ qdf_print("invalid nbuff len");
+ WARN_ON(1);
+ break;
+ }
htt_credit_delta_abs =
HTT_TX_CREDIT_DELTA_ABS_GET(*msg_word);
@@ -544,8 +581,16 @@ static void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg,
struct ol_error_info err_info;
struct ol_txrx_vdev_t *vdev;
struct ol_txrx_peer_t *peer;
- uint16_t peer_id =
- HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET
+ uint16_t peer_id;
+ int msg_len = qdf_nbuf_len(htt_t2h_msg);
+
+ if (msg_len < HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES) {
+ qdf_print("invalid nbuff len");
+ WARN_ON(1);
+ break;
+ }
+
+ peer_id = HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET
(*(msg_word + 1));
peer = ol_txrx_peer_find_by_id(pdev->txrx_pdev,
@@ -849,6 +894,13 @@ void htt_t2h_msg_handler(void *context, HTC_PACKET *pkt)
uint16_t peer_id;
uint8_t tid, pn_ie_cnt, *pn_ie = NULL;
uint16_t seq_num_start, seq_num_end;
+ int msg_len = qdf_nbuf_len(htt_t2h_msg);
+
+ if (msg_len < HTT_RX_PN_IND_BYTES) {
+ qdf_print("invalid nbuff len");
+ WARN_ON(1);
+ break;
+ }
/*First dword */
peer_id = HTT_RX_PN_IND_PEER_ID_GET(*msg_word);
@@ -861,6 +913,13 @@ void htt_t2h_msg_handler(void *context, HTC_PACKET *pkt)
seq_num_end = HTT_RX_PN_IND_SEQ_NUM_END_GET(*msg_word);
pn_ie_cnt = HTT_RX_PN_IND_PN_IE_CNT_GET(*msg_word);
+ if (msg_len - HTT_RX_PN_IND_BYTES <
+ pn_ie_cnt * sizeof(uint8_t)) {
+ qdf_print("invalid pn_ie count");
+ WARN_ON(1);
+ break;
+ }
+
msg_word++;
/*Third dword */
if (pn_ie_cnt)
@@ -1138,6 +1197,13 @@ void htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus,
u_int16_t peer_id;
u_int8_t tid, pn_ie_cnt, *pn_ie = NULL;
int seq_num_start, seq_num_end;
+ int msg_len = qdf_nbuf_len(htt_t2h_msg);
+
+ if (msg_len < HTT_RX_PN_IND_BYTES) {
+ qdf_print("invalid nbuff len");
+ WARN_ON(1);
+ break;
+ }
/*First dword */
peer_id = HTT_RX_PN_IND_PEER_ID_GET(*msg_word);
@@ -1152,6 +1218,13 @@ void htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus,
pn_ie_cnt =
HTT_RX_PN_IND_PN_IE_CNT_GET(*msg_word);
+ if (msg_len - HTT_RX_PN_IND_BYTES <
+ pn_ie_cnt * sizeof(uint8_t)) {
+ qdf_print("invalid pn_ie len");
+ WARN_ON(1);
+ break;
+ }
+
msg_word++;
/*Third dword*/
if (pn_ie_cnt)
diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c
index 155e3a2e0873..07692b6347b7 100644
--- a/core/dp/txrx/ol_txrx.c
+++ b/core/dp/txrx/ol_txrx.c
@@ -5857,6 +5857,8 @@ ol_txrx_update_tx_status(struct ol_txrx_pdev_t *pdev,
tx_status->chan_flags = channel_flags;
tx_status->ant_signal_db = mon_hdr->rssi_comb;
+ tx_status->tx_status = mon_hdr->status;
+ tx_status->add_rtap_ext = true;
}
/**
@@ -5945,6 +5947,7 @@ ol_txrx_mon_tx_data_cb(void *ppdev, void *nbuf_list, uint8_t vdev_id,
mon_hdr.sgi = cmpl_desc->sgi;
mon_hdr.ldpc = cmpl_desc->ldpc;
mon_hdr.beamformed = cmpl_desc->beamformed;
+ mon_hdr.status = status;
qdf_nbuf_pull_head(
msdu,
@@ -6158,6 +6161,9 @@ ol_txrx_mon_rx_data_cb(void *ppdev, void *nbuf_list, uint8_t vdev_id,
ol_htt_mon_note_chan(pdev, chan);
htt_rx_mon_get_rx_status(pdev->htt_pdev, rx_desc, &rx_status);
+ rx_status.tx_status = status;
+ rx_status.add_rtap_ext = true;
+
/* clear IEEE80211_RADIOTAP_F_FCS flag*/
rx_status.rtap_flags &= ~(BIT(4));
rx_status.rtap_flags &= ~(BIT(2));
@@ -6194,6 +6200,36 @@ free_buf:
drop_count = ol_txrx_drop_nbuf_list(buf_list);
}
+/**
+ * ol_txrx_pktcapture_status_map() - map Tx status for data packets
+ * with packet capture Tx status
+ * @status: Tx status
+ *
+ * Return: pktcapture_tx_status enum
+ */
+static enum pktcapture_tx_status
+ol_txrx_pktcapture_status_map(uint8_t status)
+{
+ enum pktcapture_tx_status tx_status;
+
+ switch (status) {
+ case htt_tx_status_ok:
+ tx_status = pktcapture_tx_status_ok;
+ break;
+ case htt_tx_status_discard:
+ tx_status = pktcapture_tx_status_discard;
+ break;
+ case htt_tx_status_no_ack:
+ tx_status = pktcapture_tx_status_no_ack;
+ break;
+ default:
+ tx_status = pktcapture_tx_status_discard;
+ break;
+ }
+
+ return tx_status;
+}
+
void ol_txrx_mon_data_process(uint8_t vdev_id,
qdf_nbuf_t mon_buf_list,
enum mon_data_process_type type,
@@ -6233,7 +6269,7 @@ void ol_txrx_mon_data_process(uint8_t vdev_id,
pkt->monpkt = (void *)mon_buf_list;
pkt->vdev_id = vdev_id;
pkt->tid = tid;
- pkt->status = status;
+ pkt->status = ol_txrx_pktcapture_status_map(status);
pkt->pkt_format = pkt_format;
cds_indicate_monpkt(sched_ctx, pkt);
return;
diff --git a/core/dp/txrx/ol_txrx.h b/core/dp/txrx/ol_txrx.h
index 8bdd418f587d..40c77a5e2c4c 100644
--- a/core/dp/txrx/ol_txrx.h
+++ b/core/dp/txrx/ol_txrx.h
@@ -212,4 +212,17 @@ struct ol_txrx_fw_stats_desc_t
struct ol_txrx_stats_req_internal *ol_txrx_fw_stats_desc_get_req(struct
ol_txrx_pdev_t *pdev, uint8_t desc_id);
+/**
+ * enum pktcapture_tx_status - packet capture tx status
+ * @pktcapture_tx_status_ok: successfully sent + acked
+ * @pktcapture_tx_status_discard: discard - not sent
+ * @pktcapture_tx_status_no_ack: no_ack - sent, but no ack
+ *
+ * This enum has tx status types for packet capture mode
+ */
+enum pktcapture_tx_status {
+ pktcapture_tx_status_ok,
+ pktcapture_tx_status_discard,
+ pktcapture_tx_status_no_ack,
+};
#endif /* _OL_TXRX__H_ */
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index 373bdd16fb17..98b9801c3521 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -363,6 +363,7 @@ enum {
* @eHDD_REASSOC_IN_PROGRESS: reassociation is in progress
* @eHDD_EAPOL_IN_PROGRESS: STA/P2P-CLI is in middle of EAPOL/WPS exchange
* @eHDD_SAP_EAPOL_IN_PROGRESS: SAP/P2P-GO is in middle of EAPOL/WPS exchange
+ * @eHDD_SAP_CONNECTION_IN_PROGRESS: SAP/P2P-GO is in middle of connection.
*/
typedef enum {
eHDD_SCAN_REJECT_DEFAULT = 0,
@@ -370,6 +371,7 @@ typedef enum {
eHDD_REASSOC_IN_PROGRESS,
eHDD_EAPOL_IN_PROGRESS,
eHDD_SAP_EAPOL_IN_PROGRESS,
+ eHDD_SAP_CONNECTION_IN_PROGRESS,
} scan_reject_states;
#define MAX_PROBE_REQ_OUIS 16
diff --git a/core/hdd/src/wlan_hdd_ext_scan.c b/core/hdd/src/wlan_hdd_ext_scan.c
index 547955c429f7..37d7bfe4e9b1 100644
--- a/core/hdd/src/wlan_hdd_ext_scan.c
+++ b/core/hdd/src/wlan_hdd_ext_scan.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019 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
@@ -2460,10 +2460,6 @@ __wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy,
if (0 != ret)
return -EINVAL;
- if (!pHddCtx->config->extscan_enabled) {
- hdd_err("extscan not supported");
- return -ENOTSUPP;
- }
if (hdd_nla_parse(tb,
QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX,
data, data_len, wlan_hdd_extscan_config_policy)) {
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 671abd702889..2da610d8989d 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -9354,8 +9354,6 @@ wlan_hdd_add_monitor_check(hdd_context_t *hdd_ctx, hdd_adapter_t **adapter,
hdd_adapter_t *mon_adapter;
uint32_t mode;
- *adapter = NULL;
-
if (!cds_get_pktcap_mode_enable())
return 0;
@@ -9400,8 +9398,13 @@ wlan_hdd_add_monitor_check(hdd_context_t *hdd_ctx, hdd_adapter_t **adapter,
continue;
adapter = hdd_get_adapter(hdd_ctx, mode);
- if (adapter)
+ if (adapter) {
+ wlan_hdd_release_intf_addr(
+ hdd_ctx,
+ adapter->macAddressCurrent.bytes);
+ hdd_stop_adapter(hdd_ctx, adapter, true);
hdd_close_adapter(hdd_ctx, adapter, rtnl_held);
+ }
}
mon_adapter = hdd_open_adapter(hdd_ctx, QDF_MONITOR_MODE, name,
diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c
index 572a7a41043d..ad8ac69b2df7 100644
--- a/core/hdd/src/wlan_hdd_p2p.c
+++ b/core/hdd/src/wlan_hdd_p2p.c
@@ -2974,6 +2974,7 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
}
}
+ pAdapter = NULL;
ret = wlan_hdd_add_monitor_check(pHddCtx, &pAdapter, type, name,
true, name_assign_type);
if (ret)
diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c
index 7a7bf9f72ac9..8e3a9b766ad2 100644
--- a/core/hdd/src/wlan_hdd_power.c
+++ b/core/hdd/src/wlan_hdd_power.c
@@ -1476,6 +1476,7 @@ QDF_STATUS hdd_wlan_shutdown(void)
}
pHddCtx->is_ssr_in_progress = true;
+ cds_set_connection_in_progress(false);
cds_clear_concurrent_session_count();
diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h
index 31b7712f6ba9..f96580825196 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 "N"
+#define QWLAN_VERSION_EXTRA "Z"
#define QWLAN_VERSION_BUILD 74
-#define QWLAN_VERSIONSTR "5.1.1.74N"
+#define QWLAN_VERSIONSTR "5.1.1.74Z"
#endif /* QWLAN_VERSION_H */
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index d9022b6ef82a..f1f523eca137 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -3648,6 +3648,14 @@ struct mawc_params {
uint8_t mawc_roam_rssi_low_adjust;
};
+/**
+ * struct roam_sync_timeout_timer_info - Info related to roam sync timer
+ * @vdev_id: Vdev id for which host waiting roam sync ind from fw
+ */
+struct roam_sync_timeout_timer_info {
+ uint8_t vdev_id;
+};
+
typedef struct sSirRoamOffloadScanReq {
uint16_t message_type;
uint16_t length;
diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h
index e6845a39b9a9..6c50f52814e5 100644
--- a/core/mac/src/include/sir_params.h
+++ b/core/mac/src/include/sir_params.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019 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
@@ -307,7 +307,7 @@ struct sir_mgmt_msg {
#define SIR_HAL_WOW_ADD_PTRN (SIR_HAL_ITC_MSG_TYPES_BEGIN + 82)
#define SIR_HAL_WOW_DEL_PTRN (SIR_HAL_ITC_MSG_TYPES_BEGIN + 83)
#define SIR_HAL_WOWL_ENTER_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 84)
-#define SIR_HAL_WOWL_ENTER_RSP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 85)
+#define SIR_HAL_WMA_ROAM_SYNC_TIMEOUT (SIR_HAL_ITC_MSG_TYPES_BEGIN + 85)
#define SIR_HAL_WOWL_EXIT_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 86)
#define SIR_HAL_WOWL_EXIT_RSP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 87)
/* / PE <-> HAL statistics messages */
diff --git a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c
index e32b7d5dbaaf..8dcdfa00dfd4 100644
--- a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c
+++ b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2019 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
@@ -641,7 +641,7 @@ uint8_t *mac_trace_get_wma_msg_string(uint16_t wma_msg)
#ifdef WLAN_FEATURE_11W
CASE_RETURN_STRING(WMA_EXCLUDE_UNENCRYPTED_IND);
#endif
- CASE_RETURN_STRING(WMA_WOWL_ENTER_RSP);
+ CASE_RETURN_STRING(WMA_ROAM_SYNC_TIMEOUT);
CASE_RETURN_STRING(WMA_WOWL_EXIT_RSP);
CASE_RETURN_STRING(WMA_SET_MAX_TX_POWER_RSP);
CASE_RETURN_STRING(WMA_SET_DTIM_PERIOD);
diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c
index 533df00f431b..4d9e7ed4025c 100644
--- a/core/sap/src/sap_fsm.c
+++ b/core/sap/src/sap_fsm.c
@@ -4913,6 +4913,10 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx,
CDS_CHANNEL_STATE(loop_count)))))
continue;
+ if (CDS_CHANNEL_NUM(loop_count) == 12 ||
+ CDS_CHANNEL_NUM(loop_count) == 13)
+ continue;
+
/*
* Skip the channels which are not in ACS config from user
* space
diff --git a/core/sme/inc/csr_support.h b/core/sme/inc/csr_support.h
index 046803fdca3b..91f5ec3727bb 100644
--- a/core/sme/inc/csr_support.h
+++ b/core/sme/inc/csr_support.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2019 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
@@ -200,7 +200,7 @@ typedef struct tagCsrWapiIe {
typedef struct tagRoamingTimerInfo {
tpAniSirGlobal pMac;
- uint8_t sessionId;
+ uint8_t vdev_id;
} tCsrTimerInfo;
#define CSR_IS_11A_BSS(pBssDesc) (eSIR_11A_NW_TYPE == (pBssDesc)->nwType)
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 4543f281f4dd..debd009b3727 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -312,10 +312,10 @@ static bool csr_roam_is_same_profile_keys(tpAniSirGlobal pMac,
tCsrRoamProfile *pProfile2);
static QDF_STATUS csr_roam_start_roaming_timer(tpAniSirGlobal pMac,
- uint32_t sessionId,
+ uint32_t vdev_id,
uint32_t interval);
static QDF_STATUS csr_roam_stop_roaming_timer(tpAniSirGlobal pMac,
- uint32_t sessionId);
+ uint32_t vdev_id);
static void csr_roam_roaming_timer_handler(void *pv);
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
static void csr_roam_roaming_offload_timer_action(tpAniSirGlobal mac_ctx,
@@ -1307,11 +1307,11 @@ static QDF_STATUS csr_roam_open(tpAniSirGlobal pMac)
for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) {
pSession = CSR_GET_SESSION(pMac, i);
pSession->roamingTimerInfo.pMac = pMac;
- pSession->roamingTimerInfo.sessionId =
+ pSession->roamingTimerInfo.vdev_id =
CSR_SESSION_ID_INVALID;
}
pMac->roam.WaitForKeyTimerInfo.pMac = pMac;
- pMac->roam.WaitForKeyTimerInfo.sessionId =
+ pMac->roam.WaitForKeyTimerInfo.vdev_id =
CSR_SESSION_ID_INVALID;
status = qdf_mc_timer_init(&pMac->roam.hTimerWaitForKey,
QDF_TIMER_TYPE_SW,
@@ -7765,7 +7765,7 @@ static void csr_roam_process_join_res(tpAniSirGlobal mac_ctx,
CSR_WAIT_FOR_KEY_TIMEOUT_PERIOD;
/* Save session_id in case of timeout */
- mac_ctx->roam.WaitForKeyTimerInfo.sessionId =
+ mac_ctx->roam.WaitForKeyTimerInfo.vdev_id =
(uint8_t) session_id;
/*
* This time should be long enough for the rest
@@ -12954,7 +12954,7 @@ void csr_roam_roaming_timer_handler(void *pv)
{
tCsrTimerInfo *pInfo = (tCsrTimerInfo *) pv;
tpAniSirGlobal pMac = pInfo->pMac;
- uint32_t sessionId = pInfo->sessionId;
+ uint32_t sessionId = pInfo->vdev_id;
tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId);
if (!pSession) {
@@ -12986,50 +12986,68 @@ void csr_roam_roaming_timer_handler(void *pv)
void csr_roam_roaming_offload_timeout_handler(void *timer_data)
{
tCsrTimerInfo *timer_info = (tCsrTimerInfo *) timer_data;
+ cds_msg_t wma_msg = {0};
+ struct roam_sync_timeout_timer_info *req;
+ QDF_STATUS status;
if (timer_info) {
- QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
- "LFR3:roaming offload timer expired, session: %d",
- timer_info->sessionId);
+ sme_debug("LFR3:roaming offload timer expired, session: %d",
+ timer_info->vdev_id);
+
} else {
- QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
- "Invalid Session");
+ sme_err("Invalid Session");
+ return;
+ }
+
+ req = qdf_mem_malloc(sizeof(*req));
+ if (!req)
+ return;
+
+ req->vdev_id = timer_info->vdev_id;
+ wma_msg.type = WMA_ROAM_SYNC_TIMEOUT;
+ wma_msg.bodyptr = req;
+
+ status = cds_mq_post_message(QDF_MODULE_ID_WMA, &wma_msg);
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
+ sme_err("Post roam offload timer fails, session id: %d",
+ timer_info->vdev_id);
+ qdf_mem_free(req);
return;
}
- csr_roam_disconnect(timer_info->pMac, timer_info->sessionId,
- eCSR_DISCONNECT_REASON_UNSPECIFIED);
}
-QDF_STATUS csr_roam_start_roaming_timer(tpAniSirGlobal pMac, uint32_t sessionId,
+QDF_STATUS csr_roam_start_roaming_timer(tpAniSirGlobal pMac,
+ uint32_t vdev_id,
uint32_t interval)
{
QDF_STATUS status;
- tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId);
+ tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, vdev_id);
if (!pSession) {
- sme_err("session %d not found", sessionId);
+ sme_err("session %d not found", vdev_id);
return QDF_STATUS_E_FAILURE;
}
sme_debug("csrScanStartRoamingTimer");
- pSession->roamingTimerInfo.sessionId = (uint8_t) sessionId;
+ pSession->roamingTimerInfo.vdev_id = (uint8_t) vdev_id;
status = qdf_mc_timer_start(&pSession->hTimerRoaming,
interval / QDF_MC_TIMER_TO_MS_UNIT);
return status;
}
-QDF_STATUS csr_roam_stop_roaming_timer(tpAniSirGlobal pMac, uint32_t sessionId)
+QDF_STATUS csr_roam_stop_roaming_timer(tpAniSirGlobal pMac,
+ uint32_t vdev_id)
{
return qdf_mc_timer_stop
- (&pMac->roam.roamSession[sessionId].hTimerRoaming);
+ (&pMac->roam.roamSession[vdev_id].hTimerRoaming);
}
void csr_roam_wait_for_key_time_out_handler(void *pv)
{
tCsrTimerInfo *pInfo = (tCsrTimerInfo *) pv;
tpAniSirGlobal pMac = pInfo->pMac;
- tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, pInfo->sessionId);
+ tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, pInfo->vdev_id);
QDF_STATUS status = QDF_STATUS_E_FAILURE;
if (pSession == NULL) {
@@ -13039,21 +13057,21 @@ void csr_roam_wait_for_key_time_out_handler(void *pv)
sme_debug("WaitForKey timer expired in state: %s sub-state: %s",
mac_trace_get_neighbour_roam_state(pMac->roam.
- neighborRoamInfo[pInfo->sessionId].
+ neighborRoamInfo[pInfo->vdev_id].
neighborRoamState),
mac_trace_getcsr_roam_sub_state(pMac->roam.
- curSubState[pInfo->sessionId]));
+ curSubState[pInfo->vdev_id]));
spin_lock(&pMac->roam.roam_state_lock);
- if (CSR_IS_WAIT_FOR_KEY(pMac, pInfo->sessionId)) {
+ if (CSR_IS_WAIT_FOR_KEY(pMac, pInfo->vdev_id)) {
/* Change the substate so command queue is unblocked. */
- if (CSR_ROAM_SESSION_MAX > pInfo->sessionId)
- pMac->roam.curSubState[pInfo->sessionId] =
+ if (CSR_ROAM_SESSION_MAX > pInfo->vdev_id)
+ pMac->roam.curSubState[pInfo->vdev_id] =
eCSR_ROAM_SUBSTATE_NONE;
spin_unlock(&pMac->roam.roam_state_lock);
if (csr_neighbor_roam_is_handoff_in_progress(pMac,
- pInfo->sessionId)) {
+ pInfo->vdev_id)) {
/*
* Enable heartbeat timer when hand-off is in progress
* and Key Wait timer expired.
@@ -13065,13 +13083,13 @@ void csr_roam_wait_for_key_time_out_handler(void *pv)
}
sme_debug("SME pre-auth state timeout");
- if (csr_is_conn_state_connected_infra(pMac, pInfo->sessionId)) {
+ if (csr_is_conn_state_connected_infra(pMac, pInfo->vdev_id)) {
csr_roam_link_up(pMac,
pSession->connectedProfile.bssid);
sme_process_pending_queue(pMac);
status = sme_acquire_global_lock(&pMac->sme);
if (QDF_IS_STATUS_SUCCESS(status)) {
- csr_roam_disconnect(pMac, pInfo->sessionId,
+ csr_roam_disconnect(pMac, pInfo->vdev_id,
eCSR_DISCONNECT_REASON_UNSPECIFIED);
sme_release_global_lock(&pMac->sme);
}
@@ -13095,16 +13113,17 @@ void csr_roam_wait_for_key_time_out_handler(void *pv)
* Return: None
*/
void csr_roam_roaming_offload_timer_action(tpAniSirGlobal mac_ctx,
- uint32_t interval, uint8_t session_id,
+ uint32_t interval, uint8_t vdev_id,
uint8_t action)
{
- tCsrRoamSession *csr_session = CSR_GET_SESSION(mac_ctx, session_id);
+ tCsrRoamSession *csr_session = CSR_GET_SESSION(mac_ctx, vdev_id);
+ QDF_TIMER_STATE tstate;
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
- ("LFR3: timer action %d, session %d, intvl %d"),
- action, session_id, interval);
+ ("LFR3: timer action %d, vdev_id %d, intvl %d"),
+ action, vdev_id, interval);
if (mac_ctx) {
- csr_session = CSR_GET_SESSION(mac_ctx, session_id);
+ csr_session = CSR_GET_SESSION(mac_ctx, vdev_id);
} else {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
("LFR3: Invalid MAC Context"));
@@ -13112,13 +13131,25 @@ void csr_roam_roaming_offload_timer_action(tpAniSirGlobal mac_ctx,
}
if (!csr_session) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
- ("LFR3: session %d not found"), session_id);
+ ("LFR3: session %d not found"), vdev_id);
return;
}
- csr_session->roamingTimerInfo.sessionId = (uint8_t) session_id;
- if (action == ROAMING_OFFLOAD_TIMER_START)
- qdf_mc_timer_start(&csr_session->roaming_offload_timer,
- interval / QDF_MC_TIMER_TO_MS_UNIT);
+ csr_session->roamingTimerInfo.vdev_id = (uint8_t) vdev_id;
+
+ tstate =
+ qdf_mc_timer_get_current_state(&csr_session->roaming_offload_timer);
+
+ if (action == ROAMING_OFFLOAD_TIMER_START) {
+ /*
+ * If timer is already running then re-start timer in order to
+ * process new ROAM_START with fresh timer.
+ */
+ if (tstate == QDF_TIMER_STATE_RUNNING)
+ qdf_mc_timer_stop(&csr_session->roaming_offload_timer);
+ qdf_mc_timer_start(&csr_session->roaming_offload_timer,
+ interval / QDF_MC_TIMER_TO_MS_UNIT);
+ }
+
if (action == ROAMING_OFFLOAD_TIMER_STOP)
qdf_mc_timer_stop(&csr_session->roaming_offload_timer);
@@ -13131,17 +13162,17 @@ static QDF_STATUS csr_roam_start_wait_for_key_timer(tpAniSirGlobal pMac,
QDF_STATUS status;
tpCsrNeighborRoamControlInfo pNeighborRoamInfo =
&pMac->roam.neighborRoamInfo[pMac->roam.WaitForKeyTimerInfo.
- sessionId];
+ vdev_id];
if (csr_neighbor_roam_is_handoff_in_progress(pMac,
pMac->roam.WaitForKeyTimerInfo.
- sessionId)) {
+ vdev_id)) {
/* Disable heartbeat timer when hand-off is in progress */
sme_debug("disabling HB timer in state: %s sub-state: %s",
mac_trace_get_neighbour_roam_state(
pNeighborRoamInfo->neighborRoamState),
mac_trace_getcsr_roam_sub_state(
pMac->roam.curSubState[pMac->roam.
- WaitForKeyTimerInfo.sessionId]));
+ WaitForKeyTimerInfo.vdev_id]));
cfg_set_int(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, 0);
}
sme_debug("csrScanStartWaitForKeyTimer");
@@ -13155,7 +13186,7 @@ QDF_STATUS csr_roam_stop_wait_for_key_timer(tpAniSirGlobal pMac)
{
tpCsrNeighborRoamControlInfo pNeighborRoamInfo =
&pMac->roam.neighborRoamInfo[pMac->roam.WaitForKeyTimerInfo.
- sessionId];
+ vdev_id];
sme_debug("WaitForKey timer stopped in state: %s sub-state: %s",
mac_trace_get_neighbour_roam_state(pNeighborRoamInfo->
@@ -13163,10 +13194,9 @@ QDF_STATUS csr_roam_stop_wait_for_key_timer(tpAniSirGlobal pMac)
mac_trace_getcsr_roam_sub_state(pMac->roam.
curSubState[pMac->roam.
WaitForKeyTimerInfo.
- sessionId]));
+ vdev_id]));
if (csr_neighbor_roam_is_handoff_in_progress(pMac,
- pMac->roam.WaitForKeyTimerInfo.
- sessionId)) {
+ pMac->roam.WaitForKeyTimerInfo.vdev_id)) {
/*
* Enable heartbeat timer when hand-off is in progress
* and Key Wait timer got stopped for some reason
@@ -20736,6 +20766,12 @@ csr_roam_offload_scan(tpAniSirGlobal mac_ctx, uint8_t session_id,
return QDF_STATUS_E_FAILURE;
}
+ if (!csr_is_conn_state_connected(mac_ctx, session_id) &&
+ command == ROAM_SCAN_OFFLOAD_UPDATE_CFG) {
+ sme_debug("Session not in connected state, RSO not sent");
+ return QDF_STATUS_E_FAILURE;
+ }
+
if ((command == ROAM_SCAN_OFFLOAD_START) &&
(session->pCurRoamProfile &&
session->pCurRoamProfile->driver_disabled_roaming)) {
@@ -22823,9 +22859,11 @@ static QDF_STATUS csr_process_roam_sync_callback(tpAniSirGlobal mac_ctx,
session->disable_hi_rssi = false;
}
- csr_roam_offload_scan(mac_ctx, session_id,
- ROAM_SCAN_OFFLOAD_UPDATE_CFG,
- REASON_CONNECT);
+ if (roam_synch_data->authStatus ==
+ CSR_ROAM_AUTH_STATUS_AUTHENTICATED)
+ csr_roam_offload_scan(mac_ctx, session_id,
+ ROAM_SCAN_OFFLOAD_UPDATE_CFG,
+ REASON_CONNECT);
csr_roam_call_callback(mac_ctx, session_id, NULL, 0,
eCSR_ROAM_SYNCH_COMPLETE,
eCSR_ROAM_RESULT_SUCCESS);
@@ -22937,7 +22975,7 @@ static QDF_STATUS csr_process_roam_sync_callback(tpAniSirGlobal mac_ctx,
session_id);
ps_global_info->remain_in_power_active_till_dhcp = true;
- mac_ctx->roam.WaitForKeyTimerInfo.sessionId = session_id;
+ mac_ctx->roam.WaitForKeyTimerInfo.vdev_id = session_id;
if (!QDF_IS_STATUS_SUCCESS(csr_roam_start_wait_for_key_timer(
mac_ctx, CSR_WAIT_FOR_KEY_TIMEOUT_PERIOD))
) {
diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h
index 611beb7711ab..5728194c58d6 100644
--- a/core/wma/inc/wma.h
+++ b/core/wma/inc/wma.h
@@ -1545,7 +1545,7 @@ typedef struct {
void *wmi_handle;
void *htc_handle;
void *cds_context;
- void *mac_context;
+ tAniSirGlobal *mac_context;
qdf_event_t wma_ready_event;
qdf_event_t wma_resume_event;
qdf_event_t target_suspend;
@@ -2423,6 +2423,9 @@ int wmi_desc_pool_init(tp_wma_handle wma_handle, uint32_t pool_size);
void wmi_desc_pool_deinit(tp_wma_handle wma_handle);
struct wmi_desc_t *wmi_desc_get(tp_wma_handle wma_handle);
void wmi_desc_put(tp_wma_handle wma_handle, struct wmi_desc_t *wmi_desc);
+int wma_process_mon_mgmt_tx(qdf_nbuf_t nbuf, uint32_t nbuf_len,
+ struct wmi_mgmt_params *mgmt_param,
+ uint16_t chanfreq);
int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
uint32_t len);
int wma_mgmt_tx_bundle_completion_handler(void *handle,
@@ -2652,6 +2655,18 @@ QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle,
tSirRoamOffloadScanReq *roam_req);
/**
+ * wma_handle_roam_sync_timeout() - Update roaming status at wma layer
+ * @wma_handle: wma handle
+ * @info: Info for roaming start timer
+ *
+ * This function gets called in case of roaming offload timer get expired
+ *
+ * Return: None
+ */
+void wma_handle_roam_sync_timeout(tp_wma_handle wma_handle,
+ struct roam_sync_timeout_timer_info *info);
+
+/**
* wma_register_phy_err_event_handler() - register phy error event handler
* @wma_handle: wma handle
*
diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h
index e80ce4703217..de42a3b3bbe4 100644
--- a/core/wma/inc/wma_api.h
+++ b/core/wma/inc/wma_api.h
@@ -32,6 +32,7 @@
#include "cds_concurrency.h"
#include "cds_utils.h"
#include "wma_sar_public_structs.h"
+#include "ol_txrx.h"
typedef void *WMA_HANDLE;
@@ -621,4 +622,15 @@ QDF_STATUS wma_send_dhcp_ind(uint16_t type, uint8_t device_mode,
QDF_STATUS wma_update_thermal_mitigation_to_fw(uint8_t thermal_level);
#endif
+/**
+ * wma_mgmt_pktcapture_status_map() - map Tx status for MGMT packets
+ * with packet capture Tx status
+ * @status: Tx status
+ * @is_data_pkt: Tx status for data packets
+ *
+ * Return: pktcapture_tx_status enum
+ */
+enum pktcapture_tx_status
+wma_mgmt_pktcapture_status_map(uint8_t status);
+
#endif
diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h
index 19ed6203154e..147ac452aa96 100644
--- a/core/wma/inc/wma_types.h
+++ b/core/wma/inc/wma_types.h
@@ -220,7 +220,7 @@
#define WMA_WOW_ADD_PTRN SIR_HAL_WOW_ADD_PTRN
#define WMA_WOW_DEL_PTRN SIR_HAL_WOW_DEL_PTRN
#define WMA_WOWL_ENTER_REQ SIR_HAL_WOWL_ENTER_REQ
-#define WMA_WOWL_ENTER_RSP SIR_HAL_WOWL_ENTER_RSP
+#define WMA_ROAM_SYNC_TIMEOUT SIR_HAL_WMA_ROAM_SYNC_TIMEOUT
#define WMA_WOWL_EXIT_REQ SIR_HAL_WOWL_EXIT_REQ
#define WMA_WOWL_EXIT_RSP SIR_HAL_WOWL_EXIT_RSP
/* / PE <-> HAL statistics messages */
diff --git a/core/wma/src/wma_data.c b/core/wma/src/wma_data.c
index 3d61436f7787..f5580bb7bc23 100644
--- a/core/wma/src/wma_data.c
+++ b/core/wma/src/wma_data.c
@@ -828,8 +828,7 @@ static void wma_data_tx_ack_work_handler(void *ack_work)
/* Call the Ack Cb registered by UMAC */
if (ack_cb)
- ack_cb((tpAniSirGlobal) (wma_handle->mac_context),
- work->status ? 0 : 1);
+ ack_cb(wma_handle->mac_context, work->status ? 0 : 1);
else
WMA_LOGE("Data Tx Ack Cb is NULL");
@@ -1390,8 +1389,7 @@ static void wma_mgmt_tx_ack_work_handler(void *ack_work)
work->sub_type, work->status);
/* Call the Ack Cb registered by UMAC */
- ack_cb((tpAniSirGlobal) (wma_handle->mac_context),
- work->status ? 0 : 1);
+ ack_cb(wma_handle->mac_context, work->status ? 0 : 1);
end:
qdf_mem_free(work);
wma_handle->mgmt_ack_work_ctx = NULL;
@@ -2654,6 +2652,8 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
ol_pdev_handle ctrl_pdev;
bool is_5g = false;
+ ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+
if (NULL == wma_handle) {
WMA_LOGE("wma_handle is NULL");
cds_packet_free((void *)tx_frame);
@@ -3045,6 +3045,16 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
wmi_desc->nbuf = tx_frame;
wmi_desc->tx_cmpl_cb = tx_frm_download_comp_cb;
wmi_desc->ota_post_proc_cb = tx_frm_ota_comp_cb;
+
+ if (pdev && cds_get_pktcap_mode_enable() &&
+ (ol_cfg_pktcapture_mode(pdev->ctrl_pdev) &
+ PKT_CAPTURE_MODE_MGMT_ONLY) &&
+ pdev->mon_cb) {
+ chanfreq = wma_handle->interfaces[vdev_id].mhz;
+ wma_process_mon_mgmt_tx(tx_frame,
+ qdf_nbuf_len(tx_frame),
+ &mgmt_param, chanfreq);
+ }
status = wmi_mgmt_unified_cmd_send(
wma_handle->wmi_handle,
&mgmt_param);
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index d7f0ecb62148..3197cd84237e 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -2364,8 +2364,8 @@ static int wma_rx_service_available_event(void *handle, uint8_t *cmd_param_info,
wma_handle->wmi_service_ext_offset = ev->wmi_service_segment_offset;
qdf_mem_copy(wma_handle->wmi_service_ext_bitmap,
- &ev->wmi_service_segment_bitmap[0],
- WMI_SERVICE_EXT_BM_SIZE32 * sizeof(A_UINT32));
+ &ev->wmi_service_segment_bitmap[0],
+ WMI_SERVICE_SEGMENT_BM_SIZE32 * sizeof(A_UINT32));
return 0;
}
@@ -7793,6 +7793,11 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg)
(tSirRoamOffloadScanReq *) msg->bodyptr);
break;
+ case WMA_ROAM_SYNC_TIMEOUT:
+ wma_handle_roam_sync_timeout(wma_handle, msg->bodyptr);
+ qdf_mem_free(msg->bodyptr);
+ break;
+
case WMA_RATE_UPDATE_IND:
wma_process_rate_update_indicate(wma_handle,
(tSirRateUpdateInd *) msg->bodyptr);
diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c
index 2c5d519623e7..09cbd9772617 100644
--- a/core/wma/src/wma_mgmt.c
+++ b/core/wma/src/wma_mgmt.c
@@ -2893,6 +2893,8 @@ wma_process_mon_mgmt_tx_data(wmi_mgmt_hdr *hdr,
IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ);
txrx_status.chan_flags = channel_flags;
txrx_status.rate = ((txrx_status.rate == 6 /* Mbps */) ? 0x0c : 0x02);
+ txrx_status.tx_status = status;
+ txrx_status.add_rtap_ext = true;
wh = (struct ieee80211_frame *)qdf_nbuf_data(nbuf);
wh->i_fc[1] &= ~IEEE80211_FC1_WEP;
@@ -2941,7 +2943,60 @@ static int wma_process_mon_mgmt_tx_completion(tp_wma_handle wma_handle,
qdf_mem_copy(qdf_nbuf_data(wbuf), qdf_nbuf_data(nbuf), nbuf_len);
- if (!wma_process_mon_mgmt_tx_data(mgmt_hdr, wbuf, status))
+ if (!wma_process_mon_mgmt_tx_data(
+ mgmt_hdr, wbuf,
+ wma_mgmt_pktcapture_status_map(status)))
+ qdf_nbuf_free(wbuf);
+
+ return 0;
+}
+
+/**
+ * wma_process_mon_mgmt_tx() - process tx mgmt packets for mon interface
+ * without waiting for tx completion
+ * @nbuf: netbuf
+ * @nbuf_len: nbuf length
+ *
+ * Return: 0 for success or error code
+ */
+int wma_process_mon_mgmt_tx(qdf_nbuf_t nbuf, uint32_t nbuf_len,
+ struct wmi_mgmt_params *mgmt_param,
+ uint16_t chanfreq)
+{
+ qdf_nbuf_t wbuf;
+ wmi_mgmt_hdr mgmt_hdr = {0};
+
+ wbuf = qdf_nbuf_alloc(NULL, roundup(nbuf_len + RESERVE_BYTES, 4),
+ RESERVE_BYTES, 4, false);
+
+ if (!wbuf) {
+ WMA_LOGE("%s: Failed to allocate wbuf for mgmt len(%u)",
+ __func__, nbuf_len);
+ return -ENOMEM;
+ }
+
+ qdf_nbuf_put_tail(wbuf, nbuf_len);
+
+ qdf_mem_copy(qdf_nbuf_data(wbuf), qdf_nbuf_data(nbuf), nbuf_len);
+
+ mgmt_hdr.chan_freq = chanfreq;
+ /* Filling Tpc in rssi field.
+ * As Tpc is not available, filling with default value of tpc
+ */
+ mgmt_hdr.rssi = 0;
+ /* Assigning the local timestamp as TSF timestamp is not available*/
+ mgmt_hdr.tsf_l32 = (uint32_t)jiffies;
+
+ if (mgmt_param->tx_param.preamble_type == (1 << WMI_RATE_PREAMBLE_CCK))
+ mgmt_hdr.rate_kbps = 1000; /* Rate is 1 Mbps for CCK */
+ else
+ mgmt_hdr.rate_kbps = 6000; /* Rate is 6 Mbps for OFDM */
+
+ /* The mgmt tx packet is send to mon interface before tx completion.
+ * we do not have status for this packet, using magic number(0xFF)
+ * as status for mgmt tx packet
+ */
+ if (!wma_process_mon_mgmt_tx_data(&mgmt_hdr, wbuf, 0xFF))
qdf_nbuf_free(wbuf);
return 0;
@@ -3751,6 +3806,7 @@ wma_process_mon_mgmt_rx_data(wmi_mgmt_rx_hdr *hdr,
IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ);
txrx_status.chan_flags = channel_flags;
txrx_status.rate = ((txrx_status.rate == 6 /* Mbps */) ? 0x0c : 0x02);
+ txrx_status.add_rtap_ext = true;
wh = (struct ieee80211_frame *)qdf_nbuf_data(nbuf);
wh->i_fc[1] &= ~IEEE80211_FC1_WEP;
@@ -3947,7 +4003,7 @@ wma_mgmt_offload_data_event_handler(void *handle, uint8_t *data,
qdf_nbuf_set_protocol(wbuf, ETH_P_CONTROL);
qdf_mem_copy(qdf_nbuf_data(wbuf), param_tlvs->bufp, hdr->buf_len);
- status = hdr->tx_status;
+ status = wma_mgmt_pktcapture_status_map(hdr->tx_status);
if (!wma_process_mon_mgmt_tx_data(hdr, wbuf, status))
qdf_nbuf_free(wbuf);
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index 9d3909950965..b3506ad4e1a4 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -2806,8 +2806,8 @@ static int wma_fill_roam_synch_buffer(tp_wma_handle wma,
roam_synch_ind_ptr->rssi, roam_synch_ind_ptr->isBeacon);
if (!QDF_IS_STATUS_SUCCESS(
- wma->csr_roam_synch_cb((tpAniSirGlobal)wma->mac_context,
- roam_synch_ind_ptr, NULL, SIR_ROAMING_DEREGISTER_STA))) {
+ wma->csr_roam_synch_cb(wma->mac_context, roam_synch_ind_ptr,
+ NULL, SIR_ROAMING_DEREGISTER_STA))) {
WMA_LOGE("LFR3: CSR Roam synch cb failed");
wma_free_roam_synch_frame_ind(iface);
return status;
@@ -3235,8 +3235,7 @@ int wma_roam_synch_event_handler(void *handle, uint8_t *event,
goto cleanup_label;
}
qdf_mem_zero(bss_desc_ptr, sizeof(tSirBssDescription) + ie_len);
- if (QDF_IS_STATUS_ERROR(wma->pe_roam_synch_cb(
- (tpAniSirGlobal)wma->mac_context,
+ if (QDF_IS_STATUS_ERROR(wma->pe_roam_synch_cb(wma->mac_context,
roam_synch_ind_ptr, bss_desc_ptr,
SIR_ROAM_SYNCH_PROPAGATION))) {
WMA_LOGE("LFR3: PE roam synch cb failed");
@@ -3245,8 +3244,8 @@ int wma_roam_synch_event_handler(void *handle, uint8_t *event,
}
wma_roam_update_vdev(wma, roam_synch_ind_ptr);
- wma->csr_roam_synch_cb((tpAniSirGlobal)wma->mac_context,
- roam_synch_ind_ptr, bss_desc_ptr, SIR_ROAM_SYNCH_PROPAGATION);
+ wma->csr_roam_synch_cb(wma->mac_context, roam_synch_ind_ptr,
+ bss_desc_ptr, SIR_ROAM_SYNCH_PROPAGATION);
wma_process_roam_synch_complete(wma, synch_event->vdev_id);
/* update freq and channel width */
@@ -3270,22 +3269,23 @@ int wma_roam_synch_event_handler(void *handle, uint8_t *event,
wma->interfaces[synch_event->vdev_id].chan_width,
&wma->interfaces[synch_event->vdev_id].chanmode);
- wma->csr_roam_synch_cb((tpAniSirGlobal)wma->mac_context,
- roam_synch_ind_ptr, bss_desc_ptr, SIR_ROAM_SYNCH_COMPLETE);
+ wma->csr_roam_synch_cb(wma->mac_context, roam_synch_ind_ptr,
+ bss_desc_ptr, SIR_ROAM_SYNCH_COMPLETE);
wma->interfaces[synch_event->vdev_id].roam_synch_delay =
qdf_get_system_timestamp() - roam_synch_received;
WMA_LOGD("LFR3: roam_synch_delay:%d",
wma->interfaces[synch_event->vdev_id].roam_synch_delay);
- wma->csr_roam_synch_cb((tpAniSirGlobal)wma->mac_context,
- roam_synch_ind_ptr, bss_desc_ptr, SIR_ROAM_SYNCH_NAPI_OFF);
+ wma->csr_roam_synch_cb(wma->mac_context, roam_synch_ind_ptr,
+ bss_desc_ptr, SIR_ROAM_SYNCH_NAPI_OFF);
status = 0;
cleanup_label:
if (status != 0) {
if (roam_synch_ind_ptr)
- wma->csr_roam_synch_cb((tpAniSirGlobal)wma->mac_context,
- roam_synch_ind_ptr, NULL, SIR_ROAMING_ABORT);
+ wma->csr_roam_synch_cb(wma->mac_context,
+ roam_synch_ind_ptr, NULL,
+ SIR_ROAMING_ABORT);
roam_req = qdf_mem_malloc(sizeof(tSirRoamOffloadScanReq));
if (roam_req && synch_event) {
roam_req->Command = ROAM_SCAN_OFFLOAD_STOP;
@@ -6951,6 +6951,54 @@ static void wma_handle_btm_disassoc_imminent_msg(tp_wma_handle wma_handle,
(void *)del_sta_ctx, 0);
}
+/*
+ * wma_invalid_roam_reason_handler() - Handle Invalid roam notification
+ * @wma: wma handle
+ * @vdev_id: vdev id
+ * @op_code: Operation to be done by the callback
+ *
+ * This function calls pe and csr callbacks with proper op_code
+ *
+ * Return: None
+ */
+static void wma_invalid_roam_reason_handler(tp_wma_handle wma_handle,
+ uint32_t vdev_id,
+ uint32_t notif)
+{
+ roam_offload_synch_ind *roam_synch_data = NULL;
+ enum sir_roam_op_code op_code;
+
+ if (notif == WMI_ROAM_NOTIF_ROAM_START) {
+ wma_handle->interfaces[vdev_id].roaming_in_progress = true;
+ op_code = SIR_ROAMING_START;
+ } else if (notif == WMI_ROAM_NOTIF_ROAM_ABORT) {
+ wma_handle->interfaces[vdev_id].roaming_in_progress = false;
+ op_code = SIR_ROAMING_ABORT;
+ } else {
+ WMA_LOGE(FL("Invalid notif %d"), notif);
+ return;
+ }
+
+ roam_synch_data = qdf_mem_malloc(sizeof(*roam_synch_data));
+ if (!roam_synch_data)
+ return;
+
+ roam_synch_data->roamedVdevId = vdev_id;
+ wma_handle->pe_roam_synch_cb(wma_handle->mac_context, roam_synch_data,
+ NULL, op_code);
+ wma_handle->csr_roam_synch_cb(wma_handle->mac_context, roam_synch_data,
+ NULL, op_code);
+
+ qdf_mem_free(roam_synch_data);
+}
+
+void wma_handle_roam_sync_timeout(tp_wma_handle wma_handle,
+ struct roam_sync_timeout_timer_info *info)
+{
+ wma_invalid_roam_reason_handler(wma_handle, info->vdev_id,
+ WMI_ROAM_NOTIF_ROAM_ABORT);
+}
+
/**
* wma_roam_event_callback() - roam event callback
* @handle: wma handle
@@ -6968,7 +7016,6 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
WMI_ROAM_EVENTID_param_tlvs *param_buf;
wmi_roam_event_fixed_param *wmi_event;
struct sSirSmeRoamOffloadSynchInd *roam_synch_data;
- enum sir_roam_op_code op_code = {0};
param_buf = (WMI_ROAM_EVENTID_param_tlvs *) event_buf;
if (!param_buf) {
@@ -7040,29 +7087,8 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
break;
#endif
case WMI_ROAM_REASON_INVALID:
- roam_synch_data = qdf_mem_malloc(sizeof(*roam_synch_data));
- if (NULL == roam_synch_data) {
- WMA_LOGE("Memory unavailable for roam synch data");
- return -ENOMEM;
- }
- if (wmi_event->notif == WMI_ROAM_NOTIF_ROAM_START) {
- op_code = SIR_ROAMING_START;
- wma_handle->interfaces[wmi_event->vdev_id].
- roaming_in_progress = true;
- }
- if (wmi_event->notif == WMI_ROAM_NOTIF_ROAM_ABORT) {
- op_code = SIR_ROAMING_ABORT;
- wma_handle->interfaces[wmi_event->vdev_id].
- roaming_in_progress = false;
- }
- roam_synch_data->roamedVdevId = wmi_event->vdev_id;
- wma_handle->pe_roam_synch_cb(
- (tpAniSirGlobal)wma_handle->mac_context,
- roam_synch_data, NULL, op_code);
- wma_handle->csr_roam_synch_cb(
- (tpAniSirGlobal)wma_handle->mac_context,
- roam_synch_data, NULL, op_code);
- qdf_mem_free(roam_synch_data);
+ wma_invalid_roam_reason_handler(wma_handle, wmi_event->vdev_id,
+ wmi_event->notif);
break;
case WMI_ROAM_REASON_RSO_STATUS:
wma_rso_cmd_status_event_handler(wmi_event);
@@ -7074,9 +7100,9 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
return -ENOMEM;
}
roam_synch_data->roamedVdevId = wmi_event->vdev_id;
- wma_handle->csr_roam_synch_cb(
- (tpAniSirGlobal)wma_handle->mac_context,
- roam_synch_data, NULL, SIR_ROAMING_INVOKE_FAIL);
+ wma_handle->csr_roam_synch_cb(wma_handle->mac_context,
+ roam_synch_data, NULL,
+ SIR_ROAMING_INVOKE_FAIL);
qdf_mem_free(roam_synch_data);
break;
default:
diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c
index 6e254d1cb79f..af9459c262e0 100644
--- a/core/wma/src/wma_utils.c
+++ b/core/wma/src/wma_utils.c
@@ -6577,3 +6577,33 @@ QDF_STATUS wma_get_roam_scan_stats(WMA_HANDLE handle,
return QDF_STATUS_SUCCESS;
}
+/**
+ * wma_mgmt_pktcapture_status_map() - map Tx status for MGMT packets
+ * with packet capture Tx status
+ * @status: Tx status
+ *
+ * Return: pktcapture_tx_status enum
+ */
+enum pktcapture_tx_status
+wma_mgmt_pktcapture_status_map(uint8_t status)
+{
+ enum pktcapture_tx_status tx_status;
+
+ switch (status) {
+ case WMI_MGMT_TX_COMP_TYPE_COMPLETE_OK:
+ tx_status = pktcapture_tx_status_ok;
+ break;
+ case WMI_MGMT_TX_COMP_TYPE_DISCARD:
+ tx_status = pktcapture_tx_status_discard;
+ break;
+ case WMI_MGMT_TX_COMP_TYPE_COMPLETE_NO_ACK:
+ tx_status = pktcapture_tx_status_no_ack;
+ break;
+ default:
+ tx_status = pktcapture_tx_status_discard;
+ break;
+ }
+
+ return tx_status;
+}
+