| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * FiberChannel transport specific attributes exported to sysfs. |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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 | | - * |
|---|
| 22 | 6 | * Copyright (C) 2004-2007 James Smart, Emulex Corporation |
|---|
| 23 | 7 | * Rewrite for host, target, device, and remote port attributes, |
|---|
| 24 | 8 | * statistics, and service functions... |
|---|
| 25 | | - * |
|---|
| 26 | 9 | */ |
|---|
| 27 | 10 | #ifndef SCSI_TRANSPORT_FC_H |
|---|
| 28 | 11 | #define SCSI_TRANSPORT_FC_H |
|---|
| .. | .. |
|---|
| 141 | 124 | #define FC_PORTSPEED_25GBIT 0x800 |
|---|
| 142 | 125 | #define FC_PORTSPEED_64GBIT 0x1000 |
|---|
| 143 | 126 | #define FC_PORTSPEED_128GBIT 0x2000 |
|---|
| 127 | +#define FC_PORTSPEED_256GBIT 0x4000 |
|---|
| 144 | 128 | #define FC_PORTSPEED_NOT_NEGOTIATED (1 << 15) /* Speed not established */ |
|---|
| 145 | 129 | |
|---|
| 146 | 130 | /* |
|---|
| .. | .. |
|---|
| 165 | 149 | #define FC_PORT_ROLE_FCP_INITIATOR 0x02 |
|---|
| 166 | 150 | #define FC_PORT_ROLE_IP_PORT 0x04 |
|---|
| 167 | 151 | #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 |
|---|
| 168 | 155 | |
|---|
| 169 | 156 | /* The following are for compatibility */ |
|---|
| 170 | 157 | #define FC_RPORT_ROLE_UNKNOWN FC_PORT_ROLE_UNKNOWN |
|---|
| .. | .. |
|---|
| 473 | 460 | FCH_EVT_PORT_ONLINE = 0x202, |
|---|
| 474 | 461 | FCH_EVT_PORT_FABRIC = 0x204, |
|---|
| 475 | 462 | FCH_EVT_LINK_UNKNOWN = 0x500, |
|---|
| 463 | + FCH_EVT_LINK_FPIN = 0x501, |
|---|
| 476 | 464 | FCH_EVT_VENDOR_UNIQUE = 0xffff, |
|---|
| 477 | 465 | }; |
|---|
| 478 | 466 | |
|---|
| .. | .. |
|---|
| 755 | 743 | return result; |
|---|
| 756 | 744 | } |
|---|
| 757 | 745 | |
|---|
| 758 | | -static inline u64 wwn_to_u64(u8 *wwn) |
|---|
| 746 | +static inline u64 wwn_to_u64(const u8 *wwn) |
|---|
| 759 | 747 | { |
|---|
| 760 | 748 | return get_unaligned_be64(wwn); |
|---|
| 761 | 749 | } |
|---|
| .. | .. |
|---|
| 798 | 786 | void fc_host_post_event(struct Scsi_Host *shost, u32 event_number, |
|---|
| 799 | 787 | enum fc_host_event_code event_code, u32 event_data); |
|---|
| 800 | 788 | 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); |
|---|
| 802 | 793 | /* 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. |
|---|
| 805 | 798 | */ |
|---|
| 799 | +void fc_host_fpin_rcv(struct Scsi_Host *shost, u32 fpin_len, char *fpin_buf); |
|---|
| 806 | 800 | struct fc_vport *fc_vport_create(struct Scsi_Host *shost, int channel, |
|---|
| 807 | 801 | struct fc_vport_identifiers *); |
|---|
| 808 | 802 | int fc_vport_terminate(struct fc_vport *vport); |
|---|