blob: 3fdb322d4c4bbeaba31fc0ac0a5a912d924637f6 [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 Wilck358fda52018-04-18 01:35:09 +020031#define __BLIST_UNUSED_11 ((__force blist_flags_t)(1ULL << 11))
Hannes Reineckef26aead2017-10-02 16:26:35 +020032/* do not do automatic start on add */
Martin Wilck14098802018-04-18 01:35:08 +020033#define BLIST_NOSTARTONADD ((__force blist_flags_t)(1ULL << 12))
Martin Wilck358fda52018-04-18 01:35:09 +020034#define __BLIST_UNUSED_13 ((__force blist_flags_t)(1ULL << 13))
35#define __BLIST_UNUSED_14 ((__force blist_flags_t)(1ULL << 14))
36#define __BLIST_UNUSED_15 ((__force blist_flags_t)(1ULL << 15))
37#define __BLIST_UNUSED_16 ((__force blist_flags_t)(1ULL << 16))
Hannes Reineckef26aead2017-10-02 16:26:35 +020038/* try REPORT_LUNS even for SCSI-2 devs (if HBA supports more than 8 LUNs) */
Martin Wilck14098802018-04-18 01:35:08 +020039#define BLIST_REPORTLUN2 ((__force blist_flags_t)(1ULL << 17))
Hannes Reineckef26aead2017-10-02 16:26:35 +020040/* don't try REPORT_LUNS scan (SCSI-3 devs) */
Martin Wilck14098802018-04-18 01:35:08 +020041#define BLIST_NOREPORTLUN ((__force blist_flags_t)(1ULL << 18))
Hannes Reineckef26aead2017-10-02 16:26:35 +020042/* don't use PREVENT-ALLOW commands */
Martin Wilck14098802018-04-18 01:35:08 +020043#define BLIST_NOT_LOCKABLE ((__force blist_flags_t)(1ULL << 19))
Hannes Reineckef26aead2017-10-02 16:26:35 +020044/* device is actually for RAID config */
Martin Wilck14098802018-04-18 01:35:08 +020045#define BLIST_NO_ULD_ATTACH ((__force blist_flags_t)(1ULL << 20))
Hannes Reineckef26aead2017-10-02 16:26:35 +020046/* select without ATN */
Martin Wilck14098802018-04-18 01:35:08 +020047#define BLIST_SELECT_NO_ATN ((__force blist_flags_t)(1ULL << 21))
Hannes Reineckef26aead2017-10-02 16:26:35 +020048/* retry HARDWARE_ERROR */
Martin Wilck14098802018-04-18 01:35:08 +020049#define BLIST_RETRY_HWERROR ((__force blist_flags_t)(1ULL << 22))
Hannes Reineckef26aead2017-10-02 16:26:35 +020050/* maximum 512 sector cdb length */
Martin Wilck14098802018-04-18 01:35:08 +020051#define BLIST_MAX_512 ((__force blist_flags_t)(1ULL << 23))
Martin Wilck358fda52018-04-18 01:35:09 +020052#define __BLIST_UNUSED_24 ((__force blist_flags_t)(1ULL << 24))
Hannes Reineckef26aead2017-10-02 16:26:35 +020053/* Disable T10 PI (DIF) */
Martin Wilck14098802018-04-18 01:35:08 +020054#define BLIST_NO_DIF ((__force blist_flags_t)(1ULL << 25))
Hannes Reineckef26aead2017-10-02 16:26:35 +020055/* Ignore SBC-3 VPD pages */
Martin Wilck14098802018-04-18 01:35:08 +020056#define BLIST_SKIP_VPD_PAGES ((__force blist_flags_t)(1ULL << 26))
Martin Wilck358fda52018-04-18 01:35:09 +020057#define __BLIST_UNUSED_27 ((__force blist_flags_t)(1ULL << 27))
Hannes Reineckef26aead2017-10-02 16:26:35 +020058/* Attempt to read VPD pages */
Martin Wilck14098802018-04-18 01:35:08 +020059#define BLIST_TRY_VPD_PAGES ((__force blist_flags_t)(1ULL << 28))
Hannes Reineckef26aead2017-10-02 16:26:35 +020060/* don't try to issue RSOC */
Martin Wilck14098802018-04-18 01:35:08 +020061#define BLIST_NO_RSOC ((__force blist_flags_t)(1ULL << 29))
Hannes Reineckef26aead2017-10-02 16:26:35 +020062/* maximum 1024 sector cdb length */
Martin Wilck14098802018-04-18 01:35:08 +020063#define BLIST_MAX_1024 ((__force blist_flags_t)(1ULL << 30))
Linus Torvalds670ffcc2017-11-14 16:23:44 -080064/* Use UNMAP limit for WRITE SAME */
Martin Wilck14098802018-04-18 01:35:08 +020065#define BLIST_UNMAP_LIMIT_WS ((__force blist_flags_t)(1ULL << 31))
Martin Wilck29cfc2a2018-04-18 01:35:10 +020066/* Always retry ABORTED_COMMAND with Internal Target Failure */
67#define BLIST_RETRY_ITF ((__force blist_flags_t)(1ULL << 32))
Martin Wilckc3606522018-04-18 01:35:11 +020068/* Always retry ABORTED_COMMAND with ASC 0xc1 */
69#define BLIST_RETRY_ASC_C1 ((__force blist_flags_t)(1ULL << 33))
Janusz Dziemidowicz02134362014-07-24 15:48:46 +020070
Martin Wilckc3606522018-04-18 01:35:11 +020071#define __BLIST_LAST_USED BLIST_RETRY_ASC_C1
Martin Wilck358fda52018-04-18 01:35:09 +020072
73#define __BLIST_HIGH_UNUSED (~(__BLIST_LAST_USED | \
74 (__force blist_flags_t) \
75 ((__force __u64)__BLIST_LAST_USED - 1ULL)))
76#define __BLIST_UNUSED_MASK (__BLIST_UNUSED_11 | \
77 __BLIST_UNUSED_13 | \
78 __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