Whamcloud - gitweb
1f925c1685e2e0e1074db42edbc43fa935077bba
[fs/lustre-release.git] / lnet / include / lnet / nal.h
1 #ifndef _NAL_H_
2 #define _NAL_H_
3
4 #include "build_check.h"
5
6 /*
7  * p30/nal.h
8  *
9  * The API side NAL declarations
10  */
11
12 #include <portals/types.h>
13
14 #ifdef yield
15 #undef yield
16 #endif
17
18 typedef struct nal_t nal_t;
19
20 struct nal_t {
21         int              nal_refct;
22         void            *nal_data;
23
24         int (*startup) (nal_t *nal, ptl_pid_t requested_pid,
25                         ptl_ni_limits_t *req, ptl_ni_limits_t *actual);
26         
27         void (*shutdown) (nal_t *nal);
28
29         int (*forward) (nal_t *nal, int index,  /* Function ID */
30                         void *args, size_t arg_len, void *ret, size_t ret_len);
31
32         int (*yield) (nal_t *nal, unsigned long *flags, int milliseconds);
33
34         void (*lock) (nal_t *nal, unsigned long *flags);
35
36         void (*unlock) (nal_t *nal, unsigned long *flags);
37 };
38
39 extern nal_t *ptl_hndl2nal(ptl_handle_any_t * any);
40
41 #ifdef __KERNEL__
42 extern int ptl_register_nal(ptl_interface_t interface, nal_t *nal);
43 extern void ptl_unregister_nal(ptl_interface_t interface);
44 #endif
45
46 #endif