RE: [PATCH v2 6/6] ufs: core: Add advanced RPMB support in ufs_bsg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +static int ufs_bsg_exec_advanced_rpmb_req(struct ufs_hba *hba, struct
> +bsg_job *job) {
> +       struct ufs_rpmb_request *rpmb_request = job->request;
> +       struct ufs_rpmb_reply *rpmb_reply = job->reply;
> +       struct bsg_buffer *payload = NULL;
> +       enum dma_data_direction dir;
> +       struct scatterlist *sg_list;
> +       int rpmb_req_type;
> +       int sg_cnt;
> +       int ret;
> +       int data_len;
> +
> +       if (hba->ufs_version < ufshci_version(4, 0) || !hba-
> >dev_info.b_advanced_rpmb_en ||
> +           !(hba->capabilities & MASK_EHSLUTRD_SUPPORTED))
> +               return -EINVAL;
> +
> +       if (rpmb_request->ehs_req.length != 2 || rpmb_request-
> >ehs_req.ehs_type != 1)
> +               return -EINVAL;
Maybe you could also check:
In case of rpmb write, the request payload 4096 × Advanced RPMB Block Count,
And same goes for response payload for rpmb read.

Thanks,
Avri





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux