Lines Matching refs:me_cl

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