Lines Matching refs:klip
1550 free_lofi_ioctl(struct lofi_ioctl *klip) in free_lofi_ioctl() argument
1553 bzero(klip->li_key, sizeof (klip->li_key)); in free_lofi_ioctl()
1554 kmem_free(klip, sizeof (struct lofi_ioctl)); in free_lofi_ioctl()
1565 struct lofi_ioctl *klip; in copy_in_lofi_ioctl() local
1568 klip = *klipp = kmem_alloc(sizeof (struct lofi_ioctl), KM_SLEEP); in copy_in_lofi_ioctl()
1569 error = ddi_copyin(ulip, klip, sizeof (struct lofi_ioctl), flag); in copy_in_lofi_ioctl()
1574 klip->li_filename[MAXPATHLEN-1] = '\0'; in copy_in_lofi_ioctl()
1575 klip->li_algorithm[MAXALGLEN-1] = '\0'; in copy_in_lofi_ioctl()
1576 klip->li_cipher[CRYPTO_MAX_MECH_NAME-1] = '\0'; in copy_in_lofi_ioctl()
1577 klip->li_iv_cipher[CRYPTO_MAX_MECH_NAME-1] = '\0'; in copy_in_lofi_ioctl()
1579 if (klip->li_minor > L_MAXMIN32) { in copy_in_lofi_ioctl()
1587 free_lofi_ioctl(klip); in copy_in_lofi_ioctl()
1592 copy_out_lofi_ioctl(const struct lofi_ioctl *klip, struct lofi_ioctl *ulip, in copy_out_lofi_ioctl() argument
1610 error = ddi_copyout(klip, ulip, sizeof (struct lofi_ioctl), flag); in copy_out_lofi_ioctl()
1914 lofi_init_crypto(struct lofi_state *lsp, struct lofi_ioctl *klip) in lofi_init_crypto() argument
1924 if (!klip->li_crypto_enabled) in lofi_init_crypto()
1930 if (klip->li_iv_len > CRYPTO_BITS2BYTES(512)) in lofi_init_crypto()
1933 if (CRYPTO_BITS2BYTES(klip->li_key_len) > sizeof (klip->li_key)) in lofi_init_crypto()
1936 lsp->ls_crypto_enabled = klip->li_crypto_enabled; in lofi_init_crypto()
1940 lsp->ls_mech.cm_type = crypto_mech2id(klip->li_cipher); in lofi_init_crypto()
1943 klip->li_cipher, klip->li_filename); in lofi_init_crypto()
1951 lsp->ls_iv_type = klip->li_iv_type; in lofi_init_crypto()
1952 lsp->ls_iv_mech.cm_type = crypto_mech2id(klip->li_iv_cipher); in lofi_init_crypto()
1955 " for %s", klip->li_iv_cipher, klip->li_filename); in lofi_init_crypto()
1962 lsp->ls_iv_len = klip->li_iv_len; in lofi_init_crypto()
1969 lsp->ls_key.ck_length = klip->li_key_len; in lofi_init_crypto()
1972 bcopy(klip->li_key, lsp->ls_key.ck_data, in lofi_init_crypto()
1978 "%s on file %s (0x%x)", klip->li_cipher, in lofi_init_crypto()
1979 klip->li_filename, ret); in lofi_init_crypto()
2129 struct lofi_ioctl *klip; in lofi_map_file() local
2137 error = copy_in_lofi_ioctl(ulip, &klip, ioctl_flag); in lofi_map_file()
2147 free_lofi_ioctl(klip); in lofi_map_file()
2152 if (file_to_lofi_nocheck(klip->li_filename, klip->li_readonly, in lofi_map_file()
2165 if (ddi_get_soft_state(lofi_statep, klip->li_minor) != NULL) { in lofi_map_file()
2171 id_alloc_specific_nosleep(lofi_minor_id, klip->li_minor); in lofi_map_file()
2176 error = vn_open(klip->li_filename, UIO_SYSSPACE, flag, 0, &vp, 0, 0); in lofi_map_file()
2180 error = vn_open(klip->li_filename, UIO_SYSSPACE, flag, 0, in lofi_map_file()
2274 lsp->ls_readonly = klip->li_readonly; in lofi_map_file()
2276 if ((error = lofi_init_crypto(lsp, klip)) != 0) in lofi_map_file()
2332 klip->li_minor = minor; in lofi_map_file()
2333 (void) copy_out_lofi_ioctl(klip, ulip, ioctl_flag); in lofi_map_file()
2334 free_lofi_ioctl(klip); in lofi_map_file()
2355 free_lofi_ioctl(klip); in lofi_map_file()
2367 struct lofi_ioctl *klip; in lofi_unmap_file() local
2370 err = copy_in_lofi_ioctl(ulip, &klip, ioctl_flag); in lofi_unmap_file()
2376 if ((err = file_to_lofi(klip->li_filename, klip->li_readonly, in lofi_unmap_file()
2381 } else if (klip->li_minor == 0) { in lofi_unmap_file()
2383 free_lofi_ioctl(klip); in lofi_unmap_file()
2386 lsp = ddi_get_soft_state(lofi_statep, klip->li_minor); in lofi_unmap_file()
2391 free_lofi_ioctl(klip); in lofi_unmap_file()
2395 klip->li_minor = getminor(lsp->ls_dev); in lofi_unmap_file()
2420 if (klip->li_force) { in lofi_unmap_file()
2430 } else if (klip->li_cleanup) { in lofi_unmap_file()
2433 free_lofi_ioctl(klip); in lofi_unmap_file()
2438 free_lofi_ioctl(klip); in lofi_unmap_file()
2447 (void) copy_out_lofi_ioctl(klip, ulip, ioctl_flag); in lofi_unmap_file()
2448 free_lofi_ioctl(klip); in lofi_unmap_file()
2461 struct lofi_ioctl *klip; in lofi_get_info() local
2465 error = copy_in_lofi_ioctl(ulip, &klip, ioctl_flag); in lofi_get_info()
2471 if (klip->li_minor == 0) { in lofi_get_info()
2472 free_lofi_ioctl(klip); in lofi_get_info()
2477 lsp = ddi_get_soft_state(lofi_statep, klip->li_minor); in lofi_get_info()
2480 free_lofi_ioctl(klip); in lofi_get_info()
2488 if (vnodetopath(NULL, lsp->ls_stacked_vp, klip->li_filename, in lofi_get_info()
2489 sizeof (klip->li_filename), CRED()) != 0) { in lofi_get_info()
2490 (void) strlcpy(klip->li_filename, "?", in lofi_get_info()
2491 sizeof (klip->li_filename)); in lofi_get_info()
2494 klip->li_readonly = lsp->ls_readonly; in lofi_get_info()
2496 (void) strlcpy(klip->li_algorithm, lsp->ls_comp_algorithm, in lofi_get_info()
2497 sizeof (klip->li_algorithm)); in lofi_get_info()
2498 klip->li_crypto_enabled = lsp->ls_crypto_enabled; in lofi_get_info()
2500 error = copy_out_lofi_ioctl(klip, ulip, ioctl_flag); in lofi_get_info()
2501 free_lofi_ioctl(klip); in lofi_get_info()
2505 error = file_to_lofi(klip->li_filename, in lofi_get_info()
2506 klip->li_readonly, &lsp); in lofi_get_info()
2508 klip->li_minor = getminor(lsp->ls_dev); in lofi_get_info()
2512 error = copy_out_lofi_ioctl(klip, ulip, ioctl_flag); in lofi_get_info()
2514 free_lofi_ioctl(klip); in lofi_get_info()
2518 error = file_to_lofi(klip->li_filename, in lofi_get_info()
2519 klip->li_readonly, &lsp); in lofi_get_info()
2522 free_lofi_ioctl(klip); in lofi_get_info()
2526 klip->li_minor = getminor(lsp->ls_dev); in lofi_get_info()
2527 (void) strlcpy(klip->li_algorithm, lsp->ls_comp_algorithm, in lofi_get_info()
2528 sizeof (klip->li_algorithm)); in lofi_get_info()
2531 error = copy_out_lofi_ioctl(klip, ulip, ioctl_flag); in lofi_get_info()
2532 free_lofi_ioctl(klip); in lofi_get_info()
2535 free_lofi_ioctl(klip); in lofi_get_info()