-
Notifications
You must be signed in to change notification settings - Fork 5
/
drvIpac.html
1837 lines (1382 loc) · 49.9 KB
/
drvIpac.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Andrew Johnson">
<meta name="Description" content="How to use the drvIpac Industry Pack Carrier driver software">
<meta name="KeyWords" content="IndustryPack, vxWorks, EPICS, GreenSpring">
<meta name="Version" content="$Id: drvIpac.html,v 1.10 2003-11-14 00:22:44 anj Exp $">
<title>drvIpac - Industry Pack Driver</title>
</head>
<body bgcolor="#FFFFFF">
<center>
<h1>
drvIpac - Industry Pack Driver</h1>
Version 2.6
<address>
Andrew Johnson</address></center>
<ol>
<li>
<a href="#section1">Introduction</a>
<ul>
<li>
<a href="#Installation">Installation</a></li>
</ul></li>
<li>
<a href="#section2">IPAC Driver Usage</a>
<ul>
<li>
<a href="#ipacAddCarrier">ipacAddCarrier</a></li>
<li>
<a href="#ipacReport">ipacReport</a></li>
<li>
<a href="#ipacInitialise">ipacInitialise</a></li>
</ul></li>
<li>
<a href="#section3">Calls for use by IPAC Module Drivers</a>
<ul>
<li>
<a href="#ipmBaseAddr">ipmBaseAddr</a></li>
<li>
<a href="#ipmCheck">ipmCheck</a></li>
<li>
<a href="#ipmValidate">ipmValidate</a></li>
<li>
<a href="#ipmIrqCmd">ipmIrqCmd</a></li>
<li>
<a href="#ipmIntConnect">ipmIntConnect</a></li>
<li>
<a href="#ipmReport">ipmReport</a></li>
</ul></li>
<li>
<a href="#section4">IPAC Carrier Drivers</a>
<ul>
<li>
<a href="#VIPC310">GreenSpring VIPC310</a></li>
<li>
<a href="#VIPC610">GreenSpring VIPC610</a></li>
<li>
<a href="#VIPC616">GreenSpring VIPC616</a></li>
<li>
<a href="#ATC40">GreenSpring ATC40</a></li>
<li>
<a href="#MVME162">Motorola MVME162/172</a></li>
</ul></li>
<li>
<a href="#section5">Interface to IPAC Carrier Drivers</a></li>
</ul>
See also the following Module Drivers which use drvIpac:
<ul>
<li>
<a href="drvTip810.html">TEWS Tip810 CANbus IP module</a></li>
<li>
<a href="tyGSOctal.html">GreenSpring Octal Serial IP module (RS232, RS422,
RS485)</a></li>
</ol>
<hr>
<h2>
<a NAME="section1"></a>1. Introduction</h2>
<p>
This document describes the software interface to a generic Industry Pack
(IPAC) driver module for vxWorks, written as part of a
<a href="drvTip810.html">CANbus EPICS device driver</a> for the
<a href="http://www.gemini.edu/">Gemini</a> and
<a href="http://www.jach.hawaii.edu/UKIRT/home.html">UKIRT</a> telescopes. The
original purpose of the generic IPAC driver was to ensure that the CANbus
driver would not be restricted to use with a single carrier board but could be
used with different carriers as required, including with more than one type of
carrier board simultaneously. The use of the generic driver also ensures that
additional IPAC modules and drivers for other interfaces can be added without
affecting the functioning of the CANbus driver.</p>
<p>
To provide a generic IPAC carrier board interface for each IPAC module driver,
all control of or requests for information about the carrier board goes via the
IPAC driver which in turn calls the IPAC Carrier driver written for the
particular type of carrier board. This carrier driver should be simple to
write, comprising three or four short subroutines and an interface structure.
On VMEbus, carrier drivers are available for the
<a href="http://www.greenspring.com/">GreenSpring</a> VIPC310, 610 and 616
boards, and a driver for the <a href="http://www.mcg.mot.com/">Motorola</a>
MVME162 that also works on the MVME172. On ISAbus the GreenSpring ATC40
carrier is now supported by a driver from Jeff Hill.</p>
<p>
At present the IPAC driver is limited (by the size of an internal array) to
controlling a maximum of 21 carrier boards, but this limitation should be easy
to dispense with completely without altering any of its interfaces. Although
designed primarily to be used from within an EPICS system, the software has
been written to allow it to be used independent of the presence of EPICS in
other vxWorks-based applications.</p>
<h3>
<a NAME="Installation"></a>Installation</h3>
<p>
From version 2.0 onwards the drvIpac subsystem has been separated from the
CANbus driver but provided within an EPICS <supporttop> application which
can also be used to build IPAC module drivers. To install and use the the ipac
support, obtain a copy of the tar file or (if you have remote CVS permissions
at APS) export the software from the CVS repository where it resides as
<tt>epics/modules/bus/ipac</tt> - CVS tags of the form `<b><tt>V2-1</tt></b>'
mark the particular file versions required for each release. These instructions
assume you already have EPICS R3.14.x installed and built (this software should
work with EPICS R3.14.3 and later). Two steps are then required to install and
build the software:</p>
<ol>
<li>
Edit the configure/RELEASE file and set the correct path for EPICS_BASE at
your site.</li>
<li>
Run gnumake in the top level directory.</li>
</ol>
<p>
If you don't need all of the module drivers included with the distribution,
you may wish to edit the top level Makefile and comment out the lines mentioning
driver directories you don't need.</p>
<h3>
<a NAME="Bus Issues"></a>Bus Issues</h3>
<p>
From version 2-1 this software supports little-endian as well as big-endian
busses, and provides a means of isolating module drivers from some of the
differences between interrrupt handling on different busses.</p>
<p>
The endian problem only exists when accessing I/O registers and the IPAC ID
PROM using byte addresses. If all accesses occur using 16-bit read/write cycles
then the problem disappears. This is usually done by changing the structure
that declares the structure of a module's registers to use <tt>short</tt>
instead of <tt>char</tt> and removing the `padding' char members that separate
the registers (this change has been made to the <tt>ipac_idProm_t</tt>
structure which is declared in <i>drvIpac.h</i>). This done the other changes
are generally minor, usually consisting of masking off the top 8 bits of every
value read from the hardware.</p>
<p>
Some busses such as ISAbus do not support interrupt vectors and require a
different approach to connecting Interrupt Service Routines up to the relevent
hardware interrupts, although the IndustryPack standard does require that any
IP module that generates interrupts should provide a vector. On ISA bus
carriers this vector can be read by the carrier driver to work out which module
caused the interrupt. A module driver should not need to know about the
particular bus type its carrier is on, thus ipac now provides the routine <a
href="#ipmIntConnect">ipmIntConnect()</a> to allow it to pass such issues off to
the carrier driver to handle. The interface to this is very similar to the
standard vxWorks intConnect() routine.</p>
<hr>
<h2>
<a NAME="section2"></a>2. IPAC Driver Usage</h2>
<p>
The driver provides a C header file <i>drvIpac.h</i> for use by both module
and carrier drivers.</p>
<pre>#include "drvIpac.h"</pre>
<p>
This header file declares the necessary structures, enumerated types and
functions provided by the driver. These are individually documented below. This
header <b><tt>#include</tt></b>s the vxWorks ANSI header file <i>types.h</i>
thus a <b><tt>-I</tt></b> option to the C pre-processor must be used to
indicate the location of the vxWorks header files.</p>
<p>If it is necessary to build a copy of the driver for use without EPICS, the
<i>drvIpac.c</i> file should be compiled with the <b><tt>-DNO_EPICS</tt></b>
compiler switch to disable the EPICS-specific code.</p>
<hr>
<h3>
<a NAME="ipacAddCarrier"></a>ipacAddCarrier</h3>
<p>
Used to register a carrier board and the appropriate carrier driver software
for it with the IPAC Driver. Up to release 2.5 this call was used directly
inside IOC startup scripts, but from release 2.6 onwards the carrier drivers
provided with drvIpac all contain their own routines for use in startup
scripts, which allows initialization from the EPICS ioc shell as well as from
the vxWorks shell. See the documentation for the specific carrier board in
<a href="#section4">section 4</a> below for the name of the new initialization
routine.</p>
<pre>int ipacAddCarrier(ipac_carrier_t *pcarrier, const char *cardParams);</pre>
<h4>
Parameters</h4>
<dl>
<dt>
<tt>ipac_carrier_t *pcarrier</tt></dt>
<dd>
Pointer to the carrier driver structure which is the only interface to
the IPAC Carrier driver. The same structure is used for every instance
of the same type of carrier board.</dd>
<dt>
<tt>const char *cardParams</tt></dt>
<dd>
String containing board-specific initialisation parameters which is passed
to the carrier driver. For carrier boards which rely on jumpers to set
the board address (e.g. the SBS GreenSpring carrier boards), the settings for
each particular board will be reflected in the parameter settings given
here when registering that carrier. For boards such as the MVME162 where
the addresses can be changed by the driver, this string may be used to
indicate how the board should be initialised. See the specific documentation
for each carrier driver (<a href="#section4">section 4</a> below) for the
parameter string syntax.</dd>
</dl>
<h4>
Description</h4>
<p>
This routine will usually be called from the vxWorks (EPICS) start-up script.
Some types of carrier may need additional initialisation before or after
registering, but this method using the card parameter string should be
sufficient for most carriers. Note that only the carrier <tt>initialise()</tt>
routine is called at this stage. The order in which carriers are registered
with this routine defines the carrier number which they will be allocated,
starting from zero for the first board registered.</p>
<p>
The code checks that the carrier descriptor table looks sensible, calls the
initialise routine with the given card parameters, then saves the carrier
private pointer and carrier table address in an internal array. The card number
allows the same descriptor table to be used for all carriers of the same
type.</p>
<p>
It may be necessary to remove a carrier temporarily from a system in some
circumstances without wanting to have to change the carrier number allocated to
higher numbered carriers. To allow this, it is legal to call this routine with
a NULL (zero) carrier table address, which switches in the null carrier table
instead. When this facility is used any module driver which attempts to access
a slot on this carrier will be given error status returns by the module
interface routines.</p>
<h4>
Returns</h4>
<dl>
<dt>
<tt>int</tt></dt>
<dd>
<table BORDER=2>
<tr>
<th>Symbol/Value</th>
<th>Meaning</th>
</tr>
<tr>
<td>0</td>
<td>OK</td>
</tr>
<tr>
<td>S_IPAC_tooMany</td>
<td>Carrier Info Table full</td>
</tr>
<tr>
<td>S_IPAC_badTable</td>
<td>Carrier Table invalid</td>
</tr>
<tr>
<td>(others values)</td>
<td>from carrier initialisation routine.</td>
</tr>
</table></dd>
</dl>
<h4>
Examples</h4>
<blockquote>
<pre>ipacAddCarrier(&vipc610_01, "0x6000,256");
ipacAddCarrier(NULL, "");
ipacAddCarrier(&vipc310, "0x6800");</pre>
</blockquote>
<hr>
<h3>
<a NAME="ipacReport"></a>ipacReport</h3>
<p>
Prints a report on stdout giving the status of all known IPAC carriers.</p>
<pre>int ipacReport(int interest);</pre>
<h4>
Parameters</h4>
<dl>
<dt>
<tt>int interest</tt></dt>
<dd>
Interest level, defines how much information to provide in the report.</dd>
</dl>
<h4>
Description</h4>
<p>
Prints information on each known carrier board and slot according to the
specified interest level. Level 0 lists all the carriers defined, with the
number of IPAC slots each one supports. Level 1 gives details on each slot
on the carriers: the Manufacturer and Model ID bytes of the installed module if
one is present, and the Carrier Driver's report for that slot (see <a
href="#ipmReport">ipmReport</a> below). Level 2 adds the CPU address of
each memory space for the slot.</p>
<h4>
Returns</h4>
<dl>
<dt>
<tt>int</tt></dt>
<dd>
<table BORDER=2>
<tr>
<th>Symbol/Value</th>
<th>Meaning</th>
</tr>
<tr>
<td>0</td>
<td>OK.</td>
</tr>
</table></dd>
</dl>
<hr>
<h3>
<a NAME="ipacInitialise"></a>ipacInitialise</h3>
<p>
Initialise the IPAC driver.</p>
<pre>int ipacInitialise(int after);</pre>
<h4>
Parameters</h4>
<dl>
<dt>
<tt>int after</tt></dt>
<dd>
Not currently used, provided for compatibility with EPICS driver initialisation
routine.</dd>
</dl>
<h4>
Description</h4>
Null routine, does nothing.
<h4>
Returns</h4>
<dl>
<dt>
<tt>int</tt></dt>
<dd>
<table BORDER=2>
<tr>
<th>Symbol/Value</th>
<th>Meaning</th>
</tr>
<tr>
<td>0</td>
<td>OK.</td>
</tr>
</table></dd>
</dl>
<hr>
<h2>
<a NAME="section3"></a>3. Calls for use by IPAC Module Drivers</h2>
<p>
The routines documented below are provided for use by the module drivers
which use the services of the generic IPAC driver. In general it is expected
that these routines will only be used at initialisation time. The module
driver should be informed by other means which carrier and slot the particular
IPAC module it is to control is installed in, although it should be possible
to search each carrier and slot number in turn for the module using the
Manufacturer and Model ID codes.</p>
<h3>
<a NAME="ipmBaseAddr"></a>ipmBaseAddr</h3>
<p>
Returns Base CPU address of selected IP address space</p>
<pre>void *ipmBaseAddr(ushort_t carrier, ushort_t slot, ipac_addr_t space);</pre>
<h4>
Parameters</h4>
<dl>
<dt>
<a NAME="carrierSlot"></a><tt>ushort_t carrier</tt></dt>
<dd>
Carrier number; identifies a particular carrier board in the system. The
carriers are given numbers sequentially starting from zero according to
the order in which they were registered by calling <tt>ipacAddCarrier</tt>.</dd>
<dt>
<tt>ushort_t slot</tt></dt>
<dd>
Slot number; identifies the particular IP slot on the carrier board, starting
from zero. The number of slots available varies with the type of the carrier
board - the VIPC310 and MVME172 provide 2, the VIPC610, VIPC616, ATC40 and
MVME162 each have four slots.</dd>
</dl>
<p>
Together these two parameters uniquely identify a specific IPAC module in the
system, and these are used in this way by all of the following routines.</p>
<dl>
<dt>
<tt>ipac_addr_t space</tt></dt>
<dd>
Value identifying the IP address space to be queried. This parameter is
an enumerated type, and must be one of the following values which are defined
in the header file:
<blockquote>
<table BORDER=2>
<tr>
<th>IP Address Space</th>
<th><tt>space</tt></th>
</tr>
<tr>
<td>ID Prom Space</td>
<td><tt>ipac_addrID</tt></td>
</tr>
<tr>
<td>Register Space</td>
<td><tt>ipac_addrIO</tt></td>
</tr>
<tr>
<td>32-bit Register Space</td>
<td><tt>ipac_addrIO32</tt></td>
</tr>
<tr>
<td>Memory Space</td>
<td><tt>ipac_addrMem</tt></td>
</tr>
</table>
</blockquote>
</dd>
</dl>
<h4>
Description</h4>
<p>
Checks its input parameters, then calls the carrier driver. This will return a
pointer to the location of the address space indicated by the <tt>space</tt>
parameter.</p>
<p>
All IP modules must provide an ID prom to indicate the module type (<tt>space =
ipac_addrID</tt>). Most modules need register I/O locations, which are in the
I/O space (<tt>space = ipac_addrIO</tt>). Some types of module also provide
memory (<tt>space = ipac_addrMem</tt>), but if this is not required the carrier
may allow it to be disabled, in which case the carrier driver will return a
NULL for this address space. Some carriers also provide a 32-bit wide I/O space
for accessing 32-bit registers on Dual-slot IP modules (<tt>space =
ipac_addrIO32</tt>); carriers which do not support this will return NULL for
this space.</p>
<h4>
Returns</h4>
<dl>
<dt>
<tt>void *</tt></dt>
<dd>
Pointer to the beginning of the IP address space for the given carrier/slot,
or NULL pointer.</dd>
</dl>
<hr>
<h3>
<a NAME="ipmCheck"></a>ipmCheck</h3>
<p>
Check on the presence of an IPAC module at the given carrier and slot
number.</p>
<pre>int ipmCheck(ushort_t carrier, ushort_t slot);</pre>
<h4>
Parameters</h4>
<dl>
<dt>
<tt>ushort_t carrier, ushort_t slot</tt></dt>
<dd>
Module identification - see <a href="#carrierSlot">above</a></dd>
</dl>
<h4>
Description</h4>
<p>
Does a quick check to make sure the carrier and slot numbers are legal,
probes the IDprom space to ensure an IPAC is installed, and checks that
the IDprom starts with an "IPAC" or "IPAH" identifier.</p>
<h4>
Returns</h4>
<dl>
<dt>
<tt>int</tt></dt>
<dd>
<table BORDER=2>
<tr>
<th>Symbol/Value</th>
<th>Meaning</th>
</tr>
<tr>
<td>0</td>
<td>OK</td>
</tr>
<tr>
<td>S_IPAC_badAddress</td>
<td>Bad carrier or slot number</td>
</tr>
<tr>
<td>S_IPAC_badDriver</td>
<td>Carrier driver returned NULL ID address</td>
</tr>
<tr>
<td>S_IPAC_noModule</td>
<td>No IP module installed</td>
</tr>
<tr>
<td>S_IPAC_noIpacId</td>
<td>"IPAC" identifier not found</td>
</tr>
</table></dd>
</dl>
<hr>
<h3>
<a NAME="ipmValidate"></a>ipmValidate</h3>
<p>
Validates a particular IPAC module type at the given carrier & slot
number.</p>
<pre>int ipmValidate(ushort_t carrier, ushort_t slot,
uchar_t manufacturerId, uchar_t modelId);</pre>
<h4>
Parameters</h4>
<dl>
<dt>
<tt>ushort_t carrier, ushort_t slot</tt></dt>
<dd>
Module identification - see <a href="#carrierSlot">above</a></dd>
<dt>
<tt>uchar_t manufacturerId</tt></dt>
<dd>
IPAC Manufacturer Identification Number, as allocated by GreenSpring. This
number should be given in the Programmer's Documentation for the IPAC
module.</dd>
<dt>
<tt>uchar_t modelId</tt></dt>
<dd>
IPAC Model Identification Number, as allocated by the module manufacturer.
This number should be given in the Programmer's Documentation for the IPAC
module.</dd>
</dl>
<h4>
Description</h4>
<p>
Uses <tt>ipmCheck</tt> to ensure the carrier and slot numbers are legal,
probe the IDprom and check that the IDprom looks like an IPAC module. Then
calculates and verifies the CRC for the ID Prom, and compares the manufacturer
and model ID values in the Prom to the ones given.</p>
<p>
The manufacturer and model identification numbers allow a Module Driver to
ensure that the correct hardware has been installed in the particular slot
which the driver has been told to control. If a driver supports more than one
type of module, it should check each module type individually by calling
<tt>ipmValidate</tt> with each manufacturer/model pair it can control until it
finds a match.</p>
<h4>
Returns</h4>
<dl>
<dt>
<tt>int</tt></dt>
<dd>
<table BORDER=2>
<tr>
<th>Symbol/Value</th>
<th>Meaning</th>
</tr>
<tr>
<td>0</td>
<td>OK</td>
</tr>
<tr>
<td>S_IPAC_badCRC</td>
<td>CRC Check failed</td>
</tr>
<tr>
<td>S_IPAC_badModule</td>
<td>Manufacturer or model IDs wrong</td>
</tr>
<tr>
<td>S_IPAC_badAddress</td>
<td>Bad carrier or slot number</td>
</tr>
<tr>
<td>S_IPAC_badDriver</td>
<td>Carrier driver returned NULL ID address</td>
</tr>
<tr>
<td>S_IPAC_noModule</td>
<td>No IP module installed</td>
</tr>
<tr>
<td>S_IPAC_noIpacId</td>
<td>"IPAC" or "IPAH" identifiers not found</td>
</tr>
</table></dd>
</dl>
<hr>
<h3>
<a NAME="ipmIrqCmd"></a>ipmIrqCmd</h3>
<p>
Manipulate the carrier board interrupt controller.</p>
<pre>int ipmIrqCmd(ushort_t carrier, ushort_t slot,
ushort_t irqNumber, ipac_irqCmd_t cmd);</pre>
<h4>
Parameters</h4>
<dl>
<dt>
<tt>ushort_t carrier, ushort_t slot</tt></dt>
<dd>
Module identification - see <a href="#carrierSlot">above</a></dd>
<dt>
<tt>ushort_t irqNumber</tt></dt>
<dd>
The IPAC specification provides two interrupt lines for each module. This
parameter identifies the interrupt to the Carrier Driver. It should have
the value 0 or 1 only.</dd>
<dt>
<tt>ipac_irqCmd_t cmd</tt></dt>
<dd>
This parameter gives the action required (see table in Description below), and
is an enumerated type defined in the header file. Because some carrier boards
do not provide software access to their interrupt controllers most of the
commands are optional. Module Drivers may be written to utilise the additional
functions if they are available.</dd>
</dl>
<h4>
Description</h4>
<p>
Checks input parameters, then passes the interrupt command request to the
equivalent Carrier Driver routine. The driver is only required to support the
command <tt>ipac_irqEnable</tt>; for other commands it may return the status
code <tt>S_IPAC_notImplemented</tt> and do nothing. Commands available are as
follows:</p>
<blockquote>
<table BORDER=2>
<tr>
<th>Command Description</th>
<th>cmd</th>
</tr>
<tr>
<td>Selects Interrupt Priority 0 (disabled)</td>
<td><tt>ipac_irqLevel0</tt></td>
</tr>
<tr>
<td>Selects Interrupt Priority 1</td>
<td><tt>ipac_irqLevel1</tt></td>
</tr>
<tr>
<td>Selects Interrupt Priority 2</td>
<td><tt>ipac_irqLevel2</tt></td>
</tr>
<tr>
<td>Selects Interrupt Priority 3</td>
<td><tt>ipac_irqLevel3</tt></td>
</tr>
<tr>
<td>Selects Interrupt Priority 4</td>
<td><tt>ipac_irqLevel4</tt></td>
</tr>
<tr>
<td>Selects Interrupt Priority 5</td>
<td><tt>ipac_irqLevel5</tt></td>
</tr>
<tr>
<td>Selects Interrupt Priority 6</td>
<td><tt>ipac_irqLevel6</tt></td>
</tr>
<tr>
<td>Selects Interrupt Priority 7 (non-maskable)</td>
<td><tt>ipac_irqLevel7</tt></td>
</tr>
<tr>
<td>Returns current Interrupt Priority, 0 to 7</td>
<td><tt>ipac_irqGetLevel</tt></td>
</tr>
<tr>
<td>Enable interrupts from module</td>
<td><tt>ipac_irqEnable</tt></td>
</tr>
<tr>
<td>Disable interrupts from module</td>
<td><tt>ipac_irqDisable</tt></td>
</tr>
<tr>
<td>Returns current interrupt signal state</td>
<td><tt>ipac_irqPoll</tt></td>
</tr>
<tr>
<td>Sets LED indicator to Empty/Unused</td>
<td><tt>ipac_statUnused</tt></td>
</tr>
<tr>
<td>Sets LED indicator to Active</td>
<td><tt>ipac_statActive</tt></td>
</tr>
</table>
</blockquote>
<p>
The Interrupt Priority (often also known as interrupt level) commands are
defined to be numerically the same as the level number they select. Level 0
effectively disables the interrupt. Level 7 is not recommended within vxWorks
as it is non-maskable, and may only be used for an ISR that does not call any
vxWorks routines. The <tt>ipac_irqGetLevel</tt> command returns the level
currently set. Carrier boards which have fixed interrupt levels will not
support setting the interrupt level but the driver may still able to return the
level number.</p>
<p>
The <tt>ipac_irqEnable</tt> command must be supported by all Carrier Drivers,
and must be called by any Module Driver that uses interrupts. The Carrier
Driver routine is responsible for calling the vxWorks sysIntEnable() routine if
this is required to allow IPAC interrupts to be seen by the CPU. The
corresponding <tt>ipac_irqDisable</tt> command is not necessarily supported by
all carriers however - the module driver must disable interrupts using the
control registers on the IP module itself if this is necessary. A Carrier
Driver cannot implement the <tt>ipac_irqDisable</tt> command with a call to the
vxWorks sysIntDisable() routine because this would stop any other devices which
still need this interrupt level from working.</p>
<h4>
Returns</h4>
<dl>
<dt>
<tt>int</tt></dt>
<dd>
<table BORDER=2>
<tr>
<th>Symbol/Value</th>
<th>Meaning</th>
</tr>
<tr>
<td>0</td>
<td>OK</td>
</tr>
<tr>
<td>S_IPAC_badAddress</td>
<td>No such carrier or slot</td>
</tr>
<tr>
<td>S_IPAC_notImplemented</td>
<td>Driver does not support that command</td>
</tr>
</table>
<p>Other values may also be returned depending on the Driver and command
used.</p></dd>
</dl>
<hr>
<h3>
<a NAME="ipmIntConnect"></a>ipmIntConnect</h3>
<p>
Connects a module driver Interrupt Service Routine to a particular interrupt
vector number.</p>
<pre>int ipmIntConnect (ushort_t carrier, ushort_t slot, ushort_t vecNum,
void (*routine)(int parameter), int parameter);</pre>
<h4>
Parameters</h4>
<dl>
<dt>
<tt>ushort_t carrier, ushort_t slot</tt></dt>
<dd>
Module identification - see <a href="#carrierSlot">above</a></dd>