1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License").  You may not use this file except in compliance with the
9 * License.  Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22/* Copyright (c) 1997 Apple Computer, Inc. All Rights Reserved */
23
24/* ioctl's for all Apple IOSerialStream based streaming serial ports */
25
26#ifndef _SYS_IOSS_H
27#define _SYS_IOSS_H
28
29#ifndef _POSIX_SOURCE
30
31#include <sys/termios.h>
32#include <sys/ttycom.h>
33
34/*
35 * External clock baud rates, for use with cfsetospeed
36 */
37#define _MAKE_EXT(x)	(((x) << 1) | 1)
38#define BEXT1	    	_MAKE_EXT(1)
39#define BEXT2	    	_MAKE_EXT(2)
40#define BEXT4	    	_MAKE_EXT(4)
41#define BEXT8	    	_MAKE_EXT(8)
42#define BEXT16	    	_MAKE_EXT(16)
43#define BEXT32	    	_MAKE_EXT(32)
44#define BEXT64	    	_MAKE_EXT(64)
45#define BEXT128	    	_MAKE_EXT(128)
46#define BEXT256	    	_MAKE_EXT(256)
47
48// ul - unsigned long for x86_64
49// us - unsigned long for i386
50// speed and shspeed correspondingly
51typedef __uint64_t	user_ul_t;
52typedef __uint64_t	user_speed_t;
53typedef __uint32_t	user_us_t;
54typedef __uint32_t	user_shspeed_t;
55
56/*
57 * Sets the receive latency (in microseconds) with the default
58 * value of 0 meaning a 256 / 3 character delay latency.
59 */
60#define IOSSDATALAT    _IOW('T', 0, unsigned long)
61#define IOSSDATALAT_32    _IOW('T', 0, user_us_t)
62#define IOSSDATALAT_64    _IOW('T', 0, user_ul_t)
63
64/*
65 * Controls the pre-emptible status of IOSS based serial dial in devices
66 * (i.e. /dev/tty.* devices).  If true an open tty.* device is pre-emptible by
67 * a dial out call.  Once a dial in call is established then setting pre-empt
68 * to false will halt any further call outs on the cu device.
69 */
70#define IOSSPREEMPT    _IOW('T', 1, int)
71
72/*
73 * Sets the input speed and output speed to a non-traditional baud rate
74 */
75#define IOSSIOSPEED    _IOW('T', 2, speed_t)
76#define IOSSIOSPEED_32    _IOW('T', 2, user_shspeed_t)
77#define IOSSIOSPEED_64    _IOW('T', 2, user_speed_t)
78
79#endif  /*_POSIX_SOURCE */
80
81/*
82 * END OF PROTECTED INCLUDE.
83 */
84#endif /* !_SYS_IOSS_H */
85