Terminal.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /****************************************************************
  2. ****************************************************************
  3. ** **
  4. ** (C)Copyright 2005-2006, American Megatrends Inc. **
  5. ** **
  6. ** All Rights Reserved. **
  7. ** **
  8. ** 6145-F, Northbelt Parkway, Norcross, **
  9. ** **
  10. ** Georgia - 30071, USA. Phone-(770)-246-8600. **
  11. ** **
  12. ****************************************************************
  13. ****************************************************************/
  14. /*****************************************************************
  15. *
  16. * terminal.h
  17. * Serial Terminal Mode Handler
  18. *
  19. * Author: Vinoth Kumar <vinothkumars@ami.com>
  20. *
  21. *****************************************************************/
  22. #ifndef TERMINAL_H
  23. #define TERMINAL_H
  24. #include "Message.h"
  25. /*** MACRO Definitions ***/
  26. #define HEALTH_STATUS_OK 0
  27. #define HEALTH_STATUS_NC 1
  28. #define HEALTH_STATUS_CR 2
  29. #define HEALTH_STATUS_NR 3
  30. #define HEALTH_STATUS_UF 4
  31. #define HEALTH_STATUS_UN 5
  32. #define TERM_START_BYTE '['
  33. #define TERM_END_BYTE ']'
  34. #pragma pack( 1 )
  35. /*** Type Definitions ***/
  36. /**
  37. * @struct HealthState_T
  38. * @brief Terminal mode health status structure
  39. **/
  40. typedef struct
  41. {
  42. INT8U OverallHealth; /**< Overall Health */
  43. INT8U TemperatureSys; /**< Temperature Sys */
  44. INT8U Volatge; /**< Voltage Sys */
  45. INT8U PowerSubSys; /**< Power Sub System */
  46. INT8U CoolingSys; /**< Cooling System */
  47. INT8U HardDrive; /**< Hard Drive */
  48. INT8U PhysicalSecurity; /**< Physical Security */
  49. INT8U PowerState; /**< Power State */
  50. } PACKED HealthState_T;
  51. #pragma pack( )
  52. /*** Extern Definitions ***/
  53. /*** Functions Prototypes ***/
  54. /**
  55. * @brief Processes the terminal requests
  56. * @param pReq Pointer to request message packet
  57. **/
  58. extern void ProcessTerminalReq (_NEAR_ MsgPkt_T* pReq,int BMCInst);
  59. /**
  60. * @brief Called by the interrupt after receiving a byte through serial port
  61. * @param byte a data byte received throught serial port
  62. **/
  63. extern void OnTerminalByte (INT8U byte,int BMCInst);
  64. /**
  65. * @brief Processes the ECHO request from serial interface
  66. * @param pReq Pointer to request message packet
  67. **/
  68. extern void ProcessEchoReq (_NEAR_ MsgPkt_T* pReq,int BMCInst);
  69. /**
  70. * @brief This function is called to process Terminal mode command.
  71. **/
  72. extern int PDK_TerminalCmd (INT8U* pReq, INT8U ReqLen,
  73. INT8U* pRes, INT8U* ResLen,
  74. INT8U SessionActivated);
  75. #endif /* TERMINAL_H */