2015年4月7日 星期二

Enable kcs debug for OpenIPMI driver

可以透過下列的方式打開kcs debug...
echo 7 > /sys/module/ipmi_si/parameters/kcs_debug

即可在dmesg看到kcs state, 包含兩個數字

第一個數字為driver定義的kcs state:



enum kcs_states {
/* The KCS interface is currently doing nothing. */
KCS_IDLE,

/*
* We are starting an operation.  The data is in the output
* buffer, but nothing has been done to the interface yet.  This
* was added to the state machine in the spec to wait for the
* initial IBF.
*/
KCS_START_OP,

/* We have written a write cmd to the interface. */
KCS_WAIT_WRITE_START,

/* We are writing bytes to the interface. */
KCS_WAIT_WRITE,

/*
* We have written the write end cmd to the interface, and
* still need to write the last byte.
*/
KCS_WAIT_WRITE_END,

/* We are waiting to read data from the interface. */
KCS_WAIT_READ,

/*
* State to transition to the error handler, this was added to
* the state machine in the spec to be sure IBF was there.
*/
KCS_ERROR0,

/*
* First stage error handler, wait for the interface to
* respond.
*/
KCS_ERROR1,

/*
* The abort cmd has been written, wait for the interface to
* respond.
*/
KCS_ERROR2,

/*
* We wrote some data to the interface, wait for it to switch
* to read mode.
*/
KCS_ERROR3,

/* The hardware failed to follow the state machine. */
KCS_HOSED
};

第二個數字為IPMI spec所定義的kcs interface status register bits, 可以獲知目前kcs interface state (idle, read, write or error states), 另亦可知道IBF與OBF value。



沒有留言: