1*25d3b9e7Sdholland /* $NetBSD: tctrl.h,v 1.5 2015/09/07 03:49:46 dholland Exp $ */ 25e200de9Sgarbled 35e200de9Sgarbled /*- 45e200de9Sgarbled * Copyright (c) 1998 The NetBSD Foundation, Inc. 55e200de9Sgarbled * All rights reserved. 65e200de9Sgarbled * 75e200de9Sgarbled * This code is derived from software contributed to The NetBSD Foundation 85e200de9Sgarbled * by Tim Rightnour. 95e200de9Sgarbled * 105e200de9Sgarbled * Redistribution and use in source and binary forms, with or without 115e200de9Sgarbled * modification, are permitted provided that the following conditions 125e200de9Sgarbled * are met: 135e200de9Sgarbled * 1. Redistributions of source code must retain the above copyright 145e200de9Sgarbled * notice, this list of conditions and the following disclaimer. 155e200de9Sgarbled * 2. Redistributions in binary form must reproduce the above copyright 165e200de9Sgarbled * notice, this list of conditions and the following disclaimer in the 175e200de9Sgarbled * documentation and/or other materials provided with the distribution. 185e200de9Sgarbled * 195e200de9Sgarbled * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 205e200de9Sgarbled * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 215e200de9Sgarbled * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 225e200de9Sgarbled * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 235e200de9Sgarbled * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 245e200de9Sgarbled * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 255e200de9Sgarbled * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 265e200de9Sgarbled * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 275e200de9Sgarbled * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 285e200de9Sgarbled * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 295e200de9Sgarbled * POSSIBILITY OF SUCH DAMAGE. 305e200de9Sgarbled */ 315e200de9Sgarbled #ifndef _MACHINE_TCTRL_H 325e200de9Sgarbled #define _MACHINE_TCTRL_H 335e200de9Sgarbled 34*25d3b9e7Sdholland #include <sys/ioccom.h> 35*25d3b9e7Sdholland 365e200de9Sgarbled struct tctrl_req { 376e4f5eb5Suwe uint8_t cmdbuf[16]; 386e4f5eb5Suwe uint8_t cmdlen; 396e4f5eb5Suwe uint8_t cmdoff; 405e200de9Sgarbled struct proc *p; 416e4f5eb5Suwe uint8_t rspbuf[16]; 426e4f5eb5Suwe uint8_t rspoff; 436e4f5eb5Suwe uint8_t rsplen; 445e200de9Sgarbled }; 455e200de9Sgarbled typedef struct tctrl_req tctrl_req_t; 465e200de9Sgarbled 4748ba7742Sjdc struct tctrl_pwr { 4848ba7742Sjdc int rw; 4948ba7742Sjdc int state; 5048ba7742Sjdc }; 5148ba7742Sjdc typedef struct tctrl_pwr tctrl_pwr_t; 5248ba7742Sjdc 5348ba7742Sjdc /* Port power state */ 5448ba7742Sjdc #define PORT_PWR_ON 0x00 /* Always on */ 5548ba7742Sjdc #define PORT_PWR_STANDBY 0x01 /* On when open */ 5648ba7742Sjdc #define PORT_PWR_OFF 0x02 /* Always off */ 5748ba7742Sjdc 585e200de9Sgarbled #define TCTRL_CMD_REQ _IOWR('C', 0, struct tctrl_req) 5948ba7742Sjdc #define TCTRL_SERIAL_PWR _IOWR('C', 1, struct tctrl_pwr) 6048ba7742Sjdc #define TCTRL_MODEM_PWR _IOWR('C', 2, struct tctrl_pwr) 615e200de9Sgarbled 625e200de9Sgarbled #endif /* _MACHINE_TCTRL_H */ 63