Lines Matching full:service
19 static void adf_service_add(struct service_hndl *service) in adf_service_add() argument
22 list_add(&service->list, &service_table); in adf_service_add()
26 int adf_service_register(struct service_hndl *service) in adf_service_register() argument
28 memset(service->init_status, 0, sizeof(service->init_status)); in adf_service_register()
29 memset(service->start_status, 0, sizeof(service->start_status)); in adf_service_register()
30 adf_service_add(service); in adf_service_register()
34 static void adf_service_remove(struct service_hndl *service) in adf_service_remove() argument
37 list_del(&service->list); in adf_service_remove()
41 int adf_service_unregister(struct service_hndl *service) in adf_service_unregister() argument
45 for (i = 0; i < ARRAY_SIZE(service->init_status); i++) { in adf_service_unregister()
46 if (service->init_status[i] || service->start_status[i]) { in adf_service_unregister()
47 pr_err("QAT: Could not remove active service\n"); in adf_service_unregister()
51 adf_service_remove(service); in adf_service_unregister()
66 struct service_hndl *service; in adf_dev_init() local
155 list_for_each_entry(service, &service_table, list) { in adf_dev_init()
156 if (service->event_hld(accel_dev, ADF_EVENT_INIT)) { in adf_dev_init()
158 "Failed to initialise service %s\n", in adf_dev_init()
159 service->name); in adf_dev_init()
162 set_bit(accel_dev->accel_id, service->init_status); in adf_dev_init()
169 * adf_dev_start() - Start acceleration service for the given accel device
181 struct service_hndl *service; in adf_dev_start() local
232 list_for_each_entry(service, &service_table, list) { in adf_dev_start()
233 if (service->event_hld(accel_dev, ADF_EVENT_START)) { in adf_dev_start()
235 "Failed to start service %s\n", in adf_dev_start()
236 service->name); in adf_dev_start()
239 set_bit(accel_dev->accel_id, service->start_status); in adf_dev_start()
271 * adf_dev_stop() - Stop acceleration service for the given accel device
283 struct service_hndl *service; in adf_dev_stop() local
311 list_for_each_entry(service, &service_table, list) { in adf_dev_stop()
312 if (!test_bit(accel_dev->accel_id, service->start_status)) in adf_dev_stop()
314 ret = service->event_hld(accel_dev, ADF_EVENT_STOP); in adf_dev_stop()
316 clear_bit(accel_dev->accel_id, service->start_status); in adf_dev_stop()
319 clear_bit(accel_dev->accel_id, service->start_status); in adf_dev_stop()
349 struct service_hndl *service; in adf_dev_shutdown() local
371 list_for_each_entry(service, &service_table, list) { in adf_dev_shutdown()
372 if (!test_bit(accel_dev->accel_id, service->init_status)) in adf_dev_shutdown()
374 if (service->event_hld(accel_dev, ADF_EVENT_SHUTDOWN)) in adf_dev_shutdown()
376 "Failed to shutdown service %s\n", in adf_dev_shutdown()
377 service->name); in adf_dev_shutdown()
379 clear_bit(accel_dev->accel_id, service->init_status); in adf_dev_shutdown()
412 struct service_hndl *service; in adf_dev_restarting_notify() local
414 list_for_each_entry(service, &service_table, list) { in adf_dev_restarting_notify()
415 if (service->event_hld(accel_dev, ADF_EVENT_RESTARTING)) in adf_dev_restarting_notify()
417 "Failed to restart service %s.\n", in adf_dev_restarting_notify()
418 service->name); in adf_dev_restarting_notify()
425 struct service_hndl *service; in adf_dev_restarted_notify() local
427 list_for_each_entry(service, &service_table, list) { in adf_dev_restarted_notify()
428 if (service->event_hld(accel_dev, ADF_EVENT_RESTARTED)) in adf_dev_restarted_notify()
430 "Failed to restart service %s.\n", in adf_dev_restarted_notify()
431 service->name); in adf_dev_restarted_notify()
438 struct service_hndl *service; in adf_error_notifier() local
440 list_for_each_entry(service, &service_table, list) { in adf_error_notifier()
441 if (service->event_hld(accel_dev, ADF_EVENT_FATAL_ERROR)) in adf_error_notifier()
444 service->name); in adf_error_notifier()