Example #1
0
/****************************************************************************
 * Name          : glnd_lib_req
 *
 * Description   : This is the NCS SE API which is used to init/destroy or 
 *                 Create/destroy PWE's. This will be called by SBOM.
 *
 * Arguments     : req_info  - This is the pointer to the input information 
 *                             which SBOM gives.  
 *
 * Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE..
 *
 * Notes         : None.
 *****************************************************************************/
uint32_t glnd_lib_req(NCS_LIB_REQ_INFO *req_info)
{
	uint32_t res = NCSCC_RC_FAILURE;
	TRACE_ENTER();
	
	switch (req_info->i_op) {
	case NCS_LIB_REQ_CREATE:
		if( (res = glnd_se_lib_create(NCS_HM_POOL_ID_COMMON))!= NCSCC_RC_SUCCESS )
			TRACE_2("GLND se lib create failed");	
		break;
	case NCS_LIB_REQ_DESTROY:
		if( (res = glnd_se_lib_destroy()) != NCSCC_RC_SUCCESS )
			TRACE_2("GLND se lib destroy failed");
		break;
	default:
		break;
	}
	TRACE_LEAVE2("%s return value %u", (res == NCSCC_RC_SUCCESS)?"SUCCESS":"FAILURE", res);
	return (res);
}
Example #2
0
/*******************************************************************************************
 * Name                   : cpd_a2s_ckpt_dest_down
 * 
 * Description            : Function to delete the destination of the already existing 
 *                          checkpoint
 *
 * Arguments              : CPD_CKPT_INFO_NODE - CPD Checkpoint info node
 *
 * Return Values          : None , Error message is logged
 *
********************************************************************************************/
void cpd_a2s_ckpt_dest_down(CPD_CB *cb, CPD_CKPT_INFO_NODE *ckpt_node, MDS_DEST *dest)
{
	CPD_MBCSV_MSG cpd_msg;
	uint32_t rc = SA_AIS_OK;

	TRACE_ENTER();
	memset(&cpd_msg, '\0', sizeof(CPD_MBCSV_MSG));
	cpd_msg.type = CPD_A2S_MSG_CKPT_DEST_DOWN;
	cpd_msg.info.dest_down.ckpt_id = ckpt_node->ckpt_id;
	cpd_msg.info.dest_down.mds_dest = *dest;

	TRACE("CPND 1 IS IN RESTART NOW ");

	rc = cpd_mbcsv_async_update(cb, &cpd_msg);
	if (rc != SA_AIS_OK)
		TRACE_4("cpd A2S ckpt async update failed for ckptid:%llx,dest: %"PRIu64,cpd_msg.info.dest_down.ckpt_id, *dest);
	else
		TRACE_1("cpd A2S ckpt async update del success for ckptid:%llx,dest:%"PRIu64,cpd_msg.info.dest_down.ckpt_id, *dest);
	TRACE_LEAVE();
}
static void
Permedia2SubsequentHorVertLine(ScrnInfoPtr pScrn,int x,int y,int len,int dir)
{
    GLINTPtr pGlint = GLINTPTR(pScrn);
    
    TRACE_ENTER("Permedia2SubsequentHorVertLine");
    GLINT_WAIT(6);
    GLINT_WRITE_REG(x<<16, StartXDom);
    GLINT_WRITE_REG(y<<16, StartY);
    if (dir == DEGREES_0) {
	GLINT_WRITE_REG(1<<16, dXDom);
	GLINT_WRITE_REG(0<<16, dY);
    } else {
	GLINT_WRITE_REG(0<<16, dXDom);
	GLINT_WRITE_REG(1<<16, dY);
    }

    GLINT_WRITE_REG(len, GLINTCount);
    GLINT_WRITE_REG(PrimitiveLine, Render);
}
Example #4
0
/**
 *   response to the lib on a saNtfNotificationSend request 
 *   @param error    error code sent back to the client
 *   @param notificationId
 *   @param mdsCtxt
 *   @param frDest
 *
 */
