#ifndef _SCSI_DISK_H
#define _SCSI_DISK_H
#define SD_MAJORS …
#define SD_TIMEOUT …
#define SD_MOD_TIMEOUT …
#define SD_FLUSH_TIMEOUT_MULTIPLIER …
#define SD_WRITE_SAME_TIMEOUT …
#define SD_MAX_RETRIES …
#define SD_PASSTHROUGH_RETRIES …
#define SD_MAX_MEDIUM_TIMEOUTS …
#define SD_BUF_SIZE …
#define SD_LAST_BUGGY_SECTORS …
enum { … };
enum { … };
enum { … };
enum { … };
struct zoned_disk_info { … };
struct scsi_disk { … };
#define to_scsi_disk(obj) …
static inline struct scsi_disk *scsi_disk(struct gendisk *disk)
{ … }
#define sd_printk(prefix, sdsk, fmt, a...) …
#define sd_first_printk(prefix, sdsk, fmt, a...) …
static inline int scsi_medium_access_command(struct scsi_cmnd *scmd)
{ … }
static inline sector_t logical_to_sectors(struct scsi_device *sdev, sector_t blocks)
{ … }
static inline unsigned int logical_to_bytes(struct scsi_device *sdev, sector_t blocks)
{ … }
static inline sector_t bytes_to_logical(struct scsi_device *sdev, unsigned int bytes)
{ … }
static inline sector_t sectors_to_logical(struct scsi_device *sdev, sector_t sector)
{ … }
void sd_dif_config_host(struct scsi_disk *sdkp, struct queue_limits *lim);
#ifdef CONFIG_BLK_DEV_ZONED
int sd_zbc_read_zones(struct scsi_disk *sdkp, struct queue_limits *lim,
u8 buf[SD_BUF_SIZE]);
int sd_zbc_revalidate_zones(struct scsi_disk *sdkp);
blk_status_t sd_zbc_setup_zone_mgmt_cmnd(struct scsi_cmnd *cmd,
unsigned char op, bool all);
unsigned int sd_zbc_complete(struct scsi_cmnd *cmd, unsigned int good_bytes,
struct scsi_sense_hdr *sshdr);
int sd_zbc_report_zones(struct gendisk *disk, sector_t sector,
unsigned int nr_zones, report_zones_cb cb, void *data);
#else
static inline int sd_zbc_read_zones(struct scsi_disk *sdkp,
struct queue_limits *lim, u8 buf[SD_BUF_SIZE])
{
return 0;
}
static inline int sd_zbc_revalidate_zones(struct scsi_disk *sdkp)
{
return 0;
}
static inline blk_status_t sd_zbc_setup_zone_mgmt_cmnd(struct scsi_cmnd *cmd,
unsigned char op,
bool all)
{
return BLK_STS_TARGET;
}
static inline unsigned int sd_zbc_complete(struct scsi_cmnd *cmd,
unsigned int good_bytes, struct scsi_sense_hdr *sshdr)
{
return good_bytes;
}
#define sd_zbc_report_zones …
#endif
void sd_print_sense_hdr(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr);
void sd_print_result(const struct scsi_disk *sdkp, const char *msg, int result);
#endif