[sane-devel] scsi scan command

m. allan noah kitno455 at gmail.com
Wed Oct 24 23:07:51 UTC 2007


On 10/24/07, jazz_johnson at verizon.net <jazz_johnson at verizon.net> wrote:
> Where, according to the MANUAL,
>
> "the Transfer Length is the
> byte-length of the Window List transferred by the initiator in the
> DATA OUTPUT PHASE, and the Window List is a list of WIndow Identifiers
> created by the SET WINDOW command.
> Only one Window is supported with regard to Scan command. Therefore,
> 0 or 1 is used for Window Identifier, and 1 or 2 for Transfer Length."

that statement actually contradicts itself.

> Then in my trigger_scan command, based on ibm.c,
> I have :
>
> typedef struct {
>   SANE_Byte  opcode;   /* 0x1B */
>   SANE_Byte   B1;           /* LUN : reserved */
>   SANE_Byte   pc;            /* page code */
>   SANE_Byte   B2;           /* reserved */
>   SANE_Byte   len            /* transfer length */
>   SANE_Byte   control;   /* VU : reserved : Flag : Link */
> }START_SCAN;
>
> trigger_scan (HS2P_Scanner *s)
> {
>   static START_SCAN  cmd;
>   static SANE_Byte      window_id_list[2] = { 0, 1} ;
>   SANE_Status             status;
>   size_t                           wl_size = sizeof(window_id_list);
>
>   memset (&cmd, 0, sizeof (cmd));                /* CLEAR cmd */
>   cmd.opcode = HS2P_SCSI_START_SCAN; /* 1BH */
>   cmd.len = (s->val[OPT_DUPLEX].w == SANE_TRUE)? 2 : 1 ;
>
>   status = sanei_scsi_cmd (s->fd, &cmd, sizeof (cmd), &window_id_list[0],
> &wl_size);
>   /* I've also tried the following line, but also get ILLEGAL REQUEST
>   status = sanei_scsi_cmd (s->fd, &cmd, sizeof (cmd), NULL, NULL);
>   */
>   return (status);
> }

so you are telling it in the command that you are going to transfer 1
or 2 bytes, but you always transfer 2 (wl_size)?

allan

-- 
"The truth is an offense, but not a sin"



More information about the sane-devel mailing list