void notfication_result_lib(SaAisErrorT error,
			    SaNtfIdentifierT notificationId, MDS_SYNC_SND_CTXT *mdsCtxt, MDS_DEST frDest)
{
	uns32 rc;
	ntfsv_msg_t msg;
	TRACE_ENTER();

	msg.type = NTFSV_NTFA_API_RESP_MSG;
	msg.info.api_resp_info.type = NTFSV_SEND_NOT_RSP;
	msg.info.api_resp_info.rc = error;
	msg.info.api_resp_info.param.send_not_rsp.notificationId = notificationId;
	TRACE_4("not_id: %llu, rv: %u", notificationId, error);
	rc = ntfs_mds_msg_send(ntfs_cb, &msg, &frDest, mdsCtxt, MDS_SEND_PRIORITY_HIGH);

	if (rc != NCSCC_RC_SUCCESS) {
		TRACE("ntfs_mds_msg_send FAILED");
		/* TODO: what to do exit here? */
	}
	TRACE_LEAVE();
};
void saImmOmAdminOperationContinueAsync_01(void)
{
    TRACE_ENTER();
    const SaNameT objectName = {strlen("opensafImm=opensafImm,safApp=safImmService"), "opensafImm=opensafImm,safApp=safImmService"};
    const SaImmAdminOwnerNameT adminOwnerName = (SaImmAdminOwnerNameT) __FUNCTION__;
    SaImmAdminOwnerHandleT ownerHandle;
    SaInvocationT invocation=999;
    SaImmContinuationIdT continuationId = 666;
    safassert(saImmOmInitialize(&immOmHandle, &immOmCallbacks, &immVersion), SA_AIS_OK);
    safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName, SA_TRUE, &ownerHandle), SA_AIS_OK);
    test_validate(saImmOmAdminOperationContinueAsync(
                                                     ownerHandle,
                                                     invocation,
                                                     &objectName,
                                                     continuationId), 
        SA_AIS_ERR_NOT_SUPPORTED);
    safassert(saImmOmAdminOwnerFinalize(ownerHandle), SA_AIS_OK);
    safassert(saImmOmFinalize(immOmHandle), SA_AIS_OK);
    TRACE_LEAVE();
}
Example #6
0
/**
 *   Response to the lib on a saNtfNotificationReadInitialize
 *   request
 *  
 *   @param error     error code sent back to the library
 *   @param readerId  out parameter, unique id for the new reader
 *                    set by admin to identify a reader.
 */
void new_reader_res_lib(SaAisErrorT error, unsigned int readerId, MDS_DEST mdsDest, MDS_SYNC_SND_CTXT *mdsCtxt)
{
	uns32 rc = NCSCC_RC_SUCCESS;
	ntfsv_msg_t msg;
	TRACE_ENTER();

	msg.type = NTFSV_NTFA_API_RESP_MSG;
	msg.info.api_resp_info.type = NTFSV_READER_INITIALIZE_RSP;
	msg.info.api_resp_info.rc = error;
	msg.info.api_resp_info.param.reader_init_rsp.readerId = readerId;
	TRACE_4("readerId: %u, rv: %u", readerId, error);

	rc = ntfs_mds_msg_send(ntfs_cb, &msg, &mdsDest, mdsCtxt, MDS_SEND_PRIORITY_HIGH);
	if (rc != NCSCC_RC_SUCCESS) {
		TRACE("ntfs_mds_msg_send FAILED");
		/* TODO: what to do exit here? */
	}

/* TODO: async update*/
};
Example #7
0
/******************************************************************************************************************
 * Name                   :glsv_gld_mbcsv_chgrole 
 *
 * Description            : To assign  role for a component

 * Arguments              : GLSV_GLD_CB - cb pointer
 *
 * Return Values          : Success / Error
 *
 * Notes                  : This API is use for setting the role. Role Standby - initiate Cold Sync Request if it finds Active
                            Role Active - send ckpt data to multiple standby peers
 *********************************************************************************************************************/
uint32_t glsv_gld_mbcsv_chgrole(GLSV_GLD_CB *gld_cb)
{
	NCS_MBCSV_ARG arg;
	uint32_t rc = NCSCC_RC_SUCCESS;
	TRACE_ENTER();
	memset(&arg, '\0', sizeof(NCS_MBCSV_ARG));

	arg.i_op = NCS_MBCSV_OP_CHG_ROLE;
	arg.i_mbcsv_hdl = gld_cb->mbcsv_handle;
	arg.info.chg_role.i_ckpt_hdl = gld_cb->o_ckpt_hdl;
	arg.info.chg_role.i_ha_state = gld_cb->ha_state;	/*  ha_state is assigned at the time of amf_init where csi_set_callback will assign the state */

	LOG_IN("Setting the state HaState as :%d", gld_cb->ha_state);
	if (ncs_mbcsv_svc(&arg) != SA_AIS_OK) {
		LOG_ER("GLD mbcsv chgrole failed");
		rc = NCSCC_RC_FAILURE;
	}
 	TRACE_LEAVE();
	return rc;
}
Example #8
0
/**
 *   Response to the lib after saNtfNotificationUnsubscribe request
 *
 *   @param error    error code sent back to the library
 *   @param subId    Subscribtion id for the canceled subscription
 */
