|
@@ -5576,34 +5576,20 @@ roam_rt_stats_fill_cand_info(struct sk_buff *vendor_event, uint8_t idx,
|
|
|
nla_nest_end(vendor_event, nl_array);
|
|
|
}
|
|
|
|
|
|
-void
|
|
|
-wlan_hdd_cfg80211_roam_events_callback(struct roam_stats_event *roam_stats,
|
|
|
- uint8_t idx)
|
|
|
+static void
|
|
|
+wlan_hdd_cfg80211_typical_roam_events_callback(struct wlan_hdd_link_info *link_info,
|
|
|
+ struct roam_stats_event *roam_stats,
|
|
|
+ uint8_t idx)
|
|
|
{
|
|
|
- struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
|
|
- int status;
|
|
|
uint32_t data_size, roam_event_type = 0;
|
|
|
struct sk_buff *vendor_event;
|
|
|
- struct wlan_hdd_link_info *link_info;
|
|
|
+ struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
|
|
|
|
|
- status = wlan_hdd_validate_context(hdd_ctx);
|
|
|
- if (status) {
|
|
|
+ if (wlan_hdd_validate_context(hdd_ctx)) {
|
|
|
hdd_err("Invalid hdd_ctx");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (!roam_stats) {
|
|
|
- hdd_err("msg received here is null");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- link_info = hdd_get_link_info_by_vdev(hdd_ctx, roam_stats->vdev_id);
|
|
|
- if (!link_info) {
|
|
|
- hdd_err("vdev_id %d does not exist with host",
|
|
|
- roam_stats->vdev_id);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
data_size = hdd_get_roam_rt_stats_event_len(roam_stats, idx);
|
|
|
if (!data_size) {
|
|
|
hdd_err("No data requested");
|
|
@@ -9639,6 +9625,8 @@ void wlan_hdd_register_cp_stats_cb(struct hdd_context *hdd_ctx)
|
|
|
QCA_WLAN_VENDOR_ATTR_ROAM_STATS_FRAME_STATUS
|
|
|
#define ROAM_STATS_FRAME_TIMESTAMP \
|
|
|
QCA_WLAN_VENDOR_ATTR_ROAM_STATS_FRAME_TIMESTAMP
|
|
|
+#define ROAM_STATS_EVENT_INDEX \
|
|
|
+ QCA_NL80211_VENDOR_SUBCMD_ROAM_STATS_INDEX
|
|
|
|
|
|
static enum qca_roam_reason
|
|
|
hdd_convert_roam_trigger_reason(enum roam_trigger_reason reason)
|
|
@@ -9921,8 +9909,9 @@ hdd_convert_roam_failures_reason(enum wlan_roam_failure_reason_code fail)
|
|
|
*
|
|
|
* Return: required length of an individual record of roaming stats
|
|
|
*/
|
|
|
-static uint32_t hdd_get_roam_stats_individual_record_len(struct enhance_roam_info *roam_info,
|
|
|
- uint32_t index)
|
|
|
+static uint32_t
|
|
|
+hdd_get_roam_stats_individual_record_len(struct enhance_roam_info *roam_info,
|
|
|
+ uint32_t index)
|
|
|
{
|
|
|
struct enhance_roam_info *info;
|
|
|
enum qca_roam_reason vendor_trigger_reason;
|
|
@@ -10452,6 +10441,9 @@ static int hdd_nla_put_roam_stats_info(struct sk_buff *skb,
|
|
|
}
|
|
|
|
|
|
for (i = 0; i < WLAN_ROAM_MAX_FRAME_INFO; i++) {
|
|
|
+ if (info->timestamp[i].frame_type ==
|
|
|
+ WLAN_ROAM_STATS_FRAME_SUBTYPE_INVALID)
|
|
|
+ break;
|
|
|
roam_frame = nla_nest_start(skb, i);
|
|
|
if (!roam_frame) {
|
|
|
hdd_err("nla_nest_start fail");
|
|
@@ -10690,6 +10682,100 @@ int wlan_hdd_cfg80211_get_roam_stats(struct wiphy *wiphy,
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
|
|
+#ifdef WLAN_FEATURE_ROAM_INFO_STATS
|
|
|
+static void
|
|
|
+wlan_hdd_cfg80211_enhance_roam_events_callback(struct wlan_hdd_link_info *link_info,
|
|
|
+ struct roam_stats_event *roam_stats,
|
|
|
+ uint8_t idx)
|
|
|
+{
|
|
|
+ int status;
|
|
|
+ uint32_t data_size = 0;
|
|
|
+ struct sk_buff *vendor_event;
|
|
|
+ struct wlan_objmgr_vdev *vdev = NULL;
|
|
|
+ struct enhance_roam_info *roam_info = NULL;
|
|
|
+ struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
|
|
+
|
|
|
+ status = wlan_hdd_validate_context(hdd_ctx);
|
|
|
+ if (status) {
|
|
|
+ hdd_err("Invalid hdd_ctx");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ vdev = hdd_objmgr_get_vdev_by_user(link_info, WLAN_OSIF_STATS_ID);
|
|
|
+ if (!vdev)
|
|
|
+ return;
|
|
|
+ ucfg_cm_roam_info_get(vdev, &roam_info, idx);
|
|
|
+ hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_STATS_ID);
|
|
|
+
|
|
|
+ /* QCA_WLAN_VENDOR_ATTR_ROAM_STATS_INFO */
|
|
|
+ data_size += nla_total_size(0);
|
|
|
+ /* nest attribute */
|
|
|
+ data_size += nla_total_size(0);
|
|
|
+
|
|
|
+ data_size += hdd_get_roam_stats_individual_record_len(roam_info, idx);
|
|
|
+
|
|
|
+ data_size += NLMSG_HDRLEN;
|
|
|
+
|
|
|
+ vendor_event =
|
|
|
+ wlan_cfg80211_vendor_event_alloc(hdd_ctx->wiphy,
|
|
|
+ &link_info->adapter->wdev,
|
|
|
+ data_size,
|
|
|
+ ROAM_STATS_EVENT_INDEX,
|
|
|
+ GFP_KERNEL);
|
|
|
+
|
|
|
+ if (hdd_nla_put_roam_stats_info(vendor_event, roam_info, 0)) {
|
|
|
+ wlan_cfg80211_vendor_free_skb(vendor_event);
|
|
|
+ hdd_err("nla put failure");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ roam_stats->enhance_roam_rt_event = false;
|
|
|
+
|
|
|
+ wlan_cfg80211_vendor_event(vendor_event, GFP_KERNEL);
|
|
|
+}
|
|
|
+#else
|
|
|
+static void
|
|
|
+wlan_hdd_cfg80211_enhance_roam_events_callback(struct wlan_hdd_link_info *link_info,
|
|
|
+ struct roam_stats_event *roam_stats,
|
|
|
+ uint8_t idx)
|
|
|
+{
|
|
|
+}
|
|
|
+#endif
|
|
|
+void
|
|
|
+wlan_hdd_cfg80211_roam_events_callback(struct roam_stats_event *roam_stats,
|
|
|
+ uint8_t idx)
|
|
|
+{
|
|
|
+ int status;
|
|
|
+ struct wlan_hdd_link_info *link_info;
|
|
|
+ struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
|
|
+
|
|
|
+ status = wlan_hdd_validate_context(hdd_ctx);
|
|
|
+ if (status) {
|
|
|
+ hdd_err("Invalid hdd_ctx");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!roam_stats) {
|
|
|
+ hdd_err("msg received here is null");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ link_info = hdd_get_link_info_by_vdev(hdd_ctx, roam_stats->vdev_id);
|
|
|
+ if (!link_info) {
|
|
|
+ hdd_err("vdev_id %d does not exist with host",
|
|
|
+ roam_stats->vdev_id);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (roam_stats->enhance_roam_rt_event)
|
|
|
+ wlan_hdd_cfg80211_enhance_roam_events_callback(link_info,
|
|
|
+ roam_stats, idx);
|
|
|
+ else
|
|
|
+ wlan_hdd_cfg80211_typical_roam_events_callback(link_info,
|
|
|
+ roam_stats, idx);
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
#ifdef WLAN_FEATURE_TX_LATENCY_STATS
|
|
|
#define TX_LATENCY_BUCKET_DISTRIBUTION_LEN \
|
|
|
(sizeof(uint32_t) * CDP_TX_LATENCY_TYPE_MAX)
|