6100 BSC Programming Manual

Writing Applications that Use 6100 BSC
Opening the Line
Any application that wants to use the line must first open it.
You accomplish this task with a call to the GUARDIAN OPEN
procedure, described in Volume 1 of the GUARDIAN Operating
System Programming Manual.
In the OPEN call, you specify several important parameters. In
the flags word, there are bits to indicate shared or exclusive
access to the line; if more than one process pair will have the
line open concurrently, or if one process pair will open the line
more than once, you must specify shared access. (Most
applications use exclusive access.) There are bits to specify
read/write, read-only, or write-only access to the line; to use
BSC, you must specify read/write access. There are bits to
specify the no-wait depth, the number of I/O operations that can
be outstanding; for example, if the no-wait depth is 4, you can
issue as many as 4 calls before calling AWAITIO.
A parameter separate from the flags is sync depth; it determines
whether, if the primary CP6100 process goes down, GUARDIAN
routes a new request automatically to the backup process. (The
alternative is to reject the request and have the application
retry it.) You must use a sync depth of 0 with 6100 BSC.
BSC does not queue requests that result in protocol actions,
configuration changes, or changes in electrical signals.
(Figure 3-1 lists those requests.) This fact has two major
implications:
• A process may not make a second request of this type until
the first has completed. The ABORT and HALT READ requests
are exceptions; either can preempt an earlier request.
• A process may not make such a request if another process has
one pending. (If a process issues an ABORT or HALT READ
request, it may inadvertently stop a request issued by another
process.)
Requests that simply retrieve information without changing
the state of the line--like FETCH STATISTICS and FETCH
CONFIGURATION--may be issued concurrently with other requests.
For example, with a positive no-wait depth, you can fetch line
statistics while a READ is pending.
3-2