Building a SDLC 1.2288 Mbps driver for Zilog ESCC 85230 chip

Hi,

I am writing a driver for an Industry Pack that has two 85230 Zilog ESCC’s
on it running on a carrier card.

I have written basic I/O code in C that allows me to talk back and forth at
the desired rates SDLC 1.2288Mbps and UART rates up to around 300k, but it
is time to wrap it into a real QNX device driver now.

Currently all code is in one file / thread with an interrupt handler and a
signal handler.

Interrupt - polls chips until all channels are happy, acks interrupts and
goes to sleep.

Signal- kicked each ms to check for a gap in a stream of > 3 char times a
current baud rate. This is how I detect end of message, because I can’t read
the register that contains that flag. The extra access time is too much for
my schedule at 1.2288 Mbps.

Main thread - that stuffs fifos for channels to test transmittion , and
prestuffs 4 bytes into the chips’ tx fifo’s to kick start the transmission.

I have been reading through the section in the help on writing a resource
manager and put together some of the example code and thought I almost had
what I needed. Then I found the section on IO-CHAR. Apparently this does all
the stuff I was doing manually. What I could not find was documentation on
the function calls that IO-CHAR uses.

I have looked at the 8250’s manager and see it calling tti() tto() ttc(),
but where can I find information on how these functions work?

Also I read there is a way to pend on a special character to mark start/end
of a message. This is prefect for SDLC mode, but I would need to return a
character that is outside the range of 0-255 since SDLC sync flags 0x7E are
stripped from the data stream, and data can actually have that value without
being a flag (strings of > 5 1’s in a row get bit stuffed with a 0 on TX
side and the extra 0’s are removed on the RX side in hardware before it goes
to the RX fifo).

I found some sorce code for ttc and tti, but could not find tto, or a good
explanation of how all the little pieces work together. I was pi$$ed at
myself when I realized that ttc was doing all the stuff I had been working
so hard to figure out how to do on my own.

Also, is there an option to STTY to do things like specify protocol
(SDLC/UART/BySync/MonoSync/etc…) or bit encoding (NRZ/FM1/FM0/Manchester,
etc…). I would prefer to have the capability to do that sort of setup
through the standard STTY when done, not having to write a specialized
client side application to set this up with a device control statement if
possible. That is where I was headed based on the general notes on writing a
resource manager.

Thanks,

Jeddy