summaryrefslogtreecommitdiff
path: root/release/src/linux/linux/include/linux/intermezzo_upcall.h
blob: 0b3e6ff74e3a39ddc3beb3d241db8710b322404e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/*
 * Based on cfs.h from Coda, but revamped for increased simplicity.
 * Linux modifications by Peter Braam, Aug 1996
 * Rewritten for InterMezzo
 */

#ifndef _PRESTO_HEADER_
#define _PRESTO_HEADER_


/* upcall.c */
#define SYNCHRONOUS 0
#define ASYNCHRONOUS 1

int lento_permit(int minor, int pathlen, int fsetnamelen, char *path, char *fset);
int lento_opendir(int minor, int pathlen, char *path, int async);
int lento_kml(int minor, unsigned int offset, unsigned int first_recno,
              unsigned int length, unsigned int last_recno, int namelen,
              char *fsetname);
int lento_open(int minor, int pathlen, char *path);
int lento_journal(int minor, char *page, int async);
int lento_release_permit(int minor, int cookie);

/*
 * Kernel <--> Lento communications.
 */
/* upcalls */
#define LENTO_PERMIT    1
#define LENTO_JOURNAL   2
#define LENTO_OPENDIR   3
#define LENTO_OPEN      4
#define LENTO_SIGNAL    5
#define LENTO_KML       6
#define LENTO_COOKIE    7

/*         Lento <-> Presto  RPC arguments       */
struct lento_up_hdr {
        unsigned int opcode;
        unsigned int unique;    /* Keep multiple outstanding msgs distinct */
        u_short pid;            /* Common to all */
        u_short uid;
};

/* This structure _must_ sit at the beginning of the buffer */
struct lento_down_hdr {
        unsigned int opcode;
        unsigned int unique;    
        unsigned int result;
};

/* lento_permit: */
struct lento_permit_in {
        struct lento_up_hdr uh;
        int pathlen;
        int fsetnamelen;
        char path[0];
};
struct lento_permit_out {
        struct lento_down_hdr dh;
};


/* lento_opendir: */
struct lento_opendir_in {
        struct lento_up_hdr uh;
        int async;
        int pathlen;
        char path[0];
};
struct lento_opendir_out {
        struct lento_down_hdr dh;
};


/* lento_kml: */
struct lento_kml_in {
        struct lento_up_hdr uh;
        unsigned int offset;
        unsigned int first_recno;
        unsigned int length;
        unsigned int last_recno;
        int namelen;
        char fsetname[0];
};

struct lento_kml_out {
        struct lento_down_hdr dh;
};


/* lento_open: */
struct lento_open_in {
        struct lento_up_hdr uh;
        int pathlen;
        char path[0];
};
struct lento_open_out {
    struct lento_down_hdr dh;
};

/* lento_response_cookie */
struct lento_response_cookie_in {
        struct lento_up_hdr uh;
        int cookie;
};

struct lento_response_cookie_out {
    struct lento_down_hdr dh;
};


struct lento_mknod {
  struct lento_down_hdr dh;
  int    major;
  int    minor;
  int    mode;
  char   path[0];
};


/* NB: every struct below begins with an up_hdr */
union up_args {
    struct lento_up_hdr uh;             
    struct lento_permit_in lento_permit;
    struct lento_open_in lento_open;
    struct lento_opendir_in lento_opendir;
    struct lento_kml_in lento_kml;
    struct lento_response_cookie_in lento_response_cookie;
};

union down_args {
    struct lento_down_hdr dh;
    struct lento_permit_out lento_permit;
    struct lento_open_out lento_open;
    struct lento_opendir_out lento_opendir;
    struct lento_kml_out lento_kml;
    struct lento_response_cookie_out lento_response_cookie;
};    

#include "intermezzo_psdev.h"

int lento_upcall(int minor, int read_size, int *rep_size, 
                 union up_args *buffer, int async,
                 struct upc_req *rq );
#endif