void unsubscribe_res_lib(SaAisErrorT error, SaNtfSubscriptionIdT subId, MDS_DEST mdsDest, MDS_SYNC_SND_CTXT *mdsCtxt)
{
	uns32 rc = NCSCC_RC_SUCCESS;
	ntfsv_msg_t msg;
	TRACE_ENTER();

	msg.type = NTFSV_NTFA_API_RESP_MSG;
	msg.info.api_resp_info.type = NTFSV_UNSUBSCRIBE_RSP;
	msg.info.api_resp_info.rc = error;
	msg.info.api_resp_info.param.unsubscribe_rsp.subscriptionId = subId;
	TRACE_4("subscriptionId: %u, rv: %u", subId, error);

	rc = ntfs_mds_msg_send(ntfs_cb, &msg, &mdsDest, mdsCtxt, MDS_SEND_PRIORITY_HIGH);
	if (rc != NCSCC_RC_SUCCESS) {
		TRACE("ntfs_mds_msg_send FAILED");
		/* TODO: what to do exit here? */
	}

	TRACE_LEAVE();
};
Example #9
0
/****************************************************************************
  Name          : avnd_pgdb_mem_rec_rmv
 
  Description   : This routine removes a PG member record from the PG record.
 
  Arguments     : cb            - ptr to the AvND control block
                  pg            - ptr to the pg rec
                  comp_name - ptr to the comp-name
 
  Return Values : ptr to the pg member rec, if successfully removed
                  0, otherwise
 
  Notes         : This routine only pops the cooresponding member record. It
                  doesn't delete it.
******************************************************************************/
AVND_PG_MEM *avnd_pgdb_mem_rec_rmv(AVND_CB *cb, AVND_PG *pg, SaNameT *comp_name)
{
	AVND_PG_MEM *pg_mem = 0;
	TRACE_ENTER();

	/* get the pg mem record */
	pg_mem = m_AVND_PGDB_MEM_REC_GET(*pg, *comp_name);
	if (!pg_mem)
		return 0;

	/* remove from the dll */
	ncs_db_link_list_remove(&pg->mem_list, (uns8 *)comp_name);

	/* update the params that are no longer valid */
	pg_mem->info.change = SA_AMF_PROTECTION_GROUP_REMOVED;
	pg_mem->info.member.haState = 0;

	TRACE_LEAVE();
	return pg_mem;
}
Example #10
0
/****************************************************************************
 * Name          : cpnd_ckpt_sec_get_create
 *
 * Description   : Function to Find the section in a checkpoint before create.
 *
 * Arguments     : CPND_CKPT_NODE *cp_node - Check point node.
 *               : SaCkptSectionIdT id - Section Identifier
 *                 
 * Return Values :  NULL/CPND_CKPT_SECTION_INFO
 *
 * Notes         : None.
 *****************************************************************************/
CPND_CKPT_SECTION_INFO *cpnd_ckpt_sec_get_create(CPND_CKPT_NODE *cp_node, SaCkptSectionIdT *id)
{
	CPND_CKPT_SECTION_INFO *pSecPtr = NULL;
	TRACE_ENTER();
	if (cp_node->replica_info.n_secs == 0) {
		TRACE_2("cpnd replica has no sections for ckpt_id:%llx",cp_node->ckpt_id);
		TRACE_LEAVE();
		return NULL;
	}
	pSecPtr = cp_node->replica_info.section_info;
	while (pSecPtr != NULL) {
		if ((pSecPtr->sec_id.idLen == id->idLen) && (memcmp(pSecPtr->sec_id.id, id->id, id->idLen) == 0)) {
			TRACE_LEAVE();
			return pSecPtr;
		}
		pSecPtr = pSecPtr->next;
	}
	TRACE_LEAVE();
	return NULL;
}
Example #11
0
static void __exit
exit_dldwd_cs(void)
{
	TRACE_ENTER("dldwd");

	unregister_pccard_driver(&dev_info);

	if (dev_list)
		DEBUG(0, "orinoco_cs: Removing leftover devices.\n");
	while (dev_list != NULL) {
		del_timer(&dev_list->release);
		if (dev_list->state & DEV_CONFIG)
			dldwd_cs_release((u_long) dev_list);
		dldwd_cs_detach(dev_list);
	}

	TRACE_EXIT("dldwd");

	exit_dldwd();
}
Example #12
0
/****************************************************************************
 * Name          : cpd_amf_register
 *
 * Description   : CPD registers with AMF for involking process.
 *
 * Arguments     : cpd_cb  - Ifsv control block pointer.
 *
 * Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE.
 *
 * Notes         : None.
 *****************************************************************************/
