<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>RE: [Openib-windows] [RFC v2] Kernel Async Verbs</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Hi Fab,</FONT>
</P>

<P><FONT SIZE=2>As far as I remember we have agreed that the IP's shouldn't include IRPs, but a different completion mechanism.</FONT>
<BR><FONT SIZE=2>As a result I'm quite confused to see that all your API's do contain IRP's.</FONT>
</P>

<P><FONT SIZE=2>Please remember that using an IRP on each function will:</FONT>
<BR><FONT SIZE=2>1) Make our code much more complicated.</FONT>
<BR><FONT SIZE=2>2) Make a considerable performance hit to all our API's.</FONT>
<BR><FONT SIZE=2>3) Will make our code very different from all other windows software that I know of. As an example, look at the ZwWriteFile function. Although this function can currently only be called from passive level, it's API is prepared for assync transfer, but still doesn't use IRP's</FONT></P>

<P><FONT SIZE=2>4) Will make it impossible to share the same header files from user mode and kernel mode (the way that IRP's look from user mode is by an overlapped struct). By the way, taking into account the differences between user mode and kernel mode, it is not clear if we want to do this in any way.</FONT></P>

<P><FONT SIZE=2>5) IRP's are harder to debug. Since IRP's are maintined in the operating system opaque structures, finding where an IRP was lost, is somewhat harder.</FONT></P>

<P><FONT SIZE=2>I believe that since in any case, we will be using wrapper functions around the IRPs based functions, we should probably write the wrapper function first.</FONT></P>

<P><FONT SIZE=2>In any case, if what I wrote isn't enough, I believe that the best way to continue this discussion is to try and take one of these functions, implement it in some trivial way and see the results. Once we do this in both ways, we can look at the code that is using the functions, measure the performance and see how we want to continue from here.</FONT></P>

<P><FONT SIZE=2>Thoughts?</FONT>
</P>

