hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/ata/libata.h
....@@ -1,28 +1,12 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * libata.h - helper library for ATA
34 *
45 * Copyright 2003-2004 Red Hat, Inc. All rights reserved.
56 * Copyright 2003-2004 Jeff Garzik
67 *
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
- *
238 * libata documentation is available via 'make {ps|pdf}docs',
249 * as Documentation/driver-api/libata.rst
25
- *
2610 */
2711
2812 #ifndef __LIBATA_H__
....@@ -46,6 +30,8 @@
4630 ATA_DNXFER_QUIET = (1 << 31),
4731 };
4832
33
+#define ATA_PORT_TYPE_NAME "ata_port"
34
+
4935 extern atomic_t ata_print_id;
5036 extern int atapi_passthru16;
5137 extern int libata_fua;
....@@ -53,7 +39,11 @@
5339 extern int libata_allow_tpm;
5440 extern const struct device_type ata_port_type;
5541 extern struct ata_link *ata_dev_phys_link(struct ata_device *dev);
42
+#ifdef CONFIG_ATA_FORCE
5643 extern void ata_force_cbl(struct ata_port *ap);
44
+#else
45
+static inline void ata_force_cbl(struct ata_port *ap) { }
46
+#endif
5747 extern u64 ata_tf_to_lba(const struct ata_taskfile *tf);
5848 extern u64 ata_tf_to_lba48(const struct ata_taskfile *tf);
5949 extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev, int tag);
....@@ -103,6 +93,18 @@
10393
10494 #define to_ata_port(d) container_of(d, struct ata_port, tdev)
10595
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
+
106108 /* libata-acpi.c */
107109 #ifdef CONFIG_ATA_ACPI
108110 extern unsigned int ata_acpi_gtf_filter;
....@@ -128,6 +130,8 @@
128130 #endif
129131
130132 /* libata-scsi.c */
133
+extern struct ata_device *ata_scsi_find_dev(struct ata_port *ap,
134
+ const struct scsi_device *scsidev);
131135 extern int ata_scsi_add_hosts(struct ata_host *host,
132136 struct scsi_host_template *sht);
133137 extern void ata_scsi_scan_host(struct ata_port *ap, int sync);
....@@ -144,9 +148,10 @@
144148 extern int ata_bus_probe(struct ata_port *ap);
145149 extern int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
146150 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);
150155
151156 /* libata-eh.c */
152157 extern unsigned long ata_internal_cmd_timeout(struct ata_device *dev, u8 cmd);