xref: /illumos-gate/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_fct.h (revision a3170057524922242772a15fbeb3e91f5f8d4744)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at
9  * http://www.opensource.org/licenses/cddl1.txt.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright (c) 2004-2011 Emulex. All rights reserved.
24  * Use is subject to license terms.
25  * Copyright 2020 RackTop Systems, Inc.
26  */
27 
28 #ifndef _EMLXS_FCT_H
29 #define	_EMLXS_FCT_H
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 #ifdef SFCT_SUPPORT
36 
37 #include <sys/conf.h>
38 #include <sys/ddi.h>
39 #include <sys/stat.h>
40 #include <sys/pci.h>
41 #include <sys/sunddi.h>
42 #include <sys/modctl.h>
43 
44 #ifdef FC_WELL_KNOWN_ADDR
45 #undef FC_WELL_KNOWN_ADDR
46 #endif /* FC_WELL_KNOWN_ADDR */
47 
48 #include <sys/stmf.h>
49 #include <sys/fct.h>
50 
51 #ifndef LINK_SPEED_8G
52 #define	LINK_SPEED_8G		5
53 #endif /* LINK_SPEED_8G */
54 
55 #ifndef LINK_SPEED_10G
56 #define	LINK_SPEED_10G		6
57 #endif /* LINK_SPEED_10G */
58 
59 #ifndef PORT_SPEED_10G
60 #define	PORT_SPEED_10G		0x10
61 #endif /* PORT_SPEED_10G */
62 
63 #ifndef PORT_SPEED_16G
64 #define	PORT_SPEED_16G		0x20
65 #endif /* PORT_SPEED_16G */
66 
67 #ifndef PORT_SPEED_32G
68 #define	PORT_SPEED_32G		0x40
69 #endif /* PORT_SPEED_32G */
70 
71 /*
72  * Number of ports that do not require a valid cmd handle
73  * because they will not be sending any IO, ELS cmds ONLY.
74  */
75 #define	EMLXS_FCT_NUM_ELS_ONLY		8
76 
77 #ifndef MODSYM_SUPPORT
78 #pragma weak fct_alloc
79 #pragma weak fct_free
80 #pragma weak fct_scsi_task_alloc
81 #pragma weak fct_register_local_port
82 #pragma weak fct_deregister_local_port
83 #pragma weak fct_handle_event
84 #pragma weak fct_post_rcvd_cmd
85 #pragma weak fct_ctl
86 #pragma weak fct_queue_cmd_for_termination
87 #pragma weak fct_send_response_done
88 #pragma weak fct_send_cmd_done
89 #pragma weak fct_scsi_data_xfer_done
90 #pragma weak fct_handle_rcvd_flogi
91 #pragma weak fct_port_shutdown
92 #pragma weak fct_port_initialize
93 #pragma weak stmf_deregister_port_provider
94 #pragma weak stmf_free
95 #pragma weak stmf_alloc
96 #pragma weak stmf_register_port_provider
97 extern void* stmf_alloc();
98 extern void* fct_alloc();
99 #endif /* MODSYM_SUPPORT */
100 
101 #endif	/* SFCT_SUPPORT */
102 
103 #ifdef	__cplusplus
104 }
105 #endif
106 
107 #endif	/* _EMLXS_FCT_H */
108