qcacld-3.0: Add beacon report related logging to kmsg

Below beacon report/NEIGH rpt related details needs to be logged into kmsg:
i. Beacon Report Request
	1. Token, Class, Channel list, Duration, Mode, BSSID wildcard, SSID
ii. Beacon Report Response
	1. Token, Scanned AP Number
	2. Reason – If Beacon Report could not proceed.
iii. Neighbor Report request
	1. Sent from Mobile
iv. Neighbor Report Response
	1. Channel list

Add the required details in beacon/neighbor report TX/RX path

Change-Id: I719863ecd4ac607d65dbbfde806921fe7214ce10
CRs-Fixed: 2610596
This commit is contained in:
Pragaspathi Thilagaraj 2020-01-27 16:52:50 +05:30 • committed by nshrivas
commit acdf340ee1
4 changed files with 89 additions and 56 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2012, 2014-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2011-2012, 2014-2020 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
@ -31,6 +31,7 @@
#define RRM_BCN_RPT_NO_BSS_INFO 0
#define RRM_BCN_RPT_MIN_RPT 1
#define RRM_CH_BUF_LEN 45
QDF_STATUS rrm_initialize(struct mac_context *mac);

View file

@ -4547,8 +4547,6 @@ lim_send_radio_measure_report_action_frame(struct mac_context *mac,
smeSessionId = pe_session->smeSessionId;
pe_debug("dialog_token %d num_report %d is_last_frame %d",
dialog_token, num_report, is_last_frame);
frm->Category.category = ACTION_CATEGORY_RRM;
frm->Action.action = RRM_RADIO_MEASURE_RPT;
@ -4594,11 +4592,12 @@ lim_send_radio_measure_report_action_frame(struct mac_context *mac,
}
}
nStatus =
dot11f_get_packed_radio_measurement_report_size(mac, frm, &nPayload);
if (DOT11F_FAILED(nStatus)) {
pe_err("Failed to calculate the packed size for a Radio Measure Report (0x%08x)",
nStatus);
pe_nofl_err("TX: [802.11 RRM] Failed to get packed size for RM Report (0x%08x)",
nStatus);
/* We'll fall back on the worst case scenario: */
nPayload = sizeof(tDot11fLinkMeasurementReport);
qdf_mem_free(frm);
@ -4614,7 +4613,7 @@ lim_send_radio_measure_report_action_frame(struct mac_context *mac,
cds_packet_alloc((uint16_t) nBytes, (void **)&pFrame,
(void **)&pPacket);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
pe_err("Failed to allocate %d bytes for a Radio Measure "
pe_nofl_err("TX: [802.11 RRM] Allocation of %d bytes failed for RM"
"Report", nBytes);
qdf_mem_free(frm);
return QDF_STATUS_E_FAILURE;
@ -4641,7 +4640,7 @@ lim_send_radio_measure_report_action_frame(struct mac_context *mac,
nPayload, &nPayload);
if (DOT11F_FAILED(nStatus)) {
pe_err("Failed to pack an Radio Measure Report (0x%08x)",
pe_nofl_err("Failed to pack an Radio Measure Report (0x%08x)",
nStatus);
/* FIXME - Need to convert to QDF_STATUS */
@ -4652,8 +4651,18 @@ lim_send_radio_measure_report_action_frame(struct mac_context *mac,
nStatus);
}
pe_warn("Sending a Radio Measure Report to");
lim_print_mac_addr(mac, peer, LOGW);
pe_debug("Sending Radio Measure Report to %pM", peer);
if (frm->MeasurementReport[0].type == SIR_MAC_RRM_BEACON_TYPE)
pe_nofl_info("TX: [802.11 BCN_RPT] seq_no:%d dialog_token:%d no. of APs:%d is_last_rpt:%d",
(pMacHdr->seqControl.seqNumHi << HIGH_SEQ_NUM_OFFSET |
pMacHdr->seqControl.seqNumLo),
dialog_token, frm->num_MeasurementReport,
is_last_report);
else
pe_nofl_info("TX: [802.11 RRM] seq_no:%d dialog_token %d num_report %d is_last_frm %d",
(pMacHdr->seqControl.seqNumHi << HIGH_SEQ_NUM_OFFSET |
pMacHdr->seqControl.seqNumLo),
dialog_token, num_report, is_last_frame);
if (wlan_reg_is_5ghz_ch_freq(pe_session->curr_op_freq) ||
pe_session->opmode == QDF_P2P_CLIENT_MODE ||
@ -4662,26 +4671,22 @@ lim_send_radio_measure_report_action_frame(struct mac_context *mac,
MTRACE(qdf_trace(QDF_MODULE_ID_PE, TRACE_CODE_TX_MGMT,
pe_session->peSessionId, pMacHdr->fc.subType));
qdf_status = wma_tx_frame(mac,
pPacket,
(uint16_t) nBytes,
TXRX_FRM_802_11_MGMT,
ANI_TXDIR_TODS,
7, lim_tx_complete, pFrame, txFlag,
smeSessionId, 0, RATEID_DEFAULT);
qdf_status = wma_tx_frame(mac, pPacket, (uint16_t)nBytes,
TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS,
7, lim_tx_complete, pFrame, txFlag,
smeSessionId, 0, RATEID_DEFAULT);
MTRACE(qdf_trace(QDF_MODULE_ID_PE, TRACE_CODE_TX_COMPLETE,
pe_session->peSessionId, qdf_status));
if (QDF_STATUS_SUCCESS != qdf_status) {
pe_err("wma_tx_frame FAILED! Status [%d]", qdf_status);
pe_nofl_err("TX: [802.11 RRM] Send FAILED! err_status [%d]",
qdf_status);
status_code = QDF_STATUS_E_FAILURE;
/* Pkt will be freed up by the callback */
qdf_mem_free(frm);
return status_code;
} else {
qdf_mem_free(frm);
return QDF_STATUS_SUCCESS;
}
qdf_mem_free(frm);
return status_code;
returnAfterError:
qdf_mem_free(frm);
cds_packet_free((void *)pPacket);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2020 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
@ -496,8 +496,11 @@ rrm_process_beacon_report_req(struct mac_context *mac,
int8_t maxDuration;
uint8_t sign;
tDot11fIEAPChannelReport *ie_ap_chan_rpt;
uint8_t tmp_idx;
uint8_t tmp_idx, buf_left, buf_cons;
uint16_t ch_ctr = 0;
char req_ssid[WLAN_SSID_MAX_LEN] = {0};
char ch_buf[RRM_CH_BUF_LEN];
char *tmp_buf = NULL;
if (pBeaconReq->measurement_request.Beacon.BeaconReporting.present &&
(pBeaconReq->measurement_request.Beacon.BeaconReporting.
@ -507,7 +510,7 @@ rrm_process_beacon_report_req(struct mac_context *mac,
/* Beacon reporting should not be included in request if number of repetitons is zero. */
/* IEEE Std 802.11k-2008 Table 7-29g and section 11.10.8.1 */
pe_err("Dropping the request: Reporting condition included in beacon report request and it is not zero");
pe_nofl_err("RX: [802.11 BCN_RPT] Dropping req: Reporting condition included is not zero");
return eRRM_INCAPABLE;
}
@ -533,19 +536,31 @@ rrm_process_beacon_report_req(struct mac_context *mac,
measDuration = pBeaconReq->measurement_request.Beacon.meas_duration;
pe_info("maxDuration = %d sign = %d maxMeasduration = %d measDuration = %d",
maxDuration, sign, maxMeasduration, measDuration);
if (pBeaconReq->measurement_request.Beacon.SSID.present)
qdf_snprintf(req_ssid, WLAN_SSID_MAX_LEN, "%s",
pBeaconReq->measurement_request.Beacon.SSID.ssid);
pe_nofl_info("RX: [802.11 BCN_RPT] SSID:%s BSSID:%pM Token:%d op_class:%d ch:%d meas_mode:%d meas_duration:%d",
req_ssid, pBeaconReq->measurement_request.Beacon.BSSID,
pBeaconReq->measurement_token,
pBeaconReq->measurement_request.Beacon.regClass,
pBeaconReq->measurement_request.Beacon.channel,
pBeaconReq->measurement_request.Beacon.meas_mode,
measDuration);
pe_debug("RX: [802.11 BCN_RPT] max_dur: %d sign: %d max_meas_dur: %d",
maxDuration, sign, maxMeasduration);
if (measDuration == 0 &&
pBeaconReq->measurement_request.Beacon.meas_mode !=
eSIR_BEACON_TABLE) {
pe_err("Invalid measurement duration");
pe_nofl_err("RX: [802.11 BCN_RPT] Invalid measurement duration");
return eRRM_REFUSED;
}
if (maxMeasduration < measDuration) {
if (pBeaconReq->durationMandatory) {
pe_err("Dropping the request: duration mandatory and maxduration > measduration");
pe_nofl_err("RX: [802.11 BCN_RPT] Dropping the req: duration mandatory & maxduration > measduration");
return eRRM_REFUSED;
} else
measDuration = maxMeasduration;
@ -561,18 +576,17 @@ rrm_process_beacon_report_req(struct mac_context *mac,
pCurrentReq->request.Beacon.last_beacon_report_indication =
pBeaconReq->measurement_request.Beacon.
last_beacon_report_indication.last_fragment;
pe_debug("Last Beacon Report in request = %d",
pCurrentReq->request.Beacon.
last_beacon_report_indication);
pe_debug("RX: [802.11 BCN_RPT] Last Bcn Report in the req: %d",
pCurrentReq->request.Beacon.last_beacon_report_indication);
} else {
pCurrentReq->request.Beacon.last_beacon_report_indication = 0;
pe_debug("Last Beacon report not present in request");
pe_debug("RX: [802.11 BCN_RPT] Last Bcn rpt ind not present");
}
if (pBeaconReq->measurement_request.Beacon.RequestedInfo.present) {
if (!pBeaconReq->measurement_request.Beacon.RequestedInfo.
num_requested_eids) {
pe_debug("802.11k BCN RPT: Requested num of EID is 0");
pe_debug("RX: [802.11 BCN_RPT]: Requested num of EID is 0");
return eRRM_FAILURE;
}
pCurrentReq->request.Beacon.reqIes.pElementIds =
@ -589,7 +603,7 @@ rrm_process_beacon_report_req(struct mac_context *mac,
pBeaconReq->measurement_request.Beacon.
RequestedInfo.requested_eids,
pCurrentReq->request.Beacon.reqIes.num);
pe_debug("802.11k BCN RPT: Requested EIDs: num:[%d]",
pe_debug("RX: [802.11 BCN_RPT] Requested EIDs:[%d]",
pCurrentReq->request.Beacon.reqIes.num);
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
pCurrentReq->request.Beacon.reqIes.pElementIds,
@ -614,7 +628,7 @@ rrm_process_beacon_report_req(struct mac_context *mac,
if (!wlan_reg_is_6ghz_supported(mac->pdev) &&
(wlan_reg_is_6ghz_op_class(mac->pdev,
pBeaconReq->measurement_request.Beacon.regClass))) {
pe_err("channel belongs to 6 ghz spectrum, abort");
pe_nofl_err("RX: [802.11 BCN_RPT] Ch belongs to 6 ghz spectrum, abort");
qdf_mem_free(psbrr);
return eRRM_FAILURE;
}
@ -654,7 +668,7 @@ rrm_process_beacon_report_req(struct mac_context *mac,
if (!wlan_reg_is_6ghz_supported(mac->pdev) &&
(wlan_reg_is_6ghz_op_class(mac->pdev,
ie_ap_chan_rpt->regulatoryClass))) {
pe_err("channel belongs to 6 ghz spectrum, abort");
pe_nofl_err("RX: [802.11 BCN_RPT] Ch belongs to 6 ghz spectrum, abort");
qdf_mem_free(psbrr);
return eRRM_FAILURE;
}
@ -670,7 +684,19 @@ rrm_process_beacon_report_req(struct mac_context *mac,
if (ch_ctr >= QDF_ARRAY_SIZE(psbrr->channel_list.chan_freq_lst))
break;
}
psbrr->channel_list.num_channels = ch_ctr;
buf_left = sizeof(ch_buf);
tmp_buf = ch_buf;
for (idx_rpt = 0; idx_rpt < ch_ctr; idx_rpt++) {
buf_cons = qdf_snprint(tmp_buf, buf_left, "%d ",
psbrr->channel_list.chan_freq_lst[idx_rpt]);
buf_left -= buf_cons;
tmp_buf += buf_cons;
}
if (ch_ctr)
pe_nofl_info("RX: [802.11 BCN_RPT] Ch-list:%s", ch_buf);
/* Send request to SME. */
mmh_msg.type = eWNI_SME_BEACON_REPORT_REQ_IND;
@ -853,7 +879,8 @@ rrm_process_beacon_report_xmit(struct mac_context *mac_ctx,
session_entry = pe_find_session_by_bssid(mac_ctx,
beacon_xmit_ind->bssId, &session_id);
if (!session_entry) {
pe_err("session does not exist for given bssId");
pe_err("TX: [802.11 BCN_RPT] Session does not exist for bssId:%pM",
beacon_xmit_ind->bssId);
status = QDF_STATUS_E_FAILURE;
goto end;
}
@ -868,18 +895,18 @@ rrm_process_beacon_report_xmit(struct mac_context *mac_ctx,
for (i = 0; i < MAX_BEACON_REPORTS &&
bss_desc_count < beacon_xmit_ind->numBssDesc; i++) {
beacon_report =
&report[i].report.beaconReport;
beacon_report = &report[i].report.beaconReport;
/*
* If the scan result is NULL then send report request
* with option subelement as NULL.
*/
pe_debug("report %d bss %d", i, bss_desc_count);
pe_debug("TX: [802.11 BCN_RPT] report %d bss %d", i,
bss_desc_count);
bss_desc = beacon_xmit_ind->
pBssDescription[bss_desc_count];
/* Prepare the beacon report and send it to the peer.*/
report[i].token =
beacon_xmit_ind->uDialogToken;
report[i].token = beacon_xmit_ind->uDialogToken;
report[i].refused = 0;
report[i].incapable = 0;
report[i].type = SIR_MAC_RRM_BEACON_TYPE;
@ -914,11 +941,11 @@ rrm_process_beacon_report_xmit(struct mac_context *mac_ctx,
switch (curr_req->request.Beacon.reportingDetail) {
case BEACON_REPORTING_DETAIL_NO_FF_IE:
/* 0: No need to include any elements. */
pe_debug("No reporting detail requested");
pe_debug("TX: [802.11 BCN_RPT] No reporting detail requested");
break;
case BEACON_REPORTING_DETAIL_ALL_FF_REQ_IE:
/* 1: Include all FFs and Requested Ies. */
pe_debug("Only requested IEs in reporting detail requested");
pe_debug("TX: [802.11 BCN_RPT] Only requested IEs in reporting detail requested");
if (!bss_desc)
break;
@ -935,7 +962,7 @@ rrm_process_beacon_report_xmit(struct mac_context *mac_ctx,
case BEACON_REPORTING_DETAIL_ALL_FF_IE:
/* 2: default - Include all FFs and all Ies. */
default:
pe_debug("Default all IEs and FFs");
pe_debug("TX: [802.11 BCN_RPT] Default all IEs and FFs");
if (!bss_desc)
break;
@ -962,7 +989,7 @@ rrm_process_beacon_report_xmit(struct mac_context *mac_ctx,
last_beacon_report_indication) {
offset = GET_IE_LEN_IN_BSS(
bss_desc->length) - rem_len;
pe_debug("offset %d ie_len %lu rem_len %d frag_id %d",
pe_debug("TX: [802.11 BCN_RPT] offset %d ie_len %lu rem_len %d frag_id %d",
offset,
GET_IE_LEN_IN_BSS(bss_desc->length),
rem_len, frag_id);
@ -975,17 +1002,17 @@ rrm_process_beacon_report_xmit(struct mac_context *mac_ctx,
false;
frag_id = 0;
bss_desc_count++;
pe_debug("No remaining IEs");
pe_debug("TX: [802.11 BCN_RPT] No remaining IEs");
}
if (curr_req->request.Beacon.
last_beacon_report_indication) {
pe_debug("Setting last beacon report support");
pe_debug("TX: [802.11 BCN_RPT] Setting last beacon report support");
beacon_report->last_bcn_report_ind_support = 1;
}
}
pe_debug("Total reports filled %d", i);
pe_debug("TX: [802.11 BCN_RPT] Total reports filled %d", i);
num_frames = i / RADIO_REPORTS_MAX_IN_A_FRAME;
if (i % RADIO_REPORTS_MAX_IN_A_FRAME)
num_frames++;
@ -994,7 +1021,7 @@ rrm_process_beacon_report_xmit(struct mac_context *mac_ctx,
num_reports_in_frame = QDF_MIN((i - report_index),
RADIO_REPORTS_MAX_IN_A_FRAME);
pe_debug("Sending Action frame number %d",
pe_debug("TX: [802.11 BCN_RPT] Sending Action frame number %d",
num_reports_in_frame);
lim_send_radio_measure_report_action_frame(mac_ctx,
curr_req->dialog_token, num_reports_in_frame,
@ -1045,8 +1072,8 @@ static void rrm_process_beacon_request_failure(struct mac_context *mac,
pReport->incapable = 1;
break;
default:
pe_err("Beacon request processing failed no report sent with status %d",
status);
pe_err("RX [802.11 BCN_RPT] Beacon request processing failed no report sent with status %d",
status);
qdf_mem_free(pReport);
return;
}
@ -1199,7 +1226,7 @@ rrm_process_radio_measurement_request(struct mac_context *mac_ctx,
report = qdf_mem_malloc(sizeof(tSirMacRadioMeasureReport));
if (!report)
return QDF_STATUS_E_NOMEM;
pe_err("No requestIes in the measurement request, sending incapable report");
pe_err("RX: [802.11 RRM] No requestIes in the measurement request, sending incapable report");
report->incapable = 1;
num_report = 1;
lim_send_radio_measure_report_action_frame(mac_ctx,
@ -1210,7 +1237,7 @@ rrm_process_radio_measurement_request(struct mac_context *mac_ctx,
}
/* PF Fix */
if (rrm_req->NumOfRepetitions.repetitions > 0) {
pe_info("number of repetitions %d",
pe_info("RX: [802.11 RRM] number of repetitions %d, sending incapable report",
rrm_req->NumOfRepetitions.repetitions);
/*
* Send a report with incapable bit set.

View file

@ -1562,7 +1562,7 @@ static void rrm_iter_meas_timer_handle(void *userData)
{
struct mac_context *mac = (struct mac_context *) userData;
sme_warn("Randomization timer expired...send on next channel");
sme_debug("Randomization timer expired...send on next channel");
/* Issue a scan req for next channel. */
sme_rrm_issue_scan_req(mac);
}