Lines Matching +defs:error +defs:target
255 scsipi_lookup_periph_internal(struct scsipi_channel *chan, int target, int lun, bool lock)
260 if (target >= chan->chan_ntargets ||
264 hash = scsipi_chan_periph_hash(target, lun);
269 if (periph->periph_target == target &&
280 scsipi_lookup_periph_locked(struct scsipi_channel *chan, int target, int lun)
282 return scsipi_lookup_periph_internal(chan, target, lun, false);
286 scsipi_lookup_periph(struct scsipi_channel *chan, int target, int lun)
288 return scsipi_lookup_periph_internal(chan, target, lun, true);
824 * prints a command descriptor block (for debug purpose, error messages,
871 * Look at the returned sense and act on the error, determining
872 * the unix error number to pass back. (0 = report no error)
885 int error;
888 "soft error (corrected)",
889 "not ready", "medium error",
895 "verify miscompare", "unknown error key"
929 * If the periph has its own error handler, call it first.
930 * If it returns a legit error value, return that, otherwise
931 * it wants us to continue with normal error processing.
936 error = (*periph->periph_switch->psw_error)(xs);
937 if (error != EJUSTRETURN)
938 return error;
947 case 0x00: /* no error (command completed OK) */
954 /* XXX - display some sort of error here? */
968 case 0x71: /* delayed error */
989 error = 0;
992 error = 0;
1000 error = ENODEV; /* Medium not present */
1002 return error;
1004 error = EIO;
1006 return error;
1022 error = EINVAL;
1041 error = EIO;
1044 error = EROFS;
1047 error = 0;
1052 error = ERESTART;
1054 error = EIO;
1057 error = ENOSPC;
1062 error = ERESTART;
1064 error = EIO;
1067 error = EIO;
1075 return error;
1109 return error;
1117 static const char *uc = "undecodable sense error";
1206 int error;
1216 * return a short response. However, some devices error with an
1228 error = scsipi_command(periph, (void *)&cmd, sizeof(cmd),
1231 if (!error &&
1238 error = scsipi_command(periph, (void *)&cmd, sizeof(cmd),
1242 printf("inquire: error=%d\n", error);
1252 if (error == EINVAL || error == EACCES) {
1256 inqbuf->device = (error == EINVAL ?
1265 error = 0;
1272 else if (error == 0 &&
1288 return error;
1527 "[RSOC_REPORT_SUPPORTED_OPCODES] failed error=%d"
1658 * If the xfer had an error of any sort, freeze the
1663 if (xs->error != XS_NOERROR)
1674 if (xs->error == XS_BUSY && xs->status == SCSI_CHECK) {
1681 * let the requesting thread perform error checking/handling
1704 * without error; no use in taking a context switch
1707 if (xs->error == XS_NOERROR) {
1714 * There is an error on this xfer. Put it on the channel's
1738 * xs->error == XS_NOERROR
1746 * ERESTART Xfer had an error, but was restarted.
1748 * anything else Xfer had an error, return value is Unix
1763 int error;
1779 if (xs->error == XS_BUSY && xs->status == SCSI_CHECK) {
1785 /* we've been frozen because xs->error != XS_NOERROR */
1807 if (xs->error != XS_NOERROR)
1815 switch (xs->error) {
1817 error = 0;
1822 error = (*chan->chan_bustype->bustype_interpret_sense)(xs);
1834 if (xs->error == XS_BUSY && xs->status == SCSI_QUEUE_FULL) {
1862 error = ERESTART;
1879 error = ERESTART;
1881 error = EBUSY;
1885 error = ERESTART;
1900 error = ERESTART;
1902 error = EIO;
1911 error = EINTR;
1915 error = ERESTART;
1917 error = EIO;
1923 printf("generic HBA error\n");
1924 error = EIO;
1928 printf("invalid return code from adapter: %d\n", xs->error);
1929 error = EIO;
1934 if (error == ERESTART) {
1944 xs->error = XS_NOERROR;
1948 error = scsipi_enqueue(xs);
1949 if (error == 0) {
1960 if (xs->error != XS_NOERROR)
1965 periph->periph_switch->psw_done(xs, error);
1972 return error;
1985 int flags, error;
2003 error = scsipi_command(periph, (void *)&cmd, sizeof(cmd),
2008 switch (error) {
2011 xs->error = XS_SENSE;
2015 xs->error = XS_RESET;
2023 xs->error = XS_DRIVER_STUFFUP;
2027 xs->error = XS_DRIVER_STUFFUP;
2029 printf("request sense failed with error %d\n", error);
2054 xs->error = XS_DRIVER_STUFFUP;
2059 * If we have an URGENT xfer, it's an error recovery command
2218 int oasync, async, poll, error;
2227 xs->error = XS_NOERROR;
2311 * should ALWAYS return `no error'.
2313 error = scsipi_enqueue(xs);
2314 if (error) {
2318 error);
2353 * the error handling.
2356 error = scsipi_complete(xs);
2357 if (error == ERESTART)
2362 * don't return an error here. It has already been handled
2365 error = 0;
2367 * Command completed successfully or fatal error occurred. Fall
2382 return error;
2389 * asynchronous xfers, and perform the error handling
2444 * Have an xfer with an error; process it.
2569 scsipi_set_xfer_mode(struct scsipi_channel *chan, int target, int immed)
2578 xm.xm_target = target;
2587 itperiph = scsipi_lookup_periph(chan, target, lun);
2622 int target, lun;
2635 xs->error = XS_RESET;
2643 for (target = 0; target < chan->chan_ntargets; target++) {
2644 if (target == chan->chan_id)
2647 periph = scsipi_lookup_periph_locked(chan, target, lun);
2651 xs->error = XS_RESET;
2664 scsipi_target_detach(struct scsipi_channel *chan, int target, int lun,
2671 int error = 0;
2673 if (target == -1) {
2677 if (target == chan->chan_id)
2679 if (target < 0 || target >= chan->chan_ntargets)
2681 mintarget = target;
2682 maxtarget = target + 1;
2709 error = config_detach(tdev, flags);
2710 if (error)
2721 return error;
2733 int error = 0;
2738 error = scsipi_adapter_enable(adapt, 1);
2740 if (error)
2743 return error;
2863 int error;
2869 error = (adapt->adapt_ioctl)(chan, cmd, data, flag, p);
2871 return error;
2877 int error;
2880 error = (adapt->adapt_enable)(adapt->adapt_dev, enable);
2882 return error;
2904 printf("err(0x%x)", xs->error);