Lines Matching full:service
14 static void adf_service_add(struct service_hndl *service) in adf_service_add() argument
17 list_add(&service->list, &service_table); in adf_service_add()
21 int adf_service_register(struct service_hndl *service) in adf_service_register() argument
23 memset(service->init_status, 0, sizeof(service->init_status)); in adf_service_register()
24 memset(service->start_status, 0, sizeof(service->start_status)); in adf_service_register()
25 adf_service_add(service); in adf_service_register()
29 static void adf_service_remove(struct service_hndl *service) in adf_service_remove() argument
32 list_del(&service->list); in adf_service_remove()
36 int adf_service_unregister(struct service_hndl *service) in adf_service_unregister() argument
40 for (i = 0; i < ARRAY_SIZE(service->init_status); i++) { in adf_service_unregister()
41 if (service->init_status[i] || service->start_status[i]) { in adf_service_unregister()
42 pr_err("QAT: Could not remove active service\n"); in adf_service_unregister()
46 adf_service_remove(service); in adf_service_unregister()
61 struct service_hndl *service; in adf_dev_init() local
119 service = list_entry(list_itr, struct service_hndl, list); in adf_dev_init()
120 if (service->event_hld(accel_dev, ADF_EVENT_INIT)) { in adf_dev_init()
122 "Failed to initialise service %s\n", in adf_dev_init()
123 service->name); in adf_dev_init()
126 set_bit(accel_dev->accel_id, service->init_status); in adf_dev_init()
137 * adf_dev_start() - Start acceleration service for the given accel device
149 struct service_hndl *service; in adf_dev_start() local
166 service = list_entry(list_itr, struct service_hndl, list); in adf_dev_start()
167 if (service->event_hld(accel_dev, ADF_EVENT_START)) { in adf_dev_start()
169 "Failed to start service %s\n", in adf_dev_start()
170 service->name); in adf_dev_start()
173 set_bit(accel_dev->accel_id, service->start_status); in adf_dev_start()
192 * adf_dev_stop() - Stop acceleration service for the given accel device
203 struct service_hndl *service; in adf_dev_stop() local
221 service = list_entry(list_itr, struct service_hndl, list); in adf_dev_stop()
222 if (!test_bit(accel_dev->accel_id, service->start_status)) in adf_dev_stop()
224 ret = service->event_hld(accel_dev, ADF_EVENT_STOP); in adf_dev_stop()
226 clear_bit(accel_dev->accel_id, service->start_status); in adf_dev_stop()
229 clear_bit(accel_dev->accel_id, service->start_status); in adf_dev_stop()
255 struct service_hndl *service; in adf_dev_shutdown() local
279 service = list_entry(list_itr, struct service_hndl, list); in adf_dev_shutdown()
280 if (!test_bit(accel_dev->accel_id, service->init_status)) in adf_dev_shutdown()
282 if (service->event_hld(accel_dev, ADF_EVENT_SHUTDOWN)) in adf_dev_shutdown()
284 "Failed to shutdown service %s\n", in adf_dev_shutdown()
285 service->name); in adf_dev_shutdown()
287 clear_bit(accel_dev->accel_id, service->init_status); in adf_dev_shutdown()
314 struct service_hndl *service; in adf_dev_restarting_notify() local
318 service = list_entry(list_itr, struct service_hndl, list); in adf_dev_restarting_notify()
319 if (service->event_hld(accel_dev, ADF_EVENT_RESTARTING)) in adf_dev_restarting_notify()
321 "Failed to restart service %s.\n", in adf_dev_restarting_notify()
322 service->name); in adf_dev_restarting_notify()
329 struct service_hndl *service; in adf_dev_restarted_notify() local
333 service = list_entry(list_itr, struct service_hndl, list); in adf_dev_restarted_notify()
334 if (service->event_hld(accel_dev, ADF_EVENT_RESTARTED)) in adf_dev_restarted_notify()
336 "Failed to restart service %s.\n", in adf_dev_restarted_notify()
337 service->name); in adf_dev_restarted_notify()