qcacld-3.0: Record station connect/disconnect event

Record station connect/disconnect event for debug connectivity
issues. Dump the latest 20 records for unexpected disconnect case.

Change-Id: Ibf04b98a0124b84b77e3b5647e4d4234189b0ab2
CRs-Fixed: 2849471
This commit is contained in:
Liangwei Dong 2021-01-11 14:50:33 +08:00 • committed by snandini
commit 6dc9ff0e8d
4 changed files with 58 additions and 3 deletions

View file

@ -82,6 +82,7 @@
#include "wlan_if_mgr_ucfg_api.h"
#include "wlan_if_mgr_public_struct.h"
#endif
#include "wlan_roam_debug.h"
/* These are needed to recognize WPA and RSN suite types */
#define HDD_WPA_OUI_SIZE 4
@ -1968,6 +1969,13 @@ static QDF_STATUS hdd_dis_connect_handler(struct hdd_adapter *adapter,
wlan_hdd_enable_roaming(adapter, RSO_CONNECT_START);
}
#endif
wlan_rec_conn_info(adapter->vdev_id, DEBUG_CONN_DISCONNECT_HANDLER,
sta_ctx->conn_info.bssid.bytes,
(roam_result << 24) | (roam_status << 16) |
(sta_ctx->conn_info.conn_state << 8) |
send_discon_ind,
(roam_info ? roam_info->status_code : 0) << 16 |
(roam_info ? roam_info->disassoc_reason : 0));
/* indicate disconnected event to nl80211 */
/*
@ -2624,6 +2632,12 @@ static void hdd_send_re_assoc_event(struct net_device *dev,
hdd_debug("Req RSN IE:");
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_DEBUG,
final_req_ie, (ssid_ie_len + reqRsnLength));
wlan_rec_conn_info(adapter->vdev_id,
DEBUG_CONN_ROAMED_IND,
bss ? bss->bssid : NULL,
roam_info->u.pConnectedProfile->AuthType,
0);
hdd_send_roamed_ind(dev, bss, final_req_ie,
(ssid_ie_len + reqRsnLength), rsp_rsn_ie,
rsp_rsn_lemgth);
@ -3015,6 +3029,11 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
/* Save the connection info from CSR... */
hdd_conn_save_connect_info(adapter, roam_info,
eCSR_BSS_TYPE_INFRASTRUCTURE);
wlan_rec_conn_info(adapter->vdev_id, DEBUG_CONN_ASSOCIATION,
sta_ctx->conn_info.bssid.bytes,
(roam_result << 16) | roam_status,
(sta_ctx->conn_info.conn_state << 16) |
(roam_info ? roam_info->status_code : 0));
if (hdd_add_beacon_filter(adapter) != 0)
hdd_err("hdd_add_beacon_filter() failed");
@ -3291,7 +3310,14 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
cdp_hl_fc_set_td_limit(soc,
adapter->vdev_id,
conn_info_freq);
wlan_rec_conn_info(
adapter->vdev_id,
DEBUG_CONN_ROAMED,
roam_bss ? roam_bss->bssid :
NULL,
roam_info->u.
pConnectedProfile->AuthType,
0);
hdd_send_roamed_ind(
dev,
roam_bss,
@ -3500,6 +3526,11 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
adapter->vdev_id,
QDF_MAC_ADDR_REF(sta_ctx->requested_bssid.bytes),
roam_result, roam_status);
wlan_rec_conn_info(adapter->vdev_id, DEBUG_CONN_ASSOCIATION,
sta_ctx->conn_info.bssid.bytes,
(roam_result << 16) | roam_status,
(sta_ctx->conn_info.conn_state << 16) |
(roam_info ? roam_info->status_code : 0));
if ((eCSR_ROAM_RESULT_SCAN_FOR_SSID_FAILURE == roam_result) ||
(roam_info &&

View file

@ -165,6 +165,7 @@
#include "wlan_if_mgr_public_struct.h"
#endif
#include "wlan_wfa_ucfg_api.h"
#include "wlan_roam_debug.h"
#define g_mode_rates_size (12)
#define a_mode_rates_size (8)
@ -21222,6 +21223,7 @@ int wlan_hdd_disconnect(struct hdd_adapter *adapter, u16 reason,
{
int ret;
mac_handle_t mac_handle;
struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
mac_handle = hdd_adapter_get_mac_handle(adapter);
wlan_hdd_wait_for_roaming(mac_handle, adapter);
@ -21231,7 +21233,9 @@ int wlan_hdd_disconnect(struct hdd_adapter *adapter, u16 reason,
reset_mscs_params(adapter);
wlan_hdd_netif_queue_control(adapter,
WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER, WLAN_CONTROL_PATH);
wlan_rec_conn_info(adapter->vdev_id, DEBUG_CONN_DISCONNECT,
sta_ctx->conn_info.bssid.bytes,
sta_ctx->conn_info.conn_state, mac_reason);
ret = wlan_hdd_wait_for_disconnect(mac_handle, adapter, reason,
mac_reason);
@ -21366,6 +21370,7 @@ static int __wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy,
hdd_err("Unexpected cfg disconnect called while in state: %d",
sta_ctx->conn_info.conn_state);
hdd_set_disconnect_status(adapter, false);
wlan_rec_debug_dump_table(REC_CONN, 20, true);
}
return status;

View file

@ -8110,6 +8110,9 @@ void hdd_connect_result(struct net_device *dev, const u8 *bssid,
roam_info->u.pConnectedProfile->SSID.ssId,
roam_info->u.pConnectedProfile->SSID.length);
}
wlan_rec_conn_info(adapter->vdev_id, DEBUG_CONN_CONNECT_RESULT,
bssid ? bssid : NULL,
status << 16 | connect_timeout, timeout_reason);
if (hdd_fils_update_connect_results(dev, bssid, bss,
roam_info, req_ie, req_ie_len, resp_ie,
@ -8355,6 +8358,8 @@ QDF_STATUS hdd_start_all_adapters(struct hdd_context *hdd_ctx)
eConnectionState_NotConnected == conn_state ||
eConnectionState_Disconnecting == conn_state) {
union iwreq_data wrqu;
struct hdd_station_ctx *sta_ctx =
WLAN_HDD_GET_STATION_CTX_PTR(adapter);
memset(&wrqu, '\0', sizeof(wrqu));
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
@ -8363,6 +8368,12 @@ QDF_STATUS hdd_start_all_adapters(struct hdd_context *hdd_ctx)
&wrqu, NULL);
adapter->session.station.
hdd_reassoc_scenario = false;
wlan_rec_conn_info(adapter->vdev_id,
DEBUG_CONN_DISCONNECT_IND,
sta_ctx->conn_info.
bssid.bytes,
REASON_DEVICE_RECOVERY,
0);
/* indicate disconnected event to nl80211 */
wlan_hdd_cfg80211_indicate_disconnect(

View file

@ -79,6 +79,7 @@
#include "wlan_if_mgr_public_struct.h"
#include "wlan_if_mgr_ucfg_api.h"
#endif
#include "wlan_roam_debug.h"
#define RSN_AUTH_KEY_MGMT_SAE WLAN_RSN_SEL(WLAN_AKM_SAE)
#define MAX_PWR_FCC_CHAN_12 8
@ -14894,6 +14895,10 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
pProfile->negotiatedMCEncryptionType,
mac->scan.countryCodeCurrent[0],
mac->scan.countryCodeCurrent[1]);
wlan_rec_conn_info(sessionId, DEBUG_CONN_CONNECTING,
pBssDescription->bssId,
pProfile->negotiatedAuthType,
pBssDescription->chan_freq);
/* bsstype */
dw_tmp = csr_translate_bsstype_to_mac_type
(pProfile->BSSType);
@ -22896,7 +22901,10 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
sme_debug("LFR3: reason: %d roam invoke in progress %d, source %d",
reason, vdev_roam_params->roam_invoke_in_progress,
vdev_roam_params->source);
if (reason == SIR_ROAM_SYNCH_PROPAGATION)
wlan_rec_conn_info(session_id, DEBUG_CONN_ROAMING,
bss_desc ? bss_desc->bssId : NULL,
reason, session->connectState);
switch (reason) {
case SIR_ROAMING_DEREGISTER_STA:
/*