/****************************************************************
 ****************************************************************
 **                                                            **
 **    (C)Copyright 2008, American Megatrends Inc.             **
 **                                                            **
 **            All Rights Reserved.                            **
 **                                                            **
 **        6145-F, Northbelt Parkway, Norcross,                **
 **                                                            **
 **        Georgia - 30071, USA. Phone-(770)-246-8600.         **
 **                                                            **
 ****************************************************************
 *
 * OemCmdhndlr.c
 * Oem Commands used  by SMM Channel
 *
 * Author: Anurag Bhatia <anuragb@ami.com>
 *         Vinesh Chirstopher <vineshc@ami.com>
 *
 *****************************************************************/
#define ENABLE_DEBUG_MACROS     0
#include "Types.h"
//#include "Debug.h"
//#include "OemSMMCmds.h"
//#include "MsgHndlr.h"
#include "IPMIDefs.h"
//#include "flashlib.h"
//#include "PDKEEPROM.h"
//#include "NVRAccess.h"
//#include "ubenv.h"
//#include "IPMIConf.h"
//#include "gpioifc.h"
//#include <time.h>
//#include <linux/ioport.h>
//#include "libpwmtach.h"
//#include "hal_hw.h"

//return BMC version
int  SMMExample_1(_NEAR_ INT8U* pReq, INT8U ReqLen, _NEAR_ INT8U* pRes)
{
//	char versionStr[]="v1.00 2019-01-16";
//	printf("==== Version:  %s ====\n", versionStr);
				
	*pRes= CC_NORMAL;
	*(pRes+1) = 0x20;
	*(pRes+2) = 0x19;
	*(pRes+3) = 0x03;
	*(pRes+4) = 0x21;
//	memcpy(pRes+1,versionStr,sizeof(versionStr));
	return 	5;
}

//netfn 0x2e
//cmd 0x02
//get MARK, slotID
int SMMExample_2(_NEAR_ INT8U* pReq, INT8U ReqLen, _NEAR_ INT8U* pRes)
{
	*pRes= CC_NORMAL;
	return 1;
}

int SMMExample_3(_NEAR_ INT8U* pReq, INT8U ReqLen, _NEAR_ INT8U* pRes)	
{
	*pRes= CC_NORMAL;
	return sizeof (*pRes);
}

//netfn 0x2e
//cmd 0x04
//get MARK, slotID
int SMMExample_4(_NEAR_ INT8U* pReq, INT8U ReqLen, _NEAR_ INT8U* pRes)
{
	*pRes= CC_NORMAL;
	return 1;
}
//netfn 0x2e
//cmd 0x02
//get MARK, slotID
int SMMExample_5(_NEAR_ INT8U* pReq, INT8U ReqLen, _NEAR_ INT8U* pRes)
{
	*pRes= CC_NORMAL;
	return 1;
}
//netfn 0x2e
//cmd 0x02
//get MARK, slotID
int SMMExample_6(_NEAR_ INT8U* pReq, INT8U ReqLen, _NEAR_ INT8U* pRes)
{
	*pRes= CC_NORMAL;
	return 1;
}
//netfn 0x2e
//cmd 0x02
//get MARK, slotID
int SMMExample_7(_NEAR_ INT8U* pReq, INT8U ReqLen, _NEAR_ INT8U* pRes)
{
	*pRes= CC_NORMAL;
	return 1;
}
//netfn 0x2e
//cmd 0x02
//get MARK, slotID
int SMMExample_8(_NEAR_ INT8U* pReq, INT8U ReqLen, _NEAR_ INT8U* pRes)
{
	*pRes= CC_NORMAL;
	return 1;
}
//netfn 0x2e
//cmd 0x02
//get MARK, slotID
int SMMExample_9(_NEAR_ INT8U* pReq, INT8U ReqLen, _NEAR_ INT8U* pRes)
{
	*pRes= CC_NORMAL;
	return 1;
}