<P><FONT SIZE=2>Thanks</FONT>
<BR><FONT SIZE=2>Tzachi</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=2>Since working with </FONT>
<BR><FONT SIZE=2>>-----Original Message-----</FONT>
<BR><FONT SIZE=2>>From: Fab Tillier [<A HREF="mailto:ftillier@silverstorm.com">mailto:ftillier@silverstorm.com</A>]</FONT>
<BR><FONT SIZE=2>>Sent: Monday, November 07, 2005 10:20 AM</FONT>
<BR><FONT SIZE=2>>To: openib-windows@openib.org</FONT>
<BR><FONT SIZE=2>>Subject: [Openib-windows] [RFC v2] Kernel Async Verbs</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>Folks,</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>I spent a little time over the weekend fixing up the headers for the new</FONT>
<BR><FONT SIZE=2>>kernel-level verbs API.  Code will now compile with both these and the</FONT>
<BR><FONT SIZE=2>>existing</FONT>
<BR><FONT SIZE=2>>headers included.</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>As a refresher, the goals of this new API are:</FONT>
<BR><FONT SIZE=2>>- Allow all verb calls to work at IRQL <= DISPATCH_LEVEL</FONT>
<BR><FONT SIZE=2>>- Leverage capabilities of the OS</FONT>
<BR><FONT SIZE=2>>       - Use IRPs for completion notifications</FONT>
<BR><FONT SIZE=2>>       - Optimize memory registration APIs to use native structures</FONT>
<BR><FONT SIZE=2>>- Look and feel like native Windows APIs</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>This API does not change the access layer API.  For now, this API would be</FONT>
<BR><FONT SIZE=2>>used</FONT>
<BR><FONT SIZE=2>>solely between the access layer and the HCA driver, to be migrated to wider</FONT>
<BR><FONT SIZE=2>>kernel use at a later point in time.  The files ibdef.h and ibstatus.h are</FONT>
<BR><FONT SIZE=2>>intended to be sharable with user-mode at some later point in time.</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>I haven't figured out what the SRQ API will look like yet, but will add</FONT>
<BR><FONT SIZE=2>>that</FONT>
<BR><FONT SIZE=2>>next, likely modeled after what's been done on the Linux side of things.</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>Please let me know if you have comments or questions.</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>Thanks,</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>- Fab</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>Index: inc/iba/ibstatus.h</FONT>
<BR><FONT SIZE=2>>===================================================================</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>> * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> * This software is available to you under the OpenIB.org BSD license</FONT>
<BR><FONT SIZE=2>> * below:</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> *     Redistribution and use in source and binary forms, with or</FONT>
<BR><FONT SIZE=2>> *     without modification, are permitted provided that the following</FONT>
<BR><FONT SIZE=2>> *     conditions are met:</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> *      - Redistributions of source code must retain the above</FONT>
<BR><FONT SIZE=2>> *        copyright notice, this list of conditions and the following</FONT>
<BR><FONT SIZE=2>> *        disclaimer.</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> *      - Redistributions in binary form must reproduce the above</FONT>
<BR><FONT SIZE=2>> *        copyright notice, this list of conditions and the following</FONT>
<BR><FONT SIZE=2>> *        disclaimer in the documentation and/or other materials</FONT>
<BR><FONT SIZE=2>> *        provided with the distribution.</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,</FONT>
<BR><FONT SIZE=2>> * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</FONT>
<BR><FONT SIZE=2>> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</FONT>
<BR><FONT SIZE=2>> * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS</FONT>
<BR><FONT SIZE=2>> * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN</FONT>
<BR><FONT SIZE=2>> * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN</FONT>
<BR><FONT SIZE=2>> * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</FONT>
<BR><FONT SIZE=2>> * SOFTWARE.</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> * $Id$</FONT>
<BR><FONT SIZE=2>> */</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#pragma once</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#ifndef _IBSTATUS_</FONT>
<BR><FONT SIZE=2>>#define _IBSTATUS_</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/* Defines IB-specific error values. */</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/* Matches FILE_DEVICE_INFINIBAND */</FONT>
<BR><FONT SIZE=2>>#define FACILITY_INFINIBAND             0x3B</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#define STATUS_IB_INSUFFICIENT_WR       ((NTSTATUS)0xE03B0001L)</FONT>
<BR><FONT SIZE=2>>#define STATUS_IB_INSUFFICIENT_SGE      ((NTSTATUS)0xE03B0002L)</FONT>
<BR><FONT SIZE=2>>#define STATUS_IB_INVALID_WR_TYPE       ((NTSTATUS)0xE03B0003L)</FONT>
<BR><FONT SIZE=2>>#define STATUS_IB_INVALID_STATE         ((NTSTATUS)0xE03B0004L)</FONT>
<BR><FONT SIZE=2>>#define STATUS_IB_INVALID_PORT          ((NTSTATUS)0xE03B0005L)</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#endif  /* _IBSTATUS_ */</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>Index: inc/iba/ibdef.h</FONT>
<BR><FONT SIZE=2>>===================================================================</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>> * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> * This software is available to you under the OpenIB.org BSD license</FONT>
<BR><FONT SIZE=2>> * below:</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> *     Redistribution and use in source and binary forms, with or</FONT>
<BR><FONT SIZE=2>> *     without modification, are permitted provided that the following</FONT>
<BR><FONT SIZE=2>> *     conditions are met:</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> *      - Redistributions of source code must retain the above</FONT>
<BR><FONT SIZE=2>> *        copyright notice, this list of conditions and the following</FONT>
<BR><FONT SIZE=2>> *        disclaimer.</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> *      - Redistributions in binary form must reproduce the above</FONT>
<BR><FONT SIZE=2>> *        copyright notice, this list of conditions and the following</FONT>
<BR><FONT SIZE=2>> *        disclaimer in the documentation and/or other materials</FONT>
<BR><FONT SIZE=2>> *        provided with the distribution.</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,</FONT>
<BR><FONT SIZE=2>> * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</FONT>
<BR><FONT SIZE=2>> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</FONT>
<BR><FONT SIZE=2>> * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS</FONT>
<BR><FONT SIZE=2>> * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN</FONT>
<BR><FONT SIZE=2>> * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN</FONT>
<BR><FONT SIZE=2>> * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</FONT>
<BR><FONT SIZE=2>> * SOFTWARE.</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> * $Id$</FONT>
<BR><FONT SIZE=2>> */</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#pragma once</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#ifndef _IBDEFS_</FONT>
<BR><FONT SIZE=2>>#define _IBDEFS_</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef struct _IB_CA   *IB_CA_HANDLE, * __ptr64 IB_CA_HANDLE64;</FONT>
<BR><FONT SIZE=2>>typedef struct _IB_PD   *IB_PD_HANDLE, * __ptr64 IB_PD_HANDLE64;</FONT>
<BR><FONT SIZE=2>>typedef struct _IB_CQ   *IB_CQ_HANDLE, * __ptr64 IB_CQ_HANDLE64;</FONT>
<BR><FONT SIZE=2>>typedef struct _IB_SRQ  *IB_SRQ_HANDLE, * __ptr64 IB_SRQ_HANDLE64;</FONT>
<BR><FONT SIZE=2>>typedef struct _IB_QP   *IB_QP_HANDLE, * __ptr64 IB_QP_HANDLE64;</FONT>
<BR><FONT SIZE=2>>typedef struct _IB_AH   *IB_ADDR_HANDLE, * __ptr64 IB_ADDR_HANDLE64;</FONT>
<BR><FONT SIZE=2>>typedef struct _IB_MR   *IB_MR_HANDLE, * __ptr64 IB_MR_HANDLE64;</FONT>
<BR><FONT SIZE=2>>typedef struct _IB_MW   *IB_MW_HANDLE, * __ptr64 IB_MW_HANDLE64;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#pragma pack(push, 1)</FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) union _IB_GID</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    UCHAR                   Raw[16];</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    struct _IB_GID_UNICAST</FONT>
<BR><FONT SIZE=2>>    {</FONT>
<BR><FONT SIZE=2>>        UINT64              Prefix;</FONT>
<BR><FONT SIZE=2>>        UINT64              InterfaceId;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    } Unicast;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    struct _IB_GID_MULTICAST</FONT>
<BR><FONT SIZE=2>>    {</FONT>
<BR><FONT SIZE=2>>        UCHAR               Header[2];</FONT>
<BR><FONT SIZE=2>>        UCHAR               RawGroupId[14];</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    } Multicast;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_GID;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) struct _IB_GRH</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    ULONG           VerClassFlow;</FONT>
<BR><FONT SIZE=2>>    USHORT          PayloadLength;</FONT>
<BR><FONT SIZE=2>>    UCHAR           NextHdr;</FONT>
<BR><FONT SIZE=2>>    UCHAR           HopLimit;</FONT>
<BR><FONT SIZE=2>>    IB_GID          SGid;</FONT>
<BR><FONT SIZE=2>>    IB_GID          DGid;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_GRH;</FONT>
<BR><FONT SIZE=2>>#pragma pack(pop)</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef enum _IB_MTU</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_MTU_256  = 1,</FONT>
<BR><FONT SIZE=2>>    IB_MTU_512  = 2,</FONT>
<BR><FONT SIZE=2>>    IB_MTU_1024 = 3,</FONT>
<BR><FONT SIZE=2>>    IB_MTU_2048 = 4,</FONT>
<BR><FONT SIZE=2>>    IB_MTU_4096 = 5</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_MTU;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef enum _IB_LINK_STATE</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_LINK_NO_CHANGE   = 0,</FONT>
<BR><FONT SIZE=2>>    IB_LINK_DOWN        = 1,</FONT>
<BR><FONT SIZE=2>>    IB_LINK_INIT        = 2,</FONT>
<BR><FONT SIZE=2>>    IB_LINK_ARMED       = 3,</FONT>
<BR><FONT SIZE=2>>    IB_LINK_ACTIVE      = 4,</FONT>
<BR><FONT SIZE=2>>    IB_LINK_ACT_DEFER   = 5</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_LINK_STATE;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef enum _IB_LINK_WIDTH</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_LINK_WIDTH_1X    = 1,</FONT>
<BR><FONT SIZE=2>>    IB_LINK_WIDTH_4X    = 2,</FONT>
<BR><FONT SIZE=2>>    IB_LINK_WIDTH_8X    = 4,</FONT>
<BR><FONT SIZE=2>>    IB_LINK_WIDTH_12X   = 8</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_LINK_WIDTH;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef enum _IB_LINK_SPEED</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_LINK_SPEED_2_5_GBS   = 1,</FONT>
<BR><FONT SIZE=2>>    IB_LINK_SPEED_5_GBS     = 2,</FONT>
<BR><FONT SIZE=2>>    IB_LINK_SPEED_10_GBS    = 4</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_LINK_SPEED;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>enum IB_PORT_CAP_FLAGS</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_IS_SM                       = (1<<1),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_NOTICE_SUP                  = (1<<2),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_TRAP_SUP                    = (1<<3),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_OPT_IPD_SUP                 = (1<<4),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_APM_SUP                     = (1<<5),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_SL_MAP_SUP                  = (1<<6),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_MKEY_NVRAM                  = (1<<7),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_PKEY_NVRAM                  = (1<<8),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_LED_INFO_SUP                = (1<<9),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_IS_SM_DISABLED              = (1<<10),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_SYS_IMAGE_GUID_SUP          = (1<<11),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_PKEY_SW_EXT_PORT_TRAP_SUP   = (1<<12),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_CM_SUP                      = (1<<16),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_SNMP_TUNNEL_SUP             = (1<<17),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_REINIT_SUP                  = (1<<18),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_DEVICE_MGMT_SUP             = (1<<19),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_VENDOR_CLASS_SUP            = (1<<20),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_DR_NOTICE_SUP               = (1<<21),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_CAP_MASK_NOTICE_SUP         = (1<<22),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_BOOT_MGMT_SUP               = (1<<23),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_LINK_LATENCY_SUP            = (1<<24),</FONT>
<BR><FONT SIZE=2>>    IB_PORT_CAP_CLIENT_REG_SUP              = (1<<25)</FONT>
<BR><FONT SIZE=2>>};</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>enum _IB_INIT_TYPE</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_INIT_TYPE_NO_LOAD                = 1,</FONT>
<BR><FONT SIZE=2>>    IB_INIT_TYPE_PRESERVE_CONTENT       = (1<<1),</FONT>
<BR><FONT SIZE=2>>    IB_INIT_TYPE_PRESERVE_PRESENCE      = (1<<2),</FONT>
<BR><FONT SIZE=2>>    IB_INIT_TYPE_DO_NOT_RESUSCITATE     = (1<<3)</FONT>
<BR><FONT SIZE=2>>};</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) struct _IB_PORT_ATTR</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    ULONG                   Size;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** Combination of IB_PORT_CAP_FLAGS values. */</FONT>
<BR><FONT SIZE=2>>    ULONG                   CapabilitiesFlags;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** GUID are in network byte order. */</FONT>
<BR><FONT SIZE=2>>    UINT64                  PortGuid;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    IB_LINK_STATE           LinkState;</FONT>
<BR><FONT SIZE=2>>    IB_LINK_WIDTH           LinkWidth;</FONT>
<BR><FONT SIZE=2>>    IB_LINK_SPEED           LinkSpeed;</FONT>
<BR><FONT SIZE=2>>    ULONG                   LinkWidthSup;</FONT>
<BR><FONT SIZE=2>>    ULONG                   LinkSpeedSup;</FONT>
<BR><FONT SIZE=2>>    ULONG                   LinkWidthEnabled;</FONT>
<BR><FONT SIZE=2>>    ULONG                   LinkSpeedEnabled;</FONT>
<BR><FONT SIZE=2>>    IB_MTU                  Mtu;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    UINT64                  MaxMsgSize;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    USHORT                  NumGids;</FONT>
<BR><FONT SIZE=2>>    USHORT                  NumPkeys;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** Offsets are from beginning of structure. */</FONT>
<BR><FONT SIZE=2>>    ULONG                   NextPortAttrOffset;</FONT>
<BR><FONT SIZE=2>>    ULONG                   GidTblOffset;</FONT>
<BR><FONT SIZE=2>>    ULONG                   PkeyTblOffset;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    USHORT                  PkeyViolations;</FONT>
<BR><FONT SIZE=2>>    USHORT                  QkeyViolations;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    USHORT                  BaseLid;</FONT>
<BR><FONT SIZE=2>>    USHORT                  SmLid;</FONT>
<BR><FONT SIZE=2>>    USHORT                  MaxVls;</FONT>
<BR><FONT SIZE=2>>    UCHAR                   Lmc;</FONT>
<BR><FONT SIZE=2>>    UCHAR                   PortNum;</FONT>
<BR><FONT SIZE=2>>    UCHAR                   InitTypeReply;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** The maximum expected subnet propagation delay to reach any port on</FONT>
<BR><FONT SIZE=2>>     * the subnet.  This value also determines the rate at which traps can</FONT>
<BR><FONT SIZE=2>>     * be generated from this node.  The value is expressed as</FONT>
<BR><FONT SIZE=2>>     *  timeout = 4.096 microseconds * 2^subnet_timeout</FONT>
<BR><FONT SIZE=2>>     */</FONT>
<BR><FONT SIZE=2>>    UCHAR                   SubnetTimeout;</FONT>
<BR><FONT SIZE=2>>    UCHAR                   SmSvcLvl;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_PORT_ATTR;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>enum IB_MODIFY_PORT_FLAGS</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_MOD_PORT_SHUTDOWN                = (1<<0),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_PORT_INIT_REPLY              = (1<<1),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_PORT_RESET_QKEY_VIOLATIONS   = (1<<2)</FONT>
<BR><FONT SIZE=2>>};</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) struct _IB_MODIFY_PORT</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    /** Combination of IB_PORT_CAP_FLAGS */</FONT>
<BR><FONT SIZE=2>>    ULONG       SetCapabilites;</FONT>
<BR><FONT SIZE=2>>    ULONG       ClearCapabilites;</FONT>
<BR><FONT SIZE=2>>    UCHAR       InitTypeReply;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_MODIFY_PORT;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>enum IB_CA_CAP_FLAGS</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_CA_CAP_RESIZE_MAX_WR     = (1<<0),</FONT>
<BR><FONT SIZE=2>>    IB_CA_CAP_BAD_PKEY_CNTR     = (1<<1),</FONT>
<BR><FONT SIZE=2>>    IB_CA_CAP_BAD_QKEY_CNTR     = (1<<2),</FONT>
<BR><FONT SIZE=2>>    IB_CA_CAP_AUTO_PATH_MIG     = (1<<3),</FONT>
<BR><FONT SIZE=2>>    IB_CA_CAP_CHANGE_PHY_PORT   = (1<<4),</FONT>
<BR><FONT SIZE=2>>    IB_CA_CAP_AH_PORT_ENFORCE   = (1<<5),</FONT>
<BR><FONT SIZE=2>>    IB_CA_CAP_CURR_QP_STATE_MOD = (1<<6),</FONT>
<BR><FONT SIZE=2>>    IB_CA_CAP_SHUTDOWN_PORT     = (1<<7),</FONT>
<BR><FONT SIZE=2>>    IB_CA_CAP_INIT_TYPE         = (1<<8),</FONT>
<BR><FONT SIZE=2>>    IB_CA_CAP_PORT_ACTIVE_EVENT = (1<<9),</FONT>
<BR><FONT SIZE=2>>    IB_CA_CAP_SYS_IMAGE_GUID    = (1<<10),</FONT>
<BR><FONT SIZE=2>>    IB_CA_CAP_RC_RNR_NAK_GEN    = (1<<11),</FONT>
<BR><FONT SIZE=2>>    IB_CA_CAP_N_NOTIFY_CQ       = (1<<12),</FONT>
<BR><FONT SIZE=2>>    IB_CA_CAP_SRQ_RESIZE        = (1<<13)</FONT>
<BR><FONT SIZE=2>>};</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef enum _IB_ATOMIC_CAP</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IbAtomicNone,</FONT>
<BR><FONT SIZE=2>>    IbAtomicLocal,</FONT>
<BR><FONT SIZE=2>>    IbAtomicGlobal</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_ATOMIC_CAP;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) struct _IB_CA_ATTR</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    ULONG                   Size;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    UINT32                  VendorId;</FONT>
<BR><FONT SIZE=2>>    UINT16                  DeviceId;</FONT>
<BR><FONT SIZE=2>>    UINT16                  DeviceRev;</FONT>
<BR><FONT SIZE=2>>    UINT32                  DriverVersion;</FONT>
<BR><FONT SIZE=2>>    UINT64                  FwVersion;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** GUIDs are in network byte order. */</FONT>
<BR><FONT SIZE=2>>    UINT64                  CaGuid;</FONT>
<BR><FONT SIZE=2>>    UINT64                  SystemImageGuid;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** Byte offset from the beginning of this structure to the first</FONT>
<BR><FONT SIZE=2>>    * IB_PORT_ATTR structure for the HCA.</FONT>
<BR><FONT SIZE=2>>    */</FONT>
<BR><FONT SIZE=2>>    ULONG                   PortAttrOffset;</FONT>
<BR><FONT SIZE=2>>    UINT8                   NumPorts;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    UINT8                   MaxQpReadAtomic;</FONT>
<BR><FONT SIZE=2>>    UINT8                   MaxReadAtomic;</FONT>
<BR><FONT SIZE=2>>    UINT8                   MaxQpInitReadAtomic;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** Each bit in PageSizeSupport indicates a 2^n page size supported</FONT>
<BR><FONT SIZE=2>>    * by the HCA, where bit locations are 1-based.  The minimum page</FONT>
<BR><FONT SIZE=2>>    * size that can be supported is thus 2 bytes, and the largest 2^64.</FONT>
<BR><FONT SIZE=2>>    */</FONT>
<BR><FONT SIZE=2>>    UINT64                  PageSizeSupport;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** Combination of IB_CA_CAP_FLAGS values. */</FONT>
<BR><FONT SIZE=2>>    ULONG                   CapabilitiesFlags;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    IB_ATOMIC_CAP           AtomicCap;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxQp;</FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxQpWr;</FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxQpSge;</FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxCq;</FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxCqe;</FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxPd;</FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxAh;</FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxMr;</FONT>
<BR><FONT SIZE=2>>    UINT64                  MaxMrSize;</FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxMw;</FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxMcastGrp;</FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxMcastQp;</FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxMcastQpPerGrp;</FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxSrq;</FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxSrqWr;</FONT>
<BR><FONT SIZE=2>>    ULONG                   MaxSrqSge;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    UINT16                  MaxPKeys;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    UINT8                   LocalAckDelay;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_CA_ATTR;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>enum IB_MODIFY_CA_FLAGS</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_MODIFY_CA_SYS_IMAGE_GUID = (1<<0),</FONT>
<BR><FONT SIZE=2>>    IB_MODIFY_CA_NODE_DESC = (1<<1)</FONT>
<BR><FONT SIZE=2>>};</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) struct _IB_MODIFY_CA</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    UINT64      SystemImageGuid;</FONT>
<BR><FONT SIZE=2>>    CHAR        NodeDesc[64];</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_MODIFY_CA;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****d* Verbs/IB_ASYNC_EVENT</FONT>
<BR><FONT SIZE=2>>* NAME</FONT>
<BR><FONT SIZE=2>>*   Affiliated and unaffiliated asynchronous event types.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   This type indicates the reason an async event callback was invoked.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef enum _IB_ASYNC_EVENT</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IbAeSqError = 1,</FONT>
<BR><FONT SIZE=2>>    IbAeSqDrained,</FONT>
<BR><FONT SIZE=2>>    IbAeRqError,</FONT>
<BR><FONT SIZE=2>>    IbAeCqError,</FONT>
<BR><FONT SIZE=2>>    IbAeQpFatal,</FONT>
<BR><FONT SIZE=2>>    IbAeQpComm,</FONT>
<BR><FONT SIZE=2>>    IbAeQpApm,</FONT>
<BR><FONT SIZE=2>>    IbAeLocalFatal,</FONT>
<BR><FONT SIZE=2>>    IbAePkeyTrap,</FONT>
<BR><FONT SIZE=2>>    IbAeQkeyTrap,</FONT>
<BR><FONT SIZE=2>>    IbAeMkeyTrap,</FONT>
<BR><FONT SIZE=2>>    IbAePortTrap,</FONT>
<BR><FONT SIZE=2>>    IbAeSysimgGuidTrap,</FONT>
<BR><FONT SIZE=2>>    IbAeBufOverrun,</FONT>
<BR><FONT SIZE=2>>    IbAeLinkIntegrity,</FONT>
<BR><FONT SIZE=2>>    IbAeFlowCtrlError,</FONT>
<BR><FONT SIZE=2>>    IbAeBkeyTrap,</FONT>
<BR><FONT SIZE=2>>    IbAeQpApmError,</FONT>
<BR><FONT SIZE=2>>    IbAeWqReqError,</FONT>
<BR><FONT SIZE=2>>    IbAeWqAccessError,</FONT>
<BR><FONT SIZE=2>>    IbAePortActive,</FONT>
<BR><FONT SIZE=2>>    IbAePortDown,</FONT>
<BR><FONT SIZE=2>>    IbAeClientReregister,</FONT>
<BR><FONT SIZE=2>>    IbAeUnknown     /* ALWAYS LAST ENUM VALUE */</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_ASYNC_EVENT;</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* VALUES</FONT>
<BR><FONT SIZE=2>>*   IbAeSqError</FONT>
<BR><FONT SIZE=2>>*       An error occurred when accessing the send queue of the QP.</FONT>
<BR><FONT SIZE=2>>*       This event is optional.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeSqDrained</FONT>
<BR><FONT SIZE=2>>*       The send queue of the specified QP has completed the outstanding</FONT>
<BR><FONT SIZE=2>>*       messages in progress when the state change was requested and, if</FONT>
<BR><FONT SIZE=2>>*       applicable, has received all acknowledgements for those messages.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeRqError</FONT>
<BR><FONT SIZE=2>>*       An error occurred when accessing the receive queue of the QP.</FONT>
<BR><FONT SIZE=2>>*       This event is optional.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeCqError</FONT>
<BR><FONT SIZE=2>>*       An error occurred when writing an entry to the CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeQpFatal</FONT>
<BR><FONT SIZE=2>>*       A catastrophic error occurred while accessing or processing the</FONT>
<BR><FONT SIZE=2>>*       work queue that prevents reporting of completions.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeQpComm</FONT>
<BR><FONT SIZE=2>>*       The first packet has arrived for the receive work queue where the</FONT>
<BR><FONT SIZE=2>>*       QP is still in the RTR state.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeQpApm</FONT>
<BR><FONT SIZE=2>>*       If alternate path migration is supported, this event indicates that</FONT>
<BR><FONT SIZE=2>>*       the QP connection has migrated to the alternate path.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeLocalFatal</FONT>
<BR><FONT SIZE=2>>*       A catastrophic HCA error occurred which cannot be attributed to any</FONT>
<BR><FONT SIZE=2>>*       resource; behavior is indeterminate.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAePkeyTrap</FONT>
<BR><FONT SIZE=2>>*       A PKEY violation was detected.  This event is optional.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeQkeyTrap</FONT>
<BR><FONT SIZE=2>>*       A QKEY violation was detected.  This event is optional.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeMkeyTrap</FONT>
<BR><FONT SIZE=2>>*       An MKEY violation was detected.  This event is optional.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAePortTrap</FONT>
<BR><FONT SIZE=2>>*       A port capability change was detected.  This event is optional.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeSysimgGuidTrap</FONT>
<BR><FONT SIZE=2>>*       If the system image GUID is supported, this event indicates that</FONT>
<BR><FONT SIZE=2>>the</FONT>
<BR><FONT SIZE=2>>*       system image GUID of this HCA has been changed.  This event is</FONT>
<BR><FONT SIZE=2>>*       optional.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeBufOverrun</FONT>
<BR><FONT SIZE=2>>*       The number of consecutive flow control update periods with at least</FONT>
<BR><FONT SIZE=2>>*       one overrun error in each period has exceeded the threshold</FONT>
<BR><FONT SIZE=2>>specified</FONT>
<BR><FONT SIZE=2>>*       in the port info attributes.  This event is optional.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeLinkIntegrity</FONT>
<BR><FONT SIZE=2>>*       The detection of excessively frequent local physical errors has</FONT>
<BR><FONT SIZE=2>>*       exceeded the threshold specified in the port info attributes.  This</FONT>
<BR><FONT SIZE=2>>*       event is optional.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeFlowCtrlError</FONT>
<BR><FONT SIZE=2>>*       An HCA watchdog timer monitoring the arrival of flow control</FONT>
<BR><FONT SIZE=2>>updates</FONT>
<BR><FONT SIZE=2>>*       has expired without receiving an update.  This event is optional.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeBkeyTrap</FONT>
<BR><FONT SIZE=2>>*       An BKEY violation was detected.  This event is optional.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeQpApmError</FONT>
<BR><FONT SIZE=2>>*       If alternate path migration is supported, this event indicates that</FONT>
<BR><FONT SIZE=2>>*       an incoming path migration request to this QP was not accepted.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeWqReqError</FONT>
<BR><FONT SIZE=2>>*       An OpCode violation was detected at the responder.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeWqAccessError</FONT>
<BR><FONT SIZE=2>>*       An access violation was detected at the responder.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAePortActive</FONT>
<BR><FONT SIZE=2>>*       If the port active event is supported, this event is generated</FONT>
<BR><FONT SIZE=2>>*       when the link becomes active: IB_LINK_ACTIVE.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAePortDown</FONT>
<BR><FONT SIZE=2>>*       The link is declared unavailable: IB_LINK_INIT, IB_LINK_ARMED,</FONT>
<BR><FONT SIZE=2>>*       IB_LINK_DOWN.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeClientReregister</FONT>
<BR><FONT SIZE=2>>*       The SM idicate to client to reregister its SA records.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   IbAeUnknown</FONT>
<BR><FONT SIZE=2>>*       An unknown error occurred which cannot be attributed to any</FONT>
<BR><FONT SIZE=2>>*       resource; behavior is indeterminate.</FONT>
<BR><FONT SIZE=2>>*****/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef enum _IB_WC_STATUS</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IbWcSuccess,</FONT>
<BR><FONT SIZE=2>>    IbWcLocalLenErr,</FONT>
<BR><FONT SIZE=2>>    IbWcLocalOpErr,</FONT>
<BR><FONT SIZE=2>>    IbWcLocalProtectionErr,</FONT>
<BR><FONT SIZE=2>>    IbWcWrFlushedErr,</FONT>
<BR><FONT SIZE=2>>    IbWcMwBindErr,</FONT>
<BR><FONT SIZE=2>>    IbWcRemAccessErr,</FONT>
<BR><FONT SIZE=2>>    IbWcRemOpErr,</FONT>
<BR><FONT SIZE=2>>    IbWcRnrRetryErr,</FONT>
<BR><FONT SIZE=2>>    IbWcTimeoutRetryErr,</FONT>
<BR><FONT SIZE=2>>    IbWcRemInvalidReqErr,</FONT>
<BR><FONT SIZE=2>>    IbWcUnmatchedResponse,          /* InfiniBand Access Layer */</FONT>
<BR><FONT SIZE=2>>    IbWcCanceled,                   /* InfiniBand Access Layer */</FONT>
<BR><FONT SIZE=2>>    IbWcUnknown                     /* Must be last. */</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_WC_STATUS;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef enum _IB_OP_TYPE</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IbSend,</FONT>
<BR><FONT SIZE=2>>    IbRdmaWrite,</FONT>
<BR><FONT SIZE=2>>    IbRdmaRead,</FONT>
<BR><FONT SIZE=2>>    IbInterlockedCompareExchange,</FONT>
<BR><FONT SIZE=2>>    IbInterlockedAdd,</FONT>
<BR><FONT SIZE=2>>    IbBindMw,</FONT>
<BR><FONT SIZE=2>>    /** Set value of IB_WC_RECV so consumers can test if a completion is a</FONT>
<BR><FONT SIZE=2>>    * receive by testing (Type & IB_WC_RECV).</FONT>
<BR><FONT SIZE=2>>    */</FONT>
<BR><FONT SIZE=2>>    IbRecv          = (1 << 7),</FONT>
<BR><FONT SIZE=2>>    IbRecvRdmaWrite,</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_OP_TYPE;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>enum IB_WC_FLAGS</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_WC_FLAG_IMMEDIATE    = (1<<0),</FONT>
<BR><FONT SIZE=2>>    IB_WC_FLAG_GRH          = (1<<1),</FONT>
<BR><FONT SIZE=2>>    /** Upper bits of WC flags are for vendor specific use. */</FONT>
<BR><FONT SIZE=2>>    IB_WC_FLAG_VENDOR_MASK  = 0xFFFF0000</FONT>
<BR><FONT SIZE=2>>};</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) struct _IB_WC</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_QP_HANDLE64      hQp;</FONT>
<BR><FONT SIZE=2>>    UINT64              WrId;</FONT>
<BR><FONT SIZE=2>>    IB_WC_STATUS        Status;</FONT>
<BR><FONT SIZE=2>>    IB_OP_TYPE          Type;</FONT>
<BR><FONT SIZE=2>>    ULONG               VendorError;</FONT>
<BR><FONT SIZE=2>>    ULONG               Length;</FONT>
<BR><FONT SIZE=2>>    /** OR'd IB_WC_FLAGS values. */</FONT>
<BR><FONT SIZE=2>>    ULONG               Flags;</FONT>
<BR><FONT SIZE=2>>    ULONG               ImmediateData;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    struct _WC_UD</FONT>
<BR><FONT SIZE=2>>    {</FONT>
<BR><FONT SIZE=2>>        ULONG           RemoteQp;</FONT>
<BR><FONT SIZE=2>>        USHORT          RemoteLid;</FONT>
<BR><FONT SIZE=2>>        USHORT          PkeyIndex;</FONT>
<BR><FONT SIZE=2>>        UCHAR           RemoteSl;</FONT>
<BR><FONT SIZE=2>>        UCHAR           PathBits;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    }   Ud;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_WC;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>enum IB_ACCESS_MASK</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_AC_RDMA_READ     = (0<<1),</FONT>
<BR><FONT SIZE=2>>    IB_AC_RDMA_WRITE    = (1<<1),</FONT>
<BR><FONT SIZE=2>>    IB_AC_ATOMIC        = (1<<2),</FONT>
<BR><FONT SIZE=2>>    IB_AC_LOCAL_WRITE   = (1<<3),</FONT>
<BR><FONT SIZE=2>>    IB_AC_MW_BIND       = (1<<4)</FONT>
<BR><FONT SIZE=2>>};</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>enum IB_WR_FLAGS</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_WR_FLAG_IMMEDIATE    = (1<<0),</FONT>
<BR><FONT SIZE=2>>    IB_WR_FLAG_FENCE        = (1<<1),</FONT>
<BR><FONT SIZE=2>>    IB_WR_FLAG_SIGNALED     = (1<<2),</FONT>
<BR><FONT SIZE=2>>    IB_WR_FLAG_SOLICITED    = (1<<3),</FONT>
<BR><FONT SIZE=2>>    IB_WR_FLAG_INLINE       = (1<<4),</FONT>
<BR><FONT SIZE=2>>    IB_WR_FLAG_LOCAL        = (1<<5),   /* Access Layer */</FONT>
<BR><FONT SIZE=2>>    /** Upper bits of WC flags are for vendor specific use. */</FONT>
<BR><FONT SIZE=2>>    IB_WR_FLAG_VENDOR_MASK  = 0xFFFF0000</FONT>
<BR><FONT SIZE=2>>};</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) struct _IB_SGE</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    VOID* __ptr64               Address;</FONT>
<BR><FONT SIZE=2>>    ULONG                       Length;</FONT>
<BR><FONT SIZE=2>>    ULONG                       LKey;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_SGE;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#pragma warning(disable:4200)</FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) struct _IB_SEND_WR</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    struct _IB_SEND_WR* __ptr64 pNext;</FONT>
<BR><FONT SIZE=2>>    UINT64                      WrId;</FONT>
<BR><FONT SIZE=2>>    /** Bind, Recv, RecvRdmaWrite not valid types for this struct. */</FONT>
<BR><FONT SIZE=2>>    IB_OP_TYPE                  Type;</FONT>
<BR><FONT SIZE=2>>    /** Combination of IB_WR_FLAG values. */</FONT>
<BR><FONT SIZE=2>>    ULONG                       Flags;</FONT>
<BR><FONT SIZE=2>>    ULONG                       ImmediateData;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    union _WR</FONT>
<BR><FONT SIZE=2>>    {</FONT>
<BR><FONT SIZE=2>>        struct _SEND_UD</FONT>
<BR><FONT SIZE=2>>        {</FONT>
<BR><FONT SIZE=2>>            IB_ADDR_HANDLE      pAh;</FONT>
<BR><FONT SIZE=2>>            ULONG               RemoteQpn;</FONT>
<BR><FONT SIZE=2>>            ULONG               RemoteQkey;</FONT>
<BR><FONT SIZE=2>>            USHORT              PKeyIndex;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>        }   Ud;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>        struct _SEND_RDMA</FONT>
<BR><FONT SIZE=2>>        {</FONT>
<BR><FONT SIZE=2>>            VOID* __ptr64       Address;</FONT>
<BR><FONT SIZE=2>>            ULONG               RKey;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>        }   Rdma;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>        struct _SEND_COMP_XCHG</FONT>
<BR><FONT SIZE=2>>        {</FONT>
<BR><FONT SIZE=2>>            VOID* __ptr64       Address;</FONT>
<BR><FONT SIZE=2>>            UINT64              Exchange;</FONT>
<BR><FONT SIZE=2>>            UINT64              Comparand;</FONT>
<BR><FONT SIZE=2>>            ULONG               RKey;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>        }   CompareExchange;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>        struct _SEND_XCHG_ADD</FONT>
<BR><FONT SIZE=2>>        {</FONT>
<BR><FONT SIZE=2>>            VOID* __ptr64       Address;</FONT>
<BR><FONT SIZE=2>>            UINT64              Value;</FONT>
<BR><FONT SIZE=2>>            ULONG               RKey;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>        }   ExchangeAdd;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    } u;</FONT>
<BR><FONT SIZE=2>>    ULONG                       SgeCount;</FONT>
<BR><FONT SIZE=2>>    IB_SGE* __ptr64             Sge[];</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_SEND_WR;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) struct _IB_RECV_WR</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    struct _IB_RECV_WR* __ptr64 pNext;</FONT>
<BR><FONT SIZE=2>>    UINT64                      WrId;</FONT>
<BR><FONT SIZE=2>>    ULONG                       SgeCount;</FONT>
<BR><FONT SIZE=2>>    IB_SGE* __ptr64             Sge[];</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_RECV_WR;</FONT>
<BR><FONT SIZE=2>>#pragma warning(default:4200)</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) struct _IB_BIND_WR</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    UINT64          WrId;</FONT>
<BR><FONT SIZE=2>>    IB_MR_HANDLE    *pMr;</FONT>
<BR><FONT SIZE=2>>    /** Combination of IB_WR_FLAG values. */</FONT>
<BR><FONT SIZE=2>>    ULONG           Flags;</FONT>
<BR><FONT SIZE=2>>    /** Combination of IB_ACCESS_MASK values. */</FONT>
<BR><FONT SIZE=2>>    ULONG           AccessMask;</FONT>
<BR><FONT SIZE=2>>    void* __ptr64   Addr;</FONT>
<BR><FONT SIZE=2>>    ULONG           Length;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_BIND_WR;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>enum IB_AH_FLAGS</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_AH_FLAG_GRH      = (1 << 0)</FONT>
<BR><FONT SIZE=2>>};</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) struct _IB_AH_ATTR</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    UCHAR           PortNumber;</FONT>
<BR><FONT SIZE=2>>    UCHAR           SvcLvl;</FONT>
<BR><FONT SIZE=2>>    USHORT          DLid;</FONT>
<BR><FONT SIZE=2>>    /** Combination of IB_AH_FLAG values. */</FONT>
<BR><FONT SIZE=2>>    ULONG           Flags;</FONT>
<BR><FONT SIZE=2>>    IB_GRH          Grh;</FONT>
<BR><FONT SIZE=2>>    UCHAR           StaticRate;</FONT>
<BR><FONT SIZE=2>>    UCHAR           PathBits;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_AH_ATTR;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef enum _IB_QP_TYPE</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IbQpTypeReliableConn    = 0,        /* Matches CM REQ transport type */</FONT>
<BR><FONT SIZE=2>>    IbQpTypeUnreliableConn  = 1,        /* Matches CM REQ transport type */</FONT>
<BR><FONT SIZE=2>>    IbQpTypeUnreliableDgrm  = 3,        /* Purposefully skip RDD type. */</FONT>
<BR><FONT SIZE=2>>    IbQpTypeQp0,</FONT>
<BR><FONT SIZE=2>>    IbQpTypeQp1,</FONT>
<BR><FONT SIZE=2>>    IbQpTypeMad,                        /* InfiniBand Access Layer */</FONT>
<BR><FONT SIZE=2>>    IbQpTypeQp0Alias,                   /* InfiniBand Access Layer */</FONT>
<BR><FONT SIZE=2>>    IbQpTypeQp1Alias                    /* InfiniBand Access Layer */</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_QP_TYPE;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) struct _IB_QP_CREATE</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_QP_TYPE              Type;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    ULONG                   SqDepth;</FONT>
<BR><FONT SIZE=2>>    ULONG                   RqDepth;</FONT>
<BR><FONT SIZE=2>>    ULONG                   SqSge;</FONT>
<BR><FONT SIZE=2>>    ULONG                   RqSge;</FONT>
<BR><FONT SIZE=2>>    ULONG                   SqMaxInline;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    IB_CQ_HANDLE            pSendCq;</FONT>
<BR><FONT SIZE=2>>    IB_CQ_HANDLE            pRecvCq;</FONT>
<BR><FONT SIZE=2>>    IB_SRQ_HANDLE           pSrq;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    BOOLEAN                 SqSignaled;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_QP_CREATE;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef enum _IB_QP_STATE</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IbQpsReset,</FONT>
<BR><FONT SIZE=2>>    IbQpsInit,</FONT>
<BR><FONT SIZE=2>>    IbQpsRtr,</FONT>
<BR><FONT SIZE=2>>    IbQpsRts,</FONT>
<BR><FONT SIZE=2>>    IbQpsSqd,</FONT>
<BR><FONT SIZE=2>>    IbQpsSqdDraining,</FONT>
<BR><FONT SIZE=2>>    IbQpsSqdDrained,</FONT>
<BR><FONT SIZE=2>>    IbQpsSqErr,</FONT>
<BR><FONT SIZE=2>>    IbQpsError</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_QP_STATE;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef enum _IB_APM_STATE</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IbApmMigrated = 1,</FONT>
<BR><FONT SIZE=2>>    IbApmRearm,</FONT>
<BR><FONT SIZE=2>>    IbApmArmed</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_APM_STATE;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>enum IB_QP_MOD_FLAGS</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_ALTERNATE_AV      = (1<<0),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_PKEY              = (1<<1),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_APM_STATE         = (1<<2),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_PRIMARY_AV        = (1<<3),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_RNR_NAK_TIMEOUT   = (1<<4),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_RESP_RES          = (1<<5),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_INIT_DEPTH        = (1<<6),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_PRIMARY_PORT      = (1<<7),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_ACCESS_CTRL       = (1<<8),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_QKEY              = (1<<9),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_SQ_DEPTH          = (1<<10),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_RQ_DEPTH          = (1<<11),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_CURRENT_STATE     = (1<<12),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_RETRY_CNT         = (1<<13),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_LOCAL_ACK_TIMEOUT = (1<<14),</FONT>
<BR><FONT SIZE=2>>    IB_MOD_QP_RNR_RETRY_CNT     = (1<<15)</FONT>
<BR><FONT SIZE=2>>};</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) struct _IB_QP_MODIFY</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_QP_STATE     ReqState;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    union _QpState</FONT>
<BR><FONT SIZE=2>>    {</FONT>
<BR><FONT SIZE=2>>        struct _QpInit</FONT>
<BR><FONT SIZE=2>>        {</FONT>
<BR><FONT SIZE=2>>            UCHAR               PrimaryPort;</FONT>
<BR><FONT SIZE=2>>            ULONG               Qkey;</FONT>
<BR><FONT SIZE=2>>            USHORT              PkeyIndex;</FONT>
<BR><FONT SIZE=2>>            ULONG               AccessMask;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>        }   Init;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>        struct _QpRtr</FONT>
<BR><FONT SIZE=2>>        {</FONT>
<BR><FONT SIZE=2>>            ULONG               RqPsn;</FONT>
<BR><FONT SIZE=2>>            ULONG               DestQp;</FONT>
<BR><FONT SIZE=2>>            IB_AH_ATTR          PrimaryAh;</FONT>
<BR><FONT SIZE=2>>            UCHAR               RespRes;</FONT>
<BR><FONT SIZE=2>>            UCHAR               RnrNakTimeout;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>            ULONG               Opts;</FONT>
<BR><FONT SIZE=2>>            IB_AH_ATTR          AlternateAh;</FONT>
<BR><FONT SIZE=2>>            ULONG               Qkey;</FONT>
<BR><FONT SIZE=2>>            USHORT              PkeyIndex;</FONT>
<BR><FONT SIZE=2>>            ULONG               AccessMask;</FONT>
<BR><FONT SIZE=2>>            ULONG               SqDepth;</FONT>
<BR><FONT SIZE=2>>            ULONG               RqDepth;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>        }   rtr;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>        struct _QpRts</FONT>
<BR><FONT SIZE=2>>        {</FONT>
<BR><FONT SIZE=2>>            ULONG               SqPsn;</FONT>
<BR><FONT SIZE=2>>            UCHAR               RetryCnt;</FONT>
<BR><FONT SIZE=2>>            UCHAR               RnrRetryCnt;</FONT>
<BR><FONT SIZE=2>>            UCHAR               LocalAckTimeout;</FONT>
<BR><FONT SIZE=2>>            UCHAR               InitDepth;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>            ULONG               Opts;</FONT>
<BR><FONT SIZE=2>>            UCHAR               RnrNakTimeout;</FONT>
<BR><FONT SIZE=2>>            IB_QP_STATE         CurrentState;</FONT>
<BR><FONT SIZE=2>>            ULONG               Qkey;</FONT>
<BR><FONT SIZE=2>>            ULONG               AccessMask;</FONT>
<BR><FONT SIZE=2>>            UCHAR               RespRes;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>            IB_AH_ATTR          PrimaryAh;</FONT>
<BR><FONT SIZE=2>>            IB_AH_ATTR          AlternateAh;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>            ULONG               SqDepth;</FONT>
<BR><FONT SIZE=2>>            ULONG               RqDepth;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>            IB_APM_STATE        ApmState;</FONT>
<BR><FONT SIZE=2>>            UCHAR               PrimaryPort;</FONT>
<BR><FONT SIZE=2>>            USHORT              PkeyIndex;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>        }   rts;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>        struct _QpSqd</FONT>
<BR><FONT SIZE=2>>        {</FONT>
<BR><FONT SIZE=2>>            BOOLEAN             SqdEvent;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>        }   sqd;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    }   state;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_QP_MODIFY;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef __declspec(align(8)) struct _IB_QP_ATTR</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    ULONG                   AccessMask;</FONT>
<BR><FONT SIZE=2>>    USHORT                  PkeyIndex;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    UCHAR                   InitDepth;</FONT>
<BR><FONT SIZE=2>>    UCHAR                   RespRes;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    BOOLEAN                 SqSignaled;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    IB_QP_STATE             State;</FONT>
<BR><FONT SIZE=2>>    ULONG                   DestQpNum;</FONT>
<BR><FONT SIZE=2>>    ULONG                   Qkey;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    ULONG                   SqPsn;</FONT>
<BR><FONT SIZE=2>>    ULONG                   RqPsn;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    UCHAR                   primary_port;</FONT>
<BR><FONT SIZE=2>>    UCHAR                   alternate_port;</FONT>
<BR><FONT SIZE=2>>    IB_AH_ATTR              PrimaryAh;</FONT>
<BR><FONT SIZE=2>>    IB_AH_ATTR              AlternateAh;</FONT>
<BR><FONT SIZE=2>>    IB_APM_STATE            ApmState;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_QP_ATTR;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#endif /* _IBDEFS_ */</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>Index: inc/kernel/iba/ibverbs.h</FONT>
<BR><FONT SIZE=2>>===================================================================</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>> * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> * This software is available to you under the OpenIB.org BSD license</FONT>
<BR><FONT SIZE=2>> * below:</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> *     Redistribution and use in source and binary forms, with or</FONT>
<BR><FONT SIZE=2>> *     without modification, are permitted provided that the following</FONT>
<BR><FONT SIZE=2>> *     conditions are met:</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> *      - Redistributions of source code must retain the above</FONT>
<BR><FONT SIZE=2>> *        copyright notice, this list of conditions and the following</FONT>
<BR><FONT SIZE=2>> *        disclaimer.</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> *      - Redistributions in binary form must reproduce the above</FONT>
<BR><FONT SIZE=2>> *        copyright notice, this list of conditions and the following</FONT>
<BR><FONT SIZE=2>> *        disclaimer in the documentation and/or other materials</FONT>
<BR><FONT SIZE=2>> *        provided with the distribution.</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,</FONT>
<BR><FONT SIZE=2>> * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</FONT>
<BR><FONT SIZE=2>> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</FONT>
<BR><FONT SIZE=2>> * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS</FONT>
<BR><FONT SIZE=2>> * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN</FONT>
<BR><FONT SIZE=2>> * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN</FONT>
<BR><FONT SIZE=2>> * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</FONT>
<BR><FONT SIZE=2>> * SOFTWARE.</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> * $Id$</FONT>
<BR><FONT SIZE=2>> */</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#pragma once</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#ifndef _IBVERBS_</FONT>
<BR><FONT SIZE=2>>#define _IBVERBS_</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#include <iba/ibdef.h></FONT>
<BR><FONT SIZE=2>>#include <iba/ibstatus.h></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****s* Verbs/CI_UDATA</FONT>
<BR><FONT SIZE=2>>* NAME</FONT>
<BR><FONT SIZE=2>>*   CI_UDATA</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Vendor specific structure to facilitate user mode IO</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   This structure is provided to assist the vendor specific user mode</FONT>
<BR><FONT SIZE=2>>*   library to exchange information with its kernel mode driver. The</FONT>
<BR><FONT SIZE=2>>*   user mode InfiniBand(tm) Verbs will call the vendor specific</FONT>
<BR><FONT SIZE=2>>*   module before a call is made to the kernel mode driver. The kernel mode</FONT>
<BR><FONT SIZE=2>>*   driver is expected to know the format and data in the input and output</FONT>
<BR><FONT SIZE=2>>*   buffers, and copy any necessary data that must be handed to the user</FONT>
<BR><FONT SIZE=2>>*   mode vendor library.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* PURPOSE</FONT>
<BR><FONT SIZE=2>>*   pInputBuffer</FONT>
<BR><FONT SIZE=2>>*       UVP input buffer.  May overlap the output buffer.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pOutputBuffer</FONT>
<BR><FONT SIZE=2>>*       UVP output buffer.  NULL if no output buffer is provided.</FONT>
<BR><FONT SIZE=2>>*       May overlap the input buffer.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   InputSize</FONT>
<BR><FONT SIZE=2>>*       Size of UVP provided buffer.  Zero if there is no input buffer.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   OutputSize</FONT>
<BR><FONT SIZE=2>>*       The size of the UVP provided output buffer.  Zero if no output</FONT>
<BR><FONT SIZE=2>>*       buffer is provided.  The kernel mode driver sets this to the exact</FONT>
<BR><FONT SIZE=2>>*       size that needs to be returned to its user mode counterpart.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SOURCE</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef struct _CI_UDATA</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    const VOID* __ptr64 const   pInputBuffer;</FONT>
<BR><FONT SIZE=2>>    VOID* __ptr64 const         pOutputBuffer;</FONT>
<BR><FONT SIZE=2>>    SIZE_T                      InputSize;</FONT>
<BR><FONT SIZE=2>>    SIZE_T                      OutputSize;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>} CI_UDATA;</FONT>
<BR><FONT SIZE=2>>/******/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef struct _IB_CA</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    VOID            *Context;</FONT>
<BR><FONT SIZE=2>>    LONG volatile   nRef;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_CA;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef VOID</FONT>
<BR><FONT SIZE=2>>(*PFN_IB_CA_ASYNC_EVENT)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CA* const                pCa,</FONT>
<BR><FONT SIZE=2>>    IN              VOID                        *CaContext,</FONT>
<BR><FONT SIZE=2>>    IN      const   UCHAR                       PortNumber,</FONT>
<BR><FONT SIZE=2>>    IN              IB_ASYNC_EVENT              Event );</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/POPEN_CA</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Opens the HCA for client use.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*POPEN_CA)(</FONT>
<BR><FONT SIZE=2>>    IN              VOID* const                 IfcContext,</FONT>
<BR><FONT SIZE=2>>    IN              VOID* const                 Context,</FONT>
<BR><FONT SIZE=2>>    IN              PFN_IB_CA_ASYNC_EVENT       CaAsyncEvent OPTIONAL,</FONT>
<BR><FONT SIZE=2>>    IN  OUT         CI_UDATA* const             pUserData,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   IfcContext</FONT>
<BR><FONT SIZE=2>>*       [in] Interface context returned in INTERFACE structure retrieved</FONT>
<BR><FONT SIZE=2>>*       using IRP_MN_QUERY_INTERFACE.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Context</FONT>
<BR><FONT SIZE=2>>*       [in] A pointer to a caller-supplied context for the CA instance</FONT>
<BR><FONT SIZE=2>>*       being created.  The HCA driver passes this value to the client's</FONT>
<BR><FONT SIZE=2>>*       event callback functions.  If the client will not be using event</FONT>
<BR><FONT SIZE=2>>*       callbacks, this value is unused.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   CaAsyncEvent</FONT>
<BR><FONT SIZE=2>>*       [in] A pointer to a client PFN_IB_CA_ASYNC_EVENT event callback</FONT>
<BR><FONT SIZE=2>>*       function for the new CA instance.  This callback is optional, and</FONT>
<BR><FONT SIZE=2>>*       events can be retrieved via calls to PGET_CA_FATAL_EVENT and</FONT>
<BR><FONT SIZE=2>>*       PGET_CA_PORT_EVENT.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pUserData</FONT>
<BR><FONT SIZE=2>>*       [in] Descriptor for any data exchanged with the user-mode verb</FONT>
<BR><FONT SIZE=2>>*       provider.  The input and output buffers are shadowed by the</FONT>
<BR><FONT SIZE=2>>*       access layer in non-paged pool.  The HCA driver can only access</FONT>
<BR><FONT SIZE=2>>*       further embedded pointers from the context of this call.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The operation completed successfully.  The IoStatus.Information</FONT>
<BR><FONT SIZE=2>>*       field of the IRP contains a pointer to a CA instance structure,</FONT>
<BR><FONT SIZE=2>>*       IB_CA, for the new CA instance.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PCLOSE_CA</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Closes an open instance of an HCA.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PCLOSE_CA)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CA* const                pCa,</FONT>
<BR><FONT SIZE=2>>    IN  OUT         CI_UDATA* const             pUserData,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCa</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CA structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       POPEN_CA.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pUserData</FONT>
<BR><FONT SIZE=2>>*       [in] Descriptor for any data exchanged with the user-mode verb</FONT>
<BR><FONT SIZE=2>>*       provider.  The input and output buffers are shadowed by the</FONT>
<BR><FONT SIZE=2>>*       access layer in non-paged pool.  The HCA driver can only access</FONT>
<BR><FONT SIZE=2>>*       further embedded pointers from the context of this call.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The CA instance was closed successfully.  The IRP will be completed</FONT>
<BR><FONT SIZE=2>>*       with success status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   There are no other status codes</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   This function cannot fail.  If a resource is in use, the IRP will not</FONT>
<BR><FONT SIZE=2>>*   complete until all references to the resource have been released.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Any pending event notification IRPs will be completed with</FONT>
<BR><FONT SIZE=2>>*   STATUS_CANCELLED before the function returns.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PGET_CA_FATAL_EVENT</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Queues a request for HCA catastrophic error notification.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PGET_CA_FATAL_EVENT)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CA* const                pCa,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCa</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CA structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       POPEN_CA.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when a local catastrophic error</FONT>
<BR><FONT SIZE=2>>*       occurs on the HCA.  The IRP major and minor functions as well as</FONT>
<BR><FONT SIZE=2>>*       the I/O stack must be preserved when the IRP is completed.  The</FONT>
<BR><FONT SIZE=2>>*       Irp.RequestorMode can be used to distinguish kernel and user</FONT>
<BR><FONT SIZE=2>>clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The CA instance experienced a fatal error and should be closed.</FONT>
<BR><FONT SIZE=2>>*       The IRP will be completed with success status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must set a cancel routine to allow clients to cancel</FONT>
<BR><FONT SIZE=2>>*   the notification request.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   A client can queue up mutiple requests for notification.  Only one</FONT>
<BR><FONT SIZE=2>>*   request is completed per event.  All such requests are completed with</FONT>
<BR><FONT SIZE=2>>*   STATUS_CANCELLED if the IB_CA instance is closed.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PGET_CA_PORT_EVENT</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Queues a requests for port event notification.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PGET_CA_PORT_EVENT)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CA* const                pCa,</FONT>
<BR><FONT SIZE=2>>    IN      const   UCHAR                       PortNumber,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCa</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CA structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       POPEN_CA.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   PortNumber</FONT>
<BR><FONT SIZE=2>>*       [in] Port number to which the notification request is targetted.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The CA instance experienced a port event.  The IoStatus.Information</FONT>
<BR><FONT SIZE=2>>*       member of the IRP is updated with the IB_ASYNC_EVENT value.  The</FONT>
<BR><FONT SIZE=2>>IRP</FONT>
<BR><FONT SIZE=2>>*       will be completed with success status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP and the IB_ASYNC_EVENT will be returned in the</FONT>
<BR><FONT SIZE=2>>*       IoStatus.Information field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must set a cancel routine to allow clients to cancel</FONT>
<BR><FONT SIZE=2>>*   the notification request.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   A client can queue up mutiple requests for notification.  Only one</FONT>
<BR><FONT SIZE=2>>*   request is completed per event.  All such requests are completed with</FONT>
<BR><FONT SIZE=2>>*   STATUS_CANCELLED if the IB_CA instance is closed.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PQUERY_CA</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Queries an HCA for its attributes.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PQUERY_CA)(</FONT>
<BR><FONT SIZE=2>>    IN              VOID* const                 Context,</FONT>
<BR><FONT SIZE=2>>    IN      const   SIZE_T                      AttrSize,</FONT>
<BR><FONT SIZE=2>>        OUT         IB_CA_ATTR* const           pAttr,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   Context</FONT>
<BR><FONT SIZE=2>>*       [in] Interface context returned in INTERFACE structure retrieved</FONT>
<BR><FONT SIZE=2>>*       using IRP_MN_QUERY_INTERFACE.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pAttrSize</FONT>
<BR><FONT SIZE=2>>*       [in] Size of the attributes buffer referenced by the pAttr</FONT>
<BR><FONT SIZE=2>>parameter.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pAttr</FONT>
<BR><FONT SIZE=2>>*       [out] CA attribute of this Host Channel adapter.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The full CA attributes, including port attributes and their GID</FONT>
<BR><FONT SIZE=2>>*       and PKEY tables, were successfully copied to the attribute buffer.</FONT>
<BR><FONT SIZE=2>>*       The IoStatus.Information field of the IRP is updated to indicate</FONT>
<BR><FONT SIZE=2>>*       the number of bytes returned.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field and the number of bytes returned in the IoStatus.Information</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_BUFFER_OVERFLOW</FONT>
<BR><FONT SIZE=2>>*       The operation completed but returned only partial attributes.  Full</FONT>
<BR><FONT SIZE=2>>*       attributes were not returned due to insufficient space.  The size</FONT>
<BR><FONT SIZE=2>>*       required to get the full attributes is returned in the Size field</FONT>
<BR><FONT SIZE=2>>*       of the IB_CA_ATTR structure.  The IoStatus.Information field of the</FONT>
<BR><FONT SIZE=2>>*       IRP is updated to indicate the number of bytes returned.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_BUFFER_TOO_SMALL</FONT>
<BR><FONT SIZE=2>>*       The pAttr buffer was too small to return any information.  At a</FONT>
<BR><FONT SIZE=2>>*       minimum, the buffer must be the 4 bytes to allow the required</FONT>
<BR><FONT SIZE=2>>*       size to be returned.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PQUERY_PORT</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Queries an HCA for one of its port attributes.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PQUERY_PORT)(</FONT>
<BR><FONT SIZE=2>>    IN              VOID* const                 Context,</FONT>
<BR><FONT SIZE=2>>    IN      const   UCHAR                       PortNumber,</FONT>
<BR><FONT SIZE=2>>    IN      const   SIZE_T                      AttrSize,</FONT>
<BR><FONT SIZE=2>>        OUT         IB_PORT_ATTR* const         pAttr,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   Context</FONT>
<BR><FONT SIZE=2>>*       [in] Interface context returned in INTERFACE structure retrieved</FONT>
<BR><FONT SIZE=2>>*       using IRP_MN_QUERY_INTERFACE.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   PortNumber</FONT>
<BR><FONT SIZE=2>>*       [in] 1-based port number targetted by this request.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pAttrSize</FONT>
<BR><FONT SIZE=2>>*       [in] Size of the attributes buffer referenced by the pAttr</FONT>
<BR><FONT SIZE=2>>parameter.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pAttr</FONT>
<BR><FONT SIZE=2>>*       [out] CA attribute of this Host Channel adapter.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The full port attributes, including the GID and PKEY tables, were</FONT>
<BR><FONT SIZE=2>>*       successfully copied to the attribute buffer.</FONT>
<BR><FONT SIZE=2>>*       The IoStatus.Information field of the IRP is updated to indicate</FONT>
<BR><FONT SIZE=2>>*       the number of bytes returned.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field and the number of bytes returned in the IoStatus.Information</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_MORE_ENTRIES</FONT>
<BR><FONT SIZE=2>>*       The operation completed but returned only partial attributes.  Full</FONT>
<BR><FONT SIZE=2>>*       attributes were not returned due to insufficient space.  The size</FONT>
<BR><FONT SIZE=2>>*       required to get the full attributes is returned in the Size field</FONT>
<BR><FONT SIZE=2>>*       of the IB_PORT_ATTR structure.  The IoStatus.Information field of</FONT>
<BR><FONT SIZE=2>>*       the IRP is updated to indicate the number of bytes returned.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_BUFFER_TOO_SMALL</FONT>
<BR><FONT SIZE=2>>*       The pAttr buffer was too small to return any information.  At a</FONT>
<BR><FONT SIZE=2>>*       minimum, the buffer must be the 4 bytes to allow the required</FONT>
<BR><FONT SIZE=2>>*       size to be returned.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PMODIFY_CA</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Modify the attributes of a Channel Adapter.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PMODIFY_CA)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CA* const                pCa,</FONT>
<BR><FONT SIZE=2>>    IN      const   ULONG                       Flags,</FONT>
<BR><FONT SIZE=2>>    IN      const   IB_MODIFY_CA* const         pModify,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCa</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CA structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       POPEN_CA.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Flags</FONT>
<BR><FONT SIZE=2>>*       [in] Combination of IB_MODIFY_CA_FLAGS values indicating which</FONT>
<BR><FONT SIZE=2>>*       fields are valid in the IB_MODIFY_CA structure.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pModify</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_MODIFY_CA structure with the fields specified</FONT>
<BR><FONT SIZE=2>>*       by the Flags parameter set to the desired values.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The CA was modified successfully.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PMODIFY_PORT</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Modify the attributes of a Channel Adapter's port.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PMODIFY_PORT)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CA* const                pCa,</FONT>
<BR><FONT SIZE=2>>    IN      const   UCHAR                       PortNumber,</FONT>
<BR><FONT SIZE=2>>    IN      const   ULONG                       Flags,</FONT>
<BR><FONT SIZE=2>>    IN      const   IB_MODIFY_PORT* const       pModify,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCa</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CA structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       POPEN_CA.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   PortNumber</FONT>
<BR><FONT SIZE=2>>*       [in] 1-based port number targetted by this request.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Flags</FONT>
<BR><FONT SIZE=2>>*       [in] Combination of IB_MODIFY_CA_FLAGS values indicating which</FONT>
<BR><FONT SIZE=2>>*       fields are valid in the IB_MODIFY_CA structure.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pModify</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_MODIFY_CA structure with the fields specified</FONT>
<BR><FONT SIZE=2>>*       by the Flags parameter set to the desired values.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The CA's port was modified successfully.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_LOCK_CONFLICT</FONT>
<BR><FONT SIZE=2>>*       The requested capabilities conflict with existing capabilities.</FONT>
<BR><FONT SIZE=2>>*       This can occur if multiple clients try to bits such as</FONT>
<BR><FONT SIZE=2>>*       IB_PORT_CAP_IS_SM or IB_PORT_CAP_CM_SUP bits in the port</FONT>
<BR><FONT SIZE=2>>*       capabilities.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef struct _IB_CQ</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_CA           *pCa;</FONT>
<BR><FONT SIZE=2>>    ULONG           NumCqes;</FONT>
<BR><FONT SIZE=2>>    VOID            *Context;</FONT>
<BR><FONT SIZE=2>>    LONG volatile   nRef;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_CQ;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef VOID</FONT>
<BR><FONT SIZE=2>>(*PFN_IB_CQ_COMP_EVENT)(</FONT>
<BR><FONT SIZE=2>>        IN              IB_CQ                       *pCq,</FONT>
<BR><FONT SIZE=2>>        IN              VOID                        *CqContext );</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef VOID</FONT>
<BR><FONT SIZE=2>>(*PFN_IB_CQ_ASYNC_EVENT)(</FONT>
<BR><FONT SIZE=2>>        IN              IB_CQ                       *pCq,</FONT>
<BR><FONT SIZE=2>>        IN              VOID                        *CqContext,</FONT>
<BR><FONT SIZE=2>>        IN              IB_ASYNC_EVENT              Event );</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PCREATE_CQ</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Create a Completion Queue.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PCREATE_CQ)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CA* const                pCa,</FONT>
<BR><FONT SIZE=2>>    IN              ULONG const                 NumCqes,</FONT>
<BR><FONT SIZE=2>>    IN              VOID* const                 Context,</FONT>
<BR><FONT SIZE=2>>    IN              PFN_IB_CQ_COMP_EVENT        CqCompEvent OPTIONAL,</FONT>
<BR><FONT SIZE=2>>    IN              PFN_IB_CQ_ASYNC_EVENT       CqAsyncEvent OPTIONAL,</FONT>
<BR><FONT SIZE=2>>    IN  OUT         CI_UDATA* const             pUserData,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCa</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CA structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       POPEN_CA.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   NumCqes</FONT>
<BR><FONT SIZE=2>>*       [in] Number of CQ entries requested by the consumer.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Context</FONT>
<BR><FONT SIZE=2>>*       [in] A pointer to a caller-supplied context for the CQ being</FONT>
<BR><FONT SIZE=2>>*       created.  The HCA driver passes this value to the client's</FONT>
<BR><FONT SIZE=2>>*       event callback functions.  If the client will not be using event</FONT>
<BR><FONT SIZE=2>>*       callbacks, this value is unused.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   CqCompEvent</FONT>
<BR><FONT SIZE=2>>*       [in] A pointer to a client PFN_IB_CQ_COMP_EVENT event callback</FONT>
<BR><FONT SIZE=2>>*       function for the new CQ instance.  This parameter may be NULL and</FONT>
<BR><FONT SIZE=2>>*       completion notification requests can be issued through a call to</FONT>
<BR><FONT SIZE=2>>*       PGET_CQ_COMP_EVENT.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   CqAsyncEvent</FONT>
<BR><FONT SIZE=2>>*       [in] A pointer to a client PFN_IB_CQ_ASYNC_EVENT event callback</FONT>
<BR><FONT SIZE=2>>*       function for the new CQ instance.  This parameter may be NULL and</FONT>
<BR><FONT SIZE=2>>*       asynchonrous affiliated event notification requests can be issued</FONT>
<BR><FONT SIZE=2>>*       through a call to PGET_CQ_ASYNC_EVENT.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pUserData</FONT>
<BR><FONT SIZE=2>>*       [in] Descriptor for any data exchanged with the user-mode verb</FONT>
<BR><FONT SIZE=2>>*       provider.  The input and output buffers are shadowed by the</FONT>
<BR><FONT SIZE=2>>*       access layer in non-paged pool.  The HCA driver can only access</FONT>
<BR><FONT SIZE=2>>*       further embedded pointers from the context of this call.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The CQ was created successfully.  The IB_CQ structure is returned</FONT>
<BR><FONT SIZE=2>>*       in the IoStatus.Information field of the IRP.  The IB_CQ structure</FONT>
<BR><FONT SIZE=2>>*       contains the actual number of CQ entries allocated for the CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field and the IB_CQ structure in the IoStatus.Information field of</FONT>
<BR><FONT SIZE=2>>*       the IRP.  The IB_CQ structure contains the actual number of CQ</FONT>
<BR><FONT SIZE=2>>*       entries allocated for the CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PDESTROY_CQ</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Destroy a Completion Queue.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PDESTROY_CQ)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CQ* const                pCq,</FONT>
<BR><FONT SIZE=2>>    IN  OUT         CI_UDATA* const             pUserData,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCq</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CQ structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pUserData</FONT>
<BR><FONT SIZE=2>>*       [in] Descriptor for any data exchanged with the user-mode verb</FONT>
<BR><FONT SIZE=2>>*       provider.  The input and output buffers are shadowed by the</FONT>
<BR><FONT SIZE=2>>*       access layer in non-paged pool.  The HCA driver can only access</FONT>
<BR><FONT SIZE=2>>*       further embedded pointers from the context of this call.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The CQ was destroyed successfully.  No futher operations can be</FONT>
<BR><FONT SIZE=2>>*       performed on the CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   There are no other status codes</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   This function cannot fail.  If a resource is in use, the IRP will not</FONT>
<BR><FONT SIZE=2>>*   complete until all references to the resource have been released.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PRESIZE_CQ</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Change the number of CQEs supported by a Completion Queue.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PRESIZE_CQ)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CQ* const                pCq,</FONT>
<BR><FONT SIZE=2>>    IN              ULONG const                 NumCqes,</FONT>
<BR><FONT SIZE=2>>    IN  OUT         CI_UDATA* const             pUserData,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCq</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CQ structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   NumCqes</FONT>
<BR><FONT SIZE=2>>*       [in] Number of CQ entries requested by the consumer.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pUserData</FONT>
<BR><FONT SIZE=2>>*       [in] Descriptor for any data exchanged with the user-mode verb</FONT>
<BR><FONT SIZE=2>>*       provider.  The input and output buffers are shadowed by the</FONT>
<BR><FONT SIZE=2>>*       access layer in non-paged pool.  The HCA driver can only access</FONT>
<BR><FONT SIZE=2>>*       further embedded pointers from the context of this call.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The CQ was resized successfully.  The IB_CQ structure is updated</FONT>
<BR><FONT SIZE=2>>*       with the actual number of CQ entries allocated for the CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.  The IB_CQ structure is updated with the actual</FONT>
<BR><FONT SIZE=2>>*       number of CQ entries allocated for the CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PREARM_CQ</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Requests that the completion queue generate a notifification when</FONT>
<BR><FONT SIZE=2>>*   the next completion of the requested type is added.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PREARM_CQ)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CQ* const                pCq,</FONT>
<BR><FONT SIZE=2>>    IN      const   BOOLEAN                     Solicited );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCq</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CQ structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Solicited</FONT>
<BR><FONT SIZE=2>>*       [in] A flag indicating whether the request is to generate a</FONT>
<BR><FONT SIZE=2>>*       notification on the next entry, if set to FALSE, or on the next</FONT>
<BR><FONT SIZE=2>>*       solicited entry being added to the completion queue, if set to</FONT>
<BR><FONT SIZE=2>>TRUE.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The CQ was rearmed successfully.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PREARM_N_CQ</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Request that the completion queue generate a notification when</FONT>
<BR><FONT SIZE=2>>*   the next N completions have been added to this CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PREARM_N_CQ)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CQ* const                pCq,</FONT>
<BR><FONT SIZE=2>>    IN      const   ULONG                       NumCqes );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCq</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CQ structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   NumCqes</FONT>
<BR><FONT SIZE=2>>*       [in] The number of completion queue entries to be added to the</FONT>
<BR><FONT SIZE=2>>*       completion queue before notifying the client.  This value must</FONT>
<BR><FONT SIZE=2>>*       greater than or equal to one and less than or equal to the size</FONT>
<BR><FONT SIZE=2>>*       of the completion queue.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The CQ was rearmed successfully.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_INVALID_PARAMETER</FONT>
<BR><FONT SIZE=2>>*       The requested number of completion queue entries was invalid.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_NOT_SUPPORTED</FONT>
<BR><FONT SIZE=2>>*       This operation is not supported by the channel adapter.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PPOLL_CQ</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Poll a CQ for at most nCqe completions</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PPOLL_CQ)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CQ* const                pCq,</FONT>
<BR><FONT SIZE=2>>    IN  OUT         LONG* const                 pNumWc,</FONT>
<BR><FONT SIZE=2>>        OUT         IB_WC*                      Wc[] );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCq</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CQ structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pNumWc</FONT>
<BR><FONT SIZE=2>>*       [in/out] On input, number of IB_WC work completions in the Wc[]</FONT>
<BR><FONT SIZE=2>>array</FONT>
<BR><FONT SIZE=2>>*       provided by the consumer, on output number of work completions</FONT>
<BR><FONT SIZE=2>>*       returned.  This pointer is resident and accessible from</FONT>
<BR><FONT SIZE=2>>*       IRQL == DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Wc[]</FONT>
<BR><FONT SIZE=2>>*       [in] Array of *pNumWc IB_WC structures used to retrive completions</FONT>
<BR><FONT SIZE=2>>*       from the completion queue.  This buffer is resident and accessible</FONT>
<BR><FONT SIZE=2>>*       from IQRL == DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The operation successfully polled the CQ.  The number of work</FONT>
<BR><FONT SIZE=2>>*       completions returned is provided by the pNumWc parameter.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_NO_MORE_ENTRIES</FONT>
<BR><FONT SIZE=2>>*       All entries have been reaped from the CQ.  The pNumWc parameter is</FONT>
<BR><FONT SIZE=2>>*       returned as zero.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The pNumWc parameter is updated to reflect the</FONT>
<BR><FONT SIZE=2>>*       number of successfully reaped work completions.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PPEEK_CQ</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Peek a CQ and return the number of available work completions.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PPEEK_CQ)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CQ* const                pCq,</FONT>
<BR><FONT SIZE=2>>        OUT         LONG* const                 pNumWc );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCq</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CQ structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pNumWc</FONT>
<BR><FONT SIZE=2>>*       [out] Number of work completions available on the CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The operation completed successfully and the pNumWc parameter is</FONT>
<BR><FONT SIZE=2>>*       updated with the number of available CQ entries.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PGET_CQ_COMP_EVENT</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Queue a request for completion event notification.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PGET_CQ_COMP_EVENT)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CQ* const                pCq,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCq</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CQ structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The CQ experienced a completion event.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP upon the next completion event, at which</FONT>
<BR><FONT SIZE=2>>point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must set a cancel routine to allow clients to cancel</FONT>
<BR><FONT SIZE=2>>*   the notification request.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Only a single requests for notification can be queued at a time.</FONT>
<BR><FONT SIZE=2>>*   Any previously queued request is completed with STATUS_CANCELLED.</FONT>
<BR><FONT SIZE=2>>*   All such requests are completed with STATUS_CANCELLED if the IB_CQ</FONT>
<BR><FONT SIZE=2>>*   instance is destroyed.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PGET_CQ_ASYNC_EVENT</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Queue a request for asynchronous event notification.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PGET_CQ_ASYNC_EVENT)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CQ* const                pCq,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCq</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CQ structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_CQ.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The CQ experienced an asynchronous event.  The IoStatus.Information</FONT>
<BR><FONT SIZE=2>>*       field of the IRP is updated with the IB_ASYNC_EVENT code.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP upon the next completion event, at which</FONT>
<BR><FONT SIZE=2>>point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       and the IB_ASYNC_EVENT code is returned in the IoStatus.Information</FONT>
<BR><FONT SIZE=2>>*       fields of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must set a cancel routine to allow clients to cancel</FONT>
<BR><FONT SIZE=2>>*   the notification request.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   A client can queue up mutiple requests for notification.  Only one</FONT>
<BR><FONT SIZE=2>>*   request is completed per event.  All such requests are completed with</FONT>
<BR><FONT SIZE=2>>*   STATUS_CANCELLED if the IB_CQ instance is destroyed.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef struct _IB_PD</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_CA           *pCa;</FONT>
<BR><FONT SIZE=2>>    LONG volatile   nRef;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_PD;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PCREATE_PD</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Create a Protection Domain.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PCREATE_PD)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_CA* const                pCa,</FONT>
<BR><FONT SIZE=2>>    IN  OUT         CI_UDATA* const             pUserData,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pCa</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_CA structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       POPEN_CA.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pUserData</FONT>
<BR><FONT SIZE=2>>*       [in] Descriptor for any data exchanged with the user-mode verb</FONT>
<BR><FONT SIZE=2>>*       provider.  The input and output buffers are shadowed by the</FONT>
<BR><FONT SIZE=2>>*       access layer in non-paged pool.  The HCA driver can only access</FONT>
<BR><FONT SIZE=2>>*       further embedded pointers from the context of this call.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The PD was created successfully.  The IB_PD structure is returned</FONT>
<BR><FONT SIZE=2>>*       in the IoStatus.Information field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field and the IB_PD structure in the IoStatus.Information field of</FONT>
<BR><FONT SIZE=2>>*       the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PDESTROY_PD</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Destroy a Protection Domain.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PDESTROY_PD)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_PD* const                pPd,</FONT>
<BR><FONT SIZE=2>>    IN  OUT         CI_UDATA* const             pUserData,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pPd</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_PD structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_PD.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pUserData</FONT>
<BR><FONT SIZE=2>>*       [in] Descriptor for any data exchanged with the user-mode verb</FONT>
<BR><FONT SIZE=2>>*       provider.  The input and output buffers are shadowed by the</FONT>
<BR><FONT SIZE=2>>*       access layer in non-paged pool.  The HCA driver can only access</FONT>
<BR><FONT SIZE=2>>*       further embedded pointers from the context of this call.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The PD was destroyed successfully.  No futher operations can be</FONT>
<BR><FONT SIZE=2>>*       performed on the PD.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   There are no other status codes</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   This function cannot fail.  If a resource is in use, the IRP will not</FONT>
<BR><FONT SIZE=2>>*   complete until all references to the resource have been released.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef struct _IB_AH</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_PD           *pPd;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_AH;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PCREATE_AH</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Create an unreliable datagram address handle.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PCREATE_AH)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_PD* const                pPd,</FONT>
<BR><FONT SIZE=2>>    IN              IB_AH_ATTR* const           pAhAttr,</FONT>
<BR><FONT SIZE=2>>        OUT         IB_AH** const               ppAh );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pPd</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_PD structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_PD.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pAhAttr</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_AH_CREATE structure containing the desired</FONT>
<BR><FONT SIZE=2>>*       attributes for the newly created queue pair.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   ppAh</FONT>
<BR><FONT SIZE=2>>*       [out] Pointer to user's AH poiner, set on output if the function</FONT>
<BR><FONT SIZE=2>>*       succeeds.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The AH was created successfully.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The client must release all</FONT>
<BR><FONT SIZE=2>>*       resources and close the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_INVALID_PARAMETER_1</FONT>
<BR><FONT SIZE=2>>*       Invalid port number.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_INVALID_PARAMETER_2</FONT>
<BR><FONT SIZE=2>>*       Invalid source GID.  Only possible if IB_AH_GRH flag is specified.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PDESTROY_AH</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Destroy an Address Handle.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PDESTROY_AH)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_AH* const                pAh );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pAh</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_AH structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_AH.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The AH was destroyed successfully.  No futher operations can be</FONT>
<BR><FONT SIZE=2>>*       performed referencing the AH.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   There are no other status codes</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   This function cannot fail.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PMODIFY_AH</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Modifies the attributes of an Address Handle.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PMODIFY_AH)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_AH* const                pAh,</FONT>
<BR><FONT SIZE=2>>    IN              IB_AH_ATTR* const           pModify );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pAh</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_AH structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_AH.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pModify</FONT>
<BR><FONT SIZE=2>>*       [in] Specifies the new attributes for the address handle.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The AH was modified successfully.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The client must release all</FONT>
<BR><FONT SIZE=2>>*       resources and close the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_INVALID_PARAMETER_1</FONT>
<BR><FONT SIZE=2>>*       Invalid port number.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_INVALID_PARAMETER_2</FONT>
<BR><FONT SIZE=2>>*       Invalid source GID.  Only possible if IB_AH_GRH flag is specified.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PQUERY_AH</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Modifies the attributes of a Queue Pair.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PQUERY_AH)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_AH* const                pQp,</FONT>
<BR><FONT SIZE=2>>        OUT         IB_AH_ATTR* const           pAttr );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pQp</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_AH structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_AH.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pAttr</FONT>
<BR><FONT SIZE=2>>*       [out] Pointer to an IB_AH_ATTR structure to update with the AH's</FONT>
<BR><FONT SIZE=2>>*       attributes.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The AH attributes were successfully retrieved.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The client must release all</FONT>
<BR><FONT SIZE=2>>*       resources and close the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef struct _IB_SRQ</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_PD           *pPd;</FONT>
<BR><FONT SIZE=2>>    VOID            *Context;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_SRQ;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PPOST_SRQ_RECV)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_SRQ* const               pSrq,</FONT>
<BR><FONT SIZE=2>>    IN      const   IB_RECV_WR*                 pRecvWr,</FONT>
<BR><FONT SIZE=2>>    IN              IB_RECV_WR** const          ppFailedRecv );</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef struct _IB_QP</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_PD           *pPd;</FONT>
<BR><FONT SIZE=2>>    VOID            *Context;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    IB_CQ           *pSendCq;</FONT>
<BR><FONT SIZE=2>>    IB_CQ           *pRecvCq;</FONT>
<BR><FONT SIZE=2>>    IB_SRQ          *pSrq;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    IB_QP_TYPE      Type;</FONT>
<BR><FONT SIZE=2>>    ULONG           Qpn;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    ULONG           SqDepth;</FONT>
<BR><FONT SIZE=2>>    ULONG           RqDepth;</FONT>
<BR><FONT SIZE=2>>    ULONG           SqSge;</FONT>
<BR><FONT SIZE=2>>    ULONG           RqSge;</FONT>
<BR><FONT SIZE=2>>    ULONG           SqMaxInline;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_QP;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef VOID</FONT>
<BR><FONT SIZE=2>>(*PFN_IB_QP_ASYNC_EVENT)(</FONT>
<BR><FONT SIZE=2>>        IN              IB_QP                       *pQp,</FONT>
<BR><FONT SIZE=2>>        IN              VOID                        *QpContext,</FONT>
<BR><FONT SIZE=2>>        IN              IB_ASYNC_EVENT              Event );</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PCREATE_QP</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Create a Queue Pair.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PCREATE_QP)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_PD* const                pPd,</FONT>
<BR><FONT SIZE=2>>    IN              IB_QP_CREATE* const         pCreateQp,</FONT>
<BR><FONT SIZE=2>>    IN              VOID* const                 Context,</FONT>
<BR><FONT SIZE=2>>    IN              PFN_IB_QP_ASYNC_EVENT       QpAsyncEvent OPTIONAL,</FONT>
<BR><FONT SIZE=2>>    IN  OUT         CI_UDATA* const             pUserData,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pPd</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_PD structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_PD.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pCreateAttr</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_QP_CREATE structure containing the desired</FONT>
<BR><FONT SIZE=2>>*       attributes for the newly created queue pair.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Context</FONT>
<BR><FONT SIZE=2>>*       [in] A pointer to a caller-supplied context for the QP being</FONT>
<BR><FONT SIZE=2>>*       created.  The HCA driver passes this value to the client's</FONT>
<BR><FONT SIZE=2>>*       event callback functions.  If the client will not be using event</FONT>
<BR><FONT SIZE=2>>*       callbacks, this value is unused.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   QpAsyncEvent</FONT>
<BR><FONT SIZE=2>>*       [in] A pointer to a client PFN_IB_QP_ASYNC_EVENT event callback</FONT>
<BR><FONT SIZE=2>>*       function for the new QP instance.  This parameter may be NULL and</FONT>
<BR><FONT SIZE=2>>*       asynchonrous affiliated event notification requests can be issued</FONT>
<BR><FONT SIZE=2>>*       through a call to IbGetQpAsyncEvent.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pUserData</FONT>
<BR><FONT SIZE=2>>*       [in] Descriptor for any data exchanged with the user-mode verb</FONT>
<BR><FONT SIZE=2>>*       provider.  The input and output buffers are shadowed by the</FONT>
<BR><FONT SIZE=2>>*       access layer in non-paged pool.  The HCA driver can only access</FONT>
<BR><FONT SIZE=2>>*       further embedded pointers from the context of this call.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The QP was created successfully.  The IB_QP structure is returned</FONT>
<BR><FONT SIZE=2>>*       in the IoStatus.Information field of the IRP.  The IB_QP structure</FONT>
<BR><FONT SIZE=2>>*       contains the actual QP attributes allocated for the QP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field and the IB_QP structure in the IoStatus.Information field of</FONT>
<BR><FONT SIZE=2>>*       the IRP.  The IB_QP structure contains the actual QP attributes.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PCREATE_QP</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Create a Queue Pair.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PCREATE_SPECIAL_QP)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_PD* const                pPd,</FONT>
<BR><FONT SIZE=2>>    IN              UCHAR                       PortNum,</FONT>
<BR><FONT SIZE=2>>    IN              IB_QP_CREATE* const         pCreateQp,</FONT>
<BR><FONT SIZE=2>>    IN              VOID* const                 Context,</FONT>
<BR><FONT SIZE=2>>    IN              PFN_IB_QP_ASYNC_EVENT       QpAsyncEvent OPTIONAL,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pPd</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_PD structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_PD.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   PortNum</FONT>
<BR><FONT SIZE=2>>*       [in] One-based port number for which this special queue pair</FONT>
<BR><FONT SIZE=2>>*       is created.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pCreateAttr</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_QP_CREATE structure containing the desired</FONT>
<BR><FONT SIZE=2>>*       attributes for the newly created queue pair.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Context</FONT>
<BR><FONT SIZE=2>>*       [in] A pointer to a caller-supplied context for the QP being</FONT>
<BR><FONT SIZE=2>>*       created.  The HCA driver passes this value to the client's</FONT>
<BR><FONT SIZE=2>>*       event callback functions.  If the client will not be using event</FONT>
<BR><FONT SIZE=2>>*       callbacks, this value is unused.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   QpAsyncEvent</FONT>
<BR><FONT SIZE=2>>*       [in] A pointer to a client PFN_IB_QP_ASYNC_EVENT event callback</FONT>
<BR><FONT SIZE=2>>*       function for the new QP instance.  This parameter may be NULL and</FONT>
<BR><FONT SIZE=2>>*       asynchonrous affiliated event notification requests can be issued</FONT>
<BR><FONT SIZE=2>>*       through a call to IbGetQpAsyncEvent.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pUserData</FONT>
<BR><FONT SIZE=2>>*       [in] Descriptor for any data exchanged with the user-mode verb</FONT>
<BR><FONT SIZE=2>>*       provider.  The input and output buffers are shadowed by the</FONT>
<BR><FONT SIZE=2>>*       access layer in non-paged pool.  The HCA driver can only access</FONT>
<BR><FONT SIZE=2>>*       further embedded pointers from the context of this call.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The QP was created successfully.  The IB_QP structure is returned</FONT>
<BR><FONT SIZE=2>>*       in the IoStatus.Information field of the IRP.  The IB_QP structure</FONT>
<BR><FONT SIZE=2>>*       contains the actual QP attributes allocated for the QP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field and the IB_QP structure in the IoStatus.Information field of</FONT>
<BR><FONT SIZE=2>>*       the IRP.  The IB_QP structure contains the actual QP attributes.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PDESTROY_QP</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Destroy a Queue Pair.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PDESTROY_QP)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_QP* const                pQp,</FONT>
<BR><FONT SIZE=2>>    IN  OUT         CI_UDATA* const             pUserData,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pQp</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_QP structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_QP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pUserData</FONT>
<BR><FONT SIZE=2>>*       [in] Descriptor for any data exchanged with the user-mode verb</FONT>
<BR><FONT SIZE=2>>*       provider.  The input and output buffers are shadowed by the</FONT>
<BR><FONT SIZE=2>>*       access layer in non-paged pool.  The HCA driver can only access</FONT>
<BR><FONT SIZE=2>>*       further embedded pointers from the context of this call.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The QP was destroyed successfully.  No futher operations can be</FONT>
<BR><FONT SIZE=2>>*       performed on the QP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   There are no other status codes</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   This function cannot fail.  If a resource is in use, the IRP will not</FONT>
<BR><FONT SIZE=2>>*   complete until all references to the resource have been released.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PMODIFY_QP</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Modifies the attributes of a Queue Pair.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PMODIFY_QP)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_QP* const                pQp,</FONT>
<BR><FONT SIZE=2>>    IN              IB_QP_MODIFY* const         pModify,</FONT>
<BR><FONT SIZE=2>>    IN  OUT         CI_UDATA* const             pUserData,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pQp</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_QP structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_QP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pModify</FONT>
<BR><FONT SIZE=2>>*       [in] Specifies the attributes to modify and their requested values.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pUserData</FONT>
<BR><FONT SIZE=2>>*       [in] Descriptor for any data exchanged with the user-mode verb</FONT>
<BR><FONT SIZE=2>>*       provider.  The input and output buffers are shadowed by the</FONT>
<BR><FONT SIZE=2>>*       access layer in non-paged pool.  The HCA driver can only access</FONT>
<BR><FONT SIZE=2>>*       further embedded pointers from the context of this call.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The QP was modified successfully.  The IB_QP structure is updated</FONT>
<BR><FONT SIZE=2>>*       with the actual attributes.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.  The IB_QP structure is updated with the actual</FONT>
<BR><FONT SIZE=2>>*       attribute.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PQUERY_QP</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Modifies the attributes of a Queue Pair.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PQUERY_QP)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_QP* const                pQp,</FONT>
<BR><FONT SIZE=2>>        OUT         IB_QP_ATTR* const           pAttr,</FONT>
<BR><FONT SIZE=2>>    IN  OUT         CI_UDATA* const             pUserData,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pQp</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_QP structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_QP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pAttr</FONT>
<BR><FONT SIZE=2>>*       [out] Pointer to an IB_QP_ATTR structure to update with the QP's</FONT>
<BR><FONT SIZE=2>>*       attributes.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pUserData</FONT>
<BR><FONT SIZE=2>>*       [in] Descriptor for any data exchanged with the user-mode verb</FONT>
<BR><FONT SIZE=2>>*       provider.  The input and output buffers are shadowed by the</FONT>
<BR><FONT SIZE=2>>*       access layer in non-paged pool.  The HCA driver can only access</FONT>
<BR><FONT SIZE=2>>*       further embedded pointers from the context of this call.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The QP attributes were successfully retrieved.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PPOST_SEND</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Posts a work request to the send queue of a queue pair.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PPOST_SEND)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_QP* const                pQp,</FONT>
<BR><FONT SIZE=2>>    IN      const   IB_SEND_WR*                 pSendWr,</FONT>
<BR><FONT SIZE=2>>        OUT         IB_SEND_WR** const          ppFailedSend );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pQp</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_QP structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_QP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pSendWr</FONT>
<BR><FONT SIZE=2>>*       [in] A reference to the head of the send work request list.  The</FONT>
<BR><FONT SIZE=2>>list</FONT>
<BR><FONT SIZE=2>>*       is resident and accessible from IRQL == DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   ppFailedSend</FONT>
<BR><FONT SIZE=2>>*       [out] If the post send operation failed, this references the work</FONT>
<BR><FONT SIZE=2>>*       request in the pSendWr list where the first failure occurred.</FONT>
<BR><FONT SIZE=2>>*       This parameter may be NULL only if a single work request is being</FONT>
<BR><FONT SIZE=2>>*       posted to the QP.  The pointer is resident and accessible from</FONT>
<BR><FONT SIZE=2>>*       IRQL == DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       All work requests were successfully posted.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_INVALID_PARAMETER</FONT>
<BR><FONT SIZE=2>>*       A reference to the send work request list was not provided.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_IB_INSUFFICIENT_WR</FONT>
<BR><FONT SIZE=2>>*       The number of posted work requests exceed the current depth</FONT>
<BR><FONT SIZE=2>>available</FONT>
<BR><FONT SIZE=2>>*       on the send queue.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_IB_INSUFFICIENT_SGE</FONT>
<BR><FONT SIZE=2>>*       The number of scatter-gather entries referenced by the work request</FONT>
<BR><FONT SIZE=2>>*       exceeded the send queue configuration.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_IB_INVALID_WR_TYPE</FONT>
<BR><FONT SIZE=2>>*       The work request type was invalid.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_IB_INVALID_STATE</FONT>
<BR><FONT SIZE=2>>*       The current queue pair state does not allow posting sends.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_INVALID_OPERATION</FONT>
<BR><FONT SIZE=2>>*       The requested operation is not supported by the queue pair.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*****/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PPOST_RECV</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Posts a work request to the receive queue of a queue pair.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PPOST_RECV)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_QP* const                pQp,</FONT>
<BR><FONT SIZE=2>>    IN      const   IB_RECV_WR*                 pRecvWr,</FONT>
<BR><FONT SIZE=2>>    IN              IB_RECV_WR** const          ppFailedRecv );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pQp</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_QP structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_QP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pRecvWr</FONT>
<BR><FONT SIZE=2>>*       [in] A reference to the head of the work request list.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   ppFailedRecv</FONT>
<BR><FONT SIZE=2>>*       [out] If the post receive operation failed, this references the</FONT>
<BR><FONT SIZE=2>>work</FONT>
<BR><FONT SIZE=2>>*       request in the pRecvWr list where the first failure occurred.</FONT>
<BR><FONT SIZE=2>>*       This parameter may be NULL only if a single work request is being</FONT>
<BR><FONT SIZE=2>>*       posted to the QP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       All work requests were successfully posted.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_INVALID_PARAMETER</FONT>
<BR><FONT SIZE=2>>*       A reference to the send work request list was not provided.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_IB_INSUFFICIENT_WR</FONT>
<BR><FONT SIZE=2>>*       The number of posted work requests exceed the current depth</FONT>
<BR><FONT SIZE=2>>available</FONT>
<BR><FONT SIZE=2>>*       on the send queue.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_IB_INSUFFICIENT_SGE</FONT>
<BR><FONT SIZE=2>>*       The number of scatter-gather entries referenced by the work request</FONT>
<BR><FONT SIZE=2>>*       exceeded the send queue configuration.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_IB_INVALID_WR_TYPE</FONT>
<BR><FONT SIZE=2>>*       The work request type was invalid.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_IB_INVALID_STATE</FONT>
<BR><FONT SIZE=2>>*       The current queue pair state does not allow posting sends.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_INVALID_OPERATION</FONT>
<BR><FONT SIZE=2>>*       The requested operation is not supported by the queue pair.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*****/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PGET_QP_ASYNC_EVENT</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Queue a request for asynchronous event notification.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PGET_QP_ASYNC_EVENT)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_QP* const                pQp,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pQp</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_QP structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_QP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The QP experienced an asynchronous event.  The IoStatus.Information</FONT>
<BR><FONT SIZE=2>>*       field of the IRP is updated with the IB_ASYNC_EVENT code.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP upon the next completion event, at which</FONT>
<BR><FONT SIZE=2>>point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       and the IB_ASYNC_EVENT code is returned in the IoStatus.Information</FONT>
<BR><FONT SIZE=2>>*       fields of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must set a cancel routine to allow clients to cancel</FONT>
<BR><FONT SIZE=2>>*   the notification request.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   A client can queue up mutiple requests for notification.  Only one</FONT>
<BR><FONT SIZE=2>>*   request is completed per event.  All such requests are completed with</FONT>
<BR><FONT SIZE=2>>*   STATUS_CANCELLED if the IB_QP instance is destroyed.</FONT>
<BR><FONT SIZE=2>>*********/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#pragma warning(disable:4201)</FONT>
<BR><FONT SIZE=2>>typedef struct _IB_MR</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_PD           *pPd;</FONT>
<BR><FONT SIZE=2>>    UINT8* __ptr64  pLocalStart;</FONT>
<BR><FONT SIZE=2>>    UINT8* __ptr64  pLocalEnd;</FONT>
<BR><FONT SIZE=2>>    UINT8* __ptr64  pRemoteStart;</FONT>
<BR><FONT SIZE=2>>    UINT8* __ptr64  pRemoteEnd;</FONT>
<BR><FONT SIZE=2>>    ULONG           AccessMask;</FONT>
<BR><FONT SIZE=2>>    UINT32          LKey;</FONT>
<BR><FONT SIZE=2>>    UINT32          RKey;</FONT>
<BR><FONT SIZE=2>>    union _u</FONT>
<BR><FONT SIZE=2>>    {</FONT>
<BR><FONT SIZE=2>>        /** For virtual registrations */</FONT>
<BR><FONT SIZE=2>>        MDL                 *pMdlList;</FONT>
<BR><FONT SIZE=2>>        /** For non-virtual registrations */</FONT>
<BR><FONT SIZE=2>>        PHYSICAL_ADDRESS    IoVa;</FONT>
<BR><FONT SIZE=2>>    };</FONT>
<BR><FONT SIZE=2>>    LONG volatile   nRef;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_MR;</FONT>
<BR><FONT SIZE=2>>#pragma warning(default:4201)</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PREG_MDL</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Registers a virtual memory region with a channel adapter.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PREG_MDL)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_PD* const                pPd,</FONT>
<BR><FONT SIZE=2>>    IN              MDL* const                  pMdlList,</FONT>
<BR><FONT SIZE=2>>    IN      const   ULONG                       AccessMask,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pPd</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_PD structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_PD.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pMdlList</FONT>
<BR><FONT SIZE=2>>*       [in] A list of virtually contiguous MDLs describing the memory</FONT>
<BR><FONT SIZE=2>>*       region.  The MDL page tables are populated and the memory</FONT>
<BR><FONT SIZE=2>>referenced</FONT>
<BR><FONT SIZE=2>>*       properly pinned.  The only partial pages referenced by the MDLs</FONT>
<BR><FONT SIZE=2>>*       are the first page of the first MDL in the list and last page of</FONT>
<BR><FONT SIZE=2>>*       the last MDL in the list.  All other pages are full pages.  The</FONT>
<BR><FONT SIZE=2>>page</FONT>
<BR><FONT SIZE=2>>*       addresses are CPU addresses, and should be properly mapped for DMA</FONT>
<BR><FONT SIZE=2>>*       access by the HCA driver.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   AccessMask</FONT>
<BR><FONT SIZE=2>>*       [in] The local access rights requested forthis registered memory</FONT>
<BR><FONT SIZE=2>>*       region.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The memory region was successfully registered.  The IB_MR structure</FONT>
<BR><FONT SIZE=2>>*       is returned in the IoStatus.Information field of the IRP.  The</FONT>
<BR><FONT SIZE=2>>IB_MR</FONT>
<BR><FONT SIZE=2>>*       structure contains the actual attributes of the MR.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field and the IB_MR structure in the IoStatus.Information field of</FONT>
<BR><FONT SIZE=2>>*       the IRP.  The IB_MR structure contains the actual MR attributes.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*****/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PREG_SCATTER_GATHER</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Registers a virtual memory region with a channel adapter.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PREG_SCATTER_GATHER)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_PD* const                pPd,</FONT>
<BR><FONT SIZE=2>>    IN              SCATTER_GATHER_LIST*        pScatterGather,</FONT>
<BR><FONT SIZE=2>>    IN      const   ULONG                       AccessMask,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pPd</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_PD structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_PD.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pScatterGather</FONT>
<BR><FONT SIZE=2>>*       [in] Scatter/gather list to register.  Only the first and last</FONT>
<BR><FONT SIZE=2>>*       elements in the list can reference partial pages.  All other</FONT>
<BR><FONT SIZE=2>>elements</FONT>
<BR><FONT SIZE=2>>*       must reference an intergral number of pages.  If the list has more</FONT>
<BR><FONT SIZE=2>>*       than one element, the first and last elements in the list must end</FONT>
<BR><FONT SIZE=2>>*       and start on a page boundary, respectively.  The physical addresses</FONT>
<BR><FONT SIZE=2>>*       referenced by the scatter/gather list are bus-relative addresses</FONT>
<BR><FONT SIZE=2>>and</FONT>
<BR><FONT SIZE=2>>*       have already been properly mapped for DMA access.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   AccessMask</FONT>
<BR><FONT SIZE=2>>*       [in] The local access rights requested forthis registered memory</FONT>
<BR><FONT SIZE=2>>*       region.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The memory region was successfully registered.  The IB_MR structure</FONT>
<BR><FONT SIZE=2>>*       is returned in the IoStatus.Information field of the IRP.  The</FONT>
<BR><FONT SIZE=2>>IB_MR</FONT>
<BR><FONT SIZE=2>>*       structure contains the actual attributes of the MR.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field and the IB_MR structure in the IoStatus.Information field of</FONT>
<BR><FONT SIZE=2>>*       the IRP.  The IB_MR structure contains the actual MR attributes.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   The I/O virtual address for the first element's lower bound is zero.</FONT>
<BR><FONT SIZE=2>>*   Clients are responsible for any offset within the region.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*****/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PGET_DMA_MR</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Get a memory region representing all of physical memory.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PGET_DMA_MR)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_PD* const                pPd,</FONT>
<BR><FONT SIZE=2>>    IN      const   ULONG                       AccessMask,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pPd</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_PD structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_PD.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   AccessMask</FONT>
<BR><FONT SIZE=2>>*       [in] The local access rights requested forthis registered memory</FONT>
<BR><FONT SIZE=2>>*       region.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The memory region was successfully registered.  The IB_MR structure</FONT>
<BR><FONT SIZE=2>>*       is returned in the IoStatus.Information field of the IRP.  The</FONT>
<BR><FONT SIZE=2>>IB_MR</FONT>
<BR><FONT SIZE=2>>*       structure contains the actual attributes of the MR.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field and the IB_MR structure in the IoStatus.Information field of</FONT>
<BR><FONT SIZE=2>>*       the IRP.  The IB_MR structure contains the actual MR attributes.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*****/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PDEREG_MR</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Deregister (MDL/SGL) or release (DMA) a memory region.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PDEREG_MR)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_MR* const                pMr,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pPd</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_MR structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PREG_MDL, PREG_SCATTER_GATHER, or PGET_DMA_MR.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The MR was successfully deregistered.  No futher operations can be</FONT>
<BR><FONT SIZE=2>>*       performed using the MR.  The MDL list associated with the MR is</FONT>
<BR><FONT SIZE=2>>*       returned in the IoStatus.Information field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   There are no other status codes</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   This function cannot fail.  If a resource is in use, the IRP will not</FONT>
<BR><FONT SIZE=2>>*   complete until all references to the resource have been released.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*****/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef struct _IB_MW</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    IB_PD           *pPd;</FONT>
<BR><FONT SIZE=2>>    UINT32          RKey;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_MW;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PCREATE_MW</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Get a memory region representing all of physical memory.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PCREATE_MW)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_PD* const                pPd,</FONT>
<BR><FONT SIZE=2>>    IN  OUT         CI_UDATA* const             pUserData,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pPd</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_PD structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_PD.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pUserData</FONT>
<BR><FONT SIZE=2>>*       [in] Descriptor for any data exchanged with the user-mode verb</FONT>
<BR><FONT SIZE=2>>*       provider.  The input and output buffers are shadowed by the</FONT>
<BR><FONT SIZE=2>>*       access layer in non-paged pool.  The HCA driver can only access</FONT>
<BR><FONT SIZE=2>>*       further embedded pointers from the context of this call.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The memory window was successfully created.  The IB_MW structure</FONT>
<BR><FONT SIZE=2>>*       is returned in the IoStatus.Information field of the IRP.  The</FONT>
<BR><FONT SIZE=2>>IB_MW</FONT>
<BR><FONT SIZE=2>>*       structure contains the unbound RKey value for the memory window.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field and the IB_MW structure in the IoStatus.Information field of</FONT>
<BR><FONT SIZE=2>>*       the IRP.  The IB_MW structure contains the unbound RKey value.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_FILE_FORCED_CLOSED</FONT>
<BR><FONT SIZE=2>>*       The CA is no longer functional.  The IRP will be completed with</FONT>
<BR><FONT SIZE=2>>*       failure status.  The client must release all resources and close</FONT>
<BR><FONT SIZE=2>>*       the CA as soon as possible.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   Other status codes</FONT>
<BR><FONT SIZE=2>>*       An error occurred.  The IRP will be completed with failure status.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*****/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PDESTROY_MW</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Get a memory region representing all of physical memory.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PDESTROY_MW)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_MR* const                pMr,</FONT>
<BR><FONT SIZE=2>>    IN              IRP* const                  pIrp );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pPd</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_PD structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_PD.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pIrp</FONT>
<BR><FONT SIZE=2>>*       [in] IRP that will be completed when the request completes.</FONT>
<BR><FONT SIZE=2>>*       The IRP major and minor functions as well as the I/O stack must</FONT>
<BR><FONT SIZE=2>>*       be preserved when the IRP is completed.  The Irp.RequestorMode</FONT>
<BR><FONT SIZE=2>>*       can be used to distinguish kernel and user clients.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       The MR was successfully deregistered.  No futher operations can be</FONT>
<BR><FONT SIZE=2>>*       performed using the MR.  The MDL list associated with the MR is</FONT>
<BR><FONT SIZE=2>>*       returned in the IoStatus.Information field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_PENDING</FONT>
<BR><FONT SIZE=2>>*       The operation could not be completed immediately.  The HCA driver</FONT>
<BR><FONT SIZE=2>>*       will complete the IRP when the operation completes, at which point</FONT>
<BR><FONT SIZE=2>>*       the status of the operation will be returned in the IoStatus.Status</FONT>
<BR><FONT SIZE=2>>*       field of the IRP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   There are no other status codes</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   This function cannot fail.  If a resource is in use, the IRP will not</FONT>
<BR><FONT SIZE=2>>*   complete until all references to the resource have been released.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   The HCA driver must call IoCallDriver for the input IRP so that it</FONT>
<BR><FONT SIZE=2>>*   can call I/O complete request.  The target of IoCallDriver must be</FONT>
<BR><FONT SIZE=2>>*   the FDO of the HCA since the IRP will have only a single I/O stack</FONT>
<BR><FONT SIZE=2>>*   location for the HCA to use.  This implies that the IRP cannot be</FONT>
<BR><FONT SIZE=2>>*   passed down a chain of layered drivers.</FONT>
<BR><FONT SIZE=2>>*****/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/****f* Verbs/PBIND_MW</FONT>
<BR><FONT SIZE=2>>* DESCRIPTION</FONT>
<BR><FONT SIZE=2>>*   Binds a memory window.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* SYNOPSIS</FONT>
<BR><FONT SIZE=2>>*/</FONT>
<BR><FONT SIZE=2>>typedef NTSTATUS</FONT>
<BR><FONT SIZE=2>>(*PBIND_MW)(</FONT>
<BR><FONT SIZE=2>>    IN              IB_QP* const                pQp,</FONT>
<BR><FONT SIZE=2>>    IN              IB_MW* const                pMw,</FONT>
<BR><FONT SIZE=2>>    IN      const   IB_BIND_WR* const           pBindWr );</FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>>* PARAMETERS</FONT>
<BR><FONT SIZE=2>>*   pQp</FONT>
<BR><FONT SIZE=2>>*       [in] Pointer to an IB_QP structure previously created by a call to</FONT>
<BR><FONT SIZE=2>>*       PCREATE_QP.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   pSendWr</FONT>
<BR><FONT SIZE=2>>*       [in] A reference to the head of the send work request list.  The</FONT>
<BR><FONT SIZE=2>>list</FONT>
<BR><FONT SIZE=2>>*       is resident and accessible from IRQL == DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   ppFailedSend</FONT>
<BR><FONT SIZE=2>>*       [out] If the post send operation failed, this references the work</FONT>
<BR><FONT SIZE=2>>*       request in the pSendWr list where the first failure occurred.</FONT>
<BR><FONT SIZE=2>>*       This parameter may be NULL only if a single work request is being</FONT>
<BR><FONT SIZE=2>>*       posted to the QP.  The pointer is resident and accessible from</FONT>
<BR><FONT SIZE=2>>*       IRQL == DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* RETURN VALUES</FONT>
<BR><FONT SIZE=2>>*   STATUS_SUCCESS</FONT>
<BR><FONT SIZE=2>>*       All work requests were successfully posted.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_INVALID_PARAMETER</FONT>
<BR><FONT SIZE=2>>*       A reference to the send work request list was not provided.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_IB_INSUFFICIENT_WR</FONT>
<BR><FONT SIZE=2>>*       The number of posted work requests exceed the current depth</FONT>
<BR><FONT SIZE=2>>available</FONT>
<BR><FONT SIZE=2>>*       on the send queue.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_IB_INSUFFICIENT_SGE</FONT>
<BR><FONT SIZE=2>>*       The number of scatter-gather entries referenced by the work request</FONT>
<BR><FONT SIZE=2>>*       exceeded the send queue configuration.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_IB_INVALID_WR_TYPE</FONT>
<BR><FONT SIZE=2>>*       The work request type was invalid.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_IB_INVALID_STATE</FONT>
<BR><FONT SIZE=2>>*       The current queue pair state does not allow posting sends.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>*   STATUS_INVALID_OPERATION</FONT>
<BR><FONT SIZE=2>>*       The requested operation is not supported by the queue pair.</FONT>
<BR><FONT SIZE=2>>*</FONT>
<BR><FONT SIZE=2>>* NOTES</FONT>
<BR><FONT SIZE=2>>*   This function can be invoked at IRQL <= DISPATCH_LEVEL.</FONT>
<BR><FONT SIZE=2>>*****/</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#define IB_VERBS_INTERFACE_VERSION  (1)</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>typedef struct _IB_VERBS_INTERFACE_STANDARD</FONT>
<BR><FONT SIZE=2>>{</FONT>
<BR><FONT SIZE=2>>    /** Generic interface header */</FONT>
<BR><FONT SIZE=2>>    USHORT                  Size;</FONT>
<BR><FONT SIZE=2>>    USHORT                  Version;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** The context is used in the OpenCa, QueryCa, QueryPort,</FONT>
<BR><FONT SIZE=2>>     * ModifyCa, and ModifyPort calls</FONT>
<BR><FONT SIZE=2>>     */</FONT>
<BR><FONT SIZE=2>>    PVOID                   Context;</FONT>
<BR><FONT SIZE=2>>    PINTERFACE_REFERENCE    InterfaceReference;</FONT>
<BR><FONT SIZE=2>>    PINTERFACE_DEREFERENCE  InterfaceDereference;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** HCA information */</FONT>
<BR><FONT SIZE=2>>    UINT64                  NodeGuid;</FONT>
<BR><FONT SIZE=2>>    UINT32                  VendorId;</FONT>
<BR><FONT SIZE=2>>    UINT16                  DeviceId;</FONT>
<BR><FONT SIZE=2>>    UINT16                  DeviceRev;</FONT>
<BR><FONT SIZE=2>>    UINT32                  FwVersion;</FONT>
<BR><FONT SIZE=2>>    CHAR                    UvpName[32];</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** HCA Management */</FONT>
<BR><FONT SIZE=2>>    POPEN_CA                OpenCa;</FONT>
<BR><FONT SIZE=2>>    PCLOSE_CA               CloseCa;</FONT>
<BR><FONT SIZE=2>>    PGET_CA_FATAL_EVENT     GetCaFatalEvent;</FONT>
<BR><FONT SIZE=2>>    PGET_CA_PORT_EVENT      GetCaPortEvent;</FONT>
<BR><FONT SIZE=2>>    PQUERY_CA               QueryCa;</FONT>
<BR><FONT SIZE=2>>    PQUERY_PORT             QueryPort;</FONT>
<BR><FONT SIZE=2>>    PMODIFY_CA              ModifyCa;</FONT>
<BR><FONT SIZE=2>>    PMODIFY_PORT            ModifyPort;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** CQ Management */</FONT>
<BR><FONT SIZE=2>>    PCREATE_CQ              CreateCq;</FONT>
<BR><FONT SIZE=2>>    PDESTROY_CQ             DestroyCq;</FONT>
<BR><FONT SIZE=2>>    PRESIZE_CQ              ResizeCq;</FONT>
<BR><FONT SIZE=2>>    PREARM_CQ               RearmCq;</FONT>
<BR><FONT SIZE=2>>    PREARM_N_CQ             RearmNCq;</FONT>
<BR><FONT SIZE=2>>    PPOLL_CQ                PollCq;</FONT>
<BR><FONT SIZE=2>>    PPEEK_CQ                PeekCq;</FONT>
<BR><FONT SIZE=2>>    PGET_CQ_COMP_EVENT      GetCqCompEvent;</FONT>
<BR><FONT SIZE=2>>    PGET_CQ_ASYNC_EVENT     GetCqAsyncEvent;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** Protection Domain Management */</FONT>
<BR><FONT SIZE=2>>    PCREATE_PD              CreatePd;</FONT>
<BR><FONT SIZE=2>>    PDESTROY_PD             DestroyPd;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** Address Handle Management. */</FONT>
<BR><FONT SIZE=2>>    PCREATE_AH              CreateAh;</FONT>
<BR><FONT SIZE=2>>    PDESTROY_AH             DestroyAh;</FONT>
<BR><FONT SIZE=2>>    PMODIFY_AH              ModifyAh;</FONT>
<BR><FONT SIZE=2>>    PQUERY_AH               QueryAh;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** Shared Receive Queue Management */</FONT>
<BR><FONT SIZE=2>>    //IbCreateSrq           CreateSrq;</FONT>
<BR><FONT SIZE=2>>    //IbDestroySrq          DestroySrq;</FONT>
<BR><FONT SIZE=2>>    //IbPostSrqRecv         PostSrqRecv;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** Queue Pair Management */</FONT>
<BR><FONT SIZE=2>>    PCREATE_QP              CreateQp;</FONT>
<BR><FONT SIZE=2>>    PCREATE_SPECIAL_QP      CreateSpecialQp;</FONT>
<BR><FONT SIZE=2>>    PDESTROY_QP             DestroyQp;</FONT>
<BR><FONT SIZE=2>>    PMODIFY_QP              ModifyQp;</FONT>
<BR><FONT SIZE=2>>    PQUERY_QP               QueryQp;</FONT>
<BR><FONT SIZE=2>>    PPOST_SEND              PostSend;</FONT>
<BR><FONT SIZE=2>>    PPOST_RECV              PostRecv;</FONT>
<BR><FONT SIZE=2>>    PGET_QP_ASYNC_EVENT     GetQpAsyncEvent;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** Memory Region Management */</FONT>
<BR><FONT SIZE=2>>    PREG_MDL                RegMdl;</FONT>
<BR><FONT SIZE=2>>    PREG_SCATTER_GATHER     RegScatterGather;</FONT>
<BR><FONT SIZE=2>>    PGET_DMA_MR             GetDmaMr;</FONT>
<BR><FONT SIZE=2>>    PDEREG_MR               DeregMr;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>    /** Memory Window Management */</FONT>
<BR><FONT SIZE=2>>    PCREATE_MW              CreateMw;</FONT>
<BR><FONT SIZE=2>>    PDESTROY_MW             DestroyMw;</FONT>
<BR><FONT SIZE=2>>    PBIND_MW                BindMw;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>}   IB_VERBS_INTERFACE_STANDARD;</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>#endif _IBVERBS_</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>>/*</FONT>
<BR><FONT SIZE=2>> * CI interface GUID.  The GUID is defined outside the conditional include</FONT>
<BR><FONT SIZE=2>> * on purpose so that it can be instantiated only once where it is actually</FONT>
<BR><FONT SIZE=2>> * needed.  See the DDK docs section "Using GUIDs in Drivers" for more</FONT>
<BR><FONT SIZE=2>>info.</FONT>
<BR><FONT SIZE=2>> *</FONT>
<BR><FONT SIZE=2>> * {B721E2B0-AF62-4320-A6AF-92F71F78789F}</FONT>
<BR><FONT SIZE=2>> */</FONT>
<BR><FONT SIZE=2>>DEFINE_GUID(GUID_IB_VERBS_INTERFACE,</FONT>
<BR><FONT SIZE=2>>0xb721e2b0, 0xaf62, 0x4320, 0xa6, 0xaf, 0x92, 0xf7, 0x1f, 0x78, 0x78,</FONT>
<BR><FONT SIZE=2>>0x9f);</FONT>
</P>

</BODY>
</HTML>