Lines Matching defs:command

117  * Execute a command and determine the result.
120 cmd(int file, struct uscsi_cmd *command, int flag)
132 command->uscsi_flags = USCSI_RQENABLE;
133 command->uscsi_flags |= flag;
138 /* print command for debug */
140 if ((command->uscsi_cdb == NULL) ||
152 "SCSI command: %s\n",
153 g_scsi_find_command_name(command->uscsi_cdb[0]));
155 for (i = 0; i < (int)command->uscsi_cdblen; i++) {
156 (void) printf("%x ", *(command->uscsi_cdb + i));
160 command->uscsi_cdblen,
161 command->uscsi_bufaddr,
162 command->uscsi_buflen, command->uscsi_flags);
164 if ((command->uscsi_buflen > 0) &&
167 (uchar_t *)command->uscsi_bufaddr,
168 MIN(command->uscsi_buflen, 512), HEX_ASCII);
176 * Default command timeout in case command left it 0
178 if (command->uscsi_timeout == 0) {
179 command->uscsi_timeout = 60;
181 /* Issue command - finally */
184 status = ioctl(file, USCSICMD, command);
185 if (status == 0 && command->uscsi_status == 0) {
187 if ((command->uscsi_buflen > 0) &&
190 (uchar_t *)command->uscsi_bufaddr,
191 MIN(command->uscsi_buflen, 512), HEX_ASCII);
196 if ((status != 0) && (command->uscsi_status == 0)) {
210 if ((command->uscsi_rqbuf != NULL) &&
211 (((char)command->uscsi_rqlen - (char)command->uscsi_rqresid) > 0)) {
213 rqbuf = (struct scsi_extended_sense *)command->uscsi_rqbuf;
249 g_scsi_printerr(command,
250 (struct scsi_extended_sense *)command->uscsi_rqbuf,
251 (command->uscsi_rqlen - command->uscsi_rqresid),
265 * command queue has a depth of one command.
267 switch ((uchar_t)command->uscsi_status & STATUS_MASK) {
329 return (L_SCSI_ERROR | command->uscsi_status);