|
@@ -1,5 +1,5 @@
|
|
/*
|
|
/*
|
|
- * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
|
|
|
|
|
|
+ * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
|
|
*
|
|
*
|
|
* Permission to use, copy, modify, and/or distribute this software for
|
|
* Permission to use, copy, modify, and/or distribute this software for
|
|
* any purpose with or without fee is hereby granted, provided that the
|
|
* any purpose with or without fee is hereby granted, provided that the
|
|
@@ -104,6 +104,39 @@ int tgt_cfr_get_target_type(struct wlan_objmgr_psoc *psoc)
|
|
return target_type;
|
|
return target_type;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+int tgt_cfr_validate_period(struct wlan_objmgr_psoc *psoc, u_int32_t period)
|
|
|
|
+{
|
|
|
|
+ uint32_t target_type = tgt_cfr_get_target_type(psoc);
|
|
|
|
+ int status = 0;
|
|
|
|
+
|
|
|
|
+ if (target_type == TARGET_TYPE_UNKNOWN) {
|
|
|
|
+ cfr_err("cfr period validation fail due to invalid target type");
|
|
|
|
+ return status;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /* Basic check is the period should be between 0 and MAX_CFR_PRD */
|
|
|
|
+ if ((period < 0) || (period > MAX_CFR_PRD)) {
|
|
|
|
+ cfr_err("Invalid period value: %d\n", period);
|
|
|
|
+ return status;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (target_type == TARGET_TYPE_QCN9000 ||
|
|
|
|
+ target_type == TARGET_TYPE_QCA6018 ||
|
|
|
|
+ target_type == TARGET_TYPE_QCA8074V2 ||
|
|
|
|
+ target_type == TARGET_TYPE_QCA5018) {
|
|
|
|
+ /* No additional check required for these targets */
|
|
|
|
+ status = 1;
|
|
|
|
+ } else {
|
|
|
|
+ if (!(period % CFR_MOD_PRD)) {
|
|
|
|
+ status = 1;
|
|
|
|
+ } else {
|
|
|
|
+ cfr_err("Invalid period value. Value must be mod of %d",
|
|
|
|
+ CFR_MOD_PRD);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return status;
|
|
|
|
+}
|
|
|
|
+
|
|
QDF_STATUS tgt_cfr_init_pdev(struct wlan_objmgr_pdev *pdev)
|
|
QDF_STATUS tgt_cfr_init_pdev(struct wlan_objmgr_pdev *pdev)
|
|
{
|
|
{
|
|
struct wlan_lmac_if_cfr_tx_ops *cfr_tx_ops = NULL;
|
|
struct wlan_lmac_if_cfr_tx_ops *cfr_tx_ops = NULL;
|