hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/scsi/libsas/sas_internal.h
....@@ -1,26 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Serial Attached SCSI (SAS) class internal header file
34 *
45 * Copyright (C) 2005 Adaptec, Inc. All rights reserved.
56 * Copyright (C) 2005 Luben Tuikov <luben_tuikov@adaptec.com>
6
- *
7
- * This file is licensed under GPLv2.
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU General Public License as
11
- * published by the Free Software Foundation; either version 2 of the
12
- * License, or (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful, but
15
- * WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
- * General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with this program; if not, write to the Free Software
21
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22
- * USA
23
- *
247 */
258
269 #ifndef _SAS_INTERNAL_H_
....@@ -32,9 +15,13 @@
3215 #include <scsi/libsas.h>
3316 #include <scsi/sas_ata.h>
3417
35
-#define sas_printk(fmt, ...) printk(KERN_NOTICE "sas: " fmt, ## __VA_ARGS__)
18
+#ifdef pr_fmt
19
+#undef pr_fmt
20
+#endif
3621
37
-#define SAS_DPRINTK(fmt, ...) printk(KERN_DEBUG "sas: " fmt, ## __VA_ARGS__)
22
+#define SAS_FMT "sas: "
23
+
24
+#define pr_fmt(fmt) SAS_FMT fmt
3825
3926 #define TO_SAS_TASK(_scsi_cmd) ((void *)(_scsi_cmd)->host_scribble)
4027 #define ASSIGN_SAS_TASK(_sc, _t) do { (_sc)->host_scribble = (void *) _t; } while (0)
....@@ -62,12 +49,13 @@
6249 void sas_unregister_phys(struct sas_ha_struct *sas_ha);
6350
6451 struct asd_sas_event *sas_alloc_event(struct asd_sas_phy *phy);
52
+struct asd_sas_event *sas_alloc_event_gfp(struct asd_sas_phy *phy,
53
+ gfp_t gfp_flags);
6554 void sas_free_event(struct asd_sas_event *event);
6655
6756 int sas_register_ports(struct sas_ha_struct *sas_ha);
6857 void sas_unregister_ports(struct sas_ha_struct *sas_ha);
6958
70
-int sas_init_events(struct sas_ha_struct *sas_ha);
7159 void sas_disable_revalidation(struct sas_ha_struct *ha);
7260 void sas_enable_revalidation(struct sas_ha_struct *ha);
7361 void __sas_drain_work(struct sas_ha_struct *ha);
....@@ -91,6 +79,8 @@
9179 int sas_smp_get_phy_events(struct sas_phy *phy);
9280
9381 int sas_notify_phy_event(struct asd_sas_phy *phy, enum phy_event event);
82
+int sas_notify_phy_event_gfp(struct asd_sas_phy *phy, enum phy_event event,
83
+ gfp_t flags);
9484 void sas_device_set_phy(struct domain_device *dev, struct sas_port *port);
9585 struct domain_device *sas_find_dev_by_rphy(struct sas_rphy *rphy);
9686 struct domain_device *sas_ex_to_ata(struct domain_device *ex_dev, int phy_id);
....@@ -120,10 +110,10 @@
120110
121111 static inline void sas_fail_probe(struct domain_device *dev, const char *func, int err)
122112 {
123
- SAS_DPRINTK("%s: for %s device %16llx returned %d\n",
124
- func, dev->parent ? "exp-attached" :
125
- "direct-attached",
126
- SAS_ADDR(dev->sas_addr), err);
113
+ pr_warn("%s: for %s device %016llx returned %d\n",
114
+ func, dev->parent ? "exp-attached" :
115
+ "direct-attached",
116
+ SAS_ADDR(dev->sas_addr), err);
127117 sas_unregister_dev(dev->port, dev);
128118 }
129119