예제 #1
0
/****************************************************************************
Name          : plma_mds_callback

Description   : This callback routine will be called by MDS on event arrival

Arguments     : info - pointer to the mds callback info

Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE

Notes         : None.
*****************************************************************************/
uint32_t plma_mds_callback(struct ncsmds_callback_info *info)
{
	PLMA_CB *plma_cb = plma_ctrlblk;
	uint32_t rc = NCSCC_RC_SUCCESS;
	TRACE_ENTER();

	assert(info != NULL);

	switch (info->i_op) {
		case MDS_CALLBACK_COPY:
			rc = NCSCC_RC_FAILURE;
			TRACE_1("MDS_CALLBACK_COPY - do nothing");
			break;
		case MDS_CALLBACK_ENC:
			rc = plms_mds_enc(&info->info.enc, &plma_cb->edu_hdl);
			break;
		case MDS_CALLBACK_DEC:
			rc = plms_mds_dec(&info->info.dec, &plma_cb->edu_hdl);
			break;
		case MDS_CALLBACK_ENC_FLAT:
			if (0) {        
		/*Set to zero for righorous testing of byteorder enc/dec.*/
				rc = plms_mds_enc_flat(info,&plma_cb->edu_hdl);
			} else {
				rc = plms_mds_enc(&info->info.enc_flat,&plma_cb->edu_hdl);
			}
			break;
		case MDS_CALLBACK_DEC_FLAT:
			if (1) {        
		/*Set to zero for righorous testing of byteorderr enc/dec.*/
				rc = plms_mds_dec_flat(info,&plma_cb->edu_hdl);
			} else {
				rc = plms_mds_dec(&info->info.dec_flat, &plma_cb->edu_hdl);
			}
			break;
		case MDS_CALLBACK_RECEIVE:
			rc = plma_mds_rcv(&info->info.receive);
			break;
		case MDS_CALLBACK_SVC_EVENT:
			rc = plma_mds_svc_evt(&info->info.svc_evt);
			break;
		case MDS_CALLBACK_DIRECT_RECEIVE:
			rc = NCSCC_RC_FAILURE;
			TRACE_1("MDS_CALLBACK_DIRECT_RECEIVE - do nothing");
			break;
		default:
			LOG_ER("PLMA :Illegal type of MDS message");
			rc = NCSCC_RC_FAILURE;
			break;
	}
	TRACE_LEAVE();
	return rc;
}
예제 #2
0
/****************************************************************************
Name          : plms_mds_callback

Description   : This callback routine will be called by MDS on event arrival

Arguments     : info - pointer to the mds callback info

Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE

Notes         : None.
*****************************************************************************/
SaUint32T plms_mds_callback(struct ncsmds_callback_info *info)
{
	uns32 rc = NCSCC_RC_SUCCESS;
	PLMS_CB *cb = plms_cb;

	assert(info != NULL);

	switch (info->i_op) {
		case MDS_CALLBACK_COPY:
			rc = plms_mds_cpy(info);
			break;
		case MDS_CALLBACK_ENC:
			rc = plms_mds_enc(&info->info.enc, &cb->edu_hdl);
			break;
		case MDS_CALLBACK_DEC:
			rc = plms_mds_dec(&info->info.dec,&cb->edu_hdl);
			break;
		case MDS_CALLBACK_ENC_FLAT:
			if (1) {        /*Set to zero for righorous testing of byteorderr
				   enc/dec. */
				rc = plms_mds_enc_flat( info,&cb->edu_hdl);
			} else {
				rc = plms_mds_enc( &info->info.enc_flat,&cb->edu_hdl);
			}
			break;
		case MDS_CALLBACK_DEC_FLAT:
			if (1) {        /*Set to zero for righorous testing of byteorderr
				    enc/dec. */
				rc = plms_mds_dec_flat( info,&cb->edu_hdl);
			} else {
				rc = plms_mds_dec( &info->info.dec_flat,&cb->edu_hdl);
			}
			break;
		case MDS_CALLBACK_RECEIVE:
			rc = plms_mds_rcv(&(info->info.receive));
			break;
		case MDS_CALLBACK_SVC_EVENT:
			rc = plms_mds_svc_evt(&(info->info.svc_evt));
			break;
		case MDS_CALLBACK_QUIESCED_ACK:
			rc = plms_proc_quiesced_ack_evt();
			break;
		case MDS_CALLBACK_DIRECT_RECEIVE:
			rc = NCSCC_RC_FAILURE;
			TRACE_1("MDS_CALLBACK_DIRECT_RECEIVE - do nothing");
			break;
		default:
			LOG_ER("Illegal type of MDS message");
			rc = NCSCC_RC_FAILURE;
			break;
	}
	return rc;
}