123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119 |
- /*****************************************************************
- *****************************************************************
- *** **
- *** (C)Copyright 2005-2006, American Megatrends Inc. **
- *** **
- *** All Rights Reserved. **
- *** **
- *** 6145-F, Northbelt Parkway, Norcross, **
- *** **
- *** Georgia - 30071, USA. Phone-(770)-246-8600. **
- *** **
- *****************************************************************
- *****************************************************************
- ******************************************************************
- *
- * ChassisDevice.c
- * Chassis commands
- *
- * Author: Rama Bisa <ramab@ami.com>
- *
- ******************************************************************/
- #include <string.h>
- #include "com_IPMI_ChassisDevice.h"
- #include "ChassisDevice.h"
- #include "ChassisTimerTask.h"
- #include "Support.h"
- #include "main.h"
- #include "message.h"
- /* Reserved bit macro definitions */
- #define RESERVED_BITS_CHASSISCONTROL 0xF0 //(BIT7 | BIT6 | BIT5 |BIT4)
- #define RESERVED_BITS_GETCHASSISIDENTIFY 0xFE //(BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0)
- #define RESERVED_BITS_SETCHASSISCAPS 0xFC //(BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2)
- #define RESERVED_BITS_SETPOWERRESTOREPOLICY 0xFC //(BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2)
- #define RESERVED_BITS_SETFPBUTTONENABLES 0xF0 //(BIT7 | BIT6 | BIT5 | BIT4)
- #if CHASSIS_DEVICE == 1
- /*** Local Definitions ***/
- #define PRP_ALWAYS_POWEROFF_SUPPORT 0x01
- #define PRP_LAST_STATE_SUPPORT 0x02
- #define PRP_ALWAYS_POWERON_SUPPORT 0x04
- #define CHASSIS_AMI_OEM_PARAM 96
- #define CHASSIS_SET_INPROG 0x00
- #define CHASSIS_SERVICE_PART_SEL 0x01
- #define CHASSIS_SERVICE_PART_SCAN 0x02
- #define CHASSIS_BOOT_FLAG_VALID_BIT_CLEAR 0x03
- #define CHASSIS_BOOT_INFO_ACK 0x04
- #define CHASSIS_BOOT_FLAGS 0x05
- #define CHASSIS_BOOT_INITIATOR_INFO 0x06
- #define CHASSIS_BOOT_INITIATOR_MBOX 0x07
- #define CHASSIS_AMI_OEM_PARAM 96
- #define SSICB_OEM_PARAM_BLK_SIZE_TBL 0x78
- #define SSICB_BOOT_ORDER_TBL 0x7D
- #define SSICB_BOOT_DEV_SELECTOR 0x7E
- #define SSICB_SLOT_CONFIG_TBL 0x7F
- #define ROLLBACK_OPTION 0x00
- /* Mask Bits */
- #define BIT5_BIT2_MASK 0x3C
- #define BIT6_BIT5_MASK 0x60
- #define BIT1_BIT0_MASK 0x03
-
- /* Reserved Bits */
- #define RESERVED_VALUE_03 0x03
- #define RESERVED_VALUE_10 0x10
- #define RESERVED_VALUE_20 0x20
- #define RESERVED_VALUE_28 0x28
- #define RESERVED_VALUE_30 0x30
- #define RESERVED_VALUE_34 0x34
- #define RESERVED_VALUE_38 0x38
- #define RESERVED_VALUE_40 0x40
- #define RESERVED_VALUE_60 0x60
- #define RESERVED_VALUE_80 0x80
- ///*** Module Varibales ***/
- //static const uint8_t m_BootOptParamLen [] = /**< Boot Options parameter length */
- //{
- // 0x01, /**< Set in progress byte length */
- // 0x01, /**< Service Partition selector length */
- // 0x01, /**< Service Partition scan length */
- // 0x01, /**< Boot flag valid bit length */
- // sizeof(BootInfoAck_T), /**< Boot info ack length */
- // sizeof(BootFlags_T), /**< Boot Flags valid length */
- // sizeof(BootInitiatorInfo_T), /**< Boot init info length */
- // sizeof(BootInitiatorMboxReq_T), /**< Boot init info length */
- //};
- //static const uint8_t m_SSIBootOptParamLen [] = /**< SSI Boot Options parameter length */
- //{
- // sizeof(OemParamBlkSizeTbl_T), /* OEM Parameter Block Size Table length */
- // 0x0, /* Reserved */
- // 0x0, /* Reserved */
- // 0x0, /* Reserved */
- // 0x0, /* Reserved */
- // sizeof(BootOrderTblReq_T), /* Boot Order Table length */
- // sizeof(uint8_t), /* SSI Boot Device Selector length*/
- // sizeof(SlotConfigTbl_T) /* Slot Configuration Table length */
- //};
- #define MAX_BOOT_PARAMS_DATA 20
- typedef struct
- {
- uint8_t Params;
- uint8_t ReservedBits [MAX_BOOT_PARAMS_DATA];
- uint8_t DataLen;
- } BootCfgRsvdBits_T;
- //static BootCfgRsvdBits_T m_RsvdBitsCheck [] = {
- // /* Param Reserved Bits Data Size */
- // { 0, { 0xFC }, 0x1 }, /* Set In progress */
- // { 2, { 0xFC }, 0x1 },
- // { 3, { 0xE0 }, 0x1 },
- // { 5, { 0x1F,0x00,0x00,0xF0,0xE0}, 0x5 },
- // { 6, { 0xF0 }, 0x1 }
- //};
- /*-------------------------------------
- * GetChassisCaps
- *-------------------------------------*/
- int
- GetChassisCaps ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
- {
- GetChassisCapabilitiesRes_T* pGetChassisCapsRes = ( GetChassisCapabilitiesRes_T*) pRes;
-
- printf("GetChassisCaps not implement\r\n");
- pGetChassisCapsRes->CompletionCode = CC_NORMAL;
- memcpy ( ( uint8_t*)&pGetChassisCapsRes->ChassisCapabilities,
- ( uint8_t*)&g_BMCInfo.IpmiConfig.ChassisCapabilities,
- sizeof(ChassisCapabilities_T) );
-
- return sizeof(GetChassisCapabilitiesRes_T);
- }
- /*-------------------------------------
- * GetChassisStatus
- *-------------------------------------*/
- int
- GetChassisStatus ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
- {
- GetChassisStatusRes_T* pGetChassisStatusRes =
- ( GetChassisStatusRes_T*) pRes;
- pGetChassisStatusRes->CompletionCode = CC_NORMAL;
- memcpy ( ( uint8_t*)&pGetChassisStatusRes->ChassisPowerState,
- ( uint8_t*)&g_BMCInfo.IpmiConfig.ChassisPowerState,
- sizeof(ChassisPowerState_T));
-
- return sizeof (GetChassisStatusRes_T) ;
- }
- /*-------------------------------------
- * ChassisControl
- *-------------------------------------*/
- int
- ChassisControl ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes )
- {
- ChassisControlReq_T* pChassisControlReq =
- ( ChassisControlReq_T*) pReq;
- ChassisControlRes_T* pChassisControlRes =
- ( ChassisControlRes_T*) pRes;
- MsgPkt_T MsgPkt;
- pChassisControlRes->CompletionCode = CC_NORMAL;
- /* Check for the reserved bytes should b zero */
- if ( 0 != (pChassisControlReq->ChassisControl & RESERVED_BITS_CHASSISCONTROL ) )
- {
- pChassisControlRes->CompletionCode = CC_INV_DATA_FIELD;
- return sizeof(uint8_t);
- }
- switch (pChassisControlReq->ChassisControl & 0x0F )
- {
- case CHASSIS_POWER_DOWN:
- //printf ("Chassis IS GOING FOR POWER_DOWN\n");
- MsgPkt.Param = PARAM_CHASSIS;
- MsgPkt.NetFnLUN = 0x00<<2;
- MsgPkt.Cmd = 0x02;
- MsgPkt.Data[0] = CHASSIS_POWER_DOWN;
- PostMsg(gFd_ChassisPwrHndlrQue, &MsgPkt);
- // g_BMCInfo.HostOFFStopWDT = TRUE ;
- g_BMCInfo.IpmiConfig.SysRestartCause = RESTART_CAUSE_CHASSIS_CTRL;
- // OnSetRestartCause(g_BMCInfo.ChassisConfig.SysRestartCause, TRUE,BMCInst);
- // g_BMCInfo.Msghndlr.ChassisControl= CHASSIS_POWER_DOWN;
- break;
- case CHASSIS_POWER_UP:
- //printf ("Chassis IS GOING FOR POWER UP\n");
- MsgPkt.Param = PARAM_CHASSIS;
- MsgPkt.NetFnLUN = 0x00<<2;
- MsgPkt.Cmd = 0x02;
- MsgPkt.Data[0] = CHASSIS_POWER_UP;
- PostMsg(gFd_ChassisPwrHndlrQue, &MsgPkt);
- g_BMCInfo.IpmiConfig.SysRestartCause = RESTART_CAUSE_CHASSIS_CTRL;
- // OnSetRestartCause(g_BMCInfo.ChassisConfig.SysRestartCause, TRUE,BMCInst);
- // g_BMCInfo.Msghndlr.ChassisControl = CHASSIS_POWER_UP;
- // /* Set Last Power Event through IPMI Command */
- // if(g_PDKHandle[PDK_SETLASTPOWEREVENT] != NULL)
- // {
- // ((void(*)(uint8_t,int))g_PDKHandle[PDK_SETLASTPOWEREVENT]) (PDK_LAST_POWER_ON_VIA_IPMI,BMCInst);
- // }
- break;
- case CHASSIS_POWER_CYCLE:
- //printf ("Chassis IS GOING FOR POWER CYCLE\n");
- MsgPkt.Param = PARAM_CHASSIS;
- MsgPkt.NetFnLUN = 0x00<<2;
- MsgPkt.Cmd = 0x02;
- MsgPkt.Data[0] = CHASSIS_POWER_CYCLE;
- PostMsg(gFd_ChassisPwrHndlrQue, &MsgPkt);
-
- g_BMCInfo.IpmiConfig.SysRestartCause = RESTART_CAUSE_CHASSIS_CTRL;
- // OnSetRestartCause(g_BMCInfo.ChassisConfig.SysRestartCause, TRUE,BMCInst);
- // g_BMCInfo.Msghndlr.ChassisControl = CHASSIS_POWER_CYCLE;
- // /* Set Last Power Event through IPMI Command */
- // if(g_PDKHandle[PDK_SETLASTPOWEREVENT] != NULL)
- // {
- // ((void(*)(uint8_t,int))g_PDKHandle[PDK_SETLASTPOWEREVENT]) (PDK_LAST_POWER_ON_VIA_IPMI,BMCInst);
- // }
- break;
- case CHASSIS_HARD_RESET:
- //printf ("Chassis IS GOING FOR HARD RESET");
- MsgPkt.Param = PARAM_CHASSIS;
- MsgPkt.NetFnLUN = 0x00<<2;
- MsgPkt.Cmd = 0x02;
- MsgPkt.Data[0] = CHASSIS_HARD_RESET;
- PostMsg(gFd_ChassisPwrHndlrQue, &MsgPkt);
- g_BMCInfo.IpmiConfig.SysRestartCause = RESTART_CAUSE_CHASSIS_CTRL;
- // OnSetRestartCause(g_BMCInfo.ChassisConfig.SysRestartCause, TRUE,BMCInst);
- // g_BMCInfo.Msghndlr.ChassisControl = CHASSIS_HARD_RESET;
- break;
- case CHASSIS_PULSE_DIAGNOSTIC_INTERRUPT:
- //printf ("Chassis IS GOING FOR DIAG INT\n");
- MsgPkt.Param = PARAM_CHASSIS;
- MsgPkt.NetFnLUN = 0x00<<2;
- MsgPkt.Cmd = 0x02;
- MsgPkt.Data[0] = CHASSIS_PULSE_DIAGNOSTIC_INTERRUPT;
- PostMsg(gFd_ChassisPwrHndlrQue, &MsgPkt);
- //Platform_HostDiagInt ();
- break;
- case CHASSIS_SOFT_SHUTDOWN:
- //printf ("Chassis IS GOING FOR SOFT SHUTDOWN\n");
- MsgPkt.Param = PARAM_CHASSIS;
- MsgPkt.NetFnLUN = 0x00<<2;
- MsgPkt.Cmd = 0x02;
- MsgPkt.Data[0] = CHASSIS_SOFT_SHUTDOWN;
- PostMsg(gFd_ChassisPwrHndlrQue, &MsgPkt);
- //Platform_HostSoftShutDown (BMCInst);
- break;
- default:
- printf ("UNKNOWN Chassis CONTROL REQUEST \r\n");
- pChassisControlRes->CompletionCode = CC_INV_DATA_FIELD;
- break;
- }
- UpdateFlash();
- return sizeof (ChassisControlRes_T);
- }
- /*-------------------------------------
- * GetChassisIdentify
- *-------------------------------------*/
- int
- GetChassisIdentify ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
- {
- ChassisIdentifyReq_T* pChassisIdentifyReq =
- ( ChassisIdentifyReq_T*) pReq;
- ChassisIdentifyRes_T* pChassisIdentifyRes =
- ( ChassisIdentifyRes_T*) pRes;
- if (ReqLen <= sizeof(ChassisIdentifyReq_T))
- {
- if (0 != ReqLen)
- {
- g_BMCInfo.ChassisIdentifyForce = 0;
- g_BMCInfo.ChassisIdentifyTimeout = pChassisIdentifyReq->IdentifyInterval;
- }
- else
- {
- g_BMCInfo.ChassisIdentifyForce = 0;
- g_BMCInfo.ChassisIdentifyTimeout = 15;
- }
- if (ReqLen == 2)
- {
- /* Check for the reserved bytes should b zero */
- if ( 0 != (pChassisIdentifyReq->ForceIdentify & RESERVED_BITS_GETCHASSISIDENTIFY ) )
- {
- pChassisIdentifyRes->CompletionCode = CC_INV_DATA_FIELD;
- return sizeof(uint8_t);
- }
- if(pChassisIdentifyReq->ForceIdentify & 1)
- {
- g_BMCInfo.ChassisIdentifyTimeout = 0;
- g_BMCInfo.ChassisIdentifyForce = 1;
- }
- else
- {
- g_BMCInfo.ChassisIdentifyForce = 0;
- }
- }
- g_BMCInfo.ChassisIdentify = TRUE;
- pChassisIdentifyRes->CompletionCode = CC_NORMAL;
- }
- else
- {
- pChassisIdentifyRes->CompletionCode = CC_REQ_INV_LEN;
- }
-
- return sizeof(ChassisIdentifyRes_T);
- }
- /*-------------------------------------
- * SetChassisCaps
- *-------------------------------------*/
- int
- SetChassisCaps ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
- {
- SetChassisCapabilitiesReq_T* pSetChassisCapsReq =
- ( SetChassisCapabilitiesReq_T*) pReq;
- SetChassisCapabilitiesRes_T* pSetChassisCapsRes =
- ( SetChassisCapabilitiesRes_T*) pRes;
- //printf ("SET Chassis CAPABILITIES\n");
- /* Check for the reserved bytes should b zero */
- if ( 0 != (pSetChassisCapsReq->ChassisCaps.CapabilitiesFlags & RESERVED_BITS_SETCHASSISCAPS ) )
- {
- pSetChassisCapsRes->CompletionCode = CC_INV_DATA_FIELD;
- return sizeof(uint8_t);
- }
-
- if ((ReqLen != 5) &&
- (ReqLen != sizeof(SetChassisCapabilitiesReq_T)))
- {
- pSetChassisCapsRes->CompletionCode= CC_REQ_INV_LEN;
- return sizeof(SetChassisCapabilitiesRes_T);
- }
- if((pSetChassisCapsReq->ChassisCaps.CapabilitiesFlags & 0xFC ) != 0)
- {
- pSetChassisCapsRes->CompletionCode= CC_INV_DATA_FIELD;
- return sizeof(SetChassisCapabilitiesRes_T);
- }
- memcpy (( uint8_t*) &g_BMCInfo.IpmiConfig.ChassisCapabilities,
- ( uint8_t*) &pSetChassisCapsReq->ChassisCaps,
- sizeof(ChassisCapabilities_T));
-
- UpdateFlash();
- pSetChassisCapsRes->CompletionCode = CC_NORMAL;
-
- return sizeof (SetChassisCapabilitiesRes_T);
- }
- /*-------------------------------------
- * SetPowerRestorePolicy
- *-------------------------------------*/
- int
- SetPowerRestorePolicy ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
- {
-
- SetPowerRestorePolicyReq_T* pSetPowerRestorePolicyReq =
- ( SetPowerRestorePolicyReq_T*) pReq;
- SetPowerRestorePolicyRes_T* pSetPowerRestorePolicyRes =
- ( SetPowerRestorePolicyRes_T*) pRes;
-
- printf ("\nSET POWER RESORE POLICY\r\n");
-
- /* Check for the reserved bytes should b zero */
- if ( 0 != ( pSetPowerRestorePolicyReq->PowerRestorePolicy & RESERVED_BITS_SETPOWERRESTOREPOLICY ))
- {
- pSetPowerRestorePolicyRes->CompletionCode = CC_INV_DATA_FIELD;
- return sizeof (uint8_t);
- }
- // 011b = no change to the current power restore policy
- if (pSetPowerRestorePolicyReq->PowerRestorePolicy != 0x03)
- {
- g_BMCInfo.IpmiConfig.PowerRestorePolicy =
- pSetPowerRestorePolicyReq->PowerRestorePolicy & 0x07;
- g_BMCInfo.IpmiConfig.ChassisPowerState.PowerState &= ~0x60;
- g_BMCInfo.IpmiConfig.ChassisPowerState.PowerState |= (pSetPowerRestorePolicyReq->PowerRestorePolicy << 5);
- UpdateFlash();
- }
- pSetPowerRestorePolicyRes->CompletionCode = CC_NORMAL;
- pSetPowerRestorePolicyRes->PowerRestorePolicy = PRP_ALWAYS_POWEROFF_SUPPORT |
- PRP_LAST_STATE_SUPPORT |
- PRP_ALWAYS_POWERON_SUPPORT;
- return sizeof(SetPowerRestorePolicyRes_T);
- }
- /*-------------------------------------
- * GetSysRestartCause
- *-------------------------------------*/
- int
- GetSysRestartCause ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
- {
- GetSystemRestartCauseRes_T* pGetSysRestartCauseRes =
- ( GetSystemRestartCauseRes_T*) pRes;
- uint8_t *curchannel = 0;
- //printf ("GET SYSTEM RESTART CAUSE\n");
- pGetSysRestartCauseRes->CompletionCode = CC_NORMAL;
- pGetSysRestartCauseRes->SysRestartCause = g_BMCInfo.IpmiConfig.SysRestartCause;
- pGetSysRestartCauseRes->ChannelID = *curchannel & 0xF;
-
- return sizeof(GetSystemRestartCauseRes_T);
- }
- /*-------------------------------------
- * GetPOHCounter
- *-------------------------------------*/
- int
- GetPOHCounter ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
- {
- //TODO: POHCounterReading unit is hour or minutes or second?
- GetPOHCounterRes_T* pGetPOHCounterRes = ( GetPOHCounterRes_T*) pRes;
- //printf ("GET POH COUNTER\r\n");
- pGetPOHCounterRes->CompletionCode = CC_NORMAL;
- pGetPOHCounterRes->MinutesPerCount = POH_MINS_PER_COUNT;
- pGetPOHCounterRes->POHCounterReading = (g_BMCInfo.BootValidMinutes/60);
-
- return sizeof(GetPOHCounterRes_T);
- }
- /*-------------------------------------
- * SetSysBOOTOptions
- *-------------------------------------*/
- int
- SetSysBOOTOptions ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
- {
- printf("SetSysBOOTOptions not implement\r\n");
- // SetBootOptionsReq_T* pBootOptReq = ( SetBootOptionsReq_T*) pReq;
- // SetBootOptionsRes_T* pBootOptRes = ( SetBootOptionsRes_T*) pRes;
- // BMCInfo_t *pBMCInfo = &g_BMCInfo;
- // uint8_t Parameter;
- // BootOptions_T* pBootOptions;
- // uint8_t u8SetInProgress;
- // uint8_t u8TempData,SSIComputeBladeSupport;
- // int i,j=0;
- // Parameter = pBootOptReq->ParamValidCumParam & 0x7F;
- // SSIComputeBladeSupport = g_corefeatures.ssi_support;
- // /*Check for validity of parameter */
- // if(SSIComputeBladeSupport)
- // {
- // if ((Parameter >= sizeof (m_BootOptParamLen)) && (Parameter != CHASSIS_AMI_OEM_PARAM) &&
- // (Parameter != SSICB_OEM_PARAM_BLK_SIZE_TBL) && (Parameter < SSICB_BOOT_ORDER_TBL || Parameter > SSICB_SLOT_CONFIG_TBL))
- // {
- // pBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED;
- // return sizeof (SetBootOptionsRes_T);
- // }
- // }
- // else
- // {
- // if ((Parameter >= sizeof (m_BootOptParamLen)) && (Parameter != CHASSIS_AMI_OEM_PARAM))
- // {
- // pBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED;
- // return sizeof (SetBootOptionsRes_T);
- // }
- // }
- // /*Check if ReqLen valid for OEM Parameter */
- // if (CHASSIS_AMI_OEM_PARAM == Parameter)
- // {
- // if ((ReqLen - 1) != sizeof (AMI_BootOpt_T))
- // {
- // pBootOptRes->CompletionCode= CC_REQ_INV_LEN;
- // return sizeof (uint8_t);
- // }
- // }
- // else if (Parameter >= SSICB_OEM_PARAM_BLK_SIZE_TBL && Parameter <= SSICB_SLOT_CONFIG_TBL)
- // {
- // if(SSIComputeBladeSupport)
- // {
- // if ((ReqLen - 1) != m_SSIBootOptParamLen[Parameter-SSICB_OEM_PARAM_BLK_SIZE_TBL])
- // {
- // pBootOptRes->CompletionCode= CC_REQ_INV_LEN;
- // return sizeof (uint8_t);
- // }
- // }
- // }
- // else
- // {
- // /*Check if valid message length */
- // //if ( ((ReqLen - 1) != m_BootOptParamLen[Parameter]) && (ReqLen != sizeof (Parameter)))
- // if ((ReqLen - 1) != m_BootOptParamLen[Parameter])
- // {
- // pBootOptRes->CompletionCode= CC_REQ_INV_LEN;
- // return sizeof (uint8_t);
- // }
- // }
- //#if 0
- // Bit is 1 - Parameter is locked
- // Bit is 0 - Parameter is unlocked
- //if locked
- // if no req to unlock then return invalid
- // if req to unlock then unlock and procced
- //else
- // Proceed
- //#endif
- // /* Check for Reserved Bits */
- // for (i = 0; i < sizeof (m_RsvdBitsCheck)/ sizeof (m_RsvdBitsCheck[0]); i++)
- // {
- // /* Check if this Parameter Selector needs Reserved bit checking !! */
- // if (m_RsvdBitsCheck[i].Params == Parameter)
- // {
- // //IPMI_DBG_PRINT_2 ("Param - %x, DataLen - %x\n", pSetLanReq->ParameterSelect, m_RsvdBitsCheck[i].DataLen);
- // for (j = 0; j < m_RsvdBitsCheck[i].DataLen; j++)
- // {
- // // IPMI_DBG_PRINT_2 ("Cmp %x, %x\n", pReq[2+j], m_RsvdBitsCheck[i].ReservedBits[j]);
- // if ( 0 != (pReq[1+j] & m_RsvdBitsCheck[i].ReservedBits[j]))
- // {
- // /* Alarm !!! Somebody is trying to set Reseved Bits */
- // *pRes = CC_INV_DATA_FIELD;
- // return sizeof (*pRes);
- // }
- // }
- // }
- // }
- // OS_THREAD_MUTEX_ACQUIRE(&g_BMCInfo.ChassisMutex, WAIT_INFINITE);
- // pBootOptions = &(BMC_GET_SHARED_MEM(BMCInst)->sBootOptions);
- // u8SetInProgress = pBootOptions->u8SetInProgress;
- // /* if locked */
- // if (pBootOptions->ParameterValid & (1 << Parameter) )
- // {
- // /*if not req to unlock */
- // if (0 != (pBootOptReq->ParamValidCumParam & 0x80))
- // {
- // pBootOptRes->CompletionCode = CC_INV_DATA_FIELD;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof (uint8_t);
- // }
- // }
- //
- // /*Check for valid bit settings */
- // if (0 != (pBootOptReq->ParamValidCumParam & 0x80))
- // {
- // /* The valid bit for parameters 0 - 7 are SET/RESET to
- // * corresponding bits 0-7 in ParameterValid field
- // */
- // pBootOptions->ParameterValid |= (1 << Parameter);
- // }
- // else
- // {
- // pBootOptions->ParameterValid &= ~(1 << Parameter);
- // }
- // /*if only the parameter byte is provided then exit */
- // if (ReqLen == sizeof (Parameter))
- // {
- // pBootOptRes->CompletionCode = CC_NORMAL;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof (SetBootOptionsRes_T);
- // }
- // switch (Parameter)
- // {
- // case CHASSIS_SET_INPROG:
- // /* Commit Write is optional and supported
- // * only if rollback is supported */
- // if ( (BMC_BOOT_OPTION_SET_IN_PROGRESS != pBootOptReq->BootParam.SetInProgress) &&
- // (BMC_BOOT_OPTION_SET_COMPLETE != pBootOptReq->BootParam.SetInProgress) )
- // {
- // pBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof(SetBootOptionsRes_T);
- // }
- // else if ((BMC_BOOT_OPTION_SET_IN_PROGRESS == (u8SetInProgress & 0x03)) &&
- // (BMC_BOOT_OPTION_SET_IN_PROGRESS == pBootOptReq->BootParam.SetInProgress))
- // {
- // IPMI_DBG_PRINT ("\nSET IN PROGRESS ALREADY SET \n");
- // pBootOptRes->CompletionCode = CC_SET_IN_PROGRESS;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof(SetBootOptionsRes_T);
- // }
- // /*Set the new setinpogress byte */
- // pBootOptions->u8SetInProgress = pBootOptReq->BootParam.SetInProgress;
- // break;
- //
- // case CHASSIS_SERVICE_PART_SEL:
- // pBootOptions->ServicePartitionSelector =
- // pBootOptReq->BootParam.ServicePartitionSelector;
- // break;
- //
- // case CHASSIS_SERVICE_PART_SCAN:
- // pBootOptions->ServicePartitionScan =
- // pBootOptReq->BootParam.ServicePartitionScan;
- // /*Update in NVRAM*/
- // g_BMCInfo.ChassisConfig.SysPartitionScan = pBootOptReq->BootParam.ServicePartitionScan;
- // FlushIPMI((uint8_t*)&g_BMCInfo.ChassisConfig,(uint8_t*)&g_BMCInfo.ChassisConfig.SysPartitionScan,g_BMCInfo.IPMIConfLoc.ChassisConfigAddr,sizeof(uint8_t),BMCInst);
- // break;
- //
- // case CHASSIS_BOOT_FLAG_VALID_BIT_CLEAR:
- // pBootOptions->BootFlagValidBitClearing =
- // pBootOptReq->BootParam.BootFlagValidBitClearing;
- // break;
- // case CHASSIS_BOOT_INFO_ACK:
- // _fmemcpy (( uint8_t*)&pBootOptions->BootInfoAck,
- // ( uint8_t*)&pBootOptReq->BootParam.BootInfoAck,
- // sizeof (BootInfoAck_T));
- // break;
- // case CHASSIS_BOOT_FLAGS:
- // u8TempData = (pBootOptReq->BootParam.BootFlags.Data2 & BIT5_BIT2_MASK);
- // if((u8TempData == RESERVED_VALUE_28) ||(u8TempData == RESERVED_VALUE_30) ||(u8TempData == RESERVED_VALUE_34)||(u8TempData == RESERVED_VALUE_38))
- // {
- // /* Alarm !!! Somebody is trying to set Reseved Bits */
- // *pRes = CC_INV_DATA_FIELD;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof (*pRes);
- // }
- // u8TempData = (pBootOptReq->BootParam.BootFlags.Data3 & BIT6_BIT5_MASK);
- // if((u8TempData == RESERVED_VALUE_60))
- // {
- // /* Alarm !!! Somebody is trying to set Reseved Bits */
- // *pRes = CC_INV_DATA_FIELD;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof (*pRes);
- // }
- // u8TempData = (pBootOptReq->BootParam.BootFlags.Data3 & BIT1_BIT0_MASK);
- // if((u8TempData == RESERVED_VALUE_03))
- // {
- // /* Alarm !!! Somebody is trying to set Reseved Bits */
- // *pRes = CC_INV_DATA_FIELD;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof (*pRes);
- // }
- // if((pBootOptReq->BootParam.BootFlags.Data5 == RESERVED_VALUE_20)||(pBootOptReq->BootParam.BootFlags.Data5 == RESERVED_VALUE_40)||(pBootOptReq->BootParam.BootFlags.Data5 == RESERVED_VALUE_80))
- // {
- // /* Alarm !!! Somebody is trying to set Reseved Bits */
- // *pRes = CC_INV_DATA_FIELD;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof (*pRes);
- // }
- // _fmemcpy (( uint8_t*)&pBootOptions->BootFlags,
- // ( uint8_t*)&pBootOptReq->BootParam.BootFlags,
- // sizeof (BootFlags_T));
- // break;
- // case CHASSIS_BOOT_INITIATOR_INFO:
- // _fmemcpy (( uint8_t*)&pBootOptions->BootInitiatorInfo,
- // ( uint8_t*)&pBootOptReq->BootParam.BootInitiatorInfo,
- // sizeof (BootInitiatorInfo_T));
- // break;
- //
- // case CHASSIS_BOOT_INITIATOR_MBOX:
- // if (pBootOptReq->BootParam.BootMailBox.BlockSel >= MAX_BOOT_INIT_MAILBOX_BLOCKS)
- // {
- // IPMI_DBG_PRINT ("\n ONLY FIVE BLOCKS ARE USED \n");
- // pBootOptRes->CompletionCode = CC_INV_DATA_FIELD;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof(SetBootOptionsRes_T);
- //
- // }
- // _fmemcpy (( uint8_t*)&pBootOptions->BootMailBox[pBootOptReq->BootParam.BootMailBox.BlockSel],
- // ( uint8_t*) &pBootOptReq->BootParam.BootMailBox.BootMBox,
- // sizeof (BootInitiatorMailbox_T));
- // break;
- // case CHASSIS_AMI_OEM_PARAM:
- // _fmemcpy (( uint8_t*)&g_BMCInfo.ChassisConfig.OemBootOpt,
- // ( uint8_t*) &pBootOptReq->BootParam.Oem,
- // sizeof (AMI_BootOpt_T));
- // FlushIPMI((uint8_t*)&g_BMCInfo.ChassisConfig,(uint8_t*)&g_BMCInfo.ChassisConfig,g_BMCInfo.IPMIConfLoc.ChassisConfigAddr,sizeof(ChassisConfig_T),BMCInst);
- // break;
- // case SSICB_OEM_PARAM_BLK_SIZE_TBL:
- // if(SSIComputeBladeSupport)
- // {
- // _fmemcpy (( uint8_t*)&pBootOptions->OemParamBlkSizeTbl,
- // ( uint8_t*)&pBootOptReq->BootParam.OemParamBlkSizeTbl,
- // sizeof(OemParamBlkSizeTbl_T));
- // break;
- // }
- // else
- // {
- // pBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof (SetBootOptionsRes_T);
- // }
- // case SSICB_BOOT_ORDER_TBL:
- // if(SSIComputeBladeSupport)
- // {
- // if (pBootOptReq->BootParam.BootOrderTbl.BlockSel >= g_coremacros.ssi_bot_dev_num)
- // {
- // pBootOptRes->CompletionCode = CC_INV_DATA_FIELD;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof(uint8_t);
- // }
- // _fmemcpy (( uint8_t*)&pBootOptions->BootOrderTbl[(pBootOptReq->BootParam.BootOrderTbl.BlockSel) * sizeof(BootOrderTbl_T)],
- // ( uint8_t*)&pBootOptReq->BootParam.BootOrderTbl,
- // sizeof(BootOrderTbl_T));
- // break;
- // }
- // else
- // {
- // pBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof (SetBootOptionsRes_T);
- // }
- // case SSICB_BOOT_DEV_SELECTOR:
- // if(SSIComputeBladeSupport)
- // {
- // pBootOptions->BootDevSelector = pBootOptReq->BootParam.BootDevSelector;
- // break;
- // }
- // else
- // {
- // pBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof (SetBootOptionsRes_T);
- // }
- // case SSICB_SLOT_CONFIG_TBL:
- // if(SSIComputeBladeSupport)
- // {
- // _fmemcpy (( uint8_t*)&pBootOptions->SlotConfigTbl,
- // ( uint8_t*)&pBootOptReq->BootParam.SlotConfigTbl,
- // sizeof(SlotConfigTbl_T));
- // break;
- // }
- // else
- // {
- // pBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof (SetBootOptionsRes_T);
- // }
- // default:
- // pBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED;
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return sizeof (SetBootOptionsRes_T);
- // }
- // if (0 != ROLLBACK_OPTION)
- // {
- // if (BMC_BOOT_OPTION_COMMIT_WRITE == (u8SetInProgress & 0x03))
- // {
- // /* Writing to nvRAM when "commit write" is given */
- // FlushIPMI((uint8_t*)&g_BMCInfo.ChassisConfig,(uint8_t*)&g_BMCInfo.ChassisConfig,g_BMCInfo.IPMIConfLoc.ChassisConfigAddr,sizeof(ChassisConfig_T),BMCInst);
- // /* Setting this to "set complete", don't need mutex protection */
- // pBootOptions->u8SetInProgress = BMC_BOOT_OPTION_SET_COMPLETE;
- // }
- //
- // }
- // else
- // {
- // /* Since roll back feature is not provided
- // the data is written to nvram */
- // FlushIPMI((uint8_t*)&g_BMCInfo.ChassisConfig,(uint8_t*)&g_BMCInfo.ChassisConfig,g_BMCInfo.IPMIConfLoc.ChassisConfigAddr,sizeof(ChassisConfig_T),BMCInst);
- // }
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // pBootOptRes->CompletionCode = CC_NORMAL;
- return sizeof(SetBootOptionsRes_T);
- }
- /*-------------------------------------
- * GetSysBOOTOptions
- *-------------------------------------*/
- int
- GetSysBOOTOptions ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
- {
- printf("GetSysBOOTOptions not implement\r\n");
- // GetBootOptionsReq_T* pGetBootOptReq = ( GetBootOptionsReq_T*) pReq;
- // GetBootOptionsRes_T* pGetBootOptRes = ( GetBootOptionsRes_T*) pRes;
- // BMCInfo_t *pBMCInfo = &g_BMCInfo[BMCInst];
- // uint8_t ParamSel,SSIComputeBladeSupport;
- // int ResponseLength;
- // BootOptions_T sBootOptions;
- // IPMI_DBG_PRINT ("GET SYSTEM BOOT OPTIONS\n");
- // if(pGetBootOptReq->ParamSel & RESERVED_VALUE_80)
- // {
- // /* Alarm !!! Somebody is trying to set Reseved Bits */
- // *pRes = CC_INV_DATA_FIELD;
- // return sizeof (*pRes);
- // }
- // ParamSel = pGetBootOptReq->ParamSel & 0x7F;
- // SSIComputeBladeSupport = g_corefeatures.ssi_support;
- // /*Check for validity of parameter */
- // if(SSIComputeBladeSupport)
- // {
- // if ((ParamSel >= sizeof (m_BootOptParamLen)) && (ParamSel != CHASSIS_AMI_OEM_PARAM) &&
- // (ParamSel != SSICB_OEM_PARAM_BLK_SIZE_TBL) && (ParamSel < SSICB_BOOT_ORDER_TBL || ParamSel > SSICB_SLOT_CONFIG_TBL))
- // {
- // pGetBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED;
- // return sizeof(uint8_t);
- // }
- // }
- // else
- // {
- // if ((ParamSel >= sizeof (m_BootOptParamLen)) && (ParamSel != CHASSIS_AMI_OEM_PARAM))
- // {
- // pGetBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED;
- // return sizeof(uint8_t);
- // }
- // }
- // /*Check the validity of Setselector & Blockselector */
- // if(SSIComputeBladeSupport)
- // {
- // if (((0 != pGetBootOptReq->SetSel) && (ParamSel != CHASSIS_BOOT_INITIATOR_MBOX || ParamSel != SSICB_BOOT_ORDER_TBL)) ||
- // (ParamSel == CHASSIS_BOOT_INITIATOR_MBOX && pGetBootOptReq->SetSel >= MAX_BOOT_INIT_MAILBOX_BLOCKS) ||
- // (ParamSel == SSICB_BOOT_ORDER_TBL && pGetBootOptReq->SetSel >= g_coremacros.ssi_bot_dev_num) ||
- // (0 != pGetBootOptReq->BlockSel))
- // {
- // IPMI_DBG_PRINT ("Set Selector or Block Selector is invalid\n") ;
- // pGetBootOptRes->CompletionCode = CC_INV_DATA_FIELD;
- // return sizeof(uint8_t);
- // }
- // }
- // else
- // {
- // if (((0 != pGetBootOptReq->SetSel) && (ParamSel != CHASSIS_BOOT_INITIATOR_MBOX)) ||
- // (pGetBootOptReq->SetSel >= MAX_BOOT_INIT_MAILBOX_BLOCKS) ||
- // (0 != pGetBootOptReq->BlockSel))
- // {
- // IPMI_DBG_PRINT ("Set Selector or Block Selector is invalid\n") ;
- // pGetBootOptRes->CompletionCode = CC_INV_DATA_FIELD;
- // return sizeof(uint8_t);
- // }
- // }
- // pGetBootOptRes->CompletionCode = CC_NORMAL;
- // pGetBootOptRes->ParamVersion = CHASSIS_PARAMETER_VERSION;
- // pGetBootOptRes->ParameterValid = ParamSel;
- // OS_THREAD_MUTEX_ACQUIRE(&g_BMCInfo.ChassisMutex, WAIT_INFINITE);
- // // get a local copy of the boot option from the shared memory
- // sBootOptions = BMC_GET_SHARED_MEM(BMCInst)->sBootOptions;
- // /*Set the Parameter valid bit if needed */
- // if (sBootOptions.ParameterValid & (1 << ParamSel))
- // {
- // pGetBootOptRes->ParameterValid |= 0x80;
- // }
- // /*Set initial length of Completion code,Param revision & Paramvalid */
- // ResponseLength = 0x03;
- // /*Load the specific parameter */
- // switch (ParamSel)
- // {
- // case CHASSIS_SET_INPROG :
- // pGetBootOptRes->BootParams.SetInProgress = sBootOptions.u8SetInProgress;
- // ResponseLength += sizeof (sBootOptions.u8SetInProgress);
- // break;
- // case CHASSIS_SERVICE_PART_SEL:
- // pGetBootOptRes->BootParams.ServicePartitionSelector =
- // sBootOptions.ServicePartitionSelector;
- // ResponseLength += sizeof (sBootOptions.ServicePartitionScan);
- // break;
- //
- // case CHASSIS_SERVICE_PART_SCAN:
- // pGetBootOptRes->BootParams.ServicePartitionScan = g_BMCInfo.ChassisConfig.SysPartitionScan;
- // ResponseLength += sizeof (sBootOptions.ServicePartitionScan);
- // break;
- //
- // case CHASSIS_BOOT_FLAG_VALID_BIT_CLEAR:
- // pGetBootOptRes->BootParams.BootFlagValidBitClearing =
- // sBootOptions.BootFlagValidBitClearing;
- // ResponseLength += sizeof (sBootOptions.BootFlagValidBitClearing);
- // break;
- //
- // case CHASSIS_BOOT_INFO_ACK:
- // _fmemcpy (( uint8_t*)&pGetBootOptRes->BootParams.BootInfoAck,
- // ( uint8_t*)&sBootOptions.BootInfoAck,
- // sizeof (BootInfoAck_T));
- // pGetBootOptRes->BootParams.BootInfoAck.WriteMask = 0;
- // ResponseLength += sizeof (BootInfoAck_T);
- // break;
- //
- // case CHASSIS_BOOT_FLAGS:
- // _fmemcpy (( uint8_t*)&pGetBootOptRes->BootParams.BootFlags,
- // ( uint8_t*)&sBootOptions.BootFlags,
- // sizeof (BootFlags_T));
- // ResponseLength += sizeof (BootFlags_T);
- // break;
- // case CHASSIS_BOOT_INITIATOR_INFO:
- // _fmemcpy (( uint8_t*)&pGetBootOptRes->BootParams.BootInitiatorInfo,
- // ( uint8_t*)&sBootOptions.BootInitiatorInfo,
- // sizeof (BootInitiatorInfo_T));
- // ResponseLength += sizeof (BootInitiatorInfo_T);
- // break;
- //
- // case CHASSIS_BOOT_INITIATOR_MBOX:
- // pGetBootOptRes->BootParams.BootMailBox.BlockSel = pGetBootOptReq->SetSel;
- // _fmemcpy (( uint8_t*)&pGetBootOptRes->BootParams.BootMailBox.BootMBox,
- // ( uint8_t*)&sBootOptions.BootMailBox[pGetBootOptReq->SetSel],
- // sizeof (BootInitiatorMailbox_T));
- // ResponseLength += sizeof (BootInitiatorMboxReq_T);
- // break;
- // case CHASSIS_AMI_OEM_PARAM:
- // _fmemcpy (( uint8_t*)&pGetBootOptRes->BootParams.Oem,
- // ( uint8_t*)&g_BMCInfo.ChassisConfig.OemBootOpt,
- // sizeof (AMI_BootOpt_T));
- // ResponseLength += sizeof (AMI_BootOpt_T);
- // break;
- // case SSICB_OEM_PARAM_BLK_SIZE_TBL:
- // if(SSIComputeBladeSupport)
- // {
- // _fmemcpy (( uint8_t*)&pGetBootOptRes->BootParams.OemParamBlkSizeTbl,
- // ( uint8_t*)&sBootOptions.OemParamBlkSizeTbl,
- // sizeof(OemParamBlkSizeTbl_T));
- // ResponseLength += sizeof(OemParamBlkSizeTbl_T);
- // break;
- // }
- // else
- // {
- // pGetBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED ;
- // ResponseLength = 1 ;
- // break;
- // }
- // case SSICB_BOOT_ORDER_TBL:
- // if(SSIComputeBladeSupport)
- // {
- // _fmemcpy (( uint8_t*)&pGetBootOptRes->BootParams.BootOrderTbl,
- // ( uint8_t*)&sBootOptions.BootOrderTbl[pGetBootOptReq->SetSel * sizeof(BootOrderTbl_T)],
- // sizeof(BootOrderTbl_T));
- // ResponseLength += sizeof(BootOrderTbl_T);
- // break;
- // }
- // else
- // {
- // pGetBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED ;
- // ResponseLength = 1 ;
- // break;
- // }
- // case SSICB_BOOT_DEV_SELECTOR:
- // if(SSIComputeBladeSupport)
- // {
- // pGetBootOptRes->BootParams.BootDevSelector = sBootOptions.BootDevSelector;
- // ResponseLength += sizeof(sBootOptions.BootDevSelector);
- // break;
- // }
- // else
- // {
- // pGetBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED ;
- // ResponseLength = 1 ;
- // break;
- // }
- // case SSICB_SLOT_CONFIG_TBL:
- // if(SSIComputeBladeSupport)
- // {
- // _fmemcpy (( uint8_t*)&pGetBootOptRes->BootParams.SlotConfigTbl,
- // ( uint8_t*)&sBootOptions.SlotConfigTbl,
- // sizeof(SlotConfigTbl_T));
- // ResponseLength += sizeof(SlotConfigTbl_T);
- // break;
- // }
- // else
- // {
- // pGetBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED ;
- // ResponseLength = 1 ;
- // break;
- // }
- // default :
- // pGetBootOptRes->CompletionCode = CC_PARAM_NOT_SUPPORTED ;
- // ResponseLength = 1 ;
- // }
- // OS_THREAD_MUTEX_RELEASE(&g_BMCInfo.ChassisMutex);
- // return ResponseLength;
- return 1;
- }
- /*-------------------------------------
- * SetFPButtonEnables
- *-------------------------------------*/
- int
- SetFPButtonEnables ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
- {
- printf("SetFPButtonEnables not implement\r\n");
- //#if 0 //FQLI
- // PMConfig_T* pPMConfig;
- // bool bRet;
- // SetFPBtnEnablesRes_T* pFPBtnEnablesRes = (SetFPBtnEnablesRes_T*)pRes;
- // SetFPBtnEnablesReq_T* pFPBtnEnablesReq = (SetFPBtnEnablesReq_T*)pReq;
- // IPMI_DBG_PRINT ("PwrCtrl - SetFrontPanelEnables\n");
- // pFPBtnEnablesRes->CompletionCode = CC_INV_CMD;
- // if (pReq)
- // {
- // pFPBtnEnablesRes->CompletionCode = CC_NORMAL;
- // // retrieve chassis status from the NVStore
- // pPMConfig = ( PMConfig_T*)GetNVRAddr(NVRH_PMCONFIG);
- // // store the front panel enables to the NVStore
- // pPMConfig->ChassisConfig.ChassisPowerState.FPBtnEnables = pFPBtnEnablesReq->ButtonEnables;
- // // enable / disable front panel buttons. do the set before store the value in case the
- // // action fails. if failed to set the passthrough buttons, the current reading will be
- // // used to be the current settings.
- // bRet = PDK_SetFPEnable(&pFPBtnEnablesReq->ButtonEnables);
- // if (bRet != TRUE)
- // {
- // pFPBtnEnablesRes->CompletionCode = CC_UNSPECIFIED_ERR;
- // }
- // FlushPMC(&pPMConfig->ChassisConfig.ChassisPowerState.sFrontPanelButton, sizeof(ChassisPowerState_T));
- // }
- // return sizeof (SetFPBtnEnablesRes_T);
- //#else //AMI
- // SetFPBtnEnablesReq_T* pFPBtnEnablesReq = ( SetFPBtnEnablesReq_T*)pReq;
- // SetFPBtnEnablesRes_T* pFPBtnEnablesRes = ( SetFPBtnEnablesRes_T*)pRes;
- // BMCInfo_t *pBMCInfo = &g_BMCInfo[BMCInst];
- // IPMI_DBG_PRINT ("Set FP Button Enables\n");
- // /* Check for the reserved bytes should b zero */
- // if ( 0 != (pFPBtnEnablesReq->ButtonEnables & RESERVED_BITS_SETFPBUTTONENABLES ) )
- // {
- // pFPBtnEnablesRes->CompletionCode = CC_INV_DATA_FIELD;
- // return sizeof(uint8_t);
- // }
- // OS_THREAD_MUTEX_ACQUIRE(&g_BMCInfo.ChassisMutex, WAIT_INFINITE);
- // g_BMCInfo.ChassisConfig.ChassisPowerState.FPBtnEnables = pFPBtnEnablesReq->ButtonEnables;
- // if(g_PDKHandle[PDK_FPENABLE] != NULL)
- // {
- // ((int(*)(uint8_t,int))g_PDKHandle[PDK_FPENABLE]) (pFPBtnEnablesReq->ButtonEnables,BMCInst);
- // }
- // /* Save in NVR */
- // FlushIPMI((uint8_t*)&g_BMCInfo.IpmiConfig,sizeof(IPMIConfig_T));
- // pFPBtnEnablesRes->CompletionCode = 0x00;
- // return sizeof (SetFPBtnEnablesRes_T);
- //#endif //FQLI
- return 1;
- }
- /*-------------------------------------
- * SetPowerCycleInterval
- *-------------------------------------*/
- int
- SetPowerCycleInterval ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
- {
- SetPowerCycleIntervalReq_T* pSetPowerCycleInterval = (SetPowerCycleIntervalReq_T*) pReq;
- SetPowerCycleIntervalRes_T* pSetPowerCycleIntervalRes = (SetPowerCycleIntervalRes_T*) pRes;
- g_BMCInfo.IpmiConfig.PowerCycleInterval = pSetPowerCycleInterval->PowerCycleInterval;
- pSetPowerCycleIntervalRes->CompletionCode = CC_NORMAL;
- UpdateFlash();
- return sizeof(SetPowerCycleIntervalRes_T);
- }
- #endif /* CHASSIS_DEVICE */
|