OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [linux/] [loop.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
#ifndef _LINUX_LOOP_H
2
#define _LINUX_LOOP_H
3
 
4
/*
5
 * include/linux/loop.h
6
 *
7
 * Written by Theodore Ts'o, 3/29/93.
8
 *
9
 * Copyright 1993 by Theodore Ts'o.  Redistribution of this file is
10
 * permitted under the GNU Public License.
11
 */
12
 
13
#define LO_NAME_SIZE    64
14
#define LO_KEY_SIZE     32
15
 
16
#ifdef __KERNEL__
17
 
18
struct loop_device {
19
        int             lo_number;
20
        struct inode    *lo_inode;
21
        int             lo_refcnt;
22
        kdev_t          lo_device;
23
        int             lo_offset;
24
        int             lo_encrypt_type;
25
        int             lo_encrypt_key_size;
26
        int             lo_flags;
27
        int             (*transfer)(struct loop_device *, int cmd,
28
                                    char *raw_buf, char *loop_buf, int size);
29
        char            lo_name[LO_NAME_SIZE];
30
        char            lo_encrypt_key[LO_KEY_SIZE];
31
#ifdef DES_AVAILABLE
32
        des_key_schedule lo_des_key;
33
        unsigned long   lo_des_init[2];
34
#endif
35
#ifdef IDEA_AVAILABLE
36
        idea_key        lo_idea_en_key;
37
        idea_key        lo_idea_de_key;
38
#endif
39
};
40
 
41
typedef int (* transfer_proc_t)(struct loop_device *, int cmd,
42
                                char *raw_buf, char *loop_buf, int size);
43
 
44
/*
45
 * Loop flags
46
 */
47
#define LO_FLAGS_DO_BMAP        0x00000001
48
#define LO_FLAGS_READ_ONLY      0x00000002
49
 
50
#endif /* __KERNEL__ */
51
 
52
struct loop_info {
53
        int             lo_number;      /* ioctl r/o */
54
        dev_t           lo_device;      /* ioctl r/o */
55
        unsigned long   lo_inode;       /* ioctl r/o */
56
        dev_t           lo_rdevice;     /* ioctl r/o */
57
        int             lo_offset;
58
        int             lo_encrypt_type;
59
        int             lo_encrypt_key_size;    /* ioctl w/o */
60
        int             lo_flags;       /* ioctl r/o */
61
        char            lo_name[LO_NAME_SIZE];
62
        unsigned char   lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
63
        unsigned long   lo_init[2];
64
        char            reserved[4];
65
};
66
 
67
/*
68
 * Loop encryption types --- LO_CRYPT_IDEA isn't supported yet
69
 */
70
 
71
#define LO_CRYPT_NONE   0
72
#define LO_CRYPT_XOR    1
73
#define LO_CRYPT_DES    2
74
#define LO_CRYPT_IDEA   3
75
#define MAX_LO_CRYPT    4
76
 
77
/*
78
 * IOCTL commands --- we will commandeer 0x4C ('L')
79
 */
80
 
81
#define LOOP_SET_FD     0x4C00
82
#define LOOP_CLR_FD     0x4C01
83
#define LOOP_SET_STATUS 0x4C02
84
#define LOOP_GET_STATUS 0x4C03
85
 
86
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.