Print this page
NEX-1775 scsi_vhci should use f_sym module by default
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Dan Fields <dan.fields@nexenta.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/io/scsi/adapters/scsi_vhci/fops/sym.c
+++ new/usr/src/uts/common/io/scsi/adapters/scsi_vhci/fops/sym.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
|
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 */
25 25
26 26 /*
27 + * Copyright 2018 Nexenta Systems, Inc.
28 + */
29 +
30 +/*
27 31 * Implementation of "scsi_vhci_f_sym" symmetric failover_ops.
28 32 *
29 - * This file was historically meant for only symmetric implementation. It has
30 - * been extended to manage SUN "supported" symmetric controllers. The supported
31 - * VID/PID shall be listed in the symmetric_dev_table.
33 + * Currently this module accepts all DTYPE_DIRECT devices.
32 34 */
33 35
34 36 #include <sys/conf.h>
35 37 #include <sys/file.h>
36 38 #include <sys/ddi.h>
37 39 #include <sys/sunddi.h>
38 40 #include <sys/scsi/scsi.h>
39 41 #include <sys/scsi/adapters/scsi_vhci.h>
40 42
41 -/* Supported device table entries. */
42 -char *symmetric_dev_table[] = {
43 -/* " 111111" */
44 -/* "012345670123456789012345" */
45 -/* "|-VID--||-----PID------|" */
46 - /* disks */
47 - "IBM DDYFT",
48 - "IBM IC",
49 - "SEAGATE ST",
50 - /* enclosures */
51 - "SUN SENA", /* SES device */
52 - "SUN SESS01", /* VICOM SVE box */
53 - "SUNW SUNWGS", /* Daktari enclosure */
54 - /* arrays */
55 - "HITACHI OPEN", /* Hitachi storage */
56 - "SUN PSX1000", /* Pirus Matterhorn */
57 - "SUN SE6920", /* Pirus */
58 - "SUN SE6940", /* DSP - Nauset */
59 - "SUN StorEdge 3510", /* Minnow FC */
60 - "SUN StorEdge 3511", /* Minnow SATA RAID */
61 - "SUN StorageTek 6920", /* DSP */
62 - "SUN StorageTek 6940", /* DSP - Nauset */
63 - "SUN StorageTek NAS", /* StorageTek NAS */
64 - "SUN MRA300_R", /* Shamrock - Controller */
65 - "SUN MRA300_E", /* Shamrock - Expansion */
66 - "STEC ZeusIOPs", /* Zeus SAS SSD */
43 +char *symmetric_dev_table[] = { NULL };
67 44
68 - NULL
69 -};
70 -
71 45 /* Failover module plumbing. */
72 46 SCSI_FAILOVER_OP(SFO_NAME_SYM, symmetric);
73 47
74 48 /* ARGSUSED */
75 49 static int
76 50 symmetric_device_probe(struct scsi_device *sd, struct scsi_inquiry *stdinq,
77 -void **ctpriv)
51 + void **ctpriv)
78 52 {
79 - char **dt;
80 -
81 - VHCI_DEBUG(6, (CE_NOTE, NULL, "!inq str: %s\n", stdinq->inq_vid));
82 - for (dt = symmetric_dev_table; *dt; dt++)
83 - if (strncmp(stdinq->inq_vid, *dt, strlen(*dt)) == 0)
53 + if (stdinq->inq_dtype == DTYPE_DIRECT)
84 54 return (SFO_DEVICE_PROBE_VHCI);
85 55
86 - /*
87 - * No match, check for generic Sun supported disks:
88 - *
89 - * "|-VID--||-----PID------|"
90 - * "012345670123456789012345"
91 - * ".................SUN..G."
92 - * ".................SUN..T."
93 - * ".................SUN...G"
94 - * ".................SUN...T"
95 - */
96 - if (bcmp(&stdinq->inq_pid[9], "SUN", 3) == 0) {
97 - if ((stdinq->inq_pid[14] == 'G' || stdinq->inq_pid[15] == 'G' ||
98 - stdinq->inq_pid[14] == 'T' || stdinq->inq_pid[15] == 'T') &&
99 - (stdinq->inq_dtype == DTYPE_DIRECT)) {
100 - return (SFO_DEVICE_PROBE_VHCI);
101 - }
102 - }
103 - if (bcmp(&stdinq->inq_vid[0], "ATA ", 8) == 0) {
104 - return (SFO_DEVICE_PROBE_VHCI);
105 - }
106 56 return (SFO_DEVICE_PROBE_PHCI);
107 57 }
108 58
109 59 /* ARGSUSED */
110 60 static void
111 61 symmetric_device_unprobe(struct scsi_device *sd, void *ctpriv)
112 62 {
113 63 /*
114 64 * NOP for symmetric
115 65 */
116 66 }
|
↓ open down ↓ |
1 lines elided |
↑ open up ↑ |
117 67
118 68 /* ARGSUSED */
119 69 static int
120 70 symmetric_path_activate(struct scsi_device *sd, char *pathclass, void *ctpriv)
121 71 {
122 72 return (0);
123 73 }
124 74
125 75 /* ARGSUSED */
126 76 static int
127 -symmetric_path_deactivate(struct scsi_device *sd, char *pathclass,
128 -void *ctpriv)
77 +symmetric_path_deactivate(struct scsi_device *sd, char *pathclass, void *ctpriv)
129 78 {
130 79 return (0);
131 80 }
132 81
133 82 /* ARGSUSED */
134 83 static int
135 84 symmetric_path_get_opinfo(struct scsi_device *sd,
136 -struct scsi_path_opinfo *opinfo, void *ctpriv)
85 + struct scsi_path_opinfo *opinfo, void *ctpriv)
137 86 {
138 87 opinfo->opinfo_rev = OPINFO_REV;
139 88 (void) strcpy(opinfo->opinfo_path_attr, "primary");
140 89 opinfo->opinfo_path_state = SCSI_PATH_ACTIVE;
141 90 opinfo->opinfo_pswtch_best = 0; /* N/A */
142 91 opinfo->opinfo_pswtch_worst = 0; /* N/A */
143 92 opinfo->opinfo_xlf_capable = 0;
144 93 opinfo->opinfo_mode = SCSI_NO_FAILOVER;
145 94 opinfo->opinfo_preferred = 1;
146 95
147 96 return (0);
148 97 }
|
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
149 98
150 99 /* ARGSUSED */
151 100 static int
152 101 symmetric_path_ping(struct scsi_device *sd, void *ctpriv)
153 102 {
154 103 return (1);
155 104 }
156 105
157 106 /* ARGSUSED */
158 107 static int
159 -symmetric_analyze_sense(struct scsi_device *sd,
160 -uint8_t *sense, void *ctpriv)
108 +symmetric_analyze_sense(struct scsi_device *sd, uint8_t *sense, void *ctpriv)
161 109 {
162 110 return (SCSI_SENSE_NOFAILOVER);
163 111 }
164 112
165 113 /* ARGSUSED */
166 114 static int
167 115 symmetric_pathclass_next(char *cur, char **nxt, void *ctpriv)
168 116 {
169 117 if (cur == NULL) {
170 118 *nxt = PCLASS_PRIMARY;
171 119 return (0);
172 120 } else if (strcmp(cur, PCLASS_PRIMARY) == 0) {
173 121 return (ENOENT);
174 122 } else {
175 123 return (EINVAL);
176 124 }
177 125 }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX