1 /* $NetBSD: mbppio.h,v 1.1 1998/06/03 22:40:00 pk Exp $ */ 2 /* 3 * Copyright (c) 1998 Iain Hibbert 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. The name Iain Hibbert may not be used to endorse or promote products 15 * derived from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED 18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 20 * NO EVENT SHALL I BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * 28 */ 29 30 #include <sys/ioctl.h> 31 32 struct mbpp_param { 33 int bp_burst; /* chars to send/recv in one call */ 34 int bp_timeout; /* timeout: -1 blocking, 0 non blocking >0 ms */ 35 int bp_delay; /* delay between polls (ms) */ 36 }; 37 38 #define MBPP_BLOCK -1 39 #define MBPP_NOBLOCK 0 40 41 /* defaults */ 42 #define MBPP_BURST 1024 43 #define MBPP_TIMEOUT MBPP_BLOCK 44 #define MBPP_DELAY 10 45 46 /* limits */ 47 #define MBPP_BURST_MIN 1 48 #define MBPP_BURST_MAX 1024 49 #define MBPP_DELAY_MIN 0 50 #define MBPP_DELAY_MAX 30000 51 52 /* status bits */ 53 #define MBPP_BUSY (1<<0) 54 #define MBPP_PAPER (1<<1) 55 56 /* ioctl commands */ 57 #define MBPPIOCSPARAM _IOW('P', 0x1, struct mbpp_param) 58 #define MBPPIOCGPARAM _IOR('P', 0x2, struct mbpp_param) 59 #define MBPPIOCGSTAT _IOR('P', 0x4, int) 60