qcacmn: Add support to parse roam frame info TLV
Add support to parse roam frame info TLV Change-Id: I3addd7256c003ca25c4dd5545ee0aa6a6c18a20f CRs-Fixed: 3013488
This commit is contained in:

gecommit door
Madan Koyyalamudi

bovenliggende
d57b561f80
commit
517a254443
@@ -707,13 +707,14 @@ wmi_unified_extract_hw_mode_resp(wmi_unified_t wmi,
|
||||
* @evt_buf: Pointer to the event buffer
|
||||
* @trig: Pointer to destination structure to fill data
|
||||
* @idx: TLV id
|
||||
* @btm_idx: BTM candidates index
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wmi_unified_extract_roam_trigger_stats(wmi_unified_t wmi, void *evt_buf,
|
||||
struct wmi_roam_trigger_info *trig,
|
||||
uint8_t idx);
|
||||
uint8_t idx, uint8_t btm_idx);
|
||||
|
||||
/**
|
||||
* wmi_unified_extract_roam_scan_stats() - Extract roam scan stats from
|
||||
|
@@ -7518,12 +7518,27 @@ struct wmi_roam_scan_stats_res {
|
||||
struct wmi_roam_scan_stats_params roam_scan[0];
|
||||
};
|
||||
|
||||
#define MAX_ROAM_CANDIDATE_AP 9
|
||||
#define MAX_ROAM_SCAN_CHAN 38
|
||||
#define MAX_ROAM_SCAN_STATS_TLV 5
|
||||
#define MAX_ROAM_CANDIDATE_AP 9
|
||||
#define MAX_ROAM_SCAN_CHAN 38
|
||||
#define MAX_ROAM_SCAN_STATS_TLV 5
|
||||
#define WLAN_MAX_BTM_CANDIDATE 8
|
||||
#define WLAN_ROAM_MAX_FRAME_INFO 6
|
||||
/**
|
||||
* struct btm_req_candidate_info - BTM request candidate
|
||||
* info
|
||||
* @candidate_bssid: Candidate bssid received in BTM request
|
||||
* @timestamp: candidate_timestamp;
|
||||
* @preference: candidate preference
|
||||
*/
|
||||
struct wmi_btm_req_candidate_info {
|
||||
struct qdf_mac_addr candidate_bssid;
|
||||
uint32_t timestamp;
|
||||
uint8_t preference;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wmi_roam_btm_trigger_data - BTM roam trigger related information
|
||||
* @timestamp: timestamp
|
||||
* @btm_request_mode: BTM request mode - solicited/unsolicited
|
||||
* @disassoc_timer: Number of TBTT before AP disassociates the STA in ms
|
||||
* @validity_interval: Preferred candidate list validity interval in ms
|
||||
@@ -7533,8 +7548,11 @@ struct wmi_roam_scan_stats_res {
|
||||
* in milli seconds
|
||||
* @btm_mbo_assoc_retry_timeout: BTM MBO assoc retry timeout value in
|
||||
* milli seconds
|
||||
* @token: BTM request dialog token
|
||||
* @btm_cand: BTM request candidate information
|
||||
*/
|
||||
struct wmi_roam_btm_trigger_data {
|
||||
uint32_t timestamp;
|
||||
uint32_t btm_request_mode;
|
||||
uint32_t disassoc_timer;
|
||||
uint32_t validity_interval;
|
||||
@@ -7542,6 +7560,8 @@ struct wmi_roam_btm_trigger_data {
|
||||
uint32_t btm_resp_status;
|
||||
uint32_t btm_bss_termination_timeout;
|
||||
uint32_t btm_mbo_assoc_retry_timeout;
|
||||
uint16_t token;
|
||||
struct wmi_btm_req_candidate_info btm_cand[WLAN_MAX_BTM_CANDIDATE];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -7643,6 +7663,7 @@ struct wmi_roam_candidate_info {
|
||||
* @type: 0 - Partial roam scan; 1 - Full roam scan
|
||||
* @num_ap: Number of candidate APs.
|
||||
* @num_chan: Number of channels.
|
||||
* @frame_info_count: Frame info TLV count
|
||||
* @next_rssi_threshold: Next roam can trigger rssi threshold
|
||||
* @chan_freq: List of frequencies scanned as part of roam scan
|
||||
* @ap: List of candidate AP info
|
||||
@@ -7652,6 +7673,7 @@ struct wmi_roam_scan_data {
|
||||
uint16_t type;
|
||||
uint16_t num_ap;
|
||||
uint16_t num_chan;
|
||||
uint16_t frame_info_count;
|
||||
uint32_t next_rssi_threshold;
|
||||
uint16_t chan_freq[MAX_ROAM_SCAN_CHAN];
|
||||
struct wmi_roam_candidate_info ap[MAX_ROAM_CANDIDATE_AP];
|
||||
@@ -7672,6 +7694,9 @@ struct wmi_roam_result {
|
||||
uint32_t fail_reason;
|
||||
};
|
||||
|
||||
#define WLAN_11KV_TYPE_BTM_REQ 1
|
||||
#define WLAN_11KV_TYPE_NEIGHBOR_RPT 2
|
||||
|
||||
/**
|
||||
* struct wmi_neighbor_report_data - Neighbor report/BTM request related
|
||||
* data.
|
||||
@@ -7680,7 +7705,11 @@ struct wmi_roam_result {
|
||||
* @req_type: 1 - BTM query ; 2 - 11K neighbor report request
|
||||
* @req_time: Request timestamp in ms
|
||||
* @resp_time: Response timestamp in ms
|
||||
* @num_freq: Number of frequencies
|
||||
* @freq: Channel frequency in Mhz
|
||||
* @btm_query_token: BTM query dialog token.
|
||||
* @btm_query_reason: BTM query reasons as defined in
|
||||
* IEEE802.11v spec table 7-43x
|
||||
*/
|
||||
struct wmi_neighbor_report_data {
|
||||
bool present;
|
||||
@@ -7690,6 +7719,8 @@ struct wmi_neighbor_report_data {
|
||||
uint32_t resp_time;
|
||||
uint8_t num_freq;
|
||||
uint32_t freq[MAX_ROAM_SCAN_CHAN];
|
||||
uint16_t btm_query_token;
|
||||
uint8_t btm_query_reason;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -391,6 +391,11 @@ QDF_STATUS
|
||||
QDF_STATUS
|
||||
(*extract_roam_msg_info)(wmi_unified_t wmi_handle, void *evt_buf,
|
||||
struct roam_msg_info *dst, uint8_t idx);
|
||||
|
||||
QDF_STATUS
|
||||
(*extract_roam_frame_info)(wmi_unified_t wmi_handle, void *evt_buf,
|
||||
struct roam_frame_info *dst, uint8_t idx,
|
||||
uint8_t num_frames);
|
||||
#ifdef ROAM_TARGET_IF_CONVERGENCE
|
||||
/**
|
||||
* extract_roam_sync_event - Extract roam sync event func ptr
|
||||
@@ -2282,7 +2287,7 @@ QDF_STATUS
|
||||
(*extract_roam_trigger_stats)(wmi_unified_t wmi_handle,
|
||||
void *evt_buf,
|
||||
struct wmi_roam_trigger_info *trig,
|
||||
uint8_t idx);
|
||||
uint8_t idx, uint8_t btm_idx);
|
||||
|
||||
QDF_STATUS
|
||||
(*extract_roam_scan_stats)(wmi_unified_t wmi_handle,
|
||||
|
@@ -3255,11 +3255,11 @@ QDF_STATUS
|
||||
wmi_unified_extract_roam_trigger_stats(wmi_unified_t wmi,
|
||||
void *evt_buf,
|
||||
struct wmi_roam_trigger_info *trig,
|
||||
uint8_t idx)
|
||||
uint8_t idx, uint8_t btm_idx)
|
||||
{
|
||||
if (wmi->ops->extract_roam_trigger_stats)
|
||||
return wmi->ops->extract_roam_trigger_stats(wmi, evt_buf, trig,
|
||||
idx);
|
||||
idx, btm_idx);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
@@ -14991,6 +14991,73 @@ static uint32_t wmi_convert_fw_to_cm_trig_reason(uint32_t fw_trig_reason)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* extract_roam_11kv_candidate_info - Extract btm candidate info
|
||||
* @wmi_handle: wmi_handle
|
||||
* @evt_buf: Event buffer
|
||||
* @dst_info: Destination buffer
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS
|
||||
extract_roam_11kv_candidate_info(wmi_unified_t wmi_handle, void *evt_buf,
|
||||
struct wmi_btm_req_candidate_info *dst_info,
|
||||
uint8_t btm_idx, uint16_t num_cand)
|
||||
{
|
||||
WMI_ROAM_STATS_EVENTID_param_tlvs *param_buf;
|
||||
wmi_roam_btm_request_candidate_info *src_data;
|
||||
uint8_t i;
|
||||
|
||||
param_buf = (WMI_ROAM_STATS_EVENTID_param_tlvs *)evt_buf;
|
||||
if (!param_buf || !param_buf->roam_btm_request_candidate_info ||
|
||||
!param_buf->num_roam_btm_request_candidate_info ||
|
||||
(btm_idx +
|
||||
num_cand) >= param_buf->num_roam_btm_request_candidate_info)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
src_data = ¶m_buf->roam_btm_request_candidate_info[btm_idx];
|
||||
if (num_cand > WLAN_MAX_BTM_CANDIDATE)
|
||||
num_cand = WLAN_MAX_BTM_CANDIDATE;
|
||||
for (i = 0; i < num_cand; i++) {
|
||||
WMI_MAC_ADDR_TO_CHAR_ARRAY(&src_data->btm_candidate_bssid,
|
||||
dst_info->candidate_bssid.bytes);
|
||||
dst_info->preference = src_data->preference;
|
||||
src_data++;
|
||||
dst_info++;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static enum roam_trigger_sub_reason
|
||||
wmi_convert_roam_sub_reason(WMI_ROAM_TRIGGER_SUB_REASON_ID subreason)
|
||||
{
|
||||
switch (subreason) {
|
||||
case WMI_ROAM_TRIGGER_SUB_REASON_PERIODIC_TIMER:
|
||||
return ROAM_TRIGGER_SUB_REASON_PERIODIC_TIMER;
|
||||
case WMI_ROAM_TRIGGER_SUB_REASON_INACTIVITY_TIMER:
|
||||
return ROAM_TRIGGER_SUB_REASON_INACTIVITY_TIMER_LOW_RSSI;
|
||||
case WMI_ROAM_TRIGGER_SUB_REASON_BTM_DI_TIMER:
|
||||
return ROAM_TRIGGER_SUB_REASON_BTM_DI_TIMER;
|
||||
case WMI_ROAM_TRIGGER_SUB_REASON_FULL_SCAN:
|
||||
return ROAM_TRIGGER_SUB_REASON_FULL_SCAN;
|
||||
case WMI_ROAM_TRIGGER_SUB_REASON_LOW_RSSI_PERIODIC:
|
||||
return ROAM_TRIGGER_SUB_REASON_LOW_RSSI_PERIODIC;
|
||||
case WMI_ROAM_TRIGGER_SUB_REASON_CU_PERIODIC:
|
||||
return ROAM_TRIGGER_SUB_REASON_CU_PERIODIC;
|
||||
case WMI_ROAM_TRIGGER_SUB_REASON_PERIODIC_TIMER_AFTER_INACTIVITY:
|
||||
return ROAM_TRIGGER_SUB_REASON_PERIODIC_TIMER_AFTER_INACTIVITY;
|
||||
case WMI_ROAM_TRIGGER_SUB_REASON_PERIODIC_TIMER_AFTER_INACTIVITY_CU:
|
||||
return ROAM_TRIGGER_SUB_REASON_PERIODIC_TIMER_AFTER_INACTIVITY_CU;
|
||||
case WMI_ROAM_TRIGGER_SUB_REASON_INACTIVITY_TIMER_CU:
|
||||
return ROAM_TRIGGER_SUB_REASON_INACTIVITY_TIMER_CU;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* extract_roam_trigger_stats_tlv() - Extract the Roam trigger stats
|
||||
* from the WMI_ROAM_STATS_EVENTID
|
||||
@@ -15001,7 +15068,8 @@ static uint32_t wmi_convert_fw_to_cm_trig_reason(uint32_t fw_trig_reason)
|
||||
*/
|
||||
static QDF_STATUS
|
||||
extract_roam_trigger_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
|
||||
struct wmi_roam_trigger_info *trig, uint8_t idx)
|
||||
struct wmi_roam_trigger_info *trig, uint8_t idx,
|
||||
uint8_t btm_idx)
|
||||
{
|
||||
WMI_ROAM_STATS_EVENTID_param_tlvs *param_buf;
|
||||
wmi_roam_trigger_reason *src_data = NULL;
|
||||
@@ -15016,7 +15084,8 @@ extract_roam_trigger_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
|
||||
trig->present = true;
|
||||
trig_reason = src_data->trigger_reason;
|
||||
trig->trigger_reason = wmi_convert_fw_to_cm_trig_reason(trig_reason);
|
||||
trig->trigger_sub_reason = src_data->trigger_sub_reason;
|
||||
trig->trigger_sub_reason =
|
||||
wmi_convert_roam_sub_reason(src_data->trigger_sub_reason);
|
||||
trig->current_rssi = src_data->current_rssi;
|
||||
trig->timestamp = src_data->timestamp;
|
||||
|
||||
@@ -15048,6 +15117,14 @@ extract_roam_trigger_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
|
||||
src_data->btm_bss_termination_timeout;
|
||||
trig->btm_trig_data.btm_mbo_assoc_retry_timeout =
|
||||
src_data->btm_mbo_assoc_retry_timeout;
|
||||
if ((btm_idx + trig->btm_trig_data.candidate_list_count) <
|
||||
param_buf->num_roam_btm_request_candidate_info)
|
||||
extract_roam_11kv_candidate_info(
|
||||
wmi_handle, evt_buf,
|
||||
trig->btm_trig_data.btm_cand,
|
||||
btm_idx,
|
||||
src_data->candidate_list_count);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
case WMI_ROAM_TRIGGER_REASON_BSS_LOAD:
|
||||
@@ -15182,6 +15259,9 @@ extract_roam_scan_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
|
||||
dst->type = src_data->roam_scan_type;
|
||||
dst->num_chan = src_data->roam_scan_channel_count;
|
||||
dst->next_rssi_threshold = src_data->next_rssi_trigger_threshold;
|
||||
dst->frame_info_count = src_data->frame_info_count;
|
||||
if (dst->frame_info_count > WLAN_ROAM_MAX_FRAME_INFO)
|
||||
dst->frame_info_count = WLAN_ROAM_MAX_FRAME_INFO;
|
||||
|
||||
/* Read the channel data only for dst->type is 0 (partial scan) */
|
||||
if (dst->num_chan && !dst->type && param_buf->num_roam_scan_chan_info &&
|
||||
@@ -15277,6 +15357,8 @@ extract_roam_11kv_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
|
||||
dst->num_freq = src_data->neighbor_report_channel_count;
|
||||
dst->req_time = src_data->neighbor_report_request_timestamp;
|
||||
dst->resp_time = src_data->neighbor_report_response_timestamp;
|
||||
dst->btm_query_token = src_data->btm_query_token;
|
||||
dst->btm_query_reason = src_data->btm_query_reason_code;
|
||||
|
||||
if (!dst->num_freq || !param_buf->num_roam_neighbor_report_chan_info ||
|
||||
rpt_idx >= param_buf->num_roam_neighbor_report_chan_info)
|
||||
@@ -15307,7 +15389,8 @@ extract_roam_11kv_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
|
||||
#else
|
||||
static inline QDF_STATUS
|
||||
extract_roam_trigger_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
|
||||
struct wmi_roam_trigger_info *trig, uint8_t idx)
|
||||
struct wmi_roam_trigger_info *trig, uint8_t idx,
|
||||
uint8_t btm_idx)
|
||||
{
|
||||
return QDF_STATUS_E_NOSUPPORT;
|
||||
}
|
||||
|
Verwijs in nieuw issue
Block a user