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