1*63e3ea80Sray /* $OpenBSD: bppioctl.h,v 1.2 2008/11/29 01:55:06 ray Exp $ */ 283ac0456Sjason 3*63e3ea80Sray /*- 483ac0456Sjason * Copyright (c) 1998 Iain Hibbert 583ac0456Sjason * All rights reserved. 683ac0456Sjason * 783ac0456Sjason * Redistribution and use in source and binary forms, with or without 883ac0456Sjason * modification, are permitted provided that the following conditions 983ac0456Sjason * are met: 1083ac0456Sjason * 1. Redistributions of source code must retain the above copyright 1183ac0456Sjason * notice, this list of conditions and the following disclaimer. 1283ac0456Sjason * 2. Redistributions in binary form must reproduce the above copyright 1383ac0456Sjason * notice, this list of conditions and the following disclaimer in the 1483ac0456Sjason * documentation and/or other materials provided with the distribution. 1583ac0456Sjason * 16*63e3ea80Sray * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17*63e3ea80Sray * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18*63e3ea80Sray * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19*63e3ea80Sray * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20*63e3ea80Sray * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21*63e3ea80Sray * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22*63e3ea80Sray * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23*63e3ea80Sray * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24*63e3ea80Sray * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25*63e3ea80Sray * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2683ac0456Sjason */ 2783ac0456Sjason 2883ac0456Sjason #ifndef _IOCTL_ 2983ac0456Sjason #include <sys/ioctl.h> 3083ac0456Sjason #endif 3183ac0456Sjason 3283ac0456Sjason struct bpp_param { 3383ac0456Sjason int bp_burst; /* chars to send/recv in one call */ 3483ac0456Sjason int bp_timeout; /* timeout: -1 blocking, 0 non blocking >0 ms */ 3583ac0456Sjason int bp_delay; /* delay between polls (ms) */ 3683ac0456Sjason }; 3783ac0456Sjason 3883ac0456Sjason #define BPP_BLOCK -1 3983ac0456Sjason #define BPP_NOBLOCK 0 4083ac0456Sjason 4183ac0456Sjason /* defaults */ 4283ac0456Sjason #define BPP_BURST 1024 4383ac0456Sjason #define BPP_TIMEOUT BPP_BLOCK 4483ac0456Sjason #define BPP_DELAY 10 4583ac0456Sjason 4683ac0456Sjason /* limits */ 4783ac0456Sjason #define BPP_BURST_MIN 1 4883ac0456Sjason #define BPP_BURST_MAX 1024 4983ac0456Sjason #define BPP_DELAY_MIN 0 5083ac0456Sjason #define BPP_DELAY_MAX 30000 5183ac0456Sjason 5283ac0456Sjason /* status bits */ 5383ac0456Sjason #define BPP_BUSY (1<<0) 5483ac0456Sjason #define BPP_PAPER (1<<1) 5583ac0456Sjason 5683ac0456Sjason /* ioctl commands */ 5783ac0456Sjason #define BPPIOCSPARAM _IOW('P', 0x1, struct bpp_param) 5883ac0456Sjason #define BPPIOCGPARAM _IOR('P', 0x2, struct bpp_param) 5983ac0456Sjason #define BPPIOCGSTAT _IOR('P', 0x4, int) 60