162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef _SCSI_SCSI_DEVINFO_H
362306a36Sopenharmony_ci#define _SCSI_SCSI_DEVINFO_H
462306a36Sopenharmony_ci/*
562306a36Sopenharmony_ci * Flags for SCSI devices that need special treatment
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci/* Only scan LUN 0 */
962306a36Sopenharmony_ci#define BLIST_NOLUN		((__force blist_flags_t)(1ULL << 0))
1062306a36Sopenharmony_ci/* Known to have LUNs, force scanning.
1162306a36Sopenharmony_ci * DEPRECATED: Use max_luns=N */
1262306a36Sopenharmony_ci#define BLIST_FORCELUN		((__force blist_flags_t)(1ULL << 1))
1362306a36Sopenharmony_ci/* Flag for broken handshaking */
1462306a36Sopenharmony_ci#define BLIST_BORKEN		((__force blist_flags_t)(1ULL << 2))
1562306a36Sopenharmony_ci/* unlock by special command */
1662306a36Sopenharmony_ci#define BLIST_KEY		((__force blist_flags_t)(1ULL << 3))
1762306a36Sopenharmony_ci/* Do not use LUNs in parallel */
1862306a36Sopenharmony_ci#define BLIST_SINGLELUN		((__force blist_flags_t)(1ULL << 4))
1962306a36Sopenharmony_ci/* Buggy Tagged Command Queuing */
2062306a36Sopenharmony_ci#define BLIST_NOTQ		((__force blist_flags_t)(1ULL << 5))
2162306a36Sopenharmony_ci/* Non consecutive LUN numbering */
2262306a36Sopenharmony_ci#define BLIST_SPARSELUN		((__force blist_flags_t)(1ULL << 6))
2362306a36Sopenharmony_ci/* Avoid LUNS >= 5 */
2462306a36Sopenharmony_ci#define BLIST_MAX5LUN		((__force blist_flags_t)(1ULL << 7))
2562306a36Sopenharmony_ci/* Treat as (removable) CD-ROM */
2662306a36Sopenharmony_ci#define BLIST_ISROM		((__force blist_flags_t)(1ULL << 8))
2762306a36Sopenharmony_ci/* LUNs past 7 on a SCSI-2 device */
2862306a36Sopenharmony_ci#define BLIST_LARGELUN		((__force blist_flags_t)(1ULL << 9))
2962306a36Sopenharmony_ci/* override additional length field */
3062306a36Sopenharmony_ci#define BLIST_INQUIRY_36	((__force blist_flags_t)(1ULL << 10))
3162306a36Sopenharmony_ci/* ignore MEDIA CHANGE unit attention after resuming from runtime suspend */
3262306a36Sopenharmony_ci#define BLIST_IGN_MEDIA_CHANGE	((__force blist_flags_t)(1ULL << 11))
3362306a36Sopenharmony_ci/* do not do automatic start on add */
3462306a36Sopenharmony_ci#define BLIST_NOSTARTONADD	((__force blist_flags_t)(1ULL << 12))
3562306a36Sopenharmony_ci/* do not ask for VPD page size first on some broken targets */
3662306a36Sopenharmony_ci#define BLIST_NO_VPD_SIZE	((__force blist_flags_t)(1ULL << 13))
3762306a36Sopenharmony_ci#define __BLIST_UNUSED_14	((__force blist_flags_t)(1ULL << 14))
3862306a36Sopenharmony_ci#define __BLIST_UNUSED_15	((__force blist_flags_t)(1ULL << 15))
3962306a36Sopenharmony_ci#define __BLIST_UNUSED_16	((__force blist_flags_t)(1ULL << 16))
4062306a36Sopenharmony_ci/* try REPORT_LUNS even for SCSI-2 devs (if HBA supports more than 8 LUNs) */
4162306a36Sopenharmony_ci#define BLIST_REPORTLUN2	((__force blist_flags_t)(1ULL << 17))
4262306a36Sopenharmony_ci/* don't try REPORT_LUNS scan (SCSI-3 devs) */
4362306a36Sopenharmony_ci#define BLIST_NOREPORTLUN	((__force blist_flags_t)(1ULL << 18))
4462306a36Sopenharmony_ci/* don't use PREVENT-ALLOW commands */
4562306a36Sopenharmony_ci#define BLIST_NOT_LOCKABLE	((__force blist_flags_t)(1ULL << 19))
4662306a36Sopenharmony_ci/* device is actually for RAID config */
4762306a36Sopenharmony_ci#define BLIST_NO_ULD_ATTACH	((__force blist_flags_t)(1ULL << 20))
4862306a36Sopenharmony_ci/* select without ATN */
4962306a36Sopenharmony_ci#define BLIST_SELECT_NO_ATN	((__force blist_flags_t)(1ULL << 21))
5062306a36Sopenharmony_ci/* retry HARDWARE_ERROR */
5162306a36Sopenharmony_ci#define BLIST_RETRY_HWERROR	((__force blist_flags_t)(1ULL << 22))
5262306a36Sopenharmony_ci/* maximum 512 sector cdb length */
5362306a36Sopenharmony_ci#define BLIST_MAX_512		((__force blist_flags_t)(1ULL << 23))
5462306a36Sopenharmony_ci#define __BLIST_UNUSED_24	((__force blist_flags_t)(1ULL << 24))
5562306a36Sopenharmony_ci/* Disable T10 PI (DIF) */
5662306a36Sopenharmony_ci#define BLIST_NO_DIF		((__force blist_flags_t)(1ULL << 25))
5762306a36Sopenharmony_ci/* Ignore SBC-3 VPD pages */
5862306a36Sopenharmony_ci#define BLIST_SKIP_VPD_PAGES	((__force blist_flags_t)(1ULL << 26))
5962306a36Sopenharmony_ci#define __BLIST_UNUSED_27	((__force blist_flags_t)(1ULL << 27))
6062306a36Sopenharmony_ci/* Attempt to read VPD pages */
6162306a36Sopenharmony_ci#define BLIST_TRY_VPD_PAGES	((__force blist_flags_t)(1ULL << 28))
6262306a36Sopenharmony_ci/* don't try to issue RSOC */
6362306a36Sopenharmony_ci#define BLIST_NO_RSOC		((__force blist_flags_t)(1ULL << 29))
6462306a36Sopenharmony_ci/* maximum 1024 sector cdb length */
6562306a36Sopenharmony_ci#define BLIST_MAX_1024		((__force blist_flags_t)(1ULL << 30))
6662306a36Sopenharmony_ci/* Use UNMAP limit for WRITE SAME */
6762306a36Sopenharmony_ci#define BLIST_UNMAP_LIMIT_WS	((__force blist_flags_t)(1ULL << 31))
6862306a36Sopenharmony_ci/* Always retry ABORTED_COMMAND with Internal Target Failure */
6962306a36Sopenharmony_ci#define BLIST_RETRY_ITF		((__force blist_flags_t)(1ULL << 32))
7062306a36Sopenharmony_ci/* Always retry ABORTED_COMMAND with ASC 0xc1 */
7162306a36Sopenharmony_ci#define BLIST_RETRY_ASC_C1	((__force blist_flags_t)(1ULL << 33))
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci#define __BLIST_LAST_USED BLIST_RETRY_ASC_C1
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci#define __BLIST_HIGH_UNUSED (~(__BLIST_LAST_USED | \
7662306a36Sopenharmony_ci			       (__force blist_flags_t) \
7762306a36Sopenharmony_ci			       ((__force __u64)__BLIST_LAST_USED - 1ULL)))
7862306a36Sopenharmony_ci#define __BLIST_UNUSED_MASK (__BLIST_UNUSED_14 | \
7962306a36Sopenharmony_ci			     __BLIST_UNUSED_15 | \
8062306a36Sopenharmony_ci			     __BLIST_UNUSED_16 | \
8162306a36Sopenharmony_ci			     __BLIST_UNUSED_24 | \
8262306a36Sopenharmony_ci			     __BLIST_UNUSED_27 | \
8362306a36Sopenharmony_ci			     __BLIST_HIGH_UNUSED)
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci#endif
86