1 #ifndef SERIAL_INTERN_H
2 #define SERIAL_INTERN_H
4 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
7 Desc: Private definitions for Serial device.
11 #ifndef AROS_LIBCALL_H
12 # include <aros/libcall.h>
14 #ifndef EXEC_EXECBASE_H
15 # include <exec/execbase.h>
17 #ifndef EXEC_DEVICES_H
18 # include <exec/devices.h>
20 #ifndef EXEC_SEMAPHORES_H
21 # include <exec/semaphores.h>
26 #ifndef EXEC_SEMAPHORES_H
27 # include <exec/semaphores.h>
30 # include <exec/nodes.h>
32 #ifndef DEVICES_SERIAL_H
33 # include <devices/serial.h>
48 BOOL
copyInData(struct SerialUnit
* SU
, struct IOStdReq
* IOStdReq
);
49 BOOL
copyInDataUntilZero(struct SerialUnit
* SU
, struct IOStdReq
* IOStdReq
);
50 struct SerialUnit
* findUnit(struct serialbase
* SerialDevice
,
54 ULONG
RBF_InterruptHandler(UBYTE
* data
, ULONG length
, ULONG unitnum
, APTR userdata
);
55 ULONG
WBE_InterruptHandler(ULONG unitum
, APTR userdata
);
57 #define MINBUFSIZE 512
66 struct Library
*SerialHidd
;
67 struct Library
*oopBase
;
69 OOP_Object
*SerialObject
;
75 struct MinNode su_Node
;
78 struct SignalSemaphore su_Lock
;
80 struct MsgPort su_QReadCommandPort
;
81 struct Message
* su_ActiveRead
;
83 struct MsgPort su_QWriteCommandPort
;
84 struct Message
* su_ActiveWrite
;
85 ULONG su_NextToWrite
; /* index in the buffer of next data to tx */
86 ULONG su_WriteLength
; /* Number of bytes left to tx */
89 ULONG su_SerFlags
; // copy of IOExtSer->io_SerFlags;
95 struct IOTArray su_TermArray
;
100 UBYTE su_OpenerCount
; // Count how many openers this unit has. Important in shared mode
102 BYTE
* su_InputBuffer
;
103 UWORD su_InputNextPos
; // InputCurPos may never "overtake" InputFirst
104 UWORD su_InputFirst
; // the input buffer is organized as a "circle"
105 // Next Pos is the Position in the buffer
106 // where the NEXT byte will go into.
107 UWORD su_InBufLength
;
110 /* a few flags for the status */
111 #define STATUS_CHANGING_IN_BUFFER 1 /* the user requested a change of the size
112 of the input buffer and is now changing
113 the input buffer. During this time
114 it could happen that the interrupt that
115 holds incoming bytes writes to a memory
116 location that would be invalid.
117 This tells the interrupt to simply drop
118 the data that it was about to write
121 #define STATUS_READS_PENDING 2
122 #define STATUS_WRITES_PENDING 4 /* When the task write the first byte into the UART
123 it has to set this flag.
124 When the HW-interrupt happens and there is
125 no more byte to write to the UART this
126 flag has to be cleared immediately
128 #define STATUS_BUFFEROVERFLOW 8 /* This flag indicates that an overflow
129 occurred with the internal receive
130 buffer. All further bytes will be
131 dropped until somebody reads the contents
139 #define OOPBase (((struct serialbase *)SerialDevice)->oopBase)
141 #endif /* SERIAL_INTERN_H */