1
Description: Add support for Dell 13G server.
2
Add support for upcoming Dell PowerEdge 13G server
3
and replace multiple if statments.
4
Based on patch from SriniG <srinivas_g_gowda@dell.com>
5
Author: Jörg Frings-Fürst <debian@jff-webhosting.net>
6
Origin: based on patch from SriniG <srinivas_g_gowda@dell.com>
7
Bug: http://sourceforge.net/p/ipmitool/patches/102/
8
Bug-debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756555
9
Forwarded: http://sourceforge.net/p/ipmitool/patches/102/
10
Reviewed-by: 2014-08-07 SriniG <srinivas_g_gowda@dell.com>
11
Last-Update: 2014-08-07
13
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
14
Index: trunk/include/ipmitool/ipmi_delloem.h
15
===================================================================
16
--- trunk.orig/include/ipmitool/ipmi_delloem.h 2014-08-04 17:24:11.291429804 +0200
17
+++ trunk/include/ipmitool/ipmi_delloem.h 2014-08-04 17:24:11.279429542 +0200
23
// Return Error code for license
24
#define LICENSE_NOT_SUPPORTED 0x6F
25
#define VFL_NOT_LICENSED 0x33
27
#define IMC_IDRAC_12G_MONOLITHIC (uint8_t) (0x10)
28
#define IMC_IDRAC_12G_MODULAR (uint8_t) (0x11)
30
+#define IMC_IDRAC_13G_MONOLITHIC (uint8_t) (0x20)
31
+#define IMC_IDRAC_13G_MODULAR (uint8_t) (0x21)
32
+#define IMC_IDRAC_13G_DCS (uint8_t) (0x22)
36
Index: trunk/lib/ipmi_delloem.c
37
===================================================================
38
--- trunk.orig/lib/ipmi_delloem.c 2014-08-04 17:24:11.291429804 +0200
39
+++ trunk/lib/ipmi_delloem.c 2014-08-04 17:24:11.279429542 +0200
42
static int current_arg =0;
47
+ * 11G || 12G || 13G -> _ALL
48
+ * 12G || 13G -> _12_13
51
+uint8_t iDRAC_FLAG_ALL=0;
52
+uint8_t iDRAC_FLAG_12_13=0;
55
static uint8_t LcdSupported=0;
56
static uint8_t SetLEDSupported=0;
58
lprintf(LOG_ERR, "lcd is not supported on this system.");
60
} else if (strncmp(argv[current_arg], "info\0", 5) == 0) {
61
- if ((iDRAC_FLAG==IDRAC_11G) || (iDRAC_FLAG==IDRAC_12G)) {
62
+ if (iDRAC_FLAG_ALL) {
63
rc = ipmi_lcd_get_info_wh(intf);
65
rc = ipmi_lcd_get_info(intf);
69
if ((strncmp(argv[current_arg], "mode\0", 5) == 0)
70
- && ((iDRAC_FLAG==IDRAC_11G) || (iDRAC_FLAG==IDRAC_12G))) {
71
+ && (iDRAC_FLAG_ALL)) {
73
if (argc <= current_arg) {
78
} else if ((strncmp(argv[current_arg], "lcdqualifier\0", 13) == 0)
79
- && ((iDRAC_FLAG==IDRAC_11G) || (iDRAC_FLAG==IDRAC_12G))) {
80
+ && (iDRAC_FLAG_ALL)) {
82
if (argc <= current_arg) {
87
} else if ((strncmp(argv[current_arg], "errordisplay\0", 13) == 0)
88
- && ((iDRAC_FLAG==IDRAC_11G) || (iDRAC_FLAG==IDRAC_12G))) {
89
+ && (iDRAC_FLAG_ALL)) {
91
if (argc <= current_arg) {
94
val2str(rsp->ccode, completion_code_vals)); */
98
+ * Set the new flags to 0
100
+ iDRAC_FLAG_ALL = 0;
101
+ iDRAC_FLAG_12_13 = 0;
102
/* Support the 11G Monolithic, modular, Maisy and Coaster */
103
if ((IMC_IDRAC_11G_MONOLITHIC == data[10])
104
|| (IMC_IDRAC_11G_MODULAR == data[10])
105
|| (IMC_MASER_LITE_BMC == data[10])
106
|| (IMC_MASER_LITE_NU == data[10])) {
107
iDRAC_FLAG=IDRAC_11G;
108
+ iDRAC_FLAG_ALL = 1;
109
} else if((IMC_IDRAC_12G_MONOLITHIC == data[10])
110
|| (IMC_IDRAC_12G_MODULAR == data[10])) {
111
iDRAC_FLAG = IDRAC_12G;
112
+ iDRAC_FLAG_ALL = 1;
113
+ iDRAC_FLAG_12_13 = 1;
114
+ } else if( (IMC_IDRAC_13G_MONOLITHIC == data[10])
115
+ || (IMC_IDRAC_13G_MODULAR == data[10])
116
+ || (IMC_IDRAC_13G_DCS == data[10]) ) {
117
+ iDRAC_FLAG=IDRAC_13G;
118
+ iDRAC_FLAG_ALL = 1;
119
+ iDRAC_FLAG_12_13 = 1;
122
+ iDRAC_FLAG_ALL = 0;
123
+ iDRAC_FLAG_12_13 = 0;
127
@@ -1394,7 +1420,7 @@
131
-"iDRAC 11g or iDRAC 12g:");
132
+"iDRAC 11g or iDRAC 12g or iDRAC 13g :");
134
" lcd set {mode}|{lcdqualifier}|{errordisplay}");
136
@@ -1561,7 +1587,9 @@
139
if ((IMC_IDRAC_12G_MODULAR == IMC_Type)
140
- || (IMC_IDRAC_12G_MONOLITHIC== IMC_Type)) {
141
+ || (IMC_IDRAC_12G_MONOLITHIC== IMC_Type)
142
+ || (IMC_IDRAC_13G_MODULAR == IMC_Type)
143
+ || (IMC_IDRAC_13G_MONOLITHIC== IMC_Type)) {
144
/* Get the Chasiss Assigned MAC Addresss for 12g Only */
145
memcpy(VirtualMacAddress, ((rsp->data) + 1), MACADDRESSLENGH);
146
for (i = 0; i < MACADDRESSLENGH; i++) {
147
@@ -1599,6 +1627,9 @@
148
} else if ((IMC_IDRAC_12G_MODULAR == IMC_Type)
149
|| (IMC_IDRAC_12G_MONOLITHIC== IMC_Type)) {
150
printf("\niDRAC7 MAC Address ");
151
+ } else if ((IMC_IDRAC_13G_MODULAR == IMC_Type)
152
+ || (IMC_IDRAC_13G_MONOLITHIC== IMC_Type)) {
153
+ printf ("\niDRAC8 MAC Address ");
154
} else if ((IMC_MASER_LITE_BMC== IMC_Type)
155
|| (IMC_MASER_LITE_NU== IMC_Type)) {
156
printf("\nBMC MAC Address ");
157
@@ -1668,6 +1699,9 @@
158
} else if ((IMC_IDRAC_12G_MODULAR == IMC_Type)
159
|| (IMC_IDRAC_12G_MONOLITHIC== IMC_Type)) {
160
printf("\niDRAC7 MAC Address ");
161
+ } else if ((IMC_IDRAC_13G_MODULAR == IMC_Type)
162
+ || (IMC_IDRAC_13G_MONOLITHIC== IMC_Type)) {
163
+ printf ("\niDRAC8 MAC Address ");
164
} else if ((IMC_MASER_LITE_BMC== IMC_Type)
165
|| (IMC_MASER_LITE_NU== IMC_Type)) {
166
printf("\n\rBMC MAC Address ");
167
@@ -1879,6 +1913,8 @@
168
|| IMC_IDRAC_11G_MONOLITHIC == IMC_Type)
169
|| (IMC_IDRAC_12G_MODULAR == IMC_Type
170
|| IMC_IDRAC_12G_MONOLITHIC == IMC_Type)
171
+ || (IMC_IDRAC_13G_MODULAR == IMC_Type
172
+ || IMC_IDRAC_13G_MONOLITHIC == IMC_Type)
173
|| (IMC_MASER_LITE_NU == IMC_Type || IMC_MASER_LITE_BMC== IMC_Type)) {
174
return ipmi_macinfo_11g(intf,NicNum);
176
@@ -1946,7 +1982,7 @@
180
- if (iDRAC_FLAG == IDRAC_12G) {
181
+ if (iDRAC_FLAG_12_13) {
182
nic_selection = get_nic_selection_mode_12g(intf, current_arg, argv,
184
if (INVALID == nic_selection) {
185
@@ -2063,7 +2099,7 @@
187
if (argv[current_arg] != NULL
188
&& strncmp(argv[current_arg], "lom1\0", 5) == 0) {
189
- if (IMC_IDRAC_12G_MODULAR == IMC_Type) {
190
+ if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
191
return INVAILD_SHARED_MODE;
194
@@ -2082,7 +2118,7 @@
196
} else if (argv[current_arg] != NULL
197
&& strncmp(argv[current_arg], "lom2\0", 5) == 0) {
198
- if (IMC_IDRAC_12G_MODULAR == IMC_Type) {
199
+ if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
200
return INVAILD_SHARED_MODE;
203
@@ -2101,7 +2137,7 @@
205
} else if (argv[current_arg] != NULL
206
&& strncmp(argv[current_arg], "lom3\0", 5) == 0) {
207
- if (IMC_IDRAC_12G_MODULAR == IMC_Type) {
208
+ if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
209
return INVAILD_SHARED_MODE;
212
@@ -2120,7 +2156,7 @@
214
} else if (argv[current_arg] != NULL
215
&& strncmp(argv[current_arg], "lom4\0", 5) == 0) {
216
- if (IMC_IDRAC_12G_MODULAR == IMC_Type) {
217
+ if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
218
return INVAILD_SHARED_MODE;
221
@@ -2139,7 +2175,7 @@
223
} else if (failover && argv[current_arg] != NULL
224
&& strncmp(argv[current_arg], "none\0", 5) == 0) {
225
- if (IMC_IDRAC_12G_MODULAR == IMC_Type) {
226
+ if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type) ) {
227
return INVAILD_SHARED_MODE;
230
@@ -2159,7 +2195,7 @@
232
if (failover && argv[current_arg] != NULL
233
&& strncmp(argv[current_arg], "loms\0", 5) == 0) {
234
- if (IMC_IDRAC_12G_MODULAR == IMC_Type) {
235
+ if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
236
return INVAILD_SHARED_MODE;
238
if (nic_set[0] == 1) {
239
@@ -2242,7 +2278,8 @@
240
lprintf(LOG_ERR, "Error in setting nic selection");
242
} else if( (nic_selection[0] == 1)
243
- && ((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED))) {
244
+ && (( iDRAC_FLAG_12_13 )
245
+ && (rsp->ccode == LICENSE_NOT_SUPPORTED))) {
246
/* Check license only for setting the dedicated nic. */
248
"FM001 : A required license is missing or expired");
249
@@ -2297,7 +2334,7 @@
251
req.msg.netfn = DELL_OEM_NETFN;
253
- if (iDRAC_FLAG == IDRAC_12G) {
254
+ if( iDRAC_FLAG_12_13 ) {
255
req.msg.cmd = GET_NIC_SELECTION_12G_CMD;
257
req.msg.cmd = GET_NIC_SELECTION_CMD;
258
@@ -2314,7 +2351,7 @@
261
nic_selection = rsp->data[0];
262
- if (iDRAC_FLAG == IDRAC_12G) {
263
+ if( iDRAC_FLAG_12_13 ) {
264
nic_selection_failover = rsp->data[1];
265
if ((nic_selection < 6) && (nic_selection > 0)
266
&& (nic_selection_failover < 7)) {
267
@@ -2413,7 +2450,7 @@
269
" sets the NIC Selection Mode :");
272
+" on iDRAC12g OR iDRAC13g :");
274
" dedicated, shared with lom1, shared with lom2,shared with lom3,shared");
276
@@ -2433,7 +2470,7 @@
281
+" on iDRAC12g or iDRAC13g :");
283
" returns the current NIC Selection Mode (dedicated, shared with lom1, shared");
285
@@ -2662,7 +2699,7 @@
287
lprintf(LOG_ERR, "Error getting powercap status");
289
- } else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
290
+ } else if(( iDRAC_FLAG_12_13 ) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
292
"FM001 : A required license is missing or expired");
293
return -1; /* Return Error as unlicensed */
294
@@ -2713,7 +2750,7 @@
296
lprintf(LOG_ERR, "Error setting powercap status");
298
- } else if ((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
299
+ } else if ((iDRAC_FLAG_12_13) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
301
"FM001 : A required license is missing or expired");
302
return -1; /* return unlicensed Error code */
303
@@ -2807,7 +2844,7 @@
307
- if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
308
+ if((iDRAC_FLAG_12_13) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
310
"FM001 : A required license is missing or expired");
312
@@ -2910,7 +2947,7 @@
314
lprintf(LOG_ERR, "Error clearing power values.");
316
- } else if ((iDRAC_FLAG == IDRAC_12G)
317
+ } else if ((iDRAC_FLAG_12_13)
318
&& (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
320
"FM001 : A required license is missing or expired");
321
@@ -2988,7 +3025,7 @@
323
lprintf(LOG_ERR, "Error getting power headroom status");
325
- } else if ((iDRAC_FLAG == IDRAC_12G)
326
+ } else if ((iDRAC_FLAG_12_13)
327
&& (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
329
"FM001 : A required license is missing or expired");
330
@@ -3122,7 +3159,7 @@
332
lprintf(LOG_ERR, "Error getting instantaneous power consumption data .");
334
- } else if ((iDRAC_FLAG == IDRAC_12G)
335
+ } else if ((iDRAC_FLAG_12_13)
336
&& (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
338
"FM001 : A required license is missing or expired");
339
@@ -3215,7 +3252,7 @@
341
"Error getting average power consumption history data.");
343
- } else if ((iDRAC_FLAG == IDRAC_12G) && (rc == LICENSE_NOT_SUPPORTED)) {
344
+ } else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) {
346
"FM001 : A required license is missing or expired");
348
@@ -3264,7 +3301,7 @@
350
lprintf(LOG_ERR, "Error getting peak power consumption history data.");
352
- } else if ((iDRAC_FLAG == IDRAC_12G) && (rc == LICENSE_NOT_SUPPORTED)) {
353
+ } else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) {
355
"FM001 : A required license is missing or expired");
357
@@ -3321,7 +3358,7 @@
359
lprintf(LOG_ERR, "Error getting peak power consumption history data .");
361
- } else if ((iDRAC_FLAG == IDRAC_12G) && (rc == LICENSE_NOT_SUPPORTED)) {
362
+ } else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) {
364
"FM001 : A required license is missing or expired");
366
@@ -3518,7 +3555,7 @@
368
lprintf(LOG_ERR, "Error getting power cap.");
370
- } else if ((iDRAC_FLAG == IDRAC_12G) && (rc == LICENSE_NOT_SUPPORTED)) {
371
+ } else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) {
373
"FM001 : A required license is missing or expired");
375
@@ -3618,7 +3655,7 @@
377
lprintf(LOG_ERR, "Error getting power cap.");
379
- } else if ((iDRAC_FLAG == IDRAC_12G) && (rc == LICENSE_NOT_SUPPORTED)) {
380
+ } else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) {
382
"FM001 : A required license is missing or expired");
384
@@ -3698,7 +3735,7 @@
386
lprintf(LOG_ERR, "Error setting power cap");
388
- } else if ((iDRAC_FLAG == IDRAC_12G) && (rc == LICENSE_NOT_SUPPORTED)) {
389
+ } else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) {
391
"FM001 : A required license is missing or expired");
393
@@ -3860,7 +3897,7 @@
395
sdcardinfoblock = (IPMI_DELL_SDCARD_INFO *) (void *) rsp->data;
397
- if ((iDRAC_FLAG == IDRAC_12G)
398
+ if ((iDRAC_FLAG_12_13)
399
&& (sdcardinfoblock->vflashcompcode == VFL_NOT_LICENSED)) {
401
"FM001 : A required license is missing or expired");