uint32_t cpd_amf_register(CPD_CB *cpd_cb)
{
	SaAisErrorT error;
	TRACE_ENTER();
	/* get the component name */
	error = saAmfComponentNameGet(cpd_cb->amf_hdl, &cpd_cb->comp_name);
	if (error != SA_AIS_OK) {
		LOG_ER("cpd amf compname get failed with Error: %u",error);
		TRACE_LEAVE();
		return NCSCC_RC_FAILURE;
	}

	if (saAmfComponentRegister(cpd_cb->amf_hdl, &cpd_cb->comp_name, (SaNameT *)NULL) == SA_AIS_OK) {
		TRACE_LEAVE2("cpd amf register success for %s",cpd_cb->comp_name.value);
		return NCSCC_RC_SUCCESS;
	} else {
		TRACE_LEAVE2("cpd Amf component register failed for %s",cpd_cb->comp_name.value);
		return NCSCC_RC_FAILURE;
	}
}
Example #13
0
/*****************************************************************************
  PROCEDURE NAME : gld_process_send_non_master_status

  DESCRIPTION    : This function sends the nonmaster status to all the masters
                   corresponding to the resources opened by this node

  ARGUMENTS      :gld_cb      - ptr to the GLD control block
                  node_details
                  status

  RETURNS        :NCSCC_RC_FAILURE/NCSCC_RC_SUCCESS

  NOTES         : None
*****************************************************************************/
static uint32_t gld_process_send_non_master_status(GLSV_GLD_CB *gld_cb, GLSV_GLD_GLND_DETAILS *node_details, uint32_t status)
{
	GLSV_GLD_GLND_RSC_REF *glnd_rsc = NULL;
	GLSV_GLND_EVT glnd_evt;
	NCSMDS_INFO snd_mds;
	uint32_t res = NCSCC_RC_FAILURE;
	TRACE_ENTER();

	glnd_rsc = (GLSV_GLD_GLND_RSC_REF *)ncs_patricia_tree_getnext(&node_details->rsc_info_tree, (uint8_t *)0);
	while (glnd_rsc) {
		if (glnd_rsc->rsc_info->node_list->node_id != node_details->node_id) {
			memset(&glnd_evt, '\0', sizeof(GLSV_GLND_EVT));

			glnd_evt.type = GLSV_GLND_EVT_NON_MASTER_INFO;
			glnd_evt.info.non_master_info.dest_id = node_details->dest_id;
			glnd_evt.info.non_master_info.status = status;

			snd_mds.i_mds_hdl = gld_cb->mds_handle;
			snd_mds.i_svc_id = NCSMDS_SVC_ID_GLD;
			snd_mds.i_op = MDS_SEND;
			snd_mds.info.svc_send.i_msg = (NCSCONTEXT)&glnd_evt;
			snd_mds.info.svc_send.i_to_svc = NCSMDS_SVC_ID_GLND;
			snd_mds.info.svc_send.i_priority = MDS_SEND_PRIORITY_HIGH;
			snd_mds.info.svc_send.i_sendtype = MDS_SENDTYPE_SND;
			snd_mds.info.svc_send.info.snd.i_to_dest = glnd_rsc->rsc_info->node_list->dest_id;

			res = ncsmds_api(&snd_mds);
			if (res != NCSCC_RC_SUCCESS) {
				LOG_ER("MDS Send failed");
				goto end;
			}
		}
		glnd_rsc =
		    (GLSV_GLD_GLND_RSC_REF *)ncs_patricia_tree_getnext(&node_details->rsc_info_tree,
								       (uint8_t *)&glnd_rsc->rsc_id);
	}
 end:
	TRACE_LEAVE();
	return res;

}
Example #14
0
/************************************************************
Start the unbind of a network driver from the protocol driver
************************************************************/
VOID NDIS_API
PacketUnbindAdapter( OUT PNDIS_STATUS	Status,
                     IN  NDIS_HANDLE	ProtocolBindingContext,
                     IN  NDIS_HANDLE	UnbindContext )
{
    POPEN_INSTANCE	Open;
    NDIS_STATUS		nsCloseStatus;

    TRACE_ENTER( "UnbindAdapter" );


    Open = (POPEN_INSTANCE)ProtocolBindingContext;
    Open->BindAdapterContext = UnbindContext;
    /*clean the pending requests*/
    PacketCleanUp( Status, Open );
    Open->Status = NDIS_STATUS_PENDING;
    /*Calls NDIS to close the selected adapter*/

    NdisCloseAdapter( &nsCloseStatus, Open->AdapterHandle );
    if ( nsCloseStatus == NDIS_STATUS_PENDING )
    {
        while ( Open->Status == NDIS_STATUS_PENDING )
            YieldExecution();
    }
    else
    {
        PacketUnbindAdapterComplete( Open, nsCloseStatus );
    }
    *Status = Open->Status;
    if ( *Status == NDIS_STATUS_SUCCESS )
    {
        NdisFreeMemory( Open, sizeof( OPEN_INSTANCE ) ,  0 );
    }
    else
    {
        IF_TRACE( "Unbind Operation FAILED!" );
    }
    TRACE_LEAVE( "CloseAdapter" );

    return;
}
Example #15
0
/**
 * Thread start routine to register with AMF and start health check
 * Error handling: exits process at failure
 * @param __cb control block pointer
 */
