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

vipnsinit.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 
00043 VIP_ENTRY_POINT VIP_RETURN
00044 VipNSInit (VIP_NIC_HANDLE NicHandle, VIP_PVOID NSInitInfo)
00045 {
00046   VIP_NIC *vip_nic_ptr;
00047   VIP_DEBUG_LABEL (("VipNSInit"));
00048 
00049 
00050   /* check NSInitInfo */
00051   if (NSInitInfo != NULL)
00052     {
00053       VIP_DEBUG (("Invalid NSInitInfo (should be NULL)"));
00054       return VIP_INVALID_PARAMETER;
00055     }
00056 
00057   /* check nic handle */
00058   vip_nic_ptr = (VIP_NIC *) NicHandle;
00059   if (VIP_INVALID_NIC_HANDLE (vip_nic_ptr))
00060     {
00061       VIP_DEBUG (("Invalid NIC handle"));
00062       return VIP_INVALID_PARAMETER;
00063     }
00064   VIP_MUTEX_LOCK (&(vip_nic_ptr->lock));
00065 
00066   /* check if the name service was alreadyinitialized */
00067   if (vip_nic_ptr->ns_initialized == VIP_TRUE)
00068     {
00069       VIP_DEBUG (("Name service was previously initialized"));
00070       VIP_MUTEX_UNLOCK (&(vip_nic_ptr->lock));
00071       return VIP_ERROR_NAMESERVICE;
00072     }
00073 
00074   vip_nic_ptr->ns_initialized = VIP_TRUE;
00075   VIP_DEBUG (("Success"));
00076   VIP_MUTEX_UNLOCK (&(vip_nic_ptr->lock));
00077   return VIP_SUCCESS;
00078 }
VI-GM-1.3 by Myricom © 1997-2006. Documentation generated on 20 May 2006 by doxygen 1.4.4.