Re: [PATCH net-next 2/3] dpll: add actual frequency monitoring callback ops
From: Vadim Fedorenko
Date: Thu Mar 26 2026 - 07:26:43 EST
On 25/03/2026 19:39, Ivan Vecera wrote:
+static int dpll_msg_add_actual_freq(struct sk_buff *msg, struct dpll_pin *pin,
+ struct dpll_pin_ref *ref,
+ struct netlink_ext_ack *extack)
+{
+ const struct dpll_device_ops *dev_ops = dpll_device_ops(ref->dpll);
+ const struct dpll_pin_ops *ops = dpll_pin_ops(ref);
+ struct dpll_device *dpll = ref->dpll;
+ enum dpll_feature_state state;
+ u64 actual_freq;
+ int ret;
+
+ if (!ops->actual_freq_get)
+ return 0;
+ if (dev_ops->freq_monitor_get) {
+ ret = dev_ops->freq_monitor_get(dpll, dpll_priv(dpll),
+ &state, extack);
+ if (ret)
+ return ret;
+ if (state == DPLL_FEATURE_STATE_DISABLE)
+ return 0;
I think we have to signal back to user that frequency monitoring is
disabled via extack.
+ }
+ ret = ops->actual_freq_get(pin, dpll_pin_on_dpll_priv(dpll, pin),
+ dpll, dpll_priv(dpll), &actual_freq, extack);
+ if (ret)
+ return ret;
+ if (nla_put_64bit(msg, DPLL_A_PIN_ACTUAL_FREQUENCY,
+ sizeof(actual_freq), &actual_freq, DPLL_A_PIN_PAD))
+ return -EMSGSIZE;
+
+ return 0;