OSDN Git Service

crypto: ccp - Add support for setting user ID for dynamic boost control
[tomoyo/tomoyo-test1.git] / drivers / crypto / ccp / dbc.c
index f65e93a..c6f5fb3 100644 (file)
@@ -117,6 +117,24 @@ static long dbc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                        goto unlock;
                }
                break;
+       case DBCIOCUID:
+               dbc_dev->mbox->req.header.payload_size = sizeof(dbc_dev->mbox->dbc_set_uid);
+               if (copy_from_user(&dbc_dev->mbox->dbc_set_uid.user, argp,
+                                  sizeof(struct dbc_user_setuid))) {
+                       ret = -EFAULT;
+                       goto unlock;
+               }
+
+               ret = send_dbc_cmd(dbc_dev, PSP_DYNAMIC_BOOST_SET_UID);
+               if (ret)
+                       goto unlock;
+
+               if (copy_to_user(argp, &dbc_dev->mbox->dbc_set_uid.user,
+                                sizeof(struct dbc_user_setuid))) {
+                       ret = -EFAULT;
+                       goto unlock;
+               }
+               break;
        default:
                ret = -EINVAL;