Lines Matching refs:me_cl

24 void mei_me_cl_init(struct mei_me_client *me_cl)  in mei_me_cl_init()  argument
26 INIT_LIST_HEAD(&me_cl->list); in mei_me_cl_init()
27 kref_init(&me_cl->refcnt); in mei_me_cl_init()
39 struct mei_me_client *mei_me_cl_get(struct mei_me_client *me_cl) in mei_me_cl_get() argument
41 if (me_cl && kref_get_unless_zero(&me_cl->refcnt)) in mei_me_cl_get()
42 return me_cl; in mei_me_cl_get()
56 struct mei_me_client *me_cl = in mei_me_cl_release() local
59 kfree(me_cl); in mei_me_cl_release()
69 void mei_me_cl_put(struct mei_me_client *me_cl) in mei_me_cl_put() argument
71 if (me_cl) in mei_me_cl_put()
72 kref_put(&me_cl->refcnt, mei_me_cl_release); in mei_me_cl_put()
84 static void __mei_me_cl_del(struct mei_device *dev, struct mei_me_client *me_cl) in __mei_me_cl_del() argument
86 if (!me_cl) in __mei_me_cl_del()
89 list_del_init(&me_cl->list); in __mei_me_cl_del()
90 mei_me_cl_put(me_cl); in __mei_me_cl_del()
100 void mei_me_cl_del(struct mei_device *dev, struct mei_me_client *me_cl) in mei_me_cl_del() argument
103 __mei_me_cl_del(dev, me_cl); in mei_me_cl_del()
113 void mei_me_cl_add(struct mei_device *dev, struct mei_me_client *me_cl) in mei_me_cl_add() argument
116 list_add(&me_cl->list, &dev->me_clients); in mei_me_cl_add()
134 struct mei_me_client *me_cl; in __mei_me_cl_by_uuid() local
139 list_for_each_entry(me_cl, &dev->me_clients, list) { in __mei_me_cl_by_uuid()
140 pn = &me_cl->props.protocol_name; in __mei_me_cl_by_uuid()
142 return mei_me_cl_get(me_cl); in __mei_me_cl_by_uuid()
162 struct mei_me_client *me_cl; in mei_me_cl_by_uuid() local
165 me_cl = __mei_me_cl_by_uuid(dev, uuid); in mei_me_cl_by_uuid()
168 return me_cl; in mei_me_cl_by_uuid()
185 struct mei_me_client *__me_cl, *me_cl = NULL; in mei_me_cl_by_id() local
190 me_cl = mei_me_cl_get(__me_cl); in mei_me_cl_by_id()
196 return me_cl; in mei_me_cl_by_id()
214 struct mei_me_client *me_cl; in __mei_me_cl_by_uuid_id() local
219 list_for_each_entry(me_cl, &dev->me_clients, list) { in __mei_me_cl_by_uuid_id()
220 pn = &me_cl->props.protocol_name; in __mei_me_cl_by_uuid_id()
222 me_cl->client_id == client_id) in __mei_me_cl_by_uuid_id()
223 return mei_me_cl_get(me_cl); in __mei_me_cl_by_uuid_id()
243 struct mei_me_client *me_cl; in mei_me_cl_by_uuid_id() local
246 me_cl = __mei_me_cl_by_uuid_id(dev, uuid, client_id); in mei_me_cl_by_uuid_id()
249 return me_cl; in mei_me_cl_by_uuid_id()
262 struct mei_me_client *me_cl; in mei_me_cl_rm_by_uuid() local
267 me_cl = __mei_me_cl_by_uuid(dev, uuid); in mei_me_cl_rm_by_uuid()
268 __mei_me_cl_del(dev, me_cl); in mei_me_cl_rm_by_uuid()
269 mei_me_cl_put(me_cl); in mei_me_cl_rm_by_uuid()
284 struct mei_me_client *me_cl; in mei_me_cl_rm_by_uuid_id() local
289 me_cl = __mei_me_cl_by_uuid_id(dev, uuid, id); in mei_me_cl_rm_by_uuid_id()
290 __mei_me_cl_del(dev, me_cl); in mei_me_cl_rm_by_uuid_id()
291 mei_me_cl_put(me_cl); in mei_me_cl_rm_by_uuid_id()
304 struct mei_me_client *me_cl, *next; in mei_me_cl_rm_all() local
307 list_for_each_entry_safe(me_cl, next, &dev->me_clients, list) in mei_me_cl_rm_all()
308 __mei_me_cl_del(dev, me_cl); in mei_me_cl_rm_all()
813 if (!cl->me_cl) in mei_cl_set_disconnected()
816 if (!WARN_ON(cl->me_cl->connect_count == 0)) in mei_cl_set_disconnected()
817 cl->me_cl->connect_count--; in mei_cl_set_disconnected()
819 if (cl->me_cl->connect_count == 0) in mei_cl_set_disconnected()
820 cl->me_cl->tx_flow_ctrl_creds = 0; in mei_cl_set_disconnected()
822 mei_me_cl_put(cl->me_cl); in mei_cl_set_disconnected()
823 cl->me_cl = NULL; in mei_cl_set_disconnected()
826 static int mei_cl_set_connecting(struct mei_cl *cl, struct mei_me_client *me_cl) in mei_cl_set_connecting() argument
828 if (!mei_me_cl_get(me_cl)) in mei_cl_set_connecting()
832 if (me_cl->props.fixed_address) { in mei_cl_set_connecting()
833 if (me_cl->connect_count) { in mei_cl_set_connecting()
834 mei_me_cl_put(me_cl); in mei_cl_set_connecting()
839 cl->me_cl = me_cl; in mei_cl_set_connecting()
841 cl->me_cl->connect_count++; in mei_cl_set_connecting()
1114 int mei_cl_connect(struct mei_cl *cl, struct mei_me_client *me_cl, in mei_cl_connect() argument
1121 if (WARN_ON(!cl || !cl->dev || !me_cl)) in mei_cl_connect()
1126 rets = mei_cl_set_connecting(cl, me_cl); in mei_cl_connect()
1234 if (WARN_ON(!cl || !cl->me_cl)) in mei_cl_tx_flow_ctrl_creds()
1244 if (cl->me_cl->tx_flow_ctrl_creds > 0) in mei_cl_tx_flow_ctrl_creds()
1262 if (WARN_ON(!cl || !cl->me_cl)) in mei_cl_tx_flow_ctrl_creds_reduce()
1269 if (WARN_ON(cl->me_cl->tx_flow_ctrl_creds <= 0)) in mei_cl_tx_flow_ctrl_creds_reduce()
1271 cl->me_cl->tx_flow_ctrl_creds--; in mei_cl_tx_flow_ctrl_creds_reduce()
1382 if (!cl->me_cl) in mei_cl_vt_support_check()
1385 return cl->me_cl->props.vt_supported ? 0 : -EOPNOTSUPP; in mei_cl_vt_support_check()
1677 if (!mei_me_cl_is_active(cl->me_cl)) { in mei_cl_read_start()