blob: 9cdfd382a1937e200fadd3b24c0a0eb16a08e115 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef _LINUX_LOOP_H
13#define _LINUX_LOOP_H
Ben Cheng4b29af02012-03-07 16:14:53 -080014
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080015#define LO_NAME_SIZE 64
16#define LO_KEY_SIZE 32
Ben Cheng4b29af02012-03-07 16:14:53 -080017
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080018enum {
19 LO_FLAGS_READ_ONLY = 1,
20 LO_FLAGS_USE_AOPS = 2,
21};
Ben Cheng4b29af02012-03-07 16:14:53 -080022
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080023#include <asm/posix_types.h>
24#include <asm/types.h>
Ben Cheng4b29af02012-03-07 16:14:53 -080025
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080026struct loop_info {
27 int lo_number;
28 __kernel_old_dev_t lo_device;
29 unsigned long lo_inode;
30 __kernel_old_dev_t lo_rdevice;
31 int lo_offset;
32 int lo_encrypt_type;
33 int lo_encrypt_key_size;
34 int lo_flags;
35 char lo_name[LO_NAME_SIZE];
36 unsigned char lo_encrypt_key[LO_KEY_SIZE];
37 unsigned long lo_init[2];
38 char reserved[4];
39};
Ben Cheng4b29af02012-03-07 16:14:53 -080040
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080041struct loop_info64 {
42 __u64 lo_device;
43 __u64 lo_inode;
44 __u64 lo_rdevice;
45 __u64 lo_offset;
46 __u64 lo_sizelimit;
47 __u32 lo_number;
48 __u32 lo_encrypt_type;
49 __u32 lo_encrypt_key_size;
50 __u32 lo_flags;
51 __u8 lo_file_name[LO_NAME_SIZE];
52 __u8 lo_crypt_name[LO_NAME_SIZE];
53 __u8 lo_encrypt_key[LO_KEY_SIZE];
54 __u64 lo_init[2];
55};
Ben Cheng4b29af02012-03-07 16:14:53 -080056
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080057#define LO_CRYPT_NONE 0
58#define LO_CRYPT_XOR 1
59#define LO_CRYPT_DES 2
60#define LO_CRYPT_FISH2 3
61#define LO_CRYPT_BLOW 4
62#define LO_CRYPT_CAST128 5
63#define LO_CRYPT_IDEA 6
64#define LO_CRYPT_DUMMY 9
65#define LO_CRYPT_SKIPJACK 10
66#define LO_CRYPT_CRYPTOAPI 18
67#define MAX_LO_CRYPT 20
Ben Cheng4b29af02012-03-07 16:14:53 -080068
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080069#define LOOP_SET_FD 0x4C00
70#define LOOP_CLR_FD 0x4C01
71#define LOOP_SET_STATUS 0x4C02
72#define LOOP_GET_STATUS 0x4C03
73#define LOOP_SET_STATUS64 0x4C04
74#define LOOP_GET_STATUS64 0x4C05
75#define LOOP_CHANGE_FD 0x4C06
Ben Cheng4b29af02012-03-07 16:14:53 -080076
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080077#endif