annotate usr/src/uts/common/sys/stmf.h @ 14074:cac17ab5e600

3862 stmf + kstat = kernel panic 3863 stmf_itl_task_start() must check for ilu->ilu_kstat_io is non-null 3864 memory leak in the iSCSI code Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Jeremy Jones <jeremy@delphix.com> Reviewed by: Sebastien Roy <sebastien.roy@delphix.com> Reviewed by: Dan McDonald <danmcd@nexenta.com> Reviewed by: Garrett D'Amore <garrett@damore.org> Reviewed by: Richard Elling <richard.elling@gmail.com> Approved by: Gordon Ross <gwr@nexenta.com>
author Jeff Biseda <jeff.biseda@delphix.com>
date Sun, 07 Jul 2013 18:18:37 -0800
parents f559965e4a2f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7836
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
1 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
2 * CDDL HEADER START
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
3 *
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
4 * The contents of this file are subject to the terms of the
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
5 * Common Development and Distribution License (the "License").
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
6 * You may not use this file except in compliance with the License.
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
7 *
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
9 * or http://www.opensolaris.org/os/licensing.
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
10 * See the License for the specific language governing permissions
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
11 * and limitations under the License.
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
12 *
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
13 * When distributing Covered Code, include this CDDL HEADER in each
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
15 * If applicable, add the following below this CDDL HEADER, with the
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
16 * fields enclosed by brackets "[]" replaced with your own identifying
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
17 * information: Portions Copyright [yyyy] [name of copyright owner]
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
18 *
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
19 * CDDL HEADER END
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
20 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
21 /*
12314
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
22 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
14074
cac17ab5e600 3862 stmf + kstat = kernel panic
Jeff Biseda <jeff.biseda@delphix.com>
parents: 12750
diff changeset
23 * Copyright (c) 2013 by Delphix. All rights reserved.
7836
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
24 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
25 #ifndef _STMF_H
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
26 #define _STMF_H
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
27
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
28 #include <sys/stmf_defines.h>
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
29
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
30 #ifdef __cplusplus
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
31 extern "C" {
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
32 #endif
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
33
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
34 typedef enum stmf_struct_id {
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
35 STMF_STRUCT_LU_PROVIDER = 1,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
36 STMF_STRUCT_PORT_PROVIDER,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
37 STMF_STRUCT_STMF_LOCAL_PORT,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
38 STMF_STRUCT_STMF_LU,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
39 STMF_STRUCT_SCSI_SESSION,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
40 STMF_STRUCT_SCSI_TASK,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
41 STMF_STRUCT_DATA_BUF,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
42 STMF_STRUCT_DBUF_STORE,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
43 STMF_MAX_STRUCT_IDS
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
44 } stmf_struct_id_t;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
45
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
46 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
47 * Provider callback commands
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
48 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
49 #define STMF_PROVIDER_DATA_UPDATED 0x01
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
50
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
51 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
52 * Provider callback flags
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
53 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
54 #define STMF_PCB_STMF_ONLINING 0x0001
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
55 #define STMF_PCB_PREG_COMPLETE 0x0002
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
56
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
57 typedef void *data_seg_handle_t;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
58 #define STMF_MAX_LU_CACHE_NTASKS 16
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
59
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
60 #define STMF_NO_HANDLE 0xffffffff
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
61
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
62 #define COMPANY_ID_NONE 0xFFFFFFFF
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
63 #define COMPANY_ID_SUN 0x00144F
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
64
12314
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
65 /*
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
66 * The scatter/gather list buffer format is used in 2 different
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
67 * contexts within stmf:
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
68 * 1) supplied by the port provider that the LU provider uses to exchange
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
69 * data with the backing store.
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
70 * 2) supplied by the LU provider that the port provider uses exchange
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
71 * data with the host initiator.
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
72 * The second format is optionally supported by the port provided as
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
73 * indicated by the command task flags.
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
74 */
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
75
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
76 typedef struct stmf_sglist_ent {
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
77 uint32_t seg_length;
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
78 uint8_t *seg_addr;
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
79 } stmf_sglist_ent_t;
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
80
7836
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
81 typedef struct stmf_data_buf {
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
82 void *db_stmf_private;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
83 void *db_port_private;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
84 void *db_lu_private;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
85 uint32_t db_buf_size; /* Total size of this buffer */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
86 uint32_t db_data_size; /* Intended xfer size of this buffer */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
87 uint32_t db_relative_offset;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
88 uint16_t db_sglist_length;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
89 uint16_t db_flags; /* Direction, auto status etc */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
90 stmf_status_t db_xfer_status;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
91 uint8_t db_handle; /* To track parallel buffers */
11773
189ba22b9863 6889694 COMSTAR kstat to track IO statistics at the ITL
tim szeto <Tim.Szeto@Sun.COM>
parents: 10765
diff changeset
92 hrtime_t db_xfer_start_timestamp;
12314
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
93 stmf_sglist_ent_t db_sglist[1]; /* PP scatter/gather list */
7836
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
94 } stmf_data_buf_t;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
95
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
96 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
97 * db_flags
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
98 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
99 #define DB_DIRECTION_TO_RPORT 0x0001
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
100 #define DB_DIRECTION_FROM_RPORT 0x0002
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
101 #define DB_SEND_STATUS_GOOD 0x0004
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
102 #define DB_STATUS_GOOD_SENT 0x0008
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
103 #define DB_DONT_CACHE 0x0010
9087
79961490b734 PSARC/2008/310 FCoE (Fibre Channel over Ethernet) Target
Zhong Wang <Zhong.Wang@Sun.COM>
parents: 7836
diff changeset
104 #define DB_DONT_REUSE 0x0020
12314
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
105 #define DB_LU_DATA_BUF 0x0040
12625
918cc39de2dd 6912676 STMF should attempt to catch port provider data transfer double completions
John Forte <John.Forte@Sun.COM>
parents: 12314
diff changeset
106 #define DB_LPORT_XFER_ACTIVE 0x8000
7836
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
107
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
108 typedef struct scsi_task {
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
109 void *task_stmf_private;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
110 void *task_port_private;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
111
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
112 void *task_lu_private;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
113 struct stmf_scsi_session *task_session;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
114 struct stmf_local_port *task_lport;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
115 struct stmf_lu *task_lu;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
116 void *task_lu_itl_handle; /* Assigned by LU */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
117
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
118 /* CMD information from initiator */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
119 uint8_t task_lun_no[8];
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
120 uint8_t task_flags; /* See def. for task flags */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
121 uint8_t task_priority; /* As per SAM-3 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
122 uint8_t task_mgmt_function; /* If this is a TM request */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
123 uint8_t task_max_nbufs;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
124 uint8_t task_cur_nbufs;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
125 uint8_t task_csn_size; /* cmd seq no size in bits */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
126 uint16_t task_additional_flags;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
127 uint32_t task_cmd_seq_no;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
128 uint32_t task_expected_xfer_length;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
129 uint32_t task_timeout; /* In seconds */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
130 uint16_t task_ext_id;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
131 uint16_t task_cdb_length;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
132 uint8_t *task_cdb;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
133
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
134 /* Fields to manage data phase */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
135 uint32_t task_cmd_xfer_length; /* xfer len based on CDB */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
136 uint32_t task_nbytes_transferred;
12314
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
137 uint32_t task_max_xfer_len; /* largest xfer allowed */
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
138 uint32_t task_1st_xfer_len; /* 1st xfer hint */
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
139 uint32_t task_copy_threshold; /* copy reduction threshold */
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
140
7836
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
141
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
142 /* Status Phase */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
143 stmf_status_t task_completion_status;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
144 uint32_t task_resid;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
145 uint8_t task_status_ctrl; /* See def. for status ctrl */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
146 uint8_t task_scsi_status;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
147 uint16_t task_sense_length;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
148 uint8_t *task_sense_data;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
149
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
150 /* Misc. task data */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
151 void *task_extended_cmd;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
152
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
153 } scsi_task_t;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
154
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
155 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
156 * Maximum expected transfer length. Can also be used when the transfer
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
157 * length is unknown when the task is allocated (e.g. SAS)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
158 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
159
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
160 #define TASK_MAX_XFER_LENGTH 0xFFFFFFFF
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
161
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
162 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
163 * task_flags definitions.
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
164 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
165 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
166 * If TF_INITIAL_BURST is set, the dbuf passed with new_task() contains
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
167 * data from initial burst. Otherwise its just a buffer which the port
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
168 * passed to the LU.
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
169 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
170 #define TF_INITIAL_BURST 0x80
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
171 /* Both READ_DATA and WRITE_DATA can be set for bidirectional xfers */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
172 #define TF_READ_DATA 0x40
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
173 #define TF_WRITE_DATA 0x20
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
174 #define TF_ATTR_MASK 0x07
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
175 #define TF_ATTR_UNTAGGED 0x0
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
176 #define TF_ATTR_SIMPLE_QUEUE 0x1
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
177 #define TF_ATTR_ORDERED_QUEUE 0x2
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
178 #define TF_ATTR_HEAD_OF_QUEUE 0x3
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
179 #define TF_ATTR_ACA 0x4
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
180
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
181 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
182 * Task Management flags.
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
183 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
184 #define TM_NONE 0x00
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
185 #define TM_ABORT_TASK 0x01
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
186 #define TM_ABORT_TASK_SET 0x02
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
187 #define TM_CLEAR_ACA 0x03
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
188 #define TM_CLEAR_TASK_SET 0x04
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
189 #define TM_LUN_RESET 0x05
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
190 #define TM_TARGET_WARM_RESET 0x06
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
191 #define TM_TARGET_COLD_RESET 0x07
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
192 #define TM_TASK_REASSIGN 0x08
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
193 #define TM_TARGET_RESET 0x09
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
194 #define TM_QUERY_TASK 0x0A
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
195
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
196 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
197 * additional flags
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
198 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
199 #define TASK_AF_ENABLE_COMP_CONF 0x01
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
200 #define TASK_AF_PORT_LOAD_HIGH 0x02
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
201 #define TASK_AF_NO_EXPECTED_XFER_LENGTH 0x04
12314
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
202 /*
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
203 * PP sets this flag if it can process dbufs created by the LU.
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
204 */
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
205 #define TASK_AF_ACCEPT_LU_DBUF 0x08
7836
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
206
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
207 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
208 * scsi_task_t extension identifiers
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
209 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
210 #define STMF_TASK_EXT_NONE 0
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
211
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
212 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
213 * max_nbufs
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
214 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
215 #define STMF_BUFS_MAX 255
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
216
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
217 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
218 * Task status ctrl
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
219 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
220 #define TASK_SCTRL_OVER 1
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
221 #define TASK_SCTRL_UNDER 2
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
222
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
223 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
224 * The flags used by I/O flow.
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
225 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
226 #define STMF_IOF_LU_DONE 0x0001
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
227 #define STMF_IOF_LPORT_DONE 0x0002
11773
189ba22b9863 6889694 COMSTAR kstat to track IO statistics at the ITL
tim szeto <Tim.Szeto@Sun.COM>
parents: 10765
diff changeset
228 #define STMF_IOF_STATS_ONLY 0x0004
7836
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
229
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
230 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
231 * struct allocation flags
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
232 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
233 #define AF_FORCE_NOSLEEP 0x0001
12314
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
234 #define AF_DONTZERO 0x0002
7836
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
235
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
236 typedef struct stmf_state_change_info {
12314
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
237 uint64_t st_rflags; /* Reason behind this change */
7836
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
238 char *st_additional_info;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
239 } stmf_state_change_info_t;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
240
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
241 typedef struct stmf_change_status {
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
242 stmf_status_t st_completion_status;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
243 char *st_additional_info;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
244 } stmf_change_status_t;
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
245
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
246 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
247 * conditions causing or affecting the change.
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
248 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
249 #define STMF_RFLAG_USER_REQUEST 0x0001
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
250 #define STMF_RFLAG_FATAL_ERROR 0x0002
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
251 #define STMF_RFLAG_STAY_OFFLINED 0x0004
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
252 #define STMF_RFLAG_RESET 0x0008
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
253 #define STMF_RFLAG_COLLECT_DEBUG_DUMP 0x0010
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
254 #define STMF_RFLAG_LU_ABORT 0x0020
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
255 #define STMF_RFLAG_LPORT_ABORT 0x0040
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
256
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
257 #define STMF_CHANGE_INFO_LEN 160
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
258
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
259 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
260 * cmds to stmf_abort entry point
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
261 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
262 #define STMF_QUEUE_TASK_ABORT 1
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
263 #define STMF_REQUEUE_TASK_ABORT_LPORT 2
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
264 #define STMF_REQUEUE_TASK_ABORT_LU 3
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
265 #define STMF_QUEUE_ABORT_LU 4
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
266
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
267 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
268 * cmds to be used by stmf ctl
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
269 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
270 #define STMF_CMD_LU_OP 0x0100
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
271 #define STMF_CMD_LPORT_OP 0x0200
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
272 #define STMF_CMD_MASK 0x00ff
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
273 #define STMF_CMD_ONLINE 0x0001
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
274 #define STMF_CMD_OFFLINE 0x0002
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
275 #define STMF_CMD_GET_STATUS 0x0003
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
276 #define STMF_CMD_ONLINE_COMPLETE 0x0004
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
277 #define STMF_CMD_OFFLINE_COMPLETE 0x0005
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
278 #define STMF_ACK_ONLINE_COMPLETE 0x0006
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
279 #define STMF_ACK_OFFLINE_COMPLETE 0x0007
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
280
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
281 #define STMF_CMD_LU_ONLINE (STMF_CMD_LU_OP | STMF_CMD_ONLINE)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
282 #define STMF_CMD_LU_OFFLINE (STMF_CMD_LU_OP | STMF_CMD_OFFLINE)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
283 #define STMF_CMD_LPORT_ONLINE (STMF_CMD_LPORT_OP | STMF_CMD_ONLINE)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
284 #define STMF_CMD_LPORT_OFFLINE (STMF_CMD_LPORT_OP | STMF_CMD_OFFLINE)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
285 #define STMF_CMD_GET_LU_STATUS (STMF_CMD_LU_OP | STMF_CMD_GET_STATUS)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
286 #define STMF_CMD_GET_LPORT_STATUS \
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
287 (STMF_CMD_LPORT_OP | STMF_CMD_GET_STATUS)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
288 #define STMF_CMD_LU_ONLINE_COMPLETE \
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
289 (STMF_CMD_LU_OP | STMF_CMD_ONLINE_COMPLETE)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
290 #define STMF_CMD_LPORT_ONLINE_COMPLETE \
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
291 (STMF_CMD_LPORT_OP | STMF_CMD_ONLINE_COMPLETE)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
292 #define STMF_ACK_LU_ONLINE_COMPLETE \
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
293 (STMF_CMD_LU_OP | STMF_ACK_ONLINE_COMPLETE)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
294 #define STMF_ACK_LPORT_ONLINE_COMPLETE \
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
295 (STMF_CMD_LPORT_OP | STMF_ACK_ONLINE_COMPLETE)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
296 #define STMF_CMD_LU_OFFLINE_COMPLETE \
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
297 (STMF_CMD_LU_OP | STMF_CMD_OFFLINE_COMPLETE)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
298 #define STMF_CMD_LPORT_OFFLINE_COMPLETE \
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
299 (STMF_CMD_LPORT_OP | STMF_CMD_OFFLINE_COMPLETE)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
300 #define STMF_ACK_LU_OFFLINE_COMPLETE \
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
301 (STMF_CMD_LU_OP | STMF_ACK_OFFLINE_COMPLETE)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
302 #define STMF_ACK_LPORT_OFFLINE_COMPLETE \
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
303 (STMF_CMD_LPORT_OP | STMF_ACK_OFFLINE_COMPLETE)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
304 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
305 * For LPORTs and LUs to create their own ctl cmds which dont
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
306 * conflict with stmf ctl cmds.
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
307 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
308 #define STMF_LPORT_CTL_CMDS 0x1000
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
309 #define STMF_LU_CTL_CMDS 0x2000
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
310
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
311 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
312 * Commands for various info routines.
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
313 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
314 /* Command classifiers */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
315 #define SI_LPORT 0x1000000
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
316 #define SI_STMF 0x2000000
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
317 #define SI_LU 0x4000000
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
318 #define SI_LPORT_FC 0x0000000
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
319 #define SI_LPORT_ISCSI 0x0010000
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
320 #define SI_LPORT_SAS 0x0020000
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
321 #define SI_STMF_LU 0x0010000
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
322 #define SI_STMF_LPORT 0x0020000
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
323
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
324 #define SI_GET_CLASS(v) ((v) & 0xFF000000)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
325 #define SI_GET_SUBCLASS(v) ((v) & 0x00FF0000)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
326
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
327 /* Commands for LPORT info routines */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
328 /* XXX - Implement these. */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
329 #if 0
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
330 #define SI_LPORT_FC_PORTINFO (SI_LPORT | SI_LPORT_FC | 1)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
331 #define SI_RPORT_FC_PORTINFO (SI_LPORT | SI_LPORT_FC | 2)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
332 #endif
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
333
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
334 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
335 * Events
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
336 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
337 #define STMF_EVENT_ALL ((int)-1)
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
338 #define LPORT_EVENT_INITIAL_LUN_MAPPED 0
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
339
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
340 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
341 * This needs to go into common/ddi/sunddi.h
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
342 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
343 #define DDI_NT_STMF "ddi_scsi_target:framework"
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
344 #define DDI_NT_STMF_LP "ddi_scsi_target:lu_provider"
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
345 #define DDI_NT_STMF_PP "ddi_scsi_target:port_provider"
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
346
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
347 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
348 * VPD page bits.
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
349 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
350 #define STMF_VPD_LU_ID 0x01
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
351 #define STMF_VPD_TARGET_ID 0x02
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
352 #define STMF_VPD_TP_GROUP 0x04
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
353 #define STMF_VPD_RELATIVE_TP_ID 0x08
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
354
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
355 /*
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
356 * Common macros to simplify coding
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
357 */
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
358 #define STMF_SEC2TICK(x_sec) (drv_usectohz((x_sec) * 1000000))
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
359
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
360 void stmf_trace(caddr_t ident, const char *fmt, ...);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
361 void *stmf_alloc(stmf_struct_id_t sid, int additional_size, int alloc_flags);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
362 void stmf_free(void *struct_ptr);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
363 struct scsi_task *stmf_task_alloc(struct stmf_local_port *lport,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
364 struct stmf_scsi_session *ss, uint8_t *lun, uint16_t cdb_length,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
365 uint16_t ext_id);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
366 void stmf_post_task(scsi_task_t *task, stmf_data_buf_t *dbuf);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
367 stmf_data_buf_t *stmf_alloc_dbuf(scsi_task_t *task, uint32_t size,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
368 uint32_t *pminsize, uint32_t flags);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
369 void stmf_free_dbuf(scsi_task_t *task, stmf_data_buf_t *dbuf);
12314
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
370 stmf_status_t stmf_setup_dbuf(scsi_task_t *task, stmf_data_buf_t *dbuf,
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
371 uint32_t flags);
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 11773
diff changeset
372 void stmf_teardown_dbuf(scsi_task_t *task, stmf_data_buf_t *dbuf);
7836
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
373 stmf_status_t stmf_xfer_data(scsi_task_t *task, stmf_data_buf_t *dbuf,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
374 uint32_t ioflags);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
375 stmf_status_t stmf_send_scsi_status(scsi_task_t *task, uint32_t ioflags);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
376 void stmf_data_xfer_done(scsi_task_t *task, stmf_data_buf_t *dbuf,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
377 uint32_t iof);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
378 void stmf_send_status_done(scsi_task_t *task, stmf_status_t s, uint32_t iof);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
379 void stmf_task_lu_done(scsi_task_t *task);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
380 void stmf_abort(int abort_cmd, scsi_task_t *task, stmf_status_t s, void *arg);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
381 void stmf_task_lu_aborted(scsi_task_t *task, stmf_status_t s, uint32_t iof);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
382 void stmf_task_lport_aborted(scsi_task_t *task, stmf_status_t s, uint32_t iof);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
383 stmf_status_t stmf_task_poll_lu(scsi_task_t *task, uint32_t timeout);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
384 stmf_status_t stmf_task_poll_lport(scsi_task_t *task, uint32_t timeout);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
385 stmf_status_t stmf_ctl(int cmd, void *obj, void *arg);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
386 stmf_status_t stmf_register_itl_handle(struct stmf_lu *lu, uint8_t *lun,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
387 struct stmf_scsi_session *ss, uint64_t session_id, void *itl_handle);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
388 stmf_status_t stmf_deregister_all_lu_itl_handles(struct stmf_lu *lu);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
389 stmf_status_t stmf_get_itl_handle(struct stmf_lu *lu, uint8_t *lun,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
390 struct stmf_scsi_session *ss, uint64_t session_id, void **itl_handle_retp);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
391 stmf_data_buf_t *stmf_handle_to_buf(scsi_task_t *task, uint8_t h);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
392 stmf_status_t stmf_lu_add_event(struct stmf_lu *lu, int eventid);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
393 stmf_status_t stmf_lu_remove_event(struct stmf_lu *lu, int eventid);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
394 stmf_status_t stmf_lport_add_event(struct stmf_local_port *lport, int eventid);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
395 stmf_status_t stmf_lport_remove_event(struct stmf_local_port *lport,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
396 int eventid);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
397 void stmf_wwn_to_devid_desc(struct scsi_devid_desc *sdid, uint8_t *wwn,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
398 uint8_t protocol_id);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
399 stmf_status_t stmf_scsilib_uniq_lu_id(uint32_t company_id,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
400 struct scsi_devid_desc *lu_id);
10765
7ae75584baf6 6861519 stmfCreateLu() should allow caller to specify host id
John Forte <John.Forte@Sun.COM>
parents: 9585
diff changeset
401 stmf_status_t stmf_scsilib_uniq_lu_id2(uint32_t company_id, uint32_t host_id,
7ae75584baf6 6861519 stmfCreateLu() should allow caller to specify host id
John Forte <John.Forte@Sun.COM>
parents: 9585
diff changeset
402 struct scsi_devid_desc *lu_id);
7836
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
403 void stmf_scsilib_send_status(scsi_task_t *task, uint8_t st, uint32_t saa);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
404 uint32_t stmf_scsilib_prepare_vpd_page83(scsi_task_t *task, uint8_t *page,
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
405 uint32_t page_len, uint8_t byte0, uint32_t vpd_mask);
9585
bf09620212ab 6795089 COMSTAR sbd lun provider should support PGR
tim szeto <Tim.Szeto@Sun.COM>
parents: 9087
diff changeset
406 uint16_t stmf_scsilib_get_lport_rtid(struct scsi_devid_desc *devid);
bf09620212ab 6795089 COMSTAR sbd lun provider should support PGR
tim szeto <Tim.Szeto@Sun.COM>
parents: 9087
diff changeset
407 struct scsi_devid_desc *stmf_scsilib_get_devid_desc(uint16_t rtpid);
7836
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
408 void stmf_scsilib_handle_report_tpgs(scsi_task_t *task, stmf_data_buf_t *dbuf);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
409 void stmf_scsilib_handle_task_mgmt(scsi_task_t *task);
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
410
12750
f559965e4a2f 6817374 stmf_scsi_session:ss_rport_id is insufficient for some SCSI transports
Nattuvetty Bhavyan <Nattuvetty.Bhavyan@Sun.COM>
parents: 12625
diff changeset
411 struct stmf_remote_port *stmf_scsilib_devid_to_remote_port(
f559965e4a2f 6817374 stmf_scsi_session:ss_rport_id is insufficient for some SCSI transports
Nattuvetty Bhavyan <Nattuvetty.Bhavyan@Sun.COM>
parents: 12625
diff changeset
412 struct scsi_devid_desc *);
f559965e4a2f 6817374 stmf_scsi_session:ss_rport_id is insufficient for some SCSI transports
Nattuvetty Bhavyan <Nattuvetty.Bhavyan@Sun.COM>
parents: 12625
diff changeset
413 boolean_t stmf_scsilib_tptid_validate(struct scsi_transport_id *,
f559965e4a2f 6817374 stmf_scsi_session:ss_rport_id is insufficient for some SCSI transports
Nattuvetty Bhavyan <Nattuvetty.Bhavyan@Sun.COM>
parents: 12625
diff changeset
414 uint32_t, uint16_t *);
f559965e4a2f 6817374 stmf_scsi_session:ss_rport_id is insufficient for some SCSI transports
Nattuvetty Bhavyan <Nattuvetty.Bhavyan@Sun.COM>
parents: 12625
diff changeset
415 boolean_t stmf_scsilib_tptid_compare(struct scsi_transport_id *,
f559965e4a2f 6817374 stmf_scsi_session:ss_rport_id is insufficient for some SCSI transports
Nattuvetty Bhavyan <Nattuvetty.Bhavyan@Sun.COM>
parents: 12625
diff changeset
416 struct scsi_transport_id *);
f559965e4a2f 6817374 stmf_scsi_session:ss_rport_id is insufficient for some SCSI transports
Nattuvetty Bhavyan <Nattuvetty.Bhavyan@Sun.COM>
parents: 12625
diff changeset
417 struct stmf_remote_port *stmf_remote_port_alloc(uint16_t);
f559965e4a2f 6817374 stmf_scsi_session:ss_rport_id is insufficient for some SCSI transports
Nattuvetty Bhavyan <Nattuvetty.Bhavyan@Sun.COM>
parents: 12625
diff changeset
418 void stmf_remote_port_free(struct stmf_remote_port *);
7836
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
419 #ifdef __cplusplus
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
420 }
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
421 #endif
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
422
4e95154b5b7a 6745433 Merge NWS consolidation into OS/Net consolidation
John Forte <John.Forte@Sun.COM>
parents:
diff changeset
423 #endif /* _STMF_H */