static void* amf_init_start(void *notused)
{
	SaAisErrorT error;
	const char *health_key;
	SaAmfHealthcheckKeyT healthy;

	TRACE_ENTER();

	error = saAmfComponentRegister(immd_cb->amf_hdl, &immd_cb->comp_name, NULL);
	if (error != SA_AIS_OK) {
		LOG_ER("saAmfComponentRegister failed: %u, exiting", error);
		exit(1);
	}

	memset(&healthy, 0, sizeof(healthy));
	health_key = getenv("IMMSV_ENV_HEALTHCHECK_KEY");

	if (health_key == NULL) {
		strncpy((char *)healthy.key, "A1B2", sizeof(healthy.key));
		healthy.keyLen = (SaUint16T) strlen((char *)healthy.key);
	} else {
		healthy.keyLen = (SaUint16T) strlen((char *)health_key);
		if (healthy.keyLen < sizeof(healthy.key)) {
			strncpy((char *)healthy.key, health_key, sizeof(healthy.key));
		} else {
			LOG_ER("Health check key too long:%u, exiting", healthy.keyLen);
			exit(1);
		}
	}

	error = saAmfHealthcheckStart(immd_cb->amf_hdl, &immd_cb->comp_name,
		&healthy, SA_AMF_HEALTHCHECK_AMF_INVOKED, SA_AMF_COMPONENT_FAILOVER);

	if (error != SA_AIS_OK) {
		LOG_ER("saAmfHealthcheckStart failed: %u, exiting", error);
		exit(1);
	}

	TRACE_LEAVE();
	return NULL;
}
Example #16
0
File: Lo_send.c Project: nmap/npcap
NTSTATUS
NTAPI
WSKCloseSocket(
	IN PWSK_SOCKET WskSocket
	)
{
	KEVENT          CompletionEvent = { 0 };
	PIRP            Irp = NULL;
	NTSTATUS        Status = STATUS_UNSUCCESSFUL;

	TRACE_ENTER();

	if (g_SocketsState != INITIALIZED || !WskSocket)
	{
		TRACE_EXIT();
		return STATUS_INVALID_PARAMETER;
	}

	Status = InitWskData(&Irp, &CompletionEvent);
	if (!NT_SUCCESS(Status))
	{
		TRACE_MESSAGE1(PACKET_DEBUG_LOUD, "WSKCloseSocket()::InitWskData() failed with status 0x%08X\n", Status);
		TRACE_EXIT();
		return Status;
	}

	Status = ((PWSK_PROVIDER_BASIC_DISPATCH)WskSocket->Dispatch)->WskCloseSocket(WskSocket, Irp);
	if (Status == STATUS_PENDING)
	{
		KeWaitForSingleObject(&CompletionEvent, Executive, KernelMode, FALSE, NULL);
		Status = Irp->IoStatus.Status;
	}
	else if (Status != STATUS_SUCCESS)
	{
		TRACE_MESSAGE1(PACKET_DEBUG_LOUD, "WSKCloseSocket()::Dispatch::WskSocket() failed with status 0x%08X\n", Status);
	}

	IoFreeIrp(Irp);
	TRACE_EXIT();
	return Status;
}
Example #17
0
HRESULT CKsIrpTarget::SetPropertyMulti(
    IN  REFGUID             guidPropertySet,
    IN  ULONG               nProperty,
    OUT PKSMULTIPLE_ITEM*   ppKsMultipleItem)
{
    TRACE_ENTER();
    HRESULT hr = S_OK;
    ULONG       cbMultipleItem = 0;
    ULONG       ulReturned = 0;
    KSPROPERTY  ksProperty;

    ksProperty.Set    = guidPropertySet; 
    ksProperty.Id     = nProperty;       
    ksProperty.Flags  = KSPROPERTY_TYPE_SET;

    hr = SyncIoctl(
            m_handle,
            IOCTL_KS_PROPERTY,
            &ksProperty,
            sizeof(KSPROPERTY),
            NULL,
            0,
            &cbMultipleItem);

    if (SUCCEEDED(hr))
    {
        *ppKsMultipleItem = (PKSMULTIPLE_ITEM)LocalAlloc(LPTR, cbMultipleItem);
        
        hr = SyncIoctl (
                m_handle,
                IOCTL_KS_PROPERTY,
                &ksProperty,
                sizeof(KSPROPERTY),
                (PVOID)*ppKsMultipleItem,
                cbMultipleItem,
                &ulReturned);
    }

    TRACE_LEAVE_HRESULT(hr);
    return hr;
}
void
File_impl::setFilePointer (CORBA::ULong _filePointer)
throw (CORBA::SystemException, CF::File::InvalidFilePointer,
       CF::FileException)
{
    TRACE_ENTER(File_impl)
    boost::mutex::scoped_lock lock(interfaceAccess);

    if (_filePointer > this->_local_sizeOf ()) {
        LOG_ERROR(File_impl, "File pointer set beyond EOF")
        throw CF::File::InvalidFilePointer ();
    }

    int fsOpSuccessAttempts = 0;
    bool fsOpSuccess = false;
    while (!fsOpSuccess) {
        try {
            f.seekg(_filePointer);
            f.seekp(_filePointer);
            fsOpSuccess = true;
        } catch ( const fs::filesystem_error& ex ) {
            LOG_WARN(File_impl, "Error in filesystem: "<<ex.what()<<". Attempting again")
            fsOpSuccessAttempts++;
            if (fsOpSuccessAttempts == 10)
                { break; }
            usleep(10000);
        } catch ( ... ) {
            LOG_WARN(File_impl, "Caught an unhandled file system exception. Attempting again")
            fsOpSuccessAttempts++;
            if (fsOpSuccessAttempts == 10)
                { break; }
            usleep(10000);
        }
    }
    if (!fsOpSuccess) {
        LOG_ERROR(File_impl, "Error setting file pointer for file, " << fName);
        throw (CF::File::IOException (CF::CF_EIO, "[File_impl::setFilePointer] Error setting file pointer for file"));
    }

    TRACE_EXIT(File_impl)
}
Example #19
0
void adjust_xy( short ck  ,
                short oldX,
                short oldY,
                short &newX,
                short &newY )
   {
   TRACE_ENTER("adjust_xy");
   if (ck) //control key?
      {
      //         | center of leftmost rectangle
      //         v 
      newX = max( (cxBlock / 2),
      //                  | centered to inside rectangle
      //                  v 
               min( ((oldX/cxBlock)*cxBlock) + (cxBlock / 2),
      //                       | center of rightmost rectangle
      //                       v
                    (cxBlock * (DIVISIONS -1)) + (cxBlock / 2)
                  )
              )     ;
      TRACE_INT(newX);        
      //         | center of leftmost rectangle
      //         v 
      newY = max( (cyBlock / 2),
      //                  | centered to inside rectangle
      //                  v 
               min( ((oldY/cyBlock)*cyBlock) + (cyBlock / 2),
      //                       | center of rightmost rectangle
      //                       v
                    (cyBlock * (DIVISIONS -1)) + (cyBlock / 2)
                  )
              )     ;
      TRACE_INT(newY);        
      }
   else
      {
      newX = max(0,min(oldX,cxClient));
      newY = max(0,min(oldY,cyClient));
      }
   TRACE_EXIT("adjust_xy");
   }                        
