Whamcloud - gitweb
- merge 0.7rc1 from b_devel to HEAD (20030612 merge point)
[fs/lustre-release.git] / lnet / klnds / scimaclnd / scimacnal.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:cindent:
3  *
4  * Copyright (C) 2003 High Performance Computing Center North (HPC2N)
5  *   Author: Niklas Edmundsson <nikke@hpc2n.umu.se>
6  */
7
8
9 #ifndef _SCIMACNAL_H
10 #define _SCIMACNAL_H
11
12 #include <linux/config.h>
13 #include <linux/module.h>
14 #include <linux/kernel.h>
15 #include <linux/mm.h>
16 #include <linux/string.h>
17 #include <linux/stat.h>
18 #include <linux/errno.h>
19 #include <linux/locks.h>
20 #include <linux/unistd.h>
21 #include <linux/init.h>
22
23 #include <asm/system.h>
24 #include <asm/uaccess.h>
25
26 #include <linux/fs.h>
27 #include <linux/file.h>
28 #include <linux/stat.h>
29 #include <linux/list.h>
30 #include <asm/uaccess.h>
31 #include <asm/segment.h>
32 #include <asm/page.h>            /* For PAGE_SIZE */
33
34 #define DEBUG_SUBSYSTEM S_UNDEFINED
35
36 #include <linux/kp30.h>
37 #include <portals/p30.h>
38 #include <portals/lib-p30.h>
39
40 #include <scamac.h>
41
42 #ifndef MAC_SAPID_LUSTRE
43 #define MAC_SAPID_LUSTRE MAC_SAPID_TEST1
44 #endif /* MAC_SAPID_LUSTRE */
45
46 #define SCIMACNAL_MTU 65536
47 /* FIXME: What is really the MTU of lustre? */
48 #if PTL_MD_MAX_IOV*PAGE_SIZE > SCIMACNAL_MTU
49 #error Max MTU of ScaMAC is 64k, PTL_MD_MAX_IOV*PAGE_SIZE is bigger.
50 #endif
51
52 typedef struct {
53         mac_handle_t    *handle;
54         mac_mblk_t      *msg;
55         mac_msg_type_t   type;
56         void            *userdata;
57 }  kscimacnal_rx_t;
58
59
60 typedef struct {
61         nal_cb_t        *ktx_nal;
62         void            *ktx_private;
63         lib_msg_t       *ktx_cookie;
64         ptl_hdr_t       ktx_hdr;
65 }  kscimacnal_tx_t;
66
67
68 typedef struct {
69         char              ksci_init;
70         char              ksci_shuttingdown;
71         ptl_nid_t         ksci_nid;
72         nal_cb_t         *ksci_cb;
73         spinlock_t        ksci_dispatch_lock;
74         mac_handle_t     *ksci_machandle;
75 }  kscimacnal_data_t;
76
77 extern kscimacnal_data_t   kscimacnal_data;
78 extern nal_t            kscimacnal_api;
79 extern nal_cb_t         kscimacnal_lib;
80
81 void kscimacnal_fwd_packet (void *arg, kpr_fwd_desc_t *fwd);
82 void kscimacnal_rx(mac_handle_t *handle, mac_mblk_t *msg, mac_msg_type_t type, void *userdata);
83
84
85 #endif  /* _SCIMACNAL_H */