blob: 5d14adae21c78903188052187076eeec9644188a [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _SCSI_SCSI_DEVINFO_H
3#define _SCSI_SCSI_DEVINFO_H
4/*
5 * Flags for SCSI devices that need special treatment
6 */
Hannes Reineckef26aead2017-10-02 16:26:35 +02007
8/* Only scan LUN 0 */
Martin Wilck14098802018-04-18 01:35:08 +02009#define BLIST_NOLUN ((__force blist_flags_t)(1ULL << 0))
Hannes Reineckef26aead2017-10-02 16:26:35 +020010/* Known to have LUNs, force scanning.
11 * DEPRECATED: Use max_luns=N */
Martin Wilck14098802018-04-18 01:35:08 +020012#define BLIST_FORCELUN ((__force blist_flags_t)(1ULL << 1))
Hannes Reineckef26aead2017-10-02 16:26:35 +020013/* Flag for broken handshaking */
Martin Wilck14098802018-04-18 01:35:08 +020014#define BLIST_BORKEN ((__force blist_flags_t)(1ULL << 2))
Hannes Reineckef26aead2017-10-02 16:26:35 +020015/* unlock by special command */
Martin Wilck14098802018-04-18 01:35:08 +020016#define BLIST_KEY ((__force blist_flags_t)(1ULL << 3))
Hannes Reineckef26aead2017-10-02 16:26:35 +020017/* Do not use LUNs in parallel */
Martin Wilck14098802018-04-18 01:35:08 +020018#define BLIST_SINGLELUN ((__force blist_flags_t)(1ULL << 4))
Hannes Reineckef26aead2017-10-02 16:26:35 +020019/* Buggy Tagged Command Queuing */
Martin Wilck14098802018-04-18 01:35:08 +020020#define BLIST_NOTQ ((__force blist_flags_t)(1ULL << 5))
Hannes Reineckef26aead2017-10-02 16:26:35 +020021/* Non consecutive LUN numbering */
Martin Wilck14098802018-04-18 01:35:08 +020022#define BLIST_SPARSELUN ((__force blist_flags_t)(1ULL << 6))
Hannes Reineckef26aead2017-10-02 16:26:35 +020023/* Avoid LUNS >= 5 */
Martin Wilck14098802018-04-18 01:35:08 +020024#define BLIST_MAX5LUN ((__force blist_flags_t)(1ULL << 7))
Hannes Reineckef26aead2017-10-02 16:26:35 +020025/* Treat as (removable) CD-ROM */
Martin Wilck14098802018-04-18 01:35:08 +020026#define BLIST_ISROM ((__force blist_flags_t)(1ULL << 8))
Hannes Reineckef26aead2017-10-02 16:26:35 +020027/* LUNs past 7 on a SCSI-2 device */
Martin Wilck14098802018-04-18 01:35:08 +020028#define BLIST_LARGELUN ((__force blist_flags_t)(1ULL << 9))
Hannes Reineckef26aead2017-10-02 16:26:35 +020029/* override additional length field */
Martin Wilck14098802018-04-18 01:35:08 +020030#define BLIST_INQUIRY_36 ((__force blist_flags_t)(1ULL << 10))
Martin Kepplingerf591a2e2021-07-04 09:54:01 +020031/* ignore MEDIA CHANGE unit attention after resuming from runtime suspend */
32#define BLIST_IGN_MEDIA_CHANGE ((__force blist_flags_t)(1ULL << 11))
Hannes Reineckef26aead2017-10-02 16:26:35 +020033/* do not do automatic start on add */
Martin Wilck14098802018-04-18 01:35:08 +020034#define BLIST_NOSTARTONADD ((__force blist_flags_t)(1ULL << 12))
Martin Wilck358fda52018-04-18 01:35:09 +020035#define __BLIST_UNUSED_13 ((__force blist_flags_t)(1ULL << 13))
36#define __BLIST_UNUSED_14 ((__force blist_flags_t)(1ULL << 14))
37#define __BLIST_UNUSED_15 ((__force blist_flags_t)(1ULL << 15))
38#define __BLIST_UNUSED_16 ((__force blist_flags_t)(1ULL << 16))
Hannes Reineckef26aead2017-10-02 16:26:35 +020039/* try REPORT_LUNS even for SCSI-2 devs (if HBA supports more than 8 LUNs) */
Martin Wilck14098802018-04-18 01:35:08 +020040#define BLIST_REPORTLUN2 ((__force blist_flags_t)(1ULL << 17))
Hannes Reineckef26aead2017-10-02 16:26:35 +020041/* don't try REPORT_LUNS scan (SCSI-3 devs) */
Martin Wilck14098802018-04-18 01:35:08 +020042#define BLIST_NOREPORTLUN ((__force blist_flags_t)(1ULL << 18))
Hannes Reineckef26aead2017-10-02 16:26:35 +020043/* don't use PREVENT-ALLOW commands */
Martin Wilck14098802018-04-18 01:35:08 +020044#define BLIST_NOT_LOCKABLE ((__force blist_flags_t)(1ULL << 19))
Hannes Reineckef26aead2017-10-02 16:26:35 +020045/* device is actually for RAID config */
Martin Wilck14098802018-04-18 01:35:08 +020046#define BLIST_NO_ULD_ATTACH ((__force blist_flags_t)(1ULL << 20))
Hannes Reineckef26aead2017-10-02 16:26:35 +020047/* select without ATN */
Martin Wilck14098802018-04-18 01:35:08 +020048#define BLIST_SELECT_NO_ATN ((__force blist_flags_t)(1ULL << 21))
Hannes Reineckef26aead2017-10-02 16:26:35 +020049/* retry HARDWARE_ERROR */
Martin Wilck14098802018-04-18 01:35:08 +020050#define BLIST_RETRY_HWERROR ((__force blist_flags_t)(1ULL << 22))
Hannes Reineckef26aead2017-10-02 16:26:35 +020051/* maximum 512 sector cdb length */
Martin Wilck14098802018-04-18 01:35:08 +020052#define BLIST_MAX_512 ((__force blist_flags_t)(1ULL << 23))
Martin Wilck358fda52018-04-18 01:35:09 +020053#define __BLIST_UNUSED_24 ((__force blist_flags_t)(1ULL << 24))
Hannes Reineckef26aead2017-10-02 16:26:35 +020054/* Disable T10 PI (DIF) */
Martin Wilck14098802018-04-18 01:35:08 +020055#define BLIST_NO_DIF ((__force blist_flags_t)(1ULL << 25))
Hannes Reineckef26aead2017-10-02 16:26:35 +020056/* Ignore SBC-3 VPD pages */
Martin Wilck14098802018-04-18 01:35:08 +020057#define BLIST_SKIP_VPD_PAGES ((__force blist_flags_t)(1ULL << 26))
Martin Wilck358fda52018-04-18 01:35:09 +020058#define __BLIST_UNUSED_27 ((__force blist_flags_t)(1ULL << 27))
Hannes Reineckef26aead2017-10-02 16:26:35 +020059/* Attempt to read VPD pages */
Martin Wilck14098802018-04-18 01:35:08 +020060#define BLIST_TRY_VPD_PAGES ((__force blist_flags_t)(1ULL << 28))
Hannes Reineckef26aead2017-10-02 16:26:35 +020061/* don't try to issue RSOC */
Martin Wilck14098802018-04-18 01:35:08 +020062#define BLIST_NO_RSOC ((__force blist_flags_t)(1ULL << 29))
Hannes Reineckef26aead2017-10-02 16:26:35 +020063/* maximum 1024 sector cdb length */
Martin Wilck14098802018-04-18 01:35:08 +020064#define BLIST_MAX_1024 ((__force blist_flags_t)(1ULL << 30))
Linus Torvalds670ffcc2017-11-14 16:23:44 -080065/* Use UNMAP limit for WRITE SAME */
Martin Wilck14098802018-04-18 01:35:08 +020066#define BLIST_UNMAP_LIMIT_WS ((__force blist_flags_t)(1ULL << 31))
Martin Wilck29cfc2a2018-04-18 01:35:10 +020067/* Always retry ABORTED_COMMAND with Internal Target Failure */
68#define BLIST_RETRY_ITF ((__force blist_flags_t)(1ULL << 32))
Martin Wilckc3606522018-04-18 01:35:11 +020069/* Always retry ABORTED_COMMAND with ASC 0xc1 */
70#define BLIST_RETRY_ASC_C1 ((__force blist_flags_t)(1ULL << 33))
Janusz Dziemidowicz02134362014-07-24 15:48:46 +020071
Martin Wilckc3606522018-04-18 01:35:11 +020072#define __BLIST_LAST_USED BLIST_RETRY_ASC_C1
Martin Wilck358fda52018-04-18 01:35:09 +020073
74#define __BLIST_HIGH_UNUSED (~(__BLIST_LAST_USED | \
75 (__force blist_flags_t) \
76 ((__force __u64)__BLIST_LAST_USED - 1ULL)))
Martin Kepplingerf591a2e2021-07-04 09:54:01 +020077#define __BLIST_UNUSED_MASK (__BLIST_UNUSED_13 | \
Martin Wilck358fda52018-04-18 01:35:09 +020078 __BLIST_UNUSED_14 | \
79 __BLIST_UNUSED_15 | \
80 __BLIST_UNUSED_16 | \
81 __BLIST_UNUSED_24 | \
82 __BLIST_UNUSED_27 | \
83 __BLIST_HIGH_UNUSED)
84
Linus Torvalds1da177e2005-04-16 15:20:36 -070085#endif