1*1258Smlf /* 2*1258Smlf * CDDL HEADER START 3*1258Smlf * 4*1258Smlf * The contents of this file are subject to the terms of the 5*1258Smlf * Common Development and Distribution License (the "License"). 6*1258Smlf * You may not use this file except in compliance with the License. 7*1258Smlf * 8*1258Smlf * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*1258Smlf * or http://www.opensolaris.org/os/licensing. 10*1258Smlf * See the License for the specific language governing permissions 11*1258Smlf * and limitations under the License. 12*1258Smlf * 13*1258Smlf * When distributing Covered Code, include this CDDL HEADER in each 14*1258Smlf * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*1258Smlf * If applicable, add the following below this CDDL HEADER, with the 16*1258Smlf * fields enclosed by brackets "[]" replaced with your own identifying 17*1258Smlf * information: Portions Copyright [yyyy] [name of copyright owner] 18*1258Smlf * 19*1258Smlf * CDDL HEADER END 20*1258Smlf */ 21*1258Smlf 22*1258Smlf /* 23*1258Smlf * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24*1258Smlf * Use is subject to license terms. 25*1258Smlf */ 26*1258Smlf 27*1258Smlf #ifndef _SATA_CFGADM_H 28*1258Smlf #define _SATA_CFGADM_H 29*1258Smlf 30*1258Smlf #pragma ident "%Z%%M% %I% %E% SMI" 31*1258Smlf 32*1258Smlf #ifdef __cplusplus 33*1258Smlf extern "C" { 34*1258Smlf #endif 35*1258Smlf 36*1258Smlf /* SATA cfgadm plugin interface definitions */ 37*1258Smlf 38*1258Smlf /* 39*1258Smlf * Sub-commands of DEVCTL_AP_CONTROL. 40*1258Smlf */ 41*1258Smlf typedef enum { 42*1258Smlf SATA_CFGA_GET_AP_TYPE = 1, 43*1258Smlf SATA_CFGA_GET_MODEL_INFO, 44*1258Smlf SATA_CFGA_GET_REVFIRMWARE_INFO, 45*1258Smlf SATA_CFGA_GET_SERIALNUMBER_INFO, 46*1258Smlf SATA_CFGA_RESET_PORT, 47*1258Smlf SATA_CFGA_RESET_DEVICE, 48*1258Smlf SATA_CFGA_RESET_ALL, 49*1258Smlf SATA_CFGA_PORT_DEACTIVATE, 50*1258Smlf SATA_CFGA_PORT_ACTIVATE, 51*1258Smlf SATA_CFGA_PORT_SELF_TEST, 52*1258Smlf SATA_CFGA_GET_DEVICE_PATH 53*1258Smlf } sata_cfga_apctl_t; 54*1258Smlf 55*1258Smlf /* SATA cfgadm plugin interface implementation definitions */ 56*1258Smlf 57*1258Smlf typedef struct sata_ioctl_data { 58*1258Smlf uint_t cmd; /* one of the above commands */ 59*1258Smlf uint_t port; /* port */ 60*1258Smlf uint_t get_size; /* get size/data flag */ 61*1258Smlf caddr_t buf; /* data buffer */ 62*1258Smlf uint_t bufsiz; /* data buffer size */ 63*1258Smlf uint_t misc_arg; /* reserved */ 64*1258Smlf } sata_ioctl_data_t; 65*1258Smlf 66*1258Smlf 67*1258Smlf /* For 32-bit app/64-bit kernel */ 68*1258Smlf typedef struct sata_ioctl_data_32 { 69*1258Smlf uint32_t cmd; /* one of the above commands */ 70*1258Smlf uint32_t port; /* port */ 71*1258Smlf uint32_t get_size; /* get size/data flag */ 72*1258Smlf caddr32_t buf; /* data buffer */ 73*1258Smlf uint32_t bufsiz; /* data buffer size */ 74*1258Smlf uint32_t misc_arg; /* reserved */ 75*1258Smlf } sata_ioctl_data_32_t; 76*1258Smlf 77*1258Smlf /* 78*1258Smlf * Port encoding for ioctl "port" parameter - corresponds to 79*1258Smlf * scsi target encoding for sata devices 80*1258Smlf */ 81*1258Smlf #define SATA_CFGA_CPORT_MASK 0x1f 82*1258Smlf #define SATA_CFGA_PMPORT_MASK 0xf 83*1258Smlf #define SATA_CFGA_PMPORT_SHIFT 0x5 84*1258Smlf #define SATA_CFGA_PMPORT_QUAL 0x200 85*1258Smlf 86*1258Smlf #ifdef __cplusplus 87*1258Smlf } 88*1258Smlf #endif 89*1258Smlf 90*1258Smlf #endif /* _SATA_CFGADM_H */ 91