hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/include/scsi/scsi_transport_fc.h
....@@ -1,28 +1,11 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * FiberChannel transport specific attributes exported to sysfs.
34 *
45 * Copyright (c) 2003 Silicon Graphics, Inc. All rights reserved.
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
- *
20
- * ========
21
- *
226 * Copyright (C) 2004-2007 James Smart, Emulex Corporation
237 * Rewrite for host, target, device, and remote port attributes,
248 * statistics, and service functions...
25
- *
269 */
2710 #ifndef SCSI_TRANSPORT_FC_H
2811 #define SCSI_TRANSPORT_FC_H
....@@ -141,6 +124,7 @@
141124 #define FC_PORTSPEED_25GBIT 0x800
142125 #define FC_PORTSPEED_64GBIT 0x1000
143126 #define FC_PORTSPEED_128GBIT 0x2000
127
+#define FC_PORTSPEED_256GBIT 0x4000
144128 #define FC_PORTSPEED_NOT_NEGOTIATED (1 << 15) /* Speed not established */
145129
146130 /*
....@@ -165,6 +149,9 @@
165149 #define FC_PORT_ROLE_FCP_INITIATOR 0x02
166150 #define FC_PORT_ROLE_IP_PORT 0x04
167151 #define FC_PORT_ROLE_FCP_DUMMY_INITIATOR 0x08
152
+#define FC_PORT_ROLE_NVME_INITIATOR 0x10
153
+#define FC_PORT_ROLE_NVME_TARGET 0x20
154
+#define FC_PORT_ROLE_NVME_DISCOVERY 0x40
168155
169156 /* The following are for compatibility */
170157 #define FC_RPORT_ROLE_UNKNOWN FC_PORT_ROLE_UNKNOWN
....@@ -473,6 +460,7 @@
473460 FCH_EVT_PORT_ONLINE = 0x202,
474461 FCH_EVT_PORT_FABRIC = 0x204,
475462 FCH_EVT_LINK_UNKNOWN = 0x500,
463
+ FCH_EVT_LINK_FPIN = 0x501,
476464 FCH_EVT_VENDOR_UNIQUE = 0xffff,
477465 };
478466
....@@ -755,7 +743,7 @@
755743 return result;
756744 }
757745
758
-static inline u64 wwn_to_u64(u8 *wwn)
746
+static inline u64 wwn_to_u64(const u8 *wwn)
759747 {
760748 return get_unaligned_be64(wwn);
761749 }
....@@ -798,11 +786,17 @@
798786 void fc_host_post_event(struct Scsi_Host *shost, u32 event_number,
799787 enum fc_host_event_code event_code, u32 event_data);
800788 void fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number,
801
- u32 data_len, char * data_buf, u64 vendor_id);
789
+ u32 data_len, char *data_buf, u64 vendor_id);
790
+void fc_host_post_fc_event(struct Scsi_Host *shost, u32 event_number,
791
+ enum fc_host_event_code event_code,
792
+ u32 data_len, char *data_buf, u64 vendor_id);
802793 /* Note: when specifying vendor_id to fc_host_post_vendor_event()
803
- * be sure to read the Vendor Type and ID formatting requirements
804
- * specified in scsi_netlink.h
794
+ * or fc_host_post_fc_event(), be sure to read the Vendor Type
795
+ * and ID formatting requirements specified in scsi_netlink.h
796
+ * Note: when calling fc_host_post_fc_event(), vendor_id may be
797
+ * specified as 0.
805798 */
799
+void fc_host_fpin_rcv(struct Scsi_Host *shost, u32 fpin_len, char *fpin_buf);
806800 struct fc_vport *fc_vport_create(struct Scsi_Host *shost, int channel,
807801 struct fc_vport_identifiers *);
808802 int fc_vport_terminate(struct fc_vport *vport);