bppioctl.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* $OpenBSD: bppioctl.h,v 1.3 2008/11/29 01:55:06 ray 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. *
  15. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  16. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  17. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  18. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  19. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  20. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  21. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  22. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  24. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. */
  26. #ifndef _IOCTL_
  27. #include <sys/ioctl.h>
  28. #endif
  29. struct bpp_param {
  30. int bp_burst; /* chars to send/recv in one call */
  31. int bp_timeout; /* timeout: -1 blocking, 0 non blocking >0 ms */
  32. int bp_delay; /* delay between polls (ms) */
  33. };
  34. #define BPP_BLOCK -1
  35. #define BPP_NOBLOCK 0
  36. /* defaults */
  37. #define BPP_BURST 1024
  38. #define BPP_TIMEOUT BPP_BLOCK
  39. #define BPP_DELAY 10
  40. /* limits */
  41. #define BPP_BURST_MIN 1
  42. #define BPP_BURST_MAX 1024
  43. #define BPP_DELAY_MIN 0
  44. #define BPP_DELAY_MAX 30000
  45. /* status bits */
  46. #define BPP_BUSY (1<<0)
  47. #define BPP_PAPER (1<<1)
  48. /* ioctl commands */
  49. #define BPPIOCSPARAM _IOW('P', 0x1, struct bpp_param)
  50. #define BPPIOCGPARAM _IOR('P', 0x2, struct bpp_param)
  51. #define BPPIOCGSTAT _IOR('P', 0x4, int)