diff --git a/target_if/core/inc/target_if.h b/target_if/core/inc/target_if.h index 49bb699935..c0df54b8af 100644 --- a/target_if/core/inc/target_if.h +++ b/target_if/core/inc/target_if.h @@ -180,6 +180,7 @@ struct target_version_info { * @service_ext2_param: service ready ext2 event params * @service_ext_param: ext service params * @mac_phy_cap: phy caps array + * @mac_phy_caps_ext2: mac phy caps ext2 params * @dbr_ring_cap: dbr_ring capability info * @reg_cap: regulatory caps array * @scaling_params: Spectral bin scaling parameters @@ -209,6 +210,8 @@ struct tgt_info { struct wlan_psoc_host_service_ext2_param service_ext2_param; struct wlan_psoc_host_mac_phy_caps mac_phy_cap[PSOC_MAX_MAC_PHY_CAP]; + struct wlan_psoc_host_mac_phy_caps_ext2 + mac_phy_caps_ext2[PSOC_MAX_MAC_PHY_CAP]; struct wlan_psoc_host_dbr_ring_caps *dbr_ring_cap; struct wlan_psoc_host_spectral_scaling_params *scaling_params; uint32_t num_mem_chunks; @@ -1433,6 +1436,38 @@ static inline struct wlan_psoc_host_mac_phy_caps return &info->mac_phy_cap[mac_phy_idx]; } +/** + * target_psoc_get_mac_phy_cap_ext2_for_mode() - get mac_phy_caps_ext2 + * for a hw-mode + * @psoc_info: pointer to structure target_psoc_info + * + * API to get mac_phy_cap for a specified hw-mode + * + * Return: structure pointer to wlan_psoc_host_mac_phy_caps_ext2 + */ + +static inline struct wlan_psoc_host_mac_phy_caps_ext2 + *target_psoc_get_mac_phy_cap_ext2_for_mode + (struct target_psoc_info *psoc_info, uint8_t mode) +{ + uint8_t mac_phy_idx; + struct tgt_info *info = &psoc_info->info; + + if (!psoc_info) + return NULL; + + for (mac_phy_idx = 0; + mac_phy_idx < PSOC_MAX_MAC_PHY_CAP; + mac_phy_idx++) + if (info->mac_phy_caps_ext2[mac_phy_idx].hw_mode_id == mode) + break; + + if (mac_phy_idx == PSOC_MAX_MAC_PHY_CAP) + return NULL; + + return &info->mac_phy_caps_ext2[mac_phy_idx]; +} + /** * target_psoc_get_mac_phy_cap() - get mac_phy_cap * @psoc_info: pointer to structure target_psoc_info @@ -1464,6 +1499,38 @@ static inline struct wlan_psoc_host_mac_phy_caps *target_psoc_get_mac_phy_cap return mac_phy_cap; } +/** + * target_psoc_get_mac_phy_cap_ext2() - get mac_phy_caps_ext2 + * @psoc_info: pointer to structure target_psoc_info + * + * API to get mac_phy_caps_ext2 + * + * Return: structure pointer to wlan_psoc_host_mac_phy_caps + */ +static inline struct wlan_psoc_host_mac_phy_caps_ext2 + *target_psoc_get_mac_phy_cap_ext2 + (struct target_psoc_info *psoc_info) +{ + uint32_t preferred_hw_mode; + struct wlan_psoc_host_mac_phy_caps_ext2 *mac_phy_caps_ext2; + + if (!psoc_info) + return NULL; + + preferred_hw_mode = + target_psoc_get_preferred_hw_mode(psoc_info); + + if (preferred_hw_mode < WMI_HOST_HW_MODE_MAX) { + mac_phy_caps_ext2 = + target_psoc_get_mac_phy_cap_ext2_for_mode + (psoc_info, preferred_hw_mode); + } else { + mac_phy_caps_ext2 = psoc_info->info.mac_phy_caps_ext2; + } + + return mac_phy_caps_ext2; +} + /** * target_psoc_get_dbr_ring_caps() - get dbr_ring_cap * @psoc_info: pointer to structure target_psoc_info diff --git a/target_if/init_deinit/inc/service_ready_param.h b/target_if/init_deinit/inc/service_ready_param.h index 641f816042..469380eb78 100644 --- a/target_if/init_deinit/inc/service_ready_param.h +++ b/target_if/init_deinit/inc/service_ready_param.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021 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 @@ -196,7 +196,11 @@ struct wlan_psoc_host_mac_phy_caps { supports_11a:1, supports_11n:1, supports_11ac:1, - supports_11ax:1; + supports_11ax:1, +#ifdef WLAN_FEATURE_11BE + supports_11be:1, +#endif + reserved:25; uint32_t supported_bands; uint32_t ampdu_density; uint32_t max_bw_supported_2G; @@ -253,6 +257,15 @@ struct wlan_psoc_host_mac_phy_caps_ext2 { uint32_t pdev_id; uint32_t phy_id; uint32_t wireless_modes_ext; +#ifdef WLAN_FEATURE_11BE + uint32_t eht_cap_info_2G[PSOC_HOST_MAX_MAC_SIZE]; + uint32_t eht_supp_mcs_2G; + uint32_t eht_cap_info_5G[PSOC_HOST_MAX_MAC_SIZE]; + uint32_t eht_supp_mcs_5G; + uint32_t eht_cap_phy_info_2G[PSOC_HOST_MAX_PHY_SIZE]; + uint32_t eht_cap_phy_info_5G[PSOC_HOST_MAX_PHY_SIZE]; + uint32_t eht_cap_info_internal; +#endif }; /* diff --git a/target_if/init_deinit/src/service_ready_util.c b/target_if/init_deinit/src/service_ready_util.c index 311d1a5f79..222d6fb977 100644 --- a/target_if/init_deinit/src/service_ready_util.c +++ b/target_if/init_deinit/src/service_ready_util.c @@ -679,8 +679,6 @@ int init_deinit_populate_mac_phy_cap_ext2(wmi_unified_t wmi_handle, uint8_t *event, struct tgt_info *info) { - struct wlan_psoc_host_mac_phy_caps_ext2 - mac_phy_caps_ext2[PSOC_MAX_MAC_PHY_CAP] = {{0} }; uint32_t num_hw_modes; uint8_t hw_idx; uint32_t hw_mode_id; @@ -689,6 +687,7 @@ int init_deinit_populate_mac_phy_cap_ext2(wmi_unified_t wmi_handle, uint8_t mac_phy_count = 0; QDF_STATUS status = QDF_STATUS_SUCCESS; struct wlan_psoc_host_mac_phy_caps *mac_phy_cap; + struct wlan_psoc_host_mac_phy_caps_ext2 *mac_phy_caps_ext2; if (!event) return -EINVAL; @@ -709,10 +708,12 @@ int init_deinit_populate_mac_phy_cap_ext2(wmi_unified_t wmi_handle, } mac_phy_cap = &info->mac_phy_cap[mac_phy_count]; + mac_phy_caps_ext2 = + &info->mac_phy_caps_ext2[mac_phy_count]; status = wmi_extract_mac_phy_cap_service_ready_ext2( wmi_handle, event, hw_mode_id, phy_id, mac_phy_cap->phy_idx, - &mac_phy_caps_ext2[mac_phy_count]); + mac_phy_caps_ext2); if (QDF_IS_STATUS_ERROR(status)) { target_if_err("failed to parse mac phy capability ext2"); diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 55dd07649e..159bfe24e0 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -948,6 +948,19 @@ typedef struct { #define WMI_HOST_HE_TXRX_MCS_NSS_IDX_160 1 #define WMI_HOST_HE_TXRX_MCS_NSS_IDX_80_80 2 +#ifdef WLAN_FEATURE_11BE +#define WMI_HOST_MAX_EHTCAP_PHY_SIZE 3 +#define WMI_HOST_MAX_EHTCAP_MAC_SIZE 2 +#define WMI_HOST_EHTCAP_MAC_WORD1 0 +#define WMI_HOST_EHTCAP_MAC_WORD2 1 +#define WMI_HOST_MAX_EHT_RATE_SET 3 + +#define WMI_HOST_EHT_INVALID_MCSNSSMAP (0xFFFF) +#define WMI_HOST_EHT_TXRX_MCS_NSS_IDX_80 0 +#define WMI_HOST_EHT_TXRX_MCS_NSS_IDX_160 1 +#define WMI_HOST_EHT_TXRX_MCS_NSS_IDX_320 2 +#endif + /** * struct wmi_host_ppe_threshold -PPE threshold * @numss_m1: NSS - 1 diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index fe46f7c44c..5f65189700 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -11150,6 +11150,31 @@ static QDF_STATUS extract_hw_mode_cap_service_ready_ext_tlv( return QDF_STATUS_SUCCESS; } +/** + * extract_mac_phy_cap_service_ready_11be_support - api to extract 11be support + * @param param: host mac phy capabilities + * @param mac_phy_caps: mac phy capabilities + * + * Return: void + */ +#ifdef WLAN_FEATURE_11BE +static void +extract_service_ready_11be_support(struct wlan_psoc_host_mac_phy_caps *param, + WMI_MAC_PHY_CAPABILITIES *mac_phy_caps) +{ + param->supports_11be = + WMI_SUPPORT_11BE_GET(mac_phy_caps->supported_flags); + + wmi_debug("11be support %d", param->supports_11be); +} +#else +static void +extract_service_ready_11be_support(struct wlan_psoc_host_mac_phy_caps *param, + WMI_MAC_PHY_CAPABILITIES *mac_phy_caps) +{ +} +#endif + /** * extract_mac_phy_cap_service_ready_ext_tlv() - * extract MAC phy cap from service ready event @@ -11226,6 +11251,8 @@ static QDF_STATUS extract_mac_phy_cap_service_ready_ext_tlv( param->supports_11ax = WMI_SUPPORT_11AX_GET(mac_phy_caps->supported_flags); + extract_service_ready_11be_support(param, mac_phy_caps); + param->supported_bands = mac_phy_caps->supported_bands; param->ampdu_density = mac_phy_caps->ampdu_density; param->max_bw_supported_2G = mac_phy_caps->max_bw_supported_2G; @@ -11276,6 +11303,67 @@ static QDF_STATUS extract_mac_phy_cap_service_ready_ext_tlv( return QDF_STATUS_SUCCESS; } +/** + * extract_mac_phy_cap_ehtcaps- api to extract eht mac phy caps + * @param param: host ext2 mac phy capabilities + * @param mac_phy_caps: ext mac phy capabilities + * + * Return: void + */ +#ifdef WLAN_FEATURE_11BE +static void extract_mac_phy_cap_ehtcaps( + struct wlan_psoc_host_mac_phy_caps_ext2 *param, + WMI_MAC_PHY_CAPABILITIES_EXT *mac_phy_caps) +{ + uint32_t i; + + param->eht_cap_info_2G[WMI_HOST_EHTCAP_MAC_WORD1] = + mac_phy_caps->eht_cap_info_2G; + param->eht_cap_info_2G[WMI_HOST_EHTCAP_MAC_WORD2] = + mac_phy_caps->eht_cap_info_2G_ext; + param->eht_supp_mcs_2G = mac_phy_caps->eht_supp_mcs_2G; + param->eht_cap_info_5G[WMI_HOST_EHTCAP_MAC_WORD1] = + mac_phy_caps->eht_cap_info_5G; + param->eht_cap_info_5G[WMI_HOST_EHTCAP_MAC_WORD2] = + mac_phy_caps->eht_cap_info_5G_ext; + param->eht_supp_mcs_5G = mac_phy_caps->eht_supp_mcs_5G; + param->eht_cap_info_internal = mac_phy_caps->eht_cap_info_internal; + + qdf_mem_copy(¶m->eht_cap_phy_info_2G, + &mac_phy_caps->eht_cap_phy_info_2G, + sizeof(param->eht_cap_phy_info_2G)); + qdf_mem_copy(¶m->eht_cap_phy_info_5G, + &mac_phy_caps->eht_cap_phy_info_5G, + sizeof(param->eht_cap_phy_info_5G)); + + wmi_debug("EHT mac caps: cap_info_2G %x, cap_info_2G_ext %x, cap_info_5G %x, cap_info_5G_ext %x, supp_mcs_2G %x, supp_mcs_5G %x, info_internal %x", + mac_phy_caps->eht_cap_info_2G, + mac_phy_caps->eht_cap_info_2G_ext, + mac_phy_caps->eht_cap_info_5G, + mac_phy_caps->eht_cap_info_5G_ext, + mac_phy_caps->eht_supp_mcs_2G, mac_phy_caps->eht_supp_mcs_5G, + mac_phy_caps->eht_cap_info_internal); + + wmi_nofl_debug("EHT phy caps: "); + + wmi_nofl_debug("2G: "); + for (i = 0; i < PSOC_HOST_MAX_PHY_SIZE; i++) { + wmi_nofl_debug("index %d value %d", + i, param->eht_cap_phy_info_2G[i]); + } + wmi_nofl_debug("5G: "); + for (i = 0; i < PSOC_HOST_MAX_PHY_SIZE; i++) { + wmi_nofl_debug("index %d value %d", + i, param->eht_cap_phy_info_5G[i]); + } +} +#else +static void extract_mac_phy_cap_ehtcaps( + struct wlan_psoc_host_mac_phy_caps_ext2 *param, + WMI_MAC_PHY_CAPABILITIES_EXT *mac_phy_caps) +{ +} +#endif static QDF_STATUS extract_mac_phy_cap_service_ready_ext2_tlv( wmi_unified_t wmi_handle, uint8_t *event, uint8_t hw_mode_id, uint8_t phy_id, @@ -11311,6 +11399,8 @@ static QDF_STATUS extract_mac_phy_cap_service_ready_ext2_tlv( param->wireless_modes_ext = convert_wireless_modes_ext_tlv( mac_phy_caps->wireless_modes_ext); + extract_mac_phy_cap_ehtcaps(param, mac_phy_caps); + return QDF_STATUS_SUCCESS; }