Example #20
0
/****************************************************************************
  Name          : lga_mds_finalize
 
  Description   : This routine unregisters the LGA Service from MDS.
 
  Arguments     : cb - ptr to the LGA control block
 
  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
 
  Notes         : None.
******************************************************************************/
void lga_mds_finalize(lga_cb_t *cb)
{
	NCSMDS_INFO mds_info;
	uint32_t rc = NCSCC_RC_SUCCESS;

	TRACE_ENTER();
	/* Un-install your service into MDS. 
	   No need to cancel the services that are subscribed */
	memset(&mds_info, '\0', sizeof(NCSMDS_INFO));

	mds_info.i_mds_hdl = cb->mds_hdl;
	mds_info.i_svc_id = NCSMDS_SVC_ID_LGA;
	mds_info.i_op = MDS_UNINSTALL;

	if ((rc = ncsmds_api(&mds_info)) != NCSCC_RC_SUCCESS) {
		TRACE("mds api call failed");
	}

	TRACE_LEAVE();
	return;
}
Example #21
0
static int
airport_open(struct net_device *dev)
{
	dldwd_priv_t *priv = dev->priv;
	dldwd_card_t* card = (dldwd_card_t *)priv->card;
	int rc;

	TRACE_ENTER(priv->ndev.name);

	rc = dldwd_reset(priv);
	if (rc)
		airport_stop(dev);
	else {
		card->open = 1;
		netif_device_attach(dev);
	}

//	TRACE_EXIT(priv->ndev.name);

	return rc;
}
void saImmOmAdminOperationContinue_02(void)
{
    TRACE_ENTER();
    const SaImmAdminOwnerNameT adminOwnerName = (SaImmAdminOwnerNameT) __FUNCTION__;
    SaImmAdminOwnerHandleT ownerHandle;
    SaImmContinuationIdT continuationId = 666;
    SaAisErrorT operationReturnValue=SA_AIS_OK;
    SaImmAdminOperationParamsT_2 **returnParams;
    safassert(saImmOmInitialize_o2(&immOmHandle, &immOmA2bCallbacks, &immVersion), SA_AIS_OK);
    safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName, SA_TRUE, &ownerHandle), SA_AIS_OK);
    test_validate(saImmOmAdminOperationContinue_o2(
                                                ownerHandle,
                                                &rootObj,
                                                continuationId,
                                                &operationReturnValue,
                                                &returnParams),
                  SA_AIS_ERR_NOT_SUPPORTED);
    safassert(saImmOmAdminOwnerFinalize(ownerHandle), SA_AIS_OK);
    safassert(saImmOmFinalize(immOmHandle), SA_AIS_OK);
    TRACE_LEAVE();
}
Example #23
0
File: Lo_send.c Project: nmap/npcap
VOID
NTAPI
NPF_WSKFreeSockets(
	)
{
	TRACE_ENTER();

	if (g_IPv4Socket)
	{
		WSKCloseSocket(g_IPv4Socket);
		g_IPv4Socket = NULL;
	}

	if (g_IPv6Socket)
	{
		WSKCloseSocket(g_IPv6Socket);
		g_IPv6Socket = NULL;
	}

	TRACE_EXIT();
}
Example #24
0
/**
 * Function to reset the poll fdlist
 *
 * @param fd
 *
 * @return NCSCC_RC_SUCCESS
 * @return NCSCC_RC_FAILURE
 *
 */
