Lines Matching defs:cctx
197 struct fastrpc_channel_ctx *cctx;
225 struct fastrpc_channel_ctx *cctx;
338 struct fastrpc_channel_ctx *cctx;
340 cctx = container_of(ref, struct fastrpc_channel_ctx, refcount);
342 kfree(cctx);
345 static void fastrpc_channel_ctx_get(struct fastrpc_channel_ctx *cctx)
347 kref_get(&cctx->refcount);
350 static void fastrpc_channel_ctx_put(struct fastrpc_channel_ctx *cctx)
352 kref_put(&cctx->refcount, fastrpc_channel_ctx_free);
358 struct fastrpc_channel_ctx *cctx;
363 cctx = ctx->cctx;
371 spin_lock_irqsave(&cctx->lock, flags);
372 idr_remove(&cctx->ctx_idr, ctx->ctxid >> 4);
373 spin_unlock_irqrestore(&cctx->lock, flags);
379 fastrpc_channel_ctx_put(cctx);
453 struct fastrpc_channel_ctx *cctx = user->cctx;
487 fastrpc_channel_ctx_get(cctx);
493 ctx->cctx = cctx;
501 spin_lock_irqsave(&cctx->lock, flags);
502 ret = idr_alloc_cyclic(&cctx->ctx_idr, ctx, 1,
505 spin_unlock_irqrestore(&cctx->lock, flags);
509 spin_unlock_irqrestore(&cctx->lock, flags);
518 fastrpc_channel_ctx_put(cctx);
923 struct fastrpc_channel_ctx *cctx;
928 cctx = fl->cctx;
942 ret = rpmsg_send(cctx->rpdev->ept, (void *)msg, sizeof(*msg));
961 if (!fl->cctx->rpdev)
1132 struct fastrpc_channel_ctx *cctx)
1138 spin_lock_irqsave(&cctx->lock, flags);
1139 for (i = 0; i < cctx->sesscount; i++) {
1140 if (!cctx->session[i].used && cctx->session[i].valid) {
1141 cctx->session[i].used = true;
1142 session = &cctx->session[i];
1146 spin_unlock_irqrestore(&cctx->lock, flags);
1151 static void fastrpc_session_free(struct fastrpc_channel_ctx *cctx,
1156 spin_lock_irqsave(&cctx->lock, flags);
1158 spin_unlock_irqrestore(&cctx->lock, flags);
1181 struct fastrpc_channel_ctx *cctx = fl->cctx;
1189 spin_lock_irqsave(&cctx->lock, flags);
1191 spin_unlock_irqrestore(&cctx->lock, flags);
1209 fastrpc_session_free(cctx, fl->sctx);
1210 fastrpc_channel_ctx_put(cctx);
1221 struct fastrpc_channel_ctx *cctx = miscdev_to_cctx(filp->private_data);
1230 fastrpc_channel_ctx_get(cctx);
1240 fl->cctx = cctx;
1242 fl->sctx = fastrpc_session_alloc(cctx);
1244 dev_err(&cctx->rpdev->dev, "No session available\n");
1251 spin_lock_irqsave(&cctx->lock, flags);
1252 list_add_tail(&fl->user, &cctx->users);
1253 spin_unlock_irqrestore(&cctx->lock, flags);
1539 struct fastrpc_channel_ctx *cctx;
1546 cctx = dev_get_drvdata(dev->parent);
1547 if (!cctx)
1552 spin_lock_irqsave(&cctx->lock, flags);
1553 if (cctx->sesscount >= FASTRPC_MAX_SESSIONS) {
1555 spin_unlock_irqrestore(&cctx->lock, flags);
1558 sess = &cctx->session[cctx->sesscount++];
1571 if (cctx->sesscount >= FASTRPC_MAX_SESSIONS)
1573 dup_sess = &cctx->session[cctx->sesscount++];
1577 spin_unlock_irqrestore(&cctx->lock, flags);
1589 struct fastrpc_channel_ctx *cctx = dev_get_drvdata(pdev->dev.parent);
1594 spin_lock_irqsave(&cctx->lock, flags);
1596 if (cctx->session[i].sid == sess->sid) {
1597 cctx->session[i].valid = false;
1598 cctx->sesscount--;
1601 spin_unlock_irqrestore(&cctx->lock, flags);
1687 struct fastrpc_channel_ctx *cctx = dev_get_drvdata(&rpdev->dev);
1692 spin_lock_irqsave(&cctx->lock, flags);
1693 cctx->rpdev = NULL;
1694 list_for_each_entry(user, &cctx->users, user)
1696 spin_unlock_irqrestore(&cctx->lock, flags);
1698 misc_deregister(&cctx->miscdev);
1701 fastrpc_channel_ctx_put(cctx);
1707 struct fastrpc_channel_ctx *cctx = dev_get_drvdata(&rpdev->dev);
1718 spin_lock_irqsave(&cctx->lock, flags);
1719 ctx = idr_find(&cctx->ctx_idr, ctxid);
1720 spin_unlock_irqrestore(&cctx->lock, flags);