1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see [sun.com URL with a
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
37 #ifndef __LNET_LINUX_LNET_H__
38 #define __LNET_LINUX_LNET_H__
41 #error Do not #include this file directly. #include <lnet/lnet.h> instead
46 #include <libcfs/libcfs.h>
47 #include <lnet/lib-lnet.h>
55 KsNtStatusToString (IN NTSTATUS Status);
60 IN LONG DebugPrintLevel,
61 IN PCHAR DebugMessage,
76 IN lnet_kiov_t * kiov,
84 ksock_tconn_t * tconn,
93 ksock_tconn_t * tconn,
99 ksock_tconn_t * tconn,
107 ksock_tconn_t * tconn,
115 ksock_tconn_t * tconn,
123 ksock_tconn_t * tconn,
124 ksock_tconn_t * parent,
131 ksock_tconn_t * tconn,
138 ksock_tconn_t * tconn,
144 ksock_tconn_t * tconn
148 ks_query_local_ipaddr(
149 ksock_tconn_t * tconn
153 ks_tconn_write (ksock_tconn_t *tconn, void *buffer, int nob);
156 ks_tconn_read (ksock_tconn_t * tconn, void *buffer, int nob);
159 KsTcpCompletionRoutine(
160 IN PDEVICE_OBJECT DeviceObject,
166 KsDisconectCompletionRoutine (
167 IN PDEVICE_OBJECT DeviceObject,
173 KsTcpReceiveCompletionRoutine(
175 IN PKS_TCP_COMPLETION_CONTEXT Context
179 KsTcpSendCompletionRoutine(
181 IN PKS_TCP_COMPLETION_CONTEXT Context
185 KsAcceptCompletionRoutine(
186 IN PDEVICE_OBJECT DeviceObject,
193 KsConnectEventHandler(
194 IN PVOID TdiEventContext,
195 IN LONG RemoteAddressLength,
196 IN PVOID RemoteAddress,
197 IN LONG UserDataLength,
199 IN LONG OptionsLength,
201 OUT CONNECTION_CONTEXT * ConnectionContext,
206 KsDisconnectEventHandler(
207 IN PVOID TdiEventContext,
208 IN CONNECTION_CONTEXT ConnectionContext,
209 IN LONG DisconnectDataLength,
210 IN PVOID DisconnectData,
211 IN LONG DisconnectInformationLength,
212 IN PVOID DisconnectInformation,
213 IN ULONG DisconnectFlags
217 KsTcpReceiveEventHandler(
218 IN PVOID TdiEventContext,
219 IN CONNECTION_CONTEXT ConnectionContext,
220 IN ULONG ReceiveFlags,
221 IN ULONG BytesIndicated,
222 IN ULONG BytesAvailable,
223 OUT ULONG * BytesTaken,
225 OUT PIRP * IoRequestPacket
229 KsTcpReceiveExpeditedEventHandler(
230 IN PVOID TdiEventContext,
231 IN CONNECTION_CONTEXT ConnectionContext,
232 IN ULONG ReceiveFlags,
233 IN ULONG BytesIndicated,
234 IN ULONG BytesAvailable,
235 OUT ULONG * BytesTaken,
237 OUT PIRP * IoRequestPacket
241 KsTcpChainedReceiveEventHandler (
242 IN PVOID TdiEventContext, // the event context
243 IN CONNECTION_CONTEXT ConnectionContext,
244 IN ULONG ReceiveFlags,
245 IN ULONG ReceiveLength,
246 IN ULONG StartingOffset, // offset of start of client data in TSDU
247 IN PMDL Tsdu, // TSDU data chain
248 IN PVOID TsduDescriptor // for call to TdiReturnChainedReceives
252 KsTcpChainedReceiveExpeditedEventHandler (
253 IN PVOID TdiEventContext, // the event context
254 IN CONNECTION_CONTEXT ConnectionContext,
255 IN ULONG ReceiveFlags,
256 IN ULONG ReceiveLength,
257 IN ULONG StartingOffset, // offset of start of client data in TSDU
258 IN PMDL Tsdu, // TSDU data chain
259 IN PVOID TsduDescriptor // for call to TdiReturnChainedReceives
265 KsDisconnectHelper(PKS_DISCONNECT_WORKITEM WorkItem);
269 ks_tdi_send_flags(ULONG SockFlags);
273 IN PDEVICE_OBJECT DeviceObject
278 IN PDEVICE_OBJECT DeviceObject,
280 IN BOOLEAN bSynchronous,
281 OUT PULONG Information
286 IN PUNICODE_STRING DeviceName,
288 OUT PFILE_OBJECT * FileObject
294 IN PFILE_OBJECT FileObject
299 IN PUNICODE_STRING DeviceName,
300 IN PTRANSPORT_ADDRESS pAddress,
301 IN ULONG AddressLength,
303 OUT PFILE_OBJECT * FileObject
309 IN PFILE_OBJECT FileObject
314 IN PUNICODE_STRING DeviceName,
315 IN CONNECTION_CONTEXT ConnectionContext,
317 OUT PFILE_OBJECT * FileObject
323 IN PFILE_OBJECT FileObject
328 IN HANDLE AddressHandle,
329 IN PFILE_OBJECT ConnectionObject
334 KsDisassociateAddress(
335 IN PFILE_OBJECT ConnectionObject
341 IN PFILE_OBJECT AddressObject,
342 IN PVOID EventContext,
343 IN PKS_EVENT_HANDLERS Handlers
350 PTDI_PROVIDER_INFO ProviderInfo
355 IN PFILE_OBJECT FileObject,
356 OUT PTDI_ADDRESS_INFO AddressInfo,
357 OUT PULONG AddressSize
361 KsQueryConnectionInfo(
362 IN PFILE_OBJECT ConnectionObject,
363 OUT PTDI_CONNECTION_INFO ConnectionInfo,
364 OUT PULONG ConnectionSize
368 KsInitializeTdiAddress(
369 IN OUT PTA_IP_ADDRESS pTransportAddress,
375 KsQueryMdlsSize (IN PMDL Mdl);
379 KsQueryTdiAddressLength(
380 OUT PTRANSPORT_ADDRESS pTransportAddress
385 IN PFILE_OBJECT FileObject,
386 OUT PVOID TdiAddress,
387 OUT ULONG* AddressLength
393 IN PVOID TdiEventContext,
399 ksock_tconn_t * tconn
406 PTDI_PROVIDER_INFO ProviderInfo
414 ksock_tconn_t * tconn
419 ksock_tconn_t * tconn
424 ksock_tconn_t * tconn
429 ksock_tconn_t * tconn
434 ksock_tconn_t * tconn
439 ksock_tconn_t * tconn
444 ksock_tconn_t * tconn
449 ksock_tconn_t * tconn
474 KsInitializeKsTsduMgr(
485 PKS_TSDUMGR KsTsduMgr
495 ksock_tconn_t * tconn
499 KsCopyMdlChainToMdlChain(
500 IN PMDL SourceMdlChain,
501 IN ULONG SourceOffset,
502 IN PMDL DestinationMdlChain,
503 IN ULONG DestinationOffset,
504 IN ULONG BytesTobecopied,
505 OUT PULONG BytesCopied
509 KsQueryMdlsSize (PMDL Mdl);
516 IN LOCK_OPERATION Operation,
521 KsMapMdlBuffer (PMDL Mdl);
524 KsReleaseMdl ( IN PMDL Mdl,
532 LOCK_OPERATION access,
537 ks_map_mdl (ksock_mdl_t * mdl);
540 ks_release_mdl (ksock_mdl_t *mdl, int paged);
542 #endif /* __KERNEL__ */