Lines Matching refs:me_cl

23  * @me_cl: me client
25 void mei_me_cl_init(struct mei_me_client *me_cl)
27 INIT_LIST_HEAD(&me_cl->list);
28 kref_init(&me_cl->refcnt);
34 * @me_cl: me client
40 struct mei_me_client *mei_me_cl_get(struct mei_me_client *me_cl)
42 if (me_cl && kref_get_unless_zero(&me_cl->refcnt))
43 return me_cl;
57 struct mei_me_client *me_cl =
60 kfree(me_cl);
68 * @me_cl: me client
70 void mei_me_cl_put(struct mei_me_client *me_cl)
72 if (me_cl)
73 kref_put(&me_cl->refcnt, mei_me_cl_release);
81 * @me_cl: me client
85 static void __mei_me_cl_del(struct mei_device *dev, struct mei_me_client *me_cl)
87 if (!me_cl)
90 list_del_init(&me_cl->list);
91 mei_me_cl_put(me_cl);
99 * @me_cl: me client
101 void mei_me_cl_del(struct mei_device *dev, struct mei_me_client *me_cl)
104 __mei_me_cl_del(dev, me_cl);
112 * @me_cl: me client
114 void mei_me_cl_add(struct mei_device *dev, struct mei_me_client *me_cl)
117 list_add(&me_cl->list, &dev->me_clients);
135 struct mei_me_client *me_cl;
140 list_for_each_entry(me_cl, &dev->me_clients, list) {
141 pn = &me_cl->props.protocol_name;
143 return mei_me_cl_get(me_cl);
163 struct mei_me_client *me_cl;
166 me_cl = __mei_me_cl_by_uuid(dev, uuid);
169 return me_cl;
186 struct mei_me_client *__me_cl, *me_cl = NULL;
191 me_cl = mei_me_cl_get(__me_cl);
197 return me_cl;
215 struct mei_me_client *me_cl;
220 list_for_each_entry(me_cl, &dev->me_clients, list) {
221 pn = &me_cl->props.protocol_name;
223 me_cl->client_id == client_id)
224 return mei_me_cl_get(me_cl);
244 struct mei_me_client *me_cl;
247 me_cl = __mei_me_cl_by_uuid_id(dev, uuid, client_id);
250 return me_cl;
263 struct mei_me_client *me_cl;
268 me_cl = __mei_me_cl_by_uuid(dev, uuid);
269 __mei_me_cl_del(dev, me_cl);
270 mei_me_cl_put(me_cl);
285 struct mei_me_client *me_cl;
290 me_cl = __mei_me_cl_by_uuid_id(dev, uuid, id);
291 __mei_me_cl_del(dev, me_cl);
292 mei_me_cl_put(me_cl);
305 struct mei_me_client *me_cl, *next;
308 list_for_each_entry_safe(me_cl, next, &dev->me_clients, list)
309 __mei_me_cl_del(dev, me_cl);
819 if (!cl->me_cl)
822 if (!WARN_ON(cl->me_cl->connect_count == 0))
823 cl->me_cl->connect_count--;
825 if (cl->me_cl->connect_count == 0)
826 cl->me_cl->tx_flow_ctrl_creds = 0;
828 mei_me_cl_put(cl->me_cl);
829 cl->me_cl = NULL;
832 static int mei_cl_set_connecting(struct mei_cl *cl, struct mei_me_client *me_cl)
834 if (!mei_me_cl_get(me_cl))
838 if (me_cl->props.fixed_address) {
839 if (me_cl->connect_count) {
840 mei_me_cl_put(me_cl);
845 cl->me_cl = me_cl;
847 cl->me_cl->connect_count++;
1114 * @me_cl: me client
1121 int mei_cl_connect(struct mei_cl *cl, struct mei_me_client *me_cl,
1128 if (WARN_ON(!cl || !cl->dev || !me_cl))
1133 rets = mei_cl_set_connecting(cl, me_cl);
1241 if (WARN_ON(!cl || !cl->me_cl))
1251 if (cl->me_cl->tx_flow_ctrl_creds > 0)
1269 if (WARN_ON(!cl || !cl->me_cl))
1276 if (WARN_ON(cl->me_cl->tx_flow_ctrl_creds <= 0))
1278 cl->me_cl->tx_flow_ctrl_creds--;
1393 if (!cl->me_cl)
1396 return cl->me_cl->props.vt_supported ? 0 : -EOPNOTSUPP;
1688 if (!mei_me_cl_is_active(cl->me_cl)) {
1778 is_hbm = cb->cl->me_cl->client_id == 0;