Print this page
4888 Undocument dma_req(9s)
4884 EOF scsi_hba_attach
4886 EOF ddi_dmae_getlim
4887 EOF ddi_iomin
4634 undocument scsi_hba_attach() and ddi_dma_lim(9s)
4630 clean stale references to ddi_iopb_alloc and ddi_iopb_free
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/scsi/impl/transport.h
+++ new/usr/src/uts/common/sys/scsi/impl/transport.h
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 *
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
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
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
23 24 */
24 25
25 26 #ifndef _SYS_SCSI_IMPL_TRANSPORT_H
26 27 #define _SYS_SCSI_IMPL_TRANSPORT_H
27 28
28 29 /*
29 30 * Include the loadable module wrapper.
30 31 */
31 32 #include <sys/modctl.h>
32 33 #include <sys/note.h>
33 34
34 35 #ifdef __cplusplus
35 36 extern "C" {
36 37 #endif
37 38
38 39 #ifdef _KERNEL
39 40
40 41 /*
41 42 * Opaque handles to address maps
42 43 */
43 44 typedef struct __scsi_iportmap scsi_hba_iportmap_t;
44 45 typedef struct __scsi_tgtmap scsi_hba_tgtmap_t;
45 46
46 47 /*
47 48 * SCSI transport structures
48 49 *
49 50 * As each Host Adapter makes itself known to the system,
50 51 * it will create and register with the library the structure
51 52 * described below. This is so that the library knows how to route
52 53 * packets, resource control requests, and capability requests
53 54 * for any particular host adapter. The 'a_hba_tran' field of a
54 55 * scsi_address structure made known to a Target driver will
55 56 * point to one of these transport structures.
56 57 */
57 58
58 59 typedef struct scsi_hba_tran scsi_hba_tran_t;
59 60
60 61 struct scsi_hba_tran {
61 62 /*
62 63 * Ptr to the device info structure for this particular HBA. If a SCSA
63 64 * HBA driver separates initiator port function from HBA function,
64 65 * this field still refers to the HBA and is used to manage DMA.
65 66 */
66 67 dev_info_t *tran_hba_dip;
67 68
68 69 /*
69 70 * Private fields for use by the HBA itself.
70 71 */
71 72 void *tran_hba_private; /* HBA softstate */
72 73
73 74 /*
74 75 * The following two fields are only used in the deprecated
75 76 * SCSI_HBA_TRAN_CLONE case. Use SCSI_HBA_ADDR_COMPLEX instead.
76 77 */
77 78 void *tran_tgt_private;
78 79 struct scsi_device *tran_sd;
79 80
80 81 /*
81 82 * Vectors to point to specific HBA entry points
82 83 */
83 84 int (*tran_tgt_init)(
84 85 dev_info_t *hba_dip,
85 86 dev_info_t *tgt_dip,
86 87 scsi_hba_tran_t *tran,
87 88 struct scsi_device *sd);
88 89
89 90 int (*tran_tgt_probe)(
90 91 struct scsi_device *sd,
91 92 int (*callback)(
92 93 void));
93 94 void (*tran_tgt_free)(
94 95 dev_info_t *hba_dip,
95 96 dev_info_t *tgt_dip,
96 97 scsi_hba_tran_t *tran,
97 98 struct scsi_device *sd);
98 99
99 100 int (*tran_start)(
100 101 struct scsi_address *ap,
101 102 struct scsi_pkt *pkt);
102 103
103 104 int (*tran_reset)(
104 105 struct scsi_address *ap,
105 106 int level);
106 107
107 108 int (*tran_abort)(
108 109 struct scsi_address *ap,
109 110 struct scsi_pkt *pkt);
110 111
111 112 int (*tran_getcap)(
112 113 struct scsi_address *ap,
113 114 char *cap,
114 115 int whom);
115 116
116 117 int (*tran_setcap)(
117 118 struct scsi_address *ap,
118 119 char *cap,
119 120 int value,
120 121 int whom);
121 122
122 123 struct scsi_pkt *(*tran_init_pkt)(
123 124 struct scsi_address *ap,
124 125 struct scsi_pkt *pkt,
125 126 struct buf *bp,
126 127 int cmdlen,
127 128 int statuslen,
128 129 int tgtlen,
129 130 int flags,
130 131 int (*callback)(
131 132 caddr_t arg),
132 133 caddr_t callback_arg);
133 134
134 135 void (*tran_destroy_pkt)(
135 136 struct scsi_address *ap,
136 137 struct scsi_pkt *pkt);
137 138
138 139 void (*tran_dmafree)(
139 140 struct scsi_address *ap,
140 141 struct scsi_pkt *pkt);
141 142
142 143 void (*tran_sync_pkt)(
143 144 struct scsi_address *ap,
144 145 struct scsi_pkt *pkt);
145 146
146 147 int (*tran_reset_notify)(
147 148 struct scsi_address *ap,
148 149 int flag,
149 150 void (*callback)(caddr_t),
150 151 caddr_t arg);
151 152
152 153 int (*tran_get_bus_addr)(
153 154 struct scsi_device *sd,
154 155 char *name,
155 156 int len);
156 157
157 158 int (*tran_get_name)(
158 159 struct scsi_device *sd,
159 160 char *name,
160 161 int len);
161 162
162 163 int (*tran_clear_aca)(
163 164 struct scsi_address *ap);
164 165
165 166 int (*tran_clear_task_set)(
166 167 struct scsi_address *ap);
167 168
168 169 int (*tran_terminate_task)(
169 170 struct scsi_address *ap,
170 171 struct scsi_pkt *pkt);
171 172
172 173 int (*tran_get_eventcookie)(
173 174 dev_info_t *hba_dip,
174 175 dev_info_t *tgt_dip,
175 176 char *name,
176 177 ddi_eventcookie_t *eventp);
177 178
178 179 int (*tran_add_eventcall)(
179 180 dev_info_t *hba_dip,
180 181 dev_info_t *tgt_dip,
181 182 ddi_eventcookie_t event,
182 183 void (*callback)(
183 184 dev_info_t *tgt_dip,
184 185 ddi_eventcookie_t event,
185 186 void *arg,
186 187 void *bus_impldata),
187 188 void *arg,
188 189 ddi_callback_id_t *cb_id);
189 190
190 191 int (*tran_remove_eventcall)(dev_info_t *devi,
191 192 ddi_callback_id_t cb_id);
192 193
193 194 int (*tran_post_event)(
194 195 dev_info_t *hba_dip,
195 196 dev_info_t *tgt_dip,
196 197 ddi_eventcookie_t event,
197 198 void *bus_impldata);
198 199
199 200 int (*tran_quiesce)(
200 201 dev_info_t *hba_dip);
201 202
202 203 int (*tran_unquiesce)(
203 204 dev_info_t *hba_dip);
204 205
205 206 int (*tran_bus_reset)(
206 207 dev_info_t *hba_dip,
207 208 int level);
208 209
209 210 /*
210 211 * Implementation-private specifics.
211 212 * No HBA should refer to any of the fields below.
212 213 * This information can and will change.
213 214 */
214 215 int tran_hba_flags; /* flag options */
215 216
216 217 uint_t tran_obs1;
217 218 uchar_t tran_obs2;
218 219 uchar_t tran_obs3;
219 220
220 221 /*
221 222 * open_lock: protect tran_minor_isopen
222 223 * open_flag: bit field indicating which minor nodes are open.
223 224 * 0 = closed, 1 = shared open, all bits 1 = excl open.
224 225 *
225 226 * NOTE: Unused if HBA driver implements its own open(9e) entry point.
226 227 */
227 228 kmutex_t tran_open_lock;
228 229 uint64_t tran_open_flag;
229 230
230 231 /*
231 232 * bus_config vectors - ON Consolidation Private
232 233 * These interfaces are subject to change.
233 234 */
234 235 int (*tran_bus_config)(
235 236 dev_info_t *hba_dip,
236 237 uint_t flag,
237 238 ddi_bus_config_op_t op,
238 239 void *arg,
239 240 dev_info_t **tgt_dipp);
240 241
241 242 int (*tran_bus_unconfig)(
242 243 dev_info_t *hba_dip,
243 244 uint_t flag,
244 245 ddi_bus_config_op_t op,
245 246 void *arg);
246 247
247 248 int (*tran_bus_power)(
248 249 dev_info_t *dip,
249 250 void *impl_arg,
250 251 pm_bus_power_op_t op,
251 252 void *arg,
252 253 void *result);
253 254
254 255 /*
255 256 * Inter-Connect type of transport as defined in
256 257 * usr/src/uts/common/sys/scsi/impl/services.h
257 258 */
258 259 int tran_interconnect_type;
259 260
260 261 /* tran_setup_pkt(9E) related scsi_pkt fields */
261 262 int (*tran_pkt_constructor)(
262 263 struct scsi_pkt *pkt,
263 264 scsi_hba_tran_t *tran,
264 265 int kmflag);
265 266 void (*tran_pkt_destructor)(
266 267 struct scsi_pkt *pkt,
267 268 scsi_hba_tran_t *tran);
268 269 kmem_cache_t *tran_pkt_cache_ptr;
269 270 uint_t tran_hba_len;
270 271 int (*tran_setup_pkt)(
271 272 struct scsi_pkt *pkt,
272 273 int (*callback)(
273 274 caddr_t arg),
274 275 caddr_t callback_arg);
275 276 void (*tran_teardown_pkt)(
276 277 struct scsi_pkt *pkt);
277 278 ddi_dma_attr_t tran_dma_attr;
278 279
279 280 void *tran_extension;
280 281
281 282 /*
282 283 * An fm_capable HBA driver can set tran_fm_capable prior to
283 284 * scsi_hba_attach_setup(). If not set, SCSA provides a default
284 285 * implementation.
285 286 */
286 287 int tran_fm_capable;
287 288
288 289 /*
289 290 * Ptr to the device info structure for initiator port. If a SCSA HBA
290 291 * driver separates initiator port function from HBA function, this
291 292 * field still refers to the initiator port.
292 293 */
293 294 dev_info_t *tran_iport_dip;
294 295
295 296 /*
296 297 * map of initiator ports below HBA
297 298 */
298 299 scsi_hba_iportmap_t *tran_iportmap;
299 300
300 301 /*
301 302 * map of targets below initiator
302 303 */
303 304 scsi_hba_tgtmap_t *tran_tgtmap;
304 305
305 306 #ifdef SCSI_SIZE_CLEAN_VERIFY
306 307 /*
307 308 * Must be last: Building a driver with-and-without
308 309 * -DSCSI_SIZE_CLEAN_VERIFY, and checking driver modules for
309 310 * differences with a tools like 'wsdiff' allows a developer to verify
310 311 * that their driver has no dependencies on scsi*(9S) size.
311 312 */
312 313 int _pad[8];
313 314 #endif /* SCSI_SIZE_CLEAN_VERIFY */
314 315 };
315 316 size_t scsi_hba_tran_size(); /* private */
316 317
317 318 #ifdef __lock_lint
318 319 _NOTE(SCHEME_PROTECTS_DATA("stable data",
319 320 scsi_hba_tran::tran_sd
320 321 scsi_hba_tran::tran_hba_dip
321 322 scsi_hba_tran::tran_hba_flags
322 323 scsi_hba_tran::tran_open_flag
323 324 scsi_hba_tran::tran_pkt_cache_ptr))
324 325 /*
325 326 * we only modify the dma attributes (like dma_attr_granular) upon
326 327 * attach and in response to a setcap. It is also up to the target
327 328 * driver to not have any outstanding I/Os when it is changing the
328 329 * capabilities of the transport.
329 330 */
330 331 _NOTE(SCHEME_PROTECTS_DATA("serialized by target driver", \
331 332 scsi_hba_tran::tran_dma_attr.dma_attr_granular))
332 333 #endif
333 334
334 335 /*
335 336 * Prototypes for SCSI HBA interface functions
336 337 *
337 338 * All these functions are public interfaces, with the
338 339 * exception of:
339 340 * interface called by
340 341 * scsi_initialize_hba_interface() _init() of scsi module
341 342 * scsi_uninitialize_hba_interface() _fini() of scsi module
342 343 */
343 344
344 345 void scsi_initialize_hba_interface(void);
345 346
↓ open down ↓ |
313 lines elided |
↑ open up ↑ |
346 347 #ifdef NO_SCSI_FINI_YET
347 348 void scsi_uninitialize_hba_interface(void);
348 349 #endif /* NO_SCSI_FINI_YET */
349 350
350 351 int scsi_hba_init(
351 352 struct modlinkage *modlp);
352 353
353 354 void scsi_hba_fini(
354 355 struct modlinkage *modlp);
355 356
356 -int scsi_hba_attach(
357 - dev_info_t *hba_dip,
358 - ddi_dma_lim_t *hba_lim,
359 - scsi_hba_tran_t *tran,
360 - int flags,
361 - void *hba_options);
362 -
363 357 int scsi_hba_attach_setup(
364 358 dev_info_t *hba_dip,
365 359 ddi_dma_attr_t *hba_dma_attr,
366 360 scsi_hba_tran_t *tran,
367 361 int flags);
368 362
369 363 int scsi_hba_detach(
370 364 dev_info_t *hba_dip);
371 365
372 366 scsi_hba_tran_t *scsi_hba_tran_alloc(
373 367 dev_info_t *hba_dip,
374 368 int flags);
375 369
376 370 int scsi_tran_ext_alloc(
377 371 scsi_hba_tran_t *tran,
378 372 size_t length,
379 373 int flags);
380 374
381 375 void scsi_tran_ext_free(
382 376 scsi_hba_tran_t *tran,
383 377 size_t length);
384 378
385 379 void scsi_hba_tran_free(
386 380 scsi_hba_tran_t *tran);
387 381
388 382 int scsi_hba_probe(
389 383 struct scsi_device *sd,
390 384 int (*callback)(void));
391 385
392 386 int scsi_hba_probe_pi(
393 387 struct scsi_device *sd,
394 388 int (*callback)(void),
395 389 int pi);
396 390
397 391 int scsi_hba_ua_get_reportdev(
398 392 struct scsi_device *sd,
399 393 char *ba,
400 394 int len);
401 395
402 396 int scsi_hba_ua_get(
403 397 struct scsi_device *sd,
404 398 char *ua,
405 399 int len);
406 400
407 401 char *scsi_get_device_type_string(
408 402 char *prop_name,
409 403 dev_info_t *hba_dip,
410 404 struct scsi_device *sd);
411 405
412 406 int scsi_get_scsi_maxluns(
413 407 struct scsi_device *sd);
414 408
415 409 int scsi_get_scsi_options(
416 410 struct scsi_device *sd,
417 411 int default_scsi_options);
418 412
419 413 int scsi_get_device_type_scsi_options(
420 414 dev_info_t *hba_dip,
421 415 struct scsi_device *sd,
422 416 int default_scsi_options);
423 417
424 418 struct scsi_pkt *scsi_hba_pkt_alloc(
425 419 dev_info_t *hba_dip,
426 420 struct scsi_address *ap,
427 421 int cmdlen,
428 422 int statuslen,
429 423 int tgtlen,
430 424 int hbalen,
431 425 int (*callback)(caddr_t),
432 426 caddr_t arg);
433 427
434 428 void scsi_hba_pkt_free(
435 429 struct scsi_address *ap,
436 430 struct scsi_pkt *pkt);
437 431
438 432
439 433 int scsi_hba_lookup_capstr(
440 434 char *capstr);
441 435
442 436 int scsi_hba_in_panic(void);
443 437
444 438 int scsi_hba_open(
445 439 dev_t *devp,
446 440 int flags,
447 441 int otyp,
448 442 cred_t *credp);
449 443
450 444 int scsi_hba_close(
451 445 dev_t dev,
452 446 int flag,
453 447 int otyp,
454 448 cred_t *credp);
455 449
456 450 int scsi_hba_ioctl(
457 451 dev_t dev,
458 452 int cmd,
459 453 intptr_t arg,
460 454 int mode,
461 455 cred_t *credp,
462 456 int *rvalp);
463 457
464 458 void scsi_hba_nodename_compatible_get(
465 459 struct scsi_inquiry *inq,
466 460 char *binding_set,
467 461 int dtype_node,
468 462 char *compat0,
469 463 char **nodenamep,
470 464 char ***compatiblep,
471 465 int *ncompatiblep);
472 466
473 467 void scsi_hba_nodename_compatible_free(
474 468 char *nodename,
475 469 char **compatible);
476 470
477 471 int scsi_device_prop_update_inqstring(
478 472 struct scsi_device *sd,
479 473 char *name,
480 474 char *data,
481 475 size_t len);
482 476
483 477 void scsi_hba_pkt_comp(
484 478 struct scsi_pkt *pkt);
485 479
486 480 int scsi_device_identity(
487 481 struct scsi_device *sd,
488 482 int (*callback)(void));
489 483
490 484 char *scsi_hba_iport_unit_address(
491 485 dev_info_t *dip);
492 486
493 487 int scsi_hba_iport_register(
494 488 dev_info_t *dip,
495 489 char *port);
496 490
497 491 int scsi_hba_iport_exist(
498 492 dev_info_t *dip);
499 493
500 494 dev_info_t *scsi_hba_iport_find(
501 495 dev_info_t *pdip,
502 496 char *portnm);
503 497
504 498
505 499 /*
506 500 * Flags for scsi_hba_attach
507 501 *
508 502 * SCSI_HBA_ADDR_SPI The host adapter driver wants the
509 503 * scsi_address(9S) structure to be maintained
510 504 * in legacy SPI 'a_target'/'a_lun' form (default).
511 505 *
512 506 * SCSI_HBA_ADDR_COMPLEX The host adapter has a complex unit-address
513 507 * space, and the HBA driver wants to maintain
514 508 * per-scsi_device(9S) HBA private data using
515 509 * scsi_address_device(9F) and
516 510 * scsi_device_hba_private_[gs]et(9F). The HBA
517 511 * driver must maintain a private representation
518 512 * of the scsi_device(9S) unit-address - typically
519 513 * established during tran_tgt_init(9F) based on
520 514 * property values.
521 515 *
522 516 * SCSI_HBA_TRAN_PHCI The host adapter is an mpxio/scsi_vhci pHCI.
523 517 * The framework should take care of
524 518 * mdi_phci_register() stuff.
525 519 *
526 520 * SCSI_HBA_HBA The host adapter node (associated with a PCI
527 521 * function) is just an HBA, all SCSI initiator
528 522 * port function is provided by separate 'iport'
529 523 * children of the host adapter node. These iport
530 524 * children bind to the same driver as the host
531 525 * adapter node. Both nodes are managed by the
532 526 * same driver. The driver can distinguish context
533 527 * by calling scsi_hba_iport_unit_address().
534 528 *
535 529 * ::SCSI_HBA_TRAN_CLONE Deprecated: use SCSI_HBA_ADDR_COMPLEX instead.
536 530 * SCSI_HBA_TRAN_CLONE was a KLUDGE to address
537 531 * limitations of the scsi_address(9S) structure
538 532 * via duplication of scsi_hba_tran(9S) and
539 533 * use of tran_tgt_private.
540 534 *
541 535 */
542 536 #define SCSI_HBA_TRAN_CLONE 0x01 /* Deprecated */
543 537 #define SCSI_HBA_TRAN_PHCI 0x02 /* treat HBA as mpxio 'pHCI' */
544 538 #define SCSI_HBA_TRAN_CDB 0x04 /* allocate cdb */
545 539 #define SCSI_HBA_TRAN_SCB 0x08 /* allocate sense */
546 540 #define SCSI_HBA_HBA 0x10 /* all HBA children are iports */
547 541
548 542 #define SCSI_HBA_ADDR_SPI 0x20 /* scsi_address in SPI form */
549 543 #define SCSI_HBA_ADDR_COMPLEX 0x40 /* scsi_address is COMPLEX */
550 544
551 545 /* upper bits used to record SCSA configuration state */
552 546 #define SCSI_HBA_SCSA_PHCI 0x10000 /* need mdi_phci_unregister */
553 547 #define SCSI_HBA_SCSA_TA 0x20000 /* scsi_hba_tran_alloc used */
554 548 #define SCSI_HBA_SCSA_FM 0x40000 /* using common ddi_fm_* */
555 549
556 550 /*
557 551 * Flags for scsi_hba allocation functions
558 552 */
559 553 #define SCSI_HBA_CANSLEEP 0x01 /* can sleep */
560 554
561 555 /*
562 556 * Support extra flavors for SCSA children
563 557 */
564 558 #define SCSA_FLAVOR_SCSI_DEVICE NDI_FLAVOR_VANILLA
565 559 #define SCSA_FLAVOR_SMP 1
566 560 #define SCSA_FLAVOR_IPORT 2
567 561 #define SCSA_NFLAVORS 3
568 562
569 563 /*
570 564 * Maximum number of iport nodes under PCI function
571 565 */
572 566 #define SCSI_HBA_MAX_IPORTS 32
573 567
574 568 /*
575 569 * SCSI iport map interfaces
576 570 */
577 571 int scsi_hba_iportmap_create(
578 572 dev_info_t *hba_dip,
579 573 int csync_usec,
580 574 int stable_usec,
581 575 scsi_hba_iportmap_t **iportmapp);
582 576
583 577 int scsi_hba_iportmap_iport_add(
584 578 scsi_hba_iportmap_t *iportmap,
585 579 char *iport_addr,
586 580 void *iport_priv);
587 581
588 582 int scsi_hba_iportmap_iport_remove(
589 583 scsi_hba_iportmap_t *iportmap,
590 584 char *iport_addr);
591 585
592 586 void scsi_hba_iportmap_destroy(scsi_hba_iportmap_t *iportmap);
593 587
594 588 /*
595 589 * SCSI target map interfaces
596 590 */
597 591 typedef enum {
598 592 SCSI_TM_FULLSET = 0,
599 593 SCSI_TM_PERADDR
600 594 } scsi_tgtmap_mode_t;
601 595
602 596 typedef enum {
603 597 SCSI_TGT_SCSI_DEVICE = 0,
604 598 SCSI_TGT_SMP_DEVICE,
605 599 SCSI_TGT_NTYPES
606 600 } scsi_tgtmap_tgt_type_t;
607 601
608 602 typedef enum {
609 603 SCSI_TGT_DEACT_RSN_GONE = 0,
610 604 SCSI_TGT_DEACT_RSN_CFG_FAIL,
611 605 SCSI_TGT_DEACT_RSN_UNSTBL
612 606 } scsi_tgtmap_deact_rsn_t;
613 607
614 608 typedef void (*scsi_tgt_activate_cb_t)(
615 609 void *tgtmap_priv,
616 610 char *tgt_addr,
617 611 scsi_tgtmap_tgt_type_t tgt_type,
618 612 void **tgt_privp);
619 613 typedef boolean_t (*scsi_tgt_deactivate_cb_t)(
620 614 void *tgtmap_priv,
621 615 char *tgt_addr,
622 616 scsi_tgtmap_tgt_type_t tgt_type,
623 617 void *tgt_priv,
624 618 scsi_tgtmap_deact_rsn_t tgt_deact_rsn);
625 619 int scsi_hba_tgtmap_create(
626 620 dev_info_t *iport_dip,
627 621 scsi_tgtmap_mode_t rpt_mode,
628 622 int csync_usec,
629 623 int stable_usec,
630 624 void *tgtmap_priv,
631 625 scsi_tgt_activate_cb_t activate_cb,
632 626 scsi_tgt_deactivate_cb_t deactivate_cb,
633 627 scsi_hba_tgtmap_t **tgtmapp);
634 628
635 629 int scsi_hba_tgtmap_set_begin(scsi_hba_tgtmap_t *tgtmap);
636 630
637 631 int scsi_hba_tgtmap_set_add(
638 632 scsi_hba_tgtmap_t *tgtmap,
639 633 scsi_tgtmap_tgt_type_t tgt_type,
640 634 char *tgt_addr,
641 635 void *tgt_priv);
642 636
643 637 int scsi_hba_tgtmap_set_end(
644 638 scsi_hba_tgtmap_t *tgtmap,
645 639 uint_t flags);
646 640
647 641 int scsi_hba_tgtmap_set_flush(scsi_hba_tgtmap_t *tgtmap);
648 642
649 643 int scsi_hba_tgtmap_tgt_add(
650 644 scsi_hba_tgtmap_t *tgtmap,
651 645 scsi_tgtmap_tgt_type_t tgt_type,
652 646 char *tgt_addr,
653 647 void *tgt_priv);
654 648
655 649 int scsi_hba_tgtmap_tgt_remove(
656 650 scsi_hba_tgtmap_t *tgtmap,
657 651 scsi_tgtmap_tgt_type_t tgt_type,
658 652 char *tgt_addr);
659 653
660 654 void scsi_hba_tgtmap_destroy(scsi_hba_tgtmap_t *tgt_map);
661 655
662 656
663 657 /*
664 658 * For minor nodes created by the SCSA framework, minor numbers are
665 659 * formed by left-shifting instance by INST_MINOR_SHIFT and OR in a
666 660 * number less than 64.
667 661 *
668 662 * - Numbers 0 - 31 are reserved by the framework, part of the range are
669 663 * in use, as defined below.
670 664 *
671 665 * - Numbers 32 - 63 are available for HBA driver use.
672 666 */
673 667 #define INST_MINOR_SHIFT 6
674 668 #define TRAN_MINOR_MASK ((1 << INST_MINOR_SHIFT) - 1)
675 669 #define TRAN_OPEN_EXCL (uint64_t)-1
676 670
677 671 #define DEVCTL_MINOR 0
678 672 #define SCSI_MINOR 1
679 673
680 674 #define INST2DEVCTL(x) (((x) << INST_MINOR_SHIFT) | DEVCTL_MINOR)
681 675 #define INST2SCSI(x) (((x) << INST_MINOR_SHIFT) | SCSI_MINOR)
682 676 #define MINOR2INST(x) ((x) >> INST_MINOR_SHIFT)
683 677
684 678 #define SCSI_HBA_PROP_RECEPTACLE_LABEL "receptacle-label"
685 679
686 680 #endif /* _KERNEL */
687 681
688 682 #ifdef __cplusplus
689 683 }
690 684 #endif
691 685
692 686 #endif /* _SYS_SCSI_IMPL_TRANSPORT_H */
↓ open down ↓ |
320 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX