Whamcloud - gitweb
* Added lonal (loopback NAL)
[fs/lustre-release.git] / lustre / portals / knals / lonal / lonal.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (C) 2001 Cluster File Systems, Inc. <braam@clusterfs.com>
5  *
6  *   This file is part of Lustre, http://www.lustre.org.
7  *
8  *   Lustre is free software; you can redistribute it and/or
9  *   modify it under the terms of version 2 of the GNU General Public
10  *   License as published by the Free Software Foundation.
11  *
12  *   Lustre is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with Lustre; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  * Basic library routines. 
22  *
23  */
24
25 #ifndef _LONAL_H
26 #define _LONAL_H
27 #ifndef EXPORT_SYMTAB
28 # define EXPORT_SYMTAB
29 #endif
30
31 #include <linux/config.h>
32 #include <linux/module.h>
33 #include <linux/kernel.h>
34 #include <linux/mm.h>
35 #include <linux/string.h>
36 #include <linux/stat.h>
37 #include <linux/errno.h>
38 #include <linux/uio.h>
39
40 #define DEBUG_SUBSYSTEM S_LONAL
41
42 #include <linux/kp30.h>
43 #include <portals/p30.h>
44 #include <portals/lib-p30.h>
45 #include <portals/nal.h>
46
47 #define KLOD_IOV        153401
48 #define KLOD_KIOV       153402
49
50 typedef struct
51 {
52         unsigned int     klod_type;
53         unsigned int     klod_niov;
54         size_t           klod_offset;
55         size_t           klod_nob;
56         union {
57                 struct iovec  *iov;
58                 ptl_kiov_t    *kiov;
59         }                klod_iov;
60                 
61 } klo_desc_t;
62
63 typedef struct
64 {
65         char               klo_init;            /* what's been initialised */
66 }  klonal_data_t;
67
68 /* kqn_init state */
69 #define KLO_INIT_NOTHING        0               /* MUST BE ZERO so zeroed state is initialised OK */
70 #define KLO_INIT_LIB            1
71 #define KLO_INIT_ALL            2
72
73 extern lib_nal_t           klonal_lib;
74 extern nal_t               klonal_api;
75 extern klonal_data_t       klonal_data;
76
77 #endif /* _LONAL_H */