/openbmc/linux/drivers/media/rc/ |
H A D | imon.c | 494 static void free_imon_context(struct imon_context *ictx) in free_imon_context() argument 496 struct device *dev = ictx->dev; in free_imon_context() 498 usb_free_urb(ictx->tx_urb); in free_imon_context() 499 WARN_ON(ictx->dev_present_intf0); in free_imon_context() 500 usb_free_urb(ictx->rx_urb_intf0); in free_imon_context() 501 WARN_ON(ictx->dev_present_intf1); in free_imon_context() 502 usb_free_urb(ictx->rx_urb_intf1); in free_imon_context() 503 kfree_rcu(ictx, rcu); in free_imon_context() 515 struct imon_context *ictx = NULL; in display_open() local 528 ictx = usb_get_intfdata(interface); in display_open() [all …]
|
/openbmc/u-boot/tools/ |
H A D | mxsimage.c | 204 static int sb_aes_init(struct sb_image_ctx *ictx, uint8_t *iv, int enc) in sb_aes_init() argument 211 iv = ictx->image_key; in sb_aes_init() 214 ret = EVP_CipherInit(ctx, EVP_aes_128_cbc(), ictx->image_key, iv, enc); in sb_aes_init() 217 ictx->cipher_ctx = ctx; in sb_aes_init() 222 static int sb_aes_crypt(struct sb_image_ctx *ictx, uint8_t *in_data, in sb_aes_crypt() argument 225 EVP_CIPHER_CTX *ctx = ictx->cipher_ctx; in sb_aes_crypt() 253 static int sb_aes_reinit(struct sb_image_ctx *ictx, int enc) in sb_aes_reinit() argument 256 EVP_CIPHER_CTX *ctx = ictx->cipher_ctx; in sb_aes_reinit() 257 struct sb_boot_image_header *sb_header = &ictx->payload; in sb_aes_reinit() 263 return sb_aes_init(ictx, iv, enc); in sb_aes_reinit() [all …]
|
/openbmc/linux/drivers/iommu/iommufd/ |
H A D | vfio_compat.c | 15 static struct iommufd_ioas *get_compat_ioas(struct iommufd_ctx *ictx) in get_compat_ioas() argument 19 xa_lock(&ictx->objects); in get_compat_ioas() 20 if (!ictx->vfio_ioas || !iommufd_lock_obj(&ictx->vfio_ioas->obj)) in get_compat_ioas() 22 ioas = ictx->vfio_ioas; in get_compat_ioas() 24 xa_unlock(&ictx->objects); in get_compat_ioas() 36 int iommufd_vfio_compat_ioas_get_id(struct iommufd_ctx *ictx, u32 *out_ioas_id) in iommufd_vfio_compat_ioas_get_id() argument 40 ioas = get_compat_ioas(ictx); in iommufd_vfio_compat_ioas_get_id() 55 int iommufd_vfio_compat_set_no_iommu(struct iommufd_ctx *ictx) in iommufd_vfio_compat_set_no_iommu() argument 59 xa_lock(&ictx->objects); in iommufd_vfio_compat_set_no_iommu() 60 if (!ictx->vfio_ioas) { in iommufd_vfio_compat_set_no_iommu() [all …]
|
H A D | main.c | 32 struct iommufd_object *_iommufd_object_alloc(struct iommufd_ctx *ictx, in _iommufd_object_alloc() argument 62 rc = xa_alloc(&ictx->objects, &obj->id, XA_ZERO_ENTRY, in _iommufd_object_alloc() 81 void iommufd_object_finalize(struct iommufd_ctx *ictx, in iommufd_object_finalize() argument 86 old = xa_store(&ictx->objects, obj->id, obj, GFP_KERNEL); in iommufd_object_finalize() 92 void iommufd_object_abort(struct iommufd_ctx *ictx, struct iommufd_object *obj) in iommufd_object_abort() argument 96 old = xa_erase(&ictx->objects, obj->id); in iommufd_object_abort() 105 void iommufd_object_abort_and_destroy(struct iommufd_ctx *ictx, in iommufd_object_abort_and_destroy() argument 112 iommufd_object_abort(ictx, obj); in iommufd_object_abort_and_destroy() 115 struct iommufd_object *iommufd_get_object(struct iommufd_ctx *ictx, u32 id, in iommufd_get_object() argument 123 xa_lock(&ictx->objects); in iommufd_get_object() [all …]
|
H A D | iommufd_private.h | 62 int iopt_map_user_pages(struct iommufd_ctx *ictx, struct io_pagetable *iopt, 93 struct iommufd_ctx *ictx; member 99 int iommufd_vfio_ioctl(struct iommufd_ctx *ictx, unsigned int cmd, 144 struct iommufd_object *iommufd_get_object(struct iommufd_ctx *ictx, u32 id, 152 void iommufd_object_abort(struct iommufd_ctx *ictx, struct iommufd_object *obj); 153 void iommufd_object_abort_and_destroy(struct iommufd_ctx *ictx, 155 void iommufd_object_finalize(struct iommufd_ctx *ictx, 157 void __iommufd_object_destroy_user(struct iommufd_ctx *ictx, 159 static inline void iommufd_object_destroy_user(struct iommufd_ctx *ictx, in iommufd_object_destroy_user() argument 162 __iommufd_object_destroy_user(ictx, obj, false); in iommufd_object_destroy_user() [all …]
|
H A D | device.c | 27 xa_cmpxchg(&igroup->ictx->groups, iommu_group_id(igroup->group), igroup, in iommufd_group_release() 60 static struct iommufd_group *iommufd_get_group(struct iommufd_ctx *ictx, in iommufd_get_group() argument 75 xa_lock(&ictx->groups); in iommufd_get_group() 76 igroup = xa_load(&ictx->groups, id); in iommufd_get_group() 78 xa_unlock(&ictx->groups); in iommufd_get_group() 82 xa_unlock(&ictx->groups); in iommufd_get_group() 101 new_igroup->ictx = ictx; in iommufd_get_group() 108 xa_lock(&ictx->groups); in iommufd_get_group() 110 igroup = __xa_cmpxchg(&ictx->groups, id, cur_igroup, new_igroup, in iommufd_get_group() 113 xa_unlock(&ictx->groups); in iommufd_get_group() [all …]
|
H A D | ioas.c | 23 struct iommufd_ioas *iommufd_ioas_alloc(struct iommufd_ctx *ictx) in iommufd_ioas_alloc() argument 27 ioas = iommufd_object_alloc(ictx, ioas, IOMMUFD_OBJ_IOAS); in iommufd_ioas_alloc() 46 ioas = iommufd_ioas_alloc(ucmd->ictx); in iommufd_ioas_alloc_ioctl() 54 iommufd_object_finalize(ucmd->ictx, &ioas->obj); in iommufd_ioas_alloc_ioctl() 58 iommufd_object_abort_and_destroy(ucmd->ictx, &ioas->obj); in iommufd_ioas_alloc_ioctl() 74 ioas = iommufd_get_ioas(ucmd->ictx, cmd->ioas_id); in iommufd_ioas_iova_ranges() 154 ioas = iommufd_get_ioas(ucmd->ictx, cmd->ioas_id); in iommufd_ioas_allow_iovas() 220 ioas = iommufd_get_ioas(ucmd->ictx, cmd->ioas_id); in iommufd_ioas_map() 226 rc = iopt_map_user_pages(ucmd->ictx, &ioas->iopt, &iova, in iommufd_ioas_map() 264 src_ioas = iommufd_get_ioas(ucmd->ictx, cmd->src_ioas_id); in iommufd_ioas_copy() [all …]
|
H A D | hw_pagetable.c | 74 iommufd_hw_pagetable_alloc(struct iommufd_ctx *ictx, struct iommufd_ioas *ioas, in iommufd_hw_pagetable_alloc() argument 82 hwpt = iommufd_object_alloc(ictx, hwpt, IOMMUFD_OBJ_HW_PAGETABLE); in iommufd_hw_pagetable_alloc() 132 iommufd_object_abort_and_destroy(ictx, &hwpt->obj); in iommufd_hw_pagetable_alloc() 151 ioas = iommufd_get_ioas(ucmd->ictx, cmd->pt_id); in iommufd_hwpt_alloc() 158 hwpt = iommufd_hw_pagetable_alloc(ucmd->ictx, ioas, idev, false); in iommufd_hwpt_alloc() 168 iommufd_object_finalize(ucmd->ictx, &hwpt->obj); in iommufd_hwpt_alloc() 172 iommufd_object_abort_and_destroy(ucmd->ictx, &hwpt->obj); in iommufd_hwpt_alloc()
|
/openbmc/linux/fs/ntfs/ |
H A D | index.h | 75 extern void ntfs_index_ctx_put(ntfs_index_context *ictx); 78 ntfs_index_context *ictx); 97 static inline void ntfs_index_entry_flush_dcache_page(ntfs_index_context *ictx) in ntfs_index_entry_flush_dcache_page() argument 99 if (ictx->is_in_root) in ntfs_index_entry_flush_dcache_page() 100 flush_dcache_mft_record_page(ictx->actx->ntfs_ino); in ntfs_index_entry_flush_dcache_page() 102 flush_dcache_page(ictx->page); in ntfs_index_entry_flush_dcache_page() 123 static inline void ntfs_index_entry_mark_dirty(ntfs_index_context *ictx) in ntfs_index_entry_mark_dirty() argument 125 if (ictx->is_in_root) in ntfs_index_entry_mark_dirty() 126 mark_mft_record_dirty(ictx->actx->ntfs_ino); in ntfs_index_entry_mark_dirty() 128 mark_ntfs_record_dirty(ictx->page, in ntfs_index_entry_mark_dirty() [all …]
|
H A D | index.c | 27 ntfs_index_context *ictx; in ntfs_index_ctx_get() local 29 ictx = kmem_cache_alloc(ntfs_index_ctx_cache, GFP_NOFS); in ntfs_index_ctx_get() 30 if (ictx) in ntfs_index_ctx_get() 31 *ictx = (ntfs_index_context){ .idx_ni = idx_ni }; in ntfs_index_ctx_get() 32 return ictx; in ntfs_index_ctx_get() 43 void ntfs_index_ctx_put(ntfs_index_context *ictx) in ntfs_index_ctx_put() argument 45 if (ictx->entry) { in ntfs_index_ctx_put() 46 if (ictx->is_in_root) { in ntfs_index_ctx_put() 47 if (ictx->actx) in ntfs_index_ctx_put() 48 ntfs_attr_put_search_ctx(ictx->actx); in ntfs_index_ctx_put() [all …]
|
H A D | quota.c | 25 ntfs_index_context *ictx; in ntfs_mark_quotas_out_of_date() local 38 ictx = ntfs_index_ctx_get(NTFS_I(vol->quota_q_ino)); in ntfs_mark_quotas_out_of_date() 39 if (!ictx) { in ntfs_mark_quotas_out_of_date() 43 err = ntfs_index_lookup(&qid, sizeof(qid), ictx); in ntfs_mark_quotas_out_of_date() 53 if (ictx->data_len < offsetof(QUOTA_CONTROL_ENTRY, sid)) { in ntfs_mark_quotas_out_of_date() 58 qce = (QUOTA_CONTROL_ENTRY*)ictx->data; in ntfs_mark_quotas_out_of_date() 83 ntfs_index_entry_flush_dcache_page(ictx); in ntfs_mark_quotas_out_of_date() 84 ntfs_index_entry_mark_dirty(ictx); in ntfs_mark_quotas_out_of_date() 86 ntfs_index_ctx_put(ictx); in ntfs_mark_quotas_out_of_date() 97 if (ictx) in ntfs_mark_quotas_out_of_date() [all …]
|
/openbmc/linux/arch/s390/crypto/ |
H A D | sha3_512_s390.c | 47 const struct sha3_state *ictx = in; in sha3_512_import() local 49 if (unlikely(ictx->rsizw)) in sha3_512_import() 51 sctx->count = ictx->rsiz; in sha3_512_import() 53 memcpy(sctx->state, ictx->st, sizeof(ictx->st)); in sha3_512_import() 54 memcpy(sctx->buf, ictx->buf, sizeof(ictx->buf)); in sha3_512_import() 63 const struct sha3_state *ictx = in; in sha3_384_import() local 65 if (unlikely(ictx->rsizw)) in sha3_384_import() 67 sctx->count = ictx->rsiz; in sha3_384_import() 69 memcpy(sctx->state, ictx->st, sizeof(ictx->st)); in sha3_384_import() 70 memcpy(sctx->buf, ictx->buf, sizeof(ictx->buf)); in sha3_384_import()
|
H A D | sha3_256_s390.c | 46 const struct sha3_state *ictx = in; in sha3_256_import() local 48 sctx->count = ictx->rsiz; in sha3_256_import() 49 memcpy(sctx->state, ictx->st, sizeof(ictx->st)); in sha3_256_import() 50 memcpy(sctx->buf, ictx->buf, sizeof(ictx->buf)); in sha3_256_import() 59 const struct sha3_state *ictx = in; in sha3_224_import() local 61 sctx->count = ictx->rsiz; in sha3_224_import() 62 memcpy(sctx->state, ictx->st, sizeof(ictx->st)); in sha3_224_import() 63 memcpy(sctx->buf, ictx->buf, sizeof(ictx->buf)); in sha3_224_import()
|
H A D | sha1_s390.c | 59 const struct sha1_state *ictx = in; in s390_sha1_import() local 61 sctx->count = ictx->count; in s390_sha1_import() 62 memcpy(sctx->state, ictx->state, sizeof(ictx->state)); in s390_sha1_import() 63 memcpy(sctx->buf, ictx->buffer, sizeof(ictx->buffer)); in s390_sha1_import()
|
H A D | sha512_s390.c | 54 const struct sha512_state *ictx = in; in sha512_import() local 56 if (unlikely(ictx->count[1])) in sha512_import() 58 sctx->count = ictx->count[0]; in sha512_import() 60 memcpy(sctx->state, ictx->state, sizeof(ictx->state)); in sha512_import() 61 memcpy(sctx->buf, ictx->buf, sizeof(ictx->buf)); in sha512_import()
|
H A D | sha256_s390.c | 52 const struct sha256_state *ictx = in; in sha256_import() local 54 sctx->count = ictx->count; in sha256_import() 55 memcpy(sctx->state, ictx->state, sizeof(ictx->state)); in sha256_import() 56 memcpy(sctx->buf, ictx->buf, sizeof(ictx->buf)); in sha256_import()
|
/openbmc/linux/include/linux/ |
H A D | iommufd.h | 21 struct iommufd_device *iommufd_device_bind(struct iommufd_ctx *ictx, 48 iommufd_access_create(struct iommufd_ctx *ictx, 55 void iommufd_ctx_get(struct iommufd_ctx *ictx); 60 void iommufd_ctx_put(struct iommufd_ctx *ictx); 61 bool iommufd_ctx_has_group(struct iommufd_ctx *ictx, struct iommu_group *group); 70 int iommufd_vfio_compat_ioas_get_id(struct iommufd_ctx *ictx, u32 *out_ioas_id); 71 int iommufd_vfio_compat_ioas_create(struct iommufd_ctx *ictx); 72 int iommufd_vfio_compat_set_no_iommu(struct iommufd_ctx *ictx); 79 static inline void iommufd_ctx_put(struct iommufd_ctx *ictx) in iommufd_ctx_put() argument 104 static inline int iommufd_vfio_compat_ioas_create(struct iommufd_ctx *ictx) in iommufd_vfio_compat_ioas_create() argument [all …]
|
H A D | vfio.h | 106 struct iommufd_ctx *ictx, u32 *out_device_id); 128 int vfio_iommufd_get_dev_id(struct vfio_device *vdev, struct iommufd_ctx *ictx); 130 struct iommufd_ctx *ictx, u32 *out_device_id); 135 struct iommufd_ctx *ictx, u32 *out_device_id); 147 vfio_iommufd_get_dev_id(struct vfio_device *vdev, struct iommufd_ctx *ictx) in vfio_iommufd_get_dev_id() argument 153 ((int (*)(struct vfio_device *vdev, struct iommufd_ctx *ictx, \ 162 ((int (*)(struct vfio_device *vdev, struct iommufd_ctx *ictx, \
|
/openbmc/linux/drivers/vfio/ |
H A D | iommufd.c | 14 struct iommufd_ctx *ictx) in vfio_iommufd_device_has_compat_ioas() argument 18 return !iommufd_vfio_compat_ioas_get_id(ictx, &ioas_id); in vfio_iommufd_device_has_compat_ioas() 24 struct iommufd_ctx *ictx = df->iommufd; in vfio_df_iommufd_bind() local 28 return vdev->ops->bind_iommufd(vdev, ictx, &df->devid); in vfio_df_iommufd_bind() 32 struct iommufd_ctx *ictx) in vfio_iommufd_compat_attach_ioas() argument 43 ret = iommufd_vfio_compat_ioas_get_id(ictx, &ioas_id); in vfio_iommufd_compat_attach_ioas() 85 int vfio_iommufd_get_dev_id(struct vfio_device *vdev, struct iommufd_ctx *ictx) in vfio_iommufd_get_dev_id() argument 90 if (vfio_iommufd_device_ictx(vdev) == ictx) in vfio_iommufd_get_dev_id() 97 if (iommufd_ctx_has_group(ictx, group)) in vfio_iommufd_get_dev_id() 114 struct iommufd_ctx *ictx, u32 *out_device_id) in vfio_iommufd_physical_bind() argument [all …]
|
/openbmc/linux/crypto/ |
H A D | essiv.c | 270 static int essiv_init_tfm(struct essiv_instance_ctx *ictx, in essiv_init_tfm() argument 277 essiv_cipher = crypto_alloc_cipher(ictx->essiv_cipher_name, 0, 0); in essiv_init_tfm() 281 hash = crypto_alloc_shash(ictx->shash_driver_name, 0, 0); in essiv_init_tfm() 300 struct essiv_instance_ctx *ictx = skcipher_instance_ctx(inst); in essiv_skcipher_init_tfm() local 305 skcipher = crypto_spawn_skcipher(&ictx->u.skcipher_spawn); in essiv_skcipher_init_tfm() 312 err = essiv_init_tfm(ictx, tctx); in essiv_skcipher_init_tfm() 325 struct essiv_instance_ctx *ictx = aead_instance_ctx(inst); in essiv_aead_init_tfm() local 334 aead = crypto_spawn_aead(&ictx->u.aead_spawn); in essiv_aead_init_tfm() 345 err = essiv_init_tfm(ictx, tctx); in essiv_aead_init_tfm() 375 struct essiv_instance_ctx *ictx = skcipher_instance_ctx(inst); in essiv_skcipher_free_instance() local [all …]
|
H A D | hctr2.c | 337 struct hctr2_instance_ctx *ictx = skcipher_instance_ctx(inst); in hctr2_init_tfm() local 345 xctr = crypto_spawn_skcipher(&ictx->xctr_spawn); in hctr2_init_tfm() 349 blockcipher = crypto_spawn_cipher(&ictx->blockcipher_spawn); in hctr2_init_tfm() 355 polyval = crypto_spawn_shash(&ictx->polyval_spawn); in hctr2_init_tfm() 396 struct hctr2_instance_ctx *ictx = skcipher_instance_ctx(inst); in hctr2_free_instance() local 398 crypto_drop_cipher(&ictx->blockcipher_spawn); in hctr2_free_instance() 399 crypto_drop_skcipher(&ictx->xctr_spawn); in hctr2_free_instance() 400 crypto_drop_shash(&ictx->polyval_spawn); in hctr2_free_instance() 411 struct hctr2_instance_ctx *ictx; in hctr2_create_common() local 423 inst = kzalloc(sizeof(*inst) + sizeof(*ictx), GFP_KERNEL); in hctr2_create_common() [all …]
|
H A D | adiantum.c | 399 struct adiantum_instance_ctx *ictx = skcipher_instance_ctx(inst); in adiantum_init_tfm() local 407 streamcipher = crypto_spawn_skcipher(&ictx->streamcipher_spawn); in adiantum_init_tfm() 411 blockcipher = crypto_spawn_cipher(&ictx->blockcipher_spawn); in adiantum_init_tfm() 417 hash = crypto_spawn_shash(&ictx->hash_spawn); in adiantum_init_tfm() 459 struct adiantum_instance_ctx *ictx = skcipher_instance_ctx(inst); in adiantum_free_instance() local 461 crypto_drop_skcipher(&ictx->streamcipher_spawn); in adiantum_free_instance() 462 crypto_drop_cipher(&ictx->blockcipher_spawn); in adiantum_free_instance() 463 crypto_drop_shash(&ictx->hash_spawn); in adiantum_free_instance() 496 struct adiantum_instance_ctx *ictx; in adiantum_create() local 506 inst = kzalloc(sizeof(*inst) + sizeof(*ictx), GFP_KERNEL); in adiantum_create() [all …]
|
H A D | authenc.c | 117 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in authenc_geniv_ahash_done() local 119 struct ahash_request *ahreq = (void *)(areq_ctx->tail + ictx->reqoff); in authenc_geniv_ahash_done() 137 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_genicv() local 140 struct ahash_request *ahreq = (void *)(areq_ctx->tail + ictx->reqoff); in crypto_authenc_genicv() 196 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_encrypt() local 201 ictx->reqoff); in crypto_authenc_encrypt() 234 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_decrypt_tail() local 236 struct ahash_request *ahreq = (void *)(areq_ctx->tail + ictx->reqoff); in crypto_authenc_decrypt_tail() 238 ictx->reqoff); in crypto_authenc_decrypt_tail() 282 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_decrypt() local [all …]
|
H A D | pcrypt.c | 101 struct pcrypt_instance_ctx *ictx; in pcrypt_aead_encrypt() local 103 ictx = pcrypt_tfm_ictx(aead); in pcrypt_aead_encrypt() 117 err = padata_do_parallel(ictx->psenc, padata, &ctx->cb_cpu); in pcrypt_aead_encrypt() 152 struct pcrypt_instance_ctx *ictx; in pcrypt_aead_decrypt() local 154 ictx = pcrypt_tfm_ictx(aead); in pcrypt_aead_decrypt() 168 err = padata_do_parallel(ictx->psdec, padata, &ctx->cb_cpu); in pcrypt_aead_decrypt() 183 struct pcrypt_instance_ctx *ictx = aead_instance_ctx(inst); in pcrypt_aead_init_tfm() local 187 cpu_index = (unsigned int)atomic_inc_return(&ictx->tfm_count) % in pcrypt_aead_init_tfm() 194 cipher = crypto_spawn_aead(&ictx->spawn); in pcrypt_aead_init_tfm()
|
/openbmc/linux/drivers/crypto/allwinner/sun4i-ss/ |
H A D | sun4i-ss-hash.c | 88 const struct md5_state *ictx = in; in sun4i_hash_import_md5() local 93 op->byte_count = ictx->byte_count & ~0x3F; in sun4i_hash_import_md5() 94 op->len = ictx->byte_count & 0x3F; in sun4i_hash_import_md5() 96 memcpy(op->buf, ictx->block, op->len); in sun4i_hash_import_md5() 99 op->hash[i] = ictx->hash[i]; in sun4i_hash_import_md5() 131 const struct sha1_state *ictx = in; in sun4i_hash_import_sha1() local 136 op->byte_count = ictx->count & ~0x3F; in sun4i_hash_import_sha1() 137 op->len = ictx->count & 0x3F; in sun4i_hash_import_sha1() 139 memcpy(op->buf, ictx->buffer, op->len); in sun4i_hash_import_sha1() 142 op->hash[i] = ictx->state[i]; in sun4i_hash_import_sha1()
|