Lines Matching refs:me_cl
25 void mei_me_cl_init(struct mei_me_client *me_cl) in mei_me_cl_init() argument
27 INIT_LIST_HEAD(&me_cl->list); in mei_me_cl_init()
28 kref_init(&me_cl->refcnt); in mei_me_cl_init()
40 struct mei_me_client *mei_me_cl_get(struct mei_me_client *me_cl) in mei_me_cl_get() argument
42 if (me_cl && kref_get_unless_zero(&me_cl->refcnt)) in mei_me_cl_get()
43 return me_cl; in mei_me_cl_get()
57 struct mei_me_client *me_cl = in mei_me_cl_release() local
60 kfree(me_cl); in mei_me_cl_release()
70 void mei_me_cl_put(struct mei_me_client *me_cl) in mei_me_cl_put() argument
72 if (me_cl) in mei_me_cl_put()
73 kref_put(&me_cl->refcnt, mei_me_cl_release); in mei_me_cl_put()
85 static void __mei_me_cl_del(struct mei_device *dev, struct mei_me_client *me_cl) in __mei_me_cl_del() argument
87 if (!me_cl) in __mei_me_cl_del()
90 list_del_init(&me_cl->list); in __mei_me_cl_del()
91 mei_me_cl_put(me_cl); in __mei_me_cl_del()
101 void mei_me_cl_del(struct mei_device *dev, struct mei_me_client *me_cl) in mei_me_cl_del() argument
104 __mei_me_cl_del(dev, me_cl); in mei_me_cl_del()
114 void mei_me_cl_add(struct mei_device *dev, struct mei_me_client *me_cl) in mei_me_cl_add() argument
117 list_add(&me_cl->list, &dev->me_clients); in mei_me_cl_add()
135 struct mei_me_client *me_cl; in __mei_me_cl_by_uuid() local
140 list_for_each_entry(me_cl, &dev->me_clients, list) { in __mei_me_cl_by_uuid()
141 pn = &me_cl->props.protocol_name; in __mei_me_cl_by_uuid()
143 return mei_me_cl_get(me_cl); in __mei_me_cl_by_uuid()
163 struct mei_me_client *me_cl; in mei_me_cl_by_uuid() local
166 me_cl = __mei_me_cl_by_uuid(dev, uuid); in mei_me_cl_by_uuid()
169 return me_cl; in mei_me_cl_by_uuid()
186 struct mei_me_client *__me_cl, *me_cl = NULL; in mei_me_cl_by_id() local
191 me_cl = mei_me_cl_get(__me_cl); in mei_me_cl_by_id()
197 return me_cl; in mei_me_cl_by_id()
215 struct mei_me_client *me_cl; in __mei_me_cl_by_uuid_id() local
220 list_for_each_entry(me_cl, &dev->me_clients, list) { in __mei_me_cl_by_uuid_id()
221 pn = &me_cl->props.protocol_name; in __mei_me_cl_by_uuid_id()
223 me_cl->client_id == client_id) in __mei_me_cl_by_uuid_id()
224 return mei_me_cl_get(me_cl); in __mei_me_cl_by_uuid_id()
244 struct mei_me_client *me_cl; in mei_me_cl_by_uuid_id() local
247 me_cl = __mei_me_cl_by_uuid_id(dev, uuid, client_id); in mei_me_cl_by_uuid_id()
250 return me_cl; in mei_me_cl_by_uuid_id()
263 struct mei_me_client *me_cl; in mei_me_cl_rm_by_uuid() local
268 me_cl = __mei_me_cl_by_uuid(dev, uuid); in mei_me_cl_rm_by_uuid()
269 __mei_me_cl_del(dev, me_cl); in mei_me_cl_rm_by_uuid()
270 mei_me_cl_put(me_cl); in mei_me_cl_rm_by_uuid()
285 struct mei_me_client *me_cl; in mei_me_cl_rm_by_uuid_id() local
290 me_cl = __mei_me_cl_by_uuid_id(dev, uuid, id); in mei_me_cl_rm_by_uuid_id()
291 __mei_me_cl_del(dev, me_cl); in mei_me_cl_rm_by_uuid_id()
292 mei_me_cl_put(me_cl); in mei_me_cl_rm_by_uuid_id()
305 struct mei_me_client *me_cl, *next; in mei_me_cl_rm_all() local
308 list_for_each_entry_safe(me_cl, next, &dev->me_clients, list) in mei_me_cl_rm_all()
309 __mei_me_cl_del(dev, me_cl); in mei_me_cl_rm_all()
817 if (!cl->me_cl) in mei_cl_set_disconnected()
820 if (!WARN_ON(cl->me_cl->connect_count == 0)) in mei_cl_set_disconnected()
821 cl->me_cl->connect_count--; in mei_cl_set_disconnected()
823 if (cl->me_cl->connect_count == 0) in mei_cl_set_disconnected()
824 cl->me_cl->tx_flow_ctrl_creds = 0; in mei_cl_set_disconnected()
826 mei_me_cl_put(cl->me_cl); in mei_cl_set_disconnected()
827 cl->me_cl = NULL; in mei_cl_set_disconnected()
830 static int mei_cl_set_connecting(struct mei_cl *cl, struct mei_me_client *me_cl) in mei_cl_set_connecting() argument
832 if (!mei_me_cl_get(me_cl)) in mei_cl_set_connecting()
836 if (me_cl->props.fixed_address) { in mei_cl_set_connecting()
837 if (me_cl->connect_count) { in mei_cl_set_connecting()
838 mei_me_cl_put(me_cl); in mei_cl_set_connecting()
843 cl->me_cl = me_cl; in mei_cl_set_connecting()
845 cl->me_cl->connect_count++; in mei_cl_set_connecting()
1119 int mei_cl_connect(struct mei_cl *cl, struct mei_me_client *me_cl, in mei_cl_connect() argument
1126 if (WARN_ON(!cl || !cl->dev || !me_cl)) in mei_cl_connect()
1131 rets = mei_cl_set_connecting(cl, me_cl); in mei_cl_connect()
1239 if (WARN_ON(!cl || !cl->me_cl)) in mei_cl_tx_flow_ctrl_creds()
1249 if (cl->me_cl->tx_flow_ctrl_creds > 0) in mei_cl_tx_flow_ctrl_creds()
1267 if (WARN_ON(!cl || !cl->me_cl)) in mei_cl_tx_flow_ctrl_creds_reduce()
1274 if (WARN_ON(cl->me_cl->tx_flow_ctrl_creds <= 0)) in mei_cl_tx_flow_ctrl_creds_reduce()
1276 cl->me_cl->tx_flow_ctrl_creds--; in mei_cl_tx_flow_ctrl_creds_reduce()
1389 if (!cl->me_cl) in mei_cl_vt_support_check()
1392 return cl->me_cl->props.vt_supported ? 0 : -EOPNOTSUPP; in mei_cl_vt_support_check()
1684 if (!mei_me_cl_is_active(cl->me_cl)) { in mei_cl_read_start()