-
Notifications
You must be signed in to change notification settings - Fork 5
/
drvIpac.html
2439 lines (1832 loc) · 67.4 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="EPICS, IndustryPack">
<title>drvIpac – Industry Pack Driver</title>
</head>
<body bgcolor="#FFFFFF">
<center>
<h1>
drvIpac – Industry Pack Driver</h1>
Version 2.14
<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="#ipacAddNullCarrier">ipacAddNullCarrier</a></li>
<li>
<a href="#ipacLatestCarrier">ipacLatestCarrier</a></li>
<li>
<a href="#ipacReport">ipacReport</a></li>
<li>
<a href="#ipacInitialise">ipacInitialise</a></li>
</ul></li>
<li>
<a href="#section3">Routines for use by IPAC 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>
<li>
<a href="#ipcCheckId">ipcCheckId</a></li>
</ul></li>
<li>
<a href="#section4">IPAC Carrier Drivers</a>
<ul>
<li>
<a href="#VIPC310">GE Fanuc Embedded VIPC310</a></li>
<li>
<a href="#VIPC610">GE Fanuc Embedded VIPC610</a></li>
<li>
<a href="#VIPC616">GE Fanuc Embedded VIPC616</a></li>
<li>
<a href="#TVME200">Tews TVME-200</a></li>
<li>
<a href="#ATC40">SBS ATC40</a></li>
<li>
<a href="#MVME162">Motorola MVME162/172</a></li>
<li>
<a href="#AVME9660">Acromag AVME-9660/9668/9670</a></li>
<li>
<a href="#Hy8002">Hytec 8002/8004</a></li>
</ul></li>
<li>
<a href="#section5">Interface to IPAC Carrier Drivers</a></li>
</ul>
<p>
See also the following Module Drivers which are included with drvIpac:</p>
<ul>
<li>
<a href="drvTip810.html">TEWS Tip810 CANbus IP module</a></li>
<li>
<a href="tyGSOctal.html">GE Fanuc Embedded Octal Serial IP module (RS232, RS422,
RS485)</a></li>
<li>
<a href="IP520.html">Acromag IP520 module (8 EIA/TIA-232E serial ports)</a></li>
</ul>
<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 EPICS, which was originaly 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 UKIRT 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.
Carrier drivers are available for most of the common IP carrier boards.</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 without altering the drvIpac API should any user ever need more
than 21 carriers in a single IOC.</p>
<h3>
<a NAME="Installation"></a>Installation</h3>
<p>
The drvIpac subsystem is an EPICS <supporttop> application which
can also be used to build IPAC module drivers. To install and use the the ipac
support, download the tar file from the
<a href="http://www.aps.anl.gov/epics/download/modules/">APS Support Module
Downloads</a> page. These instructions assume you already have EPICS R3.14.x
installed and built (this software should work with any release of EPICS Base
from 3.14.9 onwards). Four 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>
If you don't need all of the module drivers included with the distribution,
edit the top level Makefile and comment out the lines mentioning driver
directories you don't need.</li>
<li>
Edit the drvIpac/drvIpac.dbd file and uncomment the set of IPAC Carrier drivers
that you will be using at your site. This step can also be performed later by
copying the drvIpac.dbd file to an IOC application and modifying it there
instead.</li>
<li>
Run <tt>gnumake</tt> in the top level directory.</li>
</ol>
<h3>
<a NAME="Bus Issues"></a>OS and Bus Issues</h3>
<p>
This version if the IPAC driver supports little-endian as well as big-endian
CPUs, and provides a means of isolating module drivers from some of the
differences between interrrupt handling and module probing on different
busses.</p>
<p>
The endian problem only exists when accessing I/O registers and the IPAC ID PROM
using byte addresses. In drvIpac all accesses are made using 16-bit read/write
cycles, so there are no known issues with endianness. This is done by declaring
the structure of a module's registers using <tt>epicsUInt16</tt> variables
instead of <tt>char</tt>. With this done the only other requirement is to mask
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>
<p>
Some IPAC driver routines such as ipmCheck() need to be able to tell whether
they can safely access the ID Prom space for a given IP slot. If the carrier
driver provides a moduleProbe() routine this will be consulted; if not, the
devReadProbe() routine from devLib is used. It is assumed that probing one
location in the ID Prom is sufficient to answer the question for all ID Prom
locations.</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.</p>
<p>This software can no longer be built for use without EPICS.</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 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 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>
<p>
As long as the carrier table is not full, <tt>ipacAddCarrier()</tt> will always
increment its internal carrier number on every call, thus a carrier driver
failure will not cause all subsequent carriers to silently change their carrier
numbers. In the event of an error, the null carrier table is used for the
current carrier number instead of the requested table, which will cause module
driver initialization to fail for that carrier.</p>
<p>
This routine is not provided as an IOC Shell command; individual carrier
drivers must register their own <tt>ipacAdd...()</tt> commands to use
instead.</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(0, "");
ipacAddCarrier(&vipc310, "0x6800");</pre>
</blockquote>
<hr>
<h3>
<a NAME="ipacAddNullCarrier"></a>ipacAddNullCarrier</h3>
<p>
Reserves a carrier number for a board that is not currently being
used.</p>
<pre>int ipacAddNullCarrier();</pre>
<h4>
Description</h4>
<p>
This routine provides a way to reserve a carrier number for a carrier
board that is not currently in use.</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>
</table></dd>
</dl>
<h4>
Example</h4>
<blockquote>
<pre>ipacAddNullCarrier();
</blockquote>
<hr>
<h3>
<a NAME="ipacLatestCarrier"></a>ipacLatestCarrier</h3>
<p>
Gets the carrier number of the most recently added carrier board.</p>
<pre>int ipacLatestCarrier(void);</pre>
<h4>
Description</h4>
<p>
Returns the index into the carrier table of the most recently added carrier
board, or USHRT_MAX if the most recent call to ipacAddCarrier could not be
fulfilled because the carrier table was already full. The value returned can
always be used as the carrier argument to any drvIpac routine without checking
it first; if the carrier board was not properly initialized for any reason then
these routines will return a failure status of some kind.</p>
<p>
This routine is not provided as an IOC Shell command, it would not be
useful.</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 thru 20</td>
<td>Carrier number of latest board added</td>
</tr>
<tr>
<td>USHRT_MAX</td>
<td>Carrier table was full</td>
</tr>
</table></dd>
</dl>
<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. Routines for use by IPAC Drivers</h2>
<p>
The routines documented below are provided for use by the module and carrier
drivers which use the services of the generic IPAC driver (routine names
beginning with <q>ipm</q> are intended for module drivers, routine names
beginning with <q>ipc</q> are intended for carrier drivers). In most cases these
routines will only need to be called at initialisation time, the exception being
some run-time use of the <tt>ipmIrqCmd()</tt> routine. A module driver should be
informed by other means which carrier and slot the particular IPAC module it is
to control has been installed in, although it is possible to search each carrier
slot in turn for a particular 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(int carrier, int slot, ipac_addr_t space);</pre>
<h4>
Parameters</h4>
<dl>
<dt>
<a NAME="carrierSlot"></a><tt>int 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 with <tt>ipacAddCarrier</tt>.</dd>
<dt>
<tt>int 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 – for example the VIPC310 and MVME172 provide two, the TVME200 and
Xy9660 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(int carrier, int slot);</pre>
<h4>
Parameters</h4>
<dl>
<dt>
<tt>int carrier, int slot</tt></dt>
<dd>
Module identification – see <a href="#carrierSlot">above</a></dd>
</dl>
<h4>
Description</h4>
<p>
Checks to make sure the carrier and slot numbers are legal, then probes for the
presence of an ID Prom, delegating this operation to the carrier driver if it
provides a moduleProbe() routine. If access to a the ID Prom space is safe it
delegates checking the IPAC header to <tt>ipcCheckId()</tt>.</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>IP Module 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(int carrier, int slot,
int manufacturerId, int modelId);</pre>
<h4>
Parameters</h4>
<dl>
<dt>
<tt>int carrier, int slot</tt></dt>
<dd>
Module identification – see <a href="#carrierSlot">above</a></dd>
<dt>
<tt>int manufacturerId</tt></dt>
<dd>
IPAC Manufacturer Identification Number, as allocated by SBS. This number
should be given in the Programmer's Documentation for the IPAC module.</dd>
<dt>
<tt>int 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>
<p>
Releases of drvIpac before 2-9 did not recognize Format-2 ID PROMS as defined in
the VITA spec. From release 2-9 on this software should be compatible with
modules having either Format-1 or Format-2 ID PROMS. In the newer format the
PROM is specified to be 16 bits wide rather than 8, and various fields including
the Manufacturer and Model numbers have been made wider. The calculated CRC is
also wider, but some IP Module manufacturers are setting the CRC field to all
zeros rather than calculating the correct CRC value for it. As a result, the
<tt>ipmValidate</tt> routine will not check the CRC of a Format-2 ID Prom if its
CRC field is zero.</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>IP Module identifier 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(int carrier, int slot,
int irqNumber, ipac_irqCmd_t cmd);</pre>
<h4>
Parameters</h4>
<dl>
<dt>
<tt>int carrier, int slot</tt></dt>
<dd>
Module identification – see <a href="#carrierSlot">above</a></dd>
<dt>
<tt>int 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 <tt>0</tt> or <tt>1</tt> 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>