From 7a60a81d3ae7d3fb33b174732a972f451abf0ec4 Mon Sep 17 00:00:00 2001 From: Pragaspathi Thilagaraj Date: Sat, 29 Feb 2020 03:09:48 +0530 Subject: [PATCH] qcacmn: Use enum roam_trigger_reason for fw bitmap conversion From upper layers the vendor specific control roam bitmap is converted to unified enum roam_trigger reason. From this bitmap, deriver the fw trigger reason bitmap at convert_control_roam_trigger_reason_bitmap. Depreciate the roam_control_trigger_reason enum. Change-Id: I64ac273d88b696c32c5b72462454a8983774ef90 CRs-Fixed: 2631968 --- wmi/inc/wmi_unified_roam_param.h | 37 ++------------------------- wmi/src/wmi_unified_roam_tlv.c | 44 ++++++++++++++++++++++++-------- 2 files changed, 36 insertions(+), 45 deletions(-) diff --git a/wmi/inc/wmi_unified_roam_param.h b/wmi/inc/wmi_unified_roam_param.h index 0ec030e37e..9da790355e 100644 --- a/wmi/inc/wmi_unified_roam_param.h +++ b/wmi/inc/wmi_unified_roam_param.h @@ -462,6 +462,7 @@ struct scoring_param { * ROAM_TRIGGER_REASON_DEAUTH: Roam triggered due to deauth received from the * current connected AP. * ROAM_TRIGGER_REASON_IDLE: Roam triggered due to inactivity of the device. + * ROAM_TRIGGER_REASON_STA_KICKOUT: Roam triggered due to sta kickout event. * ROAM_TRIGGER_REASON_MAX: Maximum number of roam triggers */ enum roam_trigger_reason { @@ -480,6 +481,7 @@ enum roam_trigger_reason { ROAM_TRIGGER_REASON_BSS_LOAD, ROAM_TRIGGER_REASON_DEAUTH, ROAM_TRIGGER_REASON_IDLE, + ROAM_TRIGGER_REASON_STA_KICKOUT, ROAM_TRIGGER_REASON_MAX, }; @@ -765,41 +767,6 @@ struct wmi_invoke_neighbor_report_params { struct mac_ssid ssid; }; -/** - * enum roam_control_trigger_reason - Bitmap of roaming triggers - * - * @ROAM_TRIGGER_REASON_PER: Set if the roam has to be triggered based on - * a bad packet error rates (PER). - * @ROAM_TRIGGER_REASON_BEACON_MISS: Set if the roam has to be triggered - * based on beacon misses from the connected AP. - * @ROAM_TRIGGER_REASON_POOR_RSSI: Set if the roam has to be triggered - * due to poor RSSI of the connected AP. - * @ROAM_TRIGGER_REASON_BETTER_RSSI: Set if the roam has to be triggered - * upon finding a BSSID with a better RSSI than the connected BSSID. - * Here the RSSI of the current BSSID need not be poor. - * @ROAM_TRIGGER_REASON_PERIODIC: Set if the roam has to be triggered - * by triggering a periodic scan to find a better AP to roam. - * @ROAM_TRIGGER_REASON_DENSE: Set if the roam has to be triggered - * when the connected channel environment is too noisy/congested. - * @ROAM_TRIGGER_REASON_BTM: Set if the roam has to be triggered - * when BTM Request frame is received from the connected AP. - * @ROAM_TRIGGER_REASON_BSS_LOAD: Set if the roam has to be triggered - * when the channel utilization is goes above the configured threshold. - * - * Set the corresponding roam trigger reason bit to consider it for roam - * trigger. - */ -enum roam_control_trigger_reason { - ROAM_CONTROL_TRIGGER_REASON_PER = 1 << 0, - ROAM_CONTROL_TRIGGER_REASON_BEACON_MISS = 1 << 1, - ROAM_CONTROL_TRIGGER_REASON_POOR_RSSI = 1 << 2, - ROAM_CONTROL_TRIGGER_REASON_BETTER_RSSI = 1 << 3, - ROAM_CONTROL_TRIGGER_REASON_PERIODIC = 1 << 4, - ROAM_CONTROL_TRIGGER_REASON_DENSE = 1 << 5, - ROAM_CONTROL_TRIGGER_REASON_BTM = 1 << 6, - ROAM_CONTROL_TRIGGER_REASON_BSS_LOAD = 1 << 7, -}; - /** * struct roam_triggers - vendor configured roam triggers * @vdev_id: vdev id diff --git a/wmi/src/wmi_unified_roam_tlv.c b/wmi/src/wmi_unified_roam_tlv.c index b55cdce03d..974fdac64b 100644 --- a/wmi/src/wmi_unified_roam_tlv.c +++ b/wmi/src/wmi_unified_roam_tlv.c @@ -2474,34 +2474,58 @@ convert_control_roam_trigger_reason_bitmap(uint32_t trigger_reason_bitmap) /* Enable the complete trigger bitmap when all bits are set in * the control config bitmap */ - all_bitmap = (ROAM_CONTROL_TRIGGER_REASON_BSS_LOAD << 1) - 1; + all_bitmap = BIT(ROAM_TRIGGER_REASON_MAX) - 1; if (trigger_reason_bitmap == all_bitmap) - return (BIT(WMI_ROAM_TRIGGER_REASON_MAX) - 1); + return BIT(WMI_ROAM_TRIGGER_EXT_REASON_MAX) - 1; - if (trigger_reason_bitmap & ROAM_CONTROL_TRIGGER_REASON_PER) + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_NONE)) + fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_NONE); + + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_PER)) fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_PER); - if (trigger_reason_bitmap & ROAM_CONTROL_TRIGGER_REASON_BEACON_MISS) + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_BMISS)) fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_BMISS); - if (trigger_reason_bitmap & ROAM_CONTROL_TRIGGER_REASON_POOR_RSSI) + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_LOW_RSSI)) fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_LOW_RSSI); - if (trigger_reason_bitmap & ROAM_CONTROL_TRIGGER_REASON_BETTER_RSSI) + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_HIGH_RSSI)) fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_HIGH_RSSI); - if (trigger_reason_bitmap & ROAM_CONTROL_TRIGGER_REASON_PERIODIC) + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_PERIODIC)) fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_PERIODIC); - if (trigger_reason_bitmap & ROAM_CONTROL_TRIGGER_REASON_DENSE) + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_MAWC)) + fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_MAWC); + + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_DENSE)) fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_DENSE); - if (trigger_reason_bitmap & ROAM_CONTROL_TRIGGER_REASON_BTM) + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_BACKGROUND)) + fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_BACKGROUND); + + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_FORCED)) + fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_FORCED); + + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_BTM)) fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_BTM); - if (trigger_reason_bitmap & ROAM_CONTROL_TRIGGER_REASON_BSS_LOAD) + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_UNIT_TEST)) + fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_UNIT_TEST); + + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_BSS_LOAD)) fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_BSS_LOAD); + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_DEAUTH)) + fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_DEAUTH); + + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_IDLE)) + fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_IDLE); + + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_STA_KICKOUT)) + fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_STA_KICKOUT); + return fw_trigger_bitmap; }