forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 072de836f53be56a70cecf70b43ae43b7ce17376
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__
....@@ -53,7 +37,11 @@
5337 extern int libata_allow_tpm;
5438 extern const struct device_type ata_port_type;
5539 extern struct ata_link *ata_dev_phys_link(struct ata_device *dev);
40
+#ifdef CONFIG_ATA_FORCE
5641 extern void ata_force_cbl(struct ata_port *ap);
42
+#else
43
+static inline void ata_force_cbl(struct ata_port *ap) { }
44
+#endif
5745 extern u64 ata_tf_to_lba(const struct ata_taskfile *tf);
5846 extern u64 ata_tf_to_lba48(const struct ata_taskfile *tf);
5947 extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev, int tag);
....@@ -103,6 +91,18 @@
10391
10492 #define to_ata_port(d) container_of(d, struct ata_port, tdev)
10593
94
+/* libata-sata.c */
95
+#ifdef CONFIG_SATA_HOST
96
+int ata_sas_allocate_tag(struct ata_port *ap);
97
+void ata_sas_free_tag(unsigned int tag, struct ata_port *ap);
98
+#else
99
+static inline int ata_sas_allocate_tag(struct ata_port *ap)
100
+{
101
+ return -EOPNOTSUPP;
102
+}
103
+static inline void ata_sas_free_tag(unsigned int tag, struct ata_port *ap) { }
104
+#endif
105
+
106106 /* libata-acpi.c */
107107 #ifdef CONFIG_ATA_ACPI
108108 extern unsigned int ata_acpi_gtf_filter;
....@@ -128,6 +128,8 @@
128128 #endif
129129
130130 /* libata-scsi.c */
131
+extern struct ata_device *ata_scsi_find_dev(struct ata_port *ap,
132
+ const struct scsi_device *scsidev);
131133 extern int ata_scsi_add_hosts(struct ata_host *host,
132134 struct scsi_host_template *sht);
133135 extern void ata_scsi_scan_host(struct ata_port *ap, int sync);
....@@ -144,9 +146,10 @@
144146 extern int ata_bus_probe(struct ata_port *ap);
145147 extern int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
146148 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
-
149
+void ata_scsi_sdev_config(struct scsi_device *sdev);
150
+int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev);
151
+void ata_scsi_dump_cdb(struct ata_port *ap, struct scsi_cmnd *cmd);
152
+int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, struct ata_device *dev);
150153
151154 /* libata-eh.c */
152155 extern unsigned long ata_internal_cmd_timeout(struct ata_device *dev, u8 cmd);