Whamcloud - gitweb
- and the new files
[fs/lustre-release.git] / lustre / include / linux / lustre_net.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (C) 2002 Cluster File Systems, Inc.
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  */
22
23 #ifndef _LUSTRE_NET_H
24 #define _LUSTRE_NET_H
25
26 #include <linux/kp30.h>
27 #include <portals/p30.h>
28 #include <linux/lustre_idl.h>
29
30 #define OSC_PORTAL 1
31 #define MDS_PORTAL 2
32 #define OST_PORTAL 3
33
34 struct lustre_peer {
35         ptl_handle_ni_t peer_ni;
36         __u32 peer_nid;
37 };
38
39 struct ptlrpc_service {
40         __u32 srv_buf_size;
41         void (* srv_callback)(ptl_event_t *, void *data);
42         __u32 srv_ring_length;
43 };
44
45
46 struct ptlrpc_request { 
47         struct list_head rq_list;
48         struct mds_obd *rq_obd;
49         struct ost_obd *rq_ost;
50         int rq_status;
51
52         char *rq_reqbuf;
53         int rq_reqlen;
54         struct ptlreq_hdr *rq_reqhdr;
55         union ptl_req rq_req;
56
57         char *rq_repbuf;
58         int rq_replen;
59         struct ptlrep_hdr *rq_rephdr;
60         union ptl_rep rq_rep;
61
62         void * rq_reply_handle;
63         wait_queue_head_t rq_wait_for_rep;
64
65         ptl_md_t rq_reply_md;
66         ptl_md_t rq_req_md;
67         __u32 rq_reply_portal;
68         __u32 rq_req_portal;
69 };
70
71 /* rpc/rpc.c */
72 int ptl_send_rpc(struct ptlrpc_request *request, struct lustre_peer *peer);
73
74 /* FIXME */
75 #if 1
76 # define LUSTRE_NAL "ksocknal"
77 #else
78 # define LUSTRE_NAL "kqswnal"
79 #endif
80
81 #endif