Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

vipqueryvi.c

Go to the documentation of this file.
00001 /********************************************************
00002  * Myricom VI-GM  networking software and documentation *
00003  * Copyright (c) 2001 by Myricom, Inc.                  *
00004  * All rights reserved.                                 *
00005  * See the file `COPYING' for copyright notice.         *
00006  ********************************************************/
00007 
00013 #include "vipl_priv.h"
00014 
00015 
00039 VIP_ENTRY_POINT VIP_RETURN
00040 VipQueryVi (VIP_VI_HANDLE ViHandle,
00041             VIP_VI_STATE * State,
00042             VIP_VI_ATTRIBUTES * ViAttribs,
00043             VIP_BOOLEAN * ViSendQEmpty, VIP_BOOLEAN * ViRecvQEmpty)
00044 {
00045   VIP_VI *vip_vi_ptr;
00046   VIP_DEBUG_LABEL (("VipQueryVi"));
00047 
00048   if (State == NULL)
00049     {
00050       VIP_DEBUG (("State is NULL"));
00051       return VIP_INVALID_PARAMETER;
00052     }
00053 
00054   if (ViAttribs == NULL)
00055     {
00056       VIP_DEBUG (("ViAttribs is NULL"));
00057       return VIP_INVALID_PARAMETER;
00058     }
00059 
00060   if (ViSendQEmpty == NULL)
00061     {
00062       VIP_DEBUG (("ViSendQEmpty is NULL"));
00063       return VIP_INVALID_PARAMETER;
00064     }
00065 
00066   if (ViRecvQEmpty == NULL)
00067     {
00068       VIP_DEBUG (("ViRecvQEmpty is NULL"));
00069       return VIP_INVALID_PARAMETER;
00070     }
00071 
00072   /* check vi handle */
00073   vip_vi_ptr = (VIP_VI *) ViHandle;
00074   if (VIP_INVALID_VI_HANDLE (vip_vi_ptr))
00075     {
00076       VIP_DEBUG (("Invalid NIC handle"));
00077       return VIP_INVALID_PARAMETER;
00078     }
00079   VIP_MUTEX_LOCK (&(vip_vi_ptr->handle.vip_nic_ptr->lock));
00080 
00081   *State = vip_vi_ptr->state;
00082   ViAttribs->ReliabilityLevel = vip_vi_ptr->reliability;
00083   ViAttribs->MaxTransferSize = vip_vi_ptr->mtu;
00084   ViAttribs->QoS = vip_vi_ptr->qos;
00085   ViAttribs->Ptag = vip_vi_ptr->vip_ptag_ptr;
00086   ViAttribs->EnableRdmaWrite = vip_vi_ptr->rdma_write;
00087   ViAttribs->EnableRdmaRead = VI_GM_ENABLE_RDMAREAD;
00088 
00089   if (vip_vi_ptr->send_queue.total_count == 0)
00090     {
00091       *ViSendQEmpty = VIP_TRUE;
00092     }
00093   else
00094     {
00095       *ViSendQEmpty = VIP_FALSE;
00096     }
00097 
00098   if (vip_vi_ptr->recv_queue.total_count == 0)
00099     {
00100       *ViRecvQEmpty = VIP_TRUE;
00101     }
00102   else
00103     {
00104       *ViRecvQEmpty = VIP_FALSE;
00105     }
00106 
00107   VIP_DEBUG (("Success"));
00108   VIP_MUTEX_UNLOCK (&(vip_vi_ptr->handle.vip_nic_ptr->lock));
00109   return VIP_SUCCESS;
00110 }
VI-GM-1.3 by Myricom © 1997-2006. Documentation generated on 20 May 2006 by doxygen 1.4.4.