diff --git a/wmi/inc/wmi_unified_fwol_api.h b/wmi/inc/wmi_unified_fwol_api.h index dcc77fa0b1..478246ca3e 100644 --- a/wmi/inc/wmi_unified_fwol_api.h +++ b/wmi/inc/wmi_unified_fwol_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-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 @@ -65,4 +65,26 @@ wmi_extract_get_elna_bypass_resp(struct wmi_unified *wmi_handle, void *resp_buf, struct get_elna_bypass_response *resp); #endif /* WLAN_FEATURE_ELNA */ +#ifdef WLAN_SEND_DSCP_UP_MAP_TO_FW +/** + * wmi_unified_send_dscp_tip_map_cmd() - Send dscp-to-tid map values cmd + * @wmi_handle: wmi handle + * @dscp_to_tid_map: array of dscp_tid map values + * + * Send dscp-to-tid map values to FW. + * + * Return: QDF_STATUS + */ +QDF_STATUS +wmi_unified_send_dscp_tip_map_cmd(struct wmi_unified *wmi_handle, + uint32_t *dscp_to_tid_map); +#else +static inline QDF_STATUS +wmi_unified_send_dscp_tip_map_cmd(struct wmi_unified *wmi_handle, + uint32_t *dscp_to_tid_map) +{ + return QDF_STATUS_SUCCESS; +} +#endif /* WLAN_SEND_DSCP_UP_MAP_TO_FW */ + #endif /* _WMI_UNIFIED_FWOL_API_H_ */ diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index e30eec9a7a..25422e3771 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -2137,6 +2137,11 @@ QDF_STATUS (*extract_get_elna_bypass_resp)(wmi_unified_t wmi_handle, struct get_elna_bypass_response *resp); #endif /* WLAN_FEATURE_ELNA */ +#ifdef WLAN_SEND_DSCP_UP_MAP_TO_FW +QDF_STATUS (*send_dscp_tid_map_cmd)(wmi_unified_t wmi_handle, + uint32_t *dscp_to_tid_map); +#endif + QDF_STATUS (*send_pdev_get_pn_cmd)(wmi_unified_t wmi_handle, struct peer_request_pn_param *pn_params); QDF_STATUS (*extract_get_pn_data)(wmi_unified_t wmi_handle, diff --git a/wmi/src/wmi_unified_fwol_api.c b/wmi/src/wmi_unified_fwol_api.c index 7ccb46cade..7bca133af9 100644 --- a/wmi/src/wmi_unified_fwol_api.c +++ b/wmi/src/wmi_unified_fwol_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-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 @@ -58,3 +58,16 @@ wmi_extract_get_elna_bypass_resp(struct wmi_unified *wmi_handle, void *resp_buf, return QDF_STATUS_E_FAILURE; } #endif /* WLAN_FEATURE_ELNA */ + +#ifdef WLAN_SEND_DSCP_UP_MAP_TO_FW +QDF_STATUS +wmi_unified_send_dscp_tip_map_cmd(struct wmi_unified *wmi_handle, + uint32_t *dscp_to_tid_map) +{ + if (wmi_handle->ops->send_dscp_tid_map_cmd) + return wmi_handle->ops->send_dscp_tid_map_cmd(wmi_handle, + dscp_to_tid_map); + + return QDF_STATUS_E_FAILURE; +} +#endif /* WLAN_SEND_DSCP_UP_MAP_TO_FW */ diff --git a/wmi/src/wmi_unified_fwol_tlv.c b/wmi/src/wmi_unified_fwol_tlv.c index 13663bc572..c9b20f86d0 100644 --- a/wmi/src/wmi_unified_fwol_tlv.c +++ b/wmi/src/wmi_unified_fwol_tlv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-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 @@ -152,9 +152,66 @@ static void wmi_fwol_attach_elna_tlv(struct wmi_ops *ops) } #endif /* WLAN_FEATURE_ELNA */ +#ifdef WLAN_SEND_DSCP_UP_MAP_TO_FW +/** + * send_dscp_tid_map_cmd_tlv() - send dscp to tid map cmd to fw + * @wmi_handle: wmi handle + * @dscp_to_tid_map: array of dscp to tid map values + * + * Send WMI_PDEV_SET_DSCP_TID_MAP_CMDID to fw. + * + * Return: QDF_STATUS + */ +static QDF_STATUS +send_dscp_tid_map_cmd_tlv(wmi_unified_t wmi_handle, + uint32_t *dscp_to_tid_map) +{ + QDF_STATUS status; + wmi_pdev_set_dscp_tid_map_cmd_fixed_param *cmd; + wmi_buf_t buf; + uint16_t len = sizeof(*cmd); + + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMI_LOGE("%s: Failed to allocate wmi buffer", __func__); + return QDF_STATUS_E_NOMEM; + } + + cmd = (wmi_pdev_set_dscp_tid_map_cmd_fixed_param *)wmi_buf_data(buf); + WMITLV_SET_HDR( + &cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_pdev_set_dscp_tid_map_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_pdev_set_dscp_tid_map_cmd_fixed_param)); + cmd->reserved0 = WMI_PDEV_ID_SOC; + qdf_mem_copy(&cmd->dscp_to_tid_map, dscp_to_tid_map, + sizeof(uint32_t) * WMI_DSCP_MAP_MAX); + + status = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_PDEV_SET_DSCP_TID_MAP_CMDID); + if (status) { + WMI_LOGE("Failed to send dscp_up_map_to_fw %d", status); + wmi_buf_free(buf); + } + + return status; +} + +static void wmi_fwol_attach_dscp_tid_tlv(struct wmi_ops *ops) +{ + ops->send_dscp_tid_map_cmd = send_dscp_tid_map_cmd_tlv; +} +#else +static void wmi_fwol_attach_dscp_tid_tlv(struct wmi_ops *ops) +{ +} +#endif /* WLAN_SEND_DSCP_UP_MAP_TO_FW */ + void wmi_fwol_attach_tlv(wmi_unified_t wmi_handle) { struct wmi_ops *ops = wmi_handle->ops; wmi_fwol_attach_elna_tlv(ops); + wmi_fwol_attach_dscp_tid_tlv(ops); + }