Print this page
OS-1996 mpt_sas: allow physical topology enumeration in libtopo
Reviewed by: Keith Wesolowski <keith.wesolowski@joyent.com>


   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 2010 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */



  26 
  27 /*
  28  * Copyright (c) 2000 to 2010, LSI Corporation.
  29  * All rights reserved.
  30  *
  31  * Redistribution and use in source and binary forms of all code within
  32  * this file that is exclusively owned by LSI, with or without
  33  * modification, is permitted provided that, in addition to the CDDL 1.0
  34  * License requirements, the following conditions are met:
  35  *
  36  *    Neither the name of the author nor the names of its contributors may be
  37  *    used to endorse or promote products derived from this software without
  38  *    specific prior written permission.
  39  *
  40  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  41  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  42  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  43  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  44  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  45  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,


  54 #ifndef _MPTSAS_IOCTL_H
  55 #define _MPTSAS_IOCTL_H
  56 
  57 #ifdef  __cplusplus
  58 extern "C" {
  59 #endif
  60 
  61 #include <sys/types.h>
  62 
  63 #define MPTIOCTL                        ('I' << 8)
  64 #define MPTIOCTL_GET_ADAPTER_DATA       (MPTIOCTL | 1)
  65 #define MPTIOCTL_UPDATE_FLASH           (MPTIOCTL | 2)
  66 #define MPTIOCTL_RESET_ADAPTER          (MPTIOCTL | 3)
  67 #define MPTIOCTL_PASS_THRU              (MPTIOCTL | 4)
  68 #define MPTIOCTL_EVENT_QUERY            (MPTIOCTL | 5)
  69 #define MPTIOCTL_EVENT_ENABLE           (MPTIOCTL | 6)
  70 #define MPTIOCTL_EVENT_REPORT           (MPTIOCTL | 7)
  71 #define MPTIOCTL_GET_PCI_INFO           (MPTIOCTL | 8)
  72 #define MPTIOCTL_DIAG_ACTION            (MPTIOCTL | 9)
  73 #define MPTIOCTL_REG_ACCESS             (MPTIOCTL | 10)

  74 
  75 /*
  76  *  The following are our ioctl() return status values.  If everything went
  77  *  well, we return good status.  If the buffer length sent to us is too short
  78  *  we return a status to tell the user.
  79  */
  80 #define MPTIOCTL_STATUS_GOOD            0
  81 #define MPTIOCTL_STATUS_LEN_TOO_SHORT   1
  82 
  83 typedef struct mptsas_pci_bits
  84 {
  85         union {
  86                 struct {
  87                         uint32_t        DeviceNumber    :5;
  88                         uint32_t        FunctionNumber  :3;
  89                         uint32_t        BusNumber       :24;
  90                 } bits;
  91                 uint32_t        AsDWORD;
  92         } u;
  93         uint32_t        PciSegmentId;


 279         uint32_t        BytesToRead;
 280         uint32_t        UniqueId;
 281         uint32_t        DataBuffer[1];
 282 } mptsas_diag_read_buffer_t;
 283 
 284 /*
 285  * Register Access
 286  */
 287 #define REG_IO_READ     1
 288 #define REG_IO_WRITE    2
 289 #define REG_MEM_READ    3
 290 #define REG_MEM_WRITE   4
 291 
 292 typedef struct mptsas_reg_access
 293 {
 294         uint32_t        Command;
 295         uint32_t        RegOffset;
 296         uint32_t        RegData;
 297 } mptsas_reg_access_t;
 298 





























 299 #ifdef  __cplusplus
 300 }
 301 #endif
 302 
 303 #endif  /* _MPTSAS_IOCTL_H */


   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 2010 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 /*
  27  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  28  */
  29 
  30 /*
  31  * Copyright (c) 2000 to 2010, LSI Corporation.
  32  * All rights reserved.
  33  *
  34  * Redistribution and use in source and binary forms of all code within
  35  * this file that is exclusively owned by LSI, with or without
  36  * modification, is permitted provided that, in addition to the CDDL 1.0
  37  * License requirements, the following conditions are met:
  38  *
  39  *    Neither the name of the author nor the names of its contributors may be
  40  *    used to endorse or promote products derived from this software without
  41  *    specific prior written permission.
  42  *
  43  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  44  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  45  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  46  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  47  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  48  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,


  57 #ifndef _MPTSAS_IOCTL_H
  58 #define _MPTSAS_IOCTL_H
  59 
  60 #ifdef  __cplusplus
  61 extern "C" {
  62 #endif
  63 
  64 #include <sys/types.h>
  65 
  66 #define MPTIOCTL                        ('I' << 8)
  67 #define MPTIOCTL_GET_ADAPTER_DATA       (MPTIOCTL | 1)
  68 #define MPTIOCTL_UPDATE_FLASH           (MPTIOCTL | 2)
  69 #define MPTIOCTL_RESET_ADAPTER          (MPTIOCTL | 3)
  70 #define MPTIOCTL_PASS_THRU              (MPTIOCTL | 4)
  71 #define MPTIOCTL_EVENT_QUERY            (MPTIOCTL | 5)
  72 #define MPTIOCTL_EVENT_ENABLE           (MPTIOCTL | 6)
  73 #define MPTIOCTL_EVENT_REPORT           (MPTIOCTL | 7)
  74 #define MPTIOCTL_GET_PCI_INFO           (MPTIOCTL | 8)
  75 #define MPTIOCTL_DIAG_ACTION            (MPTIOCTL | 9)
  76 #define MPTIOCTL_REG_ACCESS             (MPTIOCTL | 10)
  77 #define MPTIOCTL_GET_DISK_INFO          (MPTIOCTL | 11)
  78 
  79 /*
  80  *  The following are our ioctl() return status values.  If everything went
  81  *  well, we return good status.  If the buffer length sent to us is too short
  82  *  we return a status to tell the user.
  83  */
  84 #define MPTIOCTL_STATUS_GOOD            0
  85 #define MPTIOCTL_STATUS_LEN_TOO_SHORT   1
  86 
  87 typedef struct mptsas_pci_bits
  88 {
  89         union {
  90                 struct {
  91                         uint32_t        DeviceNumber    :5;
  92                         uint32_t        FunctionNumber  :3;
  93                         uint32_t        BusNumber       :24;
  94                 } bits;
  95                 uint32_t        AsDWORD;
  96         } u;
  97         uint32_t        PciSegmentId;


 283         uint32_t        BytesToRead;
 284         uint32_t        UniqueId;
 285         uint32_t        DataBuffer[1];
 286 } mptsas_diag_read_buffer_t;
 287 
 288 /*
 289  * Register Access
 290  */
 291 #define REG_IO_READ     1
 292 #define REG_IO_WRITE    2
 293 #define REG_MEM_READ    3
 294 #define REG_MEM_WRITE   4
 295 
 296 typedef struct mptsas_reg_access
 297 {
 298         uint32_t        Command;
 299         uint32_t        RegOffset;
 300         uint32_t        RegData;
 301 } mptsas_reg_access_t;
 302 
 303 /*
 304  * Disk Toplogy Information
 305  */
 306 typedef struct mptsas_disk_info
 307 {
 308         uint64_t        SasAddress;
 309         uint16_t        Instance;
 310         uint16_t        Enclosure;
 311         uint16_t        Slot;
 312 } mptsas_disk_info_t;
 313 
 314 typedef struct mptsas_get_disk_info
 315 {
 316         uint16_t                DiskCount;
 317         mptsas_disk_info_t      *PtrDiskInfoArray;
 318         uint64_t                DiskInfoArraySize;
 319 } mptsas_get_disk_info_t;
 320 
 321 #ifdef _KERNEL
 322 
 323 typedef struct mptsas_get_disk_info32
 324 {
 325         uint16_t                DiskCount;
 326         caddr32_t               PtrDiskInfoArray;
 327         uint64_t                DiskInfoArraySize;
 328 } mptsas_get_disk_info32_t;
 329 
 330 #endif /* _KERNEL */
 331 
 332 #ifdef  __cplusplus
 333 }
 334 #endif
 335 
 336 #endif  /* _MPTSAS_IOCTL_H */