Lines Matching +full:max +full:- +full:retries

1 /* SPDX-License-Identifier: GPL-2.0 */
8 #include <linux/blk-mq.h>
49 * originate in the mid-layer) */
86 /* put union of data structures, for non-simple event types,
92 * struct scsi_vpd - SCSI Vital Product Data
107 /* the next two are protected by the host->host_lock */
118 unsigned short max_queue_depth; /* max queue depth */
130 * vendor-specific cmd's */
133 void *hostdata; /* available to low-level driver */
144 #define SCSI_DEFAULT_VPD_LEN 255 /* default SCSI VPD page size (max) */
163 * If true, let the high-level device driver (sd) manage the device
170 * If true, let the high-level device driver (sd) manage the device
176 * If true, let the high-level device driver (sd) manage the device
182 * If set and if the device is runtime suspended, ask the high-level
204 unsigned tagged_supported:1; /* Supports SCSI-II tagged queuing */
210 unsigned use_10_for_rw:1; /* first try 10-byte read / write */
211 unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */
300 to_scsi_device(class_dev->parent)
303 dev_dbg(&(sdev)->sdev_gendev, fmt, ##a)
323 if (__rq->q->disk) \
324 sdev_dbg((scmd)->device, "[%s] " fmt, \
325 __rq->q->disk->disk_name, ##a); \
327 sdev_dbg((scmd)->device, fmt, ##a); \
377 void *hostdata; /* available to low-level driver */
385 return to_scsi_target(sdev->sdev_gendev.parent); in scsi_target()
388 to_scsi_target(class_dev->parent)
391 dev_printk(prefix, &(starget)->dev, fmt, ##a)
426 * shost_for_each_device - iterate over all devices of a host
440 * __shost_for_each_device - iterate over all devices of a host (UNLOCKED)
446 * protected by shost->host_lock.
453 list_for_each_entry((sdev), &((shost)->__devices), siblings)
462 int retries, struct scsi_mode_data *data,
466 int retries, struct scsi_mode_data *data,
469 int retries, struct scsi_sense_hdr *sshdr);
518 #define SCMD_FAILURE_NO_LIMIT -1
531 s8 retries; member
557 int timeout, int retries,
576 return device_reprobe(&sdev->sdev_gendev); in scsi_device_reprobe()
581 return sdev->channel; in sdev_channel()
586 return sdev->id; in sdev_id()
589 #define scmd_id(scmd) sdev_id((scmd)->device)
590 #define scmd_channel(scmd) sdev_channel((scmd)->device)
597 return (sdev->sdev_state != SDEV_OFFLINE && in scsi_device_online()
598 sdev->sdev_state != SDEV_TRANSPORT_OFFLINE && in scsi_device_online()
599 sdev->sdev_state != SDEV_DEL); in scsi_device_online()
603 return sdev->sdev_state == SDEV_BLOCK || in scsi_device_blocked()
604 sdev->sdev_state == SDEV_CREATED_BLOCK; in scsi_device_blocked()
608 return sdev->sdev_state == SDEV_CREATED || in scsi_device_created()
609 sdev->sdev_state == SDEV_CREATED_BLOCK; in scsi_device_created()
619 return sdev->sdtr; in scsi_device_sync()
623 return sdev->wdtr; in scsi_device_wide()
627 return sdev->ppr; in scsi_device_dt()
631 if (sdev->inquiry_len < 57) in scsi_device_dt_only()
633 return (sdev->inquiry[56] & 0x0c) == 0x04; in scsi_device_dt_only()
637 if (sdev->inquiry_len < 57) in scsi_device_ius()
639 return sdev->inquiry[56] & 0x01; in scsi_device_ius()
643 if (sdev->inquiry_len < 57) in scsi_device_qas()
645 return sdev->inquiry[56] & 0x02; in scsi_device_qas()
649 return sdev->inquiry ? (sdev->inquiry[6] & (1<<6)) : 1; in scsi_device_enclosure()
654 if (sdev->no_dif) in scsi_device_protection()
657 return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); in scsi_device_protection()
662 return sdev->inquiry ? (sdev->inquiry[5] >> 4) & 0x3 : 0; in scsi_device_tpgs()
666 * scsi_device_supports_vpd - test if a device supports VPD pages
671 * SCSI level is at least SPC-3 and 'skip_vpd_pages' is not set.
678 if (sdev->try_vpd_pages) in scsi_device_supports_vpd()
681 * Although VPD inquiries can go to SCSI-2 type devices, in scsi_device_supports_vpd()
683 * we currently ask for are mandatory for SPC-2 and beyond in scsi_device_supports_vpd()
685 if (sdev->scsi_level >= SCSI_SPC_2 && !sdev->skip_vpd_pages) in scsi_device_supports_vpd()
692 return sbitmap_weight(&sdev->budget_map); in scsi_device_busy()
696 #define scsi_get_ua_new_media_ctr(sdev) atomic_read(&sdev->ua_new_media_ctr)
697 #define scsi_get_ua_por_ctr(sdev) atomic_read(&sdev->ua_por_ctr)
700 MODULE_ALIAS("scsi:t-" __stringify(type) "*")
701 #define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x"