1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 ioi_config:
23 proc;
24
25 dcl p_chanid char (8) aligned;
26
27 dcl chanid char (8) aligned;
28 dcl channo fixed bin (7);
29 dcl code fixed bin (35);
30 dcl iomno fixed bin (3);
31 dcl portno fixed bin;
32
33 dcl config_$find entry (char (4) aligned, ptr);
34
35 dcl (divide, hbound, lbound, max, null, substr)
36 builtin;
37 ^L
38
39
40
41
42 find_controller_card:
43 entry (p_chanid) returns (ptr);
44
45 call find_controller_card_proc;
46 return (mpc_cardp);
47 ^L
48
49
50 find_base_channel:
51 entry (p_chanid) returns (char (8) aligned);
52
53 call find_controller_card_proc;
54 if mpc_cardp = null () then
55 return ("");
56 if mpc_card.word = IPC_CARD_WORD then do;
57 ipc_cardp = mpc_cardp;
58 if (ipc_card.iom = iomno) & (ipc_card.chan <= channo) & (channo < ipc_card.chan + ipc_card.nchan) then do;
59 call io_chnl_util$iom_to_name (ipc_card.iom, (ipc_card.chan), chanid, code);
60 if code = 0 then
61 return (chanid);
62 else return ("");
63 end;
64 end;
65 if (substr (mpc_card.name, 1, 3) ^= "msp") & (substr (mpc_card.name, 1, 3) ^= "mtp") then
66 return (p_chanid);
67
68 do portno = lbound (mpc_card_array.port, 1) to hbound (mpc_card_array.port, 1);
69 if (mpc_card_array.port (portno).iom = iomno) & (mpc_card_array.port (portno).chan <= channo)
70 & (channo < mpc_card_array.port (portno).chan + mpc_card_array.port (portno).nchan) then do;
71 call io_chnl_util$iom_to_name (mpc_card_array.port (portno).iom, (mpc_card_array.port (portno).chan),
72 chanid, code);
73 if code = 0 then
74 return (chanid);
75 else return ("");
76 end;
77 end;
78
79 return ("");
80 ^L
81 find_controller_card_proc:
82 proc;
83
84 chanid = p_chanid;
85 mpc_cardp, ipc_cardp = null ();
86 call io_chnl_util$name_to_iom (chanid, iomno, channo, code);
87 if code ^= 0 then
88 return;
89
90 call config_$find (MPC_CARD_WORD, mpc_cardp);
91 do while (mpc_cardp ^= null ());
92 do portno = lbound (mpc_card_array.port, 1) to hbound (mpc_card_array.port, 1);
93 if (mpc_card_array.port (portno).iom = iomno) & (mpc_card_array.port (portno).chan <= channo)
94 & (channo < mpc_card_array.port (portno).chan + mpc_card_array.port (portno).nchan) then
95 return;
96 end;
97 call config_$find (MPC_CARD_WORD, mpc_cardp);
98 end;
99
100 call config_$find (IPC_CARD_WORD, ipc_cardp);
101 do while (ipc_cardp ^= null ());
102 if ipc_card.type = IPC_FIPS then do;
103 if (ipc_card.iom = iomno) & (ipc_card.chan <= channo) & (channo < ipc_card.chan + ipc_card.nchan)
104 then do;
105 mpc_cardp = ipc_cardp;
106 return;
107 end;
108 end;
109 call config_$find (IPC_CARD_WORD, ipc_cardp);
110 end;
111 return;
112
113 end find_controller_card_proc;
114 ^L
115 %include io_chnl_util_dcls;
116 %page;
117 %include config_mpc_card;
118 %page;
119 %include config_ipc_card;
120 end ioi_config;