Lines Matching refs:cl

146 	struct mei_cl *cl;  in mei_cl_bus_find_cl_by_uuid()  local
148 list_for_each_entry(cl, &dev->device_list, device_link) { in mei_cl_bus_find_cl_by_uuid()
149 if (!uuid_le_cmp(uuid, cl->cl_uuid)) in mei_cl_bus_find_cl_by_uuid()
150 return cl; in mei_cl_bus_find_cl_by_uuid()
160 struct mei_cl *cl; in mei_cl_add_device() local
163 cl = mei_cl_bus_find_cl_by_uuid(dev, uuid); in mei_cl_add_device()
164 if (cl == NULL) in mei_cl_add_device()
171 device->cl = cl; in mei_cl_add_device()
187 cl->device = device; in mei_cl_add_device()
227 static ssize_t ___mei_cl_send(struct mei_cl *cl, u8 *buf, size_t length, in ___mei_cl_send() argument
235 if (WARN_ON(!cl || !cl->dev)) in ___mei_cl_send()
238 dev = cl->dev; in ___mei_cl_send()
241 if (!mei_cl_is_connected(cl)) { in ___mei_cl_send()
247 me_cl = mei_me_cl_by_uuid_id(dev, &cl->cl_uuid, cl->me_client_id); in ___mei_cl_send()
258 cb = mei_cl_alloc_cb(cl, length, MEI_FOP_WRITE, NULL); in ___mei_cl_send()
266 rets = mei_cl_write(cl, cb, blocking); in ___mei_cl_send()
277 ssize_t __mei_cl_recv(struct mei_cl *cl, u8 *buf, size_t length) in __mei_cl_recv() argument
284 if (WARN_ON(!cl || !cl->dev)) in __mei_cl_recv()
287 dev = cl->dev; in __mei_cl_recv()
291 cb = mei_cl_read_cb(cl, NULL); in __mei_cl_recv()
295 rets = mei_cl_read_start(cl, length, NULL); in __mei_cl_recv()
299 if (list_empty(&cl->rd_completed) && !waitqueue_active(&cl->rx_wait)) { in __mei_cl_recv()
303 if (wait_event_interruptible(cl->rx_wait, in __mei_cl_recv()
304 (!list_empty(&cl->rd_completed)) || in __mei_cl_recv()
305 (!mei_cl_is_connected(cl)))) { in __mei_cl_recv()
314 if (!mei_cl_is_connected(cl)) { in __mei_cl_recv()
320 cb = mei_cl_read_cb(cl, NULL); in __mei_cl_recv()
344 inline ssize_t __mei_cl_async_send(struct mei_cl *cl, u8 *buf, size_t length) in __mei_cl_async_send() argument
346 return ___mei_cl_send(cl, buf, length, 0); in __mei_cl_async_send()
349 inline ssize_t __mei_cl_send(struct mei_cl *cl, u8 *buf, size_t length) in __mei_cl_send() argument
351 return ___mei_cl_send(cl, buf, length, 1); in __mei_cl_send()
356 struct mei_cl *cl = device->cl; in mei_cl_send() local
358 if (cl == NULL) in mei_cl_send()
364 return __mei_cl_send(cl, buf, length); in mei_cl_send()
370 struct mei_cl *cl = device->cl; in mei_cl_recv() local
372 if (cl == NULL) in mei_cl_recv()
378 return __mei_cl_recv(cl, buf, length); in mei_cl_recv()
394 mei_cl_read_start(device->cl, 0, NULL); in mei_bus_event_work()
408 mei_cl_read_start(device->cl, 0, NULL); in mei_cl_register_event_cb()
430 struct mei_cl *cl = device->cl; in mei_cl_enable_device() local
432 if (cl == NULL) in mei_cl_enable_device()
435 dev = cl->dev; in mei_cl_enable_device()
439 err = mei_cl_connect(cl, NULL); in mei_cl_enable_device()
450 mei_cl_read_start(device->cl, 0, NULL); in mei_cl_enable_device()
463 struct mei_cl *cl = device->cl; in mei_cl_disable_device() local
465 if (cl == NULL) in mei_cl_disable_device()
468 dev = cl->dev; in mei_cl_disable_device()
477 if (!mei_cl_is_connected(cl)) { in mei_cl_disable_device()
483 cl->state = MEI_FILE_DISCONNECTING; in mei_cl_disable_device()
485 err = mei_cl_disconnect(cl); in mei_cl_disable_device()
492 mei_cl_flush_queues(cl, NULL); in mei_cl_disable_device()
501 void mei_cl_bus_rx_event(struct mei_cl *cl) in mei_cl_bus_rx_event() argument
503 struct mei_cl_device *device = cl->device; in mei_cl_bus_rx_event()
515 struct mei_cl *cl, *next; in mei_cl_bus_remove_devices() local
518 list_for_each_entry_safe(cl, next, &dev->device_list, device_link) { in mei_cl_bus_remove_devices()
519 if (cl->device) in mei_cl_bus_remove_devices()
520 mei_cl_remove_device(cl->device); in mei_cl_bus_remove_devices()
522 list_del(&cl->device_link); in mei_cl_bus_remove_devices()
523 mei_cl_unlink(cl); in mei_cl_bus_remove_devices()
524 kfree(cl); in mei_cl_bus_remove_devices()