<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 2018-02-02 04:32, Corey Minyard
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:66b3a8f8-b477-6ada-5ced-944a5b67edd3@acm.org">
      <blockquote type="cite" style="color: #000000;">+static void
        kcs_bmc_handle_cmd(struct kcs_bmc *kcs_bmc)
        <br>
        +{
        <br>
        +    u8 cmd;
        <br>
        +
        <br>
        +    set_state(kcs_bmc, WRITE_STATE);
        <br>
        +    write_data(kcs_bmc, KCS_ZERO_DATA);
        <br>
        +
        <br>
        +    cmd = read_data(kcs_bmc);
        <br>
        +    switch (cmd) {
        <br>
        +    case KCS_CMD_WRITE_START:
        <br>
        +        if (kcs_bmc->phase != KCS_PHASE_IDLE &&
        <br>
        +            kcs_bmc->phase != KCS_PHASE_ERROR) {
        <br>
        +            kcs_force_abort(kcs_bmc);
        <br>
        +            break;
        <br>
        +        }
        <br>
        +
        <br>
      </blockquote>
      <br>
      The spec says you can do a write start basically any time and the
      state machine starts over. I know I kind of went back and forth on
      this in my previous email, but what you had before is correct, I
      think.
      <br>
      <br>
    </blockquote>
    So change it to the bellowing code is OK now? :-)<br>
    <br>
    <pre wrap="">+      case KCS_CMD_WRITE_START:
+               kcs_bmc->data_in_avail = false;
+               kcs_bmc->data_in_idx   = 0;
+               kcs_bmc->phase         = KCS_PHASE_WRITE;
+               kcs_bmc->error         = KCS_NO_ERROR;
+               break;</pre>
    <blockquote type="cite"
      cite="mid:66b3a8f8-b477-6ada-5ced-944a5b67edd3@acm.org">-corey
    </blockquote>
    <br>
  </body>
</html>