uint32_t dtm_intranode_reset_poll_fdlist(int fd)
{
	DTM_INTRANODE_POLLFD_LIST *mov_ptr = dtm_intranode_cb->fd_list_ptr_head;

	TRACE_ENTER();
	if (mov_ptr == NULL) {
		LOG_ER("DTM:Unable to set the event in the poll list");
		return NCSCC_RC_FAILURE;
	}
	while (mov_ptr != NULL) {
		if (fd == mov_ptr->dtm_intranode_fd.fd) {
			mov_ptr->dtm_intranode_fd.events = POLLIN;
			dtm_intranode_fill_fd_set();
			return NCSCC_RC_SUCCESS;
		}
		mov_ptr = mov_ptr->next;
	}
	LOG_ER("DTM:Unable to set the event in the poll list");
	TRACE_LEAVE();
	return NCSCC_RC_FAILURE;
}
Example #25
0
static uint32_t cpa_mds_rcv(CPA_CB *cb, MDS_CALLBACK_RECEIVE_INFO *rcv_info)
{
	uint32_t rc = NCSCC_RC_SUCCESS;

	TRACE_ENTER();
	CPSV_EVT *evt = (CPSV_EVT *)rcv_info->i_msg;

	evt->sinfo.ctxt = rcv_info->i_msg_ctxt;
	evt->sinfo.dest = rcv_info->i_fr_dest;
	evt->sinfo.to_svc = rcv_info->i_fr_svc_id;

	/* Process the received event at CPA */
	if (cpa_process_evt(cb, evt) != NCSCC_RC_SUCCESS)
		rc = NCSCC_RC_FAILURE;

	/* Free the Event */
	m_MMGR_FREE_CPSV_EVT(evt, NCS_SERVICE_ID_CPA);

	TRACE_LEAVE2("retal = %d",rc);
	return rc;
}
static void
Permedia2SubsequentFillRectSolid(ScrnInfoPtr pScrn, int x, int y, int w, int h)
{
    GLINTPtr pGlint = GLINTPTR(pScrn);
    int speed = 0;

    TRACE_ENTER("Permedia2SubsequentFillRectSolid");
    if (pGlint->ROP == GXcopy) {
	GLINT_WAIT(3);
        Permedia2LoadCoord(pScrn, x, y, w, h);
  	speed = FastFillEnable;
    } else {
	GLINT_WAIT(4);
        Permedia2LoadCoord(pScrn, x>>pGlint->BppShift, y, 
						(w+7)>>pGlint->BppShift, h);
  	GLINT_WRITE_REG(x<<16|(x+w), PackedDataLimits);
  	speed = 0;
    }
    GLINT_WRITE_REG(PrimitiveRectangle | XPositive | YPositive | speed, Render);
    TRACE_EXIT("Permedia2SubsequentFillRectSolid");
}
Example #27
0
/****************************************************************************
  Name          : ava_hdl_init
 
  Description   : This routine initializes the handle database.
 
  Arguments     : hdl_db  - ptr to the handle database
 
  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
 
  Notes         : None
******************************************************************************/
uint32_t ava_hdl_init(AVA_HDL_DB *hdl_db)
{
	NCS_PATRICIA_PARAMS param;
	uint32_t rc = NCSCC_RC_SUCCESS;
	TRACE_ENTER();

	memset(&param, 0, sizeof(NCS_PATRICIA_PARAMS));

	/* init the hdl db tree */
	param.key_size = sizeof(uint32_t);
	param.info_size = 0;

	rc = ncs_patricia_tree_init(&hdl_db->hdl_db_anchor, &param);
	if (NCSCC_RC_SUCCESS == rc)
		hdl_db->num = 0;
	else
		TRACE("Patricia tree init failed for Handled DB");

	TRACE_LEAVE();
	return rc;
}
Example #28
0
/****************************************************************************
 * Name          : glnd_se_lib_destroy
 *
 * Description   : This is the function which destroy the GLND libarary.
 *
 * Arguments     : 
 *
 * Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE.
 *
 * Notes         : None.
 *****************************************************************************/
uint32_t glnd_se_lib_destroy()
{
	GLND_CB *glnd_cb;
	uint32_t rc = NCSCC_RC_FAILURE;
	TRACE_ENTER();

	/* take the handle */
	glnd_cb = (GLND_CB *)m_GLND_TAKE_GLND_CB;
	if (!glnd_cb) {
		LOG_ER("GLND cb take handle failed");
		goto end;
	}

	if ((rc = glnd_cb_destroy(glnd_cb)) != NCSCC_RC_SUCCESS) {
		TRACE_2("GLND cb destroy failed");
		rc= NCSCC_RC_FAILURE;
	}
end:
	TRACE_LEAVE2("%s return value %u", (rc == NCSCC_RC_SUCCESS)?"SUCCESS":"FAILURE", rc);
	return rc;
}
Example #29
0
/****************************************************************************
  Name          : ava_hdl_del
 
  Description   : This routine deletes the handle database.
 
  Arguments     : cb  - ptr to the AvA control block
 
  Return Values : None
 
  Notes         : None
******************************************************************************/
void ava_hdl_del(AVA_CB *cb)
{
	AVA_HDL_DB *hdl_db = &cb->hdl_db;
	AVA_HDL_REC *hdl_rec = 0;
	TRACE_ENTER();

	/* scan the entire handle db & delete each record */
	while ((hdl_rec = (AVA_HDL_REC *)
		ncs_patricia_tree_getnext(&hdl_db->hdl_db_anchor, 0))) {
		ava_hdl_rec_del(cb, hdl_db, &hdl_rec);
	}

	/* there shouldn't be any record left */
	osafassert(!hdl_db->num);

	/* destroy the hdl db tree */
	ncs_patricia_tree_destroy(&hdl_db->hdl_db_anchor);

	TRACE_LEAVE();
	return;
}
Bool MapUserMemToGPU(GALINFOPTR galInfo, MemMapInfoPtr mmInfo) {
    TRACE_ENTER();
    gceSTATUS status = gcvSTATUS_OK;
    gctPOINTER logical = (gctPOINTER) mmInfo->mUserAddr;
    gctSIZE_T size = (gctSIZE_T) (mmInfo->mSize);
    gctPOINTER mappingInfo = NULL;
    gctUINT32 physical = 0;
    VIVGPUPtr gpuctx = (VIVGPUPtr) (galInfo->mGpu);

    status = gcoOS_MapUserMemory(gpuctx->mDriver->mOs, logical, size, &mappingInfo, &physical);
    if (status < 0) {
        TRACE_ERROR("Mapping Failed\n");
        gcoOS_UnmapUserMemory(gpuctx->mDriver->mOs, logical, size, mappingInfo, physical);
        mmInfo->physical = 0;
        mmInfo->mapping = NULL;
        TRACE_EXIT(FALSE);
    }
    mmInfo->physical = physical;
    mmInfo->mapping = mappingInfo;
    TRACE_EXIT(TRUE);
}