Imported Upstream version 4.6.0
[debian/atlc] / tests / try_aix.c
1 /*
2 atlc - arbitrary transmission line calculator, for the analysis of
3 transmission lines are directional couplers. 
4
5 Copyright (C) 2002. Dr. David Kirkby, PhD (G8WRB).
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either package_version 2
10 of the License, or (at your option) any later package_version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
20 USA.
21
22 Dr. David Kirkby, e-mail drkirkby@ntlworld.com 
23
24 */
25 /* Try to get data. This will work only on an IBM running AIX */
26
27 #include "config.h"
28
29 #include "defs.h"
30 #define BYTES_PER_MB  1048576
31
32 #ifdef HAVE_AIXFONT_H
33 #ifdef HAVE_UNISTD_H
34 #ifdef HAVE_STRING_H
35 #ifdef HAVE_STDLIB_H
36 #ifdef HAVE_STDIO_H  
37 #include <stdlib.h>
38 #include <stdio.h>
39 #include <unistd.h>
40 #include <string.h>
41 #endif
42 #endif
43 #endif
44 #endif
45 #endif
46
47 int try_aix(struct computer_data *data)
48 {
49 #ifdef HAVE_AIXFONT_H
50 #ifdef HAVE_UNISTD_H
51 #ifdef HAVE_STRING_H
52 #ifdef HAVE_STDLIB_H
53 #ifdef HAVE_STDIO_H  
54   long ram_in_kb;
55   char *model;
56   model=malloc(12);
57   strcpy(data->hw_provider,"IBM");
58   strncpy(model,data->machine,10);
59   model+=8;
60   if(strcmp(model,"02") == 0)
61   {
62     strcpy(data->hw_platform,"7015-930");
63     strcpy(data->mhz,"25");
64     strcpy(data->cpu_type,"Power");
65     strcpy(data->max_cpus,"1");
66   }
67   if(strcmp(model,"10") == 0)
68   {
69     strcpy(data->hw_platform,"7015-930_or_7016-730");
70     strcpy(data->mhz,"25");
71     strcpy(data->cpu_type,"Power");
72   }
73   if(strcmp(model,"11") == 0)
74   {
75     strcpy(data->hw_platform,"7013-540");
76     strcpy(data->mhz,"30");
77     strcpy(data->cpu_type,"Power");
78   }
79   if(strcmp(model,"14") == 0)
80   {
81     strcpy(data->hw_platform,"7013-540");
82     strcpy(data->mhz,"30");
83     strcpy(data->cpu_type,"Power");
84   }
85   if(strcmp(model,"18") == 0)
86   {
87     strcpy(data->hw_platform,"7013-53H");
88     strcpy(data->mhz,"33");
89     strcpy(data->cpu_type,"Power");
90   }
91   if(strcmp(model,"1C") == 0)
92   {
93     strcpy(data->hw_platform,"7013-550");
94     strcpy(data->mhz,"41.6");
95     strcpy(data->cpu_type,"Power");
96   }
97   if(strcmp(model,"20") == 0)
98   {
99     strcpy(data->hw_platform,"7015-930");
100     strcpy(data->mhz,"25");
101     strcpy(data->cpu_type,"Power");
102   }
103   if(strcmp(model,"2E") == 0)
104   {
105     strcpy(data->hw_platform,"7015-950");
106     strcpy(data->mhz,"41");
107     strcpy(data->cpu_type,"Power");
108   }
109   if(strcmp(model,"30") == 0)
110   {
111     strcpy(data->hw_platform,"7013-520");
112     strcpy(data->mhz,"20");
113     strcpy(data->cpu_type,"Power");
114   }
115   if(strcmp(model,"31") == 0)
116   {
117     strcpy(data->hw_platform,"7012-320");
118     strcpy(data->mhz,"20");
119     strcpy(data->cpu_type,"Power");
120   }
121   if(strcmp(model,"34") == 0)
122   {
123     strcpy(data->hw_platform,"7013-52H");
124     strcpy(data->mhz,"25");
125     strcpy(data->cpu_type,"Power");
126   }
127   if(strcmp(model,"35") == 0)
128   {
129     strcpy(data->hw_platform,"7012-32H");
130     strcpy(data->mhz,"25");
131     strcpy(data->cpu_type,"Power");
132   }
133   if(strcmp(model,"37") == 0)
134   {
135     strcpy(data->hw_platform,"7012-340");
136     strcpy(data->mhz,"33");
137     strcpy(data->cpu_type,"Power");
138   }
139   if(strcmp(model,"38") == 0)
140   {
141     strcpy(data->hw_platform,"7012-350");
142     strcpy(data->mhz,"41");
143     strcpy(data->cpu_type,"Power");
144   }
145   if(strcmp(model,"41") == 0)
146   {
147     strcpy(data->hw_platform,"7011-220");
148     strcpy(data->mhz,"33");
149     strcpy(data->cpu_type,"RSC");
150   }
151   if(strcmp(model,"43") == 0)
152   {
153     strcpy(data->hw_platform,"7008-M20_or_7008-M2A");
154     strcpy(data->mhz,"33");
155     strcpy(data->cpu_type,"Power");
156   }
157   if(strcmp(model,"46") == 0)
158   {
159     strcpy(data->hw_platform,"7011-250");
160     strcpy(data->mhz,"66");
161     strcpy(data->cpu_type,"PowerPC");
162   }
163   if(strcmp(model,"47") == 0)
164   {
165     strcpy(data->hw_platform,"7011-230");
166     strcpy(data->mhz,"45");
167     strcpy(data->cpu_type,"RSC");
168   }
169   if(strcmp(model,"48") == 0)
170   {
171     strcpy(data->hw_platform,"7009-C10");
172     strcpy(data->mhz,"80");
173     strcpy(data->cpu_type,"PowerPC");
174   }
175   if(strcmp(model,"57") == 0)
176   {
177     strcpy(data->hw_platform,"9076-SP2_Thin_or_9076-SP2_Thin");
178     strcpy(data->mhz,"67");
179     strcpy(data->cpu_type,"Power2");
180   }
181   if(strcmp(model,"58") == 0)
182   {
183     strcpy(data->hw_platform,"7012-380_or_7030-3AT");
184     strcpy(data->mhz,"59");
185     strcpy(data->cpu_type,"Power2");
186   }
187   if(strcmp(model,"59") == 0)
188   {
189     strcpy(data->hw_platform,"9076-SP2_Thin_w-L2");
190     strcpy(data->mhz,"67");
191     strcpy(data->cpu_type,"Power2");
192   }
193
194 #ifdef _SC_AIX_REALMEM
195   sprintf(data->memory,"%ld",sysconf(_SC_AIX_REALMEM)/1024);
196 #endif
197
198   return(PROBABLY_AIX);
199 #endif
200 #endif
201 #endif
202 #endif
203 #endif
204   return(-1);
205 }