2 * Copyright 2008, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * François Revol, revol@free.fr
8 * Copyright 2005, François Revol.
12 Description: Implements a tty on top of the parallel port,
13 using PLIP-like byte-by-byte protocol.
21 #define LPTDONGLE "/dev/misc/dongle/parallel1"
23 #define LPTSOFTRIES 1000
24 #define LPTNIBTRIES 100
25 #define LAPLINK_MAX_FRAME 512
27 typedef struct laplink_state
{
36 extern status_t
ll_send_sof(laplink_state
*st
);
37 extern status_t
ll_check_sof(laplink_state
*st
);
38 extern status_t
ll_ack_sof(laplink_state
*st
);
39 extern status_t
ll_send_eof(laplink_state
*st
);
42 extern status_t
ll_send_lnibble(laplink_state
*st
, uint8 v
);
43 extern status_t
ll_send_mnibble(laplink_state
*st
, uint8 v
);
44 extern status_t
ll_wait_lnibble(laplink_state
*st
, uint8
*v
);
45 extern status_t
ll_wait_mnibble(laplink_state
*st
, uint8
*v
);
48 extern status_t
ll_send_byte(laplink_state
*st
, uint8 v
);
49 extern status_t
ll_check_byte(laplink_state
*st
, uint8
*v
);
50 extern status_t
ll_wait_byte(laplink_state
*st
, uint8
*v
);
53 extern status_t
ll_send_frame(laplink_state
*st
, const uint8
*buff
, size_t *len
);
54 extern status_t
ll_check_frame(laplink_state
*st
, uint8
*buff
, size_t *len
);
55 extern status_t
ll_wait_frame(laplink_state
*st
, uint8
*buff
, size_t *len
);