1004                 descr_offset += (isd->isd_addl_length + 2);
1005         }
1006 
1007         dprintf("\n");
1008 }
1009 
1010 static int
1011 uscsi_timeout(void)
1012 {
1013         const char *env = getenv("USCSI_TIMEOUT");
1014         static int timeo = -1;
1015         int i;
1016 
1017         if (timeo > 0)
1018                 return (timeo);
1019 
1020         if (env != NULL) {
1021                 i = atoi(env);
1022                 if (i > USCSI_TIMEOUT_MAX)
1023                         i = USCSI_TIMEOUT_MAX;
1024                 else if (i < 0)
1025                         i = USCSI_DEFAULT_TIMEOUT;
1026         } else
1027                 i = USCSI_DEFAULT_TIMEOUT;
1028 
1029         timeo = i;
1030         return (i);
1031 }
1032 
1033 /*
1034  * Execute a command and determine the result.  Uses the "uscsi" ioctl
1035  * interface, which is fully supported.
1036  *
1037  * If the user wants request sense data to be returned in case of error then ,
1038  * the "uscsi_cmd" structure should have the request sense buffer allocated in
1039  * uscsi_rqbuf.
1040  */
1041 static int
1042 uscsi_cmd(int fd, struct uscsi_cmd *ucmd, void *rqbuf, int *rqlen)
1043 {
1044         struct scsi_extended_sense *rq;
 
 | 
 
 
1004                 descr_offset += (isd->isd_addl_length + 2);
1005         }
1006 
1007         dprintf("\n");
1008 }
1009 
1010 static int
1011 uscsi_timeout(void)
1012 {
1013         const char *env = getenv("USCSI_TIMEOUT");
1014         static int timeo = -1;
1015         int i;
1016 
1017         if (timeo > 0)
1018                 return (timeo);
1019 
1020         if (env != NULL) {
1021                 i = atoi(env);
1022                 if (i > USCSI_TIMEOUT_MAX)
1023                         i = USCSI_TIMEOUT_MAX;
1024                 else if (i <= 0)
1025                         i = USCSI_DEFAULT_TIMEOUT;
1026         } else
1027                 i = USCSI_DEFAULT_TIMEOUT;
1028 
1029         timeo = i;
1030         return (i);
1031 }
1032 
1033 /*
1034  * Execute a command and determine the result.  Uses the "uscsi" ioctl
1035  * interface, which is fully supported.
1036  *
1037  * If the user wants request sense data to be returned in case of error then ,
1038  * the "uscsi_cmd" structure should have the request sense buffer allocated in
1039  * uscsi_rqbuf.
1040  */
1041 static int
1042 uscsi_cmd(int fd, struct uscsi_cmd *ucmd, void *rqbuf, int *rqlen)
1043 {
1044         struct scsi_extended_sense *rq;
 
 |