1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  */
4 
5 #ifndef __PRESTO_PSDEV_H
6 #define __PRESTO_PSDEV_H
7 
8 #define MAX_CHANNEL 16
9 #define PROCNAME_SIZE 32
10 #include <linux/locks.h>
11 #include <linux/smp_lock.h>
12 #include <linux/version.h>
13 
14 /* represents state of an instance reached with /dev/intermezzo */
15 /* communication pending & processing queues */
16 struct upc_channel {
17         unsigned int         uc_seq;
18         wait_queue_head_t    uc_waitq;    /* Lento wait queue */
19         struct list_head     uc_pending;
20         struct list_head     uc_processing;
21         spinlock_t            uc_lock;
22         int                  uc_pid;      /* Lento's pid */
23         int                  uc_hard;     /* allows signals during upcalls */
24         int                  uc_no_filter;
25         int                  uc_no_journal;
26         int                  uc_no_upcall;
27         int                  uc_timeout;  /* . sec: signals will dequeue upc */
28         long                 uc_errorval; /* for testing I/O failures */
29         struct list_head     uc_cache_list;
30         int                  uc_minor;
31 };
32 
33 #define ISLENTO(minor) (current->pid == izo_channels[minor].uc_pid \
34                 || current->p_pptr->pid == izo_channels[minor].uc_pid \
35                 || current->p_pptr->p_pptr->pid == izo_channels[minor].uc_pid)
36 
37 extern struct upc_channel izo_channels[MAX_CHANNEL];
38 
39 /* message types between presto filesystem in kernel */
40 #define REQ_READ   1
41 #define REQ_WRITE  2
42 #define REQ_ASYNC  4
43 #define REQ_DEAD   8
44 
45 struct upc_req {
46         struct list_head   rq_chain;
47         caddr_t            rq_data;
48         int                rq_flags;
49         int                rq_bufsize;
50         int                rq_rep_size;
51         int                rq_opcode;  /* copied from data to save lookup */
52         int                rq_unique;
53         wait_queue_head_t  rq_sleep;   /* process' wait queue */
54         unsigned long      rq_posttime;
55 };
56 
57 #endif
58