5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 1982, 2010, Oracle and/or its affiliates. All rights reserved.
  24  *
  25  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  26  * Copyright 2012 DEY Storage Systems, Inc.  All rights reserved.
  27  */
  28 
  29 #ifndef _SYS_DKIO_H
  30 #define _SYS_DKIO_H
  31 
  32 #include <sys/dklabel.h>  /* Needed for NDKMAP define */
  33 
  34 #ifdef  __cplusplus
  35 extern "C" {
  36 #endif
  37 
  38 /*
  39  * Structures and definitions for disk io control commands
  40  */
  41 
  42 /*
  43  * Structures used as data by ioctl calls.
  44  */
  45 
  46 #define DK_DEVLEN       16              /* device name max length, including */
  47                                         /* unit # & NULL (ie - "xyc1") */
  48 
  49 /*
  50  * Used for controller info
  51  */
  52 struct dk_cinfo {
 
 506         uint_t          dku_size;       /* firmware buf length */
 507         uint8_t         dku_type;       /* firmware update type */
 508 } dk_updatefw_t;
 509 
 510 #ifdef _SYSCALL32
 511 typedef struct dk_updatefw_32 {
 512         caddr32_t       dku_ptrbuf;     /* pointer to firmware buf */
 513         uint_t          dku_size;       /* firmware buf length */
 514         uint8_t         dku_type;       /* firmware update type */
 515 } dk_updatefw_32_t;
 516 #endif /* _SYSCALL32 */
 517 
 518 /*
 519  * firmware update type - temporary or permanent use
 520  */
 521 #define FW_TYPE_TEMP    0x0             /* temporary use */
 522 #define FW_TYPE_PERM    0x1             /* permanent use */
 523 
 524 /*
 525  * ioctl to free space (e.g. SCSI UNMAP) off a disk.
 526  */
 527 #define DKIOCFREE       (DKIOC|50)
 528 
 529 typedef struct dkioc_free_s {
 530         uint32_t df_flags;
 531         uint32_t df_reserved;   /* For easy 64-bit alignment below... */
 532         diskaddr_t df_start;
 533         diskaddr_t df_length;
 534 } dkioc_free_t;
 535 
 536 #define DF_WAIT_SYNC    0x00000001      /* Wait for full write-out of free. */
 537 
 538 #ifdef  __cplusplus
 539 }
 540 #endif
 541 
 542 #endif /* _SYS_DKIO_H */
 | 
 
 
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 1982, 2010, Oracle and/or its affiliates. All rights reserved.
  24  *
  25  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  26  * Copyright 2012 DEY Storage Systems, Inc.  All rights reserved.
  27  */
  28 
  29 #ifndef _SYS_DKIO_H
  30 #define _SYS_DKIO_H
  31 
  32 #include <sys/dklabel.h>  /* Needed for NDKMAP define */
  33 #include <sys/int_limits.h>       /* Needed for UINT16_MAX */
  34 
  35 #ifdef  __cplusplus
  36 extern "C" {
  37 #endif
  38 
  39 /*
  40  * Structures and definitions for disk io control commands
  41  */
  42 
  43 /*
  44  * Structures used as data by ioctl calls.
  45  */
  46 
  47 #define DK_DEVLEN       16              /* device name max length, including */
  48                                         /* unit # & NULL (ie - "xyc1") */
  49 
  50 /*
  51  * Used for controller info
  52  */
  53 struct dk_cinfo {
 
 507         uint_t          dku_size;       /* firmware buf length */
 508         uint8_t         dku_type;       /* firmware update type */
 509 } dk_updatefw_t;
 510 
 511 #ifdef _SYSCALL32
 512 typedef struct dk_updatefw_32 {
 513         caddr32_t       dku_ptrbuf;     /* pointer to firmware buf */
 514         uint_t          dku_size;       /* firmware buf length */
 515         uint8_t         dku_type;       /* firmware update type */
 516 } dk_updatefw_32_t;
 517 #endif /* _SYSCALL32 */
 518 
 519 /*
 520  * firmware update type - temporary or permanent use
 521  */
 522 #define FW_TYPE_TEMP    0x0             /* temporary use */
 523 #define FW_TYPE_PERM    0x1             /* permanent use */
 524 
 525 /*
 526  * ioctl to free space (e.g. SCSI UNMAP) off a disk.
 527  * Pass a dkioc_free_list_t containing a list of extents to be freed.
 528  */
 529 #define DKIOCFREE       (DKIOC|50)
 530 
 531 #define DF_WAIT_SYNC    0x00000001      /* Wait for full write-out of free. */
 532 typedef struct dkioc_free_list_ext_s {
 533         uint64_t                dfle_start;
 534         uint64_t                dfle_length;
 535 } dkioc_free_list_ext_t;
 536 
 537 typedef struct dkioc_free_list_s {
 538         uint64_t                dfl_flags;
 539         uint64_t                dfl_num_exts;
 540         int64_t                 dfl_offset;
 541 
 542         /*
 543          * N.B. this is only an internal debugging API! This is only called
 544          * from debug builds of sd for pre-release checking. Remove before GA!
 545          */
 546         void                    (*dfl_ck_func)(uint64_t, uint64_t, void *);
 547         void                    *dfl_ck_arg;
 548 
 549         dkioc_free_list_ext_t   dfl_exts[1];
 550 } dkioc_free_list_t;
 551 #define DFL_SZ(num_exts) \
 552         (sizeof (dkioc_free_list_t) + (num_exts - 1) * 16)
 553 
 554 #ifdef  __cplusplus
 555 }
 556 #endif
 557 
 558 #endif /* _SYS_DKIO_H */
 |