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 #ifdef	__cplusplus
31*66f9d5cbSmlf extern "C" {
32*66f9d5cbSmlf #endif
33*66f9d5cbSmlf 
34*66f9d5cbSmlf /* SATA cfgadm plugin interface definitions */
35*66f9d5cbSmlf 
36*66f9d5cbSmlf /*
37*66f9d5cbSmlf  * Sub-commands of DEVCTL_AP_CONTROL.
38*66f9d5cbSmlf  */
39*66f9d5cbSmlf typedef enum {
40*66f9d5cbSmlf 	SATA_CFGA_GET_AP_TYPE = 1,
41*66f9d5cbSmlf 	SATA_CFGA_GET_MODEL_INFO,
42*66f9d5cbSmlf 	SATA_CFGA_GET_REVFIRMWARE_INFO,
43*66f9d5cbSmlf 	SATA_CFGA_GET_SERIALNUMBER_INFO,
44*66f9d5cbSmlf 	SATA_CFGA_RESET_PORT,
45*66f9d5cbSmlf 	SATA_CFGA_RESET_DEVICE,
46*66f9d5cbSmlf 	SATA_CFGA_RESET_ALL,
47*66f9d5cbSmlf 	SATA_CFGA_PORT_DEACTIVATE,
48*66f9d5cbSmlf 	SATA_CFGA_PORT_ACTIVATE,
49*66f9d5cbSmlf 	SATA_CFGA_PORT_SELF_TEST,
50*66f9d5cbSmlf 	SATA_CFGA_GET_DEVICE_PATH
51*66f9d5cbSmlf } sata_cfga_apctl_t;
52*66f9d5cbSmlf 
53*66f9d5cbSmlf /* SATA cfgadm plugin interface implementation definitions */
54*66f9d5cbSmlf 
55*66f9d5cbSmlf typedef struct sata_ioctl_data {
56*66f9d5cbSmlf 	uint_t		cmd;			/* one of the above commands */
57*66f9d5cbSmlf 	uint_t		port;			/* port */
58*66f9d5cbSmlf 	uint_t		get_size;		/* get size/data flag */
59*66f9d5cbSmlf 	caddr_t		buf;			/* data buffer */
60*66f9d5cbSmlf 	uint_t		bufsiz;			/* data buffer size */
61*66f9d5cbSmlf 	uint_t		misc_arg;		/* reserved */
62*66f9d5cbSmlf } sata_ioctl_data_t;
63*66f9d5cbSmlf 
64*66f9d5cbSmlf 
65*66f9d5cbSmlf /* For 32-bit app/64-bit kernel */
66*66f9d5cbSmlf typedef struct sata_ioctl_data_32 {
67*66f9d5cbSmlf 	uint32_t	cmd;			/* one of the above commands */
68*66f9d5cbSmlf 	uint32_t	port;			/* port */
69*66f9d5cbSmlf 	uint32_t	get_size;		/* get size/data flag */
70*66f9d5cbSmlf 	caddr32_t	buf;			/* data buffer */
71*66f9d5cbSmlf 	uint32_t	bufsiz;			/* data buffer size */
72*66f9d5cbSmlf 	uint32_t	misc_arg;		/* reserved */
73*66f9d5cbSmlf } sata_ioctl_data_32_t;
74*66f9d5cbSmlf 
75*66f9d5cbSmlf /*
76*66f9d5cbSmlf  * Port encoding for ioctl "port" parameter - corresponds to
77*66f9d5cbSmlf  * scsi target encoding for sata devices
78*66f9d5cbSmlf  */
79*66f9d5cbSmlf #define	SATA_CFGA_CPORT_MASK	0x1f
80*66f9d5cbSmlf #define	SATA_CFGA_PMPORT_MASK	0xf
81*66f9d5cbSmlf #define	SATA_CFGA_PMPORT_SHIFT	0x5
82*66f9d5cbSmlf #define	SATA_CFGA_PMPORT_QUAL	0x200
83*66f9d5cbSmlf 
84*66f9d5cbSmlf #ifdef	__cplusplus
85*66f9d5cbSmlf }
86*66f9d5cbSmlf #endif
87*66f9d5cbSmlf 
88*66f9d5cbSmlf #endif /* _SATA_CFGADM_H */
89