The aha152x panic of Canon Backend for FB620S

From: Mitsuru Okaniwa (m-okaniwa@bea.hi-ho.ne.jp)
Date: Sun Jan 28 2001 - 20:03:40 PST

  • Next message: stef: "UMAX 1220P/2000P & HP 320C backend initial release"

    Hi
    I modified Canon backend for FB620S and SANE1.0.3.
    I have added a reset_scanner function and a calibration function as
    follows.

    1) a reset_scanner
    This command resets the scanner.
    When issuing this Reset command during a scan, follow the procedure below:
    * Switch to the Standby mode (return to HP).
    * Execute Reset, then send back the Status.

    This command sends back an error only in the case of a command parameter
    error.
    For other errors(like HP errors), it still sends back the Good status.

    I modified canon-scsi.c as follows.
    =================================================
    static SANE_Status
    reset_scanner (int fd)
    {
      static u_char cmd[6];
      int status;
      DBG (31, ">> reset_scanner\n");

      memset (cmd, 0, sizeof (cmd));
      cmd[0] = 0xc1;
      status = sanei_scsi_cmd2 (fd, cmd, sizeof (cmd), 0, 0, 0, 0);

      DBG (31, "<< reset_scanner \n");
      return (status);
    }
    =================================================

    And modified canon-sane.c as follows.
    =================================================
    In sane_get_parameters function

        case OPT_RESET_SCANNER:
          sanei_scsi_open (s->hw->sane.name, &s->fd, sense_handler, 0);
          if (status == SANE_STATUS_GOOD)
          {
            status = reset_scanner(s->fd);
            if (status != SANE_STATUS_GOOD)
            {
     DBG (21, "RESET SCANNER failed\n");
                sanei_scsi_close (s->fd);
     s->fd = -1;
     return (SANE_STATUS_INVAL);
            }
            DBG (21, "RESET SCANNER\n");
            sanei_scsi_close (s->fd);
          }
         else
          {
            DBG (1, "reset scanner: cannot open device file\n");
          }
          s->fd = -1;
          return status;
    =================================================

    2) a calibration
    modulated-light data setting and shading.

    I modified canon-scsi.c as follows.
    =================================================
    static SANE_Status
    execute_calibration (int fd)
    {
      static u_char cmd[6];
      u_char data[2];
      int status;
      DBG (31, ">> execute_calibration\n");

      memset (cmd, 0, sizeof (cmd));
      memset (data, 0, sizeof (data));
      cmd[0] = 0xc2;
      cmd[4] = 2;
      status = sanei_scsi_cmd2 (fd, cmd, sizeof (cmd), data, sizeof (data), 0,
    0);

      DBG (31, "<< execute_calibration\n");
      return (status);
    }
    =================================================

    And modified canon-sane.c as follows.
    =================================================
    In sane_get_parameters function

        case OPT_CALIBRATION_NOW:
          sanei_scsi_open (s->hw->sane.name, &s->fd, sense_handler, 0);
          if (status == SANE_STATUS_GOOD)
          {
            status = execute_calibration(s->fd);
            if (status != SANE_STATUS_GOOD)
            {
     DBG (21, "EXECUTE CALIBRATION failed\n");
                sanei_scsi_close (s->fd);
     s->fd = -1;
     return (SANE_STATUS_INVAL);
            }
            DBG (21, "EXECUTE CALIBRATION\n");
            sanei_scsi_close (s->fd);
          }
         else
          {
            DBG (1, "calibration: cannot open device file\n");
          }
          s->fd = -1;
          return status;
     =================================================
    I have made the button of "reset_scanner" and "execute_calibration"
    in the xscanimage.
    It was run very well.....
    So, this modification seemed to be successful at first.
    But when I used xscanimage as follows I found the bug.

    In xscanimage, during a return to the start position of a light
    source bar in scanner after the preview, I click the reset_scanner button.
    Then a light bar in scanner stop halfway.
    And I click the execute_calibration button.
    So, the calibration does not run and I have an "aha152x panic".
    I must reboot the Linux to run the xscanimage.
    And X server was broken.

    The kernel(2.2.16) was not shutdown normally as follows.
    My computer is note-PC and I use Adaptec Slim SCSI(aha152x).

    ========================================================
    Shutting down interface eth0
    Stopping pcmcia SCSI device not inactive - r
    rq - status = 1, target = 2, pid = 912, state = 4099, owner = 258.
    Device busy ???
    target doesn't enter MSGI to identify(phase = 01)

    aha152x: unknown lun
    QUEUE STATUS:
    issue_SC:
    current_SC:
    none
    disconnected_SC:
    0xc2ee600: target = 2; lun = 0; cmnd = (VENDOR SPECIFIC (0xc2) 00 00 00 02
    00 00 00 00 00); residual = 0; buffers = 0; phase | disconnected |
    send_ident |;
    in other (MESSAGE IN); phaseend; next = 0x00000000
    enabled interrupts (ENSELDO ENSELDI ENSELINGO ENSWRAP ENSDONE ENSPIORDY
    ENDMADONE ENSELTIMO ENATNTARG ENPHASEMIS ENBUSFREE ENSCSIPERR ENPHASECHG
    ENREQINIT)
    Kernel panic: aha152x panic
    In interrupt handler - not syncing
    ========================================================

    I don't know the reason of this bug.
    This problem is hard.

    Would anybody help me ?
    regards,
    -----------------------------
    Mitsuru Okaniwa
    email : m-okaniwa@bea.hi-ho.ne.jp
    tel : (Japan)0566-26-6105
    -----------------------------

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Sun Jan 28 2001 - 20:17:34 PST