linux/include/linux/ata.h

/* SPDX-License-Identifier: GPL-2.0-or-later */

/*
 *  Copyright 2003-2004 Red Hat, Inc.  All rights reserved.
 *  Copyright 2003-2004 Jeff Garzik
 *
 *  libata documentation is available via 'make {ps|pdf}docs',
 *  as Documentation/driver-api/libata.rst
 *
 *  Hardware documentation available from http://www.t13.org/
 */

#ifndef __LINUX_ATA_H__
#define __LINUX_ATA_H__

#include <linux/bits.h>
#include <linux/string.h>
#include <linux/types.h>

/* defines only for the constants which don't work well as enums */
#define ATA_DMA_BOUNDARY
#define ATA_DMA_MASK

enum {};

enum ata_prot_flags {};

enum ata_ioctls {};

/* core structures */

struct ata_bmdma_prd {};

/*
 * id tests
 */
#define ata_id_is_ata(id)
#define ata_id_has_lba(id)
#define ata_id_has_dma(id)
#define ata_id_has_ncq(id)
#define ata_id_queue_depth(id)
#define ata_id_removable(id)
#define ata_id_has_atapi_AN(id)
#define ata_id_has_fpdma_aa(id)
#define ata_id_has_devslp(id)
#define ata_id_has_ncq_autosense(id)
#define ata_id_has_dipm(id)
#define ata_id_iordy_disable(id)
#define ata_id_has_iordy(id)
#define ata_id_u32(id,n)
#define ata_id_u64(id,n)

#define ata_id_cdb_intr(id)
#define ata_id_has_da(id)

static inline bool ata_id_has_hipm(const u16 *id)
{}

static inline bool ata_id_has_fua(const u16 *id)
{}

static inline bool ata_id_has_flush(const u16 *id)
{}

static inline bool ata_id_has_flush_ext(const u16 *id)
{}

static inline u32 ata_id_logical_sector_size(const u16 *id)
{}

static inline u8 ata_id_log2_per_physical_sector(const u16 *id)
{}

/* Offset of logical sectors relative to physical sectors.
 *
 * If device has more than one logical sector per physical sector
 * (aka 512 byte emulation), vendors might offset the "sector 0" address
 * so sector 63 is "naturally aligned" - e.g. FAT partition table.
 * This avoids Read/Mod/Write penalties when using FAT partition table
 * and updating "well aligned" (FS perspective) physical sectors on every
 * transaction.
 */
static inline u16 ata_id_logical_sector_offset(const u16 *id,
	 u8 log2_per_phys)
{}

static inline bool ata_id_has_lba48(const u16 *id)
{}

static inline bool ata_id_hpa_enabled(const u16 *id)
{}

static inline bool ata_id_has_wcache(const u16 *id)
{}

static inline bool ata_id_has_pm(const u16 *id)
{}

static inline bool ata_id_rahead_enabled(const u16 *id)
{}

static inline bool ata_id_wcache_enabled(const u16 *id)
{}

static inline bool ata_id_has_read_log_dma_ext(const u16 *id)
{}

static inline bool ata_id_has_sense_reporting(const u16 *id)
{}

static inline bool ata_id_sense_reporting_enabled(const u16 *id)
{}

/**
 *
 * Word: 206 - SCT Command Transport
 *    15:12 - Vendor Specific
 *     11:6 - Reserved
 *        5 - SCT Command Transport Data Tables supported
 *        4 - SCT Command Transport Features Control supported
 *        3 - SCT Command Transport Error Recovery Control supported
 *        2 - SCT Command Transport Write Same supported
 *        1 - SCT Command Transport Long Sector Access supported
 *        0 - SCT Command Transport supported
 */
static inline bool ata_id_sct_data_tables(const u16 *id)
{}

static inline bool ata_id_sct_features_ctrl(const u16 *id)
{}

static inline bool ata_id_sct_error_recovery_ctrl(const u16 *id)
{}

static inline bool ata_id_sct_long_sector_access(const u16 *id)
{}

static inline bool ata_id_sct_supported(const u16 *id)
{}

/**
 *	ata_id_major_version	-	get ATA level of drive
 *	@id: Identify data
 *
 *	Caveats:
 *		ATA-1 considers identify optional
 *		ATA-2 introduces mandatory identify
 *		ATA-3 introduces word 80 and accurate reporting
 *
 *	The practical impact of this is that ata_id_major_version cannot
 *	reliably report on drives below ATA3.
 */

static inline unsigned int ata_id_major_version(const u16 *id)
{}

static inline bool ata_id_is_sata(const u16 *id)
{}

static inline bool ata_id_has_tpm(const u16 *id)
{}

static inline bool ata_id_has_dword_io(const u16 *id)
{}

static inline bool ata_id_has_trusted(const u16 *id)
{}

static inline bool ata_id_has_unload(const u16 *id)
{}

static inline bool ata_id_has_wwn(const u16 *id)
{}

static inline int ata_id_form_factor(const u16 *id)
{}

static inline int ata_id_rotation_rate(const u16 *id)
{}

static inline bool ata_id_has_ncq_send_and_recv(const u16 *id)
{}

static inline bool ata_id_has_ncq_non_data(const u16 *id)
{}

static inline bool ata_id_has_ncq_prio(const u16 *id)
{}

static inline bool ata_id_has_trim(const u16 *id)
{}

static inline bool ata_id_has_zero_after_trim(const u16 *id)
{}

static inline bool ata_id_current_chs_valid(const u16 *id)
{}

static inline bool ata_id_is_cfa(const u16 *id)
{}

static inline bool ata_id_is_ssd(const u16 *id)
{}

static inline u8 ata_id_zoned_cap(const u16 *id)
{}

static inline bool ata_id_pio_need_iordy(const u16 *id, const u8 pio)
{}

static inline bool ata_drive_40wire(const u16 *dev_id)
{}

static inline bool ata_drive_40wire_relaxed(const u16 *dev_id)
{}

static inline int atapi_cdb_len(const u16 *dev_id)
{}

static inline int atapi_command_packet_set(const u16 *dev_id)
{}

static inline bool atapi_id_dmadir(const u16 *dev_id)
{}

static inline bool ata_ok(u8 status)
{}

static inline bool lba_28_ok(u64 block, u32 n_block)
{}

static inline bool lba_48_ok(u64 block, u32 n_block)
{}

#define sata_pmp_gscr_vendor(gscr)
#define sata_pmp_gscr_devid(gscr)
#define sata_pmp_gscr_rev(gscr)
#define sata_pmp_gscr_ports(gscr)

#endif /* __LINUX_ATA_H__ */