Lines Matching defs:args

27 static int device_status_info(struct hl_device *hdev, struct hl_info_args *args)
30 u32 size = args->return_size;
31 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
42 static int hw_ip_info(struct hl_device *hdev, struct hl_info_args *args)
45 u32 size = args->return_size;
46 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
87 struct hl_info_args *args)
89 u32 size, max_size = args->return_size;
90 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
101 static int dram_usage_info(struct hl_fpriv *hpriv, struct hl_info_args *args)
105 u32 max_size = args->return_size;
106 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
125 static int hw_idle(struct hl_device *hdev, struct hl_info_args *args)
128 u32 max_size = args->return_size;
129 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
143 static int debug_coresight(struct hl_device *hdev, struct hl_debug_args *args)
153 params->reg_idx = args->reg_idx;
154 params->enable = args->enable;
155 params->op = args->op;
157 if (args->input_ptr && args->input_size) {
158 input = kzalloc(hl_debug_struct_size[args->op], GFP_KERNEL);
164 if (copy_from_user(input, u64_to_user_ptr(args->input_ptr),
165 args->input_size)) {
174 if (args->output_ptr && args->output_size) {
175 output = kzalloc(args->output_size, GFP_KERNEL);
182 params->output_size = args->output_size;
192 if (output && copy_to_user((void __user *) (uintptr_t) args->output_ptr,
193 output, args->output_size)) {
208 static int device_utilization(struct hl_device *hdev, struct hl_info_args *args)
211 u32 max_size = args->return_size;
212 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
217 if ((args->period_ms < 100) || (args->period_ms > 1000) ||
218 (args->period_ms % 100)) {
221 args->period_ms);
225 device_util.utilization = hl_device_utilization(hdev, args->period_ms);
231 static int get_clk_rate(struct hl_device *hdev, struct hl_info_args *args)
234 u32 max_size = args->return_size;
235 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
250 static int get_reset_count(struct hl_device *hdev, struct hl_info_args *args)
253 u32 max_size = args->return_size;
254 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
266 static int time_sync_info(struct hl_device *hdev, struct hl_info_args *args)
269 u32 max_size = args->return_size;
270 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
282 static int pci_counters_info(struct hl_fpriv *hpriv, struct hl_info_args *args)
286 u32 max_size = args->return_size;
287 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
301 static int clk_throttle_info(struct hl_fpriv *hpriv, struct hl_info_args *args)
305 u32 max_size = args->return_size;
306 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
317 static int cs_counters_info(struct hl_fpriv *hpriv, struct hl_info_args *args)
321 u32 max_size = args->return_size;
322 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
338 static int sync_manager_info(struct hl_fpriv *hpriv, struct hl_info_args *args)
343 u32 max_size = args->return_size;
344 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
349 if (args->dcore_id >= HL_MAX_DCORES)
353 prop->first_available_user_sob[args->dcore_id];
355 prop->first_available_user_mon[args->dcore_id];
363 struct hl_info_args *args)
367 u32 max_size = args->return_size;
368 void __user *out = (void __user *) (uintptr_t) args->return_pointer;
386 struct hl_info_args *args = data;
394 switch (args->op) {
396 return hw_ip_info(hdev, args);
399 return device_status_info(hdev, args);
402 return get_reset_count(hdev, args);
415 switch (args->op) {
417 rc = hw_events_info(hdev, false, args);
421 rc = dram_usage_info(hpriv, args);
425 rc = hw_idle(hdev, args);
429 rc = device_utilization(hdev, args);
433 rc = hw_events_info(hdev, true, args);
437 rc = get_clk_rate(hdev, args);
441 return time_sync_info(hdev, args);
444 return cs_counters_info(hpriv, args);
447 return pci_counters_info(hpriv, args);
450 return clk_throttle_info(hpriv, args);
453 return sync_manager_info(hpriv, args);
456 return total_energy_consumption_info(hpriv, args);
459 dev_err(dev, "Invalid request %d\n", args->op);
479 struct hl_debug_args *args = data;
490 switch (args->op) {
503 args->input_size =
504 min(args->input_size, hl_debug_struct_size[args->op]);
505 rc = debug_coresight(hdev, args);
508 rc = hl_device_set_debug_mode(hdev, (bool) args->enable);
511 dev_err(hdev->dev, "Invalid request %d\n", args->op);