Whamcloud - gitweb
class/class_obd.c: small OBD_ATTACHED sanity cleanup; OBD_SET_UP fix.
[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_REQUEST_PORTAL 1
31 #define OSC_REPLY_PORTAL   2
32 #define MDS_REQUEST_PORTAL 3
33 #define MDS_REPLY_PORTAL   4
34 #define OST_REQUEST_PORTAL 5
35 #define OST_REPLY_PORTAL   6
36 #define MDC_BULK_PORTAL    7
37 #define MDS_BULK_PORTAL    8
38 #define OSC_BULK_PORTAL    9
39 #define OST_BULK_PORTAL    10
40
41 struct ptlrpc_service {
42         char *srv_buf;
43         __u32 srv_buf_size;
44         __u32 srv_ring_length;
45         __u32 srv_portal;
46
47         struct lustre_peer srv_self;
48
49         /* FIXME: perhaps a list of EQs, if multiple NIs are used? */
50         ptl_handle_eq_t srv_eq_h;
51
52         ptl_handle_me_t srv_me_h;
53         ptl_process_id_t srv_id;
54         ptl_md_t srv_md;
55         ptl_handle_md_t srv_md_h;
56         wait_queue_head_t *srv_wait_queue;
57 };
58
59 struct ptlrpc_request { 
60         struct list_head rq_list;
61         struct mds_obd *rq_obd;
62         struct ost_obd *rq_ost;
63         int rq_status;
64
65         char *rq_reqbuf;
66         int rq_reqlen;
67         struct ptlreq_hdr *rq_reqhdr;
68         union ptl_req rq_req;
69         __u32 rq_xid;
70
71         char *rq_repbuf;
72         int rq_replen;
73         struct ptlrep_hdr *rq_rephdr;
74         union ptl_rep rq_rep;
75
76         char *rq_bulkbuf;
77         int rq_bulklen;
78         int (*rq_bulk_cb)(struct ptlrpc_request *, void *);
79
80         void * rq_reply_handle;
81         wait_queue_head_t rq_wait_for_rep;
82         wait_queue_head_t rq_wait_for_bulk;
83
84         ptl_md_t rq_reply_md;
85         ptl_handle_md_t rq_reply_md_h;
86         ptl_md_t rq_req_md;
87         ptl_md_t rq_bulk_md;
88         ptl_handle_md_t rq_bulk_md_h;
89         __u32 rq_reply_portal;
90         __u32 rq_req_portal;
91         __u32 rq_bulk_portal;
92
93         struct lustre_peer rq_peer;
94 };
95
96 /* rpc/rpc.c */
97 int ptl_send_buf(struct ptlrpc_request *request, struct lustre_peer *peer,
98                  int portal, int is_request);
99 int ptl_send_rpc(struct ptlrpc_request *request, struct lustre_peer *peer);
100 int rpc_register_service(struct ptlrpc_service *service, char *uuid);
101 int rpc_unregister_service(struct ptlrpc_service *service);
102
103 /* FIXME */
104 #if 1
105 # define LUSTRE_NAL "ksocknal"
106 #else
107 # define LUSTRE_NAL "kqswnal"
108 #endif
109
110 #endif