.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* |
---|
2 | 3 | * libata.h - helper library for ATA |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright 2003-2004 Red Hat, Inc. All rights reserved. |
---|
5 | 6 | * Copyright 2003-2004 Jeff Garzik |
---|
6 | 7 | * |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify |
---|
9 | | - * it under the terms of the GNU General Public License as published by |
---|
10 | | - * the Free Software Foundation; either version 2, or (at your option) |
---|
11 | | - * any later version. |
---|
12 | | - * |
---|
13 | | - * This program is distributed in the hope that it will be useful, |
---|
14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | | - * GNU General Public License for more details. |
---|
17 | | - * |
---|
18 | | - * You should have received a copy of the GNU General Public License |
---|
19 | | - * along with this program; see the file COPYING. If not, write to |
---|
20 | | - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
21 | | - * |
---|
22 | | - * |
---|
23 | 8 | * libata documentation is available via 'make {ps|pdf}docs', |
---|
24 | 9 | * as Documentation/driver-api/libata.rst |
---|
25 | | - * |
---|
26 | 10 | */ |
---|
27 | 11 | |
---|
28 | 12 | #ifndef __LIBATA_H__ |
---|
.. | .. |
---|
46 | 30 | ATA_DNXFER_QUIET = (1 << 31), |
---|
47 | 31 | }; |
---|
48 | 32 | |
---|
| 33 | +#define ATA_PORT_TYPE_NAME "ata_port" |
---|
| 34 | + |
---|
49 | 35 | extern atomic_t ata_print_id; |
---|
50 | 36 | extern int atapi_passthru16; |
---|
51 | 37 | extern int libata_fua; |
---|
.. | .. |
---|
53 | 39 | extern int libata_allow_tpm; |
---|
54 | 40 | extern const struct device_type ata_port_type; |
---|
55 | 41 | extern struct ata_link *ata_dev_phys_link(struct ata_device *dev); |
---|
| 42 | +#ifdef CONFIG_ATA_FORCE |
---|
56 | 43 | extern void ata_force_cbl(struct ata_port *ap); |
---|
| 44 | +#else |
---|
| 45 | +static inline void ata_force_cbl(struct ata_port *ap) { } |
---|
| 46 | +#endif |
---|
57 | 47 | extern u64 ata_tf_to_lba(const struct ata_taskfile *tf); |
---|
58 | 48 | extern u64 ata_tf_to_lba48(const struct ata_taskfile *tf); |
---|
59 | 49 | extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev, int tag); |
---|
.. | .. |
---|
103 | 93 | |
---|
104 | 94 | #define to_ata_port(d) container_of(d, struct ata_port, tdev) |
---|
105 | 95 | |
---|
| 96 | +/* libata-sata.c */ |
---|
| 97 | +#ifdef CONFIG_SATA_HOST |
---|
| 98 | +int ata_sas_allocate_tag(struct ata_port *ap); |
---|
| 99 | +void ata_sas_free_tag(unsigned int tag, struct ata_port *ap); |
---|
| 100 | +#else |
---|
| 101 | +static inline int ata_sas_allocate_tag(struct ata_port *ap) |
---|
| 102 | +{ |
---|
| 103 | + return -EOPNOTSUPP; |
---|
| 104 | +} |
---|
| 105 | +static inline void ata_sas_free_tag(unsigned int tag, struct ata_port *ap) { } |
---|
| 106 | +#endif |
---|
| 107 | + |
---|
106 | 108 | /* libata-acpi.c */ |
---|
107 | 109 | #ifdef CONFIG_ATA_ACPI |
---|
108 | 110 | extern unsigned int ata_acpi_gtf_filter; |
---|
.. | .. |
---|
128 | 130 | #endif |
---|
129 | 131 | |
---|
130 | 132 | /* libata-scsi.c */ |
---|
| 133 | +extern struct ata_device *ata_scsi_find_dev(struct ata_port *ap, |
---|
| 134 | + const struct scsi_device *scsidev); |
---|
131 | 135 | extern int ata_scsi_add_hosts(struct ata_host *host, |
---|
132 | 136 | struct scsi_host_template *sht); |
---|
133 | 137 | extern void ata_scsi_scan_host(struct ata_port *ap, int sync); |
---|
.. | .. |
---|
144 | 148 | extern int ata_bus_probe(struct ata_port *ap); |
---|
145 | 149 | extern int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, |
---|
146 | 150 | unsigned int id, u64 lun); |
---|
147 | | -int ata_sas_allocate_tag(struct ata_port *ap); |
---|
148 | | -void ata_sas_free_tag(unsigned int tag, struct ata_port *ap); |
---|
149 | | - |
---|
| 151 | +void ata_scsi_sdev_config(struct scsi_device *sdev); |
---|
| 152 | +int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev); |
---|
| 153 | +void ata_scsi_dump_cdb(struct ata_port *ap, struct scsi_cmnd *cmd); |
---|
| 154 | +int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, struct ata_device *dev); |
---|
150 | 155 | |
---|
151 | 156 | /* libata-eh.c */ |
---|
152 | 157 | extern unsigned long ata_internal_cmd_timeout(struct ata_device *dev, u8 cmd); |
---|